hexsha stringlengths 40 40 | size int64 5 2.72M | ext stringclasses 5
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 976 | max_stars_repo_name stringlengths 5 113 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringdate 2015-01-01 00:01:43 2022-03-31 23:59:48 ⌀ | max_stars_repo_stars_event_max_datetime stringdate 2015-01-01 00:06:24 2022-03-31 23:59:53 ⌀ | max_issues_repo_path stringlengths 3 976 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count float64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 976 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringdate 2015-01-01 00:01:19 2022-03-31 23:59:49 ⌀ | max_forks_repo_forks_event_max_datetime stringdate 2015-01-03 12:00:57 2022-03-31 23:59:49 ⌀ | content stringlengths 5 2.72M | avg_line_length float64 1.38 573k | max_line_length int64 2 1.01M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d6cf0469509e3846ce164507029a93521b128ae4 | 539 | h | C | Agora-Live-Shop-Windows/AdvertiseVideoSource/AgoraCameraManager.h | AgoraIO-Usecase/Live-Shop | 75b27587d282ad99f3d072e2ec7a2569705083a8 | [
"MIT"
] | 3 | 2019-01-10T06:47:25.000Z | 2021-02-05T06:27:16.000Z | Agora-Live-Shop-Windows/AdvertiseVideoSource/AgoraCameraManager.h | AgoraIO/Live-Shop-Use-Case | 75b27587d282ad99f3d072e2ec7a2569705083a8 | [
"MIT"
] | 2 | 2018-11-04T13:11:49.000Z | 2018-11-05T06:19:11.000Z | Agora-Live-Shop-Windows/AdvertiseVideoSource/AgoraCameraManager.h | AgoraIO/Live-Shop-Use-Case | 75b27587d282ad99f3d072e2ec7a2569705083a8 | [
"MIT"
] | 6 | 2019-03-27T06:13:46.000Z | 2021-09-08T14:09:44.000Z | #pragma once
#include "IAgoraRtcEngine.h"
class CAgoraCameraManager
{
public:
CAgoraCameraManager();
~CAgoraCameraManager();
BOOL Create(agora::rtc::IRtcEngine *lpRtcEngine);
void Close();
UINT GetDeviceCount();
std::string GetCurDeviceID();
BOOL SetCurDevice(const char*);
void TestCameraDevice(HWND hVideoWnd, BOOL bTestOn = TRUE);
BOOL IsTesting() { return m_bTestingOn; };
private:
agora::rtc::AVideoDeviceManager *m_ptrDeviceManager;
agora::rtc::IVideoDeviceCollection *m_lpCollection;
BOOL m_bTestingOn;
};
| 20.730769 | 60 | 0.753247 |
d6cf5b3ae1dc5d194cc0a4fee43875f7afe58f11 | 530 | h | C | main/include/framework/Animation.h | wonderhorn/mkfj | 18d2dd290811662d87abefe2fe2e338ba9caf8a5 | [
"MIT"
] | null | null | null | main/include/framework/Animation.h | wonderhorn/mkfj | 18d2dd290811662d87abefe2fe2e338ba9caf8a5 | [
"MIT"
] | null | null | null | main/include/framework/Animation.h | wonderhorn/mkfj | 18d2dd290811662d87abefe2fe2e338ba9caf8a5 | [
"MIT"
] | null | null | null | #pragma once
#include"jumpnrun/spell/Spell.h"
namespace jnr
{
class Animation
{
public:
Animation();
void reset(int refx, int refy, int interval
, int num_frame, int w, int h, int last_frame_time = 0, int num_iteration = 1);
int refx, refy, interval, num_frame, w, h, last_frame_time, num_iteration;
bool finished;
int counter;
jnr::spl::eSpell spell;
int spell_time;
int RefX();
int Frame();
int Duration();
int RefY();
void Advance();
void setSpell(jnr::spl::eSpell spell, int spell_time);
};
}; | 23.043478 | 82 | 0.684906 |
d6cf85c0189fe2aaf3c98287f2a19e091ba1cd0c | 32,226 | c | C | freebsd4/sys/dev/nsp/nsp.c | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 91 | 2015-01-05T15:18:31.000Z | 2022-03-11T16:43:28.000Z | freebsd4/sys/dev/nsp/nsp.c | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 1 | 2016-02-25T15:57:55.000Z | 2016-02-25T16:01:02.000Z | freebsd4/sys/dev/nsp/nsp.c | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 21 | 2015-02-07T08:23:07.000Z | 2021-12-14T06:01:49.000Z | /* $FreeBSD: src/sys/dev/nsp/nsp.c,v 1.1.2.1 2000/10/29 11:05:43 non Exp $ */
/* $NecBSD: nsp.c,v 1.21 1999/07/23 21:00:05 honda Exp $ */
/* $NetBSD$ */
#define NSP_DEBUG
#define NSP_STATICS
/*
* Copyright (c) 1998
* NetBSD/pc98 porting staff. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/disklabel.h>
#if defined(__FreeBSD__) && __FreeBSD_version > 500001
#include <sys/bio.h>
#endif
#include <sys/buf.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/device_port.h>
#include <sys/errno.h>
#include <vm/vm.h>
#ifdef __NetBSD__
#include <machine/bus.h>
#include <machine/intr.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
#include <dev/scsipi/scsi_disk.h>
#include <machine/dvcfg.h>
#include <machine/physio_proc.h>
#include <i386/Cbus/dev/scsi_low.h>
#include <i386/Cbus/dev/nspreg.h>
#include <i386/Cbus/dev/nspvar.h>
#endif /* __NetBSD__ */
#ifdef __FreeBSD__
#include <machine/clock.h>
#define delay(time) DELAY(time)
#include <machine/cpu.h>
#include <machine/bus_pio.h>
#include <machine/bus_memio.h>
#include <machine/bus.h>
#include <machine/dvcfg.h>
#include <machine/physio_proc.h>
#include <cam/scsi/scsi_low.h>
#include <dev/nsp/nspreg.h>
#include <dev/nsp/nspvar.h>
#if __FreeBSD_version < 400001
#include "nsp.h"
struct nsp_softc *nspdata[NNSP];
#endif
#endif /* __FreeBSD__ */
/***************************************************
* USER SETTINGS
***************************************************/
/* DEVICE CONFIGURATION FLAGS (MINOR)
*
* 0x01 DISCONECT OFF
* 0x02 PARITY LINE OFF
* 0x04 IDENTIFY MSG OFF ( = single lun)
* 0x08 SYNC TRANSFER OFF
*/
/***************************************************
* PARAMS
***************************************************/
#define NSP_NTARGETS 8
#define NSP_NLUNS 8
#define NSP_SELTIMEOUT 200
/***************************************************
* DEBUG
***************************************************/
#ifndef DDB
#define Debugger() panic("should call debugger here (nsp.c)")
#else /* ! DDB */
#ifdef __FreeBSD__
#define Debugger() Debugger("nsp")
#endif /* __FreeBSD__ */
#endif
#ifdef NSP_DEBUG
int nsp_debug;
#endif /* NSP_DEBUG */
#ifdef NSP_STATICS
struct nsp_statics {
int disconnect;
int reselect;
int data_phase_bypass;
} nsp_statics[NSP_NTARGETS];
#endif /* NSP_STATICS */
/***************************************************
* ISA DEVICE STRUCTURE
***************************************************/
extern struct cfdriver nsp_cd;
/**************************************************************
* DECLARE
**************************************************************/
/* static */
static void nsp_pio_read __P((struct nsp_softc *, struct targ_info *));
static void nsp_pio_write __P((struct nsp_softc *, struct targ_info *));
static int nsp_xfer __P((struct nsp_softc *, u_int8_t *, int, int));
static int nsp_msg __P((struct nsp_softc *, struct targ_info *, u_int));
static int nsp_reselected __P((struct nsp_softc *));
static __inline int nsp_disconnected __P((struct nsp_softc *, struct targ_info *));
static __inline void nsp_pdma_end __P((struct nsp_softc *, struct targ_info *));
static void nsphw_init __P((struct nsp_softc *));
static int nsp_nexus __P((struct nsp_softc *, struct targ_info *));
static int nsp_world_start __P((struct nsp_softc *, int));
static int nsphw_start_selection __P((struct nsp_softc *sc, struct slccb *));
static void nsphw_bus_reset __P((struct nsp_softc *));
static void nsphw_attention __P((struct nsp_softc *));
static u_int nsp_fifo_count __P((struct nsp_softc *));
static int nsp_negate_signal __P((struct nsp_softc *, u_int8_t, u_char *));
static int nsp_expect_signal __P((struct nsp_softc *, u_int8_t, u_int8_t));
static __inline void nsp_start_timer __P((struct nsp_softc *, int));
static int nsp_dataphase_bypass __P((struct nsp_softc *, struct targ_info *));
static void nsp_setup_fifo __P((struct nsp_softc *, int));
static int nsp_lun_init __P((struct nsp_softc *, struct targ_info *, struct lun_info *));
static void settimeout __P((void *));
struct scsi_low_funcs nspfuncs = {
SC_LOW_INIT_T nsp_world_start,
SC_LOW_BUSRST_T nsphw_bus_reset,
SC_LOW_LUN_INIT_T nsp_lun_init,
SC_LOW_SELECT_T nsphw_start_selection,
SC_LOW_NEXUS_T nsp_nexus,
SC_LOW_ATTEN_T nsphw_attention,
SC_LOW_MSG_T nsp_msg,
SC_LOW_POLL_T nspintr,
NULL,
};
/****************************************************
* hwfuncs
****************************************************/
static __inline u_int8_t nsp_cr_read_1 __P((bus_space_tag_t bst, bus_space_handle_t bsh, bus_addr_t ofs));
static __inline void nsp_cr_write_1 __P((bus_space_tag_t bst, bus_space_handle_t bsh, bus_addr_t ofs, u_int8_t va));
static __inline u_int8_t
nsp_cr_read_1(bst, bsh, ofs)
bus_space_tag_t bst;
bus_space_handle_t bsh;
bus_addr_t ofs;
{
bus_space_write_1(bst, bsh, nsp_idxr, ofs);
return bus_space_read_1(bst, bsh, nsp_datar);
}
static __inline void
nsp_cr_write_1(bst, bsh, ofs, va)
bus_space_tag_t bst;
bus_space_handle_t bsh;
bus_addr_t ofs;
u_int8_t va;
{
bus_space_write_1(bst, bsh, nsp_idxr, ofs);
bus_space_write_1(bst, bsh, nsp_datar, va);
}
static int
nsp_expect_signal(sc, curphase, mask)
struct nsp_softc *sc;
u_int8_t curphase, mask;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
int rv = -1;
int s;
int tout = 0;
#ifdef __FreeBSD__
struct callout_handle ch;
#endif
u_int8_t ph, isrc;
#ifdef __FreeBSD__
ch = timeout(settimeout, &tout, hz/2);
#else
timeout(settimeout, &tout, hz/2);
#endif
do
{
ph = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON);
if (ph == 0xff) {
rv = -1;
break;
}
isrc = bus_space_read_1(bst, bsh, nsp_irqsr);
if (isrc & IRQSR_SCSI) {
rv = 0;
break;
}
if ((ph & mask) != 0 && (ph & SCBUSMON_PHMASK) == curphase) {
rv = 1;
break;
}
}
while (tout == 0);
s = splhigh();
if (tout == 0) {
#ifdef __FreeBSD__
untimeout(settimeout, &tout, ch);
#else
untimeout(settimeout, &tout);
#endif
splx(s);
} else {
splx(s);
printf("%s: nsp_expect_signal timeout\n", slp->sl_xname);
rv = -1;
}
return rv;
}
static void
nsphw_init(sc)
struct nsp_softc *sc;
{
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
/* block all interrupts */
bus_space_write_1(bst, bsh, nsp_irqcr, IRQCR_ALLMASK);
/* setup SCSI interface */
bus_space_write_1(bst, bsh, nsp_ifselr, IFSELR_IFSEL);
nsp_cr_write_1(bst, bsh, NSPR_SCIENR, 0);
nsp_cr_write_1(bst, bsh, NSPR_XFERMR, XFERMR_IO8);
nsp_cr_write_1(bst, bsh, NSPR_CLKDIVR, sc->sc_iclkdiv);
nsp_cr_write_1(bst, bsh, NSPR_SCIENR, sc->sc_icr);
nsp_cr_write_1(bst, bsh, NSPR_PARITYR, 0);
nsp_cr_write_1(bst, bsh, NSPR_PTCLRR,
PTCLRR_ACK | PTCLRR_REQ | PTCLRR_HOST | PTCLRR_RSS);
/* setup fifo asic */
bus_space_write_1(bst, bsh, nsp_ifselr, IFSELR_REGSEL);
nsp_cr_write_1(bst, bsh, NSPR_TERMPWRC, 0);
if ((nsp_cr_read_1(bst, bsh, NSPR_OCR) & OCR_TERMPWRS) == 0)
nsp_cr_write_1(bst, bsh, NSPR_TERMPWRC, TERMPWRC_POWON);
nsp_cr_write_1(bst, bsh, NSPR_XFERMR, XFERMR_IO8);
nsp_cr_write_1(bst, bsh, NSPR_CLKDIVR, sc->sc_clkdiv);
nsp_cr_write_1(bst, bsh, NSPR_TIMERCNT, 0);
nsp_cr_write_1(bst, bsh, NSPR_TIMERCNT, 0);
nsp_cr_write_1(bst, bsh, NSPR_SYNCR, 0);
nsp_cr_write_1(bst, bsh, NSPR_ACKWIDTH, 0);
/* enable interrupts and ack them */
nsp_cr_write_1(bst, bsh, NSPR_SCIENR, SCIENR_SCCHG | SCIENR_RESEL | SCIENR_RST);
bus_space_write_1(bst, bsh, nsp_irqcr, IRQSR_MASK);
nsp_setup_fifo(sc, 0);
}
/****************************************************
* scsi low interface
****************************************************/
static void
nsphw_attention(sc)
struct nsp_softc *sc;
{
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
u_int8_t cr;
cr = nsp_cr_read_1(bst, bsh, NSPR_SCBUSCR)/* & ~SCBUSCR_ACK */;
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, cr | SCBUSCR_ATN);
}
static void
nsphw_bus_reset(sc)
struct nsp_softc *sc;
{
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
int i;
bus_space_write_1(bst, bsh, nsp_irqcr, IRQCR_ALLMASK);
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, SCBUSCR_RST);
delay(100 * 1000); /* 100ms */
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, 0);
for (i = 0; i < 5; i ++)
(void) nsp_cr_read_1(bst, bsh, NSPR_IRQPHS);
bus_space_write_1(bst, bsh, nsp_irqcr, IRQSR_MASK);
}
static int
nsphw_start_selection(sc, cb)
struct nsp_softc *sc;
struct slccb *cb;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
struct targ_info *ti = cb->ti;
register u_int8_t arbs, ph;
int s;
int tout = 0;
#ifdef __FreeBSD__
struct callout_handle ch;
#endif
/* check bus free */
if (slp->sl_disc > 0)
{
s = splhigh();
ph = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON);
if (ph != SCBUSMON_FREE)
{
splx(s);
return SCSI_LOW_START_FAIL;
}
splx(s);
}
/* start arbitration */
SCSI_LOW_SETUP_PHASE(ti, PH_ARBSTART);
nsp_cr_write_1(bst, bsh, NSPR_ARBITS, ARBITS_EXEC);
#ifdef __FreeBSD__
ch = timeout(settimeout, &tout, 2 * hz);
#else
timeout(settimeout, &tout, 2 * hz);
#endif
do
{
/* XXX: what a stupid chip! */
arbs = nsp_cr_read_1(bst, bsh, NSPR_ARBITS);
delay(1);
}
while ((arbs & (ARBITS_WIN | ARBITS_FAIL)) == 0 && tout == 0);
s = splhigh();
if (tout == 0) {
#ifdef __FreeBSD__
untimeout(settimeout, &tout, ch);
#else
untimeout(settimeout, &tout);
#endif
}
splx(s);
if ((arbs & ARBITS_WIN) == 0)
{
nsp_cr_write_1(bst, bsh, NSPR_ARBITS, ARBITS_CLR);
return SCSI_LOW_START_FAIL;
}
/* assert select line */
SCSI_LOW_SETUP_PHASE(ti, PH_SELSTART);
scsi_low_arbit_win(slp, ti);
delay(3);
nsp_cr_write_1(bst, bsh, NSPR_DATA,
sc->sc_idbit | (1 << ti->ti_id));
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR,
SCBUSCR_SEL | SCBUSCR_BSY | sc->sc_busc);
delay(3);
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, SCBUSCR_SEL |
SCBUSCR_BSY | SCBUSCR_DOUT | sc->sc_busc);
nsp_cr_write_1(bst, bsh, NSPR_ARBITS, ARBITS_CLR);
delay(3);
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR,
SCBUSCR_SEL | SCBUSCR_DOUT | sc->sc_busc);
/* check selection timeout */
nsp_start_timer(sc, 1000 / 51);
sc->sc_seltout = 1;
return SCSI_LOW_START_OK;
}
static int
nsp_world_start(sc, fdone)
struct nsp_softc *sc;
int fdone;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
intrmask_t s;
s = splcam();
sc->sc_cnt = 0;
sc->sc_seltout = 0;
if ((slp->sl_cfgflags & CFG_NOATTEN) == 0)
sc->sc_busc = SCBUSCR_ATN;
else
sc->sc_busc = 0;
sc->sc_icr = (SCIENR_SCCHG | SCIENR_RESEL | SCIENR_RST);
nsphw_init(sc);
scsi_low_bus_reset(slp);
splx(s);
SOFT_INTR_REQUIRED(slp);
return 0;
}
struct ncp_synch_data {
u_int min_period;
u_int max_period;
u_int chip_period;
u_int ack_width;
};
static struct ncp_synch_data ncp_sync_data_40M[] = {
{0x0c,0x0c,0x1,0}, /* 20MB 50ns*/
{0x19,0x19,0x3,1}, /* 10MB 100ns*/
{0x1a,0x25,0x5,2}, /* 7.5MB 150ns*/
{0x26,0x32,0x7,3}, /* 5MB 200ns*/
{0x0, 0, 0, 0}
};
static struct ncp_synch_data ncp_sync_data_20M[] = {
{0x19,0x19,0x1,0}, /* 10MB 100ns*/
{0x1a,0x25,0x2,0}, /* 7.5MB 150ns*/
{0x26,0x32,0x3,1}, /* 5MB 200ns*/
{0x0, 0, 0, 0}
};
static int
nsp_msg(sc, ti, msg)
struct nsp_softc *sc;
struct targ_info *ti;
u_int msg;
{
struct ncp_synch_data *sdp;
struct lun_info *li = ti->ti_li;
struct nsp_lun_info *nli = (void *) li;
u_int period, offset;
int i;
if ((msg & SCSI_LOW_MSG_SYNCH) == 0)
return 0;
period = li->li_maxsynch.period;
offset = li->li_maxsynch.offset;
if (sc->sc_iclkdiv == CLKDIVR_20M)
sdp = &ncp_sync_data_20M[0];
else
sdp = &ncp_sync_data_40M[0];
for (i = 0; sdp->max_period != 0; i ++, sdp ++)
{
if (period >= sdp->min_period && period <= sdp->max_period)
break;
}
if (period != 0 && sdp->max_period == 0)
{
/*
* NO proper period/offset found,
* Retry neg with the target.
*/
li->li_maxsynch.period = 0;
li->li_maxsynch.offset = 0;
nli->nli_reg_syncr = 0;
nli->nli_reg_ackwidth = 0;
return EINVAL;
}
nli->nli_reg_syncr = (sdp->chip_period << SYNCR_PERS) |
(offset & SYNCR_OFFM);
nli->nli_reg_ackwidth = sdp->ack_width;
return 0;
}
static int
nsp_lun_init(sc, ti, li)
struct nsp_softc *sc;
struct targ_info *ti;
struct lun_info *li;
{
struct nsp_lun_info *nli = (void *) li;
li->li_maxsynch.period = 200 / 4;
li->li_maxsynch.offset = 15;
nli->nli_reg_syncr = 0;
nli->nli_reg_ackwidth = 0;
return 0;
}
static __inline void
nsp_start_timer(sc, time)
struct nsp_softc *sc;
int time;
{
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
sc->sc_timer = time;
nsp_cr_write_1(bst, bsh, NSPR_TIMERCNT, time);
}
/**************************************************************
* General probe attach
**************************************************************/
int
nspprobesubr(iot, ioh, dvcfg)
bus_space_tag_t iot;
bus_space_handle_t ioh;
u_int dvcfg;
{
u_int8_t regv;
regv = bus_space_read_1(iot, ioh, nsp_fifosr);
if (regv < 0x11 || regv >= 0x20)
return 0;
return 1;
}
int
nspprint(aux, name)
void *aux;
const char *name;
{
if (name != NULL)
printf("%s: scsibus ", name);
return UNCONF;
}
void
nspattachsubr(sc)
struct nsp_softc *sc;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
printf("\n");
sc->sc_idbit = (1 << slp->sl_hostid);
slp->sl_funcs = &nspfuncs;
if (sc->sc_memh != NULL)
sc->sc_xmode = NSP_MID_SMIT;
else
sc->sc_xmode = NSP_PIO;
(void) scsi_low_attach(slp, 2, NSP_NTARGETS, NSP_NLUNS,
sizeof(struct nsp_lun_info));
}
/**************************************************************
* PDMA functions
**************************************************************/
static u_int
nsp_fifo_count(sc)
struct nsp_softc *sc;
{
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
u_int count;
nsp_cr_write_1(bst, bsh, NSPR_PTCLRR, PTCLRR_PT);
count = bus_space_read_1(bst, bsh, nsp_datar);
count += (((u_int) bus_space_read_1(bst, bsh, nsp_datar)) << 8);
count += (((u_int) bus_space_read_1(bst, bsh, nsp_datar)) << 16);
return count;
}
static void
nsp_setup_fifo(sc, on)
struct nsp_softc *sc;
int on;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
u_int8_t xfermode;
if (on != 0)
xfermode = XFERMR_XEN | XFERMR_FIFOEN;
else
xfermode = 0;
if ((slp->sl_scp.scp_datalen % DEV_BSIZE) != 0)
{
sc->sc_mask = 0;
xfermode |= XFERMR_IO8;
}
else
{
sc->sc_mask = 3;
if (sc->sc_xmode == NSP_MID_SMIT)
xfermode |= XFERMR_MEM32;
else
xfermode |= XFERMR_IO32;
}
sc->sc_xfermr = xfermode;
nsp_cr_write_1(bst, bsh, NSPR_XFERMR, sc->sc_xfermr);
}
static __inline void
nsp_pdma_end(sc, ti)
struct nsp_softc *sc;
struct targ_info *ti;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
struct slccb *cb = ti->ti_nexus;
u_int len = 0, cnt;
slp->sl_flags &= ~HW_PDMASTART;
nsp_setup_fifo(sc, 0);
if (ti->ti_phase == PH_DATA)
{
cnt = nsp_fifo_count(sc);
if (slp->sl_scp.scp_direction == SCSI_LOW_WRITE)
{
len = sc->sc_cnt - cnt;
if (slp->sl_scp.scp_datalen + len <=
cb->ccb_scp.scp_datalen)
{
slp->sl_scp.scp_data -= len;
slp->sl_scp.scp_datalen += len;
}
else
{
slp->sl_error |= PDMAERR;
printf("%s len %x >= datalen %x\n",
slp->sl_xname,
len, slp->sl_scp.scp_datalen);
}
}
else if (slp->sl_scp.scp_direction == SCSI_LOW_READ)
{
if (sc->sc_cnt != cnt)
{
slp->sl_error |= PDMAERR;
printf("%s: data read count error %x != %x\n",
slp->sl_xname, sc->sc_cnt, cnt);
}
}
sc->sc_cnt = cnt;
}
else
{
printf("%s data phase miss\n", slp->sl_xname);
slp->sl_error |= PDMAERR;
}
}
#define RFIFO_CRIT 64
#define WFIFO_CRIT 64
static void
nsp_pio_read(sc, ti)
struct nsp_softc *sc;
struct targ_info *ti;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
int s;
int tout = 0;
#ifdef __FreeBSD__
struct callout_handle ch;
#endif
u_int res, ocount, mask = sc->sc_mask;
u_int8_t stat, fstat;
slp->sl_flags |= HW_PDMASTART;
ocount = sc->sc_cnt;
#ifdef __FreeBSD__
ch = timeout(settimeout, &tout, 2 * hz);
#else
timeout(settimeout, &tout, 2 * hz);
#endif
while (slp->sl_scp.scp_datalen > 0 && tout == 0)
{
stat = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON);
stat &= SCBUSMON_PHMASK;
res = nsp_fifo_count(sc) - ocount;
if (res == 0)
{
if (stat == PHASE_DATAIN)
continue;
break;
}
fstat = bus_space_read_1(bst, bsh, nsp_fifosr);
if ((fstat & FIFOSR_FULLEMP) == 0 && stat == PHASE_DATAIN)
continue;
if (res > slp->sl_scp.scp_datalen)
break;
if (res >= NSP_BUFFER_SIZE)
res = NSP_BUFFER_SIZE;
else
res &= ~mask;
if (sc->sc_xfermr & XFERMR_MEM32)
{
bus_space_read_region_4(sc->sc_memt,
sc->sc_memh,
0,
(u_int32_t *) slp->sl_scp.scp_data,
res >> 2);
}
else
{
if (mask != 0)
bus_space_read_multi_4(bst, bsh, nsp_fifodr,
(u_int32_t *) slp->sl_scp.scp_data,
res >> 2);
else
bus_space_read_multi_1(bst, bsh, nsp_fifodr,
(u_int8_t *) slp->sl_scp.scp_data,
res);
}
slp->sl_scp.scp_data += res;
slp->sl_scp.scp_datalen -= res;
ocount += res;
}
sc->sc_cnt = ocount;
s = splhigh();
if (tout == 0) {
#ifdef __FreeBSD__
untimeout(settimeout, &tout, ch);
#else
untimeout(settimeout, &tout);
#endif
splx(s);
} else {
splx(s);
printf("%s pio read timeout\n", slp->sl_xname);
}
}
static void
nsp_pio_write(sc, ti)
struct nsp_softc *sc;
struct targ_info *ti;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
u_int res, ocount, mask = sc->sc_mask;
int s;
int tout = 0;
register u_int8_t stat;
#ifdef __FreeBSD__
struct callout_handle ch;
#endif
ocount = sc->sc_cnt;
slp->sl_flags |= HW_PDMASTART;
#ifdef __FreeBSD__
ch = timeout(settimeout, &tout, 2 * hz);
#else
timeout(settimeout, &tout, 2 * hz);
#endif
while (slp->sl_scp.scp_datalen > 0 && tout == 0)
{
stat = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON);
stat &= SCBUSMON_PHMASK;
if (stat != PHASE_DATAOUT)
break;
res = ocount - nsp_fifo_count(sc);
if (res > 0)
continue;
res = (slp->sl_scp.scp_datalen > WFIFO_CRIT) ? WFIFO_CRIT :
slp->sl_scp.scp_datalen;
if (sc->sc_xfermr & XFERMR_MEM32)
{
bus_space_write_region_4(sc->sc_memt,
sc->sc_memh,
0,
(u_int32_t *) slp->sl_scp.scp_data,
res >> 2);
}
else
{
if (mask != 0)
bus_space_write_multi_4(bst, bsh, nsp_fifodr,
(u_int32_t *) slp->sl_scp.scp_data, res >> 2);
else
bus_space_write_multi_1(bst, bsh, nsp_fifodr,
(u_int8_t *) slp->sl_scp.scp_data, res);
}
slp->sl_scp.scp_datalen -= res;
slp->sl_scp.scp_data += res;
ocount += res;
}
sc->sc_cnt = ocount;
s = splhigh();
if (tout == 0) {
#ifdef __FreeBSD__
untimeout(settimeout, &tout, ch);
#else
untimeout(settimeout, &tout);
#endif
splx(s);
} else {
splx(s);
printf("%s pio write timeout\n", slp->sl_xname);
}
}
static void
settimeout(arg)
void *arg;
{
int *tout = arg;
*tout = 1;
}
static int
nsp_negate_signal(sc, mask, s)
struct nsp_softc *sc;
u_int8_t mask;
u_char *s;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
int tout = 0;
int s;
#ifdef __FreeBSD__
struct callout_handle ch;
#endif
u_int8_t regv;
#ifdef __FreeBSD__
ch = timeout(settimeout, &tout, hz/2);
#else
timeout(settimeout, &tout, hz/2);
#endif
do
{
regv = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON);
if (regv == 0xff)
break;
}
while ((regv & mask) != 0 && tout == 0);
s = splhigh();
if (tout == 0) {
#ifdef __FreeBSD__
untimeout(settimeout, &tout, ch);
#else
untimeout(settimeout, &tout);
#endif
splx(s);
} else {
splx(s);
printf("%s: %s singla off timeout \n", slp->sl_xname, s);
}
return 0;
}
static int
nsp_xfer(sc, buf, len, phase)
struct nsp_softc *sc;
u_int8_t *buf;
int len;
int phase;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
int ptr, rv, atn;
atn = (scsi_low_is_msgout_continue(slp->sl_nexus) != 0);
for (ptr = 0; len > 0; len --, ptr ++)
{
rv = nsp_expect_signal(sc, phase, SCBUSMON_REQ);
if (rv <= 0)
goto out;
if (len == 1 && atn == 0)
{
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR,
SCBUSCR_ADIR | SCBUSCR_ACKEN);
}
if (phase & SCBUSMON_IO)
{
buf[ptr] = nsp_cr_read_1(bst, bsh, NSPR_DATAACK);
}
else
{
nsp_cr_write_1(bst, bsh, NSPR_DATAACK, buf[ptr]);
}
nsp_negate_signal(sc, SCBUSMON_ACK, "xfer<ACK>");
}
out:
return len;
}
static int
nsp_dataphase_bypass(sc, ti)
struct nsp_softc *sc;
struct targ_info *ti;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
struct slccb *cb = ti->ti_nexus;
u_int cnt;
if (slp->sl_scp.scp_direction != SCSI_LOW_READ ||
(slp->sl_scp.scp_datalen % DEV_BSIZE) == 0)
return 0;
cnt = nsp_fifo_count(sc);
if (sc->sc_cnt == cnt)
return 0;
if (cnt >= DEV_BSIZE)
return EINVAL;
if (cb == NULL)
return 0;
/*
* XXX: NSP_QUIRK
* Data phase skip only occures in case of SCSI_LOW_READ.
*/
SCSI_LOW_SETUP_PHASE(ti, PH_DATA);
nsp_pio_read(sc, ti);
nsp_pdma_end(sc, ti);
#ifdef NSP_STATICS
nsp_statics[ti->ti_id].data_phase_bypass ++;
#endif /* NSP_STATICS */
return 0;
}
/**************************************************************
* disconnect & reselect (HW low)
**************************************************************/
static int
nsp_reselected(sc)
struct nsp_softc *sc;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
struct targ_info *ti;
u_int sid;
u_int8_t cr;
sid = (u_int) nsp_cr_read_1(bst, bsh, NSPR_RESELR);
sid &= ~sc->sc_idbit;
sid = ffs(sid) - 1;
if ((ti = scsi_low_reselected(slp, sid)) == NULL)
return EJUSTRETURN;
nsp_negate_signal(sc, SCBUSMON_SEL, "reselect<SEL>");
cr = nsp_cr_read_1(bst, bsh, NSPR_SCBUSCR) & ~(SCBUSCR_BSY | SCBUSCR_ATN);
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, cr);
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, cr | SCBUSCR_ADIR | SCBUSCR_ACKEN);
#ifdef NSP_STATICS
nsp_statics[sid].reselect ++;
#endif /* NSP_STATCIS */
return EJUSTRETURN;
}
static __inline int
nsp_disconnected(sc, ti)
struct nsp_softc *sc;
struct targ_info *ti;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
#ifdef NSP_STATICS
if (slp->sl_msgphase == MSGPH_DISC)
nsp_statics[ti->ti_id].disconnect ++;
#endif /* NSP_STATICS */
scsi_low_disconnected(slp, ti);
return 1;
}
/**************************************************************
* SEQUENCER
**************************************************************/
static void nspmsg __P((struct nsp_softc *, u_char *, u_int8_t, u_int8_t, u_int8_t));
static void
nspmsg(sc, s, isrc, ph, irqphs)
struct nsp_softc *sc;
u_char *s;
u_int8_t isrc, ph, irqphs;
{
struct scsi_low_softc *slp = &sc->sc_sclow;
printf("%s: %s\n", slp->sl_xname, s);
printf("%s: isrc 0x%x scmon 0x%x irqphs 0x%x\n",
slp->sl_xname, (u_int) isrc, (u_int) ph, (u_int) irqphs);
}
static int
nsp_nexus(sc, ti)
struct nsp_softc *sc;
struct targ_info *ti;
{
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
struct nsp_lun_info *nli = (void *) ti->ti_li;
/* setup synch transfer registers */
nsp_cr_write_1(bst, bsh, NSPR_SYNCR, nli->nli_reg_syncr);
nsp_cr_write_1(bst, bsh, NSPR_ACKWIDTH, nli->nli_reg_ackwidth);
/* setup pdma fifo */
nsp_setup_fifo(sc, 1);
/* clear ack counter */
sc->sc_cnt = 0;
nsp_cr_write_1(bst, bsh, NSPR_PTCLRR, PTCLRR_PT | PTCLRR_ACK |
PTCLRR_REQ | PTCLRR_HOST);
return 0;
}
int
nspintr(arg)
void *arg;
{
struct nsp_softc *sc = arg;
struct scsi_low_softc *slp = &sc->sc_sclow;
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
struct targ_info *ti;
struct physio_proc *pp;
struct buf *bp;
int len, rv;
u_int8_t isrc, ph, irqphs, cr, regv;
/*******************************************
* interrupt check
*******************************************/
if (slp->sl_flags & HW_INACTIVE)
return 0;
bus_space_write_1(bst, bsh, nsp_irqcr, IRQCR_IRQDIS);
isrc = bus_space_read_1(bst, bsh, nsp_irqsr);
if (isrc == 0xff || (isrc & IRQSR_MASK) == 0)
{
bus_space_write_1(bst, bsh, nsp_irqcr, 0);
return 0;
}
/* XXX: IMPORTANT
* Do not read an irqphs register if no scsi phase interrupt.
* Unless, you should lose a scsi phase interrupt.
*/
ph = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON);
if ((isrc & IRQSR_SCSI) != 0)
{
irqphs = nsp_cr_read_1(bst, bsh, NSPR_IRQPHS);
}
else
irqphs = 0;
/*
* timer interrupt handler (scsi vs timer interrupts)
*/
if (sc->sc_timer != 0)
{
nsp_cr_write_1(bst, bsh, NSPR_TIMERCNT, 0);
nsp_cr_write_1(bst, bsh, NSPR_TIMERCNT, 0);
sc->sc_timer = 0;
}
if ((isrc & IRQSR_MASK) == IRQSR_TIMER && sc->sc_seltout == 0)
{
bus_space_write_1(bst, bsh, nsp_irqcr, IRQCR_TIMERCL);
return 1;
}
bus_space_write_1(bst, bsh, nsp_irqcr, IRQCR_TIMERCL | IRQCR_FIFOCL);
/*******************************************
* debug section
*******************************************/
#ifdef NSP_DEBUG
if (nsp_debug)
{
nspmsg(sc, "current status", isrc, ph, irqphs);
scsi_low_print(slp, NULL);
if (nsp_debug > 1)
Debugger();
}
#endif /* NSP_DEBUG */
/*******************************************
* Parse hardware SCSI irq reasons register
*******************************************/
if ((isrc & IRQSR_SCSI) != 0)
{
if ((irqphs & IRQPHS_RST) != 0)
{
scsi_low_restart(slp, SCSI_LOW_RESTART_SOFT,
"bus reset (power off?)");
return 1;
}
if ((irqphs & IRQPHS_RSEL) != 0)
{
bus_space_write_1(bst, bsh, nsp_irqcr, IRQCR_RESCL);
if (nsp_reselected(sc) == EJUSTRETURN)
return 1;
}
if ((irqphs & (IRQPHS_PCHG | IRQPHS_LBF)) == 0)
return 1;
}
/*******************************************
* nexus check
*******************************************/
if ((ti = slp->sl_nexus) == NULL)
{
/* unknown scsi phase changes */
nspmsg(sc, "unknown scsi phase changes", isrc, ph, irqphs);
return 0;
}
/*******************************************
* aribitration & selection
*******************************************/
switch (ti->ti_phase)
{
case PH_SELSTART:
if ((ph & SCBUSMON_BSY) == 0)
{
if (sc->sc_seltout >= NSP_SELTIMEOUT)
{
sc->sc_seltout = 0;
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, 0);
return nsp_disconnected(sc, ti);
}
sc->sc_seltout ++;
nsp_start_timer(sc, 1000 / 51);
return 1;
}
/* attention assert */
sc->sc_seltout = 0;
SCSI_LOW_SETUP_PHASE(ti, PH_SELECTED);
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, sc->sc_busc);
delay(1);
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR,
sc->sc_busc | SCBUSCR_ADIR | SCBUSCR_ACKEN);
SCSI_LOW_TARGET_ASSERT_ATN(ti);
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_IDENTIFY, 0);
return 1;
case PH_RESEL:
if ((ph & SCBUSMON_PHMASK) != PHASE_MSGIN)
{
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_ABORT, 1);
return 1;
}
/* fall */
default:
if ((isrc & (IRQSR_SCSI | IRQSR_FIFO)) == 0)
return 1;
break;
}
/*******************************************
* scsi seq
*******************************************/
if (slp->sl_flags & HW_PDMASTART)
nsp_pdma_end(sc, ti);
/* normal disconnect */
if (slp->sl_msgphase != 0 && (irqphs & IRQPHS_LBF) != 0)
return nsp_disconnected(sc, ti);
/* check unexpected bus free state */
if (ph == 0)
{
nspmsg(sc, "unexpected bus free", isrc, ph, irqphs);
return nsp_disconnected(sc, ti);
}
/* check normal scsi phase */
switch (ph & SCBUSMON_PHMASK)
{
case PHASE_CMD:
if ((ph & SCBUSMON_REQ) == 0)
return 1;
SCSI_LOW_SETUP_PHASE(ti, PH_CMD);
if (scsi_low_cmd(slp, ti) != 0)
break;
nsp_cr_write_1(bst, bsh, NSPR_CMDCR, CMDCR_PTCLR);
for (len = 0; len < slp->sl_scp.scp_cmdlen; len ++)
nsp_cr_write_1(bst, bsh, NSPR_CMDDR,
slp->sl_scp.scp_cmd[len]);
nsp_cr_write_1(bst, bsh, NSPR_CMDCR, CMDCR_PTCLR | CMDCR_EXEC);
break;
case PHASE_DATAOUT:
SCSI_LOW_SETUP_PHASE(ti, PH_DATA);
if (scsi_low_data(slp, ti, &bp, SCSI_LOW_WRITE) != 0)
break;
pp = physio_proc_enter(bp);
nsp_pio_write(sc, ti);
physio_proc_leave(pp);
break;
case PHASE_DATAIN:
SCSI_LOW_SETUP_PHASE(ti, PH_DATA);
if (scsi_low_data(slp, ti, &bp, SCSI_LOW_READ) != 0)
break;
pp = physio_proc_enter(bp);
nsp_pio_read(sc, ti);
physio_proc_leave(pp);
break;
case PHASE_STATUS:
nsp_dataphase_bypass(sc, ti);
if ((ph & SCBUSMON_REQ) == 0)
return 1;
SCSI_LOW_SETUP_PHASE(ti, PH_STAT);
ti->ti_status = nsp_cr_read_1(bst, bsh, NSPR_DATAACK);
break;
case PHASE_MSGOUT:
if ((ph & SCBUSMON_REQ) == 0)
goto timerout;
/*
* XXX: NSP QUIRK
* NSP invoke interrupts only in the case of scsi phase changes,
* therefore we should poll the scsi phase here to catch
* the next "msg out" if exists (no scsi phase changes).
*/
rv = len = 16;
do {
SCSI_LOW_SETUP_PHASE(ti, PH_MSGOUT);
len = scsi_low_msgout(slp, ti);
if (nsp_xfer(sc, ti->ti_msgoutstr, len, PHASE_MSGOUT))
{
scsi_low_assert_msg(slp, ti,
SCSI_LOW_MSG_RESET, 0);
nspmsg(sc, "MSGOUT: xfer short",
isrc, ph, irqphs);
}
/* catch a next signal */
rv = nsp_expect_signal(sc, PHASE_MSGOUT, SCBUSMON_REQ);
}
while (rv > 0 && len -- > 0);
break;
case PHASE_MSGIN:
nsp_dataphase_bypass(sc, ti);
if ((ph & SCBUSMON_REQ) == 0)
goto timerout;
SCSI_LOW_SETUP_PHASE(ti, PH_MSGIN);
/*
* XXX: NSP QUIRK
* NSP invoke interrupts only in the case of scsi phase changes,
* therefore we should poll the scsi phase here to catch
* the next "msg in" if exists (no scsi phase changes).
*/
rv = len = 16;
do {
/* read a data */
regv = nsp_cr_read_1(bst, bsh, NSPR_DATA);
/* assert ack */
cr = nsp_cr_read_1(bst, bsh, NSPR_SCBUSCR);
cr |= SCBUSCR_ACK;
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, cr);
nsp_negate_signal(sc, SCBUSMON_REQ, "msgin<REQ>");
scsi_low_msgin(slp, ti, regv);
/* deassert ack */
cr = nsp_cr_read_1(bst, bsh, NSPR_SCBUSCR);
cr &= ~SCBUSCR_ACK;
nsp_cr_write_1(bst, bsh, NSPR_SCBUSCR, cr);
/* catch a next signal */
rv = nsp_expect_signal(sc, PHASE_MSGIN, SCBUSMON_REQ);
}
while (rv > 0 && len -- > 0);
break;
case PHASE_SEL:
default:
nspmsg(sc, "unknown scsi phase", isrc, ph, irqphs);
break;
}
return 1;
timerout:
nsp_start_timer(sc, 1000 / 102);
return 0;
}
| 23.454148 | 116 | 0.641935 |
d6cfb2508114efcc2e68b9d9ed02d80b058afa57 | 4,627 | h | C | vcgapps/OGF/cells/third_party/lib3ds/types.h | mattjr/structured | 0cb4635af7602f2a243a9b739e5ed757424ab2a7 | [
"Apache-2.0"
] | 14 | 2015-01-11T02:53:04.000Z | 2021-11-25T17:31:22.000Z | vcgapps/OGF/cells/third_party/lib3ds/types.h | skair39/structured | 0cb4635af7602f2a243a9b739e5ed757424ab2a7 | [
"Apache-2.0"
] | null | null | null | vcgapps/OGF/cells/third_party/lib3ds/types.h | skair39/structured | 0cb4635af7602f2a243a9b739e5ed757424ab2a7 | [
"Apache-2.0"
] | 14 | 2015-07-21T04:47:52.000Z | 2020-03-12T12:31:25.000Z | /* -*- c -*- */
#ifndef INCLUDED_LIB3DS_TYPES_H
#define INCLUDED_LIB3DS_TYPES_H
/*
* The 3D Studio File Format Library
* Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: types.h,v 1.25 2007/06/21 08:36:41 jeh Exp $
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
#ifdef _MSC_VER
#ifdef LIB3DS_EXPORTS
#define LIB3DSAPI __declspec(dllexport)
#else
#define LIB3DSAPI __declspec(dllimport)
#endif
#else
#define LIB3DSAPI
#endif
*/
/* [Bruno] we do not need exporting that, only used in cells io */
#define LIB3DSAPI
#define LIB3DS_TRUE 1
#define LIB3DS_FALSE 0
#ifdef _MSC_VER
typedef __int32 Lib3dsBool;
typedef unsigned __int8 Lib3dsByte;
typedef unsigned __int16 Lib3dsWord;
typedef unsigned __int32 Lib3dsDword;
typedef signed __int8 Lib3dsIntb;
typedef signed __int16 Lib3dsIntw;
typedef signed __int16 Lib3dsIntd;
#else
#include <stdint.h>
typedef int32_t Lib3dsBool;
typedef uint8_t Lib3dsByte;
typedef uint16_t Lib3dsWord;
typedef uint32_t Lib3dsDword;
typedef int8_t Lib3dsIntb;
typedef int16_t Lib3dsIntw;
typedef int32_t Lib3dsIntd;
#endif
typedef float Lib3dsFloat;
typedef double Lib3dsDouble;
typedef float Lib3dsVector[3];
typedef float Lib3dsTexel[2];
typedef float Lib3dsQuat[4];
typedef float Lib3dsMatrix[4][4];
typedef float Lib3dsRgb[3];
typedef float Lib3dsRgba[4];
#define LIB3DS_EPSILON (1e-8)
#define LIB3DS_PI 3.14159265358979323846
#define LIB3DS_TWOPI (2.0*LIB3DS_PI)
#define LIB3DS_HALFPI (LIB3DS_PI/2.0)
#define LIB3DS_RAD_TO_DEG(x) ((180.0/LIB3DS_PI)*(x))
#define LIB3DS_DEG_TO_RAD(x) ((LIB3DS_PI/180.0)*(x))
#include <stdio.h>
#ifdef _DEBUG
#ifndef ASSERT
#include <assert.h>
#define ASSERT(__expr) assert(__expr)
#endif
#define LIB3DS_ERROR_LOG \
{printf("\t***LIB3DS_ERROR_LOG*** %s : %d\n", __FILE__, __LINE__);}
#else
#ifndef ASSERT
#define ASSERT(__expr)
#endif
#define LIB3DS_ERROR_LOG
#endif
typedef struct Lib3dsIo Lib3dsIo;
typedef struct Lib3dsFile Lib3dsFile;
typedef struct Lib3dsBackground Lib3dsBackground;
typedef struct Lib3dsAtmosphere Lib3dsAtmosphere;
typedef struct Lib3dsShadow Lib3dsShadow;
typedef struct Lib3dsViewport Lib3dsViewport;
typedef struct Lib3dsMaterial Lib3dsMaterial;
typedef struct Lib3dsFace Lib3dsFace;
typedef struct Lib3dsBoxMap Lib3dsBoxMap;
typedef struct Lib3dsMapData Lib3dsMapData;
typedef struct Lib3dsMesh Lib3dsMesh;
typedef struct Lib3dsCamera Lib3dsCamera;
typedef struct Lib3dsLight Lib3dsLight;
typedef struct Lib3dsBoolKey Lib3dsBoolKey;
typedef struct Lib3dsBoolTrack Lib3dsBoolTrack;
typedef struct Lib3dsLin1Key Lib3dsLin1Key;
typedef struct Lib3dsLin1Track Lib3dsLin1Track;
typedef struct Lib3dsLin3Key Lib3dsLin3Key;
typedef struct Lib3dsLin3Track Lib3dsLin3Track;
typedef struct Lib3dsQuatKey Lib3dsQuatKey;
typedef struct Lib3dsQuatTrack Lib3dsQuatTrack;
typedef struct Lib3dsMorphKey Lib3dsMorphKey;
typedef struct Lib3dsMorphTrack Lib3dsMorphTrack;
typedef enum Lib3dsNodeTypes {
LIB3DS_UNKNOWN_NODE =0,
LIB3DS_AMBIENT_NODE =1,
LIB3DS_OBJECT_NODE =2,
LIB3DS_CAMERA_NODE =3,
LIB3DS_TARGET_NODE =4,
LIB3DS_LIGHT_NODE =5,
LIB3DS_SPOT_NODE =6
} Lib3dsNodeTypes;
typedef struct Lib3dsNode Lib3dsNode;
typedef enum Lib3dsObjectFlags {
LIB3DS_OBJECT_HIDDEN =0x01,
LIB3DS_OBJECT_VIS_LOFTER =0x02,
LIB3DS_OBJECT_DOESNT_CAST =0x04,
LIB3DS_OBJECT_MATTE =0x08,
LIB3DS_OBJECT_DONT_RCVSHADOW =0x10,
LIB3DS_OBJECT_FAST =0x20,
LIB3DS_OBJECT_FROZEN =0x40
} Lib3dsObjectFlags;
typedef union Lib3dsUserData {
void *p;
Lib3dsIntd i;
Lib3dsDword d;
Lib3dsFloat f;
Lib3dsMaterial *material;
Lib3dsMesh *mesh;
Lib3dsCamera *camera;
Lib3dsLight *light;
Lib3dsNode *node;
} Lib3dsUserData;
#ifdef __cplusplus
}
#endif
#endif
| 28.561728 | 79 | 0.763346 |
d6d044cea88564fd7e8ff09f8d29078dd143a164 | 2,899 | c | C | src/interface.c | mrc-ide/eigen1 | cdaa41d4dd6855dfa8cc423798896411f46c2141 | [
"MIT"
] | null | null | null | src/interface.c | mrc-ide/eigen1 | cdaa41d4dd6855dfa8cc423798896411f46c2141 | [
"MIT"
] | 3 | 2021-02-11T12:06:11.000Z | 2021-04-22T08:50:08.000Z | src/interface.c | mrc-ide/eigen1 | cdaa41d4dd6855dfa8cc423798896411f46c2141 | [
"MIT"
] | null | null | null | #define R_NO_REMAP
#define STRICT_R_HEADERS
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
#include <R_ext/Utils.h>
#include <Rversion.h>
#include "eigen1.h"
int scalar_integer(SEXP x, const char * name) {
if (Rf_length(x) != 1) {
Rf_error("Expected a length 1 vector for '%s'", name);
}
int ret = 0;
if (TYPEOF(x) == INTSXP) {
ret = INTEGER(x)[0];
} else if (TYPEOF(x) == REALSXP) {
ret = REAL(x)[0];
} else {
Rf_error("Expected an integer for '%s'", name);
}
return ret;
}
double scalar_double(SEXP x, const char * name) {
if (Rf_length(x) != 1) {
Rf_error("Expected a length 1 vector for '%s'", name);
}
double ret = 0.0;
if (TYPEOF(x) == INTSXP) {
ret = INTEGER(x)[0];
} else if (TYPEOF(x) == REALSXP) {
ret = REAL(x)[0];
} else {
Rf_error("Expected an number for '%s'", name);
}
return ret;
}
bool all_zero(const double *x, size_t len) {
for (size_t i = 0; i < len; ++i) {
if (x[i] != 0) {
return false;
}
}
return true;
}
SEXP r_eigen_power_iteration(SEXP r_m, SEXP r_max_iterations, SEXP r_tolerance,
SEXP r_initial) {
const int n = Rf_nrows(r_m);
if (Rf_ncols(r_m) != n) {
Rf_error("Expected 'm' to be square");
}
const double *m = REAL(r_m);
const int max_iterations = scalar_integer(r_max_iterations, "max_iterations");
const double tolerance = scalar_double(r_tolerance, "tolerance");
double *x = (double*)R_alloc(n, sizeof(double));
if (r_initial == R_NilValue) {
GetRNGstate();
for (int i = 0; i < n; ++i) {
x[i] = unif_rand();
}
PutRNGstate();
} else {
if (Rf_length(r_initial) != n) {
Rf_error("Expected a vector of length %d for 'initial'", n);
}
memcpy(x, REAL(r_initial), n * sizeof(double));
}
SEXP dim = Rf_getAttrib(r_m, R_DimSymbol);
const int nd = Rf_length(dim);
int n_matrices = 1;
if (nd == 3) {
n_matrices = INTEGER(dim)[2];
} else if (nd != 2) {
Rf_error("Expected 'm' to be a matrix or 3d array");
}
SEXP ret = PROTECT(Rf_allocVector(REALSXP, n_matrices));
const int len = n * n;
for (int i = 0; i < n_matrices; ++i) {
const double *m_i = m + i * len;
if (all_zero(m_i, len)) {
REAL(ret)[i] = 0;
} else {
REAL(ret)[i] = eigen_power_iteration(n, m_i,
max_iterations, tolerance, x);
}
R_CheckUserInterrupt();
}
UNPROTECT(1);
return ret;
}
static const R_CallMethodDef call_methods[] = {
{"Ceigen_power_iteration", (DL_FUNC) &r_eigen_power_iteration, 4},
{NULL, NULL, 0}
};
void R_init_eigen1(DllInfo *info) {
R_registerRoutines(info, NULL, call_methods, NULL, NULL);
#if defined(R_VERSION) && R_VERSION >= R_Version(3, 3, 0)
R_useDynamicSymbols(info, FALSE);
R_forceSymbols(info, TRUE);
#endif
}
| 25.654867 | 80 | 0.591583 |
d6d0f55605574d4f119e6cf0c2b86913019394b2 | 854 | h | C | rev2_2018/WiFiSatellite_Firmware/WiFiSatellite/EntryChannel.h | MasterScott/WiFiSatellite | 984774e5edefaa3c77d7656a2a26c605b185b725 | [
"MIT"
] | 72 | 2019-04-07T15:11:10.000Z | 2022-02-25T02:14:45.000Z | rev2_2018/WiFiSatellite_Firmware/WiFiSatellite/EntryChannel.h | n3m351d4/WiFiSatellite | 6dd7daddffaf412eaceda4664ceee037d988104d | [
"MIT"
] | 1 | 2019-04-08T14:57:54.000Z | 2019-04-08T15:56:46.000Z | rev2_2018/WiFiSatellite_Firmware/WiFiSatellite/EntryChannel.h | n3m351d4/WiFiSatellite | 6dd7daddffaf412eaceda4664ceee037d988104d | [
"MIT"
] | 20 | 2019-04-08T04:00:31.000Z | 2022-01-18T21:49:54.000Z | #ifndef SimpleMenu_EntryChannel_h
#define SimpleMenu_EntryChannel_h
#include <sstream> // std::stringstream
#include "lib/strdo.h" // strdo::build
#include "entries/Entry.h"
#include "Channel.h"
namespace simplemenu {
class EntryChannel: public Entry {
public:
EntryChannel(std::string name, Config* config, Channel* ch, Menu* m, SIMPLEMENU_EVENT_FNCT = nullptr);
virtual ~EntryChannel();
void update();
virtual void set_name(std::string name);
virtual bool draw(unsigned int x, unsigned int y, bool selected);
virtual std::string get_name() const;
protected:
std::string prefix {};
std::string suffix {};
std::string name {};
Channel * ch { nullptr };
};
}
#endif // ifndef SimpleMenu_EntryChannel_h | 31.62963 | 114 | 0.619438 |
d6d3ecaa8c91297be0f226e36776702992487b41 | 2,096 | h | C | SourceX/dvlnet/protocol_zt.h | traeak/devilutionX | 007883b836d4392bd3fe5f5f210387dd2c9ccd87 | [
"Unlicense"
] | null | null | null | SourceX/dvlnet/protocol_zt.h | traeak/devilutionX | 007883b836d4392bd3fe5f5f210387dd2c9ccd87 | [
"Unlicense"
] | null | null | null | SourceX/dvlnet/protocol_zt.h | traeak/devilutionX | 007883b836d4392bd3fe5f5f210387dd2c9ccd87 | [
"Unlicense"
] | 1 | 2021-05-08T18:04:37.000Z | 2021-05-08T18:04:37.000Z | #pragma once
#include <string>
#include <set>
#include <atomic>
#include <deque>
#include <map>
#include <exception>
#include <array>
#include <algorithm>
#include "dvlnet/frame_queue.h"
namespace devilution {
namespace net {
class protocol_exception : public std::exception {
public:
const char *what() const throw() override
{
return "Protocol error";
}
};
class protocol_zt {
public:
class endpoint {
public:
std::array<unsigned char, 16> addr = {};
explicit operator bool() const
{
auto empty = std::array<unsigned char, 16>{};
return (addr != empty);
}
bool operator<(const endpoint& rhs) const
{
return addr < rhs.addr;
}
buffer_t serialize() const
{
return buffer_t(addr.begin(), addr.end());
}
void unserialize(const buffer_t& buf)
{
if(buf.size() != 16)
throw protocol_exception();
std::copy(buf.begin(), buf.end(), addr.begin());
}
void from_string(const std::string& str);
};
protocol_zt();
~protocol_zt();
void disconnect(const endpoint& peer);
bool send(const endpoint& peer, const buffer_t& data);
bool send_oob(const endpoint& peer, const buffer_t& data);
bool send_oob_mc(const buffer_t& data);
bool recv(endpoint& peer, buffer_t& data);
bool network_online();
std::string make_default_gamename();
private:
static constexpr uint32_t PKTBUF_LEN = 65536;
static constexpr uint16_t default_port = 6112;
struct peer_state {
int fd = -1;
std::deque<buffer_t> send_queue;
frame_queue recv_queue;
};
std::deque<std::pair<endpoint, buffer_t>> oob_recv_queue;
std::map<endpoint, peer_state> peer_list;
int fd_tcp = -1;
int fd_udp = -1;
uint64_t current_ms();
void close_all();
void set_nonblock(int fd);
void set_nodelay(int fd);
void set_reuseaddr(int fd);
bool send_queued_peer(const endpoint& peer);
bool recv_peer(const endpoint& peer);
bool send_queued_all();
bool recv_from_peers();
bool recv_from_udp();
bool accept_all();
};
} // namespace net
} // namespace devilution
| 20.96 | 60 | 0.666508 |
d6d44cde890496852aa8f2eefc173d6905c85a1a | 214 | c | C | example.c | ViralTaco/vstr | 37b4fbf38b7be8487c501a7a5d586de8ee1b0588 | [
"MIT"
] | null | null | null | example.c | ViralTaco/vstr | 37b4fbf38b7be8487c501a7a5d586de8ee1b0588 | [
"MIT"
] | null | null | null | example.c | ViralTaco/vstr | 37b4fbf38b7be8487c501a7a5d586de8ee1b0588 | [
"MIT"
] | null | null | null | #include "include/vstr/vstr.h"
int main(void) {
const vstr foo = V_s("Hello, World!");
c_str bar = "Hello, World!";
V_puts(foo);
V_puts(V_eq(foo, bar) ? "Yep." : "Nope");
exit(EXIT_SUCCESS);
}
| 21.4 | 45 | 0.584112 |
d6d49f2b4d9f2f6f7fc0b18a0b132f9f80bf1fae | 18,715 | h | C | Src/HSAFdnTrace/HSATraceStringUtils.h | kimjuyounglisa/radeon_compute_profiler | 43b01a1ee293e31762ac1e346bc454c93254fa7c | [
"MIT"
] | 72 | 2017-06-24T02:45:35.000Z | 2020-01-17T08:48:33.000Z | Src/HSAFdnTrace/HSATraceStringUtils.h | kimjuyounglisa/radeon_compute_profiler | 43b01a1ee293e31762ac1e346bc454c93254fa7c | [
"MIT"
] | 28 | 2017-07-10T13:41:04.000Z | 2019-08-11T06:54:59.000Z | Src/HSAFdnTrace/HSATraceStringUtils.h | kimjuyounglisa/radeon_compute_profiler | 43b01a1ee293e31762ac1e346bc454c93254fa7c | [
"MIT"
] | 15 | 2017-07-05T05:40:36.000Z | 2019-11-01T22:55:24.000Z | //==============================================================================
// Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
/// \author AMD Developer Tools Team
/// \file
/// \brief This file contains functions to format HSA Trace string output
//==============================================================================
#ifndef _HSA_TRACE_STRING_UTILS_H_
#define _HSA_TRACE_STRING_UTILS_H_
#include <sstream>
#include <string>
#include <vector>
#include <AutoGenerated/HSARTModuleDecls.h>
#include "HSAFunctionDefs.h"
#include "Defs.h"
#include "StringUtils.h"
namespace HSATraceStringUtils
{
static const char* s_pListStart = "{"; ///< start of a list of items
static const char* s_pListEnd = "}"; ///< end of a list of items
static const char* s_pStructStart = "{"; ///< start of a structure
static const char* s_pStructEnd = "}"; ///< end of a structure
static const char* s_pPtrDeRefStart = "["; ///< start of a dereferenced pointer
static const char* s_pPtrDeRefEnd = "]"; ///< end of a dereferenced pointer
/// Pointer to a function to use to get the display name for an API
/// \param type the API whose name is needed
/// \param[out] apiDisplayName the display name of the specified API
/// \return true if the display name is returned for the specified API
extern bool (*pGetApiDisplayName)(HSA_API_Type type, std::string& apiDisplayName);
/// General template function to surround an input with two other strings
/// \param input the input string
/// \param pSurroundBegin the string to put at the beginning of the input
/// \param pSurroundEnd the string to put at the end of the input
/// \return the string containing the surrounded input
template<typename T>
std::string SurroundWith(T input, const char* pSurroundBegin, const char* pSurroundEnd)
{
std::ostringstream ss;
ss << pSurroundBegin;
ss << input;
ss << pSurroundEnd;
return ss.str();
}
/// Template function to surround an input with pointer deref strings
/// \param input the input string
/// \return the string containing the surrounded input
template<typename T>
std::string SurroundWithDeRef(T input)
{
return SurroundWith(input, s_pPtrDeRefStart, s_pPtrDeRefEnd);
}
/// Template function to surround an input with structure strings strings
/// \param input the input string
/// \return the string containing the surrounded input
template<typename T>
std::string SurroundWithStruct(T input)
{
return SurroundWith(input, s_pStructStart, s_pStructEnd);
}
/// Template function to surround an input with list strings
/// \param input the input string
/// \return the string containing the surrounded input
template<typename T>
std::string SurroundWithList(T input)
{
return SurroundWith(input, s_pListStart, s_pListEnd);
}
/// Gets the string representation of the HSA_API_TYPE
/// \param type the input HSA_API_TYPE
/// \return the string representation of the HSA_API_TYPE
std::string GetHSAAPINameString(HSA_API_Type type);
/// Add quotes to input string and optionally truncate it at most 60 chars
/// \param src input string
/// \param truncate flag indicating whether the output should be limited to 60 chars
/// \param surroundWithDeref flag indicating whether to surround the string with brackets to indicate the value is a dereferenced value
/// \return string representation of the input
std::string GetStringString(const char* src, bool truncate = true, bool surroundWithDeref = true);
/// Add quotes to input string and optionally trucate it at most 60 chars. This overload will output a string only if input pointer is non-null
/// \param src input string pointer
/// \param srcString input string
/// \param truncate flag indicating whether the output should be limited to 60 chars
/// \param surroundWithDeref flag indicating whether to surround the string with brackets to indicate the value is a dereferenced value
/// \return string representation of the input
std::string GetStringString(const char* src, std::string& srcString, bool truncate = true, bool surroundWithDeref = true);
/// Template fnuction to output up to three items in an array (more will be indicated with an elipsis)
/// \param input the input array
/// \param the number of items in the array
/// \param formatfunc the string format fnuction to call for each memeber of the array
/// \return string representation of the input
template<typename T>
std::string GetArrayString(T* input, size_t num_items, std::string(*formatFunc)(T))
{
static const size_t MAX_ITEMS_TO_OUTPUT = 3;
if (NULL == input || NULL == formatFunc)
{
return "";
}
std::ostringstream ss;
bool truncated = false;
size_t numItemsToOutput = num_items;
if (numItemsToOutput > MAX_ITEMS_TO_OUTPUT)
{
numItemsToOutput = MAX_ITEMS_TO_OUTPUT;
truncated = true;
}
for (size_t i = 0; i < numItemsToOutput; ++i)
{
ss << formatFunc(input[i]);
if (i < numItemsToOutput - 1 || truncated)
{
ss << ",";
}
}
if (truncated)
{
ss << "...";
}
return SurroundWithList(ss.str());
}
/// Gets the string representation of bool
/// \param input the input bool
/// \return the string representation of the bool
std::string Get_bool_String(bool input);
/// Gets the string representation of a bool pointer
/// \param input the input bool pointer
/// \param de-referenced value of the input bool
/// \return the string representation of the bool pointer
std::string Get_bool_Ptr_String(bool* pInput, bool input);
/// Gets the string representation of a uint8_t
/// This method is needed so uint8_t values aren't displayed as char data
/// \param input the input uint8_t
/// \return the string representation of the uint8_t
std::string Get_uint8_t_String(uint8_t input);
/// Gets the size of the underlying data for the specified agent attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified agent attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_agent_get_info_AttributeSize(hsa_agent_info_t attribute);
/// Gets the string representation of the specified agent attribute data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_agent_get_info call
/// \return the string representation of the specified agent attribute data
std::string Get_hsa_agent_get_info_AttributeString(void* value, hsa_agent_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified agent attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified agent attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_amd_agent_get_info_AttributeSize(hsa_amd_agent_info_t attribute);
/// Gets the string representation of the specified agent attribute data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_agent_get_info call
/// \return the string representation of the specified agent attribute data
std::string Get_hsa_amd_agent_get_info_AttributeString(void* value, hsa_amd_agent_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified system attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified agent attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_system_get_info_AttributeSize(hsa_system_info_t attribute);
/// Gets the string representation of the specified system attribute data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_system_get_info call
/// \return the string representation of the specified agent attribute data
std::string Get_hsa_system_get_info_AttributeString(void* value, hsa_system_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified region attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified region attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_region_get_info_AttributeSize(hsa_region_info_t attribute);
/// Gets the string representation of the specified region data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_region_get_info call
/// \return the string representation of the specified agent attribute data
std::string Get_hsa_region_get_info_AttributeString(void* value, hsa_region_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified isa attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified isa attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_isa_get_info_AttributeSize(hsa_isa_info_t attribute);
/// Gets the string representation of the specified isa data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_isa_get_info call
/// \return the string representation of the specified agent attribute data
std::string Get_hsa_isa_get_info_AttributeString(void* value, hsa_isa_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified code object attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified code object attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_code_object_get_info_AttributeSize(hsa_code_object_info_t attribute);
/// Gets the string representation of the specified code object data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_code_object_get_info call
/// \return the string representation of the specified code object attribute data
std::string Get_hsa_code_object_get_info_AttributeString(void* value, hsa_code_object_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified code symbol attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified code symbol attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_code_symbol_get_info_AttributeSize(hsa_code_symbol_info_t attribute);
/// Gets the string representation of the specified code symbol data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_code_symbol_get_info call
/// \return the string representation of the specified code symbol attribute data
std::string Get_hsa_code_symbol_get_info_AttributeString(void* value, hsa_code_symbol_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified executable attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified executable attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_executable_get_info_AttributeSize(hsa_executable_info_t attribute);
/// Gets the string representation of the specified executable data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_executable_get_info call
/// \return the string representation of the specified agent executable data
std::string Get_hsa_executable_get_info_AttributeString(void* value, hsa_executable_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified executable symbol attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified executable symbol attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_executable_symbol_get_info_AttributeSize(hsa_executable_symbol_info_t attribute);
/// Gets the string representation of the specified executable symbol data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_executable_symbol_get_info call
/// \return the string representation of the specified agent executable symbol data
std::string Get_hsa_executable_symbol_get_info_AttributeString(void* value, hsa_executable_symbol_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified program attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified program attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_ext_program_get_info_AttributeSize(hsa_ext_program_info_t attribute);
/// Gets the string representation of the specified program data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_ext_program_get_info call
/// \return the string representation of the specified program data
std::string Get_hsa_ext_program_get_info_AttributeString(void* value, hsa_ext_program_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified memory pool attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified memory pool attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_amd_memory_pool_get_info_AttributeSize(hsa_amd_memory_pool_info_t attribute);
/// Gets the string representation of the specified memory pool data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_amd_memory_pool_get_info call
/// \return the string representation of the specified memory pool data
std::string Get_hsa_amd_memory_pool_get_info_AttributeString(void* value, hsa_amd_memory_pool_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified agent memory pool attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified agent memory pool attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_amd_agent_memory_pool_get_info_AttributeSize(hsa_amd_agent_memory_pool_info_t attribute);
/// Gets the string representation of the specified agent memory pool data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_amd_agent_memory_pool_get_info call
/// \return the string representation of the specified agent memory pool data
std::string Get_hsa_amd_agent_memory_pool_get_info_AttributeString(void* value, hsa_amd_agent_memory_pool_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified cache attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified cache attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_cache_get_info_AttributeSize(hsa_cache_info_t attribute);
/// Gets the string representation of the specified cache data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_cache_get_info call
/// \return the string representation of the specified cache data
std::string Get_hsa_cache_get_info_AttributeString(void* value, hsa_cache_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified wavefront attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified wavefront attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_wavefront_get_info_AttributeSize(hsa_wavefront_info_t attribute);
/// Gets the string representation of the specified wavefront data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_wavefront_get_info call
/// \return the string representation of the specified wavefront data
std::string Get_hsa_wavefront_get_info_AttributeString(void* value, hsa_wavefront_info_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified aqlprofile attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified aqlprofile attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_ven_amd_aqlprofile_get_info_AttributeSize(hsa_ven_amd_aqlprofile_info_type_t attribute);
/// Gets the string representation of the specified aqlprofile data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_ven_amd_aqlprofile_get_info call
/// \return the string representation of the specified aqlprofile data
std::string Get_hsa_ven_amd_aqlprofile_get_info_AttributeString(void* value, hsa_ven_amd_aqlprofile_info_type_t attribute, hsa_status_t retVal);
/// Gets the size of the underlying data for the specified loaded code object attribute
/// \param attribute the attribute whose size is needed
/// \return the size of the underlying data for the specified loaded code object attribute (0 for unsupported/unknown attributes)
unsigned int Get_hsa_ven_amd_loader_loaded_code_object_get_info_AttributeSize(hsa_ven_amd_loader_loaded_code_object_info_t attribute);
/// Gets the string representation of the specified loaded code object data
/// \param value the value whose string representation is needed
/// \param attribute the attribute type
/// \param retVal the return value of the hsa_ven_amd_loader_loaded_code_object_get_info call
/// \return the string representation of the specified loaded code object data
std::string Get_hsa_ven_amd_loader_loaded_code_object_get_info_AttributeString(void* value, hsa_ven_amd_loader_loaded_code_object_info_t attribute, hsa_status_t retVal);
}
#endif //_HSA_TRACE_STRING_UTILS_H_
| 53.319088 | 169 | 0.785146 |
d6d5b71177ba8d0653da8b3282d2fee968df98a1 | 973 | h | C | LearningRoad/LearningRoad/Custom/HLZheDieAnimationView/HLZheDieView.h | zhanghuilin37/HLLearningRoad | 170d3b0707c0038550ca29dc7ca997ff5f36822e | [
"MIT"
] | null | null | null | LearningRoad/LearningRoad/Custom/HLZheDieAnimationView/HLZheDieView.h | zhanghuilin37/HLLearningRoad | 170d3b0707c0038550ca29dc7ca997ff5f36822e | [
"MIT"
] | null | null | null | LearningRoad/LearningRoad/Custom/HLZheDieAnimationView/HLZheDieView.h | zhanghuilin37/HLLearningRoad | 170d3b0707c0038550ca29dc7ca997ff5f36822e | [
"MIT"
] | 1 | 2018-08-10T08:35:20.000Z | 2018-08-10T08:35:20.000Z | //
// HLZheDieView.h
// AnimationDemo
//
// Created by Zhl on 2017/3/24.
// Copyright © 2017年 LearningRoad. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HLAnimationView.h"
#import "HLRightView.h"
typedef enum {
HLZheDieViewAnimationSate_zhankai = 0,
HLZheDieViewAnimationSate_shouqi
}HLZheDieViewAnimationSate;
@protocol HLZheDieViewDelegate <NSObject>
@optional
-(void)HLZheDieViewItemClickedAtIndex:(NSInteger)index;
@end
@interface HLZheDieView : UIView<UIScrollViewDelegate>
@property (nonatomic,assign) id<HLZheDieViewDelegate> delegate;
@property (nonatomic,weak) HLAnimationView *aniView;
@property (nonatomic,weak) UIScrollView *scrollView;
@property (nonatomic,weak) HLRightView *rightView;
@property (nonatomic,weak) UIButton *switchStateBtn;
@property (nonatomic,weak) UIView *backGroundView;
@property (nonatomic,assign) CGFloat offsetY;
@property (nonatomic,assign)HLZheDieViewAnimationSate state;
@end
| 24.948718 | 63 | 0.768756 |
d6d6dcb5f7c11e4a567d766c5d52c136312304c4 | 1,586 | h | C | shared/source/command_stream/scratch_space_controller_base.h | sanjaymsh/compute-runtime | 1bf270a804d47745dc6ee0bd2bf6232b2a4d835b | [
"MIT"
] | null | null | null | shared/source/command_stream/scratch_space_controller_base.h | sanjaymsh/compute-runtime | 1bf270a804d47745dc6ee0bd2bf6232b2a4d835b | [
"MIT"
] | null | null | null | shared/source/command_stream/scratch_space_controller_base.h | sanjaymsh/compute-runtime | 1bf270a804d47745dc6ee0bd2bf6232b2a4d835b | [
"MIT"
] | null | null | null | /*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/command_stream/scratch_space_controller.h"
namespace NEO {
class ScratchSpaceControllerBase : public ScratchSpaceController {
public:
ScratchSpaceControllerBase(uint32_t rootDeviceIndex, ExecutionEnvironment &environment, InternalAllocationStorage &allocationStorage);
void setRequiredScratchSpace(void *sshBaseAddress,
uint32_t scratchSlot,
uint32_t requiredPerThreadScratchSize,
uint32_t requiredPerThreadPrivateScratchSize,
uint32_t currentTaskCount,
OsContext &osContext,
bool &stateBaseAddressDirty,
bool &vfeStateDirty) override;
uint64_t calculateNewGSH() override;
uint64_t getScratchPatchAddress() override;
void reserveHeap(IndirectHeap::Type heapType, IndirectHeap *&indirectHeap) override;
void programHeaps(HeapContainer &heapContainer,
uint32_t scratchSlot,
uint32_t requiredPerThreadScratchSize,
uint32_t requiredPerThreadPrivateScratchSize,
uint32_t currentTaskCount,
OsContext &osContext,
bool &stateBaseAddressDirty,
bool &vfeStateDirty) override;
protected:
void createScratchSpaceAllocation();
};
} // namespace NEO
| 37.761905 | 138 | 0.621059 |
d6d6e13d5a475f20290bb86277affe17365522b8 | 6,515 | c | C | u-boot-1.1.6/board/integratorcp/integratorcp.c | XIANG07/u-boot-zjxiang | 6f34eb2c738de2683f576a9a09a31c0d55890bfb | [
"MIT"
] | null | null | null | u-boot-1.1.6/board/integratorcp/integratorcp.c | XIANG07/u-boot-zjxiang | 6f34eb2c738de2683f576a9a09a31c0d55890bfb | [
"MIT"
] | null | null | null | u-boot-1.1.6/board/integratorcp/integratorcp.c | XIANG07/u-boot-zjxiang | 6f34eb2c738de2683f576a9a09a31c0d55890bfb | [
"MIT"
] | null | null | null | /*
* (C) Copyright 2002
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
* Marius Groeger <mgroeger@sysgo.de>
*
* (C) Copyright 2002
* David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
*
* (C) Copyright 2003
* Texas Instruments, <www.ti.com>
* Kshitij Gupta <Kshitij@ti.com>
*
* (C) Copyright 2004
* ARM Ltd.
* Philippe Robin, <philippe.robin@arm.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
DECLARE_GLOBAL_DATA_PTR;
void flash__init (void);
void ether__init (void);
void peripheral_power_enable (void);
#if defined(CONFIG_SHOW_BOOT_PROGRESS)
void show_boot_progress(int progress)
{
printf("Boot reached stage %d\n", progress);
}
#endif
#define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
/*
* Miscellaneous platform dependent initialisations
*/
int board_init (void)
{
/* arch number of Integrator Board */
gd->bd->bi_arch_number = MACH_TYPE_CINTEGRATOR;
/* adress of boot parameters */
gd->bd->bi_boot_params = 0x00000100;
gd->flags = 0;
#ifdef CONFIG_CM_REMAP
extern void cm_remap(void);
cm_remap(); /* remaps writeable memory to 0x00000000 */
#endif
icache_enable ();
flash__init ();
ether__init ();
return 0;
}
int misc_init_r (void)
{
setenv("verify", "n");
return (0);
}
/******************************
Routine:
Description:
******************************/
void flash__init (void)
{
}
/*************************************************************
Routine:ether__init
Description: take the Ethernet controller out of reset and wait
for the EEPROM load to complete.
*************************************************************/
void ether__init (void)
{
}
/******************************
Routine:
Description:
******************************/
int dram_init (void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
#ifdef CONFIG_CM_SPD_DETECT
{
extern void dram_query(void);
unsigned long cm_reg_sdram;
unsigned long sdram_shift;
dram_query(); /* Assembler accesses to CM registers */
/* Queries the SPD values */
/* Obtain the SDRAM size from the CM SDRAM register */
cm_reg_sdram = *(volatile ulong *)(CM_BASE + OS_SDRAM);
/* Register SDRAM size
*
* 0xXXXXXXbbb000bb 16 MB
* 0xXXXXXXbbb001bb 32 MB
* 0xXXXXXXbbb010bb 64 MB
* 0xXXXXXXbbb011bb 128 MB
* 0xXXXXXXbbb100bb 256 MB
*
*/
sdram_shift = ((cm_reg_sdram & 0x0000001C)/4)%4;
gd->bd->bi_dram[0].size = 0x01000000 << sdram_shift;
}
#endif /* CM_SPD_DETECT */
return 0;
}
/* The Integrator/CP timer1 is clocked at 1MHz
* can be divided by 16 or 256
* and can be set up as a 32-bit timer
*/
/* U-Boot expects a 32 bit timer, running at CFG_HZ */
/* Keep total timer count to avoid losing decrements < div_timer */
static unsigned long long total_count = 0;
static unsigned long long lastdec; /* Timer reading at last call */
static unsigned long long div_clock = 1; /* Divisor applied to timer clock */
static unsigned long long div_timer = 1; /* Divisor to convert timer reading
* change to U-Boot ticks
*/
/* CFG_HZ = CFG_HZ_CLOCK/(div_clock * div_timer) */
static ulong timestamp; /* U-Boot ticks since startup */
#define TIMER_LOAD_VAL ((ulong)0xFFFFFFFF)
#define READ_TIMER (*(volatile ulong *)(CFG_TIMERBASE+4))
/* all function return values in U-Boot ticks i.e. (1/CFG_HZ) sec
* - unless otherwise stated
*/
/* starts up a counter
* - the Integrator/CP timer can be set up to issue an interrupt */
int interrupt_init (void)
{
/* Load timer with initial value */
*(volatile ulong *)(CFG_TIMERBASE + 0) = TIMER_LOAD_VAL;
/* Set timer to be
* enabled 1
* periodic 1
* no interrupts 0
* X 0
* divider 1 00 == less rounding error
* 32 bit 1
* wrapping 0
*/
*(volatile ulong *)(CFG_TIMERBASE + 8) = 0x000000C2;
/* init the timestamp */
total_count = 0ULL;
reset_timer_masked();
div_timer = (unsigned long long)(CFG_HZ_CLOCK / CFG_HZ);
div_timer /= div_clock;
return (0);
}
/*
* timer without interrupts
*/
void reset_timer (void)
{
reset_timer_masked ();
}
ulong get_timer (ulong base_ticks)
{
return get_timer_masked () - base_ticks;
}
void set_timer (ulong ticks)
{
timestamp = ticks;
total_count = (unsigned long long)ticks * div_timer;
}
/* delay usec useconds */
void udelay (unsigned long usec)
{
ulong tmo, tmp;
/* Convert to U-Boot ticks */
tmo = usec * CFG_HZ;
tmo /= (1000000L);
tmp = get_timer_masked(); /* get current timestamp */
tmo += tmp; /* form target timestamp */
while (get_timer_masked () < tmo) {/* loop till event */
/*NOP*/;
}
}
void reset_timer_masked (void)
{
/* capure current decrementer value */
lastdec = (unsigned long long)READ_TIMER;
/* start "advancing" time stamp from 0 */
timestamp = 0L;
}
/* converts the timer reading to U-Boot ticks */
/* the timestamp is the number of ticks since reset */
ulong get_timer_masked (void)
{
/* get current count */
unsigned long long now = (unsigned long long)READ_TIMER;
if(now > lastdec) {
/* Must have wrapped */
total_count += lastdec + TIMER_LOAD_VAL + 1 - now;
} else {
total_count += lastdec - now;
}
lastdec = now;
timestamp = (ulong)(total_count/div_timer);
return timestamp;
}
/* waits specified delay value and resets timestamp */
void udelay_masked (unsigned long usec)
{
udelay(usec);
}
/*
* This function is derived from PowerPC code (read timebase as long long).
* On ARM it just returns the timer value.
*/
unsigned long long get_ticks(void)
{
return (unsigned long long)get_timer(0);
}
/*
* Return the timebase clock frequency
* i.e. how often the timer decrements
*/
ulong get_tbclk (void)
{
return (ulong)(((unsigned long long)CFG_HZ_CLOCK)/div_clock);
}
| 23.690909 | 77 | 0.666922 |
d6d7cc98117a0029aaf55b80f6a32fa552dc6868 | 3,613 | h | C | 6Shots-V2/C6SMapMakerState.h | chrisdepas/6Shots | 2b339b1a367e3421d502e7815548d0b13ea3e32c | [
"CC0-1.0"
] | 1 | 2022-01-06T22:49:28.000Z | 2022-01-06T22:49:28.000Z | 6Shots-V2/C6SMapMakerState.h | chrisdepas/6Shots-Game | 2b339b1a367e3421d502e7815548d0b13ea3e32c | [
"CC0-1.0"
] | null | null | null | 6Shots-V2/C6SMapMakerState.h | chrisdepas/6Shots-Game | 2b339b1a367e3421d502e7815548d0b13ea3e32c | [
"CC0-1.0"
] | null | null | null | #ifndef __C6SMAPMAKERSTATE_H__
#define __C6SMAPMAKERSTATE_H__
/*
Christopher De Pasquale
Sometime in 2016
*/
#include "CGameState.h"
#include "C6SMap.h"
#include "C6SPlayer.h"
#include "CGlobal.h"
#include "CProjectileManager.h"
#include "CEntityManager.h"
class C6SMapMakerState : public CGameState {
struct STilesetTile {
int tileindex;
sf::Texture texture;
};
C6SDevMap m_Map;
/* Input state */
sf::Vector2f m_vLookPosition;
bool m_bMovingLeft;
bool m_bMovingRight;
bool m_bMovingUp;
bool m_bMovingDown;
sf::Vector2i m_vLastProcessedMousePosition = sf::Vector2i(-1, -1);
/* GUI data */
bool m_bGUIEnabled;
tgui::Gui* m_pGUI;
/* Tileset */
int m_iTileTabOffset = 0;
/* Loaded background data */
std::string m_sStaticBackground = "";
std::string m_sDynamicBackground1 = "";
float m_fDynamicBackground1MoveScale = 0.0f;
/* If a tile type is being placed */
bool m_bPlacingTileType;
SMapTile::EMapTileType m_ePlacingTileType;
/* If a tile is being placed */
bool m_bPlacingTile;
int m_iPlacingTileIndex;
/* Placing as 'sticker' (Any size, free placement) */
bool m_bStickerPlacingMode;
sf::Vector2i m_vStickerPlacingSize;
bool m_bStickerOnTop;
const sf::Vector2i MENU_SIZE = sf::Vector2i(400, 500);
const tgui::Layout2d CHECKBOX_SIZE = tgui::Layout2d(20.0f, 20.0f);
const int TEXT_SIZE = 24;
const tgui::Layout VERTICAL_PADDING = tgui::Layout(2.0f);
const sf::Color SLIDER_TEXT_COLOR = sf::Color::White;
const sf::Color LABEL_COLOR = sf::Color::White;
const tgui::Layout2d SLIDER_SIZE = tgui::Layout2d(150.0f, (const float)TEXT_SIZE);
const tgui::Layout2d BUTTON_SIZE = tgui::Layout2d(150.0f, 26.0f);
const tgui::Layout2d SEPERATOR_SPACING = tgui::Layout2d(0.0f, 20.0f);
const sf::Vector2f TILETYPES_BTN_SET_SCALE = sf::Vector2f(0.25f, 0.9f);
const sf::Vector2f LOADSIZE_MAP_BTN_SET_SCALE = sf::Vector2f(0.33f, 0.95f);
const std::string CHK_BOUNDINGBOX_ID = "CheckBoundingBox";
const std::string CHK_GRID_ID = "CheckGrid";
const std::string CHK_TILE_TYPE_ID = "CheckTileType";
const std::string CHK_TILES_ID = "CheckTiles";
const std::string CHK_BTN_EXIT_ID = "BtnExitMenu";
const std::string SLD_GRIDSIZE_ID = "SldGridsize";
const std::string SLD_GRIDSIZE_LABEL_ID = "SldLblGridsize";
/* Load a tileset file (.6ts), should be a list of paths to tiles, 1 per line */
void LoadTileset(char* szTilset, CGame* pGame);
/* Helper - Place current tileset texture at position */
void PlaceTileTexture(sf::Vector2i vPosition);
/* Helper - Get checkbox value */
bool GetCheckboxValue(const char* szID);
/* GUI Callback functions */
void TilePressed(int index, CGame* pGame);
void GUIChecked();
void BoundingBoxChecked();
void GridChecked();
void TileTypeChecked();
void LoadStaticBackground();
void LoadDynamicBackground1();
void GridsizeChanged();
void ResizePressed();
void LoadTilesetPressed(CGame* pGame);
void ExportMap(CGame* pGame);
void PublishMap(CGame* pGame);
void LoadMap(CGame* pGame);
void HideMenu();
void ShowMenu();
void BeginTileTypePlacement(CGame* pGame, int eTileType);
void EndTileTypePlacement(CGame* pGame);
void ExitToMenuPressed(CGame* pGame);
public:
void Init(CGame* pGame);
void Cleanup(CGame* pGame);
void Draw(CGame* pGame);
void Update(CGame* pGame, float fFrameTime);
void HandleInput(CGame* pGame);
void PauseState();
void ResumeState();
static C6SMapMakerState* Instance()
{
static C6SMapMakerState makerState;
return &makerState;
}
};
#endif
| 28.226563 | 84 | 0.71824 |
d6dab2c0e16125728c8912f49de4325ad010aa60 | 1,485 | c | C | tests/refs/branches/checkedout.c | apnadkarni/libgit2 | c8450561d4065d13ad05d8f2269f65ceb810d1e9 | [
"CC0-1.0"
] | 312 | 2019-09-08T18:18:43.000Z | 2022-03-31T08:13:30.000Z | tests/refs/branches/checkedout.c | apnadkarni/libgit2 | c8450561d4065d13ad05d8f2269f65ceb810d1e9 | [
"CC0-1.0"
] | 85 | 2019-10-06T16:03:26.000Z | 2022-02-24T06:41:13.000Z | tests/refs/branches/checkedout.c | apnadkarni/libgit2 | c8450561d4065d13ad05d8f2269f65ceb810d1e9 | [
"CC0-1.0"
] | 36 | 2019-10-06T16:06:09.000Z | 2022-01-23T12:29:14.000Z | #include "clar_libgit2.h"
#include "refs.h"
#include "worktree/worktree_helpers.h"
static git_repository *repo;
static void assert_checked_out(git_repository *repo, const char *branch, int checked_out)
{
git_reference *ref;
cl_git_pass(git_reference_lookup(&ref, repo, branch));
cl_assert(git_branch_is_checked_out(ref) == checked_out);
git_reference_free(ref);
}
void test_refs_branches_checkedout__simple_repo(void)
{
repo = cl_git_sandbox_init("testrepo");
assert_checked_out(repo, "refs/heads/master", 1);
assert_checked_out(repo, "refs/heads/executable", 0);
cl_git_sandbox_cleanup();
}
void test_refs_branches_checkedout__worktree(void)
{
static worktree_fixture fixture =
WORKTREE_FIXTURE_INIT("testrepo", "testrepo-worktree");
setup_fixture_worktree(&fixture);
assert_checked_out(fixture.repo, "refs/heads/master", 1);
assert_checked_out(fixture.repo, "refs/heads/testrepo-worktree", 1);
assert_checked_out(fixture.worktree, "refs/heads/master", 1);
assert_checked_out(fixture.worktree, "refs/heads/testrepo-worktree", 1);
cleanup_fixture_worktree(&fixture);
}
void test_refs_branches_checkedout__head_is_not_checked_out(void)
{
repo = cl_git_sandbox_init("testrepo");
assert_checked_out(repo, "HEAD", 0);
cl_git_sandbox_cleanup();
}
void test_refs_branches_checkedout__master_in_bare_repo_is_not_checked_out(void)
{
repo = cl_git_sandbox_init("testrepo.git");
assert_checked_out(repo, "refs/heads/master", 0);
cl_git_sandbox_cleanup();
}
| 27.5 | 89 | 0.792593 |
d6dbd5c8bd2fdc675f18435dcce77102267654b0 | 2,156 | h | C | Common/DataModel/vtkBezierCurve.h | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 117 | 2020-03-07T12:07:05.000Z | 2022-03-27T07:35:22.000Z | Common/DataModel/vtkBezierCurve.h | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 4 | 2020-03-12T15:36:57.000Z | 2022-02-08T02:19:17.000Z | Common/DataModel/vtkBezierCurve.h | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 76 | 2020-03-16T01:47:46.000Z | 2022-03-21T16:37:07.000Z | /*=========================================================================
Program: Visualization Toolkit
Module: vtkBezierCurve.h
Copyright (c) Kevin Tew
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkBezierCurve
// .SECTION Description
// .SECTION See Also
#ifndef vtkBezierCurve_h
#define vtkBezierCurve_h
#include "vtkCellType.h" // For GetCellType.
#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkHigherOrderCurve.h"
#include "vtkNew.h" // For member variable.
#include "vtkSmartPointer.h" // For member variable.
class vtkCellData;
class vtkDoubleArray;
class vtkIdList;
class vtkLine;
class vtkPointData;
class vtkPoints;
class vtkVector3d;
class vtkVector3i;
class vtkDataSet;
class VTKCOMMONDATAMODEL_EXPORT vtkBezierCurve : public vtkHigherOrderCurve
{
public:
static vtkBezierCurve* New();
vtkTypeMacro(vtkBezierCurve, vtkHigherOrderCurve);
void PrintSelf(ostream& os, vtkIndent indent) override;
int GetCellType() override { return VTK_BEZIER_CURVE; }
void EvaluateLocationProjectedNode(
int& subId, const vtkIdType point_id, double x[3], double* weights);
void SetRationalWeightsFromPointData(vtkPointData* point_data, const vtkIdType numPts);
void InterpolateFunctions(const double pcoords[3], double* weights) override;
void InterpolateDerivs(const double pcoords[3], double* derivs) override;
vtkDoubleArray* GetRationalWeights();
protected:
vtkLine* GetApproximateLine(
int subId, vtkDataArray* scalarsIn = nullptr, vtkDataArray* scalarsOut = nullptr) override;
vtkBezierCurve();
~vtkBezierCurve() override;
vtkNew<vtkDoubleArray> RationalWeights;
private:
vtkBezierCurve(const vtkBezierCurve&) = delete;
void operator=(const vtkBezierCurve&) = delete;
};
#endif // vtkBezierCurve_h
| 31.705882 | 95 | 0.715677 |
d6dbeb4302ba61b7f25de3ed26a73c9a2d9def50 | 1,145 | h | C | include/esil.h | masapastosa/esil | 92f0fbe6695322e4c84d41d6911f6b8bde8c07ac | [
"Unlicense"
] | null | null | null | include/esil.h | masapastosa/esil | 92f0fbe6695322e4c84d41d6911f6b8bde8c07ac | [
"Unlicense"
] | 1 | 2017-04-21T19:06:10.000Z | 2017-04-21T19:06:10.000Z | include/esil.h | masapastosa/esil | 92f0fbe6695322e4c84d41d6911f6b8bde8c07ac | [
"Unlicense"
] | null | null | null | #ifndef ESIL_H
#define ESIL_H
#include <stdbool.h>
#include "stack.h"
#define ESIL_DELIMITER ','
#define NUM_ESIL_OPCODES 11
#define MAX_ESIL_OP_LEN 2
typedef enum {
INVALID = -1,
ESIL_ADD,
ESIL_SUB,
ESIL_MUL,
ESIL_DIV,
ESIL_SHL,
ESIL_SHR,
ESIL_ROTL,
ESIL_ROTR,
ESIL_AND,
ESIL_OR,
ESIL_REG_ASSIGN
} esil_op;
#define NUM_ESIL_VM_REGS 9
#define MAX_ESIL_REG_LEN 3
// Just support 32 bits registers for now (as we use 32 bits integers in the stack)
typedef enum {
INVALID_REG = -2,
EAX = 0,
EBX,
EXC,
EDX,
ESI,
EDI,
EIP,
ESP,
EBP
} register_t;
typedef enum {
IMMEDIATE = 0,
REGISTER
} esil_type_t;
typedef struct {
stack_t data_stack;
// type_stack is a stack of the same length of data_stack, it's
// used to identify what kind of data is the data_stack value:
// a register or an immediate
stack_t type_stack;
i32 regs[NUM_ESIL_VM_REGS];
} esil_vm_t;
void init_vm_regs(esil_vm_t*);
void split_tokens(char*, i32);
void preety_print_regs(const esil_vm_t);
esil_op get_operator(char* const);
register_t get_register(char* const);
i32 exec_operation(esil_vm_t*, esil_op);
#endif
| 17.089552 | 83 | 0.722271 |
d6dc9a71cd9cf1f1d16d3b90c7796dbbb5917996 | 2,011 | h | C | include/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h | vladislav-horbatiuk/ossim | 82417ad868fac022672335e1684bdd91d662c18c | [
"MIT"
] | 251 | 2015-10-20T09:08:11.000Z | 2022-03-22T18:16:38.000Z | include/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h | IvanLJF/ossim | 2e0143f682b9884a09ff2598ef8737f29e44fbdf | [
"MIT"
] | 73 | 2015-11-02T17:12:36.000Z | 2021-11-15T17:41:47.000Z | include/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h | IvanLJF/ossim | 2e0143f682b9884a09ff2598ef8737f29e44fbdf | [
"MIT"
] | 146 | 2015-10-15T16:00:15.000Z | 2022-03-22T12:37:14.000Z | //*******************************************************************
//
// License: See top level LICENSE.txt file.
//
// Author: Garrett Potts (gpotts@imagelinks.com)
// Description: Rpf support class
//
//********************************************************************
// $Id: ossimRpfBoundaryRectSectionSubheader.h 16997 2010-04-12 18:53:48Z dburken $
#ifndef ossimRpfBoundaryRectSectionSubheader_HEADER
#define ossimRpfBoundaryRectSectionSubheader_HEADER
#include <iosfwd>
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimErrorCodes.h>
#include <ossim/base/ossimReferenced.h>
class ossimRpfBoundaryRectSectionSubheader : public ossimReferenced
{
public:
friend std::ostream& operator <<(std::ostream& out,
const ossimRpfBoundaryRectSectionSubheader &data);
/** default constructor */
ossimRpfBoundaryRectSectionSubheader();
/** copy constructor */
ossimRpfBoundaryRectSectionSubheader(const ossimRpfBoundaryRectSectionSubheader& obj);
/** assignment operator */
const ossimRpfBoundaryRectSectionSubheader& operator=(
const ossimRpfBoundaryRectSectionSubheader& rhs);
virtual ~ossimRpfBoundaryRectSectionSubheader();
ossimErrorCode parseStream(std::istream& in, ossimByteOrder);
/**
* @brief Write method.
*
* @param out Stream to write to.
*/
void writeStream(std::ostream& out);
/**
* @brief print method
* @param out String to output to.
* @return output stream.
*/
std::ostream& print(std::ostream& out) const;
ossim_uint16 getNumberOfEntries() const;
ossim_uint32 getTableOffset() const;
ossim_uint16 getLengthOfEachEntry() const;
void setNumberOfEntries(ossim_uint16 entries);
void setTableOffset(ossim_uint32 offset);
void setLengthOfEachEntry(ossim_uint16 length);
void clearFields();
private:
ossim_uint32 m_rectangleTableOffset;
ossim_uint16 m_numberOfEntries;
ossim_uint16 m_lengthOfEachEntry;
};
#endif
| 28.323944 | 89 | 0.682248 |
d6e1969fe3273371405b59a9abb88991e15c4d08 | 2,798 | c | C | cc_fips/src/module_id.c | rajohns08/corecrypto | 0344fab1747c1e187f12233f353d73c331a77653 | [
"AML"
] | null | null | null | cc_fips/src/module_id.c | rajohns08/corecrypto | 0344fab1747c1e187f12233f353d73c331a77653 | [
"AML"
] | null | null | null | cc_fips/src/module_id.c | rajohns08/corecrypto | 0344fab1747c1e187f12233f353d73c331a77653 | [
"AML"
] | null | null | null | /* Copyright (c) (2020) Apple Inc. All rights reserved.
*
* corecrypto is licensed under Apple Inc.’s Internal Use License Agreement (which
* is contained in the License.txt file distributed with corecrypto) and only to
* people who accept that license. IMPORTANT: Any license rights granted to you by
* Apple Inc. (if any) are limited to internal use within your organization only on
* devices and computers you own or control, for the sole purpose of verifying the
* security characteristics and correct functioning of the Apple Software. You may
* not, directly or indirectly, redistribute the Apple Software or any portions thereof.
*/
#include <string.h>
#include <stdio.h>
#include <corecrypto/cc_config.h>
#include "module_id.h"
//
// Provide string version of the FIPS 140-x Validated corecrypto Module
//
extern const char *cc_module_id(enum cc_module_id_format outformat)
{
static char moduleID[256] = { 0 };
const size_t length = sizeof(moduleID);
#define moduleBaseName "Apple corecrypto Module" // Module Base Name
#define moduleVersion "11.1" // 2020 OS Releases
#if CC_USE_L4 /* Apple Silicon SEP */
#define moduleTarget "Secure Key Store" // Target Environment
#define moduleType "Hardware" // Hardware SEP:SKS
#elif CC_KERNEL
#define moduleTarget "Kernel" // Target Environment
#define moduleType "Software" // Hardware / Software
#else
#define moduleTarget "User" // Target Environment
#define moduleType "Software" // Hardware / Software
#endif
#if defined(__x86_64__) // macOS/Intel
#define moduleProc "Intel" // Intel-based Macs
#else // Apple Silicon based OSes
#define moduleProc "Apple ARM" // All SoC-based Platforms
#endif // Apple Silicon based OSes
switch (outformat) {
case cc_module_id_Full: {
// <moduleBaseName> v<moduleVersion> [<moduleProc>, <moduleTarget>, <moduleType>]
// Apple corecrypto Module v11.1 [Apple Silicon, Secure Key Store, Hardware]
/// snprintf can be a macro, and thus requires the ()
(snprintf)(moduleID, length, "%s v%s [%s, %s, %s]", moduleBaseName, moduleVersion, moduleProc, moduleTarget, moduleType);
} break;
case cc_module_id_Version:
(snprintf)(moduleID, length, "%s", moduleVersion);
break;
case cc_module_id_Target:
(snprintf)(moduleID, length, "%s", moduleTarget);
break;
case cc_module_id_Proc:
(snprintf)(moduleID, length, "%s", moduleProc);
break;
case cc_module_id_Name:
(snprintf)(moduleID, length, "%s", moduleBaseName);
break;
case cc_module_id_Type:
(snprintf)(moduleID, length, "%s", moduleType);
break;
}
return moduleID;
}
| 38.328767 | 129 | 0.677269 |
d6e1a7e36449eeea4e7a6d5d080115196002fd83 | 107 | h | C | Pod/Classes/chenla/UIFont+Chenla.h | parakeety/GoogleFontsiOS | 46a0d144b32b14f06f3605568ab210ad390c8e96 | [
"MIT"
] | 10 | 2015-08-07T19:43:38.000Z | 2019-03-06T10:40:11.000Z | Pod/Classes/chenla/UIFont+Chenla.h | Maxatma/GoogleFontsiOS | 46a0d144b32b14f06f3605568ab210ad390c8e96 | [
"MIT"
] | 3 | 2016-03-01T10:29:45.000Z | 2017-03-30T12:23:06.000Z | Pod/Classes/chenla/UIFont+Chenla.h | Maxatma/GoogleFontsiOS | 46a0d144b32b14f06f3605568ab210ad390c8e96 | [
"MIT"
] | 4 | 2016-02-10T12:34:29.000Z | 2020-04-08T07:18:23.000Z | #import <UIKit/UIKit.h>
@interface UIFont (Chenla)
+ (instancetype)chenlaFontOfSize:(CGFloat)size;
@end
| 13.375 | 47 | 0.747664 |
d6e1e12e167a7f6aed7fac0a32632f46d91288c3 | 286 | h | C | Example/LPDCollectionViewKit/LPDAppDelegate.h | foxsofter/LPDCollectionviewKit | c26c2583ca42dddf91283203b8143a549a41e7cf | [
"MIT"
] | 4 | 2016-12-05T09:12:44.000Z | 2016-12-16T11:28:09.000Z | Example/LPDCollectionViewKit/LPDAppDelegate.h | LPD-iOS/lpd-collectionview-kit | c26c2583ca42dddf91283203b8143a549a41e7cf | [
"MIT"
] | null | null | null | Example/LPDCollectionViewKit/LPDAppDelegate.h | LPD-iOS/lpd-collectionview-kit | c26c2583ca42dddf91283203b8143a549a41e7cf | [
"MIT"
] | null | null | null | //
// LPDAppDelegate.h
// LPDCollectionViewKit
//
// Created by foxsofter on 12/04/2016.
// Copyright (c) 2016 foxsofter. All rights reserved.
//
@import UIKit;
@interface LPDAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| 17.875 | 63 | 0.730769 |
d6e3e45932e66907c3014074d9d6b9730c6973bc | 1,505 | h | C | mcucpp/ARM/Stm32F40x/adc_draft.h | evugar/Mcucpp | 202d98587e8b9584370a32c1bafa2c7315120c9e | [
"BSD-3-Clause"
] | 87 | 2015-03-16T19:09:09.000Z | 2022-03-19T19:48:49.000Z | mcucpp/ARM/Stm32F40x/adc_draft.h | evugar/Mcucpp | 202d98587e8b9584370a32c1bafa2c7315120c9e | [
"BSD-3-Clause"
] | 5 | 2015-04-19T11:02:35.000Z | 2021-04-21T05:29:22.000Z | mcucpp/ARM/Stm32F40x/adc_draft.h | evugar/Mcucpp | 202d98587e8b9584370a32c1bafa2c7315120c9e | [
"BSD-3-Clause"
] | 42 | 2015-02-11T16:29:35.000Z | 2022-03-12T11:48:08.000Z |
typedef void (* AdcCallback)(uint16_t *data, size_t count);
typedef void (* AdcErrorCallback)(Error error);
class AdcInterface
{
public:
static const unsigned MaxSequence = 16;
static const unsigned MaxImmediate = 4;
void Init(Divider divider, ClockSource clock, Reference reference);
void Disable();
void SetSampleTime(uint8_t channel, unsigned adcCycles);
void SetResolution(uint8_t bits);
void SetDivider(Divider divider);
void SetReference(Reference reference);
uint8_t ChannelsCount();
enum TriggerMode{RisingEdge, FallingEdge, BothEdges};
enum SequenceTrigger{Once, FreeRun, ...};
enum ImmediateTrigger{Once, FreeRun, ...};
enum Error{Overflow, TransferError, ...};
// immediate
void SetImmediateTrigger(Trigger trigger, TriggerMode mode);
bool StartImmediate(uint8_t *channels, uint16_t *data, uint8_t count);
bool ReadImmediate(uint8_t *channels, uint16_t *data, uint8_t count);
bool StartImmediate(uint8_t channel);
uint16_t ReadImmediate();
uint16_t ReadImmediate(uint8_t channel);
bool ImmediateReady();
void StopImmediate();
// continiuos
void SetSequenceTrigger(Trigger trigger, TriggerMode mode);
void SetSequenceCallback(AdcCallback callback);
bool StartSequence(uint8_t *channels, uint8_t channelsCount, uint16_t *dataBuffer, uint16_t scanCount);
bool SequenceReady();
void StopSequence();
//info
int ResolutionBits();
unsigned ToVolts(uint16_t value); // in 10E-4 Volt units
unsigned SampleRate();
}; | 33.444444 | 105 | 0.752159 |
d6e49d7cc12694d2b3ac520828265bbe7d49f041 | 626 | h | C | ENTBoostLib/SOTP/SOTPAESUtility.h | qhf012607/IMchat | c29b67822b3ad8c99e34de02970bcffde26c7c6f | [
"MIT"
] | null | null | null | ENTBoostLib/SOTP/SOTPAESUtility.h | qhf012607/IMchat | c29b67822b3ad8c99e34de02970bcffde26c7c6f | [
"MIT"
] | null | null | null | ENTBoostLib/SOTP/SOTPAESUtility.h | qhf012607/IMchat | c29b67822b3ad8c99e34de02970bcffde26c7c6f | [
"MIT"
] | null | null | null | //
// SOTPAESUtility.h
// ENTBoostLib
//
// Created by zhong zf on 15/4/3.
// Copyright (c) 2015年 entboost. All rights reserved.
//
#import <Foundation/Foundation.h>
@class NSString;
@interface SOTPAESUtility : NSObject
/*!
@function AES加密
@discussion 支持CBC/NoPadding填充模式,不足16位的整数倍,填充0后再加密
@param data 加密前数据
@param key 密钥
@return 加密后数据
*/
+ (NSData *)encryptData:(NSData*)data usingKey:(NSString *)key;
/*!
@function AES解密
@discussion 支持CBC/NoPadding填充模式
@param data 解密前数据
@param key 密钥
@return 解密后数据
*/
+ (NSData *)decryptData:(NSData*)data usingKey:(NSString *)key;
@end
| 17.885714 | 63 | 0.674121 |
d6e600b9fce25b49933dac99a4e60ff859957fab | 41,592 | h | C | Pods/Headers/Public/CloudMine/CMWebService.h | cloudmine/ios-base-project | 12cf263a365410dd58bc55081faa341a136e240b | [
"MIT"
] | null | null | null | Pods/Headers/Public/CloudMine/CMWebService.h | cloudmine/ios-base-project | 12cf263a365410dd58bc55081faa341a136e240b | [
"MIT"
] | null | null | null | Pods/Headers/Public/CloudMine/CMWebService.h | cloudmine/ios-base-project | 12cf263a365410dd58bc55081faa341a136e240b | [
"MIT"
] | null | null | null | //
// CMWebService.h
// cloudmine-ios
//
// Copyright (c) 2012 CloudMine, LLC. All rights reserved.
// See LICENSE file included with SDK for details.
//
/** @file */
#import "AFNetworking.h"
#import "CMFileUploadResult.h"
#import "CMDeviceTokenResult.h"
#import "CMUserAccountResult.h"
#import "CMSocialLoginViewController.h"
#import "CMChannelResponse.h"
#import "CMViewChannelsResponse.h"
@class CMUser;
@class CMServerFunction;
@class CMPagingDescriptor;
@class CMSortDescriptor;
typedef void (^CMWebServiceGenericRequestCallback)(id parsedBody, NSUInteger httpCode, NSDictionary *headers);
typedef void (^CMWebServiceErorCallack)(id responseBody, NSUInteger httpCode, NSDictionary *headers, NSError *error, NSDictionary *errorInfo );
/**
* Callback block signature for all operations on <tt>CMWebService</tt> that fetch objects
* from the CloudMine servers. These blocks return <tt>void</tt> and take a dictionary of results,
* a dictionary of errors, a dictionary of metadata, and a dynamic snippet result as arguments.
* These map directly with the CloudMine API response format.
*/
typedef void (^CMWebServiceObjectFetchSuccessCallback)(NSDictionary *results, NSDictionary *errors, NSDictionary *meta, id snippetResult, NSNumber *count, NSDictionary *headers);
/**
* Callback block signature for <b>all</b> operations on <tt>CMWebService</tt> that can fail. These are general
* errors that cause the entire call to fail, not key-specific errors (which are reported instead in
* the <tt>errors</tt> dictionary in the <tt>CMWebServiceObjectFetchSuccessCallback</tt> callback block).
* The block returns <tt>void</tt> and takes an <tt>NSError</tt> describing the error as an argument.
*/
typedef void (^CMWebServiceFetchFailureCallback)(NSError *error);
/**
* Callback block signature for all operations on <tt>CMWebService</tt> that upload binary files to
* the CloudMine servers. These blocks return <tt>void</tt> and take a <tt>CMFileUploadResult</tt>, the key
* of the new file, and a dynamic snippet result as arguments to indicate the final result of the upload operation.
*/
typedef void (^CMWebServiceFileUploadSuccessCallback)(CMFileUploadResult result, NSString *fileKey, id snippetResult, NSDictionary *headers);
/**
* Callback block signature for operations on <tt>CMWebService</tt> that directly execute a server-side code snippet on the CloudMine servers.
* These blocks return <tt>void</tt> and take the snippet result (the type of which is determined by the type of data you use inside your exit() call
* in your server-side JavaScript code or what you return from the main method in your server-side Java code) and all the headers of the response.
*/
typedef void (^CMWebServiceSnippetRunSuccessCallback)(id snippetResult, NSDictionary *headers);
typedef CMWebServiceFetchFailureCallback CMWebServiceSnippetRunFailureCallback;
/**
* Callback block signature for all operations on <tt>CMWebService</tt> that download binary files from
* the CloudMine servers. These blocks return <tt>void</tt> and take an <tt>NSData</tt> instance that contains
* the raw data for the file as well as a string with the content type of the file returned from the server.
*/
typedef void (^CMWebServiceFileFetchSuccessCallback)(NSData *data, NSString *contentType, NSDictionary *headers);
/**
* Callback block signature for all operations on <tt>CMWebService</tt> and <tt>CMUser</tt> that involve the management
* of user accounts and user sessions. These blocks return <tt>void</tt> and take a <tt>CMUserAccountResult</tt> code
* that represents the result of the operation as well as an <tt>NSDictionary</tt> containing the dictionary representation
* of the response body from the server.
*/
typedef void (^CMWebServiceUserAccountOperationCallback)(CMUserAccountResult result, NSDictionary *responseBody);
/**
* Callback block signature for all operations that return a list of users for the current app
* from the CloudMine servers. These blocks return <tt>void</tt> and take a dictionary of results,
* a dictionary of errors, and the total number of users returned as arguments.
* The contents of the former two map directly to the CloudMine API response format.
*/
typedef void (^CMWebServiceUserFetchSuccessCallback)(NSDictionary *results, NSDictionary *errors, NSNumber *count);
typedef void (^CMWebServiceUserFetchCallback)(NSDictionary *results, NSDictionary *errors, id snippetResult, NSDictionary *meta, NSNumber *count);
typedef void (^CMWebServicesSocialQuerySuccessCallback)(NSString *results, NSDictionary *headers);
typedef void (^CMWebServiceResultCallback)(id responseBody, NSError *errors, NSUInteger httpCode);
/**
* Base class for all classes concerned with the communication between the client device and the CloudMine
* web services.
*/
@interface CMWebService : AFHTTPRequestOperationManager <CMSocialLoginViewControllerDelegate> {
NSString *_appSecret;
NSString *_appIdentifier;
}
+ (CMWebService *)sharedWebService;
/**
* Default initializer for the web service connector. You <strong>must</strong> have already configured the
* <tt>CMUserCredentials</tt> singleton or an exception will be thrown.
* The baseURL will be to CloudMine, or whatever is last configured in CMAPICredentials.
*
* @throws NSInternalInconsistencyException <tt>CMUserCredentials</tt> has not been configured.
*/
- (id)init;
/**
* Default initializer for the web service connector. You <strong>must</strong> have already configured the
* <tt>CMUserCredentials</tt> singleton or an exception will be thrown.
* The baseURL will be to CloudMine, or whatever is last configured in CMAPICredentials.
*
* @param url The base URL you want to point this web service to. Defaults to CloudMine.
* @throws NSInternalInconsistencyException <tt>CMUserCredentials</tt> has not been configured.
*/
- (id)initWithBaseURL:(NSURL *)url;
/**
* Initializes an instance of a web service connector with the given API key and secret app key. The baseURL for
* this WebService will be to CloudMine, or whatever is last configured in CMAPICredentials.
*
* @param appSecret The App Secret for your application
* @param appIdentifier The App ID for your application
*/
- (id)initWithAppSecret:(NSString *)appSecret appIdentifier:(NSString *)appIdentifier;
/**
* Initializes an instance of the Web Service with the App ID, and secret key, and base URL This can be useful
* if you are pointing your CloudMine SDK to a different place than the default. All parameters are required.
*
* @param appSecret The App Secret for your application
* @param appIdentifier The App ID for your application
* @param url The Base URL you want this Web Service to point to.
*/
- (id)initWithAppSecret:(NSString *)appSecret appIdentifier:(NSString *)appIdentifier baseURL:(NSURL *)url;
/**
* Asynchronously retrieve all ACLs associated with the named user. On completion, the <tt>successHandler</tt> block
* will be called with a dictionary of the ACLs retrieved.
*
* @param user The user whose ACLs to fetch.
* @param successHandler The block to be called when the objects have been populated.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)getACLsForUser:(CMUser *)user
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously retrieve objects for the named user-level keys. On completion, the <tt>successHandler</tt> block
* will be called with a dictionary of the objects retrieved as well as a dictionary of the key-related errors returned from the server.
*
* @param keys The keys to fetch.
* @param function The server-side code snippet and related options to execute with this request, or nil if none.
* @param user The user whose data to fetch. If nil, fetches app-level objects.
* @param successHandler The block to be called when the objects have been populated.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)getValuesForKeys:(NSArray *)keys
serverSideFunction:(CMServerFunction *)function
pagingOptions:(CMPagingDescriptor *)paging
sortingOptions:(CMSortDescriptor *)sorting
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
- (void)searchValuesFor:(NSString *)searchQuery
serverSideFunction:(CMServerFunction *)function
pagingOptions:(CMPagingDescriptor *)paging
sortingOptions:(CMSortDescriptor *)sorting
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously search all ACLs associated with the user, using the specified query. On completion, the <tt>successHandler</tt> block
* will be called with a dictionary of the ACLs retrieved.
*
* @param query This is the same syntax as defined at https://cloudmine.me/docs/api#query_syntax and used by <tt>CMStore</tt>'s search methods.
* @param user The user whose ACLs to query.
* @param successHandler The block to be called when the objects have been populated.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)searchACLs:(NSString *)query
user:(CMUser *)user
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously retrieve a binary file for the named user-leve key. On completion, the <tt>successHandler</tt> block
* will be called with the raw data from the server.
*
* @param keys The key of the binary file to fetch.
* @param user The user whose data to fetch. If nil, fetches app-level objects.
* @param successHandler The block to be called when the file has been fully downloaded.
* @param errorHandler The block to be called if the request failed.
*/
- (void)getBinaryDataNamed:(NSString *)key
serverSideFunction:(CMServerFunction *)function
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceFileFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously update one or more objects for the user-level keys included in <tt>data</tt>. On completion, the <tt>successHandler</tt>
* block will be called with a dictionary of the keys of the objects that were created and updated as well as a dictionary of the
* key-related errors returned from the server.
*
* @param data A dictionary mapping top-level keys to the values to be used to update the object.
* @param function The server-side code snippet and related options to execute with this request, or nil if none.
* @param user The user whose data to write. If nil, writes as app-level objects.
* @param successHandler The block to be called when the objects have been populated.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)updateValuesFromDictionary:(NSDictionary *)data
serverSideFunction:(CMServerFunction *)function
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously update the specified ACL. On completion, the <tt>successHandler</tt> block will be called with a dictionary containing
* the object updated.
*
* @param acl This is a dictionary containing the attributes of the ACL object to update, as serialized by <tt>CMObjectEncoder</tt>.
* @param user The user to whom the ACL is associated.
* @param successHandler The block to be called when a response has been received.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)updateACL:(NSDictionary *)acl
user:(CMUser *)user
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously upload the raw binary data contained in <tt>data</tt> with an optional MIME type as a user-level object.
* On completion, the <tt>successHandler</tt> block will be called with a status code indicating
* whether a file with the given key previously existed on the server or had to be created new.
*
* @param data The raw binary data of the file to upload.
* @param key The unique name of this file. If this is nil, a key will be generated on the server.
* @param mimeType The MIME type of this file. When later fetched, this MIME type will be used in the Content-Type header. If <tt>nil</tt>, defaults to <tt>application/octet-stream</tt>.
* @param user The user whose data to write. If nil, writes as app-level objects.
* @param successHandler The block to be called when the file has finished uploading. The <tt>result</tt> parameter indicates whether the file was new to the server or not.
* @param errorHandler The block to be called if the request failed.
*/
- (void)uploadBinaryData:(NSData *)data
serverSideFunction:(CMServerFunction *)function
named:(NSString *)key
ofMimeType:(NSString *)mimeType
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceFileUploadSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously upload the raw binary data contained in the file stored at the path specified by <tt>path</tt> with an optional
* MIME type as an user-level object. Unlike its cousin method <tt>uploadBinaryData:</tt>, this method streams the contents of
* the file directly from the filesystem without first loading it into RAM, making it perfect for uploading large files
* on the filesystem efficiently.
*
* On completion, the <tt>successHandler</tt> block will be called with a status code indicating
* whether a file with the given key previously existed on the server or had to be created new.
*
* @param path The path to the file to upload.
* @param key The unique name of this file.
* @param mimeType The MIME type of this file. When later fetched, this MIME type will be used in the Content-Type header. If <tt>nil</tt>, defaults to <tt>application/octet-stream</tt>.
* @param user The user whose data to write. If nil, writes as app-level objects.
* @param successHandler The block to be called when the file has finished uploading. The <tt>result</tt> parameter indicates whether the file was new to the server or not.
* @param errorHandler The block to be called if the request failed.
*/
- (void)uploadFileAtPath:(NSString *)path
serverSideFunction:(CMServerFunction *)function
named:(NSString *)key
ofMimeType:(NSString *)mimeType
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceFileUploadSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously create or replace one or more objects for the values of the user-level keys included in <tt>data</tt>. On completion, the <tt>successHandler</tt>
* block will be called with a dictionary of the keys of the objects that were created and replaced as well as a dictionary of the
* key-related errors returned from the server.
*
* Note that if the key already exists server-side, this method will fully replace its value. For updating via merge, see the <tt>updateValuesFromDictionary</tt> methods.
*
* @see updateValuesFromDictionary:serverSideFunction:user:successHandler:errorHandler:
*
* @param data A dictionary mapping top-level keys to the values to be used to update the object.
* @param function The server-side code snippet and related options to execute with this request, or nil if none.
* @param user The user whose data to write. If nil, writes as app-level objects.
* @param successHandler The block to be called when the objects have been populated.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)setValuesFromDictionary:(NSDictionary *)data
serverSideFunction:(CMServerFunction *)function
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously delete objects for the named user-level keys. On completion, the <tt>successHandler</tt> block
* will be called.
*
* For the sake of consistency, <tt>results</tt> and <tt>errors</tt> will be sent to the callback like with all the other methods in this class,
* however they will <strong>always</strong> be empty.
*
* @param keys The keys to delete. If <tt>nil</tt> or an empty array, <strong>all of this user's objects will be deleted.</strong>
* @param user The user whose data to delete. If nil, deletes app-level objects.
* @param successHandler The block to be called when the objects have been populated.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)deleteValuesForKeys:(NSArray *)keys
serverSideFunction:(CMServerFunction *)function
user:(CMUser *)user
extraParameters:(NSDictionary *)params
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously delete the ACL with the specified key, associated with the specified user. On completion, the <tt>successHandler</tt> block will be called
* with a dictionary containing the status of the deletion.
*
* @param key The key of the ACL that will be deleted.
* @param user The user to whom the ACL is associated.
* @param successHandler The block to be called when a response has been received.
* @param errorHandler The block to be called if the entire request failed (i.e. if there is no network connectivity).
*/
- (void)deleteACLWithKey:(NSString *)key
user:(CMUser *)user
successHandler:(CMWebServiceObjectFetchSuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously login a user and create a new session. On completion, the <tt>callback</tt> block will be called with
* the result of the operation and the body of the response represented by an <tt>NSDictonary</tt>. See the CloudMine
* documentation online for the possible contents of this dictionary.
*
* Possible result codes:
* - <tt>CMUserAccountLoginSucceeded</tt>
* - <tt>CMUserAccountLoginFailedIncorrectCredentials</tt>
* - <tt>CMUserAccountOperationFailedUnknownAccount</tt>
*
* @param user The user to log in.
* @param callback The block that will be called on completion of the operation.
*
* @see CMUserAccountResult
* @see https://cloudmine.me/docs/ios/reference#users_login
*/
- (void)loginUser:(CMUser *)user callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* Asynchronously logout a user and clear their session and session token. On completion, the <tt>callback</tt>
* block will be called with the result of the operation and the body of the response represented by an <tt>NSDictonary</tt>.
* See the CloudMine documentation online for the possible contents of this dictionary.
*
* Possible result codes:
* - <tt>CMUserAccountLogoutSucceeded</tt>
* - <tt>CMUserAccountOperationFailedUnknownAccount</tt>
*
* @param user The user to log out.
* @param callback The block that will be called on completion of the operation.
*
* @see CMUserAccountResult
* @see https://cloudmine.me/docs/ios/reference#users_logout
*/
- (void)logoutUser:(CMUser *)user callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* Asynchronously create a new account for the user on CloudMine. This must be done once for each user before they can login.
* On completion, the <tt>callback</tt> block will be called with the result
* of the operation and the body of the response represented by an <tt>NSDictonary</tt>.
* See the CloudMine documentation online for the possible contents of this dictionary.
*
* Possible result codes:
* - <tt>CMUserAccountCreateSucceeded</tt>
* - <tt>CMUserAccountCreateFailedInvalidRequest</tt>
* - <tt>CMUserAccountCreateFailedDuplicateAccount</tt>
*
* @param user The user who needs an account created.
* @param callback The block that will be called on completion of the operation.
*
* @see CMUserAccountResult
* @see https://cloudmine.me/docs/ios/reference#users_create
*/
- (void)createAccountWithUser:(CMUser *)user callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* Initialize the social login service by calling the SocialLoginViewController (which contains only a webview)
*
* @param user The user object that is attempting the login
* @param service The social service to be logged into, @see CMSocialNetwork codes
* @param viewController the current viewController in use when this method is called
* @param params Any extra parameters you want passed in to the authentication request. This dictionary is parsed where each key value pair becomes "&key=value". We do not encode the URL after this, so any encoding will need to be done by the creator. This is a good place to put scope, for example: @{@"scope" : @"gist,repo"}
* @param callback The block that will be called on completion of the operation
* @see https://cloudmine.me/docs/api#users_social
*/
- (CMSocialLoginViewController *)loginWithSocial:(CMUser *)user
withService:(NSString *)service
viewController:(UIViewController *)viewController
params:(NSDictionary *)params
callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* Asynchronously change the password for the given user. For security purposes, you must have the user enter his or her
* old password and new password in order to perform this operation. This operation will succeed regardless of whether
* the user's <tt>CMUser</tt> instance is logged in or not.
* On completion, the <tt>callback</tt> block will be called with the result of the operation and the body of the
* response represented by an <tt>NSDictonary</tt>. See the CloudMine documentation online for the possible contents of this dictionary.
*
* If the user has forgotten his or her password, use <tt>resetForgottenPasswordForUser:callback:</tt> instead of this method.
*
* Possible result codes:
* - <tt>CMUserAccountPasswordChangeSucceeded</tt>
* - <tt>CMUserAccountPasswordChangeFailedInvalidCredentials</tt>
* - <tt>CMUserAccountOperationFailedUnknownAccount</tt>
*
* @param user The user whose password is being changed.
* @param newPassword The new password to use.
* @param oldPassword The user's old password.
* @param callback The block that will be called on completion of the operation.
*
* @see CMUserAccountResult
* @see https://cloudmine.me/docs/ios/reference#users_pass_change
*/
- (void)changePasswordForUser:(CMUser *)user oldPassword:(NSString *)oldPassword newPassword:(NSString *)newPassword callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* <strong>DEPRECATED: </strong> This method is now deprecated. Use <tt>changeCredentialsForUser:password:newPassword:newUsername:newEmail:callback:</tt> instead.
*
* Asynchronously change the credentials for the given user. For security purposes, you must have the user enter his or her password
* in order to perform this operation. This operation will succeed regardless of whether the user's <tt>CMUser</tt> instance
* is logged in or not.
* This method is useful when changing multiple fields for the user, and is the only method to change their username/userId. This
* method is generally called from the <tt>CMUser</tt>.
* On completion, the <tt>callback</tt> block will be called with the result of the operation and the body of the
* response represented by an <tt>NSDictonary</tt>. See the CloudMine documentation online for the possible contents of this dictionary.
*
* Possible result codes:
* - <tt>CMUserAccountPasswordChangeSucceeded</tt>
* - <tt>CMUserAccountUserIdChangeSucceeded</tt>
* - <tt>CMUserAccountUsernameChangeSucceeded</tt>
* - <tt>CMUserAccountCredentialsChangeSucceeded</tt> Used if more than one credential field was changed.
* - <tt>CMUserAccountCredentialChangeFailedDuplicateUserId</tt>
* - <tt>CMUserAccountCredentialChangeFailedDuplicateUsername</tt>
* - <tt>CMUserAccountCredentialChangeFailedDuplicateInfo</tt>
* - <tt>CMUserAccountCredentialChangeFailedInvalidCredentials</tt>
* - <tt>CMUserAccountOperationFailedUnknownAccount</tt>
* - <tt>CMUserAccountUnknownResult</tt>
*
* @param user The user who is having their credentials changed.
* @param password The current password for the user.
* @param newPassword Can be nil. The new password for the user.
* @param newUsername Can be nil. The new username for the user.
* @param newUserId Can be nil. THe new userId for the user. Must be in the form of an email.
*
* @see CMUserAccountResult
*/
- (void)changeCredentialsForUser:(CMUser *)user
password:(NSString *)password
newPassword:(NSString *)newPassword
newUsername:(NSString *)newUsername
newUserId:(NSString *)newUserId
callback:(CMWebServiceUserAccountOperationCallback)callback __attribute__((deprecated));
/**
* Asynchronously change the credentials for the given user. For security purposes, you must have the user enter his or her password
* in order to perform this operation. This operation will succeed regardless of whether the user's <tt>CMUser</tt> instance
* is logged in or not.
* This method is useful when changing multiple fields for the user, and is the only method to change their username/email. This
* method is generally called from the <tt>CMUser</tt>.
* On completion, the <tt>callback</tt> block will be called with the result of the operation and the body of the
* response represented by an <tt>NSDictonary</tt>. See the CloudMine documentation online for the possible contents of this dictionary.
*
* Possible result codes:
* - <tt>CMUserAccountPasswordChangeSucceeded</tt>
* - <tt>CMUserAccountEmailChangeSucceeded</tt>
* - <tt>CMUserAccountUsernameChangeSucceeded</tt>
* - <tt>CMUserAccountCredentialsChangeSucceeded</tt> Used if more than one credential field was changed.
* - <tt>CMUserAccountCredentialChangeFailedDuplicateEmail</tt>
* - <tt>CMUserAccountCredentialChangeFailedDuplicateUsername</tt>
* - <tt>CMUserAccountCredentialChangeFailedDuplicateInfo</tt>
* - <tt>CMUserAccountCredentialChangeFailedInvalidCredentials</tt>
* - <tt>CMUserAccountOperationFailedUnknownAccount</tt>
* - <tt>CMUserAccountUnknownResult</tt>
*
* @param user The user who is having their credentials changed.
* @param password The current password for the user.
* @param newPassword Can be nil. The new password for the user.
* @param newUsername Can be nil. The new username for the user.
* @param newUserId Can be nil. THe new userId for the user. Must be in the form of an email.
*
* @see CMUserAccountResult
*/
- (void)changeCredentialsForUser:(CMUser *)user
password:(NSString *)password
newPassword:(NSString *)newPassword
newUsername:(NSString *)newUsername
newEmail:(NSString *)newEmail
callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* Asynchronously reset the password for the given user. This method is used to reset a user's password if
* he or she forgot it. This method of course does not require the user to be logged in in order to function.
* On completion, the <tt>callback</tt> block will be called with the result of the operation and the body of the
* response represented by an <tt>NSDictonary</tt>. See the CloudMine documentation online for the possible contents of this dictionary.
*
* This method causes an email to be sent to the user with a link that allows them to reset their password from their browser.
* Upon creating a new password, the user will be able to login with it via your app immediately.
*
* Possible result codes:
* - <tt>CMUserAccountPasswordResetEmailSent</tt>
* - <tt>CMUserAccountOperationFailedUnknownAccount</tt>
*
* @param user The user who needs their password reset.
* @param callback The block that will be called on completion of the operation.
*
* @see CMUserAccountResult
* @see https://cloudmine.me/docs/ios/reference#users_pass_reset
*/
- (void)resetForgottenPasswordForUser:(CMUser *)user callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* Asynchronously fetch all the users of this app. This will download the profiles of all the users of your app, and is useful for displaying
* lists of people to share with or running analytics on your users yourself. On completion, the <tt>callback</tt> block
* will be called with a dictionary of the objects retrieved as well as a dictionary of the key-related errors returned from the server.
*
* @param callback The block that will be called on completion of the operation.
*/
- (void)getAllUsersWithCallback:(CMWebServiceUserFetchSuccessCallback)callback;
/**
* Asynchronously fetch a single user profile of a user of this app given its objectId. On completion, the <tt>callback</tt> block
* will be called with a dictionary of the objects retrieved as well as a dictionary of the key-related errors returned from the server.
*
* @param identifier The objectId of the user profile to retrieve. You can access this via CMUser#objectId.
* @param callback The block that will be called on completion of the operation.
*/
- (void)getUserProfileWithIdentifier:(NSString *)identifier callback:(CMWebServiceUserFetchSuccessCallback)callback;
/**
* Asynchronously search all profiles of users of this app for matching fields. This will download the profiles of all matching users of your app,
* and is useful for displaying and filtering lists of people to share with or running analytics on your users yourself. On completion, the <tt>callback</tt> block
* will be called with a dictionary of the objects retrieved as well as a dictionary of the key-related errors returned from the server.
*
* @param query The search query to run against all user profiles. This is the same syntax as defined at https://cloudmine.me/docs/api#query_syntax and used by <tt>CMStore</tt>'s search methods.
* @param callback The block that will be called on completion of the operation.
*/
- (void)searchUsers:(NSString *)query callback:(CMWebServiceUserFetchSuccessCallback)callback;
- (void)getUsersWithIdentifier:(NSString *)identifier
query:(NSString *)query
ServerSideFunction:(CMServerFunction *)function
pagingOptions:(CMPagingDescriptor *)paging
sortingOptions:(CMSortDescriptor *)sorting
callback:(CMWebServiceUserFetchCallback)callback;
- (void)saveUser:(CMUser *)user callback:(CMWebServiceUserAccountOperationCallback)callback;
/**
* Asynchronously execute a snippet. On completion, the <tt>successHandler</tt> block will be called with the result of the snippet.
*
* @param snippetName The name of the server-side snippet to run.
* @param params Any parameters that need to be passed to the snippet. Can be nil.
* @param user Passed to the snippet if it operates on user-level objects. If nil, then the snippet will operate on app-level objects.
* @param successHandler The block to be called when the snippet successfully executes.
* @param errorHandler The block to be called if the request failed.
*/
- (void)runSnippet:(NSString *)snippetName withParams:(NSDictionary *)params user:(CMUser *)user successHandler:(CMWebServiceSnippetRunSuccessCallback)successHandler errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
- (void)runPOSTSnippet:(NSString *)snippetName withBody:(NSData *)body user:(CMUser *)user successHandler:(CMWebServiceSnippetRunSuccessCallback)successHandler errorHandler:(CMWebServiceSnippetRunFailureCallback)errorHandler;
/**
* Asynchronously register the device token with CloudMine. On completion, the <tt>callback</tt> will be called with the result of the registration.
*
* @param user The user to which you want the token registered.
* @param devToken Required, the token Apple has supplied for getting push notifications, this should be unaltered.
* @param callback The callback called when the result is done.
*/
- (void)registerForPushNotificationsWithUser:(CMUser *)user token:(NSData *)devToken callback:(CMWebServiceDeviceTokenCallback)callback;
/**
* Asynchronously unregister the device with CloudMine. The device should be registered already before calling this.
*
* @param user The user who has the token registered to it
* @param callback The callback called when the request has finished.
*/
- (void)unRegisterForPushNotificationsWithUser:(CMUser *)user callback:(CMWebServiceDeviceTokenCallback)callback;
/**
* Asynchronously subscribes this device to a named Channel. The device should be registered to receive push notificiations.
*
* @param channel The Push Channel to register this device too.
* @param callback The CMWebServiceDeviceChannelCallback that will be called when the call is finished.
*/
- (void)subscribeThisDeviceToPushChannel:(NSString *)channel callback:(CMWebServiceDeviceChannelCallback)callback;
/**
* Asynchronously subscribes a device to a named Channel. The device should be registered to receive push notificiations.
*
* @param deviceID The deviceID that should be registered to the channel.
* @param channel The Push Channel to register this device too.
* @param callback The CMWebServiceDeviceChannelCallback that will be called when the call is finished.
*/
- (void)subscribeDevice:(NSString *)deviceID toPushChannel:(NSString *)channel callback:(CMWebServiceDeviceChannelCallback)callback;
/**
* Asynchronously subscribes the user to a named Channel. The user needs to be logged in.
*
* @param user The user who should be subscribed to the channel.
* @param channel The Push Channel to register this device too.
* @param callback The CMWebServiceDeviceChannelCallback that will be called when the call is finished.
*/
- (void)subscribeUser:(CMUser *)user toPushChannel:(NSString *)channel callback:(CMWebServiceDeviceChannelCallback)callback;
/**
* Asynchronously unsubscribes this device from a named Channel.
*
* @param channel The Push Channel to register this device too.
* @param callback The CMWebServiceDeviceChannelCallback that will be called when the call is finished.
*/
- (void)unSubscribeThisDeviceFromPushChannel:(NSString *)channel callback:(CMWebServiceDeviceChannelCallback)callback;
/**
* Asynchronously unsubscribes a device from a named Channel. The device should be registered to receive push notificiations.
*
* @param deviceID The deviceID that should be registered to the channel.
* @param channel The Push Channel to register this device too.
* @param callback The CMWebServiceDeviceChannelCallback that will be called when the call is finished.
*/
- (void)unSubscribeDevice:(NSString *)deviceID fromPushChannel:(NSString *)channel callback:(CMWebServiceDeviceChannelCallback)callback;
/**
* Asynchronously unsubscribes the user from a named Channel. The user needs to be logged in.
*
* @param user The user who should be subscribed to the channel.
* @param channel The Push Channel to register this device too.
* @param callback The CMWebServiceDeviceChannelCallback that will be called when the call is finished.
*/
- (void)unSubscribeUser:(CMUser *)user fromPushChannel:(NSString *)channel callback:(CMWebServiceDeviceChannelCallback)callback;
/**
* Asynchronously gets the channels this device is registered too.
*
* @param callback The CMViewChannelsRequestCallback that will be called when the call is finished.
*/
- (void)getChannelsForThisDeviceWithCallback:(CMViewChannelsRequestCallback)callback;
/**
* Asynchronously gets the channels a device is registered too.
*
* @param deviceID The deviceID to query.
* @param callback The CMViewChannelsRequestCallback that will be called when the call is finished.
*/
- (void)getChannelsForDevice:(NSString *)deviceID callback:(CMViewChannelsRequestCallback)callback;
/**
* Asynchronously execute a request on the social network through the singly proxy.
*
* @param network The Network this request is targeting. @see CMSocialNetwork
* @param verb the HTTP verb this request is calling.
* @param base Can be nil, but probably shouldn't be most of the time. The base query for the request, before any "query" parameters. This does NOT include the hostname, or the version of the API. For example, "https://api.twitter.com/1.1/statuses/home_timeline.json", would just be "statuses/home_timeline.json".
* @param params Can be nil. The Parameters that would go into the query. These typically are typed out like "some_page.json?query1=testing&querynumber2=test". We take care of formatting that for you, and encoding it in json. The Dictionary keys are used as the first part of the query, and the value is used after the "=". Formatted into a json encoded URL.
* @param data Can be nil. The data encoded in the request body. We do no encoding, we simply put it as the request body.
* @param user The user who is making the request to the network he is logged in to.
* @param successHandler The callback for a successful query
* @param errorHandler The callback for dealing with errors
*/
- (void)runSocialGraphQueryOnNetwork:(NSString *)network
withVerb:(NSString *)verb
baseQuery:(NSString *)base
parameters:(NSDictionary *)params
headers:(NSDictionary *)headers
messageData:(NSData *)data
withUser:(CMUser *)user
successHandler:(CMWebServicesSocialQuerySuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
/**
* Asynchronously execute a GET request with no Data. Convenience method.
*
* @param network The Network this request is targeting. @see CMSocialNetwork
* @param base Can be nil, but probably shoudln't be most of the time. The base query for the request, before any "query" parameters. This does NOT include the hostname, or the version of the API. For example, "https://api.twitter.com/1.1/statuses/home_timeline.json", would just be "statuses/home_timeline.json".
* @param params Can be nil. The Parameters that would go into the query. These typically are typed out like "some_page.json?query1=testing&querynumber2=test". We take care of formatting that for you, and encoding it in json. The Dictionary keys are used as the first part of the query, and the value is used after the "=". Formatted into a json encoded URL.
* @param user The user who is making the request to the network he is logged in to.
* @param successHandler The callback for a successful query
* @param errorHandler The callback for dealing with errors
*/
- (void)runSocialGraphGETQueryOnNetwork:(NSString *)network
baseQuery:(NSString *)base
parameters:(NSDictionary *)params
headers:(NSDictionary *)headers
withUser:(CMUser *)user
successHandler:(CMWebServicesSocialQuerySuccessCallback)successHandler
errorHandler:(CMWebServiceFetchFailureCallback)errorHandler;
- (void)executeGenericRequest:(NSURLRequest *)request successHandler:(CMWebServiceGenericRequestCallback)successHandler errorHandler:(CMWebServiceErorCallack)errorHandler;
- (NSMutableURLRequest *)constructHTTPRequestWithVerb:(NSString *)verb URL:(NSURL *)url binaryData:(BOOL)isForBinaryData user:(CMUser *)user;
- (NSURL *)constructAppURLWithString:(NSString *)url andDescriptors:(NSArray *)descriptors;
/**
* Moved method to Header now that AFNetworking does not have this same method.
* We are keeping it because it centralizes the placement of where operations are
* started.
*
* @param operation The AFHTTPRequestOperation to start.
*/
- (void)enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)operation;
@end
| 57.210454 | 358 | 0.752837 |
d6e755eface6356373a3f1782ea42bb36981cbd5 | 8,461 | h | C | lonestar/experimental/gnn/layers/graph_conv_layer.h | lineagech/Galois | 5c7c0abaf7253cb354e35a3836147a960a37ad5b | [
"BSD-3-Clause"
] | null | null | null | lonestar/experimental/gnn/layers/graph_conv_layer.h | lineagech/Galois | 5c7c0abaf7253cb354e35a3836147a960a37ad5b | [
"BSD-3-Clause"
] | null | null | null | lonestar/experimental/gnn/layers/graph_conv_layer.h | lineagech/Galois | 5c7c0abaf7253cb354e35a3836147a960a37ad5b | [
"BSD-3-Clause"
] | null | null | null | #pragma once
#include "layer.h"
/* GraphConv Layer
Parameters
----------
x: int, number of samples.
y: int, Input feature size.
z: int, Output feature size.
dropout: bool, optional, if True, a dropout operation is applied before
other operations. norm : bool, optional, if True, the normalizer
:math:`c_{ij}` is applied. Default: ``True``. bias : bool, optional, if True,
adds a learnable bias to the output. Default: ``False``. activation: callable
activation function/layer or None, optional If not None, applies an
activation function to the updated node features. Default: ``None``.
*/
class graph_conv_layer : public layer {
public:
graph_conv_layer(unsigned level, Graph* g, bool act, bool norm, bool bias,
bool dropout, std::vector<size_t> in_dims,
std::vector<size_t> out_dims)
: layer(level, in_dims, out_dims), graph(g), act_(act), norm_(norm),
bias_(bias), dropout_(dropout) {
assert(input_dims[0] == output_dims[0]); // num_vertices
x = input_dims[0];
y = input_dims[1];
z = output_dims[1];
trainable_ = true;
name_ = layer_type() + "_" + std::to_string(level);
// std::cout << name_ << " constructed: act(" << act_ << ") dropout(" <<
// dropout << ")\n";
init();
}
void init() {
std::cout << name_
<< ": allocating memory for parameters and intermediate data... ";
Timer t_alloc;
t_alloc.Start();
// randomly initialize trainable parameters for conv layers
rand_init_matrix(y, z, W);
// rand_init_matrix(y, z, Q);
zero_init_matrix(y, z, weight_grad);
alloc_grad();
if (dropout_) {
dropout_mask.resize(x);
for (size_t i = 0; i < x; i++)
dropout_mask[i].resize(y);
}
in_temp.resize(x * y);
// for (size_t i = 0; i < x; ++i) in_temp[i].resize(y);
out_temp.resize(
x * z); // same as pre_sup in original GCN code:
// https://github.com/chenxuhao/gcn/blob/master/gcn/layers.py
// for (size_t i = 0; i < x; ++i) out_temp[i].resize(z);
trans_data.resize(y * x); // y*x
// for (size_t i = 0; i < y; ++i) trans_data[i].resize(x);
if (norm_)
norm_factor_counting();
t_alloc.Stop();
std::cout << "Done, allocation time: " << t_alloc.Millisecs() << " ms\n";
}
graph_conv_layer(unsigned level, std::vector<size_t> in_dims,
std::vector<size_t> out_dims)
: graph_conv_layer(level, NULL, false, true, false, true, in_dims,
out_dims) {}
~graph_conv_layer() {}
std::string layer_type() const override { return std::string("graph_conv"); }
// user-defined aggregate function
void aggregate(Graph* g, const vec_t& in, tensor_t& out) {
update_all(g, in, out, true, norm_factor);
}
// user-defined combine function
void combine(const vec_t& self, const vec_t& neighbors, const vec_t mat_v,
const vec_t mat_u, vec_t& out) {
vec_t a(out.size(), 0);
vec_t b(out.size(), 0);
mvmul(mat_v, self, a);
mvmul(mat_u, neighbors, b);
vadd(a, b, out); // out = W*self + Q*neighbors
}
void set_context(net_phase ctx) override { phase_ = ctx; }
// 𝒉[𝑙] = σ(𝑊 * Σ(𝒉[𝑙-1]))
void forward_propagation(const tensor_t& in_data,
tensor_t& out_data) override {
// input: x*y; W: y*z; output: x*z
// if y > z:
// mult W first to reduce the feature size for aggregation
// else: aggregate first then mult W (not implemented yet)
// Timer t_matmul, t_agg, t_dropout;
// t_matmul.Start();
if (dropout_ && phase_ == net_phase::train) {
// t_dropout.Start();
// for (size_t i = 0; i < x; ++i) {
galois::do_all(
galois::iterate((size_t)0, x),
[&](const auto& i) {
dropout(in_data[i], dropout_mask[i], &in_temp[i * y]);
},
galois::loopname("dropout"));
// t_dropout.Stop();
matmul1D1D(x, z, y, in_temp, W, out_temp); // x*y; y*z; x*z
} else
matmul2D1D(z, in_data, W, out_temp); // x*y; y*z; x*z
// t_matmul.Stop();
// t_agg.Start();
aggregate(graph, out_temp, out_data); // aggregate
// t_agg.Stop();
if (act_) {
galois::do_all(
galois::iterate((size_t)0, x),
[&](const auto& i) { relu(out_data[i], out_data[i]); },
galois::loopname("relu"));
}
// double dropout_time = 0;
// if (dropout_ && phase_ == net_phase::train) dropout_time =
// t_dropout.Millisecs(); std::cout << "\n\t" << name_ << " matmul time: " <<
// t_matmul.Millisecs()
// << ", aggregation time: " << t_agg.Millisecs() << ", dropout time: " <<
//dropout_time << "\n";
}
// 𝜕𝐸 / 𝜕𝑦[𝑙−1] = 𝜕𝐸 / 𝜕𝑦[𝑙] ∗ 𝑊 ^𝑇
void back_propagation(const tensor_t& in_data, const tensor_t& out_data,
tensor_t& out_grad, tensor_t& in_grad) override {
if (act_) {
// for (size_t j = 0; j < z; ++j)
galois::do_all(
galois::iterate((size_t)0, x),
[&](const auto& i) {
for (size_t j = 0; j < z; ++j)
// if (out_data[i][j] <= 0.0) out_temp[i][j] = 0.0;
out_temp[i * z + j] =
out_data[i][j] > float_t(0) ? out_grad[i][j] : float_t(0);
},
galois::loopname("d_relu"));
//} else out_temp = out_grad; // TODO: avoid copying
} else
copy2D1D(out_grad, out_temp);
if (level_ != 0) { // no need to calculate in_grad for the first layer
vec_t trans_W(z * y);
transpose(y, z, W,
trans_W); // derivative of matmul needs transposed matrix
matmul1D1D(x, y, z, out_temp, trans_W, in_temp); // x*z; z*y -> x*y
update_all(graph, in_temp, in_grad, true,
norm_factor); // x*x; x*y -> x*y NOTE: since graph is
// symmetric, the derivative is the same
if (dropout_) {
galois::do_all(
galois::iterate((size_t)0, x),
[&](const auto& i) {
d_dropout(in_grad[i], dropout_mask[i], in_grad[i]);
},
galois::chunk_size<CHUNK_SIZE>(), galois::steal(),
galois::loopname("d_dropout"));
}
}
// calculate weight gradients
transpose2D1D(in_data, trans_data); // y*x
matmul1D1D(y, z, x, trans_data, out_temp, weight_grad); // y*x; x*z; y*z
}
void degree_counting() {
assert(x == graph->size());
degrees.resize(x);
galois::do_all(
galois::iterate((size_t)0, x),
[&](auto v) {
degrees[v] = std::distance(graph->edge_begin(v), graph->edge_end(v));
},
galois::loopname("DegreeCounting"));
}
// for each vertex v, compute pow(|N(v)|, -0.5), where |N(v)| is the degree of
// v
void norm_factor_counting() {
degree_counting();
norm_factor.resize(x);
galois::do_all(
galois::iterate((size_t)0, x),
[&](auto v) {
float_t temp = std::sqrt(float_t(degrees[v]));
if (temp == 0.0)
norm_factor[v] = 0.0;
else
norm_factor[v] = 1.0 / temp;
},
galois::loopname("NormCounting"));
}
private:
Graph* graph;
bool act_; // whether to use activation function at the end
bool norm_; // whether to normalize data
bool bias_; // whether to add bias afterwards
bool dropout_; // whether to use dropout at first
net_phase phase_;
size_t x;
size_t y;
size_t z;
vec_t out_temp;
vec_t in_temp;
vec_t trans_data; // y*x
std::vector<unsigned> degrees;
std::vector<float_t>
norm_factor; // normalization constant based on graph structure
std::vector<std::vector<unsigned>> dropout_mask;
// Glorot & Bengio (AISTATS 2010) init
inline void rand_init_matrix(size_t dim_x, size_t dim_y, vec_t& matrix) {
auto init_range = sqrt(6.0 / (dim_x + dim_y));
std::default_random_engine rng;
std::uniform_real_distribution<float_t> dist(-init_range, init_range);
matrix.resize(dim_x * dim_y);
for (size_t i = 0; i < dim_x; ++i) {
for (size_t j = 0; j < dim_y; ++j)
matrix[i * dim_y + j] = dist(rng);
}
}
inline void zero_init_matrix(size_t dim_x, size_t dim_y, vec_t& matrix) {
matrix.resize(dim_x * dim_y);
for (size_t i = 0; i < dim_x; ++i) {
for (size_t j = 0; j < dim_y; ++j)
matrix[i * dim_y + j] = 0;
}
}
};
| 36.469828 | 81 | 0.569318 |
d6e86379964c0d337bb04498eac448a2b5c444da | 5,278 | h | C | lib-src/libsoxr/src/cr.h | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 7,892 | 2015-03-31T09:24:05.000Z | 2022-03-31T12:30:32.000Z | lib-src/libsoxr/src/cr.h | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,050 | 2015-04-03T13:27:52.000Z | 2022-03-31T19:14:10.000Z | lib-src/libsoxr/src/cr.h | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,613 | 2015-03-26T11:28:10.000Z | 2022-03-30T13:17:03.000Z | /* SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net
* Licence for this file: LGPL v2.1 See LICENCE for details. */
#if !defined soxr_cr_included
#define soxr_cr_included
#define FIFO_SIZE_T int
#include "fifo.h"
typedef void real; /* float or double */
struct stage;
typedef void (* stage_fn_t)(struct stage * input, fifo_t * output);
typedef struct half_fir_info {
int num_coefs;
real const * coefs;
stage_fn_t fn, dfn;
float att;
} half_fir_info_t;
typedef struct {float scalar; stage_fn_t fn;} poly_fir1_t;
typedef struct {float beta; poly_fir1_t interp[3];} poly_fir_t;
#define U100_l 42
#define MULT32 (65536. * 65536.)
/* Conceptually: coef_p is &coefs[num_phases][fir_len][interp_order+1]: */
#define coef(coef_p, interp_order, fir_len, phase_num, coef_interp_num, fir_coef_num) (coef_p)[\
(fir_len) * ((interp_order) + 1) * (phase_num) + \
((interp_order) + 1) * (fir_coef_num) + \
((interp_order) - (coef_interp_num))]
/* Conceptually: coef_p is &coefs[num_phases][fir_len/4][interp_order+1][4]: */
#define coef4(coef_p, interp_order, fir_len, phase_num, coef_interp_num, fir_coef_num) (coef_p)[\
(fir_len) * ((interp_order) + 1) * (phase_num) + \
((interp_order) + 1) * ((fir_coef_num) & ~3) + \
4 * ((interp_order) - (coef_interp_num)) + \
((fir_coef_num) & 3)]
typedef union { /* Int64 in parts */
#if HAVE_BIGENDIAN
struct {int32_t ms; uint32_t ls;} parts;
#else
struct {uint32_t ls; int32_t ms;} parts;
#endif
int64_t all;
} int64p_t;
typedef union { /* Uint64 in parts */
#if HAVE_BIGENDIAN
struct {uint32_t ms, ls;} parts;
#else
struct {uint32_t ls, ms;} parts;
#endif
uint64_t all;
} uint64p_t;
typedef struct {
int dft_length, num_taps, post_peak;
void * dft_forward_setup, * dft_backward_setup;
real * coefs;
} dft_filter_t;
typedef struct { /* So generated filter coefs may be shared between channels */
real * poly_fir_coefs;
dft_filter_t dft_filter[2];
} rate_shared_t;
typedef double float_step_t; /* Or long double or __float128. */
typedef union { /* Fixed point arithmetic */
struct {uint64p_t ls; int64p_t ms;} fix; /* Hi-prec has ~96 bits. */
float_step_t flt;
} step_t;
#define integer fix.ms.parts.ms
#define fraction fix.ms.parts.ls
#define whole fix.ms.all
#define CORE_DBL 1
#define CORE_SIMD_POLY 2
#define CORE_SIMD_HALF 4
#define CORE_SIMD_DFT 8
#define LOG2_SIZEOF_REAL(core_flags) (2 + ((core_flags) & 1))
typedef int core_flags_t;
#if defined SOXR_LIB
#include "rdft_t.h"
#else
typedef void fn_t;
#endif
typedef struct stage {
int num;
/* Common to all stage types: */
core_flags_t core_flags;
stage_fn_t fn;
fifo_t fifo;
int pre; /* Number of past samples to store */
int pre_post; /* pre + number of future samples to store */
int preload; /* Number of zero samples to pre-load the fifo */
double out_in_ratio; /* For buffer management. */
int input_size;
bool is_input;
/* For a stage with variable (run-time generated) filter coefs: */
fn_t const * rdft_cb;
rate_shared_t * shared;
unsigned dft_filter_num; /* Which, if any, of the 2 DFT filters to use */
real * dft_scratch;
float * dft_out;
real const * coefs;
/* For a stage with variable L/M: */
step_t at, step;
bool use_hi_prec_clock;
int L, remM;
int n, phase_bits, block_len;
double mult, phase0;
} stage_t;
#define stage_occupancy(s) max(0, fifo_occupancy(&(s)->fifo) - (s)->pre_post)
#define stage_read_p(s) ((sample_t *)fifo_read_ptr(&(s)->fifo) + (s)->pre)
#define lq_bw0 (1385/2048.) /* ~.67625, FP exact. */
typedef enum {rolloff_small, rolloff_medium, rolloff_none} rolloff_t;
typedef struct {
void * (* alloc)(size_t);
void * (* calloc)(size_t, size_t);
void (* free)(void *);
} alloc_t;
typedef struct {
alloc_t mem;
half_fir_info_t const * half_firs;
size_t half_firs_len;
half_fir_info_t const * doub_firs;
size_t doub_firs_len;
stage_fn_t cubic_stage_fn;
poly_fir_t const * poly_firs;
fn_t * rdft_cb;
} cr_core_t;
typedef struct rate rate_t;
struct rate {
cr_core_t const * core;
double io_ratio;
int64_t samples_in, samples_out;
int num_stages, flushing;
stage_t * stages;
};
#if defined SOXR_LIB
#include "soxr.h"
char const * _soxr_init(
rate_t * const p, /* Per audio channel. */
rate_shared_t * const shared, /* Between channels (undergoing same rate change)*/
double const io_ratio, /* Input rate divided by output rate. */
soxr_quality_spec_t const * const q_spec,
soxr_runtime_spec_t const * const r_spec,
double multiplier, /* Linear gain to apply during conversion. 1 */
cr_core_t const * const core,
core_flags_t const);
void _soxr_process(struct rate * p, size_t olen);
real * _soxr_input(struct rate * p, real const * samples, size_t n);
real const * _soxr_output(struct rate * p, real * samples, size_t * n0);
void _soxr_flush(struct rate * p);
void _soxr_close(struct rate * p);
double _soxr_delay(struct rate * p);
void _soxr_sizes(size_t * shared, size_t * channel);
#endif
#endif
| 29.486034 | 97 | 0.674498 |
d6e99516d2a780ddb22333dc7bf914027350c802 | 502 | c | C | src/examples/noop.c | jamescasbon/genometools | 1187295df99c67f7083a2f4ed6bd39bfbdf1a7be | [
"MIT"
] | 2 | 2018-06-04T01:11:02.000Z | 2018-11-30T20:04:01.000Z | src/examples/noop.c | jamescasbon/genometools | 1187295df99c67f7083a2f4ed6bd39bfbdf1a7be | [
"MIT"
] | null | null | null | src/examples/noop.c | jamescasbon/genometools | 1187295df99c67f7083a2f4ed6bd39bfbdf1a7be | [
"MIT"
] | null | null | null | /* Public domain. */
#include "genometools.h" /* include the GenomeTools ``all-in-one'' header */
int main(GT_UNUSED int argc, GT_UNUSED char *argv[])
{
if (gt_version_check(GT_MAJOR_VERSION, GT_MINOR_VERSION, GT_MICRO_VERSION)) {
fprintf(stderr, "error: %s\n", gt_version_check(GT_MAJOR_VERSION,
GT_MINOR_VERSION,
GT_MICRO_VERSION));
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
| 31.375 | 79 | 0.581673 |
d6ea110951cfb3dd8a0e1c088fe923a6a5461b6e | 550 | h | C | SmartUtils/Classes/SmartUtils/category/SafeFoundation/NSObject+swizzle.h | fanhua0429/SmartUtils | 25490dca71b66b901c687a0f32af9806bf5d82de | [
"MIT"
] | 1 | 2020-06-09T07:00:05.000Z | 2020-06-09T07:00:05.000Z | SmartUtils/Classes/SmartUtils/category/SafeFoundation/NSObject+swizzle.h | fanhua0429/SmartUtils | 25490dca71b66b901c687a0f32af9806bf5d82de | [
"MIT"
] | null | null | null | SmartUtils/Classes/SmartUtils/category/SafeFoundation/NSObject+swizzle.h | fanhua0429/SmartUtils | 25490dca71b66b901c687a0f32af9806bf5d82de | [
"MIT"
] | null | null | null | //
// NSObject+swizzle.h
// FreeCitizen
//
// Created by 林杜波 on 2018/4/28.
// Copyright © 2018年 pingan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (swizzle)
/// NSArray / NSDictionary 为类族,方法实现在实际子类上,需要先找到实际实现方法的子类
+ (void)smt_exchangeInstanceMethod:(SEL)originMethod ofClass:(NSString *)ofCls withMethod:(SEL)newMethod ofOtherClass:(NSString *)toCls;
+ (void)smt_exchangeClassMethod:(SEL)originMethod ofClass:(NSString *)ofCls withMethod:(SEL)newMethod ofOtherClass:(NSString *)toCls;
- (BOOL)isNull;
@end
| 27.5 | 136 | 0.756364 |
d6eb730c0fb08d4851c3fcb83578c8630b5cdd6f | 256 | h | C | bsp_for_art-badge/packages/persim-packages/include/js_dotindicator.h | Rbb666/SDK | cdf0bfeeb35b989ccf13c41b9625059de5fec87b | [
"Apache-2.0"
] | null | null | null | bsp_for_art-badge/packages/persim-packages/include/js_dotindicator.h | Rbb666/SDK | cdf0bfeeb35b989ccf13c41b9625059de5fec87b | [
"Apache-2.0"
] | null | null | null | bsp_for_art-badge/packages/persim-packages/include/js_dotindicator.h | Rbb666/SDK | cdf0bfeeb35b989ccf13c41b9625059de5fec87b | [
"Apache-2.0"
] | null | null | null | #pragma once
#include <pm_dotindicator.h>
#include "js_utility.h"
class JsDotIndicator : public persim::DotIndicator
{
public:
JsDotIndicator();
virtual ~JsDotIndicator();
virtual void setData(JsPage *page, const JsValue &data);
private:
};
| 17.066667 | 60 | 0.726563 |
d6ebaf2fec542cb650d4ff71f8663bbf926e3f41 | 1,445 | h | C | proj/alog/797. All Paths From Source to Target/797. All Paths From Source to Target.h | andy-sheng/leetcode | 1fa070036f31d0bd18a9a11a5c771641f3cd9a03 | [
"MIT"
] | null | null | null | proj/alog/797. All Paths From Source to Target/797. All Paths From Source to Target.h | andy-sheng/leetcode | 1fa070036f31d0bd18a9a11a5c771641f3cd9a03 | [
"MIT"
] | null | null | null | proj/alog/797. All Paths From Source to Target/797. All Paths From Source to Target.h | andy-sheng/leetcode | 1fa070036f31d0bd18a9a11a5c771641f3cd9a03 | [
"MIT"
] | null | null | null | //
// 797. All Paths From Source to Target.h
// leetcode
//
// Created by andysheng on 2019/10/17.
// Copyright © 2019 Andy. All rights reserved.
//
#ifndef _97__All_Paths_From_Source_to_Target_h
#define _97__All_Paths_From_Source_to_Target_h
#include <vector>
using namespace std;
namespace AllPathsFromSourceToTarget {
class Solution {
public:
vector<vector<int>> allPathsSourceTarget(vector<vector<int>>& graph) {
vector<vector<int>> ret;
vector<int> path;
allPathsSourceTarget(graph, ret, path, 0, (int)graph.size() - 1);
return ret;
}
void allPathsSourceTarget(vector<vector<int>> &graph,
vector<vector<int>> &ret,
vector<int> &path,
int from,
int to) {
if (from == to) {
path.push_back(from);
ret.push_back(vector<int> (path.begin(), path.end()));
path.pop_back();
return;
}
path.push_back(from);
for (int i = 0; i < graph[from].size(); ++i) {
allPathsSourceTarget(graph, ret, path, graph[from][i], (int)graph.size() - 1);
}
path.pop_back();
}
};
}
#endif /* _97__All_Paths_From_Source_to_Target_h */
| 32.111111 | 94 | 0.50519 |
d6ec76f0580336f55e4eb17c5c94b0434af81be2 | 3,660 | h | C | headers/rcl_interfaces/msg/dds_connext/IntraProcessMessage_.h | TimWhiting/rcldart | 8e803d373c7db77755aade369a6f85bd0d3eb737 | [
"MIT"
] | 3 | 2021-05-25T10:34:44.000Z | 2021-11-30T09:26:42.000Z | headers/rcl_interfaces/msg/dds_connext/IntraProcessMessage_.h | TimWhiting/rcldart | 8e803d373c7db77755aade369a6f85bd0d3eb737 | [
"MIT"
] | 2 | 2021-11-30T07:12:41.000Z | 2022-01-11T15:58:09.000Z | headers/rcl_interfaces/msg/dds_connext/IntraProcessMessage_.h | TimWhiting/rcldart | 8e803d373c7db77755aade369a6f85bd0d3eb737 | [
"MIT"
] | 2 | 2021-05-14T21:13:14.000Z | 2021-11-30T09:26:45.000Z |
/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from IntraProcessMessage_.idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the RTI Connext manual.
*/
#ifndef IntraProcessMessage__501161066_h
#define IntraProcessMessage__501161066_h
#ifndef NDDS_STANDALONE_TYPE
#ifndef ndds_cpp_h
#include "ndds/ndds_cpp.h"
#endif
#else
#include "ndds_standalone_type.h"
#endif
namespace rcl_interfaces {
namespace msg {
namespace dds_ {
extern const char *IntraProcessMessage_TYPENAME;
struct IntraProcessMessage_Seq;
#ifndef NDDS_STANDALONE_TYPE
class IntraProcessMessage_TypeSupport;
class IntraProcessMessage_DataWriter;
class IntraProcessMessage_DataReader;
#endif
class IntraProcessMessage_
{
public:
typedef struct IntraProcessMessage_Seq Seq;
#ifndef NDDS_STANDALONE_TYPE
typedef IntraProcessMessage_TypeSupport TypeSupport;
typedef IntraProcessMessage_DataWriter DataWriter;
typedef IntraProcessMessage_DataReader DataReader;
#endif
DDS_UnsignedLongLong publisher_id_ ;
DDS_UnsignedLongLong message_sequence_ ;
};
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, start exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport __declspec(dllexport)
#endif
NDDSUSERDllExport DDS_TypeCode* IntraProcessMessage__get_typecode(void); /* Type code */
DDS_SEQUENCE(IntraProcessMessage_Seq, IntraProcessMessage_);
NDDSUSERDllExport
RTIBool IntraProcessMessage__initialize(
IntraProcessMessage_* self);
NDDSUSERDllExport
RTIBool IntraProcessMessage__initialize_ex(
IntraProcessMessage_* self,RTIBool allocatePointers,RTIBool allocateMemory);
NDDSUSERDllExport
RTIBool IntraProcessMessage__initialize_w_params(
IntraProcessMessage_* self,
const struct DDS_TypeAllocationParams_t * allocParams);
NDDSUSERDllExport
void IntraProcessMessage__finalize(
IntraProcessMessage_* self);
NDDSUSERDllExport
void IntraProcessMessage__finalize_ex(
IntraProcessMessage_* self,RTIBool deletePointers);
NDDSUSERDllExport
void IntraProcessMessage__finalize_w_params(
IntraProcessMessage_* self,
const struct DDS_TypeDeallocationParams_t * deallocParams);
NDDSUSERDllExport
void IntraProcessMessage__finalize_optional_members(
IntraProcessMessage_* self, RTIBool deletePointers);
NDDSUSERDllExport
RTIBool IntraProcessMessage__copy(
IntraProcessMessage_* dst,
const IntraProcessMessage_* src);
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, stop exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport
#endif
} /* namespace dds_ */
} /* namespace msg */
} /* namespace rcl_interfaces */
#endif /* IntraProcessMessage_ */
| 33.888889 | 100 | 0.650273 |
d6eca586e09756b77951bbf99d8671b7e2e1a90b | 2,954 | c | C | old_subjects_(now_not_supported)/Rush02/v4.0/srcs/all_rushes.c | ShadowOfBeing/COMPLETED_PISCINE_C | 5e518b135a694ffb850a8bf0af9a7c3637584b3a | [
"MIT"
] | 180 | 2020-12-26T19:36:48.000Z | 2022-03-31T02:49:42.000Z | old_subjects_(now_not_supported)/Rush02/v4.0/srcs/all_rushes.c | HALIP192/COMPLETED_PISCINE_C | c4b9be847e55bb9611ef78b8a9a2acfcf3c828f3 | [
"MIT"
] | 5 | 2021-01-23T11:59:02.000Z | 2022-03-20T16:36:56.000Z | old_subjects_(now_not_supported)/Rush02/v4.0/srcs/all_rushes.c | HALIP192/COMPLETED_PISCINE_C | c4b9be847e55bb9611ef78b8a9a2acfcf3c828f3 | [
"MIT"
] | 83 | 2021-01-19T01:18:58.000Z | 2022-03-20T20:48:39.000Z |
#include "ft_rush.h"
char *ft_rush00(int x, int y)
{
int c;
int r;
int i;
char *result;
result = (char *)malloc(sizeof(char) * (y * (x + 1) + 1));
i = 0;
c = 1;
r = 0;
if (x < 1 && y < 1)
return (0);
while (r++ <= (y - 1))
{
while (c <= x)
{
if ((r == 1 || r == y) && (c == 1 || c == x))
result[i++] = 'o';
else if ((r > 1 && r < y) && (c > 1 && c < x))
result[i++] = ' ';
else if (r == 1 || r == y)
result[i++] = '-';
else
result[i++] = '|';
++c;
}
result[i++] = '\n';
c = 1;
}
result[i] = '\0';
return (result);
}
char *ft_rush01(int x, int y)
{
int c;
int r;
int i;
char *result;
result = (char *)malloc(sizeof(char) * (y * (x + 1) + 1));
i = 0;
c = 1;
r = 0;
if (x < 1 && y < 1)
return (0);
while (r++ <= (y - 1))
{
while (c <= x)
{
if ((r == 1 && c == 1) || (r == y && c == x && x != 1 && y != 1))
result[i++] = '/';
else if (((r == y && c == 1) || (r == 1 && c == x)))
result[i++] = '\\';
else if ((r > 1 && r < y) && (c > 1 && c < x))
result[i++] = ' ';
else
result[i++] = '*';
++c;
}
result[i++] = '\n';
c = 1;
}
result[i] = '\0';
return (result);
}
char *ft_rush02(int x, int y)
{
int c;
int r;
int i;
char *result;
result = (char *)malloc(sizeof(char) * (y * (x + 1) + 1));
i = 0;
c = 1;
r = 0;
if (x < 1 && y < 1)
return (0);
while (r++ <= (y - 1))
{
while (c <= x)
{
if ((r == 1 && c == 1) || (r == 1 && c == x && x != 1))
result[i++] = 'A';
else if ((r == y && c == 1) || (r == y && c == x && y != 1))
result[i++] = 'C';
else if ((r > 1 && r < y) && (c > 1 && c < x))
result[i++] = ' ';
else
result[i++] = 'B';
++c;
}
result[i++] = '\n';
c = 1;
}
result[i] = '\0';
return (result);
}
char *ft_rush03(int x, int y)
{
int c;
int r;
int i;
char *result;
result = (char *)malloc(sizeof(char) * (y * (x + 1) + 1));
i = 0;
c = 1;
r = 0;
if (x < 1 && y < 1)
return (0);
while (r++ <= (y - 1))
{
while (c <= x)
{
if ((r == 1 && c == 1) || (r == y && c == 1))
result[i++] = 'A';
else if ((r == 1 && c == x) || (r == y && c == x))
result[i++] = 'C';
else if ((r > 1 && r < y) && (c > 1 && c < x))
result[i++] = ' ';
else
result[i++] = 'B';
++c;
}
result[i++] = '\n';
c = 1;
}
result[i] = '\0';
return (result);
}
char *ft_rush04(int x, int y)
{
int c;
int r;
int i;
char *result;
result = (char *)malloc(sizeof(char) * (y * (x + 1) + 1));
i = 0;
c = 1;
r = 0;
if (x < 1 && y < 1)
return (0);
while (r++ <= (y - 1))
{
while (c <= x)
{
if ((r == 1 && c == 1) || (r == y && c == x && x != 1 && y != 1))
result[i++] = 'A';
else if (((r == y && c == 1) || (r == 1 && c == x)))
result[i++] = 'C';
else if ((r > 1 && r < y) && (c > 1 && c < x))
result[i++] = ' ';
else
result[i++] = 'B';
++c;
}
result[i++] = '\n';
c = 1;
}
result[i] = '\0';
return (result);
} | 17.47929 | 68 | 0.363236 |
d6ede0cfd650bc76737a5d9869f913b53b603c2f | 2,914 | c | C | Examples/4/CPointers.c | avenatti/LearningCProgramming | 57885d4cdec2163da347ea4ae32570b877c12782 | [
"MIT"
] | 3 | 2022-02-27T18:59:14.000Z | 2022-02-28T22:51:06.000Z | Examples/4/CPointers.c | avenatti/LearningCProgramming | 57885d4cdec2163da347ea4ae32570b877c12782 | [
"MIT"
] | null | null | null | Examples/4/CPointers.c | avenatti/LearningCProgramming | 57885d4cdec2163da347ea4ae32570b877c12782 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
void main() {
// 1. Pointer and pointee are seperate -- don't forget to setup the pointee
// 2. Pointer dereferencing allows access to its pointee
// 3. Pointer Assignment (=) between pointers makes the point to the same pointee (sharing)
// standard pointer
int n = 10;
int *p = &n; // Variable p of type pointer is pointing to the address of the variable n of type integer
printf("Address of p variable is %x \n",p); // p contains the address of the number therefore printing p gives the address of number.
printf("Value of p variable is %d \n",*p); // As we know that * i
int *a; //pointer to int
char *c; //pointer to char
// pointer to array
int arr[10];
int *p[10]=&arr; // variable p of type pointer is pointing to the address of an integer array arr
// pointer to structure
struct st {
int i;
float f;
} ref;
struct st *p = &ref;
}
// pointer to function
void show (int);
void(*p)(int)=&show;
// ! Advantages of pointers
// 1. pointers reduce code and improves performance
// 2. return multiple values from a function
// 3. Access any memory location
// ! Usage of Pointers
// 1. Dynamic memory allocation --> in c language, dynamically allocate memory using malloc()
// and calloc() functions where the pointer is used
// 2. Arrays, Functions, Structures --> pointers are widely used in arrays, functions, and structures
// ! Address Of (&) Operator
// '&' returns the address of a variable. use %u to display the address of the variable.
// printf("value of number is %d, address of number is %u",number,&number);
// ! NULL Pointer
// If you have no value for a pointer at declaration initialize it to NULL;
// int *p=NULL;
// ! Reading Complex Pointers
// (): This operator is a bracket operator used to declare and define the function.
// []: This operator is an array subscript operator
// * : This operator is a pointer operator.
// Identifier: It is the name of the pointer.
// Data type: Data type is the type of the variable to which the pointer is intended to point.
// Operator | Precedence | Associativity
// (), [] | 1 | Left to right
// *, identifier| 2 | Right to left
// Data type | 3 | N/A
// ! Example (Read the pointer): int (*p)[10]
// 1. () and [] are equal so left to right therefor ()
// 2. name and identifier in () are equal so right to left
// The pointer will be read as p is a pointer to an array of integers of size 10.
// char -> 4 , * -> 2, p -> 1, [10] -> 3
// ! Example (read the pointer): int (*p)(int (*)[2], int (*)void))
// P is a pointer to a function that accepts 1d int array of size two as 1st param
// and pointer to function which param is void...return type int
| 35.536585 | 143 | 0.63315 |
d6edff8e4d10dbacf2f0fb7b78e94a3f6f740242 | 382 | c | C | sr/lsri/lib/libsys/sys_readbios.c | ducis/operating-system-labs | 7df84f3dae792ee96461497b7d47414d24d233ee | [
"MIT"
] | 2 | 2018-03-01T13:45:41.000Z | 2018-03-01T14:11:47.000Z | src.clean/lib/libsys/sys_readbios.c | ducis/operating-system-labs | 7df84f3dae792ee96461497b7d47414d24d233ee | [
"MIT"
] | null | null | null | src.clean/lib/libsys/sys_readbios.c | ducis/operating-system-labs | 7df84f3dae792ee96461497b7d47414d24d233ee | [
"MIT"
] | null | null | null | #include "syslib.h"
PUBLIC int sys_readbios(address, buf, size)
phys_bytes address; /* Absolute memory address */
void *buf; /* Buffer to store the results */
size_t size; /* Amount of data to read */
{
/* Read data from BIOS locations */
message m;
m.RDB_SIZE = size;
m.RDB_ADDR = address;
m.RDB_BUF = buf;
return(_kernel_call(SYS_READBIOS, &m));
}
| 23.875 | 51 | 0.651832 |
d6f065073aee9b08803e4417eec7c155292d2a4c | 767 | h | C | System/Library/PrivateFrameworks/CoreHandwriting.framework/CHTransliterateChineseStep.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | 1 | 2020-11-04T15:43:01.000Z | 2020-11-04T15:43:01.000Z | System/Library/PrivateFrameworks/CoreHandwriting.framework/CHTransliterateChineseStep.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/CoreHandwriting.framework/CHTransliterateChineseStep.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | /*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:52:43 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/CoreHandwriting.framework/CoreHandwriting
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
#import <CoreHandwriting/CHPostprocessingStep.h>
@interface CHTransliterateChineseStep : CHPostprocessingStep {
void* _icuTransliterator;
}
@property (assign,nonatomic) void* icuTransliterator; //@synthesize icuTransliterator=_icuTransliterator - In the implementation block
-(id)process:(id)arg1 ;
-(void)dealloc;
-(id)init;
-(void*)icuTransliterator;
-(void)setIcuTransliterator:(void*)arg1 ;
@end
| 30.68 | 147 | 0.770535 |
d6f08dba137c2893afdb1bb7faaa62a190a873c9 | 670 | c | C | 05-1 - Intersezione tra array/IntersezioneArray.c | alessandro-antonelli/ALL-2014 | b28598942e12135386914297fc5c0052d5d279e5 | [
"CC0-1.0"
] | null | null | null | 05-1 - Intersezione tra array/IntersezioneArray.c | alessandro-antonelli/ALL-2014 | b28598942e12135386914297fc5c0052d5d279e5 | [
"CC0-1.0"
] | null | null | null | 05-1 - Intersezione tra array/IntersezioneArray.c | alessandro-antonelli/ALL-2014 | b28598942e12135386914297fc5c0052d5d279e5 | [
"CC0-1.0"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
int ContaElComuni(int* a, int dima, int* b, int dimb)
{
int i, j, trovato;
int conteggio = 0;
for(i=0; i<dima; i++)
{
j=0; trovato = 0;
while(j<dimb && !trovato)
{
if(a[i] == b[j]) trovato = 1;
j++;
}
if(trovato) conteggio++;
}
return conteggio;
}
int main()
{
int i;
int dima;
scanf("%d", &dima);
int* a = malloc(dima * sizeof(int));
for(i=0; i<dima; i++) scanf("%d", &a[i]);
int dimb;
scanf("%d", &dimb);
int* b = malloc(dimb * sizeof(int));
for(i=0; i<dimb; i++) scanf("%d", &b[i]);
int comuni = ContaElComuni(a, dima, b, dimb);
free(a); free(b);
printf("%d\n", comuni);
return 0;
}
| 15.952381 | 53 | 0.549254 |
d6f1197bd1a0061fa01f390da62db1a38713e28a | 1,378 | h | C | Arduino/Microcode/Bitset.h | visrealm/vrcpu | f42ae80bd1e89e3877b88f1766f5facc5841594f | [
"MIT"
] | 102 | 2019-09-24T21:12:05.000Z | 2022-02-20T06:51:25.000Z | Arduino/Microcode/Bitset.h | visrealm/vrcpu | f42ae80bd1e89e3877b88f1766f5facc5841594f | [
"MIT"
] | null | null | null | Arduino/Microcode/Bitset.h | visrealm/vrcpu | f42ae80bd1e89e3877b88f1766f5facc5841594f | [
"MIT"
] | 13 | 2019-09-25T19:52:10.000Z | 2021-09-24T00:44:40.000Z | /*
* Bitset class. Pack an array of booleans into bits.
*
* Copyright (c) 2019 Troy Schrapel
*
* This code is licensed under the MIT license
*
* https://github.com/visrealm/vrcpu
*
*/
template <size_t BITS>
class Bitset
{
public:
Bitset()
{
clear();
}
/*
* clear the bitset - set all values to true or false
*/
void clear(bool value = false)
{
memset(m_bytes, value ? 0xffffffff : 0x00, bytes());
}
/*
* set a single bit to true or false
*/
void set(size_t b, bool value)
{
size_t by = byteIndex(b);
if (by != (size_t)-1)
{
if (value)
bitSet(m_bytes[by], bitIndex(b));
else
bitClear(m_bytes[by], bitIndex(b));
}
}
/*
* query a single bit
*/
bool isSet(size_t b) const
{
size_t by = byteIndex(b);
if (by != (size_t)-1)
{
return bitRead(m_bytes[by], bitIndex(b));
}
return false;
}
/*
* size of storage in bytes
*/
size_t bytes() const { return sizeof(m_bytes); }
private:
size_t byteIndex(size_t b) const
{
if (b < BITS)
{
return b / 8;
}
return (size_t)-1;
}
size_t bitIndex(size_t b) const
{
return b % 8;
}
private:
byte m_bytes[(BITS >> 3) + 1];
};
| 16.804878 | 58 | 0.504354 |
d6f1f65e670ab99391ac9f8f075675dbb71ff1f2 | 499 | h | C | src/AdventOfCode2017/Day08-LikeRegisters/Condition.h | dbartok/advent-of-code-cpp | c8c2df7a21980f8f3e42128f7bc5df8288f18490 | [
"MIT"
] | null | null | null | src/AdventOfCode2017/Day08-LikeRegisters/Condition.h | dbartok/advent-of-code-cpp | c8c2df7a21980f8f3e42128f7bc5df8288f18490 | [
"MIT"
] | null | null | null | src/AdventOfCode2017/Day08-LikeRegisters/Condition.h | dbartok/advent-of-code-cpp | c8c2df7a21980f8f3e42128f7bc5df8288f18490 | [
"MIT"
] | null | null | null | #pragma once
#include "State.h"
#include <AdventOfCodeCommon/DisableLibraryWarningsMacros.h>
__BEGIN_LIBRARIES_DISABLE_WARNINGS
#include <string>
__END_LIBRARIES_DISABLE_WARNINGS
namespace AdventOfCode
{
namespace Year2017
{
namespace Day08
{
class Condition
{
public:
Condition(std::string registerName, std::string symbol, int argument) noexcept;
bool isTrue(const State& state) const;
private:
std::string m_registerName;
std::string m_symbol;
int m_argument;
};
}
}
}
| 15.121212 | 83 | 0.765531 |
d6f20527edb97e49e0280ada200e2be107ae6061 | 42,098 | c | C | src/allSurf.c | Loop3D/noddyverse | d9cd3a95f24ae79f5aa580b4f8f9974011ca41f2 | [
"MIT"
] | 3 | 2022-01-11T01:31:25.000Z | 2022-03-08T03:11:39.000Z | src/allSurf.c | Loop3D/noddyverse | d9cd3a95f24ae79f5aa580b4f8f9974011ca41f2 | [
"MIT"
] | null | null | null | src/allSurf.c | Loop3D/noddyverse | d9cd3a95f24ae79f5aa580b4f8f9974011ca41f2 | [
"MIT"
] | 3 | 2021-10-15T10:22:33.000Z | 2022-02-04T09:21:11.000Z | /* **************************************************************************
** After dividing a voxel up into 5 tetrathedra, each one is processed in turn
** based on its tetcode, which depends on the number of different discontinuity
** codes in a tetrahedron. These codes are defined as:
**
**
** A A A A A
** / |\ / |\ / |\ / |\ / |\
** / | \ / | \ / | \ / | \ / | \
** A ..|..A A ..|..A B ..|..C B ..|..B B ..|..C
** \ | / \ | / \ | / \ | / \ | /
** \ |/ \ |/ \ |/ \ |/ \ |/
** A B A A D
**
** Alpha Beta Gamma Delta Epsilon
**
** Alpha Code: all discontinuity codes the same
** therefore any given level can be contoured by 1 flat surface
**
** Beta Code: one different, so a level can only intersect two A-A edges,
** or occasionally a plane can intersect all three As. For former
** case the line is projected onto a triangular plane that
** separate AAA from B and we then have to cut up this triangle
** into bits.
**
** Gamma Code: two different, so a level can only intersect one A-A
** veredgetex, or occasionally a plane can intersect all two As.
** For former case the point is projected onto a complex plane
** that separate AA from B and C and we then have to cut up this
** plane into bits.
**
** Delta Code: 2 sets of two different, so a level can only intersect one
** A-A edge, or one B-B edge, or occasionally a plane can
** intersect all two As or Bs In the former case the point is
** projected onto a flat plane that separate AA from BB and we
** then have to cut up this trapezoidal plane into bits.
**
** Epsilon Code: all codes different, so complex planes separate A,B,C and D
**
**************************************************************************** */
#include "xvt.h"
#include "noddy.h"
#include "nodInc.h"
#include "3d.h"
#include "3dExtern.h"
#include "3dDraw.h"
#include "allSurf.h"
#include <math.h>
#if (XVTWS != MACWS)
#include <malloc.h>
#endif
#define DEBUG(X)
/* ********************************** */
/* External Globals used in this file */
#if XVT_CC_PROTO
extern int cypherDiff(int, int, unsigned char **);
extern int lastdiff (unsigned char *, unsigned char *);
extern int dxopen(char *);
extern void setDxfFile (FILE *);
extern int dxclose();
extern void AlphaCode(double [8], double [8][3], int [8], TETINFO *);
extern void BetaCode(double [8], double [8][3], int [8], TETINFO *);
extern void GammaCode(double [8], double [8][3], int [8], TETINFO *);
extern void DeltaCode(double [8], double [8][3], int [8], TETINFO *);
extern void EpsilonCode(double [8][3], int [8], TETINFO *);
extern void qSortPoints(THREED_POINT_INFO __huge *, int, int, int);
extern int dxfa3l(float *, float *, float *);
extern int dxpl3l(float *,float *,float *,int,int);
extern FILE *getDxfFile ();
int allSetVerts(STORY ***, double ***, double [8][3], double [8], int [8],
int, int, int, double, int, unsigned char **);
int allDisplayPlane(double, int, int, int);
int Skinny(double [4][3]);
int tooLong(double [4][3]);
#else
extern int cypherDiff();
extern int lastdiff ();
extern int dxopen();
extern void setDxfFile ();
extern int dxclose();
extern void AlphaCode();
extern void BetaCode();
extern void GammaCode();
extern void DeltaCode();
extern void EpsilonCode();
extern void qSortPoints();
extern int dxfa3l();
extern int dxpl3l();
extern FILE *getDxfFile ();
int allSetVerts();
int allDisplayPlane();
int Skinny();
int tooLong();
#endif
extern long connect;
extern THREED_VIEW_OPTIONS threedViewOptions;
extern PROJECT_OPTIONS projectOptions;
extern Point3d *cameraPos;
extern COLOR backgroundColor;
#define ALL_SURF_POINT_STORE 400*3
COLOR layerColor; /* global color of current layer */
char clayer[81]; /* global array for current layer name */
static int noTri; /* number of triangles */
static THREED_POINT_INFO __huge *alltri = (THREED_POINT_INFO __huge *) NULL;
static THREED_IMAGE_DATA *threedDataPtr;
long vertexcount;
int **CUBE = NULL;
int **TETAPICES = NULL;
int **TETLINES = NULL;
int **LINES = NULL;
int *eventsForStratLayers;
int numEventsForStratLayers;
static double plotScale;
#if XVT_CC_PROTO
static int allSurfStart ();
static int allSurfFinish ();
void SetTet(int, int, TETINFO *);
void allOneTetrahedron(double [8], double [8][3], int [8], TETINFO *, unsigned char **);
double MidVal(double, double, double);
int CalcTetCode(int, int, int, int, unsigned char **);
void oneDisplayPlane(double [4][3],int);
void ShadeXYZ(double [4][3], COLOR *, double, double, double);
void ShadeWhite(COLOR *);
void ShadeLambert(double [4][3], COLOR *);
double determinant(double [4][3], int);
LAYER_PROPERTIES *renderLayer (OBJECT *, int);
void WriteVulcanHeader(char *);
void add_underscore(char *, char *);
#else
static int allSurfStart ();
static int allSurfFinish ();
void SetTet();
void allOneTetrahedron();
double MidVal();
int CalcTetCode();
void oneDisplayPlane();
void ShadeXYZ();
void ShadeWhite();
void ShadeLambert();
double determinant();
LAYER_PROPERTIES *renderLayer ();
void WriteVulcanHeader ();
void add_underscore();
#endif
static int allSurfStart ()
{
noTri = 0;
vertexcount = 0;
/*coordinates of vertices of cube */
if (!(CUBE = (int **) create2DArray (8, 3, sizeof(int))))
return (FALSE);
CUBE[0][0]= 0; CUBE[0][1] = 0; CUBE[0][2] = 0; /* 0 A */
CUBE[1][0]= 1; CUBE[1][1] = 0; CUBE[1][2] = 0; /* 1 B */
CUBE[2][0]= 0; CUBE[2][1] = 1; CUBE[2][2] = 0; /* 2 C */
CUBE[3][0]= 1; CUBE[3][1] = 1; CUBE[3][2] = 0; /* 3 D */
CUBE[4][0]= 0; CUBE[4][1] = 0; CUBE[4][2] = 1; /* 4 E */
CUBE[5][0]= 1; CUBE[5][1] = 0; CUBE[5][2] = 1; /* 5 F */
CUBE[6][0]= 0; CUBE[6][1] = 1; CUBE[6][2] = 1; /* 6 G */
CUBE[7][0]= 1; CUBE[7][1] = 1; CUBE[7][2] = 1; /* 7 H */
/* Apices of each tetrahedra */
if (!(TETAPICES = (int **) create2DArray (10, 4, sizeof(int))))
{
allSurfFinish ();
return (FALSE);
}
TETAPICES[0][0] = 3; TETAPICES[0][1] = 5; TETAPICES[0][2] = 6; TETAPICES[0][3] = 7; /* 0 V */
TETAPICES[1][0] = 0; TETAPICES[1][1] = 4; TETAPICES[1][2] = 5; TETAPICES[1][3] = 6; /* 1 W */
TETAPICES[2][0] = 0; TETAPICES[2][1] = 2; TETAPICES[2][2] = 3; TETAPICES[2][3] = 6; /* 2 X */
TETAPICES[3][0] = 0; TETAPICES[3][1] = 1; TETAPICES[3][2] = 3; TETAPICES[3][3] = 5; /* 3 Y */
TETAPICES[4][0] = 0; TETAPICES[4][1] = 3; TETAPICES[4][2] = 5; TETAPICES[4][3] = 6; /* 4 Z */
/*repeat for 2nd cube */
TETAPICES[5][0] = 0; TETAPICES[5][1] = 1; TETAPICES[5][2] = 2; TETAPICES[5][3] = 4; /* 5 V */
TETAPICES[6][0] = 1; TETAPICES[6][1] = 4; TETAPICES[6][2] = 5; TETAPICES[6][3] = 7; /* 6 W */
TETAPICES[7][0] = 1; TETAPICES[7][1] = 2; TETAPICES[7][2] = 3; TETAPICES[7][3] = 7; /* 7 X */
TETAPICES[8][0] = 2; TETAPICES[8][1] = 4; TETAPICES[8][2] = 6; TETAPICES[8][3] = 7; /* 8 Y */
TETAPICES[9][0] = 1; TETAPICES[9][1] = 2; TETAPICES[9][2] = 4; TETAPICES[9][3] = 7; /* 9 Z */
/* edges belonging to each tetrahedra */
if (!(TETLINES = (int **) create2DArray (10, 6, sizeof(int))))
{
allSurfFinish ();
return (FALSE);
}
TETLINES[0][0] = 17; TETLINES[0][1] = 13; TETLINES[0][2] = 12; TETLINES[0][3] = 9; TETLINES[0][4] = 5; TETLINES[0][5] = 6; /* 0 V */
TETLINES[1][0] = 16; TETLINES[1][1] = 15; TETLINES[1][2] = 12; TETLINES[1][3] = 8; TETLINES[1][4] = 7; TETLINES[1][5] = 11; /* 1 W */
TETLINES[2][0] = 15; TETLINES[2][1] = 13; TETLINES[2][2] = 14; TETLINES[2][3] = 10; TETLINES[2][4] = 2; TETLINES[2][5] = 3; /* 2 X */
TETLINES[3][0] = 14; TETLINES[3][1] = 16; TETLINES[3][2] = 17; TETLINES[3][3] = 0; TETLINES[3][4] = 4; TETLINES[3][5] = 1; /* 3 Y */
TETLINES[4][0] = 14; TETLINES[4][1] = 15; TETLINES[4][2] = 13; TETLINES[4][3] = 12; TETLINES[4][4] = 17; TETLINES[4][5] = 16; /* 4 Z */
/* repeat for 2nd cube */
TETLINES[5][0] = 18; TETLINES[5][1] = 29; TETLINES[5][2] = 21; TETLINES[5][3] = 31; TETLINES[5][4] = 30; TETLINES[5][5] = 34; /* 5 V */
TETLINES[6][0] = 22; TETLINES[6][1] = 25; TETLINES[6][2] = 24; TETLINES[6][3] = 31; TETLINES[6][4] = 32; TETLINES[6][5] = 35; /* 6 W */
TETLINES[7][0] = 19; TETLINES[7][1] = 20; TETLINES[7][2] = 23; TETLINES[7][3] = 30; TETLINES[7][4] = 32; TETLINES[7][5] = 33; /* 7 X */
TETLINES[8][0] = 26; TETLINES[8][1] = 27; TETLINES[8][2] = 28; TETLINES[8][3] = 35; TETLINES[8][4] = 34; TETLINES[8][5] = 33; /* 8 Y */
TETLINES[9][0] = 30; TETLINES[9][1] = 31; TETLINES[9][2] = 32; TETLINES[9][3] = 33; TETLINES[9][4] = 34; TETLINES[9][5] = 35; /* 9 Z */
/* Edges of all tetrahedra */
if (!(LINES = (int **) create2DArray (36, 2, sizeof(int))))
{
allSurfFinish ();
return (FALSE);
}
LINES[0][0] = 0; LINES[0][1] = 1; /* 0 AB */
LINES[1][0] = 1; LINES[1][1] = 3; /* 1 BD */
LINES[2][0] = 2; LINES[2][1] = 3; /* 2 CD */
LINES[3][0] = 0; LINES[3][1] = 2; /* 3 AC */
LINES[4][0] = 1; LINES[4][1] = 5; /* 4 BF */
LINES[5][0] = 3; LINES[5][1] = 7; /* 5 DH */
LINES[6][0] = 5; LINES[6][1] = 7; /* 6 FH */
LINES[7][0] = 4; LINES[7][1] = 5; /* 7 EF */
LINES[8][0] = 4; LINES[8][1] = 6; /* 8 EG */
LINES[9][0] = 6; LINES[9][1] = 7; /* 9 GH */
LINES[10][0]= 2; LINES[10][1]= 6; /* 10 CG */
LINES[11][0]= 0; LINES[11][1]= 4; /* 11 AE */
LINES[12][0]= 5; LINES[12][1]= 6; /* 12 FG */
LINES[13][0]= 3; LINES[13][1]= 6; /* 13 DG */
LINES[14][0]= 0; LINES[14][1]= 3; /* 14 AD */
LINES[15][0]= 0; LINES[15][1]= 6; /* 15 AG */
LINES[16][0]= 0; LINES[16][1]= 5; /* 16 AF */
LINES[17][0]= 3; LINES[17][1]= 5; /* 17 DF */
/*repeat for 2nd cube orientation*/
LINES[18][0]= 0; LINES[18][1]= 1; /* 0 AB */
LINES[19][0]= 1; LINES[19][1]= 3; /* 1 BD */
LINES[20][0]= 2; LINES[20][1]= 3; /* 2 CD */
LINES[21][0]= 0; LINES[21][1]= 2; /* 3 AC */
LINES[22][0]= 1; LINES[22][1]= 5; /* 4 BF */
LINES[23][0]= 3; LINES[23][1]= 7; /* 5 DH */
LINES[24][0]= 5; LINES[24][1]= 7; /* 6 FH */
LINES[25][0]= 4; LINES[25][1]= 5; /* 7 EF */
LINES[26][0]= 4; LINES[26][1]= 6; /* 8 EG */
LINES[27][0]= 6; LINES[27][1]= 7; /* 9 GH */
LINES[28][0]= 2; LINES[28][1]= 6; /* 10 CG */
LINES[29][0]= 0; LINES[29][1]= 4; /* 11 AE */
LINES[30][0]= 1; LINES[30][1]= 2; /* 12 BC */
LINES[31][0]= 1; LINES[31][1]= 4; /* 13 BE */
LINES[32][0]= 1; LINES[32][1]= 7; /* 14 BH */
LINES[33][0]= 2; LINES[33][1]= 7; /* 15 CH */
LINES[34][0]= 2; LINES[34][1]= 4; /* 16 CE */
LINES[35][0]= 4; LINES[35][1]= 7; /* 17 EH */
return (TRUE);
}
static int allSurfFinish ()
{
if (CUBE)
destroy2DArray ((char **) CUBE, 8, 3);
CUBE = NULL;
if (TETAPICES)
destroy2DArray ((char **) TETAPICES, 10, 4);
TETAPICES = NULL;
if (TETLINES)
destroy2DArray ((char **) TETLINES, 10, 6);
TETLINES = NULL;
if (LINES)
destroy2DArray ((char **) LINES, 36, 2);
LINES = NULL;
return (TRUE);
}
/* discretise voxel volume into surfaces for each stratigraphic horizon and
** fault, igneous & uc break */
void
#if XVT_CC_PROTO
allSurface(THREED_IMAGE_DATA *threedData, STORY ***dots3DC, double ***map3D,
int nx, int ny, int nz, double plotscale, char *filename)
#else
allSurface(threedData, dots3DC, map3D, nx, ny, nz, plotscale, filename)
THREED_IMAGE_DATA *threedData;
STORY ***dots3DC;
double ***map3D;
int nx, ny, nz;
double plotscale;
char *filename;
#endif
{
FILE *vulcanFile = NULL;
int cyphno;
unsigned char **cypher = NULL;
int ii, jj, kk, mm, trot,nn;
int SeqCode[8];
double Points[8][3], /* the xyz values of points being controured around */
Values[8]; /* the height of the points being contoured around (after unevents) */
int eventsForStrat[50];
TETINFO t;
int x, y, z, index, found;
OBJECT *object;
plotScale = plotscale;
threedDataPtr = threedData;
cypher = (unsigned char **) create2DArray (5000, ARRAY_LENGTH_OF_STRAT_CODE,
sizeof(unsigned char)); // for really complex models 5000 contiguous volumes may not be enough?
if (!cypher)
return;
if (!allSurfStart ())
return;
numEventsForStratLayers = assignEventNumForStratLayers (eventsForStrat, 50);
eventsForStratLayers = &(eventsForStrat[0]);
/* Add the Fault break planes at the end */
for (ii = 0; ii < countObjects(NULL_WIN); ii++)
{
object = nthObject (NULL_WIN, ii);
if (object->shape == FAULT)
{
eventsForStrat[numEventsForStratLayers] = ii;
numEventsForStratLayers++;
}
}
if ((threedViewOptions.fillType == DXF_FILE_FILL_3DFACE) ||
(threedViewOptions.fillType == DXF_FILE_FILL_POLYLINE))
{
if (!dxopen (filename))
{
xvt_dm_post_error ("Error, Could not open DXF File");
return;
}
}
if (threedViewOptions.fillType == VULCAN_FILE_FILL)
{
if (!(vulcanFile = (FILE *) fopen (filename, "w")))
{
xvt_dm_post_error ("Error, Could not open Vulcan File");
return;
}
setDxfFile (vulcanFile);
}
/* work out how many different discontinuity codes are in
** the volume */
iequal(cypher[1], dots3DC[1][1][1].sequence);
cyphno = 1;
for (z = 1; z <= nz; z++)
{
for (y = 1; y <= ny; y++)
{
for (x = 1; x <= nx; x++)
{
found = FALSE;
for (index = 1; index <= cyphno; index++)
{
if (coincide(dots3DC[z][y][x].sequence, &(cypher[index][0])))
{
found = TRUE;
break;
}
}
if (!found)
{
cyphno++;
iequal(cypher[cyphno],dots3DC[z][y][x].sequence);// mwj_debug
//iequal(&(cypher[cyphno][0]),dots3DC[z][y][x].sequence);// mwj_debug
}
}
}
}
vertexcount=1;
/* take a copy of the cypher */
t.cyphno=cyphno;
for (mm = 1; mm <= cyphno; mm++)
iequal(&(t.cypher[mm][0]), &(cypher[mm][0]));
for (ii = nx-1; ii >= 1; ii--)
{
for (jj = ny-1; jj >= 1; jj--)
{ /* perform calcs from back corner */
if (threedData && threedData->declination < 180)
x = nx - ii;
else
x = ii;
/* perform calcs from back corner */
if (threedData && (threedData->declination > 90) &&
(threedData->declination < 270))
y = jj;
else
y = ny - jj;
incrementLongJob (INCREMENT_JOB);
for (kk = 1; kk < nz; kk++)
{
/* code for even/odd cubes */
trot=((((x+y)%2)+(kk%2))%2);
allSetVerts(dots3DC, map3D, Points, Values, SeqCode,
x, y, kk, plotscale, cyphno, cypher);
noTri=0;
for (mm = 0; mm < 5; mm++)
{ /* Clear the 't' structure */
SetTet(mm, trot, &t); /* store some useful info */
/* process one tet */
allOneTetrahedron (Values, Points, SeqCode, &t, cypher);
}
if (noTri > 0)
allDisplayPlane(plotscale, nx, ny, nz); /* plot planes using ZBuffering */
}
}
}
if ((threedViewOptions.fillType == DXF_FILE_FILL_3DFACE) ||
(threedViewOptions.fillType == DXF_FILE_FILL_POLYLINE))
dxclose ();
if (threedViewOptions.fillType == VULCAN_FILE_FILL)
{
rewind (vulcanFile);
WriteVulcanHeader (filename);
fclose (vulcanFile);
}
allSurfFinish ();
if (alltri)
{
xvt_mem_hfree ((char __huge *) alltri);
alltri = (THREED_POINT_INFO __huge *) NULL;
}
if (cypher)
destroy2DArray ((char **) cypher, 5000, ARRAY_LENGTH_OF_STRAT_CODE);
}
/*
** set up TETINFO structure with some basic info required later
*/
void
#if XVT_CC_PROTO
SetTet( int tno, int trot, TETINFO *t)
#else
SetTet(tno, trot, t)
int tno;
int trot;
TETINFO *t;
#endif
{
t->tinc=tno+(trot*5); /* add offset for even/odd cubes */
t->tetno=tno;
t->ExCode = 0;
t->InCode = 0;
t->pC = 0;
t->pC2 = 0;
t->TetCode = 0;
t->GoodPts[0] = 0; t->GoodPts[1] = 0;
t->GoodPts[2] = 0; t->GoodPts[3] = 0;
t->apexfirst = 0;
t->apexmiddle = 0;
t->apexlast = 0;
t->order = 0;
t->exact = 0;
}
/*
** make local copy of information for one voxel
*/
#if XVT_CC_PROTO
int allSetVerts(STORY ***dots3DC, double ***map3D,
double Points[8][3], double Values[8], int SeqCode[8],
int ii, int jj, int kk, double plotscale,
int cyphno, unsigned char **cypher)
#else
allSetVerts(dots3DC, map3D, Points, Values, SeqCode, ii, jj, kk, plotscale,
cyphno, cypher)
STORY ***dots3DC;
double ***map3D, Points[8][3], Values[8];
int SeqCode[8], ii, jj, kk;
double plotscale;
int cyphno;
unsigned char **cypher;
#endif
{
int mm, nn;
BLOCK_VIEW_OPTIONS *viewOptions = getViewOptions ();
double xLoco,yLoco,zLoco;
double yMax;
xLoco = viewOptions->originX;
yLoco = viewOptions->originY;
zLoco = viewOptions->originZ - viewOptions->lengthZ;
yMax = viewOptions->originY+viewOptions->lengthY;
/* Store the locations that will be tested */
for (mm = 0; mm < 8; mm++)
{
Points[mm][0]=xLoco+(((ii-1)+CUBE[mm][0])*plotscale)+0.000001;
Points[mm][1]=yMax-(yLoco+(((jj-1)+CUBE[mm][1])*plotscale))+0.000001;
Points[mm][2]=zLoco+(((kk-1)+CUBE[mm][2])*plotscale)+0.000001;
}
for (mm = 0; mm < 8; mm++)
{
/* Store the height at the stored locaton */
Values[mm] = map3D[kk+CUBE[mm][2]]
[jj+CUBE[mm][1]]
[ii+CUBE[mm][0]];
for (nn = 1; nn <= cyphno; nn++)
{ /* work out if strats differ at these locations */
if (coincide(&(cypher[nn][0]), dots3DC[kk+CUBE[mm][2]] /* mwj_fix */
[jj+CUBE[mm][1]]
[ii+CUBE[mm][0]].sequence))
{
SeqCode[mm]=nn;
break;
}
}
if(SeqCode[mm] != 1)
{
nn=1;
}
}
return (TRUE);
}
/*
** calculate surfaces for one tetrahedron within voxel,
** first figuring out which type of combination of 4 end history codes
** is present:
** Alpha- All 4 codes are same
** Beta- 3 same 1 diff
** Gamma- 2 same 2 diff
** Delta- 2 sets of 2 same
** Epsilon all 4 diff
*/
void
#if XVT_CC_PROTO
allOneTetrahedron(double Values[8], double Points[8][3],
int SeqCode[8], TETINFO *t, unsigned char **cypher)
#else
allOneTetrahedron(Values, Points, SeqCode, t, cypher)
double Values[8];
double Points[8][3];
int SeqCode[8];
TETINFO *t;
unsigned char **cypher;
#endif
{
t->TetCode=CalcTetCode(SeqCode[TETAPICES[t->tinc][0]],
SeqCode[TETAPICES[t->tinc][1]],
SeqCode[TETAPICES[t->tinc][2]],
SeqCode[TETAPICES[t->tinc][3]], cypher);
switch (t->TetCode)
{
case 0:
DEBUG(printf("Alpha");)
AlphaCode (Values, Points, SeqCode, t);
DEBUG(printf("\n");)
break;
case 100:
case 10:
case 1:
case 111:
DEBUG(printf("Beta");)
BetaCode (Values, Points, SeqCode, t);
DEBUG(printf("\n");)
break;
case 112:
case 120:
case 121:
case 12:
case 102:
case 122:
DEBUG(printf("Gamma");)
GammaCode (Values, Points, SeqCode, t);
DEBUG(printf("\n");)
break;
case 101:
case 11:
case 110:
DEBUG(printf("Delta");)
DeltaCode (Values, Points, SeqCode, t);
DEBUG(printf("\n");)
break;
case 123:
DEBUG(printf("Epsilon");)
EpsilonCode (Points, SeqCode, t);
DEBUG(printf("\n");)
break;
default:
xvt_dm_post_error("I hadn't thought of that TetCode!");
}
}
/*
** calculate point position defined by end points and fraction along line
*/
double
#if XVT_CC_PROTO
MidVal(double x1, double x2, double bisect)
#else
MidVal(x1, x2, bisect)
double x1, x2, bisect;
#endif
{
double val;
val = ((x2-x1)*bisect) + x1;
return (val);
}
/*
** calculate code based on number of contiguous volumes for one tet
*/
int
#if XVT_CC_PROTO
CalcTetCode( int s1, int s2, int s3, int s4, unsigned char **cypher )
#else
CalcTetCode(s1, s2, s3, s4, cypher )
int s1, s2, s3, s4;
unsigned char **cypher;
#endif
{
int tCode=0;
if (cypherDiff(s1,s2,cypher))
tCode += 100;
if (cypherDiff(s1, s3,cypher))
{
if (cypherDiff(s2,s3,cypher) && tCode == 100)
tCode += 20;
else
tCode += 10;
}
if (cypherDiff(s1,s4,cypher))
{
if (tCode==0)
tCode+=1;
else if (tCode==120 && cypherDiff(s2,s4,cypher) && cypherDiff(s3,s4,cypher))
tCode+=3;
else if (!cypherDiff(s2,s4,cypher))
tCode+=1;
else if (tCode==10 & !cypherDiff(s3,s4,cypher))
tCode+=1;
else
tCode+=2;
}
return (tCode);
}
/*
** calculate number of midpoints
*/
int
#if XVT_CC_PROTO
allNoSurfaces(int mids[6])
#else
allNoSurfaces(mids)
int mids[6];
#endif
{
int mm,count=0;
for (mm=0;mm<18;mm++)
if (mids[mm])
count++;
return(count);
}
/*
** store triangle for later ZBuffer processing
*/
void
#if XVT_CC_PROTO
ZBufferPlane(double conlist[4][3])
#else
ZBufferPlane(conlist)
double conlist[4][3];
#endif
{
register int mm;
if (!alltri) /* setup alltri first time through */
{
if (!(alltri = (THREED_POINT_INFO __huge *) xvt_mem_halloc (ALL_SURF_POINT_STORE,
sizeof(THREED_POINT_INFO))))
return;
}
if (noTri > ALL_SURF_POINT_STORE)
{
xvt_dm_post_error("That shouldn't happen in ZBuffer");
return;
}
for (mm = 0; mm < 3; mm++)
{
alltri[noTri+mm].point.x = conlist[mm][0];
alltri[noTri+mm].point.y = conlist[mm][1];
alltri[noTri+mm].point.z = conlist[mm][2];
alltri[noTri+mm].color = layerColor;
}
noTri+=3;
}
/*
** Sort triangles wrt distance from viewer and then plot
*/
int allDisplayPlane(plotscale, nx, ny, nz)
double plotscale;
int nx, ny, nz;
{
register int mm, nn, point;
double conlist[4][3];
int halfnx = nx/2, halfny = ny/2, halfnz = nz/2;
double plotRatio = plotscale/10.0;
for (mm = 0; mm < noTri; mm+=3)
{
for (nn = 0; nn < 3; nn++)
{
/*
** The "/plotscale)*(nx/2) * (plotscale/10)" part is to scale the
** the triangle so it appears nicely in the viewing window
*/
point = mm+nn;
alltri[point].point.x = ((alltri[point].point.x/plotscale)-halfnx)
* plotRatio;
alltri[point].point.y = ((alltri[point].point.y/plotscale)-halfny)
* plotRatio;
alltri[point].point.z = ((alltri[point].point.z/plotscale)-halfnz)
* plotRatio;
}
}
/* Sort in order of closest planes */
qSortPoints (alltri, 0, noTri-3, 3);
for (mm = 0; mm < noTri; mm+=3)
{
for (nn = 0; nn < 3; nn++)
{
point = mm+nn;
conlist[nn][0] = alltri[point].point.x;
conlist[nn][1] = alltri[point].point.y;
conlist[nn][2] = alltri[point].point.z;
}
oneDisplayPlane(conlist, mm);
}
return (TRUE);
}
/*
** actually draw and write to file one 3D triangle
*/
void
#if XVT_CC_PROTO
oneDisplayPlane(double conlist[4][3],int triNo)
#else
oneDisplayPlane(conlist, triNo)
double conlist[4][3];
int triNo;
#endif
{
PNT thePoly[4];
int mm, index, polySize = 3;
COLOR shading, lineShade;
DRAW_CTOOLS tools;
WINDOW win = getCurrentDrawingWindow ();
Point3d point3D;
Point2d point2D;
int newSize;
THREED_POINT_INFO __huge *newPoints;
THREED_POINT_INFO *point;
BLOCK_VIEW_OPTIONS *viewOptions;
if (!threedDataPtr)
return;
xvt_dwin_get_draw_ctools (win, &tools);
/* make sure the threedData structure is big enough to
** store the next few points */
index = (int) threedDataPtr->surfaceWidth;
if (index+3 > threedDataPtr->surfaceHeight)
{ /* Expand the array if needed */
newSize = (int) threedDataPtr->surfaceHeight + 300; /* the next hunk of memory */
newPoints = (THREED_POINT_INFO __huge *) xvt_mem_halloc(newSize, sizeof(THREED_POINT_INFO));
if (newPoints)
{
if (threedDataPtr->surface)
{
hmemcpy (newPoints, threedDataPtr->surface,
threedDataPtr->surfaceHeight*sizeof(THREED_POINT_INFO));
xvt_mem_hfree ((char __huge *) threedDataPtr->surface);
}
threedDataPtr->surfaceHeight = newSize;
threedDataPtr->surface = newPoints;
}
else /* make sure we dont try and fill it */
{
if (threedDataPtr->surface)
{
xvt_mem_hfree ((char __huge *) threedDataPtr->surface);
threedDataPtr->surface = NULL;
}
}
}
for (mm = 2; mm >= 0; mm--)
{
point3D.x = conlist[mm][1];
point3D.y = conlist[mm][2];
point3D.z = conlist[mm][0];
/* Fill In the threedData structure (store points) */
if (threedDataPtr->surface)
{
point = &(threedDataPtr->surface[index+mm]);
point->point.x = point3D.x;
point->point.y = point3D.y;
point->point.z = point3D.z;
point->color = alltri[triNo].color;
threedDataPtr->surfaceWidth++;
}
ApplyTransform(&point3D, &point3D, &xFormViewer);
Project(&point3D, &point2D);
thePoly[mm].h = (short) point2D.x;
thePoly[mm].v = (short) point2D.y;
}
if (threedViewOptions.fillType == XYZ_COLOR_FILL)
{
viewOptions = getViewOptions ();
ShadeXYZ(conlist, &shading, viewOptions->lengthX, viewOptions->lengthY, viewOptions->lengthZ);
lineShade= XVT_MAKE_COLOR(
(XVT_COLOR_GET_RED(shading) +((255-XVT_COLOR_GET_RED(shading))/2)),
(XVT_COLOR_GET_GREEN(shading)+((255-XVT_COLOR_GET_GREEN(shading))/2)),
(XVT_COLOR_GET_BLUE(shading) +((255-XVT_COLOR_GET_BLUE(shading))/2)));
tools.pen.width = 0;
tools.pen.color = lineShade;
tools.pen.pat = PAT_SOLID;
tools.brush.color = shading;
tools.brush.pat = PAT_SOLID;
}
else if (threedViewOptions.fillType == SHADING_FILL)
{
ShadeLambert(conlist, &shading);
tools.pen.width = 0;
tools.pen.color = shading;
tools.pen.pat = PAT_SOLID;
tools.brush.color = shading;
tools.brush.pat = PAT_SOLID;
}
else if (threedViewOptions.fillType = LINES_FILL)
{
tools.pen.width = 0;
tools.pen.color = (COLOR) alltri[triNo].color;
tools.pen.pat = PAT_SOLID;
tools.brush.color = backgroundColor;
tools.brush.pat = PAT_SOLID;
}
xvt_dwin_set_draw_ctools (win, &tools);
xvt_dwin_draw_polygon (win, thePoly, polySize);
}
/*
** temporarily store and write to file one 3D triangle
*/
void
#if XVT_CC_PROTO
allDrawPlane(double conlist[4][3])
#else
allDrawPlane(conlist)
double conlist[4][3];
#endif
{
FILE *fpvulcan; /* Vulcan file pointer */
register int mm;
float xa[5], ya[5], za[5];
if (Skinny(conlist) || tooLong(conlist))
return;
switch (threedViewOptions.fillType)
{
case (DXF_FILE_FILL_3DFACE):
case (DXF_FILE_FILL_POLYLINE):
for (mm = 0; mm < 3; mm++)
{
xa[mm+1]=(float) conlist[mm][0];
ya[mm+1]=(float) conlist[mm][1];
za[mm+1]=(float) conlist[mm][2];
}
xa[4] = (float) conlist[2][0];
ya[4] = (float) conlist[2][1];
za[4] = (float) conlist[2][2];
if (threedViewOptions.fillType == DXF_FILE_FILL_3DFACE)
dxfa3l(xa,ya,za);
else /* DXF_FILE_FILL_POLYLINE */
dxpl3l(xa,ya,za,3,1);
break;
case (VULCAN_FILE_FILL):
fpvulcan = (FILE *) getDxfFile ();
fprintf(fpvulcan,"%s\n",clayer);
for(mm=0;mm<3;mm++)
fprintf(fpvulcan,"%8.4lf\t%8.4lf\t%8.4lf\n",
conlist[mm][0] + projectOptions.easting,
conlist[mm][1] + projectOptions.northing, conlist[mm][2]);
fprintf(fpvulcan,"%06ld\t%06ld\t%06ld\n",vertexcount,
vertexcount+1,vertexcount+2);
vertexcount += 3;
break;
default: /*displaying as an image */
ZBufferPlane(conlist);
}
}
/*
** colour triangle according to position red=x, green=y, blue=z
*/
void
#if XVT_CC_PROTO
ShadeXYZ(double conlist[4][3], COLOR *shading, double lengthX, double lengthY, double lengthZ)
#else
ShadeXYZ(conlist, shading, lengthX, lengthY, lengthZ)
double conlist[4][3];
COLOR *shading;
double lengthX, lengthY, lengthZ;
#endif
{
*shading = XVT_MAKE_COLOR (
(((((conlist[0][0]+conlist[1][0]+conlist[2][0])/3)+lengthX/20.0)/(lengthX/10.0))*255),
(((((conlist[0][1]+conlist[1][1]+conlist[2][1])/3)+lengthY/20.0)/(lengthY/10.0))*255),
(((((conlist[0][2]+conlist[1][2]+conlist[2][2])/3)+lengthZ/20.0)/(lengthZ/10.0))*255));
/*
(((((conlist[0][0]+conlist[1][0]+conlist[2][0])/3)+500)/1000.0)*255),
(((((conlist[0][1]+conlist[1][1]+conlist[2][1])/3)+350)/700.0)*255),
(((((conlist[0][2]+conlist[1][2]+conlist[2][2])/3)+250)/500.0)*255));
*/
}
/*
** colour triangle a shade of grey according to orientation
*/
void
#if XVT_CC_PROTO
ShadeLambert(double conlist[4][3], COLOR *shading)
#else
ShadeLambert(conlist, shading)
double conlist[4][3];
COLOR *shading;
#endif
{
int value;
double alpha, beta, gamma, ratio, angle;
double a1=-0.57735, a2=0.57735, a3=0.57735;
alpha = determinant(conlist,0);
beta = determinant(conlist,1);
gamma = determinant(conlist,2);
ratio = sqrt((alpha*alpha) + (beta*beta) + (gamma*gamma));
if (ratio == 0.0)
ratio = 0.000001;
alpha = alpha/ratio;
beta = beta/ratio;
gamma = gamma/ratio;
angle = (alpha*a1) + (beta*a2) + (gamma*a3);
if(angle < 0.0 )
angle = -angle;
value = (int) ((double) (angle*200.0) + 20.0);
*shading = XVT_MAKE_COLOR(value, value, value);
}
/*
** colour triangle a shade of grey according to orientation second attempt
*/
void
#if XVT_CC_PROTO
Qd3DShadeLambert(double conlist[4][3], COLOR *shading)
#else
Qd3DShadeLambert(conlist, shading)
double conlist[4][3];
COLOR *shading;
#endif
{
#ifdef PAUL
COLOR trgb;
static Point3d pl[3], norm, avev,
ka={0.2,0.2,0.2},
kd={0.8,0.8,0.8},
L={-10000,-10000,10000},
la={40000.0,0.0,0.0},
li={40000.0,40000.0,40000.0},
result;
pl[0].x=conlist[0][0];
pl[0].y=conlist[0][1];
pl[0].z=conlist[0][2];
pl[1].x=conlist[1][0];
pl[1].y=conlist[1][1];
pl[1].z=conlist[1][2];
pl[2].x=conlist[2][0];
pl[2].y=conlist[2][1];
pl[2].z=conlist[2][2];
avev.x=(pl[0].x+pl[1].x+pl[2].x)/3;
avev.y=(pl[0].y+pl[1].y+pl[2].y)/3;
avev.z=(pl[0].z+pl[1].z+pl[2].z)/3;
/* L.x=L.x-avev.x;
** L.y=L.y-avev.y;
** L.z=L.z-avev.z; */
/*
** vnorm(pl, &norm);
** LambertLight(&ka,&kd,&L,&norm,&la,&li,&result);
** Color2RGB(&result, &trgb);
*/
*shading = trgb;
#endif
}
/*
** calculate determinant of matrix for Lambert shading
*/
double
#if XVT_CC_PROTO
determinant(double conlist[4][3], int code)
#else
determinant(conlist, code)
double conlist[4][3];
int code;
#endif
{
double t1,t2,t3,t4,tl[3][3];
int mm,tc;
for (mm = 0, tc = 0; mm < 3; mm++)
{
if (mm == code)
continue;
else
{
tl[0][tc]=conlist[0][mm];
tl[1][tc]=conlist[1][mm];
tl[2][tc]=conlist[2][mm];
tc++;
}
}
tl[0][2]=1;
tl[1][2]=1;
tl[2][2]=1;
t1= tl[0][0]*((tl[1][1]*tl[2][2])-(tl[1][2]*tl[2][1]));
t2=-tl[0][1]*((tl[1][0]*tl[2][2])-(tl[1][2]*tl[2][0]));
t3= tl[0][2]*((tl[1][0]*tl[2][1])-(tl[1][1]*tl[2][0]));
t4=t1+t2+t3;
return(t4);
}
OBJECT *
#if XVT_CC_PROTO
SetCLayer(unsigned char *start1, unsigned char *start2,
int InCode, int ExCode)
#else
SetCLayer(start1, start2, InCode, ExCode)
unsigned char *start1, *start2;
int InCode, ExCode;
#endif
{
int break_code, swap_code, i;
OBJECT *object = NULL;
NODDY_COLOUR *colorStruct;
int eventNum = 0;
break_code = lastdiff(start1, start2);
if (ExCode < InCode)
{
swap_code=InCode;
InCode=ExCode;
ExCode=swap_code;
}
sprintf(clayer,"BX%03d%03d%03d",break_code,InCode,ExCode);
/* check to make sure the layer is on */
if (!threedViewOptions.allLayers)
{
for (i = 0; i < numEventsForStratLayers; i++)
{ /* find layer corresponding to event */
if (eventsForStratLayers[i] == break_code)
{
if (threedViewOptions.layerOn[i])
{
eventNum = break_code; /* On */
break;
}
/* Cannot have this as it will stop after the first uncon layer not on
We still want it to pass through if only the last layer in on.
else
break;
*/
}
}
}
else
eventNum = break_code;
if (!eventNum)
return ((OBJECT *) NULL);
if (!(object = (OBJECT *) nthObject (NULL_WIN, eventNum)))
return ((OBJECT *) NULL);
switch (object->shape)
{
case FAULT:
if (colorStruct = getNoddyColourStructure (object))
layerColor = XVT_MAKE_COLOR (colorStruct->red,
colorStruct->green,
colorStruct->blue);
else
layerColor = COLOR_RED;
break;
case UNCONFORMITY:
/* Find last Layer still in Uncon (ie. the base layer) */
while (eventsForStratLayers[i+1] == break_code)
i++;
if (threedViewOptions.layerOn[i]) /* If Base layer on draw the uncon plane */
{
object->generalData = 1; /* get color of first layer */
if (colorStruct = getNoddyColourStructure (object))
layerColor = XVT_MAKE_COLOR (colorStruct->red,
colorStruct->green,
colorStruct->blue);
else
layerColor = COLOR_GREEN;
}
break;
case DYKE: case PLUG:
if (colorStruct = getNoddyColourStructure (object))
layerColor = XVT_MAKE_COLOR (colorStruct->red,
colorStruct->green,
colorStruct->blue);
else
layerColor = COLOR_RED;
break;
default:
layerColor = COLOR_WHITE;
break;
}
return (object);
}
/*
** empty triangle check
*/
int
#if XVT_CC_PROTO
Skinny(double conlist[4][3])
#else
Skinny(conlist)
double conlist[4][3];
#endif
{
if(conlist[0][0]==conlist[1][0] &&
conlist[0][1]==conlist[1][1] &&
conlist[0][2]==conlist[1][2])
return(TRUE);
else if(conlist[0][0]==conlist[2][0] &&
conlist[0][1]==conlist[2][1] &&
conlist[0][2]==conlist[2][2])
return(TRUE);
else if(conlist[2][0]==conlist[1][0] &&
conlist[2][1]==conlist[1][1] &&
conlist[2][2]==conlist[1][2])
return(TRUE);
else
return(FALSE);
}
int
#if XVT_CC_PROTO
tooLong(double conlist[4][3])
#else
tooLong(conlist)
double conlist[4][3];
#endif
{
double length;
int i, j;
for (i = 0; i < 3; i++)
{
for (j = 0, length = 0.0; j < 3; j++)
{
length = length + ((conlist[i][j] - conlist[(i+1)%3][j])
*(conlist[i][j] - conlist[(i+1)%3][j]));
}
if (length > 7500*plotScale)
return (TRUE);
}
return (FALSE);
}
LAYER_PROPERTIES *
#if XVT_CC_PROTO
renderLayer (OBJECT *object, int eventNum)
#else
renderLayer (object, eventNum)
OBJECT *object;
int eventNum;
#endif
{
LAYER_PROPERTIES *properties = (LAYER_PROPERTIES *) NULL;
int layer, layersBefore;
if (object->generalData == 0)
{
#ifdef OLD
if (object->shape == STRATIGRAPHY)
object->generalData = 2; /* the first layer is not rendered */
else
#endif
object->generalData = 1; /* all layers rendered rendered */
}
if (threedViewOptions.allLayers)
{
if (!(properties = getLayerPropertiesStructure (object)))
object->generalData = 0; /* at the end of strat so start from start again */
else
object->generalData++; /* get next layer next time */
}
else /* check individual layers */
{ /* Find num of layers before current event */
for (layer = layersBefore = 0; layer < numEventsForStratLayers; layer++)
{
if (eventsForStratLayers[layer] != eventNum)
layersBefore++;
else
break;
}
/* Find the next layer that is turned on */
for (layer = layersBefore + object->generalData-1; (layer < 99); layer++)
{
if (threedViewOptions.layerOn[layer])
{
object->generalData = (layer - layersBefore) + 1;
if ((object->shape == STRATIGRAPHY) || (object->shape == UNCONFORMITY))
object->generalData = -object->generalData; /* Start from top and not base */
if (!(properties = getLayerPropertiesStructure (object)))
object->generalData = 0; /* at the end of strat so start from start again */
else
object->generalData = abs(object->generalData) + 1; /* get next layer next time */
break;
}
}
}
return (properties);
}
void
#if XVT_CC_PROTO
WriteVulcanHeader(char *fname)
#else
WriteVulcanHeader(fname)
char *fname;
#endif
{
FILE *headout;
int nn;
char layernew[OBJECT_TEXT_LENGTH];
LAYER_PROPERTIES *properties[100];
int eventNumbers[100];
int numLayers, layer;
OBJECT *object;
addFileExtention (fname, ".hed");
headout=fopen(fname,"w");
addFileExtention (fname, ".vul");
fprintf(headout,"%s\n%ld\n",fname,vertexcount);
numLayers = assignPropertiesForStratLayers (properties, 100);
numLayers = assignEventNumForStratLayers (eventNumbers, 100);
for (nn = 0, layer = 0; nn < numLayers; nn++)
{
if (object = nthObject (NULL_WIN, eventNumbers[nn]))
{
switch(object->shape)
{
case STRATIGRAPHY:
layer++;
add_underscore(layernew, properties[nn]->unitName);
fprintf(headout,"S_%02d_%02d_%s\n", eventNumbers[nn]+1, layer, layernew);
break;
case UNCONFORMITY:
fprintf(headout,"B_uncon_%03d\n", eventNumbers[nn]+1);
break;
case DYKE:
fprintf(headout,"B_dyke__%03d\n", eventNumbers[nn]+1);
break;
case PLUG:
fprintf(headout,"B_plug__%03d\n", eventNumbers[nn]+1);
break;
case IMPORT:
fprintf(headout,"B_imprt_%03d\n", eventNumbers[nn]+1);
break;
}
}
}
numLayers = countObjects (NULL_WIN);
for (nn = 0; nn < numLayers; nn++)
{
if (object = nthObject (NULL_WIN, nn))
{
if (object->shape == FAULT)
{
fprintf(headout,"B_fault_%03d\n", nn+1);
}
}
}
fclose(headout);
}
void
#if XVT_CC_PROTO
add_underscore(char *nameout, char *namein)
#else
add_underscore(nameout, namein)
char *nameout;
char *namein;
#endif
{
int indexing=0;
do
{
if(namein[indexing]==' ')
nameout[indexing]='_';
else
nameout[indexing]=namein[indexing];
indexing++;
} while (namein[indexing-1] != '\0');
}
| 30.091494 | 141 | 0.533279 |
d6f265477c49aa2be86da8b494e43467654d83d8 | 516 | h | C | XYJSAPI/Classes/JSAPIService/Model/FilterModel.h | CouldNotFindObject/XYJSAPI.podspec | 8d59c12ea24daa25e34e0bcc55ca1ed4052ed8aa | [
"MIT"
] | 6 | 2018-04-09T07:45:56.000Z | 2018-05-23T09:21:41.000Z | XYJSAPI/Classes/JSAPIService/Model/FilterModel.h | CouldNotFindObject/XYJSAPI.podspec | 8d59c12ea24daa25e34e0bcc55ca1ed4052ed8aa | [
"MIT"
] | null | null | null | XYJSAPI/Classes/JSAPIService/Model/FilterModel.h | CouldNotFindObject/XYJSAPI.podspec | 8d59c12ea24daa25e34e0bcc55ca1ed4052ed8aa | [
"MIT"
] | 1 | 2020-07-09T02:05:26.000Z | 2020-07-09T02:05:26.000Z | //
// FilterModel.h
// JSAPI
//
// Created by Nile on 2018/3/19.
// Copyright © 2018年 Nile. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface FilterModel : NSObject
/**
设置容器的导航栏背景颜色
*/
@property(nonatomic,copy)NSString * xy_nav_bgcolor;
/**
设置容器横竖屏
*/
@property(nonatomic,copy)NSString * xy_orientation;
/**
设置是否显示导航栏
*/
@property(nonatomic,copy)NSString * xy_nav_show;
/**
根据渲染的URL路径生成对象
@param url URL路径字符串
@return 该模型对象
*/
- (instancetype)initWithUrl:(NSString *)url;
@end
| 14.333333 | 51 | 0.699612 |
d6f26c318c36a8637ddeb78a46b94cb812fb22b5 | 1,582 | h | C | Meniga/compiled/MenigaSDK.framework/Versions/A/Headers/MNFResponse.h | WezSieTato/mobile-sdk-ios | 40a030342d43b396d0a6832d0eec58ed5b952382 | [
"MIT"
] | null | null | null | Meniga/compiled/MenigaSDK.framework/Versions/A/Headers/MNFResponse.h | WezSieTato/mobile-sdk-ios | 40a030342d43b396d0a6832d0eec58ed5b952382 | [
"MIT"
] | null | null | null | Meniga/compiled/MenigaSDK.framework/Versions/A/Headers/MNFResponse.h | WezSieTato/mobile-sdk-ios | 40a030342d43b396d0a6832d0eec58ed5b952382 | [
"MIT"
] | null | null | null | //
// MenigaResponse.h
// Meniga-ios-sdk
//
// Created by Haukur Ísfeld on 30/09/15.
// Copyright © 2015 Meniga. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MNFResponse : NSObject
/**
@abstract The HTTP status code.
*/
@property (nonatomic,strong,readonly, nullable) NSError *error;
/**
@abstract The HTTP status code.
*/
@property (nonatomic,assign,readonly) NSInteger statusCode;
/**
@abstract The result of the request.
*/
@property (nonatomic,strong,readonly, nullable) id result;
/**
@abstract The dictionary or array of objects that comes from the meta tag which has additional information about the result data.
*/
@property (nonatomic, strong, readonly, nullable) id metaData;
/**
@abstract The included data containing objects that are referenced by the data objects.
*/
@property (nonatomic, strong, readonly, nullable) NSDictionary* includedObjects;
/**
@abstract The raw data from the network request.
*/
@property (nonatomic, strong, readonly, nullable) NSData *rawData;
/**
@abstract all header fields received by the response.
*/
@property (nonatomic,strong,readonly) NSDictionary *allHeaderFields;
+ (instancetype)responseWithData:(nullable NSData *)data error:(nullable NSError *)error statusCode:(NSInteger)statusCode headerFields:(nullable NSDictionary*)allHeaderFields;
+ (instancetype)downloadResponseWithRawData:(nullable NSData*)rawData error:(nullable NSError*)error statusCode:(NSInteger)statusCode headerFields:(nullable NSDictionary*)allHeaderFields;
@end
NS_ASSUME_NONNULL_END
| 29.849057 | 187 | 0.769279 |
d6f30f1237dde3e8bdafccb7250dbacf4238e857 | 363 | h | C | equi/equihash.h | Slawterr/ccminer-palgin | d0ead1852e7e1a32a4e2e089d24791165e73987b | [
"Apache-2.0"
] | null | null | null | equi/equihash.h | Slawterr/ccminer-palgin | d0ead1852e7e1a32a4e2e089d24791165e73987b | [
"Apache-2.0"
] | null | null | null | equi/equihash.h | Slawterr/ccminer-palgin | d0ead1852e7e1a32a4e2e089d24791165e73987b | [
"Apache-2.0"
] | null | null | null | #ifndef EQUIHASH_H
#define EQUIHASH_H
#include <stdint.h>
#define WK 9
#define WN 200
//#define CONFIG_MODE_1 9, 1248, 12, 640, packer_cantor /* eqcuda.hpp */
extern "C" {
void equi_hash(const void* input, void* output, int len);
int equi_verify_sol(void* const hdr, void* const soln);
bool equi_verify(uint8_t* const hdr, uint8_t* const soln);
}
#endif
| 20.166667 | 72 | 0.719008 |
d6f581f468266a35608e0db80ac5797152da9d8f | 72 | h | C | src/commanduino/include/commanduino/commanduino.h | WPISmartmouse/smartmouse-simulator | de212fd4206485b41987587924c5d5c6a59a2bde | [
"MIT"
] | null | null | null | src/commanduino/include/commanduino/commanduino.h | WPISmartmouse/smartmouse-simulator | de212fd4206485b41987587924c5d5c6a59a2bde | [
"MIT"
] | 1 | 2018-05-24T03:10:47.000Z | 2018-05-24T03:10:47.000Z | src/commanduino/include/commanduino/commanduino.h | WPISmartmouse/smartmouse-simulator | de212fd4206485b41987587924c5d5c6a59a2bde | [
"MIT"
] | null | null | null | #include <commanduino/command.h>
#include <commanduino/command_group.h>
| 24 | 38 | 0.805556 |
d6fac32c79296093f8d30ed13b58e59ecca97b5c | 4,890 | h | C | Classes/LinphoneUI/UICallCell.h | VTCSecureLLC/linphone-iphone-vtcsecure | de3f71ffc3b9998516b3265c6a074cf74a89a855 | [
"BSD-2-Clause"
] | 5 | 2015-11-30T15:03:34.000Z | 2019-01-13T09:17:17.000Z | Classes/LinphoneUI/UICallCell.h | VTCSecureLLC/linphone-iphone-vtcsecure | de3f71ffc3b9998516b3265c6a074cf74a89a855 | [
"BSD-2-Clause"
] | 486 | 2015-09-26T01:43:50.000Z | 2016-05-13T19:14:17.000Z | Classes/LinphoneUI/UICallCell.h | VTCSecureLLC/ace-iphone | de3f71ffc3b9998516b3265c6a074cf74a89a855 | [
"BSD-2-Clause"
] | 16 | 2015-09-28T13:44:36.000Z | 2020-05-14T09:29:21.000Z | /* UICallCell.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
#include "linphone/linphonecore.h"
#include "UIChatButton.h"
#import "UITransparentTVCell.h"
typedef enum CallCellOtherView {
CallCellOtherView_Avatar = 0,
CallCellOtherView_AudioStats,
CallCellOtherView_VideoStats,
CallCellOtherView_MAX
} CallCellOtherView;
@interface UICallCellData : NSObject {
@public
bool minimize;
CallCellOtherView view;
LinphoneCall *call;
}
- (id)init:(LinphoneCall*) call minimized:(BOOL)minimized;
@property (nonatomic, strong) UIImage *image;
@property (nonatomic, strong) NSString *address;
@end
@interface UICallCell : UITransparentTVCell {
}
@property (nonatomic, strong) UICallCellData *data;
@property (nonatomic, strong) IBOutlet UIImageView* headerBackgroundImage;
@property (nonatomic, strong) IBOutlet UIImageView* headerBackgroundHighlightImage;
@property (nonatomic, strong) IBOutlet UILabel* addressLabel;
@property (nonatomic, strong) IBOutlet UILabel* stateLabel;
@property (nonatomic, strong) IBOutlet UIImageView* stateImage;
@property (nonatomic, strong) IBOutlet UIImageView* avatarImage;
@property (nonatomic, strong) IBOutlet UIButton *removeButton;
@property (nonatomic, strong) IBOutlet UIChatButton *chatButton;
@property (nonatomic, strong) IBOutlet UIView* headerView;
@property (nonatomic, strong) IBOutlet UIView* avatarView;
@property (nonatomic, strong) IBOutlet UIView* audioStatsView;
@property (nonatomic, strong) IBOutlet UILabel* audioCodecLabel;
@property (nonatomic, strong) IBOutlet UILabel* audioCodecHeaderLabel;
@property (nonatomic, strong) IBOutlet UILabel* audioUploadBandwidthLabel;
@property (nonatomic, strong) IBOutlet UILabel* audioUploadBandwidthHeaderLabel;
@property (nonatomic, strong) IBOutlet UILabel* audioDownloadBandwidthLabel;
@property (nonatomic, strong) IBOutlet UILabel* audioDownloadBandwidthHeaderLabel;
@property (nonatomic, strong) IBOutlet UILabel* audioIceConnectivityLabel;
@property (nonatomic, strong) IBOutlet UILabel* audioIceConnectivityHeaderLabel;
@property (nonatomic, strong) IBOutlet UIView* videoStatsView;
@property (nonatomic, strong) IBOutlet UILabel* videoCodecLabel;
@property (nonatomic, strong) IBOutlet UILabel* videoCodecHeaderLabel;
@property(strong, nonatomic) IBOutlet UILabel *videoSentSizeFPSHeaderLabel;
@property(strong, nonatomic) IBOutlet UILabel *videoSentSizeFPSLabel;
@property(strong, nonatomic) IBOutlet UILabel *videoRecvSizeFPSHeaderLabel;
@property(strong, nonatomic) IBOutlet UILabel *videoRecvSizeFPSLabel;
@property (nonatomic, strong) IBOutlet UILabel* videoUploadBandwidthLabel;
@property (nonatomic, strong) IBOutlet UILabel* videoUploadBandwidthHeaderLabel;
@property (nonatomic, strong) IBOutlet UILabel* videoDownloadBandwidthLabel;
@property (nonatomic, strong) IBOutlet UILabel* videoDownloadBandwidthHeaderLabel;
@property (nonatomic, strong) IBOutlet UILabel* videoIceConnectivityLabel;
@property (nonatomic, strong) IBOutlet UILabel* videoIceConnectivityHeaderLabel;
@property (nonatomic, strong) IBOutlet UIView* otherView;
@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *detailsLeftSwipeGestureRecognizer;
@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *detailsRightSwipeGestureRecognizer;
@property (assign) BOOL firstCell;
@property (assign) BOOL conferenceCell;
@property (nonatomic, assign) BOOL currentCall;
@property (strong, nonatomic) IBOutlet UILabel *outgoingRingCountLabel;
@property (strong, nonatomic) IBOutlet UILabel *outgoingRingLabel;
@property (strong) NSTimer *outgoingRingCountTimer;
- (void)update;
- (id)initWithIdentifier:(NSString*)identifier;
- (IBAction)doHeaderClick:(id)sender;
- (IBAction)doRemoveClick:(id)sender;
- (IBAction)doDetailsSwipe:(UISwipeGestureRecognizer *)sender;
+ (int)getMaximizedHeight;
+ (int)getMinimizedHeight;
@end
| 41.440678 | 100 | 0.760941 |
d6fb591fa34629a9711572799f9528cd7c64432d | 6,869 | c | C | src/dvp2sdcard/main.c | noahzhy/kendryte-standalone-sdk | d358d8aca7245669a65330180e08eaf92b8a2dd9 | [
"Apache-2.0"
] | 190 | 2018-10-13T19:32:35.000Z | 2022-03-21T06:19:21.000Z | src/dvp2sdcard/main.c | noahzhy/kendryte-standalone-sdk | d358d8aca7245669a65330180e08eaf92b8a2dd9 | [
"Apache-2.0"
] | 29 | 2018-10-30T07:37:26.000Z | 2022-03-31T07:59:06.000Z | src/dvp2sdcard/main.c | noahzhy/kendryte-standalone-sdk | d358d8aca7245669a65330180e08eaf92b8a2dd9 | [
"Apache-2.0"
] | 90 | 2018-10-14T02:15:15.000Z | 2022-03-11T03:45:49.000Z | /* Copyright 2018 Canaan Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <string.h>
#include "dvp.h"
#include "fpioa.h"
#include "lcd.h"
#include "ov5640.h"
#include "ov2640.h"
#include "plic.h"
#include "sysctl.h"
#include "uarths.h"
#include "nt35310.h"
#include "board_config.h"
#include "sdcard.h"
#include "ff.h"
#include "rgb2bmp.h"
#include "gpiohs.h"
#include "iomem.h"
/* SPI and DMAC usage
*
* SPI0 - LCD
* SPI1 - SD card
* SPI2 - unused
* SPI3 - Flash
*
* DMAC Channel 0 - LCD
* DMAC Channel 1 - SD card
*
*/
#define KEY_GPIONUM 0
uint32_t *g_lcd_gram0;
uint32_t *g_lcd_gram1;
volatile uint8_t g_dvp_finish_flag;
volatile uint8_t g_ram_mux;
volatile uint8_t g_save_flag;
void irq_key(void* gp)
{
g_save_flag = 1;
}
static int on_irq_dvp(void* ctx)
{
if (dvp_get_interrupt(DVP_STS_FRAME_FINISH))
{
/* switch gram */
dvp_set_display_addr(g_ram_mux ? (uint32_t)g_lcd_gram0 : (uint32_t)g_lcd_gram1);
dvp_clear_interrupt(DVP_STS_FRAME_FINISH);
g_dvp_finish_flag = 1;
}
else
{
if(g_dvp_finish_flag == 0)
dvp_start_convert();
dvp_clear_interrupt(DVP_STS_FRAME_START);
}
return 0;
}
static void io_mux_init(void)
{
#if BOARD_LICHEEDAN
/* SD card */
fpioa_set_function(27, FUNC_SPI1_SCLK);
fpioa_set_function(28, FUNC_SPI1_D0);
fpioa_set_function(26, FUNC_SPI1_D1);
fpioa_set_function(29, FUNC_GPIOHS7);
/* Init DVP IO map and function settings */
fpioa_set_function(42, FUNC_CMOS_RST);
fpioa_set_function(44, FUNC_CMOS_PWDN);
fpioa_set_function(46, FUNC_CMOS_XCLK);
fpioa_set_function(43, FUNC_CMOS_VSYNC);
fpioa_set_function(45, FUNC_CMOS_HREF);
fpioa_set_function(47, FUNC_CMOS_PCLK);
fpioa_set_function(41, FUNC_SCCB_SCLK);
fpioa_set_function(40, FUNC_SCCB_SDA);
/* Init SPI IO map and function settings */
fpioa_set_function(38, FUNC_GPIOHS0 + DCX_GPIONUM);
fpioa_set_function(36, FUNC_SPI0_SS3);
fpioa_set_function(39, FUNC_SPI0_SCLK);
fpioa_set_function(37, FUNC_GPIOHS0 + RST_GPIONUM);
sysctl_set_spi0_dvp_data(1);
fpioa_set_function(16, FUNC_GPIOHS0 + KEY_GPIONUM);
#else
/* SD card */
fpioa_set_function(29, FUNC_SPI1_SCLK);
fpioa_set_function(30, FUNC_SPI1_D0);
fpioa_set_function(31, FUNC_SPI1_D1);
fpioa_set_function(32, FUNC_GPIOHS7);
/* Init DVP IO map and function settings */
fpioa_set_function(11, FUNC_CMOS_RST);
fpioa_set_function(13, FUNC_CMOS_PWDN);
fpioa_set_function(14, FUNC_CMOS_XCLK);
fpioa_set_function(12, FUNC_CMOS_VSYNC);
fpioa_set_function(17, FUNC_CMOS_HREF);
fpioa_set_function(15, FUNC_CMOS_PCLK);
fpioa_set_function(10, FUNC_SCCB_SCLK);
fpioa_set_function(9, FUNC_SCCB_SDA);
/* Init SPI IO map and function settings */
fpioa_set_function(8, FUNC_GPIOHS0 + DCX_GPIONUM);
fpioa_set_function(6, FUNC_SPI0_SS3);
fpioa_set_function(7, FUNC_SPI0_SCLK);
sysctl_set_spi0_dvp_data(1);
fpioa_set_function(26, FUNC_GPIOHS0 + KEY_GPIONUM);
#endif
}
static void io_set_power(void)
{
#if BOARD_LICHEEDAN
/* Set dvp and spi pin to 1.8V */
sysctl_set_power_mode(SYSCTL_POWER_BANK6, SYSCTL_POWER_V18);
sysctl_set_power_mode(SYSCTL_POWER_BANK7, SYSCTL_POWER_V18);
#else
/* Set dvp and spi pin to 1.8V */
sysctl_set_power_mode(SYSCTL_POWER_BANK1, SYSCTL_POWER_V18);
sysctl_set_power_mode(SYSCTL_POWER_BANK2, SYSCTL_POWER_V18);
#endif
}
int main(void)
{
FATFS sdcard_fs;
/* Set CPU and dvp clk */
sysctl_pll_set_freq(SYSCTL_PLL0, 800000000UL);
uarths_init();
io_mux_init();
io_set_power();
plic_init();
gpiohs_set_drive_mode(KEY_GPIONUM, GPIO_DM_INPUT);
gpiohs_set_pin_edge(KEY_GPIONUM, GPIO_PE_FALLING);
gpiohs_set_irq(KEY_GPIONUM, 2, irq_key);
/* LCD init */
printf("LCD init\n");
lcd_init();
#if BOARD_LICHEEDAN
#if OV5640
lcd_set_direction(DIR_YX_LRDU);
#else
lcd_set_direction(DIR_YX_LRDU);
#endif
#else
#if OV5640
lcd_set_direction(DIR_YX_LRUD);
#else
lcd_set_direction(DIR_YX_LRUD);
#endif
#endif
lcd_clear(BLACK);
g_lcd_gram0 = (uint32_t *)iomem_malloc(320*240*2);
g_lcd_gram1 = (uint32_t *)iomem_malloc(320*240*2);
/* DVP init */
printf("DVP init\n");
#if OV5640
dvp_init(16);
dvp_set_xclk_rate(50000000);
dvp_enable_burst();
dvp_set_output_enable(0, 0);
dvp_set_output_enable(1, 1);
dvp_set_image_format(DVP_CFG_RGB_FORMAT);
dvp_set_image_size(320, 240);
ov5640_init();
#else
dvp_init(8);
dvp_set_xclk_rate(24000000);
dvp_enable_burst();
dvp_set_output_enable(0, 0);
dvp_set_output_enable(1, 1);
dvp_set_image_format(DVP_CFG_RGB_FORMAT);
dvp_set_image_size(320, 240);
ov2640_init();
#endif
dvp_set_display_addr((uint32_t)g_lcd_gram0);
dvp_config_interrupt(DVP_CFG_START_INT_ENABLE | DVP_CFG_FINISH_INT_ENABLE, 0);
dvp_disable_auto();
/* DVP interrupt config */
printf("DVP interrupt config\n");
plic_set_priority(IRQN_DVP_INTERRUPT, 1);
plic_irq_register(IRQN_DVP_INTERRUPT, on_irq_dvp, NULL);
plic_irq_enable(IRQN_DVP_INTERRUPT);
/* enable global interrupt */
sysctl_enable_irq();
/* SD card init */
if (sd_init())
{
printf("Fail to init SD card\n");
return -1;
}
/* mount file system to SD card */
if (f_mount(&sdcard_fs, _T("0:"), 1))
{
printf("Fail to mount file system\n");
return -1;
}
/* system start */
printf("system start\n");
g_ram_mux = 0;
g_dvp_finish_flag = 0;
dvp_clear_interrupt(DVP_STS_FRAME_START | DVP_STS_FRAME_FINISH);
dvp_config_interrupt(DVP_CFG_START_INT_ENABLE | DVP_CFG_FINISH_INT_ENABLE, 1);
while (1)
{
/* ai cal finish*/
while (g_dvp_finish_flag == 0)
;
g_ram_mux ^= 0x01;
g_dvp_finish_flag = 0;
if (g_save_flag)
{
rgb565tobmp((uint8_t*)(g_ram_mux ? g_lcd_gram0 : g_lcd_gram1), 320, 240, _T("0:photo.bmp"));
g_save_flag = 0;
}
/* display pic*/
lcd_draw_picture(0, 0, 320, 240, g_ram_mux ? g_lcd_gram0 : g_lcd_gram1);
}
iomem_free(g_lcd_gram0);
iomem_free(g_lcd_gram1);
return 0;
}
| 25.823308 | 104 | 0.688601 |
d6fbcf5147cb894607241fa4969b6dd6a5691d24 | 6,272 | c | C | src/add_routes.c | kmwoley/onebusaway-pebbletime | 2e3b8b76f9f9a7df8ef70fa2657d3ab57031ab92 | [
"Apache-2.0"
] | 4 | 2016-10-28T20:18:30.000Z | 2016-11-03T00:37:33.000Z | src/add_routes.c | kmwoley/onebusaway-pebbletime | 2e3b8b76f9f9a7df8ef70fa2657d3ab57031ab92 | [
"Apache-2.0"
] | 26 | 2016-07-07T16:27:49.000Z | 2016-12-15T06:19:26.000Z | src/add_routes.c | kmwoley/onebusaway-pebbletime | 2e3b8b76f9f9a7df8ef70fa2657d3ab57031ab92 | [
"Apache-2.0"
] | null | null | null | #include "add_routes.h"
#include "utility.h"
#include "error_window.h"
#include "progress_window.h"
#include "communication.h"
static Window *s_window;
static MenuLayer *s_menu_layer;
static Stop s_stop;
static Routes s_nearby_routes;
void BuildFavorites(Buses* buses) {
for(uint i = 0; i < s_nearby_routes.count; i++) {
bool favorite = GetBusIndex(
s_stop.stop_id,
s_nearby_routes.data[i].route_id, buses) < 0 ? false : true;
s_nearby_routes.data[i].favorite = favorite;
}
}
static uint16_t MenuGetNumSectionsCallback(MenuLayer *menu_layer,
void *data) {
return 1;
}
static uint16_t GetNumRowsCallback(MenuLayer *menu_layer,
uint16_t section_index,
void *context) {
return s_nearby_routes.count;
}
static int16_t GetHeaderHeightCallback(MenuLayer *menu_layer,
uint16_t section_index,
void *data) {
return MENU_CELL_BASIC_HEADER_HEIGHT;
}
static void DrawHeaderCallback(GContext* ctx,
const Layer *cell_layer,
uint16_t section_index,
void *data) {
MenuCellDrawHeader(ctx, cell_layer, "Select favorites");
}
static void DrawRowCallback(GContext *ctx,
const Layer *cell_layer,
MenuIndex *cell_index,
void *context) {
if(cell_index->row <= s_nearby_routes.count) {
if(s_nearby_routes.count == 0) {
menu_cell_basic_draw(ctx,
cell_layer,
"Sorry",
"No routes at this stop",
NULL);
}
else {
uint32_t i = cell_index->row;
// this used to be copy, but it crashed things no the watch hw
// worked fine on the emulator - not sure why that didn't work?
Route *r = &s_nearby_routes.data[i];
const char* heart = "❤";
// TODO - fix the size of name to a better value
char name[30];
if(r->favorite) {
snprintf(name, 30, "%s %s", heart, r->route_name);
}
else {
snprintf(name, 30, "%s", r->route_name);
}
MenuCellDraw(ctx ,cell_layer, name, r->description);
}
}
else {
APP_LOG(APP_LOG_LEVEL_ERROR, "Request for more routes than exist!");
}
}
static int16_t GetCellHeightCallback(struct MenuLayer *menu_layer,
MenuIndex *cell_index,
void *context) {
return PBL_IF_ROUND_ELSE(
menu_layer_is_index_selected(menu_layer, cell_index) ?
MENU_CELL_ROUND_FOCUSED_SHORT_CELL_HEIGHT :
MENU_CELL_ROUND_UNFOCUSED_TALL_CELL_HEIGHT,
MENU_CELL_HEIGHT_BUS);
}
static void SelectCallback(struct MenuLayer *menu_layer,
MenuIndex *cell_index,
void *context) {
if(s_nearby_routes.count == 0) {
// Do nothing
VibeMicroPulse();
}
else if(cell_index->row <= s_nearby_routes.count) {
Route *route = &s_nearby_routes.data[cell_index->row];
int32_t bus_index = GetBusIndex(s_stop.stop_id,
route->route_id,
(Buses*)context);
if(bus_index >= 0) {
RemoveBus(bus_index, (Buses*)context);
s_nearby_routes.data[cell_index->row].favorite = false;
}
else {
bool result = AddBusFromStopRoute(&s_stop, route, (Buses*)context);
s_nearby_routes.data[cell_index->row].favorite = result;
if(!result) {
ErrorWindowPush(
"Can't save favorite\n\nMaximum number of favorite buses reached",
false);
}
}
menu_layer_reload_data(s_menu_layer);
}
else {
APP_LOG(APP_LOG_LEVEL_ERROR, "SelectCallback: too many routes");
}
}
static void WindowLoad(Window *window) {
Layer *window_layer = window_get_root_layer(window);
GRect bounds = layer_get_bounds(window_layer);
Buses* buses = window_get_user_data(window);
s_menu_layer = menu_layer_create(bounds);
if(s_menu_layer == NULL) {
APP_LOG(APP_LOG_LEVEL_ERROR, "NULL MENU LAYER");
ErrorWindowPush(
"Critical error\n\nOut of memory\n\n0x100011",
true);
}
#if defined(PBL_COLOR)
menu_layer_set_normal_colors(s_menu_layer, GColorWhite, GColorBlack);
menu_layer_set_highlight_colors(s_menu_layer, GColorBlue, GColorWhite);
#endif
menu_layer_set_callbacks(s_menu_layer, buses, (MenuLayerCallbacks) {
.get_num_sections = MenuGetNumSectionsCallback,
.get_num_rows = GetNumRowsCallback,
.get_header_height = GetHeaderHeightCallback,
.draw_header = DrawHeaderCallback,
.draw_row = DrawRowCallback,
.get_cell_height = GetCellHeightCallback,
.select_click = SelectCallback
});
menu_layer_set_click_config_onto_window(s_menu_layer, window);
layer_add_child(window_layer, menu_layer_get_layer(s_menu_layer));
}
static void WindowUnload(Window *window) {
menu_layer_destroy(s_menu_layer);
window_destroy(s_window);
s_window = NULL;
}
void AddRoutesUpdate(Routes routes, Buses* buses) {
s_nearby_routes = routes;
BuildFavorites(buses);
if(s_window) {
window_set_user_data(s_window, buses);
if(!window_stack_contains_window(s_window)) {
window_stack_push(s_window, true);
ProgressWindowRemove();
}
else {
layer_mark_dirty(menu_layer_get_layer(s_menu_layer));
menu_layer_reload_data(s_menu_layer);
}
}
}
void AddRoutesProgressCancelCallback() {
WindowUnload(s_window);
}
void AddRoutesInit(Stop stop, Buses* buses) {
s_stop = stop;
s_menu_layer = NULL;
s_window = window_create();
if(s_window == NULL) {
APP_LOG(APP_LOG_LEVEL_ERROR, "NULL WINDOW LAYER");
ErrorWindowPush(
"Critical error\n\nOut of memory\n\n0x100011",
true);
return;
}
window_set_window_handlers(s_window, (WindowHandlers) {
.load = WindowLoad,
.unload = WindowUnload,
});
// Start the process of getting the routes
ProgressWindowPush(AddRoutesProgressCancelCallback);
SendAppMessageGetRoutesForStop(&s_stop);
}
| 30.446602 | 79 | 0.632175 |
d6fc2f554a8706b06dfd083042aaf2d470c60fce | 5,311 | h | C | s2e/source/s2e-linux-kernel/decree-cgc-cfe/security/apparmor/include/context.h | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 55 | 2019-12-20T03:25:14.000Z | 2022-01-16T07:19:47.000Z | s2e/source/s2e-linux-kernel/decree-cgc-cfe/security/apparmor/include/context.h | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 2 | 2020-11-02T08:01:00.000Z | 2022-03-27T02:59:18.000Z | s2e/source/s2e-linux-kernel/decree-cgc-cfe/security/apparmor/include/context.h | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 11 | 2020-08-06T03:59:45.000Z | 2022-02-25T02:31:59.000Z | /*
* AppArmor security module
*
* This file contains AppArmor contexts used to associate "labels" to objects.
*
* Copyright (C) 1998-2008 Novell/SUSE
* Copyright 2009-2010 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2 of the
* License.
*/
#ifndef __AA_CONTEXT_H
#define __AA_CONTEXT_H
#include <linux/cred.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include "label.h"
#include "policy.h"
#define cred_cxt(X) (X)->security
#define current_cxt() cred_cxt(current_cred())
#define current_ns() labels_ns(__aa_current_label())
/**
* struct aa_task_cxt - primary label for confined tasks
* @label: the current label (NOT NULL)
* @exec: label to transition to on next exec (MAYBE NULL)
* @previous: label the task may return to (MAYBE NULL)
* @token: magic value the task must know for returning to @previous
*
* Contains the task's current label (which could change due to
* change_hat). Plus the hat_magic needed during change_hat.
*
* TODO: make so a task can be confined by a stack of contexts
*/
struct aa_task_cxt {
struct aa_label *label;
struct aa_label *onexec;
struct aa_label *previous;
u64 token;
};
struct aa_task_cxt *aa_alloc_task_context(gfp_t flags);
void aa_free_task_context(struct aa_task_cxt *cxt);
void aa_dup_task_context(struct aa_task_cxt *new,
const struct aa_task_cxt *old);
int aa_replace_current_label(struct aa_label *label);
int aa_set_current_onexec(struct aa_label *label);
int aa_set_current_hat(struct aa_label *label, u64 token);
int aa_restore_previous_label(u64 cookie);
struct aa_label *aa_get_task_label(struct task_struct *task);
/**
* aa_cred_label - obtain cred's label
* @cred: cred to obtain label from (NOT NULL)
*
* Returns: confining label
*
* does NOT increment reference count
*/
static inline struct aa_label *aa_cred_label(const struct cred *cred)
{
struct aa_task_cxt *cxt = cred_cxt(cred);
BUG_ON(!cxt || !cxt->label);
return cxt->label;
}
/**
* aa_get_newest_cred_label - obtain the newest version of the label on a cred
* @cred: cred to obtain label from (NOT NULL)
*
* Returns: newest version of confining label
*/
static inline struct aa_label *aa_get_newest_cred_label(const struct cred *cred)
{
return aa_get_newest_label(aa_cred_label(cred));
}
/**
* __aa_task_label - retrieve another task's label
* @task: task to query (NOT NULL)
*
* Returns: @task's label without incrementing its ref count
*
* If @task != current needs to be called in RCU safe critical section
*/
static inline struct aa_label *__aa_task_label(struct task_struct *task)
{
return aa_cred_label(__task_cred(task));
}
/**
* __aa_task_is_confined - determine if @task has any confinement
* @task: task to check confinement of (NOT NULL)
*
* If @task != current needs to be called in RCU safe critical section
*/
static inline bool __aa_task_is_confined(struct task_struct *task)
{
return !unconfined(__aa_task_label(task));
}
/**
* __aa_current_label - find the current tasks confining label
*
* Returns: up to date confining label or the ns unconfined label (NOT NULL)
*
* This fn will not update the tasks cred to the most up to date version
* of the label so it is safe to call when inside of locks.
*/
static inline struct aa_label *__aa_current_label(void)
{
return aa_cred_label(current_cred());
}
/**
* __aa_get_current_label - find newest version of the current tasks label
*
* Returns: newest version of confining label (NOT NULL)
*
* This fn will not update the tasks cred, so it is safe inside of locks
*
* The returned reference must be put with __aa_put_current_label()
*/
static inline struct aa_label *__aa_get_current_label(void)
{
struct aa_label *l = __aa_current_label();
if (label_invalid(l))
l = aa_get_newest_label(l);
return l;
}
/**
* __aa_put_current_label - put a reference found with aa_get_current_label
* @label: label reference to put
*
* Should only be used with a reference obtained with __aa_get_current_label
* and never used in situations where the task cred may be updated
*/
static inline void __aa_put_current_label(struct aa_label *label)
{
if (label != __aa_current_label())
aa_put_label(label);
}
/**
* aa_current_label - find the current tasks confining label and update it
*
* Returns: up to date confining label or the ns unconfined label (NOT NULL)
*
* This fn will update the tasks cred structure if the label has been
* replaced. Not safe to call inside locks
*/
static inline struct aa_label *aa_current_label(void)
{
const struct aa_task_cxt *cxt = current_cxt();
struct aa_label *label;
BUG_ON(!cxt || !cxt->label);
if (label_invalid(cxt->label)) {
label = aa_get_newest_label(cxt->label);
aa_replace_current_label(label);
aa_put_label(label);
cxt = current_cxt();
}
return cxt->label;
}
/**
* aa_clear_task_cxt_trans - clear transition tracking info from the cxt
* @cxt: task context to clear (NOT NULL)
*/
static inline void aa_clear_task_cxt_trans(struct aa_task_cxt *cxt)
{
aa_put_label(cxt->previous);
aa_put_label(cxt->onexec);
cxt->previous = NULL;
cxt->onexec = NULL;
cxt->token = 0;
}
#endif /* __AA_CONTEXT_H */
| 27.806283 | 80 | 0.741103 |
d6fc63667f180818f404e59973046d74d56ba65a | 577 | h | C | PrivateFrameworks/iTunesStoreUI.framework/SUItemValidator.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 36 | 2016-04-20T04:19:04.000Z | 2018-10-08T04:12:25.000Z | PrivateFrameworks/iTunesStoreUI.framework/SUItemValidator.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | null | null | null | PrivateFrameworks/iTunesStoreUI.framework/SUItemValidator.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 10 | 2016-06-16T02:40:44.000Z | 2019-01-15T03:31:45.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/iTunesStoreUI.framework/iTunesStoreUI
*/
@interface SUItemValidator : NSObject {
NSMutableArray * _collectionTests;
NSMutableArray * _itemTests;
}
@property (nonatomic, readonly) NSArray *validationTests;
- (void)addCollectionValidationTests:(id)arg1;
- (void)addItemValidationTests:(id)arg1;
- (void)dealloc;
- (void)removeValidationTest:(id)arg1;
- (bool)validateItems:(id)arg1 error:(id*)arg2;
- (bool)validateItems:(id)arg1 offers:(id)arg2 error:(id*)arg3;
- (id)validationTests;
@end
| 27.47619 | 81 | 0.760832 |
d6fdfd9b9bb7991ecc94ab6b75523845248c6ece | 310 | h | C | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glibc/2.29-r0/git/include/sys/gmon.h | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glibc/2.29-r0/git/include/sys/gmon.h | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glibc/2.29-r0/git/include/sys/gmon.h | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | #ifndef _SYS_GMON_H
#include <gmon/sys/gmon.h>
#ifndef _ISOMAC
/* Now define the internal interfaces. */
/* Write current profiling data to file. */
extern void __write_profiling(void);
extern void write_profiling(void);
extern struct gmonparam _gmonparam attribute_hidden;
#endif /* !_ISOMAC */
#endif
| 19.375 | 52 | 0.754839 |
d900e77e53632fd28b734245842d735a1e3323b7 | 561 | c | C | release/src-ra-4300/linux/linux-2.6.36.x/arch/m68k/kernel/m68k_ksyms.c | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 21 | 2021-01-22T06:47:38.000Z | 2022-03-20T14:24:29.000Z | release/src-ra-4300/linux/linux-2.6.36.x/arch/m68k/kernel/m68k_ksyms.c | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 1 | 2021-02-24T05:16:58.000Z | 2021-02-24T05:16:58.000Z | release/src-ra-4300/linux/linux-2.6.36.x/arch/m68k/kernel/m68k_ksyms.c | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 12 | 2021-01-22T14:59:28.000Z | 2022-02-22T04:03:31.000Z | #include <linux/module.h>
asmlinkage long long __ashldi3 (long long, int);
asmlinkage long long __ashrdi3 (long long, int);
asmlinkage long long __lshrdi3 (long long, int);
asmlinkage long long __muldi3 (long long, long long);
/* The following are special because they're not called
explicitly (the C compiler generates them). Fortunately,
their interface isn't gonna change any time soon now, so
it's OK to leave it out of version control. */
EXPORT_SYMBOL(__ashldi3);
EXPORT_SYMBOL(__ashrdi3);
EXPORT_SYMBOL(__lshrdi3);
EXPORT_SYMBOL(__muldi3);
| 33 | 60 | 0.766488 |
d9011687abbf082b50ebce854a430895c3c862a1 | 177 | h | C | libraries/ms-common/inc/crc15.h | Citrusboa/firmware_xiv | 4379cefae900fd67bd14d930da6b8acfce625176 | [
"MIT"
] | 14 | 2019-11-12T00:11:29.000Z | 2021-12-13T05:32:41.000Z | libraries/ms-common/inc/crc15.h | 123Logan321/firmware_xiv | 14468d55753ad62f8a63a9289511e72131443042 | [
"MIT"
] | 191 | 2019-11-12T05:36:58.000Z | 2022-03-21T19:54:46.000Z | libraries/ms-common/inc/crc15.h | 123Logan321/firmware_xiv | 14468d55753ad62f8a63a9289511e72131443042 | [
"MIT"
] | 14 | 2020-06-06T14:43:14.000Z | 2022-03-08T00:48:11.000Z | #pragma once
// crc15 implementation for the LTC6811
#include <stddef.h>
#include <stdint.h>
void crc15_init_table(void);
uint16_t crc15_calculate(uint8_t *data, size_t len);
| 19.666667 | 52 | 0.774011 |
d9011d5caa8a2e2023961a195e829155722ebaa6 | 644 | h | C | WDZSDK/Classes/headers/WDZAlarmCategoryMenuView.h | DanielOYC/WDZSDK | 6ef97eabfd0e9094b857a87a563b8029db04b0e5 | [
"MIT"
] | null | null | null | WDZSDK/Classes/headers/WDZAlarmCategoryMenuView.h | DanielOYC/WDZSDK | 6ef97eabfd0e9094b857a87a563b8029db04b0e5 | [
"MIT"
] | null | null | null | WDZSDK/Classes/headers/WDZAlarmCategoryMenuView.h | DanielOYC/WDZSDK | 6ef97eabfd0e9094b857a87a563b8029db04b0e5 | [
"MIT"
] | null | null | null | //
// WDZAlarmCategoryMenuView.h
// WanDianZhang
//
// Created by ovopark_iOS1 on 16/6/13.
// Copyright © 2016年 zhenglaixian. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "WDZAlarmModel.h"
@protocol WDZAlarmCategoryMenuViewDelegate;
@interface WDZAlarmCategoryMenuView : UIView
@property (strong , nonatomic) WDZAlarmCategory *selectedAlarmCategory;
@property (weak , nonatomic) id <WDZAlarmCategoryMenuViewDelegate>delegate;
- (void)reload;
@end
@protocol WDZAlarmCategoryMenuViewDelegate <NSObject>
- (void)alarmCategoriesMenuView:(WDZAlarmCategoryMenuView *)v didSelectedCategory:(WDZAlarmCategory *)category;
@end
| 22.206897 | 111 | 0.785714 |
d9018efaaf4d7be680a71c745a09a3b8e134fd83 | 723 | h | C | src/util.h | bogdan2412/re2 | 5a37eec8ec28ad6de747bc894cb7cc86f1ade340 | [
"MIT"
] | 32 | 2015-09-14T15:47:21.000Z | 2022-03-29T00:18:14.000Z | src/util.h | bogdan2412/re2 | 5a37eec8ec28ad6de747bc894cb7cc86f1ade340 | [
"MIT"
] | 27 | 2015-01-24T23:47:12.000Z | 2022-02-24T02:30:51.000Z | src/util.h | bogdan2412/re2 | 5a37eec8ec28ad6de747bc894cb7cc86f1ade340 | [
"MIT"
] | 15 | 2015-01-17T16:14:29.000Z | 2021-12-17T02:46:36.000Z | #ifndef MLRE2__UTIL_H
#define MLRE2__UTIL_H
/* must be #include'ed inside an extern "C" { } block */
#define Regex_val(v) (*(RE2 **) Data_custom_val(v))
#define RegexSet_val(v) (*(RE2::Set **) Data_custom_val(v))
#define RegexOptions_val(v) (*(RE2::Options **) Data_custom_val(v))
#define PAIR(v_dst, v_a, v_b) do { \
v_dst = caml_alloc_small(2, 0); \
Field(v_dst, 0) = (v_a); \
Field(v_dst, 1) = (v_b); \
} while(false)
#define SOME(v_dst, v) do { \
v_dst = caml_alloc_small(1, 0); \
Field(v_dst, 0) = v; \
} while(false)
#endif /* MLRE2__UTIL_H */
| 32.863636 | 67 | 0.502075 |
d901969d622bb69132264b99d155b2b943ab8692 | 20,985 | h | C | workspace/judy-sys/lib/judy-1.0.5/src/JudyL/JudyL.h | lemonrock/judy | 2bbabe10f754056a94e9520081539c03b1ff74d2 | [
"Apache-2.0"
] | 72 | 2015-01-05T16:54:20.000Z | 2021-04-26T22:53:53.000Z | workspace/judy-sys/lib/judy-1.0.5/src/JudyL/JudyL.h | lemonrock/judy | 2bbabe10f754056a94e9520081539c03b1ff74d2 | [
"Apache-2.0"
] | 32 | 2015-10-01T21:32:01.000Z | 2020-09-28T12:50:58.000Z | workspace/judy-sys/lib/judy-1.0.5/src/JudyL/JudyL.h | lemonrock/judy | 2bbabe10f754056a94e9520081539c03b1ff74d2 | [
"Apache-2.0"
] | 12 | 2015-06-09T20:58:37.000Z | 2020-07-18T16:17:34.000Z | #ifndef _JUDYL_INCLUDED
#define _JUDYL_INCLUDED
// _________________
//
// Copyright (C) 2000 - 2002 Hewlett-Packard Company
//
// This program is free software; you can redistribute it and/or modify it
// under the term of the GNU Lesser General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
// for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// _________________
// @(#) $Revision: 4.41 $ $Source: /judy/src/JudyL/JudyL.h $
// ****************************************************************************
// JUDYL -- SMALL/LARGE AND/OR CLUSTERED/SPARSE ARRAYS
//
// -by-
//
// Douglas L. Baskins
// doug@sourcejudy.com
//
// Judy arrays are designed to be used instead of arrays. The performance
// suggests the reason why Judy arrays are thought of as arrays, instead of
// trees. They are remarkably memory efficient at all populations.
// Implemented as a hybrid digital tree (but really a state machine, see
// below), Judy arrays feature fast insert/retrievals, fast near neighbor
// searching, and contain a population tree for extremely fast ordinal related
// retrievals.
//
// CONVENTIONS:
//
// - The comments here refer to 32-bit [64-bit] systems.
//
// - BranchL, LeafL refer to linear branches and leaves (small populations),
// except LeafL does not actually appear as such; rather, Leaf1..3 [Leaf1..7]
// is used to represent leaf Index sizes, and LeafW refers to a Leaf with
// full (Long) word Indexes, which is also a type of linear leaf. Note that
// root-level LeafW (Leaf4 [Leaf8]) leaves are called LEAFW.
//
// - BranchB, LeafB1 refer to bitmap branches and leaves (intermediate
// populations).
//
// - BranchU refers to uncompressed branches. An uncompressed branch has 256
// JPs, some of which could be null. Note: All leaves are compressed (and
// sorted), or else an expanse is full (FullPopu), so there is no LeafU
// equivalent to BranchU.
//
// - "Popu" is short for "Population".
// - "Pop1" refers to actual population (base 1).
// - "Pop0" refers to Pop1 - 1 (base 0), the way populations are stored in data
// structures.
//
// - Branches and Leaves are both named by the number of bytes in their Pop0
// field. In the case of Leaves, the same number applies to the Index sizes.
//
// - The representation of many numbers as hex is a relatively safe and
// portable way to get desired bitpatterns as unsigned longs.
//
// - Some preprocessors cant handle single apostrophe characters within
// #ifndef code, so here, delete all instead.
#include "JudyPrivate.h" // includes Judy.h in turn.
#include "JudyPrivateBranch.h" // support for branches.
// ****************************************************************************
// JUDYL ROOT POINTER (JRP) AND JUDYL POINTER (JP) TYPE FIELDS
// ****************************************************************************
typedef enum // uint8_t -- but C does not support this type of enum.
{
// JP NULL TYPES:
//
// There is a series of cJL_JPNULL* Types because each one pre-records a
// different Index Size for when the first Index is inserted in the previously
// null JP. They must start >= 8 (three bits).
//
// Note: These Types must be in sequential order for doing relative
// calculations between them.
cJL_JPNULL1 = 1,
// Index Size 1[1] byte when 1 Index inserted.
cJL_JPNULL2, // Index Size 2[2] bytes when 1 Index inserted.
cJL_JPNULL3, // Index Size 3[3] bytes when 1 Index inserted.
#ifndef JU_64BIT
#define cJL_JPNULLMAX cJL_JPNULL3
#else
cJL_JPNULL4, // Index Size 4[4] bytes when 1 Index inserted.
cJL_JPNULL5, // Index Size 5[5] bytes when 1 Index inserted.
cJL_JPNULL6, // Index Size 6[6] bytes when 1 Index inserted.
cJL_JPNULL7, // Index Size 7[7] bytes when 1 Index inserted.
#define cJL_JPNULLMAX cJL_JPNULL7
#endif
// JP BRANCH TYPES:
//
// Note: There are no state-1 branches; only leaves reside at state 1.
// Linear branches:
//
// Note: These Types must be in sequential order for doing relative
// calculations between them.
cJL_JPBRANCH_L2, // 2[2] bytes Pop0, 1[5] bytes Dcd.
cJL_JPBRANCH_L3, // 3[3] bytes Pop0, 0[4] bytes Dcd.
#ifdef JU_64BIT
cJL_JPBRANCH_L4, // [4] bytes Pop0, [3] bytes Dcd.
cJL_JPBRANCH_L5, // [5] bytes Pop0, [2] bytes Dcd.
cJL_JPBRANCH_L6, // [6] bytes Pop0, [1] byte Dcd.
cJL_JPBRANCH_L7, // [7] bytes Pop0, [0] bytes Dcd.
#endif
cJL_JPBRANCH_L, // note: DcdPopO field not used.
// Bitmap branches:
//
// Note: These Types must be in sequential order for doing relative
// calculations between them.
cJL_JPBRANCH_B2, // 2[2] bytes Pop0, 1[5] bytes Dcd.
cJL_JPBRANCH_B3, // 3[3] bytes Pop0, 0[4] bytes Dcd.
#ifdef JU_64BIT
cJL_JPBRANCH_B4, // [4] bytes Pop0, [3] bytes Dcd.
cJL_JPBRANCH_B5, // [5] bytes Pop0, [2] bytes Dcd.
cJL_JPBRANCH_B6, // [6] bytes Pop0, [1] byte Dcd.
cJL_JPBRANCH_B7, // [7] bytes Pop0, [0] bytes Dcd.
#endif
cJL_JPBRANCH_B, // note: DcdPopO field not used.
// Uncompressed branches:
//
// Note: These Types must be in sequential order for doing relative
// calculations between them.
cJL_JPBRANCH_U2, // 2[2] bytes Pop0, 1[5] bytes Dcd.
cJL_JPBRANCH_U3, // 3[3] bytes Pop0, 0[4] bytes Dcd.
#ifdef JU_64BIT
cJL_JPBRANCH_U4, // [4] bytes Pop0, [3] bytes Dcd.
cJL_JPBRANCH_U5, // [5] bytes Pop0, [2] bytes Dcd.
cJL_JPBRANCH_U6, // [6] bytes Pop0, [1] byte Dcd.
cJL_JPBRANCH_U7, // [7] bytes Pop0, [0] bytes Dcd.
#endif
cJL_JPBRANCH_U, // note: DcdPopO field not used.
// JP LEAF TYPES:
// Linear leaves:
//
// Note: These Types must be in sequential order for doing relative
// calculations between them.
//
// Note: There is no full-word (4-byte [8-byte]) Index leaf under a JP because
// non-root-state leaves only occur under branches that decode at least one
// byte. Full-word, root-state leaves are under a JRP, not a JP. However, in
// the code a "fake" JP can be created temporarily above a root-state leaf.
cJL_JPLEAF1, // 1[1] byte Pop0, 2 bytes Dcd.
cJL_JPLEAF2, // 2[2] bytes Pop0, 1[5] bytes Dcd.
cJL_JPLEAF3, // 3[3] bytes Pop0, 0[4] bytes Dcd.
#ifdef JU_64BIT
cJL_JPLEAF4, // [4] bytes Pop0, [3] bytes Dcd.
cJL_JPLEAF5, // [5] bytes Pop0, [2] bytes Dcd.
cJL_JPLEAF6, // [6] bytes Pop0, [1] byte Dcd.
cJL_JPLEAF7, // [7] bytes Pop0, [0] bytes Dcd.
#endif
// Bitmap leaf; Index Size == 1:
//
// Note: These are currently only supported at state 1. At other states the
// bitmap would grow from 256 to 256^2, 256^3, ... bits, which would not be
// efficient..
cJL_JPLEAF_B1, // 1[1] byte Pop0, 2[6] bytes Dcd.
// Full population; Index Size == 1 virtual leaf:
//
// Note: JudyL has no cJL_JPFULLPOPU1 equivalent to cJ1_JPFULLPOPU1, because
// in the JudyL case this could result in a values-only leaf of up to 256 words
// (value areas) that would be slow to insert/delete.
// JP IMMEDIATES; leaves (Indexes) stored inside a JP:
//
// The second numeric suffix is the Pop1 for each type. As the Index Size
// increases, the maximum possible population decreases.
//
// Note: These Types must be in sequential order in each group (Index Size),
// and the groups in correct order too, for doing relative calculations between
// them. For example, since these Types enumerate the Pop1 values (unlike
// other JP Types where there is a Pop0 value in the JP), the maximum Pop1 for
// each Index Size is computable.
//
// All enums equal or above this point are cJL_JPIMMEDs.
cJL_JPIMMED_1_01, // Index Size = 1, Pop1 = 1.
cJL_JPIMMED_2_01, // Index Size = 2, Pop1 = 1.
cJL_JPIMMED_3_01, // Index Size = 3, Pop1 = 1.
#ifdef JU_64BIT
cJL_JPIMMED_4_01, // Index Size = 4, Pop1 = 1.
cJL_JPIMMED_5_01, // Index Size = 5, Pop1 = 1.
cJL_JPIMMED_6_01, // Index Size = 6, Pop1 = 1.
cJL_JPIMMED_7_01, // Index Size = 7, Pop1 = 1.
#endif
cJL_JPIMMED_1_02, // Index Size = 1, Pop1 = 2.
cJL_JPIMMED_1_03, // Index Size = 1, Pop1 = 3.
#ifdef JU_64BIT
cJL_JPIMMED_1_04, // Index Size = 1, Pop1 = 4.
cJL_JPIMMED_1_05, // Index Size = 1, Pop1 = 5.
cJL_JPIMMED_1_06, // Index Size = 1, Pop1 = 6.
cJL_JPIMMED_1_07, // Index Size = 1, Pop1 = 7.
cJL_JPIMMED_2_02, // Index Size = 2, Pop1 = 2.
cJL_JPIMMED_2_03, // Index Size = 2, Pop1 = 3.
cJL_JPIMMED_3_02, // Index Size = 3, Pop1 = 2.
#endif
// This special Type is merely a sentinel for doing relative calculations.
// This value should not be used in switch statements (to avoid allocating code
// for it), which is also why it appears at the end of the enum list.
cJL_JPIMMED_CAP
} jpL_Type_t;
// RELATED VALUES:
// Index Size (state) for leaf JP, and JP type based on Index Size (state):
#define JL_LEAFINDEXSIZE(jpType) ((jpType) - cJL_JPLEAF1 + 1)
#define JL_LEAFTYPE(IndexSize) ((IndexSize) + cJL_JPLEAF1 - 1)
// MAXIMUM POPULATIONS OF LINEAR LEAVES:
#ifndef JU_64BIT // 32-bit
#define J_L_MAXB (sizeof(Word_t) * 64)
#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words.
#define cJL_LEAF1_MAXWORDS (32) // max Leaf1 size in words.
// Note: cJL_LEAF1_MAXPOP1 is chosen such that the index portion is less than
// 32 bytes -- the number of bytes the index takes in a bitmap leaf.
#define cJL_LEAF1_MAXPOP1 \
((cJL_LEAF1_MAXWORDS * cJU_BYTESPERWORD)/(1 + cJU_BYTESPERWORD))
#define cJL_LEAF2_MAXPOP1 (J_L_MAXB / (2 + cJU_BYTESPERWORD))
#define cJL_LEAF3_MAXPOP1 (J_L_MAXB / (3 + cJU_BYTESPERWORD))
#define cJL_LEAFW_MAXPOP1 \
((J_L_MAXB - cJU_BYTESPERWORD) / (2 * cJU_BYTESPERWORD))
#else // 64-bit
#define J_L_MAXB (sizeof(Word_t) * 64)
#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words.
#define cJL_LEAF1_MAXWORDS (15) // max Leaf1 size in words.
#define cJL_LEAF1_MAXPOP1 \
((cJL_LEAF1_MAXWORDS * cJU_BYTESPERWORD)/(1 + cJU_BYTESPERWORD))
#define cJL_LEAF2_MAXPOP1 (J_L_MAXB / (2 + cJU_BYTESPERWORD))
#define cJL_LEAF3_MAXPOP1 (J_L_MAXB / (3 + cJU_BYTESPERWORD))
#define cJL_LEAF4_MAXPOP1 (J_L_MAXB / (4 + cJU_BYTESPERWORD))
#define cJL_LEAF5_MAXPOP1 (J_L_MAXB / (5 + cJU_BYTESPERWORD))
#define cJL_LEAF6_MAXPOP1 (J_L_MAXB / (6 + cJU_BYTESPERWORD))
#define cJL_LEAF7_MAXPOP1 (J_L_MAXB / (7 + cJU_BYTESPERWORD))
#define cJL_LEAFW_MAXPOP1 \
((J_L_MAXB - cJU_BYTESPERWORD) / (2 * cJU_BYTESPERWORD))
#endif // 64-bit
// MAXIMUM POPULATIONS OF IMMEDIATE JPs:
//
// These specify the maximum Population of immediate JPs with various Index
// Sizes (== sizes of remaining undecoded Index bits). Since the JP Types enum
// already lists all the immediates in order by state and size, calculate these
// values from it to avoid redundancy.
#define cJL_IMMED1_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 1) // 3 [7].
#define cJL_IMMED2_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 2) // 1 [3].
#define cJL_IMMED3_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 3) // 1 [2].
#ifdef JU_64BIT
#define cJL_IMMED4_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 4) // [1].
#define cJL_IMMED5_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 5) // [1].
#define cJL_IMMED6_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 6) // [1].
#define cJL_IMMED7_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 7) // [1].
#endif
// ****************************************************************************
// JUDYL LEAF BITMAP (JLLB) SUPPORT
// ****************************************************************************
//
// Assemble bitmap leaves out of smaller units that put bitmap subexpanses
// close to their associated pointers. Why not just use a bitmap followed by a
// series of pointers? (See 4.27.) Turns out this wastes a cache fill on
// systems with smaller cache lines than the assumed value cJU_WORDSPERCL.
#define JL_JLB_BITMAP(Pjlb, Subexp) ((Pjlb)->jLlb_jLlbs[Subexp].jLlbs_Bitmap)
#define JL_JLB_PVALUE(Pjlb, Subexp) ((Pjlb)->jLlb_jLlbs[Subexp].jLlbs_PValue)
typedef struct J__UDYL_LEAF_BITMAP_SUBEXPANSE
{
BITMAPL_t jLlbs_Bitmap;
Pjv_t jLlbs_PValue;
} jLlbs_t;
typedef struct J__UDYL_LEAF_BITMAP
{
jLlbs_t jLlb_jLlbs[cJU_NUMSUBEXPL];
} jLlb_t, * PjLlb_t;
// Words per bitmap leaf:
#define cJL_WORDSPERLEAFB1 (sizeof(jLlb_t) / cJU_BYTESPERWORD)
// ****************************************************************************
// MEMORY ALLOCATION SUPPORT
// ****************************************************************************
// ARRAY-GLOBAL INFORMATION:
//
// At the cost of an occasional additional cache fill, this object, which is
// pointed at by a JRP and in turn points to a JP_BRANCH*, carries array-global
// information about a JudyL array that has sufficient population to amortize
// the cost. The jpm_Pop0 field prevents having to add up the total population
// for the array in insert, delete, and count code. The jpm_JP field prevents
// having to build a fake JP for entry to a state machine; however, the
// jp_DcdPopO field in jpm_JP, being one byte too small, is not used.
//
// Note: Struct fields are ordered to keep "hot" data in the first 8 words
// (see left-margin comments) for machines with 8-word cache lines, and to keep
// sub-word fields together for efficient packing.
typedef struct J_UDYL_POPULATION_AND_MEMORY
{
/* 1 */ Word_t jpm_Pop0; // total population-1 in array.
/* 2 */ jp_t jpm_JP; // JP to first branch; see above.
/* 4 */ Word_t jpm_LastUPop0; // last jpm_Pop0 when convert to BranchU
/* 7 */ Pjv_t jpm_PValue; // pointer to value to return.
// Note: Field names match PJError_t for convenience in macros:
/* 8 */ char je_Errno; // one of the enums in Judy.h.
/* 8/9 */ int je_ErrID; // often an internal source line number.
/* 9/10 */ Word_t jpm_TotalMemWords; // words allocated in array.
} jLpm_t, *PjLpm_t;
// TABLES FOR DETERMINING IF LEAVES HAVE ROOM TO GROW:
//
// These tables indicate if a given memory chunk can support growth of a given
// object into wasted (rounded-up) memory in the chunk. Note: This violates
// the hiddenness of the JudyMalloc code.
extern const uint8_t j__L_Leaf1PopToWords[cJL_LEAF1_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf2PopToWords[cJL_LEAF2_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf3PopToWords[cJL_LEAF3_MAXPOP1 + 1];
#ifdef JU_64BIT
extern const uint8_t j__L_Leaf4PopToWords[cJL_LEAF4_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf5PopToWords[cJL_LEAF5_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf6PopToWords[cJL_LEAF6_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf7PopToWords[cJL_LEAF7_MAXPOP1 + 1];
#endif
extern const uint8_t j__L_LeafWPopToWords[cJL_LEAFW_MAXPOP1 + 1];
extern const uint8_t j__L_LeafVPopToWords[];
// These tables indicate where value areas start:
extern const uint8_t j__L_Leaf1Offset [cJL_LEAF1_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf2Offset [cJL_LEAF2_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf3Offset [cJL_LEAF3_MAXPOP1 + 1];
#ifdef JU_64BIT
extern const uint8_t j__L_Leaf4Offset [cJL_LEAF4_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf5Offset [cJL_LEAF5_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf6Offset [cJL_LEAF6_MAXPOP1 + 1];
extern const uint8_t j__L_Leaf7Offset [cJL_LEAF7_MAXPOP1 + 1];
#endif
extern const uint8_t j__L_LeafWOffset [cJL_LEAFW_MAXPOP1 + 1];
// Also define macros to hide the details in the code using these tables.
#define JL_LEAF1GROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAF1_MAXPOP1, j__L_Leaf1PopToWords)
#define JL_LEAF2GROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAF2_MAXPOP1, j__L_Leaf2PopToWords)
#define JL_LEAF3GROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAF3_MAXPOP1, j__L_Leaf3PopToWords)
#ifdef JU_64BIT
#define JL_LEAF4GROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAF4_MAXPOP1, j__L_Leaf4PopToWords)
#define JL_LEAF5GROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAF5_MAXPOP1, j__L_Leaf5PopToWords)
#define JL_LEAF6GROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAF6_MAXPOP1, j__L_Leaf6PopToWords)
#define JL_LEAF7GROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAF7_MAXPOP1, j__L_Leaf7PopToWords)
#endif
#define JL_LEAFWGROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJL_LEAFW_MAXPOP1, j__L_LeafWPopToWords)
#define JL_LEAFVGROWINPLACE(Pop1) \
J__U_GROWCK(Pop1, cJU_BITSPERSUBEXPL, j__L_LeafVPopToWords)
#define JL_LEAF1VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf1Offset[Pop1])
#define JL_LEAF2VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf2Offset[Pop1])
#define JL_LEAF3VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf3Offset[Pop1])
#ifdef JU_64BIT
#define JL_LEAF4VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf4Offset[Pop1])
#define JL_LEAF5VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf5Offset[Pop1])
#define JL_LEAF6VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf6Offset[Pop1])
#define JL_LEAF7VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf7Offset[Pop1])
#endif
#define JL_LEAFWVALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_LeafWOffset[Pop1])
#define JL_LEAF1POPTOWORDS(Pop1) (j__L_Leaf1PopToWords[Pop1])
#define JL_LEAF2POPTOWORDS(Pop1) (j__L_Leaf2PopToWords[Pop1])
#define JL_LEAF3POPTOWORDS(Pop1) (j__L_Leaf3PopToWords[Pop1])
#ifdef JU_64BIT
#define JL_LEAF4POPTOWORDS(Pop1) (j__L_Leaf4PopToWords[Pop1])
#define JL_LEAF5POPTOWORDS(Pop1) (j__L_Leaf5PopToWords[Pop1])
#define JL_LEAF6POPTOWORDS(Pop1) (j__L_Leaf6PopToWords[Pop1])
#define JL_LEAF7POPTOWORDS(Pop1) (j__L_Leaf7PopToWords[Pop1])
#endif
#define JL_LEAFWPOPTOWORDS(Pop1) (j__L_LeafWPopToWords[Pop1])
#define JL_LEAFVPOPTOWORDS(Pop1) (j__L_LeafVPopToWords[Pop1])
// FUNCTIONS TO ALLOCATE OBJECTS:
PjLpm_t j__udyLAllocJLPM(void); // constant size.
Pjbl_t j__udyLAllocJBL( PjLpm_t); // constant size.
Pjbb_t j__udyLAllocJBB( PjLpm_t); // constant size.
Pjp_t j__udyLAllocJBBJP(Word_t, PjLpm_t);
Pjbu_t j__udyLAllocJBU( PjLpm_t); // constant size.
Pjll_t j__udyLAllocJLL1( Word_t, PjLpm_t);
Pjll_t j__udyLAllocJLL2( Word_t, PjLpm_t);
Pjll_t j__udyLAllocJLL3( Word_t, PjLpm_t);
#ifdef JU_64BIT
Pjll_t j__udyLAllocJLL4( Word_t, PjLpm_t);
Pjll_t j__udyLAllocJLL5( Word_t, PjLpm_t);
Pjll_t j__udyLAllocJLL6( Word_t, PjLpm_t);
Pjll_t j__udyLAllocJLL7( Word_t, PjLpm_t);
#endif
Pjlw_t j__udyLAllocJLW( Word_t ); // no PjLpm_t needed.
PjLlb_t j__udyLAllocJLB1( PjLpm_t); // constant size.
Pjv_t j__udyLAllocJV( Word_t, PjLpm_t);
// FUNCTIONS TO FREE OBJECTS:
void j__udyLFreeJLPM( PjLpm_t, PjLpm_t); // constant size.
void j__udyLFreeJBL( Pjbl_t, PjLpm_t); // constant size.
void j__udyLFreeJBB( Pjbb_t, PjLpm_t); // constant size.
void j__udyLFreeJBBJP(Pjp_t, Word_t, PjLpm_t);
void j__udyLFreeJBU( Pjbu_t, PjLpm_t); // constant size.
void j__udyLFreeJLL1( Pjll_t, Word_t, PjLpm_t);
void j__udyLFreeJLL2( Pjll_t, Word_t, PjLpm_t);
void j__udyLFreeJLL3( Pjll_t, Word_t, PjLpm_t);
#ifdef JU_64BIT
void j__udyLFreeJLL4( Pjll_t, Word_t, PjLpm_t);
void j__udyLFreeJLL5( Pjll_t, Word_t, PjLpm_t);
void j__udyLFreeJLL6( Pjll_t, Word_t, PjLpm_t);
void j__udyLFreeJLL7( Pjll_t, Word_t, PjLpm_t);
#endif
void j__udyLFreeJLW( Pjlw_t, Word_t, PjLpm_t);
void j__udyLFreeJLB1( PjLlb_t, PjLpm_t); // constant size.
void j__udyLFreeJV( Pjv_t, Word_t, PjLpm_t);
void j__udyLFreeSM( Pjp_t, PjLpm_t); // everything below Pjp.
#endif // ! _JUDYL_INCLUDED
| 41.472332 | 80 | 0.660424 |
d902969dbcdd4317cd1d26141f187b4cfc87404c | 16,703 | c | C | common/itemtext.c | c0ze/tsl | 8b16872a4c41286c96fa623526d7940c687cf44f | [
"BSD-3-Clause"
] | null | null | null | common/itemtext.c | c0ze/tsl | 8b16872a4c41286c96fa623526d7940c687cf44f | [
"BSD-3-Clause"
] | null | null | null | common/itemtext.c | c0ze/tsl | 8b16872a4c41286c96fa623526d7940c687cf44f | [
"BSD-3-Clause"
] | null | null | null | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "main.h"
#include "stuff.h"
#include "item.h"
#include "stacks.h"
#include "creature.h"
#include "game.h"
/*
See item.h for prototypes.
*/
char * item_verbs[] =
{
[item_verb_bug] = "BUG",
[item_verb_take_off] = "take off",
[item_verb_put_on] = "put on",
[item_verb_put_away] = "put away",
[item_verb_ready] = "ready",
/* [item_verb_equip] = "equip",*/
[item_verb_wield] = "wield",
[item_verb_use] = "use",
[item_verb_drink] = "drink",
[item_verb_read] = "read",
[item_verb_eat] = "eat",
[item_verb_zap] = "zap",
[item_verb_light] = "light",
[item_verb_put_out] = "put out"
};
/*
Returns a pointer to a string describing the default action for ITEM
("drink" for potions, "equip" for armor, etc).
*/
char * get_default_verb(const item_t * item)
{
if (item == NULL)
return item_verbs[item_verb_bug];
switch (item->item_type)
{
case item_type_potion:
return item_verbs[item_verb_drink];
case item_type_wand:
return item_verbs[item_verb_zap];
case item_type_book:
case item_type_scroll:
return item_verbs[item_verb_read];
case item_type_tool:
return item_verbs[item_verb_use];
case item_type_food:
return item_verbs[item_verb_eat];
case item_type_m_weapon:
if (item->equipped)
return item_verbs[item_verb_put_away];
else
return item_verbs[item_verb_wield];
case item_type_r_weapon:
case item_type_ammo:
if (item->equipped)
return item_verbs[item_verb_put_away];
else
return item_verbs[item_verb_ready];
case item_type_light:
if (item->equipped)
return item_verbs[item_verb_put_out];
else
return item_verbs[item_verb_light];
default:
if (is_equipable(item))
{
if (item->equipped)
return item_verbs[item_verb_take_off];
else
return item_verbs[item_verb_put_on];
}
}
return item_verbs[item_verb_bug];
} /* get_default_verb */
void in_use_str(char * dest, const item_t * item)
{
if (item == NULL)
return;
switch (item->item_type)
{
case item_type_m_weapon:
strcpy(dest, "(wielded)");
break;
case item_type_r_weapon:
strcpy(dest, "(held)");
break;
case item_type_ammo:
strcpy(dest, "(ready)");
break;
case item_type_body:
case item_type_feet:
case item_type_head:
case item_type_cloak:
strcpy(dest, "(worn)");
break;
case item_type_tool:
case item_type_wand:
strcpy(dest, "(held)");
break;
default:
strcpy(dest, "(held)");
break;
}
return;
} /* in_use_str */
/*
Sets the "unidentified" and "identified" names of ITEM to NEW_UNID
and NEW_ID, respectively. If any of the values is omitted (== NULL),
that name will be skipped.
*/
void set_item_single_name(item_t * item, const char * new_unid, const char * new_id)
{
if (item == NULL)
return;
if (new_unid != NULL)
{
if (item->single_unid_name != NULL)
{
mem_alloc.chars -= strlen(item->single_unid_name) + 1;
free(item->single_unid_name);
}
item->single_unid_name = mydup(new_unid);
if (item->single_unid_name == NULL) out_of_memory();
mem_alloc.chars += strlen(item->single_unid_name) + 1;
}
if (new_id != NULL)
{
if (item->single_id_name != NULL)
{
mem_alloc.chars -= strlen(item->single_id_name) + 1;
free(item->single_id_name);
}
item->single_id_name = mydup(new_id);
if (item->single_id_name == NULL) out_of_memory();
mem_alloc.chars += strlen(item->single_id_name) + 1;
}
return;
} /* set_item_single_name */
/*
Sets the "unidentified" and "identified" *plural* names of ITEM to
NEW_UNID and NEW_ID, respectively. If any of the values is omitted
(== NULL), that name will be skipped. This is the name that will be
used when items are stacked. For items that don't stack, this can be
omitted.
*/
void set_item_plural_name(item_t * item, const char * new_unid, const char * new_id)
{
if (item == NULL)
return;
if (new_unid != NULL)
{
if (item->plural_unid_name != NULL)
{
mem_alloc.chars -= strlen(item->plural_unid_name) + 1;
free(item->plural_unid_name);
}
item->plural_unid_name = mydup(new_unid);
if (item->plural_unid_name == NULL) out_of_memory();
mem_alloc.chars += strlen(item->plural_unid_name) + 1;
}
if (new_id != NULL)
{
if (item->plural_id_name != NULL)
{
mem_alloc.chars -= strlen(item->plural_id_name) + 1;
free(item->plural_id_name);
}
item->plural_id_name = mydup(new_id);
if (item->plural_id_name == NULL) out_of_memory();
mem_alloc.chars += strlen(item->plural_id_name) + 1;
}
return;
} /* set_item_plural_name */
/*
Sets the description of ITEM to NEW_DESC.
*/
void set_item_description(item_t * item, const char * new_desc)
{
if (item == NULL)
return;
if (new_desc != NULL)
{
if (item->description != NULL)
{
mem_alloc.chars -= strlen(item->description) + 1;
free(item->description);
}
item->description = mydup(new_desc);
if (item->description == NULL) out_of_memory();
mem_alloc.chars += strlen(item->description) + 1;
}
return;
} /* set_item_description */
/*
Returns what article should be used before ITEM, based on the number
in the stack and the (un)identified state of the item name.
See also:
item_article_t in item.h
item_t in item.h
*/
item_article_t get_item_article(const item_t * item)
{
if (item == NULL)
return article_i_a;
if (item->child == NULL)
{
if (identified(item) & known_name)
return item->single_id_article;
else
return item->single_unid_article;
}
else
{
if (identified(item) & known_name)
return item->plural_id_article;
else
return item->plural_unid_article;
}
} /* get_item_article */
/*
Returns a pointer to a string suitable for use in sentences. The
returned value must be free()d, See _get_item_name().
*/
char * get_item_name(const item_t * item)
{
return _get_item_name(item, false);
} /* get_item_name */
/*
Returns a pointer to a string suitable for use in inventories. The
returned value must be free()d, See _get_item_name().
*/
char * get_inv_item_name(const item_t * item)
{
return _get_item_name(item, true);
} /* get_inv_item_name */
/*
Returns a pointer to a name string for ITEM. The value returned has
been malloced and must be freed after use. If BRIEF is true, the
item name will be shortened as much as possible.
*/
char * _get_item_name(const item_t * item, const blean_t brief)
{
char final[80];
char temp[80];
char * ret;
id_status_t id;
unsigned quantity;
blean_t illiterate;
if (item == NULL)
return mydup("BUG: NULL item");
illiterate = attr_current(game->player, attr_p_read);
id = identified(item);
quantity = stack_size(item);
strcpy(final, "");
if (quantity != 1)
{
sprintf(final, "%d ", quantity);
}
if (item->item_type == item_type_light)
{
if (item->item_number == artifact_everlasting_lantern)
{
if (identified(item) & known_name)
{
strcat(final, "the ");
}
else
{
sprintf(temp, "%sunused %s", (brief ? "" : "an "), is_equipped(item) ? "lit " : "");
strcat(final, temp);
}
}
else if (item->custom[CUSTOM_LIGHT_TICKS] > 0)
{
if (item->custom[CUSTOM_LIGHT_TICKS] < item->custom[CUSTOM_LIGHT_MAX_TICKS] * 0.25)
sprintf(temp, "%snearly spent ", (brief ? "" : "a "));
else if (item->custom[CUSTOM_LIGHT_TICKS] < item->custom[CUSTOM_LIGHT_MAX_TICKS] * 0.75)
sprintf(temp, "%shalf-spent ", (brief ? "" : "a "));
else if (item->custom[CUSTOM_LIGHT_TICKS] < item->custom[CUSTOM_LIGHT_MAX_TICKS])
sprintf(temp, "%salmost unused ", (brief ? "" : "an "));
else if (item->custom[CUSTOM_LIGHT_TICKS] >= item->custom[CUSTOM_LIGHT_MAX_TICKS])
sprintf(temp, "%sunused ", (brief ? "" : "an "));
strcat(final, temp);
if (is_equipped(item))
strcat(final, "lit ");
}
}
else if (brief == false)
{
if (quantity == 1)
strcat(final, item_article_a[get_item_article(item)]);
strcat(final, item_article_of[get_item_article(item)]);
}
if (illiterate && item->item_type == item_type_scroll)
{
/* When you cannot read, all scrolls show up the same. */
if (quantity > 1)
strcat(final, "scrolls");
else
strcat(final, "scroll");
}
else if (id & known_name)
{
if (item->child == NULL)
{
if (item->single_id_name != NULL)
strcat(final, item->single_id_name);
else
strcat(final, "BUG");
}
else
{
if (item->plural_id_name != NULL)
strcat(final, item->plural_id_name);
else
strcat(final, "BUG");
}
}
else
{
if (item->child == NULL)
{
if (item->single_unid_name != NULL)
strcat(final, item->single_unid_name);
else
strcat(final, "BUG");
}
else
{
if (item->plural_unid_name != NULL)
strcat(final, item->plural_unid_name);
else
strcat(final, "BUG");
}
}
/*
Display charges remaining for items that have invoke powers (but
not scrolls, since they always have one "charge".
*/
if ((item->invoke_power != 0) &&
(id & known_charges) &&
(item->item_type != item_type_scroll))
{
if (item->charges == -1)
strcat(final, " [inf]");
else
{
sprintf(temp, " [%d]", item->charges);
strcat(final, temp);
}
}
/* If the player has made any notes for this item. */
if (illiterate == false && item->label != NULL)
{
strcat(final, " {");
strcat(final, item->label);
strcat(final, "}");
}
ret = mydup(final);
if (ret == NULL)
out_of_memory();
return ret;
} /* _get_item_name */
/*
Returns a string describing what is known about ITEM. The string
needs to be free()d.
*/
char * get_item_data(const item_t * item)
{
char * ret;
char temp[500];
char line[100];
char who[100];
int i;
int len;
if (item == NULL)
return mydup("BUG: NULL item");
strcpy(temp, "");
if (item->item_type == item_type_m_weapon)
strcpy(who, "wielder");
else
strcpy(who, "wearer");
if (item->item_type == item_type_m_weapon)
{
sprintf(line, " Damage:");
strcat(temp, line);
for (i = 0; i < WEAPON_ATKSEQLEN; i++)
{
if (item->custom[WEAPON_ATKSEQ + i] == 0)
{
break;
}
else if (item->custom[WEAPON_ATKSEQ + i] == -1)
{
strcat(temp, " _");
}
else if (item->custom[WEAPON_ATKSEQ + i] > 0)
{
if ((identified(item) & known_name) ||
item->custom[WEAPON_ATKSEQ_ID + i])
{
sprintf(line, " %d", item->custom[WEAPON_ATKSEQ + i]);
strcat(temp, line);
}
else
{
strcat(temp, " ?");
break;
}
}
}
}
if (identified(item) & known_name)
{
if (item->item_type == item_type_wand && identified(item) & known_name)
{
if (identified(item) & known_charges)
{
sprintf(line, " Holds %d charge%s of %s\n", item->charges,
(item->charges != 1 ? "s" : ""),
attr_info[item->invoke_power]->name);
}
else
{
sprintf(line, " Holds charges of %s.\n",
attr_info[item->invoke_power]->name);
}
strcat(temp, line);
}
if (explosive(item))
{
sprintf(line, " Explosive damage: %d-%d\n", get_min_damage(item), get_max_damage(item));
strcat(temp, line);
}
switch(item->item_type)
{
case item_type_ammo:
if (get_min_damage(item) && explosive(item) == false)
{
sprintf(line, " Damage: +%d\n", get_min_damage(item));
strcat(temp, line);
}
break;
case item_type_m_weapon:
strcat(temp, "\n");
if (item->item_type == item_type_m_weapon)
{
if (item->custom[WEAPON_TWOHANDED] == true)
{
strcat(temp, " Two-handed\n");
}
if (get_item_mod(item, attr_i_knockback) > 0)
{
sprintf(line, " %d%% chance of knocking target back\n",
get_item_mod(item, attr_i_knockback));
strcat(temp, line);
}
if (get_item_mod(item, attr_i_drain) > 0)
{
sprintf(line, " %d%% chance of draining targets health\n",
get_item_mod(item, attr_i_drain));
strcat(temp, line);
}
if (get_item_mod(item, attr_i_blink) > 0)
{
sprintf(line, " %d%% chance of target blinking away\n",
get_item_mod(item, attr_i_blink));
strcat(temp, line);
}
if (get_item_mod(item, attr_i_stun) > 0)
{
sprintf(line, " %d%% chance of stunning target\n",
get_item_mod(item, attr_i_stun));
strcat(temp, line);
}
if (get_item_mod(item, attr_i_wound) > 0)
{
sprintf(line, " %d%% chance of wounding target\n",
get_item_mod(item, attr_i_wound));
strcat(temp, line);
}
if (get_item_mod(item, attr_i_backstab) > 0)
{
sprintf(line, " %d%% chance of backstabbing target\n",
get_item_mod(item, attr_i_backstab));
strcat(temp, line);
}
}
break;
case item_type_r_weapon:
sprintf(line, " Damage: %d-%d\n", get_min_damage(item), get_max_damage(item));
strcat(temp, line);
sprintf(line, " Range: %d\n", get_weapon_range(item));
strcat(temp, line);
break;
case item_type_body:
sprintf(line, " Protection: %d (%d)\n", item->custom[ARMOR_PROTECTION], item->custom[ARMOR_DURABILITY]);
strcat(temp, line);
break;
default:
break;
}
if (item->indestructible)
strcat(temp, " Indestructible.\n");
for (i = 0; i < ATTRIBUTES; i++)
{
signed int mod;
if (attr_info[i] == NULL)
continue;
mod = get_item_mod(item, i);
if (mod == 0)
continue;
if (attr_info[i]->invoke != NULL)
{
sprintf(line, " Ability: %s\n", attr_info[i]->name);
strcat(temp, line);
continue;
}
if (attr_info[i]->item_data == false)
continue;
switch(i)
{
case attr_blindness:
sprintf(line, " Blinds %s\n", who);
break;
case attr_carrying_capacity:
sprintf(line, " Allows %s to carry more weight\n", who);
break;
case attr_gas_immunity:
sprintf(line, " Protects %ss respiratory system\n", who);
break;
case attr_levitate:
sprintf(line, " Makes %s levitate\n", who);
break;
case attr_s_trap_detection:
sprintf(line, " Enhances %ss ability to detect traps\n", who);
break;
case attr_feet_protected:
sprintf(line, " Protects %ss feet\n", who);
break;
case attr_p_pick_up:
sprintf(line, " Prevents %s from picking up items\n", who);
break;
case attr_p_open_doors:
sprintf(line, " Prevents %s from opening doors\n", who);
break;
case attr_p_throw:
sprintf(line, " Prevents %s from throwing\n", who);
break;
case attr_p_move:
sprintf(line, " Prevents %s from moving\n", who);
break;
case attr_p_eat:
sprintf(line, " Prevents %s from eating\n", who);
break;
case attr_p_drink:
sprintf(line, " Prevents %s from drinking\n", who);
break;
case attr_p_invoke:
sprintf(line, " Prevents %s from invoking\n", who);
break;
case attr_p_read:
sprintf(line, " Makes %s illiterate\n", who);
break;
case attr_backstab_bonus:
sprintf(line, " %d%% bonus to backstabbing\n", mod);
break;
default:
if (attr_info[i]->percent)
sprintf(line, " %s: %+d%%\n", attr_info[i]->name, mod);
else
sprintf(line, " %s: %+d\n", attr_info[i]->name, mod);
break;
}
strcat(temp, line);
} /* for */
} /* identified */
len = strlen(temp);
for (i = 0; i < len - 1; i++)
{
if (temp[i] == '\n')
temp[i] = ';';
}
if ((identified(item) & known_name) &&
(item->description != NULL))
{
strcat(temp, "\n ");
strcat(temp, item->description);
strcat(temp, "\n");
}
ret = mydup(temp);
if (ret == NULL)
out_of_memory();
return ret;
} /* get_item_data */
/*
Gives ITEM the player-defined label NEW_LABEL. The string will be
duplicated: there is no need to reserve memory for it, this function
will take care of it.
*/
void label_item(item_t * item, const char * new_label)
{
item_t * temp;
if (item == NULL)
return;
if (item->label != NULL)
{
free(item->label);
}
if (new_label != NULL)
item->label = mydup(new_label);
else
item->label = NULL;
/* If this is a stack parent, label each individual item in the stack as well. */
temp = item->child;
while (temp != NULL)
{
label_item(temp, new_label);
temp = temp->next_item;
}
return;
} /* label_item */
| 21.720416 | 106 | 0.61474 |
d90483416edfd457a2b55972a36b08f531f6aded | 1,938 | h | C | include/bridge_vlan_set.h | srinivasknarayan/vyatta-dataplane | d66f721b04fc510c01e5cf0fd786e3ff42aec408 | [
"BSD-2-Clause"
] | 29 | 2019-11-18T20:02:45.000Z | 2021-11-19T11:59:45.000Z | include/bridge_vlan_set.h | srinivasknarayan/vyatta-dataplane | d66f721b04fc510c01e5cf0fd786e3ff42aec408 | [
"BSD-2-Clause"
] | 10 | 2019-12-09T15:32:17.000Z | 2021-04-28T14:34:34.000Z | include/bridge_vlan_set.h | srinivasknarayan/vyatta-dataplane | d66f721b04fc510c01e5cf0fd786e3ff42aec408 | [
"BSD-2-Clause"
] | 24 | 2019-11-16T07:13:22.000Z | 2022-03-29T15:56:42.000Z | /*-
* Copyright (c) 2017,2019-2020, AT&T Intellectual Property.
* All rights reserved.
* Copyright (c) 2017 by Brocade Communications Systems, Inc.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-only
*/
#ifndef VYATTA_DATAPLANE_BRIDGE_VLAN_SET_H
#define VYATTA_DATAPLANE_BRIDGE_VLAN_SET_H
#include <stdint.h>
#include <stdbool.h>
/*
* A VLAN set is a set data-structure large enough to hold
* a bit for each VLAN
*/
struct bridge_vlan_set;
/*
* Utility routines for bridge_vlan_set.
*/
/*
* Creates a new VLAN set.
*/
struct bridge_vlan_set *bridge_vlan_set_create(void);
/*
* Releases the resources used for the VLAN set
*/
void bridge_vlan_set_free(struct bridge_vlan_set *set);
/*
* Make the provided VLAN a member of the set.
*/
void bridge_vlan_set_add(struct bridge_vlan_set *set, uint16_t vlan);
/*
* Remove the specified VLAN from membership of the set.
*/
void bridge_vlan_set_remove(struct bridge_vlan_set *set, uint16_t vlan);
/*
* Check if the specified VLAN is a member of the set.
*/
bool bridge_vlan_set_is_member(struct bridge_vlan_set *set, uint16_t vlan);
/*
* Emptys the VLAN set.
*/
void bridge_vlan_set_clear(struct bridge_vlan_set *set);
/*
* Checks if the VLAN set is empty.
*/
bool bridge_vlan_set_is_empty(struct bridge_vlan_set *set);
/*
* Callback for synchronization algorithm, takes a vlan id and the cb_data
* that is passed to the synchronize function.
*/
typedef void (*bridge_vlan_synchronize_cb) (uint16_t vlan, void *cb_data);
/*
* Synchronizes two VLAN sets, using supplied callbacks. add_cb() and
* remove_cb() are required. cb_data will be passed unmodified to the
* callback functions.
*/
void bridge_vlan_set_synchronize(struct bridge_vlan_set *old,
struct bridge_vlan_set *new,
bridge_vlan_synchronize_cb add_cb,
bridge_vlan_synchronize_cb remove_cb,
void *cb_data);
#endif /* VYATTA_DATAPLANE_BRIDGE_VLAN_SET_H */
| 24.531646 | 75 | 0.749226 |
d9054e76533cd1fe35e9fb9e0b5a8cf0a1baf4f1 | 1,327 | h | C | actor-apps/core-async-cocoa/src/im/actor/model/CryptoProvider.h | DragonStuff/actor-platform | d262e6bb3c18b20eb35551313bce16c471cd2928 | [
"MIT"
] | null | null | null | actor-apps/core-async-cocoa/src/im/actor/model/CryptoProvider.h | DragonStuff/actor-platform | d262e6bb3c18b20eb35551313bce16c471cd2928 | [
"MIT"
] | null | null | null | actor-apps/core-async-cocoa/src/im/actor/model/CryptoProvider.h | DragonStuff/actor-platform | d262e6bb3c18b20eb35551313bce16c471cd2928 | [
"MIT"
] | null | null | null | //
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/ex3ndr/Develop/actor-platform/actor-apps/core/src/main/java/im/actor/model/CryptoProvider.java
//
#ifndef _AMCryptoProvider_H_
#define _AMCryptoProvider_H_
#include "J2ObjC_header.h"
@class AMCryptoKeyPair;
@class IOSByteArray;
@protocol AMAesCipher;
@protocol AMRsaCipher;
@protocol AMRsaEncryptCipher;
@protocol AMCryptoProvider < NSObject, JavaObject >
- (AMCryptoKeyPair *)generateRSA1024KeyPair;
- (id<AMRsaEncryptCipher>)createRSAOAEPSHA1CipherWithPublicKey:(IOSByteArray *)publicKey;
- (id<AMRsaCipher>)createRSAOAEPSHA1CipherWithPublicKey:(IOSByteArray *)publicKey
withPrivateKey:(IOSByteArray *)privateKey;
- (id<AMAesCipher>)createAESCBCPKS7CipherWithKey:(IOSByteArray *)key
withIv:(IOSByteArray *)iv;
- (IOSByteArray *)MD5WithData:(IOSByteArray *)data;
- (IOSByteArray *)SHA256WithData:(IOSByteArray *)data;
- (IOSByteArray *)SHA512WithData:(IOSByteArray *)data;
- (IOSByteArray *)randomBytesWithLength:(jint)length;
- (jint)randomIntWithMaxValue:(jint)maxValue;
@end
J2OBJC_EMPTY_STATIC_INIT(AMCryptoProvider)
J2OBJC_TYPE_LITERAL_HEADER(AMCryptoProvider)
#define ImActorModelCryptoProvider AMCryptoProvider
#endif // _AMCryptoProvider_H_
| 27.645833 | 113 | 0.756594 |
d9066ad7002582407b211bc4173f12167b77dac1 | 4,996 | c | C | arch/arm64/core/cache.c | CubePilot/zephyr | b9c345b1a5eaed94c75e07a0f05c9a9e7ba2c56f | [
"Apache-2.0"
] | 21 | 2019-02-13T02:11:04.000Z | 2020-04-23T19:09:17.000Z | arch/arm64/core/cache.c | CubePilot/zephyr | b9c345b1a5eaed94c75e07a0f05c9a9e7ba2c56f | [
"Apache-2.0"
] | 189 | 2018-12-14T11:44:08.000Z | 2020-05-20T15:14:35.000Z | arch/arm64/core/cache.c | CubePilot/zephyr | b9c345b1a5eaed94c75e07a0f05c9a9e7ba2c56f | [
"Apache-2.0"
] | 186 | 2018-12-14T11:56:22.000Z | 2020-05-15T12:51:11.000Z | /* cache.c - d-cache support for AARCH64 CPUs */
/*
* Copyright 2020-2021 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief d-cache manipulation
*
* This module contains functions for manipulation of the d-cache.
*/
#include <cache.h>
#define CTR_EL0_DMINLINE_SHIFT 16
#define CTR_EL0_DMINLINE_MASK BIT_MASK(4)
#define CTR_EL0_CWG_SHIFT 24
#define CTR_EL0_CWG_MASK BIT_MASK(4)
/* clidr_el1 */
#define CLIDR_EL1_LOC_SHIFT 24
#define CLIDR_EL1_LOC_MASK BIT_MASK(3)
#define CLIDR_EL1_CTYPE_SHIFT(level) ((level) * 3)
#define CLIDR_EL1_CTYPE_MASK BIT_MASK(3)
/* ccsidr_el1 */
#define CCSIDR_EL1_LN_SZ_SHIFT 0
#define CCSIDR_EL1_LN_SZ_MASK BIT_MASK(3)
#define CCSIDR_EL1_WAYS_SHIFT 3
#define CCSIDR_EL1_WAYS_MASK BIT_MASK(10)
#define CCSIDR_EL1_SETS_SHIFT 13
#define CCSIDR_EL1_SETS_MASK BIT_MASK(15)
#define dc_ops(op, val) \
({ \
__asm__ volatile ("dc " op ", %0" :: "r" (val) : "memory"); \
})
static size_t dcache_line_size;
size_t arch_dcache_line_size_get(void)
{
uint64_t ctr_el0;
uint32_t dminline;
if (dcache_line_size)
return dcache_line_size;
ctr_el0 = read_sysreg(CTR_EL0);
dminline = (ctr_el0 >> CTR_EL0_DMINLINE_SHIFT) & CTR_EL0_DMINLINE_MASK;
dcache_line_size = 4 << dminline;
return dcache_line_size;
}
/*
* operation for data cache by virtual address to PoC
* ops: K_CACHE_INVD: invalidate
* K_CACHE_WB: clean
* K_CACHE_WB_INVD: clean and invalidate
*/
int arch_dcache_range(void *addr, size_t size, int op)
{
size_t line_size;
uintptr_t start_addr = (uintptr_t)addr;
uintptr_t end_addr = start_addr + size;
if (op != K_CACHE_INVD && op != K_CACHE_WB && op != K_CACHE_WB_INVD)
return -ENOTSUP;
line_size = arch_dcache_line_size_get();
/*
* For the data cache invalidate operation, clean and invalidate
* the partial cache lines at both ends of the given range to
* prevent data corruption.
*
* For example (assume cache line size is 64 bytes):
* There are 2 consecutive 32-byte buffers, which can be cached in
* one line like below.
* +------------------+------------------+
* Cache line: | buffer 0 (dirty) | buffer 1 |
* +------------------+------------------+
* For the start address not aligned case, when invalidate the
* buffer 1, the full cache line will be invalidated, if the buffer
* 0 is dirty, its data will be lost.
* The same logic applies to the not aligned end address.
*/
if (op == K_CACHE_INVD) {
if (end_addr & (line_size - 1)) {
end_addr &= ~(line_size - 1);
dc_ops("civac", end_addr);
}
if (start_addr & (line_size - 1)) {
start_addr &= ~(line_size - 1);
if (start_addr == end_addr)
goto done;
dc_ops("civac", start_addr);
start_addr += line_size;
}
}
/* Align address to line size */
start_addr &= ~(line_size - 1);
while (start_addr < end_addr) {
if (op == K_CACHE_INVD) {
dc_ops("ivac", start_addr);
} else if (op == K_CACHE_WB) {
dc_ops("cvac", start_addr);
} else if (op == K_CACHE_WB_INVD) {
dc_ops("civac", start_addr);
}
start_addr += line_size;
}
done:
dsb();
return 0;
}
/*
* operation for all data cache
* ops: K_CACHE_INVD: invalidate
* K_CACHE_WB: clean
* K_CACHE_WB_INVD: clean and invalidate
*/
int arch_dcache_all(int op)
{
uint32_t clidr_el1, csselr_el1, ccsidr_el1;
uint8_t loc, ctype, cache_level, line_size, way_pos;
uint32_t max_ways, max_sets, dc_val, set, way;
if (op != K_CACHE_INVD && op != K_CACHE_WB && op != K_CACHE_WB_INVD)
return -ENOTSUP;
/* Data barrier before start */
dsb();
clidr_el1 = read_clidr_el1();
loc = (clidr_el1 >> CLIDR_EL1_LOC_SHIFT) & CLIDR_EL1_LOC_MASK;
if (!loc)
return 0;
for (cache_level = 0; cache_level < loc; cache_level++) {
ctype = (clidr_el1 >> CLIDR_EL1_CTYPE_SHIFT(cache_level))
& CLIDR_EL1_CTYPE_MASK;
/* No data cache, continue */
if (ctype < 2)
continue;
/* select cache level */
csselr_el1 = cache_level << 1;
write_csselr_el1(csselr_el1);
isb();
ccsidr_el1 = read_ccsidr_el1();
line_size = (ccsidr_el1 >> CCSIDR_EL1_LN_SZ_SHIFT
& CCSIDR_EL1_LN_SZ_MASK) + 4;
max_ways = (ccsidr_el1 >> CCSIDR_EL1_WAYS_SHIFT)
& CCSIDR_EL1_WAYS_MASK;
max_sets = (ccsidr_el1 >> CCSIDR_EL1_SETS_SHIFT)
& CCSIDR_EL1_SETS_MASK;
/* 32-log2(ways), bit position of way in DC operand */
way_pos = __builtin_clz(max_ways);
for (set = 0; set <= max_sets; set++) {
for (way = 0; way <= max_ways; way++) {
/* way number, aligned to pos in DC operand */
dc_val = way << way_pos;
/* cache level, aligned to pos in DC operand */
dc_val |= csselr_el1;
/* set number, aligned to pos in DC operand */
dc_val |= set << line_size;
if (op == K_CACHE_INVD) {
dc_ops("isw", dc_val);
} else if (op == K_CACHE_WB_INVD) {
dc_ops("cisw", dc_val);
} else if (op == K_CACHE_WB) {
dc_ops("csw", dc_val);
}
}
}
}
/* Restore csselr_el1 to level 0 */
write_csselr_el1(0);
dsb();
isb();
return 0;
}
| 24.610837 | 72 | 0.666733 |
d90993b79292ec30114abed51e07619be77a68a4 | 130,411 | h | C | robot_static_path_planning/robotest/zss_debug.pb.h | ZJULiHongxin/Path-Planning-Based-on-Astar-for-Soccer-Robots | 90f79f2a8a40915345946dc004bb69307f06e602 | [
"MIT"
] | null | null | null | robot_static_path_planning/robotest/zss_debug.pb.h | ZJULiHongxin/Path-Planning-Based-on-Astar-for-Soccer-Robots | 90f79f2a8a40915345946dc004bb69307f06e602 | [
"MIT"
] | null | null | null | robot_static_path_planning/robotest/zss_debug.pb.h | ZJULiHongxin/Path-Planning-Based-on-Astar-for-Soccer-Robots | 90f79f2a8a40915345946dc004bb69307f06e602 | [
"MIT"
] | null | null | null | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: zss_debug.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_zss_5fdebug_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_zss_5fdebug_2eproto
#include <limits>
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3009000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3009001 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/port_undef.inc>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
#define PROTOBUF_INTERNAL_EXPORT_zss_5fdebug_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_zss_5fdebug_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[14]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_zss_5fdebug_2eproto;
class Debug_Arc;
class Debug_ArcDefaultTypeInternal;
extern Debug_ArcDefaultTypeInternal _Debug_Arc_default_instance_;
class Debug_Curve;
class Debug_CurveDefaultTypeInternal;
extern Debug_CurveDefaultTypeInternal _Debug_Curve_default_instance_;
class Debug_Curve_;
class Debug_Curve_DefaultTypeInternal;
extern Debug_Curve_DefaultTypeInternal _Debug_Curve__default_instance_;
class Debug_Line;
class Debug_LineDefaultTypeInternal;
extern Debug_LineDefaultTypeInternal _Debug_Line_default_instance_;
class Debug_Msg;
class Debug_MsgDefaultTypeInternal;
extern Debug_MsgDefaultTypeInternal _Debug_Msg_default_instance_;
class Debug_Msgs;
class Debug_MsgsDefaultTypeInternal;
extern Debug_MsgsDefaultTypeInternal _Debug_Msgs_default_instance_;
class Debug_Points;
class Debug_PointsDefaultTypeInternal;
extern Debug_PointsDefaultTypeInternal _Debug_Points_default_instance_;
class Debug_Polygon;
class Debug_PolygonDefaultTypeInternal;
extern Debug_PolygonDefaultTypeInternal _Debug_Polygon_default_instance_;
class Debug_Robot;
class Debug_RobotDefaultTypeInternal;
extern Debug_RobotDefaultTypeInternal _Debug_Robot_default_instance_;
class Debug_Score;
class Debug_ScoreDefaultTypeInternal;
extern Debug_ScoreDefaultTypeInternal _Debug_Score_default_instance_;
class Debug_Scores;
class Debug_ScoresDefaultTypeInternal;
extern Debug_ScoresDefaultTypeInternal _Debug_Scores_default_instance_;
class Debug_Text;
class Debug_TextDefaultTypeInternal;
extern Debug_TextDefaultTypeInternal _Debug_Text_default_instance_;
class Point;
class PointDefaultTypeInternal;
extern PointDefaultTypeInternal _Point_default_instance_;
class Rectangle_;
class Rectangle_DefaultTypeInternal;
extern Rectangle_DefaultTypeInternal _Rectangle__default_instance_;
PROTOBUF_NAMESPACE_OPEN
template<> ::Debug_Arc* Arena::CreateMaybeMessage<::Debug_Arc>(Arena*);
template<> ::Debug_Curve* Arena::CreateMaybeMessage<::Debug_Curve>(Arena*);
template<> ::Debug_Curve_* Arena::CreateMaybeMessage<::Debug_Curve_>(Arena*);
template<> ::Debug_Line* Arena::CreateMaybeMessage<::Debug_Line>(Arena*);
template<> ::Debug_Msg* Arena::CreateMaybeMessage<::Debug_Msg>(Arena*);
template<> ::Debug_Msgs* Arena::CreateMaybeMessage<::Debug_Msgs>(Arena*);
template<> ::Debug_Points* Arena::CreateMaybeMessage<::Debug_Points>(Arena*);
template<> ::Debug_Polygon* Arena::CreateMaybeMessage<::Debug_Polygon>(Arena*);
template<> ::Debug_Robot* Arena::CreateMaybeMessage<::Debug_Robot>(Arena*);
template<> ::Debug_Score* Arena::CreateMaybeMessage<::Debug_Score>(Arena*);
template<> ::Debug_Scores* Arena::CreateMaybeMessage<::Debug_Scores>(Arena*);
template<> ::Debug_Text* Arena::CreateMaybeMessage<::Debug_Text>(Arena*);
template<> ::Point* Arena::CreateMaybeMessage<::Point>(Arena*);
template<> ::Rectangle_* Arena::CreateMaybeMessage<::Rectangle_>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
enum Debug_Msg_Debug_Type : int {
Debug_Msg_Debug_Type_ARC = 0,
Debug_Msg_Debug_Type_LINE = 1,
Debug_Msg_Debug_Type_TEXT = 2,
Debug_Msg_Debug_Type_ROBOT = 3,
Debug_Msg_Debug_Type_CURVE = 4,
Debug_Msg_Debug_Type_POLYGON = 5,
Debug_Msg_Debug_Type_Points = 6
};
bool Debug_Msg_Debug_Type_IsValid(int value);
constexpr Debug_Msg_Debug_Type Debug_Msg_Debug_Type_Debug_Type_MIN = Debug_Msg_Debug_Type_ARC;
constexpr Debug_Msg_Debug_Type Debug_Msg_Debug_Type_Debug_Type_MAX = Debug_Msg_Debug_Type_Points;
constexpr int Debug_Msg_Debug_Type_Debug_Type_ARRAYSIZE = Debug_Msg_Debug_Type_Debug_Type_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Debug_Msg_Debug_Type_descriptor();
template<typename T>
inline const std::string& Debug_Msg_Debug_Type_Name(T enum_t_value) {
static_assert(::std::is_same<T, Debug_Msg_Debug_Type>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function Debug_Msg_Debug_Type_Name.");
return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
Debug_Msg_Debug_Type_descriptor(), enum_t_value);
}
inline bool Debug_Msg_Debug_Type_Parse(
const std::string& name, Debug_Msg_Debug_Type* value) {
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Debug_Msg_Debug_Type>(
Debug_Msg_Debug_Type_descriptor(), name, value);
}
enum Debug_Msg_Color : int {
Debug_Msg_Color_WHITE = 0,
Debug_Msg_Color_RED = 1,
Debug_Msg_Color_ORANGE = 2,
Debug_Msg_Color_YELLOW = 3,
Debug_Msg_Color_GREEN = 4,
Debug_Msg_Color_CYAN = 5,
Debug_Msg_Color_BLUE = 6,
Debug_Msg_Color_PURPLE = 7,
Debug_Msg_Color_GRAY = 8,
Debug_Msg_Color_BLACK = 9
};
bool Debug_Msg_Color_IsValid(int value);
constexpr Debug_Msg_Color Debug_Msg_Color_Color_MIN = Debug_Msg_Color_WHITE;
constexpr Debug_Msg_Color Debug_Msg_Color_Color_MAX = Debug_Msg_Color_BLACK;
constexpr int Debug_Msg_Color_Color_ARRAYSIZE = Debug_Msg_Color_Color_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Debug_Msg_Color_descriptor();
template<typename T>
inline const std::string& Debug_Msg_Color_Name(T enum_t_value) {
static_assert(::std::is_same<T, Debug_Msg_Color>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function Debug_Msg_Color_Name.");
return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
Debug_Msg_Color_descriptor(), enum_t_value);
}
inline bool Debug_Msg_Color_Parse(
const std::string& name, Debug_Msg_Color* value) {
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Debug_Msg_Color>(
Debug_Msg_Color_descriptor(), name, value);
}
// ===================================================================
class Point :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Point) */ {
public:
Point();
virtual ~Point();
Point(const Point& from);
Point(Point&& from) noexcept
: Point() {
*this = ::std::move(from);
}
inline Point& operator=(const Point& from) {
CopyFrom(from);
return *this;
}
inline Point& operator=(Point&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Point& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Point* internal_default_instance() {
return reinterpret_cast<const Point*>(
&_Point_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(Point& a, Point& b) {
a.Swap(&b);
}
inline void Swap(Point* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Point* New() const final {
return CreateMaybeMessage<Point>(nullptr);
}
Point* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Point>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Point& from);
void MergeFrom(const Point& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Point* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Point";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kXFieldNumber = 1,
kYFieldNumber = 2,
};
// required float x = 1;
bool has_x() const;
void clear_x();
float x() const;
void set_x(float value);
// required float y = 2;
bool has_y() const;
void clear_y();
float y() const;
void set_y(float value);
// @@protoc_insertion_point(class_scope:Point)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
float x_;
float y_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Rectangle_ :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Rectangle_) */ {
public:
Rectangle_();
virtual ~Rectangle_();
Rectangle_(const Rectangle_& from);
Rectangle_(Rectangle_&& from) noexcept
: Rectangle_() {
*this = ::std::move(from);
}
inline Rectangle_& operator=(const Rectangle_& from) {
CopyFrom(from);
return *this;
}
inline Rectangle_& operator=(Rectangle_&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Rectangle_& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Rectangle_* internal_default_instance() {
return reinterpret_cast<const Rectangle_*>(
&_Rectangle__default_instance_);
}
static constexpr int kIndexInFileMessages =
1;
friend void swap(Rectangle_& a, Rectangle_& b) {
a.Swap(&b);
}
inline void Swap(Rectangle_* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Rectangle_* New() const final {
return CreateMaybeMessage<Rectangle_>(nullptr);
}
Rectangle_* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Rectangle_>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Rectangle_& from);
void MergeFrom(const Rectangle_& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Rectangle_* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Rectangle_";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kPoint1FieldNumber = 1,
kPoint2FieldNumber = 2,
};
// required .Point point1 = 1;
bool has_point1() const;
void clear_point1();
const ::Point& point1() const;
::Point* release_point1();
::Point* mutable_point1();
void set_allocated_point1(::Point* point1);
// required .Point point2 = 2;
bool has_point2() const;
void clear_point2();
const ::Point& point2() const;
::Point* release_point2();
::Point* mutable_point2();
void set_allocated_point2(::Point* point2);
// @@protoc_insertion_point(class_scope:Rectangle_)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::Point* point1_;
::Point* point2_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Robot :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Robot) */ {
public:
Debug_Robot();
virtual ~Debug_Robot();
Debug_Robot(const Debug_Robot& from);
Debug_Robot(Debug_Robot&& from) noexcept
: Debug_Robot() {
*this = ::std::move(from);
}
inline Debug_Robot& operator=(const Debug_Robot& from) {
CopyFrom(from);
return *this;
}
inline Debug_Robot& operator=(Debug_Robot&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Robot& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Robot* internal_default_instance() {
return reinterpret_cast<const Debug_Robot*>(
&_Debug_Robot_default_instance_);
}
static constexpr int kIndexInFileMessages =
2;
friend void swap(Debug_Robot& a, Debug_Robot& b) {
a.Swap(&b);
}
inline void Swap(Debug_Robot* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Robot* New() const final {
return CreateMaybeMessage<Debug_Robot>(nullptr);
}
Debug_Robot* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Robot>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Robot& from);
void MergeFrom(const Debug_Robot& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Robot* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Robot";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kPosFieldNumber = 1,
kDirFieldNumber = 2,
};
// required .Point pos = 1;
bool has_pos() const;
void clear_pos();
const ::Point& pos() const;
::Point* release_pos();
::Point* mutable_pos();
void set_allocated_pos(::Point* pos);
// required float dir = 2;
bool has_dir() const;
void clear_dir();
float dir() const;
void set_dir(float value);
// @@protoc_insertion_point(class_scope:Debug_Robot)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::Point* pos_;
float dir_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Line :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Line) */ {
public:
Debug_Line();
virtual ~Debug_Line();
Debug_Line(const Debug_Line& from);
Debug_Line(Debug_Line&& from) noexcept
: Debug_Line() {
*this = ::std::move(from);
}
inline Debug_Line& operator=(const Debug_Line& from) {
CopyFrom(from);
return *this;
}
inline Debug_Line& operator=(Debug_Line&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Line& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Line* internal_default_instance() {
return reinterpret_cast<const Debug_Line*>(
&_Debug_Line_default_instance_);
}
static constexpr int kIndexInFileMessages =
3;
friend void swap(Debug_Line& a, Debug_Line& b) {
a.Swap(&b);
}
inline void Swap(Debug_Line* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Line* New() const final {
return CreateMaybeMessage<Debug_Line>(nullptr);
}
Debug_Line* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Line>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Line& from);
void MergeFrom(const Debug_Line& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Line* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Line";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kStartFieldNumber = 1,
kEndFieldNumber = 2,
kFORWARDFieldNumber = 3,
kBACKFieldNumber = 4,
};
// required .Point start = 1;
bool has_start() const;
void clear_start();
const ::Point& start() const;
::Point* release_start();
::Point* mutable_start();
void set_allocated_start(::Point* start);
// required .Point end = 2;
bool has_end() const;
void clear_end();
const ::Point& end() const;
::Point* release_end();
::Point* mutable_end();
void set_allocated_end(::Point* end);
// required bool FORWARD = 3;
bool has_forward() const;
void clear_forward();
bool forward() const;
void set_forward(bool value);
// required bool BACK = 4;
bool has_back() const;
void clear_back();
bool back() const;
void set_back(bool value);
// @@protoc_insertion_point(class_scope:Debug_Line)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::Point* start_;
::Point* end_;
bool forward_;
bool back_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Arc :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Arc) */ {
public:
Debug_Arc();
virtual ~Debug_Arc();
Debug_Arc(const Debug_Arc& from);
Debug_Arc(Debug_Arc&& from) noexcept
: Debug_Arc() {
*this = ::std::move(from);
}
inline Debug_Arc& operator=(const Debug_Arc& from) {
CopyFrom(from);
return *this;
}
inline Debug_Arc& operator=(Debug_Arc&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Arc& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Arc* internal_default_instance() {
return reinterpret_cast<const Debug_Arc*>(
&_Debug_Arc_default_instance_);
}
static constexpr int kIndexInFileMessages =
4;
friend void swap(Debug_Arc& a, Debug_Arc& b) {
a.Swap(&b);
}
inline void Swap(Debug_Arc* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Arc* New() const final {
return CreateMaybeMessage<Debug_Arc>(nullptr);
}
Debug_Arc* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Arc>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Arc& from);
void MergeFrom(const Debug_Arc& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Arc* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Arc";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kRectangleFieldNumber = 1,
kStartFieldNumber = 2,
kEndFieldNumber = 3,
kFILLFieldNumber = 4,
};
// required .Rectangle_ rectangle = 1;
bool has_rectangle() const;
void clear_rectangle();
const ::Rectangle_& rectangle() const;
::Rectangle_* release_rectangle();
::Rectangle_* mutable_rectangle();
void set_allocated_rectangle(::Rectangle_* rectangle);
// required float start = 2;
bool has_start() const;
void clear_start();
float start() const;
void set_start(float value);
// required float end = 3;
bool has_end() const;
void clear_end();
float end() const;
void set_end(float value);
// required bool FILL = 4;
bool has_fill() const;
void clear_fill();
bool fill() const;
void set_fill(bool value);
// @@protoc_insertion_point(class_scope:Debug_Arc)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::Rectangle_* rectangle_;
float start_;
float end_;
bool fill_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Polygon :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Polygon) */ {
public:
Debug_Polygon();
virtual ~Debug_Polygon();
Debug_Polygon(const Debug_Polygon& from);
Debug_Polygon(Debug_Polygon&& from) noexcept
: Debug_Polygon() {
*this = ::std::move(from);
}
inline Debug_Polygon& operator=(const Debug_Polygon& from) {
CopyFrom(from);
return *this;
}
inline Debug_Polygon& operator=(Debug_Polygon&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Polygon& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Polygon* internal_default_instance() {
return reinterpret_cast<const Debug_Polygon*>(
&_Debug_Polygon_default_instance_);
}
static constexpr int kIndexInFileMessages =
5;
friend void swap(Debug_Polygon& a, Debug_Polygon& b) {
a.Swap(&b);
}
inline void Swap(Debug_Polygon* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Polygon* New() const final {
return CreateMaybeMessage<Debug_Polygon>(nullptr);
}
Debug_Polygon* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Polygon>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Polygon& from);
void MergeFrom(const Debug_Polygon& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Polygon* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Polygon";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kVertexFieldNumber = 1,
kFILLFieldNumber = 2,
};
// repeated .Point vertex = 1;
int vertex_size() const;
void clear_vertex();
::Point* mutable_vertex(int index);
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >*
mutable_vertex();
const ::Point& vertex(int index) const;
::Point* add_vertex();
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >&
vertex() const;
// required bool FILL = 2;
bool has_fill() const;
void clear_fill();
bool fill() const;
void set_fill(bool value);
// @@protoc_insertion_point(class_scope:Debug_Polygon)
private:
class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point > vertex_;
bool fill_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Text :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Text) */ {
public:
Debug_Text();
virtual ~Debug_Text();
Debug_Text(const Debug_Text& from);
Debug_Text(Debug_Text&& from) noexcept
: Debug_Text() {
*this = ::std::move(from);
}
inline Debug_Text& operator=(const Debug_Text& from) {
CopyFrom(from);
return *this;
}
inline Debug_Text& operator=(Debug_Text&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Text& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Text* internal_default_instance() {
return reinterpret_cast<const Debug_Text*>(
&_Debug_Text_default_instance_);
}
static constexpr int kIndexInFileMessages =
6;
friend void swap(Debug_Text& a, Debug_Text& b) {
a.Swap(&b);
}
inline void Swap(Debug_Text* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Text* New() const final {
return CreateMaybeMessage<Debug_Text>(nullptr);
}
Debug_Text* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Text>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Text& from);
void MergeFrom(const Debug_Text& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Text* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Text";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kTextFieldNumber = 2,
kPosFieldNumber = 1,
};
// required string text = 2;
bool has_text() const;
void clear_text();
const std::string& text() const;
void set_text(const std::string& value);
void set_text(std::string&& value);
void set_text(const char* value);
void set_text(const char* value, size_t size);
std::string* mutable_text();
std::string* release_text();
void set_allocated_text(std::string* text);
// required .Point pos = 1;
bool has_pos() const;
void clear_pos();
const ::Point& pos() const;
::Point* release_pos();
::Point* mutable_pos();
void set_allocated_pos(::Point* pos);
// @@protoc_insertion_point(class_scope:Debug_Text)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_;
::Point* pos_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Curve_ :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Curve_) */ {
public:
Debug_Curve_();
virtual ~Debug_Curve_();
Debug_Curve_(const Debug_Curve_& from);
Debug_Curve_(Debug_Curve_&& from) noexcept
: Debug_Curve_() {
*this = ::std::move(from);
}
inline Debug_Curve_& operator=(const Debug_Curve_& from) {
CopyFrom(from);
return *this;
}
inline Debug_Curve_& operator=(Debug_Curve_&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Curve_& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Curve_* internal_default_instance() {
return reinterpret_cast<const Debug_Curve_*>(
&_Debug_Curve__default_instance_);
}
static constexpr int kIndexInFileMessages =
7;
friend void swap(Debug_Curve_& a, Debug_Curve_& b) {
a.Swap(&b);
}
inline void Swap(Debug_Curve_* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Curve_* New() const final {
return CreateMaybeMessage<Debug_Curve_>(nullptr);
}
Debug_Curve_* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Curve_>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Curve_& from);
void MergeFrom(const Debug_Curve_& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Curve_* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Curve_";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kNumFieldNumber = 1,
kMaxLimitFieldNumber = 2,
kMinLimitFieldNumber = 3,
};
// required float num = 1;
bool has_num() const;
void clear_num();
float num() const;
void set_num(float value);
// required float maxLimit = 2;
bool has_maxlimit() const;
void clear_maxlimit();
float maxlimit() const;
void set_maxlimit(float value);
// required float minLimit = 3;
bool has_minlimit() const;
void clear_minlimit();
float minlimit() const;
void set_minlimit(float value);
// @@protoc_insertion_point(class_scope:Debug_Curve_)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
float num_;
float maxlimit_;
float minlimit_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Curve :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Curve) */ {
public:
Debug_Curve();
virtual ~Debug_Curve();
Debug_Curve(const Debug_Curve& from);
Debug_Curve(Debug_Curve&& from) noexcept
: Debug_Curve() {
*this = ::std::move(from);
}
inline Debug_Curve& operator=(const Debug_Curve& from) {
CopyFrom(from);
return *this;
}
inline Debug_Curve& operator=(Debug_Curve&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Curve& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Curve* internal_default_instance() {
return reinterpret_cast<const Debug_Curve*>(
&_Debug_Curve_default_instance_);
}
static constexpr int kIndexInFileMessages =
8;
friend void swap(Debug_Curve& a, Debug_Curve& b) {
a.Swap(&b);
}
inline void Swap(Debug_Curve* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Curve* New() const final {
return CreateMaybeMessage<Debug_Curve>(nullptr);
}
Debug_Curve* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Curve>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Curve& from);
void MergeFrom(const Debug_Curve& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Curve* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Curve";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kStartFieldNumber = 1,
kP1FieldNumber = 2,
kP2FieldNumber = 3,
kEndFieldNumber = 4,
};
// required .Point start = 1;
bool has_start() const;
void clear_start();
const ::Point& start() const;
::Point* release_start();
::Point* mutable_start();
void set_allocated_start(::Point* start);
// required .Point p1 = 2;
bool has_p1() const;
void clear_p1();
const ::Point& p1() const;
::Point* release_p1();
::Point* mutable_p1();
void set_allocated_p1(::Point* p1);
// required .Point p2 = 3;
bool has_p2() const;
void clear_p2();
const ::Point& p2() const;
::Point* release_p2();
::Point* mutable_p2();
void set_allocated_p2(::Point* p2);
// required .Point end = 4;
bool has_end() const;
void clear_end();
const ::Point& end() const;
::Point* release_end();
::Point* mutable_end();
void set_allocated_end(::Point* end);
// @@protoc_insertion_point(class_scope:Debug_Curve)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::Point* start_;
::Point* p1_;
::Point* p2_;
::Point* end_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Points :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Points) */ {
public:
Debug_Points();
virtual ~Debug_Points();
Debug_Points(const Debug_Points& from);
Debug_Points(Debug_Points&& from) noexcept
: Debug_Points() {
*this = ::std::move(from);
}
inline Debug_Points& operator=(const Debug_Points& from) {
CopyFrom(from);
return *this;
}
inline Debug_Points& operator=(Debug_Points&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Points& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Points* internal_default_instance() {
return reinterpret_cast<const Debug_Points*>(
&_Debug_Points_default_instance_);
}
static constexpr int kIndexInFileMessages =
9;
friend void swap(Debug_Points& a, Debug_Points& b) {
a.Swap(&b);
}
inline void Swap(Debug_Points* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Points* New() const final {
return CreateMaybeMessage<Debug_Points>(nullptr);
}
Debug_Points* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Points>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Points& from);
void MergeFrom(const Debug_Points& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Points* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Points";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kPointFieldNumber = 1,
};
// repeated .Point point = 1;
int point_size() const;
void clear_point();
::Point* mutable_point(int index);
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >*
mutable_point();
const ::Point& point(int index) const;
::Point* add_point();
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >&
point() const;
// @@protoc_insertion_point(class_scope:Debug_Points)
private:
class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point > point_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Msg :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Msg) */ {
public:
Debug_Msg();
virtual ~Debug_Msg();
Debug_Msg(const Debug_Msg& from);
Debug_Msg(Debug_Msg&& from) noexcept
: Debug_Msg() {
*this = ::std::move(from);
}
inline Debug_Msg& operator=(const Debug_Msg& from) {
CopyFrom(from);
return *this;
}
inline Debug_Msg& operator=(Debug_Msg&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Msg& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Msg* internal_default_instance() {
return reinterpret_cast<const Debug_Msg*>(
&_Debug_Msg_default_instance_);
}
static constexpr int kIndexInFileMessages =
10;
friend void swap(Debug_Msg& a, Debug_Msg& b) {
a.Swap(&b);
}
inline void Swap(Debug_Msg* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Msg* New() const final {
return CreateMaybeMessage<Debug_Msg>(nullptr);
}
Debug_Msg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Msg>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Msg& from);
void MergeFrom(const Debug_Msg& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Msg* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Msg";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
typedef Debug_Msg_Debug_Type Debug_Type;
static constexpr Debug_Type ARC =
Debug_Msg_Debug_Type_ARC;
static constexpr Debug_Type LINE =
Debug_Msg_Debug_Type_LINE;
static constexpr Debug_Type TEXT =
Debug_Msg_Debug_Type_TEXT;
static constexpr Debug_Type ROBOT =
Debug_Msg_Debug_Type_ROBOT;
static constexpr Debug_Type CURVE =
Debug_Msg_Debug_Type_CURVE;
static constexpr Debug_Type POLYGON =
Debug_Msg_Debug_Type_POLYGON;
static constexpr Debug_Type Points =
Debug_Msg_Debug_Type_Points;
static inline bool Debug_Type_IsValid(int value) {
return Debug_Msg_Debug_Type_IsValid(value);
}
static constexpr Debug_Type Debug_Type_MIN =
Debug_Msg_Debug_Type_Debug_Type_MIN;
static constexpr Debug_Type Debug_Type_MAX =
Debug_Msg_Debug_Type_Debug_Type_MAX;
static constexpr int Debug_Type_ARRAYSIZE =
Debug_Msg_Debug_Type_Debug_Type_ARRAYSIZE;
static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
Debug_Type_descriptor() {
return Debug_Msg_Debug_Type_descriptor();
}
template<typename T>
static inline const std::string& Debug_Type_Name(T enum_t_value) {
static_assert(::std::is_same<T, Debug_Type>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function Debug_Type_Name.");
return Debug_Msg_Debug_Type_Name(enum_t_value);
}
static inline bool Debug_Type_Parse(const std::string& name,
Debug_Type* value) {
return Debug_Msg_Debug_Type_Parse(name, value);
}
typedef Debug_Msg_Color Color;
static constexpr Color WHITE =
Debug_Msg_Color_WHITE;
static constexpr Color RED =
Debug_Msg_Color_RED;
static constexpr Color ORANGE =
Debug_Msg_Color_ORANGE;
static constexpr Color YELLOW =
Debug_Msg_Color_YELLOW;
static constexpr Color GREEN =
Debug_Msg_Color_GREEN;
static constexpr Color CYAN =
Debug_Msg_Color_CYAN;
static constexpr Color BLUE =
Debug_Msg_Color_BLUE;
static constexpr Color PURPLE =
Debug_Msg_Color_PURPLE;
static constexpr Color GRAY =
Debug_Msg_Color_GRAY;
static constexpr Color BLACK =
Debug_Msg_Color_BLACK;
static inline bool Color_IsValid(int value) {
return Debug_Msg_Color_IsValid(value);
}
static constexpr Color Color_MIN =
Debug_Msg_Color_Color_MIN;
static constexpr Color Color_MAX =
Debug_Msg_Color_Color_MAX;
static constexpr int Color_ARRAYSIZE =
Debug_Msg_Color_Color_ARRAYSIZE;
static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
Color_descriptor() {
return Debug_Msg_Color_descriptor();
}
template<typename T>
static inline const std::string& Color_Name(T enum_t_value) {
static_assert(::std::is_same<T, Color>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function Color_Name.");
return Debug_Msg_Color_Name(enum_t_value);
}
static inline bool Color_Parse(const std::string& name,
Color* value) {
return Debug_Msg_Color_Parse(name, value);
}
// accessors -------------------------------------------------------
enum : int {
kArcFieldNumber = 3,
kLineFieldNumber = 4,
kTextFieldNumber = 5,
kRobotFieldNumber = 6,
kCurveFieldNumber = 7,
kPolygonFieldNumber = 8,
kPointsFieldNumber = 9,
kTypeFieldNumber = 1,
kColorFieldNumber = 2,
};
// optional .Debug_Arc arc = 3;
bool has_arc() const;
void clear_arc();
const ::Debug_Arc& arc() const;
::Debug_Arc* release_arc();
::Debug_Arc* mutable_arc();
void set_allocated_arc(::Debug_Arc* arc);
// optional .Debug_Line line = 4;
bool has_line() const;
void clear_line();
const ::Debug_Line& line() const;
::Debug_Line* release_line();
::Debug_Line* mutable_line();
void set_allocated_line(::Debug_Line* line);
// optional .Debug_Text text = 5;
bool has_text() const;
void clear_text();
const ::Debug_Text& text() const;
::Debug_Text* release_text();
::Debug_Text* mutable_text();
void set_allocated_text(::Debug_Text* text);
// optional .Debug_Robot robot = 6;
bool has_robot() const;
void clear_robot();
const ::Debug_Robot& robot() const;
::Debug_Robot* release_robot();
::Debug_Robot* mutable_robot();
void set_allocated_robot(::Debug_Robot* robot);
// optional .Debug_Curve_ curve = 7;
bool has_curve() const;
void clear_curve();
const ::Debug_Curve_& curve() const;
::Debug_Curve_* release_curve();
::Debug_Curve_* mutable_curve();
void set_allocated_curve(::Debug_Curve_* curve);
// optional .Debug_Polygon polygon = 8;
bool has_polygon() const;
void clear_polygon();
const ::Debug_Polygon& polygon() const;
::Debug_Polygon* release_polygon();
::Debug_Polygon* mutable_polygon();
void set_allocated_polygon(::Debug_Polygon* polygon);
// optional .Debug_Points points = 9;
bool has_points() const;
void clear_points();
const ::Debug_Points& points() const;
::Debug_Points* release_points();
::Debug_Points* mutable_points();
void set_allocated_points(::Debug_Points* points);
// required .Debug_Msg.Debug_Type type = 1;
bool has_type() const;
void clear_type();
::Debug_Msg_Debug_Type type() const;
void set_type(::Debug_Msg_Debug_Type value);
// required .Debug_Msg.Color color = 2;
bool has_color() const;
void clear_color();
::Debug_Msg_Color color() const;
void set_color(::Debug_Msg_Color value);
// @@protoc_insertion_point(class_scope:Debug_Msg)
private:
class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::Debug_Arc* arc_;
::Debug_Line* line_;
::Debug_Text* text_;
::Debug_Robot* robot_;
::Debug_Curve_* curve_;
::Debug_Polygon* polygon_;
::Debug_Points* points_;
int type_;
int color_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Msgs :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Msgs) */ {
public:
Debug_Msgs();
virtual ~Debug_Msgs();
Debug_Msgs(const Debug_Msgs& from);
Debug_Msgs(Debug_Msgs&& from) noexcept
: Debug_Msgs() {
*this = ::std::move(from);
}
inline Debug_Msgs& operator=(const Debug_Msgs& from) {
CopyFrom(from);
return *this;
}
inline Debug_Msgs& operator=(Debug_Msgs&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Msgs& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Msgs* internal_default_instance() {
return reinterpret_cast<const Debug_Msgs*>(
&_Debug_Msgs_default_instance_);
}
static constexpr int kIndexInFileMessages =
11;
friend void swap(Debug_Msgs& a, Debug_Msgs& b) {
a.Swap(&b);
}
inline void Swap(Debug_Msgs* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Msgs* New() const final {
return CreateMaybeMessage<Debug_Msgs>(nullptr);
}
Debug_Msgs* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Msgs>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Msgs& from);
void MergeFrom(const Debug_Msgs& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Msgs* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Msgs";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kMsgsFieldNumber = 1,
};
// repeated .Debug_Msg msgs = 1;
int msgs_size() const;
void clear_msgs();
::Debug_Msg* mutable_msgs(int index);
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Msg >*
mutable_msgs();
const ::Debug_Msg& msgs(int index) const;
::Debug_Msg* add_msgs();
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Msg >&
msgs() const;
// @@protoc_insertion_point(class_scope:Debug_Msgs)
private:
class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Msg > msgs_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Score :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Score) */ {
public:
Debug_Score();
virtual ~Debug_Score();
Debug_Score(const Debug_Score& from);
Debug_Score(Debug_Score&& from) noexcept
: Debug_Score() {
*this = ::std::move(from);
}
inline Debug_Score& operator=(const Debug_Score& from) {
CopyFrom(from);
return *this;
}
inline Debug_Score& operator=(Debug_Score&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Score& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Score* internal_default_instance() {
return reinterpret_cast<const Debug_Score*>(
&_Debug_Score_default_instance_);
}
static constexpr int kIndexInFileMessages =
12;
friend void swap(Debug_Score& a, Debug_Score& b) {
a.Swap(&b);
}
inline void Swap(Debug_Score* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Score* New() const final {
return CreateMaybeMessage<Debug_Score>(nullptr);
}
Debug_Score* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Score>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Score& from);
void MergeFrom(const Debug_Score& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Score* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Score";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kPFieldNumber = 2,
kColorFieldNumber = 1,
};
// repeated .Point p = 2;
int p_size() const;
void clear_p();
::Point* mutable_p(int index);
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >*
mutable_p();
const ::Point& p(int index) const;
::Point* add_p();
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >&
p() const;
// required int32 color = 1;
bool has_color() const;
void clear_color();
::PROTOBUF_NAMESPACE_ID::int32 color() const;
void set_color(::PROTOBUF_NAMESPACE_ID::int32 value);
// @@protoc_insertion_point(class_scope:Debug_Score)
private:
class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point > p_;
::PROTOBUF_NAMESPACE_ID::int32 color_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// -------------------------------------------------------------------
class Debug_Scores :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Debug_Scores) */ {
public:
Debug_Scores();
virtual ~Debug_Scores();
Debug_Scores(const Debug_Scores& from);
Debug_Scores(Debug_Scores&& from) noexcept
: Debug_Scores() {
*this = ::std::move(from);
}
inline Debug_Scores& operator=(const Debug_Scores& from) {
CopyFrom(from);
return *this;
}
inline Debug_Scores& operator=(Debug_Scores&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Debug_Scores& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Debug_Scores* internal_default_instance() {
return reinterpret_cast<const Debug_Scores*>(
&_Debug_Scores_default_instance_);
}
static constexpr int kIndexInFileMessages =
13;
friend void swap(Debug_Scores& a, Debug_Scores& b) {
a.Swap(&b);
}
inline void Swap(Debug_Scores* other) {
if (other == this) return;
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Debug_Scores* New() const final {
return CreateMaybeMessage<Debug_Scores>(nullptr);
}
Debug_Scores* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Debug_Scores>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Debug_Scores& from);
void MergeFrom(const Debug_Scores& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Debug_Scores* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "Debug_Scores";
}
private:
inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
return nullptr;
}
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_zss_5fdebug_2eproto);
return ::descriptor_table_zss_5fdebug_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kScoresFieldNumber = 1,
};
// repeated .Debug_Score scores = 1;
int scores_size() const;
void clear_scores();
::Debug_Score* mutable_scores(int index);
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Score >*
mutable_scores();
const ::Debug_Score& scores(int index) const;
::Debug_Score* add_scores();
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Score >&
scores() const;
// @@protoc_insertion_point(class_scope:Debug_Scores)
private:
class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Score > scores_;
friend struct ::TableStruct_zss_5fdebug_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Point
// required float x = 1;
inline bool Point::has_x() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Point::clear_x() {
x_ = 0;
_has_bits_[0] &= ~0x00000001u;
}
inline float Point::x() const {
// @@protoc_insertion_point(field_get:Point.x)
return x_;
}
inline void Point::set_x(float value) {
_has_bits_[0] |= 0x00000001u;
x_ = value;
// @@protoc_insertion_point(field_set:Point.x)
}
// required float y = 2;
inline bool Point::has_y() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Point::clear_y() {
y_ = 0;
_has_bits_[0] &= ~0x00000002u;
}
inline float Point::y() const {
// @@protoc_insertion_point(field_get:Point.y)
return y_;
}
inline void Point::set_y(float value) {
_has_bits_[0] |= 0x00000002u;
y_ = value;
// @@protoc_insertion_point(field_set:Point.y)
}
// -------------------------------------------------------------------
// Rectangle_
// required .Point point1 = 1;
inline bool Rectangle_::has_point1() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Rectangle_::clear_point1() {
if (point1_ != nullptr) point1_->Clear();
_has_bits_[0] &= ~0x00000001u;
}
inline const ::Point& Rectangle_::point1() const {
const ::Point* p = point1_;
// @@protoc_insertion_point(field_get:Rectangle_.point1)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Rectangle_::release_point1() {
// @@protoc_insertion_point(field_release:Rectangle_.point1)
_has_bits_[0] &= ~0x00000001u;
::Point* temp = point1_;
point1_ = nullptr;
return temp;
}
inline ::Point* Rectangle_::mutable_point1() {
_has_bits_[0] |= 0x00000001u;
if (point1_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
point1_ = p;
}
// @@protoc_insertion_point(field_mutable:Rectangle_.point1)
return point1_;
}
inline void Rectangle_::set_allocated_point1(::Point* point1) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete point1_;
}
if (point1) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
point1 = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, point1, submessage_arena);
}
_has_bits_[0] |= 0x00000001u;
} else {
_has_bits_[0] &= ~0x00000001u;
}
point1_ = point1;
// @@protoc_insertion_point(field_set_allocated:Rectangle_.point1)
}
// required .Point point2 = 2;
inline bool Rectangle_::has_point2() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Rectangle_::clear_point2() {
if (point2_ != nullptr) point2_->Clear();
_has_bits_[0] &= ~0x00000002u;
}
inline const ::Point& Rectangle_::point2() const {
const ::Point* p = point2_;
// @@protoc_insertion_point(field_get:Rectangle_.point2)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Rectangle_::release_point2() {
// @@protoc_insertion_point(field_release:Rectangle_.point2)
_has_bits_[0] &= ~0x00000002u;
::Point* temp = point2_;
point2_ = nullptr;
return temp;
}
inline ::Point* Rectangle_::mutable_point2() {
_has_bits_[0] |= 0x00000002u;
if (point2_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
point2_ = p;
}
// @@protoc_insertion_point(field_mutable:Rectangle_.point2)
return point2_;
}
inline void Rectangle_::set_allocated_point2(::Point* point2) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete point2_;
}
if (point2) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
point2 = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, point2, submessage_arena);
}
_has_bits_[0] |= 0x00000002u;
} else {
_has_bits_[0] &= ~0x00000002u;
}
point2_ = point2;
// @@protoc_insertion_point(field_set_allocated:Rectangle_.point2)
}
// -------------------------------------------------------------------
// Debug_Robot
// required .Point pos = 1;
inline bool Debug_Robot::has_pos() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Robot::clear_pos() {
if (pos_ != nullptr) pos_->Clear();
_has_bits_[0] &= ~0x00000001u;
}
inline const ::Point& Debug_Robot::pos() const {
const ::Point* p = pos_;
// @@protoc_insertion_point(field_get:Debug_Robot.pos)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Robot::release_pos() {
// @@protoc_insertion_point(field_release:Debug_Robot.pos)
_has_bits_[0] &= ~0x00000001u;
::Point* temp = pos_;
pos_ = nullptr;
return temp;
}
inline ::Point* Debug_Robot::mutable_pos() {
_has_bits_[0] |= 0x00000001u;
if (pos_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
pos_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Robot.pos)
return pos_;
}
inline void Debug_Robot::set_allocated_pos(::Point* pos) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete pos_;
}
if (pos) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
pos = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, pos, submessage_arena);
}
_has_bits_[0] |= 0x00000001u;
} else {
_has_bits_[0] &= ~0x00000001u;
}
pos_ = pos;
// @@protoc_insertion_point(field_set_allocated:Debug_Robot.pos)
}
// required float dir = 2;
inline bool Debug_Robot::has_dir() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Debug_Robot::clear_dir() {
dir_ = 0;
_has_bits_[0] &= ~0x00000002u;
}
inline float Debug_Robot::dir() const {
// @@protoc_insertion_point(field_get:Debug_Robot.dir)
return dir_;
}
inline void Debug_Robot::set_dir(float value) {
_has_bits_[0] |= 0x00000002u;
dir_ = value;
// @@protoc_insertion_point(field_set:Debug_Robot.dir)
}
// -------------------------------------------------------------------
// Debug_Line
// required .Point start = 1;
inline bool Debug_Line::has_start() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Line::clear_start() {
if (start_ != nullptr) start_->Clear();
_has_bits_[0] &= ~0x00000001u;
}
inline const ::Point& Debug_Line::start() const {
const ::Point* p = start_;
// @@protoc_insertion_point(field_get:Debug_Line.start)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Line::release_start() {
// @@protoc_insertion_point(field_release:Debug_Line.start)
_has_bits_[0] &= ~0x00000001u;
::Point* temp = start_;
start_ = nullptr;
return temp;
}
inline ::Point* Debug_Line::mutable_start() {
_has_bits_[0] |= 0x00000001u;
if (start_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
start_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Line.start)
return start_;
}
inline void Debug_Line::set_allocated_start(::Point* start) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete start_;
}
if (start) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
start = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, start, submessage_arena);
}
_has_bits_[0] |= 0x00000001u;
} else {
_has_bits_[0] &= ~0x00000001u;
}
start_ = start;
// @@protoc_insertion_point(field_set_allocated:Debug_Line.start)
}
// required .Point end = 2;
inline bool Debug_Line::has_end() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Debug_Line::clear_end() {
if (end_ != nullptr) end_->Clear();
_has_bits_[0] &= ~0x00000002u;
}
inline const ::Point& Debug_Line::end() const {
const ::Point* p = end_;
// @@protoc_insertion_point(field_get:Debug_Line.end)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Line::release_end() {
// @@protoc_insertion_point(field_release:Debug_Line.end)
_has_bits_[0] &= ~0x00000002u;
::Point* temp = end_;
end_ = nullptr;
return temp;
}
inline ::Point* Debug_Line::mutable_end() {
_has_bits_[0] |= 0x00000002u;
if (end_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
end_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Line.end)
return end_;
}
inline void Debug_Line::set_allocated_end(::Point* end) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete end_;
}
if (end) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
end = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, end, submessage_arena);
}
_has_bits_[0] |= 0x00000002u;
} else {
_has_bits_[0] &= ~0x00000002u;
}
end_ = end;
// @@protoc_insertion_point(field_set_allocated:Debug_Line.end)
}
// required bool FORWARD = 3;
inline bool Debug_Line::has_forward() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Debug_Line::clear_forward() {
forward_ = false;
_has_bits_[0] &= ~0x00000004u;
}
inline bool Debug_Line::forward() const {
// @@protoc_insertion_point(field_get:Debug_Line.FORWARD)
return forward_;
}
inline void Debug_Line::set_forward(bool value) {
_has_bits_[0] |= 0x00000004u;
forward_ = value;
// @@protoc_insertion_point(field_set:Debug_Line.FORWARD)
}
// required bool BACK = 4;
inline bool Debug_Line::has_back() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Debug_Line::clear_back() {
back_ = false;
_has_bits_[0] &= ~0x00000008u;
}
inline bool Debug_Line::back() const {
// @@protoc_insertion_point(field_get:Debug_Line.BACK)
return back_;
}
inline void Debug_Line::set_back(bool value) {
_has_bits_[0] |= 0x00000008u;
back_ = value;
// @@protoc_insertion_point(field_set:Debug_Line.BACK)
}
// -------------------------------------------------------------------
// Debug_Arc
// required .Rectangle_ rectangle = 1;
inline bool Debug_Arc::has_rectangle() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Arc::clear_rectangle() {
if (rectangle_ != nullptr) rectangle_->Clear();
_has_bits_[0] &= ~0x00000001u;
}
inline const ::Rectangle_& Debug_Arc::rectangle() const {
const ::Rectangle_* p = rectangle_;
// @@protoc_insertion_point(field_get:Debug_Arc.rectangle)
return p != nullptr ? *p : *reinterpret_cast<const ::Rectangle_*>(
&::_Rectangle__default_instance_);
}
inline ::Rectangle_* Debug_Arc::release_rectangle() {
// @@protoc_insertion_point(field_release:Debug_Arc.rectangle)
_has_bits_[0] &= ~0x00000001u;
::Rectangle_* temp = rectangle_;
rectangle_ = nullptr;
return temp;
}
inline ::Rectangle_* Debug_Arc::mutable_rectangle() {
_has_bits_[0] |= 0x00000001u;
if (rectangle_ == nullptr) {
auto* p = CreateMaybeMessage<::Rectangle_>(GetArenaNoVirtual());
rectangle_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Arc.rectangle)
return rectangle_;
}
inline void Debug_Arc::set_allocated_rectangle(::Rectangle_* rectangle) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete rectangle_;
}
if (rectangle) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
rectangle = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, rectangle, submessage_arena);
}
_has_bits_[0] |= 0x00000001u;
} else {
_has_bits_[0] &= ~0x00000001u;
}
rectangle_ = rectangle;
// @@protoc_insertion_point(field_set_allocated:Debug_Arc.rectangle)
}
// required float start = 2;
inline bool Debug_Arc::has_start() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Debug_Arc::clear_start() {
start_ = 0;
_has_bits_[0] &= ~0x00000002u;
}
inline float Debug_Arc::start() const {
// @@protoc_insertion_point(field_get:Debug_Arc.start)
return start_;
}
inline void Debug_Arc::set_start(float value) {
_has_bits_[0] |= 0x00000002u;
start_ = value;
// @@protoc_insertion_point(field_set:Debug_Arc.start)
}
// required float end = 3;
inline bool Debug_Arc::has_end() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Debug_Arc::clear_end() {
end_ = 0;
_has_bits_[0] &= ~0x00000004u;
}
inline float Debug_Arc::end() const {
// @@protoc_insertion_point(field_get:Debug_Arc.end)
return end_;
}
inline void Debug_Arc::set_end(float value) {
_has_bits_[0] |= 0x00000004u;
end_ = value;
// @@protoc_insertion_point(field_set:Debug_Arc.end)
}
// required bool FILL = 4;
inline bool Debug_Arc::has_fill() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Debug_Arc::clear_fill() {
fill_ = false;
_has_bits_[0] &= ~0x00000008u;
}
inline bool Debug_Arc::fill() const {
// @@protoc_insertion_point(field_get:Debug_Arc.FILL)
return fill_;
}
inline void Debug_Arc::set_fill(bool value) {
_has_bits_[0] |= 0x00000008u;
fill_ = value;
// @@protoc_insertion_point(field_set:Debug_Arc.FILL)
}
// -------------------------------------------------------------------
// Debug_Polygon
// repeated .Point vertex = 1;
inline int Debug_Polygon::vertex_size() const {
return vertex_.size();
}
inline void Debug_Polygon::clear_vertex() {
vertex_.Clear();
}
inline ::Point* Debug_Polygon::mutable_vertex(int index) {
// @@protoc_insertion_point(field_mutable:Debug_Polygon.vertex)
return vertex_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >*
Debug_Polygon::mutable_vertex() {
// @@protoc_insertion_point(field_mutable_list:Debug_Polygon.vertex)
return &vertex_;
}
inline const ::Point& Debug_Polygon::vertex(int index) const {
// @@protoc_insertion_point(field_get:Debug_Polygon.vertex)
return vertex_.Get(index);
}
inline ::Point* Debug_Polygon::add_vertex() {
// @@protoc_insertion_point(field_add:Debug_Polygon.vertex)
return vertex_.Add();
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >&
Debug_Polygon::vertex() const {
// @@protoc_insertion_point(field_list:Debug_Polygon.vertex)
return vertex_;
}
// required bool FILL = 2;
inline bool Debug_Polygon::has_fill() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Polygon::clear_fill() {
fill_ = false;
_has_bits_[0] &= ~0x00000001u;
}
inline bool Debug_Polygon::fill() const {
// @@protoc_insertion_point(field_get:Debug_Polygon.FILL)
return fill_;
}
inline void Debug_Polygon::set_fill(bool value) {
_has_bits_[0] |= 0x00000001u;
fill_ = value;
// @@protoc_insertion_point(field_set:Debug_Polygon.FILL)
}
// -------------------------------------------------------------------
// Debug_Text
// required .Point pos = 1;
inline bool Debug_Text::has_pos() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Debug_Text::clear_pos() {
if (pos_ != nullptr) pos_->Clear();
_has_bits_[0] &= ~0x00000002u;
}
inline const ::Point& Debug_Text::pos() const {
const ::Point* p = pos_;
// @@protoc_insertion_point(field_get:Debug_Text.pos)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Text::release_pos() {
// @@protoc_insertion_point(field_release:Debug_Text.pos)
_has_bits_[0] &= ~0x00000002u;
::Point* temp = pos_;
pos_ = nullptr;
return temp;
}
inline ::Point* Debug_Text::mutable_pos() {
_has_bits_[0] |= 0x00000002u;
if (pos_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
pos_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Text.pos)
return pos_;
}
inline void Debug_Text::set_allocated_pos(::Point* pos) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete pos_;
}
if (pos) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
pos = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, pos, submessage_arena);
}
_has_bits_[0] |= 0x00000002u;
} else {
_has_bits_[0] &= ~0x00000002u;
}
pos_ = pos;
// @@protoc_insertion_point(field_set_allocated:Debug_Text.pos)
}
// required string text = 2;
inline bool Debug_Text::has_text() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Text::clear_text() {
text_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
_has_bits_[0] &= ~0x00000001u;
}
inline const std::string& Debug_Text::text() const {
// @@protoc_insertion_point(field_get:Debug_Text.text)
return text_.GetNoArena();
}
inline void Debug_Text::set_text(const std::string& value) {
_has_bits_[0] |= 0x00000001u;
text_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:Debug_Text.text)
}
inline void Debug_Text::set_text(std::string&& value) {
_has_bits_[0] |= 0x00000001u;
text_.SetNoArena(
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:Debug_Text.text)
}
inline void Debug_Text::set_text(const char* value) {
GOOGLE_DCHECK(value != nullptr);
_has_bits_[0] |= 0x00000001u;
text_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:Debug_Text.text)
}
inline void Debug_Text::set_text(const char* value, size_t size) {
_has_bits_[0] |= 0x00000001u;
text_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:Debug_Text.text)
}
inline std::string* Debug_Text::mutable_text() {
_has_bits_[0] |= 0x00000001u;
// @@protoc_insertion_point(field_mutable:Debug_Text.text)
return text_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
inline std::string* Debug_Text::release_text() {
// @@protoc_insertion_point(field_release:Debug_Text.text)
if (!has_text()) {
return nullptr;
}
_has_bits_[0] &= ~0x00000001u;
return text_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
inline void Debug_Text::set_allocated_text(std::string* text) {
if (text != nullptr) {
_has_bits_[0] |= 0x00000001u;
} else {
_has_bits_[0] &= ~0x00000001u;
}
text_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), text);
// @@protoc_insertion_point(field_set_allocated:Debug_Text.text)
}
// -------------------------------------------------------------------
// Debug_Curve_
// required float num = 1;
inline bool Debug_Curve_::has_num() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Curve_::clear_num() {
num_ = 0;
_has_bits_[0] &= ~0x00000001u;
}
inline float Debug_Curve_::num() const {
// @@protoc_insertion_point(field_get:Debug_Curve_.num)
return num_;
}
inline void Debug_Curve_::set_num(float value) {
_has_bits_[0] |= 0x00000001u;
num_ = value;
// @@protoc_insertion_point(field_set:Debug_Curve_.num)
}
// required float maxLimit = 2;
inline bool Debug_Curve_::has_maxlimit() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Debug_Curve_::clear_maxlimit() {
maxlimit_ = 0;
_has_bits_[0] &= ~0x00000002u;
}
inline float Debug_Curve_::maxlimit() const {
// @@protoc_insertion_point(field_get:Debug_Curve_.maxLimit)
return maxlimit_;
}
inline void Debug_Curve_::set_maxlimit(float value) {
_has_bits_[0] |= 0x00000002u;
maxlimit_ = value;
// @@protoc_insertion_point(field_set:Debug_Curve_.maxLimit)
}
// required float minLimit = 3;
inline bool Debug_Curve_::has_minlimit() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Debug_Curve_::clear_minlimit() {
minlimit_ = 0;
_has_bits_[0] &= ~0x00000004u;
}
inline float Debug_Curve_::minlimit() const {
// @@protoc_insertion_point(field_get:Debug_Curve_.minLimit)
return minlimit_;
}
inline void Debug_Curve_::set_minlimit(float value) {
_has_bits_[0] |= 0x00000004u;
minlimit_ = value;
// @@protoc_insertion_point(field_set:Debug_Curve_.minLimit)
}
// -------------------------------------------------------------------
// Debug_Curve
// required .Point start = 1;
inline bool Debug_Curve::has_start() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Curve::clear_start() {
if (start_ != nullptr) start_->Clear();
_has_bits_[0] &= ~0x00000001u;
}
inline const ::Point& Debug_Curve::start() const {
const ::Point* p = start_;
// @@protoc_insertion_point(field_get:Debug_Curve.start)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Curve::release_start() {
// @@protoc_insertion_point(field_release:Debug_Curve.start)
_has_bits_[0] &= ~0x00000001u;
::Point* temp = start_;
start_ = nullptr;
return temp;
}
inline ::Point* Debug_Curve::mutable_start() {
_has_bits_[0] |= 0x00000001u;
if (start_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
start_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Curve.start)
return start_;
}
inline void Debug_Curve::set_allocated_start(::Point* start) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete start_;
}
if (start) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
start = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, start, submessage_arena);
}
_has_bits_[0] |= 0x00000001u;
} else {
_has_bits_[0] &= ~0x00000001u;
}
start_ = start;
// @@protoc_insertion_point(field_set_allocated:Debug_Curve.start)
}
// required .Point p1 = 2;
inline bool Debug_Curve::has_p1() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Debug_Curve::clear_p1() {
if (p1_ != nullptr) p1_->Clear();
_has_bits_[0] &= ~0x00000002u;
}
inline const ::Point& Debug_Curve::p1() const {
const ::Point* p = p1_;
// @@protoc_insertion_point(field_get:Debug_Curve.p1)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Curve::release_p1() {
// @@protoc_insertion_point(field_release:Debug_Curve.p1)
_has_bits_[0] &= ~0x00000002u;
::Point* temp = p1_;
p1_ = nullptr;
return temp;
}
inline ::Point* Debug_Curve::mutable_p1() {
_has_bits_[0] |= 0x00000002u;
if (p1_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
p1_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Curve.p1)
return p1_;
}
inline void Debug_Curve::set_allocated_p1(::Point* p1) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete p1_;
}
if (p1) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
p1 = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, p1, submessage_arena);
}
_has_bits_[0] |= 0x00000002u;
} else {
_has_bits_[0] &= ~0x00000002u;
}
p1_ = p1;
// @@protoc_insertion_point(field_set_allocated:Debug_Curve.p1)
}
// required .Point p2 = 3;
inline bool Debug_Curve::has_p2() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Debug_Curve::clear_p2() {
if (p2_ != nullptr) p2_->Clear();
_has_bits_[0] &= ~0x00000004u;
}
inline const ::Point& Debug_Curve::p2() const {
const ::Point* p = p2_;
// @@protoc_insertion_point(field_get:Debug_Curve.p2)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Curve::release_p2() {
// @@protoc_insertion_point(field_release:Debug_Curve.p2)
_has_bits_[0] &= ~0x00000004u;
::Point* temp = p2_;
p2_ = nullptr;
return temp;
}
inline ::Point* Debug_Curve::mutable_p2() {
_has_bits_[0] |= 0x00000004u;
if (p2_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
p2_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Curve.p2)
return p2_;
}
inline void Debug_Curve::set_allocated_p2(::Point* p2) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete p2_;
}
if (p2) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
p2 = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, p2, submessage_arena);
}
_has_bits_[0] |= 0x00000004u;
} else {
_has_bits_[0] &= ~0x00000004u;
}
p2_ = p2;
// @@protoc_insertion_point(field_set_allocated:Debug_Curve.p2)
}
// required .Point end = 4;
inline bool Debug_Curve::has_end() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Debug_Curve::clear_end() {
if (end_ != nullptr) end_->Clear();
_has_bits_[0] &= ~0x00000008u;
}
inline const ::Point& Debug_Curve::end() const {
const ::Point* p = end_;
// @@protoc_insertion_point(field_get:Debug_Curve.end)
return p != nullptr ? *p : *reinterpret_cast<const ::Point*>(
&::_Point_default_instance_);
}
inline ::Point* Debug_Curve::release_end() {
// @@protoc_insertion_point(field_release:Debug_Curve.end)
_has_bits_[0] &= ~0x00000008u;
::Point* temp = end_;
end_ = nullptr;
return temp;
}
inline ::Point* Debug_Curve::mutable_end() {
_has_bits_[0] |= 0x00000008u;
if (end_ == nullptr) {
auto* p = CreateMaybeMessage<::Point>(GetArenaNoVirtual());
end_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Curve.end)
return end_;
}
inline void Debug_Curve::set_allocated_end(::Point* end) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete end_;
}
if (end) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
end = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, end, submessage_arena);
}
_has_bits_[0] |= 0x00000008u;
} else {
_has_bits_[0] &= ~0x00000008u;
}
end_ = end;
// @@protoc_insertion_point(field_set_allocated:Debug_Curve.end)
}
// -------------------------------------------------------------------
// Debug_Points
// repeated .Point point = 1;
inline int Debug_Points::point_size() const {
return point_.size();
}
inline void Debug_Points::clear_point() {
point_.Clear();
}
inline ::Point* Debug_Points::mutable_point(int index) {
// @@protoc_insertion_point(field_mutable:Debug_Points.point)
return point_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >*
Debug_Points::mutable_point() {
// @@protoc_insertion_point(field_mutable_list:Debug_Points.point)
return &point_;
}
inline const ::Point& Debug_Points::point(int index) const {
// @@protoc_insertion_point(field_get:Debug_Points.point)
return point_.Get(index);
}
inline ::Point* Debug_Points::add_point() {
// @@protoc_insertion_point(field_add:Debug_Points.point)
return point_.Add();
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >&
Debug_Points::point() const {
// @@protoc_insertion_point(field_list:Debug_Points.point)
return point_;
}
// -------------------------------------------------------------------
// Debug_Msg
// required .Debug_Msg.Debug_Type type = 1;
inline bool Debug_Msg::has_type() const {
return (_has_bits_[0] & 0x00000080u) != 0;
}
inline void Debug_Msg::clear_type() {
type_ = 0;
_has_bits_[0] &= ~0x00000080u;
}
inline ::Debug_Msg_Debug_Type Debug_Msg::type() const {
// @@protoc_insertion_point(field_get:Debug_Msg.type)
return static_cast< ::Debug_Msg_Debug_Type >(type_);
}
inline void Debug_Msg::set_type(::Debug_Msg_Debug_Type value) {
assert(::Debug_Msg_Debug_Type_IsValid(value));
_has_bits_[0] |= 0x00000080u;
type_ = value;
// @@protoc_insertion_point(field_set:Debug_Msg.type)
}
// required .Debug_Msg.Color color = 2;
inline bool Debug_Msg::has_color() const {
return (_has_bits_[0] & 0x00000100u) != 0;
}
inline void Debug_Msg::clear_color() {
color_ = 0;
_has_bits_[0] &= ~0x00000100u;
}
inline ::Debug_Msg_Color Debug_Msg::color() const {
// @@protoc_insertion_point(field_get:Debug_Msg.color)
return static_cast< ::Debug_Msg_Color >(color_);
}
inline void Debug_Msg::set_color(::Debug_Msg_Color value) {
assert(::Debug_Msg_Color_IsValid(value));
_has_bits_[0] |= 0x00000100u;
color_ = value;
// @@protoc_insertion_point(field_set:Debug_Msg.color)
}
// optional .Debug_Arc arc = 3;
inline bool Debug_Msg::has_arc() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Msg::clear_arc() {
if (arc_ != nullptr) arc_->Clear();
_has_bits_[0] &= ~0x00000001u;
}
inline const ::Debug_Arc& Debug_Msg::arc() const {
const ::Debug_Arc* p = arc_;
// @@protoc_insertion_point(field_get:Debug_Msg.arc)
return p != nullptr ? *p : *reinterpret_cast<const ::Debug_Arc*>(
&::_Debug_Arc_default_instance_);
}
inline ::Debug_Arc* Debug_Msg::release_arc() {
// @@protoc_insertion_point(field_release:Debug_Msg.arc)
_has_bits_[0] &= ~0x00000001u;
::Debug_Arc* temp = arc_;
arc_ = nullptr;
return temp;
}
inline ::Debug_Arc* Debug_Msg::mutable_arc() {
_has_bits_[0] |= 0x00000001u;
if (arc_ == nullptr) {
auto* p = CreateMaybeMessage<::Debug_Arc>(GetArenaNoVirtual());
arc_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Msg.arc)
return arc_;
}
inline void Debug_Msg::set_allocated_arc(::Debug_Arc* arc) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete arc_;
}
if (arc) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
arc = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, arc, submessage_arena);
}
_has_bits_[0] |= 0x00000001u;
} else {
_has_bits_[0] &= ~0x00000001u;
}
arc_ = arc;
// @@protoc_insertion_point(field_set_allocated:Debug_Msg.arc)
}
// optional .Debug_Line line = 4;
inline bool Debug_Msg::has_line() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Debug_Msg::clear_line() {
if (line_ != nullptr) line_->Clear();
_has_bits_[0] &= ~0x00000002u;
}
inline const ::Debug_Line& Debug_Msg::line() const {
const ::Debug_Line* p = line_;
// @@protoc_insertion_point(field_get:Debug_Msg.line)
return p != nullptr ? *p : *reinterpret_cast<const ::Debug_Line*>(
&::_Debug_Line_default_instance_);
}
inline ::Debug_Line* Debug_Msg::release_line() {
// @@protoc_insertion_point(field_release:Debug_Msg.line)
_has_bits_[0] &= ~0x00000002u;
::Debug_Line* temp = line_;
line_ = nullptr;
return temp;
}
inline ::Debug_Line* Debug_Msg::mutable_line() {
_has_bits_[0] |= 0x00000002u;
if (line_ == nullptr) {
auto* p = CreateMaybeMessage<::Debug_Line>(GetArenaNoVirtual());
line_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Msg.line)
return line_;
}
inline void Debug_Msg::set_allocated_line(::Debug_Line* line) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete line_;
}
if (line) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
line = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, line, submessage_arena);
}
_has_bits_[0] |= 0x00000002u;
} else {
_has_bits_[0] &= ~0x00000002u;
}
line_ = line;
// @@protoc_insertion_point(field_set_allocated:Debug_Msg.line)
}
// optional .Debug_Text text = 5;
inline bool Debug_Msg::has_text() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Debug_Msg::clear_text() {
if (text_ != nullptr) text_->Clear();
_has_bits_[0] &= ~0x00000004u;
}
inline const ::Debug_Text& Debug_Msg::text() const {
const ::Debug_Text* p = text_;
// @@protoc_insertion_point(field_get:Debug_Msg.text)
return p != nullptr ? *p : *reinterpret_cast<const ::Debug_Text*>(
&::_Debug_Text_default_instance_);
}
inline ::Debug_Text* Debug_Msg::release_text() {
// @@protoc_insertion_point(field_release:Debug_Msg.text)
_has_bits_[0] &= ~0x00000004u;
::Debug_Text* temp = text_;
text_ = nullptr;
return temp;
}
inline ::Debug_Text* Debug_Msg::mutable_text() {
_has_bits_[0] |= 0x00000004u;
if (text_ == nullptr) {
auto* p = CreateMaybeMessage<::Debug_Text>(GetArenaNoVirtual());
text_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Msg.text)
return text_;
}
inline void Debug_Msg::set_allocated_text(::Debug_Text* text) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete text_;
}
if (text) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
text = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, text, submessage_arena);
}
_has_bits_[0] |= 0x00000004u;
} else {
_has_bits_[0] &= ~0x00000004u;
}
text_ = text;
// @@protoc_insertion_point(field_set_allocated:Debug_Msg.text)
}
// optional .Debug_Robot robot = 6;
inline bool Debug_Msg::has_robot() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Debug_Msg::clear_robot() {
if (robot_ != nullptr) robot_->Clear();
_has_bits_[0] &= ~0x00000008u;
}
inline const ::Debug_Robot& Debug_Msg::robot() const {
const ::Debug_Robot* p = robot_;
// @@protoc_insertion_point(field_get:Debug_Msg.robot)
return p != nullptr ? *p : *reinterpret_cast<const ::Debug_Robot*>(
&::_Debug_Robot_default_instance_);
}
inline ::Debug_Robot* Debug_Msg::release_robot() {
// @@protoc_insertion_point(field_release:Debug_Msg.robot)
_has_bits_[0] &= ~0x00000008u;
::Debug_Robot* temp = robot_;
robot_ = nullptr;
return temp;
}
inline ::Debug_Robot* Debug_Msg::mutable_robot() {
_has_bits_[0] |= 0x00000008u;
if (robot_ == nullptr) {
auto* p = CreateMaybeMessage<::Debug_Robot>(GetArenaNoVirtual());
robot_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Msg.robot)
return robot_;
}
inline void Debug_Msg::set_allocated_robot(::Debug_Robot* robot) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete robot_;
}
if (robot) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
robot = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, robot, submessage_arena);
}
_has_bits_[0] |= 0x00000008u;
} else {
_has_bits_[0] &= ~0x00000008u;
}
robot_ = robot;
// @@protoc_insertion_point(field_set_allocated:Debug_Msg.robot)
}
// optional .Debug_Curve_ curve = 7;
inline bool Debug_Msg::has_curve() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void Debug_Msg::clear_curve() {
if (curve_ != nullptr) curve_->Clear();
_has_bits_[0] &= ~0x00000010u;
}
inline const ::Debug_Curve_& Debug_Msg::curve() const {
const ::Debug_Curve_* p = curve_;
// @@protoc_insertion_point(field_get:Debug_Msg.curve)
return p != nullptr ? *p : *reinterpret_cast<const ::Debug_Curve_*>(
&::_Debug_Curve__default_instance_);
}
inline ::Debug_Curve_* Debug_Msg::release_curve() {
// @@protoc_insertion_point(field_release:Debug_Msg.curve)
_has_bits_[0] &= ~0x00000010u;
::Debug_Curve_* temp = curve_;
curve_ = nullptr;
return temp;
}
inline ::Debug_Curve_* Debug_Msg::mutable_curve() {
_has_bits_[0] |= 0x00000010u;
if (curve_ == nullptr) {
auto* p = CreateMaybeMessage<::Debug_Curve_>(GetArenaNoVirtual());
curve_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Msg.curve)
return curve_;
}
inline void Debug_Msg::set_allocated_curve(::Debug_Curve_* curve) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete curve_;
}
if (curve) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
curve = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, curve, submessage_arena);
}
_has_bits_[0] |= 0x00000010u;
} else {
_has_bits_[0] &= ~0x00000010u;
}
curve_ = curve;
// @@protoc_insertion_point(field_set_allocated:Debug_Msg.curve)
}
// optional .Debug_Polygon polygon = 8;
inline bool Debug_Msg::has_polygon() const {
return (_has_bits_[0] & 0x00000020u) != 0;
}
inline void Debug_Msg::clear_polygon() {
if (polygon_ != nullptr) polygon_->Clear();
_has_bits_[0] &= ~0x00000020u;
}
inline const ::Debug_Polygon& Debug_Msg::polygon() const {
const ::Debug_Polygon* p = polygon_;
// @@protoc_insertion_point(field_get:Debug_Msg.polygon)
return p != nullptr ? *p : *reinterpret_cast<const ::Debug_Polygon*>(
&::_Debug_Polygon_default_instance_);
}
inline ::Debug_Polygon* Debug_Msg::release_polygon() {
// @@protoc_insertion_point(field_release:Debug_Msg.polygon)
_has_bits_[0] &= ~0x00000020u;
::Debug_Polygon* temp = polygon_;
polygon_ = nullptr;
return temp;
}
inline ::Debug_Polygon* Debug_Msg::mutable_polygon() {
_has_bits_[0] |= 0x00000020u;
if (polygon_ == nullptr) {
auto* p = CreateMaybeMessage<::Debug_Polygon>(GetArenaNoVirtual());
polygon_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Msg.polygon)
return polygon_;
}
inline void Debug_Msg::set_allocated_polygon(::Debug_Polygon* polygon) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete polygon_;
}
if (polygon) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
polygon = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, polygon, submessage_arena);
}
_has_bits_[0] |= 0x00000020u;
} else {
_has_bits_[0] &= ~0x00000020u;
}
polygon_ = polygon;
// @@protoc_insertion_point(field_set_allocated:Debug_Msg.polygon)
}
// optional .Debug_Points points = 9;
inline bool Debug_Msg::has_points() const {
return (_has_bits_[0] & 0x00000040u) != 0;
}
inline void Debug_Msg::clear_points() {
if (points_ != nullptr) points_->Clear();
_has_bits_[0] &= ~0x00000040u;
}
inline const ::Debug_Points& Debug_Msg::points() const {
const ::Debug_Points* p = points_;
// @@protoc_insertion_point(field_get:Debug_Msg.points)
return p != nullptr ? *p : *reinterpret_cast<const ::Debug_Points*>(
&::_Debug_Points_default_instance_);
}
inline ::Debug_Points* Debug_Msg::release_points() {
// @@protoc_insertion_point(field_release:Debug_Msg.points)
_has_bits_[0] &= ~0x00000040u;
::Debug_Points* temp = points_;
points_ = nullptr;
return temp;
}
inline ::Debug_Points* Debug_Msg::mutable_points() {
_has_bits_[0] |= 0x00000040u;
if (points_ == nullptr) {
auto* p = CreateMaybeMessage<::Debug_Points>(GetArenaNoVirtual());
points_ = p;
}
// @@protoc_insertion_point(field_mutable:Debug_Msg.points)
return points_;
}
inline void Debug_Msg::set_allocated_points(::Debug_Points* points) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete points_;
}
if (points) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
points = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, points, submessage_arena);
}
_has_bits_[0] |= 0x00000040u;
} else {
_has_bits_[0] &= ~0x00000040u;
}
points_ = points;
// @@protoc_insertion_point(field_set_allocated:Debug_Msg.points)
}
// -------------------------------------------------------------------
// Debug_Msgs
// repeated .Debug_Msg msgs = 1;
inline int Debug_Msgs::msgs_size() const {
return msgs_.size();
}
inline void Debug_Msgs::clear_msgs() {
msgs_.Clear();
}
inline ::Debug_Msg* Debug_Msgs::mutable_msgs(int index) {
// @@protoc_insertion_point(field_mutable:Debug_Msgs.msgs)
return msgs_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Msg >*
Debug_Msgs::mutable_msgs() {
// @@protoc_insertion_point(field_mutable_list:Debug_Msgs.msgs)
return &msgs_;
}
inline const ::Debug_Msg& Debug_Msgs::msgs(int index) const {
// @@protoc_insertion_point(field_get:Debug_Msgs.msgs)
return msgs_.Get(index);
}
inline ::Debug_Msg* Debug_Msgs::add_msgs() {
// @@protoc_insertion_point(field_add:Debug_Msgs.msgs)
return msgs_.Add();
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Msg >&
Debug_Msgs::msgs() const {
// @@protoc_insertion_point(field_list:Debug_Msgs.msgs)
return msgs_;
}
// -------------------------------------------------------------------
// Debug_Score
// required int32 color = 1;
inline bool Debug_Score::has_color() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Debug_Score::clear_color() {
color_ = 0;
_has_bits_[0] &= ~0x00000001u;
}
inline ::PROTOBUF_NAMESPACE_ID::int32 Debug_Score::color() const {
// @@protoc_insertion_point(field_get:Debug_Score.color)
return color_;
}
inline void Debug_Score::set_color(::PROTOBUF_NAMESPACE_ID::int32 value) {
_has_bits_[0] |= 0x00000001u;
color_ = value;
// @@protoc_insertion_point(field_set:Debug_Score.color)
}
// repeated .Point p = 2;
inline int Debug_Score::p_size() const {
return p_.size();
}
inline void Debug_Score::clear_p() {
p_.Clear();
}
inline ::Point* Debug_Score::mutable_p(int index) {
// @@protoc_insertion_point(field_mutable:Debug_Score.p)
return p_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >*
Debug_Score::mutable_p() {
// @@protoc_insertion_point(field_mutable_list:Debug_Score.p)
return &p_;
}
inline const ::Point& Debug_Score::p(int index) const {
// @@protoc_insertion_point(field_get:Debug_Score.p)
return p_.Get(index);
}
inline ::Point* Debug_Score::add_p() {
// @@protoc_insertion_point(field_add:Debug_Score.p)
return p_.Add();
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Point >&
Debug_Score::p() const {
// @@protoc_insertion_point(field_list:Debug_Score.p)
return p_;
}
// -------------------------------------------------------------------
// Debug_Scores
// repeated .Debug_Score scores = 1;
inline int Debug_Scores::scores_size() const {
return scores_.size();
}
inline void Debug_Scores::clear_scores() {
scores_.Clear();
}
inline ::Debug_Score* Debug_Scores::mutable_scores(int index) {
// @@protoc_insertion_point(field_mutable:Debug_Scores.scores)
return scores_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Score >*
Debug_Scores::mutable_scores() {
// @@protoc_insertion_point(field_mutable_list:Debug_Scores.scores)
return &scores_;
}
inline const ::Debug_Score& Debug_Scores::scores(int index) const {
// @@protoc_insertion_point(field_get:Debug_Scores.scores)
return scores_.Get(index);
}
inline ::Debug_Score* Debug_Scores::add_scores() {
// @@protoc_insertion_point(field_add:Debug_Scores.scores)
return scores_.Add();
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Debug_Score >&
Debug_Scores::scores() const {
// @@protoc_insertion_point(field_list:Debug_Scores.scores)
return scores_;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_OPEN
template <> struct is_proto_enum< ::Debug_Msg_Debug_Type> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::Debug_Msg_Debug_Type>() {
return ::Debug_Msg_Debug_Type_descriptor();
}
template <> struct is_proto_enum< ::Debug_Msg_Color> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::Debug_Msg_Color>() {
return ::Debug_Msg_Color_descriptor();
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_zss_5fdebug_2eproto
| 32.659905 | 108 | 0.701014 |
d90a6b363926d244f2a32872e5d3672fbf3b81e7 | 1,360 | h | C | Plugins/MadaraLibrary/Source/ThirdParty/madara/transport/multicast/MulticastTransportReadThread.h | jredmondson/GamsPlugins | d133f86c263997a55f11b3b3d3344faeee60d726 | [
"BSD-2-Clause"
] | 3 | 2020-03-25T01:59:20.000Z | 2020-06-02T17:58:05.000Z | Plugins/MadaraLibrary/Source/ThirdParty/madara/transport/multicast/MulticastTransportReadThread.h | jredmondson/GamsPlugins | d133f86c263997a55f11b3b3d3344faeee60d726 | [
"BSD-2-Clause"
] | null | null | null | Plugins/MadaraLibrary/Source/ThirdParty/madara/transport/multicast/MulticastTransportReadThread.h | jredmondson/GamsPlugins | d133f86c263997a55f11b3b3d3344faeee60d726 | [
"BSD-2-Clause"
] | 1 | 2020-11-05T23:04:05.000Z | 2020-11-05T23:04:05.000Z | #ifndef _MADARA_MULTICAST_TRANSPORT_READ_THREAD_H_
#define _MADARA_MULTICAST_TRANSPORT_READ_THREAD_H_
/**
* @file MulticastTransportReadThread.h
* @author James Edmondson <jedmondson@gmail.com>
*
* This file contains the MulticastTransportReadThread class, which provides a
* multicast transport for reading knowledge updates in KaRL
**/
#include <string>
#include "madara/utility/ScopedArray.h"
#include "madara/knowledge/ThreadSafeContext.h"
#include "madara/transport/BandwidthMonitor.h"
#include "madara/transport/QoSTransportSettings.h"
#include "madara/expression/ExpressionTree.h"
#include "madara/transport/Transport.h"
#include "madara/transport/MessageHeader.h"
#include "madara/transport/udp/UdpTransport.h"
#include "madara/threads/BaseThread.h"
#include "madara/Boost.h"
namespace madara
{
namespace transport
{
namespace asio = boost::asio;
namespace ip = boost::asio::ip;
using udp = boost::asio::ip::udp;
/**
* @class MulticastTransportReadThread
* @brief Thread for reading knowledge updates through a Multicast
* datagram socket
**/
class MulticastTransportReadThread : public UdpTransportReadThread
{
public:
using UdpTransportReadThread::UdpTransportReadThread;
/**
* Cleanup function called by thread manager
**/
void cleanup(void) override;
};
}
}
#endif // _MADARA_MULTICAST_TRANSPORT_READ_THREAD_H_
| 26.153846 | 78 | 0.783824 |
d90abc3b7350210185ab5a7d002fb4d1a956c802 | 3,101 | h | C | PhotonChat/Photon-objc/inc/EGLitePeer.h | anhtrangg/PhotonChat | 4bd5788fe4ec89dab83ae01d7f372b6e9bd5ebc9 | [
"MIT"
] | null | null | null | PhotonChat/Photon-objc/inc/EGLitePeer.h | anhtrangg/PhotonChat | 4bd5788fe4ec89dab83ae01d7f372b6e9bd5ebc9 | [
"MIT"
] | null | null | null | PhotonChat/Photon-objc/inc/EGLitePeer.h | anhtrangg/PhotonChat | 4bd5788fe4ec89dab83ae01d7f372b6e9bd5ebc9 | [
"MIT"
] | null | null | null | /* Exit Games Photon - objC Client Lib
* Copyright (C) 2004-2020 by Exit Games GmbH. All rights reserved.
* http://www.photonengine.com
* mailto:developer@photonengine.com
*/
#pragma once
#import "Photon-objc/inc/EGPhotonPeer.h"
@interface EGLitePeer : EGPhotonPeer
{
}
- (instancetype) init NS_UNAVAILABLE;
- (instancetype) initWithPhotonListener:(id<EGPhotonListener>)listener; // = ConnectionProtocol::UDP
- (instancetype) initWithPhotonListener:(id<EGPhotonListener>)listener :(nByte)connectionProtocol NS_DESIGNATED_INITIALIZER;
- (instancetype) initWithPhotonListener:(id<EGPhotonListener>)listener :(nByte)connectionProtocol :(bool)useLitePeer NS_UNAVAILABLE;
+ (instancetype) new NS_UNAVAILABLE;
- (bool) opRaiseEvent:(bool)reliable :(id<NSObject>)parameters :(nByte)eventCode; // = 0
- (bool) opRaiseEvent:(bool)reliable :(id<NSObject>)parameters :(nByte)eventCode :(nByte)channelID; // = EventCache::DO_NOT_CACHE
- (bool) opRaiseEvent:(bool)reliable :(id<NSObject>)parameters :(nByte)eventCode :(nByte)channelID :(nByte)eventCaching; // = NULL, = 0
- (bool) opRaiseEvent:(bool)reliable :(id<NSObject>)parameters :(nByte)eventCode :(nByte)channelID :(nByte)eventCaching :(int*)targetPlayers :(short)numTargetPlayers; // = ReceiverGroup::OTHERS
- (bool) opRaiseEvent:(bool)reliable :(id<NSObject>)parameters :(nByte)eventCode :(nByte)channelID :(nByte)eventCaching :(int*)targetPlayers :(short)numTargetPlayers :(nByte)receiverGroup;
- (bool) opJoin:(NSString*)gameid; // = NULL, = NULL, = false
- (bool) opJoin:(NSString*)gameId :(NSDictionary*)gameProperties :(NSDictionary*)actorProperties :(bool)broadcastActorProperties;
- (bool) opLeave;
- (bool) opSetPropertiesOfActor:(int)actorNr :(NSDictionary*)properties :(bool)broadcast; // = 0
- (bool) opSetPropertiesOfActor:(int)actorNr :(NSDictionary*)properties :(bool)broadcast :(nByte)channelID;
- (bool) opSetPropertiesOfGame:(NSDictionary*)properties :(bool)broadcast; // = 0
- (bool) opSetPropertiesOfGame:(NSDictionary*)properties :(bool)broadcast :(nByte)channelID;
- (bool) opGetProperties; // = 0
- (bool) opGetProperties:(nByte)channelID;
- (bool) opGetPropertiesOfActorByStringKeys:(NSString**)properties :(short)numProperties :(int*)actorNrList :(short)numActors; // = 0
- (bool) opGetPropertiesOfActorByStringKeys:(NSString**)properties :(short)numProperties :(int*)actorNrList :(short)numActors :(nByte)channelID;
- (bool) opGetPropertiesOfActorByByteKeys:(nByte*)properties :(short)numProperties :(int*)actorNrList :(short)numActors; // = 0
- (bool) opGetPropertiesOfActorByByteKeys:(nByte*)properties :(short)numProperties :(int*)actorNrList :(short)numActors :(nByte)channelID;
- (bool) opGetPropertiesOfGameByStringKeys:(NSString**)properties :(short)numProperties; // = 0
- (bool) opGetPropertiesOfGameByStringKeys:(NSString**)properties :(short)numProperties :(nByte)channelID;
- (bool) opGetPropertiesOfGameByByteKeys:(nByte*)properties :(short)numProperties; // = 0
- (bool) opGetPropertiesOfGameByByteKeys:(nByte*)properties :(short)numProperties :(nByte)channelID;
@end | 73.833333 | 194 | 0.761045 |
d90b2f0f764988e3a0498be0160bc406d36141d3 | 198 | h | C | FItBodyUser/FItBodyUser/Me/Class/Favourite/Modles/ZZQFavMenu.h | a5566baga/FitBodyUserApp | a6f628588e95a6db552618954c8ec8c4527787fa | [
"Apache-2.0"
] | null | null | null | FItBodyUser/FItBodyUser/Me/Class/Favourite/Modles/ZZQFavMenu.h | a5566baga/FitBodyUserApp | a6f628588e95a6db552618954c8ec8c4527787fa | [
"Apache-2.0"
] | null | null | null | FItBodyUser/FItBodyUser/Me/Class/Favourite/Modles/ZZQFavMenu.h | a5566baga/FitBodyUserApp | a6f628588e95a6db552618954c8ec8c4527787fa | [
"Apache-2.0"
] | null | null | null | //
// ZZQFavMenu.h
// FItBodyUser
//
// Created by ben on 17/4/28.
// Copyright © 2017年 张增强. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ZZQFavMenu : NSObject
@end
| 12.375 | 47 | 0.666667 |
d90c619e13fb7e14e3d70002f50673e65c264690 | 327 | c | C | src/lib/wkpf/c/common/native_wuclasses/wuclass_generic_update.c | BigstarPie/WuKongProject | e8e4a9d3f56732b2fdc8c5c48d0be93d31f57376 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/lib/wkpf/c/common/native_wuclasses/wuclass_generic_update.c | BigstarPie/WuKongProject | e8e4a9d3f56732b2fdc8c5c48d0be93d31f57376 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/lib/wkpf/c/common/native_wuclasses/wuclass_generic_update.c | BigstarPie/WuKongProject | e8e4a9d3f56732b2fdc8c5c48d0be93d31f57376 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #include "debug.h"
#include "native_wuclasses.h"
void wuclass_generic_setup(wuobject_t *wuobject) {}
void wuclass_generic_update(wuobject_t *wuobject) {
DEBUG_LOG(DBG_WKPFUPDATE, "WKPFUPDATE(Generic): Update called for generic wuclass\n");
wkpf_internal_write_property_int16(wuobject, WKPF_PROPERTY_GENERIC_DUMMY, 42);
}
| 32.7 | 88 | 0.810398 |
d90cea6c935a83411d505b3ad5ebcb136da9c574 | 1,212 | h | C | Development/External/Novodex/Physics/include/NxSceneStats.h | addstone/unrealengine3 | 4579d360dfd52b12493292120b27bb430f978fc8 | [
"FSFAP"
] | 37 | 2020-05-22T18:18:47.000Z | 2022-03-19T06:51:54.000Z | Development/External/Novodex/Physics/include/NxSceneStats.h | AdanosGotoman/unrealengine3 | 4579d360dfd52b12493292120b27bb430f978fc8 | [
"FSFAP"
] | null | null | null | Development/External/Novodex/Physics/include/NxSceneStats.h | AdanosGotoman/unrealengine3 | 4579d360dfd52b12493292120b27bb430f978fc8 | [
"FSFAP"
] | 27 | 2020-05-17T01:03:30.000Z | 2022-03-06T19:10:14.000Z | #ifndef NX_SCENE_STATS
#define NX_SCENE_STATS
/*----------------------------------------------------------------------------*\
|
| Public Interface to NovodeX Technology
|
| www.novodex.com
|
\*----------------------------------------------------------------------------*/
#include "Nxp.h"
#define PROFILE_LEVEL 1 // used to designation how detailed the profiling on this build should be.
class NxSceneStats
{
public:
NxI32 numContacts;
NxI32 maxContacts;
NxI32 numActors;
NxI32 numJoints;
NxI32 numAwake;
NxI32 numAsleep;
NxI32 numStaticShapes;
NxSceneStats()
{
reset();
}
void reset()
{
numContacts = 0;
maxContacts = 0;
numAwake = 0;
numAsleep = 0;
numActors = 0;
numJoints = 0;
numStaticShapes = 0;
}
};
enum NxPerformanceFlag
{
NX_PF_LOGCPU = (1<<0),
NX_PF_LOGCOUNT = (1<<1),
NX_PF_LOGMEAN = (1<<2),
NX_PF_ENABLE = (1<<3),
};
class NxPerformanceInspector
{
public:
virtual int initEntry(const char* pname, NxPerformanceFlag flags)=0;
virtual void logEvent(const char* fmt, ...) = 0;
virtual void markBegin(int entry) = 0;
virtual void markEnd(int entry) = 0;
virtual void setCount(int entry, int count) = 0;
};
#endif
| 19.548387 | 98 | 0.585809 |
d90fabd2b7d144815862c77bffd1df866a6cc455 | 559 | h | C | include/popups.h | joel16/VITAlbum | f64499adc5acf27f79e5fe2cd811de528a6fac32 | [
"MIT"
] | 17 | 2020-07-07T09:01:02.000Z | 2021-08-30T06:53:17.000Z | include/popups.h | joel16/VITAlbum | f64499adc5acf27f79e5fe2cd811de528a6fac32 | [
"MIT"
] | 10 | 2020-07-07T12:42:06.000Z | 2022-03-14T15:25:01.000Z | include/popups.h | joel16/VITAlbum | f64499adc5acf27f79e5fe2cd811de528a6fac32 | [
"MIT"
] | 7 | 2020-07-08T04:48:24.000Z | 2021-11-17T02:37:48.000Z | #ifndef _VITALBUM_POPUPS_H_
#define _VITALBUM_POPUPS_H_
#include "imgui.h"
#include "textures.h"
namespace Popups {
inline void SetupPopup(const char *id) {
ImGui::OpenPopup(id);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(15, 15));
ImGui::SetNextWindowPos(ImVec2(480.0f, 272.0f), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
};
inline void ExitPopup(void) {
ImGui::EndPopup();
ImGui::PopStyleVar();
};
void ImageProperties(bool *state, MenuItem *item, Tex *texture);
}
#endif
| 24.304348 | 97 | 0.661896 |
d910cac7f6e2dd0bb47d6b32426118dd3d011df1 | 3,354 | c | C | mrbgems/mruby-catch/src/catch.c | LanzaSchneider/mruby | ad09c3951468c064468f27731b49d298a79946f5 | [
"MIT"
] | null | null | null | mrbgems/mruby-catch/src/catch.c | LanzaSchneider/mruby | ad09c3951468c064468f27731b49d298a79946f5 | [
"MIT"
] | 21 | 2021-05-12T06:11:30.000Z | 2022-03-30T19:10:59.000Z | mrbgems/mruby-catch/src/catch.c | hasumikin/mruby | aca59de88e87d81021c4e05f39a55013d068701f | [
"MIT"
] | null | null | null | #include <mruby.h>
#include <mruby/class.h>
#include <mruby/variable.h>
#include <mruby/error.h>
#include <mruby/proc.h>
#include <mruby/opcode.h>
#include <mruby/presym.h>
MRB_PRESYM_DEFINE_VAR_AND_INITER(catch_syms_3, 1, MRB_SYM(call))
static const mrb_code catch_iseq_3[18] = {
OP_ENTER, 0x00, 0x00, 0x00,
OP_GETUPVAR, 0x02, 0x02, 0x01,
OP_GETUPVAR, 0x03, 0x01, 0x01,
OP_SEND, 0x02, 0x00, 0x01,
OP_RETURN, 0x02,};
static const mrb_irep catch_irep_3 = {
2,5,0,
MRB_IREP_STATIC,catch_iseq_3,
NULL,catch_syms_3,NULL,
NULL,
NULL,
18,0,1,0,0
};
static const mrb_irep *catch_reps_2[1] = {
&catch_irep_3,
};
static const mrb_code catch_iseq_2[13] = {
OP_ENTER, 0x00, 0x00, 0x00,
OP_LAMBDA, 0x02, 0x00,
OP_SEND, 0x02, 0x00, 0x00,
OP_RETURN, 0x02,};
static const mrb_irep catch_irep_2 = {
2,4,0,
MRB_IREP_STATIC,catch_iseq_2,
NULL,catch_syms_3,catch_reps_2,
NULL,
NULL,
13,0,1,1,0
};
static const mrb_irep *catch_reps_1[1] = {
&catch_irep_2,
};
MRB_PRESYM_DEFINE_VAR_AND_INITER(catch_syms_1, 3, MRB_SYM(Object), MRB_SYM(new), MRB_SYM(call))
static const mrb_code catch_iseq_1[29] = {
OP_ENTER, 0x00, 0x20, 0x01,
OP_JMP, 0x00, 0x03,
OP_JMP, 0x00, 0x0a,
OP_GETCONST, 0x03, 0x00,
OP_SEND, 0x03, 0x01, 0x00,
OP_MOVE, 0x01, 0x03,
OP_LAMBDA, 0x03, 0x00,
OP_SEND, 0x03, 0x02, 0x00,
OP_RETURN, 0x03,};
static const mrb_irep catch_irep = {
3,5,0,
MRB_IREP_STATIC,catch_iseq_1,
NULL,catch_syms_1,catch_reps_1,
NULL,
NULL,
29,0,3,1,0
};
#define ID_PRESERVED_CATCH MRB_SYM(__preserved_catch_proc)
static const mrb_callinfo *
find_catcher(mrb_state *mrb, mrb_value tag)
{
mrb_value pval = mrb_obj_iv_get(mrb, (struct RObject *)mrb->kernel_module, ID_PRESERVED_CATCH);
mrb_assert(mrb_proc_p(pval));
const struct RProc *proc = mrb_proc_ptr(pval);
const mrb_callinfo *ci = mrb->c->ci;
size_t n = ci - mrb->c->cibase;
ci--;
for (; n > 0; n--, ci--) {
const mrb_value *arg1 = ci->stack + 1;
if (ci->proc == proc && mrb_obj_eq(mrb, *arg1, tag)) {
return ci;
}
}
return NULL;
}
static mrb_value
mrb_f_throw(mrb_state *mrb, mrb_value self)
{
mrb_value tag, obj;
if (mrb_get_args(mrb, "o|o", &tag, &obj) == 1) {
obj = mrb_nil_value();
}
const mrb_callinfo *ci = find_catcher(mrb, tag);
if (ci) {
struct RBreak *b = (struct RBreak *)mrb_obj_alloc(mrb, MRB_TT_BREAK, NULL);
mrb_break_value_set(b, obj);
mrb_break_proc_set(b, ci[2].proc); /* Back to the closure in `catch` method */
mrb_exc_raise(mrb, mrb_obj_value(b));
}
else {
mrb_value argv[2] = {tag, obj};
mrb_exc_raise(mrb, mrb_obj_new(mrb, mrb_exc_get_id(mrb, MRB_ERROR_SYM(UncaughtThrowError)), 2, argv));
}
/* not reached */
return mrb_nil_value();
}
void
mrb_mruby_catch_gem_init(mrb_state *mrb)
{
struct RProc *p;
mrb_method_t m;
MRB_PRESYM_INIT_SYMBOLS(mrb, catch_syms_3);
MRB_PRESYM_INIT_SYMBOLS(mrb, catch_syms_1);
p = mrb_proc_new(mrb, &catch_irep);
MRB_METHOD_FROM_PROC(m, p);
mrb_define_method_raw(mrb, mrb->kernel_module, MRB_SYM(catch), m);
mrb_obj_iv_set(mrb, (struct RObject *)mrb->kernel_module, ID_PRESERVED_CATCH, mrb_obj_value(p));
mrb_define_method(mrb, mrb->kernel_module, "throw", mrb_f_throw, MRB_ARGS_ARG(1,1));
}
void
mrb_mruby_catch_gem_final(mrb_state *mrb)
{
}
| 26 | 106 | 0.691413 |
d9119c9d7b158f8b296cb10e3e2c8f482ebae300 | 710 | h | C | TCCollections/CoreData/TCTableViewController/Model/TCTableManagedModel+Subclass.h | Tayphoon/TCCollections | b34f15dc24db6e4ef0b723d624ae6964b50984b2 | [
"MIT"
] | null | null | null | TCCollections/CoreData/TCTableViewController/Model/TCTableManagedModel+Subclass.h | Tayphoon/TCCollections | b34f15dc24db6e4ef0b723d624ae6964b50984b2 | [
"MIT"
] | null | null | null | TCCollections/CoreData/TCTableViewController/Model/TCTableManagedModel+Subclass.h | Tayphoon/TCCollections | b34f15dc24db6e4ef0b723d624ae6964b50984b2 | [
"MIT"
] | null | null | null | //
// TCTableManagedModel+Subclass.h
// TCCollections
//
// Created by Tayphoon on 26.06.15.
// Copyright (c) 2015 Tayphoon. All rights reserved.
//
#import "TCTableManagedModel.h"
@interface TCTableManagedModel (Subclass)
- (void)reloadModelSourceControllerWithCompletion:(void (^)(NSError * error))completion;
- (void)modelWillChangeContent;
- (void)modelDidChangeSectionAtIndex:(NSUInteger)sectionIndex forChangeType:(NSInteger)type;
- (void)modelDidChangeObject:(id)anObject
atIndexPath:(NSIndexPath *)indexPath
forChangeType:(NSInteger)type
newIndexPath:(NSIndexPath *)newIndexPath;
- (void)modelDidChangeContent;
- (void)modelDidChanged;
@end
| 24.482759 | 92 | 0.728169 |
d911d5afffbd509752dad4571987c45db7b8797b | 7,792 | c | C | util/type_convert.c | b1v1r/ironbee | 97b453afd9c3dc70342c6183a875bde22c9c4a76 | [
"Apache-2.0"
] | 148 | 2015-01-10T01:53:39.000Z | 2022-03-20T20:48:12.000Z | util/type_convert.c | ErikHendriks/ironbee | 97b453afd9c3dc70342c6183a875bde22c9c4a76 | [
"Apache-2.0"
] | 8 | 2015-03-09T15:50:36.000Z | 2020-10-10T19:23:06.000Z | util/type_convert.c | ErikHendriks/ironbee | 97b453afd9c3dc70342c6183a875bde22c9c4a76 | [
"Apache-2.0"
] | 46 | 2015-03-08T22:45:42.000Z | 2022-01-15T13:47:59.000Z | /*****************************************************************************
* Licensed to Qualys, Inc. (QUALYS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* QUALYS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
****************************************************************************/
/**
* @file
* @brief IronBee --- Type conversion functions.
* @author Sam Baskinger <sbaskinger@qualys.com>
*/
#include "ironbee_config_auto.h"
#include <ironbee/type_convert.h>
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
/* Helper Functions. */
/**
* Get the number of digits in a number
*
* @param[in] num The number to operate on
*
* @returns Number of digits (including '-')
*/
static size_t ib_num_digits(int64_t num);
/**
* Get the size of a string buffer required to store a number
*
* @param[in] num The number to operate on
*
* @returns Required string length
*/
static size_t ib_num_buf_size(int64_t num);
static const int64_t P10_INT64_LIMIT = (INT64_MAX / 10);
static size_t ib_num_digits(int64_t num)
{
size_t n = 1;
int64_t po10;
if (num < 0) {
num = -num;
++n;
}
po10 = 10;
while (num >= po10) {
++n;
if (po10 > P10_INT64_LIMIT)
break;
po10 *= 10;
}
return n;
}
static size_t ib_num_buf_size(int64_t num)
{
size_t digits = ib_num_digits(num);
return digits + 1;
}
ib_status_t ib_type_atoi_ex(
const char *s,
size_t slen,
int base,
ib_num_t *result
)
{
assert(result != NULL);
char *buf;
ib_status_t rc;
/* Check for zero length string */
if ( (s == NULL) || (slen == 0) ) {
return IB_EINVAL;
}
buf = malloc(slen+1);
if (buf == NULL) {
return IB_EALLOC;
}
memcpy(buf, s, slen);
buf[slen] = '\0';
rc = ib_type_atoi(buf, base, result);
free(buf);
return rc;
}
ib_status_t ib_type_atoi(
const char *s,
int base,
ib_num_t *result
)
{
assert(result != NULL);
size_t slen;
char *end;
long int value;
size_t vlen;
/* Check for zero length string */
if ( (s == NULL) || (*s == '\0') ) {
return IB_EINVAL;
}
slen = strlen(s);
/* Do the conversion, check for errors */
value = strtol(s, &end, base);
vlen = (end - s);
if (vlen != slen) {
return IB_EINVAL;
}
else if ( ((value == LONG_MIN) || (value == LONG_MAX)) &&
(errno == ERANGE) )
{
return IB_EINVAL;
}
else {
*result = value;
return IB_OK;
}
}
ib_status_t ib_type_atot_ex(
const char *s,
size_t slen,
ib_time_t *result
)
{
assert(result != NULL);
ib_status_t rc;
char *buf;
/* Check for zero length string */
if ( (s == NULL) || (slen == 0) ) {
return IB_EINVAL;
}
buf = malloc(slen+1);
if (buf == NULL) {
return IB_EALLOC;
}
memcpy(buf, s, slen);
buf[slen] = '\0';
rc = ib_type_atot(buf, result);
free(buf);
return rc;
}
ib_status_t ib_type_atot(
const char *s,
ib_time_t *result
)
{
assert(result != NULL);
size_t slen;
char *end;
unsigned long int value;
size_t vlen;
/* Check for zero length string */
if ( (s == NULL) || (*s == '\0') ) {
return IB_EINVAL;
}
slen = strlen(s);
/* Do the conversion, check for errors */
value = strtoul(s, &end, 0);
vlen = (end - s);
if (vlen != slen) {
return IB_EINVAL;
}
else if ( (value == ULONG_MAX) && (errno == ERANGE) )
{
return IB_EINVAL;
}
else {
*result = value;
return IB_OK;
}
}
ib_status_t ib_type_atof_ex(
const char *s,
size_t slen,
ib_float_t *result
)
{
assert(result != NULL);
ib_status_t rc;
/* Check for zero length string */
if ( (s == NULL) || (*s == '\0') ) {
return IB_EINVAL;
}
char *sdup = strndup(s, slen);
if ( ! sdup ) {
return IB_EALLOC;
}
/* In this case the _ex function calls out to the no-length function. */
rc = ib_type_atof(sdup, result);
free(sdup);
return rc;
}
ib_status_t ib_type_atof(const char *s, ib_float_t *result)
{
assert(result != NULL);
char *endptr;
const char *send;
ib_float_t val;
size_t len;
*result = 0.0;
/* Check for zero length string */
if ( (s == NULL) || (*s == '\0') ) {
return IB_EINVAL;
}
/* Get the length */
len = strlen(s);
send = s + len;
errno = 0;
val = strtold(s, &endptr);
/* Conversion failed */
if (endptr != send) {
return IB_EINVAL;
}
/* Check for Underflow would occur. */
if ( (val == 0.0) && (errno == ERANGE) ) {
return IB_EINVAL;
}
/* Overflow would occur. */
if ( ((val == HUGE_VALL) || (val == -HUGE_VALL)) && (errno == ERANGE)) {
return IB_EINVAL;
}
*result = val;
return IB_OK;
}
const char *ib_type_itoa(
ib_mm_t mm,
int64_t value
) {
size_t size = ib_num_buf_size(value);
char *buf = ib_mm_alloc(mm, size);
if (buf != NULL) {
snprintf(buf, size, "%"PRId64, value);
}
return buf;
}
const char *ib_type_ttoa(ib_mm_t mm, ib_time_t value)
{
size_t size = ib_num_buf_size(value);
char *buf = ib_mm_alloc(mm, size);
if (buf != NULL) {
snprintf(buf, size, "%"PRIu64, value);
}
return buf;
}
const char *ib_type_ftoa(
ib_mm_t mm,
long double value
) {
char *buf = ib_mm_alloc(mm, 10);
if (buf != NULL) {
snprintf(buf, 10, "%Lf", value);
}
return buf;
}
/**
* Hexadecimal character to value.
*
* Convert the input character to the byte value represented by
* its hexadecimal value. The input of 'F' results in the
* character 15 being returned. If a character is not
* submitted that is hexadecimal, then -1 is returned.
*
* @param[in] a the input character to be converted. A-F, a-f, or 0-9.
* @returns The byte value of the passed in hexadecimal character or -1 on
* failure.
*/
static inline int hexchar_to_byte(char a)
{
switch(a) {
case '0': return 0;
case '1': return 1;
case '2': return 2;
case '3': return 3;
case '4': return 4;
case '5': return 5;
case '6': return 6;
case '7': return 7;
case '8': return 8;
case '9': return 9;
case 'a':
case 'A': return 10;
case 'b':
case 'B': return 11;
case 'c':
case 'C': return 12;
case 'd':
case 'D': return 13;
case 'e':
case 'E': return 14;
case 'f':
case 'F': return 15;
default:
return -1;
}
}
/**
* Take two hex characters and convert them into a single byte.
*
* @param[in] high high order byte.
* @param[in] low low order byte.
*
* @returns high and low combined into a single byte or a negative value
* on error.
*/
int ib_type_htoa(char high, char low)
{
return hexchar_to_byte(high) << 4 | hexchar_to_byte(low);
}
| 20.834225 | 78 | 0.56481 |
d911fd38a89e2f20def7204b420a2386f9c409af | 410 | h | C | projects/P-Type/entities/Player.h | bl-ackrain/FemtoIDE | df642c39abb1a45b71ce1d7ce5abc1388879345a | [
"MIT"
] | 18 | 2019-04-28T12:25:47.000Z | 2022-01-24T22:36:45.000Z | projects/P-Type/entities/Player.h | bl-ackrain/FemtoIDE | df642c39abb1a45b71ce1d7ce5abc1388879345a | [
"MIT"
] | 97 | 2019-05-11T14:40:27.000Z | 2021-09-15T12:20:30.000Z | projects/P-Type/entities/Player.h | bl-ackrain/FemtoIDE | df642c39abb1a45b71ce1d7ce5abc1388879345a | [
"MIT"
] | 12 | 2019-05-04T21:26:44.000Z | 2020-12-12T07:24:02.000Z | #pragma once
class Player : public Entity {
int ticksSinceFire;
int HP;
int moveSpeed;
int fireDelay;
int fireSpeed;
int bulletDmg;
int bulletX;
int bulletY;
BulletSprite::Animation bulletAnim;
void move();
void fire();
public:
Player();
void update(int32_t cameraX, int32_t cameraY) override;
void hit(int damage);
int getHP(){ return HP; }
};
| 16.4 | 59 | 0.634146 |
d912619a8da29879cfe8cd3a2ac865de87938ddd | 609 | h | C | Compositors/Selector.h | devildevilson/tiny_behaviour | a85b422d543b5b2740fca644257d90666401688e | [
"MIT"
] | 1 | 2019-06-20T08:50:54.000Z | 2019-06-20T08:50:54.000Z | Compositors/Selector.h | devildevilson/tiny_behaviour | a85b422d543b5b2740fca644257d90666401688e | [
"MIT"
] | 1 | 2019-06-22T20:43:36.000Z | 2019-06-26T09:32:12.000Z | Compositors/Selector.h | devildevilson/tiny_behaviour | a85b422d543b5b2740fca644257d90666401688e | [
"MIT"
] | null | null | null | #ifndef SELECTOR_H
#define SELECTOR_H
#include "../Compositor.h"
namespace tb {
class Selector : public Compositor {
public:
Selector() : Compositor() {}
~Selector() {}
status update(void* const& data = nullptr, Node** runningPtr = nullptr) override {
status s;
if (!hasChildren()) {
s = status::success;
return s;
}
for (size_t index = 0; index < children.size(); index++) {
s = children[index]->update(data, runningPtr);
if (s != status::failure) return s;
}
s = status::failure;
return s;
}
};
}
#endif
| 19.03125 | 86 | 0.56486 |
d91462d555a06dce8f4572166f994a46e545c81d | 1,362 | c | C | libftprintf/libft/str/ft_strequ.c | Travmatth/21sh | 721dc139aa8d3ad88dd08e85f59786ecc0146283 | [
"MIT"
] | null | null | null | libftprintf/libft/str/ft_strequ.c | Travmatth/21sh | 721dc139aa8d3ad88dd08e85f59786ecc0146283 | [
"MIT"
] | 74 | 2019-03-06T21:41:50.000Z | 2020-12-17T02:56:09.000Z | libftprintf/libft/str/ft_strequ.c | Travmatth/21sh | 721dc139aa8d3ad88dd08e85f59786ecc0146283 | [
"MIT"
] | null | null | null | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strequ.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmatthew <tmatthew@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/17 15:09:01 by tmatthew #+# #+# */
/* Updated: 2018/05/19 18:29:41 by tmatthew ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
/*
** ft_strequ
** Description Lexicographical comparison between s1 and s2. If the 2
** strings are identical the function returns 1, or 0 otherwise.
** Param. #1 The first string to be compared.
** Param. #2 The second string to be compared.
** Return value 1 or 0 according to if the 2 strings are identical or not.
** Libc functions None.
*/
int ft_strequ(char const *s1, char const *s2)
{
return (s1 && s2) ? ft_strcmp(s1, s2) == 0 : 0;
}
| 46.965517 | 80 | 0.314244 |
d914642ae98b68c50bdb07da48afb034ba719651 | 225 | h | C | modules/mojo3d/scene/native/collisiondetect.h | DrCox85/monkey2Ex | 5f19ad01a200b9259a16371c3a37cc2cf6a92c95 | [
"Zlib"
] | 140 | 2016-03-13T03:01:25.000Z | 2022-02-06T09:47:04.000Z | modules/mojo3d/scene/native/collisiondetect.h | DrCox85/monkey2Ex | 5f19ad01a200b9259a16371c3a37cc2cf6a92c95 | [
"Zlib"
] | 469 | 2016-05-15T07:01:56.000Z | 2020-05-29T23:58:59.000Z | modules/mojo3d/scene/native/collisiondetect.h | DrCox85/monkey2Ex | 5f19ad01a200b9259a16371c3a37cc2cf6a92c95 | [
"Zlib"
] | 72 | 2016-03-13T10:17:54.000Z | 2020-02-24T05:40:02.000Z |
#ifndef BB_COLLISIONDETECT_H
#define BB_COLLISIONDETECT_H
#include "btBulletDynamicsCommon.h"
void initCollisions( btDynamicsWorld *world );
void resetCollisions();
int getNumCollisions();
void **getCollisions();
#endif
| 17.307692 | 46 | 0.8 |
d9146674464b57aeeaaa6ceb40abd2e872e0ef24 | 2,064 | h | C | src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h | jorisvergeer/dotnet-runtime | 3ddf67b48eff8912f4d44c295f451d79edc4c1b1 | [
"MIT"
] | 3 | 2021-05-30T13:07:31.000Z | 2022-03-25T08:37:19.000Z | src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h | jorisvergeer/dotnet-runtime | 3ddf67b48eff8912f4d44c295f451d79edc4c1b1 | [
"MIT"
] | 1 | 2021-11-23T11:04:19.000Z | 2021-12-21T06:41:19.000Z | src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h | jorisvergeer/dotnet-runtime | 3ddf67b48eff8912f4d44c295f451d79edc4c1b1 | [
"MIT"
] | 4 | 2021-05-27T08:39:33.000Z | 2021-06-24T09:17:05.000Z | //
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
//----------------------------------------------------------
// crlwmlist.h - List of all LightWeightMap in CompileResult.
// To use, #define LWM(map, key, value) to something.
// If you need to distinguish DenseLightWeightMap, #define DENSELWM(map, value) as well.
//----------------------------------------------------------
#ifndef LWM
#error Define LWM before including this file.
#endif
// If the key is needed, then DENSELWM must be defined.
#ifndef DENSELWM
#define DENSELWM(map, value) LWM(map, this_is_an_error, value)
#endif
LWM(AddressMap, DWORDLONG, CompileResult::Agnostic_AddressMap)
LWM(AllocGCInfo, DWORD, CompileResult::Agnostic_AllocGCInfo)
LWM(AllocMem, DWORD, CompileResult::Agnostic_AllocMemDetails)
DENSELWM(AllocUnwindInfo, CompileResult::Agnostic_AllocUnwindInfo)
DENSELWM(AssertLog, DWORD)
DENSELWM(CallLog, DWORD)
DENSELWM(ClassMustBeLoadedBeforeCodeIsRun, DWORDLONG)
LWM(CompileMethod, DWORD, CompileResult::Agnostic_CompileMethodResults)
DENSELWM(MessageLog, DWORD)
DENSELWM(MethodMustBeLoadedBeforeCodeIsRun, DWORDLONG)
DENSELWM(ProcessName, DWORD)
LWM(RecordCallSiteWithSignature, DWORD, CompileResult::Agnostic_RecordCallSite)
LWM(RecordCallSiteWithoutSignature, DWORD, DWORDLONG)
DENSELWM(RecordRelocation, CompileResult::Agnostic_RecordRelocation)
DENSELWM(ReportFatalError, DWORD)
DENSELWM(ReportInliningDecision, CompileResult::Agnostic_ReportInliningDecision)
DENSELWM(ReportTailCallDecision, CompileResult::Agnostic_ReportTailCallDecision)
DENSELWM(ReserveUnwindInfo, CompileResult::Agnostic_ReserveUnwindInfo)
LWM(SetBoundaries, DWORD, CompileResult::Agnostic_SetBoundaries)
LWM(SetEHcount, DWORD, DWORD)
LWM(SetEHinfo, DWORD, CompileResult::Agnostic_CORINFO_EH_CLAUSE2)
LWM(SetMethodAttribs, DWORDLONG, DWORD)
LWM(SetVars, DWORD, CompileResult::Agnostic_SetVars)
LWM(SetPatchpointInfo, DWORD, CompileResult::Agnostic_SetPatchpointInfo)
#undef LWM
#undef DENSELWM
| 43 | 101 | 0.784399 |
d9146771eedee9280615e444a02ce4fb0f584b22 | 12,802 | h | C | LiteOS/targets/bsp/drivers/APM32F10x_StdPeriphDriver/inc/apm32f10x_usb.h | lambda666/liteos_in_raspberry_ubuntu20 | ca716a3d22796dc20f1bafaf548167752546e02f | [
"Apache-2.0"
] | null | null | null | LiteOS/targets/bsp/drivers/APM32F10x_StdPeriphDriver/inc/apm32f10x_usb.h | lambda666/liteos_in_raspberry_ubuntu20 | ca716a3d22796dc20f1bafaf548167752546e02f | [
"Apache-2.0"
] | null | null | null | LiteOS/targets/bsp/drivers/APM32F10x_StdPeriphDriver/inc/apm32f10x_usb.h | lambda666/liteos_in_raspberry_ubuntu20 | ca716a3d22796dc20f1bafaf548167752546e02f | [
"Apache-2.0"
] | null | null | null | /*!
* @file apm32f10x_usb.h
*
* @brief This file contains all the prototypes,enumeration and macros for USBD peripheral
*
* @version V1.0.1
*
* @date 2021-03-23
*
*/
#ifndef __APM32F10X_USBD_H_
#define __APM32F10X_USBD_H_
#include "apm32f10x.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup Peripherals_Library Standard Peripheral Library
@{
*/
/** @addtogroup USBD_Driver USBD Driver
@{
*/
/** @addtogroup USBD_Enumerations Enumerations
@{
*/
/**
* @brief USBD Endpoint register bit definition
*/
typedef enum
{
USBD_EP_BIT_ADDR = (uint32_t)(BIT0 | BIT1 | BIT2 | BIT3),
USBD_EP_BIT_TXSTS = (uint32_t)(BIT4 | BIT5),
USBD_EP_BIT_TXDTOG = (uint32_t)(BIT6),
USBD_EP_BIT_CTFT = (uint32_t)(BIT7),
USBD_EP_BIT_KIND = (uint32_t)(BIT8),
USBD_EP_BIT_TYPE = (uint32_t)(BIT9 | BIT10),
USBD_EP_BIT_SETUP = (uint32_t)(BIT11),
USBD_EP_BIT_RXSTS = (uint32_t)(BIT12 | BIT13),
USBD_EP_BIT_RXDTOG = (uint32_t)(BIT14),
USBD_EP_BIT_CTFR = (uint32_t)(BIT15)
}USBD_EP_BIT_T;
/**
* @brief Endpoint id
*/
typedef enum
{
USBD_EP_0,
USBD_EP_1,
USBD_EP_2,
USBD_EP_3,
USBD_EP_4,
USBD_EP_5,
USBD_EP_6,
USBD_EP_7,
}USBD_EP_T;
/**
* @brief Endpoint status
*/
typedef enum
{
USBD_EP_STATUS_DISABLE = ((uint32_t)0),
USBD_EP_STATUS_STALL = ((uint32_t)1),
USBD_EP_STATUS_NAK = ((uint32_t)2),
USBD_EP_STATUS_VALID = ((uint32_t)3),
}USBD_EP_STATUS_T;
/**
* @brief USBD Endpoint type
*/
typedef enum
{
USBD_EP_TYPE_BULK,
USBD_EP_TYPE_CONTROL,
USBD_EP_TYPE_ISO,
USBD_EP_TYPE_INTERRUPT
}USBD_EP_TYPE_T;
/**@} end of group USBD_Enumerations*/
/** @addtogroup USBD_Macros Macros
@{
*/
/** USBD packet memory area base address */
#define USBD_PMA_ADDR (0x40006000L)
/** Endpoint register mask value default */
#define USBD_EP_MASK_DEFAULT (USBD_EP_BIT_CTFR | USBD_EP_BIT_SETUP | USBD_EP_BIT_TYPE | USBD_EP_BIT_KIND | USBD_EP_BIT_CTFT |USBD_EP_BIT_ADDR)
/**
* @brief USBD interrupt source
*/
#define USBD_INT_ESOF 0X100
#define USBD_INT_SOF 0X200
#define USBD_INT_RST 0X400
#define USBD_INT_SUS 0x800
#define USBD_INT_WKUP 0X1000
#define USBD_INT_ERR 0X2000
#define USBD_INT_PMAOU 0X4000
#define USBD_INT_CTR 0X8000
#define USBD_INT_ALL 0XFF00
/**@} end of group USBD_Macros*/
/** @addtogroup USBD_Fuctions Fuctions
@{
*/
/*!
* @brief Set CTRL register
*
* @param val: Register value
*
* @retval None
*
*/
#define USBD_SetRegCTRL(val) (USBD->CTRL = val)
/*!
* @brief Set INTSTS register
*
* @param val: Register value
*
* @retval None
*/
#define USBD_SetRegINTSTS(val) (USBD->INTSTS = val)
/*!
* @brief Set force reset
*
* @param None
*
* @retval None
*/
#define USBD_SetForceReset() (USBD->CTRL_B.FORRST = BIT_SET)
/*!
* @brief Reset force reset
*
* @param None
*
* @retval None
*/
#define USBD_ResetForceReset() (USBD->CTRL_B.FORRST = BIT_RESET)
/*!
* @brief Set power down
*
* @param None
*
* @retval None
*/
#define USBD_SetPowerDown() (USBD->CTRL_B.PWRDOWN = BIT_SET)
/*!
* @brief Reset power down
*
* @param None
*
* @retval None
*/
#define USBD_ResetPowerDown() (USBD->CTRL_B.PWRDOWN = BIT_RESET)
/*!
* @brief Set low power mode
*
* @param None
*
* @retval None
*/
#define USBD_SetLowerPowerMode() (USBD->CTRL_B.LPWREN = BIT_SET)
/*!
* @brief Ret low power mode
*
* @param None
*
* @retval None
*/
#define USBD_ResetLowerPowerMode() (USBD->CTRL_B.LPWREN = BIT_RESET)
/*!
* @brief Set force suspend
*
* @param None
*
* @retval None
*/
#define USBD_SetForceSuspend() (USBD->CTRL_B.FORSUS = BIT_SET)
/*!
* @brief Reset force suspend
*
* @param None
*
* @retval None
*/
#define USBD_ResetForceSuspend() (USBD->CTRL_B.FORSUS = BIT_RESET)
/*!
* @brief Read force suspend status
*
* @param None
*
* @retval None
*/
#define USBD_ReadForceSuspend() (USBD->CTRL_B.FORSUS)
/*!
* @brief Set resume
*
* @param None
*
* @retval None
*/
#define USBD_SetResume() (USBD->CTRL_B.WUPREQ = BIT_SET)
/*!
* @brief Reset resume
*
* @param None
*
* @retval None
*/
#define USBD_ResetResume() (USBD->CTRL_B.WUPREQ = BIT_RESET)
/*!
* @brief Enable interrupt
*
* @param int: Interrupt source
*
* @retval None
*/
#define USBD_EnableInterrupt(int) (USBD->CTRL |= int)
/*!
* @brief Disable interrupt
*
* @param int: Interrupt source
*
* @retval None
*/
#define USBD_DisableInterrupt(int) (USBD->CTRL &= (uint32_t)~int)
/*!
* @brief Read the specified interrupt flag status
*
* @param int: Interrupt source
*
* @retval Flag status.0 or not 0
*/
#define USBD_ReadIntFlag(int) (USBD->INTSTS & int)
/*!
* @brief Clear the specified interrupt flag status
*
* @param int: Interrupt source
*
* @retval None
*/
#define USBD_ClearIntFlag(int) (USBD->INTSTS &= (uint32_t)~int)
/*!
* @brief Read DOT field value in INTSTS rigister
*
* @param None
*
* @retval DOT field value
*/
#define USBD_ReadDir() (USBD->INTSTS_B.DOT)
/*!
* @brief Read EPID field value in INTSTS rigister
*
* @param None
*
* @retval EPIDfield value
*/
#define USBD_ReadEP() ((USBD_EP_T)(USBD->INTSTS_B.EPID))
/*!
* @brief Read EP type
*
* @param ep: EP number
*
* @retval EP type
*/
#define USBD_ReadEPType(ep) (USBD->EP[ep].EP_B.TYPE)
/*!
* @brief Read EP Tx status
*
* @param ep: EP number
*
* @retval EP Tx status
*/
#define USBD_ReadEPTxStatus(ep) ((USBD_EP_STATUS_T)(USBD->EP[ep].EP_B.TXSTS))
/*!
* @brief Read EP Rx status
*
* @param ep: EP number
*
* @retval EP Rx status
*/
#define USBD_ReadEPRxStatus(ep) ((USBD_EP_STATUS_T)(USBD->EP[ep].EP_B.RXSTS))
/*!
* @brief Read EP Tx address pointer
*
* @param ep: EP number
*
* @retval EP Tx address pointer
*/
#define USBD_ReadEPTxAddrPointer(ep) (uint32_t *)((USBD->BUFFTB + ep * 8) * 2 + USBD_PMA_ADDR)
/*!
* @brief Read EP Tx count pointer
*
* @param ep: EP number
*
* @retval EP Tx count pointer
*/
#define USBD_ReadEPTxCntPointer(ep) (uint32_t *)((USBD->BUFFTB + ep * 8 + 2) * 2 + USBD_PMA_ADDR)
/*!
* @brief Read EP Rx address pointer
*
* @param ep: EP number
*
* @retval EP Rx address pointer
*/
#define USBD_ReadEPRxAddrPointer(ep) (uint32_t *)((USBD->BUFFTB + ep * 8 + 4) * 2 + USBD_PMA_ADDR)
/*!
* @brief Read EP Rx count pointer
*
* @param ep: EP number
*
* @retval EP Rx count pointer
*/
#define USBD_ReadEPRxCntPointer(ep) (uint32_t *)((USBD->BUFFTB + ep * 8 + 6) * 2 + USBD_PMA_ADDR)
/*!
* @brief Set EP Tx addr
*
* @param ep: EP number
*
* @param addr: Tx addr
*
* @retval None
*/
#define USBD_SetEPTxAddr(ep, addr) (*USBD_ReadEPTxAddrPointer(ep) = (addr >> 1) << 1)
/*!
* @brief Set EP Rx addr
*
* @param ep: EP number
*
* @param addr: Rx addr
*
* @retval None
*/
#define USBD_SetEPRxAddr(ep, addr) (*USBD_ReadEPRxAddrPointer(ep) = (addr >> 1) << 1)
/*!
* @brief Read EP Tx addr
*
* @param ep: EP number
*
* @retval EP Tx addr
*/
#define USBD_ReadEPTxAddr(ep) ((uint16_t)*USBD_ReadEPTxAddrPointer(ep))
/*!
* @brief Read EP Rx addr
*
* @param ep: EP number
*
* @retval EP Rx addr
*/
#define USBD_ReadEPRxAddr(ep) ((uint16_t)*USBD_ReadEPRxAddrPointer(ep))
/*!
* @brief Set EP Rx Count
*
* @param ep: EP number
*
* @param cnt: Tx count
*
* @retval None
*/
#define USBD_SetEPTxCnt(ep, cnt) (*USBD_ReadEPTxCntPointer(ep) = cnt)
/*!
* @brief Read EP Tx count
*
* @param ep: EP number
*
* @retval EP Tx count
*/
#define USBD_ReadEPTxCnt(ep) ((uint16_t)*USBD_ReadEPTxCntPointer(ep) & 0x3ff)
/*!
* @brief Read EP Rx count
*
* @param ep: EP number
*
* @retval EP Rx count
*/
#define USBD_ReadEPRxCnt(ep) ((uint16_t)*USBD_ReadEPRxCntPointer(ep) & 0x3ff)
/*!
* @brief Read SETUP field value in EP register
*
* @param ep: EP number
*
* @retval SETUP field value
*/
#define USBD_ReadEPSetup(ep) (USBD->EP[ep].EP_B.SETUP)
/*!
* @brief Set buffer table value
*
* @param tab: Buffer table value
*
* @retval None
*/
#define USBD_SetBufferTable(tab) (USBD->BUFFTB_B.BUFFTB = tab)
/*!
* @brief Set device address
*
* @param addr: Device address
*
* @retval None
*/
#define USBD_SetDeviceAddr(addr) (USBD->ADDR_B.ADDR = addr)
/*!
* @brief Read CTFR field value in EP register
*
* @param ep: Endpoint number
*
* @retval CTFR field value
*/
#define USBD_ReadEPRxFlag(ep) (USBD->EP[ep].EP_B.CTFR)
/*!
* @brief Read CTFT field value in EP register
*
* @param ep: Endpoint number
*
* @retval CTFT field value
*/
#define USBD_ReadEPTxFlag(ep) (USBD->EP[ep].EP_B.CTFT)
/*!
* @brief Enable USBD peripheral
*
* @param None
*
* @retval None
*/
#define USBD_Enable() (USBD->ADDR_B.USBDEN = BIT_SET)
/*!
* @brief Disable USBD peripheral
*
* @param None
*
* @retval None
*/
#define USBD_Disable() (USBD->ADDR_B.USBDEN = BIT_RESET)
/*!
* @brief Enable USBD2 peripheral
*
* @param None
*
* @retval None
*/
#define USBD2_Enable() (USBD->SWITCH = BIT_SET)
/*!
* @brief Disable USBD2 peripheral
*
* @param None
*
* @retval None
*/
#define USBD2_Disable() (USBD->SWITCH = BIT_RESET)
/*!
* @brief Read RXDPSTS field value in FRANUM register
*
* @param None
*
* @retval RXDPSTS field value
*/
#define USBD_ReadRDPS() (USBD->FRANUM_B.RXDPSTS)
/*!
* @brief Read RXDMSTS field value in FRANUM register
*
* @param None
*
* @retval RXDMSTS field value
*/
#define USBD_ReadRDMS() (USBD->FRANUM_B.RXDMSTS)
/*!
* @brief Read LOCK field value in FRANUM register
*
* @param None
*
* @retval LOCK field value
*/
#define USBD_ReadLOCK() (USBD->FRANUM_B.LOCK)
/*!
* @brief Read LSOFNUM field value in FRANUM register
*
* @param None
*
* @retval LSOFNUM field value
*/
#define USBD_ReadLSOF() (USBD->FRANUM_B.LSOFNUM)
/*!
* @brief Read FRANUM field value in FRANUM register
*
* @param None
*
* @retval FRANUM field value
*/
#define USBD_ReadFRANUM() (USBD->FRANUM_B.FRANUM)
void USBD_SetEPType(USBD_EP_T ep, USBD_EP_TYPE_T type);
void USBD_SetEPKind(USBD_EP_T ep);
void USBD_ResetEPKind(USBD_EP_T ep);
void USBD_ResetEPRxFlag(USBD_EP_T ep);
void USBD_ResetEPTxFlag(USBD_EP_T ep);
void USBD_ToggleTx(USBD_EP_T ep);
void USBD_ToggleRx(USBD_EP_T ep);
void USBD_ResetTxToggle(USBD_EP_T ep);
void USBD_ResetRxToggle(USBD_EP_T ep);
void USBD_SetEpAddr(USBD_EP_T ep, uint8_t addr);
void USBD_SetEPTxStatus(USBD_EP_T ep, USBD_EP_STATUS_T status);
void USBD_SetEPRxStatus(USBD_EP_T ep, USBD_EP_STATUS_T status);
void USBD_SetEPRxTxStatus(USBD_EP_T ep, USBD_EP_STATUS_T txStatus, USBD_EP_STATUS_T rxStatus);
void USBD_SetEPRxCnt(USBD_EP_T ep, uint32_t cnt);
void USBD_WriteDataToEP(USBD_EP_T ep, uint8_t *wBuf, uint32_t wLen);
void USBD_ReadDataFromEP(USBD_EP_T ep, uint8_t *rBuf, uint32_t rLen);
/**@} end of group USBD_Fuctions*/
/**@} end of group USBD_Driver*/
/**@} end of group Peripherals_Library*/
#ifdef __cplusplus
}
#endif
#endif /* __APM32F10X_USBD_H */
| 21.958834 | 147 | 0.569364 |
d914a908d94762a7ce8931edeef6b75b51a68399 | 323 | h | C | example/RNBottomViewController.h | rnystrom/RNSwipeViewController | 87d18eb96638214ac99fd71e0bbb2e1b8f889562 | [
"MIT"
] | 43 | 2015-01-09T04:03:38.000Z | 2021-06-03T18:54:33.000Z | example/RNBottomViewController.h | rnystrom/RNSwipeViewController | 87d18eb96638214ac99fd71e0bbb2e1b8f889562 | [
"MIT"
] | null | null | null | example/RNBottomViewController.h | rnystrom/RNSwipeViewController | 87d18eb96638214ac99fd71e0bbb2e1b8f889562 | [
"MIT"
] | 18 | 2015-01-09T17:44:57.000Z | 2016-10-10T02:22:31.000Z | //
// RNBottomViewController.h
// RNSwipeViewController
//
// Created by Ryan Nystrom on 2/22/13.
// Copyright (c) 2013 Ryan Nystrom. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RNRevealViewControllerProtocol.h"
@interface RNBottomViewController : UIViewController
<RNRevealViewControllerProtocol>
@end
| 20.1875 | 57 | 0.764706 |
d91591ddcd65dc8f5c0d84c283c585d6711d9eb9 | 66,678 | c | C | release/src-rt-6.x.4708/router/shared/defaults.c | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 4 | 2017-05-17T11:27:04.000Z | 2020-05-24T07:23:26.000Z | release/src-rt-6.x.4708/router/shared/defaults.c | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 1 | 2018-08-21T03:43:09.000Z | 2018-08-21T03:43:09.000Z | release/src-rt-6.x.4708/router/shared/defaults.c | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 5 | 2017-10-11T08:09:11.000Z | 2020-10-14T04:10:13.000Z | #include <epivers.h>
#include <typedefs.h>
#include <string.h>
#include <ctype.h>
#include <bcmnvram.h>
#include <wlioctl.h>
#include <stdio.h>
#include <shared.h>
//#include <version.h>
#include <shutils.h>
#define XSTR(s) STR(s)
#define STR(s) #s
#include <tomato_config.h>
#include "tomato_profile.h"
//! = see restore_main()
struct nvram_tuple router_defaults[] = {
{ "restore_defaults", "0" , 0 }, // Set to 0 to not restore defaults on boot
// LAN H/W parameters
{ "lan_hwnames", "" , 0 }, // LAN driver names (e.g. et0)
{ "lan_hwaddr", "" , 0 }, // LAN interface MAC address
// LAN TCP/IP parameters
{ "lan_dhcp", "0" , 0 }, // DHCP client [static|dhcp]
{ "lan_proto", "dhcp" , 0 }, // DHCP server [static|dhcp] //Barry add 2004 09 16
{ "lan_ipaddr", "192.168.1.1" , 0 }, // LAN IP address
{ "lan_netmask", "255.255.255.0" , 0 }, // LAN netmask
{ "lan_wins", "" , 0 }, // x.x.x.x x.x.x.x ...
{ "lan_domain", "" , 0 }, // LAN domain name
{ "lan_lease", "86400" , 0 }, // LAN lease time in seconds
{ "lan_stp", "0" , 0 }, // LAN spanning tree protocol
{ "lan_route", "" , 0 }, // Static routes (ipaddr:netmask:gateway:metric:ifname ...)
{ "lan_gateway", "0.0.0.0" , 0 }, // LAN Gateway
{ "wl_wds_enable", "0" , 0 }, // WDS Enable (0|1)
{ "lan_state", "1" , 0 }, // Show Ethernet LAN ports state (0|1)
{ "lan_desc", "1" , 0 }, // Show Ethernet LAN ports state (0|1)
{ "lan_invert", "0" , 0 }, // Invert Ethernet LAN ports state (0|1)
{ "lan1_ipaddr", "" , 0 },
{ "lan1_netmask", "" , 0 },
{ "lan1_stp", "0" , 0 },
{ "lan2_ipaddr", "" , 0 },
{ "lan2_netmask", "" , 0 },
{ "lan2_stp", "0" , 0 },
{ "lan3_ipaddr", "" , 0 },
{ "lan3_netmask", "" , 0 },
{ "lan3_stp", "0" , 0 },
{ "mwan_num", "1" , 0 },
{ "mwan_init", "0" , 0 },
{ "mwan_cktime", "0" , 0 },
{ "mwan_ckdst", "google.com,microsoft.com" , 0 }, // target1,target2
{ "mwan_debug", "0" , 0 },
{ "pbr_rules", "" , 0 },
// WAN H/W parameters
{ "wan_hwname", "" , 0 }, // WAN driver name (e.g. et1)
{ "wan_hwaddr", "" , 0 }, // WAN interface MAC address
{ "wan_ifnameX", NULL , 0 }, // real wan if; see wan.c:start_wan
// WAN TCP/IP parameters
{ "wan_proto", "dhcp" , 0 }, // [static|dhcp|pppoe|disabled]
{ "wan_ipaddr", "0.0.0.0" , 0 }, // WAN IP address
{ "wan_netmask", "0.0.0.0" , 0 }, // WAN netmask
{ "wan_gateway", "0.0.0.0" , 0 }, // WAN gateway
{ "wan_gateway_get", "0.0.0.0" , 0 }, // default gateway for PPP
{ "wan_dns", "" , 0 }, // x.x.x.x x.x.x.x ...
{ "wan_weight", "1" , 0 },
{ "wan_ckmtd", "2" , 0 },
{ "wan2_proto", "dhcp" , 0 }, // [static|dhcp|pppoe|disabled]
{ "wan2_ipaddr", "0.0.0.0" , 0 }, // WAN IP address
{ "wan2_netmask", "0.0.0.0" , 0 }, // WAN netmask
{ "wan2_gateway", "0.0.0.0" , 0 }, // WAN gateway
{ "wan2_dns", "" , 0 }, // x.x.x.x x.x.x.x ...
{ "wan2_weight", "1" , 0 },
{ "wan2_hwname", "" , 0 }, // WAN driver name (e.g. et1)
{ "wan2_hwaddr", "" , 0 }, // WAN interface MAC address
{ "wan2_ifnameX", NULL , 0 }, // real wan if; see wan.c:start_wan
{ "wan2_ckmtd", "2" , 0 },
#ifdef TCONFIG_MULTIWAN
{ "wan3_proto", "dhcp" , 0 }, // [static|dhcp|pppoe|disabled]
{ "wan3_ipaddr", "0.0.0.0" , 0 }, // WAN IP address
{ "wan3_netmask", "0.0.0.0" , 0 }, // WAN netmask
{ "wan3_gateway", "0.0.0.0" , 0 }, // WAN gateway
{ "wan3_dns", "" , 0 }, // x.x.x.x x.x.x.x ...
{ "wan3_weight", "1" , 0 },
{ "wan3_hwname", "" , 0 }, // WAN driver name (e.g. et1)
{ "wan3_hwaddr", "" , 0 }, // WAN interface MAC address
{ "wan3_ifnameX", NULL , 0 }, // real wan if; see wan.c:start_wan
{ "wan3_ckmtd", "2" , 0 },
{ "wan4_proto", "dhcp" , 0 }, // [static|dhcp|pppoe|disabled]
{ "wan4_ipaddr", "0.0.0.0" , 0 }, // WAN IP address
{ "wan4_netmask", "0.0.0.0" , 0 }, // WAN netmask
{ "wan4_gateway", "0.0.0.0" , 0 }, // WAN gateway
{ "wan4_dns", "" , 0 }, // x.x.x.x x.x.x.x ...
{ "wan4_weight", "1" , 0 },
{ "wan4_hwname" "" , 0 }, // WAN driver name (e.g. et1)
{ "wan4_hwaddr", "" , 0 }, // WAN interface MAC address
{ "wan4_ifnameX", NULL , 0 }, // real wan if; see wan.c:start_wan
{ "wan4_ckmtd", "2" , 0 },
#endif
#ifdef TCONFIG_DNSSEC
{ "dnssec_enable", "0" , 0 },
#endif
#ifdef TCONFIG_DNSCRYPT
{ "dnscrypt_proxy", "0" , 0 },
{ "dnscrypt_priority", "1" , 0 }, // 0=none, 1=strict-order, 2=no-resolv
{ "dnscrypt_port", "40" , 0 }, // local port
{ "dnscrypt_resolver", "opendns" , 0 }, // default resolver
{ "dnscrypt_log", "99" , 0 }, // log level
{ "dnscrypt_manual", "0" , 0 }, // Set manual resolver
{ "dnscrypt_provider_name", "" , 0 }, // Set manual provider name
{ "dnscrypt_provider_key", "" , 0 }, // Set manual provider key
{ "dnscrypt_resolver_address", "" , 0 }, // Set manual resolver address
#endif
{ "wan_wins", "" , 0 }, // x.x.x.x x.x.x.x ...
{ "wan_lease", "86400" , 0 }, // WAN lease time in seconds
{ "wan_islan", "0" , 0 },
{ "wan_modem_ipaddr", "0.0.0.0" , 0 }, // modem IP address (i.e. PPPoE bridged modem)
{ "wan_primary", "1" , 0 }, // Primary wan connection
{ "wan_unit", "0" , 0 }, // Last configured connection
{ "wan2_islan", "0" , 0 },
{ "wan2_modem_ipaddr", "0.0.0.0" , 0 }, // modem IP address (i.e. PPPoE bridged modem)
#ifdef TCONFIG_MULTIWAN
{ "wan3_islan", "0" , 0 },
{ "wan3_modem_ipaddr", "0.0.0.0" , 0 }, // modem IP address (i.e. PPPoE bridged modem)
{ "wan4_islan", "0" , 0 },
{ "wan4_modem_ipaddr", "0.0.0.0" , 0 }, // modem IP address (i.e. PPPoE bridged modem)
#endif
// DHCP server parameters
{ "dhcp_start", "2" , 0 }, //
{ "dhcp_num", "50" , 0 }, //
{ "dhcpd_startip", "" , 0 }, // if empty, tomato will use dhcp_start/dchp_num for better compatibility
{ "dhcpd_endip", "" , 0 }, // "
{ "dhcp_lease", "1440" , 0 }, // LAN lease time in minutes
{ "dhcp_domain", "wan" , 0 }, // Use WAN domain name first if available (wan|lan)
{ "wan_get_dns", "" , 0 }, // DNS IP address which get by dhcpc // Add
{ "wan_routes", "" , 0 },
// { "wan_msroutes", "" , 0 }, // Obsolete
{ "dhcp1_start", "" , 0 },
{ "dhcp1_num", "" , 0 },
{ "dhcpd1_startip", "" , 0 },
{ "dhcpd1_endip", "" , 0 },
{ "dhcp1_lease", "1440" , 0 },
{ "dhcp2_start", "" , 0 },
{ "dhcp2_num", "" , 0 },
{ "dhcpd2_startip", "" , 0 },
{ "dhcpd2_endip", "" , 0 },
{ "dhcp2_lease", "1440" , 0 },
{ "dhcp3_start", "" , 0 },
{ "dhcp3_num", "" , 0 },
{ "dhcpd3_startip", "" , 0 },
{ "dhcpd3_endip", "" , 0 },
{ "dhcp3_lease", "1440" , 0 },
#ifdef TCONFIG_USB
// 3G Modem
{ "wan_modem_pin", "" , 0 },
{ "wan_modem_dev", "ttyUSB0" , 0 },
{ "wan_modem_init", "*99#" , 0 },
{ "wan_modem_apn", "internet" , 0 },
{ "wan_modem_speed", "00" , 0 },
{ "wan2_modem_pin", "" , 0 },
{ "wan2_modem_dev", "ttyUSB0" , 0 },
{ "wan2_modem_init", "*99#" , 0 },
{ "wan2_modem_apn", "internet" , 0 },
{ "wan2_modem_speed", "00" , 0 },
#ifdef TCONFIG_MULTIWAN
{ "wan3_modem_pin", "" , 0 },
{ "wan3_modem_dev", "ttyUSB0" , 0 },
{ "wan3_modem_init", "*99#" , 0 },
{ "wan3_modem_apn", "internet" , 0 },
{ "wan3_modem_speed", "00" , 0 },
{ "wan4_modem_pin", "" , 0 },
{ "wan4_modem_dev", "ttyUSB0" , 0 },
{ "wan4_modem_init", "*99#" , 0 },
{ "wan4_modem_apn", "internet" , 0 },
{ "wan4_modem_speed", "00" , 0 },
#endif
#endif
// PPPoE parameters
{ "wan_pppoe_ifname", "" , 0 }, // PPPoE enslaved interface
{ "wan_ppp_username", "" , 0 }, // PPP username
{ "wan_ppp_passwd", "" , 0 }, // PPP password
{ "wan_ppp_idletime", "5" , 0 }, // Dial on demand max idle time (mins)
{ "wan_ppp_keepalive", "0" , 0 }, // Restore link automatically
{ "wan_ppp_demand", "0" , 0 }, // Dial on demand
{ "wan_ppp_redialperiod", "10" , 0 }, // Redial Period (seconds)*/
{ "wan_ppp_mru", "1500" , 0 }, // Negotiate MRU to this value
{ "wan_ppp_mtu", "1500" , 0 }, // Negotiate MTU to the smaller of this value or the peer MRU
{ "wan_ppp_service", "" , 0 }, // PPPoE service name
{ "wan_ppp_ac", "" , 0 }, // PPPoE access concentrator name
{ "wan_ppp_static", "0" , 0 }, // Enable / Disable Static IP
{ "wan_ppp_static_ip", "" , 0 }, // PPPoE Static IP
{ "wan_ppp_get_ac", "" , 0 }, // PPPoE Server ac name
{ "wan_ppp_get_srv", "" , 0 }, // PPPoE Server service name
{ "wan_ppp_custom", "" , 0 }, // PPPD additional options
{ "wan_ppp_mlppp", "0" , 0 }, // PPPoE single line MLPPP
{ "wan_pppoe_lei", "10" , 0 },
{ "wan_pppoe_lef", "5" , 0 },
{ "wan2_ppp_username", "" , 0 }, // PPP username
{ "wan2_ppp_passwd", "" , 0 }, // PPP password
{ "wan2_ppp_idletime", "5" , 0 }, // Dial on demand max idle time (mins)
{ "wan2_ppp_demand", "0" , 0 }, // Dial on demand
{ "wan2_ppp_redialperiod", "10" , 0 }, // Redial Period (seconds)*/
{ "wan2_ppp_service", "" , 0 }, // PPPoE service name
{ "wan2_ppp_custom", "" , 0 }, // PPPD additional options
{ "wan2_ppp_mlppp", "0" , 0 }, // PPPoE single line MLPPP
{ "wan2_pppoe_lei", "10" , 0 },
{ "wan2_pppoe_lef", "5" , 0 },
#ifdef TCONFIG_MULTIWAN
{ "wan3_ppp_username", "" , 0 }, // PPP username
{ "wan3_ppp_passwd", "" , 0 }, // PPP password
{ "wan3_ppp_idletime", "5" , 0 }, // Dial on demand max idle time (mins)
{ "wan3_ppp_demand", "0" , 0 }, // Dial on demand
{ "wan3_ppp_redialperiod", "10" , 0 }, // Redial Period (seconds)*/
{ "wan3_ppp_service", "" , 0 }, // PPPoE service name
{ "wan3_ppp_custom", "" , 0 }, // PPPD additional options
{ "wan3_ppp_mlppp", "0" , 0 }, // PPPoE single line MLPPP
{ "wan3_pppoe_lei", "10" , 0 },
{ "wan3_pppoe_lef", "5" , 0 },
{ "wan4_ppp_username", "" , 0 }, // PPP username
{ "wan4_ppp_passwd", "" , 0 }, // PPP password
{ "wan4_ppp_idletime", "5" , 0 }, // Dial on demand max idle time (mins)
{ "wan4_ppp_demand", "0" , 0 }, // Dial on demand
{ "wan4_ppp_redialperiod", "10" , 0 }, // Redial Period (seconds)*/
{ "wan4_ppp_service", "" , 0 }, // PPPoE service name
{ "wan4_ppp_custom", "" , 0 }, // PPPD additional options
{ "wan4_ppp_mlppp", "0" , 0 }, // PPPoE single line MLPPP
{ "wan4_pppoe_lei", "10" , 0 },
{ "wan4_pppoe_lef", "5" , 0 },
#endif
#ifdef TCONFIG_IPV6
// IPv6 parameters
{ "ipv6_service", "" , 0 }, // [''|native|native-pd|6to4|sit|other]
{ "ipv6_prefix", "" , 0 }, // The global-scope IPv6 prefix to route/advertise
{ "ipv6_prefix_length", "64" , 0 }, // The bit length of the prefix. Used by dhcp6c. For radvd, /64 is always assumed.
{ "ipv6_rtr_addr", "" , 0 }, // defaults to $ipv6_prefix::1
{ "ipv6_radvd", "1" , 0 }, // Enable Router Advertisement (radvd)
{ "ipv6_accept_ra", "1" , 0 }, // Accept RA on bit 0WAN and/or bit1LAN interfaces
{ "ipv6_ifname", "six0" , 0 }, // The interface facing the rest of the IPv6 world
{ "ipv6_tun_v4end", "0.0.0.0" , 0 }, // Foreign IPv4 endpoint of SIT tunnel
{ "ipv6_relay", "1" , 0 }, // Foreign IPv4 endpoint host of SIT tunnel 192.88.99.?
{ "ipv6_tun_addr", "" , 0 }, // IPv6 address to assign to local tunnel endpoint
{ "ipv6_tun_addrlen", "64" , 0 }, // CIDR prefix length for tunnel's IPv6 address
{ "ipv6_tun_mtu", "0" , 0 }, // Tunnel MTU, 0 for default
{ "ipv6_tun_ttl", "255" , 0 }, // Tunnel TTL
{ "ipv6_dns", "" , 0 }, // DNS server(s) IPs
{ "ipv6_get_dns", "" , 0 }, // DNS IP address which get by dhcp6c
{ "ipv6_6rd_prefix", "2602:100::" , 0 }, // 6RD prefix (Charter)
{ "ipv6_6rd_prefix_length", "32" , 0 }, // 6RD prefix length (32-62) checkme
{ "ipv6_6rd_borderrelay", "68.113.165.1" , 0 }, // 6RD border relay address
{ "ipv6_6rd_ipv4masklen", "0" , 0 }, // 6RD IPv4 mask length (0-30) checkme
{ "ipv6_vlan", "0" , 0 }, // Enable IPv6 on 1=LAN1 2=LAN2 4=LAN3
{ "ipv6_pdonly", "0" , 0 }, // Request DHCPv6 Prefix Delegation Only
{ "ipv6_ipsec", "1" , 0 }, // Enable Incoming IPv6 IPSec
#endif
#ifdef RTCONFIG_FANCTRL
{ "fanctrl_dutycycle", "0" , 0 },
#endif
// Wireless parameters
{ "wl_ifname", "" , 0 }, // Interface name
{ "wl_hwaddr", "" , 0 }, // MAC address
{ "wl_phytype", "b" , 0 }, // Current wireless band ("a" (5 GHz), "b" (2.4 GHz), or "g" (2.4 GHz)) // Modify
{ "wl_corerev", "" , 0 }, // Current core revision
{ "wl_phytypes", "" , 0 }, // List of supported wireless bands (e.g. "ga")
{ "wl_radioids", "" , 0 }, // List of radio IDs
{ "wl_ssid", "Tomato24" , 0 }, // Service set ID (network name)
{ "wl1_ssid", "Tomato50" , 0 },
{ "wl_country_code", "" , 0 }, // Country (default obtained from driver)
{ "wl_radio", "1" , 0 }, // Enable (1) or disable (0) radio
{ "wl1_radio", "1" , 0 }, // Enable (1) or disable (0) radio
{ "wl_closed", "0" , 0 }, // Closed (hidden) network
{ "wl_ap_isolate", "0" , 0 }, // AP isolate mode
{ "wl_mode", "ap" , 0 }, // AP mode (ap|sta|wds)
{ "wl_lazywds", "1" , 0 }, // Enable "lazy" WDS mode (0|1)
{ "wl_wds", "" , 0 }, // xx:xx:xx:xx:xx:xx ...
{ "wl_wds_timeout", "1" , 0 }, // WDS link detection interval defualt 1 sec*/
{ "wl_wep", "disabled" , 0 }, // WEP data encryption (enabled|disabled)
{ "wl_auth", "0" , 0 }, // Shared key authentication optional (0) or required (1)
{ "wl_key", "1" , 0 }, // Current WEP key
{ "wl_key1", "" , 0 }, // 5/13 char ASCII or 10/26 char hex
{ "wl_key2", "" , 0 }, // 5/13 char ASCII or 10/26 char hex
{ "wl_key3", "" , 0 }, // 5/13 char ASCII or 10/26 char hex
{ "wl_key4", "" , 0 }, // 5/13 char ASCII or 10/26 char hex
{ "wl_channel", "6" , 0 }, // Channel number
{ "wl1_channel", "0" , 0 },
{ "wl_rate", "0" , 0 }, // Rate (bps, 0 for auto)
{ "wl_mrate", "0" , 0 }, // Mcast Rate (bps, 0 for auto)
{ "wl_rateset", "default" , 0 }, // "default" or "all" or "12"
{ "wl_frag", "2346" , 0 }, // Fragmentation threshold
{ "wl_rts", "2347" , 0 }, // RTS threshold
{ "wl_dtim", "1" , 0 }, // DTIM period (3.11.5)*/ // It is best value for WiFi test
{ "wl_bcn", "100" , 0 }, // Beacon interval
{ "wl_plcphdr", "long" , 0 }, // 802.11b PLCP preamble type
{ "wl_net_mode", "mixed" , 0 }, // Wireless mode (mixed|g-only|b-only|disable)
{ "wl_gmode", "1" , 0 }, // 54g mode
{ "wl_gmode_protection", "off" , 0 }, // 802.11g RTS/CTS protection (off|auto)
{ "wl_afterburner", "off" , 0 }, // AfterBurner
{ "wl_frameburst", "off" , 0 }, // BRCM Frambursting mode (off|on)
{ "wl_wme", "auto" , 0 }, // WME mode (auto|off|on)
{ "wl1_wme", "auto" , 0 }, // WME mode (auto|off|on)
{ "wl_antdiv", "-1" , 0 }, // Antenna Diversity (-1|0|1|3)
{ "wl_infra", "1" , 0 }, // Network Type (BSS/IBSS)
{ "wl_btc_mode", "0" , 0 }, // !!TB - BT Coexistence Mode
{ "wl_sta_retry_time", "5" , 0 }, // !!TB - Seconds between association attempts (0 to disable retries)
{ "wl_mitigation", "0" , 0 }, // Interference Mitigation Mode (0|1|2|3|4)
{ "wl_passphrase", "" , 0 }, // Passphrase // Add
{ "wl_wep_bit", "128" , 0 }, // WEP encryption [64 | 128] // Add
{ "wl_wep_buf", "" , 0 }, // save all settings for web // Add
{ "wl_wep_gen", "" , 0 }, // save all settings for generate button // Add
{ "wl_wep_last", "" , 0 }, // Save last wl_wep mode // Add
{ "wl_vifs", "" , 0 }, // multiple/virtual BSSIDs
// WPA parameters
{ "wl_security_mode", "disabled" , 0 }, // WPA mode (disabled|radius|wpa_personal|wpa_enterprise|wep|wpa2_personal|wpa2_enterprise) for WEB // Add
{ "wl_auth_mode", "none" , 0 }, // Network authentication mode (radius|none)
{ "wl_wpa_psk", "" , 0 }, // WPA pre-shared key
{ "wl_wpa_gtk_rekey", "3600" , 0 }, // WPA GTK rekey interval // Modify
{ "wl_radius_ipaddr", "" , 0 }, // RADIUS server IP address
{ "wl_radius_key", "" , 0 }, // RADIUS shared secret
{ "wl_radius_port", "1812" , 0 }, // RADIUS server UDP port
{ "wl_crypto", "aes" , 0 }, // WPA data encryption
{ "wl_net_reauth", "36000" , 0 }, // Network Re-auth/PMK caching duration
{ "wl_akm", "" , 0 }, // WPA akm list
// WME parameters (cwmin cwmax aifsn txop_b txop_ag adm_control oldest_first)
// EDCA parameters for STA
{ "wl_wme_sta_bk", "15 1023 7 0 0 off off" , 0 }, // WME STA AC_BK paramters
{ "wl_wme_sta_be", "15 1023 3 0 0 off off" , 0 }, // WME STA AC_BE paramters
{ "wl_wme_sta_vi", "7 15 2 6016 3008 off off" , 0 }, // WME STA AC_VI paramters
{ "wl_wme_sta_vo", "3 7 2 3264 1504 off off" , 0 }, // WME STA AC_VO paramters
// EDCA parameters for AP
{ "wl_wme_ap_bk", "15 1023 7 0 0 off off" , 0 }, // WME AP AC_BK paramters
{ "wl_wme_ap_be", "15 63 3 0 0 off off" , 0 }, // WME AP AC_BE paramters
{ "wl_wme_ap_vi", "7 15 1 6016 3008 off off" , 0 }, // WME AP AC_VI paramters
{ "wl_wme_ap_vo", "3 7 1 3264 1504 off off" , 0 }, // WME AP AC_VO paramters
{ "wl_wme_no_ack", "off" , 0 }, // WME No-Acknowledgmen mode
{ "wl_wme_apsd", "on" , 0 }, // WME APSD mode
{ "wl_wme_bss_disable", "0" , 0 }, // WME BSS disable advertising (off|on)
/* Per AC Tx parameters */
{ "wl_wme_txp_be", "7 3 4 2 0" , 0 }, /* WME AC_BE Tx parameters */
{ "wl_wme_txp_bk", "7 3 4 2 0" , 0 }, /* WME AC_BK Tx parameters */
{ "wl_wme_txp_vi", "7 3 4 2 0" , 0 }, /* WME AC_VI Tx parameters */
{ "wl_wme_txp_vo", "7 3 4 2 0" , 0 }, /* WME AC_VO Tx parameters */
{ "wl_unit", "0" , 0 }, // Last configured interface
{ "wl_mac_deny", "" , 0 }, // filter MAC // Add
{ "wl_leddc", "0x640000" , 0 }, // !!TB - 100% duty cycle for LED on router (WLAN LED fix for some routers)
{ "wl_bss_enabled", "1" , 0 }, // !!TB - If not present the new versions of wlconf may not bring up wlan
{ "wl_reg_mode", "off" , 0 }, // !!TB - Regulatory: 802.11H(h)/802.11D(d)/off(off)
// !!TB: n-mode
{ "wl_nmode", "-1" , 0 }, // N-mode
{ "wl_nband", "2" , 0 }, // 2 - 2.4GHz, 1 - 5GHz, 0 - Auto
{ "wl1_nband", "1" , 0 },
{ "wl_nmcsidx", "-1" , 0 }, // MCS Index for N - rate
{ "wl_nreqd", "0" , 0 }, // Require 802.11n support
{ "wl_nbw", "40" , 0 }, // BW: 20 / 40 MHz
{ "wl_nbw_cap", "1" , 0 }, // BW: def 20inB and 40inA
{ "wl_mimo_preamble", "mm" , 0 }, // 802.11n Preamble: mm/gf/auto/gfbcm
{ "wl_nctrlsb", "upper" , 0 }, // N-CTRL SB (none/lower/upper)
{ "wl_nmode_protection", "off" , 0 }, // 802.11n RTS/CTS protection (off|auto)
{ "wl_rxstreams", "0" , 0 }, // 802.11n Rx Streams, 0 is invalid, WLCONF will change it to a radio appropriate default
{ "wl_txstreams", "0" , 0 }, // 802.11n Tx Streams 0, 0 is invalid, WLCONF will change it to a radio appropriate default
{ "wl_dfs_preism", "60" , 0 }, // 802.11H pre network CAC time
{ "wl_dfs_postism", "60" , 0 }, // 802.11H In Service Monitoring CAC time
{ "wl_radarthrs", "1 0x6c0 0x6e0 0x6bc 0x6e0 0x6ac 0x6cc 0x6bc 0x6e0" , 0 }, // Radar thrs params format: version thresh0_20 thresh1_20 thresh0_40 thresh1_40
{ "wl_bcn_rotate", "1" , 0 }, // Beacon rotation
{ "wl_vlan_prio_mode", "off" , 0 }, // VLAN Priority support
{ "wl_obss_coex", "0" , 0 }, // OBSS Coexistence (0|1): when enabled, channel width is forced to 20MHz
#ifdef TCONFIG_EMF
{ "emf_entry", "" , 0 }, // Static MFDB entry (mgrp:if)
{ "emf_uffp_entry", "" , 0 }, // Unreg frames forwarding ports
{ "emf_rtport_entry", "" , 0 }, // IGMP frames forwarding ports
{ "emf_enable", "0" , 0 }, // Disable EMF by default
#endif
#ifdef CONFIG_BCMWL5
// AMPDU
{ "wl_ampdu", "auto" , 0 }, // Default AMPDU setting
{ "wl_ampdu_rtylimit_tid", "5 5 5 5 5 5 5 5" , 0 }, // Default AMPDU retry limit per-tid setting
{ "wl_ampdu_rr_rtylimit_tid", "2 2 2 2 2 2 2 2" , 0 }, // Default AMPDU regular rate retry limit per-tid setting
{ "wl_amsdu", "auto" , 0 }, // Default AMSDU setting
// power save
#ifdef TCONFIG_BCMWL6
{ "wl_bss_opmode_cap_reqd", "0" , 0 },
#endif
#ifndef TCONFIG_BCMARM
{ "wl_rxchain_pwrsave_enable", "1" , 0 }, // Rxchain powersave enable
{ "wl_rxchain_pwrsave_quiet_time","1800" , 0 }, // Quiet time for power save
{ "wl_rxchain_pwrsave_pps", "10" , 0 }, // Packets per second threshold for power save
{ "wl_rxchain_pwrsave_stas_assoc_check", "0" , 0 }, /* STAs associated before powersave */
#endif
{ "wl_radio_pwrsave_enable", "0" , 0 }, // Radio powersave enable
{ "wl_radio_pwrsave_quiet_time","1800" , 0 }, // Quiet time for power save
{ "wl_radio_pwrsave_pps", "10" , 0 }, // Packets per second threshold for power save
{ "wl_radio_pwrsave_on_time", "50" , 0 }, // Radio on time for power save
{ "acs_mode", "legacy" , 0 }, /* Legacy mode if ACS is enabled */
// misc
{ "wl_wmf_bss_enable", "0" , 0 }, // Wireless Multicast Forwarding Enable/Disable
{ "wl_rifs_advert", "auto" , 0 }, // RIFS mode advertisement
{ "wl_stbc_tx", "auto" , 0 }, // Default STBC TX setting
{ "wl_mcast_regen_bss_enable", "1" , 0 }, // MCAST REGEN Enable/Disable
#endif
#ifdef TCONFIG_BCMWL6
{ "wl_ack_ratio", "0"},
{ "wl_ampdu_mpdu", "0"},
{ "wl_ampdu_rts", "1"},
#ifdef TCONFIG_BCMARM
{ "wl_turbo_qam", "1"},
{ "wl_itxbf", "1"},
{ "wl0_itxbf", "0"},
#endif
#endif
{ "wan_pptp_server_ip", "" , 0 }, // as same as WAN gateway
{ "wan_ppp_get_ip", "" , 0 }, // IP Address assigned by PPTP/L2TP server
{ "wan_pptp_dhcp", "0" , 0 },
// for firewall
{ "wan_mtu_enable", "0" , 0 }, // WAN MTU [1|0]
{ "wan_mtu", "1500" , 0 }, // Negotiate MTU to the smaller of this value or the peer MRU
{ "wan_l2tp_server_ip", "" , 0 }, // L2TP auth server (IP Address)
{ "wan2_pptp_server_ip", "" , 0 }, // as same as WAN gateway
{ "wan2_pptp_dhcp", "0" , 0 },
{ "wan2_mtu_enable", "0" , 0 }, // WAN MTU [1|0]
{ "wan2_mtu", "1500" , 0 }, // Negotiate MTU to the smaller of this value or the peer MRU
{ "wan2_l2tp_server_ip", "" , 0 }, // L2TP auth server (IP Address)
#ifdef TCONFIG_MULTIWAN
{ "wan3_pptp_server_ip", "" , 0 }, // as same as WAN gateway
{ "wan3_pptp_dhcp", "0" , 0 },
{ "wan3_mtu_enable", "0" , 0 }, // WAN MTU [1|0]
{ "wan3_mtu", "1500" , 0 }, // Negotiate MTU to the smaller of this value or the peer MRU
{ "wan3_l2tp_server_ip", "" , 0 }, // L2TP auth server (IP Address)
{ "wan4_pptp_server_ip", "" , 0 }, // as same as WAN gateway
{ "wan4_pptp_dhcp", "0" , 0 },
{ "wan4_mtu_enable", "0" , 0 }, // WAN MTU [1|0]
{ "wan4_mtu", "1500" , 0 }, // Negotiate MTU to the smaller of this value or the peer MRU
{ "wan4_l2tp_server_ip", "" , 0 }, // L2TP auth server (IP Address)
#endif
// misc
{ "wl_tnoise", "-99" , 0 },
{ "led_override", "" , 0 },
{ "btn_override", "" , 0 },
{ "btn_reset", "" , 0 },
{ "env_path", "" , 0 },
{ "manual_boot_nv", "0" , 0 },
{ "t_fix1", "" , 0 },
// basic-ddns
{ "ddnsx0", "" , 0 },
{ "ddnsx1", "" , 0 },
{ "ddnsx_ip", "wan" , 0 },
{ "ddnsx0_cache", "" , 0 },
{ "ddnsx1_cache", "" , 0 },
{ "ddnsx_save", "1" , 0 },
{ "ddnsx_refresh", "28" , 0 },
// basic-ident
{ "router_name", "TomatoUSB" , 0 },
{ "wan_hostname", "unknown" , 0 },
{ "wan_domain", "" , 0 },
// basic-time
{ "tm_sel", "CET-1CEST,M3.5.0/2,M10.5.0/3" , 0 },
{ "tm_tz", "CET-1CEST,M3.5.0/2,M10.5.0/3" , 0 },
{ "tm_dst", "1" , 0 },
{ "ntp_updates", "4" , 0 },
{ "ntp_tdod", "0" , 0 },
{ "ntp_server", "0.europe.pool.ntp.org 1.europe.pool.ntp.org 2.europe.pool.ntp.org" , 0 },
{ "ntp_kiss", "" , 0 },
{ "ntp_kiss_ignore", "" , 0 },
// basic-static
{ "dhcpd_static", "" , 0 },
{ "dhcpd_static_only", "0" , 0 },
// basic-wfilter
{ "wl_maclist", "" , 0 }, // xx:xx:xx:xx:xx:xx ...
{ "wl_macmode", "disabled" , 0 },
{ "macnames", "" , 0 },
// advanced-ctnf
{ "ct_tcp_timeout", "" , 0 },
{ "ct_udp_timeout", "" , 0 },
{ "ct_timeout", "" , 0 },
{ "ct_max", "" , 0 },
{ "nf_ttl", "0" , 0 },
{ "nf_l7in", "1" , 0 },
#ifdef LINUX26
{ "nf_sip", "1" , 0 },
{ "ct_hashsize", "2048" , 0 },
#endif
#ifdef LINUX26
{ "nf_rtsp", "0" , 0 },
#else
{ "nf_rtsp", "1" , 0 },
#endif
{ "nf_pptp", "1" , 0 },
{ "nf_h323", "1" , 0 },
{ "nf_ftp", "1" , 0 },
// advanced-adblock
{ "adblock_enable", "0" , 0 },
{ "adblock_blacklist", "1<http://winhelp2002.mvps.org/hosts.txt<>1<http://adaway.org/hosts.txt<>1<http://hosts-file.net/ad_servers.txt<>1<http://www.malwaredomainlist.com/hostslist/hosts.txt<>1<http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext<>0<http://someonewhocares.org/hosts/zero/hosts<>0<https://raw.githubusercontent.com/WindowsLies/BlockWindows/master/hosts<Windows 10>0<http://sysctl.org/cameleon/hosts<>0<http://adblock.gjtech.net/?format=hostfile<>0<http://hostsfile.mine.nu/Hosts<very large list>0<https://raw.github.com/notracking/hosts-blocklists/master/hostnames.txt<very large list>" , 0 },
{ "adblock_blacklist_custom", "" , 0 },
{ "adblock_whitelist", "" , 0 },
// advanced-mac
{ "wan_mac", "" , 0 },
{ "wl_macaddr", "" , 0 },
// advanced-misc
{ "boot_wait", "on" , 0 },
{ "wait_time", "5" , 0 },
{ "wan_speed", "4" , 0 }, // 0=10 Mb Full, 1=10 Mb Half, 2=100 Mb Full, 3=100 Mb Half, 4=Auto
{ "jumbo_frame_enable", "0" , 0 }, // Jumbo Frames support (for RT-N16/WNR3500L)
{ "jumbo_frame_size", "2000" , 0 },
#ifdef CONFIG_BCMWL5
{ "ctf_disable", "1" , 0 },
#endif
#ifdef TCONFIG_BCMFA
{ "ctf_fa_mode", "0" , 0 },
#endif
// advanced-dhcpdns
{ "dhcpd_dmdns", "1" , 0 },
{ "dhcpd_slt", "0" , 0 },
{ "dhcpd_gwmode", "" , 0 },
{ "dhcpd_lmax", "" , 0 },
{ "dns_addget", "0" , 0 },
{ "dns_intcpt", "0" , 0 },
{ "dhcpc_minpkt", "1" , 0 },
{ "dhcpc_custom", "" , 0 },
{ "dns_norebind", "1" , 0 },
{ "dnsmasq_debug", "0" , 0 },
{ "dnsmasq_custom", "" , 0 },
{ "dnsmasq_static_only", "0" , 0 },
{ "dnsmasq_q", "0" , 0 }, //Bit0=quiet-dhcp, 1=dhcp6, 2=ra
// advanced-firewall
{ "nf_loopback", "0" , 0 },
{ "block_wan", "1" , 0 }, // block inbound icmp
{ "block_wan_limit", "1" , 0 },
{ "block_wan_limit_icmp", "1" , 0 },
{ "block_wan_limit_tr", "5" , 0 },
{ "multicast_pass", "0" , 0 }, // enable multicast proxy
{ "multicast_lan", "0" , 0 }, // on LAN (br0)
{ "multicast_lan1", "0" , 0 }, // on LAN1 (br1)
{ "multicast_lan2", "0" , 0 }, // on LAN2 (br2)
{ "multicast_lan3", "0" , 0 }, // on LAN3 (br3)
{ "udpxy_enable", "0" , 0 },
{ "udpxy_stats", "0" , 0 },
{ "udpxy_clients", "3" , 0 },
{ "udpxy_port", "4022" , 0 },
{ "ne_syncookies", "0" , 0 }, // tcp_syncookies
{ "DSCP_fix_enable", "1" , 0 }, // Comacst DSCP fix
{ "ne_snat", "0" , 0 }, // use SNAT instead of MASQUERADE
{ "dhcp_pass", "1" , 0 }, // allow DHCP responses
{ "ne_shlimit", "1,3,60" , 0 }, //shibby - enable limit connection attempts for sshd
// advanced-routing
{ "routes_static", "" , 0 },
{ "dhcp_routes", "1" , 0 },
{ "wk_mode", "gateway" , 0 }, // Network mode [gateway|router]
#ifdef TCONFIG_ZEBRA
{ "dr_setting", "0" , 0 }, // [ Disable | WAN | LAN | Both ]
{ "dr_lan_tx", "0" , 0 }, // Dynamic-Routing LAN out
{ "dr_lan_rx", "0" , 0 }, // Dynamic-Routing LAN in
{ "dr_lan1_tx", "0" , 0 }, // Dynamic-Routing LAN out
{ "dr_lan1_rx", "0" , 0 }, // Dynamic-Routing LAN in
{ "dr_lan2_tx", "0" , 0 }, // Dynamic-Routing LAN out
{ "dr_lan2_rx", "0" , 0 }, // Dynamic-Routing LAN in
{ "dr_lan3_tx", "0" , 0 }, // Dynamic-Routing LAN out
{ "dr_lan3_rx", "0" , 0 }, // Dynamic-Routing LAN in
{ "dr_wan_tx", "0" , 0 }, // Dynamic-Routing WAN out
{ "dr_wan_rx", "0" , 0 }, // Dynamic-Routing WAN in
{ "dr_wan2_tx", "0" , 0 }, // Dynamic-Routing WAN out
{ "dr_wan2_rx", "0" , 0 }, // Dynamic-Routing WAN in
#ifdef TCONFIG_MULTIWAN
{ "dr_wan3_tx", "0" , 0 }, // Dynamic-Routing WAN out
{ "dr_wan3_rx", "0" , 0 }, // Dynamic-Routing WAN in
{ "dr_wan4_tx", "0" , 0 }, // Dynamic-Routing WAN out
{ "dr_wan4_rx", "0" , 0 }, // Dynamic-Routing WAN in
#endif
#endif
// advanced-vlan
{ "trunk_vlan_so", "0" , 0 }, // VLAN trunk support override
// advanced-wireless
{ "wl_txant", "3" , 0 },
{ "wl_txpwr", "100" , 0 },
{ "wl_maxassoc", "128" , 0 }, // Max associations driver could support
{ "wl_bss_maxassoc", "128" , 0 },
{ "wl_distance", "" , 0 },
// forward-*
{ "portforward", "0<3<1.1.1.0/24<1000:2000<<192.168.1.2<ex: 1000 to 2000, restricted>0<2<<1000,2000<<192.168.1.2<ex: 1000 and 2000>0<1<<1000<2000<192.168.1.2<ex: different internal port>0<3<<1000:2000,3000<<192.168.1.2<ex: 1000 to 2000, and 3000>" , 0 },
#ifdef TCONFIG_IPV6
{ "ipv6_portforward", "", 0 },
#endif
{ "trigforward", "0<1<3000:4000<5000:6000<ex: open 5000-6000 if 3000-4000>" , 0 },
{ "dmz_enable", "0" , 0 },
{ "dmz_ipaddr", "0" , 0 },
{ "dmz_sip", "" , 0 },
{ "dmz_ifname", "br0" , 0 },
{ "dmz_ra", "1" , 0 },
// forward-upnp
{ "upnp_enable", "0" , 0 },
{ "upnp_secure", "1" , 0 },
{ "upnp_port", "0" , 0 },
{ "upnp_ssdp_interval", "60" , 0 }, // SSDP interval
{ "upnp_mnp", "0" , 0 },
{ "upnp_custom", "" , 0 },
{ "upnp_clean", "1" , 0 }, /* 0:Disable 1:Enable */
{ "upnp_clean_interval", "600" , 0 }, /* Cleaning interval in seconds */
{ "upnp_clean_threshold", "20" , 0 }, /* Threshold for cleaning unused rules */
#if 0 // disabled for miniupnpd
{ "upnp_max_age", "180" , 0 }, // Max age
{ "upnp_config", "0" , 0 },
#endif
// qos
{ "atm_overhead", "0" , 0 },
{ "qos_enable", "0" , 0 },
{ "qos_ack", "0" , 0 },
{ "qos_syn", "1" , 0 },
{ "qos_fin", "1" , 0 },
{ "qos_rst", "1" , 0 },
{ "qos_udp", "0" , 0 },
{ "qos_icmp", "1" , 0 },
{ "qos_pfifo", "3" , 0 }, //Set FQ_Codel Default Qdisc Scheduler
{ "qos_reset", "1" , 0 },
{ "wan_qos_obw", "700" , 0 },
{ "wan_qos_ibw", "16000" , 0 },
{ "wan2_qos_obw", "700" , 0 },
{ "wan2_qos_ibw", "16000" , 0 },
#ifdef TCONFIG_MULTIWAN
{ "wan3_qos_obw", "700" , 0 },
{ "wan3_qos_ibw", "16000" , 0 },
{ "wan4_qos_obw", "700" , 0 },
{ "wan4_qos_ibw", "16000" , 0 },
#endif
{ "qos_orules", "0<<-1<d<53<0<<0:10<<0<DNS>0<<-1<d<37<0<<0:10<<0<Time>0<<17<d<123<0<<0:10<<0<NTP>0<<-1<d<3455<0<<0:10<<0<RSVP>0<<-1<d<9<0<<0:50<<3<SCTP, Discard>0<<-1<x<135,2101,2103,2105<0<<<<3<RPC (Microsoft)>0<<17<d<3544<0<<<<-1<Teredo Tunnel>0<<6<x<22,2222<0<<<<2<SSH>0<<6<d<23,992<0<<<<2<Telnet>0<<6<s<80,5938,8080,2222<0<<<<2<Remote Access>0<<-1<x<3389<0<<<<2<Remote Assistance>0<<-1<x<1220,6970:7170,8554<0<<<<4<Quicktime/RealAudio>0<<-1<x<554,5004,5005<0<<<<4<RTP, RTSP>0<<-1<x<1755<0<<<<4<MMS (Microsoft)>0<<-1<d<3478,3479,5060:5063<0<<<<1<SIP, Sipgate Stun Services>0<<-1<s<53,88,3074<0<<<<1<Xbox Live>0<<6<d<1718:1720<0<<<<1<H323>0<<-1<d<4380,27000:27050,11031,11235:11335,11999,2300:2400,6073,28800:29100,47624<0<<<<1<Various Games>0<<-1<d<1493,1502,1503,1542,1863,1963,3389,5061,5190:5193,7001<0<<<<5<MSGR1 - Windows Live>0<<-1<d<1071:1074,1455,1638,1644,5000:5010,5050,5100,5101,5150,8000:8002<0<<<<5<MSGR2 - Yahoo>0<<-1<d<194,1720,1730:1732,5220:5223,5298,6660:6669,22555<0<<<<5<MSGR3 - Additional>0<<-1<d<19294:19310<0<<<<5<Google+ & Voice>0<<6<d<6005,6006<0<<<<5<Camfrog>0<<-1<x<6571,6891:6901<0<<<<5<WLM File/Webcam>0<<-1<x<29613<0<<<<5<Skype incoming>0<<6<x<4244,5242<0<<<<1<Viber TCP>0<<17<x<5243,9785<0<<<<1<Viber UDP>0<<17<x<3478:3497,16384:16387,16393:16402<0<<<<5<Apple Facetime/Game Center>0<<6<d<443<0<<0:512<<3<HTTPS>0<<6<d<443<0<<512:<<5<HTTPS>0<<17<d<443<0<<0:512<<3<QUIC>0<<17<d<443<0<<512:<<5<QUIC>0<<-1<a<<0<skypetoskype<<<1<Skype to Skype>0<<-1<a<<0<skypeout<<<-1<Skype Phone (deprecated)>0<<-1<a<<0<youtube-2012<<<4<YouTube 2012 (Youtube)>0<<-1<a<<0<httpvideo<<<4<HTTP Video (Youtube)>0<<-1<a<<0<flash<<<4<Flash Video (Youtube)>0<<-1<a<<0<rtp<<<4<RTP>0<<-1<a<<0<rtmp<<<4<RTMP>0<<-1<a<<0<shoutcast<<<4<Shoutcast>0<<-2<a<<0<rtmpt<<<4<RTMPT (RTMP over HTTP)>0<<-1<a<<0<irc<<<5<IRC>0<<6<d<80,8080<0<<0:512<<3<HTTP, HTTP Proxy>0<<6<d<80,8080<0<<512:<<7<HTTP, HTTP Proxy File Transfers>0<<6<d<20,21,989,990<0<<<<7<FTP>0<<6<d<25,587,465,2525<0<<<<6<SMTP, Submission Mail>0<<6<d<110,995<0<<<<6<POP3 Mail>0<<6<d<119,563<0<<<<7<NNTP News & Downloads>0<<6<d<143,220,585,993<0<<<<6<IMAP Mail>0<<17<d<1:65535<0<<<<8<P2P (uTP, UDP)" , 0 },
{ "qos_burst0", "" , 0 },
{ "qos_burst1", "" , 0 },
{ "qos_default", "8" , 0 },
{ "qos_orates", "5-100,5-30,5-100,5-70,5-70,5-70,5-70,5-100,5-30,1-1" , 0 },
{ "qos_irates", "5-100,2-20,5-100,10-90,20-90,5-90,5-70,5-100,5-30,1-1" , 0 },
{ "qos_classnames", "Service VOIP/Game Remote WWW Media HTTPS/Msgr Mail FileXfer P2P/Bulk Crawl" , 0 },
{ "ne_vegas", "0" , 0 }, // TCP Vegas
{ "ne_valpha", "2" , 0 }, // "
{ "ne_vbeta", "6" , 0 }, // "
{ "ne_vgamma", "2" , 0 }, // "
// access restrictions
{ "rruleN", "0" , 0 },
{ "rrule0", "0|1320|300|31|||word text\n^begins-with.domain.\n.ends-with.net$\n^www.exact-domain.net$|0|example" , 0 },
{ "rrulewp", "80,8080" , 0 },
#if TOMATO_SL
// samba
{ "smbd_on", "0" , 0 },
{ "nmbd_on", "0" , 0 },
{ "smbd_wgroup", "WORKGROUP" , 0 },
{ "smbd_nbname", "TOMATO" , 0 },
{ "smbd_adminpass", "admin" , 0 },
#endif
// admin-access
{ "http_username", "" , 0 }, // Username
{ "http_passwd", "admin" , 0 }, // Password
{ "remote_management", "0" , 0 }, // Remote Management [1|0]
{ "remote_mgt_https", "0" , 0 }, // Remote Management use https [1|0]
{ "http_wanport", "8080" , 0 }, // WAN port to listen on
{ "http_lanport", "80" , 0 }, // LAN port to listen on
{ "https_lanport", "443" , 0 }, // LAN port to listen on
{ "http_enable", "1" , 0 }, // HTTP server enable/disable
{ "https_enable", "0" , 0 }, // HTTPS server enable/disable
{ "https_crt_save", "0" , 0 },
{ "https_crt_cn", "" , 0 },
{ "https_crt_file", "" , 0 },
{ "https_crt", "" , 0 },
{ "http_root", "1" , 0 }, // 0 - deny, 1 - Allow
{ "web_wl_filter", "0" , 0 }, // Allow/Deny Wireless Access Web
{ "web_lang", "" }, //shibby multilanguage
{ "web_css", "openlinksys" , 0 },
{ "web_dir", "default" , 0 }, // jffs, opt, tmp or default (/www)
{ "ttb_css", "example" , 0 }, //Tomato Themes Base
{ "web_svg", "1" , 0 },
{ "telnetd_eas", "1" , 0 },
{ "telnetd_port", "23" , 0 },
{ "sshd_eas", "1" , 0 }, //shibby - enable sshd by default
{ "sshd_pass", "1" , 0 },
{ "sshd_port", "22" , 0 },
{ "sshd_remote", "0" , 0 },
{ "sshd_motd", "1" , 0 },
{ "sshd_rport", "22" , 0 },
{ "sshd_authkeys", "" , 0 },
{ "sshd_hostkey", "" , 0 },
{ "sshd_dsskey", "" , 0 },
{ "sshd_forwarding", "1" , 0 },
{ "rmgt_sip", "" , 0 }, // remote management: source ip address
{ "http_id", "" , 0 },
{ "web_mx", "status,bwm" , 0 },
{ "web_pb", "" , 0 },
// admin-bwm
{ "rstats_enable", "1" , 0 },
{ "rstats_path", "" , 0 },
{ "rstats_stime", "48" , 0 },
{ "rstats_offset", "1" , 0 },
{ "rstats_data", "" , 0 },
{ "rstats_colors", "" , 0 },
{ "rstats_exclude", "" , 0 },
{ "rstats_sshut", "1" , 0 },
{ "rstats_bak", "0" , 0 },
// admin-ipt
{ "cstats_enable", "1" , 0 },
{ "cstats_path", "" , 0 },
{ "cstats_stime", "48" , 0 },
{ "cstats_offset", "1" , 0 },
{ "cstats_labels", "0" , 0 },
{ "cstats_exclude", "" , 0 },
{ "cstats_include", "" , 0 },
{ "cstats_all", "1" , 0 },
{ "cstats_sshut", "1" , 0 },
{ "cstats_bak", "0" , 0 },
// advanced-buttons
{ "stealth_mode", "0" , 0 }, // Stealth Mode switch (no LEDs)
{ "stealth_iled", "0" , 0 }, // Exclude INTERNET LED in SM
{ "sesx_led", "0" , 0 },
{ "sesx_b0", "1" , 0 },
{ "sesx_b1", "4" , 0 },
{ "sesx_b2", "4" , 0 },
{ "sesx_b3", "4" , 0 },
{ "sesx_script",
"[ $1 -ge 20 ] && telnetd -p 233 -l /bin/sh\n"
, 0 },
{ "script_brau",
"if [ ! -e /tmp/switch-start ]; then\n"
" # do something at startup\n"
" echo position at startup was $1 >/tmp/switch-start\n"
" exit\n"
"fi\n"
"if [ $1 = \"bridge\" ]; then\n"
" # do something\n"
" led bridge on\n"
"elif [ $1 = \"auto\" ]; then\n"
" # do something\n"
" led bridge off\n"
"fi\n"
, 0 },
// admin-log
{ "log_remote", "0" , 0 },
{ "log_remoteip", "" , 0 },
{ "log_remoteport", "514" , 0 },
{ "log_file", "1" , 0 },
{ "log_file_custom", "0" , 0 },
{ "log_file_path", "/var/log/messages" , 0 },
{ "log_file_size", "50" , 0 },
{ "log_file_keep", "1" , 0 },
{ "log_limit", "60" , 0 },
{ "log_in", "0" , 0 },
{ "log_out", "0" , 0 },
{ "log_mark", "60" , 0 },
{ "log_events", "" , 0 },
// admin-log-webmonitor
{ "log_wm", "0" , 0 },
{ "log_wmtype", "0" , 0 },
{ "log_wmip", "" , 0 },
{ "log_wmdmax", "2000" , 0 },
{ "log_wmsmax", "2000" , 0 },
{ "webmon_bkp", "0" , 0 },
{ "webmon_dir", "/tmp" , 0 },
{ "webmon_shrink", "0" , 0 },
// admin-debugging
{ "debug_nocommit", "0" , 0 },
{ "debug_cprintf", "0" , 0 },
{ "debug_cprintf_file", "0" , 0 },
{ "console_loglevel", "1" , 0 },
{ "t_cafree", "1" , 0 },
{ "t_hidelr", "0" , 0 },
{ "debug_clkfix", "1" , 0 },
{ "debug_ddns", "0" , 0 },
// admin-cifs
{ "cifs1", "" , 0 },
{ "cifs2", "" , 0 },
// admin-jffs2
{ "jffs2_on", "0" , 0 },
{ "jffs2_exec", "" , 0 },
// admin-tomatoanon
{ "tomatoanon_enable", "-1" , 0 },
{ "tomatoanon_answer", "0" , 0 },
{ "tomatoanon_cru", "6" , 0 },
{ "tomatoanon_id", "" , 0 },
{ "tomatoanon_notify", "1" , 0 },
#ifdef TCONFIG_USB
// nas-usb - !!TB
{ "usb_enable", "1" , 0 },
{ "usb_uhci", "0" , 0 },
{ "usb_ohci", "0" , 0 },
{ "usb_usb2", "1" , 0 },
{ "usb_usb3", "1" , 0 },
#if defined(LINUX26) && defined(TCONFIG_MICROSD)
{ "usb_mmc", "-1" , 0 },
#endif
{ "usb_irq_thresh", "0" , 0 },
{ "usb_storage", "1" , 0 },
{ "usb_printer", "0" , 0 },
{ "usb_printer_bidirect", "0" , 0 },
{ "usb_ext_opt", "" , 0 },
{ "usb_fat_opt", "" , 0 },
{ "usb_ntfs_opt", "" , 0 },
{ "usb_fs_ext3", "1" , 0 },
{ "usb_fs_ext4", "1" , 0 },
{ "usb_fs_fat", "1" , 0 },
{ "usb_fs_exfat", "1" , 0 },
#ifdef TCONFIG_NTFS
{ "usb_fs_ntfs", "1" , 0 },
#ifdef TCONFIG_TUXERA
{ "usb_ntfs_driver", "tuxera" , 0 },
#elif TCONFIG_UFSD
{ "usb_ntfs_driver", "paragon" , 0 },
#else
{ "usb_ntfs_driver", "ntfs3g" , 0 },
#endif
#endif //TCONFIG_NTFS
#ifdef TCONFIG_HFS
{ "usb_fs_hfs", "1" , 0 }, //!Victek
#ifdef TCONFIG_TUXERA_HFS
{ "usb_hfs_driver", "tuxera" , 0 },
#elif TCONFIG_UFSD
{ "usb_hfs_driver", "paragon" , 0 },
#else
{ "usb_hfs_driver", "kernel" , 0 },
#endif
#endif //TCONFIG_HFS
{ "usb_automount", "1" , 0 },
#if 0
{ "usb_bdflush", "30 500 0 0 100 100 60 0 0" , 0 },
#endif
{ "script_usbhotplug", "" , 0 },
{ "script_usbmount", "" , 0 },
{ "script_usbumount", "" , 0 },
{ "idle_enable", "0" , 0 },
{ "usb_3g", "1" , 0 },
#endif
#ifdef TCONFIG_FTP
// nas-ftp - !!TB
{ "ftp_enable", "0" , 0 },
{ "ftp_super", "0" , 0 },
{ "ftp_anonymous", "0" , 0 },
{ "ftp_dirlist", "0" , 0 },
{ "ftp_port", "21" , 0 },
{ "ftp_max", "0" , 0 },
{ "ftp_ipmax", "0" , 0 },
{ "ftp_staytimeout", "300" , 0 },
{ "ftp_rate", "0" , 0 },
{ "ftp_anonrate", "0" , 0 },
{ "ftp_anonroot", "" , 0 },
{ "ftp_pubroot", "" , 0 },
{ "ftp_pvtroot", "" , 0 },
{ "ftp_users", "" , 0 },
{ "ftp_custom", "" , 0 },
{ "ftp_sip", "" , 0 }, // wan ftp access: source ip address(es)
{ "ftp_limit", "0,3,60" , 0 },
{ "log_ftp", "0" , 0 },
#endif
#ifdef TCONFIG_SNMP
{ "snmp_enable", "0" , 0 },
{ "snmp_port", "161" , 0 },
{ "snmp_remote", "0" , 0 },
{ "snmp_remote_sip", "" , 0 },
{ "snmp_location", "router" , 0 },
{ "snmp_contact", "admin@tomato" , 0 },
{ "snmp_ro", "rocommunity" , 0 },
#endif
#ifdef TCONFIG_SAMBASRV
// nas-samba - !!TB
{ "smbd_enable", "0" , 0 },
{ "smbd_wgroup", "WORKGROUP" , 0 },
{ "smbd_master", "1" , 0 },
{ "smbd_wins", "1" , 0 },
{ "smbd_cpage", "" , 0 },
{ "smbd_cset", "utf8" , 0 },
{ "smbd_custom", "" , 0 },
{ "smbd_autoshare", "2" , 0 },
{ "smbd_shares",
"jffs</jffs<JFFS<1<0>root$</<Hidden Root<0<1"
, 0 },
{ "smbd_user", "nas" , 0 },
{ "smbd_passwd", "" , 0 },
#endif
#ifdef TCONFIG_MEDIA_SERVER
// nas-media
{ "ms_enable", "0" , 0 }, /* 0:Disable 1:Enable 2:Enable&Rescan */
{ "ms_dirs", "/mnt<" , 0 },
{ "ms_port", "0" , 0 },
{ "ms_dbdir", "" , 0 },
{ "ms_tivo", "0" , 0 },
{ "ms_stdlna", "0" , 0 },
{ "ms_sas", "0" , 0 },
#endif
#ifdef TCONFIG_SDHC
// admin-sdhc
{ "mmc_on", "0" , 0 },
{ "mmc_cs", "7" , 0 },
{ "mmc_clk", "3" , 0 },
{ "mmc_din", "2" , 0 },
{ "mmc_dout", "4" , 0 },
{ "mmc_fs_partition", "1" , 0 },
{ "mmc_fs_type", "ext2" , 0 },
{ "mmc_exec_mount", "" , 0 },
{ "mmc_exec_umount", "" , 0 },
#endif
// admin-sch
{ "sch_rboot", "" , 0 },
{ "sch_rcon", "" , 0 },
{ "sch_c1", "" , 0 },
{ "sch_c2", "" , 0 },
{ "sch_c3", "" , 0 },
{ "sch_c4", "" , 0 },
{ "sch_c5", "" , 0 },
{ "sch_c1_cmd", "" , 0 },
{ "sch_c2_cmd", "" , 0 },
{ "sch_c3_cmd", "" , 0 },
{ "sch_c4_cmd", "" , 0 },
{ "sch_c5_cmd", "" , 0 },
// admin-script
{ "script_init", "" , 0 },
{ "script_shut", "" , 0 },
{ "script_fire", "" , 0 },
{ "script_wanup", "" , 0 },
#ifdef TCONFIG_NFS
{ "nfs_enable", "0" , 0 },
{ "nfs_exports", "" , 0 },
#endif
#ifdef TCONFIG_OPENVPN
// vpn
{ "vpn_debug", "0" , 0 },
{ "vpn_server_eas", "" , 0 },
{ "vpn_server_dns", "" , 0 },
{ "vpn_server1_poll", "0" , 0 },
{ "vpn_server1_if", "tun" , 0 },
{ "vpn_server1_proto", "udp" , 0 },
{ "vpn_server1_port", "1194" , 0 },
{ "vpn_server1_firewall", "auto" , 0 },
{ "vpn_server1_crypt", "tls" , 0 },
{ "vpn_server1_comp", "adaptive" , 0 },
{ "vpn_server1_cipher", "default" , 0 },
{ "vpn_server1_dhcp", "1" , 0 },
{ "vpn_server1_r1", "192.168.1.50" , 0 },
{ "vpn_server1_r2", "192.168.1.55" , 0 },
{ "vpn_server1_sn", "10.8.0.0" , 0 },
{ "vpn_server1_nm", "255.255.255.0" , 0 },
{ "vpn_server1_local", "10.8.0.1" , 0 },
{ "vpn_server1_remote", "10.8.0.2" , 0 },
{ "vpn_server1_reneg", "-1" , 0 },
{ "vpn_server1_hmac", "-1" , 0 },
{ "vpn_server1_plan", "1" , 0 },
{ "vpn_server1_ccd", "0" , 0 },
{ "vpn_server1_c2c", "0" , 0 },
{ "vpn_server1_ccd_excl", "0" , 0 },
{ "vpn_server1_ccd_val", "" , 0 },
{ "vpn_server1_pdns", "0" , 0 },
{ "vpn_server1_rgw", "0" , 0 },
{ "vpn_server1_custom", "" , 0 },
{ "vpn_server1_static", "" , 0 },
{ "vpn_server1_ca", "" , 0 },
{ "vpn_server1_crt", "" , 0 },
{ "vpn_server1_key", "" , 0 },
{ "vpn_server1_dh", "" , 0 },
{ "vpn_server1_br", "br0" , 0 },
{ "vpn_server1_route" "0" , 0 },
{ "vpn_server1_routing_val", "" , 0 },
{ "vpn_server2_poll", "0" , 0 },
{ "vpn_server2_if", "tun" , 0 },
{ "vpn_server2_proto", "udp" , 0 },
{ "vpn_server2_port", "1194" , 0 },
{ "vpn_server2_firewall", "auto" , 0 },
{ "vpn_server2_crypt", "tls" , 0 },
{ "vpn_server2_comp", "adaptive" , 0 },
{ "vpn_server2_cipher", "default" , 0 },
{ "vpn_server2_dhcp", "1" , 0 },
{ "vpn_server2_r1", "192.168.1.50" , 0 },
{ "vpn_server2_r2", "192.168.1.55" , 0 },
{ "vpn_server2_sn", "10.8.0.0" , 0 },
{ "vpn_server2_nm", "255.255.255.0" , 0 },
{ "vpn_server2_local", "10.8.0.1" , 0 },
{ "vpn_server2_remote", "10.8.0.2" , 0 },
{ "vpn_server2_reneg", "-1" , 0 },
{ "vpn_server2_hmac", "-1" , 0 },
{ "vpn_server2_plan", "1" , 0 },
{ "vpn_server2_ccd", "0" , 0 },
{ "vpn_server2_c2c", "0" , 0 },
{ "vpn_server2_ccd_excl", "0" , 0 },
{ "vpn_server2_ccd_val", "" , 0 },
{ "vpn_server2_pdns", "0" , 0 },
{ "vpn_server2_rgw", "0" , 0 },
{ "vpn_server2_custom", "" , 0 },
{ "vpn_server2_static", "" , 0 },
{ "vpn_server2_ca", "" , 0 },
{ "vpn_server2_crt", "" , 0 },
{ "vpn_server2_key", "" , 0 },
{ "vpn_server2_dh", "" , 0 },
{ "vpn_server2_br", "br0" , 0 },
{ "vpn_server2_route" "0" , 0 },
{ "vpn_server2_routing_val", "" , 0 },
{ "vpn_client_eas", "" , 0 },
{ "vpn_client1_poll", "0" , 0 },
{ "vpn_client1_if", "tun" , 0 },
{ "vpn_client1_bridge", "1" , 0 },
{ "vpn_client1_nat", "1" , 0 },
{ "vpn_client1_proto", "udp" , 0 },
{ "vpn_client1_addr", "" , 0 },
{ "vpn_client1_port", "1194" , 0 },
{ "vpn_client1_retry", "30" , 0 },
{ "vpn_client1_rg", "0" , 0 },
{ "vpn_client1_firewall", "auto" , 0 },
{ "vpn_client1_crypt", "tls" , 0 },
{ "vpn_client1_comp", "adaptive" , 0 },
{ "vpn_client1_cipher", "default" , 0 },
{ "vpn_client1_local", "10.8.0.2" , 0 },
{ "vpn_client1_remote", "10.8.0.1" , 0 },
{ "vpn_client1_nm", "255.255.255.0" , 0 },
{ "vpn_client1_reneg", "-1" , 0 },
{ "vpn_client1_hmac", "-1" , 0 },
{ "vpn_client1_adns", "0" , 0 },
{ "vpn_client1_rgw", "0" , 0 },
{ "vpn_client1_gw", "" , 0 },
{ "vpn_client1_custom", "" , 0 },
{ "vpn_client1_static", "" , 0 },
{ "vpn_client1_ca", "" , 0 },
{ "vpn_client1_crt", "" , 0 },
{ "vpn_client1_key", "" , 0 },
{ "vpn_client1_br", "br0" , 0 },
{ "vpn_client1_nopull", "0" , 0 },
{ "vpn_client1_nobind", "1" , 0 },
{ "vpn_client1_route", "0" , 0 },
{ "vpn_client1_routing_val", "" , 0 },
{ "vpn_client2_poll", "0" , 0 },
{ "vpn_client2_if", "tun" , 0 },
{ "vpn_client2_bridge", "1" , 0 },
{ "vpn_client2_nat", "1" , 0 },
{ "vpn_client2_proto", "udp" , 0 },
{ "vpn_client2_addr", "" , 0 },
{ "vpn_client2_port", "1194" , 0 },
{ "vpn_client2_retry", "30" , 0 },
{ "vpn_client2_rg", "0" , 0 },
{ "vpn_client2_firewall", "auto" , 0 },
{ "vpn_client2_crypt", "tls" , 0 },
{ "vpn_client2_comp", "adaptive" , 0 },
{ "vpn_client2_cipher", "default" , 0 },
{ "vpn_client2_local", "10.8.0.2" , 0 },
{ "vpn_client2_remote", "10.8.0.1" , 0 },
{ "vpn_client2_nm", "255.255.255.0" , 0 },
{ "vpn_client2_reneg", "-1" , 0 },
{ "vpn_client2_hmac", "-1" , 0 },
{ "vpn_client2_adns", "0" , 0 },
{ "vpn_client2_rgw", "0" , 0 },
{ "vpn_client2_gw", "" , 0 },
{ "vpn_client2_custom", "" , 0 },
{ "vpn_client2_static", "" , 0 },
{ "vpn_client2_ca", "" , 0 },
{ "vpn_client2_crt", "" , 0 },
{ "vpn_client2_key", "" , 0 },
{ "vpn_client2_br", "br0" , 0 },
{ "vpn_client2_nopull", "0" , 0 },
{ "vpn_client2_nobind", "1" , 0 },
{ "vpn_client2_route", "0" , 0 },
{ "vpn_client2_routing_val", "" , 0 },
#endif // vpn
#ifdef TCONFIG_PPTPD
{ "pptp_client_enable", "0" , 0 },
{ "pptp_client_peerdns", "0" , 0 },
{ "pptp_client_mtuenable","0" , 0 },
{ "pptp_client_mtu", "1450" , 0 },
{ "pptp_client_mruenable","0" , 0 },
{ "pptp_client_mru", "1450" , 0 },
{ "pptp_client_nat", "0" , 0 },
{ "pptp_client_srvip", "" , 0 },
{ "pptp_client_srvsub", "10.0.0.0" , 0 },
{ "pptp_client_srvsubmsk","255.0.0.0" , 0 },
{ "pptp_client_username", "" , 0 },
{ "pptp_client_passwd", "" , 0 },
{ "pptp_client_crypt", "0" , 0 },
{ "pptp_client_custom", "" , 0 },
{ "pptp_client_dfltroute","0" , 0 },
#endif
#ifdef TCONFIG_TINC
{"tinc_wanup", "0" , 0 },
{"tinc_name", "" , 0 },
{"tinc_devicetype", "tun" , 0 }, // tun, tap
{"tinc_mode", "switch" , 0 }, // switch, hub
{"tinc_vpn_netmask", "255.255.0.0" , 0 },
{"tinc_private_rsa", "" , 0 },
{"tinc_private_ed25519", "" , 0 },
{"tinc_custom", "" , 0 },
{"tinc_hosts", "" , 0 },
{"tinc_manual_firewall", "" , 0 },
{"tinc_manual_tinc_up", "0" , 0 },
// scripts
{"tinc_tinc_up", "" , 0 },
{"tinc_tinc_down", "" , 0 },
{"tinc_host_up", "" , 0 },
{"tinc_host_down", "" , 0 },
{"tinc_subnet_up", "" , 0 },
{"tinc_subnet_down", "" , 0 },
{"tinc_firewall", "" , 0 },
#endif
#ifdef TCONFIG_BT
// nas-transmission
{ "bt_enable", "0" , 0 },
#ifdef TCONFIG_BBT
{ "bt_binary", "internal" , 0 },
#else
{ "bt_binary", "optware" , 0 },
#endif
{ "bt_binary_custom", "/path/to/binaries/directory" , 0 },
{ "bt_custom", "" , 0 },
{ "bt_port", "51515" , 0 },
{ "bt_dir", "/mnt" , 0 },
{ "bt_incomplete", "1" , 0 },
{ "bt_settings", "down_dir" , 0 },
{ "bt_settings_custom", "/tmp/btclient" , 0 },
{ "bt_rpc_enable", "1" , 0 },
{ "bt_rpc_wan", "0" , 0 },
{ "bt_auth", "1" , 0 },
{ "bt_login", "admin" , 0 },
{ "bt_password", "admin11" , 0 },
{ "bt_port_gui", "9091" , 0 },
{ "bt_dl_enable", "0" , 0 },
{ "bt_ul_enable", "0" , 0 },
{ "bt_dl", "248" , 0 },
{ "bt_ul", "64" , 0 },
{ "bt_peer_limit_global", "150" , 0 },
{ "bt_peer_limit_per_torrent", "30" , 0 },
{ "bt_ul_slot_per_torrent", "10" , 0 },
{ "bt_ratio_enable", "0" , 0 },
{ "bt_ratio", "1.0000" , 0 },
{ "bt_ratio_idle_enable", "0" , 0 },
{ "bt_ratio_idle", "30" , 0 },
{ "bt_dht", "0" , 0 },
{ "bt_pex", "0" , 0 },
{ "bt_lpd", "0" , 0 },
{ "bt_utp", "1" , 0 },
{ "bt_blocklist", "0" , 0 },
{ "bt_blocklist_url", "http://list.iblocklist.com/?list=bt_level1" , 0 },
{ "bt_sleep", "10" , 0 },
{ "bt_check", "1" , 0 },
{ "bt_check_time", "15" , 0 },
{ "bt_dl_queue_enable", "0" , 0 },
{ "bt_dl_queue_size", "5" , 0 },
{ "bt_ul_queue_enable", "0" , 0 },
{ "bt_ul_queue_size", "5" , 0 },
{ "bt_message", "2" , 0 },
{ "bt_log", "0" , 0 },
{ "bt_log_path", "/var/log" , 0 },
#endif
// new_qoslimit
{ "new_qoslimit_enable", "0" , 0 },
{ "new_qoslimit_obw", "" , 0 },
{ "new_qoslimit_ibw", "" , 0 },
{ "new_qoslimit_rules", "" , 0 },
{ "qosl_enable", "0" , 0 },
{ "qosl_tcp", "0" , 0 },//unlimited
{ "qosl_udp", "0" , 0 },//unlimited
{ "qosl_dlc", "" , 0 },
{ "qosl_ulc", "" , 0 },
{ "qosl_dlr", "" , 0 },
{ "qosl_ulr", "" , 0 },
{ "limit_br0_prio", "3" , 0 },
{ "limit_br1_enable", "0" , 0 },
{ "limit_br1_dlc", "" , 0 },
{ "limit_br1_ulc", "" , 0 },
{ "limit_br1_dlr", "" , 0 },
{ "limit_br1_ulr", "" , 0 },
{ "limit_br1_prio", "2" , 0 },
{ "limit_br2_enable", "0" , 0 },
{ "limit_br2_dlc", "" , 0 },
{ "limit_br2_ulc", "" , 0 },
{ "limit_br2_dlr", "" , 0 },
{ "limit_br2_ulr", "" , 0 },
{ "limit_br2_prio", "2" , 0 },
{ "limit_br3_enable", "0" , 0 },
{ "limit_br3_dlc", "" , 0 },
{ "limit_br3_ulc", "" , 0 },
{ "limit_br3_dlr", "" , 0 },
{ "limit_br3_ulr", "" , 0 },
{ "limit_br3_prio", "2" , 0 },
// NoCatSplash. !!Victek
#ifdef TCONFIG_NOCAT
{ "NC_enable", "0" , 0 }, // enable NoCatSplash
{ "NC_Verbosity", "2" , 0 },
{ "NC_GatewayName", "Tomato Captive Portal" , 0 },
{ "NC_GatewayPort", "5280" , 0 },
{ "NC_GatewayMode", "Open" , 0 },
{ "NC_DocumentRoot", "/tmp/splashd" , 0 },
{ "NC_ExcludePorts", "1863" , 0 },
{ "NC_HomePage", "http://google.com" , 0 },
{ "NC_ForcedRedirect", "0" , 0 },
{ "NC_IdleTimeout", "0" , 0 },
{ "NC_MaxMissedARP", "5" , 0 },
{ "NC_PeerChecktimeout", "0" , 0 },
{ "NC_LoginTimeout", "3600" , 0 },
{ "NC_RenewTimeout", "0" , 0 },
{ "NC_AllowedWebHosts", "" , 0 },
{ "NC_BridgeLAN", "br0" , 0 },
#endif
//Tomato RAF - NGINX
#ifdef TCONFIG_NGINX
{"nginx_enable", "0" , 0 }, // NGinX enabled
{"nginx_php", "0" , 0 }, // PHP enabled
{"nginx_keepconf", "0" , 0 }, // Enable/disable keep configuration files unmodified in /etc/nginx
{"nginx_docroot", "/www" , 0 }, // path for server files
{"nginx_port", "85" , 0 }, // port to listen
{"nginx_remote", "0" , 0 }, // open port from WAN site
{"nginx_fqdn", "Tomato" , 0 }, // server name
{"nginx_upload", "100" , 0 }, // upload file size limit
{"nginx_priority", "10" , 0 }, // server priority = worker_priority
{"nginx_custom", "" , 0 }, // additional lines for nginx.conf
{"nginx_httpcustom", "" , 0 }, // additional lines for nginx.conf
{"nginx_servercustom", "" , 0 }, // additional lines for nginx.conf
{"nginx_phpconf", "" , 0 }, // additional lines for php.ini
{"nginx_user", "root" , 0 }, // user/group
{"nginx_override", "0" , 0 }, // additional lines for php.ini
{"nginx_overridefile", "/path/to/nginx.conf" , 0 }, // user/group
// bwq518 - MySQL
{ "mysql_enable", "0" , 0 },
{ "mysql_sleep", "2" , 0 },
{ "mysql_check", "1" , 0 },
{ "mysql_check_time", "1" , 0 },
{ "mysql_binary", "internal" , 0 },
{ "mysql_binary_custom", "/mnt/sda1/mysql/bin" , 0 },
{ "mysql_usb_enable", "1" , 0 },
{ "mysql_dlroot", "" , 0 },
{ "mysql_datadir", "data" , 0 },
{ "mysql_tmpdir", "tmp" , 0 },
{ "mysql_server_custom", "" , 0 },
{ "mysql_port", "3306" , 0 },
{ "mysql_allow_anyhost", "0" , 0 },
{ "mysql_init_rootpass", "0" , 0 },
{ "mysql_username", "root" , 0 }, // mysqladmin username
{ "mysql_passwd", "admin" , 0 }, // mysqladmin password
{ "mysql_key_buffer", "16" , 0 }, //KB
{ "mysql_max_allowed_packet", "4" , 0 }, //MB
{ "mysql_thread_stack", "128" , 0 }, //KB
{ "mysql_thread_cache_size", "8" , 0 },
{ "mysql_init_priv", "0" , 0 },
{ "mysql_table_open_cache", "4" , 0 },
{ "mysql_sort_buffer_size", "128" , 0 }, //KB
{ "mysql_read_buffer_size", "128" , 0 }, //KB
{ "mysql_query_cache_size", "16" , 0 }, //MB
{ "mysql_read_rnd_buffer_size", "256" , 0 }, //KB
{ "mysql_net_buffer_length", "2" , 0 }, //K
{ "mysql_max_connections", "1000" , 0 },
#endif
#ifdef TCONFIG_TOR
{ "tor_enable", "0" , 0 },
{ "tor_socksport", "9050" , 0 },
{ "tor_transport", "9040" , 0 },
{ "tor_dnsport", "9053" , 0 },
{ "tor_datadir", "/tmp/tor" , 0 },
{ "tor_iface", "br0" , 0 },
{ "tor_users", "192.168.1.0/24" , 0 },
{ "tor_custom", "" , 0 },
{ "tor_ports", "80" , 0 },
{ "tor_ports_custom", "80,443,8080:8880" , 0 },
#endif
{ 0, 0, 0}
};
#ifdef TCONFIG_BCMWL6
#ifndef TCONFIG_BCMARM
struct nvram_tuple bcm4360ac_defaults[] = {
{ "pci/2/1/aa2g", "0", 0 },
{ "pci/2/1/aa5g", "7", 0 },
{ "pci/2/1/aga0", "0", 0 },
{ "pci/2/1/aga1", "0", 0 },
{ "pci/2/1/aga2", "0", 0 },
{ "pci/2/1/agbg0", "133", 0 },
{ "pci/2/1/agbg1", "133", 0 },
{ "pci/2/1/agbg2", "133", 0 },
{ "pci/2/1/antswitch", "0", 0 },
{ "pci/2/1/cckbw202gpo", "0", 0 },
{ "pci/2/1/cckbw20ul2gpo", "0", 0 },
{ "pci/2/1/dot11agofdmhrbw202gpo", "0", 0 },
{ "pci/2/1/femctrl", "3", 0 },
{ "pci/2/1/papdcap2g", "0", 0 },
{ "pci/2/1/tworangetssi2g", "0", 0 },
{ "pci/2/1/pdgain2g", "4", 0 },
{ "pci/2/1/epagain2g", "0", 0 },
{ "pci/2/1/tssiposslope2g", "1", 0 },
{ "pci/2/1/gainctrlsph", "0", 0 },
{ "pci/2/1/papdcap5g", "0", 0 },
{ "pci/2/1/tworangetssi5g", "0", 0 },
{ "pci/2/1/pdgain5g", "4", 0 },
{ "pci/2/1/epagain5g", "0", 0 },
{ "pci/2/1/tssiposslope5g", "1", 0 },
{ "pci/2/1/maxp2ga0", "76", 0 },
{ "pci/2/1/maxp2ga1", "76", 0 },
{ "pci/2/1/maxp2ga2", "76", 0 },
{ "pci/2/1/mcsbw202gpo", "0", 0 },
{ "pci/2/1/mcsbw402gpo", "0", 0 },
{ "pci/2/1/measpower", "0x7f", 0 },
{ "pci/2/1/measpower1", "0x7f", 0 },
{ "pci/2/1/measpower2", "0x7f", 0 },
{ "pci/2/1/noiselvl2ga0", "31", 0 },
{ "pci/2/1/noiselvl2ga1", "31", 0 },
{ "pci/2/1/noiselvl2ga2", "31", 0 },
{ "pci/2/1/noiselvl5gha0", "31", 0 },
{ "pci/2/1/noiselvl5gha1", "31", 0 },
{ "pci/2/1/noiselvl5gha2", "31", 0 },
{ "pci/2/1/noiselvl5gla0", "31", 0 },
{ "pci/2/1/noiselvl5gla1", "31", 0 },
{ "pci/2/1/noiselvl5gla2", "31", 0 },
{ "pci/2/1/noiselvl5gma0", "31", 0 },
{ "pci/2/1/noiselvl5gma1", "31", 0 },
{ "pci/2/1/noiselvl5gma2", "31", 0 },
{ "pci/2/1/noiselvl5gua0", "31", 0 },
{ "pci/2/1/noiselvl5gua1", "31", 0 },
{ "pci/2/1/noiselvl5gua2", "31", 0 },
{ "pci/2/1/ofdmlrbw202gpo", "0", 0 },
{ "pci/2/1/pa2ga0", "0xfe72,0x14c0,0xfac7", 0 },
{ "pci/2/1/pa2ga1", "0xfe80,0x1472,0xfabc", 0 },
{ "pci/2/1/pa2ga2", "0xfe82,0x14bf,0xfad9", 0 },
{ "pci/2/1/pcieingress_war", "15", 0 },
{ "pci/2/1/phycal_tempdelta", "255", 0 },
{ "pci/2/1/rawtempsense", "0x1ff", 0 },
{ "pci/2/1/rxchain", "7", 0 },
{ "pci/2/1/rxgainerr2g", "0xffff", 0 },
{ "pci/2/1/rxgainerr5g", "0xffff,0xffff,0xffff,0xffff", 0 },
{ "pci/2/1/rxgains2gelnagaina0", "0", 0 },
{ "pci/2/1/rxgains2gelnagaina1", "0", 0 },
{ "pci/2/1/rxgains2gelnagaina2", "0", 0 },
{ "pci/2/1/rxgains2gtrelnabypa0", "0", 0 },
{ "pci/2/1/rxgains2gtrelnabypa1", "0", 0 },
{ "pci/2/1/rxgains2gtrelnabypa2", "0", 0 },
{ "pci/2/1/rxgains2gtrisoa0", "0", 0 },
{ "pci/2/1/rxgains2gtrisoa1", "0", 0 },
{ "pci/2/1/rxgains2gtrisoa2", "0", 0 },
{ "pci/2/1/sar2g", "18", 0 },
{ "pci/2/1/sar5g", "15", 0 },
{ "pci/2/1/sromrev", "11", 0 },
{ "pci/2/1/subband5gver", "0x4", 0 },
{ "pci/2/1/tempcorrx", "0x3f", 0 },
{ "pci/2/1/tempoffset", "255", 0 },
{ "pci/2/1/temps_hysteresis", "15", 0 },
{ "pci/2/1/temps_period", "15", 0 },
{ "pci/2/1/tempsense_option", "0x3", 0 },
{ "pci/2/1/tempsense_slope", "0xff", 0 },
{ "pci/2/1/tempthresh", "255", 0 },
{ "pci/2/1/txchain", "7", 0 },
{ "pci/2/1/ledbh0", "2", 0 },
{ "pci/2/1/ledbh1", "5", 0 },
{ "pci/2/1/ledbh2", "4", 0 },
{ "pci/2/1/ledbh3", "11", 0 },
{ "pci/2/1/ledbh10", "7", 0 },
{ 0, 0, 0 }
};
#else
struct nvram_tuple bcm4360ac_defaults[] = {
{ "0:ledbh10", "7", 0 },
{ "1:ledbh10", "7", 0 },
{ 0, 0, 0 }
};
#endif
/* nvram override default setting for Media Router */
struct nvram_tuple router_defaults_override_type1[] = {
{ "router_disable", "1", 0 }, /* lan_proto=static lan_stp=0 wan_proto=disabled */
{ "lan_stp", "0", 0 }, /* LAN spanning tree protocol */
{ "wl_wmf_bss_enable", "1", 0 }, /* WMF Enable for IPTV Media or WiFi+PLC */
{ "wl_reg_mode", "h", 0 }, /* Regulatory: 802.11H(h) */
{ "wl_wet_tunnel", "1", 0 }, /* Enable wet tunnel */
{ "wl_taf_enable", "1", 0 }, /* Enable TAF */
/* EBOS feature Media router default */
{ "wl_ebos_enable", "0", 0 }, /* EBOS feature on */
{ "wl_ebos_flags", "104", 0 }, /* 104(0x68) pseudo-round robin */
{ "wl_ebos_prr_threshold", "0x0f000000", 0 }, /* pseudo-round robin threshold */
#ifdef __CONFIG_EMF__
{ "emf_enable", "1", 0 }, /* Enable EMF by default */
{ "wl_wmf_ucigmp_query", "1", 0 }, /* Enable Converting IGMP Query to ucast */
{ "wl_wmf_ucast_upnp", "1", 0 }, /* Enable upnp to ucast conversion */
{ "wl_wmf_igmpq_filter", "1", 0 }, /* Enable igmp query filter */
#endif
{ "wl_acs_fcs_mode", "1", 0 }, /* Enable acsd fcs mode */
{ "wl_acs_dfs", "1", 0 }, /* Enable first DFS chan Selection */
{ "wl_dcs_csa_unicast", "1", 0 }, /* Enable unicast CSA */
/* Exclude ACSD to select 140l, 144u, 140/80, 144/80 to compatible with Ducati 11N */
{ "wl_acs_excl_chans", "0xd98e,0xd88e,0xe28a,0xe38a", 0 },
{ "wl_pspretend_retry_limit", "5", 0 }, /* Enable PsPretend */
{ "wl_pspretend_threshold", "0", 0 }, /* Disable PsPretend Threshold */
{ "wl_acs_chan_dwell_time", "70", 0 }, /* WAR for AP to stay on DFS chan */
{ "wl_frameburst", "on", 0 }, /* BRCM Frambursting mode (off|on) */
{ "wl_amsdu", "off", 0 }, /* Default IPTV AMSDU setting */
{ "wl_rx_amsdu_in_ampdu", "off", 0 }, /* Media RX AMSDU In AMPDU setting */
{ 0, 0, 0 }
};
/* Translates from, for example, wl0_ (or wl0.1_) to wl_. */
/* Only single digits are currently supported */
static void
fix_name(const char *name, char *fixed_name)
{
char *pSuffix = NULL;
/* Translate prefix wlx_ and wlx.y_ to wl_ */
/* Expected inputs are: wld_root, wld.d_root, wld.dd_root
* We accept: wld + '_' anywhere
*/
pSuffix = strchr(name, '_');
if ((strncmp(name, "wl", 2) == 0) && isdigit(name[2]) && (pSuffix != NULL)) {
strcpy(fixed_name, "wl");
strcpy(&fixed_name[2], pSuffix);
return;
}
/* No match with above rules: default to input name */
strcpy(fixed_name, name);
}
/*
* Find nvram param name; return pointer which should be treated as const
* return NULL if not found.
*
* NOTE: This routine special-cases the variable wl_bss_enabled. It will
* return the normal default value if asked for wl_ or wl0_. But it will
* return 0 if asked for a virtual BSS reference like wl0.1_.
*/
char *
nvram_default_get(const char *name)
{
int idx;
char fixed_name[NVRAM_MAX_VALUE_LEN];
fix_name(name, fixed_name);
if (strcmp(fixed_name, "wl_bss_enabled") == 0) {
if (name[3] == '.' || name[4] == '.') { /* Virtual interface */
return "0";
}
}
#ifdef __CONFIG_HSPOT__
if (strcmp(fixed_name, "wl_bss_hs2_enabled") == 0) {
if (name[3] == '.' || name[4] == '.') { /* Virtual interface */
return "0";
}
}
#endif /* __CONFIG_HSPOT__ */
if (!strcmp(nvram_safe_get("devicemode"), "1")) {
for (idx = 0; router_defaults_override_type1[idx].name != NULL; idx++) {
if (strcmp(router_defaults_override_type1[idx].name, fixed_name) == 0) {
return router_defaults_override_type1[idx].value;
}
}
}
for (idx = 0; router_defaults[idx].name != NULL; idx++) {
if (strcmp(router_defaults[idx].name, fixed_name) == 0) {
return router_defaults[idx].value;
}
}
return NULL;
}
/* validate/restore all per-interface related variables */
void
nvram_validate_all(char *prefix, bool restore)
{
struct nvram_tuple *t;
char tmp[100];
char *v;
for (t = router_defaults; t->name; t++) {
if (!strncmp(t->name, "wl_", 3)) {
strcat_r(prefix, &t->name[3], tmp);
if (!restore && nvram_get(tmp))
continue;
v = nvram_get(t->name);
nvram_set(tmp, v ? v : t->value);
}
}
/* override router type1 nvram setting */
if (!strcmp(nvram_safe_get("devicemode"), "1")) {
for (t = router_defaults_override_type1; t->name; t++) {
if (!strncmp(t->name, "wl_", 3)) {
strcat_r(prefix, &t->name[3], tmp);
if (!restore && nvram_get(tmp))
continue;
v = nvram_get(t->name);
nvram_set(tmp, v ? v : t->value);
}
}
}
}
/* restore specific per-interface variable */
void
nvram_restore_var(char *prefix, char *name)
{
struct nvram_tuple *t;
char tmp[100];
for (t = router_defaults; t->name; t++) {
if (!strncmp(t->name, "wl_", 3) && !strcmp(&t->name[3], name)) {
nvram_set(strcat_r(prefix, name, tmp), t->value);
break;
}
}
/* override router type1 setting */
if (!strcmp(nvram_safe_get("devicemode"), "1")) {
for (t = router_defaults_override_type1; t->name; t++) {
if (!strncmp(t->name, "wl_", 3) && !strcmp(&t->name[3], name)) {
nvram_set(strcat_r(prefix, name, tmp), t->value);
break;
}
}
}
}
#endif
| 41.752035 | 2,162 | 0.508039 |
d915d2436c8d9d522f0964f40e3a1d1f5738f115 | 1,437 | h | C | Store/include/utils.h | LightningMods/PS4-Store | f9e2df9a1efe1d3745ddcf6413bfec3465d043f5 | [
"MIT"
] | 116 | 2019-04-13T10:40:21.000Z | 2022-03-27T11:55:16.000Z | Store/include/utils.h | LightningMods/PS4-Store | f9e2df9a1efe1d3745ddcf6413bfec3465d043f5 | [
"MIT"
] | 14 | 2020-08-10T13:37:10.000Z | 2022-03-27T19:31:36.000Z | Store/include/utils.h | LightningMods/PS4-Store | f9e2df9a1efe1d3745ddcf6413bfec3465d043f5 | [
"MIT"
] | 17 | 2019-05-27T22:35:10.000Z | 2022-03-26T21:46:00.000Z | #pragma once
#include "defines.h"
#include <MsgDialog.h>
#include <ImeDialog.h>
#include <CommonDialog.h>
#include <KeyboardDialog.h>
#include <pl_ini.h>
#define DIM(x) (sizeof(x)/sizeof(*(x)))
#define NORMAL 1
#define FATAL 2
#define WARNING 3
#define STORE_LOG "/user/app/NPXS39041/logs/log.txt"
static const char *option_panel_text[] =
{
"Content Delivery Network",
"Temporary Path",
"Detected USB",
"INI Path",
"Custom FreeType font Path",
// following doesn't store strings for any Paths...
"Store Downloads on USB",
"Save Settings"
};
enum STR_type
{
CDN_URL,
TMP_PATH,
USB_PATH,
INI_PATH,
FNT_PATH,
NUM_OF_STRINGS
};
// indexed options
typedef struct
{
char *opt[ NUM_OF_STRINGS ];
int StoreOnUSB;
// more options
} StoreOptions;
char *usbpath(void);
int LoadOptions(StoreOptions *set);
int SaveOptions(StoreOptions *set);
// sysctl
uint32_t SysctlByName_get_sdk_version(void);
char *checkedsize;
char *calculateSize(uint64_t size);
void *(*libc_memset)(void *, int, size_t);
int msgok(int level, char* format, ...);
int loadmsg(char* format, ...);
void klog(const char *format, ...);
void CalcAppsize(char *path);
char* cutoff(const char* str, int from, int to);
int getjson(int Pagenumb, char* cdn);
int MD5_hash_compare(const char* file1, const char* hash);
#define assert(expr) if (!(expr)) msgok(FATAL, "Assertion Failed!");
| 19.418919 | 68 | 0.683368 |
d916935d841d143f1d55842514552a7fa515d116 | 21,301 | c | C | src/vendor/foundation/system.c | pbtrung/seshat | d66d96d6946365007967d2b4515655e3725982de | [
"BSD-3-Clause"
] | null | null | null | src/vendor/foundation/system.c | pbtrung/seshat | d66d96d6946365007967d2b4515655e3725982de | [
"BSD-3-Clause"
] | null | null | null | src/vendor/foundation/system.c | pbtrung/seshat | d66d96d6946365007967d2b4515655e3725982de | [
"BSD-3-Clause"
] | null | null | null | /* system.c - Foundation library - Public Domain - 2013 Mattias Jansson /
* Rampant Pixels
*
* This library provides a cross-platform foundation library in C11 providing
* basic support data types and functions to write applications and games in a
* platform-independent fashion. The latest source code is always available at
*
* https://github.com/rampantpixels/foundation_lib
*
* This library is put in the public domain; you can redistribute it and/or
* modify it without any restrictions.
*/
#include <foundation/foundation.h>
#include <foundation/internal.h>
#if FOUNDATION_PLATFORM_POSIX
#include <foundation/posix.h>
#include <net/if.h>
#include <sys/socket.h>
#endif
#if FOUNDATION_PLATFORM_ANDROID
#include <cpu-features.h>
#include <foundation/android.h>
#endif
#if FOUNDATION_PLATFORM_PNACL
#include <foundation/pnacl.h>
extern char *strerror_r(int __errnum, char *__buf, size_t __buflen);
#endif
#if FOUNDATION_PLATFORM_BSD
#include <sys/sysctl.h>
#include <sys/types.h>
#endif
#if FOUNDATION_PLATFORM_APPLE
#include <sys/sysctl.h>
extern unsigned int _system_process_info_processor_count(void);
extern int _system_show_alert(const char *, size_t, const char *, size_t, int);
#endif
#define SYSTEM_BUFFER_SIZE 511
FOUNDATION_DECLARE_THREAD_LOCAL(char *, system_buffer, 0)
static device_orientation_t _system_device_orientation =
DEVICEORIENTATION_UNKNOWN;
static event_stream_t *_system_event_stream;
struct platform_info_t {
platform_t platform;
architecture_t architecture;
byteorder_t byteorder;
};
typedef struct platform_info_t platform_info_t;
static const platform_info_t _platform_info = {
#if FOUNDATION_PLATFORM_WINDOWS
PLATFORM_WINDOWS,
#elif FOUNDATION_PLATFORM_ANDROID
PLATFORM_ANDROID,
#elif FOUNDATION_PLATFORM_LINUX_RASPBERRYPI
PLATFORM_RASPBERRYPI,
#elif FOUNDATION_PLATFORM_LINUX
PLATFORM_LINUX,
#elif FOUNDATION_PLATFORM_MACOS
PLATFORM_MACOS,
#elif FOUNDATION_PLATFORM_IOS
PLATFORM_IOS,
#elif FOUNDATION_PLATFORM_PNACL
PLATFORM_PNACL,
#elif FOUNDATION_PLATFORM_BSD
PLATFORM_BSD,
#elif FOUNDATION_PLATFORM_TIZEN
PLATFORM_TIZEN,
#else
#error Unknown platform
#endif
#if FOUNDATION_ARCH_X86_64
ARCHITECTURE_X86_64,
#elif FOUNDATION_ARCH_X86
ARCHITECTURE_X86,
#elif FOUNDATION_ARCH_PPC_64
ARCHITECTURE_PPC_64,
#elif FOUNDATION_ARCH_PPC
ARCHITECTURE_PPC,
#elif FOUNDATION_ARCH_ARM8_64
ARCHITECTURE_ARM8_64,
#elif FOUNDATION_ARCH_ARM8
ARCHITECTURE_ARM8,
#elif FOUNDATION_ARCH_ARM7
ARCHITECTURE_ARM7,
#elif FOUNDATION_ARCH_ARM6
ARCHITECTURE_ARM6,
#elif FOUNDATION_ARCH_ARM5
ARCHITECTURE_ARM5,
#elif FOUNDATION_ARCH_MIPS_64
ARCHITECTURE_MIPS_64,
#elif FOUNDATION_ARCH_MIPS
ARCHITECTURE_MIPS,
#elif FOUNDATION_ARCH_GENERIC
ARCHITECTURE_GENERIC,
#else
#error Unknown architecture
#endif
#if FOUNDATION_ARCH_ENDIAN_LITTLE
BYTEORDER_LITTLEENDIAN
#else
BYTEORDER_BIGENDIAN
#endif
};
static char *_system_buffer(void) {
char *buffer = get_thread_system_buffer();
if (!buffer) {
buffer = memory_allocate(0, SYSTEM_BUFFER_SIZE + 1, 0,
MEMORY_PERSISTENT | MEMORY_ZERO_INITIALIZED);
set_thread_system_buffer(buffer);
}
return buffer;
}
platform_t system_platform(void) {
return _platform_info.platform;
}
architecture_t system_architecture(void) {
return _platform_info.architecture;
}
byteorder_t system_byteorder(void) {
return _platform_info.byteorder;
}
#if FOUNDATION_PLATFORM_WINDOWS
#include <foundation/windows.h>
static object_t _system_library_iphlpapi;
int _system_initialize(void) {
_system_event_stream = event_stream_allocate(128);
return 0;
}
void _system_finalize(void) {
if (_system_library_iphlpapi)
library_unload(_system_library_iphlpapi);
_system_library_iphlpapi = 0;
event_stream_deallocate(_system_event_stream);
_system_event_stream = 0;
}
int system_error(void) {
return (int)GetLastError();
}
void system_error_reset(void) {
SetLastError(0);
}
string_const_t system_error_message(int code) {
char *errmsg;
if (!code)
code = system_error();
if (!code)
return string_const(STRING_CONST("<no error>"));
errmsg = _system_buffer();
errmsg[0] = 0;
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
0, (unsigned int)code & 0xBFFFFFFF,
0 /*LANG_SYSTEM_DEFAULT*/
/*MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT )*/,
errmsg, SYSTEM_BUFFER_SIZE, 0);
return string_strip(errmsg, string_length(errmsg),
STRING_CONST(STRING_WHITESPACE));
}
string_t system_hostname(char *buffer, size_t capacity) {
DWORD size = (DWORD)capacity;
if (!GetComputerNameA(buffer, &size))
return string_copy(buffer, capacity, STRING_CONST("unknown"));
return (string_t) {
buffer, size
};
}
uint64_t system_hostid(void) {
/*lint --e{970} */
union {
unsigned char hostid[8];
uint64_t val;
} hostid;
IP_ADAPTER_INFO adapter_info[16];
unsigned int status, i, j;
unsigned long buffer_length;
DWORD(STDCALL * fn_get_adapters_info)(PIP_ADAPTER_INFO, PULONG) = 0;
if (!_system_library_iphlpapi)
_system_library_iphlpapi = library_load(STRING_CONST("iphlpapi"));
if (_system_library_iphlpapi) {
/*lint -e{611} */
fn_get_adapters_info =
(DWORD(STDCALL *)(PIP_ADAPTER_INFO, PULONG))library_symbol(
_system_library_iphlpapi, STRING_CONST("GetAdaptersInfo"));
}
if (!fn_get_adapters_info)
return 0;
hostid.val = 0;
buffer_length = sizeof(adapter_info); // Save memory size of buffer
memset(adapter_info, 0, sizeof(adapter_info));
status = fn_get_adapters_info(adapter_info, &buffer_length);
if (status == ERROR_SUCCESS)
for (i = 0; i < 16; ++i) {
if (adapter_info[i].Type == MIB_IF_TYPE_ETHERNET) {
for (j = 0; j < 6; ++j)
hostid.hostid[5 - j] = adapter_info[i].Address[j];
break;
}
}
return hostid.val;
}
string_t system_username(char *buffer, size_t capacity) {
DWORD size = (DWORD)capacity;
if (!GetUserNameA(buffer, &size))
return string_copy(buffer, capacity, STRING_CONST("unknown"));
return (string_t) {
buffer, size
};
}
size_t system_hardware_threads(void) {
SYSTEM_INFO system_info;
GetSystemInfo(&system_info);
return system_info.dwNumberOfProcessors;
}
void system_process_events(void) {}
bool system_debugger_attached(void) {
return IsDebuggerPresent();
}
void system_pause(void) {
system("pause");
}
static uint32_t _system_default_locale(void) {
return LOCALE_DEFAULT;
}
typedef int(STDCALL *fnGetLocaleInfoEx)(LPCWSTR, LCTYPE, LPWSTR, int);
static uint32_t _system_user_locale(void) {
fnGetLocaleInfoEx get_locale_info = (fnGetLocaleInfoEx)GetProcAddress(
GetModuleHandleA("kernel32.dll"), "GetLocaleInfoEx");
if (get_locale_info) {
wchar_t locale_sname[128] = {0};
union {
char buffer[8];
uint32_t value;
} locale_data;
string_t locale_string;
if (get_locale_info(0 /*LOCALE_NAME_USER_DEFAULT*/,
0x0000005c /*LOCALE_SNAME*/, locale_sname,
32) > 0) {
locale_string = string_convert_utf16(
locale_data.buffer, sizeof(locale_data.buffer),
(uint16_t *)locale_sname, wstring_length(locale_sname));
if (string_match_pattern(STRING_ARGS(locale_string),
STRING_CONST("?"
"?"
"-"
"?"
"?"))) {
locale_data.buffer[2] = locale_data.buffer[3];
locale_data.buffer[3] = locale_data.buffer[4];
locale_data.buffer[4] = 0;
return locale_data.value;
}
}
}
return _system_default_locale();
}
#elif FOUNDATION_PLATFORM_POSIX || FOUNDATION_PLATFORM_PNACL
#if !FOUNDATION_PLATFORM_ANDROID && !FOUNDATION_PLATFORM_PNACL
#include <ifaddrs.h>
#endif
int _system_initialize(void) {
_system_event_stream = event_stream_allocate(128);
return 0;
}
void _system_finalize(void) {
event_stream_deallocate(_system_event_stream);
_system_event_stream = 0;
}
int system_error(void) {
return errno;
}
void system_error_reset(void) {
errno = 0;
}
string_const_t system_error_message(int code) {
if (!code)
code = system_error();
if (!code)
return string_const(STRING_CONST("<no error>"));
char *buffer = _system_buffer();
#if (FOUNDATION_PLATFORM_LINUX || FOUNDATION_PLATFORM_PNACL) && \
defined(_GNU_SOURCE)
if ((buffer = strerror_r(code, buffer, SYSTEM_BUFFER_SIZE)) != nullptr)
return string_const(buffer, string_length(buffer));
#else
if (strerror_r(code, buffer, SYSTEM_BUFFER_SIZE) == 0)
return string_const(buffer, string_length(buffer));
#endif
return string_const(STRING_CONST("<no error string>"));
}
string_t system_hostname(char *buffer, size_t size) {
int ret = gethostname(buffer, size);
if ((ret < 0) || !size || !*buffer)
return string_copy(buffer, size, STRING_CONST("unknown"));
return (string_t) {
buffer, string_length(buffer)
};
}
string_t system_username(char *buffer, size_t size) {
struct passwd passwd;
struct passwd *result;
#if FOUNDATION_PLATFORM_ANDROID && (__ANDROID_API__ <= 19)
result = 0;
#else
if (getpwuid_r(getuid(), &passwd, buffer, size, &result) != 0)
result = 0;
#endif
if (!result || !result->pw_name || !*result->pw_name) {
#if FOUNDATION_PLATFORM_ANDROID || FOUNDATION_PLATFORM_PNACL
const char *login = getlogin();
if (!login || !*login)
return string_copy(buffer, size, STRING_CONST("unknown"));
return string_copy(buffer, size, login, string_length(login));
#elif FOUNDATION_PLATFORM_BSD
if (getlogin_r(buffer, (int)size) != 0)
return string_copy(buffer, size, STRING_CONST("unknown"));
return (string_t) {
buffer, string_length(buffer)
};
#else
if (getlogin_r(buffer, size) != 0)
return string_copy(buffer, size, STRING_CONST("unknown"));
return (string_t) {
buffer, string_length(buffer)
};
#endif
}
return (string_t) {
result->pw_name, string_length(result->pw_name)
};
}
#if FOUNDATION_PLATFORM_APPLE || FOUNDATION_PLATFORM_BSD
#include <net/if_dl.h>
static uint64_t _system_hostid_lookup(struct ifaddrs *ifaddr) {
unsigned int j;
union {
uint64_t id;
uint8_t FOUNDATION_ALIGN(8) buffer[8];
} hostid;
if (ifaddr->ifa_addr && (ifaddr->ifa_addr->sa_family == AF_LINK)) {
struct sockaddr_dl addr_dl;
memcpy(&addr_dl, ifaddr->ifa_addr, sizeof(addr_dl));
if (addr_dl.sdl_alen == 6) {
hostid.id = 0;
for (j = 0; j < 6; ++j)
hostid.buffer[5 - j] = (uint8_t)LLADDR(&addr_dl)[j];
return hostid.id;
}
}
return 0;
}
#elif FOUNDATION_PLATFORM_POSIX
static uint64_t _system_hostid_lookup(int sock, struct ifreq *ifr) {
unsigned int j;
union {
uint64_t id;
uint8_t FOUNDATION_ALIGN(8) buffer[8];
} hostid;
if (ioctl(sock, SIOCGIFHWADDR, ifr) < 0) {
log_warnf(0, WARNING_SYSTEM_CALL_FAIL,
STRING_CONST("Unable to get hw address for interface %s"),
ifr->ifr_name);
return 0;
}
hostid.id = 0;
for (j = 0; j < 6; ++j)
hostid.buffer[5 - j] = (uint8_t)ifr->ifr_hwaddr.sa_data[j];
return hostid.id;
}
#endif
uint64_t system_hostid(void) {
#if FOUNDATION_PLATFORM_PNACL
// Not implemented yet
return 0;
#else
uint64_t hostid = 0;
#if FOUNDATION_PLATFORM_ANDROID
struct ifconf ifc;
struct ifreq *ifrarr;
int sock = socket(PF_INET, SOCK_DGRAM, 0);
if (sock < 0) {
log_warn(0, WARNING_SYSTEM_CALL_FAIL,
STRING_CONST("Unable to lookup system hostid (no socket)"));
return 0;
}
memset(&ifc, 0, sizeof(ifc));
if (ioctl(sock, SIOCGIFCONF, &ifc) == 0) {
ifrarr =
memory_allocate(0, (unsigned int)ifc.ifc_len, 0, MEMORY_TEMPORARY);
ifc.ifc_ifcu.ifcu_req = ifrarr;
if (ioctl(sock, SIOCGIFCONF, &ifc) == 0) {
int numif = ifc.ifc_len / (int)sizeof(struct ifreq);
int iif;
for (iif = 0; (iif < numif) && !hostid; ++iif) {
struct ifreq *ifr = &ifrarr[iif];
if (ifr->ifr_name && string_equal(ifr->ifr_name, 2, "lo", 2))
continue;
hostid = _system_hostid_lookup(sock, ifr);
}
} else {
log_warn(
0, WARNING_SYSTEM_CALL_FAIL,
STRING_CONST(
"Unable to lookup system hostid (query ioctl failed)"));
}
memory_deallocate(ifrarr);
} else {
log_warn(0, WARNING_SYSTEM_CALL_FAIL,
STRING_CONST("Unable to lookup system hostid (ioctl failed)"));
}
close(sock);
#elif FOUNDATION_PLATFORM_APPLE || FOUNDATION_PLATFORM_BSD
struct ifaddrs *ifaddr;
struct ifaddrs *ifa;
if (getifaddrs(&ifaddr) == 0) {
for (ifa = ifaddr; ifa && !hostid; ifa = ifa->ifa_next) {
if (memcmp(ifa->ifa_name, "lo", 2) == 0)
continue;
hostid = _system_hostid_lookup(ifa);
}
freeifaddrs(ifaddr);
}
#else
struct ifaddrs *ifaddr;
struct ifaddrs *ifa;
struct ifreq ifr;
int sock = socket(PF_INET, SOCK_DGRAM, 0);
if (getifaddrs(&ifaddr) == 0) {
for (ifa = ifaddr; ifa && !hostid; ifa = ifa->ifa_next) {
size_t ifa_length = string_length(ifa->ifa_name);
if (string_equal(ifa->ifa_name, ifa_length, "lo", 2))
continue;
memset(&ifr, 0, sizeof(ifr));
string_copy(ifr.ifr_name, sizeof(ifr.ifr_name), ifa->ifa_name,
ifa_length);
hostid = _system_hostid_lookup(sock, &ifr);
}
freeifaddrs(ifaddr);
} else {
memset(&ifr, 0, sizeof(ifr));
string_copy(ifr.ifr_name, sizeof(ifr.ifr_name), "eth0", 4);
hostid = _system_hostid_lookup(sock, &ifr);
}
close(sock);
#endif
return hostid;
#endif
}
size_t system_hardware_threads(void) {
#if FOUNDATION_PLATFORM_APPLE
return _system_process_info_processor_count();
#elif FOUNDATION_PLATFORM_ANDROID
return (size_t)android_getCpuCount();
#elif FOUNDATION_PLATFORM_PNACL
return (size_t)sysconf(_SC_NPROCESSORS_ONLN);
#elif FOUNDATION_PLATFORM_BSD
int ctlarg[2], ncpu;
size_t len;
ctlarg[0] = CTL_HW;
ctlarg[1] = HW_NCPU;
len = sizeof(ncpu);
if (sysctl(ctlarg, 2, &ncpu, &len, 0, 0) == 0)
return (size_t)ncpu;
return 1;
#else
cpu_set_t prevmask, testmask;
CPU_ZERO(&prevmask);
CPU_ZERO(&testmask);
sched_getaffinity(0, sizeof(prevmask), &prevmask); // Get current mask
sched_setaffinity(0, sizeof(testmask), &testmask); // Set zero mask
sched_getaffinity(0, sizeof(testmask), &testmask); // Get mask for all CPUs
sched_setaffinity(0, sizeof(prevmask), &prevmask); // Reset current mask
int num = CPU_COUNT(&testmask);
return (size_t)(num > 1 ? num : 1);
#endif
}
void system_process_events(void) {
#if FOUNDATION_PLATFORM_ANDROID
profile_begin_block(STRING_CONST("system events"));
int ident = 0;
int events = 0;
int nummsg = 0;
struct android_poll_source *source = 0;
struct android_app *app = android_app();
while ((ident = ALooper_pollOnce(0, 0, &events, (void **)&source)) >= 0) {
// Process this event.
if (source)
source->process(app, source);
++nummsg;
}
profile_end_block();
#endif
}
bool system_debugger_attached(void) {
#if FOUNDATION_PLATFORM_APPLE
int mib[4];
struct kinfo_proc info;
size_t size;
memset(&info, 0, sizeof(info));
info.kp_proc.p_flag = 0;
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid();
size = sizeof(info);
sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, 0, 0);
return ((info.kp_proc.p_flag & P_TRACED) != 0);
#elif FOUNDATION_PLATFORM_LINUX || FOUNDATION_PLATFORM_ANDROID
int fd, ib, ofs, partial = 0;
bool read_pid = false;
ssize_t nread;
static const char tracer_pid[] = "TracerPid:";
fd = open("/proc/self/status", O_RDONLY);
if (fd < 0)
return false;
do {
char buffer[128];
nread = read(fd, buffer, sizeof(buffer));
if (nread > 0) {
for (ib = 0; (ib < nread); ++ib) {
if (read_pid) {
if ((buffer[ib] >= '1') && (buffer[ib] <= '9'))
return true;
if ((buffer[ib] != ' ') && (buffer[ib] != '\t'))
return false;
} else {
for (ofs = 0; (ib + ofs < nread) && tracer_pid[partial];
++partial, ++ofs) {
if (buffer[ib + ofs] != tracer_pid[partial])
break;
}
if (!tracer_pid[partial]) {
ib += ofs;
read_pid = true;
} else if (ib + partial < nread)
partial = 0;
}
}
}
} while (nread > 0);
return false;
#else
return false;
#endif
}
void system_pause(void) {}
static uint32_t _system_default_locale(void) {
return LOCALE_DEFAULT;
}
static uint32_t _system_user_locale(void) {
return _system_default_locale();
}
#endif
static uint32_t _system_locale;
uint32_t system_locale(void) {
return _system_locale ? _system_locale : _system_user_locale();
}
string_t system_locale_string(char *buffer, size_t capacity) {
uint32_t locale = system_locale();
size_t length = (capacity > 4) ? 4 : capacity;
memcpy(buffer, &locale, length);
if (capacity > 4)
buffer[4] = 0;
return (string_t) {
buffer, length
};
}
void system_set_locale(uint32_t locale) {
_system_locale = locale;
}
uint16_t system_language(void) {
return (uint16_t)(system_locale() & 0xFFFF);
}
uint16_t system_country(void) {
return (uint16_t)((system_locale() >> 16) & 0xFFFF);
}
void system_set_device_orientation(device_orientation_t orientation) {
if (_system_device_orientation == orientation)
return;
_system_device_orientation = orientation;
system_post_event(FOUNDATIONEVENT_DEVICE_ORIENTATION);
}
device_orientation_t system_device_orientation(void) {
return _system_device_orientation;
}
event_stream_t *system_event_stream(void) {
return _system_event_stream;
}
void system_post_event(foundation_event_id event) {
if (_system_event_stream)
event_post(_system_event_stream, event, 0, 0, 0, 0);
}
bool system_message_box(const char *title, size_t title_length,
const char *message, size_t message_length,
bool cancel_button) {
if (environment_application()->flags & APPLICATION_UTILITY)
return true;
#if FOUNDATION_PLATFORM_WINDOWS
FOUNDATION_UNUSED(message_length);
FOUNDATION_UNUSED(title_length);
return (MessageBoxA(0, message, title,
cancel_button ? MB_OKCANCEL : MB_OK) == IDOK);
#elif FOUNDATION_PLATFORM_APPLE
return _system_show_alert(title, title_length, message, message_length,
cancel_button ? 1 : 0) > 0;
#elif 0 // FOUNDATION_PLATFORM_LINUX
char *buf = string_format("%s\n\n%s\n", title, message);
pid_t pid = fork();
switch (pid) {
case -1:
// error
string_deallocate(buf);
break;
case 0:
execlp("xmessage", "xmessage", "-buttons",
cancel_button ? "OK:101,Cancel:102" : "OK:101", "-default", "OK",
"-center", buf, (char *)0);
_exit(-1);
break;
default:
string_deallocate(buf);
int status;
waitpid(pid, &status, 0);
if ((!WIFEXITED(status)) || (WEXITSTATUS(status) != 101))
return false;
return true;
}
return false;
#else
// Not implemented
FOUNDATION_UNUSED(message);
FOUNDATION_UNUSED(message_length);
FOUNDATION_UNUSED(title);
FOUNDATION_UNUSED(title_length);
FOUNDATION_UNUSED(cancel_button);
return false;
#endif
}
void system_thread_finalize(void) {
char *buffer = get_thread_system_buffer();
if (!buffer)
return;
memory_deallocate(buffer);
set_thread_system_buffer(0);
}
| 27.771838 | 97 | 0.632506 |
d9177a3185f369b13e6fe78a151b3a54f761c9ce | 249 | h | C | THREE/Renderers/Shaders/newShaderLib/equirect_vert.h | hjoykim/THREE | b69252c7e46069ae52133de4b53870b8f34b3a69 | [
"MIT"
] | 1 | 2021-08-23T00:00:44.000Z | 2021-08-23T00:00:44.000Z | THREE/Renderers/Shaders/newShaderLib/equirect_vert.h | hjoykim/THREE | b69252c7e46069ae52133de4b53870b8f34b3a69 | [
"MIT"
] | null | null | null | THREE/Renderers/Shaders/newShaderLib/equirect_vert.h | hjoykim/THREE | b69252c7e46069ae52133de4b53870b8f34b3a69 | [
"MIT"
] | null | null | null | const char* equirect_vert =R"(
varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}
)"; | 5.659091 | 63 | 0.650602 |
d918a8e6f68e4d21f88350619409c7b5e2d3b6f0 | 3,324 | c | C | redis-4.0/tests/ld2string.c | hoohack/read-redis-src | 87806dfe74ce1a4f97f879ca9bb2bd58dbd1ef94 | [
"MIT"
] | 39 | 2017-11-09T03:59:42.000Z | 2021-09-07T07:31:37.000Z | redis-4.0/tests/ld2string.c | hoohack/read-redis-src | 87806dfe74ce1a4f97f879ca9bb2bd58dbd1ef94 | [
"MIT"
] | null | null | null | redis-4.0/tests/ld2string.c | hoohack/read-redis-src | 87806dfe74ce1a4f97f879ca9bb2bd58dbd1ef94 | [
"MIT"
] | 9 | 2018-04-25T06:35:07.000Z | 2020-05-20T03:00:39.000Z | #include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#undef isnan
#define isnan(x) \
__extension__({ __typeof (x) __x_a = (x); \
__builtin_expect(__x_a != __x_a, 0); })
#undef isfinite
#define isfinite(x) \
__extension__ ({ __typeof (x) __x_f = (x); \
__builtin_expect(!isnan(__x_f - __x_f), 1); })
#undef isinf
#define isinf(x) \
__extension__ ({ __typeof (x) __x_i = (x); \
__builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })
#if defined(__GNUC__)
# define HUGE_VAL __builtin_huge_val()
# define HUGE_VALF __builtin_huge_valf()
# define HUGE_VALL __builtin_huge_vall()
# define NAN __builtin_nanf("0x7fc00000")
#else
# define HUGE_VAL 1e500
# define HUGE_VALF 1e50f
# define HUGE_VALL 1e5000L
# define NAN __nan()
#endif
int string2ld(const char *s, size_t slen, long double *dp) {
char buf[256];
long double value;
char *eptr;
if (slen >= sizeof(buf)) return 0;
memcpy(buf,s,slen);
buf[slen] = '\0';
errno = 0;
value = strtold(buf, &eptr);
if (isspace(buf[0]) || eptr[0] != '\0' ||
(errno == ERANGE &&
(value == HUGE_VAL || value == -HUGE_VAL || value == 0)) ||
errno == EINVAL ||
isnan(value))
return 0;
if (dp) *dp = value;
return 1;
}
int ld2string(char *buf, size_t len, long double value, int humanfriendly) {
size_t l;
/* 数值太大 */
if (isinf(value)) {
/* Libc in odd systems (Hi Solaris!) will format infinite in a
* different way, so better to handle it in an explicit way. */
if (len < 5) return 0; /* No room. 5 is "-inf\0" */
if (value > 0) {
memcpy(buf,"inf",3);
l = 3;
} else {
memcpy(buf,"-inf",4);
l = 4;
}
} else if (humanfriendly) {
/* We use 17 digits precision since with 128 bit floats that precision
* after rounding is able to represent most small decimal numbers in a
* way that is "non surprising" for the user (that is, most small
* decimal numbers will be represented in a way that when converted
* back into a string are exactly the same as what the user typed.) */
/*
* 使用17位精度保存数据
* 128位表示的浮点数,在四舍五入的大部分小数
*/
l = snprintf(buf,len,"%.17Lf", value);
if (l+1 > len) return 0; /* No room. */
/* Now remove trailing zeroes after the '.' */
if (strchr(buf,'.') != NULL) {
char *p = buf+l-1;
while(*p == '0') {
p--;
l--;
}
if (*p == '.') l--;
}
} else {
l = snprintf(buf,len,"%.17Lg", value);
/* l+1大于buf长度,没有足够空间存储 */
if (l+1 > len) return 0; /* No room. */
}
/* 增加结束位 */
buf[l] = '\0';
return l;
}
/*
* 可以无损进行 浮点数<=>字符串 的转换
*/
int main()
{
long double ld = 1.12345678912334455666;
char buf[256];
int l = ld2string(buf, sizeof(buf), ld, 0);
long double *ld2 = (long double *)malloc(l * sizeof(long double *));
printf("str: %s\n", buf);/* str: 1.1234567891233445 */
int l2 = string2ld(buf, strlen(buf), ld2);
printf("orig long double : %.17Lg\n", *ld2);/* orig long double : 1.1234567891233445 */
return 0;
}
| 27.7 | 88 | 0.54994 |
d9198bda44153ac6641aa52211d373e48bac9d36 | 3,145 | h | C | FreeBSD/sys/dev/dwc/if_dwcvar.h | TigerBSD/FreeBSD-Custom-ThinkPad | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | 4 | 2016-08-22T22:02:55.000Z | 2017-03-04T22:56:44.000Z | FreeBSD/sys/dev/dwc/if_dwcvar.h | TigerBSD/FreeBSD-Custom-ThinkPad | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | 21 | 2016-08-11T09:43:43.000Z | 2017-01-29T12:52:56.000Z | FreeBSD/sys/dev/dwc/if_dwcvar.h | TigerBSD/TigerBSD | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | null | null | null | /*-
* Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com>
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* Ethernet media access controller (EMAC)
* Chapter 17, Altera Cyclone V Device Handbook (CV-5V2 2014.07.22)
*
* EMAC is an instance of the Synopsys DesignWare 3504-0
* Universal 10/100/1000 Ethernet MAC (DWC_gmac).
*/
#ifndef __IF_DWCVAR_H__
#define __IF_DWCVAR_H__
/*
* Driver data and defines.
*/
#define RX_MAX_PACKET 0x7ff
#define RX_DESC_COUNT 1024
#define RX_DESC_SIZE (sizeof(struct dwc_hwdesc) * RX_DESC_COUNT)
#define TX_DESC_COUNT 1024
#define TX_DESC_SIZE (sizeof(struct dwc_hwdesc) * TX_DESC_COUNT)
struct dwc_bufmap {
bus_dmamap_t map;
struct mbuf *mbuf;
};
struct dwc_softc {
struct resource *res[2];
bus_space_tag_t bst;
bus_space_handle_t bsh;
device_t dev;
int mactype;
int mii_clk;
device_t miibus;
struct mii_data * mii_softc;
struct ifnet *ifp;
int if_flags;
struct mtx mtx;
void * intr_cookie;
struct callout dwc_callout;
boolean_t link_is_up;
boolean_t is_attached;
boolean_t is_detaching;
int tx_watchdog_count;
int stats_harvest_count;
/* RX */
bus_dma_tag_t rxdesc_tag;
bus_dmamap_t rxdesc_map;
struct dwc_hwdesc *rxdesc_ring;
bus_addr_t rxdesc_ring_paddr;
bus_dma_tag_t rxbuf_tag;
struct dwc_bufmap rxbuf_map[RX_DESC_COUNT];
uint32_t rx_idx;
/* TX */
bus_dma_tag_t txdesc_tag;
bus_dmamap_t txdesc_map;
struct dwc_hwdesc *txdesc_ring;
bus_addr_t txdesc_ring_paddr;
bus_dma_tag_t txbuf_tag;
struct dwc_bufmap txbuf_map[TX_DESC_COUNT];
uint32_t tx_idx_head;
uint32_t tx_idx_tail;
int txcount;
};
#endif /* __IF_DWCVAR_H__ */
| 31.45 | 77 | 0.758983 |
d91bac3ea095ee5358523a0ce56769e0bf564305 | 2,201 | c | C | glibc-2.21/sysdeps/microblaze/backtrace_linux.c | LinuxUser404/smack-glibc | 75137ec47348317a8dbb431774b74dbb7bd2ec4f | [
"MIT"
] | null | null | null | glibc-2.21/sysdeps/microblaze/backtrace_linux.c | LinuxUser404/smack-glibc | 75137ec47348317a8dbb431774b74dbb7bd2ec4f | [
"MIT"
] | null | null | null | glibc-2.21/sysdeps/microblaze/backtrace_linux.c | LinuxUser404/smack-glibc | 75137ec47348317a8dbb431774b74dbb7bd2ec4f | [
"MIT"
] | null | null | null | /* Copyright (C) 2005-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <asm/sigcontext.h>
#include <linux/signal.h>
#include <asm-generic/ucontext.h>
#include <asm/unistd.h>
int
_identify_sighandler (unsigned long fp, unsigned long pc,
unsigned long *pprev_fp, unsigned long *pprev_pc,
unsigned long *retaddr)
{
unsigned long *tramp = 0;
struct ucontext *uc;
if (*retaddr == 0)
{
/* Kernel inserts the tramp between the signal handler frame and the
caller frame in signal handling. */
tramp = (unsigned long *) pc;
tramp += 2;
if ((*tramp == (0x31800000 | __NR_rt_sigreturn))
&& (*(tramp+1) == 0xb9cc0008))
{
/* Signal handler function argument are:
int sig_num, siginfo_t * info, void * ucontext
therefore ucontext is the 3rd argument. */
unsigned long ucptr = ((unsigned long) tramp
- sizeof (struct ucontext));
uc = (struct ucontext *) ucptr;
*pprev_pc = uc->uc_mcontext.regs.pc;
/* Need to record the return address since the return address of the
function which causes this signal may not be recorded in the
stack. */
*pprev_fp = uc->uc_mcontext.regs.r1;
*retaddr = uc->uc_mcontext.regs.r15;
/* It is a signal handler. */
return 1;
}
}
return 0;
}
| 36.683333 | 78 | 0.63244 |
d920a463cbf7a1d782077f1ee97fd4dd54872677 | 474 | c | C | llpv1e/IO_Unbuffered/es-KR-read-file.c | yuweijun/books | 5be0fec3adce236875fef0f9e1ed8d91ef4acbfe | [
"MIT"
] | 1 | 2018-07-02T12:03:02.000Z | 2018-07-02T12:03:02.000Z | llpv1e/IO_Unbuffered/es-KR-read-file.c | yuweijun/books | 5be0fec3adce236875fef0f9e1ed8d91ef4acbfe | [
"MIT"
] | null | null | null | llpv1e/IO_Unbuffered/es-KR-read-file.c | yuweijun/books | 5be0fec3adce236875fef0f9e1ed8d91ef4acbfe | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
char c;
/*
* Come si puo' notare, il parametro della read() che prevede la lunghezza
* del buffer è impostato ad 1, ciò vuol dire che la lettura dell'input sarà
* carattere per carattere.
*
* Codice estremamente efficiente
*/
while (read(0, &c, 1) > 0) {
write(STDOUT_FILENO, &c, sizeof(c));
}
return (EXIT_SUCCESS);
}
| 21.545455 | 80 | 0.607595 |
d922a6593d637549ba614c9635fbbb3fd7449ea3 | 3,503 | h | C | src/iss/debugger/gdb_session.h | Minres/DBT-RISE-Core | e55026b8fe000ddb0c546a14967ac669b430cd65 | [
"BSD-3-Clause"
] | 6 | 2020-08-25T14:49:27.000Z | 2022-03-27T05:50:08.000Z | src/iss/debugger/gdb_session.h | Minres/DBT-RISE-Core | e55026b8fe000ddb0c546a14967ac669b430cd65 | [
"BSD-3-Clause"
] | null | null | null | src/iss/debugger/gdb_session.h | Minres/DBT-RISE-Core | e55026b8fe000ddb0c546a14967ac669b430cd65 | [
"BSD-3-Clause"
] | 3 | 2020-08-25T14:49:31.000Z | 2020-11-23T09:44:59.000Z | /*******************************************************************************
* Copyright (C) 2017, MINRES Technologies GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* eyck@minres.com - initial API and implementation
******************************************************************************/
#ifndef _GDB_SESSION_H_
#define _GDB_SESSION_H_
#include <boost/asio.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/bind/bind.hpp>
#include <chrono>
#include <cstdlib>
#include <iostream>
#include <iss/debugger/serialized_connection.h>
#include <thread>
#include <functional>
#include "cmdhandler.h"
#include "serialized_connection.h"
#include "server_if.h"
#include <iss/log_categories.h>
namespace iss {
namespace debugger {
using boost::asio::ip::tcp;
class gdb_session : public connection<std::string, std::string>::async_listener {
public:
gdb_session(server_if *server_, boost::asio::io_context &io_service);
virtual ~gdb_session() = default;
tcp::socket &socket() { return conn_shptr->socket(); }
int start();
void receive_completed(const boost::system::error_code &e, std::string *data) override;
void send_completed(const boost::system::error_code &e) override;
bool message_completed(std::vector<char> &buffer) override;
protected:
std::string check_packet(std::string &msg);
void parse_n_execute(std::string &msg);
void respond(std::string const& msg) {
last_msg = msg;
// std::this_thread::sleep_for(std::chrono::milliseconds(2));
CLOG(TRACE, connection) << "Processed message, responding with '" << msg << "'";
conn_shptr->write_data(msg);
// conn_shptr->async_write(msg);
conn_shptr->async_read();
}
private:
server_if *server;
boost::shared_ptr<connection<std::string, std::string>> conn_shptr;
std::string last_msg;
cmd_handler handler;
std::function<void(unsigned)> stop_callback;
};
}
}
#endif /* _GDB_SESSION_H_ */
| 35.383838 | 91 | 0.697973 |
d9261185131715b29ceb8200eda5ec9f63256722 | 4,800 | h | C | core/Crypto/acsdkCryptoInterfaces/test/include/acsdkCryptoInterfaces/test/MockKeyStore.h | tsweet77/avs-device-sdk | 703b06188eae146af396f58be4e47442d7ce5b1e | [
"Apache-2.0"
] | 1 | 2018-07-09T16:44:28.000Z | 2018-07-09T16:44:28.000Z | core/Crypto/acsdkCryptoInterfaces/test/include/acsdkCryptoInterfaces/test/MockKeyStore.h | tsweet77/avs-device-sdk | 703b06188eae146af396f58be4e47442d7ce5b1e | [
"Apache-2.0"
] | null | null | null | core/Crypto/acsdkCryptoInterfaces/test/include/acsdkCryptoInterfaces/test/MockKeyStore.h | tsweet77/avs-device-sdk | 703b06188eae146af396f58be4e47442d7ce5b1e | [
"Apache-2.0"
] | 2 | 2019-02-05T23:42:48.000Z | 2020-03-01T11:11:30.000Z | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#ifndef ACSDKCRYPTOINTERFACES_TEST_MOCKKEYSTORE_H_
#define ACSDKCRYPTOINTERFACES_TEST_MOCKKEYSTORE_H_
#include <acsdkCryptoInterfaces/KeyStoreInterface.h>
#include <gmock/gmock.h>
namespace alexaClientSDK {
namespace acsdkCryptoInterfaces {
namespace test {
/**
* Mock class for @c KeyStoreInterface.
*/
class MockKeyStore : public KeyStoreInterface {
public:
MOCK_METHOD6(
_encrypt,
bool(
const std::string& keyAlias,
AlgorithmType type,
const IV& iv,
const DataBlock& plaintext,
KeyChecksum& checksum,
DataBlock& ciphertext));
MOCK_METHOD8(
_encryptAE,
bool(
const std::string& keyAlias,
AlgorithmType type,
const IV& iv,
const DataBlock& aad,
const DataBlock& plaintext,
KeyChecksum& checksum,
DataBlock& ciphertext,
DataBlock& tag));
MOCK_METHOD6(
_decrypt,
bool(
const std::string& keyAlias,
AlgorithmType type,
const KeyChecksum& checksum,
const IV& iv,
const DataBlock& ciphertext,
DataBlock& plaintext));
MOCK_METHOD8(
_decryptAD,
bool(
const std::string& keyAlias,
AlgorithmType type,
const KeyChecksum& checksum,
const IV& iv,
const DataBlock& aad,
const DataBlock& ciphertext,
const Tag& tag,
DataBlock& plaintext));
MOCK_METHOD1(_getDefaultKeyAlias, bool(std::string&));
bool encrypt(
const std::string& keyAlias,
AlgorithmType type,
const IV& iv,
const KeyChecksum& plaintext,
DataBlock& checksum,
DataBlock& ciphertext) noexcept override;
bool encryptAE(
const std::string& keyAlias,
AlgorithmType type,
const IV& iv,
const DataBlock& aad,
const DataBlock& plaintext,
KeyChecksum& checksum,
DataBlock& ciphertext,
Tag& tag) noexcept override;
bool decrypt(
const std::string& keyAlias,
AlgorithmType type,
const KeyChecksum& checksum,
const IV& iv,
const DataBlock& ciphertext,
DataBlock& plaintext) noexcept override;
bool decryptAD(
const std::string& keyAlias,
AlgorithmType type,
const KeyChecksum& checksum,
const IV& iv,
const DataBlock& aad,
const DataBlock& ciphertext,
const Tag& tag,
DataBlock& plaintext) noexcept override;
bool getDefaultKeyAlias(std::string& keyAlias) noexcept override;
};
inline bool MockKeyStore::encrypt(
const std::string& keyAlias,
AlgorithmType type,
const IV& iv,
const DataBlock& plaintext,
KeyChecksum& checksum,
DataBlock& ciphertext) noexcept {
return _encrypt(keyAlias, type, iv, plaintext, checksum, ciphertext);
}
inline bool MockKeyStore::encryptAE(
const std::string& keyAlias,
AlgorithmType type,
const IV& iv,
const DataBlock& aad,
const DataBlock& plaintext,
KeyChecksum& checksum,
DataBlock& ciphertext,
Tag& tag) noexcept {
return _encryptAE(keyAlias, type, iv, aad, plaintext, checksum, ciphertext, tag);
}
inline bool MockKeyStore::decrypt(
const std::string& keyAlias,
AlgorithmType type,
const KeyChecksum& checksum,
const IV& iv,
const DataBlock& ciphertext,
DataBlock& plaintext) noexcept {
return _decrypt(keyAlias, type, checksum, iv, ciphertext, plaintext);
}
inline bool MockKeyStore::decryptAD(
const std::string& keyAlias,
AlgorithmType type,
const KeyChecksum& checksum,
const IV& iv,
const DataBlock& aad,
const DataBlock& ciphertext,
const Tag& tag,
DataBlock& plaintext) noexcept {
return _decryptAD(keyAlias, type, checksum, iv, aad, ciphertext, tag, plaintext);
}
inline bool MockKeyStore::getDefaultKeyAlias(std::string& keyAlias) noexcept {
return _getDefaultKeyAlias(keyAlias);
}
} // namespace test
} // namespace acsdkCryptoInterfaces
} // namespace alexaClientSDK
#endif // ACSDKCRYPTOINTERFACES_TEST_MOCKKEYSTORE_H_
| 29.813665 | 85 | 0.652083 |
d926b0aad830e4655d1d069c0602f1d996be9f42 | 2,381 | h | C | core/discovery/manager/include/disc_manager.h | openharmony-sig-ci/communication_dsoftbus | 6fa531d0851de1ca4d788dd0f2e8f9e48fef7d4a | [
"Apache-2.0"
] | 2 | 2021-11-22T15:58:06.000Z | 2021-12-03T13:57:01.000Z | core/discovery/manager/include/disc_manager.h | openharmony-sig-ci/communication_dsoftbus | 6fa531d0851de1ca4d788dd0f2e8f9e48fef7d4a | [
"Apache-2.0"
] | null | null | null | core/discovery/manager/include/disc_manager.h | openharmony-sig-ci/communication_dsoftbus | 6fa531d0851de1ca4d788dd0f2e8f9e48fef7d4a | [
"Apache-2.0"
] | 4 | 2021-09-13T11:17:56.000Z | 2022-03-31T01:28:33.000Z | /*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef DISC_MANAGER_H
#define DISC_MANAGER_H
#include "disc_interface.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#define CAPABILITY_NUM 1
#define CAPABILITY_MAX_BITNUM 8
typedef struct {
int32_t freq;
uint32_t capabilityBitmap[CAPABILITY_NUM];
unsigned char *capabilityData;
uint32_t dataLen;
} PublishOption;
typedef struct {
int32_t freq;
bool isSameAccount;
bool isWakeRemote;
uint32_t capabilityBitmap[CAPABILITY_NUM];
unsigned char *capabilityData;
uint32_t dataLen;
} SubscribeOption;
typedef struct {
int32_t (*Publish)(const PublishOption *option);
int32_t (*StartScan)(const PublishOption *option);
int32_t (*Unpublish)(const PublishOption *option);
int32_t (*StopScan)(const PublishOption *option);
int32_t (*StartAdvertise)(const SubscribeOption *option);
int32_t (*Subscribe)(const SubscribeOption *option);
int32_t (*Unsubscribe)(const SubscribeOption *option);
int32_t (*StopAdvertise)(const SubscribeOption *option);
void (*LinkStatusChanged)(LinkStatus status);
} DiscoveryFuncInterface;
typedef struct {
int32_t (*OnServerDeviceFound)(const char *packageName, const DeviceInfo *device);
} IServerDiscInnerCallback;
int32_t DiscPublishService(const char *packageName, const PublishInfo *info);
int32_t DiscUnPublishService(const char *packageName, int32_t publishId);
int32_t DiscStartDiscovery(const char *packageName, const SubscribeInfo *info, const IServerDiscInnerCallback *cb);
int32_t DiscStopDiscovery(const char *packageName, int32_t subscribeId);
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif /* DISC_MANAGER_H */ | 32.616438 | 116 | 0.735405 |
d92784eda39833e732bfb81890b34afd9d46587c | 1,334 | h | C | bluetooth/dispatcher/dispatcher_daemon.h | emersion/chromiumos-platform2 | ba71ad06f7ba52e922c647a8915ff852b2d4ebbd | [
"BSD-3-Clause"
] | 5 | 2019-01-19T15:38:48.000Z | 2021-10-06T03:59:46.000Z | bluetooth/dispatcher/dispatcher_daemon.h | emersion/chromiumos-platform2 | ba71ad06f7ba52e922c647a8915ff852b2d4ebbd | [
"BSD-3-Clause"
] | null | null | null | bluetooth/dispatcher/dispatcher_daemon.h | emersion/chromiumos-platform2 | ba71ad06f7ba52e922c647a8915ff852b2d4ebbd | [
"BSD-3-Clause"
] | 1 | 2019-02-15T23:05:30.000Z | 2019-02-15T23:05:30.000Z | // Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BLUETOOTH_DISPATCHER_DISPATCHER_DAEMON_H_
#define BLUETOOTH_DISPATCHER_DISPATCHER_DAEMON_H_
#include <memory>
#include "bluetooth/common/bluetooth_daemon.h"
#include "bluetooth/dispatcher/dispatcher.h"
#include "bluetooth/dispatcher/suspend_manager.h"
namespace bluetooth {
// Main class within btdispatch daemon that ties all other classes together.
class DispatcherDaemon : public BluetoothDaemon {
public:
// |passthrough_mode|: Pure D-Bus forwarding to/from BlueZ or NewBlue.
explicit DispatcherDaemon(PassthroughMode passthrough_mode);
~DispatcherDaemon() override = default;
// Initializes the daemon D-Bus operations.
bool Init(scoped_refptr<dbus::Bus> bus, DBusDaemon* dbus_daemon) override;
private:
// The suspend/resume handler for pausing/unpausing discovery during system
// suspend.
std::unique_ptr<SuspendManager> suspend_manager_;
// Exposes BlueZ-compatible D-Bus API and handles the client requests.
std::unique_ptr<Dispatcher> dispatcher_;
PassthroughMode passthrough_mode_;
DISALLOW_COPY_AND_ASSIGN(DispatcherDaemon);
};
} // namespace bluetooth
#endif // BLUETOOTH_DISPATCHER_DISPATCHER_DAEMON_H_
| 31.761905 | 77 | 0.794603 |
d92897cf20857e6551b7c8bfa9b60b73db1f34c0 | 58,426 | c | C | mame/src/mame/drivers/esd16.c | clobber/MAME-OS-X | ca11d0e946636bda042b6db55c82113e5722fc08 | [
"MIT"
] | 15 | 2015-03-03T23:15:57.000Z | 2021-11-12T07:09:24.000Z | mame/src/mame/drivers/esd16.c | clobber/MAME-OS-X | ca11d0e946636bda042b6db55c82113e5722fc08 | [
"MIT"
] | null | null | null | mame/src/mame/drivers/esd16.c | clobber/MAME-OS-X | ca11d0e946636bda042b6db55c82113e5722fc08 | [
"MIT"
] | 8 | 2015-07-07T16:40:44.000Z | 2020-08-18T06:57:29.000Z | /***************************************************************************
-= ESD 16 Bit Games =-
driver by Luca Elia (l.elia@tin.it)
additions by David Haywood
Main CPU : M68000
Video Chips : 2 x ACTEL A40MX04 (84 Pin Square Socketed) or
ESD CRTC99 (QFP240) & ACTEL A40MX04
Sound CPU : Z80
Sound Chips : M6295 (AD-65) + YM3812 (U6612) + YM3014 (U6614)
---------------------------------------------------------------------------
Year + Game PCB Notes
---------------------------------------------------------------------------
98 Multi Champ ESD 11-09-98 (also a year 1999 revision)
99 Multi Champ Deluxe ESD 08-26-1999 (also a year 2000 revision)
99 Head Panic ESD 05-28-99 (All English version, copyright 1999)
00 Head Panic ESD 08-26-1999 (All English version, copyright 2000)
00 Head Panic ESD 08-26-1999 (with Fuuki, Story in Japanese)
00 Tang Tang ESD (no date is marked on PCB)
01 SWAT Police ESD (no date is marked on PCB)
---------------------------------------------------------------------------
Other ESD games:
3 Cushion Billiards (c) 2000 - Undumped
Deluxe 5 (c) 2000 - Undumped (PCB looks identical to the ESD 08-26-1999)
Tang Tang (c) 2000 - Undumped ESD 05-28-99 version
Fire Hawk (c) 2001 - see nmk16.c driver
Jumping Pop (c) 2001 - see tumbleb.c driver
Head Panic
- Maybe the sprite code can be merged again, haven't checked yet.
- Nude / Bikini pics don't show in-game, even when set in test mode?
---------------------------------------------------------------------------
***************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "machine/eeprom.h"
#include "sound/okim6295.h"
#include "sound/3812intf.h"
#include "includes/esd16.h"
/***************************************************************************
Memory Maps - Main CPU
***************************************************************************/
static WRITE16_HANDLER( esd16_spriteram_w )
{
esd16_state *state = space->machine().driver_data<esd16_state>();
COMBINE_DATA(&state->m_spriteram[offset]);
}
static WRITE16_HANDLER( esd16_sound_command_w )
{
esd16_state *state = space->machine().driver_data<esd16_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->m_audio_cpu, 0, ASSERT_LINE); // Generate an IRQ
device_spin_until_time(&space->device(), attotime::from_usec(50)); // Allow the other CPU to reply
}
}
/*
Lines starting with an empty comment in the following MemoryReadAddress
arrays are there for debug (e.g. the game does not read from those ranges
AFAIK)
*/
static ADDRESS_MAP_START( multchmp_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x100000, 0x10ffff) AM_RAM // RAM
AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) // Palette
/**/AM_RANGE(0x300000, 0x3007ff) AM_RAM AM_BASE_SIZE_MEMBER(esd16_state, m_spriteram, m_spriteram_size) // Sprites
AM_RANGE(0x300800, 0x300807) AM_WRITE(esd16_spriteram_w) // Sprites (Mirrored)
/**/AM_RANGE(0x400000, 0x403fff) AM_RAM_WRITE(esd16_vram_0_w) AM_BASE_MEMBER(esd16_state, m_vram_0) // Layers
/**/AM_RANGE(0x420000, 0x423fff) AM_RAM_WRITE(esd16_vram_1_w) AM_BASE_MEMBER(esd16_state, m_vram_1) //
/**/AM_RANGE(0x500000, 0x500003) AM_RAM AM_BASE_MEMBER(esd16_state, m_scroll_0) // Scroll
/**/AM_RANGE(0x500004, 0x500007) AM_RAM AM_BASE_MEMBER(esd16_state, m_scroll_1) //
/**/AM_RANGE(0x500008, 0x50000b) AM_RAM //
/**/AM_RANGE(0x50000c, 0x50000f) AM_RAM //
AM_RANGE(0x600000, 0x600001) AM_WRITENOP // IRQ Ack
AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P1_P2")
AM_RANGE(0x600004, 0x600005) AM_READ_PORT("SYSTEM")
AM_RANGE(0x600006, 0x600007) AM_READ_PORT("DSW")
AM_RANGE(0x600008, 0x600009) AM_WRITE(esd16_tilemap0_color_w) // Flip Screen + Tileamp0 palette banking
AM_RANGE(0x60000a, 0x60000b) AM_WRITENOP // ? 2
AM_RANGE(0x60000c, 0x60000d) AM_WRITE(esd16_sound_command_w) // To Sound CPU
AM_RANGE(0x700008, 0x70000b) AM_READNOP // ? Only read once
ADDRESS_MAP_END
static WRITE16_HANDLER(hedpanic_platform_w)
{
esd16_state *state = space->machine().driver_data<esd16_state>();
int offsets = state->m_headpanic_platform_x[0] + 0x40 * state->m_headpanic_platform_y[0];
state->m_vram_1[offsets] = data;
tilemap_mark_tile_dirty(state->m_tilemap_1_16x16, offsets);
}
static READ16_HANDLER( esd_eeprom_r )
{
esd16_state *state = space->machine().driver_data<esd16_state>();
if (ACCESSING_BITS_8_15)
{
return ((state->m_eeprom->read_bit() & 0x01) << 15);
}
// logerror("(0x%06x) unk EEPROM read: %04x\n", cpu_get_pc(&space->device()), mem_mask);
return 0;
}
static WRITE16_HANDLER( esd_eeprom_w )
{
if (ACCESSING_BITS_8_15)
input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", cpu_get_pc(&space->device()), data, mem_mask);
}
static ADDRESS_MAP_START( hedpanic_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x100000, 0x10ffff) AM_RAM // RAM
AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) // Palette
AM_RANGE(0x900000, 0x9007ff) AM_WRITEONLY AM_BASE_SIZE_MEMBER(esd16_state, m_spriteram, m_spriteram_size) // Sprites
AM_RANGE(0x900800, 0x900807) AM_WRITE(esd16_spriteram_w) // Sprites (Mirrored)
AM_RANGE(0xa00000, 0xa03fff) AM_WRITE(esd16_vram_0_w) AM_BASE_MEMBER(esd16_state, m_vram_0) // Layers
AM_RANGE(0xa20000, 0xa23fff) AM_WRITE(esd16_vram_1_w) AM_BASE_MEMBER(esd16_state, m_vram_1) //
AM_RANGE(0xa24000, 0xa27fff) AM_WRITE(esd16_vram_1_w) AM_BASE_MEMBER(esd16_state, m_vram_1) // mirror?
AM_RANGE(0xb00000, 0xb00003) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_scroll_0) // Scroll
AM_RANGE(0xb00004, 0xb00007) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_scroll_1) //
AM_RANGE(0xb00008, 0xb00009) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_headpanic_platform_x)
AM_RANGE(0xb0000a, 0xb0000b) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_headpanic_platform_y)
AM_RANGE(0xb0000c, 0xb0000d) AM_WRITENOP // ??
AM_RANGE(0xb0000e, 0xb0000f) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_head_layersize) // ??
AM_RANGE(0xc00000, 0xc00001) AM_WRITENOP // IRQ Ack
AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("P1_P2")
AM_RANGE(0xc00004, 0xc00005) AM_READ_PORT("SYSTEM")
AM_RANGE(0xc00006, 0xc00007) AM_READ(esd_eeprom_r)
AM_RANGE(0xc00008, 0xc00009) AM_WRITE(esd16_tilemap0_color_w) // Flip Screen + Tileamp0 palette banking
AM_RANGE(0xc0000a, 0xc0000b) AM_WRITENOP // ? 2 not checked
AM_RANGE(0xc0000c, 0xc0000d) AM_WRITE(esd16_sound_command_w) // To Sound CPU // ok
AM_RANGE(0xc0000e, 0xc0000f) AM_WRITE(esd_eeprom_w)
AM_RANGE(0xd00008, 0xd00009) AM_WRITE(hedpanic_platform_w)
ADDRESS_MAP_END
/* Multi Champ Deluxe, like Head Panic but different addresses */
static ADDRESS_MAP_START( mchampdx_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM
AM_RANGE(0x300000, 0x303fff) AM_WRITE(esd16_vram_0_w) AM_BASE_MEMBER(esd16_state, m_vram_0) // Layers
AM_RANGE(0x320000, 0x323fff) AM_WRITE(esd16_vram_1_w) AM_BASE_MEMBER(esd16_state, m_vram_1) //
AM_RANGE(0x324000, 0x327fff) AM_WRITE(esd16_vram_1_w) AM_BASE_MEMBER(esd16_state, m_vram_1) // mirror?
AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) // Palette
AM_RANGE(0x500000, 0x500001) AM_WRITENOP // IRQ Ack
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P1_P2")
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
AM_RANGE(0x500006, 0x500007) AM_READ(esd_eeprom_r)
AM_RANGE(0x500008, 0x500009) AM_WRITE(esd16_tilemap0_color_w) // Flip Screen + Tileamp0 palette banking
AM_RANGE(0x50000a, 0x50000b) AM_WRITENOP // ? 2 not checked
AM_RANGE(0x50000c, 0x50000d) AM_WRITE(esd16_sound_command_w) // To Sound CPU // ok
AM_RANGE(0x50000e, 0x50000f) AM_WRITE(esd_eeprom_w)
AM_RANGE(0x600000, 0x6007ff) AM_WRITEONLY AM_BASE_SIZE_MEMBER(esd16_state, m_spriteram, m_spriteram_size) // Sprites
AM_RANGE(0x600800, 0x600807) AM_WRITE(esd16_spriteram_w) // Sprites (Mirrored)
AM_RANGE(0x700000, 0x700003) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_scroll_0) // Scroll
AM_RANGE(0x700004, 0x700007) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_scroll_1) //
AM_RANGE(0x700008, 0x700009) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_headpanic_platform_x) // not used in mchampdx?
AM_RANGE(0x70000a, 0x70000b) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_headpanic_platform_y) // not used in mchampdx?
AM_RANGE(0x70000c, 0x70000d) AM_WRITENOP // ??
AM_RANGE(0x70000e, 0x70000f) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_head_layersize) // ??
AM_RANGE(0xd00008, 0xd00009) AM_WRITE(hedpanic_platform_w) // not used in mchampdx?
ADDRESS_MAP_END
/* Tang Tang - like the others but again with different addresses */
static ADDRESS_MAP_START( tangtang_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) // RAM
AM_RANGE(0x200000, 0x2007ff) AM_WRITEONLY AM_BASE_SIZE_MEMBER(esd16_state, m_spriteram, m_spriteram_size) // Sprites
AM_RANGE(0x200800, 0x200807) AM_WRITE(esd16_spriteram_w) // Sprites (Mirrored)
AM_RANGE(0x300000, 0x303fff) AM_WRITE(esd16_vram_0_w) AM_BASE_MEMBER(esd16_state, m_vram_0) // Layers
AM_RANGE(0x320000, 0x323fff) AM_WRITE(esd16_vram_1_w) AM_BASE_MEMBER(esd16_state, m_vram_1) //
AM_RANGE(0x324000, 0x327fff) AM_WRITE(esd16_vram_1_w) AM_BASE_MEMBER(esd16_state, m_vram_1) // mirror?
AM_RANGE(0x400000, 0x400003) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_scroll_0) // Scroll
AM_RANGE(0x400004, 0x400007) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_scroll_1) //
AM_RANGE(0x400008, 0x400009) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_headpanic_platform_x) // not used in mchampdx?
AM_RANGE(0x40000a, 0x40000b) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_headpanic_platform_y) // not used in mchampdx?
AM_RANGE(0x40000c, 0x40000d) AM_WRITENOP // ??
AM_RANGE(0x40000e, 0x40000f) AM_WRITEONLY AM_BASE_MEMBER(esd16_state, m_head_layersize) // ??
AM_RANGE(0x500000, 0x500001) AM_WRITENOP // IRQ Ack
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P1_P2")
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
AM_RANGE(0x500006, 0x500007) AM_READ(esd_eeprom_r)
AM_RANGE(0x500008, 0x500009) AM_WRITE(esd16_tilemap0_color_w) // Flip Screen + Tileamp0 palette banking
AM_RANGE(0x50000a, 0x50000b) AM_WRITENOP // ? 2 not checked
AM_RANGE(0x50000c, 0x50000d) AM_WRITE(esd16_sound_command_w) // To Sound CPU // ok
AM_RANGE(0x50000e, 0x50000f) AM_WRITE(esd_eeprom_w)
AM_RANGE(0x600008, 0x600009) AM_WRITE(hedpanic_platform_w)
AM_RANGE(0x700000, 0x70ffff) AM_RAM // main ram
ADDRESS_MAP_END
/***************************************************************************
Memory Maps - Sound CPU
***************************************************************************/
static WRITE8_HANDLER( esd16_sound_rombank_w )
{
int bank = data & 0xf;
if (data != bank) logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n", cpu_get_pc(&space->device()), data);
if (bank >= 3) bank += 1;
memory_set_bank(space->machine(), "bank1", bank);
}
static ADDRESS_MAP_START( multchmp_sound_map, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // Banked ROM
AM_RANGE(0xf800, 0xffff) AM_RAM // RAM
ADDRESS_MAP_END
static READ8_HANDLER( esd16_sound_command_r )
{
esd16_state *state = space->machine().driver_data<esd16_state>();
/* Clear IRQ only after reading the command, or some get lost */
device_set_input_line(state->m_audio_cpu, 0, CLEAR_LINE);
return soundlatch_r(space, 0);
}
static ADDRESS_MAP_START( multchmp_sound_io_map, AS_IO, 8 )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVWRITE("ymsnd", ym3812_w) // YM3812
AM_RANGE(0x02, 0x02) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write) // M6295
AM_RANGE(0x03, 0x03) AM_READ(esd16_sound_command_r) // From Main CPU
AM_RANGE(0x04, 0x04) AM_WRITENOP // ? $00, $30
AM_RANGE(0x05, 0x05) AM_WRITE(esd16_sound_rombank_w) // ROM Bank
AM_RANGE(0x06, 0x06) AM_NOP // ? At the start / ? 1 (End of NMI routine)
ADDRESS_MAP_END
/***************************************************************************
Input Ports
***************************************************************************/
static INPUT_PORTS_START( multchmp )
PORT_START("P1_P2") // $600002.w
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Resets the test mode
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SYSTEM") // $600005.b
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW") // $600006.w
PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" )
PORT_DIPNAME( 0x0002, 0x0002, "Coinage Type" ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x0002, "1" )
PORT_DIPSETTING( 0x0000, "2" )
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x0300, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x0100, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
PORT_DIPSETTING( 0x0000, "2" )
PORT_DIPSETTING( 0x0c00, "3" )
PORT_DIPSETTING( 0x0800, "4" )
PORT_DIPSETTING( 0x0400, "5" )
PORT_DIPNAME( 0x1000, 0x1000, "Selectable Games" ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x1000, "3" )
PORT_DIPSETTING( 0x0000, "4" )
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" )
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )
INPUT_PORTS_END
static INPUT_PORTS_START( hedpanic )
PORT_START("P1_P2") // $600002.w
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SYSTEM") // $600005.b
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x0040, IP_ACTIVE_LOW)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START( "EEPROMOUT" )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line)
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line)
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit)
INPUT_PORTS_END
static INPUT_PORTS_START( swatpolc )
PORT_START("P1_P2") // $600002.w
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SYSTEM") // $600005.b
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x0040, IP_ACTIVE_LOW)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START( "EEPROMOUT" )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line)
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line)
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit)
INPUT_PORTS_END
/***************************************************************************
Graphics Layouts
***************************************************************************/
/* 16x16x5, made of four 8x8 tiles */
static const gfx_layout layout_16x16x5 =
{
16,16,
RGN_FRAC(1,5),
5,
{ RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5), RGN_FRAC(0,5) },
{ STEP8(0+7,-1), STEP8(8*16+7,-1) },
{ STEP16(0,8) },
16*16
};
/* 8x8x8 */
static const gfx_layout layout_8x8x8 =
{
8,8,
RGN_FRAC(1,4),
8,
{ STEP8(0,1) },
{ RGN_FRAC(3,4)+0*8,RGN_FRAC(2,4)+0*8,RGN_FRAC(1,4)+0*8,RGN_FRAC(0,4)+0*8,
RGN_FRAC(3,4)+1*8,RGN_FRAC(2,4)+1*8,RGN_FRAC(1,4)+1*8,RGN_FRAC(0,4)+1*8 },
{ STEP8(0,2*8) },
8*8*2,
};
static GFXDECODE_START( esd16 )
GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x5, 0x200, 8 ) // [0] Sprites
GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x8, 0x000, 2 ) // [1] Layers
GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x5, 0x200, 8 ) // [0] Sprites
GFXDECODE_END
static const gfx_layout hedpanic_layout_8x8x8 =
{
8,8,
RGN_FRAC(1,1),
8,
{ 0,1,2,3,4,5,6,7 },
{ 0*8,2*8,1*8,3*8,4*8,6*8,5*8,7*8 },
{ 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64 },
64*8,
};
static const gfx_layout hedpanic_layout_16x16x8 =
{
16,16,
RGN_FRAC(1,1),
8,
{ 0,1,2,3,4,5,6,7 },
{ 0*8,2*8,1*8,3*8,4*8,6*8,5*8,7*8,
64*8+0*8,64*8+2*8,64*8+1*8,64*8+3*8,64*8+4*8,64*8+6*8,64*8+5*8,64*8+7*8 },
{ 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64,
128*8+0*64,128*8+1*64,128*8+2*64,128*8+3*64,128*8+4*64,128*8+5*64,128*8+6*64,128*8+7*64
},
256*8,
};
static const gfx_layout hedpanic_sprite_16x16x5 =
{
16,16,
RGN_FRAC(1,3),
5,
{ RGN_FRAC(2,3), RGN_FRAC(0,3), RGN_FRAC(0,3)+8, RGN_FRAC(1,3),RGN_FRAC(1,3)+8 },
{ 7,6,5,4,3,2,1,0, 256+7,256+6,256+5,256+4,256+3,256+2,256+1,256+0 },
{ 0*16,1*16,2*16,3*16,4*16,5*16,6*16,7*16,8*16,9*16,10*16,11*16,12*16,13*16,14*16,15*16 },
16*32,
};
static GFXDECODE_START( hedpanic )
GFXDECODE_ENTRY( "gfx1", 0, hedpanic_sprite_16x16x5, 0x200, 8 ) // [0] Sprites
GFXDECODE_ENTRY( "gfx2", 0, hedpanic_layout_8x8x8, 0x000, 4 ) // [1] Layers
GFXDECODE_ENTRY( "gfx2", 0, hedpanic_layout_16x16x8, 0x000, 4 ) // [2] Layers
GFXDECODE_END
static GFXDECODE_START( tangtang )
GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x5, 0x200, 8 ) // [0] Sprites
GFXDECODE_ENTRY( "gfx2", 0, hedpanic_layout_8x8x8, 0x000, 4 ) // [1] Layers
GFXDECODE_ENTRY( "gfx2", 0, hedpanic_layout_16x16x8, 0x000, 4 ) // [2] Layers
GFXDECODE_END
/***************************************************************************
Machine Drivers
***************************************************************************/
static MACHINE_START( esd16 )
{
esd16_state *state = machine.driver_data<esd16_state>();
UINT8 *AUDIO = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 17, &AUDIO[0x0000], 0x4000);
state->m_audio_cpu = machine.device("audiocpu");
state->m_eeprom = machine.device<eeprom_device>("eeprom");
state->save_item(NAME(state->m_tilemap0_color));
}
static MACHINE_RESET( esd16 )
{
esd16_state *state = machine.driver_data<esd16_state>();
state->m_tilemap0_color = 0;
}
static MACHINE_CONFIG_START( multchmp, esd16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(multchmp_map)
MCFG_CPU_VBLANK_INT("screen", irq6_line_hold)
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* ? */
MCFG_CPU_PROGRAM_MAP(multchmp_sound_map)
MCFG_CPU_IO_MAP(multchmp_sound_io_map)
MCFG_CPU_PERIODIC_INT(nmi_line_pulse,32*60) /* IRQ By Main CPU */
MCFG_MACHINE_START(esd16)
MCFG_MACHINE_RESET(esd16)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MCFG_SCREEN_SIZE(0x140, 0x100)
MCFG_SCREEN_VISIBLE_AREA(0, 0x140-1, 0+8, 0x100-8-1)
MCFG_SCREEN_UPDATE(esd16)
MCFG_GFXDECODE(esd16)
MCFG_PALETTE_LENGTH(768)
MCFG_VIDEO_START(esd16)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ymsnd", YM3812, 4000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( hedpanic, multchmp )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(hedpanic_map)
MCFG_EEPROM_93C46_ADD("eeprom")
MCFG_PALETTE_LENGTH(0x1000/2)
MCFG_GFXDECODE(hedpanic)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE(hedpanic)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mchampdx, hedpanic )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(mchampdx_map)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tangtang, hedpanic )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(tangtang_map)
MCFG_GFXDECODE(tangtang)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( swatpolc, hedpanic )
/* basic machine hardware */
MCFG_GFXDECODE(tangtang)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( hedpanio, hedpanic )
/* basic machine hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE(hedpanio)
MACHINE_CONFIG_END
/***************************************************************************
ROMs Loading
***************************************************************************/
/***************************************************************************
Multi Champ
PCB Layout
----------
ESD 11-09-98
+-----------------------------------------+
| YM3812 6116 su10 fu27|
|VOL YM3014 su06 M6295 fu32|
| PAL Z80 fu26|
| 6116 fu30|
|J 6116 Actel fu28|
|A DSWA DSWB 76C256 A40MX04 fu31|
|M 76C256 fu29|
|M cu03 76C256 6116 Actel PAL fu33|
|A cu02 76C256 6116 A40MX04 PAL ju07|
| 68000 6116 ju03|
| PAL 6116 PAL ju04|
| PAL 6116 PAL ju05|
|16MHz 14MHz 6116 PAL ju06|
+-----------------------------------------+
(C) ESD 1998, 1999
PCB No. ESD 11-09-98 (Probably the manufacture date)
CPU: MC68HC000FN16 (68000, 68 pin PLCC socketed)
SND: Z80 (Z0840006PSC), U6614/U6612 (YM3014/YM3812), AD-65 (OKI M6295)
OSC: 16.000MHz, 14.000MHz
RAM: 4 x 62256, 9 x 6116
DIPS: 2 x 8 position
Dip info is in Japanese! I will scan and make it available on my site for translation.
Other Chips: 2 x Actel A40MX04-F FPGA (PLCC84)
8 PAL's (not dumped)
ROMS:
MULTCHMP.U02 \ Main Program MX27C2000
MULTCHMP.U03 / MX27C2000
MULTCHMP.U06 -- Sound Program 27C010
MULTCHMP.U10 -- ADPCM Samples 27C010
MULTCHMP.U27 -\ 27C4001
MULTCHMP.U28 \ 27C4001
MULTCHMP.U29 | 27C4001
MULTCHMP.U30 + Backgrounds 27C4001
MULTCHMP.U31 | 27C4001
MULTCHMP.U32 | 27C4001
MULTCHMP.U33 / 27C4001
MULTCHMP.U34 -/ 27C4001
MULTCHMP.U35 -\ MX27C2000
MULTCHMP.U36 \ MX27C2000
MULTCHMP.U37 +- Sprites MX27C2000
MULTCHMP.U38 / MX27C2000
MULTCHMP.U39 -/ MX27C2000
***************************************************************************/
ROM_START( multchmp )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "esd2.cu02", 0x000000, 0x040000, CRC(2d1b098a) SHA1(c2f3991f02c611c258219da2c61cad22c9a21f7d) )
ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(10974063) SHA1(854b38b4d4cb529e9928aae4212c86a220615e04) )
ROM_REGION( 0x24000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(7c178bd7) SHA1(8754d3c70d9b2bf369a5ce0cce4cc0696ed22750) )
ROM_CONTINUE( 0x10000, 0x14000)
ROM_REGION( 0x140000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "esd14.ju03", 0x000000, 0x040000, CRC(a6122225) SHA1(cbcf2b31c4c011daba21f0ae5fd3be63c9a87c00) )
ROM_LOAD( "esd15.ju04", 0x040000, 0x040000, CRC(88b7a97c) SHA1(0a57ec8f6a44c8e3aa3ef35499a415d6a2b7eb16) )
ROM_LOAD( "esd16.ju05", 0x080000, 0x040000, CRC(e670a6da) SHA1(47cbe45b6d5d0ca70d0c6787d589dde5d14fdba4) )
ROM_LOAD( "esd17.ju06", 0x0c0000, 0x040000, CRC(a69d4399) SHA1(06ae6c07cc6b7313e2e2aa3b994f7532d6994e1b) )
ROM_LOAD( "esd13.ju07", 0x100000, 0x040000, CRC(22071594) SHA1(c79102b250780d1da8c290d065d61fbbfa193366) )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD( "esd5.fu27", 0x000000, 0x080000, CRC(299f32c2) SHA1(274752444f6ddba16eeefc02c3e78525c079b3d8) )
ROM_LOAD( "esd6.fu32", 0x080000, 0x080000, CRC(e2689bb2) SHA1(1da9b1f7335d5c2d1c2f8353fccf91c0109d2e9d) )
ROM_LOAD( "esd11.fu29", 0x100000, 0x080000, CRC(9bafd8ee) SHA1(db18be05431d4b6d4207e19fa4ed8701621aaa19) )
ROM_LOAD( "esd12.fu33", 0x180000, 0x080000, CRC(c6b86001) SHA1(11a63b56df30ab7b85ce4568d2a24e96a125735a) )
ROM_LOAD( "esd7.fu26", 0x200000, 0x080000, CRC(a783a003) SHA1(1ff61a049485c5b599c458a8bf7f48027d14f8e0) )
ROM_LOAD( "esd8.fu30", 0x280000, 0x080000, CRC(22861af2) SHA1(1e74e85517cb8fd5fb4bda6e9d9d54046e31f653) )
ROM_LOAD( "esd9.fu28", 0x300000, 0x080000, CRC(6652c04a) SHA1(178e1d42847506d869ef79db2f7e10df05e9ef76) )
ROM_LOAD( "esd10.fu31", 0x380000, 0x080000, CRC(d815974b) SHA1(3e528a5df79fa7dc0f38b0ee7f2f3a0ebc97a369) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(6e741fcd) SHA1(742e0952916c00f67dd9f8d01e721a9a538d2fc4) )
ROM_END
ROM_START( multchmpk )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "multchmp.u02", 0x000000, 0x040000, CRC(7da8c0df) SHA1(763a3240554a02d8a9a0b13b6bfcd384825a6c57) )
ROM_LOAD16_BYTE( "multchmp.u03", 0x000001, 0x040000, CRC(5dc62799) SHA1(ff7882985efc20309c3f901a622f1beffa0c47be) )
ROM_REGION( 0x24000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(7c178bd7) SHA1(8754d3c70d9b2bf369a5ce0cce4cc0696ed22750) )
ROM_CONTINUE( 0x10000, 0x14000)
ROM_REGION( 0x140000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "multchmp.u36", 0x000000, 0x040000, CRC(d8f06fa8) SHA1(f76912f93f99578529612a7f01d82ac7229a8e41) )
ROM_LOAD( "multchmp.u37", 0x040000, 0x040000, CRC(b1ae7f08) SHA1(37dd9d4cef8b9e1d09d7b46a9794fb2b777c9a01) )
ROM_LOAD( "multchmp.u38", 0x080000, 0x040000, CRC(88e252e8) SHA1(07d898379798c6be42b636762b0af61b9111a480) )
ROM_LOAD( "multchmp.u39", 0x0c0000, 0x040000, CRC(51f01067) SHA1(d5ebbc7d358b63724d2f24da8b2ce4a202be37a5) )
ROM_LOAD( "multchmp.u35", 0x100000, 0x040000, CRC(9d1590a6) SHA1(35f634dbf0df06ec62359c7bae43c7f5d14b0ab2) )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD( "multchmp.u27", 0x000000, 0x080000, CRC(dc42704e) SHA1(58a04a47ffc6d6ae0e4d49e466b1c58b37ad741a) )
ROM_LOAD( "multchmp.u28", 0x080000, 0x080000, CRC(449991fa) SHA1(fd93e420a04cb8bea5421aa9cbe079bd3e7d4924) )
ROM_LOAD( "multchmp.u33", 0x100000, 0x080000, CRC(e4c0ec96) SHA1(74152108e4d05f4aff9d38919f212fcb8c87cef3) )
ROM_LOAD( "multchmp.u34", 0x180000, 0x080000, CRC(bffaaccc) SHA1(d9ab248e2c7c639666e3717cfc5d8c8468a1bde2) )
ROM_LOAD( "multchmp.u29", 0x200000, 0x080000, CRC(01bd1399) SHA1(b717ccffe0af92a42a0879736d34d3ad71840233) )
ROM_LOAD( "multchmp.u30", 0x280000, 0x080000, CRC(c6b4cc18) SHA1(d9097b85584272cfe4989a40d622ef1feeee6775) )
ROM_LOAD( "multchmp.u31", 0x300000, 0x080000, CRC(b1e4e9e3) SHA1(1a7393e9073b028b4170393b3788ad8cb86c0c78) )
ROM_LOAD( "multchmp.u32", 0x380000, 0x080000, CRC(f05cb5b4) SHA1(1b33e60942238e39d61ae59e9317b99e83595ab1) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(6e741fcd) SHA1(742e0952916c00f67dd9f8d01e721a9a538d2fc4) )
ROM_END
/*
Multi Champ Deluxe
------------------
PCB Layout
----------
ESD 08-26-1999
|-----------------------------------------|
| 3014 3812 6116 6295 ESD4.SU10 * |
|VOL ESD3.SU06 Z80 ROM.JU01|
| PAL * |
| 6116 |
| 6116 PAL 6116 ROM.JU02|
| 6116 |-------| * |
|J PAL | ESD | * |
|A PAL |CRTC99 |ESD5.JU07 |
|M PAL | | * |
|M PAL |-------| |
|A 68000 ESD1.CU03 |
| ESD2.CU02 |-------| |
| |ACTEL | 6116 |
| 93C46 |A40MX04| 6116 |
| MCM6206 | | 6116 |
| MCM6206 |-------| 6116 |
| 16MHz PAL MCM6206 |
| 14MHz PAL MCM6206 ROM.FU35 ROM.FU34 |
|-----------------------------------------|
Notes:
68000 clock 16.000MHz
Z80 clock 4.000MHz
M6295 clock 1.000MHz. Sample rate 1000000/132
YM3812 clock 4.000MHz
HSync - 15.625kHz
VSync - 60Hz
MCM6206 - 32k x8 SRAM (SOJ28)
6116 - 2k x8 SRAM (SOP28)
A40MX04 - Actel A40MX04-F FPGA (PLCC84)
CRTC99 - ESD CRTC99 Graphics Controller (QFP240)
* : Board has positions for 6x standard 32 pin EPROMs but only position ESD5 is populated
with an EPROM. In between the unpopulated positions are 2x smt pads. These are populated
with 2x 16M SOP44 smt Mask ROMs.
Note: Some versions of this PCB used larger EPROMs with the data repeated:
ESD 3 @ SU06 as a 27C040 with data repeated 2x (CRC32 0x2C0C8813)
*/
ROM_START( mchampdx )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "ver0106_esd2.cu02", 0x000000, 0x040000, CRC(ea98b3fd) SHA1(107ee8adea246141fd6fa9209541ce0a7ed1e24c) )
ROM_LOAD16_BYTE( "ver0106_esd1.cu03", 0x000001, 0x040000, CRC(c6e4546b) SHA1(af9a8edffe94d035f92b36b1cd145c2a5ee66f48) )
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(1b22568c) SHA1(5458e1a798357a6785f8ea1fe9da37768cd4761d) )
ROM_CONTINUE( 0x10000, 0x34000)
/* this has additional copyright sprites in the flash roms for the (c)2000 message.. */
ROM_REGION( 0x600000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "ver0106_ju01.bin", 0x200000, 0x200000, CRC(55841d90) SHA1(52ba3ee9393dcddf28e2d20a50151bc739faaaa4) )
ROM_LOAD( "ver0106_ju02.bin", 0x000000, 0x200000, CRC(b27a4977) SHA1(b7f94bb04d0046538b3938335e6b0cce330ad79c) )
/* expand this to take up 0x200000 bytes too so we can decode it */
ROM_LOAD16_BYTE( "ver0106_esd5.ju07", 0x400000, 0x040000, CRC(7a3ac887) SHA1(3c759f9bed396bbaf6bd7298a8bd2bd76df3aa6f) )
ROM_FILL( 0x500000, 0x100000, 0 )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "rom.fu35", 0x000000, 0x200000, CRC(ba46f3dc) SHA1(4ac7695bdf4237654481f7f74f8650d70a51e691) )
ROM_LOAD16_BYTE( "rom.fu34", 0x000001, 0x200000, CRC(2895cf09) SHA1(88756fcd589af1986c3881d4080f086afc11b498) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "ver0106_esd4.su10", 0x00000, 0x40000, CRC(ac8ae009) SHA1(2c1c30cc4b3e34a5f14d7dfb6f6e18ff21f526f5) )
ROM_END
ROM_START( mchampdxa )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "esd2.cu02", 0x000000, 0x040000, CRC(4cca802c) SHA1(5e6e81febbb56b7c4630b530e546e7ab59c6c6c1) )
ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(0af1cd0a) SHA1(d2befcb596d83d523317d17b4c1c71f99de0d33e) )
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(1b22568c) SHA1(5458e1a798357a6785f8ea1fe9da37768cd4761d) )
ROM_CONTINUE( 0x10000, 0x34000)
ROM_REGION( 0x600000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "rom.ju01", 0x200000, 0x200000, CRC(1a749fc2) SHA1(feff4b26ee28244b4d092798a176e33e09d5df2c) )
ROM_LOAD( "rom.ju02", 0x000000, 0x200000, CRC(7e87e332) SHA1(f90aa00a64a940846d99053c7aa023e3fd5d070b) )
/* expand this to take up 0x200000 bytes too so we can decode it */
ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(6cc871cc) SHA1(710b9695c864e4234686993b88d24590d60e1cb9) )
ROM_FILL( 0x500000, 0x100000, 0 )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "rom.fu35", 0x000000, 0x200000, CRC(ba46f3dc) SHA1(4ac7695bdf4237654481f7f74f8650d70a51e691) )
ROM_LOAD16_BYTE( "rom.fu34", 0x000001, 0x200000, CRC(2895cf09) SHA1(88756fcd589af1986c3881d4080f086afc11b498) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.su10", 0x00000, 0x40000, CRC(2fbe94ab) SHA1(1bc4a33ec93a80fb598722d2b50bdf3ccaaa984a) )
ROM_END
ROM_START( mchampdxb )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "ver1114_esd2.cu02", 0x000000, 0x040000, CRC(d17b2616) SHA1(2c50c2bf928036678b92b8862d191552e46d9faa) )
ROM_LOAD16_BYTE( "ver1114_esd1.cu03", 0x000001, 0x040000, CRC(11ff2e94) SHA1(30044bedfff514ae0a855cffa756e5c315fe2124) )
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "ver1114_esd3.su06", 0x00000, 0x0c000, CRC(b87a1e85) SHA1(2fcdd7e8b301e3d20e6500a03dc293403b23b471) )
ROM_CONTINUE( 0x10000, 0x34000)
ROM_REGION( 0x600000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "ver1114_ju01", 0x200000, 0x200000, CRC(0048e687) SHA1(5cc0a35b5f5f8d69b2dc3728ad6d0d505d9e16c5) ) // SMT Flash MX chips
ROM_LOAD( "ver1114_ju02", 0x000000, 0x200000, CRC(2f9ccff8) SHA1(176240cd247cc5d3efd58fe0630726a8633be2a4) )
/* expand this to take up 0x200000 bytes too so we can decode it */
ROM_LOAD16_BYTE( "ver1114_esd5.ju07", 0x400000, 0x040000, CRC(8175939f) SHA1(cd0132ae0d2e35dc656434989b1f0f255ad562ab) )
ROM_FILL( 0x500000, 0x100000, 0 )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "ver1114_fu35", 0x000000, 0x200000, CRC(c515c704) SHA1(c1657534314e66a25c38f70a12f14d2225ab89cc) ) // SMT Flash MX chips
ROM_LOAD16_BYTE( "ver1114_fu34", 0x000001, 0x200000, CRC(39d448bb) SHA1(07cd6e30a25d1c0caeef0f95f23df0ca6a2c7a26) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.su10", 0x00000, 0x40000, CRC(2fbe94ab) SHA1(1bc4a33ec93a80fb598722d2b50bdf3ccaaa984a) )
ROM_END
/***************************************************************************
PCB Layout (Head Panic)
----------
ESD 05-28-99
+-----------------------------------------+
| 3812 3014 W24165 6295 ESD4 |
|VOL ESD3 |
| PAL Z80 |
| |
| +-------+ SM4 |
| W24165 62256 | ESD | |
|J W24165 62256 |CRTC99 | SM3 |
|A 62256 | | |
|M 62256 +-------+ PAL |
|M 68000 ESD1 PAL |
|A PAL ESD2 W24165 +-------+ ESD5 |
| PAL W24165 |ACTEL | |
| |A40MX04| |
| W24165 | | SM2 |
| W24165 +-------+ |
|S1 93C46 W24165 PAL SM1 |
|S2 16MHz 14MHZ W24165 PAL PAL |
+-----------------------------------------+
Notes:
68000 (MC68HC000FN16)
Z80 (Z84C00006FEC)
YM3014/YM3812 & OKI M6295 (rebaged as U6614/U6612 & AD-65)
A40MX04 - Actel A40MX04-F FPGA (PLCC84)
CRTC99 - ESD CRTC99 Graphics Controller (QFP240)
ESD1, ESD2 are 27C2001
ESD3 is a 27C2000
ESD4 is a 27C010 Mask ROM
ESD5 is a 27C040
SM1, SM2, SM3 & SM4 are MX29F1610MC 16M SOP44 smt flash ROM
1x connector JAMMA
1x trimmer (volume)
2x pushbutton
ESD 08-26-1999
|-----------------------------------------|
| 3014 3812 6116 6295 ESD4 |
|VOL ESD3 Z80 * |
| PAL ESD6 |
| 6116 * |
| 6116 PAL 6116 ESD7 |
| 6116 |-------| * |
|J PAL | ESD | * |
|A PAL |CRTC99 | ESD5 |
|M PAL | | * |
|M PAL |-------| |
|A ESD1 |
| 68000 ESD2 |-------| |
| |ACTEL | 6116 |
| |A40MX04| 6116 |
| 93C46 MCM6206 | | 6116 |
| MCM6206 |-------| 6116 |
| 16MHz PAL MCM6206 |
| 14MHz PAL MCM6206 ESD8 % ESD9 |
|-----------------------------------------|
Notes:
HSync: 15.625kHz
VSync: 60Hz
MCM6206 is 32kx8 SRAM
6116 is 8kx8 SRAM
* : Board has positions for 6x standard 32 pin EPROMs but only position ESD5 is populated
with an EPROM. In between the unpopulated positions are 2x smt pads. These are populated
with 2x 16M SOP44 smt Mask ROMs.
% : ROMs ESD8 and ESD9 are also 16M SOP44 smt Mask ROMs, though these are dedicated smt
locations (i.e. no option for EPROMs at this location)
Note: Some versions of this PCB used larger EPROMs with the data repeated:
ESD 3 @ SU06 as a 27C040 with data repeated 2x (CRC32 0xC668D443)
ESD 4 @ SU10 as a 27C040 with data repeated 4x (CRC32 0x5692FE92)
***************************************************************************/
ROM_START( hedpanic ) /* Story line & game instructions in English */
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "esd2.cu03", 0x000000, 0x040000, CRC(7c7be3bb) SHA1(d43ad7a967e1ef79ee0cf50d3842cc9174fbef3a) )
ROM_LOAD16_BYTE( "esd1.cu02", 0x000001, 0x040000, CRC(42405e9d) SHA1(0fa088b8bd921e42cedcc4083dfe41bc9888dfd1) )
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) /* AT27C020 mask rom */
ROM_CONTINUE( 0x10000, 0x34000)
ROM_REGION( 0x600000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) )
ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) )
/* expand this to take up 0x200000 bytes too so we can decode it */
ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(bd785921) SHA1(c8bcb38d5aa6f5a27f0dedf7efd1d6737d59b4ca) )
ROM_FILL( 0x500000, 0x100000, 0 )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "esd8.fu35", 0x000000, 0x200000, CRC(23aceb4f) SHA1(35d9ebc33b9e1515e47750cfcdfc0bf8bf44b71d) )
ROM_LOAD16_BYTE( "esd9.fu34", 0x000001, 0x200000, CRC(76b46cd2) SHA1(679cbf50ae5935e8848868081ecef4ec66424f6c) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) /* AT27010 mask rom */
ROM_REGION( 0x80, "eeprom", 0 )
ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) )
ROM_END
ROM_START( hedpanicf ) /* Story line in Japanese, game instructions in English */
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "esd2", 0x000000, 0x040000, CRC(8cccc691) SHA1(d6a5dd6c21a67638b9023182f77780282b9b04e5) )
ROM_LOAD16_BYTE( "esd1", 0x000001, 0x040000, CRC(d8574925) SHA1(bd4990778b90a49aa6b10f8cf6709ce2424f546a) )
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) /* AT27C020 mask rom */
ROM_CONTINUE( 0x10000, 0x34000)
ROM_REGION( 0x600000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) )
ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) )
/* expand this to take up 0x200000 bytes too so we can decode it */
ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(bd785921) SHA1(c8bcb38d5aa6f5a27f0dedf7efd1d6737d59b4ca) )
ROM_FILL( 0x500000, 0x100000, 0 )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "esd8.fu35", 0x000000, 0x200000, CRC(23aceb4f) SHA1(35d9ebc33b9e1515e47750cfcdfc0bf8bf44b71d) )
ROM_LOAD16_BYTE( "esd9.fu34", 0x000001, 0x200000, CRC(76b46cd2) SHA1(679cbf50ae5935e8848868081ecef4ec66424f6c) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) /* AT27010 mask rom */
ROM_REGION( 0x80, "eeprom", 0 )
ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) )
ROM_END
ROM_START( hedpanico ) /* Story line & game instructions in English, copyright year is 1999 - ESD 05-28-99 PCB which uses older style sprites */
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "esd2.rom", 0x000000, 0x040000, CRC(70b08424) SHA1(2ba4fb3b749e31db4239a9173b8509366400152f) ) /* CU03 */
ROM_LOAD16_BYTE( "esd1.rom", 0x000001, 0x040000, CRC(4e0682c5) SHA1(f4117f31b6426d7bf126a6c62c489b9347885b42) ) /* CU02 */
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
// this rom is severely corrupted, however, I think it should be the same, so I'm using the one from the other sets
//ROM_LOAD( "esd3.rom", 0x00000, 0x0c000, BAD_DUMP CRC(b72b761b) SHA1(9735e05ddc1db38bf81eac89a5312200fc008248) ) /* Should be twice the size, IE: 27C020 */
//ROM_CONTINUE( 0x10000, 0x14000)
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) /* AT27C020 mask rom */
ROM_CONTINUE( 0x10000, 0x34000)
ROM_REGION( 0x600000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "sm1.ju01", 0x000000, 0x200000, CRC(8083813f) SHA1(9492e7e844e45d59f0506f69d40c338b27bd3ce3) )
ROM_LOAD( "sm2.ju02", 0x200000, 0x200000, CRC(7a9610e4) SHA1(21ae3ec3fbddfc66416c109b091bd885d5ba0558) )
/* expand this to take up 0x200000 bytes too so we can decode it */
ROM_LOAD16_BYTE( "esd5.rom", 0x400000, 0x080000, CRC(82c5727f) SHA1(017f1d0c94475c51d17f12e24895f47a273a2dbb) ) /* JU07 */
ROM_FILL( 0x500000, 0x100000, 0 )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "sm3.fu35", 0x000000, 0x200000, CRC(94dd4cfc) SHA1(a3f9c49611f0bc9d26166dafb44e2c5ebbb31127) )
ROM_LOAD16_BYTE( "sm4.fu34", 0x000001, 0x200000, CRC(6da0fb9e) SHA1(c4e7487953f45c5f6ce2ebe558b4c325f6ec54eb) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.rom", 0x000000, 0x020000, CRC(d7ca6806) SHA1(8ad668bfb5b7561cc0f3e36dfc3c936b136a4274) ) /* SU10 */
ROM_REGION( 0x80, "eeprom", 0 )
ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) )
ROM_END
/* Tang Tang
Tang Tang (ESD)
------------------------
PCB Layout
----------
ESD made in Korea
|-----------------------------------------|
| U6614 U6612 6116 AD65 ESD4.SU10 |
|VOL ESD3.SU06 Z80 ROM.JU04|
| PAL |
| 6116 ROM.JU05|
| 6116 PAL 6116 |
| 6116 |-------| ROM.JU06|
|J PAL | ESD | |
|A PAL |CRTC99 | ROM.JU07|
|M PAL | 0016 | |
|M PAL |-------| ROM.JU08|
|A 68000 ESD1.CU03 |
| ESD2.CU02 |-------| |
| |ACTEL | 6116 |
| |A40MX04| 6116 |
| MCM6206 | 0008 | 6116 |
| MCM6206 |-------| 6116 |
| 16MHz PAL MCM6206 |
| 14MHz PAL MCM6206 ROM.FU35 ROM.FU34 |
|-----------------------------------------|
Notes:
68000 (MC68HC000FN16-2E60R-QQJU9508)
Z80 (Z84C00006FEC-Z80CPU-9618Z3)
OKI6295 label AD65 (sound)
YM3014 label U6614 (sound)
YM3812 label U6612 (sound)
MCM6206 - 32k x8 SRAM (SOJ28)
6116 - 2k x8 SRAM (SOP28)
A40MX04 - Actel A40MX04-F FPGA (PLCC84)
CRTC99 - ESD CRTC99 Graphics Controller (QFP240)
ESD1-2 - 27C2001
ESD3-4 - 27C2000
JU04-8 - MX27C2000PC
FU34,FU35 - MX29F1610MC
1x connector JAMMA
1x trimmer (volume)
2x pushbutton
* : Board has positions for 6x standard 32 pin EPROMs but only 5 positions are populated with an EPROM.
* : Tang Tang also known to be found on a ESD 05-28-99 PCB (see Head Panic above for PCB layout)
*/
ROM_START( tangtang )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "esd2.cu02", 0x000000, 0x040000, CRC(b6dd6e3d) SHA1(44d2663827c45267eb154c873f3bd2e9e2bf3d3f) )
ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(b6c0f2f4) SHA1(68ad76e7e380c728dda200a852729e034d9c9f4c) )
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(d48ecc5c) SHA1(5015dd775980542eb29a08bffe1a09ea87d56272) )
ROM_CONTINUE( 0x10000, 0x34000)
ROM_REGION( 0x140000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "xju04.bin", 0x000000, 0x040000, CRC(f999b9d7) SHA1(9e4d0e68cdc429c7563b8ad51c072d68ffed09dc) )
ROM_LOAD( "xju05.bin", 0x040000, 0x040000, CRC(679302cf) SHA1(911c2f7e0e809ee28e4f2364788fd51d2bcef24e) )
ROM_LOAD( "xju06.bin", 0x080000, 0x040000, CRC(01f59ff7) SHA1(a62a2d5c2d107f67fecfc08fdb5d801ee39c3875) )
ROM_LOAD( "xju07.bin", 0x0c0000, 0x040000, CRC(556acac3) SHA1(10e919e63b434da80fb261db1d8967cb11e95e00) )
ROM_LOAD( "xju08.bin", 0x100000, 0x040000, CRC(ecc2d8c7) SHA1(1aabdf7204fcdff8d46cb50de8b097e3775dddf3) )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "fu35.bin", 0x000000, 0x200000, CRC(84f3f833) SHA1(f84e41d93dc47a58ada800b921a7e5902b7631cd) )
ROM_LOAD16_BYTE( "fu34.bin", 0x000001, 0x200000, CRC(bf91f543) SHA1(7c149fed8b8044850cd6b798622a91c45336cd47) )
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(f2dfb02d) SHA1(04001488697aad3e5b2d15c9f5a81dc2b7d0952c) )
ROM_END
/*
SWAT Police (c) 2001 ESD
PCB Layout
----------
ESD made in Korea
|-----------------------------------------|
| 3014 3812 6116 6295 AT27C020 |
|VOL ESD3.SU06 Z80 ESD1.JU03|
| PAL |
| 6116 ESD2.JU04|
| 6116 PAL 6116 |
| 6116 PAL |-------| ESD3.JU05|
|J PAL | ESD | |
|A |CRTC99 | ESD4.JU06|
|M PAL | 0016 | |
|M PAL |-------| ESD5.JU07|
|A 68000 ESD.CU03 |
| ESD.CU02 |-------| |
| |ACTEL | |
| |A40MX04| 6116|
| MCM6206 | 0008 | 6116|
| MCM6206 |-------| |
| 16MHz PAL MCM6206 6116|
| 14MHz PAL MCM6206 FU35 FU34 6116|
|-----------------------------------------|
Notes:
68000 (MC68HC000FN16)
Z80 (Z84C00006FEC-Z80CPU)
OKI6295 label AD65 (sound)
YM3014 label U6614 (sound)
YM3812 label U6612 (sound)
MCM6206 - 32k x8 SRAM (SOJ28)
6116 - 2k x8 SRAM (SOP28)
A40MX04 - Actel A40MX04-F FPGA (PLCC84)
CRTC99 - ESD CRTC99 Graphics Controller (QFP240)
JU03-8 - 27C040
FU34,FU35 - MX29F1610MC
1x connector JAMMA
1x trimmer (volume)
2x pushbutton
* : Board has positions for 6x standard 32 pin EPROMs but only 5 positions are populated
with an EPROM.
*/
ROM_START( swatpolc ) /* SWAT Police */
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "esd.cu02", 0x000000, 0x040000, CRC(29e0c126) SHA1(7c0356eed4ffdc056b7ec5c1ac07f1c9cc6aeffa) ) /* ESD labels but not numbered */
ROM_LOAD16_BYTE( "esd.cu03", 0x000001, 0x040000, CRC(1070208b) SHA1(1e058774c5aee1de15ffcd26d530b23592286db1) ) /* ESD labels but not numbered */
ROM_REGION( 0x44000, "audiocpu", 0 ) /* Z80 Code */
ROM_LOAD( "esd3.su06", 0x00000, 0x0c000, CRC(80e97dbe) SHA1(d6fae689cd3737777f36c980b9a7d9e42b06a467) ) /* 2 roms on PCB with an ESD3 label */
ROM_CONTINUE( 0x10000, 0x34000)
ROM_REGION( 0x280000, "gfx1", 0 ) /* Sprites, 16x16x5 */
ROM_LOAD( "esd1.ju03", 0x000000, 0x080000, CRC(17fcc5e7) SHA1(ad57d2b0c0062f6f8c7732df57e4d12ca47c1bb8) )
ROM_LOAD( "esd2.ju04", 0x080000, 0x080000, CRC(9c1752f2) SHA1(2e8c377137258498564749413b49e156180e806a) )
ROM_LOAD( "esd3.ju05", 0x100000, 0x080000, CRC(e8d9c092) SHA1(80e1f1d4dad48c7be3d4b72c4a82d5388fd493c7) )
ROM_LOAD( "esd4.ju06", 0x180000, 0x080000, CRC(bde1b130) SHA1(e45a2257f8c4d107dfb7401b5ae1b79951052bc6) )
ROM_LOAD( "esd5.ju07", 0x200000, 0x080000, CRC(d2c27f03) SHA1(7cbdf7f7ff17df16ca81823f69e82ae1cf96b714) )
ROM_REGION( 0x400000, "gfx2", 0 ) /* Layers, 16x16x8 */
ROM_LOAD16_BYTE( "fu35", 0x000000, 0x200000, CRC(c55897c5) SHA1(f6e0ef1c2fcfe6a511fe787a3abeff4da16d1b54) ) /* No labels on the flash roms */
ROM_LOAD16_BYTE( "fu34", 0x000001, 0x200000, CRC(7117a6a2) SHA1(17c0ab02698cffa0582ed2d2b7dbb7fed8cd9393) ) /* No labels on the flash roms */
ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
ROM_LOAD( "at27c020.su10", 0x00000, 0x40000, CRC(c43efec2) SHA1(4ef328d8703b81328de09ecc4328763aba06e883) ) /* AT27C020 mask rom with no label */
ROM_END
/***************************************************************************
Game Drivers
***************************************************************************/
/* ESD 11-09-98 */
GAME( 1999, multchmp, 0, multchmp, multchmp, 0, ROT0, "ESD", "Multi Champ (World)", GAME_SUPPORTS_SAVE )
GAME( 1998, multchmpk,multchmp, multchmp, multchmp, 0, ROT0, "ESD", "Multi Champ (Korea)", GAME_SUPPORTS_SAVE )
/* ESD 05-28-99 */
GAME( 1999, hedpanico,hedpanic, hedpanio, hedpanic, 0, ROT0, "ESD", "Head Panic (ver. 0615, 15/06/1999)", GAME_SUPPORTS_SAVE ) // 15/06/1999 ?
/* ESD 08-26-1999 */
GAME( 2000, mchampdx, 0, mchampdx, hedpanic, 0, ROT0, "ESD", "Multi Champ Deluxe (ver. 0106, 06/01/2000)", GAME_SUPPORTS_SAVE ) // 06/01/2000 ?
GAME( 1999, mchampdxa,mchampdx, mchampdx, hedpanic, 0, ROT0, "ESD", "Multi Champ Deluxe (ver. 1126, 26/11/1999)", GAME_SUPPORTS_SAVE ) // 26/11/1999 ?
GAME( 1999, mchampdxb,mchampdx, mchampdx, hedpanic, 0, ROT0, "ESD", "Multi Champ Deluxe (ver. 1114, 14/11/1999)", GAME_SUPPORTS_SAVE ) // 14/11/1999 ?
GAME( 2000, hedpanic, 0, hedpanic, hedpanic, 0, ROT0, "ESD", "Head Panic (ver. 0117, 17/01/2000)", GAME_SUPPORTS_SAVE ) // 17/01/2000 ?
GAME( 2000, hedpanicf,hedpanic, hedpanic, hedpanic, 0, ROT0, "ESD / Fuuki", "Head Panic (ver. 0315, 15/03/2000)", GAME_SUPPORTS_SAVE ) // 15/03/2000 ?
/* ESD - This PCB looks identical to the ESD 08-26-1999 PCB */
GAME( 2000, tangtang, 0, tangtang, hedpanic, 0, ROT0, "ESD", "Tang Tang (ver. 0526, 26/05/2000)", GAME_SUPPORTS_SAVE ) // 26/05/2000 ?
GAME( 2001, swatpolc, 0, swatpolc, swatpolc, 0, ROT0, "ESD", "SWAT Police ", GAME_SUPPORTS_SAVE )
| 47.578176 | 159 | 0.649146 |
d9296305da050bd441290999e8fae8ba891053d2 | 86,261 | h | C | release/src/linux/linux/include/asm-ia64/sn/sn1/hubmd.h | enfoTek/tomato.linksys.e2000.nvram-mod | 2ce3a5217def49d6df7348522e2bfda702b56029 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | release/src/linux/linux/include/asm-ia64/sn/sn1/hubmd.h | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | release/src/linux/linux/include/asm-ia64/sn/sn1/hubmd.h | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | /* $Id: hubmd.h,v 1.1.1.4 2003/10/14 08:09:11 sparq Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved.
*/
#ifndef _ASM_IA64_SN_SN1_HUBMD_H
#define _ASM_IA64_SN_SN1_HUBMD_H
/************************************************************************
* *
* WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! *
* *
* This file is created by an automated script. Any (minimal) changes *
* made manually to this file should be made with care. *
* *
* MAKE ALL ADDITIONS TO THE END OF THIS FILE *
* *
************************************************************************/
#define MD_CURRENT_CELL 0x00780000 /*
* BDDIR, LREG, LBOOT,
* RREG, RBOOT
* protection and mask
* for using Local
* Access protection.
*/
#define MD_MEMORY_CONFIG 0x00780008 /*
* Memory/Directory
* DIMM control
*/
#define MD_ARBITRATION_CONTROL 0x00780010 /*
* Arbitration
* Parameters
*/
#define MD_MIG_CONFIG 0x00780018 /*
* Page Migration
* control
*/
#define MD_FANDOP_CAC_STAT0 0x00780020 /*
* Fetch-and-op cache
* 0 status
*/
#define MD_FANDOP_CAC_STAT1 0x00780028 /*
* Fetch-and-op cache
* 1 status
*/
#define MD_MISC0_ERROR 0x00780040 /*
* Miscellaneous MD
* error
*/
#define MD_MISC1_ERROR 0x00780048 /*
* Miscellaneous MD
* error
*/
#define MD_MISC1_ERROR_CLR 0x00780058 /*
* Miscellaneous MD
* error clear
*/
#define MD_OUTGOING_RP_QUEUE_SIZE 0x00780060 /*
* MD outgoing reply
* queues sizing
*/
#define MD_PERF_SEL0 0x00790000 /*
* Selects events
* monitored by
* MD_PERF_CNT0
*/
#define MD_PERF_SEL1 0x00790008 /*
* Selects events
* monitored by
* MD_PERF_CNT1
*/
#define MD_PERF_CNT0 0x00790010 /*
* Performance counter
* 0
*/
#define MD_PERF_CNT1 0x00790018 /*
* Performance counter
* 1
*/
#define MD_REFRESH_CONTROL 0x007A0000 /*
* Memory/Directory
* refresh control
*/
#define MD_JUNK_BUS_TIMING 0x007A0008 /* Junk Bus Timing */
#define MD_LED0 0x007A0010 /* Reads of 8-bit LED0 */
#define MD_LED1 0x007A0018 /* Reads of 8-bit LED1 */
#define MD_LED2 0x007A0020 /* Reads of 8-bit LED2 */
#define MD_LED3 0x007A0028 /* Reads of 8-bit LED3 */
#define MD_BIST_CTL 0x007A0030 /*
* BIST general
* control
*/
#define MD_BIST_DATA 0x007A0038 /*
* BIST initial data
* pattern and
* variation control
*/
#define MD_BIST_AB_ERR_ADDR 0x007A0040 /* BIST error address */
#define MD_BIST_STATUS 0x007A0048 /* BIST status */
#define MD_IB_DEBUG 0x007A0060 /* IB debug select */
#define MD_DIR_CONFIG 0x007C0000 /*
* Directory mode
* control
*/
#define MD_DIR_ERROR 0x007C0010 /*
* Directory DIMM
* error
*/
#define MD_DIR_ERROR_CLR 0x007C0018 /*
* Directory DIMM
* error clear
*/
#define MD_PROTOCOL_ERROR 0x007C0020 /*
* Directory protocol
* error
*/
#define MD_PROTOCOL_ERR_CLR 0x007C0028 /*
* Directory protocol
* error clear
*/
#define MD_MIG_CANDIDATE 0x007C0030 /*
* Page migration
* candidate
*/
#define MD_MIG_CANDIDATE_CLR 0x007C0038 /*
* Page migration
* candidate clear
*/
#define MD_MIG_DIFF_THRESH 0x007C0040 /*
* Page migration
* count difference
* threshold
*/
#define MD_MIG_VALUE_THRESH 0x007C0048 /*
* Page migration
* count absolute
* threshold
*/
#define MD_OUTGOING_RQ_QUEUE_SIZE 0x007C0050 /*
* MD outgoing request
* queues sizing
*/
#define MD_BIST_DB_ERR_DATA 0x007C0058 /*
* BIST directory
* error data
*/
#define MD_DB_DEBUG 0x007C0060 /* DB debug select */
#define MD_MB_ECC_CONFIG 0x007E0000 /*
* Data ECC
* Configuration
*/
#define MD_MEM_ERROR 0x007E0010 /* Memory DIMM error */
#define MD_MEM_ERROR_CLR 0x007E0018 /*
* Memory DIMM error
* clear
*/
#define MD_BIST_MB_ERR_DATA_0 0x007E0020 /*
* BIST memory error
* data
*/
#define MD_BIST_MB_ERR_DATA_1 0x007E0028 /*
* BIST memory error
* data
*/
#define MD_BIST_MB_ERR_DATA_2 0x007E0030 /*
* BIST memory error
* data
*/
#define MD_BIST_MB_ERR_DATA_3 0x007E0038 /*
* BIST memory error
* data
*/
#define MD_MB_DEBUG 0x007E0040 /* MB debug select */
#ifndef __ASSEMBLY__
/************************************************************************
* *
* Description: This register shows which regions are in the current *
* cell. If a region has its bit set in this register, then it uses *
* the Local Access protection in the directory instead of the *
* separate per-region protection (which would cause a small *
* performance penalty). In addition, writeback and write reply *
* commands from outside the current cell will always check the *
* directory protection before writing data to memory. Writeback and *
* write reply commands from inside the current cell will write *
* memory regardless of the protection value. *
* This register is also used as the access-rights bit-vector for *
* most of the ASIC-special (HSpec) portion of the address space. It *
* covers the BDDIR, LREG, LBOOT, RREG, and RBOOT spaces. It does not *
* cover the UALIAS and BDECC spaces, as they are covered by the *
* protection in the directory. If a bit in the bit-vector is set, *
* the region corresponding to that bit has read/write permission on *
* these spaces. If the bit is clear, then that region has read-only *
* access to these spaces (except for LREG/RREG which have no access *
* when the bit is clear). *
* The granularity of a region is set by the REGION_SIZE register in *
* the NI local register space. *
* NOTE: This means that no processor outside the current cell can *
* write into the BDDIR, LREG, LBOOT, RREG, or RBOOT spaces. *
* *
************************************************************************/
typedef union md_current_cell_u {
bdrkreg_t md_current_cell_regval;
struct {
bdrkreg_t cc_hspec_prot : 64;
} md_current_cell_fld_s;
} md_current_cell_u_t;
/************************************************************************
* *
* Description: This register contains three sets of information. *
* The first set describes the size and configuration of DIMMs that *
* are plugged into a system, the second set controls which set of *
* protection checks are performed on each access and the third set *
* controls various DDR SDRAM timing parameters. *
* In order to config a DIMM bank, three fields must be initialized: *
* BANK_SIZE, DRAM_WIDTH, and BANK_ENABLE. The BANK_SIZE field sets *
* the address range that the MD unit will accept for that DIMM bank. *
* All addresses larger than the specified size will return errors on *
* access. In order to read from a DIMM bank, Bedrock must know *
* whether or not the bank contains x4 or x8/x16 DRAM. The operating *
* system must query the System Controller for this information and *
* then set the DRAM_WIDTH field accordingly. The BANK_ENABLE field *
* can be used to individually enable the two physical banks located *
* on each DIMM bank. *
* The contents of this register are preserved through soft-resets. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_memory_config_u {
bdrkreg_t md_memory_config_regval;
struct {
bdrkreg_t mc_dimm0_bank_enable : 2;
bdrkreg_t mc_reserved_7 : 1;
bdrkreg_t mc_dimm0_dram_width : 1;
bdrkreg_t mc_dimm0_bank_size : 4;
bdrkreg_t mc_dimm1_bank_enable : 2;
bdrkreg_t mc_reserved_6 : 1;
bdrkreg_t mc_dimm1_dram_width : 1;
bdrkreg_t mc_dimm1_bank_size : 4;
bdrkreg_t mc_dimm2_bank_enable : 2;
bdrkreg_t mc_reserved_5 : 1;
bdrkreg_t mc_dimm2_dram_width : 1;
bdrkreg_t mc_dimm2_bank_size : 4;
bdrkreg_t mc_dimm3_bank_enable : 2;
bdrkreg_t mc_reserved_4 : 1;
bdrkreg_t mc_dimm3_dram_width : 1;
bdrkreg_t mc_dimm3_bank_size : 4;
bdrkreg_t mc_dimm0_sel : 2;
bdrkreg_t mc_reserved_3 : 10;
bdrkreg_t mc_cc_enable : 1;
bdrkreg_t mc_io_prot_en : 1;
bdrkreg_t mc_io_prot_ignore : 1;
bdrkreg_t mc_cpu_prot_ignore : 1;
bdrkreg_t mc_db_neg_edge : 1;
bdrkreg_t mc_phase_delay : 1;
bdrkreg_t mc_delay_mux_sel : 2;
bdrkreg_t mc_sample_time : 2;
bdrkreg_t mc_reserved_2 : 2;
bdrkreg_t mc_mb_neg_edge : 3;
bdrkreg_t mc_reserved_1 : 1;
bdrkreg_t mc_rcd_config : 1;
bdrkreg_t mc_rp_config : 1;
bdrkreg_t mc_reserved : 2;
} md_memory_config_fld_s;
} md_memory_config_u_t;
#else
typedef union md_memory_config_u {
bdrkreg_t md_memory_config_regval;
struct {
bdrkreg_t mc_reserved : 2;
bdrkreg_t mc_rp_config : 1;
bdrkreg_t mc_rcd_config : 1;
bdrkreg_t mc_reserved_1 : 1;
bdrkreg_t mc_mb_neg_edge : 3;
bdrkreg_t mc_reserved_2 : 2;
bdrkreg_t mc_sample_time : 2;
bdrkreg_t mc_delay_mux_sel : 2;
bdrkreg_t mc_phase_delay : 1;
bdrkreg_t mc_db_neg_edge : 1;
bdrkreg_t mc_cpu_prot_ignore : 1;
bdrkreg_t mc_io_prot_ignore : 1;
bdrkreg_t mc_io_prot_en : 1;
bdrkreg_t mc_cc_enable : 1;
bdrkreg_t mc_reserved_3 : 10;
bdrkreg_t mc_dimm0_sel : 2;
bdrkreg_t mc_dimm3_bank_size : 4;
bdrkreg_t mc_dimm3_dram_width : 1;
bdrkreg_t mc_reserved_4 : 1;
bdrkreg_t mc_dimm3_bank_enable : 2;
bdrkreg_t mc_dimm2_bank_size : 4;
bdrkreg_t mc_dimm2_dram_width : 1;
bdrkreg_t mc_reserved_5 : 1;
bdrkreg_t mc_dimm2_bank_enable : 2;
bdrkreg_t mc_dimm1_bank_size : 4;
bdrkreg_t mc_dimm1_dram_width : 1;
bdrkreg_t mc_reserved_6 : 1;
bdrkreg_t mc_dimm1_bank_enable : 2;
bdrkreg_t mc_dimm0_bank_size : 4;
bdrkreg_t mc_dimm0_dram_width : 1;
bdrkreg_t mc_reserved_7 : 1;
bdrkreg_t mc_dimm0_bank_enable : 2;
} md_memory_config_fld_s;
} md_memory_config_u_t;
#endif
#ifdef LITTLE_ENDIAN
typedef union md_arbitration_control_u {
bdrkreg_t md_arbitration_control_regval;
struct {
bdrkreg_t ac_reply_guar : 4;
bdrkreg_t ac_write_guar : 4;
bdrkreg_t ac_reserved : 56;
} md_arbitration_control_fld_s;
} md_arbitration_control_u_t;
#else
typedef union md_arbitration_control_u {
bdrkreg_t md_arbitration_control_regval;
struct {
bdrkreg_t ac_reserved : 56;
bdrkreg_t ac_write_guar : 4;
bdrkreg_t ac_reply_guar : 4;
} md_arbitration_control_fld_s;
} md_arbitration_control_u_t;
#endif
/************************************************************************
* *
* Contains page migration control fields. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mig_config_u {
bdrkreg_t md_mig_config_regval;
struct {
bdrkreg_t mc_mig_interval : 10;
bdrkreg_t mc_reserved_2 : 6;
bdrkreg_t mc_mig_node_mask : 8;
bdrkreg_t mc_reserved_1 : 8;
bdrkreg_t mc_mig_enable : 1;
bdrkreg_t mc_reserved : 31;
} md_mig_config_fld_s;
} md_mig_config_u_t;
#else
typedef union md_mig_config_u {
bdrkreg_t md_mig_config_regval;
struct {
bdrkreg_t mc_reserved : 31;
bdrkreg_t mc_mig_enable : 1;
bdrkreg_t mc_reserved_1 : 8;
bdrkreg_t mc_mig_node_mask : 8;
bdrkreg_t mc_reserved_2 : 6;
bdrkreg_t mc_mig_interval : 10;
} md_mig_config_fld_s;
} md_mig_config_u_t;
#endif
/************************************************************************
* *
* Each register contains the valid bit and address of the entry in *
* the fetch-and-op for cache 0 (or 1). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_fandop_cac_stat0_u {
bdrkreg_t md_fandop_cac_stat0_regval;
struct {
bdrkreg_t fcs_reserved_1 : 6;
bdrkreg_t fcs_addr : 27;
bdrkreg_t fcs_reserved : 30;
bdrkreg_t fcs_valid : 1;
} md_fandop_cac_stat0_fld_s;
} md_fandop_cac_stat0_u_t;
#else
typedef union md_fandop_cac_stat0_u {
bdrkreg_t md_fandop_cac_stat0_regval;
struct {
bdrkreg_t fcs_valid : 1;
bdrkreg_t fcs_reserved : 30;
bdrkreg_t fcs_addr : 27;
bdrkreg_t fcs_reserved_1 : 6;
} md_fandop_cac_stat0_fld_s;
} md_fandop_cac_stat0_u_t;
#endif
/************************************************************************
* *
* Each register contains the valid bit and address of the entry in *
* the fetch-and-op for cache 0 (or 1). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_fandop_cac_stat1_u {
bdrkreg_t md_fandop_cac_stat1_regval;
struct {
bdrkreg_t fcs_reserved_1 : 6;
bdrkreg_t fcs_addr : 27;
bdrkreg_t fcs_reserved : 30;
bdrkreg_t fcs_valid : 1;
} md_fandop_cac_stat1_fld_s;
} md_fandop_cac_stat1_u_t;
#else
typedef union md_fandop_cac_stat1_u {
bdrkreg_t md_fandop_cac_stat1_regval;
struct {
bdrkreg_t fcs_valid : 1;
bdrkreg_t fcs_reserved : 30;
bdrkreg_t fcs_addr : 27;
bdrkreg_t fcs_reserved_1 : 6;
} md_fandop_cac_stat1_fld_s;
} md_fandop_cac_stat1_u_t;
#endif
/************************************************************************
* *
* Description: Contains a number of fields to capture various *
* random memory/directory errors. For each 2-bit field, the LSB *
* indicates that additional information has been captured for the *
* error and the MSB indicates overrun, thus: *
* x1: bits 51...0 of this register contain additional information *
* for the message that caused this error *
* 1x: overrun occurred *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_misc0_error_u {
bdrkreg_t md_misc0_error_regval;
struct {
bdrkreg_t me_command : 7;
bdrkreg_t me_reserved_4 : 1;
bdrkreg_t me_source : 11;
bdrkreg_t me_reserved_3 : 1;
bdrkreg_t me_suppl : 11;
bdrkreg_t me_reserved_2 : 1;
bdrkreg_t me_virtual_channel : 2;
bdrkreg_t me_reserved_1 : 2;
bdrkreg_t me_tail : 1;
bdrkreg_t me_reserved : 11;
bdrkreg_t me_xb_error : 4;
bdrkreg_t me_bad_partial_data : 2;
bdrkreg_t me_missing_dv : 2;
bdrkreg_t me_short_pack : 2;
bdrkreg_t me_long_pack : 2;
bdrkreg_t me_ill_msg : 2;
bdrkreg_t me_ill_revision : 2;
} md_misc0_error_fld_s;
} md_misc0_error_u_t;
#else
typedef union md_misc0_error_u {
bdrkreg_t md_misc0_error_regval;
struct {
bdrkreg_t me_ill_revision : 2;
bdrkreg_t me_ill_msg : 2;
bdrkreg_t me_long_pack : 2;
bdrkreg_t me_short_pack : 2;
bdrkreg_t me_missing_dv : 2;
bdrkreg_t me_bad_partial_data : 2;
bdrkreg_t me_xb_error : 4;
bdrkreg_t me_reserved : 11;
bdrkreg_t me_tail : 1;
bdrkreg_t me_reserved_1 : 2;
bdrkreg_t me_virtual_channel : 2;
bdrkreg_t me_reserved_2 : 1;
bdrkreg_t me_suppl : 11;
bdrkreg_t me_reserved_3 : 1;
bdrkreg_t me_source : 11;
bdrkreg_t me_reserved_4 : 1;
bdrkreg_t me_command : 7;
} md_misc0_error_fld_s;
} md_misc0_error_u_t;
#endif
/************************************************************************
* *
* Address for error captured in MISC0_ERROR. Error valid bits are *
* repeated in both MISC0_ERROR and MISC1_ERROR (allowing them to be *
* read sequentially without missing any errors). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_misc1_error_u {
bdrkreg_t md_misc1_error_regval;
struct {
bdrkreg_t me_reserved_1 : 3;
bdrkreg_t me_address : 38;
bdrkreg_t me_reserved : 7;
bdrkreg_t me_xb_error : 4;
bdrkreg_t me_bad_partial_data : 2;
bdrkreg_t me_missing_dv : 2;
bdrkreg_t me_short_pack : 2;
bdrkreg_t me_long_pack : 2;
bdrkreg_t me_ill_msg : 2;
bdrkreg_t me_ill_revision : 2;
} md_misc1_error_fld_s;
} md_misc1_error_u_t;
#else
typedef union md_misc1_error_u {
bdrkreg_t md_misc1_error_regval;
struct {
bdrkreg_t me_ill_revision : 2;
bdrkreg_t me_ill_msg : 2;
bdrkreg_t me_long_pack : 2;
bdrkreg_t me_short_pack : 2;
bdrkreg_t me_missing_dv : 2;
bdrkreg_t me_bad_partial_data : 2;
bdrkreg_t me_xb_error : 4;
bdrkreg_t me_reserved : 7;
bdrkreg_t me_address : 38;
bdrkreg_t me_reserved_1 : 3;
} md_misc1_error_fld_s;
} md_misc1_error_u_t;
#endif
/************************************************************************
* *
* Address for error captured in MISC0_ERROR. Error valid bits are *
* repeated in both MISC0_ERROR and MISC1_ERROR (allowing them to be *
* read sequentially without missing any errors). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_misc1_error_clr_u {
bdrkreg_t md_misc1_error_clr_regval;
struct {
bdrkreg_t mec_reserved_1 : 3;
bdrkreg_t mec_address : 38;
bdrkreg_t mec_reserved : 7;
bdrkreg_t mec_xb_error : 4;
bdrkreg_t mec_bad_partial_data : 2;
bdrkreg_t mec_missing_dv : 2;
bdrkreg_t mec_short_pack : 2;
bdrkreg_t mec_long_pack : 2;
bdrkreg_t mec_ill_msg : 2;
bdrkreg_t mec_ill_revision : 2;
} md_misc1_error_clr_fld_s;
} md_misc1_error_clr_u_t;
#else
typedef union md_misc1_error_clr_u {
bdrkreg_t md_misc1_error_clr_regval;
struct {
bdrkreg_t mec_ill_revision : 2;
bdrkreg_t mec_ill_msg : 2;
bdrkreg_t mec_long_pack : 2;
bdrkreg_t mec_short_pack : 2;
bdrkreg_t mec_missing_dv : 2;
bdrkreg_t mec_bad_partial_data : 2;
bdrkreg_t mec_xb_error : 4;
bdrkreg_t mec_reserved : 7;
bdrkreg_t mec_address : 38;
bdrkreg_t mec_reserved_1 : 3;
} md_misc1_error_clr_fld_s;
} md_misc1_error_clr_u_t;
#endif
/************************************************************************
* *
* Description: The MD no longer allows for arbitrarily sizing the *
* reply queues, so all of the fields in this register are read-only *
* and contain the reset default value of 12 for the MOQHs (for *
* headers) and 24 for the MOQDs (for data). *
* Reading from this register returns the values currently held in *
* the MD's credit counters. Writing to the register resets the *
* counters to the default reset values specified in the table below. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_outgoing_rp_queue_size_u {
bdrkreg_t md_outgoing_rp_queue_size_regval;
struct {
bdrkreg_t orqs_reserved_6 : 8;
bdrkreg_t orqs_moqh_p0_rp_size : 4;
bdrkreg_t orqs_reserved_5 : 4;
bdrkreg_t orqs_moqh_p1_rp_size : 4;
bdrkreg_t orqs_reserved_4 : 4;
bdrkreg_t orqs_moqh_np_rp_size : 4;
bdrkreg_t orqs_reserved_3 : 4;
bdrkreg_t orqs_moqd_pi0_rp_size : 5;
bdrkreg_t orqs_reserved_2 : 3;
bdrkreg_t orqs_moqd_pi1_rp_size : 5;
bdrkreg_t orqs_reserved_1 : 3;
bdrkreg_t orqs_moqd_np_rp_size : 5;
bdrkreg_t orqs_reserved : 11;
} md_outgoing_rp_queue_size_fld_s;
} md_outgoing_rp_queue_size_u_t;
#else
typedef union md_outgoing_rp_queue_size_u {
bdrkreg_t md_outgoing_rp_queue_size_regval;
struct {
bdrkreg_t orqs_reserved : 11;
bdrkreg_t orqs_moqd_np_rp_size : 5;
bdrkreg_t orqs_reserved_1 : 3;
bdrkreg_t orqs_moqd_pi1_rp_size : 5;
bdrkreg_t orqs_reserved_2 : 3;
bdrkreg_t orqs_moqd_pi0_rp_size : 5;
bdrkreg_t orqs_reserved_3 : 4;
bdrkreg_t orqs_moqh_np_rp_size : 4;
bdrkreg_t orqs_reserved_4 : 4;
bdrkreg_t orqs_moqh_p1_rp_size : 4;
bdrkreg_t orqs_reserved_5 : 4;
bdrkreg_t orqs_moqh_p0_rp_size : 4;
bdrkreg_t orqs_reserved_6 : 8;
} md_outgoing_rp_queue_size_fld_s;
} md_outgoing_rp_queue_size_u_t;
#endif
#ifdef LITTLE_ENDIAN
typedef union md_perf_sel0_u {
bdrkreg_t md_perf_sel0_regval;
struct {
bdrkreg_t ps_cnt_mode : 2;
bdrkreg_t ps_reserved_2 : 2;
bdrkreg_t ps_activity : 4;
bdrkreg_t ps_source : 7;
bdrkreg_t ps_reserved_1 : 1;
bdrkreg_t ps_channel : 4;
bdrkreg_t ps_command : 40;
bdrkreg_t ps_reserved : 3;
bdrkreg_t ps_interrupt : 1;
} md_perf_sel0_fld_s;
} md_perf_sel0_u_t;
#else
typedef union md_perf_sel0_u {
bdrkreg_t md_perf_sel0_regval;
struct {
bdrkreg_t ps_interrupt : 1;
bdrkreg_t ps_reserved : 3;
bdrkreg_t ps_command : 40;
bdrkreg_t ps_channel : 4;
bdrkreg_t ps_reserved_1 : 1;
bdrkreg_t ps_source : 7;
bdrkreg_t ps_activity : 4;
bdrkreg_t ps_reserved_2 : 2;
bdrkreg_t ps_cnt_mode : 2;
} md_perf_sel0_fld_s;
} md_perf_sel0_u_t;
#endif
#ifdef LITTLE_ENDIAN
typedef union md_perf_sel1_u {
bdrkreg_t md_perf_sel1_regval;
struct {
bdrkreg_t ps_cnt_mode : 2;
bdrkreg_t ps_reserved_2 : 2;
bdrkreg_t ps_activity : 4;
bdrkreg_t ps_source : 7;
bdrkreg_t ps_reserved_1 : 1;
bdrkreg_t ps_channel : 4;
bdrkreg_t ps_command : 40;
bdrkreg_t ps_reserved : 3;
bdrkreg_t ps_interrupt : 1;
} md_perf_sel1_fld_s;
} md_perf_sel1_u_t;
#else
typedef union md_perf_sel1_u {
bdrkreg_t md_perf_sel1_regval;
struct {
bdrkreg_t ps_interrupt : 1;
bdrkreg_t ps_reserved : 3;
bdrkreg_t ps_command : 40;
bdrkreg_t ps_channel : 4;
bdrkreg_t ps_reserved_1 : 1;
bdrkreg_t ps_source : 7;
bdrkreg_t ps_activity : 4;
bdrkreg_t ps_reserved_2 : 2;
bdrkreg_t ps_cnt_mode : 2;
} md_perf_sel1_fld_s;
} md_perf_sel1_u_t;
#endif
/************************************************************************
* *
* Performance counter. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_perf_cnt0_u {
bdrkreg_t md_perf_cnt0_regval;
struct {
bdrkreg_t pc_perf_cnt : 41;
bdrkreg_t pc_reserved : 23;
} md_perf_cnt0_fld_s;
} md_perf_cnt0_u_t;
#else
typedef union md_perf_cnt0_u {
bdrkreg_t md_perf_cnt0_regval;
struct {
bdrkreg_t pc_reserved : 23;
bdrkreg_t pc_perf_cnt : 41;
} md_perf_cnt0_fld_s;
} md_perf_cnt0_u_t;
#endif
/************************************************************************
* *
* Performance counter. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_perf_cnt1_u {
bdrkreg_t md_perf_cnt1_regval;
struct {
bdrkreg_t pc_perf_cnt : 41;
bdrkreg_t pc_reserved : 23;
} md_perf_cnt1_fld_s;
} md_perf_cnt1_u_t;
#else
typedef union md_perf_cnt1_u {
bdrkreg_t md_perf_cnt1_regval;
struct {
bdrkreg_t pc_reserved : 23;
bdrkreg_t pc_perf_cnt : 41;
} md_perf_cnt1_fld_s;
} md_perf_cnt1_u_t;
#endif
/************************************************************************
* *
* Description: This register contains the control for *
* memory/directory refresh. Once the MEMORY_CONFIG register contains *
* the correct DIMM information, the hardware takes care of *
* refreshing all the banks in the system. Therefore, the value in *
* the counter threshold is corresponds exactly to the refresh value *
* required by the SDRAM parts (expressed in Bedrock clock cycles). *
* The refresh will execute whenever there is a free cycle and there *
* are still banks that have not been refreshed in the current *
* window. If the window expires with banks still waiting to be *
* refreshed, all other transactions are halted until the banks are *
* refreshed. *
* The upper order bit contains an enable, which may be needed for *
* correct initialization of the DIMMs (according to the specs, the *
* first operation to the DIMMs should be a mode register write, not *
* a refresh, so this bit is cleared on reset) and is also useful for *
* diagnostic purposes. *
* For the SDRAM parts used by Bedrock, 4096 refreshes need to be *
* issued during every 64 ms window, resulting in a refresh threshold *
* of 3125 Bedrock cycles. *
* The ENABLE and CNT_THRESH fields of this register are preserved *
* through soft-resets. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_refresh_control_u {
bdrkreg_t md_refresh_control_regval;
struct {
bdrkreg_t rc_cnt_thresh : 12;
bdrkreg_t rc_counter : 12;
bdrkreg_t rc_reserved : 39;
bdrkreg_t rc_enable : 1;
} md_refresh_control_fld_s;
} md_refresh_control_u_t;
#else
typedef union md_refresh_control_u {
bdrkreg_t md_refresh_control_regval;
struct {
bdrkreg_t rc_enable : 1;
bdrkreg_t rc_reserved : 39;
bdrkreg_t rc_counter : 12;
bdrkreg_t rc_cnt_thresh : 12;
} md_refresh_control_fld_s;
} md_refresh_control_u_t;
#endif
/************************************************************************
* *
* This register controls the read and write timing for Flash PROM, *
* UART and Synergy junk bus devices. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_junk_bus_timing_u {
bdrkreg_t md_junk_bus_timing_regval;
struct {
bdrkreg_t jbt_fprom_setup_hold : 8;
bdrkreg_t jbt_fprom_enable : 8;
bdrkreg_t jbt_uart_setup_hold : 8;
bdrkreg_t jbt_uart_enable : 8;
bdrkreg_t jbt_synergy_setup_hold : 8;
bdrkreg_t jbt_synergy_enable : 8;
bdrkreg_t jbt_reserved : 16;
} md_junk_bus_timing_fld_s;
} md_junk_bus_timing_u_t;
#else
typedef union md_junk_bus_timing_u {
bdrkreg_t md_junk_bus_timing_regval;
struct {
bdrkreg_t jbt_reserved : 16;
bdrkreg_t jbt_synergy_enable : 8;
bdrkreg_t jbt_synergy_setup_hold : 8;
bdrkreg_t jbt_uart_enable : 8;
bdrkreg_t jbt_uart_setup_hold : 8;
bdrkreg_t jbt_fprom_enable : 8;
bdrkreg_t jbt_fprom_setup_hold : 8;
} md_junk_bus_timing_fld_s;
} md_junk_bus_timing_u_t;
#endif
/************************************************************************
* *
* Each of these addresses allows the value on one 8-bit bank of *
* LEDs to be read. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_led0_u {
bdrkreg_t md_led0_regval;
struct {
bdrkreg_t l_data : 8;
bdrkreg_t l_reserved : 56;
} md_led0_fld_s;
} md_led0_u_t;
#else
typedef union md_led0_u {
bdrkreg_t md_led0_regval;
struct {
bdrkreg_t l_reserved : 56;
bdrkreg_t l_data : 8;
} md_led0_fld_s;
} md_led0_u_t;
#endif
/************************************************************************
* *
* Each of these addresses allows the value on one 8-bit bank of *
* LEDs to be read. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_led1_u {
bdrkreg_t md_led1_regval;
struct {
bdrkreg_t l_data : 8;
bdrkreg_t l_reserved : 56;
} md_led1_fld_s;
} md_led1_u_t;
#else
typedef union md_led1_u {
bdrkreg_t md_led1_regval;
struct {
bdrkreg_t l_reserved : 56;
bdrkreg_t l_data : 8;
} md_led1_fld_s;
} md_led1_u_t;
#endif
/************************************************************************
* *
* Each of these addresses allows the value on one 8-bit bank of *
* LEDs to be read. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_led2_u {
bdrkreg_t md_led2_regval;
struct {
bdrkreg_t l_data : 8;
bdrkreg_t l_reserved : 56;
} md_led2_fld_s;
} md_led2_u_t;
#else
typedef union md_led2_u {
bdrkreg_t md_led2_regval;
struct {
bdrkreg_t l_reserved : 56;
bdrkreg_t l_data : 8;
} md_led2_fld_s;
} md_led2_u_t;
#endif
/************************************************************************
* *
* Each of these addresses allows the value on one 8-bit bank of *
* LEDs to be read. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_led3_u {
bdrkreg_t md_led3_regval;
struct {
bdrkreg_t l_data : 8;
bdrkreg_t l_reserved : 56;
} md_led3_fld_s;
} md_led3_u_t;
#else
typedef union md_led3_u {
bdrkreg_t md_led3_regval;
struct {
bdrkreg_t l_reserved : 56;
bdrkreg_t l_data : 8;
} md_led3_fld_s;
} md_led3_u_t;
#endif
/************************************************************************
* *
* Core control for the BIST function. Start and stop BIST at any *
* time. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_ctl_u {
bdrkreg_t md_bist_ctl_regval;
struct {
bdrkreg_t bc_bist_start : 1;
bdrkreg_t bc_bist_stop : 1;
bdrkreg_t bc_bist_reset : 1;
bdrkreg_t bc_reserved_1 : 1;
bdrkreg_t bc_bank_num : 1;
bdrkreg_t bc_dimm_num : 2;
bdrkreg_t bc_reserved : 57;
} md_bist_ctl_fld_s;
} md_bist_ctl_u_t;
#else
typedef union md_bist_ctl_u {
bdrkreg_t md_bist_ctl_regval;
struct {
bdrkreg_t bc_reserved : 57;
bdrkreg_t bc_dimm_num : 2;
bdrkreg_t bc_bank_num : 1;
bdrkreg_t bc_reserved_1 : 1;
bdrkreg_t bc_bist_reset : 1;
bdrkreg_t bc_bist_stop : 1;
bdrkreg_t bc_bist_start : 1;
} md_bist_ctl_fld_s;
} md_bist_ctl_u_t;
#endif
/************************************************************************
* *
* Contain the initial BIST data nibble and the 4-bit data control *
* field.. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_data_u {
bdrkreg_t md_bist_data_regval;
struct {
bdrkreg_t bd_bist_data : 4;
bdrkreg_t bd_bist_nibble : 1;
bdrkreg_t bd_bist_byte : 1;
bdrkreg_t bd_bist_cycle : 1;
bdrkreg_t bd_bist_write : 1;
bdrkreg_t bd_reserved : 56;
} md_bist_data_fld_s;
} md_bist_data_u_t;
#else
typedef union md_bist_data_u {
bdrkreg_t md_bist_data_regval;
struct {
bdrkreg_t bd_reserved : 56;
bdrkreg_t bd_bist_write : 1;
bdrkreg_t bd_bist_cycle : 1;
bdrkreg_t bd_bist_byte : 1;
bdrkreg_t bd_bist_nibble : 1;
bdrkreg_t bd_bist_data : 4;
} md_bist_data_fld_s;
} md_bist_data_u_t;
#endif
/************************************************************************
* *
* Captures the BIST error address and indicates whether it is an MB *
* error or DB error. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_ab_err_addr_u {
bdrkreg_t md_bist_ab_err_addr_regval;
struct {
bdrkreg_t baea_be_db_cas_addr : 15;
bdrkreg_t baea_reserved_3 : 1;
bdrkreg_t baea_be_mb_cas_addr : 15;
bdrkreg_t baea_reserved_2 : 1;
bdrkreg_t baea_be_ras_addr : 15;
bdrkreg_t baea_reserved_1 : 1;
bdrkreg_t baea_bist_mb_error : 1;
bdrkreg_t baea_bist_db_error : 1;
bdrkreg_t baea_reserved : 14;
} md_bist_ab_err_addr_fld_s;
} md_bist_ab_err_addr_u_t;
#else
typedef union md_bist_ab_err_addr_u {
bdrkreg_t md_bist_ab_err_addr_regval;
struct {
bdrkreg_t baea_reserved : 14;
bdrkreg_t baea_bist_db_error : 1;
bdrkreg_t baea_bist_mb_error : 1;
bdrkreg_t baea_reserved_1 : 1;
bdrkreg_t baea_be_ras_addr : 15;
bdrkreg_t baea_reserved_2 : 1;
bdrkreg_t baea_be_mb_cas_addr : 15;
bdrkreg_t baea_reserved_3 : 1;
bdrkreg_t baea_be_db_cas_addr : 15;
} md_bist_ab_err_addr_fld_s;
} md_bist_ab_err_addr_u_t;
#endif
/************************************************************************
* *
* Contains information on BIST progress and memory bank currently *
* under BIST. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_status_u {
bdrkreg_t md_bist_status_regval;
struct {
bdrkreg_t bs_bist_passed : 1;
bdrkreg_t bs_bist_done : 1;
bdrkreg_t bs_reserved : 62;
} md_bist_status_fld_s;
} md_bist_status_u_t;
#else
typedef union md_bist_status_u {
bdrkreg_t md_bist_status_regval;
struct {
bdrkreg_t bs_reserved : 62;
bdrkreg_t bs_bist_done : 1;
bdrkreg_t bs_bist_passed : 1;
} md_bist_status_fld_s;
} md_bist_status_u_t;
#endif
/************************************************************************
* *
* Contains 3 bits that allow the selection of IB debug information *
* at the debug port (see design specification for available debug *
* information). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_ib_debug_u {
bdrkreg_t md_ib_debug_regval;
struct {
bdrkreg_t id_ib_debug_sel : 2;
bdrkreg_t id_reserved : 62;
} md_ib_debug_fld_s;
} md_ib_debug_u_t;
#else
typedef union md_ib_debug_u {
bdrkreg_t md_ib_debug_regval;
struct {
bdrkreg_t id_reserved : 62;
bdrkreg_t id_ib_debug_sel : 2;
} md_ib_debug_fld_s;
} md_ib_debug_u_t;
#endif
/************************************************************************
* *
* Contains the directory specific mode bits. The contents of this *
* register are preserved through soft-resets. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_dir_config_u {
bdrkreg_t md_dir_config_regval;
struct {
bdrkreg_t dc_dir_flavor : 1;
bdrkreg_t dc_ignore_dir_ecc : 1;
bdrkreg_t dc_reserved : 62;
} md_dir_config_fld_s;
} md_dir_config_u_t;
#else
typedef union md_dir_config_u {
bdrkreg_t md_dir_config_regval;
struct {
bdrkreg_t dc_reserved : 62;
bdrkreg_t dc_ignore_dir_ecc : 1;
bdrkreg_t dc_dir_flavor : 1;
} md_dir_config_fld_s;
} md_dir_config_u_t;
#endif
/************************************************************************
* *
* Description: Contains information on uncorrectable and *
* correctable directory ECC errors, along with protection ECC *
* errors. The priority of ECC errors latched is: uncorrectable *
* directory, protection error, correctable directory. Thus the valid *
* bits signal: *
* 1xxx: uncorrectable directory ECC error (UCE) *
* 01xx: access protection double bit error (AE) *
* 001x: correctable directory ECC error (CE) *
* 0001: access protection correctable error (ACE) *
* If the UCE valid bit is set, the address field contains a pointer *
* to the Hspec address of the offending directory entry, the *
* syndrome field contains the bad syndrome, and the UCE overrun bit *
* indicates whether multiple double-bit errors were received. *
* If the UCE valid bit is clear but the AE valid bit is set, the *
* address field contains a pointer to the Hspec address of the *
* offending protection entry, the Bad Protection field contains the *
* 4-bit bad protection value, the PROT_INDEX field shows which of *
* the 8 protection values in the word was bad and the AE overrun bit *
* indicates whether multiple AE errors were received. *
* If the UCE and AE valid bits are clear, but the CE valid bit is *
* set, the address field contains a pointer to the Hspec address of *
* the offending directory entry, the syndrome field contains the bad *
* syndrome, and the CE overrun bit indicates whether multiple *
* single-bit errors were received. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_dir_error_u {
bdrkreg_t md_dir_error_regval;
struct {
bdrkreg_t de_reserved_3 : 3;
bdrkreg_t de_hspec_addr : 30;
bdrkreg_t de_reserved_2 : 7;
bdrkreg_t de_bad_syn : 7;
bdrkreg_t de_reserved_1 : 1;
bdrkreg_t de_bad_protect : 4;
bdrkreg_t de_prot_index : 3;
bdrkreg_t de_reserved : 1;
bdrkreg_t de_ace_overrun : 1;
bdrkreg_t de_ce_overrun : 1;
bdrkreg_t de_ae_overrun : 1;
bdrkreg_t de_uce_overrun : 1;
bdrkreg_t de_ace_valid : 1;
bdrkreg_t de_ce_valid : 1;
bdrkreg_t de_ae_valid : 1;
bdrkreg_t de_uce_valid : 1;
} md_dir_error_fld_s;
} md_dir_error_u_t;
#else
typedef union md_dir_error_u {
bdrkreg_t md_dir_error_regval;
struct {
bdrkreg_t de_uce_valid : 1;
bdrkreg_t de_ae_valid : 1;
bdrkreg_t de_ce_valid : 1;
bdrkreg_t de_ace_valid : 1;
bdrkreg_t de_uce_overrun : 1;
bdrkreg_t de_ae_overrun : 1;
bdrkreg_t de_ce_overrun : 1;
bdrkreg_t de_ace_overrun : 1;
bdrkreg_t de_reserved : 1;
bdrkreg_t de_prot_index : 3;
bdrkreg_t de_bad_protect : 4;
bdrkreg_t de_reserved_1 : 1;
bdrkreg_t de_bad_syn : 7;
bdrkreg_t de_reserved_2 : 7;
bdrkreg_t de_hspec_addr : 30;
bdrkreg_t de_reserved_3 : 3;
} md_dir_error_fld_s;
} md_dir_error_u_t;
#endif
/************************************************************************
* *
* Description: Contains information on uncorrectable and *
* correctable directory ECC errors, along with protection ECC *
* errors. The priority of ECC errors latched is: uncorrectable *
* directory, protection error, correctable directory. Thus the valid *
* bits signal: *
* 1xxx: uncorrectable directory ECC error (UCE) *
* 01xx: access protection double bit error (AE) *
* 001x: correctable directory ECC error (CE) *
* 0001: access protection correctable error (ACE) *
* If the UCE valid bit is set, the address field contains a pointer *
* to the Hspec address of the offending directory entry, the *
* syndrome field contains the bad syndrome, and the UCE overrun bit *
* indicates whether multiple double-bit errors were received. *
* If the UCE valid bit is clear but the AE valid bit is set, the *
* address field contains a pointer to the Hspec address of the *
* offending protection entry, the Bad Protection field contains the *
* 4-bit bad protection value, the PROT_INDEX field shows which of *
* the 8 protection values in the word was bad and the AE overrun bit *
* indicates whether multiple AE errors were received. *
* If the UCE and AE valid bits are clear, but the CE valid bit is *
* set, the address field contains a pointer to the Hspec address of *
* the offending directory entry, the syndrome field contains the bad *
* syndrome, and the CE overrun bit indicates whether multiple *
* single-bit errors were received. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_dir_error_clr_u {
bdrkreg_t md_dir_error_clr_regval;
struct {
bdrkreg_t dec_reserved_3 : 3;
bdrkreg_t dec_hspec_addr : 30;
bdrkreg_t dec_reserved_2 : 7;
bdrkreg_t dec_bad_syn : 7;
bdrkreg_t dec_reserved_1 : 1;
bdrkreg_t dec_bad_protect : 4;
bdrkreg_t dec_prot_index : 3;
bdrkreg_t dec_reserved : 1;
bdrkreg_t dec_ace_overrun : 1;
bdrkreg_t dec_ce_overrun : 1;
bdrkreg_t dec_ae_overrun : 1;
bdrkreg_t dec_uce_overrun : 1;
bdrkreg_t dec_ace_valid : 1;
bdrkreg_t dec_ce_valid : 1;
bdrkreg_t dec_ae_valid : 1;
bdrkreg_t dec_uce_valid : 1;
} md_dir_error_clr_fld_s;
} md_dir_error_clr_u_t;
#else
typedef union md_dir_error_clr_u {
bdrkreg_t md_dir_error_clr_regval;
struct {
bdrkreg_t dec_uce_valid : 1;
bdrkreg_t dec_ae_valid : 1;
bdrkreg_t dec_ce_valid : 1;
bdrkreg_t dec_ace_valid : 1;
bdrkreg_t dec_uce_overrun : 1;
bdrkreg_t dec_ae_overrun : 1;
bdrkreg_t dec_ce_overrun : 1;
bdrkreg_t dec_ace_overrun : 1;
bdrkreg_t dec_reserved : 1;
bdrkreg_t dec_prot_index : 3;
bdrkreg_t dec_bad_protect : 4;
bdrkreg_t dec_reserved_1 : 1;
bdrkreg_t dec_bad_syn : 7;
bdrkreg_t dec_reserved_2 : 7;
bdrkreg_t dec_hspec_addr : 30;
bdrkreg_t dec_reserved_3 : 3;
} md_dir_error_clr_fld_s;
} md_dir_error_clr_u_t;
#endif
/************************************************************************
* *
* Contains information on requests that encounter no valid protocol *
* table entry. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_protocol_error_u {
bdrkreg_t md_protocol_error_regval;
struct {
bdrkreg_t pe_overrun : 1;
bdrkreg_t pe_pointer_me : 1;
bdrkreg_t pe_reserved_1 : 1;
bdrkreg_t pe_address : 30;
bdrkreg_t pe_reserved : 1;
bdrkreg_t pe_ptr1_btmbits : 3;
bdrkreg_t pe_dir_format : 2;
bdrkreg_t pe_dir_state : 3;
bdrkreg_t pe_priority : 1;
bdrkreg_t pe_access : 1;
bdrkreg_t pe_msg_type : 8;
bdrkreg_t pe_initiator : 11;
bdrkreg_t pe_valid : 1;
} md_protocol_error_fld_s;
} md_protocol_error_u_t;
#else
typedef union md_protocol_error_u {
bdrkreg_t md_protocol_error_regval;
struct {
bdrkreg_t pe_valid : 1;
bdrkreg_t pe_initiator : 11;
bdrkreg_t pe_msg_type : 8;
bdrkreg_t pe_access : 1;
bdrkreg_t pe_priority : 1;
bdrkreg_t pe_dir_state : 3;
bdrkreg_t pe_dir_format : 2;
bdrkreg_t pe_ptr1_btmbits : 3;
bdrkreg_t pe_reserved : 1;
bdrkreg_t pe_address : 30;
bdrkreg_t pe_reserved_1 : 1;
bdrkreg_t pe_pointer_me : 1;
bdrkreg_t pe_overrun : 1;
} md_protocol_error_fld_s;
} md_protocol_error_u_t;
#endif
/************************************************************************
* *
* Contains information on requests that encounter no valid protocol *
* table entry. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_protocol_err_clr_u {
bdrkreg_t md_protocol_err_clr_regval;
struct {
bdrkreg_t pec_overrun : 1;
bdrkreg_t pec_pointer_me : 1;
bdrkreg_t pec_reserved_1 : 1;
bdrkreg_t pec_address : 30;
bdrkreg_t pec_reserved : 1;
bdrkreg_t pec_ptr1_btmbits : 3;
bdrkreg_t pec_dir_format : 2;
bdrkreg_t pec_dir_state : 3;
bdrkreg_t pec_priority : 1;
bdrkreg_t pec_access : 1;
bdrkreg_t pec_msg_type : 8;
bdrkreg_t pec_initiator : 11;
bdrkreg_t pec_valid : 1;
} md_protocol_err_clr_fld_s;
} md_protocol_err_clr_u_t;
#else
typedef union md_protocol_err_clr_u {
bdrkreg_t md_protocol_err_clr_regval;
struct {
bdrkreg_t pec_valid : 1;
bdrkreg_t pec_initiator : 11;
bdrkreg_t pec_msg_type : 8;
bdrkreg_t pec_access : 1;
bdrkreg_t pec_priority : 1;
bdrkreg_t pec_dir_state : 3;
bdrkreg_t pec_dir_format : 2;
bdrkreg_t pec_ptr1_btmbits : 3;
bdrkreg_t pec_reserved : 1;
bdrkreg_t pec_address : 30;
bdrkreg_t pec_reserved_1 : 1;
bdrkreg_t pec_pointer_me : 1;
bdrkreg_t pec_overrun : 1;
} md_protocol_err_clr_fld_s;
} md_protocol_err_clr_u_t;
#endif
/************************************************************************
* *
* Contains the address of the page and the requestor which caused a *
* migration threshold to be exceeded. Also contains the type of *
* threshold exceeded and an overrun bit. For Value mode type *
* interrupts, it indicates whether the local or the remote counter *
* triggered the interrupt. Unlike most registers, when the overrun *
* bit is set the register contains information on the most recent *
* (the last) migration candidate. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mig_candidate_u {
bdrkreg_t md_mig_candidate_regval;
struct {
bdrkreg_t mc_address : 21;
bdrkreg_t mc_initiator : 11;
bdrkreg_t mc_overrun : 1;
bdrkreg_t mc_type : 1;
bdrkreg_t mc_local : 1;
bdrkreg_t mc_reserved : 28;
bdrkreg_t mc_valid : 1;
} md_mig_candidate_fld_s;
} md_mig_candidate_u_t;
#else
typedef union md_mig_candidate_u {
bdrkreg_t md_mig_candidate_regval;
struct {
bdrkreg_t mc_valid : 1;
bdrkreg_t mc_reserved : 28;
bdrkreg_t mc_local : 1;
bdrkreg_t mc_type : 1;
bdrkreg_t mc_overrun : 1;
bdrkreg_t mc_initiator : 11;
bdrkreg_t mc_address : 21;
} md_mig_candidate_fld_s;
} md_mig_candidate_u_t;
#endif
/************************************************************************
* *
* Contains the address of the page and the requestor which caused a *
* migration threshold to be exceeded. Also contains the type of *
* threshold exceeded and an overrun bit. For Value mode type *
* interrupts, it indicates whether the local or the remote counter *
* triggered the interrupt. Unlike most registers, when the overrun *
* bit is set the register contains information on the most recent *
* (the last) migration candidate. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mig_candidate_clr_u {
bdrkreg_t md_mig_candidate_clr_regval;
struct {
bdrkreg_t mcc_address : 21;
bdrkreg_t mcc_initiator : 11;
bdrkreg_t mcc_overrun : 1;
bdrkreg_t mcc_type : 1;
bdrkreg_t mcc_local : 1;
bdrkreg_t mcc_reserved : 28;
bdrkreg_t mcc_valid : 1;
} md_mig_candidate_clr_fld_s;
} md_mig_candidate_clr_u_t;
#else
typedef union md_mig_candidate_clr_u {
bdrkreg_t md_mig_candidate_clr_regval;
struct {
bdrkreg_t mcc_valid : 1;
bdrkreg_t mcc_reserved : 28;
bdrkreg_t mcc_local : 1;
bdrkreg_t mcc_type : 1;
bdrkreg_t mcc_overrun : 1;
bdrkreg_t mcc_initiator : 11;
bdrkreg_t mcc_address : 21;
} md_mig_candidate_clr_fld_s;
} md_mig_candidate_clr_u_t;
#endif
/************************************************************************
* *
* Controls the generation of page-migration interrupts and loading *
* of the MIGRATION_CANDIDATE register for pages which are using the *
* difference between the requestor and home counts. If the *
* difference is greater-than or equal to than the threshold *
* contained in the register, and the valid bit is set, the migration *
* candidate is loaded (and an interrupt generated if enabled by the *
* page migration mode). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mig_diff_thresh_u {
bdrkreg_t md_mig_diff_thresh_regval;
struct {
bdrkreg_t mdt_threshold : 15;
bdrkreg_t mdt_reserved_1 : 17;
bdrkreg_t mdt_th_action : 3;
bdrkreg_t mdt_sat_action : 3;
bdrkreg_t mdt_reserved : 25;
bdrkreg_t mdt_valid : 1;
} md_mig_diff_thresh_fld_s;
} md_mig_diff_thresh_u_t;
#else
typedef union md_mig_diff_thresh_u {
bdrkreg_t md_mig_diff_thresh_regval;
struct {
bdrkreg_t mdt_valid : 1;
bdrkreg_t mdt_reserved : 25;
bdrkreg_t mdt_sat_action : 3;
bdrkreg_t mdt_th_action : 3;
bdrkreg_t mdt_reserved_1 : 17;
bdrkreg_t mdt_threshold : 15;
} md_mig_diff_thresh_fld_s;
} md_mig_diff_thresh_u_t;
#endif
/************************************************************************
* *
* Controls the generation of page-migration interrupts and loading *
* of the MIGRATION_CANDIDATE register for pages that are using the *
* absolute value of the requestor count. If the value is *
* greater-than or equal to the threshold contained in the register, *
* and the register valid bit is set, the migration candidate is *
* loaded and an interrupt generated. For the value mode of page *
* migration, there are two variations. In the first variation, *
* interrupts are only generated when the remote counter reaches the *
* threshold, not when the local counter reaches the threshold. In *
* the second mode, both the local counter and the remote counter *
* generate interrupts if they reach the threshold. This second mode *
* is useful for performance monitoring, to track the number of local *
* and remote references to a page. LOCAL_INT determines whether we *
* will generate interrupts when the local counter reaches the *
* threshold. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mig_value_thresh_u {
bdrkreg_t md_mig_value_thresh_regval;
struct {
bdrkreg_t mvt_threshold : 15;
bdrkreg_t mvt_reserved_1 : 17;
bdrkreg_t mvt_th_action : 3;
bdrkreg_t mvt_sat_action : 3;
bdrkreg_t mvt_reserved : 24;
bdrkreg_t mvt_local_int : 1;
bdrkreg_t mvt_valid : 1;
} md_mig_value_thresh_fld_s;
} md_mig_value_thresh_u_t;
#else
typedef union md_mig_value_thresh_u {
bdrkreg_t md_mig_value_thresh_regval;
struct {
bdrkreg_t mvt_valid : 1;
bdrkreg_t mvt_local_int : 1;
bdrkreg_t mvt_reserved : 24;
bdrkreg_t mvt_sat_action : 3;
bdrkreg_t mvt_th_action : 3;
bdrkreg_t mvt_reserved_1 : 17;
bdrkreg_t mvt_threshold : 15;
} md_mig_value_thresh_fld_s;
} md_mig_value_thresh_u_t;
#endif
/************************************************************************
* *
* Contains the controls for the sizing of the three MOQH request *
* queues. The maximum (and default) value is 4. Queue sizes are in *
* flits. One header equals one flit. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_outgoing_rq_queue_size_u {
bdrkreg_t md_outgoing_rq_queue_size_regval;
struct {
bdrkreg_t orqs_reserved_3 : 8;
bdrkreg_t orqs_moqh_p0_rq_size : 3;
bdrkreg_t orqs_reserved_2 : 5;
bdrkreg_t orqs_moqh_p1_rq_size : 3;
bdrkreg_t orqs_reserved_1 : 5;
bdrkreg_t orqs_moqh_np_rq_size : 3;
bdrkreg_t orqs_reserved : 37;
} md_outgoing_rq_queue_size_fld_s;
} md_outgoing_rq_queue_size_u_t;
#else
typedef union md_outgoing_rq_queue_size_u {
bdrkreg_t md_outgoing_rq_queue_size_regval;
struct {
bdrkreg_t orqs_reserved : 37;
bdrkreg_t orqs_moqh_np_rq_size : 3;
bdrkreg_t orqs_reserved_1 : 5;
bdrkreg_t orqs_moqh_p1_rq_size : 3;
bdrkreg_t orqs_reserved_2 : 5;
bdrkreg_t orqs_moqh_p0_rq_size : 3;
bdrkreg_t orqs_reserved_3 : 8;
} md_outgoing_rq_queue_size_fld_s;
} md_outgoing_rq_queue_size_u_t;
#endif
/************************************************************************
* *
* Contains the 32-bit directory word failing BIST. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_db_err_data_u {
bdrkreg_t md_bist_db_err_data_regval;
struct {
bdrkreg_t bded_db_er_d : 32;
bdrkreg_t bded_reserved : 32;
} md_bist_db_err_data_fld_s;
} md_bist_db_err_data_u_t;
#else
typedef union md_bist_db_err_data_u {
bdrkreg_t md_bist_db_err_data_regval;
struct {
bdrkreg_t bded_reserved : 32;
bdrkreg_t bded_db_er_d : 32;
} md_bist_db_err_data_fld_s;
} md_bist_db_err_data_u_t;
#endif
/************************************************************************
* *
* Contains 2 bits that allow the selection of DB debug information *
* at the debug port (see the design specification for descrition of *
* the available debug information). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_db_debug_u {
bdrkreg_t md_db_debug_regval;
struct {
bdrkreg_t dd_db_debug_sel : 2;
bdrkreg_t dd_reserved : 62;
} md_db_debug_fld_s;
} md_db_debug_u_t;
#else
typedef union md_db_debug_u {
bdrkreg_t md_db_debug_regval;
struct {
bdrkreg_t dd_reserved : 62;
bdrkreg_t dd_db_debug_sel : 2;
} md_db_debug_fld_s;
} md_db_debug_u_t;
#endif
/************************************************************************
* *
* Contains the IgnoreECC bit. When this bit is set, all ECC errors *
* are ignored. ECC bits will still be generated on writebacks. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mb_ecc_config_u {
bdrkreg_t md_mb_ecc_config_regval;
struct {
bdrkreg_t mec_ignore_dataecc : 1;
bdrkreg_t mec_reserved : 63;
} md_mb_ecc_config_fld_s;
} md_mb_ecc_config_u_t;
#else
typedef union md_mb_ecc_config_u {
bdrkreg_t md_mb_ecc_config_regval;
struct {
bdrkreg_t mec_reserved : 63;
bdrkreg_t mec_ignore_dataecc : 1;
} md_mb_ecc_config_fld_s;
} md_mb_ecc_config_u_t;
#endif
/************************************************************************
* *
* Description: Contains information on read memory errors (both *
* correctable and uncorrectable) and write memory errors (always *
* uncorrectable). The errors are prioritized as follows: *
* highest: uncorrectable read error (READ_UCE) *
* middle: write error (WRITE_UCE) *
* lowest: correctable read error (READ_CE) *
* Each type of error maintains a two-bit valid/overrun field *
* (READ_UCE, WRITE_UCE, or READ_CE). Bit 0 of each two-bit field *
* corresponds to the valid bit, and bit 1 of each two-bit field *
* corresponds to the overrun bit. *
* The rule for the valid bit is that it gets set whenever that error *
* occurs, regardless of whether a higher priority error has occurred. *
* The rule for the overrun bit is that it gets set whenever we are *
* unable to record the address information for this particular *
* error, due to a previous error of the same or higher priority. *
* Note that the syndrome and address information always corresponds *
* to the earliest, highest priority error. *
* Finally, the UCE_DIFF_ADDR bit is set whenever there have been *
* several uncorrectable errors, to different cache line addresses. *
* If all the UCEs were to the same cache line address, then *
* UCE_DIFF_ADDR will be 0. This allows the operating system to *
* detect the case where a UCE error is read exclusively, and then *
* written back by the processor. If the bit is 0, it indicates that *
* no information has been lost about UCEs on other cache lines. In *
* particular, partial writes do a read modify write of the cache *
* line. A UCE read error will be set when the cache line is read, *
* and a UCE write error will occur when the cache line is written *
* back, but the UCE_DIFF_ADDR will not be set. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mem_error_u {
bdrkreg_t md_mem_error_regval;
struct {
bdrkreg_t me_reserved_5 : 3;
bdrkreg_t me_address : 30;
bdrkreg_t me_reserved_4 : 7;
bdrkreg_t me_bad_syn : 8;
bdrkreg_t me_reserved_3 : 4;
bdrkreg_t me_read_ce : 2;
bdrkreg_t me_reserved_2 : 2;
bdrkreg_t me_write_uce : 2;
bdrkreg_t me_reserved_1 : 2;
bdrkreg_t me_read_uce : 2;
bdrkreg_t me_reserved : 1;
bdrkreg_t me_uce_diff_addr : 1;
} md_mem_error_fld_s;
} md_mem_error_u_t;
#else
typedef union md_mem_error_u {
bdrkreg_t md_mem_error_regval;
struct {
bdrkreg_t me_uce_diff_addr : 1;
bdrkreg_t me_reserved : 1;
bdrkreg_t me_read_uce : 2;
bdrkreg_t me_reserved_1 : 2;
bdrkreg_t me_write_uce : 2;
bdrkreg_t me_reserved_2 : 2;
bdrkreg_t me_read_ce : 2;
bdrkreg_t me_reserved_3 : 4;
bdrkreg_t me_bad_syn : 8;
bdrkreg_t me_reserved_4 : 7;
bdrkreg_t me_address : 30;
bdrkreg_t me_reserved_5 : 3;
} md_mem_error_fld_s;
} md_mem_error_u_t;
#endif
/************************************************************************
* *
* Description: Contains information on read memory errors (both *
* correctable and uncorrectable) and write memory errors (always *
* uncorrectable). The errors are prioritized as follows: *
* highest: uncorrectable read error (READ_UCE) *
* middle: write error (WRITE_UCE) *
* lowest: correctable read error (READ_CE) *
* Each type of error maintains a two-bit valid/overrun field *
* (READ_UCE, WRITE_UCE, or READ_CE). Bit 0 of each two-bit field *
* corresponds to the valid bit, and bit 1 of each two-bit field *
* corresponds to the overrun bit. *
* The rule for the valid bit is that it gets set whenever that error *
* occurs, regardless of whether a higher priority error has occurred. *
* The rule for the overrun bit is that it gets set whenever we are *
* unable to record the address information for this particular *
* error, due to a previous error of the same or higher priority. *
* Note that the syndrome and address information always corresponds *
* to the earliest, highest priority error. *
* Finally, the UCE_DIFF_ADDR bit is set whenever there have been *
* several uncorrectable errors, to different cache line addresses. *
* If all the UCEs were to the same cache line address, then *
* UCE_DIFF_ADDR will be 0. This allows the operating system to *
* detect the case where a UCE error is read exclusively, and then *
* written back by the processor. If the bit is 0, it indicates that *
* no information has been lost about UCEs on other cache lines. In *
* particular, partial writes do a read modify write of the cache *
* line. A UCE read error will be set when the cache line is read, *
* and a UCE write error will occur when the cache line is written *
* back, but the UCE_DIFF_ADDR will not be set. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mem_error_clr_u {
bdrkreg_t md_mem_error_clr_regval;
struct {
bdrkreg_t mec_reserved_5 : 3;
bdrkreg_t mec_address : 30;
bdrkreg_t mec_reserved_4 : 7;
bdrkreg_t mec_bad_syn : 8;
bdrkreg_t mec_reserved_3 : 4;
bdrkreg_t mec_read_ce : 2;
bdrkreg_t mec_reserved_2 : 2;
bdrkreg_t mec_write_uce : 2;
bdrkreg_t mec_reserved_1 : 2;
bdrkreg_t mec_read_uce : 2;
bdrkreg_t mec_reserved : 1;
bdrkreg_t mec_uce_diff_addr : 1;
} md_mem_error_clr_fld_s;
} md_mem_error_clr_u_t;
#else
typedef union md_mem_error_clr_u {
bdrkreg_t md_mem_error_clr_regval;
struct {
bdrkreg_t mec_uce_diff_addr : 1;
bdrkreg_t mec_reserved : 1;
bdrkreg_t mec_read_uce : 2;
bdrkreg_t mec_reserved_1 : 2;
bdrkreg_t mec_write_uce : 2;
bdrkreg_t mec_reserved_2 : 2;
bdrkreg_t mec_read_ce : 2;
bdrkreg_t mec_reserved_3 : 4;
bdrkreg_t mec_bad_syn : 8;
bdrkreg_t mec_reserved_4 : 7;
bdrkreg_t mec_address : 30;
bdrkreg_t mec_reserved_5 : 3;
} md_mem_error_clr_fld_s;
} md_mem_error_clr_u_t;
#endif
/************************************************************************
* *
* Contains one-quarter of the error memory line failing BIST. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_mb_err_data_0_u {
bdrkreg_t md_bist_mb_err_data_0_regval;
struct {
bdrkreg_t bmed0_mb_er_d : 36;
bdrkreg_t bmed0_reserved : 28;
} md_bist_mb_err_data_0_fld_s;
} md_bist_mb_err_data_0_u_t;
#else
typedef union md_bist_mb_err_data_0_u {
bdrkreg_t md_bist_mb_err_data_0_regval;
struct {
bdrkreg_t bmed0_reserved : 28;
bdrkreg_t bmed0_mb_er_d : 36;
} md_bist_mb_err_data_0_fld_s;
} md_bist_mb_err_data_0_u_t;
#endif
/************************************************************************
* *
* Contains one-quarter of the error memory line failing BIST. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_mb_err_data_1_u {
bdrkreg_t md_bist_mb_err_data_1_regval;
struct {
bdrkreg_t bmed1_mb_er_d : 36;
bdrkreg_t bmed1_reserved : 28;
} md_bist_mb_err_data_1_fld_s;
} md_bist_mb_err_data_1_u_t;
#else
typedef union md_bist_mb_err_data_1_u {
bdrkreg_t md_bist_mb_err_data_1_regval;
struct {
bdrkreg_t bmed1_reserved : 28;
bdrkreg_t bmed1_mb_er_d : 36;
} md_bist_mb_err_data_1_fld_s;
} md_bist_mb_err_data_1_u_t;
#endif
/************************************************************************
* *
* Contains one-quarter of the error memory line failing BIST. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_mb_err_data_2_u {
bdrkreg_t md_bist_mb_err_data_2_regval;
struct {
bdrkreg_t bmed2_mb_er_d : 36;
bdrkreg_t bmed2_reserved : 28;
} md_bist_mb_err_data_2_fld_s;
} md_bist_mb_err_data_2_u_t;
#else
typedef union md_bist_mb_err_data_2_u {
bdrkreg_t md_bist_mb_err_data_2_regval;
struct {
bdrkreg_t bmed2_reserved : 28;
bdrkreg_t bmed2_mb_er_d : 36;
} md_bist_mb_err_data_2_fld_s;
} md_bist_mb_err_data_2_u_t;
#endif
/************************************************************************
* *
* Contains one-quarter of the error memory line failing BIST. *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_bist_mb_err_data_3_u {
bdrkreg_t md_bist_mb_err_data_3_regval;
struct {
bdrkreg_t bmed3_mb_er_d : 36;
bdrkreg_t bmed3_reserved : 28;
} md_bist_mb_err_data_3_fld_s;
} md_bist_mb_err_data_3_u_t;
#else
typedef union md_bist_mb_err_data_3_u {
bdrkreg_t md_bist_mb_err_data_3_regval;
struct {
bdrkreg_t bmed3_reserved : 28;
bdrkreg_t bmed3_mb_er_d : 36;
} md_bist_mb_err_data_3_fld_s;
} md_bist_mb_err_data_3_u_t;
#endif
/************************************************************************
* *
* Contains 1 bit that allow the selection of MB debug information *
* at the debug port (see the design specification for the available *
* debug information). *
* *
************************************************************************/
#ifdef LITTLE_ENDIAN
typedef union md_mb_debug_u {
bdrkreg_t md_mb_debug_regval;
struct {
bdrkreg_t md_mb_debug_sel : 1;
bdrkreg_t md_reserved : 63;
} md_mb_debug_fld_s;
} md_mb_debug_u_t;
#else
typedef union md_mb_debug_u {
bdrkreg_t md_mb_debug_regval;
struct {
bdrkreg_t md_reserved : 63;
bdrkreg_t md_mb_debug_sel : 1;
} md_mb_debug_fld_s;
} md_mb_debug_u_t;
#endif
#endif /* __ASSEMBLY__ */
/************************************************************************
* *
* MAKE ALL ADDITIONS AFTER THIS LINE *
* *
************************************************************************/
#endif /* _ASM_IA64_SN_SN1_HUBMD_H */
| 34.824788 | 83 | 0.463941 |
d929dc342c9d910bc01d5392038289f51b15da66 | 2,512 | h | C | Modules/Learning/Markov/include/otbMRFEnergyGaussian.h | heralex/OTB | c52b504b64dc89c8fe9cac8af39b8067ca2c3a57 | [
"Apache-2.0"
] | 317 | 2015-01-19T08:40:58.000Z | 2022-03-17T11:55:48.000Z | Modules/Learning/Markov/include/otbMRFEnergyGaussian.h | guandd/OTB | 707ce4c6bb4c7186e3b102b2b00493a5050872cb | [
"Apache-2.0"
] | 18 | 2015-07-29T14:13:45.000Z | 2021-03-29T12:36:24.000Z | Modules/Learning/Markov/include/otbMRFEnergyGaussian.h | guandd/OTB | 707ce4c6bb4c7186e3b102b2b00493a5050872cb | [
"Apache-2.0"
] | 132 | 2015-02-21T23:57:25.000Z | 2022-03-25T16:03:16.000Z | /*
* Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbMRFEnergyGaussian_h
#define otbMRFEnergyGaussian_h
#include "otbMRFEnergy.h"
#include "otbMath.h"
namespace otb
{
/**
* \class MRFEnergyGaussian
* \brief This is the implementation of the Gaussian model for Markov classification.
*
* This is the implementation of the Gaussian model for Markov classification,
* to be used for data fidelity. Energy is:
*
* \f[ U(x_s, x_t) = (x_s-x_t)^2 \f]
*
* with
* - \f$ x_s \f$ the label on site s
* - \f$ y_s \f$ the value on the reference image
*
* This class is meant to be used in the MRF framework with the otb::MarkovRandomFieldFilter
*
* \ingroup Markov
*
* \ingroup OTBMarkov
*/
template <class TInput1, class TInput2>
class ITK_EXPORT MRFEnergyGaussian : public MRFEnergy<TInput1, TInput2>
{
public:
typedef MRFEnergyGaussian Self;
typedef MRFEnergy<TInput1, TInput2> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef TInput1 InputImageType;
typedef TInput2 LabelledImageType;
typedef typename InputImageType::PixelType InputImagePixelType;
typedef typename LabelledImageType::PixelType LabelledImagePixelType;
typedef itk::Array<double> ParametersType;
itkTypeMacro(MRFEnergyGaussian, MRFEnergy);
itkNewMacro(Self);
double GetSingleValue(const InputImagePixelType& value1, const LabelledImagePixelType& value2) override
{
return vnl_math_sqr((static_cast<double>(value1)) - (static_cast<double>(value2)));
}
protected:
// The constructor and destructor.
MRFEnergyGaussian()
{
this->m_NumberOfParameters = 0;
this->m_Parameters.SetSize(this->m_NumberOfParameters);
};
~MRFEnergyGaussian() override
{
}
};
}
#endif
| 27.911111 | 105 | 0.717755 |
d92a22191e2c62d37b0fea5981375d623b8c44e2 | 5,626 | h | C | Code/Includes/OMS Headers/OMSSerUPPs.h | Synclavier/Software | a237bf2a6698bf7bc6c8282227fc22b627e512cc | [
"MIT"
] | 5 | 2017-10-26T03:02:21.000Z | 2021-06-24T23:32:25.000Z | Code/Includes/OMS Headers/OMSSerUPPs.h | Synclavier/Software | a237bf2a6698bf7bc6c8282227fc22b627e512cc | [
"MIT"
] | null | null | null | Code/Includes/OMS Headers/OMSSerUPPs.h | Synclavier/Software | a237bf2a6698bf7bc6c8282227fc22b627e512cc | [
"MIT"
] | 2 | 2020-11-04T04:07:33.000Z | 2021-06-24T23:32:30.000Z | /*
*** THIS FILE GENERATED AUTOMATICALLY -- DO NOT MODIFY ***
Copyright (c) 1994-98 Opcode Systems, Inc.
*/
#if OMS_MAC_CFM
enum {
uppOMSSerDrvrProcInfo = kThinkCStackBased
| RESULT_SIZE(kFourByteCode) /* C long */
| STACK_ROUTINE_PARAMETER(1, kTwoByteCode) /* short msgNum */
| STACK_ROUTINE_PARAMETER(2, kFourByteCode) /* OMSSerialPort *port */
| STACK_ROUTINE_PARAMETER(3, kFourByteCode) /* long param */
};
typedef UniversalProcPtr OMSSerDrvrProcUPP;
#define NewOMSSerDrvrProc(userRoutine) \
(OMSSerDrvrProcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOMSSerDrvrProcInfo, GetCurrentArchitecture())
#define CallOMSSerDrvrProc(userRoutine, msgNum, port, param) \
(long)CallUniversalProc((UniversalProcPtr)(userRoutine), uppOMSSerDrvrProcInfo, (msgNum), (port), (param))
#else
typedef OMSSerDrvrProc OMSSerDrvrProcUPP;
#define NewOMSSerDrvrProc(userRoutine) \
(OMSSerDrvrProcUPP)(userRoutine)
#define CallOMSSerDrvrProc(userRoutine, msgNum, port, param) \
(*(userRoutine))((msgNum), (port), (param))
#endif
#if OMS_MAC_CFM
enum {
uppOMSVBLProcInfo = kThinkCStackBased
| RESULT_SIZE(0) /* C void */
| STACK_ROUTINE_PARAMETER(1, kFourByteCode) /* OMSSerialPort *port */
};
typedef UniversalProcPtr OMSVBLProcUPP;
#define NewOMSVBLProc(userRoutine) \
(OMSVBLProcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOMSVBLProcInfo, GetCurrentArchitecture())
#define CallOMSVBLProc(userRoutine, port) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppOMSVBLProcInfo, (port))
#else
typedef OMSVBLProc OMSVBLProcUPP;
#define NewOMSVBLProc(userRoutine) \
(OMSVBLProcUPP)(userRoutine)
#define CallOMSVBLProc(userRoutine, port) \
(*(userRoutine))((port))
#endif
#if OMS_MAC_CFM
enum {
uppOMSSerSendDataProcInfo = kThinkCStackBased
| RESULT_SIZE(0) /* C void */
| STACK_ROUTINE_PARAMETER(1, kFourByteCode) /* OMSSerialPort *port */
| STACK_ROUTINE_PARAMETER(2, kFourByteCode) /* unsigned char *data */
| STACK_ROUTINE_PARAMETER(3, kTwoByteCode) /* short len */
};
typedef UniversalProcPtr OMSSerSendDataProcUPP;
#define NewOMSSerSendDataProc(userRoutine) \
(OMSSerSendDataProcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOMSSerSendDataProcInfo, GetCurrentArchitecture())
#define CallOMSSerSendDataProc(userRoutine, port, data, len) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppOMSSerSendDataProcInfo, (port), (data), (len))
#else
typedef OMSSerSendDataProc OMSSerSendDataProcUPP;
#define NewOMSSerSendDataProc(userRoutine) \
(OMSSerSendDataProcUPP)(userRoutine)
#define CallOMSSerSendDataProc(userRoutine, port, data, len) \
(*(userRoutine))((port), (data), (len))
#endif
#if OMS_MAC_CFM
enum {
uppOMSSerRcvByteProcInfo = kThinkCStackBased
| RESULT_SIZE(0) /* C void */
| STACK_ROUTINE_PARAMETER(1, kFourByteCode) /* OMSSerialPort *port */
| STACK_ROUTINE_PARAMETER(2, kOneByteCode) /* unsigned char rcvByte */
};
typedef UniversalProcPtr OMSSerRcvByteProcUPP;
#define NewOMSSerRcvByteProc(userRoutine) \
(OMSSerRcvByteProcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOMSSerRcvByteProcInfo, GetCurrentArchitecture())
#define CallOMSSerRcvByteProc(userRoutine, port, rcvByte) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppOMSSerRcvByteProcInfo, (port), (rcvByte))
#else
typedef OMSSerRcvByteProc OMSSerRcvByteProcUPP;
#define NewOMSSerRcvByteProc(userRoutine) \
(OMSSerRcvByteProcUPP)(userRoutine)
#define CallOMSSerRcvByteProc(userRoutine, port, rcvByte) \
(*(userRoutine))((port), (rcvByte))
#endif
#if OMS_MAC_CFM
enum {
uppOMSSerSpecialRcvProcInfo = kThinkCStackBased
| RESULT_SIZE(0) /* C void */
| STACK_ROUTINE_PARAMETER(1, kFourByteCode) /* OMSSerialPort *port */
| STACK_ROUTINE_PARAMETER(2, kOneByteCode) /* OMSBool forceEnqueueing */
};
typedef UniversalProcPtr OMSSerSpecialRcvProcUPP;
#define NewOMSSerSpecialRcvProc(userRoutine) \
(OMSSerSpecialRcvProcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOMSSerSpecialRcvProcInfo, GetCurrentArchitecture())
#define CallOMSSerSpecialRcvProc(userRoutine, port, forceEnqueueing) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppOMSSerSpecialRcvProcInfo, (port), (forceEnqueueing))
#else
typedef OMSSerSpecialRcvProc OMSSerSpecialRcvProcUPP;
#define NewOMSSerSpecialRcvProc(userRoutine) \
(OMSSerSpecialRcvProcUPP)(userRoutine)
#define CallOMSSerSpecialRcvProc(userRoutine, port, forceEnqueueing) \
(*(userRoutine))((port), (forceEnqueueing))
#endif
#if OMS_MAC_CFM
enum {
uppOMSSerHandshakeProcInfo = kThinkCStackBased
| RESULT_SIZE(0) /* C void */
| STACK_ROUTINE_PARAMETER(1, kFourByteCode) /* OMSSerialPort *port */
| STACK_ROUTINE_PARAMETER(2, kTwoByteCode) /* short msg */
| STACK_ROUTINE_PARAMETER(3, kOneByteCode) /* unsigned char hsByte */
};
typedef UniversalProcPtr OMSSerHandshakeProcUPP;
#define NewOMSSerHandshakeProc(userRoutine) \
(OMSSerHandshakeProcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOMSSerHandshakeProcInfo, GetCurrentArchitecture())
#define CallOMSSerHandshakeProc(userRoutine, port, msg, hsByte) \
CallUniversalProc((UniversalProcPtr)(userRoutine), uppOMSSerHandshakeProcInfo, (port), (msg), (hsByte))
#else
typedef OMSSerHandshakeProc OMSSerHandshakeProcUPP;
#define NewOMSSerHandshakeProc(userRoutine) \
(OMSSerHandshakeProcUPP)(userRoutine)
#define CallOMSSerHandshakeProc(userRoutine, port, msg, hsByte) \
(*(userRoutine))((port), (msg), (hsByte))
#endif
| 5,626 | 5,626 | 0.758621 |
d92a658d10f2fc41f474302a1ba26d1061b6b631 | 6,556 | h | C | QCA4020_SDK/target/include/qapi/qapi_ble_errors.h | r8d8/lastlock | 78c02e5fbb129b1bc4147bd55eec2882267d7e87 | [
"Apache-2.0"
] | null | null | null | QCA4020_SDK/target/include/qapi/qapi_ble_errors.h | r8d8/lastlock | 78c02e5fbb129b1bc4147bd55eec2882267d7e87 | [
"Apache-2.0"
] | null | null | null | QCA4020_SDK/target/include/qapi/qapi_ble_errors.h | r8d8/lastlock | 78c02e5fbb129b1bc4147bd55eec2882267d7e87 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright (c) 2016-2018 Qualcomm Technologies, Inc.
* All Rights Reserved.
*/
// Copyright (c) 2018 Qualcomm Technologies, Inc.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below)
// provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// Neither the name of Qualcomm Technologies, Inc. nor the names of its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __QAPI_BLE_ERRORS_H__
#define __QAPI_BLE_ERRORS_H__
#define QAPI_BLE_BTPS_ERROR_INVALID_PARAMETER (-1)
#define QAPI_BLE_BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID (-2)
#define QAPI_BLE_BTPS_ERROR_STACK_INITIALIZATION_ERROR (-3)
#define QAPI_BLE_BTPS_ERROR_HCI_INITIALIZATION_ERROR (-4)
#define QAPI_BLE_BTPS_ERROR_GAP_INITIALIZATION_ERROR (-5)
#define QAPI_BLE_BTPS_ERROR_L2CAP_INITIALIZATION_ERROR (-7)
#define QAPI_BLE_BTPS_ERROR_DEBUG_CALLBACK_ALREADY_INSTALLED (-13)
#define QAPI_BLE_BTPS_ERROR_HCI_DRIVER_ERROR (-14)
#define QAPI_BLE_BTPS_ERROR_DEVICE_RESET_ERROR (-15)
#define QAPI_BLE_BTPS_ERROR_HCI_RESPONSE_ERROR (-16)
#define QAPI_BLE_BTPS_ERROR_HCI_TIMEOUT_ERROR (-17)
#define QAPI_BLE_BTPS_ERROR_UNSUPPORTED_HCI_VERSION (-18)
#define QAPI_BLE_BTPS_ERROR_UNKNOWN_HCI_BUFFER_SIZE (-20)
#define QAPI_BLE_BTPS_ERROR_UNABLE_TO_REGISTER_EVENT_CALLBACK (-21)
#define QAPI_BLE_BTPS_ERROR_UNABLE_TO_REGISTER_ACL_CALLBACK (-22)
#define QAPI_BLE_BTPS_ERROR_L2CAP_NOT_INITIALIZED (-26)
#define QAPI_BLE_BTPS_ERROR_ADDING_IDENTIFIER_INFORMATION (-35)
#define QAPI_BLE_BTPS_ERROR_INVALID_CONNECTION_STATE (-36)
#define QAPI_BLE_BTPS_ERROR_CHANNEL_NOT_IN_OPEN_STATE (-37)
#define QAPI_BLE_BTPS_ERROR_INVALID_CID (-38)
#define QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR (-40)
#define QAPI_BLE_BTPS_ERROR_NEGOTIATED_MTU_EXCEEDED (-41)
#define QAPI_BLE_BTPS_ERROR_GAP_NOT_INITIALIZED (-56)
#define QAPI_BLE_BTPS_ERROR_DEVICE_HCI_ERROR (-57)
#define QAPI_BLE_BTPS_ERROR_ADDING_CALLBACK_INFORMATION (-59)
#define QAPI_BLE_BTPS_ERROR_DELETING_CALLBACK_INFORMATION (-60)
#define QAPI_BLE_BTPS_ERROR_NO_CALLBACK_REGISTERED (-61)
#define QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR (-64)
#define QAPI_BLE_BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE (-65)
#define QAPI_BLE_BTPS_ERROR_INSUFFICIENT_RESOURCES (-66)
#define QAPI_BLE_BTPS_ERROR_DEVICE_NOT_CONNECTED (-98)
#define QAPI_BLE_BTPS_ERROR_ACTION_NOT_ALLOWED (-99)
#define QAPI_BLE_BTPS_ERROR_VS_HCI_ERROR (-101)
#define QAPI_BLE_BTPS_ERROR_FEATURE_NOT_AVAILABLE (-103)
#define QAPI_BLE_BTPS_ERROR_LOCAL_CONTROLLER_DOES_NOT_SUPPORT_LE (-104)
#define QAPI_BLE_BTPS_ERROR_SCAN_ACTIVE (-105)
#define QAPI_BLE_BTPS_ERROR_INVALID_DEVICE_ROLE_MODE (-107)
#define QAPI_BLE_BTPS_ERROR_DEVICE_IS_SLAVE (-108)
#define QAPI_BLE_BTPS_ERROR_READ_REMOTE_FEATURES_OUTSTANDING (-110)
#define QAPI_BLE_BTPS_ERROR_CREATE_CONNECTION_OUTSTANDING (-111)
#define QAPI_BLE_BTPS_ERROR_INVALID_CONNECTION_PARAMETERS (-112)
#define QAPI_BLE_BTPS_ERROR_RANDOM_ADDRESS_IN_USE (-116)
#define QAPI_BLE_BTPS_ERROR_PAIRING_ACTIVE (-117)
#define QAPI_BLE_BTPS_ERROR_PAIRING_NOT_ACTIVE (-118)
#define QAPI_BLE_BTPS_ERROR_INVALID_STATE (-119)
#define QAPI_BLE_BTPS_ERROR_FEATURE_NOT_CURRENTLY_ACTIVE (-120)
#define QAPI_BLE_BTPS_ERROR_CONNECTION_UPDATE_PROCEDURE_OUTSTANDING (-121)
#define QAPI_BLE_BTPS_ERROR_RESOLVING_LIST_IN_USE (-122)
#define QAPI_BLE_BTPS_ERROR_SECURE_CONNECTIONS_NOT_SUPPORTED (-123)
/* The following defines the start of the HCI Status Code Error Base.*/
/* Errors between (-500) -> (-755) are errors returned due to a Error*/
/* Code between returned by the Bluetooth Controller. */
#define QAPI_BLE_BTPS_ERROR_CODE_HCI_STATUS_BASE (-500)
/* The following MACRO is a utility MACRO that provides a mechanism */
/* for the return value in the range -500->-755 to be converted to an*/
/* HCI Controller Status Code. This MACRO accepts as it's only */
/* parameter the HCI Error Code to convert and returns the HCI Status*/
/* Code. */
#define QAPI_BLE_CONVERT_ERROR_CODE_TO_HCI_STATUS_CODE(_x) ((uint8_t)(-((_x) - QAPI_BLE_BTPS_ERROR_CODE_HCI_STATUS_BASE)))
#endif
| 73.662921 | 151 | 0.681056 |
d92c2eca6642ea37df43409e9021bc812cf40562 | 1,689 | h | C | src/parser/include/parser/operator.h | 1whatleytay/kara | fd730900e845058c4e75eb294d0d9846e71a3665 | [
"MIT"
] | 7 | 2021-09-02T09:51:21.000Z | 2022-01-17T18:31:22.000Z | src/parser/include/parser/operator.h | 1whatleytay/kara | fd730900e845058c4e75eb294d0d9846e71a3665 | [
"MIT"
] | null | null | null | src/parser/include/parser/operator.h | 1whatleytay/kara | fd730900e845058c4e75eb294d0d9846e71a3665 | [
"MIT"
] | null | null | null | #pragma once
#include <parser/kinds.h>
#include <utils/expression.h>
namespace kara::parser {
struct Reference;
struct Expression;
struct As : public hermes::Node {
[[nodiscard]] const Node *type() const;
explicit As(Node *parent);
};
struct CallParameterName : public hermes::Node {
std::string name;
explicit CallParameterName(Node *parent);
};
struct Call : public hermes::Node {
[[nodiscard]] std::vector<const Expression *> parameters() const;
[[nodiscard]] std::unordered_map<size_t, const CallParameterName *> names() const;
[[nodiscard]] std::unordered_map<size_t, std::string> namesStripped() const;
explicit Call(Node *parent);
};
struct Dot : public hermes::Node {
[[nodiscard]] const Unary *unary() const;
[[nodiscard]] const Reference *reference() const;
explicit Dot(Node *parent);
};
struct Index : public hermes::Node {
[[nodiscard]] const Expression *index() const;
explicit Index(Node *parent);
};
struct Ternary : public hermes::Node {
[[nodiscard]] const Expression *onTrue() const;
[[nodiscard]] const Expression *onFalse() const;
explicit Ternary(Node *parent);
};
struct Slash : public hermes::Node {
explicit Slash(Node *parent);
};
struct Unary : public hermes::Node {
utils::UnaryOperation op = utils::UnaryOperation::Not;
explicit Unary(Node *parent);
};
struct Operator : public hermes::Node {
utils::BinaryOperation op = utils::BinaryOperation::Equals;
explicit Operator(Node *parent);
};
}
| 24.838235 | 90 | 0.618709 |
d92c6fe5e05754f79888b5f92b9cd3dc365e8524 | 3,716 | c | C | src/isc/dat2sta.c | avillasenorh/OCR-bulletins | 77cc20e80827d50707217381d9aad6ca0f16c3c3 | [
"MIT"
] | null | null | null | src/isc/dat2sta.c | avillasenorh/OCR-bulletins | 77cc20e80827d50707217381d9aad6ca0f16c3c3 | [
"MIT"
] | null | null | null | src/isc/dat2sta.c | avillasenorh/OCR-bulletins | 77cc20e80827d50707217381d9aad6ca0f16c3c3 | [
"MIT"
] | null | null | null | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*******************************************************************************
Program: dat2sta.c
Purpose: Reads text files and extracts station information
Author: Antonio Villasenor, ICTJA-CSIC, Barcelona
Date: 16-FEB-2006
*******************************************************************************/
/* maximum filename length */
#ifndef FILENAME_MAX
#define FILENAME_MAX 1024
#endif
#define MAXLINE 96
#define MAXSTA 1000
#define TRUE 1
#define FALSE 0
int trim(char s[]);
int main(int argc, char *argv[])
{
FILE *fpdat, *fpisc, *fpheq, *fpsta;
char datfile[FILENAME_MAX];
char iscfile[FILENAME_MAX];
char line[MAXLINE+1];
int icard = 0;
char *sta_name[MAXSTA];
char *sta_code[MAXSTA];
int ntim[MAXSTA];
int nsta = 0;
int ist;
int iind;
char stnm[32];
float delta, azim;
int yr, mo, dy;
int year;
char ord;
int lineno, evno;
char evname[8];
char csta[5];
int header = FALSE; /* true while reading hypocenter header. False otherwise */
int ntot = 0; /* total number of phase cards */
int neq = 0; /* number of events in data file */
int nobs = 0; /* number of observations (stations) in current event */
int verbose = FALSE;
int infile = FALSE;
int i;
/* Decode flag options */
for (i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'V':
verbose = TRUE;
break;
default:
break;
}
} else {
if ((fpdat = fopen(argv[i], "r")) == NULL) {
fprintf(stderr, "ERROR: ");
fprintf(stderr, "cannot open %s \n", argv[i]);
exit(1);
} else {
strcpy(datfile,argv[i]);
infile = TRUE;
}
}
}
if (! infile) {
/* read from standard input */
fpdat = stdin;
} else {
if (verbose) {
fprintf(stderr, "dat2isc: ");
fprintf(stderr, "processing file %s\n", datfile);
}
}
/* initialize arrays */
for (i = 0; i < MAXSTA; i++) {
sta_name[i] = (char *)malloc(14);
sta_code[i] = (char *)malloc(5);
sta_name[i][0] = '\0';
sta_code[i][0] = '\0';
ntim[i] = 0;
}
/* Open and read station file */
if ((fpsta = fopen("/data/PROJECTS/Historical/stations/1960.codes", "r")) == NULL) {
fprintf(stderr, "ERROR: ");
fprintf(stderr, "cannot open output station file: %s\n",
"/data/PROJECTS/Historical/stations/1960.codes");
exit(1);
}
i = 0;
while (fgets(line, MAXLINE, fpsta) != NULL) {
if (line[0] != '!') {
strncpy(sta_name[i], &line[5], 12);
sta_name[i][12] = '\0';
strncpy(sta_code[i], &line[0], 4);
sta_code[i][4] = '\0';
trim(sta_name[i]);
trim(sta_code[i]);
i++;
}
}
nsta = i;
if (verbose)
fprintf(stderr, "Number of station names in 1960.codes: %d\n", nsta);
fclose(fpsta);
neq = 0;
while (fgets(line, MAXLINE, fpdat) != NULL) {
/* read year from line header */
sscanf(line, "%2d%2d%2d%c%3d",
&yr, &mo, &dy, &ord, &lineno);
year = yr + 1900;
evno = ord - 'A' + 1;
if (lineno == 1) {
neq++;
strncpy(evname, line, 7);
evname[7] = '\0';
}
if (isupper(line[11])) {
if (line[27] != '.') {
fprintf(stderr, "ERROR: wrong phase card:\n%s",line);
exit(1);
}
ntot++;
strncpy(stnm,&line[11],12);
stnm[12] = '\0';
trim(stnm);
/* find station code for stnm */
iind=-1;
for (ist = 0; ist < nsta; ist++) {
if (strcmp(stnm, sta_name[ist]) == 0) {
iind=ist;
ntim[ist]++;
break;
}
}
if (iind < 0)
fprintf(stderr, "ERROR: station code not found for: %s\n", stnm);
}
}
for (i = 0; i < nsta; i++) {
printf("%-6s %8d\n", sta_code[i], ntim[i]);
}
if (verbose)
fprintf(stderr, "Number of phase cards read in: %d\n", ntot);
fclose(fpdat);
return 0;
}
| 19.354167 | 85 | 0.555167 |
d92cc2c3fa5b683e42a7d6a4cf4f13e5a0301b75 | 339 | h | C | src/mp/mpn/mpn_sub.h | phthinh/libscarv | b48ae473235eeeb5c4cb37bd7c5fd1c275abf20b | [
"MIT"
] | 1 | 2019-03-12T17:26:25.000Z | 2019-03-12T17:26:25.000Z | src/mp/mpn/mpn_sub.h | phthinh/libscarv | b48ae473235eeeb5c4cb37bd7c5fd1c275abf20b | [
"MIT"
] | null | null | null | src/mp/mpn/mpn_sub.h | phthinh/libscarv | b48ae473235eeeb5c4cb37bd7c5fd1c275abf20b | [
"MIT"
] | null | null | null | #ifndef __MPN_SUB_H
#define __MPN_SUB_H
#include "mpn.h"
extern limb_t mpn_sub ( limb_t* r, const limb_t* x, int l_x, const limb_t* y, int l_y );
extern limb_t mpn_sub_1( limb_t* r, const limb_t* x, int l_x, const limb_t y );
extern limb_t mpn_sub_n( limb_t* r, const limb_t* x, const limb_t* y, int l );
#endif
| 28.25 | 89 | 0.666667 |
d92f64575317cc434d91abfb538a70ca119cce63 | 980 | h | C | System/Library/PrivateFrameworks/HealthUI.framework/HKScalarGraphViewController.h | lechium/iPhoneOS_12.1.1_Headers | aac688b174273dfcbade13bab104461f463db772 | [
"MIT"
] | 12 | 2019-06-02T02:42:41.000Z | 2021-04-13T07:22:20.000Z | System/Library/PrivateFrameworks/HealthUI.framework/HKScalarGraphViewController.h | lechium/iPhoneOS_12.1.1_Headers | aac688b174273dfcbade13bab104461f463db772 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/HealthUI.framework/HKScalarGraphViewController.h | lechium/iPhoneOS_12.1.1_Headers | aac688b174273dfcbade13bab104461f463db772 | [
"MIT"
] | 3 | 2019-06-11T02:46:10.000Z | 2019-12-21T14:58:16.000Z | /*
* This header is generated by classdump-dyld 1.0
* on Saturday, June 1, 2019 at 6:50:59 PM Mountain Standard Time
* Operating System: Version 12.1.1 (Build 16C5050a)
* Image Source: /System/Library/PrivateFrameworks/HealthUI.framework/HealthUI
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
#import <HealthUI/HKGraphViewController.h>
@interface HKScalarGraphViewController : HKGraphViewController {
double _minimumHeight;
}
@property (nonatomic,readonly) double minimumHeight; //@synthesize minimumHeight=_minimumHeight - In the implementation block
-(double)minimumHeight;
-(id)_buildGraphViewWithLabelDimension:(id)arg1 labelEndings:(long long)arg2 ;
-(id)initWithMinimumHeight:(double)arg1 labelDimension:(id)arg2 labelEndings:(long long)arg3 ;
-(void)_setupGraphViewSelectionStyle;
-(void)_pinView:(id)arg1 toParentView:(id)arg2 ;
-(id)initWithMinimumHeight:(double)arg1 ;
-(void)loadView;
-(void)viewDidLoad;
@end
| 35 | 138 | 0.781633 |
d93133143118a66fa13f34799e782764d18b8257 | 536 | h | C | src/pdf/SkPDFBitmap.h | Perspex/skia | e25fe5a294e9cee8f23207eef63fad6cffa9ced4 | [
"Apache-2.0"
] | 7 | 2016-01-12T23:32:32.000Z | 2021-12-03T11:21:26.000Z | src/pdf/SkPDFBitmap.h | AvaloniaUI/skia | e25fe5a294e9cee8f23207eef63fad6cffa9ced4 | [
"Apache-2.0"
] | null | null | null | src/pdf/SkPDFBitmap.h | AvaloniaUI/skia | e25fe5a294e9cee8f23207eef63fad6cffa9ced4 | [
"Apache-2.0"
] | 6 | 2015-12-09T14:00:19.000Z | 2021-12-06T03:08:43.000Z | /*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkPDFBitmap_DEFINED
#define SkPDFBitmap_DEFINED
#include "SkPDFTypes.h"
class SkImage;
/**
* SkPDFBitmap wraps a SkImage and serializes it as an image Xobject.
* It is designed to use a minimal amout of memory, aside from refing
* the image, and its emitObject() does not cache any data.
*/
SkPDFObject* SkPDFCreateBitmapObject(const SkImage*);
#endif // SkPDFBitmap_DEFINED
| 24.363636 | 73 | 0.746269 |
d934802ffa1964a3d72aa43fd851767821f244f8 | 7,272 | h | C | SofaKernel/modules/SofaBaseTopology/PointSetTopologyContainer.h | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | SofaKernel/modules/SofaBaseTopology/PointSetTopologyContainer.h | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | SofaKernel/modules/SofaBaseTopology/PointSetTopologyContainer.h | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | /******************************************************************************
* SOFA, Simulation Open-Framework Architecture, development version *
* (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#ifndef SOFA_COMPONENT_TOPOLOGY_POINTSETTOPOLOGYCONTAINER_H
#define SOFA_COMPONENT_TOPOLOGY_POINTSETTOPOLOGYCONTAINER_H
#include "config.h"
#include <sofa/helper/vector.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/core/topology/BaseTopology.h>
namespace sofa
{
namespace component
{
namespace topology
{
class PointSetTopologyModifier;
//using core::topology::BaseMeshTopology;
//typedef core::topology::BaseMeshTopology::PointID PointID;
//typedef Data< sofa::helper::vector < void* > > t_topologicalData;
/** The container class that stores a set of points and provides access
to each point. This set of point may be a subset of the DOF of the mechanical model */
class SOFA_BASE_TOPOLOGY_API PointSetTopologyContainer : public core::topology::TopologyContainer
{
public:
SOFA_CLASS(PointSetTopologyContainer,core::topology::TopologyContainer);
friend class PointSetTopologyModifier;
typedef defaulttype::Vec3Types InitTypes;
protected:
PointSetTopologyContainer(int nPoints = 0);
virtual ~PointSetTopologyContainer() {}
public:
virtual void init();
/// Procedural creation methods
/// @{
virtual void clear();
virtual void addPoint(double px, double py, double pz);
/// @}
/// BaseMeshTopology API
/// @{
/** \brief Returns the number of vertices in this topology. */
int getNbPoints() const { return (int)nbPoints.getValue(); }
/** \brief Returns the number of topological element of the current topology.
* This function avoids to know which topological container is in used.
*/
virtual unsigned int getNumberOfElements() const;
/** \brief Returns a reference to the Data of points array container. */
Data<InitTypes::VecCoord>& getPointDataArray() {return d_initPoints;}
/** \brief Set the number of vertices in this topology. */
void setNbPoints(int n);
/** \brief check if vertices in this topology have positions. */
virtual bool hasPos() const;
/** \brief Returns the X coordinate of the ith DOF. */
virtual SReal getPX(int i) const;
/** \brief Returns the Y coordinate of the ith DOF. */
virtual SReal getPY(int i) const;
/** \brief Returns the Z coordinate of the ith DOF. */
virtual SReal getPZ(int i) const;
/** \brief Returns the type of the topology */
virtual sofa::core::topology::TopologyObjectType getTopologyType() const {return sofa::core::topology::POINT;}
/// @}
/// Dynamic Topology API
/// @{
/** \brief Checks if the Topology is coherent
*
*/
virtual bool checkTopology() const;
/** \brief add one DOF in this topology (simply increment the number of DOF)
*
*/
void addPoint();
/** \brief add a number of DOFs in this topology (simply increase the number of DOF according to this parameter)
*
* @param The number of point to add.
*/
void addPoints(const unsigned int nPoints);
/** \brief remove one DOF in this topology (simply decrement the number of DOF)
*
*/
void removePoint();
/** \brief remove a number of DOFs in this topology (simply decrease the number of DOF according to this parameter)
*
* @param The number of point to remove.
*/
void removePoints(const unsigned int nPoints);
/// @}
inline friend std::ostream& operator<< (std::ostream& out, const PointSetTopologyContainer& /*t*/)
{
return out;
}
inline friend std::istream& operator>>(std::istream& in, PointSetTopologyContainer& /*t*/)
{
return in;
}
const sofa::helper::vector<PointID>& getPoints() const;
protected:
/// \brief Function creating the data graph linked to d_point
virtual void updateTopologyEngineGraph();
/// \brief functions to really update the graph of Data/DataEngines linked to the different Data array, using member variable.
virtual void updateDataEngineGraph(sofa::core::objectmodel::BaseData& my_Data, sofa::helper::list <sofa::core::topology::TopologyEngine *>& my_enginesList);
/// Use a specific boolean @see m_pointTopologyDirty in order to know if topology Data is dirty or not.
/// Set/Get function access to this boolean
void setPointTopologyToDirty() {m_pointTopologyDirty = true;}
void cleanPointTopologyFromDirty() {m_pointTopologyDirty = false;}
const bool& isPointTopologyDirty() {return m_pointTopologyDirty;}
/// \brief function to add a topologyEngine to the current list of engines.
void addEngineToList(sofa::core::topology::TopologyEngine * _engine);
/// \brief functions to display the graph of Data/DataEngines linked to the different Data array, using member variable.
virtual void displayDataGraph(sofa::core::objectmodel::BaseData& my_Data);
public:
Data<InitTypes::VecCoord> d_initPoints;
protected:
/// Boolean used to know if the topology Data of this container is dirty
bool m_pointTopologyDirty;
/// List of engines related to this specific container
sofa::helper::list <sofa::core::topology::TopologyEngine *> m_enginesList;
/// \brief variables used to display the graph of Data/DataEngines linked to this Data array.
sofa::helper::vector < sofa::helper::vector <std::string> > m_dataGraph;
sofa::helper::vector < sofa::helper::vector <std::string> > m_enginesGraph;
private:
Data<unsigned int> nbPoints;
Data<sofa::helper::vector<PointID> > points;
};
} // namespace topology
} // namespace component
} // namespace sofa
#endif // SOFA_COMPONENTS_POINTSETTOPOLOGYCONTAINER_H
| 35.473171 | 160 | 0.635589 |
d935493b24f04892ab0d1f72843efb8c420f7169 | 6,244 | c | C | src/xflow_rtt.c | praveingk/xflow-ebpf | 9389121729ca9062a51896c0f81f11a2e0b62809 | [
"Apache-2.0"
] | null | null | null | src/xflow_rtt.c | praveingk/xflow-ebpf | 9389121729ca9062a51896c0f81f11a2e0b62809 | [
"Apache-2.0"
] | 3 | 2022-02-16T03:38:29.000Z | 2022-03-23T04:06:55.000Z | src/xflow_rtt.c | praveingk/xflow-ebpf | 9389121729ca9062a51896c0f81f11a2e0b62809 | [
"Apache-2.0"
] | 2 | 2022-02-15T15:00:56.000Z | 2022-02-15T16:58:07.000Z | /*
An ebpf tc program to calculate avg-RTT for flows based on the TCP Seq/ACK
*/
#include "xflow_global.h"
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/pkt_cls.h>
// we are using tc to load in our ebpf program that will
// create maps for us and require structure bpf_elf_map
#include <iproute2/bpf_elf.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>
#include "../common/parsing_helpers.h"
#include "../common/common_defines.h"
#include "../common/common_utils.h"
#define MYNAME "xflow_rtt"
//#define BPF_MAP_TYPE_RINGBUF 28
#define bpf_tc_printk(fmt, ...) \
({ \
const char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
struct {
__uint(type, BPF_MAP_TYPE_LRU_HASH);
__type(key, flow_id_seq);
__type(value, timestamps);
__uint(max_entries, MAX_ENTRIES);
__uint(pinning, LIBBPF_PIN_BY_NAME);
} flow_seq_timestamp_map SEC(".maps");
struct {
__uint(type, BPF_MAP_TYPE_HASH);
__type(key, flow_def);
__type(value, flow_report); // avg rtt
__uint(max_entries, MAX_ENTRIES);
__uint(pinning, LIBBPF_PIN_BY_NAME);
} flow_report_map SEC(".maps");
/*
Flow_id -> sample
Maintain avg rtt per-flow
*/
SEC("xflow_rtt_egress")
int xflow_egress(struct __sk_buff *skb) {
void *data_end = (void *)(long)skb->data_end;
void *data = (void *)(long)skb->data;
int rc = TC_ACT_OK;
int ret = 0;
timestamps seq_timestamps;
flow_id_seq my_flow_id_seq;
flow_def my_flow_id;
/* Get Eth header */
struct ethhdr *eth = data;
if ((void *)(eth + 1) > data_end) {
return rc;
}
if (eth->h_proto != bpf_htons(ETH_P_IP)) {
// Non-IP packets, ignore for now
return rc;
}
/* Get IP header */
struct iphdr *iph = (struct iphdr *)(void *)(eth + 1);
if ((void *)(iph + 1) > data_end) {
return rc;
}
if (iph->protocol == IPPROTO_TCP) {
struct tcphdr *tcph = (struct tcphdr *)(void *)(iph + 1);
if (tcph + 1 > data_end) {
return rc;
}
my_flow_id.saddr = iph->saddr;
my_flow_id.daddr = iph->daddr;
my_flow_id.sport = tcph->source;
my_flow_id.dport = tcph->dest;
my_flow_id_seq.id = my_flow_id;
my_flow_id_seq.seq = tcph->seq;
//__u64 timestamp = skb->timestamp;
//__be32 seq = tcph->seq;
seq_timestamps.send_tstamp = bpf_ktime_get_ns();//skb->tstamp; //bpf_ktime_get_ns();//
seq_timestamps.rtt = 0;
//seq_timestamps.id = 0;
timestamps *test = bpf_map_lookup_elem(&flow_seq_timestamp_map, &my_flow_id_seq);
if (test == NULL) {
ret = bpf_map_update_elem(&flow_seq_timestamp_map, &my_flow_id_seq, &seq_timestamps, BPF_NOEXIST);
if (ret < 0) {
bpf_tc_printk("Egress: Map is full\n Work on eviction..%d", ret);
return rc;
} else {
//bpf_tc_printk("Egress: seq=%u, send_tstamp=%lu\n", my_flow_id_seq.seq, seq_timestamps.send_tstamp);
}
}
}
//bpf_tc_printk(MYNAME " Recording packet size=%d, interface=%d", pkt_bytes, skb->ifindex);
return rc;
}
SEC("xflow_rtt_ingress")
int xflow_ingress(struct __sk_buff *skb) {
void *data_end = (void *)(long)skb->data_end;
void *data = (void *)(long)skb->data;
int rc = TC_ACT_OK;
//int pkt_bytes = data_end - data;
flow_id_seq my_flow_id_seq;
flow_def my_flow_id;
flow_report my_report;
/* Get Eth header */
struct ethhdr *eth = data;
if ((void *)(eth + 1) > data_end) {
return rc;
}
if (eth->h_proto != bpf_htons(ETH_P_IP)) {
// Non-IP packets, ignore for now
return rc;
}
/* Get IP header */
struct iphdr *iph = (struct iphdr *)(void *)(eth + 1);
if ((void *)(iph + 1) > data_end) {
return rc;
}
if (iph->protocol == IPPROTO_TCP) {
struct tcphdr *tcph = (struct tcphdr *)(void *)(iph + 1);
if (tcph + 1 > data_end) {
return rc;
}
//__u64 timestamp = bpf_ktime_get_ns();
if (tcph->ack == 1) {
my_flow_id.saddr = iph->daddr;
my_flow_id.daddr = iph->saddr;
my_flow_id.sport = tcph->dest;
my_flow_id.dport = tcph->source;
my_flow_id_seq.id = my_flow_id;
my_flow_id_seq.seq = tcph->ack_seq;
//__be32 seq = tcph->ack_seq;
//__u64 tstamp = skb->tstamp;
//bpf_map_update_elem(&rtt_map, &seq, &tstamp, BPF_NOEXIST);
timestamps *seq_timestamps = bpf_map_lookup_elem(&flow_seq_timestamp_map, &my_flow_id_seq);
if (seq_timestamps != NULL) {
//seq_timestamps->send_tstamp = seq_timestamps->send_tstamp;
seq_timestamps->rtt = (__u32) (bpf_ktime_get_ns() - seq_timestamps->send_tstamp);//skb->tstamp;
bpf_map_update_elem(&flow_seq_timestamp_map, &my_flow_id_seq, seq_timestamps, BPF_EXIST);
//bpf_map_delete_elem(&flow_seq_timestamp_map, &my_flow_id);
//bpf_tc_printk("Ingress: found seq=%u, recv_tstamp=%lu, rtt=%u\n",
//my_flow_id_seq.seq,
//bpf_ktime_get_ns(),
//seq_timestamps->rtt);
// Next to maintain the RTT per-flow
flow_report *report = bpf_map_lookup_elem(&flow_report_map, &my_flow_id);
if (report != NULL) {
report->avg_rtt = (seq_timestamps->rtt + report->avg_rtt) / 2;
my_report.fct = 0;
bpf_map_update_elem(&flow_report_map, &my_flow_id, report, BPF_NOEXIST);
} else {
my_report.avg_rtt = seq_timestamps->rtt;
my_report.fct = 0;
bpf_map_update_elem(&flow_report_map, &my_flow_id, &my_report, BPF_NOEXIST);
}
} else {
//bpf_tc_printk("Ingress: Not found seq=%u \n", my_flow_id_seq.seq);
}
}
}
//bpf_tc_printk(MYNAME " Recording packet size=%d, interface=%d", pkt_bytes, skb->ifindex);
return rc;
}
char _license[] SEC("license") = "GPL";
| 30.910891 | 117 | 0.59417 |
d93688107a9c4fd4fc3b84ff922d402c89ccfcc6 | 613 | c | C | GettingStarted/amicablepair.c | gokulshri/Cplusplus | 898878aa39c1dc8751f11b34748cb52852e68bd7 | [
"MIT"
] | 2 | 2020-05-04T15:30:02.000Z | 2020-05-04T15:30:11.000Z | GettingStarted/amicablepair.c | gokulshri/Cplusplus | 898878aa39c1dc8751f11b34748cb52852e68bd7 | [
"MIT"
] | null | null | null | GettingStarted/amicablepair.c | gokulshri/Cplusplus | 898878aa39c1dc8751f11b34748cb52852e68bd7 | [
"MIT"
] | 3 | 2019-10-01T13:41:16.000Z | 2019-10-03T16:16:10.000Z | #include <iostream.h>
using namespace std;
int divSum(int n)
{
int result = 0;
for (int i = 2; i <= sqrt(n); i++)
{
if (n % i == 0)
{
if (i == (n / i))
result += i;
else
result += (i + n/i);
}
}
return (result + 1);
}
bool areAmicable(int x, int y)
{
if (divSum(x) != y)
return false;
return (divSum(y) == x);
}
int main() {
int x = 220, y = 284;
if (areAmicable(x, y))
cout << "Yes";
else
cout << "No";
return 0;
}
| 16.131579 | 39 | 0.373573 |
d9370ac18e2b73178e9fee322fc473880d0b4453 | 3,939 | h | C | Code/Tests/ScreenTest/Transform.h | mrneo240/suicide-barbie | c8b01f9c04755e7f6d1d261fc4a1600cd6705b96 | [
"MIT"
] | 57 | 2021-01-02T00:18:22.000Z | 2022-03-27T14:40:25.000Z | Code/Tests/ScreenTest/Transform.h | mrneo240/suicide-barbie | c8b01f9c04755e7f6d1d261fc4a1600cd6705b96 | [
"MIT"
] | 1 | 2021-01-05T20:43:02.000Z | 2021-01-11T23:04:41.000Z | Code/Tests/ScreenTest/Transform.h | mrneo240/suicide-barbie | c8b01f9c04755e7f6d1d261fc4a1600cd6705b96 | [
"MIT"
] | 8 | 2021-01-01T22:34:43.000Z | 2022-03-22T01:21:26.000Z | #ifndef NEWAGE_TRANSFORM_H_
#define NEWAGE_TRANSFORM_H_
#include "cfg.h"
extern "C" {
#include <Base/Math/Lin.h>
#include <Base/Math/Quat.h>
}
#include <iosfwd>
struct xVec3 : public Vec3
{
xVec3( float x_ = 0.0f, float y_ = 0.0f, float z_ = 0.0f ) { x = x_; y = y_; z = z_; }
xVec3( Vec3 const& v ) { x = v.x; y = v.y; z = v.z; }
xVec3 operator+( xVec3 const& rhs ) const;
xVec3 operator-( xVec3 const& rhs ) const;
xVec3 operator*( float v ) const;
};
struct xQuat : public Quat
{
xQuat( float x_ = 0.0f, float y_ = 0.0f, float z_ = 0.0f, float w_ = 0.0f ) { x = x_; y = y_; z = z_; w = w_; }
xQuat( Quat const& q ) { x = q.x; y = q.y; z = q.z; w = q.w; }
};
struct xMat34 : public Mat34
{
xMat34();
xMat34( float x0, float y0, float z0,
float x1, float y1, float z1,
float x2, float y2, float z2,
float x3, float y3, float z3 );
xMat34 operator*( xMat34 const& rhs ) const;
};
class CTransform
{
public:
typedef xVec3 t_vector;
typedef xQuat t_quaternion;
typedef xMat34 t_matrix;
CTransform();
CTransform( t_vector const& transl, t_quaternion const& rot, t_vector const& scale );
CTransform( CTransform const& r );
CTransform( t_matrix const& m );
CTransform const& operator=( CTransform const& rh );
CTransform const& operator=( t_matrix const& m );
static CTransform const& identity() { return mIdentityTransform; }
static t_matrix const& identityMatrix() { return mIdentityMatrix; }
static t_vector const& nullTranslation() { return mIdentityTranslation; }
static t_quaternion const& identityRotation() { return mIdentityRotation; }
static t_vector const& identityScale() { return mIdentityScale; }
static CTransform scaling( float s );
static CTransform scaling( float x, float y, float z );
static CTransform scaling( t_vector const& s );
static CTransform translating( t_vector const& t );
static CTransform translating( float x, float y, float z );
static CTransform rotating( t_quaternion const& q );
static t_quaternion rotationAxisAngle( t_vector const& vec, float angle );
t_quaternion rotationConjugate() const;
void identify();
void translateBy( t_vector const& transl );
void rotateBy( t_quaternion const& q );
void scaleBy( t_vector const& scl );
void scaleBy( float scl );
t_vector orientVector( t_vector const& vec ) const;
void setTranslation( t_vector const& v ) { mTranslation = v; }
void setRotation( t_quaternion const& q ) { mRotation = q; }
void setScale( t_vector const& s ) { mScale = s; }
void setScale( float s ) { mScale.x = mScale.y = mScale.z = s; }
t_vector& translation() { return mTranslation; }
t_vector const& translation() const { return mTranslation; }
t_quaternion& rotation() { return mRotation; }
t_quaternion const& rotation() const { return mRotation; }
t_vector& scale() { return mScale; }
t_vector const& scale() const { return mScale; }
t_matrix matrix() const;
// CTransform operator*( CTransform const& rh ) const;
// t_matrix operator*( t_matrix const& mat ) const;
t_vector transformCoord( t_vector const& vec ) const;
t_vector transformNormal( t_vector const& vec ) const;
operator t_matrix() const { return matrix(); }
friend t_matrix operator*( CTransform::t_matrix const& lh, CTransform const& rh );
friend std::ostream& operator<<( std::ostream& os, CTransform const& rh );
private:
t_vector mTranslation;
t_quaternion mRotation;
t_vector mScale;
static CTransform mIdentityTransform;
static t_vector mIdentityScale;
static t_quaternion mIdentityRotation;
static t_vector mIdentityTranslation;
static t_matrix mIdentityMatrix;
};
CTransform::t_matrix operator*(
CTransform::t_matrix const& lh, CTransform const& rh );
std::ostream& operator<<( std::ostream& os, CTransform const& rh );
std::ostream& operator<<( std::ostream& os, CTransform::t_vector const& rh );
std::ostream& operator<<( std::ostream& os, CTransform::t_quaternion const& rh );
#endif // NEWAGE_TRANSFORM_H_
| 32.02439 | 112 | 0.713125 |