hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 588
values | lang stringclasses 305
values | max_stars_repo_path stringlengths 3 363 | max_stars_repo_name stringlengths 5 118 | max_stars_repo_head_hexsha stringlengths 40 40 | 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:00:35 2022-03-31 23:43:49 ⌀ | max_stars_repo_stars_event_max_datetime stringdate 2015-01-01 12:37:38 2022-03-31 23:59:52 ⌀ | max_issues_repo_path stringlengths 3 363 | max_issues_repo_name stringlengths 5 118 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 363 | max_forks_repo_name stringlengths 5 135 | max_forks_repo_head_hexsha stringlengths 40 40 | 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:02 2022-03-31 23:27:27 ⌀ | max_forks_repo_forks_event_max_datetime stringdate 2015-01-03 08:55:07 2022-03-31 23:59:24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1.13 1.04M | max_line_length int64 1 1.05M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12e932938f45da87e79d0269a156d22718badb5d | 648 | c | C | d/darkwood/castle/tower1n.c | Dbevan/SunderingShadows | 6c15ec56cef43c36361899bae6dc08d0ee907304 | [
"MIT"
] | 13 | 2019-07-19T05:24:44.000Z | 2021-11-18T04:08:19.000Z | d/darkwood/castle/tower1n.c | Dbevan/SunderingShadows | 6c15ec56cef43c36361899bae6dc08d0ee907304 | [
"MIT"
] | 4 | 2021-03-15T18:56:39.000Z | 2021-08-17T17:08:22.000Z | d/darkwood/castle/tower1n.c | Dbevan/SunderingShadows | 6c15ec56cef43c36361899bae6dc08d0ee907304 | [
"MIT"
] | 13 | 2019-09-12T06:22:38.000Z | 2022-01-31T01:15:12.000Z | #include <std.h>
inherit ROOM;
void create()
{
::create();
set_property("indoors",1);
set_property("light",2);
set_short("The Tower of Wizardry");
set_long(
@CASTLE
%^BOLD%^First Floor of the Tower of Wizardry%^RESET%^
%^BLUE%^You are in the north room on the first floor, the
residence of Merrang the Enchanter. There are shelves lining
the walls, and you are sure they must be filled with many
secrets of the magi.
CASTLE
);
set_items(([
]));
set_exits( ([
"south":"/d/darkwood/castle/tower1c"
]) );
}
void reset(){
::reset();
if(!present("merrang"))
new("/d/darkwood/castle/mon/merrang.c")->move(TO);
}
| 20.25 | 61 | 0.657407 |
28e9b5a713f018da02abac07ececcb3c4803c67b | 83 | h | C | Pod/Classes/Projection/MOBProjectionEPSG32627.h | jkdubr/Proj4 | dcdf91821720b90423e7d6774d14948d165fbb12 | [
"MIT"
] | 3 | 2015-01-29T15:53:20.000Z | 2019-03-06T03:36:56.000Z | Pod/Classes/Projection/MOBProjectionEPSG32627.h | jkdubr/Proj4 | dcdf91821720b90423e7d6774d14948d165fbb12 | [
"MIT"
] | 1 | 2016-01-12T13:53:40.000Z | 2016-01-12T13:53:40.000Z | Pod/Classes/Projection/MOBProjectionEPSG32627.h | jkdubr/Proj4 | dcdf91821720b90423e7d6774d14948d165fbb12 | [
"MIT"
] | null | null | null | #import "MOBProjection.h"
@interface MOBProjectionEPSG32627 : MOBProjection
@end
| 13.833333 | 49 | 0.807229 |
d40979f8c1241d8a1d17a8da431403cea3799b33 | 481 | h | C | ZJSDemoProjection/ZJSDemoProjection/Controller/fileTransferBoxFileInfoModel.h | zjsrose/ZJSDemoProjection | 4d645dadbb68352ef629d34191b8ddfa6fea0ccf | [
"MIT"
] | null | null | null | ZJSDemoProjection/ZJSDemoProjection/Controller/fileTransferBoxFileInfoModel.h | zjsrose/ZJSDemoProjection | 4d645dadbb68352ef629d34191b8ddfa6fea0ccf | [
"MIT"
] | null | null | null | ZJSDemoProjection/ZJSDemoProjection/Controller/fileTransferBoxFileInfoModel.h | zjsrose/ZJSDemoProjection | 4d645dadbb68352ef629d34191b8ddfa6fea0ccf | [
"MIT"
] | null | null | null | //
// fileTransferBoxFileInfoModel.h
// CloudAdressBookV2
//
// Created by apple on 15-7-24.
// Copyright (c) 2015年 wds. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface fileTransferBoxFileInfoModel : NSObject
@property(nonatomic,copy)NSNumber * fileSize;
@property(nonatomic,copy)NSDate * fileCreateDate;
@property(nonatomic,copy)NSString * fileName;
@property(nonatomic,copy)NSString * fileOwner;
@property(nonatomic,copy)NSDate * fileModDate;
@end
| 21.863636 | 50 | 0.765073 |
58089f59291e345a366465a217bd4af2a4984efa | 890 | h | C | cie-pkcs11/Util/log.h | bitpdg/cie-middleware-linux | d3a794802240a2cda55ecd1d02ff79195689e5ac | [
"BSD-3-Clause"
] | 24 | 2018-05-15T08:52:34.000Z | 2022-02-23T21:23:55.000Z | cie-pkcs11/Util/log.h | bitpdg/cie-middleware-linux | d3a794802240a2cda55ecd1d02ff79195689e5ac | [
"BSD-3-Clause"
] | 42 | 2017-10-07T08:19:54.000Z | 2022-03-24T20:45:41.000Z | cie-pkcs11/Util/log.h | bitpdg/cie-middleware-linux | d3a794802240a2cda55ecd1d02ff79195689e5ac | [
"BSD-3-Clause"
] | 22 | 2019-03-20T14:26:49.000Z | 2022-03-25T16:41:29.000Z | #pragma once
#include <stdlib.h>
//#include "defines.h"
#include <string>
#include <wintypes.h>
#ifndef OutputDebugString
#define OutputDebugString printf
#endif
class CLog {
public:
unsigned int LogCount;
bool Initialized;
bool Enabled;
bool FunctionLog;
bool LogParam;
unsigned int ModuleNum;
std::string logDir;
std::string logPath;
std::string logName;
std::string logFileName;
std::string::iterator threadPos;
std::string logVersion;
bool FirstLog;
bool _stack_logged;
CLog(void);
~CLog(void);
DWORD write(const char *format,...);
void writePure(const char *format,...);
void writeBinData(uint8_t *data, size_t datalen);
// void initModule(const char *name,const char *version);
void init();
void writeModuleInfo();
void dumpErr();
};
void initLog(const char *moduleName, const char *iniFile,const char *version);
| 20.227273 | 78 | 0.702247 |
5846ab28bae0ae7230cb1c985535808c3af28ac6 | 2,486 | h | C | Signer/ui_GetPtarrenFileInfo.h | WhiteGroup/JAV-AV-Engine | c258c1bb283d2cccc358dab5d3a7bacd4fc35790 | [
"MIT"
] | 15 | 2016-11-03T20:39:13.000Z | 2022-01-17T16:00:21.000Z | Signer/ui_GetPtarrenFileInfo.h | ZhuHuiBeiShaDiao/JAV-AV-Engine | c258c1bb283d2cccc358dab5d3a7bacd4fc35790 | [
"MIT"
] | null | null | null | Signer/ui_GetPtarrenFileInfo.h | ZhuHuiBeiShaDiao/JAV-AV-Engine | c258c1bb283d2cccc358dab5d3a7bacd4fc35790 | [
"MIT"
] | 16 | 2016-11-04T11:40:39.000Z | 2022-02-25T07:25:52.000Z | /********************************************************************************
** Form generated from reading UI file 'GetPtarrenFileInfo.ui'
**
** Created: Wed May 30 14:37:36 2012
** by: Qt User Interface Compiler version 4.8.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_GETPTARRENFILEINFO_H
#define UI_GETPTARRENFILEINFO_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QGridLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QTableView>
QT_BEGIN_NAMESPACE
class Ui_DlgGetPatternFileInfo
{
public:
QGridLayout *gridLayout;
QDialogButtonBox *buttonBox;
QTableView *TblFileInfo;
void setupUi(QDialog *DlgGetPatternFileInfo)
{
if (DlgGetPatternFileInfo->objectName().isEmpty())
DlgGetPatternFileInfo->setObjectName(QString::fromUtf8("DlgGetPatternFileInfo"));
DlgGetPatternFileInfo->resize(580, 397);
gridLayout = new QGridLayout(DlgGetPatternFileInfo);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
buttonBox = new QDialogButtonBox(DlgGetPatternFileInfo);
buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
gridLayout->addWidget(buttonBox, 1, 0, 1, 1);
TblFileInfo = new QTableView(DlgGetPatternFileInfo);
TblFileInfo->setObjectName(QString::fromUtf8("TblFileInfo"));
gridLayout->addWidget(TblFileInfo, 0, 0, 1, 1);
retranslateUi(DlgGetPatternFileInfo);
QObject::connect(buttonBox, SIGNAL(accepted()), DlgGetPatternFileInfo, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), DlgGetPatternFileInfo, SLOT(reject()));
QMetaObject::connectSlotsByName(DlgGetPatternFileInfo);
} // setupUi
void retranslateUi(QDialog *DlgGetPatternFileInfo)
{
DlgGetPatternFileInfo->setWindowTitle(QApplication::translate("DlgGetPatternFileInfo", "File Info", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class DlgGetPatternFileInfo: public Ui_DlgGetPatternFileInfo {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_GETPTARRENFILEINFO_H
| 34.054795 | 139 | 0.684634 |
5565f6f5b1ae061fb478542eee4525d8a6676507 | 18,583 | c | C | tools/omake/tolsrc/go_0023s/gcc/bitmap.c | TheCodeYu/os | 11034d8bd68dbd4d503d79b91be04e3861724c63 | [
"Apache-2.0"
] | null | null | null | tools/omake/tolsrc/go_0023s/gcc/bitmap.c | TheCodeYu/os | 11034d8bd68dbd4d503d79b91be04e3861724c63 | [
"Apache-2.0"
] | null | null | null | tools/omake/tolsrc/go_0023s/gcc/bitmap.c | TheCodeYu/os | 11034d8bd68dbd4d503d79b91be04e3861724c63 | [
"Apache-2.0"
] | null | null | null | /* Functions to support general ended bitmaps.
Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
GCC 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 GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#define GENERATOR_FILE 1
/* !kawai! */
#include "config.h"
#include "system.h"
#include "rtl.h"
#include "flags.h"
#include "../include/obstack.h"
#include "bitmap.h"
/* end of !kawai! */
/* Obstack to allocate bitmap elements from. */
static struct obstack bitmap_obstack;
static int bitmap_obstack_init = FALSE;
#ifndef INLINE
#ifndef __GNUC__
#define INLINE
#else
#define INLINE __inline__
#endif
#endif
/* Global data */
bitmap_element bitmap_zero_bits; /* An element of all zero bits. */
static bitmap_element *bitmap_free; /* Freelist of bitmap elements. */
static void bitmap_element_free PARAMS ((bitmap, bitmap_element *));
static bitmap_element *bitmap_element_allocate PARAMS ((void));
static int bitmap_element_zerop PARAMS ((bitmap_element *));
static void bitmap_element_link PARAMS ((bitmap, bitmap_element *));
static bitmap_element *bitmap_find_bit PARAMS ((bitmap, unsigned int));
/* Free a bitmap element. Since these are allocated off the
bitmap_obstack, "free" actually means "put onto the freelist". */
static INLINE void
bitmap_element_free (head, elt)
bitmap head;
bitmap_element *elt;
{
bitmap_element *next = elt->next;
bitmap_element *prev = elt->prev;
if (prev)
prev->next = next;
if (next)
next->prev = prev;
if (head->first == elt)
head->first = next;
/* Since the first thing we try is to insert before current,
make current the next entry in preference to the previous. */
if (head->current == elt)
{
head->current = next != 0 ? next : prev;
if (head->current)
head->indx = head->current->indx;
}
elt->next = bitmap_free;
bitmap_free = elt;
}
/* Allocate a bitmap element. The bits are cleared, but nothing else is. */
static INLINE bitmap_element *
bitmap_element_allocate ()
{
bitmap_element *element;
if (bitmap_free != 0)
{
element = bitmap_free;
bitmap_free = element->next;
}
else
{
/* We can't use gcc_obstack_init to initialize the obstack since
print-rtl.c now calls bitmap functions, and bitmap is linked
into the gen* functions. */
if (!bitmap_obstack_init)
{
bitmap_obstack_init = TRUE;
/* Let particular systems override the size of a chunk. */
#ifndef OBSTACK_CHUNK_SIZE
#define OBSTACK_CHUNK_SIZE 0
#endif
/* Let them override the alloc and free routines too. */
#ifndef OBSTACK_CHUNK_ALLOC
#define OBSTACK_CHUNK_ALLOC xmalloc
#endif
#ifndef OBSTACK_CHUNK_FREE
#define OBSTACK_CHUNK_FREE free
#endif
#if !defined(__GNUC__) || (__GNUC__ < 2)
#define __alignof__(type) 0
#endif
obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
__alignof__ (bitmap_element),
(void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC,
(void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
}
element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
sizeof (bitmap_element));
}
memset (element->bits, 0, sizeof (element->bits));
return element;
}
/* Release any memory allocated by bitmaps. */
void
bitmap_release_memory ()
{
bitmap_free = 0;
if (bitmap_obstack_init)
{
bitmap_obstack_init = FALSE;
obstack_free (&bitmap_obstack, NULL);
}
}
/* Return nonzero if all bits in an element are zero. */
static INLINE int
bitmap_element_zerop (element)
bitmap_element *element;
{
#if BITMAP_ELEMENT_WORDS == 2
return (element->bits[0] | element->bits[1]) == 0;
#else
int i;
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
if (element->bits[i] != 0)
return 0;
return 1;
#endif
}
/* Link the bitmap element into the current bitmap linked list. */
static INLINE void
bitmap_element_link (head, element)
bitmap head;
bitmap_element *element;
{
unsigned int indx = element->indx;
bitmap_element *ptr;
/* If this is the first and only element, set it in. */
if (head->first == 0)
{
element->next = element->prev = 0;
head->first = element;
}
/* If this index is less than that of the current element, it goes someplace
before the current element. */
else if (indx < head->indx)
{
for (ptr = head->current;
ptr->prev != 0 && ptr->prev->indx > indx;
ptr = ptr->prev)
;
if (ptr->prev)
ptr->prev->next = element;
else
head->first = element;
element->prev = ptr->prev;
element->next = ptr;
ptr->prev = element;
}
/* Otherwise, it must go someplace after the current element. */
else
{
for (ptr = head->current;
ptr->next != 0 && ptr->next->indx < indx;
ptr = ptr->next)
;
if (ptr->next)
ptr->next->prev = element;
element->next = ptr->next;
element->prev = ptr;
ptr->next = element;
}
/* Set up so this is the first element searched. */
head->current = element;
head->indx = indx;
}
/* Clear a bitmap by freeing the linked list. */
INLINE void
bitmap_clear (head)
bitmap head;
{
bitmap_element *element, *next;
for (element = head->first; element != 0; element = next)
{
next = element->next;
element->next = bitmap_free;
bitmap_free = element;
}
head->first = head->current = 0;
}
/* Copy a bitmap to another bitmap. */
void
bitmap_copy (to, from)
bitmap to;
bitmap from;
{
bitmap_element *from_ptr, *to_ptr = 0;
#if BITMAP_ELEMENT_WORDS != 2
int i;
#endif
bitmap_clear (to);
/* Copy elements in forward direction one at a time */
for (from_ptr = from->first; from_ptr; from_ptr = from_ptr->next)
{
bitmap_element *to_elt = bitmap_element_allocate ();
to_elt->indx = from_ptr->indx;
#if BITMAP_ELEMENT_WORDS == 2
to_elt->bits[0] = from_ptr->bits[0];
to_elt->bits[1] = from_ptr->bits[1];
#else
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
to_elt->bits[i] = from_ptr->bits[i];
#endif
/* Here we have a special case of bitmap_element_link, for the case
where we know the links are being entered in sequence. */
if (to_ptr == 0)
{
to->first = to->current = to_elt;
to->indx = from_ptr->indx;
to_elt->next = to_elt->prev = 0;
}
else
{
to_elt->prev = to_ptr;
to_elt->next = 0;
to_ptr->next = to_elt;
}
to_ptr = to_elt;
}
}
/* Find a bitmap element that would hold a bitmap's bit.
Update the `current' field even if we can't find an element that
would hold the bitmap's bit to make eventual allocation
faster. */
static INLINE bitmap_element *
bitmap_find_bit (head, bit)
bitmap head;
unsigned int bit;
{
bitmap_element *element;
unsigned HOST_WIDE_INT indx = bit / BITMAP_ELEMENT_ALL_BITS;
if (head->current == 0
|| head->indx == indx)
return head->current;
if (head->indx > indx)
for (element = head->current;
element->prev != 0 && element->indx > indx;
element = element->prev)
;
else
for (element = head->current;
element->next != 0 && element->indx < indx;
element = element->next)
;
/* `element' is the nearest to the one we want. If it's not the one we
want, the one we want doesn't exist. */
head->current = element;
head->indx = element->indx;
if (element != 0 && element->indx != indx)
element = 0;
return element;
}
/* Clear a single bit in a bitmap. */
void
bitmap_clear_bit (head, bit)
bitmap head;
int bit;
{
bitmap_element *ptr = bitmap_find_bit (head, bit);
if (ptr != 0)
{
unsigned bit_num = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
unsigned word_num = ((bit / (unsigned) HOST_BITS_PER_WIDE_INT)
% BITMAP_ELEMENT_WORDS);
ptr->bits[word_num] &= ~ (((unsigned HOST_WIDE_INT) 1) << bit_num);
/* If we cleared the entire word, free up the element */
if (bitmap_element_zerop (ptr))
bitmap_element_free (head, ptr);
}
}
/* Set a single bit in a bitmap. */
void
bitmap_set_bit (head, bit)
bitmap head;
int bit;
{
bitmap_element *ptr = bitmap_find_bit (head, bit);
unsigned word_num
= ((bit / (unsigned) HOST_BITS_PER_WIDE_INT) % BITMAP_ELEMENT_WORDS);
unsigned bit_num = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
unsigned HOST_WIDE_INT bit_val = ((unsigned HOST_WIDE_INT) 1) << bit_num;
if (ptr == 0)
{
ptr = bitmap_element_allocate ();
ptr->indx = bit / BITMAP_ELEMENT_ALL_BITS;
ptr->bits[word_num] = bit_val;
bitmap_element_link (head, ptr);
}
else
ptr->bits[word_num] |= bit_val;
}
/* Return whether a bit is set within a bitmap. */
int
bitmap_bit_p (head, bit)
bitmap head;
int bit;
{
bitmap_element *ptr;
unsigned bit_num;
unsigned word_num;
ptr = bitmap_find_bit (head, bit);
if (ptr == 0)
return 0;
bit_num = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
word_num
= ((bit / (unsigned) HOST_BITS_PER_WIDE_INT) % BITMAP_ELEMENT_WORDS);
return (ptr->bits[word_num] >> bit_num) & 1;
}
/* Return the bit number of the first set bit in the bitmap, or -1
if the bitmap is empty. */
int
bitmap_first_set_bit (a)
bitmap a;
{
bitmap_element *ptr = a->first;
unsigned HOST_WIDE_INT word;
unsigned word_num, bit_num;
if (ptr == NULL)
return -1;
#if BITMAP_ELEMENT_WORDS == 2
word_num = 0, word = ptr->bits[0];
if (word == 0)
word_num = 1, word = ptr->bits[1];
#else
for (word_num = 0; word_num < BITMAP_ELEMENT_WORDS; ++word_num)
if ((word = ptr->bits[word_num]) != 0)
break;
#endif
/* Binary search for the first set bit. */
/* ??? It'd be nice to know if ffs or ffsl was available. */
bit_num = 0;
word = word & -word;
#if HOST_BITS_PER_WIDE_INT > 64
#error "Fill out the table."
#endif
#if HOST_BITS_PER_WIDE_INT > 32
if ((word & 0xffffffff) == 0)
word >>= 32, bit_num += 32;
#endif
if ((word & 0xffff) == 0)
word >>= 16, bit_num += 16;
if ((word & 0xff) == 0)
word >>= 8, bit_num += 8;
if (word & 0xf0)
bit_num += 4;
if (word & 0xcc)
bit_num += 2;
if (word & 0xaa)
bit_num += 1;
return (ptr->indx * BITMAP_ELEMENT_ALL_BITS
+ word_num * HOST_BITS_PER_WIDE_INT
+ bit_num);
}
/* Return the bit number of the last set bit in the bitmap, or -1
if the bitmap is empty. */
int
bitmap_last_set_bit (a)
bitmap a;
{
bitmap_element *ptr = a->first;
unsigned HOST_WIDE_INT word;
unsigned word_num, bit_num;
if (ptr == NULL)
return -1;
while (ptr->next != NULL)
ptr = ptr->next;
#if BITMAP_ELEMENT_WORDS == 2
word_num = 1, word = ptr->bits[1];
if (word == 0)
word_num = 0, word = ptr->bits[0];
#else
for (word_num = BITMAP_ELEMENT_WORDS; word_num-- > 0; )
if ((word = ptr->bits[word_num]) != 0)
break;
#endif
/* Binary search for the last set bit. */
bit_num = 0;
#if HOST_BITS_PER_WIDE_INT > 64
#error "Fill out the table."
#endif
#if HOST_BITS_PER_WIDE_INT > 32
if (word & ~ (unsigned HOST_WIDE_INT) 0xffffffff)
word >>= 32, bit_num += 32;
#endif
if (word & 0xffff0000)
word >>= 16, bit_num += 16;
if (word & 0xff00)
word >>= 8, bit_num += 8;
if (word & 0xf0)
word >>= 4, bit_num += 4;
if (word & 0xc)
word >>= 2, bit_num += 2;
if (word & 0x2)
bit_num += 1;
return (ptr->indx * BITMAP_ELEMENT_ALL_BITS
+ word_num * HOST_BITS_PER_WIDE_INT
+ bit_num);
}
/* Store in bitmap TO the result of combining bitmap FROM1 and FROM2 using
a specific bit manipulation. Return true if TO changes. */
int
bitmap_operation (to, from1, from2, operation)
bitmap to;
bitmap from1;
bitmap from2;
enum bitmap_bits operation;
{
#define HIGHEST_INDEX (unsigned int) ~0
bitmap_element *from1_ptr = from1->first;
bitmap_element *from2_ptr = from2->first;
unsigned int indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
unsigned int indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
bitmap_element *to_ptr = to->first;
bitmap_element *from1_tmp;
bitmap_element *from2_tmp;
bitmap_element *to_tmp;
unsigned int indx;
int changed = 0;
#if BITMAP_ELEMENT_WORDS == 2
#define DOIT(OP) \
do { \
unsigned HOST_WIDE_INT t0, t1, f10, f11, f20, f21; \
f10 = from1_tmp->bits[0]; \
f20 = from2_tmp->bits[0]; \
t0 = f10 OP f20; \
changed |= (t0 != to_tmp->bits[0]); \
f11 = from1_tmp->bits[1]; \
f21 = from2_tmp->bits[1]; \
t1 = f11 OP f21; \
changed |= (t1 != to_tmp->bits[1]); \
to_tmp->bits[0] = t0; \
to_tmp->bits[1] = t1; \
} while (0)
#else
#define DOIT(OP) \
do { \
unsigned HOST_WIDE_INT t, f1, f2; \
int i; \
for (i = 0; i < BITMAP_ELEMENT_WORDS; ++i) \
{ \
f1 = from1_tmp->bits[i]; \
f2 = from2_tmp->bits[i]; \
t = f1 OP f2; \
changed |= (t != to_tmp->bits[i]); \
to_tmp->bits[i] = t; \
} \
} while (0)
#endif
to->first = to->current = 0;
while (from1_ptr != 0 || from2_ptr != 0)
{
/* Figure out whether we need to substitute zero elements for
missing links. */
if (indx1 == indx2)
{
indx = indx1;
from1_tmp = from1_ptr;
from2_tmp = from2_ptr;
from1_ptr = from1_ptr->next;
indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
from2_ptr = from2_ptr->next;
indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
}
else if (indx1 < indx2)
{
indx = indx1;
from1_tmp = from1_ptr;
from2_tmp = &bitmap_zero_bits;
from1_ptr = from1_ptr->next;
indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
}
else
{
indx = indx2;
from1_tmp = &bitmap_zero_bits;
from2_tmp = from2_ptr;
from2_ptr = from2_ptr->next;
indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
}
/* Find the appropriate element from TO. Begin by discarding
elements that we've skipped. */
while (to_ptr && to_ptr->indx < indx)
{
changed = 1;
to_tmp = to_ptr;
to_ptr = to_ptr->next;
to_tmp->next = bitmap_free;
bitmap_free = to_tmp;
}
if (to_ptr && to_ptr->indx == indx)
{
to_tmp = to_ptr;
to_ptr = to_ptr->next;
}
else
to_tmp = bitmap_element_allocate ();
/* Do the operation, and if any bits are set, link it into the
linked list. */
switch (operation)
{
default:
abort ();
case BITMAP_AND:
DOIT (&);
break;
case BITMAP_AND_COMPL:
DOIT (&~);
break;
case BITMAP_IOR:
DOIT (|);
break;
case BITMAP_IOR_COMPL:
DOIT (|~);
break;
case BITMAP_XOR:
DOIT (^);
break;
}
if (! bitmap_element_zerop (to_tmp))
{
to_tmp->indx = indx;
bitmap_element_link (to, to_tmp);
}
else
{
to_tmp->next = bitmap_free;
bitmap_free = to_tmp;
}
}
/* If we have elements of TO left over, free the lot. */
if (to_ptr)
{
changed = 1;
for (to_tmp = to_ptr; to_tmp->next ; to_tmp = to_tmp->next)
continue;
to_tmp->next = bitmap_free;
bitmap_free = to_ptr;
}
#undef DOIT
return changed;
}
/* Return true if two bitmaps are identical. */
int
bitmap_equal_p (a, b)
bitmap a;
bitmap b;
{
bitmap_head c;
int ret;
c.first = c.current = 0;
ret = ! bitmap_operation (&c, a, b, BITMAP_XOR);
bitmap_clear (&c);
return ret;
}
/* Or into bitmap TO bitmap FROM1 and'ed with the complement of
bitmap FROM2. */
void
bitmap_ior_and_compl (to, from1, from2)
bitmap to;
bitmap from1;
bitmap from2;
{
bitmap_head tmp;
tmp.first = tmp.current = 0;
bitmap_operation (&tmp, from1, from2, BITMAP_AND_COMPL);
bitmap_operation (to, to, &tmp, BITMAP_IOR);
bitmap_clear (&tmp);
}
int
bitmap_union_of_diff (dst, a, b, c)
bitmap dst;
bitmap a;
bitmap b;
bitmap c;
{
bitmap_head tmp;
int changed;
tmp.first = tmp.current = 0;
bitmap_operation (&tmp, b, c, BITMAP_AND_COMPL);
changed = bitmap_operation (dst, &tmp, a, BITMAP_IOR);
bitmap_clear (&tmp);
return changed;
}
/* Initialize a bitmap header. */
bitmap
bitmap_initialize (head)
bitmap head;
{
head->first = head->current = 0;
return head;
}
/* Debugging function to print out the contents of a bitmap. */
void
debug_bitmap_file (file, head)
FILE *file;
bitmap head;
{
bitmap_element *ptr;
fprintf (file, "\nfirst = ");
fprintf (file, HOST_PTR_PRINTF, (PTR) head->first);
fprintf (file, " current = ");
fprintf (file, HOST_PTR_PRINTF, (PTR) head->current);
fprintf (file, " indx = %u\n", head->indx);
for (ptr = head->first; ptr; ptr = ptr->next)
{
int i, j, col = 26;
fprintf (file, "\t");
fprintf (file, HOST_PTR_PRINTF, (PTR) ptr);
fprintf (file, " next = ");
fprintf (file, HOST_PTR_PRINTF, (PTR) ptr->next);
fprintf (file, " prev = ");
fprintf (file, HOST_PTR_PRINTF, (PTR) ptr->prev);
fprintf (file, " indx = %u\n\t\tbits = {", ptr->indx);
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
for (j = 0; j < HOST_BITS_PER_WIDE_INT; j++)
if ((ptr->bits[i] >> j) & 1)
{
if (col > 70)
{
fprintf (file, "\n\t\t\t");
col = 24;
}
fprintf (file, " %u", (ptr->indx * BITMAP_ELEMENT_ALL_BITS
+ i * HOST_BITS_PER_WIDE_INT + j));
col += 4;
}
fprintf (file, " }\n");
}
}
/* Function to be called from the debugger to print the contents
of a bitmap. */
void
debug_bitmap (head)
bitmap head;
{
debug_bitmap_file (stdout, head);
}
/* Function to print out the contents of a bitmap. Unlike debug_bitmap_file,
it does not print anything but the bits. */
void
bitmap_print (file, head, prefix, suffix)
FILE *file;
bitmap head;
const char *prefix;
const char *suffix;
{
const char *comma = "";
int i;
fputs (prefix, file);
EXECUTE_IF_SET_IN_BITMAP (head, 0, i,
{
fprintf (file, "%s%d", comma, i);
comma = ", ";
});
fputs (suffix, file);
}
| 23.027261 | 78 | 0.632029 |
ad1b25cf6e507c8780044cd15bbc3cd7e4774d75 | 10,605 | h | C | include/box2d/b2_intrusive_list.h | LaudateCorpus1/box2d-optimized | 505bb43175e6126d13dba398c2cc5d618c818f89 | [
"MIT"
] | null | null | null | include/box2d/b2_intrusive_list.h | LaudateCorpus1/box2d-optimized | 505bb43175e6126d13dba398c2cc5d618c818f89 | [
"MIT"
] | null | null | null | include/box2d/b2_intrusive_list.h | LaudateCorpus1/box2d-optimized | 505bb43175e6126d13dba398c2cc5d618c818f89 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2014 Google, Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef B2_INTRUSIVE_LIST
#define B2_INTRUSIVE_LIST
#include "box2d/b2_settings.h"
// Whether to enable b2IntrusiveList::ValidateList().
// Be careful when enabling this since this changes the size of
// b2IntrusiveListNode so make sure *all* projects that include Box2D.h
// also define this value in the same way to avoid data corruption.
#ifndef B2_INTRUSIVE_LIST_VALIDATE
#define B2_INTRUSIVE_LIST_VALIDATE 0
#endif // B2_INTRUSIVE_LIST_VALIDATE
/// b2IntrusiveListNode is used to implement an intrusive doubly-linked
/// list.
///
/// For example:
///
/// class MyClass {
/// public:
/// MyClass(const char *msg) : m_msg(msg) {}
/// const char* GetMessage() const { return m_msg; }
/// B2_INTRUSIVE_LIST_GET_NODE(m_node);
/// B2_INTRUSIVE_LIST_NODE_GET_CLASS(MyClass, m_node);
/// private:
/// b2IntrusiveListNode m_node;
/// const char *m_msg;
/// };
///
/// int main(int argc, char *argv[]) {
/// b2IntrusiveListNode list; // NOTE: type is NOT MyClass
/// MyClass a("this");
/// MyClass b("is");
/// MyClass c("a");
/// MyClass d("test");
/// list.InsertBefore(a.GetListNode());
/// list.InsertBefore(b.GetListNode());
/// list.InsertBefore(c.GetListNode());
/// list.InsertBefore(d.GetListNode());
/// for (b2IntrusiveListNode* node = list.GetNext();
/// node != list.GetTerminator(); node = node->GetNext()) {
/// MyClass *cls = MyClass::GetInstanceFromListNode(node);
/// printf("%s\n", cls->GetMessage());
/// }
/// return 0;
/// }
class b2IntrusiveListNode
{
public:
/// Initialize the node.
b2IntrusiveListNode()
{
Initialize();
#if B2_INTRUSIVE_LIST_VALIDATE
m_magic = k_magic;
#endif // B2_INTRUSIVE_LIST_VALIDATE
}
/// If the node is in a list, remove it from the list.
~b2IntrusiveListNode()
{
Remove();
#if B2_INTRUSIVE_LIST_VALIDATE
m_magic = 0;
#endif // B2_INTRUSIVE_LIST_VALIDATE
}
/// Insert this node after the specified node.
void InsertAfter(b2IntrusiveListNode* const node)
{
b2Assert(!node->InList());
node->m_next = m_next;
node->m_prev = this;
m_next->m_prev = node;
m_next = node;
}
/// Insert this node before the specified node.
void InsertBefore(b2IntrusiveListNode* const node)
{
b2Assert(!node->InList());
node->m_next = this;
node->m_prev = m_prev;
m_prev->m_next = node;
m_prev = node;
}
/// Get the terminator of the list.
const b2IntrusiveListNode* GetTerminator() const
{
return this;
}
/// Remove this node from the list it's currently in.
b2IntrusiveListNode* Remove()
{
m_prev->m_next = m_next;
m_next->m_prev = m_prev;
Initialize();
return this;
}
/// Determine whether this list is empty or the node isn't in a list.
bool IsEmpty() const
{
return GetNext() == this;
}
/// Determine whether this node is in a list or the list contains nodes.
bool InList() const
{
return !IsEmpty();
}
/// Calculate the length of the list.
uint32 GetLength() const
{
uint32 length = 0;
const b2IntrusiveListNode * const terminator = GetTerminator();
for (const b2IntrusiveListNode* node = GetNext();
node != terminator; node = node->GetNext())
{
length++;
}
return length;
}
/// Get the next node in the list.
b2IntrusiveListNode* GetNext() const
{
return m_next;
}
/// Get the previous node in the list.
b2IntrusiveListNode* GetPrevious() const
{
return m_prev;
}
/// If B2_INTRUSIVE_LIST_VALIDATE is 1 perform a very rough validation
/// of all nodes in the list.
bool ValidateList() const
{
#if B2_INTRUSIVE_LIST_VALIDATE
if (m_magic != k_magic) return false;
const b2IntrusiveListNode * const terminator = GetTerminator();
for (b2IntrusiveListNode *node = GetNext(); node != terminator;
node = node->GetNext()) {
if (node->m_magic != k_magic) return false;
}
#endif // B2_INTRUSIVE_LIST_VALIDATE
return true;
}
/// Determine whether the specified node is present in this list.
bool FindNodeInList(b2IntrusiveListNode* const nodeToFind) const
{
const b2IntrusiveListNode * const terminator = GetTerminator();
for (b2IntrusiveListNode *node = GetNext(); node != terminator;
node = node->GetNext())
{
if (nodeToFind == node) return true;
}
return false;
}
private:
/// Initialize the list node.
void Initialize()
{
m_next = this;
m_prev = this;
}
private:
#if B2_INTRUSIVE_LIST_VALIDATE
uint32 m_magic;
#endif // B2_INTRUSIVE_LIST_VALIDATE
/// The next node in the list.
b2IntrusiveListNode *m_prev;
/// The previous node in the list.
b2IntrusiveListNode *m_next;
private:
#if B2_INTRUSIVE_LIST_VALIDATE
static const uint32 k_magic = 0x7157ac01;
#endif // B2_INTRUSIVE_LIST_VALIDATE
};
/// Declares the member function GetListNode() of Class to retrieve a pointer
/// to NodeMemberName.
/// See #B2_INTRUSIVE_LIST_NODE_GET_CLASS_ACCESSOR()
#define B2_INTRUSIVE_LIST_GET_NODE(NodeMemberName) \
b2IntrusiveListNode* GetListNode() { return &NodeMemberName; } \
const b2IntrusiveListNode* GetListNode() const { return &NodeMemberName; }
/// Declares the member function FunctionName of Class to retrieve a pointer
/// to a Class instance from a list node pointer. NodeMemberName references
/// the name of the b2IntrusiveListNode member of Class.
#define B2_INTRUSIVE_LIST_NODE_GET_CLASS_ACCESSOR( \
Class, NodeMemberName, FunctionName) \
static Class* FunctionName(b2IntrusiveListNode *node) \
{ \
Class *cls = NULL; \
/* This effectively performs offsetof(Class, NodeMemberName) */ \
/* which ends up in the undefined behavior realm of C++ but in */ \
/* practice this works with most compilers. */ \
return reinterpret_cast<Class*>((uint8*)(node) - \
(uint8*)(&cls->NodeMemberName)); \
} \
\
static const Class* FunctionName(const b2IntrusiveListNode *node) \
{ \
return FunctionName(const_cast<b2IntrusiveListNode*>(node)); \
}
/// Declares the member function GetInstanceFromListNode() of Class to retrieve
/// a pointer to a Class instance from a list node pointer. NodeMemberName
/// reference the name of the b2IntrusiveListNode member of Class.
#define B2_INTRUSIVE_LIST_NODE_GET_CLASS(Class, NodeMemberName) \
B2_INTRUSIVE_LIST_NODE_GET_CLASS_ACCESSOR(Class, NodeMemberName, \
GetInstanceFromListNode)
/// b2TypedIntrusiveListNode which supports inserting an object into a single
/// doubly linked list. For objects that need to be inserted in multiple
/// doubly linked lists, use b2IntrusiveListNode.
///
/// For example:
///
/// class IntegerItem : public b2TypedIntrusiveListNode<IntegerItem>
/// {
/// public:
/// IntegerItem(int32 value) : m_value(value) { }
/// ~IntegerItem() { }
/// int32 GetValue() const { return m_value; }
/// private:
/// int32 m_value;
/// };
///
/// int main(int argc, const char *arvg[]) {
/// b2TypedIntrusiveListNode<IntegerItem> list;
/// IntegerItem a(1);
/// IntegerItem b(2);
/// IntegerItem c(3);
/// list.InsertBefore(&a);
/// list.InsertBefore(&b);
/// list.InsertBefore(&c);
/// for (IntegerItem* item = list.GetNext();
/// item != list.GetTerminator(); item = item->GetNext())
/// {
/// printf("%d\n", item->GetValue());
/// }
/// }
template<typename T>
class b2TypedIntrusiveListNode
{
public:
b2TypedIntrusiveListNode() { }
~b2TypedIntrusiveListNode() { }
/// Insert this object after the specified object.
void InsertAfter(T* const obj)
{
b2Assert(obj);
GetListNode()->InsertAfter(obj->GetListNode());
}
/// Insert this object before the specified object.
void InsertBefore(T* const obj)
{
b2Assert(obj);
GetListNode()->InsertBefore(obj->GetListNode());
}
/// Get the next object in the list.
/// Check against GetTerminator() before deferencing the object.
T* GetNext() const
{
return GetInstanceFromListNode(GetListNode()->GetNext());
}
/// Get the previous object in the list.
/// Check against GetTerminator() before deferencing the object.
T* GetPrevious() const
{
return GetInstanceFromListNode(GetListNode()->GetPrevious());
}
/// Get the terminator of the list.
/// This should not be dereferenced as it is a pointer to
/// b2TypedIntrusiveListNode<T> *not* T.
T* GetTerminator() const
{
return (T*)GetListNode();
}
/// Remove this object from the list it's currently in.
T* Remove()
{
GetListNode()->Remove();
return GetInstanceFromListNode(GetListNode());
}
/// Determine whether this object is in a list.
bool InList() const
{
return GetListNode()->InList();
}
// Determine whether this list is empty.
bool IsEmpty() const
{
return GetListNode()->IsEmpty();
}
/// Calculate the length of the list.
uint32 GetLength() const
{
return GetListNode()->GetLength();
}
B2_INTRUSIVE_LIST_GET_NODE(m_node);
private:
// Node within an intrusive list.
b2IntrusiveListNode m_node;
public:
/// Get a pointer to the instance of T that contains "node".
static T* GetInstanceFromListNode(b2IntrusiveListNode* const node)
{
b2Assert(node);
// Calculate the pointer to T from the offset.
return (T*)((uint8*)node - GetNodeOffset(node));
}
private:
// Get the offset of m_node within this class.
static int32 GetNodeOffset(b2IntrusiveListNode* const node)
{
b2Assert(node);
// Perform some type punning to calculate the offset of m_node in T.
// WARNING: This could result in undefined behavior with some C++
// compilers.
T* obj = (T*)node;
int32 nodeOffset = (int32)((uint8*)&obj->m_node - (uint8*)obj);
return nodeOffset;
}
};
#endif // B2_INTRUSIVE_LIST
| 28.662162 | 79 | 0.688826 |
a82795dc13c5ba9c213671f06aa879277b23f48a | 14,667 | h | C | pow_accel_soc/software/u-boot-socfpga/board/ti/omap5_evm/mux_data.h | ajblane/iota_fpga | 2ec78e89bf263a84905aba92437da5ec091ab621 | [
"MIT"
] | 13 | 2018-05-24T07:02:26.000Z | 2021-04-13T12:48:24.000Z | pow_accel_soc/software/u-boot-socfpga/board/ti/omap5_evm/mux_data.h | ajblane/iota_fpga | 2ec78e89bf263a84905aba92437da5ec091ab621 | [
"MIT"
] | null | null | null | pow_accel_soc/software/u-boot-socfpga/board/ti/omap5_evm/mux_data.h | ajblane/iota_fpga | 2ec78e89bf263a84905aba92437da5ec091ab621 | [
"MIT"
] | 14 | 2018-05-08T23:40:47.000Z | 2022-02-12T00:12:06.000Z | /*
* (C) Copyright 2010
* Texas Instruments Incorporated, <www.ti.com>
*
* Sricharan R <r.sricharan@ti.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
*/
#ifndef _EVM5430_MUX_DATA_H
#define _EVM5430_MUX_DATA_H
#include <asm/arch/mux_omap5.h>
const struct pad_conf_entry core_padconf_array_essential[] = {
{EMMC_CLK, (PTU | IEN | M0)}, /* EMMC_CLK */
{EMMC_CMD, (PTU | IEN | M0)}, /* EMMC_CMD */
{EMMC_DATA0, (PTU | IEN | M0)}, /* EMMC_DATA0 */
{EMMC_DATA1, (PTU | IEN | M0)}, /* EMMC_DATA1 */
{EMMC_DATA2, (PTU | IEN | M0)}, /* EMMC_DATA2 */
{EMMC_DATA3, (PTU | IEN | M0)}, /* EMMC_DATA3 */
{EMMC_DATA4, (PTU | IEN | M0)}, /* EMMC_DATA4 */
{EMMC_DATA5, (PTU | IEN | M0)}, /* EMMC_DATA5 */
{EMMC_DATA6, (PTU | IEN | M0)}, /* EMMC_DATA6 */
{EMMC_DATA7, (PTU | IEN | M0)}, /* EMMC_DATA7 */
{SDCARD_CLK, (PTU | IEN | M0)}, /* SDCARD_CLK */
{SDCARD_CMD, (PTU | IEN | M0)}, /* SDCARD_CMD */
{SDCARD_DATA0, (PTU | IEN | M0)}, /* SDCARD_DATA0*/
{SDCARD_DATA1, (PTU | IEN | M0)}, /* SDCARD_DATA1*/
{SDCARD_DATA2, (PTU | IEN | M0)}, /* SDCARD_DATA2*/
{SDCARD_DATA3, (PTU | IEN | M0)}, /* SDCARD_DATA3*/
{UART3_RX_IRRX, (PTU | IEN | M0)}, /* UART3_RX_IRRX */
{UART3_TX_IRTX, (M0)}, /* UART3_TX_IRTX */
{USBB1_HSIC_STROBE, (PTU | IEN | M0)}, /* USBB1_HSIC_STROBE */
{USBB1_HSIC_DATA, (PTU | IEN | M0)}, /* USBB1_HSIC_DATA */
{USBB2_HSIC_STROBE, (PTU | IEN | M0)}, /* USBB2_HSIC_STROBE */
{USBB2_HSIC_DATA, (PTU | IEN | M0)}, /* USBB2_HSIC_DATA */
{USBB3_HSIC_STROBE, (PTU | IEN | M0)}, /* USBB3_HSIC_STROBE*/
{USBB3_HSIC_DATA, (PTU | IEN | M0)}, /* USBB3_HSIC_DATA */
{USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */
{USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */
{USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */
};
const struct pad_conf_entry wkup_padconf_array_essential[] = {
{SR_PMIC_SCL, (PTU | IEN | M0)}, /* SR_PMIC_SCL */
{SR_PMIC_SDA, (PTU | IEN | M0)}, /* SR_PMIC_SDA */
{SYS_32K, (IEN | M0)}, /* SYS_32K */
};
const struct pad_conf_entry core_padconf_array_non_essential[] = {
{C2C_DATAIN0, (IEN | M0)}, /* C2C_DATAIN0 */
{C2C_DATAIN1, (IEN | M0)}, /* C2C_DATAIN1 */
{C2C_DATAIN2, (IEN | M0)}, /* C2C_DATAIN2 */
{C2C_DATAIN3, (IEN | M0)}, /* C2C_DATAIN3 */
{C2C_DATAIN4, (IEN | M0)}, /* C2C_DATAIN4 */
{C2C_DATAIN5, (IEN | M0)}, /* C2C_DATAIN5 */
{C2C_DATAIN6, (IEN | M0)}, /* C2C_DATAIN6 */
{C2C_DATAIN7, (IEN | M0)}, /* C2C_DATAIN7 */
{C2C_CLKIN1, (IEN | M0)}, /* C2C_CLKIN1 */
{C2C_CLKIN0, (IEN | M0)}, /* C2C_CLKIN0 */
{C2C_CLKOUT0, (M0)}, /* C2C_CLKOUT0 */
{C2C_CLKOUT1, (M0)}, /* C2C_CLKOUT1 */
{C2C_DATAOUT0, (M0)}, /* C2C_DATAOUT0 */
{C2C_DATAOUT1, (M0)}, /* C2C_DATAOUT1 */
{C2C_DATAOUT2, (M0)}, /* C2C_DATAOUT2 */
{C2C_DATAOUT3, (M0)}, /* C2C_DATAOUT3 */
{C2C_DATAOUT4, (M0)}, /* C2C_DATAOUT4 */
{C2C_DATAOUT5, (M0)}, /* C2C_DATAOUT5 */
{C2C_DATAOUT6, (M0)}, /* C2C_DATAOUT6 */
{C2C_DATAOUT7, (M0)}, /* C2C_DATAOUT7 */
{C2C_DATA8, (IEN | M0)}, /* C2C_DATA8 */
{C2C_DATA9, (IEN | M0)}, /* C2C_DATA9 */
{C2C_DATA10, (IEN | M0)}, /* C2C_DATA10 */
{C2C_DATA11, (IEN | M0)}, /* C2C_DATA11 */
{C2C_DATA12, (IEN | M0)}, /* C2C_DATA12 */
{C2C_DATA13, (IEN | M0)}, /* C2C_DATA13 */
{C2C_DATA14, (IEN | M0)}, /* C2C_DATA14 */
{C2C_DATA15, (IEN | M0)}, /* C2C_DATA15 */
{LLIB_WAKEREQOUT, (PTU | IEN | M6)}, /* GPIO2_32 */
{LLIA_WAKEREQOUT, (M1)}, /* C2C_WAKEREQOUT */
{HSI1_ACREADY, (PTD | M6)}, /* GPIO3_64 */
{HSI1_CAREADY, (PTD | M6)}, /* GPIO3_65 */
{HSI1_ACWAKE, (PTD | IEN | M6)}, /* GPIO3_66 */
{HSI1_CAWAKE, (PTU | IEN | M6)}, /* GPIO3_67 */
{HSI1_ACFLAG, (PTD | IEN | M6)}, /* GPIO3_68 */
{HSI1_ACDATA, (PTD | M6)}, /* GPIO3_69 */
{HSI1_CAFLAG, (M6)}, /* GPIO3_70 */
{HSI1_CADATA, (M6)}, /* GPIO3_71 */
{UART1_TX, (M0)}, /* UART1_TX */
{UART1_CTS, (PTU | IEN | M0)}, /* UART1_CTS */
{UART1_RX, (PTU | IEN | M0)}, /* UART1_RX */
{UART1_RTS, (M0)}, /* UART1_RTS */
{HSI2_CAREADY, (IEN | M0)}, /* HSI2_CAREADY */
{HSI2_ACREADY, (OFF_EN | M0)}, /* HSI2_ACREADY */
{HSI2_CAWAKE, (IEN | PTD | M0)}, /* HSI2_CAWAKE */
{HSI2_ACWAKE, (M0)}, /* HSI2_ACWAKE */
{HSI2_CAFLAG, (IEN | PTD | M0)}, /* HSI2_CAFLAG */
{HSI2_CADATA, (IEN | PTD | M0)}, /* HSI2_CADATA */
{HSI2_ACFLAG, (M0)}, /* HSI2_ACFLAG */
{HSI2_ACDATA, (M0)}, /* HSI2_ACDATA */
{UART2_RTS, (IEN | M1)}, /* MCSPI3_SOMI */
{UART2_CTS, (IEN | M1)}, /* MCSPI3_CS0 */
{UART2_RX, (IEN | M1)}, /* MCSPI3_SIMO */
{UART2_TX, (IEN | M1)}, /* MCSPI3_CLK */
{TIMER10_PWM_EVT, (IEN | M0)}, /* TIMER10_PWM_EVT */
{DSIPORTA_TE0, (IEN | M0)}, /* DSIPORTA_TE0 */
{DSIPORTA_LANE0X, (IEN | M0)}, /* DSIPORTA_LANE0X */
{DSIPORTA_LANE0Y, (IEN | M0)}, /* DSIPORTA_LANE0Y */
{DSIPORTA_LANE1X, (IEN | M0)}, /* DSIPORTA_LANE1X */
{DSIPORTA_LANE1Y, (IEN | M0)}, /* DSIPORTA_LANE1Y */
{DSIPORTA_LANE2X, (IEN | M0)}, /* DSIPORTA_LANE2X */
{DSIPORTA_LANE2Y, (IEN | M0)}, /* DSIPORTA_LANE2Y */
{DSIPORTA_LANE3X, (IEN | M0)}, /* DSIPORTA_LANE3X */
{DSIPORTA_LANE3Y, (IEN | M0)}, /* DSIPORTA_LANE3Y */
{DSIPORTA_LANE4X, (IEN | M0)}, /* DSIPORTA_LANE4X */
{DSIPORTA_LANE4Y, (IEN | M0)}, /* DSIPORTA_LANE4Y */
{TIMER9_PWM_EVT, (IEN | M0)}, /* TIMER9_PWM_EVT */
{DSIPORTC_TE0, (IEN | M0)}, /* DSIPORTC_TE0 */
{DSIPORTC_LANE0X, (IEN | M0)}, /* DSIPORTC_LANE0X */
{DSIPORTC_LANE0Y, (IEN | M0)}, /* DSIPORTC_LANE0Y */
{DSIPORTC_LANE1X, (IEN | M0)}, /* DSIPORTC_LANE1X */
{DSIPORTC_LANE1Y, (IEN | M0)}, /* DSIPORTC_LANE1Y */
{DSIPORTC_LANE2X, (IEN | M0)}, /* DSIPORTC_LANE2X */
{DSIPORTC_LANE2Y, (IEN | M0)}, /* DSIPORTC_LANE2Y */
{DSIPORTC_LANE3X, (IEN | M0)}, /* DSIPORTC_LANE3X */
{DSIPORTC_LANE3Y, (IEN | M0)}, /* DSIPORTC_LANE3Y */
{DSIPORTC_LANE4X, (IEN | M0)}, /* DSIPORTC_LANE4X */
{DSIPORTC_LANE4Y, (IEN | M0)}, /* DSIPORTC_LANE4Y */
{RFBI_HSYNC0, (M4)}, /* KBD_COL5 */
{RFBI_TE_VSYNC0, (PTD | M6)}, /* GPIO6_161 */
{RFBI_RE, (M4)}, /* KBD_COL4 */
{RFBI_A0, (PTD | IEN | M6)}, /* GPIO6_165 */
{RFBI_DATA8, (M4)}, /* KBD_COL3 */
{RFBI_DATA9, (PTD | M6)}, /* GPIO6_175 */
{RFBI_DATA10, (PTD | M6)}, /* GPIO6_176 */
{RFBI_DATA11, (PTD | M6)}, /* GPIO6_177 */
{RFBI_DATA12, (PTD | M6)}, /* GPIO6_178 */
{RFBI_DATA13, (PTU | IEN | M6)}, /* GPIO6_179 */
{RFBI_DATA14, (M4)}, /* KBD_COL7 */
{RFBI_DATA15, (M4)}, /* KBD_COL6 */
{GPIO6_182, (M6)}, /* GPIO6_182 */
{GPIO6_183, (PTD | M6)}, /* GPIO6_183 */
{GPIO6_184, (M4)}, /* KBD_COL2 */
{GPIO6_185, (PTD | IEN | M6)}, /* GPIO6_185 */
{GPIO6_186, (PTD | M6)}, /* GPIO6_186 */
{GPIO6_187, (PTU | IEN | M4)}, /* KBD_ROW2 */
{RFBI_DATA0, (PTD | M6)}, /* GPIO6_166 */
{RFBI_DATA1, (PTD | M6)}, /* GPIO6_167 */
{RFBI_DATA2, (PTD | M6)}, /* GPIO6_168 */
{RFBI_DATA3, (PTD | IEN | M6)}, /* GPIO6_169 */
{RFBI_DATA4, (IEN | M6)}, /* GPIO6_170 */
{RFBI_DATA5, (IEN | M6)}, /* GPIO6_171 */
{RFBI_DATA6, (PTD | M6)}, /* GPIO6_172 */
{RFBI_DATA7, (PTD | M6)}, /* GPIO6_173 */
{RFBI_CS0, (PTD | IEN | M6)}, /* GPIO6_163 */
{RFBI_WE, (PTD | M6)}, /* GPIO6_162 */
{MCSPI2_CS0, (M0)}, /* MCSPI2_CS0 */
{MCSPI2_CLK, (IEN | M0)}, /* MCSPI2_CLK */
{MCSPI2_SIMO, (IEN | M0)}, /* MCSPI2_SIMO*/
{MCSPI2_SOMI, (PTU | IEN | M0)}, /* MCSPI2_SOMI*/
{I2C4_SCL, (IEN | M0)}, /* I2C4_SCL */
{I2C4_SDA, (IEN | M0)}, /* I2C4_SDA */
{HDMI_CEC, (IEN | M0)}, /* HDMI_CEC */
{HDMI_HPD, (PTD | IEN | M0)}, /* HDMI_HPD */
{HDMI_DDC_SCL, (IEN | M0)}, /* HDMI_DDC_SCL */
{HDMI_DDC_SDA, (IEN | M0)}, /* HDMI_DDC_SDA */
{CSIPORTA_LANE0X, (IEN | M0)}, /* CSIPORTA_LANE0X */
{CSIPORTA_LANE0Y, (IEN | M0)}, /* CSIPORTA_LANE0Y */
{CSIPORTA_LANE1Y, (IEN | M0)}, /* CSIPORTA_LANE1Y */
{CSIPORTA_LANE1X, (IEN | M0)}, /* CSIPORTA_LANE1X */
{CSIPORTA_LANE2Y, (IEN | M0)}, /* CSIPORTA_LANE2Y */
{CSIPORTA_LANE2X, (IEN | M0)}, /* CSIPORTA_LANE2X */
{CSIPORTA_LANE3X, (IEN | M0)}, /* CSIPORTA_LANE3X */
{CSIPORTA_LANE3Y, (IEN | M0)}, /* CSIPORTA_LANE3Y */
{CSIPORTA_LANE4X, (IEN | M0)}, /* CSIPORTA_LANE4X */
{CSIPORTA_LANE4Y, (IEN | M0)}, /* CSIPORTA_LANE4Y */
{CSIPORTB_LANE0X, (IEN | M0)}, /* CSIPORTB_LANE0X */
{CSIPORTB_LANE0Y, (IEN | M0)}, /* CSIPORTB_LANE0Y */
{CSIPORTB_LANE1Y, (IEN | M0)}, /* CSIPORTB_LANE1Y */
{CSIPORTB_LANE1X, (IEN | M0)}, /* CSIPORTB_LANE1X */
{CSIPORTB_LANE2Y, (IEN | M0)}, /* CSIPORTB_LANE2Y */
{CSIPORTB_LANE2X, (IEN | M0)}, /* CSIPORTB_LANE2X */
{CSIPORTC_LANE0Y, (IEN | M0)}, /* CSIPORTC_LANE0Y */
{CSIPORTC_LANE0X, (IEN | M0)}, /* CSIPORTC_LANE0X */
{CSIPORTC_LANE1Y, (IEN | M0)}, /* CSIPORTC_LANE1Y */
{CSIPORTC_LANE1X, (IEN | M0)}, /* CSIPORTC_LANE1X */
{CAM_SHUTTER, (M0)}, /* CAM_SHUTTER */
{CAM_STROBE, (M0)}, /* CAM_STROBE */
{CAM_GLOBALRESET, (IEN | M0)}, /* CAM_GLOBALRESET */
{TIMER11_PWM_EVT, (PTD | M6)}, /* GPIO8_227 */
{TIMER5_PWM_EVT, (PTD | M6)}, /* GPIO8_228 */
{TIMER6_PWM_EVT, (PTD | M6)}, /* GPIO8_229 */
{TIMER8_PWM_EVT, (PTU | M6)}, /* GPIO8_230 */
{I2C3_SCL, (IEN | M0)}, /* I2C3_SCL */
{I2C3_SDA, (IEN | M0)}, /* I2C3_SDA */
{GPIO8_233, (IEN | M2)}, /* TIMER8_PWM_EVT */
{ABE_CLKS, (IEN | M0)}, /* ABE_CLKS */
{ABEDMIC_DIN1, (IEN | M0)}, /* ABEDMIC_DIN1 */
{ABEDMIC_DIN2, (IEN | M0)}, /* ABEDMIC_DIN2 */
{ABEDMIC_DIN3, (IEN | M0)}, /* ABEDMIC_DIN3 */
{ABEDMIC_CLK1, (M0)}, /* ABEDMIC_CLK1 */
{ABEDMIC_CLK2, (IEN | M1)}, /* ABEMCBSP1_FSX */
{ABEDMIC_CLK3, (M1)}, /* ABEMCBSP1_DX */
{ABESLIMBUS1_CLOCK, (IEN | M1)}, /* ABEMCBSP1_CLKX */
{ABESLIMBUS1_DATA, (IEN | M1)}, /* ABEMCBSP1_DR */
{ABEMCBSP2_DR, (IEN | M0)}, /* ABEMCBSP2_DR */
{ABEMCBSP2_DX, (M0)}, /* ABEMCBSP2_DX */
{ABEMCBSP2_FSX, (IEN | M0)}, /* ABEMCBSP2_FSX */
{ABEMCBSP2_CLKX, (IEN | M0)}, /* ABEMCBSP2_CLKX */
{ABEMCPDM_UL_DATA, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* ABEMCPDM_UL_DATA */
{ABEMCPDM_DL_DATA, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* ABEMCPDM_DL_DATA */
{ABEMCPDM_FRAME, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* ABEMCPDM_FRAME */
{ABEMCPDM_LB_CLK, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* ABEMCPDM_LB_CLK */
{WLSDIO_CLK, (PTU | IEN | M0)}, /* WLSDIO_CLK */
{WLSDIO_CMD, (PTU | IEN | M0)}, /* WLSDIO_CMD */
{WLSDIO_DATA0, (PTU | IEN | M0)}, /* WLSDIO_DATA0*/
{WLSDIO_DATA1, (PTU | IEN | M0)}, /* WLSDIO_DATA1*/
{WLSDIO_DATA2, (PTU | IEN | M0)}, /* WLSDIO_DATA2*/
{WLSDIO_DATA3, (PTU | IEN | M0)}, /* WLSDIO_DATA3*/
{UART5_RX, (PTU | IEN | M0)}, /* UART5_RX */
{UART5_TX, (M0)}, /* UART5_TX */
{UART5_CTS, (PTU | IEN | M0)}, /* UART5_CTS */
{UART5_RTS, (M0)}, /* UART5_RTS */
{I2C2_SCL, (IEN | M0)}, /* I2C2_SCL */
{I2C2_SDA, (IEN | M0)}, /* I2C2_SDA */
{MCSPI1_CLK, (M6)}, /* GPIO5_140 */
{MCSPI1_SOMI, (IEN | M6)}, /* GPIO5_141 */
{MCSPI1_SIMO, (PTD | M6)}, /* GPIO5_142 */
{MCSPI1_CS0, (PTD | M6)}, /* GPIO5_143 */
{MCSPI1_CS1, (PTD | IEN | M6)}, /* GPIO5_144 */
{I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */
{I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */
{PERSLIMBUS2_CLOCK, (PTD | M6)}, /* GPIO5_145 */
{PERSLIMBUS2_DATA, (PTD | IEN | M6)}, /* GPIO5_146 */
{UART6_TX, (PTU | IEN | M6)}, /* GPIO5_149 */
{UART6_RX, (PTU | IEN | M6)}, /* GPIO5_150 */
{UART6_CTS, (PTU | IEN | M6)}, /* GPIO5_151 */
{UART6_RTS, (PTU | M0)}, /* UART6_RTS */
{UART3_CTS_RCTX, (PTU | IEN | M6)}, /* GPIO5_153 */
{UART3_RTS_IRSD, (PTU | IEN | M1)}, /* HDQ_SIO */
{I2C1_PMIC_SCL, (PTU | IEN | M0)}, /* I2C1_PMIC_SCL */
{I2C1_PMIC_SDA, (PTU | IEN | M0)}, /* I2C1_PMIC_SDA */
};
const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
/*
* This pad keeps C2C Module always enabled.
* Putting this in safe mode do not cause the issue.
* C2C driver could enable this mux setting if needed.
*/
{LLIA_WAKEREQIN, (M7)}, /* SAFE MODE */
{LLIB_WAKEREQIN, (M7)}, /* SAFE MODE */
{DRM_EMU0, (PTU | IEN | M0)}, /* DRM_EMU0 */
{DRM_EMU1, (PTU | IEN | M0)}, /* DRM_EMU1 */
{JTAG_NTRST, (IEN | M0)}, /* JTAG_NTRST */
{JTAG_TCK, (IEN | M0)}, /* JTAG_TCK */
{JTAG_RTCK, (M0)}, /* JTAG_RTCK */
{JTAG_TMSC, (IEN | M0)}, /* JTAG_TMSC */
{JTAG_TDI, (IEN | M0)}, /* JTAG_TDI */
{JTAG_TDO, (M0)}, /* JTAG_TDO */
{FREF_CLK_IOREQ, (IEN | M0)}, /* FREF_CLK_IOREQ */
{FREF_CLK0_OUT, (M0)}, /* FREF_CLK0_OUT */
{FREF_CLK1_OUT, (M0)}, /* FREF_CLK1_OUT */
{FREF_CLK2_OUT, (M0)}, /* FREF_CLK2_OUT */
{FREF_CLK2_REQ, (PTU | IEN | M6)}, /* GPIO1_WK9 */
{FREF_CLK1_REQ, (PTD | IEN | M6)}, /* GPIO1_WK8 */
{SYS_NRESPWRON, (IEN | M0)}, /* SYS_NRESPWRON */
{SYS_NRESWARM, (PTU | IEN | M0)}, /* SYS_NRESWARM */
{SYS_PWR_REQ, (M0)}, /* SYS_PWR_REQ */
{SYS_NIRQ1, (PTU | IEN | M0)}, /* SYS_NIRQ1 */
{SYS_NIRQ2, (PTU | IEN | M0)}, /* SYS_NIRQ2 */
{SYS_BOOT0, (IEN | M0)}, /* SYS_BOOT0 */
{SYS_BOOT1, (IEN | M0)}, /* SYS_BOOT1 */
{SYS_BOOT2, (IEN | M0)}, /* SYS_BOOT2 */
{SYS_BOOT3, (IEN | M0)}, /* SYS_BOOT3 */
{SYS_BOOT4, (IEN | M0)}, /* SYS_BOOT4 */
{SYS_BOOT5, (IEN | M0)}, /* SYS_BOOT5 */
};
#endif /* _EVM4430_MUX_DATA_H */
| 48.088525 | 92 | 0.555669 |
35cd371fc33043d59db6d39ae5f06cd75d27c3a7 | 2,700 | c | C | utl/utl_rng.c | nayuta-gondo/ptarmigan | 1522799fb3dec4df690bcfd827acb1809ceb1d62 | [
"Apache-2.0"
] | null | null | null | utl/utl_rng.c | nayuta-gondo/ptarmigan | 1522799fb3dec4df690bcfd827acb1809ceb1d62 | [
"Apache-2.0"
] | null | null | null | utl/utl_rng.c | nayuta-gondo/ptarmigan | 1522799fb3dec4df690bcfd827acb1809ceb1d62 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright (C) 2017, Nayuta, Inc. All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#ifndef PTARM_NO_USE_RNG
#include "mbedtls/ctr_drbg.h"
#include "mbedtls/entropy.h"
#endif
#include "utl_rng.h"
/**************************************************************************
* macros
**************************************************************************/
#define M_RNG_APP_SPECIFIC_DATA_STR "ptarmigan@nayuta"
/**************************************************************************
* private variables
**************************************************************************/
#ifndef PTARM_NO_USE_RNG
static mbedtls_entropy_context mEntropy;
static mbedtls_ctr_drbg_context mRng;
#endif
/**************************************************************************
* public functions
**************************************************************************/
bool utl_rng_init(void)
{
#ifndef PTARM_NO_USE_RNG
mbedtls_entropy_init(&mEntropy);
mbedtls_ctr_drbg_init(&mRng);
//XXX: TODO: we not set the device-specific identifier yet
if (mbedtls_ctr_drbg_seed(&mRng, mbedtls_entropy_func, &mEntropy,
(const unsigned char *)M_RNG_APP_SPECIFIC_DATA_STR, strlen(M_RNG_APP_SPECIFIC_DATA_STR))) return false;
mbedtls_ctr_drbg_set_prediction_resistance(&mRng, MBEDTLS_CTR_DRBG_PR_ON);
#endif
return true;
}
bool utl_rng_rand(uint8_t *pData, uint16_t Len)
{
#ifndef PTARM_NO_USE_RNG
if (mbedtls_ctr_drbg_random(&mRng, pData, Len)) return false;
#else
for (uint16_t lp = 0; lp < Len; lp++) {
pData[lp] = (uint8_t)(rand() % 256);
}
#endif
return true;
}
void utl_rng_free(void)
{
#ifndef PTARM_NO_USE_RNG
mbedtls_entropy_free(&mEntropy);
mbedtls_ctr_drbg_free(&mRng);
#endif
}
| 29.347826 | 111 | 0.611111 |
35fa19eaa2fffb0a9a89476c5f377a6f6dc110a7 | 3,686 | c | C | src/xgcd_partial.c | SkynetNetwork/skynetvdf | ec1ec0a4f87e14d3ef05ca1434f3a1b7a5f2f861 | [
"Apache-2.0"
] | null | null | null | src/xgcd_partial.c | SkynetNetwork/skynetvdf | ec1ec0a4f87e14d3ef05ca1434f3a1b7a5f2f861 | [
"Apache-2.0"
] | null | null | null | src/xgcd_partial.c | SkynetNetwork/skynetvdf | ec1ec0a4f87e14d3ef05ca1434f3a1b7a5f2f861 | [
"Apache-2.0"
] | null | null | null | /*
Copyright (C) 2012 William Hart
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
MIT licensing permission obtained January 13, 2020 by Skynet Network Inc. from William Hart
*/
#ifndef _XGCD_PARTIAL
#define _XGCD_PARTIAL
#include <gmp.h>
void mpz_xgcd_partial(mpz_t co2, mpz_t co1,
mpz_t r2, mpz_t r1, const mpz_t L)
{
mpz_t q, r;
mp_limb_signed_t aa2, aa1, bb2, bb1, rr1, rr2, qq, bb, t1, t2, t3, i;
mp_limb_signed_t bits, bits1, bits2;
mpz_init(q); mpz_init(r);
mpz_set_ui(co2, 0);
mpz_set_si(co1, -1);
while (mpz_cmp_ui(r1, 0) && mpz_cmp(r1, L) > 0)
{
bits2 = mpz_sizeinbase(r2, 2);
bits1 = mpz_sizeinbase(r1, 2);
bits = __GMP_MAX(bits2, bits1) - GMP_LIMB_BITS + 1;
if (bits < 0) bits = 0;
mpz_tdiv_q_2exp(r, r2, bits);
rr2 = mpz_get_ui(r);
mpz_tdiv_q_2exp(r, r1, bits);
rr1 = mpz_get_ui(r);
mpz_tdiv_q_2exp(r, L, bits);
bb = mpz_get_ui(r);
aa2 = 0; aa1 = 1;
bb2 = 1; bb1 = 0;
for (i = 0; rr1 != 0 && rr1 > bb; i++)
{
qq = rr2 / rr1;
t1 = rr2 - qq*rr1;
t2 = aa2 - qq*aa1;
t3 = bb2 - qq*bb1;
if (i & 1)
{
if (t1 < -t3 || rr1 - t1 < t2 - aa1) break;
} else
{
if (t1 < -t2 || rr1 - t1 < t3 - bb1) break;
}
rr2 = rr1; rr1 = t1;
aa2 = aa1; aa1 = t2;
bb2 = bb1; bb1 = t3;
}
if (i == 0)
{
mpz_fdiv_qr(q, r2, r2, r1);
mpz_swap(r2, r1);
mpz_submul(co2, co1, q);
mpz_swap(co2, co1);
} else
{
mpz_mul_si(r, r2, bb2);
if (aa2 >= 0)
mpz_addmul_ui(r, r1, aa2);
else
mpz_submul_ui(r, r1, -aa2);
mpz_mul_si(r1, r1, aa1);
if (bb1 >= 0)
mpz_addmul_ui(r1, r2, bb1);
else
mpz_submul_ui(r1, r2, -bb1);
mpz_set(r2, r);
mpz_mul_si(r, co2, bb2);
if (aa2 >= 0)
mpz_addmul_ui(r, co1, aa2);
else
mpz_submul_ui(r, co1, -aa2);
mpz_mul_si(co1, co1, aa1);
if (bb1 >= 0)
mpz_addmul_ui(co1, co2, bb1);
else
mpz_submul_ui(co1, co2, -bb1);
mpz_set(co2, r);
if (mpz_sgn(r1) < 0) { mpz_neg(co1, co1); mpz_neg(r1, r1); }
if (mpz_sgn(r2) < 0) { mpz_neg(co2, co2); mpz_neg(r2, r2); }
}
}
if (mpz_sgn(r2) < 0)
{
mpz_neg(co2, co2); mpz_neg(co1, co1);
mpz_neg(r2, r2);
}
mpz_clear(q); mpz_clear(r);
}
#endif /* _XGCD_PARTIAL */
| 29.488 | 95 | 0.560228 |
33f2e44cc032062ac713ed073d6b333e90cf8e4e | 1,293 | h | C | Classes/Clients/IFToastingRoomStreamClient.h | fabiopelosin/IFToastingKit | a9c58d1139ac3f660167c30ffcecbbcb907160dd | [
"MIT"
] | 1 | 2015-11-09T00:03:01.000Z | 2015-11-09T00:03:01.000Z | Classes/Clients/IFToastingRoomStreamClient.h | fabiopelosin/IFToastingKit | a9c58d1139ac3f660167c30ffcecbbcb907160dd | [
"MIT"
] | null | null | null | Classes/Clients/IFToastingRoomStreamClient.h | fabiopelosin/IFToastingKit | a9c58d1139ac3f660167c30ffcecbbcb907160dd | [
"MIT"
] | null | null | null | //
// IFToastingRoomStreamClient.h
// CampfireTest
//
// Created by Fabio Pelosin on 23/01/13.
// Copyright (c) 2013 Discontinuity. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IFToastingMessage.h"
@protocol IFToastingRoomStreamClientDelegate;
///-----------------------------------------------------------------------------
/// IFToastingRoomStreamClient
///-----------------------------------------------------------------------------
@interface IFToastingRoomStreamClient : NSObject
- (id)initWithRoom:(NSString *)room;
@property NSString *authorizationToken;
@property (weak) id <IFToastingRoomStreamClientDelegate> delegate;
- (void)openConnection;
- (void)openConnectionWithSuccess:(void (^)())success
failure:(void (^)(NSError *error))failure;
- (void)closeConnection;
@end
///-----------------------------------------------------------------------------
/// IFToastingRoomStreamClientDelegate
///-----------------------------------------------------------------------------
@protocol IFToastingRoomStreamClientDelegate <NSObject>
- (void)client:(IFToastingRoomStreamClient*)client didReceiveMessage:(IFToastingMessage*)message;
- (void)client:(IFToastingRoomStreamClient*)client didFailWithError:(NSError*)error;
@end
| 28.733333 | 97 | 0.572312 |
a6759373c4bf8edb661f8aaffe1974f555496f0b | 351 | h | C | tools/leveleditor/include/hierarchy.h | redstrate/graph | d77c071e3d43da784c95b142687f78213c034658 | [
"MIT"
] | null | null | null | tools/leveleditor/include/hierarchy.h | redstrate/graph | d77c071e3d43da784c95b142687f78213c034658 | [
"MIT"
] | null | null | null | tools/leveleditor/include/hierarchy.h | redstrate/graph | d77c071e3d43da784c95b142687f78213c034658 | [
"MIT"
] | null | null | null | #pragma once
#include <QWidget>
#include <QListView>
#include <QStringListModel>
struct Context;
class Hierarchy : public QWidget {
Q_OBJECT
public:
Hierarchy(Context& context, QWidget* parent = nullptr);
private:
void rebuild();
QListView* listView = nullptr;
QStringListModel* listModel = nullptr;
Context& context;
};
| 15.954545 | 59 | 0.706553 |
a6e74262b767ddee0935b073e32d95fde86fee72 | 760 | h | C | TTNews/Tools/CKAlertViewController.h | 1370156363/TTNews1 | 8775ec0e4bc878ddfc978c50f95add5504492e03 | [
"Unlicense",
"MIT"
] | null | null | null | TTNews/Tools/CKAlertViewController.h | 1370156363/TTNews1 | 8775ec0e4bc878ddfc978c50f95add5504492e03 | [
"Unlicense",
"MIT"
] | 1 | 2018-06-27T03:31:06.000Z | 2018-06-27T03:31:06.000Z | Example/Pods/BRXHBasis/BRXHBasis/Classes/Lib/BasicTools/CKAlertViewController.h | Nglszs/BCSegmentTag | b191a8272feacc71d4b756731d325790a94142fa | [
"MIT"
] | null | null | null | //
// CKAlertViewController.h
// 自定义警告框
//
// Created by 陈凯 on 16/8/24.
// Copyright © 2016年 陈凯. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CKAlertAction : NSObject
+ (instancetype)actionWithTitle:(NSString *)title handler:(void (^)(CKAlertAction *action))handler;
@property (nonatomic, readonly) NSString *title;
@end
@interface CKAlertViewController : UIViewController
@property (nonatomic, readonly) NSArray<CKAlertAction *> *actions;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, assign) NSTextAlignment messageAlignment;
+ (instancetype)alertControllerWithTitle:(NSString *)title message:(NSString *)message;
- (void)addAction:(CKAlertAction *)action;
@end
| 24.516129 | 99 | 0.752632 |
815a619acb9e440d4250c22f2fd0f70f901751c1 | 343 | h | C | sources/misc/mbox.h | ydong08/klite | 1bbddb1011abe8ec9487b2b679f30a99b92342a7 | [
"MIT"
] | null | null | null | sources/misc/mbox.h | ydong08/klite | 1bbddb1011abe8ec9487b2b679f30a99b92342a7 | [
"MIT"
] | null | null | null | sources/misc/mbox.h | ydong08/klite | 1bbddb1011abe8ec9487b2b679f30a99b92342a7 | [
"MIT"
] | null | null | null | #ifndef __MBOX_H
#define __MBOX_H
typedef struct
{
event_t event;
uint32_t data;
}mbox_t;
bool mbox_init(mbox_t *mbox);
void mbox_delete(mbox_t *mbox);
void mbox_post(mbox_t *mbox, uint32_t data);
void mbox_wait(mbox_t *mbox, uint32_t *pdata);
bool mbox_timedwait(mbox_t *mbox, uint32_t *pdata, uint32_t timeout);
#endif
| 20.176471 | 71 | 0.731778 |
edd77a0cb80fc107f87443032b3849f4d611ef89 | 348 | h | C | twitter/TweetsViewController.h | TLuthra/twitter-ios-animations | 2472dd323890dfa4f5d9d7decd976d6bb9388a3e | [
"MIT"
] | null | null | null | twitter/TweetsViewController.h | TLuthra/twitter-ios-animations | 2472dd323890dfa4f5d9d7decd976d6bb9388a3e | [
"MIT"
] | 1 | 2015-03-01T09:53:53.000Z | 2015-03-07T00:44:00.000Z | twitter/TweetsViewController.h | TLuthra/twitter-ios-animations | 2472dd323890dfa4f5d9d7decd976d6bb9388a3e | [
"MIT"
] | null | null | null | //
// TweetsViewController.h
// twitter
//
// Created by Tanooj Luthra on 2/22/15.
// Copyright (c) 2015 Tanooj Luthra. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HamburgerViewController.h"
@interface TweetsViewController : UIViewController
@property (strong, nonatomic) HamburgerViewController *hamburgerViewController;
@end
| 20.470588 | 79 | 0.755747 |
8846d3e6bd878baf006560db6f4361c099a6ad9a | 3,752 | h | C | db_1cd/db_1cd_83.h | DenMMM/db_1cd | 5cdd1bd48fa766dbde99ab2c009ef8021345527a | [
"Apache-2.0"
] | null | null | null | db_1cd/db_1cd_83.h | DenMMM/db_1cd | 5cdd1bd48fa766dbde99ab2c009ef8021345527a | [
"Apache-2.0"
] | null | null | null | db_1cd/db_1cd_83.h | DenMMM/db_1cd | 5cdd1bd48fa766dbde99ab2c009ef8021345527a | [
"Apache-2.0"
] | null | null | null | /*
Library for low-level access to 1CD file database.
Copyright (C) 2021 Denis Matveev (denm.mmm@gmail.com).
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.
*/
#pragma once
#include <string>
#include <cassert>
#include <typeinfo>
#include "db_1cd_8x.h"
class db_1cd_83 : public db_1cd_8x
{
public:
db_1cd_83() = delete;
public:
static constexpr std::uint32_t VERSION = 0x00080308; // Suppoted format version.
public:
class object
{
public:
using size_type = std::uint64_t; // 'obj_hdr::length'.
private:
#pragma pack(push, 1)
struct obj_hdr
{
std::uint16_t type; // Object type (0xFD1C).
std::uint16_t pmt_type; // Placement table type (0x0000/0x0001).
std::uint32_t v1;
std::uint32_t v2;
std::uint32_t v3;
std::uint64_t length; // Data size (byte).
std::uint32_t blocks[0]; // Indexes of the pages with data/'pmt_hdr'.
};
struct pmt_hdr
{
std::uint32_t data_blocks[0]; // Indexes of the pages with object data.
};
#pragma pack(pop)
pages& pages_iface; // Interface to read data.
pages::buffer_type hdr_page; // Buffer for the object header.
pages::index_type page_num_to_index(pages::index_type page_num_);
pages::index_type page_num_to_index_lite(pages::index_type page_num_) const;
public:
object(pages& pages_, pages::index_type index_);
object::size_type size() const noexcept
{
auto* hdr = reinterpret_cast<const obj_hdr*>(hdr_page.data());
return hdr->length;
}
void read(
void* dst_buff_,
std::size_t count_, object::size_type pos_);
};
using blob = db_1cd_8x::blob<object>;
using records = db_1cd_8x::records<object>;
class root : public db_1cd_8x::root
{
public:
using index_type = std::uint32_t; // 'root_hdr::numtables'.
private:
#pragma pack(push, 1)
struct root_hdr
{
char lang[32]; // Language label (as example 'ru_RU').
std::uint32_t numtables; // Tables count in database.
std::uint32_t tables[0]; // Indexes of the tables descriptions in BLOB.
};
#pragma pack(pop)
blob blob_iface; // BLOB-object to read descriptions of tables.
pages::buffer_type hdr_data; // Buffer with root-object header.
public:
root(pages& pages_);
root::index_type size() const noexcept
{
auto* hdr = reinterpret_cast<const root_hdr*>(hdr_data.data());
return hdr->numtables;
}
std::wstring read(root::index_type num_);
table::params get(root::index_type num_)
{
const std::wstring descr = read(num_);
return parse_params(descr);
}
};
};
| 30.016 | 106 | 0.5629 |
32fd7aba6b325546b75650621bb9bc153b46e6aa | 731 | h | C | PrivateFrameworks/SpotlightServices/PRSRankingRenderAndEngagementValues.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 17 | 2018-11-13T04:02:58.000Z | 2022-01-20T09:27:13.000Z | PrivateFrameworks/SpotlightServices/PRSRankingRenderAndEngagementValues.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 3 | 2018-04-06T02:02:27.000Z | 2018-10-02T01:12:10.000Z | PrivateFrameworks/SpotlightServices/PRSRankingRenderAndEngagementValues.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 1 | 2018-09-28T13:54:23.000Z | 2018-09-28T13:54:23.000Z | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
#import "NSCopying.h"
#import "NSSecureCoding.h"
@interface PRSRankingRenderAndEngagementValues : NSObject <NSSecureCoding, NSCopying>
{
short _renderValues[6];
short _engagementValues[6];
}
+ (BOOL)supportsSecureCoding;
- (void)incrementRankingValuesForType:(int)arg1;
- (void)setRankingValues:(short [6])arg1 forType:(int)arg2;
- (BOOL)getRankingValues:(short *)arg1 withRankingValueSize:(unsigned long long)arg2 forType:(int)arg3;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)init;
- (id)copyWithZone:(struct _NSZone *)arg1;
@end
| 25.206897 | 103 | 0.726402 |
fc058159c6ef4d7f261d7f7c45e5677adfb4918d | 1,808 | h | C | System/Library/PrivateFrameworks/ScreenTimeSettingsUI.framework/STUsageCell.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 2 | 2021-11-02T09:23:27.000Z | 2022-03-28T08:21:57.000Z | System/Library/PrivateFrameworks/ScreenTimeSettingsUI.framework/STUsageCell.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/ScreenTimeSettingsUI.framework/STUsageCell.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 1 | 2022-03-28T08:21:59.000Z | 2022-03-28T08:21:59.000Z | /*
* This header is generated by classdump-dyld 1.5
* on Wednesday, October 27, 2021 at 3:23:40 PM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/ScreenTimeSettingsUI.framework/ScreenTimeSettingsUI
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
#import <ScreenTimeSettingsUI/STTableCell.h>
@class UILabel, STCandyBarView, NSLayoutConstraint;
@interface STUsageCell : STTableCell {
UILabel* _itemNameLabel;
STCandyBarView* _usageBarView;
UILabel* _usageLabel;
NSLayoutConstraint* _usageBarWidthConstraint;
}
@property (nonatomic,readonly) NSLayoutConstraint * usageBarWidthConstraint; //@synthesize usageBarWidthConstraint=_usageBarWidthConstraint - In the implementation block
@property (nonatomic,readonly) UILabel * itemNameLabel; //@synthesize itemNameLabel=_itemNameLabel - In the implementation block
@property (nonatomic,readonly) STCandyBarView * usageBarView; //@synthesize usageBarView=_usageBarView - In the implementation block
@property (nonatomic,readonly) UILabel * usageLabel; //@synthesize usageLabel=_usageLabel - In the implementation block
-(id)value;
-(void)setValue:(id)arg1 ;
-(id)initWithStyle:(long long)arg1 reuseIdentifier:(id)arg2 specifier:(id)arg3 ;
-(void)refreshCellContentsWithSpecifier:(id)arg1 ;
-(void)_didFetchAppInfoOrIcon:(id)arg1 ;
-(UILabel *)usageLabel;
-(UILabel *)itemNameLabel;
-(STCandyBarView *)usageBarView;
-(NSLayoutConstraint *)usageBarWidthConstraint;
@end
| 48.864865 | 182 | 0.692478 |
1174bb0b8740e6cbd751972d54f27aa7236f38df | 11,173 | c | C | libMx/i_sim900.c | nbeaver/mx-trunk | 8f9305f42cc5b12b77ba0354680bb317d779165d | [
"X11",
"MIT"
] | null | null | null | libMx/i_sim900.c | nbeaver/mx-trunk | 8f9305f42cc5b12b77ba0354680bb317d779165d | [
"X11",
"MIT"
] | null | null | null | libMx/i_sim900.c | nbeaver/mx-trunk | 8f9305f42cc5b12b77ba0354680bb317d779165d | [
"X11",
"MIT"
] | 2 | 2016-11-21T05:10:10.000Z | 2019-11-14T11:35:45.000Z | /*
* Name: i_sim900.c
*
* Purpose: MX driver for the Stanford Research Systems SIM900 mainframe.
*
* Author: William Lavender
*
*--------------------------------------------------------------------------
*
* Copyright 2010-2012, 2015, 2017 Illinois Institute of Technology
*
* See the file "LICENSE" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
*/
#define MXI_SIM900_DEBUG FALSE
#include <stdio.h>
#include <stdlib.h>
#include "mx_util.h"
#include "mx_record.h"
#include "mx_driver.h"
#include "mx_ascii.h"
#include "mx_rs232.h"
#include "mx_gpib.h"
#include "i_sim900.h"
MX_RECORD_FUNCTION_LIST mxi_sim900_record_function_list = {
NULL,
mxi_sim900_create_record_structures,
NULL,
NULL,
NULL,
mxi_sim900_open
};
MX_RECORD_FIELD_DEFAULTS mxi_sim900_record_field_defaults[] = {
MX_RECORD_STANDARD_FIELDS,
MXI_SIM900_STANDARD_FIELDS
};
long mxi_sim900_num_record_fields
= sizeof( mxi_sim900_record_field_defaults )
/ sizeof( mxi_sim900_record_field_defaults[0] );
MX_RECORD_FIELD_DEFAULTS *mxi_sim900_rfield_def_ptr
= &mxi_sim900_record_field_defaults[0];
MX_EXPORT mx_status_type
mxi_sim900_create_record_structures( MX_RECORD *record )
{
static const char fname[] = "mxi_sim900_create_record_structures()";
MX_SIM900 *sim900;
/* Allocate memory for the necessary structures. */
sim900 = (MX_SIM900 *) malloc( sizeof(MX_SIM900) );
if ( sim900 == (MX_SIM900 *) NULL ) {
return mx_error( MXE_OUT_OF_MEMORY, fname,
"Can't allocate memory for MX_SIM900 structure." );
}
/* Now set up the necessary pointers. */
record->record_class_struct = NULL;
record->record_type_struct = sim900;
record->record_function_list = &mxi_sim900_record_function_list;
record->superclass_specific_function_list = NULL;
record->class_specific_function_list = NULL;
sim900->record = record;
return MX_SUCCESSFUL_RESULT;
}
MX_EXPORT mx_status_type
mxi_sim900_open( MX_RECORD *record )
{
static const char fname[] = "mxi_sim900_open()";
MX_SIM900 *sim900 = NULL;
MX_RECORD *interface_record = NULL;
MX_RS232 *rs232 = NULL;
long speed;
char flow_control;
unsigned long read_terminators, write_terminators;
char response[100];
char copy_of_response[100];
int argc, num_items;
char **argv;
mx_status_type mx_status;
if ( record == (MX_RECORD *) NULL ) {
return mx_error( MXE_NULL_ARGUMENT, fname,
"MX_RECORD pointer passed is NULL.");
}
sim900 = (MX_SIM900 *) record->record_type_struct;
if ( sim900 == (MX_SIM900 *) NULL ) {
return mx_error( MXE_CORRUPT_DATA_STRUCTURE, fname,
"MX_SIM900 pointer for record '%s' is NULL.", record->name);
}
#if MXI_SIM900_DEBUG
{
unsigned long sim900_flags;
sim900_flags = sim900->sim900_flags;
MX_DEBUG(-2,("%s invoked for record '%s', sim900_flags = %#lx.",
fname, record->name, sim900_flags ));
}
#endif
interface_record = sim900->sim900_interface.record;
rs232 = (MX_RS232 *) interface_record->record_class_struct;
if ( rs232 == (MX_RS232 *) NULL ) {
return mx_error( MXE_CORRUPT_DATA_STRUCTURE, fname,
"The MX_RS232 pointer for the RS-232 record "
"used by SIM900 interface '%s' is NULL.", record->name );
}
switch( interface_record->mx_class ) {
case MXI_RS232:
/* Make sure that the RS-232 port from the computer to
* the SIM900 is configured to use valid serial
* communication parameters.
*/
mx_status = mx_rs232_get_configuration( interface_record,
&speed, NULL, NULL, NULL,
&flow_control,
&read_terminators,
&write_terminators, NULL );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
switch( speed ) {
case 115200:
case 57600:
case 19200:
case 9600:
case 1200:
break;
default:
return mx_error( MXE_ILLEGAL_ARGUMENT, fname,
"Illegal port speed %ld requested for SIM900 "
"RS-232 port '%s'. The allowed port speeds are "
"115200, 57600, 19200, 9600, and 1200.",
speed, interface_record->name );
break;
}
mx_status = mx_rs232_set_configuration( interface_record,
speed, 8, 'N', 1,
flow_control,
read_terminators,
write_terminators,
rs232->timeout );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
/* Discard any characters waiting to be sent or received. */
mx_status = mx_rs232_discard_unwritten_output(
interface_record, MXI_SIM900_DEBUG );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
mx_status = mx_rs232_discard_unread_input(
interface_record, MXI_SIM900_DEBUG );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
break;
case MXI_GPIB:
/* GPIB does not require any initialization. */
break;
default:
return mx_error( MXE_TYPE_MISMATCH, fname,
"Only RS-232 and GPIB interfaces are supported for "
"SIM900 interface '%s'. Interface record '%s' is "
"of unsupported type '%s'.",
record->name, interface_record->name,
mx_get_driver_name( interface_record ) );
break;
}
/* Send a device clear to reset the mainframe to the idle state. */
mx_status = mxi_sim900_device_clear( sim900, MXI_SIM900_DEBUG );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
/* Verify that this is a SIM900 mainframe. */
mx_status = mxi_sim900_command( sim900, "*IDN?",
response, sizeof(response),
MXI_SIM900_DEBUG );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
strlcpy( copy_of_response, response, sizeof(copy_of_response) );
mx_string_split( copy_of_response, ",", &argc, &argv );
if ( argc != 4 ) {
return mx_error( MXE_INTERFACE_IO_ERROR, fname,
"Did not find 4 tokens in the response '%s' to "
"the *IDN? command sent to '%s'.",
response, record->name );
}
if ( strcmp( argv[0], "Stanford_Research_Systems" ) != 0 ) {
free( argv );
return mx_error( MXE_ILLEGAL_ARGUMENT, fname,
"Controller '%s' is not a Stanford Research Systems device. "
"The response to '*IDN?' was '%s'.",
record->name, response );
}
if ( strcmp( argv[1], "SIM900" ) != 0 ) {
free( argv );
return mx_error( MXE_ILLEGAL_ARGUMENT, fname,
"Controller '%s' is not a SIM900 mainframe. "
"The response to '*IDN?' was '%s'.",
record->name, response );
}
/* Get the version number. */
num_items = sscanf( argv[3], "ver%lf", &(sim900->version) );
if ( num_items != 1 ) {
mx_status = mx_error( MXE_INTERFACE_IO_ERROR, fname,
"Did not find the SIM900 version number in the token '%s' "
"contained in the response '%s' to '*IDN?' by controller '%s'.",
argv[3], response, record->name );
free( argv );
return mx_status;
}
return MX_SUCCESSFUL_RESULT;
}
/*---*/
static mx_status_type
mxi_sim900_rs232_getline( MX_RS232 *rs232,
char *response,
size_t max_response_length )
{
char c;
unsigned long i;
mx_bool_type in_terminator;
mx_status_type mx_status;
in_terminator = FALSE;
for ( i = 0; i < max_response_length; i++ ) {
mx_status = mx_rs232_getchar_with_timeout( rs232->record,
&c, 0, rs232->timeout );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
if ( in_terminator ) {
if ( c == MX_LF ) {
response[i-1] = '\0';
break; /* Exit the for() loop. */
} else {
in_terminator = FALSE;
}
} else {
if ( c == MX_CR ) {
in_terminator = TRUE;
}
}
response[i] = c;
}
/* Make sure the string is null terminated. */
response[max_response_length - 1] = '\0';
return MX_SUCCESSFUL_RESULT;
}
/*---*/
MX_EXPORT mx_status_type
mxi_sim900_command( MX_SIM900 *sim900,
char *command,
char *response,
size_t max_response_length,
unsigned long sim900_flags )
{
static const char fname[] = "mxi_sim900_command()";
MX_RECORD *interface_record;
long gpib_address;
mx_bool_type debug;
mx_status_type mx_status;
MX_RS232 *rs232;
if ( sim900 == (MX_SIM900 *) NULL ) {
return mx_error( MXE_NULL_ARGUMENT, fname,
"The MX_SIM900 pointer passed was NULL." );
}
if ( sim900_flags & MXF_SIM900_DEBUG ) {
debug = TRUE;
} else
if ( sim900->sim900_flags & MXF_SIM900_DEBUG ) {
debug = TRUE;
} else {
debug = FALSE;
}
interface_record = sim900->sim900_interface.record;
if ( interface_record == (MX_RECORD *) NULL ) {
return mx_error( MXE_CORRUPT_DATA_STRUCTURE, fname,
"The interface record pointer for SIM900 interface '%s' is NULL.",
sim900->record->name );
}
/* Send the command and get the response. */
if ( ( command != NULL ) && debug ) {
MX_DEBUG(-2,("%s: sending command '%s' to '%s'.",
fname, command, sim900->record->name));
}
if ( interface_record->mx_class == MXI_RS232 ) {
rs232 = (MX_RS232 *) interface_record->record_class_struct;
if ( rs232 == (MX_RS232 *) NULL ) {
return mx_error( MXE_CORRUPT_DATA_STRUCTURE, fname,
"The MX_RS232 pointer for record '%s' is NULL.",
interface_record->name );
}
if ( command != NULL ) {
mx_status = mx_rs232_putline( interface_record,
command, NULL, 0 );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
}
if ( response != NULL ) {
unsigned long raw_status_code;
mx_status = mxi_sim900_rs232_getline( rs232,
response,
max_response_length );
if ( mx_status.code != MXE_SUCCESS ) {
raw_status_code = mx_status.code & (~MXE_QUIET);
if ( raw_status_code != MXE_TIMED_OUT ) {
return mx_status;
} else {
return mx_error( MXE_TIMED_OUT, fname,
"Timed out while waiting for a response to the "
"command '%s' sent to SIM900 '%s'.",
command, sim900->record->name );
}
}
}
} else { /* GPIB */
gpib_address = sim900->sim900_interface.address;
if ( command != NULL ) {
mx_status = mx_gpib_putline( interface_record,
gpib_address,
command, NULL, 0 );
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
}
if ( response != NULL ) {
mx_status = mx_gpib_getline(
interface_record, gpib_address,
response, max_response_length, NULL, 0);
if ( mx_status.code != MXE_SUCCESS )
return mx_status;
}
}
if ( ( response != NULL ) && debug ) {
MX_DEBUG(-2,("%s: received response '%s' from '%s'.",
fname, response, sim900->record->name ));
}
return MX_SUCCESSFUL_RESULT;
}
/*---*/
MX_EXPORT mx_status_type
mxi_sim900_device_clear( MX_SIM900 *sim900,
unsigned long sim900_flags )
{
static const char fname[] = "mxi_sim900_device_clear()";
MX_RECORD *interface_record;
mx_status_type mx_status;
if ( sim900 == (MX_SIM900 *) NULL ) {
return mx_error( MXE_NULL_ARGUMENT, fname,
"The MX_SIM900 pointer passed was NULL." );
}
interface_record = sim900->sim900_interface.record;
if ( interface_record == (MX_RECORD *) NULL ) {
return mx_error( MXE_CORRUPT_DATA_STRUCTURE, fname,
"The interface record pointer for SIM900 interface '%s' is NULL.",
sim900->record->name );
}
/* Send the device clear request. */
if ( sim900_flags & MXF_SIM900_DEBUG ) {
MX_DEBUG(-2,("%s: sending device clear to '%s'.",
fname, sim900->record->name));
}
if ( interface_record->mx_class == MXI_RS232 ) {
mx_status = mx_rs232_send_break( interface_record );
} else {
mx_status = mx_gpib_device_clear( interface_record );
}
return mx_status;
}
| 23.77234 | 76 | 0.682986 |
5044b135c635f31dae2133985e09fee96b665f29 | 1,192 | c | C | ConsistentHashing/test.c | kevinms/algorithms-and-datastructures | f901aadd66b119b2432f91c427a5c5f023398217 | [
"MIT"
] | null | null | null | ConsistentHashing/test.c | kevinms/algorithms-and-datastructures | f901aadd66b119b2432f91c427a5c5f023398217 | [
"MIT"
] | null | null | null | ConsistentHashing/test.c | kevinms/algorithms-and-datastructures | f901aadd66b119b2432f91c427a5c5f023398217 | [
"MIT"
] | null | null | null | #include "HashCircle.h"
#include <stdio.h>
#include <assert.h>
#define PRIME1 3851
static uint64_t
polyHash(void *key, uint64_t len, uint64_t p, uint64_t M)
{
uint64_t hash = 0;
int i;
for (i = len-1; i >=0; i--) {
hash = (hash * p + ((uint8_t *)key)[i]) % M;
}
return hash;
}
static uint64_t
myHash(void *key, uint64_t len)
{
return polyHash(key, len, PRIME1, UINT64_MAX);
}
int main()
{
Circle *c = circleAlloc(myHash);
char *keys[] = {
"key0",
"key3",
"key1",
"key2"
};
int numKeys = sizeof(keys) / sizeof(*keys);
int i;
for (i = 0; i < numKeys; i++) {
printf("Inserting %s\n", keys[i]);
Node * n = circleInsert(c, keys[i], keys[i], 2);
assert(n != NULL && n->name == keys[i]);
}
for (i = 0; i < c->numPoints; i++) {
printf("Point %i: %" PRIu64 " -> %s-%" PRIu64 "\n",
i, c->points[i].hash, c->points[i].node->name, c->points[i].x);
}
for (i = 0; i < numKeys; i++) {
Point *cp = circleClosestPoint(c, keys[i]);
printf("%s is closest to %s-%" PRIu64"\n", keys[i], cp->node->name, cp->x);
Point *p = cp;
while ((p = circleNextPoint(c, p)) != cp) {
printf("Next closest %s-%" PRIu64 "\n", p->node->name, p->x);
}
}
return 0;
}
| 19.540984 | 77 | 0.564597 |
a1fecdde8a244351c986f4bdd4b4efe06ca7b0a9 | 22,166 | c | C | Software/MAX78000_FW/Sneakers/TFT/fthr/SansSerif16x16.c | Mouser-Electronics/MAX78000_AccessControl | ea170bf2ecd816759cbeda07764c28e28ce86419 | [
"MIT"
] | null | null | null | Software/MAX78000_FW/Sneakers/TFT/fthr/SansSerif16x16.c | Mouser-Electronics/MAX78000_AccessControl | ea170bf2ecd816759cbeda07764c28e28ce86419 | [
"MIT"
] | null | null | null | Software/MAX78000_FW/Sneakers/TFT/fthr/SansSerif16x16.c | Mouser-Electronics/MAX78000_AccessControl | ea170bf2ecd816759cbeda07764c28e28ce86419 | [
"MIT"
] | null | null | null | //Font Generated by MikroElektronika GLCD Font Creator
//http://www.mikroe.com
/* MS_Reference_Sans_Serif font with 16*16 matrix for Adafruit 2.4" TFT FeatherWing */
__attribute__((section(".bin_storage_img"))) __attribute__((__used__))
__attribute__ ((aligned (2)))
const unsigned char SansSerif16x16[] = {
33, 16, 16, 2, // number of bytes per character; horizontal size in pixels; vertical size in pixels; number of bytes per vertical line
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
0x03, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
0x06, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char "
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x1E, 0x90, 0x03, 0x70, 0x02, 0x1E, 0x02, 0x10, 0x1E, 0x90, 0x03, 0x70, 0x02, 0x1E, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char #
0x09, 0x00, 0x00, 0x30, 0x08, 0x48, 0x10, 0x84, 0x10, 0xFF, 0xFF, 0x84, 0x10, 0x84, 0x10, 0x04, 0x09, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char $
0x10, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x10, 0x7C, 0x0C, 0x00, 0x03, 0xC0, 0x00, 0x30, 0x00, 0x8C, 0x0F, 0x42, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x80, 0x0F, // Code for char %
0x0B, 0x00, 0x00, 0x00, 0x07, 0x9C, 0x08, 0x62, 0x10, 0x42, 0x10, 0xC2, 0x10, 0x22, 0x11, 0x1C, 0x0A, 0x00, 0x04, 0xC0, 0x0B, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char &
0x02, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
0x06, 0x00, 0x00, 0xE0, 0x07, 0x18, 0x18, 0x04, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char (
0x06, 0x00, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, 0x20, 0x18, 0x18, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char )
0x08, 0x00, 0x00, 0x22, 0x00, 0x14, 0x00, 0x08, 0x00, 0x7F, 0x00, 0x08, 0x00, 0x14, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char *
0x0B, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xF8, 0x0F, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char +
0x03, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
0x06, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char -
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
0x07, 0x00, 0x40, 0x00, 0x38, 0x00, 0x06, 0xC0, 0x01, 0x30, 0x00, 0x0E, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
0x09, 0x00, 0x00, 0xF8, 0x07, 0x04, 0x08, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x04, 0x08, 0xF8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x08, 0x10, 0xFE, 0x1F, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
0x09, 0x00, 0x00, 0x04, 0x10, 0x02, 0x18, 0x02, 0x14, 0x02, 0x12, 0x02, 0x11, 0x82, 0x10, 0x44, 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2
0x09, 0x00, 0x00, 0x04, 0x08, 0x02, 0x10, 0x02, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0xA4, 0x08, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
0x0A, 0x00, 0x00, 0x80, 0x03, 0x40, 0x02, 0x20, 0x02, 0x10, 0x02, 0x08, 0x02, 0x04, 0x02, 0xFE, 0x1F, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 4
0x09, 0x00, 0x00, 0x00, 0x08, 0x3E, 0x10, 0x22, 0x10, 0x22, 0x10, 0x22, 0x10, 0x22, 0x10, 0x42, 0x08, 0x82, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
0x09, 0x00, 0x00, 0xF0, 0x07, 0x48, 0x08, 0x24, 0x10, 0x22, 0x10, 0x22, 0x10, 0x22, 0x10, 0x42, 0x08, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6
0x09, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x18, 0x02, 0x06, 0x82, 0x01, 0x62, 0x00, 0x1A, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
0x09, 0x00, 0x00, 0x18, 0x07, 0xA4, 0x08, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0xA4, 0x08, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8
0x09, 0x00, 0x00, 0x78, 0x00, 0x84, 0x10, 0x02, 0x11, 0x02, 0x11, 0x02, 0x11, 0x02, 0x09, 0x84, 0x04, 0xF8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 9
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
0x0B, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x40, 0x01, 0x40, 0x01, 0x20, 0x02, 0x20, 0x02, 0x10, 0x04, 0x10, 0x04, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char <
0x0B, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char =
0x0B, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x10, 0x04, 0x10, 0x04, 0x20, 0x02, 0x20, 0x02, 0x40, 0x01, 0x40, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char >
0x08, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x1B, 0x82, 0x00, 0x44, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ?
0x0F, 0x00, 0x00, 0xC0, 0x07, 0x30, 0x18, 0x08, 0x20, 0xC4, 0x23, 0x24, 0x44, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0x12, 0x44, 0xF2, 0x4F, 0x04, 0x08, 0x04, 0x08, 0x18, 0x08, 0xE0, 0x07, 0x00, 0x00, // Code for char @
0x0A, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x03, 0xE0, 0x02, 0x18, 0x02, 0x06, 0x02, 0x18, 0x02, 0xE0, 0x02, 0x00, 0x03, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char A
0x0A, 0x00, 0x00, 0xFE, 0x1F, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x62, 0x10, 0x9C, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char B
0x0A, 0x00, 0x00, 0xF0, 0x03, 0x0C, 0x0C, 0x04, 0x08, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x04, 0x08, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char C
0x0B, 0x00, 0x00, 0xFE, 0x1F, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x04, 0x08, 0x04, 0x08, 0x18, 0x06, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char D
0x09, 0x00, 0x00, 0xFE, 0x1F, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char E
0x09, 0x00, 0x00, 0xFE, 0x1F, 0x42, 0x00, 0x42, 0x00, 0x42, 0x00, 0x42, 0x00, 0x42, 0x00, 0x42, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char F
0x0B, 0x00, 0x00, 0xF0, 0x03, 0x0C, 0x0C, 0x04, 0x08, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x82, 0x10, 0x82, 0x10, 0x84, 0x10, 0x8C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char G
0x0B, 0x00, 0x00, 0xFE, 0x1F, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char H
0x06, 0x00, 0x00, 0x02, 0x10, 0x02, 0x10, 0xFE, 0x1F, 0x02, 0x10, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I
0x06, 0x00, 0x10, 0x00, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x08, 0xFE, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J
0x0A, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x01, 0x80, 0x00, 0xC0, 0x00, 0x20, 0x01, 0x10, 0x02, 0x08, 0x04, 0x04, 0x08, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char K
0x09, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char L
0x0C, 0x00, 0x00, 0xFE, 0x1F, 0x06, 0x00, 0x18, 0x00, 0x60, 0x00, 0x80, 0x01, 0x00, 0x06, 0x80, 0x01, 0x60, 0x00, 0x18, 0x00, 0x06, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char M
0x0B, 0x00, 0x00, 0xFE, 0x1F, 0x04, 0x00, 0x08, 0x00, 0x30, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x08, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char N
0x0C, 0x00, 0x00, 0xF0, 0x03, 0x0C, 0x0C, 0x04, 0x08, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x04, 0x08, 0x0C, 0x0C, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char O
0x09, 0x00, 0x00, 0xFE, 0x1F, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x84, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char P
0x0C, 0x00, 0x00, 0xF0, 0x03, 0x0C, 0x0C, 0x04, 0x08, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x70, 0x02, 0x90, 0x04, 0x88, 0x0C, 0x8C, 0xF0, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Q
0x0B, 0x00, 0x00, 0xFE, 0x1F, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x01, 0x44, 0x02, 0x38, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char R
0x09, 0x00, 0x00, 0x38, 0x04, 0x44, 0x08, 0x42, 0x10, 0x42, 0x10, 0x82, 0x10, 0x82, 0x10, 0x84, 0x08, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S
0x09, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0xFE, 0x1F, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char T
0x0B, 0x00, 0x00, 0xFE, 0x07, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x08, 0xFE, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char U
0x0A, 0x00, 0x00, 0x0E, 0x00, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x06, 0x00, 0x18, 0x00, 0x06, 0xC0, 0x01, 0x30, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char V
0x10, 0x00, 0x00, 0x0E, 0x00, 0xF0, 0x00, 0x00, 0x07, 0x00, 0x18, 0x00, 0x07, 0xC0, 0x00, 0x38, 0x00, 0x06, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x00, 0x07, 0x00, 0x18, 0x00, 0x07, 0xF0, 0x00, 0x0E, 0x00, // Code for char W
0x0A, 0x00, 0x00, 0x02, 0x10, 0x04, 0x08, 0x18, 0x06, 0x20, 0x01, 0xC0, 0x00, 0x20, 0x01, 0x18, 0x06, 0x04, 0x08, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char X
0x0A, 0x00, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x60, 0x00, 0x80, 0x1F, 0x60, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Y
0x0A, 0x00, 0x00, 0x02, 0x18, 0x02, 0x14, 0x02, 0x12, 0x02, 0x11, 0xC2, 0x10, 0x22, 0x10, 0x12, 0x10, 0x0A, 0x10, 0x06, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Z
0x06, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [
0x07, 0x01, 0x00, 0x0E, 0x00, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x06, 0x00, 0x38, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char BackSlash
0x05, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ]
0x0B, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x02, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^
0x0A, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char _
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char `
0x09, 0x00, 0x00, 0x00, 0x06, 0x20, 0x09, 0x90, 0x10, 0x90, 0x10, 0x90, 0x10, 0x90, 0x10, 0x90, 0x08, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char a
0x09, 0x00, 0x00, 0xFF, 0x1F, 0x20, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x08, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char b
0x08, 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char c
0x09, 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x08, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char d
0x09, 0x00, 0x00, 0xC0, 0x07, 0x20, 0x09, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x20, 0x11, 0xC0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char e
0x07, 0x00, 0x00, 0x10, 0x00, 0xFE, 0x1F, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char f
0x09, 0x00, 0x00, 0xC0, 0x07, 0x20, 0x48, 0x10, 0x90, 0x10, 0x90, 0x10, 0x90, 0x10, 0x90, 0x20, 0x48, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char g
0x09, 0x00, 0x00, 0xFF, 0x1F, 0x20, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char h
0x03, 0x00, 0x00, 0x00, 0x00, 0xF6, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i
0x04, 0x00, 0x80, 0x10, 0x80, 0x10, 0x80, 0xF6, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char j
0x08, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0x02, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, 0x20, 0x08, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char k
0x03, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l
0x0E, 0x00, 0x00, 0xF0, 0x1F, 0x20, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xE0, 0x1F, 0x20, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, // Code for char m
0x09, 0x00, 0x00, 0xF0, 0x1F, 0x20, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char n
0x09, 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x08, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char o
0x09, 0x00, 0x00, 0xF0, 0xFF, 0x20, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x08, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char p
0x09, 0x00, 0x00, 0xC0, 0x07, 0x20, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x08, 0xF0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char q
0x06, 0x00, 0x00, 0xF0, 0x1F, 0x20, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char r
0x08, 0x00, 0x00, 0xE0, 0x08, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x20, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char s
0x06, 0x00, 0x00, 0x10, 0x00, 0xFE, 0x0F, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char t
0x09, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x08, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char u
0x08, 0x00, 0x00, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x06, 0x00, 0x18, 0x00, 0x06, 0xC0, 0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char v
0x0C, 0x00, 0x00, 0x30, 0x00, 0xC0, 0x07, 0x00, 0x18, 0x00, 0x06, 0xC0, 0x01, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x06, 0x00, 0x18, 0xC0, 0x07, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char w
0x08, 0x00, 0x00, 0x10, 0x10, 0x60, 0x0C, 0x80, 0x02, 0x00, 0x01, 0x80, 0x02, 0x60, 0x0C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char x
0x08, 0x00, 0x00, 0x30, 0x00, 0xC0, 0x01, 0x00, 0xC6, 0x00, 0x38, 0x00, 0x06, 0xC0, 0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char y
0x08, 0x00, 0x00, 0x10, 0x18, 0x10, 0x14, 0x10, 0x12, 0x10, 0x11, 0x90, 0x10, 0x50, 0x10, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char z
0x08, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x40, 0x01, 0x3E, 0x7E, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char {
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char |
0x09, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x3E, 0x7E, 0x40, 0x01, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char }
0x0B, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ~
0x04, 0xFE, 0x1F, 0x02, 0x10, 0x02, 0x10, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char
};
| 207.158879 | 233 | 0.637914 |
d322367bef7880c60fab7a334389eb85f1ef8515 | 740 | h | C | adapters/Vpon/VponAdapter/GADVpadnNativeAd.h | vpon-sdk/googleads-mobile-ios-mediation | b3d7452e051bbceac91a84d70599e6c51cd90411 | [
"Apache-2.0"
] | null | null | null | adapters/Vpon/VponAdapter/GADVpadnNativeAd.h | vpon-sdk/googleads-mobile-ios-mediation | b3d7452e051bbceac91a84d70599e6c51cd90411 | [
"Apache-2.0"
] | null | null | null | adapters/Vpon/VponAdapter/GADVpadnNativeAd.h | vpon-sdk/googleads-mobile-ios-mediation | b3d7452e051bbceac91a84d70599e6c51cd90411 | [
"Apache-2.0"
] | null | null | null | //
// GADVpadnNativeAd.h
// VponAdapter
//
// Created by EricChien on 2018/10/24.
// Copyright © 2018 Vpon. All rights reserved.
//
@import Foundation;
@import GoogleMobileAds;
@import VpadnSDKAdKit;
NS_ASSUME_NONNULL_BEGIN
@class GADVpadnNativeAd;
@protocol GADVpadnNativeAdDelegate <NSObject>
- (void) onGADVpadnNativeAdDidImageLoaded:(GADVpadnNativeAd *)mediatedAd;
@end
@interface GADVpadnNativeAd : NSObject <GADMediatedUnifiedNativeAd>
- (null_unspecified instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithNativeAd:(VpadnNativeAd *)nativeAd adOptions:(GADNativeAdViewAdOptions *)options delegate:(id<GADVpadnNativeAdDelegate>)delegate NS_DESIGNATED_INITIALIZER;
- (void) loadImages;
@end
NS_ASSUME_NONNULL_END
| 21.764706 | 179 | 0.802703 |
91abc43f90f328b0eef3b2eeb0f99ff26ec74f40 | 793 | h | C | sources/UIFramework/Interfaces/I_GUIGraphics.h | haiko21/LittleGPTracker | 0f137aa67dfd86379b830cc51ba900b9423127ce | [
"BSD-3-Clause"
] | 66 | 2015-01-29T09:12:51.000Z | 2022-03-23T19:20:49.000Z | sources/UIFramework/Interfaces/I_GUIGraphics.h | haiko21/LittleGPTracker | 0f137aa67dfd86379b830cc51ba900b9423127ce | [
"BSD-3-Clause"
] | 18 | 2015-08-19T19:50:31.000Z | 2021-10-12T02:33:09.000Z | sources/UIFramework/Interfaces/I_GUIGraphics.h | haiko21/LittleGPTracker | 0f137aa67dfd86379b830cc51ba900b9423127ce | [
"BSD-3-Clause"
] | 20 | 2015-08-19T00:46:57.000Z | 2022-03-14T13:44:49.000Z | #ifndef _I_GUIGRAPHICS_H_
#define _I_GUIGRAPHICS_H_
#include "UIFramework/Framework/GUIColor.h"
#include "UIFramework/BasicDatas/GUIRect.h"
#include "UIFramework/Framework/GUITextProperties.h"
//#include "Engine/ENGBitmap.h"
// Interface definition for a graphical port.
class I_GUIGraphics {
public:
virtual ~I_GUIGraphics() {} ;
virtual void Clear(GUIColor &,bool overlay=false)=0 ;
virtual void SetColor(GUIColor &)=0 ;
virtual void ClearRect(GUIRect &)=0 ;
virtual void DrawString(const char *string,GUIPoint &pos,GUITextProperties& p,bool overlay)=0 ;
virtual void DrawChar(const char c,GUIPoint &pos,GUITextProperties &)=0;
virtual GUIRect GetRect()=0 ;
virtual void Invalidate()=0 ;
virtual void Lock()=0 ;
virtual void Unlock()=0 ;
virtual void Flush()=0 ;
} ;
#endif
| 27.344828 | 96 | 0.754098 |
87b45182beaeb69ed601a94d0a717c975a796544 | 1,980 | h | C | include/rustfp/traits.h | guhwanbae/rustfp | 5d89523f0f1373de5b87ea9a582a4882be99541e | [
"MIT"
] | 10 | 2018-10-05T22:31:10.000Z | 2022-03-01T09:47:16.000Z | include/rustfp/traits.h | guhwanbae/rustfp | 5d89523f0f1373de5b87ea9a582a4882be99541e | [
"MIT"
] | 12 | 2017-08-26T03:27:14.000Z | 2020-12-23T04:39:06.000Z | include/rustfp/traits.h | guhwanbae/rustfp | 5d89523f0f1373de5b87ea9a582a4882be99541e | [
"MIT"
] | 1 | 2022-03-02T13:16:20.000Z | 2022-03-02T13:16:20.000Z | /**
* Contains type transformations used within the namespace.
* @author Chen Weiguang
* @version 0.1.0
*/
#pragma once
#include <functional>
#include <type_traits>
namespace rustfp {
// declaration section
namespace details {
template <class T>
struct special_decay_impl {
using type = std::decay_t<T>;
};
template <class T>
struct special_decay_impl<std::reference_wrapper<T>> {
using type = T &;
};
template <class T>
struct special_decay_impl<std::reference_wrapper<T> &> {
using type = T &;
};
template <class T>
struct special_decay_impl<const std::reference_wrapper<T> &> {
using type = T &;
};
template <class T>
struct reverse_decay_impl {
using type = T;
};
template <class T>
struct reverse_decay_impl<T &> {
using type = std::reference_wrapper<T>;
};
template <class T>
struct simplify_ref_impl {
using type = T;
};
template <class T>
struct simplify_ref_impl<std::reference_wrapper<T>> {
using type = T &;
};
template <class T>
struct simplify_ref_impl<std::reference_wrapper<T> &> {
using type = T &;
};
template <class T>
struct simplify_ref_impl<const std::reference_wrapper<T> &> {
using type = T &;
};
} // namespace details
template <class T>
using special_decay_t = typename details::special_decay_impl<T>::type;
template <class T>
using reverse_decay_t = typename details::reverse_decay_impl<T>::type;
template <class T>
using simplify_ref_t = typename details::simplify_ref_impl<T>::type;
template <class T>
using special_move_t = T &&;
template <class T>
auto special_decay(T &&val) -> special_decay_t<T>;
template <class T>
auto reverse_decay(T &&val) -> reverse_decay_t<T>;
// implementation section
template <class T>
inline auto special_decay(T &&val) -> special_decay_t<T> {
return special_decay_t<T>(std::forward<T>(val));
}
template <class T>
inline auto reverse_decay(T &&val) -> reverse_decay_t<T> {
return reverse_decay_t<T>(std::forward<T>(val));
}
} // namespace rustfp
| 20.204082 | 70 | 0.708081 |
7bde5c7fa1718418088b5699c97fb6cd2985ab3d | 1,371 | h | C | less/pattern.h | tonyhoggibm/zos-tools-and-toys | dc59d93a58e5f5e3e5e490e1edc05325223d0a4f | [
"Apache-2.0"
] | null | null | null | less/pattern.h | tonyhoggibm/zos-tools-and-toys | dc59d93a58e5f5e3e5e490e1edc05325223d0a4f | [
"Apache-2.0"
] | null | null | null | less/pattern.h | tonyhoggibm/zos-tools-and-toys | dc59d93a58e5f5e3e5e490e1edc05325223d0a4f | [
"Apache-2.0"
] | null | null | null | /*
* Copyright (C) 1984-2017 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
#if HAVE_GNU_REGEX
#define __USE_GNU 1
#include <regex.h>
#define PATTERN_TYPE struct re_pattern_buffer *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_POSIX_REGCOMP
#include <regex.h>
#ifdef REG_EXTENDED
#define REGCOMP_FLAG REG_EXTENDED
#else
#define REGCOMP_FLAG 0
#endif
#define PATTERN_TYPE regex_t *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_PCRE
#include <pcre.h>
#define PATTERN_TYPE pcre *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_RE_COMP
char *re_comp LESSPARAMS ((char*));
int re_exec LESSPARAMS ((char*));
#define PATTERN_TYPE int
#define CLEAR_PATTERN(name) name = 0
#endif
#if HAVE_REGCMP
char *regcmp LESSPARAMS ((char*));
char *regex LESSPARAMS ((char**, char*));
extern char *__loc1;
#define PATTERN_TYPE char **
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_V8_REGCOMP
#include "regexp.h"
extern int reg_show_error;
#define PATTERN_TYPE struct regexp *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if NO_REGEX
#define PATTERN_TYPE void *
#define CLEAR_PATTERN(name)
#endif
| 22.85 | 70 | 0.711889 |
400d4f8177c82b31ae1b24a11aaa05371c7f35e6 | 242 | c | C | KernelLand/Modules/Filesystems/LEAN/main.c | thepowersgang/acess2 | b52f9a841f47d7f29e9813b215e1290f191b5171 | [
"Zlib"
] | 58 | 2015-02-11T23:18:09.000Z | 2022-02-23T14:11:11.000Z | KernelLand/Modules/Filesystems/LEAN/main.c | thepowersgang/acess2 | b52f9a841f47d7f29e9813b215e1290f191b5171 | [
"Zlib"
] | 5 | 2015-01-12T03:28:04.000Z | 2016-01-12T12:21:34.000Z | KernelLand/Modules/Filesystems/LEAN/main.c | thepowersgang/acess2 | b52f9a841f47d7f29e9813b215e1290f191b5171 | [
"Zlib"
] | 10 | 2015-04-05T08:03:36.000Z | 2022-02-09T23:33:58.000Z | /*
* Acess 2 LEAN Filesystem Driver
* By John Hodge (thePowersGang)
*/
#include <acess.h>
#include <vfs.h>
// === CONSTANTS ===
// === PROTOTYPES ===
// === GLOBALS ===
// === CODE ===
int LEAN_Install(char **Arguments)
{
return 1;
}
| 12.736842 | 34 | 0.57438 |
a7063afe01e33047df707095871d54d43e24acb5 | 2,484 | h | C | src/ios/XMLConverter.h | chakm72/mInterface2.0 | 78ccc23ec9b514bed67e03fec92b50c17827caef | [
"Apache-2.0"
] | 1 | 2022-01-22T05:34:06.000Z | 2022-01-22T05:34:06.000Z | XMLConverter.h | SIMHAM/XMLConverter | 39748dcaebb647a2352ec2ed416e59efd06c514c | [
"MIT"
] | null | null | null | XMLConverter.h | SIMHAM/XMLConverter | 39748dcaebb647a2352ec2ed416e59efd06c514c | [
"MIT"
] | null | null | null | /**
* @class XMLConverter XMLConverter.h "XMLConverter.h"
* @brief XMLConverter
* @details XMLConverter.h in XMLConverter
* @date 10/8/13
* @copyright Copyright (c) 2013 Ruslan Soldatenko. All rights reserved.
*/
#import <Foundation/Foundation.h>
@interface XMLConverter : NSObject
/**
* The block called when XML-data convert finished
* @param[in] success YES - when XML-data convert successful, otherwise - NO.
* @param[in] dictionary Contains convert XML-data when success, otherwise - nil.
* @param[in] error Contains error of processing XML-data if exist, otherwise - nil.
*/
typedef void (^OutputBlock)(BOOL success, NSMutableDictionary *dictionary, NSError *error);
/**
*Convert XML data containing in input NSString object .
*@param[in] string Contains an NSString object with XML-data in the string format.
*@param[in] completion A block of code will be executed when the processing of XML-data is completed.
*This parameter must not be NULL.
*/
+ (void)convertXMLString:(NSString *)string completion:(OutputBlock)completion;
/**
*Convert XML data containing in input file.
*@param[in] filePath Contains an NSString object with absolute path to file with XML-data.
*@param[in] completion A block of code will be executed when the processing of XML-data is completed.
*This parameter must not be NULL.
*/
+ (void)convertXMLFile:(NSString *)filePath completion:(OutputBlock)completion;
/**
*Convert XML data containing in input NSData object.
*@param[in] data Contains NSData object with encapsulated XML contents.
*@param[in] completion A block of code will be executed when the processing of XML-data is completed.
*This parameter must not be NULL.
*/
+ (void)convertXMLData:(NSData *)data completion:(OutputBlock)completion;
/**
*Convert XML content referenced by the given URL.
*@param[in] url Contains an NSURL object specifying a URL.
*@param[in] completion A block of code will be executed when the processing of XML-data is completed.
*This parameter must not be NULL.
*/
+ (void)convertXMLURL:(NSURL *)url completion:(OutputBlock)completion;
/**
*Convert XML content from the specified stream.
*@param[in] stream Contains the specified input stream in NSInputStream object.
*@param[in] completion A block of code will be executed when the processing of XML-data is completed.
*This parameter must not be NULL.
*/
+ (void)convertXMLStream:(NSInputStream *)stream completion:(OutputBlock)completion;
@end
| 40.064516 | 102 | 0.750805 |
1ee88779fd4b4fea78e052c14b285927c68bea5b | 6,941 | c | C | RepPanel/reppanel_console.c | seeul8er/lv_sim_eclipse_sdl | d639df6a4e1dc7cdca075c7b36633111218a59bc | [
"MIT"
] | 5 | 2020-08-01T12:47:41.000Z | 2021-07-07T06:28:42.000Z | RepPanel/reppanel_console.c | seeul8er/lv_sim_eclipse_sdl | d639df6a4e1dc7cdca075c7b36633111218a59bc | [
"MIT"
] | null | null | null | RepPanel/reppanel_console.c | seeul8er/lv_sim_eclipse_sdl | d639df6a4e1dc7cdca075c7b36633111218a59bc | [
"MIT"
] | 2 | 2021-02-25T18:55:02.000Z | 2021-07-01T14:29:32.000Z | //
// Created by cyber on 21.03.20.
//
#include <stdio.h>
#include <lvgl/src/lv_objx/lv_cont.h>
#include <lvgl/lvgl.h>
#include <RepPanel/custom_themes/lv_theme_rep_panel_light.h>
#include "reppanel_console.h"
#include "reppanel.h"
#include "reppanel_request.h"
lv_obj_t *console_container;
lv_obj_t *ta_command;
lv_obj_t *user_comm_cont;
lv_obj_t *comm_page;
lv_obj_t *console_page;
lv_obj_t *kb;
console_entry_t console_enties[MAX_CONSOLE_ENTRY_COUNT];
static int num_console_entries = 0;
static int pos_newest_entry = -1;
void _send_user_command() {
if (strlen(lv_ta_get_text(ta_command)) > 0) {
char txt[strlen(lv_ta_get_text(ta_command))];
strcpy(txt, lv_ta_get_text(ta_command));
printf("Sending command %s\n", txt);
reprap_send_gcode(txt);
}
}
static void kb_event_cb(lv_obj_t * event_kb, lv_event_t event)
{
/* Just call the regular event handler */
lv_kb_def_event_cb(event_kb, event);
if (event == LV_EVENT_CANCEL) {
lv_obj_del(kb);
kb = NULL;
} else if (event == LV_EVENT_APPLY) {
_send_user_command();
}
}
static void ta_event_handler(lv_obj_t * obj, lv_event_t event) {
if(event == LV_EVENT_CLICKED) {
if(kb != NULL) lv_obj_del(kb);
kb = lv_kb_create(user_comm_cont, NULL);
lv_obj_set_pos(kb, 5, 90);
lv_obj_set_event_cb(kb, kb_event_cb); /* Setting a custom event handler stops the keyboard from closing automatically */
lv_obj_set_size(kb, LV_HOR_RES - 35, 140);
lv_kb_set_ta(kb, ta_command);
}
}
static void _send_gcode_event_handler(lv_obj_t * obj, lv_event_t event) {
if(event == LV_EVENT_RELEASED) {
_send_user_command();
}
}
void _add_entry_to_ui(char *command, char *response, enum console_msg_type type) {
lv_obj_t *c1 = lv_cont_create(comm_page, NULL);
static lv_style_t entry_style_info;
lv_style_copy(&entry_style_info, lv_cont_get_style(c1, LV_CONT_STYLE_MAIN));
entry_style_info.body.main_color = REP_PANEL_DARK_ACCENT;
entry_style_info.body.grad_color = REP_PANEL_DARK_ACCENT_ALT1;
entry_style_info.body.padding.inner = LV_DPI / 100;
static lv_style_t entry_style_warn;
lv_style_copy(&entry_style_warn, &entry_style_info);
entry_style_warn.body.main_color = REP_PANEL_DARK_RED;
entry_style_warn.body.grad_color = REP_PANEL_DARK_DARK_RED;
static lv_style_t entry_style_reppanel;
lv_style_copy(&entry_style_reppanel, &entry_style_info);
entry_style_reppanel.body.main_color = REP_PANEL_DARK_HIGHLIGHT;
entry_style_reppanel.body.grad_color = REP_PANEL_DARK_HIGHLIGHT_DARK;
switch (type) {
default:
case CONSOLE_TYPE_INFO:
lv_cont_set_style(c1, LV_CONT_STYLE_MAIN, &entry_style_info);
break;
case CONSOLE_TYPE_WARN:
lv_cont_set_style(c1, LV_CONT_STYLE_MAIN, &entry_style_warn);
break;
case CONSOLE_TYPE_REPPANEL:
lv_cont_set_style(c1, LV_CONT_STYLE_MAIN, &entry_style_reppanel);
break;
}
lv_cont_set_fit2(c1, LV_FIT_FILL, LV_FIT_TIGHT);
lv_cont_set_layout(c1, LV_LAYOUT_COL_L);
lv_obj_t *l1 = lv_label_create(c1, NULL);
static lv_style_t l1_style;
lv_style_copy(&l1_style, lv_label_get_style(l1, LV_LABEL_STYLE_MAIN));
l1_style.text.font = &reppanel_font_roboto_bold_16;
l1_style.text.color = REP_PANEL_DARK;
lv_label_set_style(l1, LV_LABEL_STYLE_MAIN, &l1_style);
lv_label_set_text(l1, command);
if (response != NULL && strlen(response) > 0) {
lv_obj_t *l11 = lv_label_create(c1, NULL);
static lv_style_t l11_style;
lv_style_copy(&l11_style, lv_label_get_style(l11, LV_LABEL_STYLE_MAIN));
l11_style.text.font = &lv_font_roboto_16;
l11_style.text.color = REP_PANEL_DARK;
lv_label_set_style(l11, LV_LABEL_STYLE_MAIN, &l11_style);
lv_label_set_text(l11, response);
}
}
void update_entries_ui() {
if (comm_page) {
lv_page_clean(comm_page);
// get newest entry in buffer
console_entry_t *entry;
int indx = pos_newest_entry;
entry = &console_enties[indx];
for (int i = 0; i < num_console_entries; i++) {
if (strlen(entry->command) > 0) {
_add_entry_to_ui(entry->command, entry->response, entry->type);
entry--;
indx--;
if (indx < 0) {
indx = MAX_CONSOLE_ENTRY_COUNT - 1;
entry = &console_enties[indx];
}
}
}
}
}
void add_console_hist_entry(char *command, char *response, enum console_msg_type type) {
if ((MAX_CONSOLE_ENTRY_COUNT - 1) > pos_newest_entry) {
pos_newest_entry++;
num_console_entries++;
} else
pos_newest_entry = 0;
console_entry_t e = {.command = "", .response = "", .type = type};
strcpy(e.command, command);
if (response != NULL) {
strcpy(e.response, response);
}
console_enties[pos_newest_entry] = e;
}
void draw_console(lv_obj_t *parent_screen) {
console_page = lv_page_create(parent_screen, NULL);
lv_obj_set_size(console_page, lv_disp_get_hor_res(NULL), lv_disp_get_ver_res(NULL) - (lv_obj_get_height(cont_header) + 5));
lv_obj_align(console_page, NULL, LV_ALIGN_IN_TOP_MID, 0, 0);
lv_page_set_scrl_layout(console_page, LV_LAYOUT_COL_L);
user_comm_cont = lv_cont_create(console_page, NULL);
lv_cont_set_fit(user_comm_cont, LV_FIT_TIGHT);
lv_cont_set_layout(user_comm_cont, LV_LAYOUT_COL_M);
lv_obj_t *user_comm_enter_cont = lv_cont_create(user_comm_cont, NULL);
lv_cont_set_fit(user_comm_enter_cont, LV_FIT_TIGHT);
lv_cont_set_layout(user_comm_enter_cont, LV_LAYOUT_ROW_M);
ta_command = lv_ta_create(user_comm_enter_cont, NULL);
lv_ta_set_cursor_type(ta_command, LV_CURSOR_LINE);
lv_ta_set_one_line(ta_command, true);
lv_obj_set_event_cb(ta_command, ta_event_handler);
lv_ta_set_text(ta_command, "G28");
static lv_obj_t *btn_send_gcode;
create_button(user_comm_enter_cont, btn_send_gcode, LV_SYMBOL_UPLOAD" Send", _send_gcode_event_handler);
lv_obj_set_size(ta_command, lv_disp_get_hor_res(NULL) - 180, 30);
comm_page = lv_page_create(console_page, NULL);
lv_obj_set_size(comm_page, lv_disp_get_hor_res(NULL) - 30, lv_disp_get_ver_res(NULL) - (lv_obj_get_height(cont_header) + 80));
lv_page_set_scrl_layout(comm_page, LV_LAYOUT_COL_L);
// add_console_hist_entry("M21", NULL, CONSOLE_TYPE_INFO);
// add_console_hist_entry("M28 X", "Wifi SSID", CONSOLE_TYPE_REPPANEL);
// add_console_hist_entry("G01 X0.45 Y452.1", "Moved gantry", CONSOLE_TYPE_WARN);
// add_console_hist_entry("M21", "3", CONSOLE_TYPE_REPPANEL);
// add_console_hist_entry("Msdf", "2", CONSOLE_TYPE_REPPANEL);
// add_console_hist_entry("G61d8f dfgs645", "1", CONSOLE_TYPE_WARN);
update_entries_ui(console_enties);
} | 37.518919 | 130 | 0.704509 |
7183c719692caceea91034753a0a6d18c5ce75a1 | 17,591 | c | C | deps/GraphBLAS/Source/GB_AxB_Gustavson.c | The-Alchemist/RedisGraph | 3dca151464d915f3a4a1e57bbc04ad0ae0b1388d | [
"Ruby",
"ISC",
"MIT"
] | 1 | 2021-01-13T07:08:07.000Z | 2021-01-13T07:08:07.000Z | deps/GraphBLAS/Source/GB_AxB_Gustavson.c | The-Alchemist/RedisGraph | 3dca151464d915f3a4a1e57bbc04ad0ae0b1388d | [
"Ruby",
"ISC",
"MIT"
] | 1 | 2019-06-02T15:09:59.000Z | 2019-06-02T15:09:59.000Z | Source/GB_AxB_Gustavson.c | sntran/GraphBLAS | ce36e9bb1bb4962111ac969804a995ff1c3ce396 | [
"DOC"
] | null | null | null | //------------------------------------------------------------------------------
// GB_AxB_Gustavson: C=A*B or C<M>=A*B, gather/scatter-based saxpy method.
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved.
// http://suitesparse.com See GraphBLAS/Doc/License.txt for license.
//------------------------------------------------------------------------------
// This method is agnostic to the CSR/CSC format. The format of C is set
// to CSC but this is a placeholder that will be changed in GB_AxB_meta.
// parallel: this work is done by a single thread. parallelism will be done in
// GB_AxB_parallel.
// Does not log an error; returns GrB_SUCCESS, GrB_OUT_OF_MEMORY, or GrB_PANIC.
#include "GB.h"
#ifndef GBCOMPACT
#include "GB_AxB__semirings.h"
#endif
// C=A*B failed, free everything, even the Sauna
#define GB_FREE_ALL \
{ \
GB_MATRIX_FREE (Chandle) ; \
GB_Sauna_free (Sauna_id) ; \
}
GrB_Info GB_AxB_Gustavson // C=A*B or C<M>=A*B, Gustavson's method
(
GrB_Matrix *Chandle, // output matrix
const GrB_Matrix M_in, // optional matrix
const bool Mask_comp, // if true, use ~M
const GrB_Matrix A, // input matrix A
const GrB_Matrix B, // input matrix B
const GrB_Semiring semiring, // semiring that defines C=A*B
const bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b)
bool *mask_applied, // if true, mask was applied
const int Sauna_id // Sauna to use
)
{
//--------------------------------------------------------------------------
// check inputs
//--------------------------------------------------------------------------
GB_Context Context = NULL ;
ASSERT (Chandle != NULL) ;
ASSERT_OK_OR_NULL (GB_check (M_in, "M for Gustavson C<M>=A*B", GB0)) ;
ASSERT_OK (GB_check (A, "A for Gustavson C=A*B", GB0)) ;
ASSERT_OK (GB_check (B, "B for Gustavson C=A*B", GB0)) ;
ASSERT (!GB_PENDING (M_in)) ; ASSERT (!GB_ZOMBIES (M_in)) ;
ASSERT (!GB_PENDING (A)) ; ASSERT (!GB_ZOMBIES (A)) ;
ASSERT (!GB_PENDING (B)) ; ASSERT (!GB_ZOMBIES (B)) ;
ASSERT (A->vdim == B->vlen) ;
ASSERT_OK (GB_check (semiring, "semiring for Gustavson A*B", GB0)) ;
ASSERT (Sauna_id >= 0 && Sauna_id < GxB_NTHREADS_MAX) ;
ASSERT (mask_applied != NULL) ;
//--------------------------------------------------------------------------
// determine size and hypersparsity of C
//--------------------------------------------------------------------------
GrB_Info info ;
(*Chandle) = NULL ;
// Gustavson's method does not handle a complemented mask
GrB_Matrix M = (Mask_comp ? NULL : M_in) ;
int64_t cvlen = A->vlen ;
int64_t cvdim = B->vdim ;
//--------------------------------------------------------------------------
// get the semiring operators
//--------------------------------------------------------------------------
GrB_BinaryOp mult = semiring->multiply ;
GrB_Monoid add = semiring->add ;
// flipxy: if true, then compute z = fmult (B(k,j), A(i,k)) instead of the
// usual z = fmult (A(i,k), B(k,j)), since A and B have been swapped on
// input.
// these conditions have already been checked in the caller
if (flipxy)
{
// z = fmult (b,a) will be computed
ASSERT (GB_Type_compatible (A->type, mult->ytype)) ;
ASSERT (GB_Type_compatible (B->type, mult->xtype)) ;
}
else
{
// z = fmult (a,b) will be computed
ASSERT (GB_Type_compatible (A->type, mult->xtype)) ;
ASSERT (GB_Type_compatible (B->type, mult->ytype)) ;
}
// these asserts hold for any valid semiring:
ASSERT (mult->ztype == add->op->ztype) ;
ASSERT (add->op->ztype == add->op->xtype) ;
ASSERT (add->op->ztype == add->op->ytype) ;
size_t zsize = mult->ztype->size ;
//--------------------------------------------------------------------------
// allocate the Sauna
//--------------------------------------------------------------------------
GB_Sauna Sauna = GB_Global.Saunas [Sauna_id] ;
if (Sauna == NULL || Sauna->Sauna_n < cvlen || Sauna->Sauna_size < zsize)
{
// get a new Sauna: the Sauna either does not exist, or is too small
GB_Sauna_free (Sauna_id) ;
GB_OK (GB_Sauna_alloc (Sauna_id, cvlen, zsize)) ;
Sauna = GB_Global.Saunas [Sauna_id] ;
}
int64_t *restrict Sauna_Mark = Sauna->Sauna_Mark ;
// Sauna_Mark [0..cvlen-1] < hiwater holds
ASSERT_SAUNA_IS_RESET ;
//--------------------------------------------------------------------------
// estimate nnz(C) and allocate C (just the pattern)
//--------------------------------------------------------------------------
GB_OK (GB_AxB_alloc (Chandle, GrB_BOOL, cvlen, cvdim, M, A, B, false,
cvlen + GB_NNZ (A) + GB_NNZ (B))) ;
GrB_Matrix C = (*Chandle) ;
ASSERT (C != NULL) ;
ASSERT (C->x == NULL) ;
//==========================================================================
// symbolic analysis when no mask is present
//==========================================================================
if (M == NULL)
{
bool A_is_hyper = GB_IS_HYPER (A) ;
if (A_is_hyper || GB_IS_HYPER (B) || GB_IS_HYPER (C))
{
// symbolic analysis when one or more matrix is hypersparse
#define GB_HYPER_CASE
#include "GB_AxB_Gustavson_symbolic.c"
#undef GB_HYPER_CASE
}
else
{
// symbolic analysis when no matrix is hypersparse
#include "GB_AxB_Gustavson_symbolic.c"
}
// FUTURE: if A and B are pattern-only and the semiring is AND_OR
// or OR_AND (perhaps others) the C is pattern-only, and the values
// of C do not need to be computed. The work is done here.
}
//==========================================================================
// numerical phase
//==========================================================================
//--------------------------------------------------------------------------
// allocate C->x
//--------------------------------------------------------------------------
// C has the same type as z for z=fmult(x,y). The type is also the same as
// the monoid of the semiring. The types of A and/or B, and their
// typecasting, has no effect on the size of the type of C or the Sauna
// workspace.
C->type = mult->ztype ;
C->type_size = zsize ;
char zwork [zsize] ;
GB_MALLOC_MEMORY (C->x, C->nzmax, zsize) ;
if (C->x == NULL)
{
// out of memory
GB_FREE_ALL ;
return (GrB_OUT_OF_MEMORY) ;
}
C->x_shallow = false ;
// Sauna_Work has size cvlen, each entry of size zsize. Not initialized.
GB_void *restrict Sauna_Work = Sauna->Sauna_Work ;
if (M != NULL)
{
ASSERT (M->vlen == C->vlen && M->vdim == C->vdim) ;
}
//--------------------------------------------------------------------------
// determine the required types of A and B, for typecasting
//--------------------------------------------------------------------------
GrB_Type atype_required, btype_required ;
if (flipxy)
{
// A is passed as y, and B as x, in z = mult(x,y)
atype_required = mult->ytype ;
btype_required = mult->xtype ;
}
else
{
// A is passed as x, and B as y, in z = mult(x,y)
atype_required = mult->xtype ;
btype_required = mult->ytype ;
}
bool no_typecasting = (A->type == atype_required)
&& (B->type == btype_required) ;
//--------------------------------------------------------------------------
// compute C = A*B for built-in types and operators
//--------------------------------------------------------------------------
if (no_typecasting)
{
ASSERT_OK (GB_check (A->type, "A type for Gustavson builtin", GB0)) ;
ASSERT_OK (GB_check (B->type, "B type for Gustavson builtin", GB0)) ;
ASSERT_OK (GB_check (C->type, "C type for Gustavson builtin", GB0)) ;
#ifndef GBCOMPACT
// If the GB_AxB_Gustavson_builtin function has a worker for the
// particular semiring, then it does the computation and returns done =
// true. Otherwise, it returns done as false, and the generic worker
// below does the work.
// If GBCOMPACT is enabled at compile-time, then no built-in workers
// are created, and this function is not used. All C=A*B computations
// are done with the generic worker below.
bool done = false ;
info = GB_AxB_Gustavson_builtin (C, M, A, B, semiring, flipxy, &done,
Sauna) ;
ASSERT (info == GrB_SUCCESS) ;
if (done)
{
// C = A*B has been done via a hard-coded case
ASSERT_OK (GB_check (C, "C hard-coded for Gustavson C=A*B", GB0)) ;
ASSERT (*Chandle == C) ;
ASSERT_SAUNA_IS_RESET ;
(*mask_applied) = (M != NULL) ;
return (GrB_SUCCESS) ;
}
#endif
//----------------------------------------------------------------------
// user semirings created at compile time
//----------------------------------------------------------------------
// A precompiled function for C=A*B with user-defined semiring is
// called only if no typecasting is needed.
if (semiring->object_kind == GB_USER_COMPILED)
{
info = GB_AxB_user (GxB_AxB_GUSTAVSON, semiring, Chandle, M, A, B,
flipxy, false, NULL, NULL, NULL, 0, Sauna) ;
(*mask_applied) = (M != NULL) && (info == GrB_SUCCESS) ;
return (info) ;
}
}
//--------------------------------------------------------------------------
// generic Gustavson, any semiring, with or without typecasting
//--------------------------------------------------------------------------
// Define operations for GB_AxB_Gustavson_mask and GB_AxB_Gustavson_nomask,
// whether or not typecasting is needed.
#define GB_IDENTITY \
identity
// x [i] = y // to scatter C(i,j) to Work(i), of size zsize
#define GB_COPY_SCALAR_TO_ARRAY(x,i,y,s) \
memcpy (x +((i)*s), y, s) ;
// x [i] = y [j] // to gather C(i,j) from Work(i), of size zsize
#define GB_COPY_ARRAY_TO_ARRAY(x,i,y,j,s) \
memcpy (x +((i)*s), y +((j)*s), s) ;
// z = x*y
#define GB_MULTOP(z,x,y) fmult (z, x, y) ;
size_t asize = A->type->size ;
size_t bsize = B->type->size ;
size_t xsize = mult->xtype->size ;
size_t ysize = mult->ytype->size ;
// scalar workspace (after typecasting, if needed)
// flipxy false: aik = (xtype) A(i,k) and bkj = (ytype) B(k,j)
// flipxy true: aik = (ytype) A(i,k) and bkj = (xtype) B(k,j)
char aik [flipxy ? ysize : xsize] ;
char bkj [flipxy ? xsize : ysize] ;
GxB_binary_function fmult = mult->function ;
GxB_binary_function fadd = add->op->function ;
GB_void *restrict identity = add->identity ;
GB_void *restrict Cx = C->x ;
#define GB_HANDLE_FLIPXY true
#define GB_XTYPE GB_void
#define GB_YTYPE GB_void
if (no_typecasting)
{
//----------------------------------------------------------------------
// generic C=A*B or C<M>=A*B with any semiring, but no typecasting
//----------------------------------------------------------------------
// x = y [i] // for bkj = B(k,j), of size bsize
#define GB_COPY_ARRAY_TO_SCALAR(x,y,i,s) \
memcpy (x, y +((i)*s), s) ;
// generic multiply-add operation (with no mask). fadd: (z x alias)
#define GB_MULTADD_NOMASK \
{ \
/* Sauna_Work [i] += A(i,k) * B(k,j) */ \
GB_MULTIPLY (zwork, Ax +(pA*asize), bkj) ; \
fadd (Sauna_Work +(i*zsize), Sauna_Work +(i*zsize), zwork) ; \
}
// generic multiply-add operation (with mask)
#define GB_MULTADD_WITH_MASK \
{ \
/* Sauna_Work [i] += A(i,k) * B(k,j) */ \
if (mark == hiwater) \
{ \
/* first time C(i,j) seen */ \
/* Sauna_Work [i] = A(i,k) * B(k,j) */ \
GB_MULTIPLY (Sauna_Work +(i*zsize), Ax +(pA*asize), bkj) ; \
Sauna_Mark [i] = hiwater + 1 ; \
} \
else \
{ \
/* C(i,j) seen before, update it */ \
/* Sauna_Work [i] += A(i,k) * B(k,j) */ \
GB_MULTADD_NOMASK ; \
} \
}
#include "GB_AxB_Gustavson_flipxy.c"
}
else
{
//----------------------------------------------------------------------
// generic C=A*B or C<M>=A*B with any semiring, with any typecasting
//----------------------------------------------------------------------
GB_cast_function cast_A, cast_B ;
if (flipxy)
{
// A is typecasted to y, and B is typecasted to x
cast_A = GB_cast_factory (mult->ytype->code, A->type->code) ;
cast_B = GB_cast_factory (mult->xtype->code, B->type->code) ;
}
else
{
// A is typecasted to x, and B is typecasted to y
cast_A = GB_cast_factory (mult->xtype->code, A->type->code) ;
cast_B = GB_cast_factory (mult->ytype->code, B->type->code) ;
}
// x = y [i] // for bkj = B(k,j), of size bsize
#undef GB_COPY_ARRAY_TO_SCALAR
#define GB_COPY_ARRAY_TO_SCALAR(x,y,i,s) \
cast_B (x, y +((i)*s), s) ;
// generic multiply-add operation (with no mask). fadd: (z x alias)
#undef GB_MULTADD_NOMASK
#define GB_MULTADD_NOMASK \
{ \
/* Sauna_Work [i] += A(i,k) * B(k,j) */ \
cast_A (aik, Ax +(pA*asize), asize) ; \
GB_MULTIPLY (zwork, aik, bkj) ; \
fadd (Sauna_Work +(i*zsize), Sauna_Work +(i*zsize), zwork) ; \
}
// generic multiply-add operation (with mask)
#undef GB_MULTADD_WITH_MASK
#define GB_MULTADD_WITH_MASK \
{ \
/* Sauna_Work [i] += A(i,k) * B(k,j) */ \
if (mark == hiwater) \
{ \
/* first time C(i,j) seen */ \
/* Sauna_Work [i] = A(i,k) * B(k,j) */ \
cast_A (aik, Ax +(pA*asize), asize) ; \
GB_MULTIPLY (Sauna_Work +(i*zsize), aik, bkj) ; \
Sauna_Mark [i] = hiwater + 1 ; \
} \
else \
{ \
/* C(i,j) seen before, update it */ \
/* Sauna_Work [i] += A(i,k) * B(k,j) */ \
GB_MULTADD_NOMASK ; \
} \
}
#include "GB_AxB_Gustavson_flipxy.c"
}
//--------------------------------------------------------------------------
// return result
//--------------------------------------------------------------------------
ASSERT_SAUNA_IS_RESET ;
// cannot fail since C->plen is the upper bound: # non-empty columns of B
ASSERT (info == GrB_SUCCESS) ;
// if it could fail, do this:
// GB_OK (info) ; // check result and return if an error occurred
ASSERT_OK (GB_check (C, "C output for Gustavson C=A*B", GB0)) ;
ASSERT (*Chandle == C) ;
(*mask_applied) = (M != NULL) ;
return (GrB_SUCCESS) ;
}
| 40.532258 | 80 | 0.416008 |
73db15d9945264f878bc672d5d945ece3f419952 | 6,790 | c | C | benchmarks/Angha_original/extr_verifier_check_map_func_compatibility/extr_verifier_check_map_func_compatibility.c | ComputerSystemsLab/OptimizationCache | 9c30ae120673e57b772ea42e29e087f775aa9de9 | [
"Apache-2.0"
] | 2 | 2021-03-11T00:46:25.000Z | 2021-07-08T16:44:58.000Z | benchmarks/Angha_original/extr_verifier_check_map_func_compatibility/extr_verifier_check_map_func_compatibility.c | ComputerSystemsLab/OptimizationCache | 9c30ae120673e57b772ea42e29e087f775aa9de9 | [
"Apache-2.0"
] | null | null | null | benchmarks/Angha_original/extr_verifier_check_map_func_compatibility/extr_verifier_check_map_func_compatibility.c | ComputerSystemsLab/OptimizationCache | 9c30ae120673e57b772ea42e29e087f775aa9de9 | [
"Apache-2.0"
] | null | null | null | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct bpf_verifier_env {int subprog_cnt; } ;
struct bpf_map {int map_type; } ;
/* Variables and functions */
#define BPF_FUNC_current_task_under_cgroup 166
#define BPF_FUNC_get_local_storage 165
#define BPF_FUNC_get_stackid 164
int BPF_FUNC_map_delete_elem ;
int BPF_FUNC_map_lookup_elem ;
#define BPF_FUNC_map_peek_elem 163
#define BPF_FUNC_map_pop_elem 162
#define BPF_FUNC_map_push_elem 161
#define BPF_FUNC_msg_redirect_hash 160
#define BPF_FUNC_msg_redirect_map 159
#define BPF_FUNC_perf_event_output 158
#define BPF_FUNC_perf_event_read 157
#define BPF_FUNC_perf_event_read_value 156
#define BPF_FUNC_redirect_map 155
#define BPF_FUNC_sk_redirect_hash 154
#define BPF_FUNC_sk_redirect_map 153
#define BPF_FUNC_sk_select_reuseport 152
#define BPF_FUNC_sk_storage_delete 151
#define BPF_FUNC_sk_storage_get 150
#define BPF_FUNC_skb_under_cgroup 149
#define BPF_FUNC_sock_hash_update 148
#define BPF_FUNC_sock_map_update 147
#define BPF_FUNC_tail_call 146
#define BPF_MAP_TYPE_ARRAY_OF_MAPS 145
#define BPF_MAP_TYPE_CGROUP_ARRAY 144
#define BPF_MAP_TYPE_CGROUP_STORAGE 143
#define BPF_MAP_TYPE_CPUMAP 142
#define BPF_MAP_TYPE_DEVMAP 141
#define BPF_MAP_TYPE_DEVMAP_HASH 140
#define BPF_MAP_TYPE_HASH_OF_MAPS 139
#define BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE 138
#define BPF_MAP_TYPE_PERF_EVENT_ARRAY 137
#define BPF_MAP_TYPE_PROG_ARRAY 136
#define BPF_MAP_TYPE_QUEUE 135
#define BPF_MAP_TYPE_REUSEPORT_SOCKARRAY 134
#define BPF_MAP_TYPE_SK_STORAGE 133
#define BPF_MAP_TYPE_SOCKHASH 132
#define BPF_MAP_TYPE_SOCKMAP 131
#define BPF_MAP_TYPE_STACK 130
#define BPF_MAP_TYPE_STACK_TRACE 129
#define BPF_MAP_TYPE_XSKMAP 128
int EINVAL ;
int /*<<< orphan*/ func_id_name (int) ;
int /*<<< orphan*/ verbose (struct bpf_verifier_env*,char*,...) ;
__attribute__((used)) static int check_map_func_compatibility(struct bpf_verifier_env *env,
struct bpf_map *map, int func_id)
{
if (!map)
return 0;
/* We need a two way check, first is from map perspective ... */
switch (map->map_type) {
case BPF_MAP_TYPE_PROG_ARRAY:
if (func_id != BPF_FUNC_tail_call)
goto error;
break;
case BPF_MAP_TYPE_PERF_EVENT_ARRAY:
if (func_id != BPF_FUNC_perf_event_read &&
func_id != BPF_FUNC_perf_event_output &&
func_id != BPF_FUNC_perf_event_read_value)
goto error;
break;
case BPF_MAP_TYPE_STACK_TRACE:
if (func_id != BPF_FUNC_get_stackid)
goto error;
break;
case BPF_MAP_TYPE_CGROUP_ARRAY:
if (func_id != BPF_FUNC_skb_under_cgroup &&
func_id != BPF_FUNC_current_task_under_cgroup)
goto error;
break;
case BPF_MAP_TYPE_CGROUP_STORAGE:
case BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE:
if (func_id != BPF_FUNC_get_local_storage)
goto error;
break;
case BPF_MAP_TYPE_DEVMAP:
case BPF_MAP_TYPE_DEVMAP_HASH:
if (func_id != BPF_FUNC_redirect_map &&
func_id != BPF_FUNC_map_lookup_elem)
goto error;
break;
/* Restrict bpf side of cpumap and xskmap, open when use-cases
* appear.
*/
case BPF_MAP_TYPE_CPUMAP:
if (func_id != BPF_FUNC_redirect_map)
goto error;
break;
case BPF_MAP_TYPE_XSKMAP:
if (func_id != BPF_FUNC_redirect_map &&
func_id != BPF_FUNC_map_lookup_elem)
goto error;
break;
case BPF_MAP_TYPE_ARRAY_OF_MAPS:
case BPF_MAP_TYPE_HASH_OF_MAPS:
if (func_id != BPF_FUNC_map_lookup_elem)
goto error;
break;
case BPF_MAP_TYPE_SOCKMAP:
if (func_id != BPF_FUNC_sk_redirect_map &&
func_id != BPF_FUNC_sock_map_update &&
func_id != BPF_FUNC_map_delete_elem &&
func_id != BPF_FUNC_msg_redirect_map)
goto error;
break;
case BPF_MAP_TYPE_SOCKHASH:
if (func_id != BPF_FUNC_sk_redirect_hash &&
func_id != BPF_FUNC_sock_hash_update &&
func_id != BPF_FUNC_map_delete_elem &&
func_id != BPF_FUNC_msg_redirect_hash)
goto error;
break;
case BPF_MAP_TYPE_REUSEPORT_SOCKARRAY:
if (func_id != BPF_FUNC_sk_select_reuseport)
goto error;
break;
case BPF_MAP_TYPE_QUEUE:
case BPF_MAP_TYPE_STACK:
if (func_id != BPF_FUNC_map_peek_elem &&
func_id != BPF_FUNC_map_pop_elem &&
func_id != BPF_FUNC_map_push_elem)
goto error;
break;
case BPF_MAP_TYPE_SK_STORAGE:
if (func_id != BPF_FUNC_sk_storage_get &&
func_id != BPF_FUNC_sk_storage_delete)
goto error;
break;
default:
break;
}
/* ... and second from the function itself. */
switch (func_id) {
case BPF_FUNC_tail_call:
if (map->map_type != BPF_MAP_TYPE_PROG_ARRAY)
goto error;
if (env->subprog_cnt > 1) {
verbose(env, "tail_calls are not allowed in programs with bpf-to-bpf calls\n");
return -EINVAL;
}
break;
case BPF_FUNC_perf_event_read:
case BPF_FUNC_perf_event_output:
case BPF_FUNC_perf_event_read_value:
if (map->map_type != BPF_MAP_TYPE_PERF_EVENT_ARRAY)
goto error;
break;
case BPF_FUNC_get_stackid:
if (map->map_type != BPF_MAP_TYPE_STACK_TRACE)
goto error;
break;
case BPF_FUNC_current_task_under_cgroup:
case BPF_FUNC_skb_under_cgroup:
if (map->map_type != BPF_MAP_TYPE_CGROUP_ARRAY)
goto error;
break;
case BPF_FUNC_redirect_map:
if (map->map_type != BPF_MAP_TYPE_DEVMAP &&
map->map_type != BPF_MAP_TYPE_DEVMAP_HASH &&
map->map_type != BPF_MAP_TYPE_CPUMAP &&
map->map_type != BPF_MAP_TYPE_XSKMAP)
goto error;
break;
case BPF_FUNC_sk_redirect_map:
case BPF_FUNC_msg_redirect_map:
case BPF_FUNC_sock_map_update:
if (map->map_type != BPF_MAP_TYPE_SOCKMAP)
goto error;
break;
case BPF_FUNC_sk_redirect_hash:
case BPF_FUNC_msg_redirect_hash:
case BPF_FUNC_sock_hash_update:
if (map->map_type != BPF_MAP_TYPE_SOCKHASH)
goto error;
break;
case BPF_FUNC_get_local_storage:
if (map->map_type != BPF_MAP_TYPE_CGROUP_STORAGE &&
map->map_type != BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE)
goto error;
break;
case BPF_FUNC_sk_select_reuseport:
if (map->map_type != BPF_MAP_TYPE_REUSEPORT_SOCKARRAY)
goto error;
break;
case BPF_FUNC_map_peek_elem:
case BPF_FUNC_map_pop_elem:
case BPF_FUNC_map_push_elem:
if (map->map_type != BPF_MAP_TYPE_QUEUE &&
map->map_type != BPF_MAP_TYPE_STACK)
goto error;
break;
case BPF_FUNC_sk_storage_get:
case BPF_FUNC_sk_storage_delete:
if (map->map_type != BPF_MAP_TYPE_SK_STORAGE)
goto error;
break;
default:
break;
}
return 0;
error:
verbose(env, "cannot pass map_type %d into func %s#%d\n",
map->map_type, func_id_name(func_id), func_id);
return -EINVAL;
} | 30.177778 | 91 | 0.762592 |
293a0df55e03b34b1d0d9225187562154d84685f | 31,096 | c | C | source/asn_processor/ak_asn_write_new.c | anton-sakharov/asn_handler | 577910e5ab09a0f003397da6de5f8bfdb9e1c99d | [
"MIT"
] | 1 | 2019-07-08T08:47:18.000Z | 2019-07-08T08:47:18.000Z | source/asn_processor/ak_asn_write_new.c | anton-sakharov/asn_handler | 577910e5ab09a0f003397da6de5f8bfdb9e1c99d | [
"MIT"
] | null | null | null | source/asn_processor/ak_asn_write_new.c | anton-sakharov/asn_handler | 577910e5ab09a0f003397da6de5f8bfdb9e1c99d | [
"MIT"
] | null | null | null | #include "ak_asn_codec_new.h"
// TODO: проверить необходимость в подключении файлов
#ifdef LIBAKRYPT_HAVE_STDLIB_H
#include <stdlib.h>
#else
#error Library cannot be compiled without stdlib.h header
#endif
#ifdef LIBAKRYPT_HAVE_STRING_H
#include <string.h>
#else
#error Library cannot be compiled without string.h header
#endif
#ifdef LIBAKRYPT_HAVE_CTYPE_H
#include <ctype.h>
#include <stdio.h>
#else
#error Library cannot be compiled without ctype.h header
#endif
/*________________________________________________________________________ new realization ____________________________________________________________________*/
static int ak_asn_encode_tlv(ak_asn_tlv p_tlv, ak_byte** pp_pos, ak_byte* p_end)
{
int error; /* Код ошибки */
ak_uint32 size; /* Размер кодируемых данных */
if(!pp_pos || !p_end || !p_tlv)
return ak_error_null_pointer;
/* Вычисляем длину кодируемых в данный момент данных,
* чтобы проверить выход за границы выделенной памяти */
ak_asn_get_size(p_tlv, &size);
if((*pp_pos + size) > p_end)
return ak_error_message(ak_error_out_of_memory, __func__, "need more memory for encoding");
if(p_tlv->m_tag & CONSTRUCTED) /* Кодирование составных данных */
{
ak_uint8 index; /* Индекс элемента в массиве элементов составного объекта */
if((error = new_asn_put_tag(p_tlv->m_tag, pp_pos)) != ak_error_ok)
return ak_error_message(error, __func__, "failure in adding tag");
if((error = new_asn_put_len(p_tlv->m_data_len, p_tlv->m_len_byte_cnt, pp_pos)) != ak_error_ok)
return ak_error_message(error, __func__, "failure in adding data length");
for(index = 0; index < p_tlv->m_data.m_constructed_data->m_curr_size; index++)
{
if((error = ak_asn_encode_tlv(p_tlv->m_data.m_constructed_data->m_arr_of_data[index], pp_pos, p_end)) != ak_error_ok)
return error; /* Никакого сообщения не выводится, иначе выведется много одинаковых строчек (из-за рекурсии) */
}
}
else /* Кодирование примитивных данных */
{
new_asn_put_tag(p_tlv->m_tag, pp_pos);
new_asn_put_len(p_tlv->m_data_len, p_tlv->m_len_byte_cnt, pp_pos);
memcpy(*pp_pos, p_tlv->m_data.m_primitive_data, p_tlv->m_data_len);
(*pp_pos) += p_tlv->m_data_len;
}
return ak_error_ok;
}
int ak_asn_encode(ak_asn_tlv p_tlv, ak_byte** pp_asn_data, ak_uint32* p_size)
{
/* TODO FIXME: уточнить, нужно ли создавать отдельную переменную указатель на данные
и потом записывать ее значение во входной параметр? */
int error; /* Код ошибки */
if(!pp_asn_data || !p_size || !p_tlv)
return ak_error_null_pointer;
/* Пересчитываем длины, чтобы защититься от нежелательных ошибок */
if((error = ak_asn_update_size(p_tlv)) != ak_error_ok)
return ak_error_message(error, __func__, "failure in recalculating size");
/* Вычисляем объем памяти, необходимый для кодирования данных */
if((error = ak_asn_get_size(p_tlv, p_size)) != ak_error_ok)
return ak_error_message(error, __func__, "failure in getting size");
/* Выделяем память */
*pp_asn_data = (ak_byte*)malloc(*p_size);
if(!(*pp_asn_data))
{
*p_size = 0;
return ak_error_out_of_memory;
}
/* Кодируем данные */
if((error = ak_asn_encode_tlv(p_tlv, pp_asn_data, (*pp_asn_data) + (*p_size))) != ak_error_ok)
return ak_error_message(error, __func__, "failure in encoding ASN.1 data");
/* Возвращаем указатель на данные в их начало (он смещается внутри ф-ии ak_asn_encode_tlv()) */
(*pp_asn_data) -= *p_size;
return ak_error_ok;
}
int ak_asn_fill_root_tlv(ak_asn_tlv p_tlv, tag data_tag, ak_pointer p_data)
{
if(data_tag & CONSTRUCTED)
{
if(ak_asn_create_constructed_tlv(p_tlv, data_tag, ak_true) != ak_error_ok)
return -1;
}
else
{
}
return ak_error_ok;
}
int ak_asn_add(ak_asn_tlv p_tlv, tag data_tag, ak_pointer p_data, int (*encode)(ak_pointer, ak_pointer))
{
if(data_tag & CONSTRUCTED)
{
ak_uint8 obj_pos;
ak_asn_tlv p_obj;
obj_pos = p_tlv->m_data.m_constructed_data->m_curr_size;
p_obj = malloc(sizeof(s_asn_tlv_t));
if(!p_obj)
return ak_error_out_of_memory;
if(ak_asn_create_constructed_tlv(p_obj, data_tag, ak_true) != ak_error_ok)
return -1;
if(obj_pos == p_tlv->m_data.m_constructed_data->m_alloc_size)
{
//FIXME реализовать перевыделение памяти
return -1;
}
p_tlv->m_data.m_constructed_data->m_arr_of_data[obj_pos] = p_obj;
p_tlv->m_data_len = 1 + p_obj->m_data_len + p_obj->m_data_len;
p_tlv->m_len_byte_cnt = new_asn_get_len_byte_cnt(p_tlv->m_data_len);
}
return ak_error_ok;
}
/*________________________________________________________________________ /new realization ____________________________________________________________________*/
/* ----------------------------------------------------------------------------------------------- */
/*! @param tag тег
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_tag(tag tag, ak_byte** pp_buff)
{
if (!pp_buff)
return ak_error_message(ak_error_null_pointer, __func__, "bad pointer to buffer");
**pp_buff = tag;
(*pp_buff)++;
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param len длина данных
@param p_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_len(size_t len, ak_uint32 len_byte_cnt, ak_byte** pp_buff)
{
// if (!pp_buff)
// return ak_error_message(ak_error_null_pointer, __func__, "bad pointer to buffer");
//
// if (!len_byte_cnt)
// return ak_error_message(ak_error_null_pointer, __func__, "wrong length");
if (len_byte_cnt == 1)
{
(**pp_buff) = (ak_byte) len;
(*pp_buff)++;
}
else
{
(**pp_buff) = (ak_byte) (0x80u ^ (uint8_t) (--len_byte_cnt));
(*pp_buff)++;
do
{
(**pp_buff) = (ak_byte) ((len >> (8u * --len_byte_cnt)) & 0xFFu);
(*pp_buff)++;
}while (len_byte_cnt != 0);
}
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param val входное значение (описание формата значения находится в определении типа integer)
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_int(integer val, ak_byte** pp_buff, ak_uint32* p_size)
{
bool_t high_bit;
ak_uint8 val_len_byte_cnt;
if (!pp_buff)
return ak_error_null_pointer;
if (val <= 0xFFu)
val_len_byte_cnt = 1;
else if (val <= 0xFFFFu)
val_len_byte_cnt = 2;
else if (val <= 0xFFFFFFu)
val_len_byte_cnt = 3;
else if (val <= 0xFFFFFFFFu)
val_len_byte_cnt = 4;
else
{
*pp_buff = NULL;
*p_size = 0;
return ak_error_invalid_value;
}
/* Проверям, возведен ли старший бит в числе */
if((val >> ((val_len_byte_cnt - 1) * 8)) & 0x80)
{
high_bit = ak_true;
*p_size = val_len_byte_cnt + 1;
}
else
{
high_bit = ak_false;
*p_size = val_len_byte_cnt;
}
*pp_buff = malloc(*p_size);
if(!(*pp_buff))
{
*p_size = 0;
return ak_error_out_of_memory;
}
if(high_bit)
{
*((*pp_buff)++) = 0x00;
}
while(--val_len_byte_cnt > 0)
{
*((*pp_buff)++) = (ak_byte)((val >> (val_len_byte_cnt * 8)) & 0xFF);
}
**pp_buff = (ak_byte)(val & 0xFF);
// if (!val.mp_value)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// if (!val.m_positive && !(val.mp_value[0] & 0x80u))
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if (!val.m_positive)
// {
// memcpy(pp_buff, val.mp_value, val.m_val_len);
// }
// else
// {
// if (val.mp_value[0] & 0x80u)
// {
// *pp_buff = 0x00;
// pp_buff++;
// }
//
// memcpy(pp_buff, val.mp_value, val.m_val_len);
// }
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param str входная UTF-8 строка
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_utf8string(utf8_string str, ak_byte** pp_buff, ak_uint32* p_size)
{
*p_size = (ak_uint32)strlen((char*)str);
if (!str || !pp_buff)
return ak_error_null_pointer;
*pp_buff = malloc(*p_size);
if(!(*pp_buff))
{
*p_size = 0;
return ak_error_out_of_memory;
}
memcpy(*pp_buff, str, *p_size);
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param src массив октетов
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_octetstr(octet_string src, ak_byte** pp_buff, ak_uint32* p_size)
{
if (!pp_buff || !src.mp_value)
return ak_error_null_pointer;
*pp_buff = malloc(src.m_val_len);
if(!(*pp_buff))
return ak_error_out_of_memory;
memcpy(*pp_buff, src.mp_value, src.m_val_len);
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param src входная строка
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_vsblstr(visible_string str, ak_byte** pp_buff, ak_uint32* p_size)
{
*p_size = (ak_uint32)strlen(str);
if (!str || !pp_buff)
return ak_error_null_pointer;
*pp_buff = malloc(*p_size);
if(!(*pp_buff))
{
*p_size = 0;
return ak_error_out_of_memory;
}
memcpy(*pp_buff, str, strlen(str));
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! На данный момент добавляются только идентификаторы, у который первое число 1 или 2,
а второе не превосходит 32
@param obj_id входная строка, содержая идентификатор в виде чисел, разделенных точками
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_objid(object_identifier obj_id, ak_byte** pp_buff, ak_uint32* p_size)
{
// FIXME: Реализовать кодирования произовльного идентификатора
ak_uint64 num;
object_identifier p_objid_end;
if (!obj_id || !pp_buff)
return ak_error_null_pointer;
*p_size = new_asn_get_oid_byte_cnt(obj_id);
*pp_buff = malloc(*p_size);
if(!(*pp_buff))
{
*p_size = 0;
return ak_error_out_of_memory;
}
num = strtoul((char *) obj_id, &p_objid_end, 10);
obj_id = ++p_objid_end;
num = num * 40 + strtol((char *) obj_id, &p_objid_end, 10);
*((*pp_buff)++) = (ak_byte) num;
while (*p_objid_end != '\0')
{
obj_id = ++p_objid_end;
num = strtoul((char *) obj_id, &p_objid_end, 10);
if (num > 0x7Fu)
{
ak_byte seven_bits;
int8_t i;
i = 3;
while (i > 0)
{
seven_bits = (ak_byte) ((num >> ((uint8_t) i * 7u)) & 0x7Fu);
if (seven_bits)
*((*pp_buff)++) = (ak_byte) (0x80u ^ seven_bits);
i--;
}
}
*((*pp_buff)++) = (ak_byte) (num & 0x7Fu);
}
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param src входные данные (описание формата данных находится в определении типа bit_string)
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_bitstr(bit_string src, ak_byte** pp_buff, ak_uint32* p_size)
{
if (!src.mp_value || !pp_buff)
return ak_error_null_pointer;
if (src.m_unused > 7 || !src.m_val_len)
return ak_error_invalid_value;
/* 1 дополнительный байт для хранения кол-ва неиспользуемых бит в послднем байте данных */
*p_size = 1 + src.m_val_len;
*pp_buff = malloc(*p_size);
if(!(*pp_buff))
{
*p_size = 0;
return ak_error_out_of_memory;
}
*((*pp_buff)++) = src.m_unused;
memcpy(*pp_buff, src.mp_value, src.m_val_len);
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param val входное значение
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_bool(boolean val, ak_byte** pp_buff, ak_uint32* p_size)
{
if (!pp_buff)
return ak_error_null_pointer;
*p_size = 1;
*pp_buff = malloc(*p_size);
if(!(*pp_buff))
{
*p_size = 0;
return ak_error_out_of_memory;
}
if (val)
**pp_buff = 0xFFu;
else
**pp_buff = 0x00;
return ak_error_ok;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param time строка в формате "YYYY-MM-DD HH:MM:SS.[ms] UTC"
@param pp_buff указатель на область памяти, в которую записывается результат кодирования
@return В случае успеха функция возввращает ak_error_ok (ноль).
В противном случае, возвращается код ошибки. */
/* ----------------------------------------------------------------------------------------------- */
int new_asn_put_generalized_time(generalized_time time, ak_byte** pp_buff, ak_uint32* p_size)
{
if (!time || !pp_buff)
return ak_error_null_pointer;
*p_size = new_asn_get_gentime_byte_cnt(time);
if (*p_size < 15)
return ak_error_message(ak_error_invalid_value, __func__, "wrong length of time string");
*pp_buff = malloc(*p_size);
if(!(*pp_buff))
{
*p_size = 0;
return ak_error_out_of_memory;
}
/* YYYY */
for (uint8_t i = 0; i < 4; i++)
{
if (!isdigit(*time))
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong format of year value");
*((*pp_buff)++) = (ak_byte) *(time++);
}
time++;
/* MM */
for (uint8_t i = 0; i < 2; i++)
{
if (!isdigit(*time))
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong format of month value");
*((*pp_buff)++) = (ak_byte) *(time++);
}
time++;
/* DD */
for (uint8_t i = 0; i < 2; i++)
{
if (!isdigit(*time))
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong format of day value");
*((*pp_buff)++) = (ak_byte) *(time++);
}
time++;
/* HH */
for (uint8_t i = 0; i < 2; i++)
{
if (!isdigit(*time))
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong format of hour value");
*((*pp_buff)++) = (ak_byte) *(time++);
}
time++;
/* MM */
for (uint8_t i = 0; i < 2; i++)
{
if (!isdigit(*time))
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong format of minute value");
*((*pp_buff)++) = (ak_byte) *(time++);
}
time++;
/* SS */
for (uint8_t i = 0; i < 2; i++)
{
if (!isdigit(*time))
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong format of second value");
*((*pp_buff)++) = (ak_byte) *(time++);
}
/* .mmm */
if (*time == '.')
{
int8_t ms_cnt = (int8_t) ((strchr(time, ' ') - time) - 1);
if (ms_cnt == 0)
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "quota of second absent");
if (time[ms_cnt] == '0')
return ak_error_message(ak_error_wrong_asn1_encode,
__func__,
"wrong format of quota of second value (it can't end by 0 symbol)");
*((*pp_buff)++) = (ak_byte) *(time++); // помещаем символ точки
for (uint8_t i = 0; i < ms_cnt; i++)
{
if (!isdigit(*time))
return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong format of quota of second value");
*((*pp_buff)++) = (ak_byte) *(time++);
}
}
**pp_buff = 'Z';
return ak_error_ok;
}
///* ----------------------------------------------------------------------------------------------- */
///*! Функция добавляет стандартный тег ASN.1, длину данных, данные (если они присутствуют).
// В случае, когда tag_number = TSEQUENCE | TSET, параметр p_data должен быть равен NULL,
// а seq_or_set_len содержать длину данных, которые объединются в объект sequence или set.
// В остальных случаях параметр p_data указывает на область памяти с данными, а seq_or_set_len
// должен быть равен 0.
//
// @param tag_number номер стандартного тега
// @param p_data указатель на область памяти, в которой находятся данные для кодирования
// @param seq_or_set_len длина закодированных данных
// @param p_main_ps указатель на главный объект типа s_ptr_server
// @param p_result указатель на объект типа s_ptr_server, в который поместиться блок
// закодированных данных
// @return В случае успеха функция возввращает ak_error_ok (ноль).
// В противном случае, возвращается код ошибки. */
///* ----------------------------------------------------------------------------------------------- */
//int new_asn_put_universal_tlv(uint8_t tag_number,
// void *p_data,
// size_t seq_or_set_len,
// s_ptr_server *p_main_ps,
// s_ptr_server *p_result) {
// int error;
// size_t value_len;
// size_t len_byte_cnt;
//
// if (!tag_number || !p_main_ps || !p_result)
// return ak_error_message(ak_error_null_pointer, __func__, "input argument is null");
//
// value_len = 0;
// len_byte_cnt = 0;
//
// if (tag_number == TOCTET_STRING)
// {
// octet_string str = *((octet_string *) p_data);
//
// if (!p_data)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// if (!str.mp_value)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// value_len = str.m_val_len;
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt + value_len)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
//
// if ((error = new_asn_put_octetstr(str, p_main_ps->mp_curr + 1 + len_byte_cnt)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with adding octet string value");
// }
// else if (tag_number == TINTEGER)
// {
// integer num = *((integer *) p_data);
// if (!p_data)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// if (!num.mp_value)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// value_len = num.m_val_len;
// if (num.m_positive && (num.mp_value[0] & 0x80u))
// value_len += 1;
//
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt + value_len)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
//
// if ((error = new_asn_put_int(num, p_main_ps->mp_curr + len_byte_cnt + 1)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with adding integer value");
// }
// else if (tag_number == TBIT_STRING)
// {
// bit_string str = *((bit_string *) p_data);
//
// if (!p_data)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// if (!str.mp_value)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// value_len = str.m_val_len + 1; // 1 - для хранения кол-ва неиспользуемых битов
//
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt + value_len)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
//
// if ((error = new_asn_put_bitstr(str, p_main_ps->mp_curr + len_byte_cnt + 1)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with adding bit string value");
// }
// else if (tag_number == TGENERALIZED_TIME)
// {
// generalized_time time = *((generalized_time *) p_data);
//
// if (!p_data)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// value_len = new_asn_get_gentime_byte_cnt(time);
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
//
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt + value_len)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
//
// if ((error = new_asn_put_generalized_time(time, p_main_ps->mp_curr + len_byte_cnt + 1)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with adding generalized time value");
// }
// else if (tag_number == TOBJECT_IDENTIFIER)
// {
// object_identifier oid = *((object_identifier *) p_data);
//
// if (!p_data)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// value_len = new_asn_get_oid_byte_cnt(oid);
//
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt + value_len)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
//
// if ((error = new_asn_put_objid(oid, p_main_ps->mp_curr + len_byte_cnt + 1)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with adding object identifier value");
// }
// else if (tag_number == TUTF8_STRING)
// {
// utf8_string str = *((utf8_string *) p_data);
// value_len = strlen((char *) str);
//
// if (!p_data)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt + value_len)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
//
// if ((error = new_asn_put_utf8string(str, p_main_ps->mp_curr + len_byte_cnt + 1)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with adding utf8 string value");
// }
// else if (tag_number == TBOOLEAN)
// {
// boolean bval = *((boolean *) p_data);
//
// if (!p_data)
// return ak_error_message(ak_error_null_pointer, __func__, "null value");
//
// value_len = 1;
//
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt + value_len)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
//
// if ((error = new_asn_put_bool(bval, p_main_ps->mp_curr + len_byte_cnt + 1)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with adding boolean value");
// }
// else if (tag_number == TSEQUENCE || tag_number == TSET)
// {
// value_len = seq_or_set_len;
// tag_number |= CONSTRUCTED;
//
// len_byte_cnt = new_asn_get_len_byte_cnt(value_len);
// if (!len_byte_cnt)
// return ak_error_message(ak_error_wrong_asn1_encode, __func__, "wrong asn1 encode");
//
// if ((error = ps_move_cursor(p_main_ps, 1 + len_byte_cnt)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with moving cursor");
// }
//
// new_asn_put_tag(tag_number, p_main_ps->mp_curr);
//
// if ((error = new_asn_put_len(value_len, p_main_ps->mp_curr + 1)) != ak_error_ok)
// return ak_error_message(error, __func__, "problem with adding data length");
//
// if ((error = ps_set(p_result, p_main_ps->mp_curr, 1 + len_byte_cnt + value_len, PS_U_MODE)) != ak_error_ok)
// return ak_error_message(error, __func__, "problems with making union of asn data");
// return error;
//}
//
/* ----------------------------------------------------------------------------------------------- */
/*! @param len длина данных
@return Кол-во байтов, необходимое для хранения закодированной длины. */
/* ----------------------------------------------------------------------------------------------- */
ak_uint8 new_asn_get_len_byte_cnt(size_t len)
{
if (len < 0x80u && len >= 0)
return 1;
if (len <= 0xFFu)
return 2;
if (len <= 0xFFFFu)
return 3;
if (len <= 0xFFFFFFu)
return 4;
if (len <= 0xFFFFFFFFu)
return 5;
else
return 0;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param oid строка, содержая идентификатор в виде чисел, разделенных точками
@return Кол-во байтов, необходимое для хранения закодированного идентификатора. */
/* ----------------------------------------------------------------------------------------------- */
ak_uint8 new_asn_get_oid_byte_cnt(object_identifier oid) {
ak_uint8 byte_cnt;
object_identifier p_end;
size_t num;
if (!oid)
return 0;
byte_cnt = 1;
/* Пропускаем 2 первых идентификатора */
strtoul((char *) oid, &p_end, 10);
oid = ++p_end;
strtol((char *) oid, &p_end, 10);
while (*p_end != '\0')
{
oid = ++p_end;
num = (size_t) strtol((char *) oid, &p_end, 10);
if (num <= 0x7Fu) /* 0111 1111 - 7 бит */
byte_cnt += 1;
else if (num <= 0x3FFFu) /* 0011 1111 1111 1111 - 14 бит */
byte_cnt += 2;
else if (num <= 0x1FFFFFu) /* 0001 1111 1111 1111 1111 1111 - 21 бит */
byte_cnt += 3;
else if (num <= 0x0FFFFFFFu) /* 0000 1111 1111 1111 1111 1111 1111 1111 - 28 бит */
byte_cnt += 4;
else
return 0;
}
return byte_cnt;
}
/* ----------------------------------------------------------------------------------------------- */
/*! @param time строка, содержая время в формате "YYYY-MM-DD HH:MM:SS.[ms] UTC"
@return Кол-во байтов, необходимое для хранения закодированного времени. */
/* ----------------------------------------------------------------------------------------------- */
ak_uint8 new_asn_get_gentime_byte_cnt(generalized_time time) {
if (!time)
return 0;
/*
* 8 имеет след. смысл:
* - из строки "YYYY-MM-DD HH:MM:SS.[ms] UTC" удалить символы "-- :: UTC"
* - добавить символ "Z"
* Примечание: эл-ов ms может быть неограниченное кол-во.
*/
return (ak_uint8) (strlen(time) - 8);
}
| 37.196172 | 163 | 0.560972 |
34a88f27be6169f4239853a2afd08dd862cd011e | 628 | h | C | cocoa-sniff/ALGEncodingUtils.h | algal/cocoa-sniff | 70545586ba6e129ec56b0533ca1037f3486e542d | [
"CNRI-Python",
"Xnet",
"X11",
"AML"
] | 2 | 2015-01-19T19:11:37.000Z | 2015-06-03T06:26:13.000Z | cocoa-sniff/ALGEncodingUtils.h | algal/cocoa-sniff | 70545586ba6e129ec56b0533ca1037f3486e542d | [
"CNRI-Python",
"Xnet",
"X11",
"AML"
] | 1 | 2015-06-04T03:41:50.000Z | 2015-06-04T14:03:28.000Z | cocoa-sniff/ALGEncodingUtils.h | algal/cocoa-sniff | 70545586ba6e129ec56b0533ca1037f3486e542d | [
"CNRI-Python",
"Xnet",
"X11",
"AML"
] | null | null | null | //
// ALGUtilities.h
// OHI
//
// Created by Alexis Gallagher on 2011-12-29.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
void ALGPrintString(NSString * s);
void ALGPrintLnString(NSString * s);
@interface ALGEncodingUtils : NSObject
// encoding
+(NSStringEncoding)encodingForIANACharSetName:(NSString*)theIANAName;
+(NSString*)IANACharSetNameOfEncoding:(NSStringEncoding) encoding;
+(NSString*)stringWithContentsOfFile:(NSString*)filepath
tryingIANACharSetNames:(NSArray*)theIANACharSetNames
printAttemptedDecodings:(BOOL)printing;
@end
| 25.12 | 69 | 0.754777 |
51e325a0dc796682eb919606af44d52a530e1d6e | 2,863 | h | C | src/ChrysalisCore/Components/TimePiece/TimePieceComponent.h | ivanhawkes/Chrysalis | fa46a1b8fdf8f076c125083dd772a608b60d982b | [
"BSD-2-Clause"
] | 59 | 2016-07-31T14:54:11.000Z | 2022-03-05T16:42:29.000Z | code/ChrysalisCore/Components/TimePiece/TimePieceComponent.h | amasu/Chrysalis | 9d60e35e7cc1cd6af2227917c1be2fc7da75e03a | [
"BSD-2-Clause"
] | 2 | 2018-01-23T05:25:26.000Z | 2020-03-04T21:31:19.000Z | code/ChrysalisCore/Components/TimePiece/TimePieceComponent.h | amasu/Chrysalis | 9d60e35e7cc1cd6af2227917c1be2fc7da75e03a | [
"BSD-2-Clause"
] | 18 | 2017-03-28T09:45:59.000Z | 2021-04-13T20:46:28.000Z | #pragma once
#include "Entities/Interaction/IEntityInteraction.h"
#include <DefaultComponents/Geometry/BaseMeshComponent.h>
namespace Chrysalis
{
/**
A TimePiece extension.
**/
class CTimePieceComponent
: public Cry::DefaultComponents::CBaseMeshComponent
{
protected:
// IEntityComponent
void Initialize() override;
void ProcessEvent(const SEntityEvent& event) override;
Cry::Entity::EventFlags GetEventMask() const override { return Cry::DefaultComponents::CBaseMeshComponent::GetEventMask() | EEntityEvent::Update; }
// ~IEntityComponent
// IEditorEntityComponent
virtual bool SetMaterial(int slotId, const char* szMaterial) override;
// ~IEditorEntityComponent
public:
CTimePieceComponent() {}
virtual ~CTimePieceComponent() {}
static void ReflectType(Schematyc::CTypeDesc<CTimePieceComponent>& desc);
static CryGUID& IID()
{
static CryGUID id = "{64F5CEFC-3098-4166-8860-4C82DEAFEA11}"_cry_guid;
return id;
}
struct STimePieceProperties
{
inline bool operator==(const STimePieceProperties &rhs) const { return 0 == memcmp(this, &rhs, sizeof(rhs)); }
Vec3 axis { 0.0f, 1.0f, 0.0f };
Schematyc::Range<0, 24> hour = 0.0f;
Schematyc::Range<0, 60> minute = 0.0f;
Schematyc::Range<0, 60> second = 0.0f;
};
virtual void Update(SEntityUpdateContext* pCtx);
virtual void SetCharacterFile(const char* szPath) { m_filePath = szPath; };
const char* GetCharacterFile() const { return m_filePath.value.c_str(); }
// Loads character and mannequin data from disk.
virtual void LoadFromDisk();
// Applies the character to the entity.
virtual void ResetObject();
// Helper to allow exposing derived function to Schematyc.
virtual void SetMeshType(Cry::DefaultComponents::EMeshType type) { SetType(type); }
void SetHour(const float hour)
{
m_timePieceProperties.hour = hour;
}
void SetMinute(const float minute)
{
m_timePieceProperties.minute = minute;
}
void SetSecond(const float second)
{
m_timePieceProperties.second = second;
}
protected:
Schematyc::CharacterFileName m_filePath;
Schematyc::MaterialFileName m_materialPath;
_smart_ptr<ICharacterInstance> m_pCachedCharacter = nullptr;
STimePieceProperties m_timePieceProperties;
};
static void ReflectType(Schematyc::CTypeDesc<CTimePieceComponent::STimePieceProperties>& desc)
{
desc.SetGUID("{C0D6D7AC-9D54-48AA-A9F9-DC85CF579632}"_cry_guid);
desc.AddMember(&CTimePieceComponent::STimePieceProperties::axis, 'axis', "Axis", "Axis", "Axis around which the hands will rotate", Vec3(0.0f, 1.0f, 0.0f));
desc.AddMember(&CTimePieceComponent::STimePieceProperties::hour, 'hour', "Hours", "Hours", nullptr, 0.0f);
desc.AddMember(&CTimePieceComponent::STimePieceProperties::minute, 'mins', "Minutes", "Minutes", nullptr, 0.0f);
desc.AddMember(&CTimePieceComponent::STimePieceProperties::second, 'secs', "Seconds", "Seconds", nullptr, 0.0f);
}
} | 30.457447 | 157 | 0.757248 |
ab00da9115c23c46878b8aca4fe8c4c8c859d0ba | 2,914 | c | C | history_queue.c | TheRealMedi/simple_shell | bdf04df5c5995aa49dd0b022631ac0f3ad24e863 | [
"MIT"
] | 1 | 2021-12-02T19:41:57.000Z | 2021-12-02T19:41:57.000Z | history_queue.c | TheRealMedi/simple_shell | bdf04df5c5995aa49dd0b022631ac0f3ad24e863 | [
"MIT"
] | null | null | null | history_queue.c | TheRealMedi/simple_shell | bdf04df5c5995aa49dd0b022631ac0f3ad24e863 | [
"MIT"
] | 1 | 2021-12-09T20:26:13.000Z | 2021-12-09T20:26:13.000Z | #include "shell.h"
/*
* File: "history_queue.c"
* Author(s): Imanol Asolo <3848@holbertonschool.com>
* Andrés Medina <3371@holbertonschool.com>
* Alex Arévalo <3915@holbertonschool.com>
*/
/**
* get_history - Checks if there is a history file present, pulls from that
* or creates a new queue if no file is found.
* Return: Pointer to new queue in memory.
*/
his_q_t *get_history()
{
/* check if history file exists, if it does read / build q from it */
/* else */
return (create_h_queue());
}
/**
* create_h_queue - Creates the queue of nodes.
* Return: Address of node.
*/
his_q_t *create_h_queue()
{
his_q_t *seq = malloc(sizeof(his_q_t));
if (!seq)
return (NULL);
seq->head = seq->tail = NULL;
return (seq);
}
/**
* h_enqueue - Adds new node to the head.
* @seq: Pointer to sequence.
* @command: Points to the first char in the stream.
* Return: 0 for failure or 1 success.
*/
int h_enqueue(his_q_t *seq, char *command)
{
int p_no = 0;
history_t *new_node;
if (seq->tail)
p_no = seq->tail->priority_number + 1;
new_node = create_history_t(command, p_no);
if (!new_node)
return (0);
if (!seq->tail)
{
seq->head = new_node;
seq->tail = new_node;
return (1);
}
seq->tail->next = new_node;
seq->tail = new_node;
return (1);
}
/**
* h_dequeue - Removes the node after executed.
* @seq: Pointer to the history sequence.
* Return: Node that was removed.
*/
history_t *h_dequeue(his_q_t *seq)
{
history_t *old_node = NULL;
if (!seq->head)
return (NULL);
old_node = seq->head;
seq->head = seq->head->next;
if (!seq->head)
seq->tail = NULL;
return (old_node);
}
/**
* write_h_queue - Writes the input node to a file descriptor.
* @seq: Pointer to the sequence.
* @fd: File descriptor.
* Description: 4 bytes = \t + 2 spaces + \n
* 3 bytes = \t + 2 spaces.
* Return: none.
*/
void write_h_queue(his_q_t *seq, int fd)
{
int s_command = 0, s_number = 0, total = 0, i, j, k, s_i = 0;
char *priority_n_s = NULL, *node_buffer = NULL;
history_t *temp = NULL;
if (!seq)
return;
temp = seq->head;
while (temp)
{
priority_n_s = get_int(temp->priority_number);
if (!priority_n_s)
return;
s_number = _strlen(priority_n_s);
s_command = _strlen(temp->command);
total = s_number + s_command + 4;
s_i = s_number + 3;
node_buffer = malloc(sizeof(char) * total);
if (!node_buffer)
return;
i = j = k = 0;
while (i < total)
{
if (i == 0)
node_buffer[i] = '\t';
else if (i < s_number + 1)
node_buffer[i] = priority_n_s[j++];
else if (i < s_i)
node_buffer[i] = ' ';
else if (i < total - 1)
node_buffer[i] = temp->command[k++];
else
node_buffer[i] = '\n';
i++;
}
free(priority_n_s); /* total - 1: forget \0 */
write(fd, node_buffer, total - 1);
free(node_buffer);
temp = temp->next;
}
}
| 20.377622 | 76 | 0.612217 |
823396d3e3b6b1e38d7a793d2f8900f6cd224e52 | 22,527 | h | C | Vibe/Plug-ins/MAXON CINEWARE AE/(CINEWARE Support)/bin/resource/coffeesymbols_old.h | kaapiel/Vibe-Rendering-Template | d2aee7aab21dc32831e9e298576caac3db7bdef3 | [
"Apache-2.0"
] | 1 | 2022-02-06T06:24:04.000Z | 2022-02-06T06:24:04.000Z | Vibe/Plug-ins/MAXON CINEWARE AE/(CINEWARE Support)/lite/resource/coffeesymbols_old.h | kaapiel/Vibe-Rendering-Template | d2aee7aab21dc32831e9e298576caac3db7bdef3 | [
"Apache-2.0"
] | null | null | null | Vibe/Plug-ins/MAXON CINEWARE AE/(CINEWARE Support)/lite/resource/coffeesymbols_old.h | kaapiel/Vibe-Rendering-Template | d2aee7aab21dc32831e9e298576caac3db7bdef3 | [
"Apache-2.0"
] | null | null | null | enum
{
DTYPE_CHILDS=0,
DESC_CHILDS=4,
BASEBITMAP_DATA_GAMMA=1000,
BASEBITMAP_DATA_EXPOSURE=1001,
BASEBITMAP_DATA_TARGETGAMMA=1002,
ID_GV_OPGROUP_DESCRIPTOR=1001105,
ID_GV_OPCLASS_DESCRIPTOR=1001106,
ID_GV_VALGROUP_DESCRIPTOR=1001107,
ID_GV_VALUE_DESCRIPTOR=1001108,
ID_GV_DATA_DESCRIPTOR=1001109,
GV_INVALID_POS_VALUE=2147483647,
UPDATE_CHILDS=1,
SCENEHOOKDRAW_ACTIVE_PASS=1,
SCENEHOOKDRAW_INACTIVE_PASS=2,
SHADER_RAYTRACING_EX=1,
SHADER_ASYNC_EX=16777216,
SHADER_TRANSFORM_N=32,
CHANNEL_RAYTRACING_EX=1,
CHANNEL_DIRECTBUMP_EX=2,
CHANNEL_TRANSFORM_N=8,
RAY_OK=0,
RAY_NOMEM=1,
RAY_TEXMISSING=2,
RAY_MP=4,
RAY_IMAGE=5,
RAY_USERBREAK=6,
RAY_GICACHE=7,
MSG_GETALLSTRINGS=112004,
MSG_SETDATA=112000,
MSG_GETDATA=112001,
VPobjectmotionblur=1001011,
BITMAPBUTTON_IGNORE_BITMAP_HEIGTH=1768386152,
CUSTOMGUI_TEXGROUP=1001050,
CUSTOMDATATYPE_TEXGROUP=1001051,
FILEERROR_MEMORY=-7,
FILE_NODIALOG=0,
FILE_DIALOG=1,
FILE_IGNOREOPEN=2,
IMAGE_OK=1,
IMAGE_NOTEXISTING=-1,
IMAGE_WRONGTYPE=-2,
IMAGE_NOMEM=-3,
IMAGE_DISKERROR=-4,
IMAGE_FILESTRUCT=-5,
GE_READ=1,
GE_WRITE=2,
GE_APPEND=0,
GE_READWRITE=3,
GE_START=0,
GE_RELATIVE=2,
GE_SAVE=1,
GE_DIRECTORY=2,
GE_WIN=1,
GE_MAC=2,
GE_MOTOROLA=1,
GE_INTEL=2,
GEMB_OK=0,
GEMB_OKCANCEL=1,
GEMB_ABORTRETRYIGNORE=2,
GEMB_YESNOCANCEL=3,
GEMB_YESNO=4,
GEMB_RETRYCANCEL=5,
GEMB_ICONSTOP=16,
GEMB_ICONQUESTION=32,
GEMB_ICONEXCLAMATION=48,
GEMB_ICONASTERISK=64,
GEMB_MULTILINE=128,
GEMB_R_OK=1,
GEMB_R_CANCEL=2,
GEMB_R_ABORT=3,
GEMB_R_RETRY=4,
GEMB_R_IGNORE=5,
GEMB_R_YES=6,
GEMB_R_NO=7,
DIRTY_MATRIX=2,
DIRTY_DATA=4,
DIRTY_SELECT=8,
DIRTY_CACHE=16,
DIRTY_CHILDREN=32,
VERSION_CINEMA4D=1,
VERSION_BODYPAINT=2,
VERSION_NET=4,
VERSION_SERVER=8,
VERSION_DEMO=16,
VERSION_BENCHMARK=64,
VERSION_BODYPAINT2_EX=128,
VERSION_MODELER=256,
VERSION_BPSTANDALONE=1024,
VERSION_UPDATER=2048,
VERSION_SAVABLEDEMO=4096,
VERSION_SAVABLEDEMO_ACTIVE=8192,
VERSION_INSTALLER=16384,
MODIFY_ALL=0,
MODIFY_POINTSELECTION=1,
MODIFY_POLYGONSELECTION=2,
MODIFY_EDGESELECTION=3,
SYSTEMINFO_OSX=1,
SYSTEMINFO_NOGUI=2,
FSTYPE_ANYTHING=0,
FSTYPE_IMAGES=1,
FSTYPE_SCENES=2,
FSTYPE_COFFEE=3,
CINTER_SPLINE=1,
CINTER_LINEAR=2,
CINTER_STEP=3,
true=1,
false=0,
null=0,
BIT_AAMAN=16,
BIT_AFOLD=128,
BIT_ADOC=2,
BIT_AMAT=2,
BIT_ARDATA=268435456,
BIT_ATAG=2,
BIT_AOBJ=2,
BIT_TFOLD=32768,
BIT_ADIA=2,
MY_ACTIVE=536870912,
BIT_AAMAN_PX=512,
BIT_AAMAN_LX=1024,
BIT_AAMAN_RX=2048,
BIT_AAMAN_PY=512,
BIT_AAMAN_LY=1024,
BIT_AAMAN_RY=2048,
BIT_AAMAN_PZ=512,
BIT_AAMAN_LZ=1024,
BIT_AAMAN_RZ=2048,
Tlinear=0,
Tcubic=1,
Takima=2,
Tbspline=3,
Thermite=4,
Inone=0,
Inatural=1,
Iuniform=2,
Iadaptive=3,
Isubdiv=4,
LOAD_OK=0,
LOAD_NOMEM=-100,
LOAD_NOTFOUND=-101,
LOAD_UNKNOWN=-102,
LOAD_DOUBLENAME=-105,
ANIMINFO_QUICK=1,
MATERIALGROUP_ID=100,
MATERIALGROUP_NAME=101,
MATERIALGROUP_SELECTED=102,
Tbaselist4d=110051,
Obone=5123,
Ohypernurbs=5127,
ID_RENDERDATA=110304,
Tanchor=5608,
Tkinematic=5614,
Thermite2d=5617,
Tfixexpression=5677,
Tikexpression=5679,
CTp2p=100001744,
MDATA_RESETSYSTEM_NORM=2163,
MDATA_RESETSYSTEM_ORTHO=2164,
OBSOLETE_WPREF_UNITS_COLOR=10002,
WPREF_RATIO_X=10005,
WPREF_RATIO_Y=10006,
WPREF_HPB_SYSTEM=1001,
WPREF_CENTER=1002,
WPREF_BACKUP=1003,
WPREF_RENDERMATS_EX=1004,
WPREF_ONLY_ACTIVEVIEW=1010,
WPREF_SAVE_OPENGL=1012,
WPREF_SAVE_PARTICLES=1013,
WPREF_DELETEATQUADS=1015,
WPREF_INSERTAT=1016,
WPREF_PASTEAT=1017,
WPREF_MULTISPLINEDRAW=1021,
WPREF_3DGRID=1032,
WPREF_OPENGL_DUALPLANES_ACTIVE=1036,
WPREF_ONLY_ACTIVEVIEW_ANIMATION=1039,
WPREF_REALTIMESPINNER=1040,
WPREF_REWIND=1045,
WPREF_VIEWGAMMA=1067,
COLORSYSTEM_RGB=10,
COLORSYSTEM_HSV=20,
WPREF_AUTOSAVE_MODE=1404,
WPREF_AUTOSAVE_CURRENTDOC=0,
WPREF_AUTOSAVE_ALLDOCS=1,
WPREF_BUBBLEHELP1=21001,
WPREF_DIALOGSTYLE=21008,
WPREF_DIALOGALIGN=21009,
WPREF_DELAY_MENU=21010,
WPREF_DELAY_MENUSCROLL=21011,
WPREF_DELAY_CMDPOPUP=21012,
WPREF_DELAY_DRAGSCROLL=21013,
WPREF_DELAY_SCROLLER1=21014,
WPREF_DELAY_SCROLLER2=21015,
WPREF_DELAY_TABSWITCH=21016,
WPREF_PATTERN_TIMESLIDER=21040,
WPREF_PATTERN_BG=21041,
WPREF_PATTERN_BGEDIT=21042,
WPREF_PATTERN_BGGADGET=21043,
WPREF_PATTERN_BGFOCUS=21044,
WPREF_PATTERN_DBARBG1=21045,
WPREF_PATTERN_DBARBG2=21046,
WPREF_PATTERN_USE=21060,
WPREF_MAC_ALLOWSTOPSLEEP=21064,
WPREF_MOUSEOVER_AUTO=21071,
WPREF_MOUSEOVER_TIME=21073,
WPREF_ONLINEHELP_MODE=21074,
ONLINEHELP_MODE_LOCAL=0,
ONLINEHELP_MODE_HTTP=1,
WPREF_TOOLCURSOR_ADVANCED=21080,
WPREF_ONLINEUPDATER_MD_PATH1=40010,
WPREF_ONLINEUPDATER_MD_PATH2=40020,
WPREF_ONLINEUPDATER_MD_PATH3=40021,
WPREF_ONLINEUPDATER_MD_PATH4=40022,
WPREF_FILEPATH_ALL=90000,
WPREF_FILEPATH_TEX=90001,
WPREF_FILEPATH_MAT=90002,
WPREF_FILEPATH_DOC=90003,
WPREF_FILEPATH_PRF=90004,
WPREF_FILEPATH_CAT=90005,
WPREF_FILEPATH_WAV=90006,
WPREF_FILEPATH_COF=90007,
WPREF_FILEPATH_FCV=90008,
WPREF_FILEPATH_BP=90022,
EVMSG_FRAME_SCENE=-1005,
VFLAG_POLYGONAL=16,
FORMAT_FCV=1019,
FORMAT_C4D_6_XML=1021,
COLOR_XOR=998,
BMP_DARKEN=2,
ID_SCROLLGROUP_STATUSBAR_EXT_GROUP=200000239,
DIALOG_FREECHILDS=18,
DIALOG_PROGRESSBAR=61,
DLG_HELP=4,
DLG_=5,
ANIMATE_NO_PARTICLES=4,
ANIMATE_QUICK=8,
ANIMATE_NOT_KEYFRAME=16,
ANIMATE_NOT_UPWARDS=32,
ANIMATE_NO_CHILDS=64,
ANIMATE_INRENDER=128,
Uobject_rek=40,
Uobject=41,
Uobj_data=42,
Umat_data=40,
Utag_data=40,
Uobj_new=44,
Uselection=43,
UNDO_CHANGE=40,
UNDO_CHANGE_NOCHILDS=41,
UNDO_CHANGE_SMALL=42,
UNDO_CHANGE_SELECTION=43,
UNDO_NEW=44,
UNDO_DELETE=45,
UNDO_ACTIVATE=46,
UNDO_DEACTIVATE=47,
UNDO_BITS=48,
UNDO_OBJECT_REC=40,
UNDO_OBJECT=41,
UNDO_OBJECT_BASEDATA_REC=42,
UNDO_OBJECT_BASEDATA=40,
UNDO_OBJECT_NEW=44,
UNDO_OBJECT_DEL=45,
UNDO_OBJECT_ACTIVE=46,
UNDO_OBJECT_SELECTION=43,
UNDO_MATERIAL_DATA=40,
UNDO_MATERIAL_NEW=44,
UNDO_MATERIAL_DEL=45,
UNDO_TAG_DATA=40,
UNDO_TAG_NEW=44,
UNDO_TAG_DEL=45,
UNDO_KEY_DATA=40,
UNDO_KEY_NEW=44,
UNDO_KEY_DEL=45,
UNDO_SEQUENCE_DATA=40,
UNDO_SEQUENCE_NEW=44,
UNDO_SEQUENCE_DEL=45,
UNDO_TRACK_DATA=40,
UNDO_TRACK_NEW=44,
UNDO_TRACK_DEL=45,
RDATA_DPI=10022,
MARKERKEY_NAME=1,
ALIGNTOPATH_ANGLE=1,
ALIGNTOPATH_LOOKAHEAD=1,
VISIBILITYKEY_VALUE=1,
ALIGNTOSPLINEKEY_NAME=1,
ALIGNTOSPLINEKEY_TANGENTIAL=1,
KINEMATICKEY_NAME=1,
TARGETKEY_NAME=1,
MORPHKEY_NAME=1,
TEXTUREKEY_OX=1,
TEXTUREKEY_OY=1,
TEXTUREKEY_LENX=1,
TEXTUREKEY_LENY=1,
TEXTUREKEY_TILE=1,
TEXTUREKEY_SEAMLESS=1,
TEXTUREKEY_MIX=1,
TEXTUREKEY_PROJECTION=1,
TEXTUREKEY_SIDE=1,
TEXTUREKEY_RESTRICTION=1,
PULSATEKEY_POS_AMP=1,
PULSATEKEY_SCALE_AMP=1,
PULSATEKEY_ROT_AMP=1,
PULSATEKEY_POS_FREQ=1,
PULSATEKEY_SCALE_FREQ=1,
PULSATEKEY_ROT_FREQ=1,
VIBRATEKEY_POS_V=1,
VIBRATEKEY_SCALE_V=1,
VIBRATEKEY_ROT_V=1,
VIBRATEKEY_FREQUENCY=1,
VIBRATEKEY_SEED=1,
FOLDERKEY_VALUE=1,
MSG_MATERIALS_CHANGED=3,
MSG_MARK_MATERIALS=1073741828,
OBJECT_POLYGON=5100,
OBJECT_SPLINE=5101,
OBJECT_LIGHT=5102,
OBJECT_CAMERA=5103,
OBJECT_FLOOR=5104,
OBJECT_SKY=5105,
OBJECT_ENVIRONMENT=5106,
OBJECT_LOFT=5107,
OBJECT_FFD=5108,
OBJECT_PARTICLE=5109,
OBJECT_DEFLECTOR=5110,
OBJECT_GRAVITATION=5111,
OBJECT_ROTATION=5112,
OBJECT_WIND=5113,
OBJECT_FRICTION=5114,
OBJECT_TURBULENCE=5115,
OBJECT_EXTRUDE=5116,
OBJECT_LATHE=5117,
OBJECT_SWEEP=5118,
OBJECT_ATTRACTOR=5119,
OBJECT_BEZIER=5120,
OBJECT_FOREGROUND=5121,
OBJECT_BACKGROUND=5122,
OBJECT_BONE=5123,
OBJECT_DESTRUCTOR=5124,
OBJECT_METABALL=5125,
OBJECT_INSTANCE=5126,
OBJECT_HYPERNURBS=5127,
OBJECT_BEND=5128,
OBJECT_BULGE=5129,
OBJECT_SHEAR=5131,
OBJECT_TAPER=5133,
OBJECT_TWIST=5134,
OBJECT_WAVE=5135,
OBJECT_STAGE=5136,
OBJECT_MICROPHONE=5138,
OBJECT_LOUDSPEAKER=5139,
OBJECT_NULL=5140,
OBJECT_PRIMITIVE=5141,
OBJECT_SYMMETRY=5142,
OBJECT_WRAP=5143,
OBJECT_BOOLE=1010865,
OBJECT_EXPLOSION=5145,
OBJECT_FORMULA=5146,
OBJECT_MELT=5147,
OBJECT_SHATTER=5148,
OBJECT_WINDDEFORM=5149,
OBJECT_ARRAY=5150,
OBJECT_HEADPHONE=5151,
OBJECT_SPLINEPRIMITIVE=5152,
OBJECT_CONPLANE=5153,
OBJECT_CUBE=5159,
OBJECT_SPHERE=5160,
OBJECT_PLATONIC=5161,
OBJECT_CONE=5162,
OBJECT_TORUS=5163,
OBJECT_DISC=5164,
OBJECT_TUBE=5165,
OBJECT_FIGURE=5166,
OBJECT_PYRAMID=5167,
OBJECT_PLANE=5168,
OBJECT_FRACTAL=5169,
OBJECT_CYLINDER=5170,
OBJECT_CAPSULE=5171,
OBJECT_OILTANK=5172,
OBJECT_RELIEF=5173,
OBJECT_POLY=5174,
OBJECT_SPLINEFORMULA=5177,
OBJECT_SPLINETEXT=5178,
OBJECT_SPLINENSIDE=5179,
OBJECT_SPLINE4SIDE=5180,
OBJECT_SPLINECIRCLE=5181,
OBJECT_SPLINEARC=5182,
OBJECT_SPLINECISSOID=5183,
OBJECT_SPLINECYCLOID=5184,
OBJECT_SPLINEPROFILE=5175,
OBJECT_SPLINEHELIX=5185,
OBJECT_SPLINERECTANGLE=5186,
OBJECT_SPLINEFLOWER=5176,
OBJECT_SPLINESTAR=5187,
OBJECT_SPLINECOGWHEEL=5188,
OBJECT_SPLINECONTOUR=5189,
CL_NO_BITS=16,
CL_ONLY_VISIBLETAGS=0,
CL_NO_TRACKS=8,
CL_NO_HIERARCHY=4,
CAMERAOBJECT_FOCUS=500,
CAMERAOBJECT_ZOOM=1000,
CAMERAOBJECT_PROJECTION=1001,
CAMERAOBJECT_DEPTHTYPE=1002,
CAMERAOBJECT_DEPTHFRONT=1003,
CAMERAOBJECT_DEPTHMIDDLE=1010,
CAMERAOBJECT_DEPTHBACK=1005,
INSTANCEOBJECT_SOURCE=999,
LMOBJECT_DOPPLER=1008,
LMOBJECT_DFACTOR=1009,
PARTICLEOBJECT_LASTT=999,
PARTICLEOBJECT_LASTP=999,
STAGEOBJECT_CNAME=999,
STAGEOBJECT_SNAME=999,
STAGEOBJECT_FNAME=999,
STAGEOBJECT_BNAME=999,
STAGEOBJECT_ENAME=999,
HYPERNURBSOBJECT_SUBEDITOR=1000,
HYPERNURBSOBJECT_SUBRAY=1001,
PRIM_CUBE_FILLET=1105,
PRIM_CONE_TYPE=1136,
PRIM_CONE_TFILLET=1137,
PRIM_CONE_BFILLET=1138,
PRIM_CONE_TFILLETY=1139,
PRIM_CONE_BFILLETY=1140,
PRIM_CONE_TFILANGLE=1142,
PRIM_CONE_BFILANGLE=1143,
PRIM_TEXT_USE_PS=2110,
PRIMITIVE_CUBE=1000,
PRIMITIVE_SPHERE=1001,
PRIMITIVE_PLATONIC=1002,
PRIMITIVE_CONE=1003,
PRIMITIVE_TORUS=1004,
PRIMITIVE_DISC=1005,
PRIMITIVE_TUBE=1006,
PRIMITIVE_FIGURE=1007,
PRIMITIVE_PYRAMID=1008,
PRIMITIVE_PLANE=1009,
PRIMITIVE_FRACTAL=1010,
PRIMITIVE_CYLINDER=1011,
PRIMITIVE_CAPSULE=1012,
PRIMITIVE_OILTANK=1013,
PRIMITIVE_RELIEF=1014,
PRIMITIVE_POLY=1015,
PRIMITIVE_FORMULA=1016,
PRIMITIVE_TEXT=1017,
PRIMITIVE_NSIDE=1018,
PRIMITIVE_4SIDE=1019,
PRIMITIVE_CIRCLE=2000,
PRIMITIVE_ARC=2001,
PRIMITIVE_CISSOID=2002,
PRIMITIVE_CYCLOID=2003,
PRIMITIVE_PROFILE=2004,
PRIMITIVE_HELIX=2005,
PRIMITIVE_RECTANGLE=2006,
PRIMITIVE_FLOWER=2007,
PRIMITIVE_STAR=2008,
PRIMITIVE_COGWHEEL=2009,
PRIMITIVE_CONTOUR=2010,
PHONGTAG_PHONG=1000,
COFFEEEXPRESSIONTAG_PASS=1500,
COFFEEEXPRESSIONTAG_TEXT=1000,
TARGETEXPRESSIONTAG_NAME=1000,
IKEXPRESSIONTAG_NAME=1000,
SUNEXPRESSIONTAG_DATE=1001,
SUNEXPRESSIONTAG_TIME=1002,
EXPRESSIONTAG_PASS=999103,
KINEMATICTAG_MIN_W=1003,
KINEMATICTAG_MAX_W=1004,
KINEMATICTAG_DAMP_W=1005,
COMPOSITINGTAG_CAST_SHADOW=1000,
COMPOSITINGTAG_RECEIVE_SHADOW=1001,
COMPOSITINGTAG_SEEN_BY_CAMERA=1002,
COMPOSITINGTAG_SEEN_BY_RAYS=1003,
DISPLAYTAG_DISPLAY=1000,
DISPLAYTAG_SDISPLAY=1000,
DISPLAYTAG_WDISPLAY=1013,
DISPLAYTAG_BACKCULL=1001,
DISPLAYTAG_LOD=1010,
DISPLAYTAG_LODVAL=1004,
TEXTURETAG_OX=1000,
TEXTURETAG_OY=1001,
TEXTURETAG_LENX=1002,
TEXTURETAG_LENY=1003,
TAG_POINT=5600,
TAG_HERMITE=5617,
TAG_PARTICLE=5630,
TAG_BAKEPARTICLE=5685,
TAG_POLYGON=5604,
TAG_UVW=5671,
TAG_VERTEXMAP=5682,
TAG_ANCHOR=5608,
TAG_PROTECTION=5629,
TAG_COFFEEEXPRESSION=5675,
TAG_TARGETEXPRESSION=5676,
TAG_FIXEXPRESSION=5677,
TAG_SUNEXPRESSION=5678,
TAG_IKEXPRESSION=5679,
TAG_PHONG=5612,
TAG_WWW=5647,
TAG_MOTIONBLUR=5636,
TAG_RESTRICTION=5683,
TAG_POLYSELECTION=5673,
TAG_POINTSELECTION=5674,
TAG_SEGMENT=5672,
TAG_KINEMATIC=5614,
TAG_COMPOSITING=5637,
TAG_DISPLAY=5613,
TAG_TEXTURE=5616,
TAG_METABALL=5684,
TAG_PLUGIN=5686,
TAG_EXPRESSION_PLUGIN=5687,
TAG_STICKTEXTURE=5690,
TAG_STOPTAG=5693,
WPREF_UNITS_COLOR=10002,
WPREF_LAYER0_COL=10035,
WPREF_LAYER1_COL=10036,
WPREF_LAYER2_COL=10037,
WPREF_LAYER3_COL=10038,
WPREF_LAYER4_COL=10039,
WPREF_LAYER5_COL=10040,
WPREF_LAYER6_COL=10041,
WPREF_LAYER7_COL=10042,
WPREF_NORMAL_COL=10050,
WPREF_RENDERMATS=1004,
WPREF_SCALE_AXES=1006,
WPREF_DRAWCACHE=1033,
WPREF_SEMI_TRANSPARENCY=1007,
WPREF_LOAD_MANAGER=1011,
WPREF_RENDER_SAFE=1015,
WPREF_ACTION_SAFE=1016,
WPREF_TITLE_SAFE=1017,
WPREF_ACTION_FAC=1020,
WPREF_TITLE_FAC=1021,
WPREF_SEMI_FAC=1022,
WPREF_COLOR_EDGEWH=20020,
WPREF_COLOR_EDGELT=20021,
WPREF_COLOR_EDGEDK=20022,
WPREF_COLOR_EDGEBL=20023,
WPREF_COLOR_TIMESLIDER=20024,
WPREF_COLOR_BG=20025,
WPREF_COLOR_BGEDIT=20026,
WPREF_COLOR_BGGADGET=20027,
WPREF_COLOR_BGFOCUS=20028,
WPREF_COLOR_BGTRISTATE=20037,
WPREF_COLOR_TEXT=20029,
WPREF_COLOR_TEXTFOCUS=20030,
WPREF_COLOR_DBARFG1=20031,
WPREF_COLOR_DBARBG1=20032,
WPREF_COLOR_DBARFG2=20033,
WPREF_COLOR_DBARBG2=20034,
WPREF_COLOR_BGSELTEXT=20035,
WPREF_COLOR_FGSELTEXT=20036,
WPREF_NAVSERVICE=20061,
DLG_MAC=1,
DLG_ALIGN_LEFT=0,
DLG_ALIGN_CENTER=1,
DLG_ALIGN_RIGHT=2,
DOCUMENT_CHANGED=604,
MCOMMAND_SMOOTHSHIFT=450000003,
MDATA_QUANTIZE_ENABLEX=2003,
MDATA_QUANTIZE_ENABLEY=2004,
MDATA_QUANTIZE_ENABLEZ=2005,
MDATA_QUANTIZE_VAL=2006,
MDATA_CRUMPLE_MODE=2025,
MDATA_CRUMPLE_INANDOUT=2026,
MDATA_CRUMPLE_VAL=2027,
MDATA_EXTRUDE_CREATEQUADS=2168,
MDATA_BRIDGE_TRIANGULATE=2066,
MDATA_CREATEPOLYGON_KEEPQUADRANGLE=2081,
MDATA_SELECTFREE_TOLERANCE=2106,
MDATA_SELECTFREE_VISIBLE=2107,
MDATA_SELECTPOLY_TOLERANCE=2106,
MDATA_SELECTPOLY_VISIBLE=2107,
MDATA_SELECTRECT_TOLERANCE=2106,
MDATA_SELECTRECT_VISIBLE=2107,
MDATA_MAGNET_NEARESTPOINT=0,
MDATA_MAGNET_RADIUS=0,
MDATA_MAGNET_WIDTH=0,
MDATA_MAGNET_TYPE=0,
MDATA_VERTEXPAINT_ENABLE=0,
NEW_DOCUMENT=605,
NEW_ACTIVE_OBJECT=603,
ACTIVE_OBJECT_CHANGED=602,
REDRAW_ALL=601,
TIMELINE_CHANGED=-1001,
MATERIAL_CHANGED=-1004,
NEW_ACTIVE_TAG=-1007,
DA_NODUALPLANE=0,
DA_NO_THREAD=2,
DA_NO_REDUCTION=4,
DA_WAIT_GL_FINISHED=8,
DA_ONLY_ACTIVE=8,
DA_ONLY_BACK=16,
DA_ONEPLANE=64,
DA_NOT_KEY=128,
DA_NO_ANIMATION=256,
DA_NO_BLIT=512,
DA_ONLY_ACTIVE_VIEW=1024,
DA_NO_EXPRESSIONS=4096,
DA_INDRAG=8192,
DA_FORCEFULLREDRAW=32768,
DA_ONLY_CAMERAEXPRESSION=65536,
DA_STATICBREAK=524290,
DA_NODUALPLANE=1048576,
DA_IRR=8388608,
DA_ONLY_HIGHLIGHT=8650752,
DA_ONLY_BASEDRAW=4194304,
MAX_GLOW_COUNT=5,
MAX_STREAK_COUNT=5,
MAX_LENS_COUNT=40,
LIGHT_LENS_TYP=10003,
LIGHT_STREAK_RANDOM=1,
LIGHT_STREAK_RANDOMLEN=1,
LIGHT_STREAK_STERN=1,
LIGHT_STREAK_ANZ=1,
LIGHT_STREAK_HOLEANZ=1,
LIGHT_STREAK_SIZE=1,
LIGHT_STREAK_SV=1,
LIGHT_STREAK_HOLEWIDTH=1,
LIGHT_STREAK_DICKE=1,
LIGHT_STREAK_ROT=1,
LIGHT_STREAK_COL=1,
LIGHT_STREAK_TYP=1,
LIGHT_GLOW_SIZE=1,
LIGHT_GLOW_SV=1,
LIGHT_GLOW_COL=1,
LIGHT_GLOW_TYP=1,
LIGHT_HALO_SIZE=1,
LIGHT_HALO_SV=1,
LIGHT_HALO_COL=1,
LIGHT_HALO_TYP=1,
LIGHT_SHADOW_BIAS=50016,
LIGHT_SHADOW_PARRADIUS=50002,
LIGHT_SHADOW_AREARADIUS=50004,
LIGHT_SHADOW_SMPRADIUS=50007,
LIGHT_SHADOW_CONE=50011,
LIGHT_VNSTRUCT_NOISE=60000,
LIGHT_VNSTRUCT_OCTAVES=60001,
LIGHT_VNSTRUCT_VELOCITY=60002,
LIGHT_VNSTRUCT_RSCALE=60003,
LIGHT_VNSTRUCT_AMPLITUDE=60004,
LIGHT_VNSTRUCT_WINDVELOCITY=60005,
LIGHT_VNSTRUCT_OFFSET=60006,
LIGHT_VNSTRUCT_WIND=60007,
LIGHT_VNSTRUCT_LOCAL=60008,
LIGHT_VNSTRUCT_VSCALE=60009,
LIGHT_VLSTRUCT_CUSTOMCOL=70000,
LIGHT_VLSTRUCT_FALLOFF=70001,
LIGHT_VLSTRUCT_EDGEFALLOFF=70002,
LIGHT_VLSTRUCT_COLFALLOFF=70003,
LIGHT_VLSTRUCT_STRENGTH=70004,
LIGHT_VLSTRUCT_EDGESTRENGTH=70005,
LIGHT_VLSTRUCT_JITTER=70006,
LIGHT_VLSTRUCT_ICOL=70007,
LIGHT_VLSTRUCT_OCOL=70008,
LIGHT_VLSTRUCT_INNERDIST=70009,
LIGHT_VLSTRUCT_OUTERDIST=1,
LIGHT_VLSTRUCT_OUTERDISTY=1,
LIGHT_VLSTRUCT_OUTERDISTZ=1,
LIGHT_VLSTRUCT_BRIGHTNESS=70019,
LIGHT_VLSTRUCT_SAMPLEDIST=70020,
LIGHT_VLSTRUCT_DUST=70021,
LIGHT_VLSTRUCT_ADDITIVE=70022,
LIGHT_VLSTRUCT_ANGLESCALE=70023,
LIGHT_LFSTRUCT_GLOWSV=80000,
LIGHT_LFSTRUCT_REFLSV=80001,
LIGHT_LFSTRUCT_GLOWHELL=80002,
LIGHT_LFSTRUCT_REFLHELL=80003,
LIGHT_LFSTRUCT_SCALE=80004,
LIGHT_LFSTRUCT_ROTATION=80005,
LIGHT_LFSTRUCT_REFERENCE=80006,
LIGHT_LFSTRUCT_LIGHTPARAM=80007,
LIGHT_LFSTRUCT_FADEBEHIND=80008,
LIGHT_LFSTRUCT_FADENEAR=80009,
LIGHT_LFSTRUCT_FADEOFFSCREEN=80010,
LIGHT_LFSTRUCT_SCALEGLOW=80011,
LIGHT_LFSTRUCT_SCALEREFLEXES=80012,
LIGHT_LFSTRUCT_LENSANZ=80013,
LIGHT_LFSTRUCT_LENSGLOW=80014,
LIGHT_LFSTRUCT_LENSREFL=80015,
LIGHT_MAIN_F=90000,
LIGHT_MAIN_HELL=90001,
LIGHT_MAIN_TYPE=90002,
LIGHT_MAIN_STYPE=90003,
LIGHT_MAIN_VTYPE=90004,
LIGHT_MAIN_NTYPE=90005,
LIGHT_MAIN_SHOWLI=90006,
LIGHT_MAIN_SHOWVL=90007,
LIGHT_MAIN_SHOWCLIP=90008,
LIGHT_MAIN_DARK=90009,
LIGHT_MAIN_INNERANGLE=90010,
LIGHT_MAIN_OUTERANGLE=90011,
LIGHT_MAIN_INNERRADIUS=90012,
LIGHT_MAIN_OUTERRADIUS=90013,
LIGHT_MAIN_FALLOFF=90014,
LIGHT_MAIN_AMBIENT=90015,
LIGHT_MAIN_NODIFFUSE=90016,
LIGHT_MAIN_NOSPECULAR=90017,
LIGHT_MAIN_INNERCONE=90018,
LIGHT_MAIN_INNERCOLOR=90019,
LIGHT_MAIN_COLFALLOFF=90020,
LIGHT_MAIN_CONTRAST=90021,
LIGHT_MAIN_ASPECTRATIO=90022,
LIGHT_MAIN_BRIGHTNESS=90023,
LIGHT_MAIN_INNERDIST=90024,
LIGHT_MAIN_OUTERDIST=90025,
LIGHT_MAIN_ICOL=90026,
LIGHT_MAIN_NEARCLIP=90027,
LIGHT_MAIN_FARCLIP=90028,
LIGHT_MAIN_NEARFROM=90029,
LIGHT_MAIN_NEARTO=90030,
LIGHT_MAIN_FARFROM=90031,
LIGHT_MAIN_FARTO=90032,
DIFFUSION_AFFECT_SPECULAR=1000,
DIFFUSION_AFFECT_REFLECTION=1001,
DIFFUSION_AFFECT_LUMINANCE=1002,
TRANSPARENCY_FRESNEL=1003,
TRANSPARENCY_ADDITIVE=1004,
TRANSPARENCY_N=1005,
ENVIRONMENT_TILESX=1006,
ENVIRONMENT_TILESY=1007,
FOG_DISTANCE=1008,
BUMP_STRENGTH=1009,
BUMP_MIPFALLOFF=1010,
ALPHA_DELTA=1011,
ALPHA_SOFT=1012,
ALPHA_IMAGEALPHA=1013,
ALPHA_INVERT=1014,
SPECULAR_WIDTH=1016,
SPECULAR_HEIGHT=1017,
SPECULAR_MODE=1018,
GLOW_INNER=1019,
GLOW_OUTER=1020,
GLOW_RADIUS=1021,
GLOW_RANDOM=1022,
GLOW_FREQUENCY=1023,
GLOW_USEMATERIAL=1024,
DISPLACEMENT_STRENGTH=1025,
DISPLACEMENT_HEIGHT=1026,
CH_COLOR=1000,
CH_BRIGHTNESS=1001,
CH_MIXMODE=1006,
CH_MIXSTRENGTH=1007,
CH_TEXTURE=1002,
CH_BLUR_OFFSET=1003,
CH_BLUR_STRENGTH=1004,
CH_INTERPOLATION=1005,
CH_TIME_FROM=1008,
CH_TIME_TO=1009,
CH_TIME_FPS=1010,
CH_TIME_MODE=1011,
CH_TIME_TIMING=1012,
CH_TIME_START=1013,
CH_TIME_END=1014,
CH_TIME_LOOPS=1015,
SHADER_SOFTSHADOW=0,
CHANNEL_DIRECTBUMP=2,
ID_BASEOBJECT_POSITION=903,
ID_BASEOBJECT_ROTATION=904,
ID_BASEOBJECT_SCALE=905,
SHADER_REFLECTANCE=2,
SHADER_TRANSPARENCY=4,
SHADER_ALPHA=8,
SHADER_CHANGENORMAL=8192,
SHADER_DISPLACE=16384,
SHADER_ENVREQUIRED=1048576,
SHADER_DUDVREQUIRED=2097152,
SHADER_MIPSAT=33554432,
SHADER_VOLUMETRIC=536870912,
SHADER_TRANSFORM=16,
SHADER_EVALUATEPROJECTION=67108864,
SHADER_GLOW=268435456,
SHADER_INITCALCULATION=-2147483648,
CHANNEL_TRANSFORM=4,
CHANNEL_BUMP_SUPPORT=16,
CHANNEL_ALPHA_SUPPORT=32,
MAXLONGl=2147483647,
MINLONGl=-2147483647,
MAXULONG=-1,
MAXSWORD=32767,
MAXUWORD=65535,
EVMSG_TOOLCHANGED=-826267,
DESC_UNIT_REAL=1718773089,
DESC_UNIT_LONG=1718382183,
FORMAT_REAL=1718773089,
FORMAT_LONG=1718382183,
LV_RES_LONG=1819242087,
SUBSTANCE_MATERIAL_MODE_STANDARD=0,
SUBSTANCE_MATERIAL_MODE_METALLIC=1,
SUBSTANCE_MATERIAL_MODE_GLOSSY= 2,
SUBSTANCE_MATERIAL_MODE_AUTO= 3,
SUBSTANCE_MATERIAL_MODE_NONE=100,
SUBSTANCE_IMPORT_RESULT_SUCCESS=0,
SUBSTANCE_IMPORT_RESULT_DOESNOTEXIST=1,
SUBSTANCE_IMPORT_RESULT_NOTANASSET=2,
SUBSTANCE_IMPORT_RESULT_UNKNOWNERROR=3,
SUBSTANCE_IMPORT_COPY_YES=0,
SUBSTANCE_IMPORT_COPY_NO=1,
SUBSTANCE_IMPORT_COPY_ASK=2,
SUBSTANCE_INPUT_TYPE_INTEGER=0,
SUBSTANCE_INPUT_TYPE_INTEGER_2=1,
SUBSTANCE_INPUT_TYPE_INTEGER_3=2,
SUBSTANCE_INPUT_TYPE_INTEGER_4=3,
SUBSTANCE_INPUT_TYPE_BOOL=4,
SUBSTANCE_INPUT_TYPE_FLOAT=5,
SUBSTANCE_INPUT_TYPE_FLOAT_2=6,
SUBSTANCE_INPUT_TYPE_FLOAT_3=7,
SUBSTANCE_INPUT_TYPE_FLOAT_4=8,
SUBSTANCE_INPUT_TYPE_IMAGE=9,
SUBSTANCE_INPUT_TYPE_STRING=10,
SUBSTANCE_INPUT_TYPE_COLOR_RGB=11,
SUBSTANCE_INPUT_TYPE_COLOR_RGBA=12,
SUBSTANCE_INPUT_TYPE_RESOLUTION=13,
SUBSTANCE_OUTPUT_TYPE_DIFFUSE=0,
SUBSTANCE_OUTPUT_TYPE_BASECOLOR=1,
SUBSTANCE_OUTPUT_TYPE_OPACITY=2,
SUBSTANCE_OUTPUT_TYPE_EMISSIVE=3,
SUBSTANCE_OUTPUT_TYPE_AMBIENT=4,
SUBSTANCE_OUTPUT_TYPE_AMBIENTOCCLUSION=5,
SUBSTANCE_OUTPUT_TYPE_MASK=6,
SUBSTANCE_OUTPUT_TYPE_NORMAL=7,
SUBSTANCE_OUTPUT_TYPE_BUMP=8,
SUBSTANCE_OUTPUT_TYPE_HEIGHT=9,
SUBSTANCE_OUTPUT_TYPE_DISPLACEMENT=10,
SUBSTANCE_OUTPUT_TYPE_SPECULAR=11,
SUBSTANCE_OUTPUT_TYPE_SPECULARLEVEL=12,
SUBSTANCE_OUTPUT_TYPE_SPECULARCOLOR=13,
SUBSTANCE_OUTPUT_TYPE_GLOSSINESS=14,
SUBSTANCE_OUTPUT_TYPE_ROUGHNESS=15,
SUBSTANCE_OUTPUT_TYPE_ANISOTROPYLEVEL=16,
SUBSTANCE_OUTPUT_TYPE_ANISOTROPYANGLE=17,
SUBSTANCE_OUTPUT_TYPE_TRANSMISSIVE=18,
SUBSTANCE_OUTPUT_TYPE_REFLECTION=19,
SUBSTANCE_OUTPUT_TYPE_REFRACTION=20,
SUBSTANCE_OUTPUT_TYPE_ENVIRONMENT=21,
SUBSTANCE_OUTPUT_TYPE_IOR=22,
SUBSTANCE_OUTPUT_TYPE_SCATTERING0=23,
SUBSTANCE_OUTPUT_TYPE_SCATTERING1=24,
SUBSTANCE_OUTPUT_TYPE_SCATTERING2=25,
SUBSTANCE_OUTPUT_TYPE_SCATTERING3=26,
SUBSTANCE_OUTPUT_TYPE_METALLIC=27,
SUBSTANCE_OUTPUT_TYPE_ANY=28,
SUBSTANCE_OUTPUT_TYPE_UNKNOWN=29,
SUBSTANCE_OUTPUT_TYPE_INTERNAL_COUNT=30,
ID_SUBSTANCE_ASSET=1032106,
ID_SUBSTANCE_SHADER=1032171,
ID_SUBSTANCE_LIBRARY=1034607,
ID_SUBSTANCE_PREFERENCES=1036471,
ID_SUBSTANCE_PRESET=1036526,
ID_SUBSTANCE_COMMAND_OPENMANAGER=1032108,
ID_SUBSTANCE_COMMAND_SYNCTRCLIENTS=1036066,
ID_SUBSTANCE_COMMAND_LOADASSET=1032109,
ID_SUBSTANCE_COMMAND_LOADFOLDER=1038450,
ID_SUBSTANCE_COMMAND_REIMPORT=1036975,
ID_SUBSTANCE_COMMAND_CUT=1038399,
ID_SUBSTANCE_COMMAND_COPY=1038400,
ID_SUBSTANCE_COMMAND_PASTE=1038401,
ID_SUBSTANCE_COMMAND_REMOVE= 1038402,
ID_SUBSTANCE_COMMAND_REMOVEUNUSED=1038403,
ID_SUBSTANCE_COMMAND_SELECT_ALL=1037143,
ID_SUBSTANCE_COMMAND_DESELECT_ALL=1037144,
ID_SUBSTANCE_COMMAND_SELECTFROMMATERIAL=1038404,
ID_SUBSTANCE_COMMAND_SELECTFROMMARKEDMATERIAL=1038405,
ID_SUBSTANCE_COMMAND_SELECTFROMOBJECT=1038406,
ID_SUBSTANCE_COMMAND_SELECTMATERIALS=1038407,
ID_SUBSTANCE_COMMAND_SELECTOBJECTS=1038408,
ID_SUBSTANCE_COMMAND_ENABLEALL=1038409,
ID_SUBSTANCE_COMMAND_DISABLEALL=1038410,
ID_SUBSTANCE_COMMAND_OPENPREFS=1038411,
ID_SUBSTANCE_COMMAND_CREATEMATERIAL=1038412,
ID_SUBSTANCE_COMMAND_CREATEMATERIALMETALLIC=1038413,
ID_SUBSTANCE_COMMAND_CREATEMATERIALGLOSSY=1038414,
ID_SUBSTANCE_COMMAND_DUPLICATE=1038415,
ID_SUBSTANCE_COMMAND_DUPLICATEWITHMATERIAL=1038416,
ID_SUBSTANCE_COMMAND_IMPORTPRESET=1038417,
ID_SUBSTANCE_COMMAND_IMPORTPRESETMERGE=1038418,
ID_SUBSTANCE_COMMAND_EXPORTPRESET=1038419,
ID_SUBSTANCE_COMMAND_DISKCACHESELECTED=1038420,
ID_SUBSTANCE_COMMAND_DISKCACHECHANGED=1038421,
ID_SUBSTANCE_COMMAND_DISKCACHEALL=1038422,
ID_SUBSTANCE_COMMAND_DISKCACHECLEARSELECTED=1038423,
ID_SUBSTANCE_COMMAND_DISKCACHECLEARALL=1038424,
ID_WEIGHT_MANAGER = 1026919,
ID_WEIGHT_TOOL = 1019499,
CUSTOMGUI_RANGE=431000177,
CUSTOMDATATYPE_RANGE=431000178,
MSG_DESCRIPTION_RANGEGUI_KNOTSELECTED = 0,
MSG_DESCRIPTION_RANGEGUI_KNOTDELETED = 1,
MSG_DESCRIPTION_RANGEGUI_KNOTADDED = 2,
MSG_DESCRIPTION_RANGEGUI_RANGESINVERTED = 3,
MSG_DESCRIPTION_RANGEGUI_USERCURRENTVALUECHANGED = 4,
MSG_DESCRIPTION_RANGEGUI_KNOTSELECTED_INDEX=0,
MSG_DESCRIPTION_RANGEGUI_KNOTDELETED_INDEX=0,
MSG_DESCRIPTION_RANGEGUI_KNOTADDED_INDEX=0,
MSG_DESCRIPTION_RANGEGUI_USERCURRENTVALUECHANGED_MODE = 1000,
MSG_DESCRIPTION_RANGEGUI_USERCURRENTVALUECHANGED_VALUE = 1001,
MSG_DESCRIPTION_USERCURRENTVALUECHANGED_MODE=1000,
MSG_DESCRIPTION_USERCURRENTVALUECHANGED_VALUE=10001,
MSG_DESCRIPTION_USERCURRENTVALUECHANGED_START=0,
MSG_DESCRIPTION_USERCURRENTVALUECHANGED_DRAG=1,
MSG_DESCRIPTION_USERCURRENTVALUECHANGED_END=2,
COFFEE_HEADERFILE_OLD_END_
}
| 22.708669 | 62 | 0.874284 |
059a3488175bddbd6c902ab16c4d1b3ad77a7d1a | 12,351 | c | C | B2G/hardware/ti/wlan/wl1271/utils/queue.c | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-08-31T15:24:31.000Z | 2020-04-24T20:31:29.000Z | B2G/hardware/ti/wlan/wl1271/utils/queue.c | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | null | null | null | B2G/hardware/ti/wlan/wl1271/utils/queue.c | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-07-29T07:17:15.000Z | 2020-11-04T06:55:37.000Z | /*
* queue.c
*
* Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted 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 Texas Instruments 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
* OWNER 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.
*/
/** \file queue.c
* \brief This module provides generic queueing services, including enqueue, dequeue
* and requeue of any object that contains TQueNodeHdr in its structure.
*
* \see queue.h
*/
#define __FILE_ID__ FILE_ID_130
#include "report.h"
#include "queue.h"
/* Queue structure */
typedef struct
{
TQueNodeHdr tHead; /* The queue first node */
TI_UINT32 uCount; /* Current number of nodes in queue */
TI_UINT32 uLimit; /* Upper limit of nodes in queue */
TI_UINT32 uMaxCount; /* Maximum uCount value (for debug) */
TI_UINT32 uOverflow; /* Number of overflow occurences - couldn't insert node (for debug) */
TI_UINT32 uNodeHeaderOffset; /* Offset of NodeHeader field from the entry of the queued item */
TI_HANDLE hOs;
TI_HANDLE hReport;
} TQueue;
/*
* INTERNAL FUNCTIONS
* ===============================
*/
/*
* InsertNode(): Insert new node between pPrev and pNext
*/
static INLINE void InsertNode( TQueNodeHdr *pNode, TQueNodeHdr *pPrev, TQueNodeHdr *pNext)
{
pNext->pPrev = pNode;
pNode->pNext = pNext;
pNode->pPrev = pPrev;
pPrev->pNext = pNode;
}
/*
* RemoveNode(): Remove node from between pPrev and pNext
*/
static INLINE void RemoveNode( TQueNodeHdr *pPrev, TQueNodeHdr *pNext)
{
pNext->pPrev = pPrev;
pPrev->pNext = pNext;
}
/*
* AddToHead(): Add node to queue head (last in queue)
*/
static INLINE void AddToHead( TQueNodeHdr *pNode, TQueNodeHdr *pListHead)
{
InsertNode (pNode, pListHead, pListHead->pNext);
}
/*
* AddToTail(): Add node to queue tail (first in queue)
*/
static INLINE void AddToTail( TQueNodeHdr *pNode, TQueNodeHdr *pListHead)
{
InsertNode( pNode, pListHead->pPrev, pListHead );
}
/*
* DelFromTail(): Delete node from queue tail (first in queue)
*/
static INLINE void DelFromTail (TQueNodeHdr *pNode)
{
RemoveNode (pNode->pPrev, pNode->pNext);
}
/*
* EXTERNAL FUNCTIONS
* ===============================
*/
/**
* \fn que_Create
* \brief Create a queue.
*
* Allocate and init a queue object.
*
* \note
* \param hOs - Handle to Os Abstraction Layer
* \param hReport - Handle to report module
* \param uLimit - Maximum items to store in queue
* \param uNodeHeaderOffset - Offset of NodeHeader field from the entry of the queued item.
* \return Handle to the allocated queue
* \sa que_Destroy
*/
TI_HANDLE que_Create (TI_HANDLE hOs, TI_HANDLE hReport, TI_UINT32 uLimit, TI_UINT32 uNodeHeaderOffset)
{
TQueue *pQue;
/* allocate queue module */
pQue = os_memoryAlloc (hOs, sizeof(TQueue));
if (!pQue)
{
WLAN_OS_REPORT (("Error allocating the Queue Module\n"));
return NULL;
}
os_memoryZero (hOs, pQue, sizeof(TQueue));
/* Intialize the queue header */
pQue->tHead.pNext = pQue->tHead.pPrev = &pQue->tHead;
/* Set the Queue parameters */
pQue->hOs = hOs;
pQue->hReport = hReport;
pQue->uLimit = uLimit;
pQue->uNodeHeaderOffset = uNodeHeaderOffset;
return (TI_HANDLE)pQue;
}
/**
* \fn que_Destroy
* \brief Destroy the queue.
*
* Free the queue memory.
*
* \note The queue's owner should first free the queued items!
* \param hQue - The queue object
* \return TI_OK on success or TI_NOK on failure
* \sa que_Create
*/
TI_STATUS que_Destroy (TI_HANDLE hQue)
{
TQueue *pQue = (TQueue *)hQue;
if (pQue)
{
/* Alert if the queue is unloaded before it was cleared from items */
if (pQue->uCount)
{
TRACE0(pQue->hReport, REPORT_SEVERITY_WARNING, "que_Destroy() Queue Not Empty!!");
}
/* free Queue object */
os_memoryFree (pQue->hOs, pQue, sizeof(TQueue));
}
return TI_OK;
}
/**
* \fn que_Init
* \brief Init required handles
*
* Init required handles.
*
* \note
* \param hQue - The queue object
* \param hOs - Handle to Os Abstraction Layer
* \param hReport - Handle to report module
* \return TI_OK on success or TI_NOK on failure
* \sa
*/
TI_STATUS que_Init (TI_HANDLE hQue, TI_HANDLE hOs, TI_HANDLE hReport)
{
TQueue *pQue = (TQueue *)hQue;
pQue->hOs = hOs;
pQue->hReport = hReport;
return TI_OK;
}
/**
* \fn que_Enqueue
* \brief Enqueue an item
*
* Enqueue an item at the queue's head (last in queue).
*
* \note
* \param hQue - The queue object
* \param hItem - Handle to queued item
* \return TI_OK if item was queued, or TI_NOK if not queued due to overflow
* \sa que_Dequeue, que_Requeue
*/
TI_STATUS que_Enqueue (TI_HANDLE hQue, TI_HANDLE hItem)
{
TQueue *pQue = (TQueue *)hQue;
TQueNodeHdr *pQueNodeHdr; /* the Node-Header in the given item */
if (pQue)
{
/* Check queue limit */
if(pQue->uCount < pQue->uLimit)
{
/* Find NodeHeader in the given item */
pQueNodeHdr = (TQueNodeHdr *)((TI_UINT8*)hItem + pQue->uNodeHeaderOffset);
/* Verify that pNext is NULL --> Sanity check that this item is not already linked to a queue */
if (pQueNodeHdr->pNext)
{
/* Not an error since we have a case where a timer may expire twice in a row (in TxDataQueue) */
TRACE0(pQue->hReport, REPORT_SEVERITY_WARNING, "que_Enqueue(): Trying to enqueue an item that is already enqueued!!");
return TI_NOK;
}
/* Enqueue item and increment items counter */
AddToHead (pQueNodeHdr, &pQue->tHead);
pQue->uCount++;
#ifdef TI_DBG
if (pQue->uCount > pQue->uMaxCount)
{
pQue->uMaxCount = pQue->uCount;
}
TRACE0(pQue->hReport, REPORT_SEVERITY_INFORMATION , "que_Enqueue(): Enqueued Successfully\n");
#endif
return TI_OK;
}
/*
* Queue is overflowed, return TI_NOK.
*/
#ifdef TI_DBG
pQue->uOverflow++;
TRACE0(pQue->hReport, REPORT_SEVERITY_WARNING , "que_Enqueue(): Queue Overflow\n");
#endif
}
return TI_NOK;
}
/**
* \fn que_Dequeue
* \brief Dequeue an item
*
* Dequeue an item from the queue's tail (first in queue).
*
* \note
* \param hQue - The queue object
* \return pointer to dequeued item or NULL if queue is empty
* \sa que_Enqueue, que_Requeue
*/
TI_HANDLE que_Dequeue (TI_HANDLE hQue)
{
TQueue *pQue = (TQueue *)hQue;
TI_HANDLE hItem;
if (pQue)
{
if (pQue->uCount)
{
/* Queue is not empty, take packet from the queue tail */
/* find pointer to the node entry */
hItem = (TI_HANDLE)((TI_UINT8*)pQue->tHead.pPrev - pQue->uNodeHeaderOffset);
DelFromTail (pQue->tHead.pPrev); /* remove node from the queue */
pQue->uCount--;
#ifdef TI_DBG
/* Clear the pNext so we can do a sanity check when enqueuing this structre in the future */
((TQueNodeHdr *)((TI_UINT8*)hItem + pQue->uNodeHeaderOffset))->pNext = NULL;
#endif
return (hItem);
}
}
/* Queue is empty */
TRACE0(pQue->hReport, REPORT_SEVERITY_INFORMATION , "que_Dequeue(): Queue is empty\n");
return NULL;
}
/**
* \fn que_Requeue
* \brief Requeue an item
*
* Requeue an item at the queue's tail (first in queue).
*
* \note
* \param hQue - The queue object
* \param hItem - Handle to queued item
* \return TI_OK if item was queued, or TI_NOK if not queued due to overflow
* \sa que_Enqueue, que_Dequeue
*/
TI_STATUS que_Requeue (TI_HANDLE hQue, TI_HANDLE hItem)
{
TQueue *pQue = (TQueue *)hQue;
TQueNodeHdr *pQueNodeHdr; /* the NodeHeader in the given item */
/*
* If queue's limits not exceeded add the packet to queue's tail and return TI_OK
*/
if (pQue->uCount < pQue->uLimit)
{
/* Find NodeHeader in the given item */
pQueNodeHdr = (TQueNodeHdr *)((TI_UINT8*)hItem + pQue->uNodeHeaderOffset);
/* Verify that pNext is NULL --> Sanity check that this item is not already linked to a queue */
if (pQueNodeHdr->pNext)
{
TRACE0(pQue->hReport, REPORT_SEVERITY_ERROR, "que_Requeue(): Trying to Requeue an item that is already enqueued!!");
return TI_NOK;
}
/* Enqueue item and increment items counter */
AddToTail (pQueNodeHdr, &pQue->tHead);
pQue->uCount++;
#ifdef TI_DBG
if (pQue->uCount > pQue->uMaxCount)
pQue->uMaxCount = pQue->uCount;
TRACE0(pQue->hReport, REPORT_SEVERITY_INFORMATION , "que_Requeue(): Requeued successfully\n");
#endif
return TI_OK;
}
/*
* Queue is overflowed, return TI_NOK.
* Note: This is not expected in the current design, since Tx packet may be requeued
* only right after it was dequeued in the same context so the queue can't be full.
*/
#ifdef TI_DBG
pQue->uOverflow++;
TRACE0(pQue->hReport, REPORT_SEVERITY_ERROR , "que_Requeue(): Queue Overflow\n");
#endif
return TI_NOK;
}
/**
* \fn que_Size
* \brief Return queue size
*
* Return number of items in queue.
*
* \note
* \param hQue - The queue object
* \return TI_UINT32 - the items count
* \sa
*/
TI_UINT32 que_Size (TI_HANDLE hQue)
{
TQueue *pQue = (TQueue *)hQue;
return (pQue->uCount);
}
/**
* \fn que_Print
* \brief Print queue status
*
* Print the queue's parameters (not the content).
*
* \note
* \param hQue - The queue object
* \return void
* \sa
*/
#ifdef TI_DBG
void que_Print(TI_HANDLE hQue)
{
#ifdef REPORT_LOG
TQueue *pQue = (TQueue *)hQue;
WLAN_OS_REPORT(("que_Print: Count=%u MaxCount=%u Limit=%u Overflow=%u NodeHeaderOffset=%u Next=0x%x Prev=0x%x\n",
pQue->uCount, pQue->uMaxCount, pQue->uLimit, pQue->uOverflow,
pQue->uNodeHeaderOffset, pQue->tHead.pNext, pQue->tHead.pPrev));
#endif
}
#endif /* TI_DBG */
| 28.925059 | 138 | 0.602137 |
c3310fb62976b2af264d903483d5c7600f9eb4d4 | 4,611 | h | C | tsimd/detail/functions/math/abs.h | ospray/tsimd | 0dd4365ad740cca0431b6f66fc2d5bd0a8bd4b86 | [
"MIT"
] | 269 | 2017-12-15T09:28:06.000Z | 2020-10-15T15:12:16.000Z | tsimd/detail/functions/math/abs.h | ospray/tsimd | 0dd4365ad740cca0431b6f66fc2d5bd0a8bd4b86 | [
"MIT"
] | 10 | 2018-01-17T23:27:05.000Z | 2019-09-15T13:01:15.000Z | tsimd/detail/functions/math/abs.h | ospray/tsimd | 0dd4365ad740cca0431b6f66fc2d5bd0a8bd4b86 | [
"MIT"
] | 16 | 2018-04-01T00:58:42.000Z | 2020-10-13T07:07:53.000Z | // ========================================================================== //
// The MIT License (MIT) //
// //
// Copyright (c) 2017 Intel Corporation //
// //
// Permission is hereby granted, free of charge, to any person obtaining a //
// copy of this software and associated documentation files (the "Software"), //
// to deal in the Software without restriction, including without limitation //
// the rights to use, copy, modify, merge, publish, distribute, sublicense, //
// and/or sell copies of the Software, and to permit persons to whom the //
// Software is furnished to do so, subject to the following conditions: //
// //
// The above copyright notice and this permission notice shall be included in //
// in all copies or substantial portions of the Software. //
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL //
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING //
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER //
// DEALINGS IN THE SOFTWARE. //
// ========================================================================== //
#pragma once
#include <cmath>
#include "../../pack.h"
namespace tsimd {
// 1-wide //
template <typename T>
TSIMD_INLINE pack<T, 1> abs(const pack<T, 1> &p)
{
return pack<T, 1>(std::abs(p[0]));
}
// 4-wide //
TSIMD_INLINE vfloat4 abs(const vfloat4 &p)
{
#if defined(__SSE4_2__)
return _mm_and_ps(p, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)));
#else
vfloat4 result;
for (int i = 0; i < 4; ++i)
result[i] = std::abs(p[i]);
return result;
#endif
}
TSIMD_INLINE vint4 abs(const vint4 &p)
{
#if defined(__SSE4_2__)
return _mm_abs_epi32(p);
#else
vint4 result;
for (int i = 0; i < 4; ++i)
result[i] = std::abs(p[i]);
return result;
#endif
}
TSIMD_INLINE vdouble4 abs(const vdouble4 &p)
{
vdouble4 result;
for (int i = 0; i < 4; ++i)
result[i] = std::abs(p[i]);
return result;
}
TSIMD_INLINE vllong4 abs(const vllong4 &p)
{
vllong4 result;
for (int i = 0; i < 4; ++i)
result[i] = std::abs(p[i]);
return result;
}
// 8-wide //
TSIMD_INLINE vfloat8 abs(const vfloat8 &p)
{
#if defined(__AVX__)
return _mm256_and_ps(p, _mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff)));
#else
return vfloat8(abs(vfloat4(p.vl)), abs(vfloat4(p.vh)));
#endif
}
TSIMD_INLINE vint8 abs(const vint8 &p)
{
#if defined(__AVX2__)
return _mm256_abs_epi32(p);
#elif defined(__AVX__)
return vint8(_mm_abs_epi32(p.vl), _mm_abs_epi32(p.vh));
#else
return vint8(abs(vint4(p.vl)), abs(vint4(p.vh)));
#endif
}
TSIMD_INLINE vdouble8 abs(const vdouble8 &p)
{
#if defined(__AVX512F__)
return _mm512_castsi512_pd(
_mm512_and_epi64(
_mm512_castpd_si512(p),_mm512_set1_epi64(0x7FFFFFFFFFFFFFFFLL)));
#else
return vdouble8(abs(vdouble4(p.vl)), abs(vdouble4(p.vh)));
#endif
}
TSIMD_INLINE vllong8 abs(const vllong8 &p)
{
#if defined(__AVX512F__)
return _mm512_abs_epi64(p);
#else
return vllong8(abs(vllong4(p.vl)), abs(vllong4(p.vh)));
#endif
}
// 16-wide //
TSIMD_INLINE vfloat16 abs(const vfloat16 &p)
{
#if defined(__AVX512F__)
return _mm512_castsi512_ps(
_mm512_and_epi32(
_mm512_castps_si512(p),_mm512_set1_epi32(0x7FFFFFFF)));
#else
return vfloat16(abs(vfloat8(p.vl)), abs(vfloat8(p.vh)));
#endif
}
TSIMD_INLINE vint16 abs(const vint16 &p)
{
#if defined(__AVX512F__)
return _mm512_abs_epi32(p);
#else
return vint16(abs(vint8(p.vl)), abs(vint8(p.vh)));
#endif
}
TSIMD_INLINE vdouble16 abs(const vdouble16 &p)
{
return vdouble16(abs(vdouble8(p.vl)), abs(vdouble8(p.vh)));
}
TSIMD_INLINE vllong16 abs(const vllong16 &p)
{
return vllong16(abs(vllong8(p.vl)), abs(vllong8(p.vh)));
}
} // namespace tsimd
| 27.777108 | 80 | 0.573411 |
f979515c6d302ad7acda1958bde87ca63e72c778 | 2,355 | h | C | include/codeformation/Resource.h | carlbrown/scraps | 78925a738540415ec04b9cbe23cb319421f44978 | [
"Apache-2.0"
] | null | null | null | include/codeformation/Resource.h | carlbrown/scraps | 78925a738540415ec04b9cbe23cb319421f44978 | [
"Apache-2.0"
] | null | null | null | include/codeformation/Resource.h | carlbrown/scraps | 78925a738540415ec04b9cbe23cb319421f44978 | [
"Apache-2.0"
] | null | null | null | /**
* Copyright 2016 BitTorrent 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.
*/
#pragma once
#include <codeformation/Error.h>
#include <codeformation/types.h>
#include <stdts/any.h>
#include <string>
namespace codeformation {
namespace {
using namespace std::literals;
using namespace codeformation::types;
}
class Resource {
public:
virtual void create() = 0;
virtual Any get() = 0;
void setProperties(Dictionary properties) { _properties = std::move(properties); }
protected:
template <typename T>
T requireProperty(const String& name) {
return require<T>(name, _properties);
}
template <typename T>
stdts::optional<T> optionalProperty(const String& name) {
return optional<T>(name, _properties);
}
template <typename T>
T require(const Any& thing) {
auto* ret = stdts::any_cast<T>(&thing);
if (!ret) {
throw Error("Invalid type.");
}
return *ret;
}
template <typename T>
T require(const String& name, const Dictionary& object) {
auto it = object.find(name);
if (it == object.end()) {
throw Error(name + " is required.");
}
auto* ret = stdts::any_cast<T>(&it->second);
if (!ret) {
throw Error("The value for "s + name + " is the wrong type.");
}
return *ret;
}
template <typename T>
stdts::optional<T> optional(const String& name, const Dictionary& object) {
auto it = object.find(name);
if (it == object.end()) {
return {};
}
auto* ret = stdts::any_cast<T>(&it->second);
if (!ret) {
throw Error("The value for "s + name + " is the wrong type.");
}
return *ret;
}
private:
Dictionary _properties;
};
} // namespace codeformation
| 25.879121 | 86 | 0.620807 |
689622fa972713e3cc4ebffa935f0f939a5c7d07 | 231 | h | C | RDM-Converter/include/Log.h | kskudlik/Anno-1800-Model-Converter | 32185564bdf8e9258970e91c50515ee2ab4e815d | [
"MIT"
] | 9 | 2019-08-08T11:02:21.000Z | 2021-05-24T13:37:35.000Z | RDM-Converter/include/Log.h | kskudlik/Anno-1800-Model-Converter | 32185564bdf8e9258970e91c50515ee2ab4e815d | [
"MIT"
] | 3 | 2019-10-08T19:30:09.000Z | 2021-02-09T21:31:20.000Z | RDM-Converter/include/Log.h | kskudlik/Anno-1800-Model-Converter | 32185564bdf8e9258970e91c50515ee2ab4e815d | [
"MIT"
] | 2 | 2019-08-09T21:36:23.000Z | 2020-08-24T16:25:02.000Z | #pragma once
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
class Log
{
public:
Log(const char* logfile);
~Log();
private:
const char* logfile;
}; | 16.5 | 44 | 0.692641 |
ec045d3f7c378b7681e90ca80c9f5c56c15d2391 | 253 | h | C | HoudiniEngine_gui.h | Ali2k/HoudiniEngineFor3dsMax | 0f2ebcbbccc22f60005a30b2a710af96e47d6358 | [
"MIT"
] | 3 | 2018-06-21T19:40:43.000Z | 2020-01-09T10:05:55.000Z | HoudiniEngine_gui.h | Ali2k/HoudiniEngineFor3dsMax | 0f2ebcbbccc22f60005a30b2a710af96e47d6358 | [
"MIT"
] | null | null | null | HoudiniEngine_gui.h | Ali2k/HoudiniEngineFor3dsMax | 0f2ebcbbccc22f60005a30b2a710af96e47d6358 | [
"MIT"
] | null | null | null | #ifndef __HOUDINIENGINE_GUI__
#define __HOUDINIENGINE_GUI__
bool GenerateScriptPlugin(std::string& otl_path, std::string& name, std::string& category, std::string& texture_path, std::string& classid, std::string& code);
#endif // __HOUDINIENGINE_GUI__ | 42.166667 | 159 | 0.794466 |
57bbe1a69011837068f362aedcffacec55afedee | 274 | h | C | Kyosk/Kyosk/RegistryUtilities.h | dezGusty/kiosk | 7cf6440c364b90af3539f699329fbf5bea1cd679 | [
"MIT"
] | 2 | 2016-02-19T21:13:07.000Z | 2021-03-22T20:56:34.000Z | Kyosk/Kyosk/RegistryUtilities.h | abogeorge/kiosk | 7cf6440c364b90af3539f699329fbf5bea1cd679 | [
"MIT"
] | null | null | null | Kyosk/Kyosk/RegistryUtilities.h | abogeorge/kiosk | 7cf6440c364b90af3539f699329fbf5bea1cd679 | [
"MIT"
] | 2 | 2016-08-25T21:06:47.000Z | 2019-09-05T13:06:26.000Z | #pragma once
class RegistryUtilities
{
public:
RegistryUtilities();
~RegistryUtilities();
bool changeAllFeatures(DWORD value);
bool lockStatus();
bool keepAppsStatus();
private:
bool changeSingleFeature(HKEY regKey, LPCWSTR subKey, DWORD value, LPCWSTR valueName);
};
| 21.076923 | 87 | 0.781022 |
47525241c8441123b61a44b3e4e1bc3e6c200219 | 2,884 | h | C | cpp/pmft/PMFTR12.h | phmalek/freud | cb0781f2009758638cd79a0bb6d44801e5473774 | [
"BSD-3-Clause"
] | null | null | null | cpp/pmft/PMFTR12.h | phmalek/freud | cb0781f2009758638cd79a0bb6d44801e5473774 | [
"BSD-3-Clause"
] | null | null | null | cpp/pmft/PMFTR12.h | phmalek/freud | cb0781f2009758638cd79a0bb6d44801e5473774 | [
"BSD-3-Clause"
] | null | null | null | // Copyright (c) 2010-2019 The Regents of the University of Michigan
// This file is from the freud project, released under the BSD 3-Clause License.
#ifndef PMFTR12_H
#define PMFTR12_H
#include <memory>
#include <ostream>
#include <tbb/tbb.h>
#include "NeighborList.h"
#include "PMFT.h"
/*! \file PMFTR12.h
\brief Routines for computing potential of mean force and torque in R12 coordinates
*/
namespace freud { namespace pmft {
class PMFTR12 : public PMFT
{
public:
//! Constructor
PMFTR12(float r_max, unsigned int n_r, unsigned int n_t1, unsigned int n_t2);
//! Reset the PCF array to all zeros
virtual void reset();
/*! Compute the PCF for the passed in set of points. The function will be added to previous values
of the PCF
*/
void accumulate(box::Box& box, const locality::NeighborList* nlist, vec3<float>* ref_points,
float* ref_orientations, unsigned int n_ref, vec3<float>* points, float* orientations,
unsigned int n_p);
//! \internal
//! helper function to reduce the thread specific arrays into one array
virtual void reducePCF();
//! Get a reference to the R array
std::shared_ptr<float> getR()
{
return m_r_array;
}
//! Get a reference to the T1 array
std::shared_ptr<float> getT1()
{
return m_t1_array;
}
//! Get a reference to the T2 array
std::shared_ptr<float> getT2()
{
return m_t2_array;
}
//! Get a reference to the jacobian array
std::shared_ptr<float> getInverseJacobian()
{
return m_inv_jacobian_array;
}
unsigned int getNBinsR()
{
return m_n_r;
}
unsigned int getNBinsT1()
{
return m_n_t1;
}
unsigned int getNBinsT2()
{
return m_n_t2;
}
private:
float m_r_max; //!< Maximum r at which to compute PCF
float m_t1_max; //!< Maximum t1 at which to compute PCF
float m_t2_max; //!< Maximum t2 at which to compute PCF
float m_dr; //!< Bin size for r in the computation
float m_dt1; //!< Bin size for t1 in the computation
float m_dt2; //!< Bin size for t2 in the computation
unsigned int m_n_r; //!< Number of r bins to compute PCF over
unsigned int m_n_t1; //!< Number of t1 bins to compute PCF over
unsigned int m_n_t2; //!< Number of t2 bins to compute PCF over
std::shared_ptr<float> m_r_array; //!< Array of r values where the PCF is computed
std::shared_ptr<float> m_t1_array; //!< Array of t1 values where the PCF is computed
std::shared_ptr<float> m_t2_array; //!< Array of t2 values where the PCF is computed
std::shared_ptr<float> m_inv_jacobian_array; //!< Array of inverse jacobians for each bin
};
}; }; // end namespace freud::pmft
#endif // PMFTR12_H
| 29.131313 | 106 | 0.64043 |
fe6f9ca315a98913c01093bed23191487d24541c | 1,300 | c | C | demo/second.c | ehetherington/libtinylogger | fac8dd722e4828212a6a120f58827114ac5129b7 | [
"MIT"
] | 1 | 2021-01-10T15:49:47.000Z | 2021-01-10T15:49:47.000Z | demo/second.c | ehetherington/libtinylogger | fac8dd722e4828212a6a120f58827114ac5129b7 | [
"MIT"
] | null | null | null | demo/second.c | ehetherington/libtinylogger | fac8dd722e4828212a6a120f58827114ac5129b7 | [
"MIT"
] | null | null | null | #include "tinylogger.h"
#define FILENAME "second.log"
/**
* @fn int main(void)
*
* @brief Log to two streams using different formats
*
* Messages may be logged to two different streams using different formats.
* This can be useful when you want to have the main output left as intended,
* but want a second, more verbose output for debug purposes.
*
* This example uses one channel for systemd style format at LL_INFO level,
* while logging a verbose log_fmt_debug format at LL_FINE level. This would
* allow a detailed view of program progress for development and debug
* purposes.
*/
int main(void) {
/*
* Set the "main" channel to output to stderr at LL_INFO level.
*/
LOG_CHANNEL *ch1 = log_open_channel_s(stderr, LL_INFO, log_fmt_systemd);
/**
* Set a second channel to log to a file at LL_FINE level and use the
* log_fmt_debug format. Turn line buffering on (useful with tail -f, for
* example).
*/
LOG_CHANNEL *ch2 = log_open_channel_f(FILENAME, LL_FINE, log_fmt_debug, true);
log_notice("this message will be printed to both");
log_info("this message will be printed to both");
log_debug("this message will be printed to file only");
log_finer("this message will not be printed at all");
log_close_channel(ch1);
log_close_channel(ch2);
return 0;
}
| 30.952381 | 79 | 0.734615 |
468ccd06fe156d58e89105486c6671f62443d7da | 917 | h | C | LZUISDK/SDK/LSDeviceManagerFramework.framework/Headers/LSDeviceManager+Connect.h | leshiguang/LZUISDK | 4e2bb38837c846b4a648d563e3842c6b6fcc1dee | [
"MIT"
] | null | null | null | LZUISDK/SDK/LSDeviceManagerFramework.framework/Headers/LSDeviceManager+Connect.h | leshiguang/LZUISDK | 4e2bb38837c846b4a648d563e3842c6b6fcc1dee | [
"MIT"
] | null | null | null | LZUISDK/SDK/LSDeviceManagerFramework.framework/Headers/LSDeviceManager+Connect.h | leshiguang/LZUISDK | 4e2bb38837c846b4a648d563e3842c6b6fcc1dee | [
"MIT"
] | null | null | null | //
// LSDeviceManager+Connect.h
// LSDeviceManagerFrameworkTests
//
// Created by alex.wu on 2019/9/9.
// Copyright © 2019 Wenzheng Zhang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "LSDeviceManager.h"
NS_ASSUME_NONNULL_BEGIN
@interface LSDeviceManager(Connect)<LSBluetoothStateChangeDelegate>
/**
* 连接设备
*
* @param deviceInfo 设备信息
*/
- (void)connectDeviceWithDeviceInfo:(Device *)deviceInfo;
/**
* 断开设备
*
* @param deviceInfo 设备信息
*/
- (void)disConnectWithDeviceInfo:(NSString *)broadcastId;
/**
* 检测蓝牙是否打开
*/
- (void)isBleEnableCompletion:(void(^)(BOOL isOpenFlags))completion;
- (BOOL)isBluetoothEnabled;
/// 检测蓝牙设备连接状态
/// @param broadcastId 设备广播id
- (BOOL)checkDeviceConnectionStateWithBroadcastId:(NSString *)broadcastId;
/// 开启数据同步
- (BOOL)startDataReceiveService;
/// 结束数据同步
-(BOOL)stopDeviceManger;
-(void)connectAllDevevices;
@end
NS_ASSUME_NONNULL_END
| 17.634615 | 74 | 0.738277 |
0bbcd6dd2743a448ed2d46fc783bfa62f03ee122 | 2,529 | h | C | src/qvi-line.h | samuelkgutierrez/quo-vadis | 2a93f1c2bbfece70a9cab4f1e2a2eb02a817560b | [
"BSD-3-Clause"
] | 3 | 2021-12-09T19:16:02.000Z | 2021-12-09T20:10:51.000Z | src/qvi-line.h | samuelkgutierrez/quo-vadis | 2a93f1c2bbfece70a9cab4f1e2a2eb02a817560b | [
"BSD-3-Clause"
] | 14 | 2021-10-23T00:46:43.000Z | 2022-03-15T20:53:04.000Z | src/qvi-line.h | samuelkgutierrez/quo-vadis | 2a93f1c2bbfece70a9cab4f1e2a2eb02a817560b | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2022 Triad National Security, LLC
* All rights reserved.
*
* This file is part of the quo-vadis project. See the LICENSE file at the
* top-level directory of this distribution.
*/
/**
* @file qvi-line.h
*
* Line types and functions for sending and receiving data over the network.
* More generally, they are types that can be easily serialized.
*/
#ifndef QVI_LINE_H
#define QVI_LINE_H
#include "qvi-common.h"
#include "qvi-bbuff.h"
#include "qvi-hwloc.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct qvi_line_config_s {
/** Not sent, initialized elsewhere. */
qvi_hwloc_t *hwloc = nullptr;
/** Connection URL. */
char *url = nullptr;
/** Path to hardware topology file. */
char *hwtopo_path = nullptr;
} qvi_line_config_t;
/** Device information struct for line transmission. */
typedef struct qvi_line_devinfo_s {
/** The bitmap encoding CPU affinity. */
hwloc_bitmap_t affinity = nullptr;
/** Device type. */
qv_hw_obj_type_t type = QV_HW_OBJ_LAST;
/** Device ID. */
int id = 0;
/** PCI bus ID. */
char *pci_bus_id = nullptr;
/** UUID */
char *uuid = nullptr;
} qvi_line_devinfo_t;
/** Hardware pool data structure for line transmission. */
typedef struct qvi_line_hwpool_s {
/** The cpuset of this resource pool. */
hwloc_bitmap_t cpuset = nullptr;
/** Number of devinfos. */
int ndevinfos = 0;
/** Array of device infos. */
qvi_line_devinfo_t *devinfos = nullptr;
} qvi_line_hwpool_t;
/**
*
*/
int
qvi_line_config_new(
qvi_line_config_t **config
);
/**
*
*/
void
qvi_line_config_free(
qvi_line_config_t **config
);
/**
*
*/
int
qvi_line_config_cp(
qvi_line_config_t *from,
qvi_line_config_t *to
);
/**
*
*/
int
qvi_line_config_pack(
qvi_line_config_t *config,
qvi_bbuff_t *buff
);
/**
*
*/
int
qvi_line_config_unpack(
void *buff,
qvi_line_config_t *config
);
/**
*
*/
int
qvi_line_devinfo_new(
qvi_line_devinfo_t *devinfo
);
/**
*
*/
void
qvi_line_devinfo_free(
qvi_line_devinfo_t *devinfo
);
/**
*
*/
int
qvi_line_hwpool_new(
qvi_line_hwpool_t **hws
);
/**
*
*/
void
qvi_line_hwpool_free(
qvi_line_hwpool_t **hws
);
/**
*
*/
int
qvi_line_hwpool_pack(
qvi_line_hwpool_t *hws,
qvi_bbuff_t *buff
);
/**
*
*/
int
qvi_line_hwpool_unpack(
void *buff,
qvi_line_hwpool_t **hws
);
#ifdef __cplusplus
}
#endif
#endif
/*
* vim: ft=cpp ts=4 sts=4 sw=4 expandtab
*/
| 15.515337 | 76 | 0.651246 |
9a171a8bc423c623f29373bd0c8f26e8fd253589 | 356 | h | C | utils.h | callmeshades/DownloadCleanerCPP | 9fc17ec22f6c9cb6ebdd9477855b1727b7eb5ffb | [
"Unlicense"
] | null | null | null | utils.h | callmeshades/DownloadCleanerCPP | 9fc17ec22f6c9cb6ebdd9477855b1727b7eb5ffb | [
"Unlicense"
] | null | null | null | utils.h | callmeshades/DownloadCleanerCPP | 9fc17ec22f6c9cb6ebdd9477855b1727b7eb5ffb | [
"Unlicense"
] | null | null | null | #pragma once
#include <iostream>
#include <vector>
#include <filesystem>
#include <fstream>
#include <string>
void prevent_close();
void tokenize(std::string const& str, std::string const& delim, std::vector<std::string>& out);
void remove_char(std::string& str, const char character);
std::string read_json_file();
void to_lowercase(std::string& string); | 29.666667 | 95 | 0.75 |
62ba34cf8cee385e8e6bc77c661b793e99eee01e | 444 | h | C | XZBActionSheet/XZBActionSheet/XZBButton.h | xiaoallocinit/XZBActionSheet | 820450680a47ee15b933f85a11cca9dd095034a7 | [
"MIT"
] | 1 | 2020-01-17T21:26:05.000Z | 2020-01-17T21:26:05.000Z | XZBActionSheet/XZBActionSheet/XZBButton.h | xiaoallocinit/XZBActionSheet | 820450680a47ee15b933f85a11cca9dd095034a7 | [
"MIT"
] | null | null | null | XZBActionSheet/XZBActionSheet/XZBButton.h | xiaoallocinit/XZBActionSheet | 820450680a47ee15b933f85a11cca9dd095034a7 | [
"MIT"
] | null | null | null | //
// XZBButton.h
// XZBActionSheet
//
// Created by 肖志斌 on 2018/7/29.
// Copyright © 2018年 xiao. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface XZBButton : UIButton
typedef void (^ClickActionBlock) (id obj);
@property (nonatomic,strong) ClickActionBlock caBlock;
- (void)initWithBlock:(ClickActionBlock)clickBlock for:(UIControlEvents)event;
+ (instancetype)btnWithBeginColor:(UIColor *)begin endColor:(UIColor *)end;
@end
| 23.368421 | 78 | 0.740991 |
bbef4765f40939dab195f9e33b19cb07348a3b1c | 78 | c | C | main.c | OmegaZhou/Simple_File_System | 1c70381627a0998c2fb099c943a1cc7ce7000886 | [
"MIT"
] | null | null | null | main.c | OmegaZhou/Simple_File_System | 1c70381627a0998c2fb099c943a1cc7ce7000886 | [
"MIT"
] | null | null | null | main.c | OmegaZhou/Simple_File_System | 1c70381627a0998c2fb099c943a1cc7ce7000886 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include "shell.h"
int main()
{
init_shell();
return 0;
} | 11.142857 | 18 | 0.641026 |
bbf28282e9419d2a8cb554a259b96d9f88bd33aa | 117 | h | C | software/k25519/hash.h | joostrenes/web | 41197df82af97d8fedca9324f4214f0ff5058283 | [
"MIT"
] | null | null | null | software/k25519/hash.h | joostrenes/web | 41197df82af97d8fedca9324f4214f0ff5058283 | [
"MIT"
] | null | null | null | software/k25519/hash.h | joostrenes/web | 41197df82af97d8fedca9324f4214f0ff5058283 | [
"MIT"
] | null | null | null | #ifndef HASH_H
#define HASH_H
void hash( unsigned char *out, const unsigned char *in, unsigned int inlen );
#endif
| 16.714286 | 77 | 0.74359 |
4abbb29f302a1d8ba3545e6127ce22fbad886d19 | 19,217 | c | C | cest.c | cpiber/cest | 2e3cd38db0679f384ba6ce977406dfc1d0b578de | [
"MIT"
] | null | null | null | cest.c | cpiber/cest | 2e3cd38db0679f384ba6ce977406dfc1d0b578de | [
"MIT"
] | null | null | null | cest.c | cpiber/cest | 2e3cd38db0679f384ba6ce977406dfc1d0b578de | [
"MIT"
] | null | null | null | #define _GNU_SOURCE
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/wait.h>
#define DEBUG
#include "array.h"
#include "lexer.h"
#define SV_IMPLEMENTATION
#include "sv.h"
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define POSIX_WORK(name, ...) do \
{ \
if (name(__VA_ARGS__) < 0) { \
perror(__FILE__ ":" TOSTRING(__LINE__) ":" #name); \
exit(1); \
} \
} while(0);
#define UNREACHABLE do { assert(0 && "unreachable"); exit(99); } while(0);
#define INSERT_STR "CEST_MACROS_HERE"
// TODO: does not consider typedef`s without body (i.e. forward defs)
// TODO: implement multiple inheritance
typedef struct {
String_View defn;
String_View strt;
String_View tdef;
bool hasParent;
size_t parent;
MAKE_ARRAY(size_t, inherits)
const char *loc_start;
const char *loc_end;
const char *loc_after;
} StructDef;
typedef struct {
MAKE_ARRAY(StructDef, items)
const char *orig;
} StructArr;
#define INITIAL_FILE_CAP 1000
String_View preprocess_file(const char *filename) {
int fd[2];
POSIX_WORK(pipe, fd);
pid_t child = fork();
if (child < 0) {
perror("fork");
exit(1);
} else if (child == 0) {
// child process
POSIX_WORK(close, fd[0]); // close read end
POSIX_WORK(dup2, fd[1], STDOUT_FILENO); // use pipe as stdout to read in parent process
POSIX_WORK(execlp, "cc", "cc", "-x", "c", "-fdirectives-only", "-w", "-E", filename, NULL);
UNREACHABLE
}
// parent process
POSIX_WORK(close, fd[1]); // close write end
size_t size = 0;
char *ptr = NULL;
size_t total = 0;
ssize_t nread = 0;
do {
total += nread;
if (total >= size) {
size = size == 0 ? INITIAL_FILE_CAP : size * 2; // new size double
ptr = realloc(ptr, size);
if (ptr == NULL) {
perror("realloc preprocess_file");
exit(1);
}
}
} while ((nread = read(fd[0], ptr + total, size - total)) > 0);
if (nread < 0) {
perror("read");
exit(1);
}
POSIX_WORK(close, fd[0]);
int status;
POSIX_WORK(waitpid, child, &status, 0);
if (!WIFEXITED(status)) {
fprintf(stderr, "child crashed\n");
exit(1);
} else if (WEXITSTATUS(status) != 0) {
fprintf(stderr, "child did not exit normally\n");
exit(1);
}
ptr[total] = 0;
return (String_View) {
.count = total,
.data = ptr,
};
}
String_View load_file(const char *filename) {
FILE *f = fopen(filename, "r");
if (f == NULL) {
perror("fopen load_file");
exit(1);
}
POSIX_WORK(fseek, f, 0, SEEK_END);
long size = ftell(f);
if (size < 0) {
perror("ftell");
exit(1);
}
POSIX_WORK(fseek, f, 0, SEEK_SET);
char *ptr = malloc(size + 1);
if (fread(ptr, size, 1, f) != 1 && ferror(f)) { // read one entire buffer or fail
perror("fread");
exit(1);
}
POSIX_WORK(fclose, f);
ptr[size] = 0;
return (String_View) {
.count = size,
.data = ptr,
};
}
char *struct_to_name(StructDef def, bool include_struct_body) {
const size_t n = def.strt.count ? sizeof("struct ") - 1 + def.strt.count : 0;
const size_t m = n && def.tdef.count ? 3 : 0;
char *fname = malloc(n + def.tdef.count + m + 1 + include_struct_body ? sizeof(" struct body") - 1 : 0);
if (fname == NULL) {
perror("malloc filename");
exit(1);
}
if (n) {
strcpy(fname, "struct ");
strncat(fname, def.strt.data, def.strt.count);
}
if (m) strcat(fname, " / ");
strncat(fname, def.tdef.data, def.tdef.count);
if (include_struct_body) strcat(fname, " struct body");
return fname;
}
bool parse_structdef(Lexer *lexer, String_View *strt, String_View *def, bool *is_struct, String_View *who) {
bool is_inherit = false;
TokenOrEnd nameOrParen = lexer_peek_token(lexer);
if (nameOrParen.has_value && nameOrParen.token.kind == TK_NAME) {
*strt = nameOrParen.token.content;
lexer_expect_token(lexer);
}
Token paren = lexer_expect_token(lexer);
if (paren.kind != TK_PAREN)
lexer_exit_err(paren.loc, stderr, "Expected identifier or `{'");
if (sv_eq(paren.content, SV("("))) {
is_inherit = true;
TokenOrEnd nameOrStruct = lexer_peek_token(lexer);
if (nameOrStruct.has_value && nameOrStruct.token.kind == TK_STRUCT) {
if (is_struct) *is_struct = true;
lexer_expect_token(lexer);
}
Token name = lexer_expect_token(lexer);
if (name.kind != TK_NAME)
lexer_exit_err(paren.loc, stderr, "Expected identifier or `struct'");
if (who) *who = name.content;
Token closeParen = lexer_expect_token(lexer);
if (closeParen.kind != TK_PAREN || !sv_eq(closeParen.content, SV(")")))
lexer_exit_err(closeParen.loc, stderr, "Expected `)'");
paren = lexer_expect_token(lexer);
}
if (paren.kind != TK_PAREN || !sv_eq(paren.content, SV("{")))
lexer_exit_err(paren.loc, stderr, "Expected identifier or `{'");
*def = lexer->content;
TokenOrEnd ntoken = lexer_peek_token(lexer);
while (ntoken.has_value) {
// TODO: maybe error check definition contents
if (ntoken.token.kind == TK_PAREN && sv_eq(ntoken.token.content, SV("}")))
break;
lexer_expect_token(lexer);
ntoken = lexer_peek_token(lexer);
}
Token closeParen = lexer_expect_token(lexer);
if (closeParen.kind != TK_PAREN || !sv_eq(closeParen.content, SV("}")))
lexer_exit_err(closeParen.loc, stderr, "Expected `}'");
def->count = closeParen.content.data - def->data;
return is_inherit;
}
void parse_struct(StructArr *structs, Lexer *lexer) {
String_View strt = {0}, def = {0};
if (parse_structdef(lexer, &strt, &def, NULL, NULL)) return;
StructDef item = (StructDef) {
.defn = def,
.strt = strt,
};
ARRAY_PUSH(*structs, items, item);
}
void parse_typedef(StructArr *structs, Lexer *lexer) {
Token token = lexer_expect_token(lexer);
if (token.kind != TK_STRUCT) return;
String_View strt = {0}, def = {0};
if (parse_structdef(lexer, &strt, &def, NULL, NULL)) return;
TokenOrEnd nameOrSemi = lexer_peek_token(lexer);
String_View tpdef;
if (nameOrSemi.has_value && nameOrSemi.token.kind == TK_NAME) {
tpdef = nameOrSemi.token.content;
lexer_expect_token(lexer);
}
StructDef item = (StructDef) {
.defn = def,
.strt = strt,
.tdef = tpdef,
};
ARRAY_PUSH(*structs, items, item);
}
StructArr collect_structs(const char *filename) {
String_View file = preprocess_file(filename);
assert(file.data[file.count] == 0);
StructArr structs = {
.orig = file.data,
};
char *fname = malloc(strlen(filename) + sizeof(" (preprocessed)"));
if (fname == NULL) {
perror("malloc filename");
exit(1);
}
strcpy(fname, filename);
strcat(fname, " (preprocessed)");
Lexer lexer = lexer_create(sv_from_cstr(fname), file);
size_t depth = 0;
TokenOrEnd token = lexer_get_token(&lexer);
for (; token.has_value; token = lexer_get_token(&lexer)) {
Token t = token.token;
if (t.kind == TK_PAREN && sv_eq(t.content, SV("}"))) {
depth -= 1;
continue;
}
if (t.kind == TK_PAREN && sv_eq(t.content, SV("{"))) {
depth += 1;
continue;
}
if (t.kind == TK_TYPEDF) {
parse_typedef(&structs, &lexer);
continue;
}
if (t.kind == TK_STRUCT) {
parse_struct(&structs, &lexer);
continue;
}
// ignore everything else
}
if (depth != 0)
lexer_exit_err(lexer.loc, stderr, "Unclosed block");
free(fname);
return structs;
}
bool parse_struct_inherit(Lexer *lexer, String_View *strt, String_View *def, bool *is_struct, String_View *who) {
return parse_structdef(lexer, strt, def, is_struct, who);
}
bool parse_typedef_inherit(Lexer *lexer, String_View *strt, String_View *def, String_View *tpdef, bool *is_struct, String_View *who) {
Token token = lexer_expect_token(lexer);
if (token.kind != TK_STRUCT) return false;
if (!parse_structdef(lexer, strt, def, is_struct, who)) return false;
TokenOrEnd nameOrSemi = lexer_peek_token(lexer);
if (nameOrSemi.has_value && nameOrSemi.token.kind == TK_NAME) {
*tpdef = nameOrSemi.token.content;
lexer_expect_token(lexer);
}
return true;
}
void collect_inherits(StructArr *structs, String_View file, String_View filename) {
Lexer lexer = lexer_create(filename, file);
size_t depth = 0;
TokenOrEnd token = lexer_get_token(&lexer);
for (; token.has_value; token = lexer_get_token(&lexer)) {
Token t = token.token;
if (t.kind == TK_PAREN && sv_eq(t.content, SV("}"))) {
depth -= 1;
continue;
}
if (t.kind == TK_PAREN && sv_eq(t.content, SV("{"))) {
depth += 1;
continue;
}
if (t.kind != TK_TYPEDF && t.kind != TK_STRUCT) continue; // ignore everything else
StructDef new = {0};
String_View who = {0};
bool is_struct = false;
new.loc_start = t.content.data;
if (t.kind == TK_TYPEDF) {
if (!parse_typedef_inherit(&lexer, &new.strt, &new.defn, &new.tdef, &is_struct, &who))
continue;
// typdef given but no name -> skip it
if (new.tdef.count == 0) {
lexer_dump_warn(t.loc, stderr, "Warning: typedef but no name for child of `" SV_Fmt "`", SV_Arg(who));
new.loc_start += t.content.count;
}
}
if (t.kind == TK_STRUCT) {
if (!parse_struct_inherit(&lexer, &new.strt, &new.defn, &is_struct, &who))
continue;
}
new.loc_end = lexer.content.data - new.tdef.count;
if (!new.strt.count && !new.tdef.count) {
lexer_dump_warn(t.loc, stderr, "Warning: neither struct name nor typedef given for child of `" SV_Fmt "`", SV_Arg(who));
}
for (; token.has_value; token = lexer_get_token(&lexer)) {
if (token.token.kind == TK_SEP && sv_eq(token.token.content, SV(";"))) {
new.loc_after = lexer.content.data;
break;
}
}
for (size_t i = 0; i < structs->items_count; ++i) {
if ((is_struct && sv_eq(who, structs->items[i].strt)) ||
(!is_struct && sv_eq(who, structs->items[i].tdef))) {
new.parent = i;
new.hasParent = true;
ARRAY_PUSH(*structs, items, new);
if (new.strt.count || new.tdef.count) // TODO: is this good? parent-child broken...
ARRAY_PUSH(structs->items[i], inherits, structs->items_count - 1);
break;
}
}
if (!new.hasParent)
lexer_dump_err(t.loc, stderr, "Error: no parent `" SV_Fmt "` known in definition of %s", SV_Arg(who), struct_to_name(new, false));
}
if (depth != 0)
lexer_exit_err(lexer.loc, stderr, "Unclosed block");
}
#define WRITE(ptr, size) do \
{ \
/* write one entire buffer or fail */ \
if (fwrite(ptr, size, 1, outfile) != 1 && ferror(outfile)) { \
perror("fwrite"); \
exit(1); \
} \
} while (0);
void dump_def(StructArr data, StructDef def, FILE *outfile) {
if (def.hasParent) dump_def(data, data.items[def.parent], outfile);
WRITE(def.defn.data, def.defn.count);
}
void dump_type_name(StructDef def, FILE *outfile) {
static char strut[] = "struct ";
if (def.strt.count) {
WRITE(strut, sizeof(strut) - 1);
WRITE(def.strt.data, def.strt.count);
} else {
assert(def.tdef.count);
WRITE(def.tdef.data, def.tdef.count);
}
}
String_View extract_property(Lexer *lexer) {
String_View last_name = {0};
while (true) {
Token token = lexer_expect_token(lexer);
if (token.kind == TK_NAME) last_name = token.content;
else if (token.kind == TK_SEP && sv_eq(token.content, SV(";"))) break;
}
return last_name;
}
void dump_asserts(StructArr data, StructDef def, StructDef curparent, StructDef parent, FILE *outfile) {
// dump asserts for all fields in parent chain, but with actual parent name
if (parent.hasParent) dump_asserts(data, def, curparent, data.items[parent.parent], outfile);
char *fname = struct_to_name(parent, true);
Lexer lexer = lexer_create(sv_from_cstr(fname), parent.defn);
TokenOrEnd token = lexer_get_token(&lexer);
for (; token.has_value; token = lexer_get_token(&lexer)) {
Token t = token.token;
if (t.kind != TK_NAME)
lexer_exit_err(t.loc, stderr, "Expected a type");
String_View property = extract_property(&lexer);
if (!property.count)
lexer_exit_err(t.loc, stderr, "Not a valid property");
static char assrt1[] = "_Static_assert(offsetof(";
static char assrt2[] = ") == offsetof(";
static char assrt3[] = "), \"Offsets don't match\");\n";
WRITE(assrt1, sizeof(assrt1) - 1);
dump_type_name(def, outfile);
WRITE(", ", 2);
WRITE(property.data, property.count);
WRITE(assrt2, sizeof(assrt2) - 1);
dump_type_name(curparent, outfile);
WRITE(", ", 2);
WRITE(property.data, property.count);
WRITE(assrt3, sizeof(assrt3) - 1);
}
free(fname);
}
void dump_child_cast(StructArr data, StructDef in, String_View name, bool is_struct, bool ptr, FILE *outfile) {
static char stut[] = "struct ";
// <typename>: *(<parent>*)&(T)
// or
// <typename>*: (<parent>*)(T)
WRITE(", ", 2);
if (in.strt.count) {
WRITE(stut, sizeof(stut) - 1);
WRITE(in.strt.data, in.strt.count);
} else {
assert(in.tdef.count);
WRITE(in.tdef.data, in.tdef.count);
}
if (ptr) WRITE("*", 1);
WRITE(": ", 2);
if (!ptr) WRITE("*", 1);
WRITE("(", 1);
if (is_struct) WRITE(stut, sizeof(stut) - 1);
WRITE(name.data, name.count);
WRITE("*)", 2);
if (!ptr) WRITE("&", 1);
WRITE("(T)", 3);
// recurse into children to allow casting up the chain
for (size_t i = 0; i < in.inherits_count; ++i) {
StructDef in2 = data.items[in.inherits[i]];
dump_child_cast(data, in2, name, is_struct, ptr, outfile);
}
}
void dump_cast(StructArr data, StructDef def, String_View name,
bool is_struct, bool ptr, FILE *outfile) {
if (!def.inherits_count) return;
static char defc[] = "#define CEST_AS_";
static char strt[] = "struct_";
static char gene[] = "(T) _Generic((T)";
static char stut[] = "struct ";
WRITE(defc, sizeof(defc) - 1);
if (is_struct) WRITE(strt, sizeof(strt) - 1);
WRITE(name.data, name.count);
if (ptr) WRITE("S", 1);
WRITE(gene, sizeof(gene) - 1);
WRITE(", ", 2);
if (is_struct) WRITE(stut, sizeof(stut) - 1);
WRITE(name.data, name.count);
if (ptr) WRITE("*", 1);
WRITE(": (T)", 5);
for (size_t i = 0; i < def.inherits_count; ++i) {
StructDef in = data.items[def.inherits[i]];
dump_child_cast(data, in, name, is_struct, ptr, outfile);
}
WRITE(")\n", 2);
}
void output_casts(StructArr data, FILE *outfile) {
for (size_t i = 0; i < data.items_count; ++i) {
StructDef def = data.items[i];
if (def.strt.count) dump_cast(data, def, def.strt, true, false, outfile);
if (def.strt.count) dump_cast(data, def, def.strt, true, true, outfile);
if (def.tdef.count) dump_cast(data, def, def.tdef, false, false, outfile);
if (def.tdef.count) dump_cast(data, def, def.tdef, false, true, outfile);
}
}
void replace_inherits(StructArr data, String_View file, FILE *outfile) {
char *ins = NULL;
const char *last = file.data;
// items are guaranteed to be in order
for (size_t i = 0; i < data.items_count; ++i) {
StructDef def = data.items[i];
if (!def.hasParent) continue;
if ((ins = strstr(last, INSERT_STR)) != NULL && ins < def.loc_start) {
WRITE(last, ins - last);
output_casts(data, outfile);
WRITE(ins + sizeof(INSERT_STR) - 1, def.loc_start - (ins + sizeof(INSERT_STR) - 1));
} else {
WRITE(last, def.loc_start - last);
}
static char tpdef[] = "typedef ";
static char strut[] = "struct ";
if (def.tdef.count) WRITE(tpdef, sizeof(tpdef) - 1);
WRITE(strut, sizeof(strut) - 1);
WRITE(def.strt.data, def.strt.count);
WRITE("{", 1);
dump_def(data, def, outfile);
WRITE("}", 1);
WRITE(def.loc_end, def.loc_after - def.loc_end);
WRITE("\n", 1);
if (def.strt.count || def.tdef.count)
dump_asserts(data, def, data.items[def.parent], data.items[def.parent], outfile);
last = def.loc_after;
}
size_t rest = (file.data + file.count) - last;
if ((ins = strstr(last, INSERT_STR)) != NULL && ins < last + rest) {
WRITE(last, ins - last);
output_casts(data, outfile);
WRITE(ins + sizeof(INSERT_STR) - 1, file.data + file.count - (ins + sizeof(INSERT_STR) - 1));
} else {
WRITE(last, rest);
}
}
#undef WRITE
void print_struct_def(StructArr arr, StructDef def, int level) {
printf("%*.s", level * 2, "");
if (def.strt.count) printf("struct " SV_Fmt, SV_Arg(def.strt));
if (def.strt.count && def.tdef.count) printf(" / ");
if (def.tdef.count) printf(SV_Fmt, SV_Arg(def.tdef));
if (def.hasParent) printf(" (parent: %zu)", def.parent);
printf("\n");
if (def.inherits_count) {
printf("%*.sChildren:\n", level * 2, "");
for (size_t i = 0; i < def.inherits_count; ++i) {
print_struct_def(arr, arr.items[def.inherits[i]], level + 1);
}
}
}
void usage(FILE *stream, const char *program) {
fprintf(stream, "%s <in file> [<out file>]\n", program);
fprintf(stream, " <in file> File to resolve inheritance in\n");
fprintf(stream, " <out file> File to place results in, may be - for stdout\n");
}
#ifndef NO_MAIN
int main(int argc, char *argv[]) {
if (argc > 1 && strcmp(argv[1], "-h") == 0) {
usage(stdout, argv[0]);
exit(0);
}
if (argc < 2) {
fprintf(stderr, "too few arguments provided!\n");
usage(stderr, argv[0]);
exit(1);
}
char *outstr = "-";
if (argc >= 3) outstr = argv[2];
StructArr strts = collect_structs(argv[1]);
#ifdef DEBUG
printf("Originally known structs:\n");
for (size_t i = 0; i < strts.items_count; i++) {
print_struct_def(strts, strts.items[i], 0);
}
#endif // DEBUG
String_View file = load_file(argv[1]);
collect_inherits(&strts, file, sv_from_cstr(argv[1]));
#ifdef DEBUG
printf("-------------------------\n");
printf("Structs after inheritance:\n");
for (size_t i = 0; i < strts.items_count; i++) {
print_struct_def(strts, strts.items[i], 0);
}
printf("-------------------------\n");
#endif // DEBUG
// TODO: collect anonymous typedefs
// will require making tdef an array
FILE *outfile = stdout;
if (strcmp(outstr, "-") != 0) outfile = fopen(outstr, "w");
if (outfile == NULL) {
fprintf(stderr, "Could not open file `%s` for writing: %s\n", outstr, strerror(errno));
exit(1);
}
replace_inherits(strts, file, outfile);
if (strcmp(outstr, "-") != 0) POSIX_WORK(fclose, outfile);
free((void *)strts.orig);
for (size_t i = 0; i < strts.items_count; ++i) free((void *)strts.items[i].inherits);
free((void *)strts.items);
free((void *)file.data);
return 0;
}
#endif // NO_MAIN
| 32.243289 | 136 | 0.610345 |
6d265555e6bd00bccb5005034c46b12923fb9dd0 | 12,448 | h | C | android/android_9/hardware/intel/common/libmix/mix_vbp/viddec_fw/include/viddec_fw_parser_host.h | yakuizhao/intel-vaapi-driver | b2bb0383352694941826543a171b557efac2219b | [
"MIT"
] | 1 | 2017-09-22T01:41:30.000Z | 2017-09-22T01:41:30.000Z | intel/common/libmix/mix_vbp/viddec_fw/include/viddec_fw_parser_host.h | Keneral/ahardware | 9a8a025f7c9471444c9e271bbe7f48182741d710 | [
"Unlicense"
] | null | null | null | intel/common/libmix/mix_vbp/viddec_fw/include/viddec_fw_parser_host.h | Keneral/ahardware | 9a8a025f7c9471444c9e271bbe7f48182741d710 | [
"Unlicense"
] | 1 | 2018-02-24T19:09:04.000Z | 2018-02-24T19:09:04.000Z | /*
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
GPL LICENSE SUMMARY
Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
BSD LICENSE
Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted 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 Intel Corporation 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
OWNER 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 VIDDEC_FW_PARSER_HOST_H
#define VIDDEC_FW_PARSER_HOST_H
#ifdef __cplusplus
extern "C" {
#endif
#include "viddec_fw_common_defs.h"
/** @weakgroup viddec Fw Parser interface Functions */
/** @ingroup viddec_fw_parser */
/*@{*/
/**
This function returns the size required for loading fw.
@retval size : Required size.
*/
uint32_t viddec_fw_parser_query_fwsize(void);
/**
This function loads Parser Firmware and initialises necessary state information.This a synchronous message to FW.
@param[in] phys : Physical address on where firmware should be loaded.
@param[in] len : Length of data allocated at phys.
@retval VIDDEC_FW_SUCCESS : Successfully loaded firmware.
@retval VIDDEC_FW_FAILURE : Failed to communicate with firmware.
@retval VIDDEC_FW_NORESOURCES : Failed to allocate resources for Loading firmware.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
*/
uint32_t viddec_fw_parser_loadfw(uint32_t phys, uint32_t len);
/**
This function returns the size required opening a stream. This a synchronous message to FW.
@param[in] codec_type : Type of codec that we want information about.
@param[out] num_wklds : Number of wklds required for initialisation.
@param[out] size : Size of memory required for opening a stream.
*/
void viddec_fw_parser_query_streamsize(uint32_t codec_type, uint32_t *num_wklds, uint32_t *size);
/**
This function opens requested codec.This a synchronous message to FW.
@param[in] codec_type : Type of codec that we want to open.
@param[in] phys : Physical address of allocated memory for this codec.
@param[in] prority : Priority of stream. 1 for realtime and 0 for background.
@param[out] strm_handle : Handle of the opened stream.
@retval VIDDEC_FW_SUCCESS : Successfully Opened the stream.
@retval VIDDEC_FW_FAILURE : Failed to Open a stream.
@retval VIDDEC_FW_NORESOURCES : Failed to Open a stream as we are out of resources.
*/
uint32_t viddec_fw_parser_openstream(uint32_t codec_type, uint32_t *strm_handle, uint32_t phys, uint32_t priority);
/**
This function closes stream.This a synchronous message to FW.
For the close stream to be effective, host has to do flush with discard first and then close the stream.
@param[in] strm_handle : Handle of the stream to close.
*/
void viddec_fw_parser_closestream(uint32_t strm_handle);
/**
This function flushes the current stream. This is a synchronous message to FW.
Before calling this function the host has to make sure the output queue of the firmware
is empty. After this function is executed the FW will read all entries in input
es buffer queue into a free or partial workload and push it into output queue.
After this operation the host has to read all entries in output queue again to
finish the flush operation.
@param[in] flush_type : Type of flush we want to perform.ex:flush and discard.
@param[in] strm_handle : Handle of the stream we want to flush.
@retval VIDDEC_FW_SUCCESS : Successfully flushed the stream.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
@retval VIDDEC_FW_NEED_FREE_WKLD : Failed to flush sice a free wkld was not available.
*/
uint32_t viddec_fw_parser_flushstream(uint32_t strm_handle, uint32_t flush_type);
/**
This function sends an input es buffer.
@param[in] strm_handle : The handle of stream that we want to send es buffer to.
@param[in] message : The es buffer we want to send.
@retval VIDDEC_FW_SUCCESS : Successfully Sent the message.
@retval VIDDEC_FW_PORT_FULL : Port to fw full unsuccesful in sending message.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
*/
uint32_t viddec_fw_parser_send(uint32_t strm_handle, ipc_msg_data *message);
/**
This function gets the next processed workload. The host is required to add free workloads
to keep the parser busy. The FW will stall when it doesn't have enough workloads(2) to continue.
@param[in] strm_handle : The handle of stream that we want to read workload from.
@param[out] message : The workload descriptor.
@retval VIDDEC_FW_SUCCESS : Successfully Sent the message.
@retval VIDDEC_FW_PORT_EMPTY : Workload port is empty,unsuccesful in reading wkld.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
*/
uint32_t viddec_fw_parser_recv(uint32_t strm_handle, ipc_msg_data *message);
/**
This function adds a free workload to current stream.
@param[in] strm_handle : The handle of stream that we want to write workload to.
@param[out] message : The workload descriptor.
@retval VIDDEC_FW_SUCCESS : Successfully Sent the message.
@retval VIDDEC_FW_PORT_FULL : Workload port is full,unsuccesful in writing wkld.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
*/
uint32_t viddec_fw_parser_addwkld(uint32_t strm_handle, ipc_msg_data *message);
/**
This function enables or disables Interrupts for a stream. By default the FW will always enable interrupts.
The driver can disable/enable Interrupts if it needs for this particular stream.
@param[in] strm_handle : The handle of stream that we want to get mask from
@param[in] mask : This is read as boolean variable, true to enable, false to disable.
@retval VIDDEC_FW_SUCCESS : Successfully set mask.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
*/
uint32_t viddec_fw_parser_set_interruptmask(uint32_t strm_handle, uint32_t mask);
/**
This function gets the interrupt status for current stream.
When the host gets Interrupted since its a global interrupt it's expected that host will look at all active streams,
by calling this function. The status is what the FW thinks the current state of stream is. The status information that
FW provides is complete information on all possible events that are defined. The host should only access this information
in its ISR at which state FW doesn't modify this information.
@param[in] strm_handle : The handle of stream that we want to get mask from
@param[out] status : The status of the stream based on viddec_fw_parser_int_status_t enum.
@retval VIDDEC_FW_SUCCESS : Successfully in reading status.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
*/
uint32_t viddec_fw_parser_getstatus(uint32_t strm_handle, uint32_t *status);
/**
This function allows to set stream attributes that are supported.
@param[in] strm_handle : The handle of stream that we want to set attribute on.
@param[in] type : The type of attribute we want to set, this should be one of items in viddec_fw_stream_attributes_t.
@param[in] value : The value of the type that we want to set.
@retval VIDDEC_FW_SUCCESS : Successfully Set the attribute.
@retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid.
*/
uint32_t viddec_fw_parser_set_stream_attributes(uint32_t strm_handle, uint32_t type, uint32_t value);
/**
This function allows to get current status of all the parser queues. If the current stream is active we return
number of inout messages that can be written to input queue, no of messages in output queue and number of
free available workloads the stream has.
Normally this is called when Host receives an interrupt from parser, In which case before releasing the INT
Host will try its best to keep the FW busy. We always get a interrupt if we passed the watermark on input or
a workload was pushed into output and INT line is free. If host holds onto INT when firmware tries to send an INT
FW would send the Interrupt after host releases INT. Since we have EDGE triggered interrupts we cannot guarantee
one interrupt per frame, ex: If three frames are generated and after the first frame FW was able to provide an INT
to host, but host held on to INT while the FW finished the next two frames, after host releases the INT the FW will
give only one INT and host should try to empty output queue.
@param[in] strm_handle : The handle of stream that we want to get status of queues.
@param[out] status : The status of each queue gets updated in here.
@retval VIDDEC_FW_SUCCESS : Successfully Got the status information.
@retval VIDDEC_FW_INVALID_PARAM: Invalid parameter in this case an inactive stream.
*/
uint32_t viddec_fw_parser_get_queue_status(uint32_t strm_handle, viddec_fw_q_status_t *status);
/**
This function unloads Parser Firmware and free's the resources allocated in Load fw.
If this function is called before load fw it will crash with a segmentation fault.
*/
void viddec_fw_parser_deinit(void);
/**
This function gets the major and minor revison numbers of the loaded firmware.
@param[out] major : The major revision numner.
@param[out] minor : The minor revision number.
@param[out] build : The Internal Build number.
*/
void viddec_fw_parser_get_version_number(unsigned int *major, unsigned int *minor, unsigned int *build);
/**
This function clears the global interrupt. This is the last thing host calls before exiting ISR.
*/
void viddec_fw_parser_clear_global_interrupt(void);
/*@}*/
#ifdef __cplusplus
}
#endif
#endif//#ifndef VIDDEC_FW_PARSER_HOST_H
| 52.302521 | 135 | 0.732808 |
1374f56499a47b262e79f4a20a23aff6755ab674 | 8,357 | h | C | platform/include/crypto/tt_cipher.h | newser/TitanSDK | fcddad88e91873584e93cee6d2cf1da567388316 | [
"Apache-2.0"
] | 3 | 2017-07-12T07:41:47.000Z | 2018-12-07T07:12:06.000Z | platform/include/crypto/tt_cipher.h | newser/TitanSDK | fcddad88e91873584e93cee6d2cf1da567388316 | [
"Apache-2.0"
] | 4 | 2016-12-12T15:20:52.000Z | 2017-07-12T07:40:23.000Z | platform/include/crypto/tt_cipher.h | newser/TitanSDK | fcddad88e91873584e93cee6d2cf1da567388316 | [
"Apache-2.0"
] | null | null | null | /* Copyright (C) 2017 haniu (niuhao.cn@gmail.com)
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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 tt_cipher.h
@brief encrypt & decrypt
this file defines encrypt and decrypt APIs
*/
#ifndef __TT_CIPHER__
#define __TT_CIPHER__
////////////////////////////////////////////////////////////
// import header files
////////////////////////////////////////////////////////////
#include <misc/tt_assert.h>
#include <cipher.h>
////////////////////////////////////////////////////////////
// macro definition
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// type definition
////////////////////////////////////////////////////////////
struct tt_buf_s;
typedef enum {
TT_CIPHER_NULL,
TT_AES_128_ECB,
TT_AES_192_ECB,
TT_AES_256_ECB,
TT_AES_128_CBC,
TT_AES_192_CBC,
TT_AES_256_CBC,
TT_AES_128_CFB128,
TT_AES_192_CFB128,
TT_AES_256_CFB128,
TT_AES_128_CTR,
TT_AES_192_CTR,
TT_AES_256_CTR,
TT_AES_128_GCM,
TT_AES_192_GCM,
TT_AES_256_GCM,
TT_CAMELLIA_128_ECB,
TT_CAMELLIA_192_ECB,
TT_CAMELLIA_256_ECB,
TT_CAMELLIA_128_CBC,
TT_CAMELLIA_192_CBC,
TT_CAMELLIA_256_CBC,
TT_CAMELLIA_128_CFB128,
TT_CAMELLIA_192_CFB128,
TT_CAMELLIA_256_CFB128,
TT_CAMELLIA_128_CTR,
TT_CAMELLIA_192_CTR,
TT_CAMELLIA_256_CTR,
TT_CAMELLIA_128_GCM,
TT_CAMELLIA_192_GCM,
TT_CAMELLIA_256_GCM,
TT_DES_ECB,
TT_DES_CBC,
TT_DES_EDE_ECB,
TT_DES_EDE_CBC,
TT_DES_EDE3_ECB,
TT_DES_EDE3_CBC,
TT_BLOWFISH_ECB,
TT_BLOWFISH_CBC,
TT_BLOWFISH_CFB64,
TT_BLOWFISH_CTR,
TT_ARC4_128,
TT_AES_128_CCM,
TT_AES_192_CCM,
TT_AES_256_CCM,
TT_CAMELLIA_128_CCM,
TT_CAMELLIA_192_CCM,
TT_CAMELLIA_256_CCM,
TT_CIPHER_TYPE_NUM
} tt_cipher_type_t;
#define TT_CIPHER_TYPE_VALID(i) ((i) < TT_CIPHER_TYPE_NUM)
typedef enum {
TT_PADDING_PKCS7,
TT_PADDING_ONE_AND_ZEROS,
TT_PADDING_ZEROS_AND_LEN,
TT_PADDING_ZEROS,
TT_PADDING_NONE,
TT_PADDING_NUM
} tt_cipher_padding_t;
#define TT_CIPHER_PADDING_VALID(i) ((i) < TT_PADDING_NUM)
typedef struct
{
mbedtls_cipher_context_t ctx;
} tt_cipher_t;
////////////////////////////////////////////////////////////
// global variants
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// interface declaration
////////////////////////////////////////////////////////////
tt_inline void tt_cipher_init(IN tt_cipher_t *cipher)
{
TT_ASSERT(cipher != NULL);
mbedtls_cipher_init(&cipher->ctx);
}
tt_inline void tt_cipher_destroy(IN tt_cipher_t *cipher)
{
mbedtls_cipher_free(&cipher->ctx);
}
tt_export tt_result_t tt_cipher_setup(IN tt_cipher_t *cipher,
IN tt_cipher_type_t type,
IN tt_bool_t encrypt,
IN tt_u8_t *key,
IN tt_u32_t len);
tt_export tt_result_t tt_cipher_set_iv(IN tt_cipher_t *cipher,
IN tt_u8_t *iv,
IN tt_u32_t len);
tt_export tt_result_t tt_cipher_set_pad(IN tt_cipher_t *cipher,
IN tt_cipher_padding_t padding);
// must be called after tt_cipher_setup and tt_cipher_set_iv
tt_export tt_result_t tt_cipher_set_aad(IN tt_cipher_t *cipher,
IN tt_u8_t *aad,
IN tt_u32_t len);
tt_export tt_result_t tt_cipher_update(IN tt_cipher_t *cipher,
IN tt_u8_t *input,
IN tt_u32_t ilen,
IN tt_u8_t *output,
IN tt_u32_t *olen);
tt_export tt_result_t tt_cipher_finish(IN tt_cipher_t *cipher,
IN tt_u8_t *output,
IN tt_u32_t *olen);
tt_export tt_result_t tt_cipher_tag(IN tt_cipher_t *cipher,
IN tt_u8_t *tag,
IN tt_u32_t len);
tt_export tt_result_t tt_cipher_auth(IN tt_cipher_t *cipher,
IN tt_u8_t *tag,
IN tt_u32_t len);
tt_export tt_result_t tt_cipher_update_buf(IN tt_cipher_t *cipher,
IN tt_u8_t *input,
IN tt_u32_t ilen,
IN struct tt_buf_s *obuf);
tt_export tt_result_t tt_cipher_finish_buf(IN tt_cipher_t *cipher,
IN struct tt_buf_s *obuf);
tt_export tt_result_t tt_cipher_encrypt_tag(IN tt_cipher_t *cipher,
IN tt_u8_t *iv,
IN tt_u32_t iv_len,
IN tt_u8_t *aad,
IN tt_u32_t ad_len,
IN tt_u8_t *input,
IN tt_u32_t ilen,
IN tt_u8_t *output,
IN tt_u32_t *olen,
IN tt_u8_t *tag,
IN tt_u32_t tag_len);
tt_export tt_result_t tt_cipher_decrypt_auth(IN tt_cipher_t *cipher,
IN tt_u8_t *iv,
IN tt_u32_t iv_len,
IN tt_u8_t *aad,
IN tt_u32_t ad_len,
IN tt_u8_t *input,
IN tt_u32_t ilen,
IN tt_u8_t *output,
IN tt_u32_t *olen,
IN tt_u8_t *tag,
IN tt_u32_t tag_len);
tt_export tt_result_t tt_cipher_encrypt_tag_buf(IN tt_cipher_t *cipher,
IN tt_u8_t *iv,
IN tt_u32_t iv_len,
IN tt_u8_t *aad,
IN tt_u32_t ad_len,
IN tt_u8_t *input,
IN tt_u32_t ilen,
IN struct tt_buf_s *obuf,
IN tt_u8_t *tag,
IN tt_u32_t tag_len);
tt_export tt_result_t tt_cipher_decrypt_auth_buf(IN tt_cipher_t *cipher,
IN tt_u8_t *iv,
IN tt_u32_t iv_len,
IN tt_u8_t *aad,
IN tt_u32_t ad_len,
IN tt_u8_t *input,
IN tt_u32_t ilen,
IN struct tt_buf_s *obuf,
IN tt_u8_t *tag,
IN tt_u32_t tag_len);
#endif
| 36.814978 | 75 | 0.467034 |
1a03fd3f43a61f16321092e6568fdfd98bd1230b | 215 | h | C | 05_DIYUI/05_DIYUI/SafeAreaTest/FMTestView.h | OSzhou/MyTestDemo | bf03ccaff9e4a95374bd60674b4e7590c67dd1d6 | [
"Apache-2.0"
] | null | null | null | 05_DIYUI/05_DIYUI/SafeAreaTest/FMTestView.h | OSzhou/MyTestDemo | bf03ccaff9e4a95374bd60674b4e7590c67dd1d6 | [
"Apache-2.0"
] | null | null | null | 05_DIYUI/05_DIYUI/SafeAreaTest/FMTestView.h | OSzhou/MyTestDemo | bf03ccaff9e4a95374bd60674b4e7590c67dd1d6 | [
"Apache-2.0"
] | null | null | null | //
// FMTestView.h
// podTest
//
// Created by Smile on 2018/5/19.
// Copyright © 2018 Smile. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FMTestView : UIView
+ (instancetype)viewFromXib;
@end
| 13.4375 | 48 | 0.669767 |
4d4ee7e4a79534300d893160bd106ec7adfe0ee8 | 94 | h | C | Minigin/Component.h | keangdavidTouch/C-GameEngine | e276e7cc7c840ca41b005c0cf844cd8d5580200a | [
"MIT"
] | 2 | 2021-03-19T13:29:36.000Z | 2021-04-13T23:37:10.000Z | Minigin/Component.h | keangdavidTouch/C-GameEngine | e276e7cc7c840ca41b005c0cf844cd8d5580200a | [
"MIT"
] | null | null | null | Minigin/Component.h | keangdavidTouch/C-GameEngine | e276e7cc7c840ca41b005c0cf844cd8d5580200a | [
"MIT"
] | null | null | null | #pragma once
#include "RenderComponent.h"
#include "TextComponent.h"
#include "FpsComponent.h" | 23.5 | 28 | 0.787234 |
9e9445c3184bf78b7e410734c9e9eb41480e7310 | 60,354 | c | C | epgui/rcfile.c | tomzox/nxtvepg | 779c254de331e13383a62797f35054011ecf9323 | [
"TCL"
] | null | null | null | epgui/rcfile.c | tomzox/nxtvepg | 779c254de331e13383a62797f35054011ecf9323 | [
"TCL"
] | 1 | 2021-08-21T17:17:23.000Z | 2021-09-02T13:06:00.000Z | epgui/rcfile.c | tomzox/nxtvepg | 779c254de331e13383a62797f35054011ecf9323 | [
"TCL"
] | null | null | null | /*
* Reading/writing the .nxtvepgrc / nxtvepg.ini file
*
* Copyright (C) 1999-2011, 2020-2021 T. Zoerner
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
* published by the Free Software Foundation. You find a copy of this
* license in the file COPYRIGHT in the root directory of this release.
*
* 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.
*
*
* Description:
*
* This module implements functions to manage reading and writing of
* the parameter configuration file. Parameters are read once during
* start-up into a C structure and can be changed during run-time
* via update functions. Parameter assignments are split into
* separate sections. Not all sections are managed here: parameters
* belonging to the GUI are read and written separately; a function
* is provided to copy through foreign sections during updates in case
* the calling application doesn't include the GUI code.
*/
#define DEBUG_SWITCH DEBUG_SWITCH_EPGUI
#define DPRINTF_OFF
#ifndef WIN32
#include <unistd.h>
#include <sys/param.h>
#include <sys/time.h>
#include <pwd.h>
#include <signal.h>
#else
#include <winsock2.h>
#include <windows.h>
#include <io.h>
#include <direct.h>
#endif
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include "epgctl/mytypes.h"
#include "epgctl/epgversion.h"
#include "epgctl/debug.h"
#include "epgdb/epgblock.h"
#include "epgdb/epgdbfil.h"
#include "epgdb/epgdbif.h"
#include "epgdb/epgdbmgmt.h"
#include "epgdb/epgnetio.h"
#include "epgctl/epgacqctl.h"
#include "epgctl/epgacqsrv.h"
#include "epgctl/epgacqclnt.h"
#include "epgvbi/syserrmsg.h"
#include "epgui/uictrl.h"
#include "epgctl/epgctxctl.h"
#include "epgtcl/dlg_hwcfg.h"
#include "epgtcl/dlg_acqmode.h"
#include "epgui/cmdline.h"
#include "epgui/rcfile.h"
// ----------------------------------------------------------------------------
// Container struct for "dynamic list" sections
// - these sections effectively are a single assignment where each line contains
// the same structure and is appended to the list
//
typedef struct
{
char ** ppData;
uint itemSize;
uint maxItemCount;
uint * pItemCount;
} RCFILE_DYN_LIST;
#define RC_DYNLIST_STEP_SZ_1 8
#define RC_DYNLIST_STEP_SZ_2 32
#define RC_DYNLIST_STEP_SZ_CRIT 100
// ----------------------------------------------------------------------------
// Table describing mapping of config keywords and values to the C struct
//
#define RC_OFF(MEMBER) ((size_t) &((RCFILE *)0)->MEMBER)
#define RC_CNT(X) (sizeof(mainRc.X)/sizeof(mainRc.X[0]))
#define RC_TOFF(TYPE,MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#define RC_NAME_NONE() NULL
#define RC_OFF_NONE() 0
#define RC_ARR_CNT(X) (sizeof((X))/sizeof((X)[0]))
static RCFILE mainRc;
static bool mainRcInit = FALSE;
typedef enum
{
RCPARSE_NO_FLAGS = 0,
RCPARSE_EXTERN = 1<<0,
RCPARSE_IGNORE_UNKNOWN = 1<<1,
RCPARSE_ALLOC = 1<<2,
RCPARSE_EXTERN_IGNORE_UNKNOWN = RCPARSE_EXTERN | RCPARSE_IGNORE_UNKNOWN,
} RCPARSE_CFG_FLAGS;
typedef struct
{
const char * pKey;
uint value;
} RCPARSE_ENUM;
static const RCPARSE_ENUM rcEnum_AcqMode[] =
{
{ "passive", ACQMODE_PASSIVE },
{ "external", ACQMODE_PASSIVE /*ACQMODE_EXTERNAL*/ }, // obsolete
{ "cyclic_2", ACQMODE_CYCLIC_2 },
{ "cyclic_02", ACQMODE_CYCLIC_02 },
{ "follow-ui", ACQMODE_CYCLIC_2 /*ACQMODE_FOLLOW_UI*/ }, // obsolete
{ "cyclic_012", ACQMODE_CYCLIC_2 /*ACQMODE_CYCLIC_012*/ }, // obsolete
{ "cyclic_12", ACQMODE_CYCLIC_2 /*ACQMODE_CYCLIC_12*/ }, // obsolete
{ (const char *) NULL, ACQMODE_COUNT }
};
static const RCPARSE_ENUM rcEnum_AcqStart[] =
{
{ "auto", ACQ_START_AUTO },
{ "manual", ACQ_START_MANUAL },
{ (const char *) NULL, 0 }
};
typedef enum
{
RC_TYPE_INT,
RC_TYPE_HEX,
RC_TYPE_STR,
RC_TYPE_STRZ,
RC_TYPE_ENUM,
RC_TYPE_OBS
} RC_VAL_TYPE;
typedef struct
{
RC_VAL_TYPE type;
uint off;
const char * pKey;
uint counterOff;
uint maxCount;
const RCPARSE_ENUM * pEnum;
} RCPARSE_CFG;
#define RCPARSE_IS_LIST(X) ((X)->maxCount != 0)
static const RCPARSE_CFG rcParseCfg_version[] =
{
{ RC_TYPE_INT, RC_OFF(version.rc_nxtvepg_version), "nxtvepg_version", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STR, RC_OFF(version.rc_nxtvepg_version_str), "nxtvepg_version_str", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(version.rc_compat_version), "rc_compat_version", RC_OFF_NONE(), 0, NULL },
};
static const RCPARSE_CFG rcParseCfg_acq[] =
{
{ RC_TYPE_OBS, 0, "prov_freqs", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_OBS, 0, "acq_mode_cnis", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_ENUM, RC_OFF(acq.acq_mode), "acq_mode", RC_OFF_NONE(), 0, rcEnum_AcqMode },
{ RC_TYPE_ENUM, RC_OFF(acq.acq_start), "acq_start", RC_OFF_NONE(), 0, rcEnum_AcqStart },
{ RC_TYPE_INT, RC_OFF(acq.epgscan_opt_ftable), "epgscan_opt_ftable", RC_OFF_NONE(), 0, NULL },
};
static const RCPARSE_CFG rcParseCfg_db[] =
{
{ RC_TYPE_INT, RC_OFF(db.piexpire_cutoff), "piexpire_cutoff", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(db.auto_merge_ttx), "auto_merge_ttx", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_OFF(db.prov_selection), "prov_selection", RC_OFF(db.prov_sel_count), RC_CNT(db.prov_selection), NULL },
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_cnis), "prov_merge_cnis", RC_OFF(db.prov_merge_count), RC_CNT(db.prov_merge_cnis), NULL },
{ RC_TYPE_OBS, 0, "prov_merge_netwops", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_TITLE]), "prov_merge_cftitle", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_TITLE]), MAX_MERGED_DB_COUNT, NULL },
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_DESCR]), "prov_merge_cfdescr", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_DESCR]), MAX_MERGED_DB_COUNT, NULL },
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_THEMES]), "prov_merge_cfthemes", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_THEMES]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_OBS, 0, "prov_merge_cfseries", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_EDITORIAL]), "prov_merge_cfeditorial", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_EDITORIAL]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_PARENTAL]), "prov_merge_cfparental", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_PARENTAL]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_SOUND]), "prov_merge_cfsound", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_SOUND]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_FORMAT]), "prov_merge_cfformat", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_FORMAT]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_REPEAT]), "prov_merge_cfrepeat", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_REPEAT]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_SUBT]), "prov_merge_cfsubt", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_SUBT]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_OTHERFEAT]), "prov_merge_cfmisc", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_OTHERFEAT]), MAX_MERGED_DB_COUNT, NULL},
{ RC_TYPE_HEX, RC_OFF(db.prov_merge_opts[MERGE_TYPE_VPS]), "prov_merge_cfvps", RC_OFF(db.prov_merge_opt_count[MERGE_TYPE_VPS]), MAX_MERGED_DB_COUNT, NULL},
};
static const RCPARSE_CFG rcParseCfg_netacq[] =
{
{ RC_TYPE_INT, RC_OFF(netacq.netacq_enable), "netacq_enable", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(netacq.remctl), "netacqcf_remctl", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(netacq.do_tcp_ip), "netacqcf_do_tcp_ip", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STRZ, RC_OFF(netacq.pHostName), "netacqcf_host", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STRZ, RC_OFF(netacq.pPort), "netacqcf_port", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STRZ, RC_OFF(netacq.pIpStr), "netacqcf_ip", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STRZ, RC_OFF(netacq.pLogfileName), "netacqcf_logname", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(netacq.max_conn), "netacqcf_max_conn", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(netacq.fileloglev), "netacqcf_fileloglev", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(netacq.sysloglev), "netacqcf_sysloglev", RC_OFF_NONE(), 0, NULL },
};
static const RCPARSE_CFG rcParseCfg_tvcard[] =
{
{ RC_TYPE_INT, RC_OFF(tvcard.drv_type), "hwcf_drv_type", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(tvcard.card_idx), "hwcf_cardidx", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(tvcard.input), "hwcf_input", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(tvcard.acq_prio), "hwcf_acq_prio", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(tvcard.slicer_type), "hwcf_slicer_type", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(tvcard.wdm_stop), "hwcf_wdm_stop", RC_OFF_NONE(), 0, NULL }, // obsolete
// note: following must match RCFILE_MAX_WINSRC_COUNT
{ RC_TYPE_INT, RC_OFF(tvcard.winsrc_count), "tvcardcf_count", RC_OFF_NONE(), 0, NULL }, // obsolete
{ RC_TYPE_INT, RC_OFF(tvcard.winsrc[0]), "tvcardcf_0", RC_OFF(tvcard.winsrc_param_count[0]), 4, NULL }, // obsolete
{ RC_TYPE_INT, RC_OFF(tvcard.winsrc[1]), "tvcardcf_1", RC_OFF(tvcard.winsrc_param_count[1]), 4, NULL }, // obsolete
{ RC_TYPE_INT, RC_OFF(tvcard.winsrc[2]), "tvcardcf_2", RC_OFF(tvcard.winsrc_param_count[2]), 4, NULL }, // obsolete
{ RC_TYPE_INT, RC_OFF(tvcard.winsrc[3]), "tvcardcf_3", RC_OFF(tvcard.winsrc_param_count[3]), 4, NULL }, // obsolete
{ RC_TYPE_INT, RC_OFF(tvcard.winsrc[4]), "tvcardcf_4", RC_OFF(tvcard.winsrc_param_count[4]), 4, NULL }, // obsolete
};
static const RCPARSE_CFG rcParseCfg_ttx[] =
{
{ RC_TYPE_INT, RC_OFF(ttx.ttx_enable), "ttx_enable", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(ttx.ttx_chn_count), "ttx_chn_count", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_OFF(ttx.ttx_start_pg), "ttx_start_pg", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_OFF(ttx.ttx_end_pg), "ttx_end_pg", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_OFF(ttx.ttx_ov_pg), "ttx_ov_pg", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(ttx.ttx_duration), "ttx_duration", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(ttx.keep_ttx_data), "keep_ttx_data", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STRZ, RC_OFF(ttx.perl_path_win), "perl_path_win", RC_OFF_NONE(), 0, NULL },
};
static const RCPARSE_CFG rcParseCfg_tvapp[] =
{
{ RC_TYPE_INT, RC_OFF(tvapp.tvapp_win), "tvapp_win", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STRZ, RC_OFF(tvapp.tvpath_win), "tvpath_win", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_OFF(tvapp.tvapp_unix), "tvapp_unix", RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STRZ, RC_OFF(tvapp.tvpath_unix), "tvpath_unix", RC_OFF_NONE(), 0, NULL },
};
static const RCPARSE_CFG rcParseCfg_NetOrder[] =
{
{ RC_TYPE_HEX, RC_TOFF(RCFILE_NET_ORDER, prov_cni), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_TOFF(RCFILE_NET_ORDER, add_sub), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_TOFF(RCFILE_NET_ORDER, net_cnis), RC_NAME_NONE(), RC_TOFF(RCFILE_NET_ORDER, net_count), RC_MAX_DB_NETWOPS, NULL },
};
static const RCPARSE_CFG rcParseCfg_NetNames[] =
{
{ RC_TYPE_HEX, RC_TOFF(RCFILE_NET_NAMES, net_cni), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_TOFF(RCFILE_NET_NAMES, net_flags), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STR, RC_TOFF(RCFILE_NET_NAMES, name), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
};
static const RCPARSE_CFG rcParseCfg_XmltvProv[] =
{
{ RC_TYPE_HEX, RC_TOFF(RCFILE_XMLTV_PROV, prov_cni), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_TOFF(RCFILE_XMLTV_PROV, atime), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_INT, RC_TOFF(RCFILE_XMLTV_PROV, acount), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STR, RC_TOFF(RCFILE_XMLTV_PROV, path), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
};
static const RCPARSE_CFG rcParseCfg_XmltvNets[] =
{
{ RC_TYPE_HEX, RC_TOFF(RCFILE_XMLTV_NETS, prov_cni), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_HEX, RC_TOFF(RCFILE_XMLTV_NETS, net_cni), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
{ RC_TYPE_STR, RC_TOFF(RCFILE_XMLTV_NETS, chn_id), RC_NAME_NONE(), RC_OFF_NONE(), 0, NULL },
};
typedef struct
{
const char * pName;
const RCPARSE_CFG * pList;
uint listLen;
RCPARSE_CFG_FLAGS flags;
uint allocItemSize;
uint allocPtrOff;
uint allocCounterOff;
} RCPARSE_SECT;
static const RCPARSE_SECT rcParseCfg[] =
{
// assignment sections
{ "VERSION", rcParseCfg_version, RC_ARR_CNT(rcParseCfg_version), RCPARSE_EXTERN_IGNORE_UNKNOWN, 0,0,0 },
{ "ACQUISITION", rcParseCfg_acq, RC_ARR_CNT(rcParseCfg_acq), RCPARSE_NO_FLAGS, 0,0,0 },
{ "TELETEXT GRABBER", rcParseCfg_ttx, RC_ARR_CNT(rcParseCfg_ttx), RCPARSE_NO_FLAGS, 0,0,0 },
{ "DATABASE", rcParseCfg_db, RC_ARR_CNT(rcParseCfg_db), RCPARSE_IGNORE_UNKNOWN, 0,0,0 },
{ "CLIENT SERVER", rcParseCfg_netacq, RC_ARR_CNT(rcParseCfg_netacq), RCPARSE_NO_FLAGS, 0,0,0 },
{ "TV CARDS", rcParseCfg_tvcard, RC_ARR_CNT(rcParseCfg_tvcard), RCPARSE_NO_FLAGS, 0,0,0 },
{ "TV APPLICATION", rcParseCfg_tvapp, RC_ARR_CNT(rcParseCfg_tvapp), RCPARSE_NO_FLAGS, 0,0,0 },
// list sections
{ "NETWORK ORDER", rcParseCfg_NetOrder, RC_ARR_CNT(rcParseCfg_NetOrder), RCPARSE_ALLOC, sizeof(RCFILE_NET_ORDER), RC_OFF(net_order), RC_OFF(net_order_count) },
{ "NETWORK NAMES", rcParseCfg_NetNames, RC_ARR_CNT(rcParseCfg_NetNames), RCPARSE_ALLOC, sizeof(RCFILE_NET_NAMES), RC_OFF(net_names), RC_OFF(net_names_count) },
{ "XMLTV PROVIDERS", rcParseCfg_XmltvProv, RC_ARR_CNT(rcParseCfg_XmltvProv), RCPARSE_ALLOC, sizeof(RCFILE_XMLTV_PROV), RC_OFF(xmltv_prov), RC_OFF(xmltv_prov_count) },
{ "XMLTV NETWORKS", rcParseCfg_XmltvNets, RC_ARR_CNT(rcParseCfg_XmltvNets), RCPARSE_ALLOC, sizeof(RCFILE_XMLTV_NETS), RC_OFF(xmltv_nets), RC_OFF(xmltv_nets_count) },
};
// ----------------------------------------------------------------------------
// Map value to enum index
// - returns -1 if no
//
static int RcFile_MapValueToEnumIdx( const RCPARSE_ENUM * pEnum, int value )
{
int idx;
if (pEnum != NULL)
{
idx = 0;
while (pEnum->pKey != NULL)
{
if (pEnum->value == value)
{
break;
}
pEnum++;
idx++;
}
if (pEnum->pKey == NULL)
idx = -1;
}
else
idx = -1;
return idx;
}
// ----------------------------------------------------------------------------
// Search given enum keyword in list and return associated value
// - if string is not in list, returns pre-defined fallback value
//
static int RcFile_MapEnumStrToValue( const RCPARSE_ENUM * pEnum, const char * pKey )
{
int value = 0;
if (pEnum != NULL)
{
while (pEnum->pKey != NULL)
{
if (strcmp(pKey, pEnum->pKey) == 0)
{
value = pEnum->value;
break;
}
pEnum++;
}
// not found: use fallback value
if (pEnum->pKey == NULL)
value = pEnum->value;
}
return value;
}
// ----------------------------------------------------------------------------
// Create file for writing config values
// - on UNIX a temporary file is created which is later moved over the old one
//
FILE * RcFile_WriteCreateFile( const char * pRcPath, char ** ppErrMsg )
{
time_t now;
FILE * fp = NULL;
if (pRcPath != NULL)
{
#ifndef WIN32
char * pTmpRcPath = (char*) xmalloc(strlen(pRcPath) + 1+4);
strcpy(pTmpRcPath, pRcPath);
strcat(pTmpRcPath, ".tmp");
#else
const char * pTmpRcPath = pRcPath;
#endif
fp = fopen(pTmpRcPath, "w");
if (fp != NULL)
{
now = time(NULL);
fprintf(fp, "#\n"
"# nxtvepg configuration file\n"
"#\n"
"# This file is automatically generated - do not edit\n"
"# Written at: %s"
"#\n",
ctime(&now));
}
else
{
SystemErrorMessage_Set(ppErrMsg, errno, "Failed to write new config file '", pTmpRcPath, "': ", NULL);
}
#ifndef WIN32
xfree(pTmpRcPath);
#endif
}
else
debug0("RcFile-WriteCreateFile: illegal NULL ptr param");
return fp;
}
// ----------------------------------------------------------------------------
// Close the file for writing
// - UNIX only: if there was a write error the written file is discarded
//
bool RcFile_WriteCloseFile( FILE * fp, bool writeOk, const char * pRcPath, char ** ppErrMsg )
{
#ifndef WIN32
char * pTmpRcPath;
#endif
if (fp != NULL)
{
#ifndef WIN32
if (fsync(fileno(fp)) != 0)
#else
if (_commit(fileno(fp)) != 0)
#endif
{
debug2("RcFile-WriteCloseFile: error on fsync: %d (%s)", errno, strerror(errno));
writeOk = FALSE;
}
if (fclose(fp) != 0)
{
debug2("RcFile-WriteCloseFile: error on close: %d (%s)", errno, strerror(errno));
writeOk = FALSE;
}
#ifndef WIN32
pTmpRcPath = (char*) xmalloc(strlen(pRcPath) + 1 + 4);
strcpy(pTmpRcPath, pRcPath);
strcat(pTmpRcPath, ".tmp");
if (writeOk)
{
if (rename(pTmpRcPath, pRcPath) != 0)
{
debug4("RcFile-WriteCloseFile: failed to rename '%s' into '%s': %d (%s)", pTmpRcPath, pRcPath, errno, strerror(errno));
if (*ppErrMsg == NULL)
SystemErrorMessage_Set(ppErrMsg, errno, "Failed to replace config file '", pRcPath, "': ", NULL);
}
}
else
unlink(pTmpRcPath);
xfree(pTmpRcPath);
#endif
}
else
debug0("RcFile-WriteCloseFile: illegal NULL ptr param");
return writeOk;
}
// ----------------------------------------------------------------------------
// Write section with version information
//
static void RcFile_WriteVersionSection( FILE * fp )
{
if (fp != NULL)
{
fprintf(fp, "\n[VERSION]\n"
"nxtvepg_version = 0x%X\n"
"nxtvepg_version_str = %s\n"
"rc_compat_version = 0x%X\n"
"rc_timestamp = %d\n",
EPG_VERSION_NO,
EPG_VERSION_STR,
RC_FILE_COMPAT_VERSION,
(int)time(NULL));
}
else
debug0("RcFile-WriteVersionSection: illegal NULL ptr param");
}
// ----------------------------------------------------------------------------
// Write sections of config file which are managed by C level
//
static void RcFile_WriteElement( FILE * fp, const RCPARSE_CFG * pDesc, char * pBase, bool space )
{
uint listLen;
uint listIdx;
int enumIdx;
int * pInt;
char ** pChar;
if (RCPARSE_IS_LIST(pDesc))
listLen = *((int *)(pBase + pDesc->counterOff));
else
listLen = 1;
for (listIdx = 0; listIdx < listLen; listIdx++)
{
if (space || (listIdx != 0))
fprintf(fp, " ");
switch (pDesc->type)
{
case RC_TYPE_INT:
pInt = (int *)(pBase + pDesc->off);
fprintf(fp, "%d", pInt[listIdx]);
break;
case RC_TYPE_HEX:
pInt = (int *)(pBase + pDesc->off);
fprintf(fp, "0x%X", pInt[listIdx]);
break;
case RC_TYPE_STR:
case RC_TYPE_STRZ:
pChar = (char **)(pBase + pDesc->off);
if (*pChar != NULL)
{
fprintf(fp, "%s", *pChar);
}
break;
case RC_TYPE_ENUM:
pInt = (int *)(pBase + pDesc->off);
enumIdx = RcFile_MapValueToEnumIdx(pDesc->pEnum, pInt[listIdx]);
if (enumIdx >= 0)
{
fprintf(fp, "%s", pDesc->pEnum[enumIdx].pKey);
}
break;
case RC_TYPE_OBS:
default:
SHOULD_NOT_BE_REACHED;
break;
}
}
}
// ----------------------------------------------------------------------------
// Write sections of config file which are managed by C level
//
bool RcFile_WriteOwnSections( FILE * fp )
{
const RCPARSE_CFG * pDesc;
uint listIdx;
uint sectIdx;
uint elemIdx;
uint allocCount;
char * allocPtr;
RcFile_WriteVersionSection(fp);
for (sectIdx = 0; sectIdx < RC_ARR_CNT(rcParseCfg); sectIdx++)
{
if ((rcParseCfg[sectIdx].flags & RCPARSE_EXTERN) == 0)
{
fprintf(fp, "\n[%s]\n", rcParseCfg[sectIdx].pName);
if (rcParseCfg[sectIdx].flags & RCPARSE_ALLOC)
{
allocCount = *(uint*)((long)&mainRc + rcParseCfg[sectIdx].allocCounterOff);
allocPtr = *(char**)((long)&mainRc + rcParseCfg[sectIdx].allocPtrOff);
for (listIdx = 0; listIdx < allocCount; listIdx++)
{
pDesc = rcParseCfg[sectIdx].pList;
for (elemIdx = 0; elemIdx < rcParseCfg[sectIdx].listLen; elemIdx++, pDesc++)
{
RcFile_WriteElement(fp, pDesc, allocPtr, (elemIdx != 0));
}
fprintf(fp, "\n");
allocPtr += rcParseCfg[sectIdx].allocItemSize;
}
}
else
{
pDesc = rcParseCfg[sectIdx].pList;
for (elemIdx = 0; elemIdx < rcParseCfg[sectIdx].listLen; elemIdx++, pDesc++)
{
if (pDesc->type != RC_TYPE_OBS)
{
fprintf(fp, "%s =", pDesc->pKey);
RcFile_WriteElement(fp, pDesc, (char*)&mainRc, TRUE);
fprintf(fp, "\n");
}
}
}
}
}
return (ferror(fp) == FALSE);
}
// ----------------------------------------------------------------------------
// Read GUI sections into a temporary buffer
// - memory for the buffer must be freed by caller
// - returns error code if file exists but there was an error reading it
// (caller should not overwrite the file in this case to avoid losing data)
//
bool RcFile_CopyForeignSections( const char * pRcPath, char ** ppBuf, uint * pBufLen )
{
struct stat st;
FILE * fp;
char sbuf[256];
char key[100];
uint sectIdx;
uint lineLen;
uint bufOff;
bool copySection;
bool partialLine;
bool result = TRUE;
if ((pRcPath != NULL) && (ppBuf != NULL) && (pBufLen != NULL))
{
*ppBuf = NULL;
*pBufLen = 0;
if (stat(pRcPath, &st) == 0)
{
dprintf1("RcFile-CopyForeignSections: allocate buffer for %ld bytes\n", (long)st.st_size);
*ppBuf = (char*) xmalloc(st.st_size + 1);
bufOff = 0;
fp = fopen(pRcPath, "r");
if (fp != NULL)
{
sectIdx = RC_ARR_CNT(rcParseCfg);
copySection = FALSE;
partialLine = FALSE;
while (fgets(sbuf, sizeof(sbuf), fp) != NULL)
{
if ( (partialLine == FALSE) &&
(sbuf[0] == '[') && (sscanf(sbuf,"[%99[^]]]", key) == 1) )
{
for (sectIdx = 0; sectIdx < RC_ARR_CNT(rcParseCfg); sectIdx++)
if (strcmp(rcParseCfg[sectIdx].pName, key) == 0)
break;
copySection = (sectIdx >= RC_ARR_CNT(rcParseCfg));
}
lineLen = strlen(sbuf);
if (copySection)
{
if (bufOff + lineLen < st.st_size)
{
memcpy(*ppBuf + bufOff, sbuf, lineLen);
bufOff += lineLen;
}
else
{ // should never happen (unless fgets() adds characters for some reason)
debug3("RcFile-CopyForeignSections: internal error: buffer overflow: stat size=%ld, read %d+%d", (long)st.st_size, bufOff, lineLen);
result = FALSE;
break;
}
}
partialLine = ((lineLen > 0) && (sbuf[lineLen - 1] != '\n'));
}
result &= (ferror(fp) == FALSE);
fclose(fp);
}
else
{ // stat OK buf open not (maybe weird file permissions)
debug3("RcFile-CopyForeignSections: rc open failed: '%s': %d (%s)", pRcPath, errno, strerror(errno));
result = FALSE;
}
// return number of bytes in buffer and append 0-byte
*pBufLen = bufOff;
if (bufOff < st.st_size)
(*ppBuf)[bufOff] = 0;
}
}
else
debug0("RcFile-CopyForeignSections: illegal NULL ptr params");
return result;
}
// ----------------------------------------------------------------------------
// Initialize a dynamic list "context"
// - used to build a new list or to update an existing list
//
static void RcFile_DynListInit( RCFILE_DYN_LIST * pDynList, uint itemSize,
char ** ppPtr, uint * pItemCount )
{
memset(pDynList, 0, sizeof(*pDynList));
pDynList->itemSize = itemSize;
pDynList->ppData = ppPtr;
pDynList->pItemCount = pItemCount;
pDynList->maxItemCount = *pItemCount;
}
// ----------------------------------------------------------------------------
// Make space for a new item in the channel table buffer
//
static void RcFile_DynListGrow( RCFILE_DYN_LIST * pDynList )
{
char * pOldData;
assert(*pDynList->pItemCount <= pDynList->maxItemCount);
// grow the table if necessary
if (*pDynList->pItemCount == pDynList->maxItemCount)
{
if (pDynList->itemSize < RC_DYNLIST_STEP_SZ_CRIT)
pDynList->maxItemCount += RC_DYNLIST_STEP_SZ_2;
else
pDynList->maxItemCount += RC_DYNLIST_STEP_SZ_1;
pOldData = *pDynList->ppData;
*pDynList->ppData = (char*) xmalloc(pDynList->maxItemCount * pDynList->itemSize);
if (pOldData != NULL)
{
memcpy(*pDynList->ppData, pOldData, *pDynList->pItemCount * pDynList->itemSize);
xfree(pOldData);
}
// rc data structures must be zero-initialized (e.g. for string pointers)
memset(*pDynList->ppData + (*pDynList->pItemCount * pDynList->itemSize), 0,
(pDynList->maxItemCount - *pDynList->pItemCount) * pDynList->itemSize);
}
*pDynList->pItemCount += 1;
}
// ----------------------------------------------------------------------------
// Discard the last entry in the list - called upon parser errors
//
static void RcFile_DynListUngrow( RCFILE_DYN_LIST * pDynList )
{
if (*pDynList->pItemCount > 0)
{
*pDynList->pItemCount -= 1;
}
else
fatal0("RcFile-DynListUngrow: list is already empty");
}
// ----------------------------------------------------------------------------
// Return pointer to the last element
//
static char * RcFile_DynListGetPtr( RCFILE_DYN_LIST * pDynList )
{
assert(*pDynList->pItemCount > 0);
return ((char*)*pDynList->ppData + ((*pDynList->pItemCount - 1) * pDynList->itemSize));
}
// ----------------------------------------------------------------------------
// Count elements in integer list
// - elements are separated by blanks
// - note: only integer lists are supported (which don't have escaped blanks)
//
static uint RcFile_ParseTclList( char * pList )
{
char * p;
uint count;
count = 0;
p = pList;
while (*p != 0)
{
// skip leading space
while (isspace(*p))
p++;
if (*p == 0)
break;
// found an element
count += 1;
// skip element
while ((*p != 0) && !isspace(*p))
p++;
}
//dprintf2("LIST len=%d: '%s'\n", count, pList);
return count;
}
// ----------------------------------------------------------------------------
// Assign a value from the rc/ini file to the config struct
//
static bool RcFile_AssignParam( const RCPARSE_CFG * pDesc, uint descCount,
char * strval, char * pBase )
{
uint count;
int scanlen;
int value;
int listIdx;
int * pInt;
char ** pChar;
bool result = TRUE;
do
{
if (RCPARSE_IS_LIST(pDesc))
{
assert((pDesc->type != RC_TYPE_STR) && (pDesc->type != RC_TYPE_STRZ));
count = RcFile_ParseTclList(strval);
if (count > pDesc->maxCount) // XXX FIXME allocate dynamically
{
debug3("RcFile-AssignParam: too many elements: %d>%d '%s'", count, pDesc->maxCount, strval);
count = pDesc->maxCount;
}
}
else
count = 1;
for (listIdx = 0; (listIdx < count) && result; listIdx++)
{
scanlen = 0;
switch (pDesc->type)
{
case RC_TYPE_INT:
case RC_TYPE_HEX:
if ( (sscanf(strval, " %i%n", &value, &scanlen) >= 1) &&
( (strval[scanlen] == 0) || ((strval[scanlen] == ' ') && ((descCount > 1) || (listIdx + 1 < count))) ))
{
//dprintf3("RcFile-AssignParam: %s: idx=%d val=%s\n", pDesc->pKey, listIdx, strval);
pInt = (int *)(pBase + pDesc->off);
pInt[listIdx] = value;
}
else
{
debug3("RcFile-AssignParam: parse error key %s idx=%d: '%s'", pDesc->pKey, listIdx, strval);
result = FALSE;
}
break;
case RC_TYPE_STR:
case RC_TYPE_STRZ:
pChar = (char **)(pBase + pDesc->off);
if (*pChar != NULL)
xfree(*pChar);
// chop off whitespace at both ends of the string argument
while (*strval == ' ')
strval++;
scanlen = strlen(strval);
while ((scanlen > 0) && (strval[scanlen - 1] == ' '))
scanlen--;
if (*strval != 0)
*pChar = xstrdup(strval);
else if (pDesc->type == RC_TYPE_STRZ)
*pChar = NULL; // null-string is allowed
else
{
debug1("RcFile-AssignParam: missing string value for key %s", pDesc->pKey);
result = FALSE;
}
break;
case RC_TYPE_ENUM:
if (pDesc->pEnum != NULL)
{
value = RcFile_MapEnumStrToValue(pDesc->pEnum, strval);
pInt = (int *)(pBase + pDesc->off);
*pInt = value;
}
else
{
fatal1("RcFile-AssignParam: enum without description array: %s", pDesc->pKey);
result = FALSE;
}
break;
case RC_TYPE_OBS:
// an obsolete element - silently skipped
break;
default:
SHOULD_NOT_BE_REACHED;
break;
}
strval += scanlen;
}
if (RCPARSE_IS_LIST(pDesc))
{
pInt = (int *)(pBase + pDesc->counterOff);
*pInt = (result ? count : 0);
}
descCount -= 1;
pDesc += 1;
} while (result && (descCount > 0));
return result;
}
// ----------------------------------------------------------------------------
// Process a single line of the config file
//
static bool RcFile_ParseLine( char * sbuf, uint * pSectIdx, RCFILE_DYN_LIST * pDynList )
{
const RCPARSE_CFG * pDesc;
char key[100];
char * pValStr;
uint elemIdx;
uint scanlen;
uint sectIdx = *pSectIdx;
bool result = TRUE;
if ((sbuf[0] == '[') && (sscanf(sbuf,"[%99[^]]]", key) == 1))
{
for (sectIdx = 0; sectIdx < RC_ARR_CNT(rcParseCfg); sectIdx++)
if (strcmp(rcParseCfg[sectIdx].pName, key) == 0)
break;
*pSectIdx = sectIdx;
if ( (sectIdx < RC_ARR_CNT(rcParseCfg)) &&
(rcParseCfg[sectIdx].flags & RCPARSE_ALLOC) )
{
RcFile_DynListInit( pDynList, rcParseCfg[sectIdx].allocItemSize,
(char**)((long)&mainRc + rcParseCfg[sectIdx].allocPtrOff),
(uint*)((long)&mainRc + rcParseCfg[sectIdx].allocCounterOff) );
}
}
else if (sectIdx < RC_ARR_CNT(rcParseCfg))
{
if (rcParseCfg[sectIdx].flags & RCPARSE_ALLOC)
{
if (sbuf[0] != 0)
{
RcFile_DynListGrow(pDynList);
if (RcFile_AssignParam(rcParseCfg[sectIdx].pList, rcParseCfg[sectIdx].listLen,
sbuf, RcFile_DynListGetPtr(pDynList)) == FALSE)
{
debug2("RcFile-ParseLine: Parse error section [%s] skipping '%s'", rcParseCfg[sectIdx].pName, sbuf);
RcFile_DynListUngrow(pDynList);
}
}
}
else if (sscanf(sbuf, "%99s = %n", key, &scanlen) >= 1)
{
pValStr = sbuf + scanlen;
// search key in the descriptior list of the current section
pDesc = rcParseCfg[sectIdx].pList;
for (elemIdx = 0; elemIdx < rcParseCfg[sectIdx].listLen; elemIdx++, pDesc++)
{
if (strcmp(pDesc->pKey, key) == 0)
{
dprintf3("RC [%s] %s = %s\n", rcParseCfg[sectIdx].pName, key, pValStr);
result = RcFile_AssignParam(pDesc, 1, pValStr, (char*)&mainRc);
break;
}
}
if ( (elemIdx >= rcParseCfg[sectIdx].listLen) &&
((rcParseCfg[sectIdx].flags & RCPARSE_IGNORE_UNKNOWN) == 0) )
{
debug3("RcFile-Load: [%s] unknown key %s (val '%s')", rcParseCfg[sectIdx].pName, key, pValStr);
}
}
else if (sscanf(sbuf, " %1[^#\n]", key) >= 1)
{
debug2("RcFile-Load: [%s] parse error: %s", rcParseCfg[sectIdx].pName, sbuf);
}
}
return result;
}
// ----------------------------------------------------------------------------
// Read config values from the rc/ini
// - rc file is split in two parts: first is in Tcl format, which is skipped
// - 2nd part is simple assignments in the form: "KEY=value"
//
bool RcFile_Load( const char * pRcPath, bool isDefault, char ** ppErrMsg )
{
FILE * fp;
char sbuf[4096];
uint sectIdx;
RCFILE_DYN_LIST dynList;
uint len;
bool parseError;
bool result = FALSE;
if (pRcPath != NULL)
{
fp = fopen(pRcPath, "r");
if (fp != NULL)
{
sectIdx = RC_ARR_CNT(rcParseCfg);
parseError = FALSE;
result = TRUE;
while (fgets(sbuf, sizeof(sbuf), fp) != NULL)
{
// remove newline from the end of the line
len = strlen(sbuf);
if ((len > 0) && (sbuf[len - 1] == '\n'))
{
if ((len > 1) && (sbuf[len - 2] == '\r'))
sbuf[len - 2] = 0;
else
sbuf[len - 1] = 0;
if ((RcFile_ParseLine(sbuf, §Idx, &dynList) == FALSE) && (parseError == FALSE))
{
SystemErrorMessage_Set(ppErrMsg, errno, "Parse error in rc/ini file, section [", rcParseCfg[sectIdx].pName, "]: ", sbuf, NULL);
}
}
else
{ // line found which is longer than input buffer - should only occur in foreign sections
if (sectIdx < RC_ARR_CNT(rcParseCfg))
debug2("RcFile-Load: [%s] overly long line skipped (%.40s...)", rcParseCfg[sectIdx].pName, sbuf);
// continue reading until end of line if reached
while (fgets(sbuf, sizeof(sbuf), fp) != NULL)
{
len = strlen(sbuf);
if ((len > 0) && (sbuf[len - 1] == '\n'))
break;
}
}
}
if (ferror(fp))
{
SystemErrorMessage_Set(ppErrMsg, errno, "Read error in config file '", pRcPath, "': ", NULL);
result = FALSE;
}
else if ((mainRc.version.rc_compat_version > RC_FILE_COMPAT_VERSION) && result)
{
SystemErrorMessage_Set(ppErrMsg, errno, "rc/ini file is from incompatible newer version ",
mainRc.version.rc_nxtvepg_version_str, NULL);
// switch to different rc file
CmdLine_AddRcFilePostfix(EPG_VERSION_STR);
result = FALSE;
}
else if (mainRc.version.rc_compat_version < RC_FILE_COMPAT_VERSION)
{
// backward compatibility
if ( (mainRc.version.rc_compat_version == 0x0207C2) &&
( (mainRc.version.rc_nxtvepg_version >= 0x0207C5) &&
(mainRc.version.rc_nxtvepg_version <= 0x0207C6) ))
{
// predecessor version had WDM sources appended to the list
mainRc.tvcard.winsrc_count /= 2;
if (mainRc.tvcard.winsrc_count > RCFILE_MAX_WINSRC_COUNT)
{
mainRc.tvcard.winsrc_count = RCFILE_MAX_WINSRC_COUNT;
}
}
}
fclose(fp);
}
else
{ // failed to open the rc/ini file
if ( (errno != ENOENT) || (isDefault == FALSE) )
{
SystemErrorMessage_Set(ppErrMsg, errno, "Failed to read config file '", pRcPath, "': ", NULL);
}
}
}
else
debug0("RcFile-Load: illegal NULL ptr param");
return result;
}
// ----------------------------------------------------------------------------
// Read config values from newline-separated string
//
bool RcFile_LoadFromString( const char * pRcString )
{
const char * pLineEnd;
char sbuf[512];
uint sectIdx;
RCFILE_DYN_LIST dynList;
uint len;
bool result = FALSE;
sectIdx = RC_ARR_CNT(rcParseCfg);
result = TRUE;
while ((pLineEnd = strchr(pRcString, '\n')) != NULL)
{
len = pLineEnd - pRcString;
if (len < sizeof(sbuf) - 1)
{
strncpy(sbuf, pRcString, len);
sbuf[len] = 0;
result &= RcFile_ParseLine(sbuf, §Idx, &dynList);
}
pRcString = pLineEnd + 1;
}
return result;
}
// ----------------------------------------------------------------------------
// Free dynamically allocated memory in a parameter element
//
static void RcFile_FreeParamMemory( const RCPARSE_CFG * pDesc, uint descCount, char * pBase )
{
char ** pChar;
uint elemIdx;
for (elemIdx = 0; elemIdx < descCount; elemIdx++, pDesc++)
{
if ((pDesc->type == RC_TYPE_STR) || (pDesc->type == RC_TYPE_STRZ))
{
pChar = (char **)(pBase + pDesc->off);
if (*pChar != NULL)
xfree(*pChar);
*pChar = NULL;
}
}
}
// ----------------------------------------------------------------------------
// Free dynamically allocated memory in a section
//
static void RcFile_FreeSectionMemory( uint sectIdx )
{
uint listIdx;
uint allocCount;
char * allocPtr;
if (sectIdx < RC_ARR_CNT(rcParseCfg))
{
if (rcParseCfg[sectIdx].flags & RCPARSE_ALLOC)
{
allocCount = *(uint*)((long)&mainRc + rcParseCfg[sectIdx].allocCounterOff);
allocPtr = *(char**)((long)&mainRc + rcParseCfg[sectIdx].allocPtrOff);
if (allocPtr != NULL)
{
for (listIdx = 0; listIdx < allocCount; listIdx++)
{
RcFile_FreeParamMemory(rcParseCfg[sectIdx].pList, rcParseCfg[sectIdx].listLen,
allocPtr);
allocPtr += rcParseCfg[sectIdx].allocItemSize;
}
xfree(*(char**)((long)&mainRc + rcParseCfg[sectIdx].allocPtrOff));
*(uint*)((long)&mainRc + rcParseCfg[sectIdx].allocCounterOff) = 0;
*(char**)((long)&mainRc + rcParseCfg[sectIdx].allocPtrOff) = NULL;
}
}
else
{
RcFile_FreeParamMemory(rcParseCfg[sectIdx].pList, rcParseCfg[sectIdx].listLen,
(char *)&mainRc);
}
}
}
// ----------------------------------------------------------------------------
// Search the section with the given name
//
static uint RcFile_SearchSectionName( const char * pName )
{
uint sectIdx;
for (sectIdx = 0; sectIdx < RC_ARR_CNT(rcParseCfg); sectIdx++)
{
if (strcmp(pName, rcParseCfg[sectIdx].pName) == 0)
{
break;
}
}
assert(sectIdx < RC_ARR_CNT(rcParseCfg)); // name mismatch
return sectIdx;
}
// ----------------------------------------------------------------------------
// Update functions invoked by GUI
// - CAUTION: caller must not provide copy of earlier query if the section
// contains strings, because old string pointers are freed here!
//
void RcFile_SetNetAcqEnable( bool isEnabled )
{
mainRc.netacq.netacq_enable = isEnabled;
}
void RcFile_SetNetAcq( const RCFILE_NETACQ * pRcNetAcq )
{
RcFile_FreeSectionMemory( RcFile_SearchSectionName("CLIENT SERVER") );
mainRc.netacq = *pRcNetAcq;
}
void RcFile_SetTvCard( const RCFILE_TVCARD * pRcTvCard )
{
mainRc.tvcard = *pRcTvCard;
}
void RcFile_SetAcqMode( const char * pAcqModeStr )
{
uint mode;
mode = RcFile_MapEnumStrToValue(rcEnum_AcqMode, pAcqModeStr);
if (mode < ACQMODE_COUNT)
{
mainRc.acq.acq_mode = mode;
}
else
debug1("RcFile-SetAcqMode: unknown mode '%s'", pAcqModeStr);
}
void RcFile_SetAcqAutoStart( int autoStart )
{
mainRc.acq.acq_start = autoStart;
}
void RcFile_SetAcqScanOpt( uint optFtable )
{
mainRc.acq.epgscan_opt_ftable = optFtable;
}
void RcFile_SetDbExpireDelay( uint delay )
{
mainRc.db.piexpire_cutoff = delay;
}
void RcFile_SetAutoMergeTtx( int enable )
{
mainRc.db.auto_merge_ttx = enable;
}
void RcFile_SetTtxGrabOpt( const RCFILE_TTX * pRcTtxGrab )
{
RcFile_FreeSectionMemory( RcFile_SearchSectionName("TELETEXT GRABBER") );
mainRc.ttx = *pRcTtxGrab;
}
void RcFile_SetTvApp( uint appIdx, const char * pPath )
{
#ifdef WIN32
mainRc.tvapp.tvapp_win = appIdx;
if (mainRc.tvapp.tvpath_win != NULL)
xfree((void*) mainRc.tvapp.tvpath_win);
if ((pPath != NULL) && (*pPath != 0))
mainRc.tvapp.tvpath_win = xstrdup(pPath);
else
mainRc.tvapp.tvpath_win = NULL;
#else
mainRc.tvapp.tvapp_unix = appIdx;
if (mainRc.tvapp.tvpath_unix != NULL)
xfree((void*) mainRc.tvapp.tvpath_unix);
if ((pPath != NULL) && (*pPath != 0))
mainRc.tvapp.tvpath_unix = xstrdup(pPath);
else
mainRc.tvapp.tvpath_unix = NULL;
#endif
}
void RcFile_UpdateDbMergeCnis( const uint * pCniList, uint cniCount )
{
if (cniCount > MAX_MERGED_DB_COUNT)
cniCount = MAX_MERGED_DB_COUNT;
memcpy(mainRc.db.prov_merge_cnis, pCniList, cniCount * sizeof(uint));
mainRc.db.prov_merge_count = cniCount;
}
void RcFile_UpdateDbMergeOptions( uint type, const uint * pCniList, uint cniCount )
{
if (type < MERGE_TYPE_COUNT)
{
dprintf3("RcFile-UpdateDbMergeOptions: %d: %d CNIs, first 0x%04X\n", type, cniCount, (((cniCount > 0) && (pCniList != NULL)) ? *pCniList : 0));
if (cniCount > MAX_MERGED_DB_COUNT)
cniCount = MAX_MERGED_DB_COUNT;
if ((pCniList != NULL) && (cniCount > 0))
{
memcpy(mainRc.db.prov_merge_opts[type], pCniList, cniCount * sizeof(uint));
mainRc.db.prov_merge_opt_count[type] = cniCount;
}
else
mainRc.db.prov_merge_opt_count[type] = 0;
}
else
fatal1("RcFile-UpdateDbMergeOptions: invalid type %d", type);
}
const char * RcFile_GetAcqModeStr( uint mode )
{
const char * pResult = NULL;
int enumIdx;
enumIdx = RcFile_MapValueToEnumIdx(rcEnum_AcqMode, mode);
if (enumIdx >= 0)
{
pResult = rcEnum_AcqMode[enumIdx].pKey;
}
else
debug1("RcFile-GetAcqModeStr: invalid mode %d", mode);
return pResult;
}
// ----------------------------------------------------------------------------
// Fetch the user-assigned names for the given network or provider CNI
//
const char * RcFile_GetNetworkName( uint cni )
{
RCFILE_NET_NAMES * pNetNames;
uint idx;
const char * pResult = NULL;
assert(mainRcInit != FALSE);
pNetNames = mainRc.net_names;
for (idx = 0; idx < mainRc.net_names_count; idx++, pNetNames++)
{
if (pNetNames->net_cni == cni)
{
pResult = pNetNames->name;
break;
}
}
return pResult;
}
// ----------------------------------------------------------------------------
// Fetch the user-assigned names for the given network or provider CNI
//
void RcFile_UpdateNetworkNames( uint count, const uint * pCniList, const char ** pNameList )
{
RCFILE_DYN_LIST dynList;
uint newIdx;
uint oldIdx;
RcFile_DynListInit(&dynList, sizeof(RCFILE_NET_NAMES),
(char**)&mainRc.net_names, &mainRc.net_names_count);
for (newIdx = 0; newIdx < count; newIdx++)
{
if (pCniList[newIdx] != 0)
{
for (oldIdx = 0; oldIdx < mainRc.net_names_count; oldIdx++)
if (mainRc.net_names[oldIdx].net_cni == pCniList[newIdx])
break;
if (oldIdx < mainRc.net_names_count)
{ // replace existing name
if ( (mainRc.net_names[oldIdx].name == NULL) ||
(strcmp(mainRc.net_names[oldIdx].name, pNameList[newIdx]) != 0) )
{
dprintf3("RcFile-UpdateNetworkNames: change 0x%04X: '%s' into '%s'\n", mainRc.net_names[oldIdx].net_cni, mainRc.net_names[oldIdx].name, pNameList[newIdx]);
if (mainRc.net_names[oldIdx].name != NULL)
xfree((char*)mainRc.net_names[oldIdx].name);
mainRc.net_names[oldIdx].name = xstrdup(pNameList[newIdx]);
}
//else printf("UNCHANGED: 0x%04X: %s\n", mainRc.net_names[oldIdx].net_cni, pNameList[newIdx]);
}
else
{ // append new name
dprintf2("RcFile-UpdateNetworkNames: append 0x%04X: %s\n", pCniList[newIdx], pNameList[newIdx]);
RcFile_DynListGrow(&dynList);
mainRc.net_names[oldIdx].name = xstrdup(pNameList[newIdx]);
mainRc.net_names[oldIdx].net_cni = pCniList[newIdx];
//printf("NEW: 0x%04X: %s\n", mainRc.net_names[oldIdx].net_cni, mainRc.net_names[oldIdx].name);
}
}
else
debug1("RcFile-UpdateNetworkNames: invalid CNI 0 in name list at idx %d", newIdx);
}
}
// ----------------------------------------------------------------------------
// Get network selection configuration for the given provider
// - pointers may be NULL if the respective return value is not needed
// (makes no sense though to retrieve a CNI list without count)
// - if no config is available for the provider, the returned pointers are NULL
//
void RcFile_GetNetworkSelection( uint provCni, uint * pSelCount, const uint ** ppSelCnis,
uint * pSupCount, const uint ** ppSupCnis )
{
bool foundSel = FALSE;
bool foundSup = FALSE;
uint idx;
for (idx = 0; idx < mainRc.net_order_count; idx++)
{
if (mainRc.net_order[idx].prov_cni == provCni)
{
if (mainRc.net_order[idx].add_sub != 0)
{
if (ppSelCnis != NULL)
*ppSelCnis = mainRc.net_order[idx].net_cnis;
if (pSelCount != NULL)
*pSelCount = mainRc.net_order[idx].net_count;
foundSel = TRUE;
}
else
{
if (ppSupCnis != NULL)
*ppSupCnis = mainRc.net_order[idx].net_cnis;
if (pSupCount != NULL)
*pSupCount = mainRc.net_order[idx].net_count;
foundSup = TRUE;
}
}
}
if (foundSel == FALSE)
{
if (ppSelCnis != NULL)
*ppSelCnis = NULL;
if (pSelCount != NULL)
*pSelCount = 0;
}
if (foundSup == FALSE)
{
if (ppSupCnis != NULL)
*ppSupCnis = NULL;
if (pSupCount != NULL)
*pSupCount = 0;
}
}
// ----------------------------------------------------------------------------
// Update network selection configuration for the given provider
// - either list pointer can be NULL if the list need not be updated
//
void RcFile_UpdateNetworkSelection( uint provCni, uint selCount, const uint * pSelCnis,
uint supCount, const uint * pSupCnis )
{
RCFILE_DYN_LIST dynList;
uint idx;
bool foundSel;
bool foundSup;
assert(selCount <= RC_MAX_DB_NETWOPS);
assert(supCount <= RC_MAX_DB_NETWOPS);
RcFile_DynListInit(&dynList, sizeof(RCFILE_NET_ORDER),
(char**)&mainRc.net_order, &mainRc.net_order_count);
foundSel = FALSE;
foundSup = FALSE;
for (idx = 0; idx < mainRc.net_order_count; idx++)
{
if (mainRc.net_order[idx].prov_cni == provCni)
{
dprintf3("RcFile-UpdateNetworkSelection: update %s list for prov 0x%04X: %d entries\n", (mainRc.net_order[idx].add_sub?"SEL":"SUP"), provCni, selCount);
if (mainRc.net_order[idx].add_sub != 0)
{
if (pSelCnis != NULL)
{
memcpy(mainRc.net_order[idx].net_cnis, pSelCnis, selCount * sizeof(*pSelCnis));
mainRc.net_order[idx].net_count = selCount;
}
foundSel = TRUE;
}
else
{
if (pSupCnis != NULL)
{
memcpy(mainRc.net_order[idx].net_cnis, pSupCnis, supCount * sizeof(*pSupCnis));
mainRc.net_order[idx].net_count = supCount;
}
foundSup = TRUE;
}
}
}
if ((foundSel == FALSE) && (pSelCnis != NULL))
{
dprintf2("RcFile-UpdateNetworkSelection: append SEL list for prov 0x%04X: %d entries\n", provCni, selCount);
RcFile_DynListGrow(&dynList);
idx = mainRc.net_order_count - 1;
memcpy(mainRc.net_order[idx].net_cnis, pSelCnis, selCount * sizeof(*pSelCnis));
mainRc.net_order[idx].net_count = selCount;
mainRc.net_order[idx].add_sub = 1;
mainRc.net_order[idx].prov_cni = provCni;
}
if ((foundSup == FALSE) && (pSupCnis != NULL))
{
dprintf2("RcFile-UpdateNetworkSelection: append SUP list for prov 0x%04X: %d entries\n", provCni, selCount);
RcFile_DynListGrow(&dynList);
idx = mainRc.net_order_count - 1;
memcpy(mainRc.net_order[idx].net_cnis, pSupCnis, supCount * sizeof(*pSupCnis));
mainRc.net_order[idx].net_count = supCount;
mainRc.net_order[idx].add_sub = 0;
mainRc.net_order[idx].prov_cni = provCni;
}
}
// ----------------------------------------------------------------------------
// Add a new XMLTV provider path
// - caller must make sure the provider CNI is not yet defined
//
void RcFile_AddXmltvProvider( uint cni, const char * pXmlFile )
{
RCFILE_DYN_LIST dynList;
RcFile_DynListInit(&dynList, sizeof(RCFILE_XMLTV_PROV),
(char**)&mainRc.xmltv_prov, &mainRc.xmltv_prov_count);
RcFile_DynListGrow(&dynList);
mainRc.xmltv_prov[mainRc.xmltv_prov_count - 1].prov_cni = cni;
mainRc.xmltv_prov[mainRc.xmltv_prov_count - 1].path = xstrdup(pXmlFile);
}
// ----------------------------------------------------------------------------
// Update an XMLTV provider's access time and count
//
bool RcFile_UpdateXmltvProvAtime( uint provCni, time_t atime, bool doAcountIncr )
{
uint idx;
bool result = FALSE;
for (idx = 0; idx < mainRc.xmltv_prov_count; idx++)
{
if (mainRc.xmltv_prov[idx].prov_cni == provCni)
{
mainRc.xmltv_prov[idx].atime = atime;
if (doAcountIncr)
mainRc.xmltv_prov[idx].acount += 1;
result = TRUE;
break;
}
}
return result;
}
// ----------------------------------------------------------------------------
// Fetch the original channel ID for the given network CNI
//
const char * RcFile_GetXmltvNetworkId( uint cni )
{
RCFILE_XMLTV_NETS *pNetNames;
uint idx;
const char * pResult = NULL;
pNetNames = mainRc.xmltv_nets;
for (idx = 0; idx < mainRc.xmltv_nets_count; idx++, pNetNames++)
{
if (pNetNames->net_cni == cni)
{
pResult = pNetNames->chn_id;
break;
}
}
return pResult;
}
// ----------------------------------------------------------------------------
// Add a new XMLTV channel ID for a given provider
// - caller must make sure the network CNI is not yet defined for this provider
//
void RcFile_AddXmltvNetwork( uint provCni, uint netCni, const char * pChnId )
{
RCFILE_DYN_LIST dynList;
RcFile_DynListInit(&dynList, sizeof(RCFILE_XMLTV_NETS),
(char**)&mainRc.xmltv_nets, &mainRc.xmltv_nets_count);
RcFile_DynListGrow(&dynList);
mainRc.xmltv_nets[mainRc.xmltv_nets_count - 1].prov_cni = provCni;
mainRc.xmltv_nets[mainRc.xmltv_nets_count - 1].net_cni = netCni;
mainRc.xmltv_nets[mainRc.xmltv_nets_count - 1].chn_id = xstrdup(pChnId);
}
// ----------------------------------------------------------------------------
// Update the provider preference order: move the last selected CNI to the front
// - note: only the first item is used currently; rest of the list is OBSOLETE
//
bool RcFile_UpdateProvSelection( uint cni )
{
uint prov_sel_count;
uint prov_selection[RC_MAX_ACQ_CNI_PROV];
uint idx;
bool modified;
// check if an update is required
if ( (mainRc.db.prov_sel_count == 0) || (mainRc.db.prov_selection[0] != cni))
{
dprintf1("RcFile-UpdateProvSelection: CNI 0x%04X\n", cni);
// place new CNI at first position
prov_sel_count = 1;
prov_selection[0] = cni;
// copy the other CNIs behind it (while skipping the new CNI)
for (idx = 0; (idx < mainRc.db.prov_sel_count) && (prov_sel_count < RC_MAX_ACQ_CNI_PROV); idx++)
{
if (mainRc.db.prov_selection[idx] != cni)
{
prov_selection[prov_sel_count] = mainRc.db.prov_selection[idx];
prov_sel_count += 1;
}
}
// finally copy the new list into the database
memcpy(mainRc.db.prov_selection, prov_selection, sizeof(mainRc.db.prov_selection));
mainRc.db.prov_sel_count = prov_sel_count;
modified = TRUE;
}
else
modified = FALSE;
return modified;
}
// ----------------------------------------------------------------------------
// Same as above, but with more than one CNI, taken from merged database
// - first CNI 0x00FF is implied
//
bool RcFile_UpdateMergedProvSelection( void )
{
uint prov_sel_count;
uint prov_selection[RC_MAX_ACQ_CNI_PROV];
uint cmpIdx;
uint idx;
uint cni;
bool modified;
// check if an update is required
if ( (mainRc.db.prov_sel_count == mainRc.db.prov_merge_count + 1) &&
(mainRc.db.prov_selection[0] == MERGED_PROV_CNI) )
{
for (cmpIdx = 0; (cmpIdx < mainRc.db.prov_merge_count) &&
(cmpIdx + 1 < mainRc.db.prov_sel_count); cmpIdx++)
if (mainRc.db.prov_merge_cnis[cmpIdx] != mainRc.db.prov_selection[cmpIdx + 1])
break;
modified = (cmpIdx >= mainRc.db.prov_merge_count);
}
else
modified = TRUE;
if (modified)
{
// place new CNI at first position
prov_sel_count = 1 + mainRc.db.prov_merge_count;
prov_selection[0] = MERGED_PROV_CNI;
memcpy(prov_selection + 1, mainRc.db.prov_merge_cnis,
mainRc.db.prov_merge_count * sizeof(uint));
// copy the other CNIs behind it (while skipping the new CNI)
for (idx = 0; (idx < mainRc.db.prov_sel_count) &&
(prov_sel_count < RC_MAX_ACQ_CNI_PROV); idx++)
{
cni = mainRc.db.prov_selection[idx];
if ((cni != MERGED_PROV_CNI) && (cni != 0))
{
for (cmpIdx = 0; cmpIdx < mainRc.db.prov_merge_count; cmpIdx++)
if (mainRc.db.prov_merge_cnis[cmpIdx] == cni)
break;
if (cmpIdx >= mainRc.db.prov_merge_count)
{
prov_selection[prov_sel_count] = cni;
prov_sel_count += 1;
}
}
}
// finally copy the new list into the database
memcpy(mainRc.db.prov_selection, prov_selection, sizeof(mainRc.db.prov_selection));
mainRc.db.prov_sel_count = prov_sel_count;
modified = TRUE;
}
else
modified = FALSE;
return modified;
}
// ----------------------------------------------------------------------------
// Remove provider CNI from all lists
//
void RcFile_RemoveProvider( uint cni )
{
uint tmpl[RC_MAX_ACQ_CNI_FREQS];
uint type;
uint idx;
uint count;
// remove from provider selection
count = 0;
for (idx = 0; idx < mainRc.db.prov_sel_count; idx++)
{
if (mainRc.db.prov_selection[idx] != cni)
{
tmpl[count] = mainRc.db.prov_selection[idx];
count += 1;
}
}
memcpy(mainRc.db.prov_selection, tmpl, count * sizeof(uint));
mainRc.db.prov_sel_count = count;
// remove from merge provider list
count = 0;
for (idx = 0; idx < mainRc.db.prov_merge_count; idx++)
{
if (mainRc.db.prov_merge_cnis[idx] != cni)
{
tmpl[count] = mainRc.db.prov_merge_cnis[idx];
count += 1;
}
}
memcpy(mainRc.db.prov_merge_cnis, tmpl, count * sizeof(uint));
mainRc.db.prov_merge_count = count;
// remove from all merge options
for (type = 0; type < MERGE_TYPE_COUNT; type++)
{
count = 0;
for (idx = 0; idx < mainRc.db.prov_merge_opt_count[type]; idx++)
if (mainRc.db.prov_merge_opts[type][idx] != cni)
tmpl[count++] = mainRc.db.prov_merge_opts[type][idx];
memcpy(mainRc.db.prov_merge_opts[type], tmpl, count * sizeof(uint));
mainRc.db.prov_merge_opt_count[type] = count;
}
// remove network selection
for (idx = 0; idx < mainRc.net_order_count; /* no increment */ )
{
if (mainRc.net_order[idx].prov_cni == cni)
{
memmove(mainRc.net_order + idx, mainRc.net_order + idx + 1,
(mainRc.net_order_count - idx) * sizeof(mainRc.net_order[0]));
mainRc.net_order_count -= 1;
}
else
idx += 1;
}
// TODO: remove net selection
}
// ----------------------------------------------------------------------------
// Return pointer to configuration data
//
const RCFILE * RcFile_Query( void )
{
assert(mainRcInit != FALSE);
return &mainRc;
}
// ----------------------------------------------------------------------------
// Free allocated memory in config struct
//
void RcFile_Destroy( void )
{
uint sectIdx;
for (sectIdx = 0; sectIdx < RC_ARR_CNT(rcParseCfg); sectIdx++)
{
RcFile_FreeSectionMemory(sectIdx);
}
}
// ----------------------------------------------------------------------------
// Initialize configuration with default values (same as in GUI)
//
void RcFile_Init( void )
{
memset(&mainRc, 0, sizeof(mainRc));
mainRcInit = TRUE;
mainRc.acq.acq_mode = ACQ_DFLT_ACQ_MODE;
mainRc.netacq.netacq_enable = NETACQ_DFLT_ENABLE;
mainRc.netacq.do_tcp_ip = NETACQ_DFLT_DO_TCP_IP;
mainRc.netacq.max_conn = NETACQ_DFLT_MAX_CONN;
mainRc.netacq.fileloglev = NETACQ_DFLT_FILELOGLEV;
mainRc.netacq.sysloglev = NETACQ_DFLT_SYSLOGLEV;
mainRc.netacq.pHostName = xstrdup(NETACQ_DFLT_HOSTNAME_STR);
mainRc.netacq.pPort = xstrdup(NETACQ_DFLT_PORT_STR);
mainRc.ttx.ttx_chn_count = TTXGRAB_DFLT_CHN_COUNT;
mainRc.ttx.ttx_start_pg = TTXGRAB_DFLT_START_PG;
mainRc.ttx.ttx_end_pg = TTXGRAB_DFLT_END_PG;
mainRc.ttx.ttx_ov_pg = TTXGRAB_DFLT_OV_PG;
mainRc.ttx.ttx_duration = TTXGRAB_DFLT_DURATION;
mainRc.tvcard.drv_type = BTDRV_SOURCE_UNDEF;
mainRc.tvcard.wdm_stop = TRUE;
mainRc.db.piexpire_cutoff = EPGDB_DFLT_EXPIRE_TIME;
mainRc.db.auto_merge_ttx = TRUE;
}
| 33.811765 | 177 | 0.579812 |
365124f9930d6da6848f608186e902723fd20e56 | 801 | h | C | GLTF/include/GLTFImage.h | cnheider/COLLADA2GLTF | 73caf2f3b17457403ddddcb8623bc26d75ef4f91 | [
"MIT"
] | null | null | null | GLTF/include/GLTFImage.h | cnheider/COLLADA2GLTF | 73caf2f3b17457403ddddcb8623bc26d75ef4f91 | [
"MIT"
] | 1 | 2019-09-24T12:46:20.000Z | 2019-09-24T12:46:20.000Z | GLTF/include/GLTFImage.h | cnheider/COLLADA2GLTF | 73caf2f3b17457403ddddcb8623bc26d75ef4f91 | [
"MIT"
] | 2 | 2019-09-24T12:01:22.000Z | 2019-10-08T06:01:22.000Z | #pragma once
#include "GLTFBufferView.h"
#include "GLTFObject.h"
namespace GLTF {
class Image : public GLTF::Object {
public:
std::string uri;
unsigned char* data = NULL;
size_t byteLength = 0;
std::string mimeType;
GLTF::BufferView* bufferView = NULL;
Image(std::string uri);
Image(std::string uri, unsigned char* data, size_t byteLength, std::string fileExtension);
virtual ~Image();
static GLTF::Image* load(std::string path);
std::pair<int, int> getDimensions();
virtual std::string typeName();
virtual void writeJSON(void* writer, GLTF::Options* options);
private:
const std::string cacheKey;
Image(std::string uri, std::string cacheKey);
Image(std::string uri, std::string cacheKey, unsigned char* data, size_t byteLength, std::string fileExtension);
};
} | 26.7 | 114 | 0.71161 |
aaac443d37767200e7d695614bbfb11f12c4cc77 | 939 | h | C | Example/build/Debug-iphoneos/WZMKit/WZMKit.framework/Headers/WZMDownloader.h | wangzhaomeng/WZMKit | 0dc8cae93971b2da4b25d1168d87ee7e0d0ac536 | [
"MIT"
] | 3 | 2019-08-07T10:01:23.000Z | 2020-06-03T06:51:30.000Z | Example/build/Debug-iphoneos/WZMKit/WZMKit.framework/Headers/WZMDownloader.h | wangzhaomeng/WZMKit | 0dc8cae93971b2da4b25d1168d87ee7e0d0ac536 | [
"MIT"
] | null | null | null | Example/build/Debug-iphoneos/WZMKit/WZMKit.framework/Headers/WZMDownloader.h | wangzhaomeng/WZMKit | 0dc8cae93971b2da4b25d1168d87ee7e0d0ac536 | [
"MIT"
] | 1 | 2020-04-26T09:34:15.000Z | 2020-04-26T09:34:15.000Z | //
// WZMDownloader.h
// LLFoundation
//
// Created by WangZhaomeng on 2017/4/28.
// Copyright © 2017年 MaoChao Network Co. Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol WZMDownloaderDelegate;
@interface WZMDownloader : NSObject
///下载地址
@property (nonatomic, strong) NSString *url;
///下载后的文件保存的目录(必须是文件夹,可以不设置,默认保存在临时文件夹)
@property (nonatomic, strong) NSString *folderPath;
///是否正在下载
@property (nonatomic, assign, readonly, getter=isDownloading) BOOL downloading;
///代理
@property (nonatomic, weak) id<WZMDownloaderDelegate> delegate;
///开始
- (void)start;
///暂停
- (void)pause:(void(^)(void))completion;
///停止
- (void)stop:(void(^)(void))completion;
@end
@protocol WZMDownloaderDelegate <NSObject>
@optional
- (void)downloader:(WZMDownloader *)downloader didWriteBytes:(int64_t)didWriteBytes totalBytes:(int64_t)totalBytes;
- (void)downloader:(WZMDownloader *)downloader didFinish:(NSString *)path;
@end
| 24.710526 | 115 | 0.747604 |
9602c23dbc58e5b93359e4539dbc281e469668d3 | 894 | h | C | libs/ubuntu_arm/include/pointcloud-1.0.0/3dtof/3DToFExports.h | pointcloudAI/libDepthEye | d6a55be236d8b4a0451a7ec4cc3ef38a21fcbadc | [
"MIT"
] | 1 | 2022-03-26T09:52:03.000Z | 2022-03-26T09:52:03.000Z | libs/ubuntu_arm/include/pointcloud-1.0.0/3dtof/3DToFExports.h | pointcloudAI/libDepthEye | d6a55be236d8b4a0451a7ec4cc3ef38a21fcbadc | [
"MIT"
] | null | null | null | libs/ubuntu_arm/include/pointcloud-1.0.0/3dtof/3DToFExports.h | pointcloudAI/libDepthEye | d6a55be236d8b4a0451a7ec4cc3ef38a21fcbadc | [
"MIT"
] | null | null | null |
#ifndef TOFCAM_EXPORT_H
#define TOFCAM_EXPORT_H
#ifdef TOFCDK_STATIC_DEFINE
# define TOFCAM_EXPORT
# define TOFCDK_NO_EXPORT
#else
# ifndef TOFCAM_EXPORT
# ifdef tofcdk_EXPORTS
/* We are building this library */
# define TOFCAM_EXPORT
# else
/* We are using this library */
# define TOFCAM_EXPORT
# endif
# endif
# ifndef TOFCDK_NO_EXPORT
# define TOFCDK_NO_EXPORT
# endif
#endif
#ifndef TOFCDK_DEPRECATED
# define TOFCDK_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef TOFCDK_DEPRECATED_EXPORT
# define TOFCDK_DEPRECATED_EXPORT TOFCAM_EXPORT TOFCDK_DEPRECATED
#endif
#ifndef TOFCDK_DEPRECATED_NO_EXPORT
# define TOFCDK_DEPRECATED_NO_EXPORT TOFCDK_NO_EXPORT TOFCDK_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef TOFCDK_NO_DEPRECATED
# define TOFCDK_NO_DEPRECATED
# endif
#endif
#endif /* TOFCAM_EXPORT_H */
| 20.790698 | 72 | 0.763982 |
65b4bc5ae2f22c5085fc52316003539061e0ebe1 | 694 | h | C | src/cpp/pipeline/internal/aligned_alloc.h | SanggunLee/edgetpu | d3cf166783265f475c1ddba5883e150ee84f7bfe | [
"Apache-2.0"
] | 320 | 2019-09-19T07:10:48.000Z | 2022-03-12T01:48:56.000Z | src/cpp/pipeline/internal/aligned_alloc.h | Machine-Learning-Practice/edgetpu | 6d699665efdc5d84944b5233223c55fe5d3bd1a6 | [
"Apache-2.0"
] | 563 | 2019-09-27T06:40:40.000Z | 2022-03-31T23:12:15.000Z | src/cpp/pipeline/internal/aligned_alloc.h | Machine-Learning-Practice/edgetpu | 6d699665efdc5d84944b5233223c55fe5d3bd1a6 | [
"Apache-2.0"
] | 119 | 2019-09-25T02:51:10.000Z | 2022-03-03T08:11:12.000Z | #ifndef EDGETPU_CPP_PIPELINE_INTERNAL_ALIGNED_ALLOC_H_
#define EDGETPU_CPP_PIPELINE_INTERNAL_ALIGNED_ALLOC_H_
#include <cstdlib>
#if defined(_WIN32)
#include <malloc.h>
#endif
namespace coral {
namespace internal {
inline void* AlignedAlloc(int alignment, size_t size) {
#if defined(_WIN32)
return _aligned_malloc(size, alignment);
#else
void* ptr;
if (posix_memalign(&ptr, alignment, size) == 0) return ptr;
return nullptr;
#endif
}
inline void AlignedFree(void* aligned_memory) {
#if defined(_WIN32)
_aligned_free(aligned_memory);
#else
free(aligned_memory);
#endif
}
} // namespace internal
} // namespace coral
#endif // EDGETPU_CPP_PIPELINE_INTERNAL_ALIGNED_ALLOC_H_
| 19.828571 | 61 | 0.773775 |
d6a501a5b59651e2c37b32ceeedecbcc7fa9ba65 | 413 | h | C | rubis_ws/src/inertiallabs_pkgs/inertiallabs_sdk/Transport.h | Jihwan-Kimm/Autoware_On_Embedded | dc45b70a355fdd26a65007e9c1d9246090f06373 | [
"MIT"
] | 2 | 2021-07-12T06:44:37.000Z | 2021-07-20T07:50:33.000Z | rubis_ws/src/inertiallabs_pkgs/inertiallabs_sdk/Transport.h | Jihwan-Kimm/Autoware_On_Embedded | dc45b70a355fdd26a65007e9c1d9246090f06373 | [
"MIT"
] | null | null | null | rubis_ws/src/inertiallabs_pkgs/inertiallabs_sdk/Transport.h | Jihwan-Kimm/Autoware_On_Embedded | dc45b70a355fdd26a65007e9c1d9246090f06373 | [
"MIT"
] | 3 | 2021-07-12T06:38:00.000Z | 2022-03-21T07:27:17.000Z | #pragma once
namespace IL {
class Transport
{
public:
Transport() {};
virtual ~Transport() {};
virtual int open(const char* path) { (void)path;return 1; }
virtual bool isOpen() { return false; }
virtual void close() {}
virtual int read(char* buf, unsigned int size) { (void)buf; (void)size; return 0; }
virtual int write(char* buf, unsigned int size) { (void)buf; (void)size; return 0; }
};
}
| 24.294118 | 86 | 0.651332 |
04f2ce26523c0d44a30dd7543ae0b591b2f4bca0 | 3,933 | c | C | src/shell/shell_adv_rm.c | amit08thakare/Elua | e104a9adf3dcafe6f871191ac008cd438a189c0a | [
"MIT"
] | 641 | 2015-01-02T04:41:47.000Z | 2022-03-31T03:15:13.000Z | src/shell/shell_adv_rm.c | amit08thakare/Elua | e104a9adf3dcafe6f871191ac008cd438a189c0a | [
"MIT"
] | 58 | 2015-03-11T08:05:27.000Z | 2021-12-31T11:49:55.000Z | src/shell/shell_adv_rm.c | darren1713/elua | c280894885218858806b68cf04fbafa66a52c36a | [
"MIT"
] | 237 | 2015-01-04T07:49:39.000Z | 2022-03-11T03:31:35.000Z | // Advanced shell: 'rm' implementation
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "shell.h"
#include "common.h"
#include "type.h"
#include "platform_conf.h"
#ifdef BUILD_ADVANCED_SHELL
const char shell_help_rm[] = "<filemask> [-R] [-c] [-s]\n"
" <filemask>: file, directory or file mask to remove.\n"
" -R: remove recursively.\n"
" -c: confirm each remove.\n"
" -s: simulate only (no actual operation).\n";
const char shell_help_summary_rm[] = "remove files";
// helper: remove a single file and/or directory
static void shellh_rm_one( const char* path, int flags )
{
int ftype = cmn_fs_get_type( path );
int res = 0;
if( flags & SHELL_F_ASK_CONFIRMATION )
{
printf( "Are you sure you want to remove %s ? [y/n] ", path );
if( shellh_ask_yes_no( NULL ) == 0 )
return;
}
if( ( flags & SHELL_F_SIMULATE_ONLY ) == 0 )
{
if( ftype == CMN_FS_TYPE_FILE )
res = unlink( path );
else if( ftype == CMN_FS_TYPE_DIR )
res = rmdir( path );
else
{
printf( "WARNING: invalid argument '%s'\n", path );
return;
}
}
if( res )
{
if( ( flags & SHELL_F_SILENT ) == 0 )
printf( "WARNING: unable to remove %s\n", path );
}
else
printf( "Removed %s\n", path );
}
static int shellh_rm_walkdir_cb( const char *path, const struct dm_dirent *pent, void *pdata, int info )
{
u8 *pflags = ( u8* )pdata;
char *tmp = NULL;
int res = 1;
switch( info )
{
case CMN_FS_INFO_BEFORE_READDIR:
goto done;
case CMN_FS_INFO_INSIDE_READDIR:
if( ( tmp = cmn_fs_path_join( path, pent->fname, NULL ) ) == NULL )
{
printf( "Not enough memory.\n" );
goto done_err;
}
if( cmn_fs_get_type( tmp ) == CMN_FS_TYPE_FILE )
shellh_rm_one( tmp, *pflags );
goto done;
case CMN_FS_INFO_OPENDIR_FAILED:
printf( "ERROR: unable to read directory '%s', aborting.\n", path );
goto done_err;
case CMN_FS_INFO_DIRECTORY_DONE:
if( ( *pflags & SHELL_F_RECURSIVE ) && !cmn_fs_is_root_dir( path ) )
shellh_rm_one( path, *pflags | SHELL_F_SILENT );
goto done;
default:
goto done;
}
done_err:
res = 0;
done:
if( tmp )
free( tmp );
return res;
}
void shell_adv_rm( int argc, char **argv )
{
const char *fmask = NULL;
unsigned i, flags = 0;
int masktype;
if( argc < 2 )
{
SHELL_SHOW_HELP( rm );
return;
}
for( i = 1; i < argc; i ++ )
{
if( argv[ i ][ 0 ] == '/' )
{
if( !fmask )
fmask = argv[ i ];
else
printf( "Warning: ignoring argument '%s'\n", argv[ i ] );
}
else if( !strcmp( argv[ i ], "-R" ) )
flags |= SHELL_F_RECURSIVE;
else if( !strcmp( argv[ i ], "-c" ) )
flags |= SHELL_F_ASK_CONFIRMATION;
else if( !strcmp( argv[ i ], "-s" ) )
flags |= SHELL_F_SIMULATE_ONLY;
else
printf( "Warning: ignoring argument '%s'\n", argv[ i ] );
}
if( !fmask )
{
printf( "rm target not specified.\n" );
return;
}
masktype = cmn_fs_get_type( fmask );
if( masktype == CMN_FS_TYPE_FILE )
shellh_rm_one( fmask, flags );
else if( masktype == CMN_FS_TYPE_ERROR || masktype == CMN_FS_TYPE_FILE_NOT_FOUND || masktype == CMN_FS_TYPE_DIR_NOT_FOUND || masktype == CMN_FS_TYPE_UNKNOWN_NOT_FOUND )
printf( "Invalid argument '%s'.\n", fmask );
else if( masktype == CMN_FS_TYPE_DIR && ( ( flags & SHELL_F_RECURSIVE ) == 0 ) )
printf( "'%s': unable to remove directory (use '-R').\n", fmask );
else
cmn_fs_walkdir( fmask, shellh_rm_walkdir_cb, &flags, flags & SHELL_F_RECURSIVE );
}
#else // #ifdef BUILD_ADVANCED_SHELL
const char shell_help_rm[] = "";
const char shell_help_summary_rm[] = "";
void shell_adv_rm( int argc, char **argv )
{
shellh_not_implemented_handler( argc, argv );
}
#endif // #ifdef BUILD_ADVANCED_SHELL
| 25.538961 | 170 | 0.609713 |
aa9b81049d5a19aef7a69b511cd5198f0f0aa900 | 31,627 | c | C | src/core/corelib.c | boardwalk/janet | dbcbb4466dbab9d101cc4bb4f65b6f8151013cef | [
"MIT"
] | null | null | null | src/core/corelib.c | boardwalk/janet | dbcbb4466dbab9d101cc4bb4f65b6f8151013cef | [
"MIT"
] | null | null | null | src/core/corelib.c | boardwalk/janet | dbcbb4466dbab9d101cc4bb4f65b6f8151013cef | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2019 Calvin Rose
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef JANET_AMALG
#include <janet.h>
#include "compile.h"
#include "state.h"
#include "util.h"
#endif
/* Generated bytes */
#ifdef JANET_BOOTSTRAP
extern const unsigned char *janet_gen_core;
extern int32_t janet_gen_core_size;
#else
extern const unsigned char *janet_core_image;
extern size_t janet_core_image_size;
#endif
/* Use LoadLibrary on windows or dlopen on posix to load dynamic libaries
* with native code. */
#if defined(JANET_NO_DYNAMIC_MODULES)
typedef int Clib;
#define load_clib(name) ((void) name, 0)
#define symbol_clib(lib, sym) ((void) lib, (void) sym, 0)
#define error_clib() "dynamic libraries not supported"
#elif defined(JANET_WINDOWS)
#include <windows.h>
typedef HINSTANCE Clib;
#define load_clib(name) LoadLibrary((name))
#define symbol_clib(lib, sym) GetProcAddress((lib), (sym))
#define error_clib() "could not load dynamic library"
#else
#include <dlfcn.h>
typedef void *Clib;
#define load_clib(name) dlopen((name), RTLD_NOW)
#define symbol_clib(lib, sym) dlsym((lib), (sym))
#define error_clib() dlerror()
#endif
JanetModule janet_native(const char *name, const uint8_t **error) {
Clib lib = load_clib(name);
JanetModule init;
if (!lib) {
*error = janet_cstring(error_clib());
return NULL;
}
init = (JanetModule) symbol_clib(lib, "_janet_init");
if (!init) {
*error = janet_cstring("could not find _janet_init symbol");
return NULL;
}
return init;
}
static Janet janet_core_native(int32_t argc, Janet *argv) {
JanetModule init;
janet_arity(argc, 1, 2);
const uint8_t *path = janet_getstring(argv, 0);
const uint8_t *error = NULL;
JanetTable *env;
if (argc == 2) {
env = janet_gettable(argv, 1);
} else {
env = janet_table(0);
}
init = janet_native((const char *)path, &error);
if (!init) {
janet_panicf("could not load native %S: %S", path, error);
}
init(env);
return janet_wrap_table(env);
}
static Janet janet_core_print(int32_t argc, Janet *argv) {
for (int32_t i = 0; i < argc; ++i) {
int32_t j, len;
const uint8_t *vstr = janet_to_string(argv[i]);
len = janet_string_length(vstr);
for (j = 0; j < len; ++j) {
putc(vstr[j], stdout);
}
}
putc('\n', stdout);
return janet_wrap_nil();
}
static Janet janet_core_describe(int32_t argc, Janet *argv) {
JanetBuffer *b = janet_buffer(0);
for (int32_t i = 0; i < argc; ++i)
janet_description_b(b, argv[i]);
return janet_stringv(b->data, b->count);
}
static Janet janet_core_string(int32_t argc, Janet *argv) {
JanetBuffer *b = janet_buffer(0);
for (int32_t i = 0; i < argc; ++i)
janet_to_string_b(b, argv[i]);
return janet_stringv(b->data, b->count);
}
static Janet janet_core_symbol(int32_t argc, Janet *argv) {
JanetBuffer *b = janet_buffer(0);
for (int32_t i = 0; i < argc; ++i)
janet_to_string_b(b, argv[i]);
return janet_symbolv(b->data, b->count);
}
static Janet janet_core_keyword(int32_t argc, Janet *argv) {
JanetBuffer *b = janet_buffer(0);
for (int32_t i = 0; i < argc; ++i)
janet_to_string_b(b, argv[i]);
return janet_keywordv(b->data, b->count);
}
static Janet janet_core_buffer(int32_t argc, Janet *argv) {
JanetBuffer *b = janet_buffer(0);
for (int32_t i = 0; i < argc; ++i)
janet_to_string_b(b, argv[i]);
return janet_wrap_buffer(b);
}
static Janet janet_core_is_abstract(int32_t argc, Janet *argv) {
janet_fixarity(argc, 1);
return janet_wrap_boolean(janet_checktype(argv[0], JANET_ABSTRACT));
}
static Janet janet_core_scannumber(int32_t argc, Janet *argv) {
double number;
janet_fixarity(argc, 1);
JanetByteView view = janet_getbytes(argv, 0);
if (janet_scan_number(view.bytes, view.len, &number))
return janet_wrap_nil();
return janet_wrap_number(number);
}
static Janet janet_core_tuple(int32_t argc, Janet *argv) {
return janet_wrap_tuple(janet_tuple_n(argv, argc));
}
static Janet janet_core_array(int32_t argc, Janet *argv) {
JanetArray *array = janet_array(argc);
array->count = argc;
memcpy(array->data, argv, argc * sizeof(Janet));
return janet_wrap_array(array);
}
static Janet janet_core_table(int32_t argc, Janet *argv) {
int32_t i;
if (argc & 1)
janet_panic("expected even number of arguments");
JanetTable *table = janet_table(argc >> 1);
for (i = 0; i < argc; i += 2) {
janet_table_put(table, argv[i], argv[i + 1]);
}
return janet_wrap_table(table);
}
static Janet janet_core_struct(int32_t argc, Janet *argv) {
int32_t i;
if (argc & 1)
janet_panic("expected even number of arguments");
JanetKV *st = janet_struct_begin(argc >> 1);
for (i = 0; i < argc; i += 2) {
janet_struct_put(st, argv[i], argv[i + 1]);
}
return janet_wrap_struct(janet_struct_end(st));
}
static Janet janet_core_gensym(int32_t argc, Janet *argv) {
(void) argv;
janet_fixarity(argc, 0);
return janet_wrap_symbol(janet_symbol_gen());
}
static Janet janet_core_gccollect(int32_t argc, Janet *argv) {
(void) argv;
(void) argc;
janet_collect();
return janet_wrap_nil();
}
static Janet janet_core_gcsetinterval(int32_t argc, Janet *argv) {
janet_fixarity(argc, 1);
int32_t val = janet_getinteger(argv, 0);
if (val < 0)
janet_panic("expected non-negative integer");
janet_vm_gc_interval = val;
return janet_wrap_nil();
}
static Janet janet_core_gcinterval(int32_t argc, Janet *argv) {
(void) argv;
janet_fixarity(argc, 0);
return janet_wrap_number(janet_vm_gc_interval);
}
static Janet janet_core_type(int32_t argc, Janet *argv) {
janet_fixarity(argc, 1);
JanetType t = janet_type(argv[0]);
if (t == JANET_ABSTRACT) {
return janet_ckeywordv(janet_abstract_type(janet_unwrap_abstract(argv[0]))->name);
} else {
return janet_ckeywordv(janet_type_names[t]);
}
}
static Janet janet_core_next(int32_t argc, Janet *argv) {
janet_fixarity(argc, 2);
JanetDictView view = janet_getdictionary(argv, 0);
const JanetKV *end = view.kvs + view.cap;
const JanetKV *kv = janet_checktype(argv[1], JANET_NIL)
? view.kvs
: janet_dict_find(view.kvs, view.cap, argv[1]) + 1;
while (kv < end) {
if (!janet_checktype(kv->key, JANET_NIL)) return kv->key;
kv++;
}
return janet_wrap_nil();
}
static Janet janet_core_hash(int32_t argc, Janet *argv) {
janet_fixarity(argc, 1);
return janet_wrap_number(janet_hash(argv[0]));
}
static const JanetReg corelib_cfuns[] = {
{"native", janet_core_native,
JDOC("(native path [,env])\n\n"
"Load a native module from the given path. The path "
"must be an absolute or relative path on the file system, and is "
"usually a .so file on Unix systems, and a .dll file on Windows. "
"Returns an environment table that contains functions and other values "
"from the native module.")
},
{"print", janet_core_print,
JDOC("(print & xs)\n\n"
"Print values to the console (standard out). Value are converted "
"to strings if they are not already. After printing all values, a "
"newline character is printed. Returns nil.")
},
{"describe", janet_core_describe,
JDOC("(describe x)\n\n"
"Returns a string that is a human readable description of a value x.")
},
{"string", janet_core_string,
JDOC("(string & parts)\n\n"
"Creates a string by concatenating values together. Values are "
"converted to bytes via describe if they are not byte sequences. "
"Returns the new string.")
},
{"symbol", janet_core_symbol,
JDOC("(symbol & xs)\n\n"
"Creates a symbol by concatenating values together. Values are "
"converted to bytes via describe if they are not byte sequences. Returns "
"the new symbol.")
},
{"keyword", janet_core_keyword,
JDOC("(keyword & xs)\n\n"
"Creates a keyword by concatenating values together. Values are "
"converted to bytes via describe if they are not byte sequences. Returns "
"the new keyword.")
},
{"buffer", janet_core_buffer,
JDOC("(buffer & xs)\n\n"
"Creates a new buffer by concatenating values together. Values are "
"converted to bytes via describe if they are not byte sequences. Returns "
"the new buffer.")
},
{"abstract?", janet_core_is_abstract,
JDOC("(abstract? x)\n\n"
"Check if x is an abstract type.")
},
{"table", janet_core_table,
JDOC("(table & kvs)\n\n"
"Creates a new table from a variadic number of keys and values. "
"kvs is a sequence k1, v1, k2, v2, k3, v3, ... If kvs has "
"an odd number of elements, an error will be thrown. Returns the "
"new table.")
},
{"array", janet_core_array,
JDOC("(array & items)\n\n"
"Create a new array that contains items. Returns the new array.")
},
{"scan-number", janet_core_scannumber,
JDOC("(scan-number str)\n\n"
"Parse a number from a byte sequence an return that number, either and integer "
"or a real. The number "
"must be in the same format as numbers in janet source code. Will return nil "
"on an invalid number.")
},
{"tuple", janet_core_tuple,
JDOC("(tuple & items)\n\n"
"Creates a new tuple that contains items. Returns the new tuple.")
},
{"struct", janet_core_struct,
JDOC("(struct & kvs)\n\n"
"Create a new struct from a sequence of key value pairs. "
"kvs is a sequence k1, v1, k2, v2, k3, v3, ... If kvs has "
"an odd number of elements, an error will be thrown. Returns the "
"new struct.")
},
{"gensym", janet_core_gensym,
JDOC("(gensym)\n\n"
"Returns a new symbol that is unique across the runtime. This means it "
"will not collide with any already created symbols during compilation, so "
"it can be used in macros to generate automatic bindings.")
},
{"gccollect", janet_core_gccollect,
JDOC("(gccollect)\n\n"
"Run garbage collection. You should probably not call this manually.")
},
{"gcsetinterval", janet_core_gcsetinterval,
JDOC("(gcsetinterval interval)\n\n"
"Set an integer number of bytes to allocate before running garbage collection. "
"Low valuesi for interval will be slower but use less memory. "
"High values will be faster but use more memory.")
},
{"gcinterval", janet_core_gcinterval,
JDOC("(gcinterval)\n\n"
"Returns the integer number of bytes to allocate before running an iteration "
"of garbage collection.")
},
{"type", janet_core_type,
JDOC("(type x)\n\n"
"Returns the type of x as a keyword symbol. x is one of\n"
"\t:nil\n"
"\t:boolean\n"
"\t:integer\n"
"\t:real\n"
"\t:array\n"
"\t:tuple\n"
"\t:table\n"
"\t:struct\n"
"\t:string\n"
"\t:buffer\n"
"\t:symbol\n"
"\t:keyword\n"
"\t:function\n"
"\t:cfunction\n\n"
"or another symbol for an abstract type.")
},
{"next", janet_core_next,
JDOC("(next dict key)\n\n"
"Gets the next key in a struct or table. Can be used to iterate through "
"the keys of a data structure in an unspecified order. Keys are guaranteed "
"to be seen only once per iteration if they data structure is not mutated "
"during iteration. If key is nil, next returns the first key. If next "
"returns nil, there are no more keys to iterate through. ")
},
{"hash", janet_core_hash,
JDOC("(hash value)\n\n"
"Gets a hash value for any janet value. The hash is an integer can be used "
"as a cheap hash function for all janet objects. If two values are strictly equal, "
"then they will have the same hash value.")
},
{NULL, NULL, NULL}
};
#ifdef JANET_BOOTSTRAP
/* Utility for inline assembly */
static void janet_quick_asm(
JanetTable *env,
int32_t flags,
const char *name,
int32_t arity,
int32_t slots,
const uint32_t *bytecode,
size_t bytecode_size,
const char *doc) {
JanetFuncDef *def = janet_funcdef_alloc();
def->arity = arity;
def->flags = flags;
def->slotcount = slots;
def->bytecode = malloc(bytecode_size);
def->bytecode_length = (int32_t)(bytecode_size / sizeof(uint32_t));
def->name = janet_cstring(name);
if (!def->bytecode) {
JANET_OUT_OF_MEMORY;
}
memcpy(def->bytecode, bytecode, bytecode_size);
janet_def(env, name, janet_wrap_function(janet_thunk(def)), doc);
}
/* Macros for easier inline janet assembly */
#define SSS(op, a, b, c) ((op) | ((a) << 8) | ((b) << 16) | ((c) << 24))
#define SS(op, a, b) ((op) | ((a) << 8) | ((b) << 16))
#define SSI(op, a, b, I) ((op) | ((a) << 8) | ((b) << 16) | ((uint32_t)(I) << 24))
#define S(op, a) ((op) | ((a) << 8))
#define SI(op, a, I) ((op) | ((a) << 8) | ((uint32_t)(I) << 16))
/* Templatize a varop */
static void templatize_varop(
JanetTable *env,
int32_t flags,
const char *name,
int32_t nullary,
int32_t unary,
uint32_t op,
const char *doc) {
/* Variadic operator assembly. Must be templatized for each different opcode. */
/* Reg 0: Argument tuple (args) */
/* Reg 1: Argument count (argn) */
/* Reg 2: Jump flag (jump?) */
/* Reg 3: Accumulator (accum) */
/* Reg 4: Next operand (operand) */
/* Reg 5: Loop iterator (i) */
uint32_t varop_asm[] = {
SS(JOP_LENGTH, 1, 0), /* Put number of arguments in register 1 -> argn = count(args) */
/* Check nullary */
SSS(JOP_EQUALS_IMMEDIATE, 2, 1, 0), /* Check if numargs equal to 0 */
SI(JOP_JUMP_IF_NOT, 2, 3), /* If not 0, jump to next check */
/* Nullary */
SI(JOP_LOAD_INTEGER, 3, nullary), /* accum = nullary value */
S(JOP_RETURN, 3), /* return accum */
/* Check unary */
SSI(JOP_EQUALS_IMMEDIATE, 2, 1, 1), /* Check if numargs equal to 1 */
SI(JOP_JUMP_IF_NOT, 2, 5), /* If not 1, jump to next check */
/* Unary */
SI(JOP_LOAD_INTEGER, 3, unary), /* accum = unary value */
SSI(JOP_GET_INDEX, 4, 0, 0), /* operand = args[0] */
SSS(op, 3, 3, 4), /* accum = accum op operand */
S(JOP_RETURN, 3), /* return accum */
/* Mutli (2 or more) arity */
/* Prime loop */
SSI(JOP_GET_INDEX, 3, 0, 0), /* accum = args[0] */
SI(JOP_LOAD_INTEGER, 5, 1), /* i = 1 */
/* Main loop */
SSS(JOP_GET, 4, 0, 5), /* operand = args[i] */
SSS(op, 3, 3, 4), /* accum = accum op operand */
SSI(JOP_ADD_IMMEDIATE, 5, 5, 1), /* i++ */
SSI(JOP_EQUALS, 2, 5, 1), /* jump? = (i == argn) */
SI(JOP_JUMP_IF_NOT, 2, -4), /* if not jump? go back 4 */
/* Done, do last and return accumulator */
S(JOP_RETURN, 3) /* return accum */
};
janet_quick_asm(
env,
flags | JANET_FUNCDEF_FLAG_VARARG,
name,
0,
6,
varop_asm,
sizeof(varop_asm),
doc);
}
/* Templatize variadic comparators */
static void templatize_comparator(
JanetTable *env,
int32_t flags,
const char *name,
int invert,
uint32_t op,
const char *doc) {
/* Reg 0: Argument tuple (args) */
/* Reg 1: Argument count (argn) */
/* Reg 2: Jump flag (jump?) */
/* Reg 3: Last value (last) */
/* Reg 4: Next operand (next) */
/* Reg 5: Loop iterator (i) */
uint32_t comparator_asm[] = {
SS(JOP_LENGTH, 1, 0), /* Put number of arguments in register 1 -> argn = count(args) */
SSS(JOP_LESS_THAN_IMMEDIATE, 2, 1, 2), /* Check if numargs less than 2 */
SI(JOP_JUMP_IF, 2, 10), /* If numargs < 2, jump to done */
/* Prime loop */
SSI(JOP_GET_INDEX, 3, 0, 0), /* last = args[0] */
SI(JOP_LOAD_INTEGER, 5, 1), /* i = 1 */
/* Main loop */
SSS(JOP_GET, 4, 0, 5), /* next = args[i] */
SSS(op, 2, 3, 4), /* jump? = last compare next */
SI(JOP_JUMP_IF_NOT, 2, 7), /* if not jump? goto fail (return false) */
SSI(JOP_ADD_IMMEDIATE, 5, 5, 1), /* i++ */
SS(JOP_MOVE_NEAR, 3, 4), /* last = next */
SSI(JOP_EQUALS, 2, 5, 1), /* jump? = (i == argn) */
SI(JOP_JUMP_IF_NOT, 2, -6), /* if not jump? go back 6 */
/* Done, return true */
S(invert ? JOP_LOAD_FALSE : JOP_LOAD_TRUE, 3),
S(JOP_RETURN, 3),
/* Failed, return false */
S(invert ? JOP_LOAD_TRUE : JOP_LOAD_FALSE, 3),
S(JOP_RETURN, 3)
};
janet_quick_asm(
env,
flags | JANET_FUNCDEF_FLAG_VARARG,
name,
0,
6,
comparator_asm,
sizeof(comparator_asm),
doc);
}
/* Make the apply function */
static void make_apply(JanetTable *env) {
/* Reg 0: Function (fun) */
/* Reg 1: Argument tuple (args) */
/* Reg 2: Argument count (argn) */
/* Reg 3: Jump flag (jump?) */
/* Reg 4: Loop iterator (i) */
/* Reg 5: Loop values (x) */
uint32_t apply_asm[] = {
SS(JOP_LENGTH, 2, 1),
SSS(JOP_EQUALS_IMMEDIATE, 3, 2, 0), /* Immediate tail call if no args */
SI(JOP_JUMP_IF, 3, 9),
/* Prime loop */
SI(JOP_LOAD_INTEGER, 4, 0), /* i = 0 */
/* Main loop */
SSS(JOP_GET, 5, 1, 4), /* x = args[i] */
SSI(JOP_ADD_IMMEDIATE, 4, 4, 1), /* i++ */
SSI(JOP_EQUALS, 3, 4, 2), /* jump? = (i == argn) */
SI(JOP_JUMP_IF, 3, 3), /* if jump? go forward 3 */
S(JOP_PUSH, 5),
(JOP_JUMP | ((uint32_t)(-5) << 8)),
/* Push the array */
S(JOP_PUSH_ARRAY, 5),
/* Call the funciton */
S(JOP_TAILCALL, 0)
};
janet_quick_asm(env, JANET_FUN_APPLY | JANET_FUNCDEF_FLAG_VARARG,
"apply", 1, 6, apply_asm, sizeof(apply_asm),
JDOC("(apply f & args)\n\n"
"Applies a function to a variable number of arguments. Each element in args "
"is used as an argument to f, except the last element in args, which is expected to "
"be an array-like. Each element in this last argument is then also pushed as an argument to "
"f. For example:\n\n"
"\t(apply + 1000 (range 10))\n\n"
"sums the first 10 integers and 1000.)"));
}
static const uint32_t error_asm[] = {
JOP_ERROR
};
static const uint32_t debug_asm[] = {
JOP_SIGNAL | (2 << 24),
JOP_RETURN_NIL
};
static const uint32_t yield_asm[] = {
JOP_SIGNAL | (3 << 24),
JOP_RETURN
};
static const uint32_t resume_asm[] = {
JOP_RESUME | (1 << 24),
JOP_RETURN
};
static const uint32_t get_asm[] = {
JOP_GET | (1 << 24),
JOP_RETURN
};
static const uint32_t put_asm[] = {
JOP_PUT | (1 << 16) | (2 << 24),
JOP_RETURN
};
static const uint32_t length_asm[] = {
JOP_LENGTH,
JOP_RETURN
};
static const uint32_t bnot_asm[] = {
JOP_BNOT,
JOP_RETURN
};
#endif /* ifndef JANET_NO_BOOTSTRAP */
JanetTable *janet_core_env(void) {
JanetTable *env = janet_table(0);
janet_core_cfuns(env, NULL, corelib_cfuns);
#ifdef JANET_BOOTSTRAP
janet_quick_asm(env, JANET_FUN_YIELD, "debug", 0, 1, debug_asm, sizeof(debug_asm),
JDOC("(debug)\n\n"
"Throws a debug signal that can be caught by a parent fiber and used to inspect "
"the running state of the current fiber. Returns nil."));
janet_quick_asm(env, JANET_FUN_ERROR, "error", 1, 1, error_asm, sizeof(error_asm),
JDOC("(error e)\n\n"
"Throws an error e that can be caught and handled by a parent fiber."));
janet_quick_asm(env, JANET_FUN_YIELD, "yield", 1, 2, yield_asm, sizeof(yield_asm),
JDOC("(yield x)\n\n"
"Yield a value to a parent fiber. When a fiber yields, its execution is paused until "
"another thread resumes it. The fiber will then resume, and the last yield call will "
"return the value that was passed to resume."));
janet_quick_asm(env, JANET_FUN_RESUME, "resume", 2, 2, resume_asm, sizeof(resume_asm),
JDOC("(resume fiber [,x])\n\n"
"Resume a new or suspended fiber and optionally pass in a value to the fiber that "
"will be returned to the last yield in the case of a pending fiber, or the argument to "
"the dispatch function in the case of a new fiber. Returns either the return result of "
"the fiber's dispatch function, or the value from the next yield call in fiber."));
janet_quick_asm(env, JANET_FUN_GET, "get", 2, 2, get_asm, sizeof(get_asm),
JDOC("(get ds key)\n\n"
"Get a value from any associative data structure. Arrays, tuples, tables, structs, strings, "
"symbols, and buffers are all associative and can be used with get. Order structures, name "
"arrays, tuples, strings, buffers, and symbols must use integer keys. Structs and tables can "
"take any value as a key except nil and return a value except nil. Byte sequences will return "
"integer representations of bytes as result of a get call."));
janet_quick_asm(env, JANET_FUN_PUT, "put", 3, 3, put_asm, sizeof(put_asm),
JDOC("(put ds key value)\n\n"
"Associate a key with a value in any mutable associative data structure. Indexed data structures "
"(arrays and buffers) only accept non-negative integer keys, and will expand if an out of bounds "
"value is provided. In an array, extra space will be filled with nils, and in a buffer, extra "
"space will be filled with 0 bytes. In a table, putting a key that is contained in the table prototype "
"will hide the association defined by the prototype, but will not mutate the prototype table. Putting "
"a value nil into a table will remove the key from the table. Returns the data structure ds."));
janet_quick_asm(env, JANET_FUN_LENGTH, "length", 1, 1, length_asm, sizeof(length_asm),
JDOC("(length ds)\n\n"
"Returns the length or count of a data structure in constant time as an integer. For "
"structs and tables, returns the number of key-value pairs in the data structure."));
janet_quick_asm(env, JANET_FUN_BNOT, "bnot", 1, 1, bnot_asm, sizeof(bnot_asm),
JDOC("(bnot x)\n\nReturns the bit-wise inverse of integer x."));
make_apply(env);
/* Variadic ops */
templatize_varop(env, JANET_FUN_ADD, "+", 0, 0, JOP_ADD,
JDOC("(+ & xs)\n\n"
"Returns the sum of all xs. xs must be integers or real numbers only. If xs is empty, return 0."));
templatize_varop(env, JANET_FUN_SUBTRACT, "-", 0, 0, JOP_SUBTRACT,
JDOC("(- & xs)\n\n"
"Returns the difference of xs. If xs is empty, returns 0. If xs has one element, returns the "
"negative value of that element. Otherwise, returns the first element in xs minus the sum of "
"the rest of the elements."));
templatize_varop(env, JANET_FUN_MULTIPLY, "*", 1, 1, JOP_MULTIPLY,
JDOC("(* & xs)\n\n"
"Returns the product of all elements in xs. If xs is empty, returns 1."));
templatize_varop(env, JANET_FUN_DIVIDE, "/", 1, 1, JOP_DIVIDE,
JDOC("(/ & xs)\n\n"
"Returns the quotient of xs. If xs is empty, returns 1. If xs has one value x, returns "
"the reciprocal of x. Otherwise return the first value of xs repeatedly divided by the remaining "
"values. Division by two integers uses truncating division."));
templatize_varop(env, JANET_FUN_BAND, "band", -1, -1, JOP_BAND,
JDOC("(band & xs)\n\n"
"Returns the bit-wise and of all values in xs. Each x in xs must be an integer."));
templatize_varop(env, JANET_FUN_BOR, "bor", 0, 0, JOP_BOR,
JDOC("(bor & xs)\n\n"
"Returns the bit-wise or of all values in xs. Each x in xs must be an integer."));
templatize_varop(env, JANET_FUN_BXOR, "bxor", 0, 0, JOP_BXOR,
JDOC("(bxor & xs)\n\n"
"Returns the bit-wise xor of all values in xs. Each in xs must be an integer."));
templatize_varop(env, JANET_FUN_LSHIFT, "blshift", 1, 1, JOP_SHIFT_LEFT,
JDOC("(blshift x & shifts)\n\n"
"Returns the value of x bit shifted left by the sum of all values in shifts. x "
"and each element in shift must be an integer."));
templatize_varop(env, JANET_FUN_RSHIFT, "brshift", 1, 1, JOP_SHIFT_RIGHT,
JDOC("(brshift x & shifts)\n\n"
"Returns the value of x bit shifted right by the sum of all values in shifts. x "
"and each element in shift must be an integer."));
templatize_varop(env, JANET_FUN_RSHIFTU, "brushift", 1, 1, JOP_SHIFT_RIGHT_UNSIGNED,
JDOC("(brushift x & shifts)\n\n"
"Returns the value of x bit shifted right by the sum of all values in shifts. x "
"and each element in shift must be an integer. The sign of x is not preserved, so "
"for positive shifts the return value will always be positive."));
/* Variadic comparators */
templatize_comparator(env, JANET_FUN_ORDER_GT, "order>", 0, JOP_GREATER_THAN,
JDOC("(order> & xs)\n\n"
"Check if xs is strictly descending according to a total order "
"over all values. Returns a boolean."));
templatize_comparator(env, JANET_FUN_ORDER_LT, "order<", 0, JOP_LESS_THAN,
JDOC("(order< & xs)\n\n"
"Check if xs is strictly increasing according to a total order "
"over all values. Returns a boolean."));
templatize_comparator(env, JANET_FUN_ORDER_GTE, "order>=", 1, JOP_LESS_THAN,
JDOC("(order>= & xs)\n\n"
"Check if xs is not increasing according to a total order "
"over all values. Returns a boolean."));
templatize_comparator(env, JANET_FUN_ORDER_LTE, "order<=", 1, JOP_GREATER_THAN,
JDOC("(order<= & xs)\n\n"
"Check if xs is not decreasing according to a total order "
"over all values. Returns a boolean."));
templatize_comparator(env, JANET_FUN_ORDER_EQ, "=", 0, JOP_EQUALS,
JDOC("(= & xs)\n\n"
"Returns true if all values in xs are the same, false otherwise."));
templatize_comparator(env, JANET_FUN_ORDER_NEQ, "not=", 1, JOP_EQUALS,
JDOC("(not= & xs)\n\n"
"Return true if any values in xs are not equal, otherwise false."));
templatize_comparator(env, JANET_FUN_GT, ">", 0, JOP_NUMERIC_GREATER_THAN,
JDOC("(> & xs)\n\n"
"Check if xs is in numerically descending order. Returns a boolean."));
templatize_comparator(env, JANET_FUN_LT, "<", 0, JOP_NUMERIC_LESS_THAN,
JDOC("(< & xs)\n\n"
"Check if xs is in numerically ascending order. Returns a boolean."));
templatize_comparator(env, JANET_FUN_GTE, ">=", 0, JOP_NUMERIC_GREATER_THAN_EQUAL,
JDOC("(>= & xs)\n\n"
"Check if xs is in numerically non-ascending order. Returns a boolean."));
templatize_comparator(env, JANET_FUN_LTE, "<=", 0, JOP_NUMERIC_LESS_THAN_EQUAL,
JDOC("(<= & xs)\n\n"
"Check if xs is in numerically non-descending order. Returns a boolean."));
templatize_comparator(env, JANET_FUN_EQ, "==", 0, JOP_NUMERIC_EQUAL,
JDOC("(== & xs)\n\n"
"Check if all values in xs are numerically equal (4.0 == 4). Returns a boolean."));
templatize_comparator(env, JANET_FUN_NEQ, "not==", 1, JOP_NUMERIC_EQUAL,
JDOC("(not== & xs)\n\n"
"Check if any values in xs are not numerically equal (3.0 not== 4). Returns a boolean."));
/* Platform detection */
janet_def(env, "janet/version", janet_cstringv(JANET_VERSION),
JDOC("The version number of the running janet program."));
janet_def(env, "janet/build", janet_cstringv(JANET_BUILD),
JDOC("The build identifier of the running janet program."));
/* Allow references to the environment */
janet_def(env, "_env", janet_wrap_table(env), JDOC("The environment table for the current scope."));
/* Set as gc root */
janet_gcroot(janet_wrap_table(env));
#endif
/* Load auxiliary envs */
janet_lib_io(env);
janet_lib_math(env);
janet_lib_array(env);
janet_lib_tuple(env);
janet_lib_buffer(env);
janet_lib_table(env);
janet_lib_fiber(env);
janet_lib_os(env);
janet_lib_parse(env);
janet_lib_compile(env);
janet_lib_debug(env);
janet_lib_string(env);
janet_lib_marsh(env);
#ifdef JANET_PEG
janet_lib_peg(env);
#endif
#ifdef JANET_ASSEMBLER
janet_lib_asm(env);
#endif
#ifdef JANET_BOOTSTRAP
/* Run bootstrap source */
janet_dobytes(env, janet_gen_core, janet_gen_core_size, "core.janet", NULL);
#else
/* Unmarshal from core image */
Janet marsh_out;
int status = janet_unmarshal(
janet_core_image,
janet_core_image_size,
0,
&marsh_out,
env,
NULL);
if (status) {
printf("error unmarshaling core image\n");
exit(1);
}
janet_gcroot(marsh_out);
env = janet_unwrap_table(marsh_out);
#endif
return env;
}
| 40.186785 | 120 | 0.605495 |
bd171a5a8fdcabca1d1dffcb34b7554512294dfd | 1,966 | h | C | Code/Editor/AssetImporter/AssetImporterManager/AssetImporterDragAndDropHandler.h | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 11 | 2021-07-08T09:58:26.000Z | 2022-03-17T17:59:26.000Z | Code/Editor/AssetImporter/AssetImporterManager/AssetImporterDragAndDropHandler.h | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | 29 | 2021-07-06T19:33:52.000Z | 2022-03-22T10:27:49.000Z | Code/Editor/AssetImporter/AssetImporterManager/AssetImporterDragAndDropHandler.h | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | 4 | 2021-07-06T19:24:43.000Z | 2022-03-31T12:42:27.000Z | /*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#if !defined(Q_MOC_RUN)
#include <QObject>
#include <QFileInfo>
#include <QString>
#include <AzCore/EBus/EBus.h>
#include <AzQtComponents/Buses/DragAndDrop.h>
#include <AzToolsFramework/API/AssetDatabaseBus.h>
#include <AzCore/std/smart_ptr/scoped_ptr.h>
#endif
class MainWindow;
class AssetImporterManager;
namespace AzToolsFramework
{
namespace AssetDatabase
{
class AssetDatabaseConnection;
}
}
class AssetImporterDragAndDropHandler
: public QObject
, public AzQtComponents::DragAndDropEventsBus::Handler
{
Q_OBJECT
public:
explicit AssetImporterDragAndDropHandler(QObject* parent, AssetImporterManager* const assetImporterManager);
~AssetImporterDragAndDropHandler();
void DragEnter(QDragEnterEvent* event, AzQtComponents::DragAndDropContextBase& context) override;
void Drop(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) override;
static void ProcessDragEnter(QDragEnterEvent* event);
static QStringList GetFileList(QDropEvent* event);
Q_SIGNALS:
void OpenAssetImporterManager(const QStringList& fileList);
public Q_SLOTS:
void OnStartAssetImporter();
void OnStopAssetImporter();
private:
bool m_isAssetImporterRunning = false;
AssetImporterManager* m_assetImporterManager;
static bool ContainCrateFiles(QString path);
static bool isCrateFile(QFileInfo fileInfo);
// it is used because MainWindow's dropEvent will ask the Ebus to call the Drop() function in AssetImporterDragAndDropHandler.
// That will cause the problem that even the crate objects are blocked by the DragEnter() in AssetImporterDragAndDropHandler,
// it will still open the Asset Importer
static bool m_dragAccepted;
};
| 28.085714 | 130 | 0.771617 |
bd4a82b28a2f468dfeb3d69b81409eda5a468da8 | 3,277 | c | C | algo/C/data_structures/heap/maxheap.c | you-know-who-2017/acmCompete | 5e43a58c3bf68e45c996131a9d6de6d0b9f45960 | [
"MIT"
] | null | null | null | algo/C/data_structures/heap/maxheap.c | you-know-who-2017/acmCompete | 5e43a58c3bf68e45c996131a9d6de6d0b9f45960 | [
"MIT"
] | null | null | null | algo/C/data_structures/heap/maxheap.c | you-know-who-2017/acmCompete | 5e43a58c3bf68e45c996131a9d6de6d0b9f45960 | [
"MIT"
] | null | null | null | #include<stdio.h>
#include<stdlib.h>
typedef struct max_heap{
int *p;
int size;
int count;
}Heap;
Heap* create_heap(Heap* heap); /*Creates a max_heap structure and returns a pointer to the struct*/
void down_heapify(Heap* heap, int index);/*Pushes an element downwards in the heap to find its correct position*/
void up_heapify(Heap* heap, int index);/*Pushes an element upwards in the heap to find its correct position*/
void push(Heap* heap, int x);/*Inserts an element in the heap*/
void pop(Heap* heap);/*Removes the top element from the heap*/
int top(Heap* heap);/*Returns the top element of the heap or returns INT_MIN if heap is empty*/
int empty(Heap* heap);/*Checks if heap is empty*/
int size(Heap* heap);/*Returns the size of heap*/
int main(){
Heap* head = create_heap(head);
push(head, 10);
printf("Pushing element : 10\n");
push(head, 3);
printf("Pushing element : 3\n");
push(head, 2);
printf("Pushing element : 2\n");
push(head, 8);
printf("Pushing element : 8\n");
printf("Top element = %d \n", top(head));
push(head, 1);
printf("Pushing element : 1\n");
push(head, 7);
printf("Pushing element : 7\n");
printf("Top element = %d \n", top(head));
pop(head);
printf("Popping an element.\n");
printf("Top element = %d \n", top(head));
pop(head);
printf("Popping an element.\n");
printf("Top element = %d \n", top(head));
printf("\n");
return 0;
}
Heap* create_heap(Heap* heap){
heap = (Heap *)malloc(sizeof(Heap));
heap->size = 1;
heap->p = (int *)malloc(heap->size*sizeof(int));
heap->count = 0;
}
void down_heapify(Heap* heap, int index){
if(index>=heap->count)return;
int left = index*2+1;
int right = index*2+2;
int leftflag = 0, rightflag = 0;
int maximum = *((heap->p)+index);
if(left<heap->count && maximum<*((heap->p)+left)){
maximum = *((heap->p)+left);
leftflag = 1;
}
if(right<heap->count && maximum<*((heap->p)+right)){
maximum = *((heap->p)+right);
leftflag = 0;
rightflag = 1;
}
if(leftflag){
*((heap->p)+left) = *((heap->p)+index);
*((heap->p)+index) = maximum;
down_heapify(heap, left);
}
if(rightflag){
*((heap->p)+right) = *((heap->p)+index);
*((heap->p)+index) = maximum;
down_heapify(heap, right);
}
}
void up_heapify(Heap* heap, int index){
int parent = (index-1)/2;
if(parent<0)return;
if(*((heap->p)+index)>*((heap->p)+parent)){
int temp = *((heap->p)+index);
*((heap->p)+index) = *((heap->p)+parent);
*((heap->p)+parent) = temp;
up_heapify(heap, parent);
}
}
void push(Heap* heap, int x){
if(heap->count>=heap->size)return;
*((heap->p)+heap->count) = x;
heap->count++;
if(4*heap->count >= 3*heap->size){
heap->size *= 2;
(heap->p) = (int *)realloc((heap->p), (heap->size)*sizeof(int));
}
up_heapify(heap, heap->count - 1);
}
void pop(Heap* heap){
if(heap->count==0)return;
heap->count--;
int temp = *((heap->p)+heap->count);
*((heap->p)+heap->count) = *(heap->p);
*(heap->p) = temp;
down_heapify(heap, 0);
if(4*heap->count<=heap->size){
heap->size /= 2;
(heap->p) = (int *)realloc((heap->p), (heap->size)*sizeof(int));
}
}
int top(Heap* heap){
if(heap->count!=0)return *(heap->p);
else return INT_MIN;
}
int empty(Heap* heap){
if(heap->count!=0)return 0;
else return 1;
}
int size(Heap* heap){
return heap->count;
}
| 26.860656 | 113 | 0.625572 |
08b32d929e03a560b6db33b924da5d5bcaeda0a2 | 1,758 | h | C | include/pbcopper/utility/OStreamRedirect.h | PacificBiosciences/pbcopper | ba98ddd79371c2218ca5110d07d5f881c995ff93 | [
"BSD-3-Clause-Clear"
] | 5 | 2018-01-15T13:40:30.000Z | 2021-01-19T18:28:30.000Z | include/pbcopper/utility/OStreamRedirect.h | PacificBiosciences/pbcopper | ba98ddd79371c2218ca5110d07d5f881c995ff93 | [
"BSD-3-Clause-Clear"
] | 4 | 2016-09-20T20:25:14.000Z | 2020-12-22T19:21:49.000Z | include/pbcopper/utility/OStreamRedirect.h | PacificBiosciences/pbcopper | ba98ddd79371c2218ca5110d07d5f881c995ff93 | [
"BSD-3-Clause-Clear"
] | 7 | 2017-05-15T08:47:02.000Z | 2021-04-28T18:38:09.000Z | #ifndef PBCOPPER_UTILITY_OSTREAMREDIRECT_H
#define PBCOPPER_UTILITY_OSTREAMREDIRECT_H
#include <pbcopper/PbcopperConfig.h>
#include <iostream>
#include <ostream>
#include <streambuf>
namespace PacBio {
namespace Utility {
// clang-format off
///
/// \internal
///
struct OStreamRedirectBase
{
public:
virtual ~OStreamRedirectBase() { s_.rdbuf(oldBuffer_); }
protected:
OStreamRedirectBase(std::ostream& o, std::streambuf* newBuffer)
: s_{o}, oldBuffer_{o.rdbuf()}
{
o.rdbuf(newBuffer);
}
private:
std::ostream& s_;
std::streambuf* oldBuffer_;
};
///
/// Redirect std::cout into the stream buffer provided. std::cout is restored on
/// CoutRedirect destruction.
///
/// \code
/// std::ostringstream stream;
/// {
/// Utility::CoutRedirect redirect{stream.rdbuf()};
///
/// // Anything normally written to std::cout in this scope will be
/// // written to stream instead.
/// }
/// \endcode
///
struct CoutRedirect : public OStreamRedirectBase
{
public:
CoutRedirect(std::streambuf* newBuffer)
: OStreamRedirectBase{std::cout, newBuffer}
{}
};
///
/// Redirect std::cerr into the stream buffer provided. std::cerr is restored on
/// CerrRedirect destruction.
///
/// \code
/// std::ostringstream stream;
/// {
/// Utility::CerrRedirect redirect{stream.rdbuf()};
///
/// // Anything normally written to std::cerr in this scope will be
/// // written to stream instead.
/// }
/// \endcode
///
struct CerrRedirect : public OStreamRedirectBase
{
public:
CerrRedirect(std::streambuf* newBuffer)
: OStreamRedirectBase{std::cerr, newBuffer}
{}
};
// clang-format on
} // namespace Utility
} // namespace PacBio
#endif // PBCOPPER_UTILITY_OSTREAMREDIRECT_H
| 20.682353 | 80 | 0.67463 |
ebee1ecaae5089d25702911f5e93be76afeb0612 | 2,396 | h | C | build projects/irr_include/IGUIComboBox.h | aggieblue92/IndigoFrost-Physics | 9cc35397ee5ee38a55d8d09d5038436edf26d5c1 | [
"MIT"
] | 30 | 2018-10-26T12:54:11.000Z | 2022-02-04T18:18:57.000Z | build projects/irr_include/IGUIComboBox.h | aggieblue92/IndigoFrost-Physics | 9cc35397ee5ee38a55d8d09d5038436edf26d5c1 | [
"MIT"
] | 8 | 2021-12-31T08:31:38.000Z | 2022-01-05T14:49:03.000Z | build projects/irr_include/IGUIComboBox.h | aggieblue92/IndigoFrost-Physics | 9cc35397ee5ee38a55d8d09d5038436edf26d5c1 | [
"MIT"
] | 26 | 2018-11-20T18:11:39.000Z | 2022-01-28T21:05:30.000Z | // Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_COMBO_BOX_H_INCLUDED__
#define __I_GUI_COMBO_BOX_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
//! Combobox widget
/** \par This element can create the following events of type EGUI_EVENT_TYPE:
\li EGET_COMBO_BOX_CHANGED
*/
class IGUIComboBox : public IGUIElement
{
public:
//! constructor
IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {}
//! Returns amount of items in box
virtual u32 getItemCount() const = 0;
//! Returns string of an item. the idx may be a value from 0 to itemCount-1
virtual const wchar_t* getItem(u32 idx) const = 0;
//! Returns item data of an item. the idx may be a value from 0 to itemCount-1
virtual u32 getItemData(u32 idx) const = 0;
//! Returns index based on item data
virtual s32 getIndexForItemData(u32 data ) const = 0;
//! Adds an item and returns the index of it
virtual u32 addItem(const wchar_t* text, u32 data = 0) = 0;
//! Removes an item from the combo box.
/** Warning. This will change the index of all following items */
virtual void removeItem(u32 idx) = 0;
//! Deletes all items in the combo box
virtual void clear() = 0;
//! Returns id of selected item. returns -1 if no item is selected.
virtual s32 getSelected() const = 0;
//! Sets the selected item. Set this to -1 if no item should be selected
virtual void setSelected(s32 idx) = 0;
//! Sets text justification of the text area
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
\param vertical: EGUIA_UPPERLEFT to align with top edge,
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
//! Set the maximal number of rows for the selection listbox
virtual void setMaxSelectionRows(u32 max) = 0;
//! Get the maximimal number of rows for the selection listbox
virtual u32 getMaxSelectionRows() const = 0;
};
} // end namespace gui
} // end namespace irr
#endif
| 31.946667 | 100 | 0.732471 |
0316025de945b19664c3d54845542ad34180359f | 716 | h | C | src/cuda_devices.h | faichele/manycore_info | 52f74b94f69502d6848c65c7367775a523f6566d | [
"CC0-1.0"
] | null | null | null | src/cuda_devices.h | faichele/manycore_info | 52f74b94f69502d6848c65c7367775a523f6566d | [
"CC0-1.0"
] | null | null | null | src/cuda_devices.h | faichele/manycore_info | 52f74b94f69502d6848c65c7367775a523f6566d | [
"CC0-1.0"
] | null | null | null | #pragma once
#include <cuda_runtime.h>
#include "helper_cuda.h"
#include <iostream>
#include <memory>
#include <string>
#if CUDART_VERSION < 5000
// CUDA-C includes
#include <cuda.h>
// This function wraps the CUDA Driver API into a template function
template <class T>
inline void getCudaAttribute(T *attribute, CUdevice_attribute device_attribute,
int device) {
CUresult error = cuDeviceGetAttribute(attribute, device_attribute, device);
if (CUDA_SUCCESS != error) {
fprintf(
stderr,
"cuSafeCallNoSync() Driver API error = %04d from file <%s>, line %i.\n",
error, __FILE__, __LINE__);
exit(EXIT_FAILURE);
}
}
#endif /* CUDART_VERSION < 5000 */
void cudaDevicesInfo(int argc, char** argv); | 21.69697 | 79 | 0.726257 |
eacac42ff1c21403b890993b48d140fef59fdcd3 | 6,443 | h | C | c/SketchUpAPI/geometry/transformation2d.h | amreus/sketchup-api-d-bindings | ab2b2065fd017deeb237c4fb6e2fc54a9a1e968b | [
"MIT"
] | 1 | 2015-11-05T20:54:25.000Z | 2015-11-05T20:54:25.000Z | c/SketchUpAPI/geometry/transformation2d.h | amreus/sketchup-api-d-bindings | ab2b2065fd017deeb237c4fb6e2fc54a9a1e968b | [
"MIT"
] | 1 | 2015-11-05T09:55:22.000Z | 2015-11-05T09:55:22.000Z | API/SketchUpAPI/geometry/transformation2d.h | moethu/SketchUpSharp | eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0 | [
"MIT"
] | null | null | null | // Copyright 2017 Trimble Inc., All rights reserved.
/**
* @file
* @brief Interfaces for SUTransformation2D.
*/
#ifndef SKETCHUP_GEOMETRY_TRANSFORMATION2D_H_
#define SKETCHUP_GEOMETRY_TRANSFORMATION2D_H_
#include <SketchUpAPI/geometry.h>
#pragma pack(push, 8)
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/**
@brief Creates a translation transformation using the given vector.
@since SketchUp 2019, API 7.0
@param[out] transform The transformation to be set.
@param[in] vector The 2D vector specifying the translation for the
transformation.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
- \ref SU_ERROR_NULL_POINTER_INPUT if vector is NULL
*/
SU_RESULT SUTransformation2DTranslation(struct SUTransformation2D* transform,
const struct SUVector2D* vector);
/**
@brief Creates a scale transformation using the given scale value.
@since SketchUp 2019, API 7.0
@param[out] transform The transformation to be set.
@param[in] scale The scale value for the transformation.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
*/
SU_RESULT SUTransformation2DScale(struct SUTransformation2D* transform,
double scale);
/**
@brief Creates a scale transformation using the given scale values.
@since SketchUp 2019, API 7.0
@param[out] transform The transformation to be set.
@param[in] x_scale The x-axis scale value for the transformation.
@param[in] y_scale The y-axis scale value for the transformation.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
- \ref SU_ERROR_NULL_POINTER_INPUT if x_scale or y_scale are NULL
*/
SU_RESULT SUTransformation2DNonUniformScale(struct SUTransformation2D* transform,
double x_scale,
double y_scale);
/**
@brief Creates a scale transformation using the given scale value and origin.
@since SketchUp 2019, API 7.0
@param[out] transform The transformation to be set.
@param[in] point The point specifying the translation component of the
transformation.
@param[in] scale The scale value for the transformation.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
- \ref SU_ERROR_NULL_POINTER_INPUT if point or scale are NULL
*/
SU_RESULT SUTransformation2DScaleAboutPoint(struct SUTransformation2D* transform,
const struct SUPoint2D* point,
double scale);
/**
@brief Creates a scale transformation using the given scale values and origin.
@since SketchUp 2019, API 7.0
@param[out] transform The transformation to be set.
@param[in] point The point specifying the translation component of the
transformation.
@param[in] x_scale The x-axis scale value for the transformation.
@param[in] y_scale The y-axis scale value for the transformation.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
- \ref SU_ERROR_NULL_POINTER_INPUT if point, x_scale, or y_scale are NULL
*/
SU_RESULT SUTransformation2DNonUniformScaleAboutPoint(
struct SUTransformation2D* transform,
const struct SUPoint2D* point,
double x_scale,
double y_scale);
/**
@brief Creates a transformation given a point and angle.
@since SketchUp 2019, API 7.0
@param[out] transform The calculated transformation.
@param[in] point The point specifying the translation component of the
transformation.
@param[in] angle The rotation in radians for the transformation.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_INPUT if transform is NULL
- \ref SU_ERROR_NULL_POINTER_OUTPUT if is_identity is NULL
- \ref SU_ERROR_OUT_OF_RANGE if weight is not between 0.0 and 1.0
*/
SU_RESULT SUTransformation2DRotation(struct SUTransformation2D* transform,
const struct SUPoint2D* point,
double angle);
/**
@brief Gets whether the transformation is an identity transformation.
@since SketchUp 2019, API 7.0
@param[in] transform The transformation object.
@param[out] is_identity Whether the transformation is identity.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_INPUT if transform is NULL
- \ref SU_ERROR_NULL_POINTER_OUTPUT if is_identity is NULL
*/
SU_RESULT SUTransformation2DIsIdentity(
const struct SUTransformation2D* transform,
bool* is_identity);
/**
@brief Gets the inverse transformation of the given transformation object.
@since SketchUp 2019, API 7.0
@param[in] transform The transformation object.
@param[out] inverse The inverse transformation object.
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
- \ref SU_ERROR_NULL_POINTER_INPUT if inverse is NULL
- \ref SU_ERROR_INVALID_ARGUMENT if the transform cannot be inverted
*/
SU_RESULT SUTransformation2DGetInverse(
const struct SUTransformation2D* transform,
struct SUTransformation2D* inverse);
/**
@brief Multiplies a transformation by another transformation.
@since SketchUp 2019, API 7.0
@param[in] transform1 The transformation object to be multiplied.
@param[in] transform2 The transformation object to multiply by.
@param[out] out_transform The result of the matrix multiplication
[transform1 * transform2].
@related SUTransformation2D
@return
- \ref SU_ERROR_NONE on success
- \ref SU_ERROR_NULL_POINTER_OUTPUT if out_transform is NULL
- \ref SU_ERROR_NULL_POINTER_INPUT if transform1 or transform2 are NULL
*/
SU_RESULT SUTransformation2DMultiply(const struct SUTransformation2D* transform1,
const struct SUTransformation2D* transform2,
struct SUTransformation2D* out_transform);
#ifdef __cplusplus
} // end extern "C"
#endif // __cplusplus
#pragma pack(pop)
#endif // SKETCHUP_GEOMETRY_TRANSFORMATION2D_H_ | 37.459302 | 81 | 0.734906 |
143d4853e51e1a7e25b07b331a28c08500ea8e39 | 389 | h | C | src/common/time_utils.h | voicevon/Arduino-FOC | a4f99990d7a120a2b0d3dfaaca9576b4f0d5656b | [
"MIT"
] | 845 | 2020-08-02T12:06:49.000Z | 2022-03-31T21:58:15.000Z | src/common/time_utils.h | voicevon/Arduino-FOC | a4f99990d7a120a2b0d3dfaaca9576b4f0d5656b | [
"MIT"
] | 140 | 2020-08-12T01:36:20.000Z | 2022-03-24T09:31:16.000Z | src/common/time_utils.h | voicevon/Arduino-FOC | a4f99990d7a120a2b0d3dfaaca9576b4f0d5656b | [
"MIT"
] | 226 | 2020-08-09T16:51:39.000Z | 2022-03-29T06:53:25.000Z | #ifndef TIME_UTILS_H
#define TIME_UTILS_H
#include "foc_utils.h"
/**
* Function implementing delay() function in milliseconds
* - blocking function
* - hardware specific
* @param ms number of milliseconds to wait
*/
void _delay(unsigned long ms);
/**
* Function implementing timestamp getting function in microseconds
* hardware specific
*/
unsigned long _micros();
#endif | 17.681818 | 67 | 0.737789 |
cab9bebd804a4dde0f60a0a08852b8cb28780b0b | 39,691 | c | C | src/graphemebreakdata.c | zengzhu/libunibreak | 5cab302e3c317ac5b98c4bc9959347cb38863b47 | [
"Zlib"
] | null | null | null | src/graphemebreakdata.c | zengzhu/libunibreak | 5cab302e3c317ac5b98c4bc9959347cb38863b47 | [
"Zlib"
] | null | null | null | src/graphemebreakdata.c | zengzhu/libunibreak | 5cab302e3c317ac5b98c4bc9959347cb38863b47 | [
"Zlib"
] | 1 | 2018-11-28T23:50:32.000Z | 2018-11-28T23:50:32.000Z | /* The content of this file is generated from:
# GraphemeBreakProperty-9.0.0.txt
# Date: 2016-06-03, 22:23:55 GMT
*/
#include "graphemebreakdef.h"
static const struct GraphemeBreakProperties gb_prop_default[] = {
{0x0000, 0x0009, GBP_Control},
{0x000A, 0x000A, GBP_LF},
{0x000B, 0x000C, GBP_Control},
{0x000D, 0x000D, GBP_CR},
{0x000E, 0x001F, GBP_Control},
{0x007F, 0x009F, GBP_Control},
{0x00AD, 0x00AD, GBP_Control},
{0x0300, 0x036F, GBP_Extend},
{0x0483, 0x0487, GBP_Extend},
{0x0488, 0x0489, GBP_Extend},
{0x0591, 0x05BD, GBP_Extend},
{0x05BF, 0x05BF, GBP_Extend},
{0x05C1, 0x05C2, GBP_Extend},
{0x05C4, 0x05C5, GBP_Extend},
{0x05C7, 0x05C7, GBP_Extend},
{0x0600, 0x0605, GBP_Prepend},
{0x0610, 0x061A, GBP_Extend},
{0x061C, 0x061C, GBP_Control},
{0x064B, 0x065F, GBP_Extend},
{0x0670, 0x0670, GBP_Extend},
{0x06D6, 0x06DC, GBP_Extend},
{0x06DD, 0x06DD, GBP_Prepend},
{0x06DF, 0x06E4, GBP_Extend},
{0x06E7, 0x06E8, GBP_Extend},
{0x06EA, 0x06ED, GBP_Extend},
{0x070F, 0x070F, GBP_Prepend},
{0x0711, 0x0711, GBP_Extend},
{0x0730, 0x074A, GBP_Extend},
{0x07A6, 0x07B0, GBP_Extend},
{0x07EB, 0x07F3, GBP_Extend},
{0x0816, 0x0819, GBP_Extend},
{0x081B, 0x0823, GBP_Extend},
{0x0825, 0x0827, GBP_Extend},
{0x0829, 0x082D, GBP_Extend},
{0x0859, 0x085B, GBP_Extend},
{0x08D4, 0x08E1, GBP_Extend},
{0x08E2, 0x08E2, GBP_Prepend},
{0x08E3, 0x0902, GBP_Extend},
{0x0903, 0x0903, GBP_SpacingMark},
{0x093A, 0x093A, GBP_Extend},
{0x093B, 0x093B, GBP_SpacingMark},
{0x093C, 0x093C, GBP_Extend},
{0x093E, 0x0940, GBP_SpacingMark},
{0x0941, 0x0948, GBP_Extend},
{0x0949, 0x094C, GBP_SpacingMark},
{0x094D, 0x094D, GBP_Extend},
{0x094E, 0x094F, GBP_SpacingMark},
{0x0951, 0x0957, GBP_Extend},
{0x0962, 0x0963, GBP_Extend},
{0x0981, 0x0981, GBP_Extend},
{0x0982, 0x0983, GBP_SpacingMark},
{0x09BC, 0x09BC, GBP_Extend},
{0x09BE, 0x09BE, GBP_Extend},
{0x09BF, 0x09C0, GBP_SpacingMark},
{0x09C1, 0x09C4, GBP_Extend},
{0x09C7, 0x09C8, GBP_SpacingMark},
{0x09CB, 0x09CC, GBP_SpacingMark},
{0x09CD, 0x09CD, GBP_Extend},
{0x09D7, 0x09D7, GBP_Extend},
{0x09E2, 0x09E3, GBP_Extend},
{0x0A01, 0x0A02, GBP_Extend},
{0x0A03, 0x0A03, GBP_SpacingMark},
{0x0A3C, 0x0A3C, GBP_Extend},
{0x0A3E, 0x0A40, GBP_SpacingMark},
{0x0A41, 0x0A42, GBP_Extend},
{0x0A47, 0x0A48, GBP_Extend},
{0x0A4B, 0x0A4D, GBP_Extend},
{0x0A51, 0x0A51, GBP_Extend},
{0x0A70, 0x0A71, GBP_Extend},
{0x0A75, 0x0A75, GBP_Extend},
{0x0A81, 0x0A82, GBP_Extend},
{0x0A83, 0x0A83, GBP_SpacingMark},
{0x0ABC, 0x0ABC, GBP_Extend},
{0x0ABE, 0x0AC0, GBP_SpacingMark},
{0x0AC1, 0x0AC5, GBP_Extend},
{0x0AC7, 0x0AC8, GBP_Extend},
{0x0AC9, 0x0AC9, GBP_SpacingMark},
{0x0ACB, 0x0ACC, GBP_SpacingMark},
{0x0ACD, 0x0ACD, GBP_Extend},
{0x0AE2, 0x0AE3, GBP_Extend},
{0x0B01, 0x0B01, GBP_Extend},
{0x0B02, 0x0B03, GBP_SpacingMark},
{0x0B3C, 0x0B3C, GBP_Extend},
{0x0B3E, 0x0B3E, GBP_Extend},
{0x0B3F, 0x0B3F, GBP_Extend},
{0x0B40, 0x0B40, GBP_SpacingMark},
{0x0B41, 0x0B44, GBP_Extend},
{0x0B47, 0x0B48, GBP_SpacingMark},
{0x0B4B, 0x0B4C, GBP_SpacingMark},
{0x0B4D, 0x0B4D, GBP_Extend},
{0x0B56, 0x0B56, GBP_Extend},
{0x0B57, 0x0B57, GBP_Extend},
{0x0B62, 0x0B63, GBP_Extend},
{0x0B82, 0x0B82, GBP_Extend},
{0x0BBE, 0x0BBE, GBP_Extend},
{0x0BBF, 0x0BBF, GBP_SpacingMark},
{0x0BC0, 0x0BC0, GBP_Extend},
{0x0BC1, 0x0BC2, GBP_SpacingMark},
{0x0BC6, 0x0BC8, GBP_SpacingMark},
{0x0BCA, 0x0BCC, GBP_SpacingMark},
{0x0BCD, 0x0BCD, GBP_Extend},
{0x0BD7, 0x0BD7, GBP_Extend},
{0x0C00, 0x0C00, GBP_Extend},
{0x0C01, 0x0C03, GBP_SpacingMark},
{0x0C3E, 0x0C40, GBP_Extend},
{0x0C41, 0x0C44, GBP_SpacingMark},
{0x0C46, 0x0C48, GBP_Extend},
{0x0C4A, 0x0C4D, GBP_Extend},
{0x0C55, 0x0C56, GBP_Extend},
{0x0C62, 0x0C63, GBP_Extend},
{0x0C81, 0x0C81, GBP_Extend},
{0x0C82, 0x0C83, GBP_SpacingMark},
{0x0CBC, 0x0CBC, GBP_Extend},
{0x0CBE, 0x0CBE, GBP_SpacingMark},
{0x0CBF, 0x0CBF, GBP_Extend},
{0x0CC0, 0x0CC1, GBP_SpacingMark},
{0x0CC2, 0x0CC2, GBP_Extend},
{0x0CC3, 0x0CC4, GBP_SpacingMark},
{0x0CC6, 0x0CC6, GBP_Extend},
{0x0CC7, 0x0CC8, GBP_SpacingMark},
{0x0CCA, 0x0CCB, GBP_SpacingMark},
{0x0CCC, 0x0CCD, GBP_Extend},
{0x0CD5, 0x0CD6, GBP_Extend},
{0x0CE2, 0x0CE3, GBP_Extend},
{0x0D01, 0x0D01, GBP_Extend},
{0x0D02, 0x0D03, GBP_SpacingMark},
{0x0D3E, 0x0D3E, GBP_Extend},
{0x0D3F, 0x0D40, GBP_SpacingMark},
{0x0D41, 0x0D44, GBP_Extend},
{0x0D46, 0x0D48, GBP_SpacingMark},
{0x0D4A, 0x0D4C, GBP_SpacingMark},
{0x0D4D, 0x0D4D, GBP_Extend},
{0x0D4E, 0x0D4E, GBP_Prepend},
{0x0D57, 0x0D57, GBP_Extend},
{0x0D62, 0x0D63, GBP_Extend},
{0x0D82, 0x0D83, GBP_SpacingMark},
{0x0DCA, 0x0DCA, GBP_Extend},
{0x0DCF, 0x0DCF, GBP_Extend},
{0x0DD0, 0x0DD1, GBP_SpacingMark},
{0x0DD2, 0x0DD4, GBP_Extend},
{0x0DD6, 0x0DD6, GBP_Extend},
{0x0DD8, 0x0DDE, GBP_SpacingMark},
{0x0DDF, 0x0DDF, GBP_Extend},
{0x0DF2, 0x0DF3, GBP_SpacingMark},
{0x0E31, 0x0E31, GBP_Extend},
{0x0E33, 0x0E33, GBP_SpacingMark},
{0x0E34, 0x0E3A, GBP_Extend},
{0x0E47, 0x0E4E, GBP_Extend},
{0x0EB1, 0x0EB1, GBP_Extend},
{0x0EB3, 0x0EB3, GBP_SpacingMark},
{0x0EB4, 0x0EB9, GBP_Extend},
{0x0EBB, 0x0EBC, GBP_Extend},
{0x0EC8, 0x0ECD, GBP_Extend},
{0x0F18, 0x0F19, GBP_Extend},
{0x0F35, 0x0F35, GBP_Extend},
{0x0F37, 0x0F37, GBP_Extend},
{0x0F39, 0x0F39, GBP_Extend},
{0x0F3E, 0x0F3F, GBP_SpacingMark},
{0x0F71, 0x0F7E, GBP_Extend},
{0x0F7F, 0x0F7F, GBP_SpacingMark},
{0x0F80, 0x0F84, GBP_Extend},
{0x0F86, 0x0F87, GBP_Extend},
{0x0F8D, 0x0F97, GBP_Extend},
{0x0F99, 0x0FBC, GBP_Extend},
{0x0FC6, 0x0FC6, GBP_Extend},
{0x102D, 0x1030, GBP_Extend},
{0x1031, 0x1031, GBP_SpacingMark},
{0x1032, 0x1037, GBP_Extend},
{0x1039, 0x103A, GBP_Extend},
{0x103B, 0x103C, GBP_SpacingMark},
{0x103D, 0x103E, GBP_Extend},
{0x1056, 0x1057, GBP_SpacingMark},
{0x1058, 0x1059, GBP_Extend},
{0x105E, 0x1060, GBP_Extend},
{0x1071, 0x1074, GBP_Extend},
{0x1082, 0x1082, GBP_Extend},
{0x1084, 0x1084, GBP_SpacingMark},
{0x1085, 0x1086, GBP_Extend},
{0x108D, 0x108D, GBP_Extend},
{0x109D, 0x109D, GBP_Extend},
{0x1100, 0x115F, GBP_L},
{0x1160, 0x11A7, GBP_V},
{0x11A8, 0x11FF, GBP_T},
{0x135D, 0x135F, GBP_Extend},
{0x1712, 0x1714, GBP_Extend},
{0x1732, 0x1734, GBP_Extend},
{0x1752, 0x1753, GBP_Extend},
{0x1772, 0x1773, GBP_Extend},
{0x17B4, 0x17B5, GBP_Extend},
{0x17B6, 0x17B6, GBP_SpacingMark},
{0x17B7, 0x17BD, GBP_Extend},
{0x17BE, 0x17C5, GBP_SpacingMark},
{0x17C6, 0x17C6, GBP_Extend},
{0x17C7, 0x17C8, GBP_SpacingMark},
{0x17C9, 0x17D3, GBP_Extend},
{0x17DD, 0x17DD, GBP_Extend},
{0x180B, 0x180D, GBP_Extend},
{0x180E, 0x180E, GBP_Control},
{0x1885, 0x1886, GBP_Extend},
{0x18A9, 0x18A9, GBP_Extend},
{0x1920, 0x1922, GBP_Extend},
{0x1923, 0x1926, GBP_SpacingMark},
{0x1927, 0x1928, GBP_Extend},
{0x1929, 0x192B, GBP_SpacingMark},
{0x1930, 0x1931, GBP_SpacingMark},
{0x1932, 0x1932, GBP_Extend},
{0x1933, 0x1938, GBP_SpacingMark},
{0x1939, 0x193B, GBP_Extend},
{0x1A17, 0x1A18, GBP_Extend},
{0x1A19, 0x1A1A, GBP_SpacingMark},
{0x1A1B, 0x1A1B, GBP_Extend},
{0x1A55, 0x1A55, GBP_SpacingMark},
{0x1A56, 0x1A56, GBP_Extend},
{0x1A57, 0x1A57, GBP_SpacingMark},
{0x1A58, 0x1A5E, GBP_Extend},
{0x1A60, 0x1A60, GBP_Extend},
{0x1A62, 0x1A62, GBP_Extend},
{0x1A65, 0x1A6C, GBP_Extend},
{0x1A6D, 0x1A72, GBP_SpacingMark},
{0x1A73, 0x1A7C, GBP_Extend},
{0x1A7F, 0x1A7F, GBP_Extend},
{0x1AB0, 0x1ABD, GBP_Extend},
{0x1ABE, 0x1ABE, GBP_Extend},
{0x1B00, 0x1B03, GBP_Extend},
{0x1B04, 0x1B04, GBP_SpacingMark},
{0x1B34, 0x1B34, GBP_Extend},
{0x1B35, 0x1B35, GBP_SpacingMark},
{0x1B36, 0x1B3A, GBP_Extend},
{0x1B3B, 0x1B3B, GBP_SpacingMark},
{0x1B3C, 0x1B3C, GBP_Extend},
{0x1B3D, 0x1B41, GBP_SpacingMark},
{0x1B42, 0x1B42, GBP_Extend},
{0x1B43, 0x1B44, GBP_SpacingMark},
{0x1B6B, 0x1B73, GBP_Extend},
{0x1B80, 0x1B81, GBP_Extend},
{0x1B82, 0x1B82, GBP_SpacingMark},
{0x1BA1, 0x1BA1, GBP_SpacingMark},
{0x1BA2, 0x1BA5, GBP_Extend},
{0x1BA6, 0x1BA7, GBP_SpacingMark},
{0x1BA8, 0x1BA9, GBP_Extend},
{0x1BAA, 0x1BAA, GBP_SpacingMark},
{0x1BAB, 0x1BAD, GBP_Extend},
{0x1BE6, 0x1BE6, GBP_Extend},
{0x1BE7, 0x1BE7, GBP_SpacingMark},
{0x1BE8, 0x1BE9, GBP_Extend},
{0x1BEA, 0x1BEC, GBP_SpacingMark},
{0x1BED, 0x1BED, GBP_Extend},
{0x1BEE, 0x1BEE, GBP_SpacingMark},
{0x1BEF, 0x1BF1, GBP_Extend},
{0x1BF2, 0x1BF3, GBP_SpacingMark},
{0x1C24, 0x1C2B, GBP_SpacingMark},
{0x1C2C, 0x1C33, GBP_Extend},
{0x1C34, 0x1C35, GBP_SpacingMark},
{0x1C36, 0x1C37, GBP_Extend},
{0x1CD0, 0x1CD2, GBP_Extend},
{0x1CD4, 0x1CE0, GBP_Extend},
{0x1CE1, 0x1CE1, GBP_SpacingMark},
{0x1CE2, 0x1CE8, GBP_Extend},
{0x1CED, 0x1CED, GBP_Extend},
{0x1CF2, 0x1CF3, GBP_SpacingMark},
{0x1CF4, 0x1CF4, GBP_Extend},
{0x1CF8, 0x1CF9, GBP_Extend},
{0x1DC0, 0x1DF5, GBP_Extend},
{0x1DFB, 0x1DFF, GBP_Extend},
{0x200B, 0x200B, GBP_Control},
{0x200C, 0x200C, GBP_Extend},
{0x200D, 0x200D, GBP_ZWJ},
{0x200E, 0x200F, GBP_Control},
{0x2028, 0x2028, GBP_Control},
{0x2029, 0x2029, GBP_Control},
{0x202A, 0x202E, GBP_Control},
{0x2060, 0x2064, GBP_Control},
{0x2065, 0x2065, GBP_Control},
{0x2066, 0x206F, GBP_Control},
{0x20D0, 0x20DC, GBP_Extend},
{0x20DD, 0x20E0, GBP_Extend},
{0x20E1, 0x20E1, GBP_Extend},
{0x20E2, 0x20E4, GBP_Extend},
{0x20E5, 0x20F0, GBP_Extend},
{0x261D, 0x261D, GBP_E_Base},
{0x26F9, 0x26F9, GBP_E_Base},
{0x270A, 0x270D, GBP_E_Base},
{0x2764, 0x2764, GBP_Glue_After_Zwj},
{0x2CEF, 0x2CF1, GBP_Extend},
{0x2D7F, 0x2D7F, GBP_Extend},
{0x2DE0, 0x2DFF, GBP_Extend},
{0x302A, 0x302D, GBP_Extend},
{0x302E, 0x302F, GBP_Extend},
{0x3099, 0x309A, GBP_Extend},
{0xA66F, 0xA66F, GBP_Extend},
{0xA670, 0xA672, GBP_Extend},
{0xA674, 0xA67D, GBP_Extend},
{0xA69E, 0xA69F, GBP_Extend},
{0xA6F0, 0xA6F1, GBP_Extend},
{0xA802, 0xA802, GBP_Extend},
{0xA806, 0xA806, GBP_Extend},
{0xA80B, 0xA80B, GBP_Extend},
{0xA823, 0xA824, GBP_SpacingMark},
{0xA825, 0xA826, GBP_Extend},
{0xA827, 0xA827, GBP_SpacingMark},
{0xA880, 0xA881, GBP_SpacingMark},
{0xA8B4, 0xA8C3, GBP_SpacingMark},
{0xA8C4, 0xA8C5, GBP_Extend},
{0xA8E0, 0xA8F1, GBP_Extend},
{0xA926, 0xA92D, GBP_Extend},
{0xA947, 0xA951, GBP_Extend},
{0xA952, 0xA953, GBP_SpacingMark},
{0xA960, 0xA97C, GBP_L},
{0xA980, 0xA982, GBP_Extend},
{0xA983, 0xA983, GBP_SpacingMark},
{0xA9B3, 0xA9B3, GBP_Extend},
{0xA9B4, 0xA9B5, GBP_SpacingMark},
{0xA9B6, 0xA9B9, GBP_Extend},
{0xA9BA, 0xA9BB, GBP_SpacingMark},
{0xA9BC, 0xA9BC, GBP_Extend},
{0xA9BD, 0xA9C0, GBP_SpacingMark},
{0xA9E5, 0xA9E5, GBP_Extend},
{0xAA29, 0xAA2E, GBP_Extend},
{0xAA2F, 0xAA30, GBP_SpacingMark},
{0xAA31, 0xAA32, GBP_Extend},
{0xAA33, 0xAA34, GBP_SpacingMark},
{0xAA35, 0xAA36, GBP_Extend},
{0xAA43, 0xAA43, GBP_Extend},
{0xAA4C, 0xAA4C, GBP_Extend},
{0xAA4D, 0xAA4D, GBP_SpacingMark},
{0xAA7C, 0xAA7C, GBP_Extend},
{0xAAB0, 0xAAB0, GBP_Extend},
{0xAAB2, 0xAAB4, GBP_Extend},
{0xAAB7, 0xAAB8, GBP_Extend},
{0xAABE, 0xAABF, GBP_Extend},
{0xAAC1, 0xAAC1, GBP_Extend},
{0xAAEB, 0xAAEB, GBP_SpacingMark},
{0xAAEC, 0xAAED, GBP_Extend},
{0xAAEE, 0xAAEF, GBP_SpacingMark},
{0xAAF5, 0xAAF5, GBP_SpacingMark},
{0xAAF6, 0xAAF6, GBP_Extend},
{0xABE3, 0xABE4, GBP_SpacingMark},
{0xABE5, 0xABE5, GBP_Extend},
{0xABE6, 0xABE7, GBP_SpacingMark},
{0xABE8, 0xABE8, GBP_Extend},
{0xABE9, 0xABEA, GBP_SpacingMark},
{0xABEC, 0xABEC, GBP_SpacingMark},
{0xABED, 0xABED, GBP_Extend},
{0xAC00, 0xAC00, GBP_LV},
{0xAC01, 0xAC1B, GBP_LVT},
{0xAC1C, 0xAC1C, GBP_LV},
{0xAC1D, 0xAC37, GBP_LVT},
{0xAC38, 0xAC38, GBP_LV},
{0xAC39, 0xAC53, GBP_LVT},
{0xAC54, 0xAC54, GBP_LV},
{0xAC55, 0xAC6F, GBP_LVT},
{0xAC70, 0xAC70, GBP_LV},
{0xAC71, 0xAC8B, GBP_LVT},
{0xAC8C, 0xAC8C, GBP_LV},
{0xAC8D, 0xACA7, GBP_LVT},
{0xACA8, 0xACA8, GBP_LV},
{0xACA9, 0xACC3, GBP_LVT},
{0xACC4, 0xACC4, GBP_LV},
{0xACC5, 0xACDF, GBP_LVT},
{0xACE0, 0xACE0, GBP_LV},
{0xACE1, 0xACFB, GBP_LVT},
{0xACFC, 0xACFC, GBP_LV},
{0xACFD, 0xAD17, GBP_LVT},
{0xAD18, 0xAD18, GBP_LV},
{0xAD19, 0xAD33, GBP_LVT},
{0xAD34, 0xAD34, GBP_LV},
{0xAD35, 0xAD4F, GBP_LVT},
{0xAD50, 0xAD50, GBP_LV},
{0xAD51, 0xAD6B, GBP_LVT},
{0xAD6C, 0xAD6C, GBP_LV},
{0xAD6D, 0xAD87, GBP_LVT},
{0xAD88, 0xAD88, GBP_LV},
{0xAD89, 0xADA3, GBP_LVT},
{0xADA4, 0xADA4, GBP_LV},
{0xADA5, 0xADBF, GBP_LVT},
{0xADC0, 0xADC0, GBP_LV},
{0xADC1, 0xADDB, GBP_LVT},
{0xADDC, 0xADDC, GBP_LV},
{0xADDD, 0xADF7, GBP_LVT},
{0xADF8, 0xADF8, GBP_LV},
{0xADF9, 0xAE13, GBP_LVT},
{0xAE14, 0xAE14, GBP_LV},
{0xAE15, 0xAE2F, GBP_LVT},
{0xAE30, 0xAE30, GBP_LV},
{0xAE31, 0xAE4B, GBP_LVT},
{0xAE4C, 0xAE4C, GBP_LV},
{0xAE4D, 0xAE67, GBP_LVT},
{0xAE68, 0xAE68, GBP_LV},
{0xAE69, 0xAE83, GBP_LVT},
{0xAE84, 0xAE84, GBP_LV},
{0xAE85, 0xAE9F, GBP_LVT},
{0xAEA0, 0xAEA0, GBP_LV},
{0xAEA1, 0xAEBB, GBP_LVT},
{0xAEBC, 0xAEBC, GBP_LV},
{0xAEBD, 0xAED7, GBP_LVT},
{0xAED8, 0xAED8, GBP_LV},
{0xAED9, 0xAEF3, GBP_LVT},
{0xAEF4, 0xAEF4, GBP_LV},
{0xAEF5, 0xAF0F, GBP_LVT},
{0xAF10, 0xAF10, GBP_LV},
{0xAF11, 0xAF2B, GBP_LVT},
{0xAF2C, 0xAF2C, GBP_LV},
{0xAF2D, 0xAF47, GBP_LVT},
{0xAF48, 0xAF48, GBP_LV},
{0xAF49, 0xAF63, GBP_LVT},
{0xAF64, 0xAF64, GBP_LV},
{0xAF65, 0xAF7F, GBP_LVT},
{0xAF80, 0xAF80, GBP_LV},
{0xAF81, 0xAF9B, GBP_LVT},
{0xAF9C, 0xAF9C, GBP_LV},
{0xAF9D, 0xAFB7, GBP_LVT},
{0xAFB8, 0xAFB8, GBP_LV},
{0xAFB9, 0xAFD3, GBP_LVT},
{0xAFD4, 0xAFD4, GBP_LV},
{0xAFD5, 0xAFEF, GBP_LVT},
{0xAFF0, 0xAFF0, GBP_LV},
{0xAFF1, 0xB00B, GBP_LVT},
{0xB00C, 0xB00C, GBP_LV},
{0xB00D, 0xB027, GBP_LVT},
{0xB028, 0xB028, GBP_LV},
{0xB029, 0xB043, GBP_LVT},
{0xB044, 0xB044, GBP_LV},
{0xB045, 0xB05F, GBP_LVT},
{0xB060, 0xB060, GBP_LV},
{0xB061, 0xB07B, GBP_LVT},
{0xB07C, 0xB07C, GBP_LV},
{0xB07D, 0xB097, GBP_LVT},
{0xB098, 0xB098, GBP_LV},
{0xB099, 0xB0B3, GBP_LVT},
{0xB0B4, 0xB0B4, GBP_LV},
{0xB0B5, 0xB0CF, GBP_LVT},
{0xB0D0, 0xB0D0, GBP_LV},
{0xB0D1, 0xB0EB, GBP_LVT},
{0xB0EC, 0xB0EC, GBP_LV},
{0xB0ED, 0xB107, GBP_LVT},
{0xB108, 0xB108, GBP_LV},
{0xB109, 0xB123, GBP_LVT},
{0xB124, 0xB124, GBP_LV},
{0xB125, 0xB13F, GBP_LVT},
{0xB140, 0xB140, GBP_LV},
{0xB141, 0xB15B, GBP_LVT},
{0xB15C, 0xB15C, GBP_LV},
{0xB15D, 0xB177, GBP_LVT},
{0xB178, 0xB178, GBP_LV},
{0xB179, 0xB193, GBP_LVT},
{0xB194, 0xB194, GBP_LV},
{0xB195, 0xB1AF, GBP_LVT},
{0xB1B0, 0xB1B0, GBP_LV},
{0xB1B1, 0xB1CB, GBP_LVT},
{0xB1CC, 0xB1CC, GBP_LV},
{0xB1CD, 0xB1E7, GBP_LVT},
{0xB1E8, 0xB1E8, GBP_LV},
{0xB1E9, 0xB203, GBP_LVT},
{0xB204, 0xB204, GBP_LV},
{0xB205, 0xB21F, GBP_LVT},
{0xB220, 0xB220, GBP_LV},
{0xB221, 0xB23B, GBP_LVT},
{0xB23C, 0xB23C, GBP_LV},
{0xB23D, 0xB257, GBP_LVT},
{0xB258, 0xB258, GBP_LV},
{0xB259, 0xB273, GBP_LVT},
{0xB274, 0xB274, GBP_LV},
{0xB275, 0xB28F, GBP_LVT},
{0xB290, 0xB290, GBP_LV},
{0xB291, 0xB2AB, GBP_LVT},
{0xB2AC, 0xB2AC, GBP_LV},
{0xB2AD, 0xB2C7, GBP_LVT},
{0xB2C8, 0xB2C8, GBP_LV},
{0xB2C9, 0xB2E3, GBP_LVT},
{0xB2E4, 0xB2E4, GBP_LV},
{0xB2E5, 0xB2FF, GBP_LVT},
{0xB300, 0xB300, GBP_LV},
{0xB301, 0xB31B, GBP_LVT},
{0xB31C, 0xB31C, GBP_LV},
{0xB31D, 0xB337, GBP_LVT},
{0xB338, 0xB338, GBP_LV},
{0xB339, 0xB353, GBP_LVT},
{0xB354, 0xB354, GBP_LV},
{0xB355, 0xB36F, GBP_LVT},
{0xB370, 0xB370, GBP_LV},
{0xB371, 0xB38B, GBP_LVT},
{0xB38C, 0xB38C, GBP_LV},
{0xB38D, 0xB3A7, GBP_LVT},
{0xB3A8, 0xB3A8, GBP_LV},
{0xB3A9, 0xB3C3, GBP_LVT},
{0xB3C4, 0xB3C4, GBP_LV},
{0xB3C5, 0xB3DF, GBP_LVT},
{0xB3E0, 0xB3E0, GBP_LV},
{0xB3E1, 0xB3FB, GBP_LVT},
{0xB3FC, 0xB3FC, GBP_LV},
{0xB3FD, 0xB417, GBP_LVT},
{0xB418, 0xB418, GBP_LV},
{0xB419, 0xB433, GBP_LVT},
{0xB434, 0xB434, GBP_LV},
{0xB435, 0xB44F, GBP_LVT},
{0xB450, 0xB450, GBP_LV},
{0xB451, 0xB46B, GBP_LVT},
{0xB46C, 0xB46C, GBP_LV},
{0xB46D, 0xB487, GBP_LVT},
{0xB488, 0xB488, GBP_LV},
{0xB489, 0xB4A3, GBP_LVT},
{0xB4A4, 0xB4A4, GBP_LV},
{0xB4A5, 0xB4BF, GBP_LVT},
{0xB4C0, 0xB4C0, GBP_LV},
{0xB4C1, 0xB4DB, GBP_LVT},
{0xB4DC, 0xB4DC, GBP_LV},
{0xB4DD, 0xB4F7, GBP_LVT},
{0xB4F8, 0xB4F8, GBP_LV},
{0xB4F9, 0xB513, GBP_LVT},
{0xB514, 0xB514, GBP_LV},
{0xB515, 0xB52F, GBP_LVT},
{0xB530, 0xB530, GBP_LV},
{0xB531, 0xB54B, GBP_LVT},
{0xB54C, 0xB54C, GBP_LV},
{0xB54D, 0xB567, GBP_LVT},
{0xB568, 0xB568, GBP_LV},
{0xB569, 0xB583, GBP_LVT},
{0xB584, 0xB584, GBP_LV},
{0xB585, 0xB59F, GBP_LVT},
{0xB5A0, 0xB5A0, GBP_LV},
{0xB5A1, 0xB5BB, GBP_LVT},
{0xB5BC, 0xB5BC, GBP_LV},
{0xB5BD, 0xB5D7, GBP_LVT},
{0xB5D8, 0xB5D8, GBP_LV},
{0xB5D9, 0xB5F3, GBP_LVT},
{0xB5F4, 0xB5F4, GBP_LV},
{0xB5F5, 0xB60F, GBP_LVT},
{0xB610, 0xB610, GBP_LV},
{0xB611, 0xB62B, GBP_LVT},
{0xB62C, 0xB62C, GBP_LV},
{0xB62D, 0xB647, GBP_LVT},
{0xB648, 0xB648, GBP_LV},
{0xB649, 0xB663, GBP_LVT},
{0xB664, 0xB664, GBP_LV},
{0xB665, 0xB67F, GBP_LVT},
{0xB680, 0xB680, GBP_LV},
{0xB681, 0xB69B, GBP_LVT},
{0xB69C, 0xB69C, GBP_LV},
{0xB69D, 0xB6B7, GBP_LVT},
{0xB6B8, 0xB6B8, GBP_LV},
{0xB6B9, 0xB6D3, GBP_LVT},
{0xB6D4, 0xB6D4, GBP_LV},
{0xB6D5, 0xB6EF, GBP_LVT},
{0xB6F0, 0xB6F0, GBP_LV},
{0xB6F1, 0xB70B, GBP_LVT},
{0xB70C, 0xB70C, GBP_LV},
{0xB70D, 0xB727, GBP_LVT},
{0xB728, 0xB728, GBP_LV},
{0xB729, 0xB743, GBP_LVT},
{0xB744, 0xB744, GBP_LV},
{0xB745, 0xB75F, GBP_LVT},
{0xB760, 0xB760, GBP_LV},
{0xB761, 0xB77B, GBP_LVT},
{0xB77C, 0xB77C, GBP_LV},
{0xB77D, 0xB797, GBP_LVT},
{0xB798, 0xB798, GBP_LV},
{0xB799, 0xB7B3, GBP_LVT},
{0xB7B4, 0xB7B4, GBP_LV},
{0xB7B5, 0xB7CF, GBP_LVT},
{0xB7D0, 0xB7D0, GBP_LV},
{0xB7D1, 0xB7EB, GBP_LVT},
{0xB7EC, 0xB7EC, GBP_LV},
{0xB7ED, 0xB807, GBP_LVT},
{0xB808, 0xB808, GBP_LV},
{0xB809, 0xB823, GBP_LVT},
{0xB824, 0xB824, GBP_LV},
{0xB825, 0xB83F, GBP_LVT},
{0xB840, 0xB840, GBP_LV},
{0xB841, 0xB85B, GBP_LVT},
{0xB85C, 0xB85C, GBP_LV},
{0xB85D, 0xB877, GBP_LVT},
{0xB878, 0xB878, GBP_LV},
{0xB879, 0xB893, GBP_LVT},
{0xB894, 0xB894, GBP_LV},
{0xB895, 0xB8AF, GBP_LVT},
{0xB8B0, 0xB8B0, GBP_LV},
{0xB8B1, 0xB8CB, GBP_LVT},
{0xB8CC, 0xB8CC, GBP_LV},
{0xB8CD, 0xB8E7, GBP_LVT},
{0xB8E8, 0xB8E8, GBP_LV},
{0xB8E9, 0xB903, GBP_LVT},
{0xB904, 0xB904, GBP_LV},
{0xB905, 0xB91F, GBP_LVT},
{0xB920, 0xB920, GBP_LV},
{0xB921, 0xB93B, GBP_LVT},
{0xB93C, 0xB93C, GBP_LV},
{0xB93D, 0xB957, GBP_LVT},
{0xB958, 0xB958, GBP_LV},
{0xB959, 0xB973, GBP_LVT},
{0xB974, 0xB974, GBP_LV},
{0xB975, 0xB98F, GBP_LVT},
{0xB990, 0xB990, GBP_LV},
{0xB991, 0xB9AB, GBP_LVT},
{0xB9AC, 0xB9AC, GBP_LV},
{0xB9AD, 0xB9C7, GBP_LVT},
{0xB9C8, 0xB9C8, GBP_LV},
{0xB9C9, 0xB9E3, GBP_LVT},
{0xB9E4, 0xB9E4, GBP_LV},
{0xB9E5, 0xB9FF, GBP_LVT},
{0xBA00, 0xBA00, GBP_LV},
{0xBA01, 0xBA1B, GBP_LVT},
{0xBA1C, 0xBA1C, GBP_LV},
{0xBA1D, 0xBA37, GBP_LVT},
{0xBA38, 0xBA38, GBP_LV},
{0xBA39, 0xBA53, GBP_LVT},
{0xBA54, 0xBA54, GBP_LV},
{0xBA55, 0xBA6F, GBP_LVT},
{0xBA70, 0xBA70, GBP_LV},
{0xBA71, 0xBA8B, GBP_LVT},
{0xBA8C, 0xBA8C, GBP_LV},
{0xBA8D, 0xBAA7, GBP_LVT},
{0xBAA8, 0xBAA8, GBP_LV},
{0xBAA9, 0xBAC3, GBP_LVT},
{0xBAC4, 0xBAC4, GBP_LV},
{0xBAC5, 0xBADF, GBP_LVT},
{0xBAE0, 0xBAE0, GBP_LV},
{0xBAE1, 0xBAFB, GBP_LVT},
{0xBAFC, 0xBAFC, GBP_LV},
{0xBAFD, 0xBB17, GBP_LVT},
{0xBB18, 0xBB18, GBP_LV},
{0xBB19, 0xBB33, GBP_LVT},
{0xBB34, 0xBB34, GBP_LV},
{0xBB35, 0xBB4F, GBP_LVT},
{0xBB50, 0xBB50, GBP_LV},
{0xBB51, 0xBB6B, GBP_LVT},
{0xBB6C, 0xBB6C, GBP_LV},
{0xBB6D, 0xBB87, GBP_LVT},
{0xBB88, 0xBB88, GBP_LV},
{0xBB89, 0xBBA3, GBP_LVT},
{0xBBA4, 0xBBA4, GBP_LV},
{0xBBA5, 0xBBBF, GBP_LVT},
{0xBBC0, 0xBBC0, GBP_LV},
{0xBBC1, 0xBBDB, GBP_LVT},
{0xBBDC, 0xBBDC, GBP_LV},
{0xBBDD, 0xBBF7, GBP_LVT},
{0xBBF8, 0xBBF8, GBP_LV},
{0xBBF9, 0xBC13, GBP_LVT},
{0xBC14, 0xBC14, GBP_LV},
{0xBC15, 0xBC2F, GBP_LVT},
{0xBC30, 0xBC30, GBP_LV},
{0xBC31, 0xBC4B, GBP_LVT},
{0xBC4C, 0xBC4C, GBP_LV},
{0xBC4D, 0xBC67, GBP_LVT},
{0xBC68, 0xBC68, GBP_LV},
{0xBC69, 0xBC83, GBP_LVT},
{0xBC84, 0xBC84, GBP_LV},
{0xBC85, 0xBC9F, GBP_LVT},
{0xBCA0, 0xBCA0, GBP_LV},
{0xBCA1, 0xBCBB, GBP_LVT},
{0xBCBC, 0xBCBC, GBP_LV},
{0xBCBD, 0xBCD7, GBP_LVT},
{0xBCD8, 0xBCD8, GBP_LV},
{0xBCD9, 0xBCF3, GBP_LVT},
{0xBCF4, 0xBCF4, GBP_LV},
{0xBCF5, 0xBD0F, GBP_LVT},
{0xBD10, 0xBD10, GBP_LV},
{0xBD11, 0xBD2B, GBP_LVT},
{0xBD2C, 0xBD2C, GBP_LV},
{0xBD2D, 0xBD47, GBP_LVT},
{0xBD48, 0xBD48, GBP_LV},
{0xBD49, 0xBD63, GBP_LVT},
{0xBD64, 0xBD64, GBP_LV},
{0xBD65, 0xBD7F, GBP_LVT},
{0xBD80, 0xBD80, GBP_LV},
{0xBD81, 0xBD9B, GBP_LVT},
{0xBD9C, 0xBD9C, GBP_LV},
{0xBD9D, 0xBDB7, GBP_LVT},
{0xBDB8, 0xBDB8, GBP_LV},
{0xBDB9, 0xBDD3, GBP_LVT},
{0xBDD4, 0xBDD4, GBP_LV},
{0xBDD5, 0xBDEF, GBP_LVT},
{0xBDF0, 0xBDF0, GBP_LV},
{0xBDF1, 0xBE0B, GBP_LVT},
{0xBE0C, 0xBE0C, GBP_LV},
{0xBE0D, 0xBE27, GBP_LVT},
{0xBE28, 0xBE28, GBP_LV},
{0xBE29, 0xBE43, GBP_LVT},
{0xBE44, 0xBE44, GBP_LV},
{0xBE45, 0xBE5F, GBP_LVT},
{0xBE60, 0xBE60, GBP_LV},
{0xBE61, 0xBE7B, GBP_LVT},
{0xBE7C, 0xBE7C, GBP_LV},
{0xBE7D, 0xBE97, GBP_LVT},
{0xBE98, 0xBE98, GBP_LV},
{0xBE99, 0xBEB3, GBP_LVT},
{0xBEB4, 0xBEB4, GBP_LV},
{0xBEB5, 0xBECF, GBP_LVT},
{0xBED0, 0xBED0, GBP_LV},
{0xBED1, 0xBEEB, GBP_LVT},
{0xBEEC, 0xBEEC, GBP_LV},
{0xBEED, 0xBF07, GBP_LVT},
{0xBF08, 0xBF08, GBP_LV},
{0xBF09, 0xBF23, GBP_LVT},
{0xBF24, 0xBF24, GBP_LV},
{0xBF25, 0xBF3F, GBP_LVT},
{0xBF40, 0xBF40, GBP_LV},
{0xBF41, 0xBF5B, GBP_LVT},
{0xBF5C, 0xBF5C, GBP_LV},
{0xBF5D, 0xBF77, GBP_LVT},
{0xBF78, 0xBF78, GBP_LV},
{0xBF79, 0xBF93, GBP_LVT},
{0xBF94, 0xBF94, GBP_LV},
{0xBF95, 0xBFAF, GBP_LVT},
{0xBFB0, 0xBFB0, GBP_LV},
{0xBFB1, 0xBFCB, GBP_LVT},
{0xBFCC, 0xBFCC, GBP_LV},
{0xBFCD, 0xBFE7, GBP_LVT},
{0xBFE8, 0xBFE8, GBP_LV},
{0xBFE9, 0xC003, GBP_LVT},
{0xC004, 0xC004, GBP_LV},
{0xC005, 0xC01F, GBP_LVT},
{0xC020, 0xC020, GBP_LV},
{0xC021, 0xC03B, GBP_LVT},
{0xC03C, 0xC03C, GBP_LV},
{0xC03D, 0xC057, GBP_LVT},
{0xC058, 0xC058, GBP_LV},
{0xC059, 0xC073, GBP_LVT},
{0xC074, 0xC074, GBP_LV},
{0xC075, 0xC08F, GBP_LVT},
{0xC090, 0xC090, GBP_LV},
{0xC091, 0xC0AB, GBP_LVT},
{0xC0AC, 0xC0AC, GBP_LV},
{0xC0AD, 0xC0C7, GBP_LVT},
{0xC0C8, 0xC0C8, GBP_LV},
{0xC0C9, 0xC0E3, GBP_LVT},
{0xC0E4, 0xC0E4, GBP_LV},
{0xC0E5, 0xC0FF, GBP_LVT},
{0xC100, 0xC100, GBP_LV},
{0xC101, 0xC11B, GBP_LVT},
{0xC11C, 0xC11C, GBP_LV},
{0xC11D, 0xC137, GBP_LVT},
{0xC138, 0xC138, GBP_LV},
{0xC139, 0xC153, GBP_LVT},
{0xC154, 0xC154, GBP_LV},
{0xC155, 0xC16F, GBP_LVT},
{0xC170, 0xC170, GBP_LV},
{0xC171, 0xC18B, GBP_LVT},
{0xC18C, 0xC18C, GBP_LV},
{0xC18D, 0xC1A7, GBP_LVT},
{0xC1A8, 0xC1A8, GBP_LV},
{0xC1A9, 0xC1C3, GBP_LVT},
{0xC1C4, 0xC1C4, GBP_LV},
{0xC1C5, 0xC1DF, GBP_LVT},
{0xC1E0, 0xC1E0, GBP_LV},
{0xC1E1, 0xC1FB, GBP_LVT},
{0xC1FC, 0xC1FC, GBP_LV},
{0xC1FD, 0xC217, GBP_LVT},
{0xC218, 0xC218, GBP_LV},
{0xC219, 0xC233, GBP_LVT},
{0xC234, 0xC234, GBP_LV},
{0xC235, 0xC24F, GBP_LVT},
{0xC250, 0xC250, GBP_LV},
{0xC251, 0xC26B, GBP_LVT},
{0xC26C, 0xC26C, GBP_LV},
{0xC26D, 0xC287, GBP_LVT},
{0xC288, 0xC288, GBP_LV},
{0xC289, 0xC2A3, GBP_LVT},
{0xC2A4, 0xC2A4, GBP_LV},
{0xC2A5, 0xC2BF, GBP_LVT},
{0xC2C0, 0xC2C0, GBP_LV},
{0xC2C1, 0xC2DB, GBP_LVT},
{0xC2DC, 0xC2DC, GBP_LV},
{0xC2DD, 0xC2F7, GBP_LVT},
{0xC2F8, 0xC2F8, GBP_LV},
{0xC2F9, 0xC313, GBP_LVT},
{0xC314, 0xC314, GBP_LV},
{0xC315, 0xC32F, GBP_LVT},
{0xC330, 0xC330, GBP_LV},
{0xC331, 0xC34B, GBP_LVT},
{0xC34C, 0xC34C, GBP_LV},
{0xC34D, 0xC367, GBP_LVT},
{0xC368, 0xC368, GBP_LV},
{0xC369, 0xC383, GBP_LVT},
{0xC384, 0xC384, GBP_LV},
{0xC385, 0xC39F, GBP_LVT},
{0xC3A0, 0xC3A0, GBP_LV},
{0xC3A1, 0xC3BB, GBP_LVT},
{0xC3BC, 0xC3BC, GBP_LV},
{0xC3BD, 0xC3D7, GBP_LVT},
{0xC3D8, 0xC3D8, GBP_LV},
{0xC3D9, 0xC3F3, GBP_LVT},
{0xC3F4, 0xC3F4, GBP_LV},
{0xC3F5, 0xC40F, GBP_LVT},
{0xC410, 0xC410, GBP_LV},
{0xC411, 0xC42B, GBP_LVT},
{0xC42C, 0xC42C, GBP_LV},
{0xC42D, 0xC447, GBP_LVT},
{0xC448, 0xC448, GBP_LV},
{0xC449, 0xC463, GBP_LVT},
{0xC464, 0xC464, GBP_LV},
{0xC465, 0xC47F, GBP_LVT},
{0xC480, 0xC480, GBP_LV},
{0xC481, 0xC49B, GBP_LVT},
{0xC49C, 0xC49C, GBP_LV},
{0xC49D, 0xC4B7, GBP_LVT},
{0xC4B8, 0xC4B8, GBP_LV},
{0xC4B9, 0xC4D3, GBP_LVT},
{0xC4D4, 0xC4D4, GBP_LV},
{0xC4D5, 0xC4EF, GBP_LVT},
{0xC4F0, 0xC4F0, GBP_LV},
{0xC4F1, 0xC50B, GBP_LVT},
{0xC50C, 0xC50C, GBP_LV},
{0xC50D, 0xC527, GBP_LVT},
{0xC528, 0xC528, GBP_LV},
{0xC529, 0xC543, GBP_LVT},
{0xC544, 0xC544, GBP_LV},
{0xC545, 0xC55F, GBP_LVT},
{0xC560, 0xC560, GBP_LV},
{0xC561, 0xC57B, GBP_LVT},
{0xC57C, 0xC57C, GBP_LV},
{0xC57D, 0xC597, GBP_LVT},
{0xC598, 0xC598, GBP_LV},
{0xC599, 0xC5B3, GBP_LVT},
{0xC5B4, 0xC5B4, GBP_LV},
{0xC5B5, 0xC5CF, GBP_LVT},
{0xC5D0, 0xC5D0, GBP_LV},
{0xC5D1, 0xC5EB, GBP_LVT},
{0xC5EC, 0xC5EC, GBP_LV},
{0xC5ED, 0xC607, GBP_LVT},
{0xC608, 0xC608, GBP_LV},
{0xC609, 0xC623, GBP_LVT},
{0xC624, 0xC624, GBP_LV},
{0xC625, 0xC63F, GBP_LVT},
{0xC640, 0xC640, GBP_LV},
{0xC641, 0xC65B, GBP_LVT},
{0xC65C, 0xC65C, GBP_LV},
{0xC65D, 0xC677, GBP_LVT},
{0xC678, 0xC678, GBP_LV},
{0xC679, 0xC693, GBP_LVT},
{0xC694, 0xC694, GBP_LV},
{0xC695, 0xC6AF, GBP_LVT},
{0xC6B0, 0xC6B0, GBP_LV},
{0xC6B1, 0xC6CB, GBP_LVT},
{0xC6CC, 0xC6CC, GBP_LV},
{0xC6CD, 0xC6E7, GBP_LVT},
{0xC6E8, 0xC6E8, GBP_LV},
{0xC6E9, 0xC703, GBP_LVT},
{0xC704, 0xC704, GBP_LV},
{0xC705, 0xC71F, GBP_LVT},
{0xC720, 0xC720, GBP_LV},
{0xC721, 0xC73B, GBP_LVT},
{0xC73C, 0xC73C, GBP_LV},
{0xC73D, 0xC757, GBP_LVT},
{0xC758, 0xC758, GBP_LV},
{0xC759, 0xC773, GBP_LVT},
{0xC774, 0xC774, GBP_LV},
{0xC775, 0xC78F, GBP_LVT},
{0xC790, 0xC790, GBP_LV},
{0xC791, 0xC7AB, GBP_LVT},
{0xC7AC, 0xC7AC, GBP_LV},
{0xC7AD, 0xC7C7, GBP_LVT},
{0xC7C8, 0xC7C8, GBP_LV},
{0xC7C9, 0xC7E3, GBP_LVT},
{0xC7E4, 0xC7E4, GBP_LV},
{0xC7E5, 0xC7FF, GBP_LVT},
{0xC800, 0xC800, GBP_LV},
{0xC801, 0xC81B, GBP_LVT},
{0xC81C, 0xC81C, GBP_LV},
{0xC81D, 0xC837, GBP_LVT},
{0xC838, 0xC838, GBP_LV},
{0xC839, 0xC853, GBP_LVT},
{0xC854, 0xC854, GBP_LV},
{0xC855, 0xC86F, GBP_LVT},
{0xC870, 0xC870, GBP_LV},
{0xC871, 0xC88B, GBP_LVT},
{0xC88C, 0xC88C, GBP_LV},
{0xC88D, 0xC8A7, GBP_LVT},
{0xC8A8, 0xC8A8, GBP_LV},
{0xC8A9, 0xC8C3, GBP_LVT},
{0xC8C4, 0xC8C4, GBP_LV},
{0xC8C5, 0xC8DF, GBP_LVT},
{0xC8E0, 0xC8E0, GBP_LV},
{0xC8E1, 0xC8FB, GBP_LVT},
{0xC8FC, 0xC8FC, GBP_LV},
{0xC8FD, 0xC917, GBP_LVT},
{0xC918, 0xC918, GBP_LV},
{0xC919, 0xC933, GBP_LVT},
{0xC934, 0xC934, GBP_LV},
{0xC935, 0xC94F, GBP_LVT},
{0xC950, 0xC950, GBP_LV},
{0xC951, 0xC96B, GBP_LVT},
{0xC96C, 0xC96C, GBP_LV},
{0xC96D, 0xC987, GBP_LVT},
{0xC988, 0xC988, GBP_LV},
{0xC989, 0xC9A3, GBP_LVT},
{0xC9A4, 0xC9A4, GBP_LV},
{0xC9A5, 0xC9BF, GBP_LVT},
{0xC9C0, 0xC9C0, GBP_LV},
{0xC9C1, 0xC9DB, GBP_LVT},
{0xC9DC, 0xC9DC, GBP_LV},
{0xC9DD, 0xC9F7, GBP_LVT},
{0xC9F8, 0xC9F8, GBP_LV},
{0xC9F9, 0xCA13, GBP_LVT},
{0xCA14, 0xCA14, GBP_LV},
{0xCA15, 0xCA2F, GBP_LVT},
{0xCA30, 0xCA30, GBP_LV},
{0xCA31, 0xCA4B, GBP_LVT},
{0xCA4C, 0xCA4C, GBP_LV},
{0xCA4D, 0xCA67, GBP_LVT},
{0xCA68, 0xCA68, GBP_LV},
{0xCA69, 0xCA83, GBP_LVT},
{0xCA84, 0xCA84, GBP_LV},
{0xCA85, 0xCA9F, GBP_LVT},
{0xCAA0, 0xCAA0, GBP_LV},
{0xCAA1, 0xCABB, GBP_LVT},
{0xCABC, 0xCABC, GBP_LV},
{0xCABD, 0xCAD7, GBP_LVT},
{0xCAD8, 0xCAD8, GBP_LV},
{0xCAD9, 0xCAF3, GBP_LVT},
{0xCAF4, 0xCAF4, GBP_LV},
{0xCAF5, 0xCB0F, GBP_LVT},
{0xCB10, 0xCB10, GBP_LV},
{0xCB11, 0xCB2B, GBP_LVT},
{0xCB2C, 0xCB2C, GBP_LV},
{0xCB2D, 0xCB47, GBP_LVT},
{0xCB48, 0xCB48, GBP_LV},
{0xCB49, 0xCB63, GBP_LVT},
{0xCB64, 0xCB64, GBP_LV},
{0xCB65, 0xCB7F, GBP_LVT},
{0xCB80, 0xCB80, GBP_LV},
{0xCB81, 0xCB9B, GBP_LVT},
{0xCB9C, 0xCB9C, GBP_LV},
{0xCB9D, 0xCBB7, GBP_LVT},
{0xCBB8, 0xCBB8, GBP_LV},
{0xCBB9, 0xCBD3, GBP_LVT},
{0xCBD4, 0xCBD4, GBP_LV},
{0xCBD5, 0xCBEF, GBP_LVT},
{0xCBF0, 0xCBF0, GBP_LV},
{0xCBF1, 0xCC0B, GBP_LVT},
{0xCC0C, 0xCC0C, GBP_LV},
{0xCC0D, 0xCC27, GBP_LVT},
{0xCC28, 0xCC28, GBP_LV},
{0xCC29, 0xCC43, GBP_LVT},
{0xCC44, 0xCC44, GBP_LV},
{0xCC45, 0xCC5F, GBP_LVT},
{0xCC60, 0xCC60, GBP_LV},
{0xCC61, 0xCC7B, GBP_LVT},
{0xCC7C, 0xCC7C, GBP_LV},
{0xCC7D, 0xCC97, GBP_LVT},
{0xCC98, 0xCC98, GBP_LV},
{0xCC99, 0xCCB3, GBP_LVT},
{0xCCB4, 0xCCB4, GBP_LV},
{0xCCB5, 0xCCCF, GBP_LVT},
{0xCCD0, 0xCCD0, GBP_LV},
{0xCCD1, 0xCCEB, GBP_LVT},
{0xCCEC, 0xCCEC, GBP_LV},
{0xCCED, 0xCD07, GBP_LVT},
{0xCD08, 0xCD08, GBP_LV},
{0xCD09, 0xCD23, GBP_LVT},
{0xCD24, 0xCD24, GBP_LV},
{0xCD25, 0xCD3F, GBP_LVT},
{0xCD40, 0xCD40, GBP_LV},
{0xCD41, 0xCD5B, GBP_LVT},
{0xCD5C, 0xCD5C, GBP_LV},
{0xCD5D, 0xCD77, GBP_LVT},
{0xCD78, 0xCD78, GBP_LV},
{0xCD79, 0xCD93, GBP_LVT},
{0xCD94, 0xCD94, GBP_LV},
{0xCD95, 0xCDAF, GBP_LVT},
{0xCDB0, 0xCDB0, GBP_LV},
{0xCDB1, 0xCDCB, GBP_LVT},
{0xCDCC, 0xCDCC, GBP_LV},
{0xCDCD, 0xCDE7, GBP_LVT},
{0xCDE8, 0xCDE8, GBP_LV},
{0xCDE9, 0xCE03, GBP_LVT},
{0xCE04, 0xCE04, GBP_LV},
{0xCE05, 0xCE1F, GBP_LVT},
{0xCE20, 0xCE20, GBP_LV},
{0xCE21, 0xCE3B, GBP_LVT},
{0xCE3C, 0xCE3C, GBP_LV},
{0xCE3D, 0xCE57, GBP_LVT},
{0xCE58, 0xCE58, GBP_LV},
{0xCE59, 0xCE73, GBP_LVT},
{0xCE74, 0xCE74, GBP_LV},
{0xCE75, 0xCE8F, GBP_LVT},
{0xCE90, 0xCE90, GBP_LV},
{0xCE91, 0xCEAB, GBP_LVT},
{0xCEAC, 0xCEAC, GBP_LV},
{0xCEAD, 0xCEC7, GBP_LVT},
{0xCEC8, 0xCEC8, GBP_LV},
{0xCEC9, 0xCEE3, GBP_LVT},
{0xCEE4, 0xCEE4, GBP_LV},
{0xCEE5, 0xCEFF, GBP_LVT},
{0xCF00, 0xCF00, GBP_LV},
{0xCF01, 0xCF1B, GBP_LVT},
{0xCF1C, 0xCF1C, GBP_LV},
{0xCF1D, 0xCF37, GBP_LVT},
{0xCF38, 0xCF38, GBP_LV},
{0xCF39, 0xCF53, GBP_LVT},
{0xCF54, 0xCF54, GBP_LV},
{0xCF55, 0xCF6F, GBP_LVT},
{0xCF70, 0xCF70, GBP_LV},
{0xCF71, 0xCF8B, GBP_LVT},
{0xCF8C, 0xCF8C, GBP_LV},
{0xCF8D, 0xCFA7, GBP_LVT},
{0xCFA8, 0xCFA8, GBP_LV},
{0xCFA9, 0xCFC3, GBP_LVT},
{0xCFC4, 0xCFC4, GBP_LV},
{0xCFC5, 0xCFDF, GBP_LVT},
{0xCFE0, 0xCFE0, GBP_LV},
{0xCFE1, 0xCFFB, GBP_LVT},
{0xCFFC, 0xCFFC, GBP_LV},
{0xCFFD, 0xD017, GBP_LVT},
{0xD018, 0xD018, GBP_LV},
{0xD019, 0xD033, GBP_LVT},
{0xD034, 0xD034, GBP_LV},
{0xD035, 0xD04F, GBP_LVT},
{0xD050, 0xD050, GBP_LV},
{0xD051, 0xD06B, GBP_LVT},
{0xD06C, 0xD06C, GBP_LV},
{0xD06D, 0xD087, GBP_LVT},
{0xD088, 0xD088, GBP_LV},
{0xD089, 0xD0A3, GBP_LVT},
{0xD0A4, 0xD0A4, GBP_LV},
{0xD0A5, 0xD0BF, GBP_LVT},
{0xD0C0, 0xD0C0, GBP_LV},
{0xD0C1, 0xD0DB, GBP_LVT},
{0xD0DC, 0xD0DC, GBP_LV},
{0xD0DD, 0xD0F7, GBP_LVT},
{0xD0F8, 0xD0F8, GBP_LV},
{0xD0F9, 0xD113, GBP_LVT},
{0xD114, 0xD114, GBP_LV},
{0xD115, 0xD12F, GBP_LVT},
{0xD130, 0xD130, GBP_LV},
{0xD131, 0xD14B, GBP_LVT},
{0xD14C, 0xD14C, GBP_LV},
{0xD14D, 0xD167, GBP_LVT},
{0xD168, 0xD168, GBP_LV},
{0xD169, 0xD183, GBP_LVT},
{0xD184, 0xD184, GBP_LV},
{0xD185, 0xD19F, GBP_LVT},
{0xD1A0, 0xD1A0, GBP_LV},
{0xD1A1, 0xD1BB, GBP_LVT},
{0xD1BC, 0xD1BC, GBP_LV},
{0xD1BD, 0xD1D7, GBP_LVT},
{0xD1D8, 0xD1D8, GBP_LV},
{0xD1D9, 0xD1F3, GBP_LVT},
{0xD1F4, 0xD1F4, GBP_LV},
{0xD1F5, 0xD20F, GBP_LVT},
{0xD210, 0xD210, GBP_LV},
{0xD211, 0xD22B, GBP_LVT},
{0xD22C, 0xD22C, GBP_LV},
{0xD22D, 0xD247, GBP_LVT},
{0xD248, 0xD248, GBP_LV},
{0xD249, 0xD263, GBP_LVT},
{0xD264, 0xD264, GBP_LV},
{0xD265, 0xD27F, GBP_LVT},
{0xD280, 0xD280, GBP_LV},
{0xD281, 0xD29B, GBP_LVT},
{0xD29C, 0xD29C, GBP_LV},
{0xD29D, 0xD2B7, GBP_LVT},
{0xD2B8, 0xD2B8, GBP_LV},
{0xD2B9, 0xD2D3, GBP_LVT},
{0xD2D4, 0xD2D4, GBP_LV},
{0xD2D5, 0xD2EF, GBP_LVT},
{0xD2F0, 0xD2F0, GBP_LV},
{0xD2F1, 0xD30B, GBP_LVT},
{0xD30C, 0xD30C, GBP_LV},
{0xD30D, 0xD327, GBP_LVT},
{0xD328, 0xD328, GBP_LV},
{0xD329, 0xD343, GBP_LVT},
{0xD344, 0xD344, GBP_LV},
{0xD345, 0xD35F, GBP_LVT},
{0xD360, 0xD360, GBP_LV},
{0xD361, 0xD37B, GBP_LVT},
{0xD37C, 0xD37C, GBP_LV},
{0xD37D, 0xD397, GBP_LVT},
{0xD398, 0xD398, GBP_LV},
{0xD399, 0xD3B3, GBP_LVT},
{0xD3B4, 0xD3B4, GBP_LV},
{0xD3B5, 0xD3CF, GBP_LVT},
{0xD3D0, 0xD3D0, GBP_LV},
{0xD3D1, 0xD3EB, GBP_LVT},
{0xD3EC, 0xD3EC, GBP_LV},
{0xD3ED, 0xD407, GBP_LVT},
{0xD408, 0xD408, GBP_LV},
{0xD409, 0xD423, GBP_LVT},
{0xD424, 0xD424, GBP_LV},
{0xD425, 0xD43F, GBP_LVT},
{0xD440, 0xD440, GBP_LV},
{0xD441, 0xD45B, GBP_LVT},
{0xD45C, 0xD45C, GBP_LV},
{0xD45D, 0xD477, GBP_LVT},
{0xD478, 0xD478, GBP_LV},
{0xD479, 0xD493, GBP_LVT},
{0xD494, 0xD494, GBP_LV},
{0xD495, 0xD4AF, GBP_LVT},
{0xD4B0, 0xD4B0, GBP_LV},
{0xD4B1, 0xD4CB, GBP_LVT},
{0xD4CC, 0xD4CC, GBP_LV},
{0xD4CD, 0xD4E7, GBP_LVT},
{0xD4E8, 0xD4E8, GBP_LV},
{0xD4E9, 0xD503, GBP_LVT},
{0xD504, 0xD504, GBP_LV},
{0xD505, 0xD51F, GBP_LVT},
{0xD520, 0xD520, GBP_LV},
{0xD521, 0xD53B, GBP_LVT},
{0xD53C, 0xD53C, GBP_LV},
{0xD53D, 0xD557, GBP_LVT},
{0xD558, 0xD558, GBP_LV},
{0xD559, 0xD573, GBP_LVT},
{0xD574, 0xD574, GBP_LV},
{0xD575, 0xD58F, GBP_LVT},
{0xD590, 0xD590, GBP_LV},
{0xD591, 0xD5AB, GBP_LVT},
{0xD5AC, 0xD5AC, GBP_LV},
{0xD5AD, 0xD5C7, GBP_LVT},
{0xD5C8, 0xD5C8, GBP_LV},
{0xD5C9, 0xD5E3, GBP_LVT},
{0xD5E4, 0xD5E4, GBP_LV},
{0xD5E5, 0xD5FF, GBP_LVT},
{0xD600, 0xD600, GBP_LV},
{0xD601, 0xD61B, GBP_LVT},
{0xD61C, 0xD61C, GBP_LV},
{0xD61D, 0xD637, GBP_LVT},
{0xD638, 0xD638, GBP_LV},
{0xD639, 0xD653, GBP_LVT},
{0xD654, 0xD654, GBP_LV},
{0xD655, 0xD66F, GBP_LVT},
{0xD670, 0xD670, GBP_LV},
{0xD671, 0xD68B, GBP_LVT},
{0xD68C, 0xD68C, GBP_LV},
{0xD68D, 0xD6A7, GBP_LVT},
{0xD6A8, 0xD6A8, GBP_LV},
{0xD6A9, 0xD6C3, GBP_LVT},
{0xD6C4, 0xD6C4, GBP_LV},
{0xD6C5, 0xD6DF, GBP_LVT},
{0xD6E0, 0xD6E0, GBP_LV},
{0xD6E1, 0xD6FB, GBP_LVT},
{0xD6FC, 0xD6FC, GBP_LV},
{0xD6FD, 0xD717, GBP_LVT},
{0xD718, 0xD718, GBP_LV},
{0xD719, 0xD733, GBP_LVT},
{0xD734, 0xD734, GBP_LV},
{0xD735, 0xD74F, GBP_LVT},
{0xD750, 0xD750, GBP_LV},
{0xD751, 0xD76B, GBP_LVT},
{0xD76C, 0xD76C, GBP_LV},
{0xD76D, 0xD787, GBP_LVT},
{0xD788, 0xD788, GBP_LV},
{0xD789, 0xD7A3, GBP_LVT},
{0xD7B0, 0xD7C6, GBP_V},
{0xD7CB, 0xD7FB, GBP_T},
{0xD800, 0xDFFF, GBP_Control},
{0xFB1E, 0xFB1E, GBP_Extend},
{0xFE00, 0xFE0F, GBP_Extend},
{0xFE20, 0xFE2F, GBP_Extend},
{0xFEFF, 0xFEFF, GBP_Control},
{0xFF9E, 0xFF9F, GBP_Extend},
{0xFFF0, 0xFFF8, GBP_Control},
{0xFFF9, 0xFFFB, GBP_Control},
{0x101FD, 0x101FD, GBP_Extend},
{0x102E0, 0x102E0, GBP_Extend},
{0x10376, 0x1037A, GBP_Extend},
{0x10A01, 0x10A03, GBP_Extend},
{0x10A05, 0x10A06, GBP_Extend},
{0x10A0C, 0x10A0F, GBP_Extend},
{0x10A38, 0x10A3A, GBP_Extend},
{0x10A3F, 0x10A3F, GBP_Extend},
{0x10AE5, 0x10AE6, GBP_Extend},
{0x11000, 0x11000, GBP_SpacingMark},
{0x11001, 0x11001, GBP_Extend},
{0x11002, 0x11002, GBP_SpacingMark},
{0x11038, 0x11046, GBP_Extend},
{0x1107F, 0x11081, GBP_Extend},
{0x11082, 0x11082, GBP_SpacingMark},
{0x110B0, 0x110B2, GBP_SpacingMark},
{0x110B3, 0x110B6, GBP_Extend},
{0x110B7, 0x110B8, GBP_SpacingMark},
{0x110B9, 0x110BA, GBP_Extend},
{0x110BD, 0x110BD, GBP_Prepend},
{0x11100, 0x11102, GBP_Extend},
{0x11127, 0x1112B, GBP_Extend},
{0x1112C, 0x1112C, GBP_SpacingMark},
{0x1112D, 0x11134, GBP_Extend},
{0x11173, 0x11173, GBP_Extend},
{0x11180, 0x11181, GBP_Extend},
{0x11182, 0x11182, GBP_SpacingMark},
{0x111B3, 0x111B5, GBP_SpacingMark},
{0x111B6, 0x111BE, GBP_Extend},
{0x111BF, 0x111C0, GBP_SpacingMark},
{0x111C2, 0x111C3, GBP_Prepend},
{0x111CA, 0x111CC, GBP_Extend},
{0x1122C, 0x1122E, GBP_SpacingMark},
{0x1122F, 0x11231, GBP_Extend},
{0x11232, 0x11233, GBP_SpacingMark},
{0x11234, 0x11234, GBP_Extend},
{0x11235, 0x11235, GBP_SpacingMark},
{0x11236, 0x11237, GBP_Extend},
{0x1123E, 0x1123E, GBP_Extend},
{0x112DF, 0x112DF, GBP_Extend},
{0x112E0, 0x112E2, GBP_SpacingMark},
{0x112E3, 0x112EA, GBP_Extend},
{0x11300, 0x11301, GBP_Extend},
{0x11302, 0x11303, GBP_SpacingMark},
{0x1133C, 0x1133C, GBP_Extend},
{0x1133E, 0x1133E, GBP_Extend},
{0x1133F, 0x1133F, GBP_SpacingMark},
{0x11340, 0x11340, GBP_Extend},
{0x11341, 0x11344, GBP_SpacingMark},
{0x11347, 0x11348, GBP_SpacingMark},
{0x1134B, 0x1134D, GBP_SpacingMark},
{0x11357, 0x11357, GBP_Extend},
{0x11362, 0x11363, GBP_SpacingMark},
{0x11366, 0x1136C, GBP_Extend},
{0x11370, 0x11374, GBP_Extend},
{0x11435, 0x11437, GBP_SpacingMark},
{0x11438, 0x1143F, GBP_Extend},
{0x11440, 0x11441, GBP_SpacingMark},
{0x11442, 0x11444, GBP_Extend},
{0x11445, 0x11445, GBP_SpacingMark},
{0x11446, 0x11446, GBP_Extend},
{0x114B0, 0x114B0, GBP_Extend},
{0x114B1, 0x114B2, GBP_SpacingMark},
{0x114B3, 0x114B8, GBP_Extend},
{0x114B9, 0x114B9, GBP_SpacingMark},
{0x114BA, 0x114BA, GBP_Extend},
{0x114BB, 0x114BC, GBP_SpacingMark},
{0x114BD, 0x114BD, GBP_Extend},
{0x114BE, 0x114BE, GBP_SpacingMark},
{0x114BF, 0x114C0, GBP_Extend},
{0x114C1, 0x114C1, GBP_SpacingMark},
{0x114C2, 0x114C3, GBP_Extend},
{0x115AF, 0x115AF, GBP_Extend},
{0x115B0, 0x115B1, GBP_SpacingMark},
{0x115B2, 0x115B5, GBP_Extend},
{0x115B8, 0x115BB, GBP_SpacingMark},
{0x115BC, 0x115BD, GBP_Extend},
{0x115BE, 0x115BE, GBP_SpacingMark},
{0x115BF, 0x115C0, GBP_Extend},
{0x115DC, 0x115DD, GBP_Extend},
{0x11630, 0x11632, GBP_SpacingMark},
{0x11633, 0x1163A, GBP_Extend},
{0x1163B, 0x1163C, GBP_SpacingMark},
{0x1163D, 0x1163D, GBP_Extend},
{0x1163E, 0x1163E, GBP_SpacingMark},
{0x1163F, 0x11640, GBP_Extend},
{0x116AB, 0x116AB, GBP_Extend},
{0x116AC, 0x116AC, GBP_SpacingMark},
{0x116AD, 0x116AD, GBP_Extend},
{0x116AE, 0x116AF, GBP_SpacingMark},
{0x116B0, 0x116B5, GBP_Extend},
{0x116B6, 0x116B6, GBP_SpacingMark},
{0x116B7, 0x116B7, GBP_Extend},
{0x1171D, 0x1171F, GBP_Extend},
{0x11720, 0x11721, GBP_SpacingMark},
{0x11722, 0x11725, GBP_Extend},
{0x11726, 0x11726, GBP_SpacingMark},
{0x11727, 0x1172B, GBP_Extend},
{0x11C2F, 0x11C2F, GBP_SpacingMark},
{0x11C30, 0x11C36, GBP_Extend},
{0x11C38, 0x11C3D, GBP_Extend},
{0x11C3E, 0x11C3E, GBP_SpacingMark},
{0x11C3F, 0x11C3F, GBP_Extend},
{0x11C92, 0x11CA7, GBP_Extend},
{0x11CA9, 0x11CA9, GBP_SpacingMark},
{0x11CAA, 0x11CB0, GBP_Extend},
{0x11CB1, 0x11CB1, GBP_SpacingMark},
{0x11CB2, 0x11CB3, GBP_Extend},
{0x11CB4, 0x11CB4, GBP_SpacingMark},
{0x11CB5, 0x11CB6, GBP_Extend},
{0x16AF0, 0x16AF4, GBP_Extend},
{0x16B30, 0x16B36, GBP_Extend},
{0x16F51, 0x16F7E, GBP_SpacingMark},
{0x16F8F, 0x16F92, GBP_Extend},
{0x1BC9D, 0x1BC9E, GBP_Extend},
{0x1BCA0, 0x1BCA3, GBP_Control},
{0x1D165, 0x1D165, GBP_Extend},
{0x1D166, 0x1D166, GBP_SpacingMark},
{0x1D167, 0x1D169, GBP_Extend},
{0x1D16D, 0x1D16D, GBP_SpacingMark},
{0x1D16E, 0x1D172, GBP_Extend},
{0x1D173, 0x1D17A, GBP_Control},
{0x1D17B, 0x1D182, GBP_Extend},
{0x1D185, 0x1D18B, GBP_Extend},
{0x1D1AA, 0x1D1AD, GBP_Extend},
{0x1D242, 0x1D244, GBP_Extend},
{0x1DA00, 0x1DA36, GBP_Extend},
{0x1DA3B, 0x1DA6C, GBP_Extend},
{0x1DA75, 0x1DA75, GBP_Extend},
{0x1DA84, 0x1DA84, GBP_Extend},
{0x1DA9B, 0x1DA9F, GBP_Extend},
{0x1DAA1, 0x1DAAF, GBP_Extend},
{0x1E000, 0x1E006, GBP_Extend},
{0x1E008, 0x1E018, GBP_Extend},
{0x1E01B, 0x1E021, GBP_Extend},
{0x1E023, 0x1E024, GBP_Extend},
{0x1E026, 0x1E02A, GBP_Extend},
{0x1E8D0, 0x1E8D6, GBP_Extend},
{0x1E944, 0x1E94A, GBP_Extend},
{0x1F1E6, 0x1F1FF, GBP_Regional_Indicator},
{0x1F385, 0x1F385, GBP_E_Base},
{0x1F3C3, 0x1F3C4, GBP_E_Base},
{0x1F3CA, 0x1F3CB, GBP_E_Base},
{0x1F3FB, 0x1F3FF, GBP_E_Modifier},
{0x1F442, 0x1F443, GBP_E_Base},
{0x1F446, 0x1F450, GBP_E_Base},
{0x1F466, 0x1F469, GBP_E_Base_GAZ},
{0x1F46E, 0x1F46E, GBP_E_Base},
{0x1F470, 0x1F478, GBP_E_Base},
{0x1F47C, 0x1F47C, GBP_E_Base},
{0x1F481, 0x1F483, GBP_E_Base},
{0x1F485, 0x1F487, GBP_E_Base},
{0x1F48B, 0x1F48B, GBP_Glue_After_Zwj},
{0x1F4AA, 0x1F4AA, GBP_E_Base},
{0x1F575, 0x1F575, GBP_E_Base},
{0x1F57A, 0x1F57A, GBP_E_Base},
{0x1F590, 0x1F590, GBP_E_Base},
{0x1F595, 0x1F596, GBP_E_Base},
{0x1F5E8, 0x1F5E8, GBP_Glue_After_Zwj},
{0x1F645, 0x1F647, GBP_E_Base},
{0x1F64B, 0x1F64F, GBP_E_Base},
{0x1F6A3, 0x1F6A3, GBP_E_Base},
{0x1F6B4, 0x1F6B6, GBP_E_Base},
{0x1F6C0, 0x1F6C0, GBP_E_Base},
{0x1F918, 0x1F91E, GBP_E_Base},
{0x1F926, 0x1F926, GBP_E_Base},
{0x1F930, 0x1F930, GBP_E_Base},
{0x1F933, 0x1F939, GBP_E_Base},
{0x1F93C, 0x1F93E, GBP_E_Base},
{0xE0000, 0xE0000, GBP_Control},
{0xE0001, 0xE0001, GBP_Control},
{0xE0002, 0xE001F, GBP_Control},
{0xE0020, 0xE007F, GBP_Extend},
{0xE0080, 0xE00FF, GBP_Control},
{0xE0100, 0xE01EF, GBP_Extend},
{0xE01F0, 0xE0FFF, GBP_Control},
{0xFFFFFFFF, 0xFFFFFFFF, GBP_Undefined}
};
| 29.664425 | 65 | 0.697488 |
1550f3baa84c275bb1cee1173f395b2d4afb9d05 | 773 | h | C | Warcraft Heroes Beyond Time/Warcraft Heroes Beyond Time/Thunder.h | SoftCactusTeam/Warcraft_Adventures | 7b44294d44094ce690abe90348dd87f42cdae07d | [
"MIT"
] | 9 | 2018-03-19T21:36:53.000Z | 2020-02-28T07:05:17.000Z | Warcraft Heroes Beyond Time/Warcraft Heroes Beyond Time/Thunder.h | SoftCactusTeam/Warcraft-Heroes-Beyond-Time | 7b44294d44094ce690abe90348dd87f42cdae07d | [
"MIT"
] | 87 | 2018-03-04T15:04:57.000Z | 2018-06-07T08:42:55.000Z | Warcraft Heroes Beyond Time/Warcraft Heroes Beyond Time/Thunder.h | SoftCactusTeam/Warcraft-Heroes-Beyond-Time | 7b44294d44094ce690abe90348dd87f42cdae07d | [
"MIT"
] | 2 | 2018-06-04T17:29:54.000Z | 2018-09-28T11:04:08.000Z | #ifndef __THUNDER_H__
#define __THUNDER_H__
#include "Projectile.h"
struct ThunderInfo : public ProjectileInfo
{
ThunderInfo() {};
ThunderInfo(const ThunderInfo& info) : ProjectileInfo((const ProjectileInfo&)info) {};
};
class Thunder : public Projectile
{
public:
Thunder(const ThunderInfo* info, Projectile_type type);
~Thunder();
bool Update(float dt);
bool Draw() const;
void OnCollision(Collider* yours, Collider* collideWith);
void OnCollisionContinue(Collider* yours, Collider* collideWith);
void OnCollisionLeave(Collider* yours, Collider* collideWith);
private:
ThunderInfo * toData = nullptr;
enum class ThunderAnimations
{
no_anim = -1,
cast,
max_anim
};
Animation thunderAnims[(unsigned int)ThunderAnimations::max_anim];
};
#endif | 19.325 | 87 | 0.752911 |
155f857e4572ede7b2fa9869df42c6bf0876e73e | 261 | h | C | include/il2cpp/Dpr/Battle/Logic/Handler/Item/GET_FUNC_TABLE_ELEM.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | 1 | 2022-01-15T20:20:27.000Z | 2022-01-15T20:20:27.000Z | include/il2cpp/Dpr/Battle/Logic/Handler/Item/GET_FUNC_TABLE_ELEM.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | include/il2cpp/Dpr/Battle/Logic/Handler/Item/GET_FUNC_TABLE_ELEM.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | #pragma once
#include "il2cpp.h"
void Dpr_Battle_Logic_Handler_Item_GET_FUNC_TABLE_ELEM___ctor (Dpr_Battle_Logic_Handler_Item_GET_FUNC_TABLE_ELEM_o __this, uint16_t itemno, Dpr_Battle_Logic_Handler_Item_HandlerGetFunc_o* func, const MethodInfo* method_info);
| 43.5 | 225 | 0.885057 |
767ebf7f63920378bbf506a8f7ae913e136478b7 | 4,012 | h | C | Libraries/LibCrypto/Cipher/Cipher.h | magicmarvman/serenity | f8489b4a697f441cbf53e5ac7d29e0716f238174 | [
"BSD-2-Clause"
] | 1 | 2021-01-07T18:48:01.000Z | 2021-01-07T18:48:01.000Z | Libraries/LibCrypto/Cipher/Cipher.h | magicmarvman/serenity | f8489b4a697f441cbf53e5ac7d29e0716f238174 | [
"BSD-2-Clause"
] | null | null | null | Libraries/LibCrypto/Cipher/Cipher.h | magicmarvman/serenity | f8489b4a697f441cbf53e5ac7d29e0716f238174 | [
"BSD-2-Clause"
] | null | null | null | /*
* Copyright (c) 2020, Ali Mohammad Pur <ali.mpfard@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE 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.
*/
#pragma once
#include <AK/ByteBuffer.h>
#include <AK/Optional.h>
#include <AK/Types.h>
namespace Crypto {
namespace Cipher {
enum class Intent {
Encryption,
Decryption,
};
enum class PaddingMode {
CMS, // RFC 1423
RFC5246, // very similar to CMS, but filled with |length - 1|, instead of |length|
Null,
// FIXME: We do not implement these yet
Bit,
Random,
Space,
ZeroLength,
};
template<typename B, typename T>
class Cipher;
struct CipherBlock {
public:
explicit CipherBlock(PaddingMode mode)
: m_padding_mode(mode)
{
}
static size_t block_size() { ASSERT_NOT_REACHED(); }
virtual ByteBuffer get() const = 0;
virtual const ByteBuffer& data() const = 0;
virtual void overwrite(const ByteBuffer&) = 0;
virtual void overwrite(const u8*, size_t) = 0;
virtual void apply_initialization_vector(const u8* ivec) = 0;
PaddingMode padding_mode() const { return m_padding_mode; }
template<typename T>
void put(size_t offset, T value)
{
ASSERT(offset + sizeof(T) <= data().size());
auto* ptr = data().data() + offset;
auto index { 0 };
ASSERT(sizeof(T) <= 4);
if constexpr (sizeof(T) > 3)
ptr[index++] = (u8)(value >> 24);
if constexpr (sizeof(T) > 2)
ptr[index++] = (u8)(value >> 16);
if constexpr (sizeof(T) > 1)
ptr[index++] = (u8)(value >> 8);
ptr[index] = (u8)value;
}
private:
virtual ByteBuffer& data() = 0;
PaddingMode m_padding_mode;
};
struct CipherKey {
virtual ByteBuffer data() const = 0;
static bool is_valid_key_size(size_t) { return false; };
virtual ~CipherKey() { }
protected:
virtual void expand_encrypt_key(const ByteBuffer& user_key, size_t bits) = 0;
virtual void expand_decrypt_key(const ByteBuffer& user_key, size_t bits) = 0;
size_t bits { 0 };
};
template<typename KeyT = CipherKey, typename BlockT = CipherBlock>
class Cipher {
public:
using KeyType = KeyT;
using BlockType = BlockT;
explicit Cipher<KeyT, BlockT>(PaddingMode mode)
: m_padding_mode(mode)
{
}
virtual const KeyType& key() const = 0;
virtual KeyType& key() = 0;
static size_t block_size() { return BlockType::block_size(); }
PaddingMode padding_mode() const { return m_padding_mode; }
virtual void encrypt_block(const BlockType& in, BlockType& out) = 0;
virtual void decrypt_block(const BlockType& in, BlockType& out) = 0;
virtual String class_name() const = 0;
private:
PaddingMode m_padding_mode;
};
}
}
| 28.453901 | 86 | 0.681705 |
bbbc5a82ce3b8f042e69d58adbe86cee58626a6a | 11,087 | h | C | extensions/third_party/perfetto/protos/perfetto/trace/ftrace/regulator.gen.h | blockspacer/chromium_base_conan | b4749433cf34f54d2edff52e2f0465fec8cb9bad | [
"Apache-2.0",
"BSD-3-Clause"
] | 6 | 2020-12-22T05:48:31.000Z | 2022-02-08T19:49:49.000Z | extensions/third_party/perfetto/protos/perfetto/trace/ftrace/regulator.gen.h | blockspacer/chromium_base_conan | b4749433cf34f54d2edff52e2f0465fec8cb9bad | [
"Apache-2.0",
"BSD-3-Clause"
] | 4 | 2020-05-22T18:36:43.000Z | 2021-05-19T10:20:23.000Z | extensions/third_party/perfetto/protos/perfetto/trace/ftrace/regulator.gen.h | blockspacer/chromium_base_conan | b4749433cf34f54d2edff52e2f0465fec8cb9bad | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-12-06T11:48:16.000Z | 2021-09-16T04:44:47.000Z | // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_REGULATOR_PROTO_CPP_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_REGULATOR_PROTO_CPP_H_
#include <stdint.h>
#include <bitset>
#include <vector>
#include <string>
#include <type_traits>
#include "perfetto/protozero/cpp_message_obj.h"
#include "perfetto/protozero/copyable_ptr.h"
#include "perfetto/base/export.h"
namespace perfetto {
namespace protos {
namespace gen {
class RegulatorSetVoltageCompleteFtraceEvent;
class RegulatorSetVoltageFtraceEvent;
class RegulatorEnableDelayFtraceEvent;
class RegulatorEnableCompleteFtraceEvent;
class RegulatorEnableFtraceEvent;
class RegulatorDisableCompleteFtraceEvent;
class RegulatorDisableFtraceEvent;
} // namespace perfetto
} // namespace protos
} // namespace gen
namespace protozero {
class Message;
} // namespace protozero
namespace perfetto {
namespace protos {
namespace gen {
class PERFETTO_EXPORT RegulatorSetVoltageCompleteFtraceEvent : public ::protozero::CppMessageObj {
public:
enum FieldNumbers {
kNameFieldNumber = 1,
kValFieldNumber = 2,
};
RegulatorSetVoltageCompleteFtraceEvent();
~RegulatorSetVoltageCompleteFtraceEvent() override;
RegulatorSetVoltageCompleteFtraceEvent(RegulatorSetVoltageCompleteFtraceEvent&&) noexcept;
RegulatorSetVoltageCompleteFtraceEvent& operator=(RegulatorSetVoltageCompleteFtraceEvent&&);
RegulatorSetVoltageCompleteFtraceEvent(const RegulatorSetVoltageCompleteFtraceEvent&);
RegulatorSetVoltageCompleteFtraceEvent& operator=(const RegulatorSetVoltageCompleteFtraceEvent&);
bool operator==(const RegulatorSetVoltageCompleteFtraceEvent&) const;
bool operator!=(const RegulatorSetVoltageCompleteFtraceEvent& other) const { return !(*this == other); }
bool ParseFromArray(const void*, size_t) override;
std::string SerializeAsString() const override;
std::vector<uint8_t> SerializeAsArray() const override;
void Serialize(::protozero::Message*) const;
bool has_name() const { return _has_field_[1]; }
const std::string& name() const { return name_; }
void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
bool has_val() const { return _has_field_[2]; }
uint32_t val() const { return val_; }
void set_val(uint32_t value) { val_ = value; _has_field_.set(2); }
private:
std::string name_{};
uint32_t val_{};
// Allows to preserve unknown protobuf fields for compatibility
// with future versions of .proto files.
std::string unknown_fields_;
std::bitset<3> _has_field_{};
};
class PERFETTO_EXPORT RegulatorSetVoltageFtraceEvent : public ::protozero::CppMessageObj {
public:
enum FieldNumbers {
kNameFieldNumber = 1,
kMinFieldNumber = 2,
kMaxFieldNumber = 3,
};
RegulatorSetVoltageFtraceEvent();
~RegulatorSetVoltageFtraceEvent() override;
RegulatorSetVoltageFtraceEvent(RegulatorSetVoltageFtraceEvent&&) noexcept;
RegulatorSetVoltageFtraceEvent& operator=(RegulatorSetVoltageFtraceEvent&&);
RegulatorSetVoltageFtraceEvent(const RegulatorSetVoltageFtraceEvent&);
RegulatorSetVoltageFtraceEvent& operator=(const RegulatorSetVoltageFtraceEvent&);
bool operator==(const RegulatorSetVoltageFtraceEvent&) const;
bool operator!=(const RegulatorSetVoltageFtraceEvent& other) const { return !(*this == other); }
bool ParseFromArray(const void*, size_t) override;
std::string SerializeAsString() const override;
std::vector<uint8_t> SerializeAsArray() const override;
void Serialize(::protozero::Message*) const;
bool has_name() const { return _has_field_[1]; }
const std::string& name() const { return name_; }
void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
bool has_min() const { return _has_field_[2]; }
int32_t min() const { return min_; }
void set_min(int32_t value) { min_ = value; _has_field_.set(2); }
bool has_max() const { return _has_field_[3]; }
int32_t max() const { return max_; }
void set_max(int32_t value) { max_ = value; _has_field_.set(3); }
private:
std::string name_{};
int32_t min_{};
int32_t max_{};
// Allows to preserve unknown protobuf fields for compatibility
// with future versions of .proto files.
std::string unknown_fields_;
std::bitset<4> _has_field_{};
};
class PERFETTO_EXPORT RegulatorEnableDelayFtraceEvent : public ::protozero::CppMessageObj {
public:
enum FieldNumbers {
kNameFieldNumber = 1,
};
RegulatorEnableDelayFtraceEvent();
~RegulatorEnableDelayFtraceEvent() override;
RegulatorEnableDelayFtraceEvent(RegulatorEnableDelayFtraceEvent&&) noexcept;
RegulatorEnableDelayFtraceEvent& operator=(RegulatorEnableDelayFtraceEvent&&);
RegulatorEnableDelayFtraceEvent(const RegulatorEnableDelayFtraceEvent&);
RegulatorEnableDelayFtraceEvent& operator=(const RegulatorEnableDelayFtraceEvent&);
bool operator==(const RegulatorEnableDelayFtraceEvent&) const;
bool operator!=(const RegulatorEnableDelayFtraceEvent& other) const { return !(*this == other); }
bool ParseFromArray(const void*, size_t) override;
std::string SerializeAsString() const override;
std::vector<uint8_t> SerializeAsArray() const override;
void Serialize(::protozero::Message*) const;
bool has_name() const { return _has_field_[1]; }
const std::string& name() const { return name_; }
void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
private:
std::string name_{};
// Allows to preserve unknown protobuf fields for compatibility
// with future versions of .proto files.
std::string unknown_fields_;
std::bitset<2> _has_field_{};
};
class PERFETTO_EXPORT RegulatorEnableCompleteFtraceEvent : public ::protozero::CppMessageObj {
public:
enum FieldNumbers {
kNameFieldNumber = 1,
};
RegulatorEnableCompleteFtraceEvent();
~RegulatorEnableCompleteFtraceEvent() override;
RegulatorEnableCompleteFtraceEvent(RegulatorEnableCompleteFtraceEvent&&) noexcept;
RegulatorEnableCompleteFtraceEvent& operator=(RegulatorEnableCompleteFtraceEvent&&);
RegulatorEnableCompleteFtraceEvent(const RegulatorEnableCompleteFtraceEvent&);
RegulatorEnableCompleteFtraceEvent& operator=(const RegulatorEnableCompleteFtraceEvent&);
bool operator==(const RegulatorEnableCompleteFtraceEvent&) const;
bool operator!=(const RegulatorEnableCompleteFtraceEvent& other) const { return !(*this == other); }
bool ParseFromArray(const void*, size_t) override;
std::string SerializeAsString() const override;
std::vector<uint8_t> SerializeAsArray() const override;
void Serialize(::protozero::Message*) const;
bool has_name() const { return _has_field_[1]; }
const std::string& name() const { return name_; }
void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
private:
std::string name_{};
// Allows to preserve unknown protobuf fields for compatibility
// with future versions of .proto files.
std::string unknown_fields_;
std::bitset<2> _has_field_{};
};
class PERFETTO_EXPORT RegulatorEnableFtraceEvent : public ::protozero::CppMessageObj {
public:
enum FieldNumbers {
kNameFieldNumber = 1,
};
RegulatorEnableFtraceEvent();
~RegulatorEnableFtraceEvent() override;
RegulatorEnableFtraceEvent(RegulatorEnableFtraceEvent&&) noexcept;
RegulatorEnableFtraceEvent& operator=(RegulatorEnableFtraceEvent&&);
RegulatorEnableFtraceEvent(const RegulatorEnableFtraceEvent&);
RegulatorEnableFtraceEvent& operator=(const RegulatorEnableFtraceEvent&);
bool operator==(const RegulatorEnableFtraceEvent&) const;
bool operator!=(const RegulatorEnableFtraceEvent& other) const { return !(*this == other); }
bool ParseFromArray(const void*, size_t) override;
std::string SerializeAsString() const override;
std::vector<uint8_t> SerializeAsArray() const override;
void Serialize(::protozero::Message*) const;
bool has_name() const { return _has_field_[1]; }
const std::string& name() const { return name_; }
void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
private:
std::string name_{};
// Allows to preserve unknown protobuf fields for compatibility
// with future versions of .proto files.
std::string unknown_fields_;
std::bitset<2> _has_field_{};
};
class PERFETTO_EXPORT RegulatorDisableCompleteFtraceEvent : public ::protozero::CppMessageObj {
public:
enum FieldNumbers {
kNameFieldNumber = 1,
};
RegulatorDisableCompleteFtraceEvent();
~RegulatorDisableCompleteFtraceEvent() override;
RegulatorDisableCompleteFtraceEvent(RegulatorDisableCompleteFtraceEvent&&) noexcept;
RegulatorDisableCompleteFtraceEvent& operator=(RegulatorDisableCompleteFtraceEvent&&);
RegulatorDisableCompleteFtraceEvent(const RegulatorDisableCompleteFtraceEvent&);
RegulatorDisableCompleteFtraceEvent& operator=(const RegulatorDisableCompleteFtraceEvent&);
bool operator==(const RegulatorDisableCompleteFtraceEvent&) const;
bool operator!=(const RegulatorDisableCompleteFtraceEvent& other) const { return !(*this == other); }
bool ParseFromArray(const void*, size_t) override;
std::string SerializeAsString() const override;
std::vector<uint8_t> SerializeAsArray() const override;
void Serialize(::protozero::Message*) const;
bool has_name() const { return _has_field_[1]; }
const std::string& name() const { return name_; }
void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
private:
std::string name_{};
// Allows to preserve unknown protobuf fields for compatibility
// with future versions of .proto files.
std::string unknown_fields_;
std::bitset<2> _has_field_{};
};
class PERFETTO_EXPORT RegulatorDisableFtraceEvent : public ::protozero::CppMessageObj {
public:
enum FieldNumbers {
kNameFieldNumber = 1,
};
RegulatorDisableFtraceEvent();
~RegulatorDisableFtraceEvent() override;
RegulatorDisableFtraceEvent(RegulatorDisableFtraceEvent&&) noexcept;
RegulatorDisableFtraceEvent& operator=(RegulatorDisableFtraceEvent&&);
RegulatorDisableFtraceEvent(const RegulatorDisableFtraceEvent&);
RegulatorDisableFtraceEvent& operator=(const RegulatorDisableFtraceEvent&);
bool operator==(const RegulatorDisableFtraceEvent&) const;
bool operator!=(const RegulatorDisableFtraceEvent& other) const { return !(*this == other); }
bool ParseFromArray(const void*, size_t) override;
std::string SerializeAsString() const override;
std::vector<uint8_t> SerializeAsArray() const override;
void Serialize(::protozero::Message*) const;
bool has_name() const { return _has_field_[1]; }
const std::string& name() const { return name_; }
void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
private:
std::string name_{};
// Allows to preserve unknown protobuf fields for compatibility
// with future versions of .proto files.
std::string unknown_fields_;
std::bitset<2> _has_field_{};
};
} // namespace perfetto
} // namespace protos
} // namespace gen
#endif // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_REGULATOR_PROTO_CPP_H_
| 36.470395 | 106 | 0.773338 |
496d6c8c3f067b2fd7614c836d68061bb4db8d67 | 15,355 | c | C | swish-e-2.4.7/src/libtest.c | uddhab/swish-e | 47011e47f45ec34c807ab6bd9c14e3b4ee236bea | [
"MIT"
] | 6 | 2017-02-09T23:06:34.000Z | 2020-02-13T12:26:16.000Z | swish-e-2.4.7/src/libtest.c | uddhab/swish-e | 47011e47f45ec34c807ab6bd9c14e3b4ee236bea | [
"MIT"
] | null | null | null | swish-e-2.4.7/src/libtest.c | uddhab/swish-e | 47011e47f45ec34c807ab6bd9c14e3b4ee236bea | [
"MIT"
] | 3 | 2017-10-12T13:03:54.000Z | 2020-02-13T12:26:36.000Z | /*
$Id: libtest.c 2291 2009-03-31 01:56:00Z karpet $
**
This file is part of Swish-e.
Swish-e 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.
Swish-e 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 Swish-e; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
See the COPYING file that accompanies the Swish-e distribution for details
of the GNU GPL and the special exception available for linking against
the Swish-e library.
** Mon May 9 15:22:55 CDT 2005
** added GPL
**---------------------------------------------------------
*
* Example program for interfacing a C program with the Swish-e C library.
*
* ./libtest [optional index file]
*
* use quotes for more than one file
* ./libtest index.swish-e
* ./libtest 'index1 index2 index3'
*
* See the perl/API.xs file for more detail
*
*/
#include <stdio.h>
#include "swish-e.h" /* use locally for testing */
#define MEM_TEST 1
#ifdef MEM_TEST
#include "mem.h" // for mem_summary only
#endif
#define DISPLAY_COUNT 10 // max to display
static void display_results( SW_HANDLE, SW_RESULTS );
static void print_error_or_abort( SW_HANDLE swish_handle );
static void print_index_headers( SW_HANDLE swish_handle, SW_RESULTS results );
static void print_index_metadata( SW_HANDLE swish_handle );
static void print_header_value( SW_HANDLE swish_handle, const char *name, SWISH_HEADER_VALUE head_value, SWISH_HEADER_TYPE head_type );
static void demo_stemming( SW_RESULTS results );
static void stem_it( SW_RESULT r, char *word );
int main(int argc, char **argv)
{
SW_HANDLE swish_handle = NULL; /* Database handle */
SW_SEARCH search = NULL; /* search handle -- holds search parameters */
SW_RESULTS results = NULL; /* results handle -- holds list of results */
char input_buf[200];
char *index_file_list;
SwishErrorsToStderr(); /* Send any errors or warnings to stderr (default is stdout) */
/* Connect to the indexes specified */
index_file_list = argv[1] && *(argv[1]) ? argv[1] : "index.swish-e";
swish_handle = SwishInit( index_file_list );
/* set ranking scheme. default is 0 */
SwishRankScheme( swish_handle, 1 );
/* return raw values */
SwishReturnRawRank( swish_handle, 1 );
/* Check for errors after every call */
if ( SwishError( swish_handle ) )
print_error_or_abort( swish_handle ); /* print an error or abort -- see below */
/* Here's a short-cut to searching that creates a search object and searches at the same time */
results = SwishQuery( swish_handle, "foo OR bar" );
if ( SwishError( swish_handle ) )
print_error_or_abort( swish_handle ); /* print an error or abort -- see below */
else
{
display_results( swish_handle, results );
printf( "Testing SW_ResultsToSW_HANDLE() = '%s'\n",
SW_ResultsToSW_HANDLE( results ) == swish_handle ? "OK" : "Not OK" );
demo_stemming( results );
Free_Results_Object( results );
}
/* This may change since it only supports 8-bit chars */
{
const char *words = SwishWordsByLetter( swish_handle, "index.swish-e", 'f' );
char *tmp = (char *)words;
printf("Words that begin with 'f': ");
for(;tmp && tmp[0]; tmp += strlen(tmp)+1 )
printf("%s \n", tmp);
printf("\n");
}
/*
* Stem a word -- this method is somewhat depreciated.
* It stores the stemmed word in a single location in the SW_OBJECT
*/
{
char *stemmed = SwishStemWord( swish_handle, "running" );
printf("SwishStemWord 'running' => '%s'\n\n", stemmed ? stemmed : "Failed to stem" );
}
/* Typical use of the library is to create a search object */
/* and use the search object to make multiple queries */
/* Create a search object for searching - the query string is optional */
/* Remember to free the search object when done */
search = New_Search_Object( swish_handle, "foo" );
/* Adjust some of the search parameters if different than the defaults */
SwishSetSort( search, "swishrank desc" );
// SwishSetStructure( search, IN_TITLE ); /* limit to title only */
/* Set Limit parameters like */
/*****
SwishSetSearchLimit( search, "swishtitle", "a", "z" );
SwishSetSearchLimit( search, "age", "18", "65" );
if ( SwishError( swish_handle ) ) // e.g. can't define two limits for same prop name
print_error_or_abort( swish_handle );
// use SwishResetLimit() if wish to change the parameters on a active search object
*****/
/* Now we are ready to search */
while ( 1 )
{
printf("Enter search words: ");
if ( !fgets( input_buf, 200, stdin ) )
break;
results = SwishExecute( search, input_buf );
/* check for errors */
if ( SwishError( swish_handle ) )
{
print_error_or_abort( swish_handle );
if ( results ) /* probably always true */
Free_Results_Object( results );
continue;
}
display_results( swish_handle, results );
Free_Results_Object( results );
#ifdef MEM_TEST
/* It's expected to see some memory used here since a swish_handle exists */
Mem_Summary("End of loop", 1);
#endif
}
Free_Search_Object( search );
SwishClose( swish_handle );
/* Look for memory leaks -- configure swish-e with --enable-memtrace to use */
#ifdef MEM_TEST
Mem_Summary("At end of program", 1);
#endif
return 0;
}
/* Display some standard properties -- see perl/SWISHE.xs for how to get at the data */
static void display_results( SW_HANDLE swish_handle, SW_RESULTS results )
{
SW_RESULT result;
int hits;
int first = 1;
if ( !results ) /* better safe than sorry */
return;
/* Display the set of headers for the index(es) */
print_index_headers( swish_handle, results );
/* Try to get metadata from the index */
print_index_metadata( swish_handle );
hits = SwishHits( results );
if ( 0 == hits )
{
printf("no results!\n");
return;
}
printf("# Total Results: %d\n", hits );
if ( SwishSeekResult(results, 0 ) < 0 ) // how to seek to a page of results
{
print_error_or_abort( swish_handle ); /* seek past end of file */
return;
}
while ( (result = SwishNextResult( results )) )
{
/* This SwishResultPropertyStr() will work for all types of props */
/* But SwishResultPropertyULong() can be used to return numeric types */
/* Should probably check for errors after every call */
/* SwishResultPropertyULong will return ULONG_MAX if the value cannot be returned */
/* that could mean an error, or just that there was not a property assigned (which is not an error) */
printf("Path: %s\n Rank: %lu\n Size: %lu\n Title: %s\n Index: %s\n Modified: %s\n Record #: %lu\n File #: %lu\n\n",
SwishResultPropertyStr ( result, "swishdocpath" ),
SwishResultPropertyULong ( result, "swishrank" ),
SwishResultPropertyULong ( result, "swishdocsize" ),
SwishResultPropertyStr ( result, "swishtitle"),
SwishResultPropertyStr ( result, "swishdbfile" ),
SwishResultPropertyStr ( result, "swishlastmodified" ),
SwishResultPropertyULong ( result, "swishreccount" ), /* can figure this out in loop, of course */
SwishResultPropertyULong ( result, "swishfilenum" )
);
/* Generally not useful, but also can lookup Index header data via the current result */
{
SWISH_HEADER_VALUE header_value;
SWISH_HEADER_TYPE header_type;
const char *example = "WordCharacters";
header_value = SwishResultIndexValue( result, example, &header_type );
print_header_value( swish_handle, example, header_value, header_type );
}
if ( first )
{
printf( "Testing SW_ResultToSW_HANDLE() = '%s'\n",
SW_ResultToSW_HANDLE( result ) == swish_handle ? "OK" : "Not OK" );
first = 0;
}
}
}
/**********************************************************************
* print_index_headers
*
* This displays the standard headers associated with an index
*
* Pass in:
* swish_handle -- for standard headers
*
* Note:
* The SWISH_HEADER value, and the data it points to, is only
* valid during the current call.
*
*
***********************************************************************/
static void print_index_headers( SW_HANDLE swish_handle, SW_RESULTS results )
{
const char **header_names = SwishHeaderNames(swish_handle); /* fetch the list of available header names */
const char **index_name = SwishIndexNames( swish_handle );
SWISH_HEADER_VALUE header_value;
SWISH_HEADER_TYPE header_type;
/* display for each index */
while ( *index_name )
{
const char **cur_header = header_names;
while ( *cur_header )
{
header_value = SwishHeaderValue( swish_handle, *index_name, *cur_header, &header_type );
print_header_value( swish_handle, *cur_header, header_value, header_type );
cur_header++; /* move to next header name */
}
/* Now print out results-specific data */
header_value = SwishParsedWords( results, *index_name );
print_header_value( swish_handle, "Parsed Words", header_value, SWISH_LIST );
header_value = SwishRemovedStopwords( results, *index_name );
print_header_value( swish_handle, "Removed Stopwords", header_value, SWISH_LIST );
index_name++; /* move to next index file */
}
}
static void print_header_value( SW_HANDLE swish_handle, const char *name, SWISH_HEADER_VALUE head_value, SWISH_HEADER_TYPE head_type )
{
const char **string_list;
printf("# %s:", name );
switch ( head_type )
{
case SWISH_STRING:
printf(" %s\n", head_value.string ? head_value.string : "" );
return;
case SWISH_NUMBER:
printf(" %lu\n", head_value.number );
return;
case SWISH_BOOL:
printf(" %s\n", head_value.boolean ? "Yes" : "No" );
return;
case SWISH_LIST:
string_list = head_value.string_list;
while ( *string_list )
{
printf(" %s", *string_list );
string_list++;
}
printf("\n");
return;
case SWISH_HEADER_ERROR:
print_error_or_abort( swish_handle );
return;
default:
printf(" Unknown header type '%d'\n", (int)head_type );
return;
}
}
/**********************************************************************
* print_index_metadata
*
* This displays the metanames and property names in each index.
*
* Pass in:
* swish_handle -- for standard headers
*
* Note:
* The SWISH_HEADER value, and the data it points to, is only
* valid during the current call.
*
*
***********************************************************************/
static void print_index_metadata( SW_HANDLE swish_handle )
{
const char **index_name = SwishIndexNames( swish_handle );
while ( *index_name ) {
SWISH_META_LIST meta_list = SwishMetaList( swish_handle, *index_name );
SWISH_META_LIST prop_list = SwishPropertyList( swish_handle, *index_name );
while ( *meta_list ) {
printf("# Meta: " );
printf( "%s ", SwishMetaName(*meta_list));
printf( "type=%d ", SwishMetaType(*meta_list));
printf( "id=%d ", SwishMetaID(*meta_list));
printf("\n");
meta_list++;
}
while ( *prop_list ) {
printf("# Property: " );
printf( "%s ", SwishMetaName(*prop_list));
printf( "type=%d ", SwishMetaType(*prop_list));
printf( "id=%d ", SwishMetaID(*prop_list));
printf("\n");
prop_list++;
}
index_name++;
}
}
/*************************************************************
* print_error_or_abort -- display an error message / abort
*
* This displays the error message, and aborts if it's a critical
* error. This is overkill -- normally a critical error means
* that the you should call SwishClose() and start over.
*
* On searches means that the search could not be completed
*
*
**************************************************************/
static void print_error_or_abort( SW_HANDLE swish_handle )
{
if ( !SwishError( swish_handle ) )
return;
/* On critical errors simply exit -- normally you would SwishClose() and loop */
if ( SwishCriticalError( swish_handle ) )
SwishAbortLastError( swish_handle ); /* prints message and exits */
/* print a message */
fprintf(stderr,
"err: Number [%d], Type [%s], Optional Message: [%s]\n",
SwishError( swish_handle ),
SwishErrorString( swish_handle ),
SwishLastErrorMsg( swish_handle )
);
}
/*
* This shows how to use the stemmer based on a result.
* It's done this way because a result is related to a
* specific index (where a result list may contain results
* from many indexes).
* Typically, the stemmer is used at search time to highlight words
* so it would be based on a given result.
*/
static void demo_stemming( SW_RESULTS results )
{
SW_RESULT r;
printf("\n-- Stemmer Test --\n");
if ( !SwishHits( results ) )
{
printf("Couldn't test stemming because search returned no results\n");
return;
}
if (SwishSeekResult( results, 0) )
{
printf("Failed to seek to result 0\n");
return;
}
r = SwishNextResult( results );
if ( !r )
{
printf("Failed to get first result\n");
return;
}
printf("Fuzzy Mode: %s\n", SwishFuzzyMode( r ) );
stem_it( r, "running" );
stem_it( r, "runs" );
stem_it( r, "12345" );
stem_it( r, "abc3def" );
stem_it( r, "");
stem_it( r, "sugar" ); /* produces two metaphones */
}
static void stem_it( SW_RESULT r, char *word )
{
const char **word_list;
SW_FUZZYWORD fw;
printf(" [%s] : ", word );
fw = SwishFuzzyWord( r, word );
printf(" Status: %d", SwishFuzzyWordError(fw) );
printf(" Word Count: %d\n", SwishFuzzyWordCount(fw) );
printf(" words:");
word_list = SwishFuzzyWordList( fw );
while ( *word_list )
{
printf(" %s", *word_list );
word_list++;
}
printf("\n");
SwishFuzzyWordFree( fw );
}
| 28.174312 | 135 | 0.602214 |
5bb3764a192bee84c3c96879e069dbb946237083 | 631 | h | C | src/SqliteError.h | mattgodbolt/zindex | 68aacf7bf3d904d1d48535a6f4aac8182dbc904c | [
"BSD-2-Clause"
] | 615 | 2015-04-06T01:39:15.000Z | 2022-03-18T07:52:16.000Z | src/SqliteError.h | ammarfaizi2/zindex | 68aacf7bf3d904d1d48535a6f4aac8182dbc904c | [
"BSD-2-Clause"
] | 38 | 2015-04-15T03:43:13.000Z | 2021-12-02T10:47:05.000Z | src/SqliteError.h | ammarfaizi2/zindex | 68aacf7bf3d904d1d48535a6f4aac8182dbc904c | [
"BSD-2-Clause"
] | 38 | 2015-04-06T01:25:00.000Z | 2022-03-18T07:52:18.000Z | #pragma once
#include <stdexcept>
#include <sqlite3.h>
// An exception in sqlite.
struct SqliteError : std::runtime_error {
SqliteError(int result)
: std::runtime_error(sqlite3_errstr(result)) {
}
SqliteError(int result, const std::string &context)
: std::runtime_error(
sqlite3_errstr(result) + std::string(" (") + context + ")") {
}
explicit SqliteError(const std::string &errMsg)
: std::runtime_error(errMsg) { }
SqliteError(const std::string &errMsg, const std::string &context)
: std::runtime_error(errMsg + " (" + context + ")") { }
};
| 27.434783 | 73 | 0.608558 |
9de14ecf4c08016e468b648e9ab1a7c089f83340 | 1,012 | c | C | nitan/d/heimuya/npc/jiaotu.c | cantona/NT6 | 073f4d491b3cfe6bfbe02fbad12db8983c1b9201 | [
"MIT"
] | 1 | 2019-03-27T07:25:16.000Z | 2019-03-27T07:25:16.000Z | nitan/d/heimuya/npc/jiaotu.c | cantona/NT6 | 073f4d491b3cfe6bfbe02fbad12db8983c1b9201 | [
"MIT"
] | null | null | null | nitan/d/heimuya/npc/jiaotu.c | cantona/NT6 | 073f4d491b3cfe6bfbe02fbad12db8983c1b9201 | [
"MIT"
] | null | null | null | // jiaotu.c 日月神教教徒
inherit NPC;
void create()
{
int age;
age = 20 + random(10);
set_name("日月神教教徒", ({ "jiao tu", "tu" }));
set("gender", "男性");
set("age", age);
set_skill("unarmed", 20);
set_skill("dodge", 20);
set("apply/attack", 20);
set("apply/defense", 20);
set("apply/damage", 5);
set("combat_exp", 550 + age*10);
set("shen_type", -1);
setup();
add_money("silver", 10);
}
void init()
{
object ob,me,what;
::init();
ob = this_player();
me = this_object();
if( interactive(ob) && ! is_fighting())
{
remove_call_out("greeting");
call_out("greeting", 1, me);
}
}
void greeting(object ob)
{
if (! ob || environment(ob) != environment()) return;
switch (random(1))
{
case 0:
command("say 日月神教,日出東方,唯我不敗。\n");
break;
}
}
| 22 | 61 | 0.44664 |
e493cb51ec572e37da5bd5d3f58a31bfa1e0b501 | 587 | h | C | 0x02-huffman_coding/huffman.h | gefranco/holbertonschool-system_algorithms | b04870c402aeb9afa4a2b29a845630e820c7cab3 | [
"MIT"
] | null | null | null | 0x02-huffman_coding/huffman.h | gefranco/holbertonschool-system_algorithms | b04870c402aeb9afa4a2b29a845630e820c7cab3 | [
"MIT"
] | null | null | null | 0x02-huffman_coding/huffman.h | gefranco/holbertonschool-system_algorithms | b04870c402aeb9afa4a2b29a845630e820c7cab3 | [
"MIT"
] | null | null | null | #ifndef _HUFFMAN_
#define _HUFFMAN_
#include <stdlib.h>
#include "heap.h"
/**
* struct symbol_s - Stores a char and its associated frequency
*
* @data: The character
* @freq: The associated frequency
*/
typedef struct symbol_s
{
char data;
size_t freq;
} symbol_t;
symbol_t *symbol_create(char data, size_t freq);
heap_t *huffman_priority_queue(char *data, size_t *freq, size_t size);
int huffman_extract_and_insert(heap_t *priority_queue);
binary_tree_node_t *huffman_tree(char *data, size_t *freq, size_t size);
int huffman_codes(char *data, size_t *freq, size_t size);
#endif
| 25.521739 | 72 | 0.759796 |
4fe7aac21265337620535d2032a2c034e7b2172f | 3,209 | h | C | aimsalgo/src/aimsalgo/roi/roigtm.h | brainvisa/aims-free | 5852c1164292cadefc97cecace022d14ab362dc4 | [
"CECILL-B"
] | 4 | 2019-07-09T05:34:10.000Z | 2020-10-16T00:03:15.000Z | aimsalgo/src/aimsalgo/roi/roigtm.h | brainvisa/aims-free | 5852c1164292cadefc97cecace022d14ab362dc4 | [
"CECILL-B"
] | 72 | 2018-10-31T14:52:50.000Z | 2022-03-04T11:22:51.000Z | aimsalgo/src/aimsalgo/roi/roigtm.h | brainvisa/aims-free | 5852c1164292cadefc97cecace022d14ab362dc4 | [
"CECILL-B"
] | null | null | null | /* This software and supporting documentation are distributed by
* Institut Federatif de Recherche 49
* CEA/NeuroSpin, Batiment 145,
* 91191 Gif-sur-Yvette cedex
* France
*
* This software is governed by the CeCILL-B license under
* French law and abiding by the rules of distribution of free software.
* You can use, modify and/or redistribute the software under the
* terms of the CeCILL-B license as circulated by CEA, CNRS
* and INRIA at the following URL "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
*/
#ifndef AIMS_ROI_ROIGTM_H
#define AIMS_ROI_ROIGTM_H
#include <aims/config/aimsalgo_config.h>
#include <cartodata/volume/volume.h>
#include <aims/bucket/bucket.h>
#include <aims/roi/roi.h>
#include <aims/roi/roiselector.h>
#include <graph/graph/graph.h>
#include <vector>
namespace aims
{
class AIMSALGO_API RoiGtm : public Graph
{
public:
enum MaskType
{
threshold_on_closed,
threshold_on_smoothed,
get_from_file
};
RoiGtm( RoiSelector* roiSel=NULL, float trans=-1, float axial=-1);
virtual ~RoiGtm( );
void stamp(std::string &selector_fname, std::string &roi_fname);
AimsRoi* doit( AimsRoi &roi,
MaskType m = threshold_on_smoothed,
carto::rc_ptr<carto::Volume<float> > smo
= carto::rc_ptr<carto::Volume<float> >( 0 ) );
void streamout( );
carto::VolumeRef<float> getMatrix();
carto::VolumeRef<float> getInvMatrix();
std::vector<std::string> getStructNameList();
AimsRoi& getMaskRoi(){return *_maskRoi;}
void setMaskRoi(AimsRoi* roi){ _maskRoi = roi;}
void editionSet() {_isEditable = true;}
void computationSet() {_isComputable = true;}
carto::SyntaxSet& syntax() { return sGtm; }
protected:
carto::SyntaxSet sGtm;
private:
RoiSelector* _roiSel;
float _trans, _axial;
AimsRoi* _maskRoi;
bool _isEditable;
bool _isComputable;
};
}
#endif
| 31.15534 | 75 | 0.686195 |
8b1e60f58c7e8526c8d54429e54ebb308b3a4c96 | 768 | h | C | Headers/Frameworks/TLKit/TLKDragItemComponentsHandler.h | CommandPost/FinalCutProFrameworks | d98b00ff0c84af80942d71514e9238d624aca50a | [
"MIT"
] | 3 | 2020-11-19T10:04:02.000Z | 2021-10-02T17:25:21.000Z | Headers/Frameworks/TLKit/TLKDragItemComponentsHandler.h | CommandPost/FinalCutProFrameworks | d98b00ff0c84af80942d71514e9238d624aca50a | [
"MIT"
] | null | null | null | Headers/Frameworks/TLKit/TLKDragItemComponentsHandler.h | CommandPost/FinalCutProFrameworks | d98b00ff0c84af80942d71514e9238d624aca50a | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Mar 11 2021 20:53:35).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <TLKit/TLKTimelineHandler.h>
@class TLKDragContext;
@interface TLKDragItemComponentsHandler : TLKTimelineHandler
{
TLKDragContext *_dragContext;
}
@property(retain, nonatomic) TLKDragContext *dragContext; // @synthesize dragContext=_dragContext;
- (BOOL)stopTracking:(id)arg1;
- (void)cancelTracking:(id)arg1;
- (BOOL)_stopTracking;
- (BOOL)continueTracking:(id)arg1;
- (BOOL)startTracking:(id)arg1;
- (void)_updateDraggedObjectsIfNeeded:(id)arg1;
- (void)_removeItemComponentLayersFromDragPositionForObjects:(id)arg1;
- (void)_moveItemComponentLayersToDragPositionForObjects:(id)arg1;
- (void)dealloc;
@end
| 26.482759 | 98 | 0.764323 |
3fd7ebfcc467a3760770054bfbbf68fd51a67b4b | 2,776 | c | C | sources/server/commands/broadcast.c | armandmgt/zappy | 055792feac1a48811e13243ce88b6296022ea97a | [
"MIT"
] | null | null | null | sources/server/commands/broadcast.c | armandmgt/zappy | 055792feac1a48811e13243ce88b6296022ea97a | [
"MIT"
] | null | null | null | sources/server/commands/broadcast.c | armandmgt/zappy | 055792feac1a48811e13243ce88b6296022ea97a | [
"MIT"
] | null | null | null | /*
** EPITECH PROJECT, 2018
** command_actions
** File description:
** none
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "server/gui_magic.h"
#include "server/commands.h"
#include "gui_commands.h"
static int convertion_to_degree(client_t *client, double angle);
static int get_direction(server_t *server, client_t *client, client_t *tmp);
static int determine_angle(double angle);
static void send_msg(server_t *server, client_t *client, client_t *tmp_client,
char *args);
bool broadcast(server_t *server, client_t *client, char *args)
{
client_t *tmp_client;
for (list_t *tmp = server->clients; tmp; tmp = tmp->next) {
tmp_client = tmp->data;
send_msg(server, client, tmp_client, args);
}
dprintf(client->sock, "%s\n", args ? "ok" : "ko");
if (args)
print_in_gui(server->clients, "pbc %d %s\n", client->infos->id,
args);
return (false);
}
static void send_msg(server_t *server, client_t *client, client_t *tmp_client,
char *args)
{
int direction;
if (tmp_client->team && !strcmp(tmp_client->team->name, GUI_NAME))
return;
if (args && tmp_client != client && (client->infos->pos.x ==
tmp_client->infos->pos.x && client->infos->pos.y ==
tmp_client->infos->pos.y))
dprintf(tmp_client->sock, "message 0, %s", args);
else if (args && tmp_client != client) {
direction = get_direction(server, client, tmp_client);
dprintf(tmp_client->sock, "message %d, %s\n", direction,
args);
}
}
static int get_direction(server_t *server, client_t *client, client_t *tmp)
{
double delta_x;
double delta_y;
double tan;
double result;
int direction;
delta_x = abs(client->infos->pos.x - tmp->infos->pos.x);
delta_y = abs(client->infos->pos.y - tmp->infos->pos.y);
if (delta_x > server->map_infos.x / 2)
delta_x = server->map_infos.x - delta_x;
if (delta_y > server->map_infos.y / 2)
delta_y = server->map_infos.y - delta_y;
tan = delta_y / delta_x;
result = atan(tan);
direction = convertion_to_degree(client, result);
return (direction);
}
static int convertion_to_degree(client_t *client, double angle)
{
double degrees = (angle * 180.0 / M_PI);
int orientation = determine_angle(degrees);
int direction = (8 - client->infos->direction + orientation) % 8;
return (direction);
}
static int determine_angle(double angle)
{
if (angle <= 22.5 && angle >= 337.7)
return (7);
else if (angle < 67.5 && angle > 22.5)
return (8);
else if (angle >= 67.5 && angle <= 112.5)
return (1);
else if (angle > 112.5 && angle < 157.5)
return (2);
else if (angle >= 157.5 && angle < 202.5)
return (3);
else if (angle > 202.5 && angle < 247.5)
return (4);
else if (angle >= 247.5 && angle <= 292.5)
return (5);
else if (angle > 292.5 && angle < 337.5)
return (6);
return (-1);
}
| 26.951456 | 78 | 0.67219 |
12d1923232d392a79b912735b9c0b39ae984f985 | 428 | h | C | Source/Almond/Platform/OpenGL/VertexArray.h | enix403/Almond | 5c4a622ef7d25df83ff82089104bb05a2bb86e65 | [
"Apache-2.0"
] | null | null | null | Source/Almond/Platform/OpenGL/VertexArray.h | enix403/Almond | 5c4a622ef7d25df83ff82089104bb05a2bb86e65 | [
"Apache-2.0"
] | null | null | null | Source/Almond/Platform/OpenGL/VertexArray.h | enix403/Almond | 5c4a622ef7d25df83ff82089104bb05a2bb86e65 | [
"Apache-2.0"
] | null | null | null | #pragma once
#include <Almond/Platform/OpenGL/Buffer.h>
namespace Almond
{
class VertexArray
{
public:
VertexArray();
~VertexArray();
void Bind() const;
void Unbind() const;
void AddVertexBuffer(const VertexBuffer& buffer, const VertexLayout& layout);
void AddIndexBuffer(const IndexBuffer& buffer);
private:
uint m_VaoId;
};
} // namespace Almond | 19.454545 | 85 | 0.628505 |
e92dd8ccf232a3baa94ac46ec1936fff509c6805 | 1,710 | h | C | src/consensus/merkle.h | MONIMAKER365/BitcoinUnlimited | 8aea282c44ee23ca65cdd895c99b3f6347f46dfc | [
"MIT"
] | 1 | 2020-11-11T12:56:55.000Z | 2020-11-11T12:56:55.000Z | src/consensus/merkle.h | MONIMAKER365/BitcoinUnlimited | 8aea282c44ee23ca65cdd895c99b3f6347f46dfc | [
"MIT"
] | null | null | null | src/consensus/merkle.h | MONIMAKER365/BitcoinUnlimited | 8aea282c44ee23ca65cdd895c99b3f6347f46dfc | [
"MIT"
] | null | null | null | // Copyright (c) 2015 The Bitcoin Core developers
// Copyright (c) 2015-2018 The Bitcoin Unlimited developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CONSENSUS_MERKLE_H
#define BITCOIN_CONSENSUS_MERKLE_H
#include <stdint.h>
#include <vector>
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "uint256.h"
uint256 ComputeMerkleRoot(std::vector<uint256> hashes, bool *mutated = nullptr);
/*
To compute a merkle path (AKA merkle proof), pass the index of the element being proved into position.
The merkle proof will be returned, not including the element.
For example, ComputeMerkleBranch(4 elements, 0) will return:
[ element[1], Hash256(element[2], element[3]) ]
*/
std::vector<uint256> ComputeMerkleBranch(const std::vector<uint256> &leaves, uint32_t position);
/* To verify a merkle proof, pass the hash of the element in "leaf", the merkle proof in "branch", and the zero-based
index specifying where the element was in the array when the merkle proof was created.
*/
uint256 ComputeMerkleRootFromBranch(const uint256 &leaf, const std::vector<uint256> &branch, uint32_t position);
/*
* Compute the Merkle root of the transactions in a block.
* *mutated is set to true if a duplicated subtree was found.
*/
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated = nullptr);
/*
* Compute the Merkle branch for the tree of transactions in a block, for a
* given position.
* This can be verified using ComputeMerkleRootFromBranch.
*/
std::vector<uint256> BlockMerkleBranch(const CBlock &block, uint32_t position);
#endif // BITCOIN_CONSENSUS_MERKLE_H
| 37.173913 | 117 | 0.77076 |
e946a777fe7b04816ac6eb96d8a56dd7944418d3 | 1,288 | c | C | c03/ex04/ft_strstr.c | irnabern/dealBEY | 966d4e988a7e324e577fd0de60be00fde41cdda0 | [
"Apache-2.0"
] | null | null | null | c03/ex04/ft_strstr.c | irnabern/dealBEY | 966d4e988a7e324e577fd0de60be00fde41cdda0 | [
"Apache-2.0"
] | null | null | null | c03/ex04/ft_strstr.c | irnabern/dealBEY | 966d4e988a7e324e577fd0de60be00fde41cdda0 | [
"Apache-2.0"
] | null | null | null | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bbatumik <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/17 12:18:58 by bbatumik #+# #+# */
/* Updated: 2019/09/18 12:12:02 by bbatumik ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strstr(char *str, char *to_find)
{
int i;
int affino;
int romeo;
i = 0;
if (to_find[0] == '\0')
return (str);
while (str[i] != '\0')
{
affino = 0;
if (str[i] == to_find[affino])
{
romeo = i;
while (str[i] == to_find[affino])
{
if (to_find[affino + 1] == '\0')
return (&str[romeo]);
affino++;
i++;
}
i = romeo;
}
i++;
}
return (0);
}
| 31.414634 | 80 | 0.220497 |
6a935d541760f55c20450fa91ae729b530a041d8 | 448 | h | C | L1Trigger/L1TGlobal/src/classes.h | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | L1Trigger/L1TGlobal/src/classes.h | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | L1Trigger/L1TGlobal/src/classes.h | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | #include "L1Trigger/L1TGlobal/interface/GlobalCondition.h"
#include "L1Trigger/L1TGlobal/interface/TriggerMenu.h"
namespace L1Trigger_L1TGlobal {
struct dictionary {
std::vector<MuonTemplate> dummy1;
std::vector<CaloTemplate> dummy2;
std::vector<CorrelationTemplate> dummy3;
std::vector<CorrelationThreeBodyTemplate> dummy4;
std::vector<CorrelationWithOverlapRemovalTemplate> dummy5;
};
} // namespace L1Trigger_L1TGlobal
| 34.461538 | 62 | 0.783482 |
b156bd7a359320415e480b525b7b17bb88110a0a | 459 | h | C | Source/HeliumRain/Data/FlareOrbitalMap.h | eaglesquads/HeliumRain | 74e70482f8d93158ab819406086a513452eee555 | [
"BSD-3-Clause"
] | 1 | 2020-02-21T20:11:06.000Z | 2020-02-21T20:11:06.000Z | Source/HeliumRain/Data/FlareOrbitalMap.h | eaglesquads/HeliumRain | 74e70482f8d93158ab819406086a513452eee555 | [
"BSD-3-Clause"
] | null | null | null | Source/HeliumRain/Data/FlareOrbitalMap.h | eaglesquads/HeliumRain | 74e70482f8d93158ab819406086a513452eee555 | [
"BSD-3-Clause"
] | null | null | null | #pragma once
#include "../Game/FlareSimulatedSector.h"
#include "FlareOrbitalMap.generated.h"
UCLASS()
class HELIUMRAIN_API UFlareOrbitalMap : public UDataAsset
{
GENERATED_UCLASS_BODY()
public:
/*----------------------------------------------------
Public data
----------------------------------------------------*/
/** Sectors data */
UPROPERTY(EditAnywhere, Category = Content)
TArray<FFlareSectorCelestialBodyDescription> OrbitalBodies;
};
| 19.956522 | 60 | 0.588235 |
1d7d866c13645b03f9f73dc65b3c0575828a0bdc | 5,940 | w | C | hw/src/cpu.w | nickmqb/fpga_craft | 13f1258ba2cf822812eb7b7e9ec60ed6d6d9a17d | [
"Apache-2.0"
] | 140 | 2021-09-26T15:50:29.000Z | 2022-02-27T04:38:09.000Z | hw/src/cpu.w | nickmqb/fpga_craft | 13f1258ba2cf822812eb7b7e9ec60ed6d6d9a17d | [
"Apache-2.0"
] | null | null | null | hw/src/cpu.w | nickmqb/fpga_craft | 13f1258ba2cf822812eb7b7e9ec60ed6d6d9a17d | [
"Apache-2.0"
] | 11 | 2021-09-26T16:10:34.000Z | 2022-01-12T20:49:47.000Z | // Copyright 2021 nickmqb
// SPDX-License-Identifier: Apache-2.0
// All instructions are 1 byte, except for the following which have an extra 1 byte argument/suffix:
// in, out, get_ex, put_ex, call, jump, goto, bz, bnz
// 0x00-0x7f: get(128)
// 0x80-0xbf: put(64)
// 0xc_: + dec dup inc swap sub inv neg & | ^ &~ store storeb push pop
// 0xd_: >=u <u <s >=s >u <=u <=s >s not to_bool == != mul mul16 mul8s mul12s
// 0xe_: load loadb in out get_ex put_ex ? ? call jump ret ? add_offset ? push_slow pop_slow
// 0xf_: goto(8) bz(4) bnz(4)
cpu(#initial_locals $4096, #initial_jump_table $4096, clk $1, req_enabled $1, ins $8, mem_rdata $16, port_rdata $16) {
out reg pc $13
out reg a $16
out reg b $16
reg sp $6
reg temp_mul $16
reg temp_in $16
reg temp_misc $16
reg carry_out $1
posedge clk {
reg decode <= req_enabled
reg ins_d <= ins
if req_enabled & ~stall {
pc <= pc + 1
}
if decode {
reg ctrl_get <= ins[7] == '0
reg ctrl_put <= ins[7:6] == '10
reg ctrl_alu <= (ins[7:4] == 0xc & (ins[3] == 0 | ins[3:1] == 6)) | (ins[7:4] == 0xd & (ins[3] == 0 | ins[2] == 0))
reg ctrl_alu_a_mode <= { ins[4:0] == 1 | ins[4:3] == 1, ins[4:1] == 1 | ins[4:1] == 3 | ins[4:3] == 1 | ins[4:1] == 12 }
reg ctrl_alu_b_mode <= { ins[4:0] == 4, ins[4:2] == 1 | ins[4:3] == 2 | ins[4:1] == 13 }
reg ctrl_alu_carry_in <= { ins[4:0] == 3 | ins[4:0] == 5 | ins[4:0] == 7 | ins[4:0] == 12 | ins[4:3] == 2 | ins[4:1] == 13 }
reg ctrl_alu_compare <= '0
reg ctrl_alu_compare_mode <= { ins[3:2] == 1, ins[3:2] == 0 | ins[3:1] == 3 }
reg ctrl_alu_compare_invert <= ins[0]
reg ctrl_bitwise <= (ins[7:4] == 0xc & ins[3:2] == 2)
reg ctrl_mul <= (ins[7:4] == 0xd & ins[3:2] == 3)
reg ctrl_load <= ins == 0xe0 | ins == 0xe1
reg ctrl_store <= ins == 0xcc | ins == 0xcd
reg ctrl_ls_byte <= ins[0]
reg ctrl_in <= ins == 0xe2
reg ctrl_in_f <= '0
reg ctrl_out <= ins == 0xe3
reg ctrl_get_ex <= ins == 0xe4
reg ctrl_put_ex <= ins == 0xe5
reg ctrl_push <= ins == 0xce | ins == 0xee
reg ctrl_pop <= ins == 0xcf | ins == 0xef
reg ctrl_jump <= ins == 0xe8 | ins == 0xe9
reg ctrl_jump_f <= '0
reg ctrl_call <= ins == 0xe9
reg ctrl_ret <= ins == 0xea
reg ctrl_add_offset <= ins == 0xec
reg ctrl_goto <= ins[7:4] == 0xf
// >=2 cycles
if ins[7:4] == 0xd | ins[7:4] == 0xe | ins[7:4] == 0xf {
decode <= '0
}
// cycles > num_bytes
stall := decode & (ins[7:4] == 0xd | (ins[7:4] == 0xe & (ins[3:1] == 0 | ins[3:0] == 2 | ins[3:2] == 3)))
}
if ctrl_mul & ~decode {
mul_u := MUL16x16(clk: clk, a: a, b: b).o
mul_s := MUL16x16_SIGNED(clk: clk, a: a, b: b).o
temp_mul <= match ins_d[1:0] {
'00: mul_u[15:0]
'01: mul_u[31:16]
'10: mul_s[23:8]
'11: mul_s[27:12]
}
}
if ctrl_mul & decode {
b <= temp_mul
}
if ctrl_add_offset & ~decode {
offset_x := { b[10:7], b[0] } + { a[10:7], a[0] }
offset_y := b[6:2] + a[6:2]
offset_z := { b[14:11], b[1] } + { a[14:11], a[1] }
temp_misc <= { '1, offset_z[4:1], offset_x[4:1], offset_y, offset_z[0], offset_x[0] }
}
if ctrl_add_offset & decode {
b <= temp_misc
}
out req_rport := ctrl_in_f
out req_wport := ctrl_out & decode
out port := ins_d[5:0]
if ctrl_in {
ctrl_in <= 0
ctrl_in_f <= 1
decode <= 0
}
if ctrl_in_f & ~decode {
temp_in <= port_rdata
}
if ctrl_in_f & decode {
b <= temp_in
a <= b
}
if ctrl_alu_compare {
cmp := match ctrl_alu_compare_mode {
'00: eq0
'01: carry_out
'10: carry_out & ~eq0
'11: carry_out | eq0
}
b <= { rep('0, 15), cmp ^ ctrl_alu_compare_invert }
}
if ctrl_bitwise {
b <= match ins_d[1:0] {
'00: a & b
'01: a | b
'10: a ^ b
'11: a & ~b
}
}
eq0 := b == 0
if ctrl_goto & ~decode & (ins_d[3] == 0 | (ins_d[2] != eq0)) {
pc <= pc + { ins_d[3] ? rep(ins_d[1], 3) : rep(ins_d[2], 3), ins_d[1:0], ins }
ctrl_goto <= 0
decode <= 0
}
out req_r := ctrl_load & ~decode
out req_w := ctrl_store
out req_byte := ctrl_ls_byte
if ctrl_load & decode {
b <= mem_rdata
a <= b
}
if ctrl_push {
sp <= sp + 1
}
if ctrl_push & ~decode {
ctrl_push <= 0
}
if ctrl_pop {
ctrl_pop <= 0
sp <= sp - 1
b <= jump_stack.rdata
a <= b
}
if ctrl_jump {
ctrl_jump <= 0
ctrl_jump_f <= 1
decode <= 0
}
if ctrl_jump_f {
ctrl_jump_f <= 0
decode <= 0
pc <= jump_stack.rdata[12:0]
}
if ctrl_call {
ctrl_call <= 0
sp <= sp + 1
}
if ctrl_ret {
ctrl_ret <= 0
decode <= 0
sp <= sp - 1
pc <= jump_stack.rdata[12:0]
}
jump_stack := RAM256x16(
#initial_data: #initial_jump_table
rclk: clk, wclk: clk
raddr: ctrl_jump ? ins : { '11, sp - 1 }
we: ctrl_push | ctrl_call, waddr: { '11, sp }, wdata: ctrl_push ? b : { '000, pc }
)
if ctrl_alu & ~ctrl_alu_compare {
alu := alu(clk: clk, a: a, b: b, a_mode: ctrl_alu_a_mode, b_mode: ctrl_alu_b_mode, carry_in: ctrl_alu_carry_in, signed: ins_d[1])
b <= alu.o[15:0]
carry_out <= alu.o[16]
if ctrl_alu_b_mode[1] { // If swap
a <= b
}
ctrl_alu_compare <= ins_d[4]
}
if (ctrl_get & (prev_ctrl_put == 0 | ins_d[7:6] != 0 | ins_d[5:0] != prev_ctrl_put_addr)) | (ctrl_get_ex & decode) {
b <= locals.rdata
}
if ctrl_get | (ctrl_get_ex & decode) {
a <= b
}
locals := RAM256x16(
#initial_data: #initial_locals
rclk: clk, wclk: clk
raddr: ins
we: ctrl_put | (ctrl_put_ex & ~decode), waddr: ctrl_put ? { '00, ins_d[5:0] } : ins, wdata: b
)
reg prev_ctrl_put <= ctrl_put
reg prev_ctrl_put_addr <= ins_d[5:0]
}
}
alu(clk $1, a $16, b $16, a_mode $2, b_mode $2, carry_in $1, signed $1) {
lhs := match a_mode {
'00: a
'01: 0_$16
'10: 0xffff_$16
'11: 1_$16
}
rhs := match b_mode {
'00: b
'01: ~b
'10: 0_$16
'11: 0_$16
}
out o := { signed ? lhs[15] : '0, lhs } + { signed ? rhs[15] : '0, rhs } + { 0_$16, carry_in }
}
| 25.063291 | 135 | 0.553535 |
383187ec9e37d60a6c6a8a48070edae377ed1f7d | 7,993 | h | C | drm_util.h | Theodus/vcap | 7607b5d6dcb9fa2309fbf89a143ab2771699cfdf | [
"BSD-2-Clause"
] | null | null | null | drm_util.h | Theodus/vcap | 7607b5d6dcb9fa2309fbf89a143ab2771699cfdf | [
"BSD-2-Clause"
] | null | null | null | drm_util.h | Theodus/vcap | 7607b5d6dcb9fa2309fbf89a143ab2771699cfdf | [
"BSD-2-Clause"
] | null | null | null | #pragma once
#include "errors.h"
#include <libdrm/drm.h>
#include <libdrm/drm_mode.h>
#include <stdbool.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#define MAX_DRM_BUFS 5
#define XYLON_DRM_STRIDE 2048
typedef struct
{
unsigned int index;
unsigned int bo_handle;
unsigned int fb_handle;
int dbuf_fd;
unsigned char* drm_buff;
unsigned int dumb_buff_length;
} drm_buf_t;
typedef enum
{
PLANE_OVERLAY,
PLANE_PRIMARY,
PLANE_CURSOR,
PLANE_NONE
} plane_t;
typedef struct
{
char const* module;
int fd;
int crtc_index;
unsigned int crtc_id;
unsigned int con_id;
drmModePlane prim_plane;
drmModePlane overlay_plane;
drmModeConnector* connector;
drmModeModeInfo mode;
drmModeCrtc* saved_crtc;
const char modestr[32];
unsigned int format;
drm_buf_t drm_bufs[MAX_DRM_BUFS];
uint32_t width;
uint32_t height;
} drm_device_t;
// Create dumb scanout buffers and framebuffer
static inline bool drm_buffer_create(
drm_device_t* dev, drm_buf_t* buf, size_t width, size_t height, size_t stride)
{
struct drm_mode_create_dumb gem;
struct drm_mode_map_dumb mreq;
struct drm_mode_destroy_dumb gem_destroy;
memset(&gem, 0, sizeof gem);
gem.width = width;
gem.height = height;
gem.bpp = stride / width * 8;
// The kernel will return a 32bit handle that can be used to manage the buffer
// with the DRM API
if (ioctl(dev->fd, DRM_IOCTL_MODE_CREATE_DUMB, &gem))
return false;
buf->bo_handle = gem.handle;
buf->dumb_buff_length = gem.size;
struct drm_prime_handle prime;
memset(&prime, 0, sizeof prime);
prime.handle = buf->bo_handle;
if (ioctl(dev->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &prime))
goto fail_gem;
buf->dbuf_fd = prime.fd;
uint32_t offsets[4] = {0};
uint32_t pitches[4] = {stride};
uint32_t bo_handles[4] = {buf->bo_handle};
int ret = drmModeAddFB2(
dev->fd,
width,
height,
dev->format,
bo_handles,
pitches,
offsets,
&buf->fb_handle,
0);
if (ret)
goto fail_prime;
memset(&mreq, 0, sizeof(mreq));
mreq.handle = buf->bo_handle;
if (drmIoctl(dev->fd, DRM_IOCTL_MODE_MAP_DUMB, &mreq))
{
fprintf(stderr, "cannot map dumb buffer: %s\n", strerror(errno));
goto fail_prime;
}
buf->drm_buff =
mmap(0, gem.size, PROT_READ | PROT_WRITE, MAP_SHARED, dev->fd, mreq.offset);
if (buf->drm_buff == MAP_FAILED)
{
fprintf(stderr, "cannot mmap dumb buffer \n");
goto fail_prime;
}
return true;
fail_prime:
close(buf->dbuf_fd);
fail_gem:
memset(&gem_destroy, 0, sizeof gem_destroy);
gem_destroy.handle = buf->bo_handle,
ioctl(dev->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &gem_destroy);
return false;
}
// Find available CRTC and connector for scanout
static inline bool drm_find_crtc(drm_device_t* dev)
{
drmModeRes* res = drmModeGetResources(dev->fd);
if (res == NULL)
return false;
if ((res->count_crtcs <= 0) || (res->count_connectors <= 0))
{
drmModeFreeResources(res);
return false;
}
dev->crtc_index = 0;
dev->crtc_id = res->crtcs[0];
dev->con_id = res->connectors[0];
dev->connector = drmModeGetConnector(dev->fd, dev->con_id);
if (!dev->connector)
{
drmModeFreeResources(res);
return false;
}
return true;
}
static inline plane_t
drm_get_plane_type(drm_device_t* dev, unsigned int plane_id)
{
plane_t type = PLANE_NONE;
bool found = false;
drmModeObjectPropertiesPtr props =
drmModeObjectGetProperties(dev->fd, plane_id, DRM_MODE_OBJECT_PLANE);
for (size_t i = 0; i < props->count_props && !found; i++)
{
const char* enum_name = NULL;
drmModePropertyPtr prop = drmModeGetProperty(dev->fd, props->props[i]);
if (0 == strcmp(prop->name, "type"))
{
for (size_t j = 0; j < prop->count_enums; j++)
{
if (prop->enums[j].value == props->prop_values[i])
{
enum_name = prop->enums[j].name;
break;
}
}
if (0 == strcmp(enum_name, "Primary"))
type = PLANE_PRIMARY;
else if (0 == strcmp(enum_name, "Overlay"))
type = PLANE_OVERLAY;
else if (0 == strcmp(enum_name, "Cursor"))
type = PLANE_CURSOR;
found = true;
}
drmModeFreeProperty(prop);
}
drmModeFreeObjectProperties(props);
return type;
}
// Find an unused plane that supports the format
static inline bool drm_find_plane(drm_device_t* dev)
{
drmModePlaneResPtr planes = drmModeGetPlaneResources(dev->fd);
if (planes == NULL)
return false;
for (size_t i = 0; i < planes->count_planes; ++i)
{
drmModePlanePtr plane = drmModeGetPlane(dev->fd, planes->planes[i]);
if (plane == 0)
break;
plane_t type = drm_get_plane_type(dev, plane->plane_id);
if (type == PLANE_PRIMARY)
dev->prim_plane = *plane;
if (plane->crtc_id)
continue;
if (!(plane->possible_crtcs & (1 << dev->crtc_index)))
{
drmModeFreePlane(plane);
continue;
}
size_t j = 0;
for (j = 0; j < plane->count_formats; ++j)
{
if (plane->formats[j] == dev->format)
break;
}
if (j == plane->count_formats)
{
drmModeFreePlane(plane);
continue;
}
dev->overlay_plane = *plane;
drmModeFreePlane(plane);
break;
}
drmModeFreePlaneResources(planes);
return true;
}
static inline bool drm_set_mode(drm_device_t* dev)
{
dev->saved_crtc = drmModeGetCrtc(dev->fd, dev->crtc_id);
if (!dev->saved_crtc)
return false;
drmModeConnector* connector = dev->connector;
bool mode_found = false;
size_t j = 0;
for (j = 0; j < connector->count_modes; j++)
{
if (
connector->modes[j].hdisplay == dev->width &&
connector->modes[j].vdisplay == dev->height)
{
mode_found = 1;
break;
}
}
if (!mode_found)
{
fprintf(
stderr,
"Monitor does not support resolution %ux%u\n",
dev->width,
dev->height);
return false;
}
int ret = drmModeSetCrtc(
dev->fd,
dev->saved_crtc->crtc_id,
dev->saved_crtc->buffer_id,
dev->prim_plane.x,
dev->prim_plane.y,
&dev->con_id,
1,
&connector->modes[j]);
if (ret < 0)
return false;
return true;
}
// Allocate framebuffers and map to userland
static inline void drm_init(drm_device_t* dev, unsigned int num_buffers)
{
dev->fd = drmOpen(dev->module, NULL);
if (dev->fd < 0)
abort_info("drmOpen failed", dev->module);
for (size_t i = 0; i < num_buffers; ++i)
{
if (!drm_buffer_create(
dev, &dev->drm_bufs[i], dev->width, dev->height, XYLON_DRM_STRIDE))
abort_msg("unable to create buffer");
dev->drm_bufs[i].index = i;
}
fprintf(stderr, "DRM buffers ready\n");
if (drmSetClientCap(dev->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1))
abort_msg("universal plane not supported");
if (!drm_find_crtc(dev))
abort_msg("unable to find CRTC");
if (!drm_find_plane(dev))
abort_msg("unable to find compatible plane");
if (!drm_set_mode(dev))
abort_msg("unable set DRM configuration");
}
static inline void
drm_set_plane_state(drm_device_t* dev, unsigned int plane_id, bool enable)
{
drmModePlanePtr plane = drmModeGetPlane(dev->fd, plane_id);
int fb_id = enable ? plane->fb_id : 0;
drmModeSetPlane(
dev->fd,
plane->plane_id,
dev->crtc_id,
fb_id,
0,
plane->crtc_x,
plane->crtc_y,
dev->width,
dev->height,
plane->x << 16,
plane->y << 16,
dev->width << 16,
dev->height << 16);
}
// Set buffer index for next scanout
static inline bool drm_set_plane(drm_device_t* dev, uint32_t index)
{
// the CRTC blends the plane over the framebuffer during scanout
int ret = drmModeSetPlane(
dev->fd,
dev->overlay_plane.plane_id,
dev->crtc_id,
dev->drm_bufs[index].fb_handle,
0,
0,
0,
dev->width,
dev->height,
0,
0,
dev->width << 16,
dev->height << 16);
return ret == 0;
}
| 21.89863 | 80 | 0.65107 |
c09b1c8c13c036f7fcfcafc3c4292d1f4f3a3146 | 6,840 | c | C | base/fs/efs/control.c | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/fs/efs/control.c | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/fs/efs/control.c | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
control.c
Abstract:
This module contains the code to handle the IRP MajorFunctions of
IRP_MJ_DEVICE_CONTROL and IRP_MJ_FILE_SYSTEM_CONTROL. The code will
be responsible for correctly setting these IRP's with any necessary
information and passing them along. Any other support routine which are
directly releated (such as completion routines) to these operations can
be found in this module.
Author:
Robert Gu (robertg) 29-Oct-1996
Environment:
Kernel mode
Revision History:
--*/
#include "efs.h"
#include "efsrtl.h"
#include "efsext.h"
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, EFSFsControl)
#endif
NTSTATUS
EFSFsControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PFILE_OBJECT FileObject
)
/*++
Routine Description:
This routine is invoked whenever an I/O Request Packet (IRP) w/a major
function code of IRP_MJ_FILE_SYSTEM_CONTROL is encountered. For most
IRPs of this type, the packet is simply passed through. However, for
some requests, special processing is required.
Arguments:
DeviceObject - Pointer to the device object for this driver.
Irp - Pointer to the request packet representing the I/O request.
Return Value:
The function value is the status of the operation.
--*/
{
NTSTATUS status;
PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation( Irp );
PIO_STACK_LOCATION nextIrpSp;
PDEVICE_OBJECT deviceObject;
PKEVENT finishEvent;
PAGED_CODE();
if ( (irpSp->MinorFunction == IRP_MN_USER_FS_REQUEST) &&
(irpSp->Parameters.FileSystemControl.FsControlCode == FSCTL_SET_COMPRESSION) &&
( (irpSp->Parameters.FileSystemControl.InputBufferLength >= sizeof (USHORT)) &&
(*(PUSHORT)(Irp->AssociatedIrp.SystemBuffer) != 0 /*COMPRESSION_FORMAT_NONE*/)
)
){
//
// Compression on encrypted file is not allowed.
// Check if the file is encrypted or not
//
ULONG inputDataLength;
UCHAR *inputDataBuffer, *outputDataBuffer;
ULONG outputDataLength;
KEVENT event;
IO_STATUS_BLOCK ioStatus;
PIRP fsCtlIrp;
PIO_STACK_LOCATION fsCtlIrpSp;
inputDataLength = FIELD_OFFSET(FSCTL_INPUT, EfsFsData[0]) +
FIELD_OFFSET(GENERAL_FS_DATA, EfsData[0]);
inputDataBuffer = ExAllocatePoolWithTag(
PagedPool,
inputDataLength,
'msfE'
);
//
// The size of output data buffer is not important. We don't
// care the content. We just need to know the $EFS exists.
//
outputDataLength = 1024;
outputDataBuffer = ExAllocatePoolWithTag(
PagedPool,
outputDataLength,
'msfE'
);
if ( ( NULL == inputDataBuffer ) || ( NULL == outputDataBuffer ) ){
//
// Out of memory
//
if ( inputDataBuffer ){
ExFreePool( inputDataBuffer );
}
if ( outputDataBuffer ){
ExFreePool( outputDataBuffer );
}
return STATUS_INSUFFICIENT_RESOURCES;
}
((PFSCTL_INPUT)inputDataBuffer)->EfsFsCode = EFS_GET_ATTRIBUTE;
RtlCopyMemory(
&(((PFSCTL_INPUT)inputDataBuffer)->EfsFsData[0]),
&(EfsData.SessionKey),
DES_KEYSIZE
);
RtlCopyMemory(
&(((PFSCTL_INPUT)inputDataBuffer)->EfsFsData[0]) + DES_KEYSIZE + 2 * sizeof( ULONG ),
&(((PFSCTL_INPUT)inputDataBuffer)->EfsFsData[0]),
DES_KEYSIZE + 2 * sizeof( ULONG )
);
//
// Encrypt our Input data
//
EfsEncryptKeyFsData(
inputDataBuffer,
inputDataLength,
sizeof(ULONG),
EFS_FSCTL_HEADER_LENGTH + DES_KEYSIZE + 2 * sizeof( ULONG ),
DES_KEYSIZE + 2 * sizeof( ULONG )
);
//
// Prepare a FSCTL IRP
//
KeInitializeEvent( &event, SynchronizationEvent, FALSE);
fsCtlIrp = IoBuildDeviceIoControlRequest( FSCTL_ENCRYPTION_FSCTL_IO,
DeviceObject,
inputDataBuffer,
inputDataLength,
outputDataBuffer,
outputDataLength,
FALSE,
&event,
&ioStatus
);
if ( fsCtlIrp ) {
fsCtlIrpSp = IoGetNextIrpStackLocation( fsCtlIrp );
fsCtlIrpSp->MajorFunction = IRP_MJ_FILE_SYSTEM_CONTROL;
fsCtlIrpSp->MinorFunction = IRP_MN_USER_FS_REQUEST;
fsCtlIrpSp->FileObject = irpSp->FileObject;
status = IoCallDriver( DeviceObject, fsCtlIrp);
if (status == STATUS_PENDING) {
status = KeWaitForSingleObject( &event,
Executive,
KernelMode,
FALSE,
(PLARGE_INTEGER) NULL );
status = ioStatus.Status;
}
ExFreePool( inputDataBuffer );
ExFreePool( outputDataBuffer );
if ( NT_SUCCESS(status) || ( STATUS_BUFFER_TOO_SMALL == status) ){
//
// $EFS exist, encrypted file. Deny compression
//
return STATUS_INVALID_DEVICE_REQUEST;
}
} else {
//
// Failed allocate IRP
//
ExFreePool( inputDataBuffer );
ExFreePool( outputDataBuffer );
return STATUS_INSUFFICIENT_RESOURCES;
}
//
// Compression allowed. Simply pass this file system control request through.
//
status = STATUS_SUCCESS;
} else {
//
// Simply pass this file system control request through.
//
status = STATUS_SUCCESS;
}
//
// Any special processing has been completed, so simply pass the request
// along to the next driver.
//
return status;
}
| 28.264463 | 101 | 0.522222 |
0e0a0cdf3bf934e90c6023fe9c3edba644370f6b | 1,051 | h | C | Living_SDK/framework/protocol/linkkit/sdk/iotx-sdk-c_clone/include/exports/iot_export_guider.h | AL-Answer/HF-270-1.6.6 | fe271e48af446ed51fbe1b090be86801480afd2f | [
"Apache-2.0"
] | 12 | 2020-12-04T15:06:22.000Z | 2022-01-19T09:57:47.000Z | Living_SDK/framework/protocol/linkkit/sdk/iotx-sdk-c_clone/include/exports/iot_export_guider.h | AL-Answer/HF-270-1.6.6 | fe271e48af446ed51fbe1b090be86801480afd2f | [
"Apache-2.0"
] | 1 | 2022-03-18T07:14:27.000Z | 2022-03-18T07:14:27.000Z | Living_SDK/framework/protocol/linkkit/sdk/iotx-sdk-c_clone/include/exports/iot_export_guider.h | AL-Answer/HF-270-1.6.6 | fe271e48af446ed51fbe1b090be86801480afd2f | [
"Apache-2.0"
] | 5 | 2020-12-10T09:09:24.000Z | 2021-04-15T11:50:32.000Z | #ifndef __IOT_EXPORT_GUIDER_H__
#define __IOT_EXPORT_GUIDER_H__
#define GUIDER_ENV_LEN (10)
#define GUIDER_ENV_KEY "env"
typedef enum _region_type_e
{
REGION_TYPE_ID = 0,
REGION_TYPE_MQTTURL,
REGION_TYPE_MAX
} region_type_e;
typedef enum _guider_env_e
{
GUIDER_ENV_DAILY = 1,
GUIDER_ENV_PRERELEASE,
GUIDER_ENV_ONLINE,
GUIDER_ENV_MAX
} guider_env_e;
DLL_IOT_API int iotx_guider_set_dynamic_mqtt_url(char *p_mqtt_url);
DLL_IOT_API int iotx_guider_set_dynamic_region(int region);
DLL_IOT_API int iotx_guider_clear_dynamic_url(void);
DLL_IOT_API int iotx_guider_fill_conn_string(char *dst, int len, const char *fmt, ...);
DLL_IOT_API int iotx_redirect_region_subscribe(void);
DLL_IOT_API int iotx_reconnect_region_subscribe(void);
DLL_IOT_API int iotx_guider_get_kv_env(void);
DLL_IOT_API guider_env_e iotx_guider_get_env(void);
DLL_IOT_API iotx_cloud_region_types_t iotx_guider_get_region(void);
DLL_IOT_API int iotx_guider_get_region_id(void);
DLL_IOT_API int guider_set_direct_connect_count(unsigned char count);
#endif
| 30.911765 | 87 | 0.834443 |
3315f52904f445657848edb745b9d5ddee993f84 | 4,344 | c | C | src/helper/uihelper.c | maximilianvoss/romfetcher | 58b7075e7e59f5f2cf4522642b83b9e511516ed3 | [
"Apache-2.0"
] | 20 | 2020-05-07T23:42:06.000Z | 2022-03-08T01:31:08.000Z | src/helper/uihelper.c | maximilianvoss/romfetcher | 58b7075e7e59f5f2cf4522642b83b9e511516ed3 | [
"Apache-2.0"
] | null | null | null | src/helper/uihelper.c | maximilianvoss/romfetcher | 58b7075e7e59f5f2cf4522642b83b9e511516ed3 | [
"Apache-2.0"
] | 1 | 2021-04-19T03:40:56.000Z | 2021-04-19T03:40:56.000Z | /*
* Copyright 2020 - 2021 Maximilian Voss (maximilian@voss.rocks)
*
* 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 "uihelper.h"
uiElementRects_t uihelper_generateRectsFullScreenWidth(int x, int y, int windowWidth, int height) {
uiElementRects_t element;
element.content.x = x + 10;
element.content.y = y + 3;
element.content.w = windowWidth - 2 * (x + 10);
element.content.h = height - 6;
element.inner.x = x;
element.inner.y = y;
element.inner.w = windowWidth - 2 * x;
element.inner.h = height;
element.outter.x = x - 2;
element.outter.y = y - 2;
element.outter.w = windowWidth - 2 * x + 4;
element.outter.h = height + 4;
return element;
}
uiElementRects_t uihelper_generateRects(int x, int y, int width, int height) {
uiElementRects_t element;
element.content.x = x + 10;
element.content.y = y + 3;
element.content.w = width - 20;
element.content.h = height - 6;
element.inner.x = x;
element.inner.y = y;
element.inner.w = width;
element.inner.h = height;
element.outter.x = x - 2;
element.outter.y = y - 2;
element.outter.w = width + 4;
element.outter.h = height + 4;
return element;
}
void uihelper_noPaddingX(uiElementRects_t *element) {
element->content.x -= 10;
element->content.w += 20;
}
void uihelper_renderTexture(SDL_Renderer *sdlRenderer, texture_t *texture, SDL_Rect *target) {
SDL_Rect srcQuad = {0, 0,
(texture->w > target->w) ? target->w : texture->w,
(texture->h > target->h) ? target->h : texture->h};
SDL_Rect renderQuad = {target->x,
(texture->h > target->h) ? target->y : target->y + (target->h - texture->h) / 2,
(texture->w > target->w) ? target->w : texture->w,
(texture->h > target->h) ? target->h : texture->h};
SDL_RenderCopy(sdlRenderer, texture->texture, &srcQuad, &renderQuad);
}
void uihelper_renderTextureCentered(SDL_Renderer *sdlRenderer, texture_t *texture, SDL_Rect *target) {
SDL_Rect srcQuad = {0, 0,
(texture->w > target->w) ? target->w : texture->w,
(texture->h > target->h) ? target->h : texture->h};
SDL_Rect renderQuad = {(texture->w > target->w) ? target->x : target->x + (target->w - texture->w) / 2,
(texture->h > target->h) ? target->y : target->y + (target->h - texture->h) / 2,
(texture->w > target->w) ? target->w : texture->w,
(texture->h > target->h) ? target->h : texture->h};
SDL_RenderCopy(sdlRenderer, texture->texture, &srcQuad, &renderQuad);
}
void uihelper_renderTextureRight(SDL_Renderer *sdlRenderer, texture_t *texture, SDL_Rect *target) {
SDL_Rect srcQuad = {0, 0,
(texture->w > target->w) ? target->w : texture->w,
(texture->h > target->h) ? target->h : texture->h};
SDL_Rect renderQuad = {(texture->w > target->w) ? target->x : target->x + target->w - texture->w - 3,
(texture->h > target->h) ? target->y : target->y + (target->h - texture->h) / 2,
(texture->w > target->w) ? target->w : texture->w,
(texture->h > target->h) ? target->h : texture->h};
SDL_RenderCopy(sdlRenderer, texture->texture, &srcQuad, &renderQuad);
}
void uihelper_renderSDLTexture(SDL_Renderer *sdlRenderer, SDL_Texture *texture, SDL_Rect *target) {
SDL_Rect renderQuad = {target->x, target->y, target->w, target->h};
SDL_RenderCopy(sdlRenderer, texture, NULL, &renderQuad);
}
void uihelper_destroyTexture(texture_t *texture) {
texture->h = -1;
texture->w = -1;
SDL_DestroyTexture(texture->texture);
} | 40.598131 | 107 | 0.603821 |
81bcd5acf3c1c5c23c24972b7c33715cd6937944 | 4,365 | h | C | src/psmoveservice/PSNaviController/PSNaviController.h | wuyou33/PS | b254a10a532c11eb1c45138ea6dab57e9a8595f2 | [
"Apache-2.0"
] | null | null | null | src/psmoveservice/PSNaviController/PSNaviController.h | wuyou33/PS | b254a10a532c11eb1c45138ea6dab57e9a8595f2 | [
"Apache-2.0"
] | null | null | null | src/psmoveservice/PSNaviController/PSNaviController.h | wuyou33/PS | b254a10a532c11eb1c45138ea6dab57e9a8595f2 | [
"Apache-2.0"
] | null | null | null | #ifndef PSNAVI_CONTROLLER_H
#define PSNAVI_CONTROLLER_H
#include "PSMoveConfig.h"
#include "DeviceEnumerator.h"
#include "DeviceInterface.h"
#include "hidapi.h"
#include <string>
#include <vector>
#include <deque>
struct PSNaviHIDDetails {
std::string Device_path;
hid_device *Handle;
std::string Device_path_addr; // only needed by Win > 8.1, otherwise ignored.
hid_device *Handle_addr; // only needed by Win > 8.1, otherwise ignored.
std::string Bt_addr;
std::string Host_bt_addr;
};
struct PSNaviDataInput; // See .cpp for full declaration
class PSNaviControllerConfig : public PSMoveConfig
{
public:
PSNaviControllerConfig(const std::string &fnamebase = "PSNaviControllerConfig")
: PSMoveConfig(fnamebase)
, max_poll_failure_count(1000) // ms
{};
virtual const boost::property_tree::ptree config2ptree();
virtual void ptree2config(const boost::property_tree::ptree &pt);
long max_poll_failure_count;
};
// https://code.google.com/p/moveonpc/wiki/NavigationInputReport
struct PSNaviControllerState : public CommonControllerState
{
ButtonState L1;
ButtonState L2;
ButtonState L3;
ButtonState Circle;
ButtonState Cross;
ButtonState PS;
ButtonState DPad_Up;
ButtonState DPad_Right;
ButtonState DPad_Down;
ButtonState DPad_Left;
unsigned char Trigger; // 0-255.
unsigned char Stick_XAxis; // 0-255. Subtract 0x80 to obtain signed values
unsigned char Stick_YAxis; // 0-255. Subtract 0x80 to obtain signed values
PSNaviControllerState()
{
clear();
}
void clear()
{
CommonControllerState::clear();
DeviceType = PSNavi;
L1 = Button_UP;
L2 = Button_UP;
L3 = Button_UP;
Circle = Button_UP;
Cross = Button_UP;
PS = Button_UP;
DPad_Up = Button_UP;
DPad_Right = Button_UP;
DPad_Down = Button_UP;
DPad_Left = Button_UP;
Trigger= 0;
Stick_XAxis= 0x80;
Stick_YAxis= 0x80;
}
};
class PSNaviController : public IControllerInterface {
public:
PSNaviController();
virtual ~PSNaviController();
// PSNaviController
bool open(); // Opens the first HID device for the controller
// -- Getters
inline const PSNaviControllerConfig &getConfig() const
{ return cfg; }
// IControllerInterface
virtual bool matchesDeviceEnumerator(const DeviceEnumerator *enumerator) const override;
virtual bool open(const DeviceEnumerator *enumerator) override;
virtual IDeviceInterface::ePollResult poll() override;
virtual void close() override;
virtual bool setHostBluetoothAddress(const std::string &address) override;
virtual bool setTrackingColorID(const eCommonTrackingColorID tracking_color_id) override;
// -- Getters
virtual bool getIsBluetooth() const override;
virtual bool getIsReadyToPoll() const override;
virtual std::string getUSBDevicePath() const override;
virtual std::string getSerial() const override;
virtual std::string getAssignedHostBluetoothAddress() const override;
virtual bool getIsOpen() const override;
static CommonDeviceState::eDeviceType getDeviceTypeStatic()
{ return CommonDeviceState::PSNavi; }
virtual CommonDeviceState::eDeviceType getDeviceType() const override;
virtual const CommonDeviceState * getState(int lookBack = 0) const override;
virtual long getMaxPollFailureCount() const override;
virtual const std::tuple<unsigned char, unsigned char, unsigned char> getColour() const override;
virtual void getTrackingShape(CommonDeviceTrackingShape &outTrackingShape) const override;
virtual bool getTrackingColorID(eCommonTrackingColorID &out_tracking_color_id) const override;
private:
bool getBTAddress(std::string& host, std::string& controller);
// Constant while a controller is open
PSNaviControllerConfig cfg;
PSNaviHIDDetails HIDDetails;
bool IsBluetooth; // true if valid serial number on device opening
// Read Controller State
int NextPollSequenceNumber;
std::deque<PSNaviControllerState> ControllerStates;
PSNaviDataInput* InData; // Buffer to copy hidapi reports into
};
#endif // PSMOVE_CONTROLLER_H | 32.819549 | 109 | 0.704467 |
518906624ef786137a80829137bccaf1c833d872 | 11,156 | h | C | include/sled/bytestream.h | dsledz/sled | a7763441fe98fc6029294f85358a666353311aed | [
"BSD-2-Clause"
] | null | null | null | include/sled/bytestream.h | dsledz/sled | a7763441fe98fc6029294f85358a666353311aed | [
"BSD-2-Clause"
] | null | null | null | include/sled/bytestream.h | dsledz/sled | a7763441fe98fc6029294f85358a666353311aed | [
"BSD-2-Clause"
] | null | null | null | /*
* Copyright (c) 2019, Dan Sledz
* All rights reserved.
* Licensed under BSD-2-Clause license.
*/
#pragma once
#include "sled/numeric.h"
#include "sled/platform.h"
#include <cstddef>
namespace sled {
/**
* Arbitary fixed bit number
*/
template <int WIDTH>
struct fixed_bits {
fixed_bits() = default;
explicit constexpr fixed_bits(uint64_t v) : v(v) {}
constexpr int width() const { return WIDTH; }
uint64_t v{0};
};
/**
* Variable number of bits number.
*/
struct variable_bits {
variable_bits() = default;
explicit constexpr variable_bits(uint64_t v, int num_bits)
: v(v), w(num_bits) {}
constexpr int width() const { return w; }
uint64_t v{0};
int w{0};
};
/**
* Byte stream interface
*/
class bytestream {
public:
bytestream(std::byte *begin, std::byte *end) : begin_(begin), end_(end) {}
~bytestream() = default;
int size() { return static_cast<int>(end_ - begin_); }
void write(int offset, std::byte value) {
assert(end_ - begin_ > offset);
memcpy(begin_ + offset, &value, sizeof(value));
}
std::byte read(int offset) { return begin_[offset]; }
void pwrite(std::byte *value, int length, int offset) {
memcpy(begin_ + offset, value, length);
}
void pread(std::byte *value, int length, int offset) {
memcpy(value, begin_ + offset, length);
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void pread(T &value, int offset) {
memcpy(reinterpret_cast<std::byte *>(&value), begin_ + offset,
sizeof(value));
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void le_pwrite(T v, int offset) {
if constexpr (sizeof(T) == 2) {
uint16_t t;
mempcy(&t, &v, sizeof(t));
t = htole16(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else if constexpr (sizeof(T) == 4) {
uint32_t t;
mempcy(&t, &v, sizeof(t));
t = htole32(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else if constexpr (sizeof(T) == 8) {
uint64_t t;
mempcy(&t, &v, sizeof(t));
t = htole64(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else {
memcpy(begin_ + offset, &v, sizeof(v));
}
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void be_pwrite(T v, int offset) {
if constexpr (sizeof(T) == 2) {
uint16_t t;
mempcy(&t, &v, sizeof(t));
t = htobe16(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else if constexpr (sizeof(T) == 4) {
uint32_t t;
mempcy(&t, &v, sizeof(t));
t = htobe32(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else if constexpr (sizeof(T) == 8) {
uint64_t t;
mempcy(&t, &v, sizeof(t));
t = htobe64(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else {
memcpy(begin_ + offset, &v, sizeof(v));
}
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
T be_pread(int offset) {
T r;
if constexpr (sizeof(T) == 2) {
uint16_t t;
memcpy(&t, begin_ + offset, sizeof(t));
t = be16toh(t);
memcpy(&r, &t, sizeof(r));
} else if constexpr (sizeof(T) == 4) {
uint32_t t;
memcpy(&t, begin_ + offset, sizeof(t));
t = be32toh(t);
memcpy(&r, &t, sizeof(r));
} else if constexpr (sizeof(T) == 8) {
uint64_t t;
memcpy(&t, begin_ + offset, sizeof(t));
t = be64toh(t);
memcpy(&r, &t, sizeof(r));
} else {
memcpy(&r, begin_ + offset, sizeof(r));
}
return r;
}
uint64_t be_pread(int num_bytes, int offset) {
assert(num_bytes > 0 && num_bytes <= 8);
uint64_t r = 0;
std::byte *buf = reinterpret_cast<std::byte *>(&r);
// Copy the bytes into the correct BE position
for (int i = num_bytes; i > 0; i--, offset++) {
memcpy(&buf[8 - i], &begin_[offset], sizeof(std::byte));
}
return be64toh(r);
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
T le_pread(int offset) {
T r;
if constexpr (sizeof(T) == 2) {
uint16_t t;
memcpy(&t, begin_ + offset, sizeof(t));
t = le16toh(t);
memcpy(&r, &t, sizeof(r));
} else if constexpr (sizeof(T) == 4) {
uint32_t t;
memcpy(&t, begin_ + offset, sizeof(t));
t = le32toh(t);
memcpy(&r, &t, sizeof(r));
} else if constexpr (sizeof(T) == 8) {
uint64_t t;
memcpy(&t, begin_ + offset, sizeof(t));
t = le64toh(t);
memcpy(&r, &t, sizeof(r));
} else {
memcpy(&r, begin_ + offset, sizeof(r));
}
return r;
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void be_write(T v, int offset) {
if constexpr (sizeof(T) == 2) {
uint16_t t;
mempcy(&t, &v, sizeof(t));
t = htobe16(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else if constexpr (sizeof(T) == 4) {
uint32_t t;
mempcy(&t, &v, sizeof(t));
t = htobe32(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else if constexpr (sizeof(T) == 8) {
uint64_t t;
mempcy(&t, &v, sizeof(t));
t = htobe64(t);
memcpy(begin_ + offset, &t, sizeof(t));
} else {
memcpy(begin_ + offset, &v, sizeof(v));
}
}
/**
* Return a fixed number of bits at the specifid bit offset.
*
* Bits are stored in big endian format.
* be_pread<fixed_bits<1>>(0) would read the highest bit of the first byte
* of the bytestream.
*/
template <int WIDTH>
fixed_bits<WIDTH> be_bits_pread(int offset) {
fixed_bits<WIDTH> fb;
be_bits_pread_into(fb, WIDTH, offset);
return fb;
}
/**
* Return variable number of bits at the specified offset.
*/
variable_bits be_bits_pread(int num_bits, int offset) {
variable_bits vb;
vb.w = num_bits;
be_bits_pread_into(vb, num_bits, offset);
return vb;
}
int bits_read(int num_bits) {
variable_bits vb;
vb.w = num_bits;
if (overflow_ || (offset_ + num_bits > (size() * 8))) {
overflow_ = true;
return 0;
}
be_bits_pread_into(vb, num_bits, offset_);
offset_ += num_bits;
return vb.v;
}
bool overflow() { return overflow_; }
int bits_peek(int num_bits) {
variable_bits vb;
vb.w = num_bits;
if (overflow_ || (offset_ + num_bits > (size() * 8))) {
overflow_ = true;
return 0;
}
be_bits_pread_into(vb, num_bits, offset_);
return vb.v;
}
void bits_skip(int num_bits) {
if (overflow_ || (offset_ + num_bits > (size() * 8))) {
overflow_ = true;
return;
}
offset_ += num_bits;
}
private:
template <typename T>
void be_bits_pread_into(T &bits, int num_bits, int offset) {
int byte_offset = offset / 8;
int bits_offset = offset % 8;
int bits_left = num_bits;
while (bits_left > 0) {
/* Extract the current bits from the byte */
/* (high, low] */
int high = 8 - bits_offset;
int low = std::max(high - bits_left, 0);
std::byte b = begin_[byte_offset];
// Mask the high bits
b = b & std::byte((1u << high) - 1);
// Shift away the low bits
b = b >> low;
bits_left -= high - low;
bits.v |= std::to_integer<uint64_t>(b) << bits_left;
bits_offset = 0;
byte_offset++;
}
}
std::byte *begin_{nullptr};
std::byte *end_{nullptr};
int offset_{0};
bool overflow_{false};
};
/**
* Fixed length bytestream interface
*/
template <size_t SIZE>
class fixed_bytestream {
public:
fixed_bytestream() : bs_(data_.begin(), data_.end()) {}
~fixed_bytestream() = default;
bytestream &bs() { return bs_; }
int size() { return bs_.size(); }
void write(int offset, std::byte value) { bs_.write(offset, value); }
template <int offset>
void write(std::byte value) {
static_assert(offset + sizeof(std::byte) <= SIZE);
bs_.write(offset, value);
}
void pwrite(std::byte *value, int length, int offset) {
bs_.pwrite(value, length, offset);
}
template <int offset>
void pwrite(std::byte *value, int length) {
static_assert(offset + length <= SIZE);
bs_.pwrite(value, length, offset);
}
std::byte read(int offset) { return bs_.read(offset); }
template <int offset>
std::byte read() {
static_assert(offset + sizeof(std::byte) <= SIZE);
return bs_.read(offset);
}
void pread(std::byte *value, int length, int offset) {
bs_.pread(value, length, offset);
}
template <int offset>
void pread(std::byte *value, int length) {
bs_.pread(value, length, offset);
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void le_pwrite(T value, int offset) {
bs_.le_pwrite<T>(value, offset);
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void be_pwrite(T value, int offset) {
bs_.be_pwrite<T>(value, offset);
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
T be_pread(int offset) {
return bs_.be_pread<T>(offset);
}
uint64_t be_pread(int num_bytes, int offset) {
return bs_.be_pread(num_bytes, offset);
}
template <typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
T le_pread(int offset) {
return bs_.le_pread<T>(offset);
}
template <int offset, typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void le_pwrite(T value) {
static_assert(offset + sizeof(T) <= SIZE);
bs_.le_pwrite<T>(value, offset);
}
template <int offset, typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
void be_pwrite(T value) {
static_assert(offset + sizeof(T) <= SIZE);
bs_.be_pwrite<offset, T>(value, offset);
}
template <int offset, typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
T be_pread() {
static_assert(offset + sizeof(T) <= SIZE);
return bs_.be_pread<T>(offset);
}
template <int offset, typename T,
class = std::enable_if_t<std::is_trivially_copyable_v<T>>>
T le_pread() {
static_assert(offset + sizeof(T) <= SIZE);
return bs_.le_pread<T>(offset);
}
std::array<std::byte, SIZE> &buf() { return data_; };
private:
std::array<std::byte, SIZE> data_{};
bytestream bs_;
};
class ByteArrayFmt {
public:
template <typename T>
ByteArrayFmt(T *begin, T *end) : begin(begin), end(end) {}
friend inline std::ostream &operator<<(std::ostream &os,
ByteArrayFmt const &obj) {
bool first = true;
os << "<";
for (const std::byte *it = obj.begin; it != obj.end; it++, first = false) {
if (!first) {
os << ",";
}
os << sled::HexFmt(*it);
}
os << ">";
return os;
}
friend inline std::string fmt_string(ByteArrayFmt const &obj) {
std::stringstream os;
os << obj;
return os.str();
}
const std::byte *begin{nullptr};
const std::byte *end{nullptr};
};
} // namespace sled
| 25.883991 | 79 | 0.591251 |
b66667ab883e09c997c9828c0784f8bd8dcb34de | 57 | h | C | src/qt/include/QtCore/qsharedpointer_impl.h | ant0ine/phantomjs | 8114d44a28134b765ab26b7e13ce31594fa81253 | [
"BSD-3-Clause"
] | 46 | 2015-01-08T14:32:34.000Z | 2022-02-05T16:48:26.000Z | src/qt/include/QtCore/qsharedpointer_impl.h | ant0ine/phantomjs | 8114d44a28134b765ab26b7e13ce31594fa81253 | [
"BSD-3-Clause"
] | 7 | 2015-01-20T14:28:12.000Z | 2017-01-18T17:21:44.000Z | src/qt/include/QtCore/qsharedpointer_impl.h | ant0ine/phantomjs | 8114d44a28134b765ab26b7e13ce31594fa81253 | [
"BSD-3-Clause"
] | 14 | 2015-10-27T06:17:48.000Z | 2020-03-03T06:15:50.000Z | #include "../../src/corelib/tools/qsharedpointer_impl.h"
| 28.5 | 56 | 0.736842 |
e52f3e5f935f3994685635a3290d88f199d6f23e | 12,370 | h | C | eva/ckks/ckks_compiler.h | AlexanderViand/EVA | b544e6292045fedb32e32751f46a6ca58fd8d9cb | [
"MIT"
] | 119 | 2020-11-21T04:03:31.000Z | 2022-03-31T11:01:00.000Z | eva/ckks/ckks_compiler.h | AlexanderViand/EVA | b544e6292045fedb32e32751f46a6ca58fd8d9cb | [
"MIT"
] | 25 | 2020-11-24T21:38:09.000Z | 2022-03-24T12:35:56.000Z | eva/ckks/ckks_compiler.h | AlexanderViand/EVA | b544e6292045fedb32e32751f46a6ca58fd8d9cb | [
"MIT"
] | 37 | 2020-11-23T13:59:49.000Z | 2022-03-29T10:07:28.000Z | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
#include "eva/ckks/always_rescaler.h"
#include "eva/ckks/ckks_config.h"
#include "eva/ckks/ckks_parameters.h"
#include "eva/ckks/ckks_signature.h"
#include "eva/ckks/eager_relinearizer.h"
#include "eva/ckks/eager_waterline_rescaler.h"
#include "eva/ckks/encode_inserter.h"
#include "eva/ckks/encryption_parameter_selector.h"
#include "eva/ckks/lazy_relinearizer.h"
#include "eva/ckks/lazy_waterline_rescaler.h"
#include "eva/ckks/levels_checker.h"
#include "eva/ckks/minimum_rescaler.h"
#include "eva/ckks/mod_switcher.h"
#include "eva/ckks/parameter_checker.h"
#include "eva/ckks/scales_checker.h"
#include "eva/ckks/seal_lowering.h"
#include "eva/common/constant_folder.h"
#include "eva/common/program_traversal.h"
#include "eva/common/reduction_balancer.h"
#include "eva/common/rotation_keys_selector.h"
#include "eva/common/type_deducer.h"
#include "eva/util/logging.h"
#include <cstdint>
#include <seal/util/hestdparms.h>
namespace eva {
class CKKSCompiler {
CKKSConfig config;
void transform(Program &program, TermMap<Type> &types,
TermMapOptional<std::uint32_t> &scales) {
auto programRewrite = ProgramTraversal(program);
log(Verbosity::Debug, "Running TypeDeducer pass");
programRewrite.forwardPass(TypeDeducer(program, types));
log(Verbosity::Debug, "Running ConstantFolder pass");
programRewrite.forwardPass(ConstantFolder(
program, scales)); // currently required because executor/runtime
// does not handle this
if (config.balanceReductions) {
log(Verbosity::Debug, "Running ReductionCombiner pass");
programRewrite.forwardPass(ReductionCombiner(program));
log(Verbosity::Debug, "Running ReductionLogExpander pass");
programRewrite.forwardPass(ReductionLogExpander(program, types));
}
switch (config.rescaler) {
case CKKSRescaler::Minimum:
log(Verbosity::Debug, "Running MinimumRescaler pass");
programRewrite.forwardPass(MinimumRescaler(program, types, scales));
break;
case CKKSRescaler::Always:
log(Verbosity::Debug, "Running AlwaysRescaler pass");
programRewrite.forwardPass(AlwaysRescaler(program, types, scales));
break;
case CKKSRescaler::EagerWaterline:
log(Verbosity::Debug, "Running EagerWaterlineRescaler pass");
programRewrite.forwardPass(
EagerWaterlineRescaler(program, types, scales));
break;
case CKKSRescaler::LazyWaterline:
log(Verbosity::Debug, "Running LazyWaterlineRescaler pass");
programRewrite.forwardPass(LazyWaterlineRescaler(program, types, scales));
break;
default:
throw std::logic_error("Unhandled rescaler in CKKSCompiler.");
}
log(Verbosity::Debug, "Running TypeDeducer pass");
programRewrite.forwardPass(TypeDeducer(program, types));
log(Verbosity::Debug, "Running EncodeInserter pass");
programRewrite.forwardPass(EncodeInserter(program, types, scales));
log(Verbosity::Debug, "Running TypeDeducer pass");
programRewrite.forwardPass(TypeDeducer(program, types));
// TODO: rerunning the type deducer at every step is wasteful, but also
// forcing other passes to always keep type information up to date isn't
// something they should need to do. Type deduction should be changed
// into a thing that is done as needed locally.
if (config.lazyRelinearize) {
log(Verbosity::Debug, "Running LazyRelinearizer pass");
programRewrite.forwardPass(LazyRelinearizer(program, types, scales));
} else {
log(Verbosity::Debug, "Running EagerRelinearizer pass");
programRewrite.forwardPass(EagerRelinearizer(program, types, scales));
}
log(Verbosity::Debug, "Running TypeDeducer pass");
programRewrite.forwardPass(TypeDeducer(program, types));
log(Verbosity::Debug, "Running ModSwitcher pass");
programRewrite.backwardPass(ModSwitcher(program, types, scales));
log(Verbosity::Debug, "Running TypeDeducer pass");
programRewrite.forwardPass(TypeDeducer(program, types));
log(Verbosity::Debug, "Running SEALLowering pass");
programRewrite.forwardPass(SEALLowering(program, types));
}
void validate(Program &program, TermMap<Type> &types,
TermMapOptional<std::uint32_t> &scales) {
auto programTraverse = ProgramTraversal(program);
log(Verbosity::Debug, "Running LevelsChecker pass");
LevelsChecker lc(program, types);
programTraverse.forwardPass(lc);
try {
log(Verbosity::Debug, "Running ParameterChecker pass");
ParameterChecker pc(program, types);
programTraverse.forwardPass(pc);
} catch (const InconsistentParameters &e) {
switch (config.rescaler) {
case CKKSRescaler::Minimum:
throw std::runtime_error(
"The 'minimum' rescaler produced inconsistent parameters. Note "
"that this rescaling policy is not general and thus will not work "
"for all programs. Please use a different rescaler for this "
"program.");
case CKKSRescaler::Always:
throw std::runtime_error(
"The 'always' rescaler produced inconsistent parameters. Note that "
"this rescaling policy is not general. It is only guaranteed to "
"work for programs that have equal scale for all inputs and "
"constants.");
default:
throw std::runtime_error(
"The current rescaler produced inconsistent parameters. This is a "
"bug, as this rescaler should be able to handle all programs.");
}
}
log(Verbosity::Debug, "Running ScalesChecker pass");
ScalesChecker sc(program, scales, types);
programTraverse.forwardPass(sc);
}
std::size_t getMinDegreeForBitCount(int (*MaxBitsFun)(std::size_t),
int bitCount) {
std::size_t degree = 1024;
int maxBitsSeen = 0;
while (true) {
auto maxBitsForDegree = MaxBitsFun(degree);
maxBitsSeen = std::max(maxBitsSeen, maxBitsForDegree);
if (maxBitsForDegree == 0) {
throw std::runtime_error(
"Program requires a " + std::to_string(bitCount) +
" bit modulus, but parameters are available for a maximum of " +
std::to_string(maxBitsSeen));
}
if (maxBitsForDegree >= bitCount) {
return degree;
}
degree *= 2;
}
}
void determineEncryptionParameters(Program &program,
CKKSParameters &encParams,
TermMapOptional<std::uint32_t> &scales,
TermMap<Type> types) {
auto programTraverse = ProgramTraversal(program);
log(Verbosity::Debug, "Running EncryptionParametersSelector pass");
EncryptionParametersSelector eps(program, scales, types);
programTraverse.forwardPass(eps);
log(Verbosity::Debug, "Running RotationKeysSelector pass");
RotationKeysSelector rks(program, types);
programTraverse.forwardPass(rks);
encParams.primeBits = eps.getEncryptionParameters();
encParams.rotations = rks.getRotationKeys();
int bitCount = 0;
for (auto &logQ : encParams.primeBits)
bitCount += logQ;
if (config.securityLevel <= 128) {
if (config.quantumSafe)
encParams.polyModulusDegree = getMinDegreeForBitCount(
&seal::util::seal_he_std_parms_128_tq, bitCount);
else
encParams.polyModulusDegree = getMinDegreeForBitCount(
&seal::util::seal_he_std_parms_128_tc, bitCount);
} else if (config.securityLevel <= 192) {
if (config.quantumSafe)
encParams.polyModulusDegree = getMinDegreeForBitCount(
&seal::util::seal_he_std_parms_192_tq, bitCount);
else
encParams.polyModulusDegree = getMinDegreeForBitCount(
&seal::util::seal_he_std_parms_192_tc, bitCount);
} else if (config.securityLevel <= 256) {
if (config.quantumSafe)
encParams.polyModulusDegree = getMinDegreeForBitCount(
&seal::util::seal_he_std_parms_256_tq, bitCount);
else
encParams.polyModulusDegree = getMinDegreeForBitCount(
&seal::util::seal_he_std_parms_256_tc, bitCount);
} else {
throw std::runtime_error(
"EVA has support for up to 256 bit security, but " +
std::to_string(config.securityLevel) +
" bit security was requested.");
}
auto slots = encParams.polyModulusDegree / 2;
if (config.warnVecSize && slots > program.getVecSize()) {
warn("Program specifies vector size %i while at least %i slots are "
"required for security. "
"This does not affect correctness, as the smaller vector size will "
"be transparently emulated. "
"However, using a vector size up to %i would come at no additional "
"cost.",
program.getVecSize(), slots, slots);
}
if (slots < program.getVecSize()) {
if (config.warnVecSize) {
warn("Program uses vector size %i while only %i slots are required for "
"security. "
"This does not affect correctness, but higher performance may be "
"available "
"with a smaller vector size.",
program.getVecSize(), slots);
}
encParams.polyModulusDegree = 2 * program.getVecSize();
}
if (verbosityAtLeast(Verbosity::Info)) {
printf("EVA: Encryption parameters for %s are:\n Q = [",
program.getName().c_str());
bool first = true;
for (auto &logQ : encParams.primeBits) {
if (first) {
first = false;
printf("%i", logQ);
} else {
printf(",%i", logQ);
}
}
int n = encParams.polyModulusDegree;
int nexp = 0;
while (n >>= 1)
++nexp;
printf("] (total bits %i)\n N = 2^%i (available slots %i)\n Rotation "
"keys: ",
bitCount, nexp, encParams.polyModulusDegree / 2);
first = true;
for (auto &rotation : encParams.rotations) {
if (first) {
first = false;
printf("%i", rotation);
} else {
printf(", %i", rotation);
}
}
printf(" (count %lu)\n", encParams.rotations.size());
}
}
CKKSSignature extractSignature(const Program &program) {
std::unordered_map<std::string, CKKSEncodingInfo> inputs;
for (auto &input : program.getInputs()) {
Type type = input.second->get<TypeAttribute>();
assert(type != Type::Undef);
inputs.emplace(
input.first,
CKKSEncodingInfo(type, input.second->get<EncodeAtScaleAttribute>(),
input.second->get<EncodeAtLevelAttribute>()));
}
return CKKSSignature(program.getVecSize(), std::move(inputs));
}
public:
CKKSCompiler() {}
CKKSCompiler(CKKSConfig config) : config(config) {}
std::tuple<std::unique_ptr<Program>, CKKSParameters, CKKSSignature>
compile(Program &inputProgram) {
auto program = inputProgram.deepCopy();
log(Verbosity::Info, "Compiling %s for CKKS with:\n%s",
program->getName().c_str(), config.toString(2).c_str());
TermMap<Type> types(*program);
TermMapOptional<std::uint32_t> scales(*program);
for (auto &source : program->getSources()) {
// Error out if the scale attribute doesn't exist
if (!source->has<EncodeAtScaleAttribute>()) {
for (auto &entry : program->getInputs()) {
if (source == entry.second) {
throw std::runtime_error("The scale for input " + entry.first +
" was not set.");
}
}
throw std::runtime_error("The scale for a constant was not set.");
}
// Copy the scale from the attribute into the scales TermMap
scales[source] = source->get<EncodeAtScaleAttribute>();
}
CKKSParameters encParams;
transform(*program, types, scales);
validate(*program, types, scales);
determineEncryptionParameters(*program, encParams, scales, types);
auto signature = extractSignature(*program);
return std::make_tuple(std::move(program), std::move(encParams),
std::move(signature));
}
};
} // namespace eva
| 39.903226 | 80 | 0.65578 |
66287499d700fae730ce16a45e007cf52cbc85dd | 3,717 | h | C | DiabolicalEngine/src/ECS/ECS.h | Absurdponcho/Diabolical | a34cf6da8340315224530b50a0ce81e22bcc7b94 | [
"MIT"
] | 5 | 2022-01-18T07:46:21.000Z | 2022-02-20T13:39:36.000Z | DiabolicalEngine/src/ECS/ECS.h | Absurdponcho/Diabolical | a34cf6da8340315224530b50a0ce81e22bcc7b94 | [
"MIT"
] | null | null | null | DiabolicalEngine/src/ECS/ECS.h | Absurdponcho/Diabolical | a34cf6da8340315224530b50a0ce81e22bcc7b94 | [
"MIT"
] | 1 | 2022-02-14T00:04:38.000Z | 2022-02-14T00:04:38.000Z | #pragma once
#include "Flecs/flecs.h"
#include "Check.h"
#include "Types/DString.h"
#include "Types/DVector.h"
#include "Meta/Meta.h"
class DEntity;
struct DEntityData;
class DUtilityECS
{
public:
static void InitializeECSSystems();
static flecs::world& GetECSWorld();
private:
static flecs::world ECSWorld;
};
class DEntity
{
public:
inline static size_t GetSize(){ return sizeof(DEntity); }
// Creates a new prefab entity. This is the exact same as an entity, except it is excluded from systems and queries.
static DEntity CreatePrefab(const DString& OriginalName = "");
// Creates a new entity. Add data by adding components, add functionality by adding systems.
static DEntity CreateEntity(const DString& Name = "");
static DString GenerateUniqueName(const DString& Name);
DEntity() {};
// Makes this DEntity the same entity as ExistingEntity (does not clone data)
DEntity(const DEntity& ExistingEntity)
{
*this = ExistingEntity;
Check (FlecsEntity.id() == ExistingEntity.FlecsEntity.id());
}
DEntity(flecs::entity ExistingEntity)
{
FlecsEntity = ExistingEntity;
}
DString& GetName();
DEntity Clone(DString NewName = "");
// Set the parent entity of this entity.
// Each entity can only have 1 parent.
void SetParent(DEntity& NewParent);
// Add a child entity to this entity.
// The child entity will have this entity set as its parent.
void AddChild(DEntity& NewChild);
// Remove a child entity from this entity.
// The child will no longer have this entity as its parent.
void RemoveChild(DEntity& Child);
// Remove the parent from this entity.
// The parent will have this entity removed from its child list.
void DetachFromParent();
// Returns true if this entity is the parent of the specified child.
bool HasChild(const DEntity& Child);
DEntity& GetParent();
bool HasParent();
// Inherits an existing entity.
// Inheriting the entity means this entity will have all of the same components.
void Inherit(DEntity Parent);
// Check if this entity is valid or not.
bool IsAlive() const
{
return FlecsEntity.is_alive() ;
}
DEntityData& GetEntityData() const
{
return *FlecsEntity.get_mut<DEntityData>();
}
// Add a new component. If the entity already has the component, it will set the values.
template<typename T>
bool Set(T Component)
{
Check (IsAlive());
if (!IsAlive()) return false;
int Size = sizeof(T);
if (std::is_empty<T>())
{
FlecsEntity.add<T>();
}
else
{
FlecsEntity.set<T>(Component);
}
return true;
}
// Gets a mutable pointer to the component. This will raise an exception in some situations.
template<typename T>
T* GetComponentMutable()
{
Check(IsAlive());
if (!IsAlive()) return nullptr;
Check (FlecsEntity.has<T>());
if (!FlecsEntity.has<T>()) return nullptr;
T* Comp = FlecsEntity.get_mut<T>();
return Comp;
}
// Gets a const pointer to the component. This shouldn't fail.
template<typename T>
const T* GetComponent() const
{
Check (IsAlive());
if (!IsAlive()) return nullptr;
if (!FlecsEntity.has<T>()) return nullptr;
return FlecsEntity.get<T>();
}
inline friend bool operator== (const DEntity& LHS, const DEntity& RHS)
{
return LHS.FlecsEntity.id() == RHS.FlecsEntity.id();
}
flecs::entity GetFlecsEntity() const
{
return FlecsEntity;
}
protected:
flecs::entity FlecsEntity;
};
struct DEntityData
{
DString Name;
DEntity Parent;
DVector<DEntity> Children;
};
// Any extra data that DEntity stores should be kept inside of DEntityData as a component.
// DEntity should be able to be copied and still point to the same entity, and have the same data.
static_assert(sizeof(DEntity) == sizeof(flecs::entity), "Error"); | 23.086957 | 117 | 0.712402 |
b5829acbf9fe5c8610557427221e6eb75b2e90a6 | 266 | h | C | UIImage+Library.h | MinSZCIOS/shishangFrameWork | f0bbde9c611cf312eba7f0f41c092b5dffda1e4a | [
"MIT"
] | null | null | null | UIImage+Library.h | MinSZCIOS/shishangFrameWork | f0bbde9c611cf312eba7f0f41c092b5dffda1e4a | [
"MIT"
] | null | null | null | UIImage+Library.h | MinSZCIOS/shishangFrameWork | f0bbde9c611cf312eba7f0f41c092b5dffda1e4a | [
"MIT"
] | null | null | null | //
// UIImage+Library.h
// mytestFrameWork
//
// Created by 史志成 on 2020/7/24.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
//图片调用的分类
@interface UIImage (Library)
//从bundle中获取图片
+ (UIImage *)bundleImageNamed:(NSString *)name;
@end
NS_ASSUME_NONNULL_END
| 13.3 | 47 | 0.721805 |
687e561f914858020fdfbeaef8a7e3604ca428ac | 2,696 | h | C | Movie.h | JeffBobbo/filmpp | 5cdc8b68b449e016c961e20b363685839c6b449a | [
"MIT"
] | null | null | null | Movie.h | JeffBobbo/filmpp | 5cdc8b68b449e016c961e20b363685839c6b449a | [
"MIT"
] | null | null | null | Movie.h | JeffBobbo/filmpp | 5cdc8b68b449e016c961e20b363685839c6b449a | [
"MIT"
] | null | null | null | #ifndef MOVIE_H_INCLUDE
#define MOVIE_H_INCLUDE
#include <string>
#include <sstream>
#include <stdint.h>
#include "Ratings.h"
enum class AgeRating
{
APPROVED = 0,
G,
M,
N_A,
NOT_RATED,
PASSED,
PG,
PG_13,
R,
TV_14,
UNRATED,
X
};
std::ostream& operator<<(std::ostream& os, const AgeRating& r);
// TODO: Replace this with an operator>> implementation
AgeRating ageFrom_string(const std::string& str);
class Genre
{
public:
enum class CATEGORY
{
ACTION = 0x1,
ADVENTURE = 0x2,
ANIMATION = 0x4,
BIOGRAPHY = 0x8,
COMEDY = 0x10,
CRIME = 0x20,
DRAMA = 0x40,
FAMILY = 0x80,
FANTASY = 0x100,
FILM_NOIR = 0x200,
HISTORY = 0x400,
HORROR = 0x800,
MUSIC = 0x1000,
MUSICAL = 0x2000,
MYSTERY = 0x4000,
ROMANCE = 0x8000,
SCI_FI = 0x10000,
THRILLER = 0x20000,
WAR = 0x40000,
WESTERN = 0x80000
};
Genre() : flags(0) {}
Genre(uint32_t g) : flags(g) {}
bool operator[](const Genre::CATEGORY c) const { return (flags & static_cast<uint32_t>(c)) != 0; }
friend std::ostream& operator<<(std::ostream& os, const Genre& g);
friend std::istream& operator>>(std::istream& is, Genre& g);
private:
uint32_t flags;
};
std::ostream& operator<<(std::ostream& os, const Genre::CATEGORY& c);
Genre::CATEGORY categoryFrom_string(const std::string& str);
class Movie
{
public:
Movie() : count(0), totalScore(-1), average(0) {}
const std::string& getName() const { return name; }
const Genre& getGenre() const { return genre; }
int16_t getRuntime() const { return runtime; }
Rating::Score ratingHighest() const;
std::size_t ratingCount() const;
Rating::Score ratingTotal() const;
Rating::Score ratingAverage() const;
inline bool operator<(const Movie& other) const { return year < other.year || (year == other.year && name < other.name); }
inline bool operator>(const Movie& other) const { return year > other.year || (year == other.year && name > other.name); }
inline bool operator<=(const Movie& other) const { return !(*this > other); }
inline bool operator>=(const Movie& other) const { return !(*this < other); }
inline bool operator==(const Movie& other) const { return year == other.year && name == other.name; }
inline bool operator!=(const Movie& other) const { return !(*this == other); }
friend std::ostream& operator<<(std::ostream& os, const Movie& m);
friend std::istream& operator>>(std::istream& is, Movie& m);
private:
void calcRatings() const;
std::string name;
int16_t year;
AgeRating age;
Genre genre;
int16_t runtime;
mutable std::size_t count;
mutable Rating::Score totalScore;
mutable Rating::Score average;
};
#endif
| 24.509091 | 124 | 0.659496 |
71d700062da5f4a44476008217fa78588adbae97 | 178,726 | c | C | compiler/pmParse.c | tajmone/alan | b76a03eed8b567a130352bea4781203bcf693286 | [
"Artistic-2.0"
] | null | null | null | compiler/pmParse.c | tajmone/alan | b76a03eed8b567a130352bea4781203bcf693286 | [
"Artistic-2.0"
] | null | null | null | compiler/pmParse.c | tajmone/alan | b76a03eed8b567a130352bea4781203bcf693286 | [
"Artistic-2.0"
] | null | null | null | /*----------------------------------------------------------------------*\
pmParse.c
ParserMaker generated parser
\*----------------------------------------------------------------------*/
/* %%IMPORT */
#include "util.h"
#include "acode.h"
#include "types.h"
#include "smScan.h"
#include "token.h"
#include "lmlog.h"
#include "alt.h"
#include "evt.h"
#include "lim.h"
#include "msg.h"
#include "opt.h"
#include "sco.h"
#include "str.h"
#include "syn.h"
#include "adv_x.h"
#include "add_x.h"
#include "article_x.h"
#include "atr_x.h"
#include "cla_x.h"
#include "chk_x.h"
#include "cnt_x.h"
#include "elm_x.h"
#include "exp_x.h"
#include "ext_x.h"
#include "id_x.h"
#include "ins_x.h"
#include "description_x.h"
#include "initialize_x.h"
#include "resource_x.h"
#include "rul_x.h"
#include "lst_x.h"
#include "prop_x.h"
#include "res_x.h"
#include "scr_x.h"
#include "stm_x.h"
#include "stp_x.h"
#include "stx_x.h"
#include "sym_x.h"
#include "srcp_x.h"
#include "vrb_x.h"
#include "whr_x.h"
#include "wht_x.h"
/* END %%IMPORT */
#include <string.h>
#include <setjmp.h>
#include "pmParse.h"
#define PMTRUE 1
#define PMFALSE 0
typedef unsigned char PmBoolean; /* For logical values */
/* System dependencies */
/* These datatypes should be defined to be unsigned integers of length 1, 2
* and 4 bytes respectively.
*/
typedef unsigned char UByte1;
typedef unsigned short UByte2;
typedef unsigned int UByte4;
/* Token definition */
#include "alanCommon.h"
/* %%ATTRIBUTES - The semantic attributes for grammar symbols */
typedef struct pmGrammar {
bool wordOrChar;
What *wht;
Where *whr;
List *vrbs;
Verb *vrb;
int val;
Transitivity transitivity;
List *syns;
Synonym *syn;
List *stxs;
Syntax *stx;
char *str;
List *stps;
Step *stp;
List *stms3;
List *stms2;
List *stms;
Statement *stm;
Srcp srcp2;
Srcp srcp;
List *set;
List *scrs;
Script *scr;
SayForm sayForm;
List *ruls;
RulNod *rul;
RestrictionKind restrictionKind;
List *ress;
Restriction *res;
QualKind qual;
Srcp pronounsSrcp;
List *pronouns;
List *prompt;
bool present;
bool opaque;
OperatorKind op;
bool on_or_off;
Article *negative;
List *nams;
List *nam;
List *msgs;
Message *msg;
bool minus;
bool isMeta;
Srcp mentionedSrcp;
List *mentioned;
List *lims;
LimNod *lim;
bool isForm;
List *inss;
Instance *ins;
Article *indefinite;
List *idList2;
List *idList;
Id *id;
List *form;
bool first;
List *exts;
Exit *ext;
List *exps;
Expression *exp;
List *evts;
Event *evt;
Initialize *initialize;
Srcp enteredSrcp;
List *entered;
List *elms;
Element *elm;
Srcp descriptionSrcp;
List *descriptionDoes;
List *descriptionChecks;
Srcp descriptionCheckSrcp;
Description *description;
Srcp definiteSrcp;
bool definiteIsForm;
Article *definite;
List *cnts;
Container *cnt;
List *clas;
Class *cla;
List *chks;
CheckNode *chk;
List *cases;
int bits;
List *atrs;
Attribute *atr;
Article *article;
List *alts;
Alternative *alt;
AggregateKind agr;
AddNode *add;
} pmGrammar;
/* END %%ATTRIBUTES */
/* Parser constants *\
\* ---------------- */
#define ERROR_ACT 0 /* Action - Error */
#define SHIFT_ACT 1 /* Action - Shift */
#define SHIFTRED_ACT 2 /* Action - Shift_Reduce */
#define REDUCE_ACT 3 /* Action - Reduce */
#define ACCEPT_ACT 4 /* Action - Accept */
#define ERR_SYM 0 /* Error token */
#define ENDMARK 1 /* End of file token code */
/* Recovery method *\
\* --------------- */
#define NONE_REC 0 /* No recovery found */
#define IN_REC 1 /* Insertion of symbol(s) */
#define DEL_REC 2 /* Deletion of symbol(s) */
#define REP_REC 3 /* Replacement of symbol(s) */
#define BAK_REC 4 /* Stack backup */
#define HALT_REC 5 /* System halted */
/* Error class *\
\* ----------- */
#define LEX_ERR 1 /* Non valid scanner symbol found */
#define SYN_ERR 2 /* Normal syntax error */
#define OFLW_ERR 3 /* Parse stack overflow */
#define TAB_ERR 4 /* Parse table error */
/* Error severity *\
\* -------------- */
#define WAR_SEV 1 /* Warnings */
#define ERR_SEV 2 /* Repairable error */
#define FAT_SEV 3 /* Fatal error */
#define SYS_SEV 4 /* System & limit error */
/* Parser constants *\
\* ---------------- */
#define SccMax 150 /* Max scanner code value */
#define TermMin 1 /* Minimum terminal number */
#define Terms 150 /* Number of terminals in grammar */
#define StateMin 1 /* Minimum state number */
#define States 372 /* Number of states */
#define ProdMin 1 /* Minimum production number */
#define Prods 386 /* Number of productions */
#define PmStkMax 64 /* Parse stack size */
#define PmLaMax 5 /* Look-ahead length */
#define PmCost 5 /* Shifting cost */
/* Types *\
\* ----- */
typedef unsigned char TermSet[(Terms + TermMin + 7) >> 3]; /* Terminal set */
typedef UByte2 ParseStack[PmStkMax]; /* Parse stack */
/* Terminal table *\
\* -------------- */
typedef struct {
UByte1 tsym; /* Normal continuation */
UByte1 ssym; /* Separator continuation */
} ContRec;
typedef struct {
ContRec cont[372]; /* Continuation function */
TermSet sepa; /* Separator symbols */
TermSet fiduc; /* Fiducial symbols */
TermSet skip; /* Symbols to skip */
} RecTab;
typedef struct {
UByte2 act[16106]; /* Action table */
UByte2 actCheck[16118]; /* Row Displacement Check Vector*/
UByte2 actRix[372]; /* Action row mapping */
RecTab recover; /* Error recovery info */
} TermTab;
static TermTab act = {
{4,2643,705,2643,2643,2105,2643,2643,2643,2649,2643,2643,258,2643,2643,2643
,2643,2643,2643,2643,2643,2643,2643,2643,2643,1987,2643,2643,2643,2643,2643
,105,2643,2643,2643,2643,2290,2643,2643,2643,2643,105,2643,2643,2643,2643
,2643,2643,2643,2643,2970,153,2963,2643,2643,1474,2643,2643,2643,2643,1346
,2643,2643,2643,2643,1562,1354,2643,2643,2643,2643,2643,2643,2643,153,2643
,2643,2643,2643,2643,2643,153,2393,2401,2762,2057,2746,2754,2770,2643,2425
,2643,2643,2643,2643,2643,587,2643,2643,2762,2643,2746,2754,2770,2643,2643
,2643,2433,1570,2643,2643,2643,529,2643,2465,1241,1467,1266,2643,2643,2643
,1099,2643,2643,2643,2643,2643,1553,1979,2643,2643,2643,2643,2643,2643,2643
,2643,2643,2643,2643,2643,2643,2041,2643,2643,2643,2643,2643,2643,2643,2675
,1259,2675,2675,153,2675,2675,89,2105,2675,2675,626,2675,2675,2675,2675
,2675,683,2675,2675,2675,2675,2675,2675,2353,2675,2675,2675,2675,2675,2675
,2675,2675,2675,2675,683,2675,2675,2675,2675,1761,2675,2675,2675,2675,2675
,2675,2675,2675,1467,1025,266,2675,2675,2009,2675,2675,2675,2675,683,2675
,2675,2675,2675,322,1217,2675,2675,2675,2675,2675,2675,2675,153,2675,2675
,2675,2675,2675,2675,1842,2658,1761,2762,89,2746,2754,2770,2675,409,2675
,2675,2675,2675,2675,2178,2675,2675,2762,2675,2746,2754,2770,2675,2675,2675
,2051,1481,2675,2675,2675,1441,2675,153,2211,2155,2163,2675,2675,2675,2666
,2675,2675,2675,2675,2675,153,1289,2675,2675,2675,2675,2675,2675,2675,2675
,2675,2675,2675,2675,2675,1833,2675,2675,2675,2675,2675,2675,2675,2523,1826
,2523,2523,2298,89,2523,89,873,2523,2523,1513,2523,2523,2523,2523,2523,1370
,2523,2523,2523,2523,2523,2523,1907,2306,2523,2523,2523,2523,2523,2523,2523
,2523,2523,2074,2523,2523,2523,2523,2635,2523,2523,2523,2523,2523,2523,2523
,2523,1609,153,1145,2523,2523,2057,2523,2523,2523,2523,2489,2523,2523,2523
,2523,2082,1298,2523,2523,2523,2523,2523,2523,2523,1858,2523,2523,2523,2523
,2523,2523,307,441,449,307,1939,89,2554,1946,2523,1850,2523,2523,2523,2523
,2523,2027,2523,2523,2762,2523,2746,2754,2770,2523,2523,2523,153,1954,2523
,2523,2523,2041,2523,2057,1273,153,2027,2523,2523,2523,1281,2523,2523,2523
,2523,2523,2706,457,2523,2523,2523,2523,2523,2523,2523,2523,2523,2523,2523
,2523,2523,1730,2523,2523,2523,2523,2523,2523,2523,2131,2131,2507,1962,2138
,1465,1834,2131,1722,1970,89,2194,89,2010,369,89,2131,2131,153,2714,2131
,2041,2131,2131,2131,1890,257,2131,2131,283,153,2131,2131,2131,2131,2131
,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,1810
,153,1665,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2561,2131
,1313,2131,2131,2131,2131,2131,2323,2131,489,2323,2131,2131,2131,2131,2131
,1001,2219,2131,2131,2131,89,1738,2131,1705,1818,2131,2131,2131,2131,2323
,2131,2131,2131,2131,2131,2617,2131,2131,2131,2131,2131,2066,2131,2131,2131
,2131,1866,2131,2546,1377,777,2131,2131,2131,2131,2131,2131,2131,2131,2131
,2131,354,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2131,2323
,2131,1746,2131,2131,2131,2323,2131,2131,2131,2171,2171,385,635,2171,2689
,1754,2171,1899,1874,809,218,2635,210,2737,2753,2171,2171,1762,89,2171,2465
,2171,2171,2171,2249,635,2171,2171,2785,1073,2171,2171,2171,2171,2171,2171
,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2226,2234
,1793,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2809,2171,1882
,2171,2171,2171,2171,2171,849,2171,2242,2250,2171,2186,2171,2171,2171,2202
,2857,2171,2171,2171,2305,2258,2171,2538,1185,2171,2171,2171,2171,2266,2171
,2171,2171,2171,2171,2905,2171,2171,2171,2171,2171,57,2171,2171,2171,2171
,1450,2171,2274,689,929,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171
,1042,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,2171,82,2171
,90,2171,2171,2171,2282,2171,2171,2171,2739,2739,74,0,2739,89,0,2739,2739
,0,2739,2739,2739,2739,2739,0,0,2739,2739,2739,2739,0,0,0,2739,0,2739,2739
,0,2739,2739,2739,2739,0,2739,2739,2739,0,0,2739,2739,2739,2739,2739,2739
,2739,0,0,0,0,2739,2739,0,2739,2739,2739,2739,0,2739,2739,2739,2739,0,0
,2739,2739,2739,2739,2739,2739,2739,0,2739,2739,2739,2739,2739,2739,1899
,0,0,0,2635,0,0,2691,2739,0,2739,2739,2739,0,2739,0,2739,0,0,2739,0,0,1073
,2739,2739,2883,2883,0,2739,2739,2739,0,2739,0,0,0,0,2739,2739,2739,0,2739
,2739,2739,2739,2739,0,0,2739,2739,2739,2739,2739,2739,2739,2739,0,2739
,2739,2739,2739,0,2739,2739,2739,2739,2739,2739,2739,2515,2883,2883,0,2515
,0,2515,2515,2515,2515,2515,0,1051,2515,0,2515,2515,0,0,0,1715,0,0,2515
,0,2515,2515,2515,2515,0,1715,2515,2515,2515,0,2515,2515,2515,1715,1715
,1715,1715,0,2883,0,635,1715,1715,1715,1715,1715,2515,1715,1715,1715,1715
,1715,0,1715,635,2515,2515,1715,1715,1715,2898,1715,0,635,0,1715,1715,1715
,1715,0,0,0,635,0,2906,0,0,635,2890,1715,1715,1715,2105,0,0,1715,0,0,1715
,1793,0,0,1715,1715,0,0,0,2515,1715,1715,0,1715,0,1793,0,0,1715,1715,1715
,0,1715,1715,2515,1715,1715,0,555,1715,1715,2515,1715,1715,1715,1715,2515
,1339,1715,1715,0,1715,0,1715,1715,2515,555,1715,1715,2515,0,555,0,0,0,0
,1339,0,1339,1339,1339,0,0,1225,1339,0,0,1339,0,0,0,0,0,1339,1339,0,0,555
,1339,1339,1339,129,1129,1217,841,1339,0,0,0,1339,1339,0,609,1714,1339,1339
,0,1339,1339,1339,0,0,0,1339,1339,545,561,577,0,945,0,0,1339,2178,825,617
,625,0,0,0,0,0,0,0,1339,0,0,593,713,969,1339,0,0,649,1339,0,1339,0,0,0,1339
,1339,1339,0,1339,1339,737,889,0,681,0,0,0,0,1339,1339,1339,1339,761,793
,0,633,641,0,0,1339,1339,1339,73,905,1049,1105,1339,1339,1339,1339,0,1305
,0,1339,1339,1339,0,665,1339,1339,2403,0,0,2403,0,0,2403,2403,0,2403,2403
,2403,2403,2403,0,0,1066,2403,2403,2403,0,0,0,2403,0,2403,2403,0,2403,2403
,2403,2403,19,0,2403,2403,329,19,1074,1082,1090,2403,2403,2403,2403,0,0
,0,0,19,0,19,2403,2403,2403,19,0,0,0,0,2403,0,0,2403,2403,2403,2403,2403
,2403,2403,0,2403,2403,2403,2403,2403,2403,0,0,19,19,19,0,0,0,0,0,2403,2403
,2403,0,2403,0,2403,0,19,0,42,19,19,2403,0,89,0,0,2403,2403,2403,0,2403
,0,0,34,19,0,0,2883,2883,2403,2403,2403,2403,2403,0,19,0,0,2403,2403,2403
,2403,2403,2403,0,0,0,2403,2403,0,0,0,2403,2403,2403,0,2403,409,2411,0,0
,2411,0,0,2411,2411,0,2411,2411,2411,2411,2411,2883,2883,0,2411,2411,2411
,0,0,0,2411,0,2411,2411,0,2411,2411,2411,2411,2521,0,2411,2411,2691,2801
,0,0,0,2411,2411,2411,2411,0,0,0,0,563,0,2577,2411,2411,2411,570,2883,0
,0,0,2411,0,0,2411,2411,2411,2411,2411,2411,2411,0,2411,2411,2411,2411,2411
,2411,0,2898,1625,2921,41,0,0,0,0,0,2411,2411,2411,0,2411,2906,2411,0,2665
,2890,0,114,1569,2411,0,0,0,0,2411,2411,2411,0,2411,0,0,0,1585,0,0,0,0,2411
,2411,2411,2411,2411,0,2625,0,0,2411,2411,2411,2411,2411,2411,0,0,0,2411
,2411,0,0,0,2411,2411,2411,2363,2411,0,2363,0,0,2363,2762,0,2746,2754,2770
,2363,2363,0,0,0,2363,2363,2363,0,0,0,2363,0,0,2363,0,2363,2363,2363,2363
,99,0,2363,2363,0,99,0,0,0,2363,2363,2363,2363,0,0,0,0,99,0,99,2363,2363
,2363,99,0,0,0,0,2363,0,0,2363,2363,2363,2363,2363,2363,2363,0,2363,2363
,2363,2363,2363,2363,0,0,99,99,99,0,0,0,0,0,2363,2363,2363,0,2363,0,2363
,0,99,0,0,99,99,2363,0,0,0,0,2363,2363,2363,0,2363,0,0,0,99,0,0,0,0,2363
,2363,2363,2363,2363,0,99,0,0,2363,2363,2363,2363,2363,2363,0,0,0,2363,2363
,0,0,0,2363,2363,2363,2379,2363,0,2379,0,0,2379,2762,0,2746,2754,2770,2379
,2379,0,0,0,2379,2379,2379,0,0,0,2379,0,0,2379,0,2379,2379,2379,2379,0,0
,2379,2379,0,0,0,0,0,2379,2379,2379,2379,0,0,0,0,0,0,0,2379,2379,2379,0
,0,0,0,0,2379,0,0,2379,2379,2379,2379,2379,2379,2379,0,2379,2379,2379,2379
,2379,2379,0,0,0,0,0,0,0,0,0,0,2379,2379,2379,0,2379,0,2379,0,0,0,0,0,0
,2379,0,0,2883,2883,2379,2379,2379,0,2379,0,0,0,2883,2883,0,0,0,2379,2379
,2379,2379,2379,0,0,0,0,2379,2379,2379,2379,2379,2379,0,0,0,2379,2379,0
,0,0,2379,2379,2379,675,2379,675,675,2883,2883,0,1225,0,0,0,0,0,0,2883,2883
,0,675,0,675,0,0,675,675,675,129,1129,1217,841,0,0,0,0,675,675,675,609,1714
,0,675,675,675,675,675,0,675,2883,675,675,545,561,577,0,945,0,0,2883,2178
,825,617,625,0,0,0,0,0,0,0,2898,0,0,593,713,969,0,0,0,649,2898,0,675,0,2906
,0,697,675,2890,0,0,675,737,889,2906,681,0,0,2890,0,675,675,675,0,761,793
,0,633,641,0,0,675,675,675,73,905,1049,1105,0,0,675,675,0,1305,0,675,675
,675,0,665,675,675,2387,0,0,2387,0,0,2387,2762,0,2746,2754,2770,2387,2387
,0,0,0,2387,2387,2387,0,0,0,2387,0,0,2387,0,2387,2387,2387,2387,0,0,2387
,2387,0,2883,2883,0,0,2387,2387,2387,2387,0,0,0,0,0,0,0,2387,2387,2387,425
,0,0,0,0,2387,0,0,2387,2387,2387,2387,2387,2387,2387,0,2387,2387,2387,2387
,2387,2387,0,0,0,0,0,2883,2883,0,0,0,2387,2387,2387,0,2387,0,2387,0,0,0
,0,0,0,2387,0,0,0,0,2387,2387,2387,0,2387,0,0,0,0,0,0,0,0,2387,2387,2387
,2387,2387,0,2883,0,0,2387,2387,2387,2387,2387,2387,0,0,0,2387,2387,0,0
,0,2387,2387,2387,2395,2387,2898,2395,0,0,2395,2762,0,2746,2754,2770,2395
,2395,0,0,2906,2395,2395,2395,2890,0,0,2395,0,0,2395,0,2395,2395,2395,2395
,0,0,2395,2395,0,0,0,0,0,2395,2395,2395,2395,0,0,0,0,0,0,0,2395,2395,2395
,0,0,0,0,0,2395,0,0,2395,2395,2395,2395,2395,2395,2395,0,2395,2395,2395
,2395,2395,2395,0,0,0,0,0,0,0,0,0,0,2395,2395,2395,0,2395,0,2395,0,0,0,0
,0,0,2395,0,0,0,0,2395,2395,2395,0,2395,0,0,0,0,0,0,0,0,2395,2395,2395,2395
,2395,0,0,0,0,2395,2395,2395,2395,2395,2395,0,0,0,2395,2395,0,0,0,2395,2395
,2395,643,2395,643,643,0,0,0,1225,0,0,0,0,0,0,0,0,0,643,0,0,0,0,643,643
,643,129,1129,1217,841,0,0,0,0,643,643,643,609,1714,0,643,643,643,643,643
,0,643,0,643,643,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0
,0,0,0,593,713,969,0,0,0,649,0,0,643,0,0,0,697,643,0,0,0,643,737,889,0,681
,0,0,0,0,643,643,643,0,761,793,0,633,641,0,0,643,643,643,73,905,1049,1105
,0,0,643,643,0,1305,0,643,643,643,0,665,643,643,635,0,635,635,0,0,0,1225
,0,0,0,0,0,0,0,0,0,635,0,0,0,0,635,635,635,129,1129,1217,841,0,0,0,0,635
,635,0,609,1714,0,635,635,635,635,635,0,635,0,635,635,545,561,577,0,945
,0,0,0,2178,825,617,625,0,0,0,0,0,1793,0,0,0,0,593,713,969,0,0,0,649,0,0
,635,0,0,0,697,635,0,0,0,635,737,889,0,681,0,0,0,0,635,635,635,0,761,793
,0,633,641,0,0,635,635,635,73,905,1049,1105,0,0,635,635,0,1305,0,635,635
,635,0,665,635,635,1387,0,1387,1387,0,0,0,1225,0,0,0,0,0,0,0,0,0,1387,0
,0,0,0,1387,1387,1387,129,1129,1217,841,0,0,0,0,1387,1387,0,609,1714,1387
,1387,0,1387,1387,1387,0,0,0,1387,1387,545,561,577,0,945,0,0,0,2178,825
,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1387,0,0,0,697,1387
,0,0,0,1387,737,889,0,681,0,0,0,0,1387,1387,1387,1387,761,793,0,633,641
,0,0,1387,1387,1387,73,905,1049,1105,0,0,1387,1387,0,1305,0,1387,1387,1387
,0,665,1387,1387,699,0,699,699,0,0,0,1225,0,0,0,0,0,0,0,0,0,699,0,0,0,0
,699,699,699,129,1129,1217,841,0,0,0,0,699,699,699,609,1714,0,699,0,699
,699,699,0,699,0,699,699,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0
,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,699,0,0,0,697,699,0,0,0,699,737
,889,0,681,0,0,0,0,699,699,699,0,761,793,0,633,641,0,0,699,699,699,73,905
,1049,1105,0,0,699,699,0,1305,0,699,699,699,0,665,699,699,635,0,635,635
,0,0,0,1225,0,0,0,0,0,0,0,0,0,635,0,0,0,0,635,635,635,129,1129,1217,841
,0,0,0,0,635,635,0,609,1714,0,635,635,635,635,635,0,0,0,635,635,545,561
,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,1793,0,0,0,0,593,713,969,0,0
,0,649,0,0,635,0,0,0,697,635,0,0,0,635,737,889,0,681,0,0,0,0,635,635,635
,0,761,793,0,633,641,0,0,635,635,635,73,905,1049,1105,0,0,635,635,0,1305
,0,635,635,635,0,665,635,635,1403,0,1403,1403,0,0,0,1225,0,0,0,0,0,0,0,0
,0,1403,0,0,0,0,1403,1403,1403,129,1129,1217,841,0,0,0,0,1403,1403,0,609
,1714,0,1403,0,1403,1403,1403,0,0,0,1403,1403,545,561,577,0,945,0,0,0,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1403,0,0,0,697
,1403,0,0,0,1403,737,889,0,681,0,0,0,0,1403,1403,1403,1403,761,793,0,633
,641,0,0,1403,1403,1403,73,905,1049,1105,0,0,1403,1403,0,1305,0,1403,1403
,1403,0,665,1403,1403,1123,0,1123,1123,0,0,0,1225,0,0,0,0,0,0,0,0,0,1123
,0,0,0,0,1123,1123,1123,129,1129,1217,841,0,0,0,0,1123,1123,0,609,1714,0
,1123,0,1123,1123,1123,0,1123,0,1123,1123,545,561,577,0,945,0,0,0,2178,825
,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1123,0,0,0,697,1123
,0,0,0,1123,737,889,0,681,0,0,0,0,1123,1123,1123,0,761,793,0,633,641,0,0
,1123,1123,1123,73,905,1049,1105,0,0,1123,1123,0,1305,0,1123,1123,1123,0
,665,1123,1123,1499,0,1499,1499,0,0,0,1225,0,0,0,0,0,0,0,0,0,1499,0,0,0
,0,1499,1499,1499,129,1129,1217,841,0,0,0,0,1499,1499,0,609,1714,0,1499
,0,1499,1499,1499,0,1499,0,1499,1499,545,561,577,0,945,0,0,0,2178,825,617
,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1499,0,0,0,697,1499,0
,0,0,1499,737,889,0,681,0,0,0,0,1499,1499,1499,0,761,793,0,633,641,0,0,1499
,1499,1499,73,905,1049,1105,0,0,1499,1499,0,1305,0,1499,1499,1499,0,665
,1499,1499,1507,0,1507,1507,0,0,0,1225,0,0,0,0,0,0,0,0,0,1507,0,0,0,0,1507
,1507,1507,129,1129,1217,841,0,0,0,0,1507,1507,0,609,1714,0,1507,0,1507
,1507,1507,0,1507,0,1507,1507,545,561,577,0,945,0,0,0,2178,825,617,625,0
,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1507,0,0,0,697,1507,0,0,0,1507
,737,889,0,681,0,0,0,0,1507,1507,1507,0,761,793,0,633,641,0,0,1507,1507
,1507,73,905,1049,1105,0,0,1507,1507,0,1305,0,1507,1507,1507,0,665,1507
,1507,1515,0,1515,1515,0,0,0,1225,0,0,0,0,0,0,0,0,0,1515,0,0,0,0,1515,1515
,1515,129,1129,1217,841,0,0,0,0,1515,1515,0,609,1714,0,1515,0,1515,1515
,1515,0,1515,0,1515,1515,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0
,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1515,0,0,0,697,1515,0,0,0,1515
,737,889,0,681,0,0,0,0,1515,1515,1515,0,761,793,0,633,641,0,0,1515,1515
,1515,73,905,1049,1105,0,0,1515,1515,0,1305,0,1515,1515,1515,0,665,1515
,1515,1147,0,1147,1147,0,0,0,1225,0,0,0,0,0,0,0,0,0,1147,0,0,0,0,1147,1147
,1147,129,1129,1217,841,0,0,0,0,1147,1147,0,609,1714,0,1147,0,1147,1147
,1147,0,0,0,1147,1147,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0
,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1147,0,0,0,697,1147,0,0,0,1147,737
,889,0,681,0,0,0,0,1147,1147,1147,0,761,793,0,633,641,0,0,1147,1147,1147
,73,905,1049,1105,0,0,1147,1147,0,1305,0,1147,1147,1147,0,665,1147,1147
,1155,0,1155,1155,0,0,0,1225,0,0,0,0,0,0,0,0,0,1155,0,0,0,0,1155,1155,1155
,129,1129,1217,841,0,0,0,0,1155,1155,0,609,1714,0,1155,0,1155,1155,1155
,0,0,0,1155,1155,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0
,0,0,0,593,713,969,0,0,0,649,0,0,1155,0,0,0,697,1155,0,0,0,1155,737,889
,0,681,0,0,0,0,1155,1155,1155,0,761,793,0,633,641,0,0,1155,1155,1155,73
,905,1049,1105,0,0,1155,1155,0,1305,0,1155,1155,1155,0,665,1155,1155,1163
,0,1163,1163,0,0,0,1225,0,0,0,0,0,0,0,0,0,1163,0,0,0,0,1163,1163,1163,129
,1129,1217,841,0,0,0,0,1163,1163,0,609,1714,0,1163,0,1163,1163,1163,0,0
,0,1163,1163,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0
,0,593,713,969,0,0,0,649,0,0,1163,0,0,0,697,1163,0,0,0,1163,737,889,0,681
,0,0,0,0,1163,1163,1163,0,761,793,0,633,641,0,0,1163,1163,1163,73,905,1049
,1105,0,0,1163,1163,0,1305,0,1163,1163,1163,0,665,1163,1163,1171,0,1171
,1171,0,0,0,1225,0,0,0,0,0,0,0,0,0,1171,0,0,0,0,1171,1171,1171,129,1129
,1217,841,0,0,0,0,1171,1171,0,609,1714,0,1171,0,1171,1171,1171,0,0,0,1171
,1171,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713
,969,0,0,0,649,0,0,1171,0,0,0,697,1171,0,0,0,1171,737,889,0,681,0,0,0,0
,1171,1171,1171,0,761,793,0,633,641,0,0,1171,1171,1171,73,905,1049,1105
,0,0,1171,1171,0,1305,0,1171,1171,1171,0,665,1171,1171,1187,0,1187,1187
,0,0,0,1225,0,0,0,0,0,0,0,0,0,1187,0,0,0,0,1187,1187,1187,129,1129,1217
,841,0,0,0,0,1187,1187,0,609,1714,0,1187,0,1187,1187,1187,0,0,0,1187,1187
,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969
,0,0,0,649,0,0,1187,0,0,0,697,1187,0,0,0,1187,737,889,0,681,0,0,0,0,1187
,1187,1187,0,761,793,0,633,641,0,0,1187,1187,1187,73,905,1049,1105,0,0,1187
,1187,0,1305,0,1187,1187,1187,0,665,1187,1187,1179,0,1179,1179,0,0,0,1225
,0,0,0,0,0,0,0,0,0,1179,0,0,0,0,1179,1179,1179,129,1129,1217,841,0,0,0,0
,1179,1179,0,609,1714,0,1179,0,1179,1179,1179,0,0,0,1179,1179,545,561,577
,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1179,0,0,0,697,1179,0,0,0,1179,737,889,0,681,0,0,0,0,1179,1179,1179
,0,761,793,0,633,641,0,0,1179,1179,1179,73,905,1049,1105,0,0,1179,1179,0
,1305,0,1179,1179,1179,0,665,1179,1179,1195,0,1195,1195,0,0,0,1225,0,0,0
,0,0,0,0,0,0,1195,0,0,0,0,1195,1195,1195,129,1129,1217,841,0,0,0,0,1195
,1195,0,609,1714,0,1195,0,1195,1195,1195,0,0,0,1195,1195,545,561,577,0,945
,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1195
,0,0,0,697,1195,0,0,0,1195,737,889,0,681,0,0,0,0,1195,1195,1195,0,761,793
,0,633,641,0,0,1195,1195,1195,73,905,1049,1105,0,0,1195,1195,0,1305,0,1195
,1195,1195,0,665,1195,1195,1427,0,1427,1427,0,0,0,1225,0,0,0,0,0,0,0,0,0
,1427,0,0,0,0,1427,1427,1427,129,1129,1217,841,0,0,0,0,1427,1427,0,609,1714
,0,1427,0,1427,1427,1427,0,0,0,1427,1427,545,561,577,0,945,0,0,0,2178,825
,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1427,0,0,0,697,1427
,0,0,0,1427,737,889,0,681,0,0,0,0,1427,1427,1427,0,761,793,0,633,641,0,0
,1427,1427,1427,73,905,1049,1105,0,0,1427,1427,0,1305,0,1427,1427,1427,0
,665,1427,1427,2355,0,0,2867,0,0,2355,0,0,0,0,0,2867,2867,0,0,0,2355,2867
,2867,0,0,0,2355,0,0,2355,0,2867,2867,2867,2867,0,0,2874,2355,0,0,0,0,0
,2355,2355,2355,2355,0,0,0,0,0,0,0,2355,2355,2355,0,0,0,0,0,2355,0,0,2867
,2867,2355,2355,2355,2355,2355,0,2355,2355,2355,2355,2355,2355,0,0,0,0,0
,0,0,0,0,0,2355,2355,2355,0,2355,0,2355,0,0,0,0,0,0,2355,0,0,0,0,2867,2355
,2355,0,2355,0,0,0,0,0,0,0,0,2355,2355,2867,2355,2355,0,0,0,0,2867,2355
,2355,2355,2355,2867,0,0,0,2355,2355,0,0,0,2867,2355,2355,2347,2867,0,2867
,0,0,2347,0,0,0,0,0,2867,2867,0,0,0,2347,2867,2867,0,0,0,2347,0,0,2347,0
,2867,2867,2867,2867,0,0,2874,2347,0,0,0,0,0,2347,2347,2347,2347,0,0,0,0
,0,0,0,2347,2347,2347,0,0,0,0,0,2347,0,0,2867,2867,2347,2347,2347,2347,2347
,0,2347,2347,2347,2347,2347,2347,0,0,0,0,0,0,0,0,0,0,2347,2347,2347,0,2347
,0,2347,0,0,0,0,0,0,2347,0,0,0,0,2867,2347,2347,0,2347,0,0,0,0,0,0,0,0,2347
,2347,2867,2347,2347,507,0,0,0,2867,2347,2347,2347,2347,2867,0,0,0,2347
,2347,0,0,0,2867,2347,2347,0,2867,507,0,0,1225,507,0,0,507,0,0,0,0,507,0
,0,507,0,507,0,0,0,129,1129,1217,841,507,0,0,0,507,0,507,609,1714,0,507
,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0,507,2178,825,617,625,0,0,507,507
,507,0,0,0,0,0,593,713,969,507,0,0,649,507,507,0,0,507,507,507,507,507,0
,0,0,737,889,0,681,0,0,0,507,0,0,0,0,761,793,0,633,641,0,507,2115,0,0,73
,905,1049,1105,507,507,2115,2115,0,1305,2115,0,2115,2115,0,665,0,1225,0
,0,0,0,2115,2115,2115,2115,0,2115,2115,0,2115,0,2115,2115,2115,129,1129
,1217,841,0,0,0,0,0,0,0,609,1714,2115,0,0,0,0,0,0,0,0,2115,2115,545,561
,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0
,649,0,0,0,0,0,0,697,0,0,0,0,2115,737,889,0,681,0,0,387,0,0,0,0,0,761,793
,2115,633,641,0,0,0,0,2115,73,905,1049,1105,2115,0,0,387,0,1305,1225,387
,0,2115,387,665,0,2115,0,387,0,0,0,0,387,0,0,0,129,1129,1217,841,387,0,0
,0,387,0,387,609,1714,0,387,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0,387
,2178,825,617,625,0,0,387,387,387,0,0,0,0,0,593,713,969,387,0,0,649,387
,387,0,0,387,387,387,387,387,0,0,0,737,889,0,681,0,0,0,387,0,0,0,0,761,793
,0,633,641,0,387,2107,0,0,73,905,1049,1105,387,387,2107,2107,0,1305,2107
,0,2107,2107,0,665,0,1225,0,0,0,0,2107,2107,2107,2107,0,2107,2107,0,2107
,0,2107,2107,2107,129,1129,1217,841,0,0,0,0,0,0,0,609,1714,2107,0,0,0,0
,0,0,0,0,2107,2107,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0
,0,0,0,0,593,713,969,0,0,0,649,0,0,0,0,0,0,697,0,0,0,0,2107,737,889,0,681
,0,0,0,0,0,0,0,0,761,793,2107,633,641,0,0,0,0,2107,73,905,1049,1105,2107
,0,2994,2979,0,1305,233,0,0,2107,281,665,0,2107,0,2986,0,0,0,0,0,1066,0
,2867,2867,3050,0,0,1225,3042,2147,0,3058,0,0,0,0,0,0,2874,0,2867,0,1074
,1082,1090,129,1129,1217,841,3090,2594,2602,2610,0,0,0,609,1849,0,0,0,0
,0,0,0,0,0,2867,2867,545,561,577,0,945,0,0,3074,2178,825,617,625,2650,0
,0,0,0,0,0,2578,0,0,593,713,969,3066,0,0,1857,3010,0,0,0,0,0,1865,3018,3082
,0,0,2867,737,889,0,681,353,0,0,0,0,0,0,2994,761,793,1537,633,641,121,0
,0,0,2867,73,905,1049,1105,3034,3002,0,0,1315,1305,1315,1315,3050,2867,0
,665,3042,2867,0,3058,0,0,0,0,0,1315,1977,0,0,0,1315,1315,1315,0,0,0,0,3090
,0,0,0,1315,1315,0,0,0,1315,1315,0,1315,1315,1315,0,0,0,1315,1315,0,0,0
,0,0,0,0,3074,0,0,0,0,0,0,0,0,0,0,0,1985,0,0,0,0,0,3066,0,0,0,3010,0,1315
,0,0,0,3026,1315,3082,0,1315,1315,0,0,0,0,0,0,0,0,1315,1315,1315,1315,0
,0,0,0,0,0,0,1315,1315,1315,1225,0,0,0,3034,3002,1315,1315,0,1579,2609,1315
,1315,1315,1579,0,1315,1315,129,1129,1217,841,0,0,0,0,1579,0,1579,609,1714
,0,1579,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,1579
,1579,1579,0,0,0,0,0,593,713,969,0,0,0,649,0,1579,0,0,1579,1579,697,0,0
,0,0,0,737,889,0,681,0,0,0,1579,0,0,0,0,761,793,0,633,641,0,1579,0,1225
,0,73,905,1049,1105,0,0,0,203,0,1305,0,0,203,0,0,665,129,1129,1217,841,0
,0,0,0,203,0,203,609,1714,0,203,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0
,0,2178,825,617,625,0,0,203,203,203,0,0,0,0,0,593,713,969,0,0,0,649,0,203
,0,2331,203,203,697,0,0,2331,0,0,737,889,0,681,0,0,0,203,2331,0,0,0,761
,793,2331,633,641,2331,203,0,0,0,73,905,1049,1105,169,0,0,0,0,1305,2331
,2331,2331,2331,0,665,0,0,0,0,0,2331,2331,2331,0,0,0,0,0,2331,0,0,0,0,2331
,2331,2331,2331,2331,0,2331,2331,2331,2331,2331,2331,0,0,0,0,0,0,0,0,0,0
,2331,2331,2331,0,2331,0,2331,0,0,0,2339,0,0,2331,0,0,2339,0,0,2331,2331
,0,2331,0,0,0,0,2339,0,0,0,2331,2331,2339,2331,2331,2339,0,0,0,0,2331,2331
,2331,2331,169,0,0,0,2331,2331,2339,2339,2339,2339,2331,2331,0,0,0,0,0,2339
,2339,2339,0,0,0,0,0,2339,0,0,0,0,2339,2339,2339,2339,2339,0,2339,2339,2339
,2339,2339,2339,0,0,0,0,0,0,0,0,0,0,2339,2339,2339,0,2339,1066,2339,2867
,2867,0,0,0,0,2339,0,0,0,0,0,2339,2339,0,2339,2874,0,2867,0,1074,1082,1090
,0,2339,2339,0,2339,2339,0,0,2994,0,0,2339,2339,2339,2339,0,0,0,0,2339,2339
,0,2867,2867,0,2339,2339,979,0,979,979,3050,0,0,0,3042,0,0,3058,0,0,0,0
,0,979,1977,0,0,0,979,979,979,0,0,0,0,3090,0,0,0,979,979,0,0,2867,0,979
,0,979,979,979,0,0,0,979,979,0,0,0,0,0,0,0,3074,0,0,2867,0,0,0,0,0,0,2786
,0,0,0,0,0,0,2867,3066,2818,2826,2867,3010,0,979,2883,2883,0,3026,979,3082
,0,0,979,0,2778,2794,2802,2810,0,0,0,979,979,979,0,0,0,0,0,0,0,0,979,979
,979,2994,0,0,1226,3034,3002,979,979,0,0,0,979,979,979,2883,2883,979,979
,0,1219,0,1219,1219,3050,0,0,0,3042,0,0,3058,0,0,0,0,0,1219,0,0,0,0,1219
,1219,1219,0,0,0,0,3090,0,0,0,1219,1219,0,0,2883,0,1219,0,1219,1219,1219
,0,0,0,1219,1219,0,0,0,513,0,0,0,3074,0,0,2898,0,0,0,0,497,0,0,0,0,0,0,0
,0,2906,3066,0,0,2890,3010,0,1219,0,0,0,3026,1219,3082,0,0,1219,0,0,0,0
,0,0,0,0,1219,1219,1219,0,0,0,0,0,0,0,2994,1219,1219,1219,0,0,1282,0,3034
,3002,1219,1219,0,0,0,1219,1219,1219,0,0,1219,1219,1291,3050,1291,1291,0
,3042,0,0,3058,0,0,0,0,0,0,0,0,1291,0,0,0,0,1291,1291,1291,0,3090,0,0,0
,0,0,0,1291,1291,0,0,0,1291,1291,0,1291,1291,1291,0,0,0,1291,1291,0,0,0
,0,3074,0,0,0,0,2650,0,0,0,0,0,0,0,0,0,0,0,0,3066,0,0,0,3010,0,0,0,0,1291
,3026,3018,3082,0,1291,1993,1291,1291,1291,0,0,0,0,0,0,0,0,1291,1291,1291
,1291,0,0,121,0,0,0,0,1291,1291,1291,1225,3034,3002,0,0,0,1291,1291,0,0
,2019,1291,1291,1291,0,0,1291,1291,129,1129,1217,841,0,0,0,0,0,0,0,609,1714
,2019,0,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0
,0,0,0,0,0,0,0,593,713,969,0,0,1497,649,0,0,2835,0,0,0,697,0,0,0,0,0,737
,889,0,681,0,0,0,0,2835,2835,2835,2835,761,793,0,633,641,0,0,2835,2835,0
,73,905,1049,1105,0,0,0,0,0,1305,2835,2835,2835,0,2835,665,0,0,2835,2835
,2835,2835,0,2858,0,0,0,0,0,0,2850,0,2835,2835,2835,0,0,0,2835,0,0,0,0,0
,0,2835,0,0,0,0,1225,2835,2835,0,2835,0,2842,0,0,0,2043,0,0,2835,2835,0
,2835,2835,129,1129,1217,841,0,2835,2835,2835,2835,0,0,609,1714,2043,2835
,0,0,0,0,0,2835,0,0,0,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0
,0,0,0,0,0,593,713,969,0,0,2043,649,0,0,0,0,0,0,697,0,0,0,0,1225,737,889
,0,681,0,0,0,0,0,2035,0,0,761,793,0,633,641,129,1129,1217,841,0,73,905,1049
,1105,0,0,609,1714,2035,1305,0,0,0,0,0,665,0,0,0,545,561,577,0,945,0,0,0
,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,2035,649,0,0,0,0,0
,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,0,0,0,0,761,793,0,633,641,1307,0
,1307,1307,0,73,905,1049,1105,0,0,0,0,0,1305,0,0,1307,0,0,665,0,1307,1307
,1307,0,0,0,0,0,0,0,0,1307,1307,0,0,0,1307,1307,0,1307,1307,1307,0,0,0,1307
,1307,0,0,0,0,0,0,0,0,0,0,1066,0,2867,2867,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2874
,0,2867,1307,1074,1082,1090,0,1307,0,1905,1307,1307,1546,0,0,0,0,0,0,0,1307
,1307,1307,1307,0,0,0,0,2867,2867,0,1307,1307,1307,0,1539,0,0,153,0,1307
,1307,0,0,0,1307,1307,1307,0,0,1307,1307,0,1539,1539,1539,1539,0,0,0,0,0
,0,0,1539,1539,0,0,0,0,2867,0,0,0,0,0,0,1539,1539,1539,0,1539,0,0,0,1539
,1539,1539,1539,0,0,0,2867,0,0,0,0,0,0,1539,1539,1539,0,0,0,1539,2867,0
,1225,0,2867,0,1539,0,0,0,0,0,1539,1539,0,1539,0,0,0,0,129,1129,1217,841
,1539,1539,0,1539,1539,0,0,609,1714,0,1539,1539,1539,1539,0,0,0,2297,0,1539
,545,561,577,0,945,1539,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,2265,0,593
,713,969,0,0,0,649,0,0,0,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,0,0,0
,0,761,793,0,633,641,651,0,651,651,0,73,905,1049,1105,0,0,0,0,0,1305,0,0
,651,0,1817,665,0,651,651,651,0,0,0,0,0,0,0,0,651,651,651,0,0,0,651,651
,651,651,651,2867,651,0,651,651,0,0,0,0,2867,2867,0,0,0,0,2867,2867,0,0
,0,0,0,0,0,0,2867,2867,2867,2867,0,0,2874,0,0,0,0,651,0,0,0,0,651,0,0,0
,651,1530,0,0,0,0,0,0,0,651,651,651,2499,0,0,2867,2867,0,0,0,651,651,651
,0,1523,0,0,153,0,651,651,0,0,0,651,651,651,0,0,651,651,0,1523,1523,1523
,1523,0,0,0,0,0,0,0,1523,1523,0,0,2867,0,0,0,0,0,0,0,0,1523,1523,1523,0
,1523,0,2867,0,1523,1523,1523,1523,0,2867,0,0,0,0,2867,0,0,0,1523,1523,1523
,0,0,2867,1523,0,0,2867,0,0,0,1523,0,0,0,0,1225,1523,1523,0,1523,0,0,0,0
,0,1201,0,0,1523,1523,0,1523,1523,129,1129,1217,841,0,1523,1523,1523,1523
,0,0,609,1714,0,1523,0,0,0,0,0,1523,0,0,0,545,561,577,0,945,0,0,0,2178,825
,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,0,0,0,0,697,0,0,0
,0,1225,737,889,0,681,0,0,0,0,0,2059,0,0,761,793,0,633,641,129,1129,1217
,841,0,73,905,1049,1105,0,0,609,1714,0,1305,0,0,0,0,0,665,0,0,0,545,561
,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0
,649,0,0,0,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,0,0,0,0,761,793,0,633
,641,1379,0,1379,1379,0,73,905,1049,1105,0,0,0,0,0,1305,0,0,1379,0,0,665
,0,1379,1379,1379,0,0,0,0,0,0,0,0,1379,1379,0,0,0,1379,1379,0,1379,1379
,1379,0,0,0,1379,1379,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,1379,0,0,0,0,1379,1619,0,1889,1379,0,0,0,0,0,0,0,0,1379,1379
,1379,1379,0,0,0,0,0,0,0,1379,1379,1379,0,1225,0,0,0,0,1379,1379,0,0,0,1379
,1379,1379,0,0,1379,1379,0,129,1129,1217,841,0,0,0,0,0,0,0,609,1714,0,0
,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0,0,2178,825,617,625,0,1627,0,0,0
,0,0,0,0,0,593,713,969,0,0,0,649,0,0,0,0,0,0,697,0,0,0,0,1225,737,889,0
,681,0,0,0,0,0,0,0,0,761,793,0,633,641,129,1129,1217,841,0,73,905,1049,1105
,0,0,609,1714,0,1305,0,0,0,0,0,665,0,0,0,545,561,577,0,945,0,0,0,2178,825
,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,0,0,0,0,697,0,0,0
,0,1225,737,889,0,681,0,0,0,0,0,2897,0,0,761,793,0,633,641,129,1129,1217
,841,0,73,905,1049,1105,0,0,609,1714,0,1305,0,0,0,0,0,665,0,0,0,545,561
,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0
,649,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841
,761,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561
,577,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0
,0,649,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217
,841,761,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545
,561,577,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969
,0,0,0,649,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217
,841,761,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545
,561,577,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969
,0,0,0,649,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217
,841,761,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545
,561,577,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969
,0,0,0,649,0,0,0,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,0,2105,1226,0
,761,793,0,633,641,0,0,0,0,0,73,905,1049,1105,1219,0,1219,1219,0,1305,0
,1225,0,0,0,665,0,0,0,0,0,1219,0,0,0,0,1219,1219,1219,129,1129,1217,841
,0,0,0,0,1219,1219,0,609,1714,0,1219,0,1219,1219,1219,0,0,0,1219,1219,545
,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0
,0,0,649,0,0,1219,0,0,0,697,1219,0,0,0,1219,737,889,0,681,0,0,0,0,1219,1219
,1219,0,761,793,0,633,641,0,0,1219,1219,1219,73,905,1049,1105,1225,0,1219
,1219,0,1305,0,1219,1219,1219,0,665,1219,1219,0,0,0,0,129,1129,1217,841
,0,0,0,0,0,0,0,609,1714,0,0,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0,0,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1225,0,0,0,697
,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761,793,0,633,641,0,0
,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577,0,945,665,0,0,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,0,0,0,0,697,0
,0,0,0,0,737,889,0,681,0,0,0,0,0,0,0,0,761,793,0,633,641,0,0,0,0,705,73
,905,1049,1105,3027,3027,0,0,3027,1305,3027,3027,3027,3027,3027,665,0,3027
,0,3027,3027,0,0,0,1225,0,0,3027,3027,3027,3027,3027,3027,0,0,3027,3027
,3027,0,3027,3027,3027,129,1129,1217,841,0,0,0,0,0,0,0,609,1714,3027,0,0
,0,0,0,0,0,0,3027,3027,545,561,577,0,945,0,0,0,2178,825,617,625,0,0,0,0
,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1225,0,0,0,697,0,0,0,0,3027,737,889
,0,681,0,0,0,0,129,1129,1217,841,761,793,3027,633,641,0,0,609,1714,3027
,73,905,1049,1105,3027,0,0,0,0,1305,545,561,577,3027,945,665,0,3027,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,0,0,0,0,697,0
,0,0,0,0,737,889,0,681,0,0,0,0,0,0,0,0,761,793,0,633,641,1395,0,1395,1395
,0,73,905,1049,1105,0,0,0,0,0,1305,0,0,1395,0,0,665,0,1395,1395,1395,0,0
,0,0,0,0,0,0,1395,1395,0,0,0,1873,1395,0,1395,1395,1395,0,0,0,1395,1395
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1395,0,0
,0,0,1395,0,0,0,1395,0,0,0,0,0,0,0,0,1395,1395,1395,1395,0,0,0,0,0,0,0,1395
,1395,1395,1225,0,0,0,0,0,1395,1395,0,0,0,1395,1395,1395,0,0,1395,1395,129
,1129,1217,841,0,0,0,0,0,0,0,609,1714,0,0,0,0,0,0,0,0,0,0,0,545,561,577
,0,945,0,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,1225,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761
,793,0,633,641,0,0,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577
,0,945,665,0,0,2178,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649
,0,0,0,0,0,0,697,0,0,0,0,0,737,889,0,681,0,0,0,0,0,0,0,0,761,793,0,633,641
,683,0,683,683,0,73,905,1049,1105,0,0,0,0,0,1305,0,0,683,0,0,665,0,683,683
,683,0,0,0,0,0,0,0,0,683,683,0,0,0,0,683,1761,683,683,683,0,683,0,683,683
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,0,0
,0,683,0,0,0,683,0,0,0,0,0,0,0,0,683,683,683,0,0,0,0,0,0,0,0,683,683,683
,1225,0,0,0,0,0,683,683,0,0,0,683,683,683,0,0,683,683,129,1129,1217,841
,0,0,0,0,0,0,0,609,1714,0,0,0,0,0,0,0,0,0,0,0,545,561,577,0,945,0,0,0,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1225,0,0,0,697
,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761,793,0,633,641,0,0
,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577,0,945,665,0,0,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1225,0,0,0,697
,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761,793,0,633,641,0,0
,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577,0,945,665,0,0,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,1225,0,0,0,697
,0,0,0,0,0,737,889,0,681,0,0,0,0,129,1129,1217,841,761,793,0,633,641,0,0
,609,1714,0,73,905,1049,1105,0,0,0,0,0,1305,545,561,577,0,945,665,0,0,2178
,825,617,625,0,0,0,0,0,0,0,0,0,0,593,713,969,0,0,0,649,0,0,0,0,0,0,697,0
,0,0,0,0,737,889,1018,681,0,0,0,0,0,0,0,0,761,793,0,633,641,0,1011,0,1011
,1011,73,905,1049,1105,0,0,0,0,0,1305,0,0,0,1011,0,665,0,0,1011,1011,1011
,0,0,0,0,0,0,0,0,1011,1011,0,0,0,866,1011,0,1011,1011,1011,0,0,0,1011,1011
,0,0,0,0,0,859,0,859,859,0,0,0,0,0,0,0,0,0,0,0,0,0,859,0,0,0,0,859,859,859
,0,1011,0,0,0,0,1011,0,859,859,1011,0,0,0,859,0,859,859,859,1011,1011,1011
,859,859,0,0,0,0,0,0,1011,1011,1011,0,0,0,0,0,0,1011,1011,0,0,0,1011,1011
,1011,0,0,1011,1011,0,0,0,0,859,0,0,0,0,859,0,0,0,859,0,0,0,0,0,0,0,0,859
,859,859,0,0,0,0,0,0,0,0,859,859,859,0,835,0,835,835,0,859,859,0,0,0,859
,859,859,0,0,859,859,835,0,0,2505,0,835,835,835,0,0,0,0,0,0,0,0,835,835
,0,0,0,0,835,0,835,835,835,0,0,0,835,835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1915
,1915,0,0,1915,0,0,0,1915,0,0,0,0,1915,0,0,835,0,0,0,0,835,0,1915,0,835
,0,1915,0,0,1915,0,0,0,835,835,835,0,0,0,0,0,0,0,0,835,835,835,1915,1915
,1915,1915,0,0,835,835,1915,0,0,835,835,835,0,0,835,835,0,1411,0,1411,1411
,1915,0,1930,1915,1915,0,0,0,0,1915,0,0,0,1411,0,0,1915,0,1411,1411,1411
,0,1922,1915,0,1915,1915,0,0,1411,1411,0,1915,1915,1915,1411,0,1411,1411
,1411,0,0,1915,1411,1411,0,0,0,0,0,0,0,0,0,0,1915,0,0,0,0,0,0,0,0,1915,1915
,0,0,1915,835,0,835,835,0,1915,0,1411,0,0,0,0,1411,0,0,0,1411,835,0,0,2505
,0,835,835,835,1411,1411,1411,1745,0,0,0,0,835,835,0,1411,1411,1411,835
,0,835,835,835,0,1411,1411,835,835,0,1411,1411,1411,0,0,1411,1411,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,683,683,0,0,0,835,0,0,0,0,835,0,0,0,835
,683,0,0,0,0,683,683,683,835,835,835,0,0,0,0,0,683,683,0,835,835,835,683
,1761,683,683,683,0,835,835,683,683,0,835,835,835,0,0,835,835,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,835,0,835,835,0,0,0,683,0,0,0,0,683,0,0,0,683,835
,0,0,2505,0,835,835,835,683,683,683,0,0,0,0,0,835,835,0,683,683,683,835
,0,835,835,835,0,683,683,835,835,0,683,683,683,0,0,683,683,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,835,0,0,0,0,835,0,0,0,835,0,0,0,0,0,0,0
,0,835,835,835,0,0,0,0,0,0,0,0,835,835,835,0,0,0,0,0,0,835,835,0,0,0,835
,835,835,0,0,835,835,2970,0,2963,0,0,2531,0,0,0,2531,0,2531,2531,2531,2531
,2531,0,0,2531,0,2531,2531,0,0,0,0,0,0,2531,0,2531,2531,2531,2531,0,0,2531
,2531,2531,0,2531,2531,2531,0,0,0,1459,0,1459,1459,0,0,0,0,0,0,2531,0,0
,0,0,0,0,1459,0,2531,2531,0,1459,1459,1459,0,0,0,0,2994,2961,0,66,1459,1459
,0,0,0,0,1459,0,1459,1459,1459,0,2249,0,1459,1459,0,0,0,3050,0,0,0,3042
,0,0,3058,0,2531,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2531,3090,0,0,1459,0,0,2531
,0,1459,0,0,2531,1459,0,0,0,0,0,0,0,2531,1459,1459,1459,2531,0,0,3074,0
,0,0,0,1459,1459,1459,0,1066,0,2883,2883,0,1459,1459,0,0,3066,1459,1459
,1459,3010,0,1459,1459,1657,0,3026,3018,3082,1074,1082,1090,0,0,0,0,0,0
,0,0,563,2337,0,0,0,0,570,0,1027,2073,1250,0,0,0,2883,2883,0,0,3034,3002
,0,875,0,875,875,0,0,0,0,0,0,0,0,0,0,0,0,0,875,0,0,0,0,875,875,875,0,2209
,0,0,0,0,1243,0,875,875,2883,0,0,0,875,0,875,875,875,1027,2129,2089,875
,875,0,0,0,0,0,0,2161,2169,2898,0,0,0,0,0,0,2145,1243,0,0,0,1034,2113,2906
,0,0,2009,2890,0,0,0,0,875,0,0,0,0,875,0,0,0,875,0,0,0,0,0,0,0,0,875,875
,875,0,0,0,0,0,0,0,0,875,875,875,0,1066,0,2883,2883,0,875,875,0,0,0,875
,875,875,0,0,875,875,2553,0,0,0,0,1074,1082,1090,0,0,0,0,0,0,0,0,563,2337
,0,0,0,0,570,0,1027,2073,1250,0,0,0,2883,2883,0,0,0,0,0,875,0,875,875,0
,0,0,0,0,0,0,0,0,0,0,0,0,875,0,0,0,0,875,875,875,0,2209,0,0,0,0,1243,0,875
,875,2883,0,0,0,875,0,875,875,875,1027,2129,2089,875,875,0,0,0,0,0,0,2161
,2169,2898,0,0,0,0,0,0,2145,1243,0,0,0,1034,2113,2906,0,0,2009,2890,0,0
,0,0,875,0,0,0,0,875,0,0,0,875,0,0,0,0,0,0,0,0,875,875,875,0,0,0,0,0,0,0
,0,875,875,875,0,1066,0,2883,2883,0,875,875,0,0,0,875,875,875,0,0,875,875
,2849,0,0,0,0,1074,1082,1090,0,0,0,0,0,0,0,0,563,2337,0,0,0,0,570,0,1027
,2073,1250,0,0,0,2883,2883,0,0,0,0,0,0,0,2994,2979,0,0,233,0,0,0,281,0,0
,0,0,2986,0,0,0,0,0,0,0,0,0,3050,2209,0,0,3042,0,1243,3058,0,0,2883,0,0
,0,0,0,0,0,0,1027,2129,2089,0,0,0,3090,2594,2602,2610,0,2161,2169,2898,2514
,0,0,2994,0,0,2145,1243,0,0,0,1034,2113,2906,0,2315,2009,2890,2315,3074
,2969,0,0,0,2650,0,3050,0,0,0,3042,2578,0,3058,0,0,0,3066,2315,0,2530,3010
,0,875,0,875,875,3026,3018,3082,0,3090,0,0,0,0,0,353,0,0,875,0,0,0,0,875
,875,875,0,0,121,0,0,0,0,0,875,875,3074,3034,3002,0,875,2315,875,875,875
,0,0,2315,875,875,0,0,0,0,3066,0,0,0,3010,0,0,0,0,0,3026,3018,3082,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,875,0,0,0,0,875,0,0,0,875,0,0,0,0,0,3034,3002,0,875
,875,875,0,0,0,0,0,0,0,0,875,875,875,0,1771,1771,0,0,1771,875,875,0,1771
,0,875,875,875,1771,0,875,875,1802,0,0,0,0,0,1794,1786,0,0,1771,0,0,1771
,0,0,0,0,1778,771,0,0,771,0,0,0,0,0,0,0,0,1771,1771,1771,1771,0,0,778,0
,1771,0,0,771,0,0,0,771,0,0,771,0,0,0,0,771,0,0,0,1771,771,0,0,0,1771,0
,0,0,771,0,0,1771,771,0,771,0,0,1771,771,0,1771,1771,0,0,0,0,0,1771,1771
,1771,0,0,0,0,0,771,0,1771,0,0,0,0,771,771,771,539,0,0,0,0,1771,0,0,771
,0,0,0,771,771,1771,1771,771,771,771,771,771,0,0,539,0,0,0,539,0,0,539,771
,0,0,0,539,0,0,2721,0,539,0,771,0,0,0,0,0,539,0,771,771,539,0,539,0,0,0
,539,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,539,0,0,0,0,0,0,539,539,539,2994,0
,0,2915,0,0,0,0,539,0,0,0,539,539,2994,0,539,539,539,539,539,0,0,3050,0
,0,0,3042,0,0,3058,539,0,0,0,2915,0,3050,0,0,2915,3042,539,0,3058,0,0,0
,3090,0,539,539,2915,0,2915,0,0,0,2915,0,0,0,3090,0,0,0,0,0,0,0,0,0,0,0
,0,3074,0,0,0,0,0,0,2915,2915,2915,2994,0,0,2915,3074,0,0,0,3066,2650,0
,0,3010,2915,2994,0,2915,2915,3026,3018,3082,0,3066,3050,0,0,3010,3042,0
,0,3058,2915,3026,3018,3082,2915,0,3050,0,0,2915,3042,2915,0,3058,0,0,0
,3090,0,3034,3002,2915,0,2915,121,0,0,2915,0,0,0,3090,0,3034,3002,0,0,0
,0,0,0,0,0,0,3074,0,0,0,0,0,0,2915,2915,2915,2994,0,0,2915,3074,0,0,0,3066
,2650,0,0,3010,2915,0,0,2915,2915,3026,3018,3082,0,3066,3050,0,0,3010,3042
,0,0,3058,2915,3026,3018,3082,2915,0,0,0,0,2915,0,2915,0,0,0,0,0,3090,0
,3034,3002,2915,0,2915,121,0,0,2915,0,0,0,0,0,3034,3002,0,0,0,0,0,0,0,0
,0,3074,0,0,0,0,0,0,2915,2915,2915,0,0,0,0,0,2994,0,0,3066,0,0,0,3010,2915
,0,0,2915,2915,3026,3018,3082,0,2969,0,0,0,0,0,3050,0,0,2915,3042,0,0,3058
,0,0,0,0,27,0,2915,0,0,27,0,0,0,2994,3034,3002,0,3090,0,0,0,27,0,27,0,0
,0,27,0,0,0,0,0,2994,2979,0,3050,233,0,0,3042,281,0,3058,3074,0,2986,0,0
,0,0,27,27,27,0,0,3050,0,0,0,3042,3090,3066,3058,0,0,3010,27,0,0,27,27,3026
,3018,3082,0,0,0,0,0,0,3090,2594,2602,2610,27,0,0,3074,2514,0,0,0,2650,0
,0,27,0,0,0,0,0,0,0,3034,3002,3066,0,3074,0,3010,0,0,2650,0,0,3026,3018
,3082,0,2578,0,0,0,0,0,3066,2994,2979,2530,3010,233,0,0,0,281,3026,3018
,3082,121,2986,0,0,0,0,0,353,0,3034,3002,3050,0,0,0,3042,0,0,3058,0,121
,0,2994,2979,0,0,0,275,0,3034,3002,0,0,0,0,2986,3090,2594,2602,2610,0,0
,2994,2979,2514,3050,233,0,0,3042,281,0,3058,0,0,2986,0,0,0,0,0,0,0,3074
,2883,3050,0,0,2650,3042,3090,0,3058,0,0,2578,0,0,314,0,0,3066,0,0,2530
,3010,0,0,0,0,3090,3026,3018,3082,0,0,0,3074,2514,0,0,353,2650,0,0,0,0,0
,0,0,0,0,0,0,121,3066,0,3074,0,3010,0,0,2650,3034,3002,3026,3018,3082,0
,0,0,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082,121,0,0,0,2994
,2979,0,353,233,3034,3002,0,281,0,0,0,0,2986,0,0,121,0,0,0,2898,0,0,3050
,0,3034,3002,3042,0,0,3058,0,0,0,2906,0,0,0,2890,0,0,0,0,0,0,0,0,0,3090
,2594,2602,2610,0,0,0,0,2514,0,2994,2979,0,0,233,0,0,0,281,0,0,0,0,2986
,0,0,0,3074,0,0,0,0,2650,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,0,0,2530
,3010,0,0,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0,0,353,2514,0,2994
,2979,0,0,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050
,0,0,0,3042,0,2578,3058,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082
,3090,2594,2602,2610,0,0,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0,121
,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042,0,2578,3058,0,0
,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0
,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074,0,3034
,3002,0,2650,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,0,0,2530,3010,0,0
,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0,0,353,2514,0,2994,2979,0,0
,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042
,0,2578,3058,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,2594
,2602,2610,0,0,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0,121,0,0,2986,0
,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,0
,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0,0,353,2514
,0,2994,2979,0,0,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074,0,3034,3002,0,2650
,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018
,3082,3090,2594,2602,2610,0,0,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0
,121,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042,0,2578,3058
,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,2594,2602,2610
,0,0,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074
,0,3034,3002,0,2650,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,0,0,2530,3010
,0,0,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0,0,353,2514,0,2994,2979
,0,0,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050,0,0
,0,3042,0,2578,3058,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082
,3090,2594,2602,2610,0,0,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0,121
,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042,0,2578,3058,0,0
,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0
,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074,0,3034
,3002,0,2650,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,2994,0,2530,3010,0
,0,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0,0,353,2514,0,0,3050,0,0
,0,3042,0,0,3058,0,121,0,0,331,0,0,0,3074,331,3034,3002,0,2650,0,0,0,3090
,0,0,2578,331,0,331,0,0,3066,331,0,2530,3010,0,0,0,0,0,3026,3018,3082,0
,0,0,0,0,3074,0,353,0,0,0,0,331,331,331,2994,0,0,0,0,121,0,0,3066,0,0,0
,3010,331,3034,3002,331,331,3026,3018,3082,0,0,3050,0,0,0,3042,0,0,3058
,331,0,0,0,395,0,0,0,0,395,0,331,0,2994,2979,0,0,3090,275,3034,3002,395
,0,395,0,0,2986,395,0,0,0,0,0,2994,2979,0,3050,233,0,0,3042,281,0,3058,3074
,0,2986,0,0,0,0,395,395,395,0,0,3050,0,0,0,3042,3090,3066,3058,0,0,3010
,395,0,314,395,395,3026,3018,3082,0,0,0,0,0,0,3090,2594,2602,2610,395,0
,0,3074,2514,0,0,0,2650,0,0,395,0,0,0,0,0,0,0,3034,3002,3066,0,3074,0,3010
,0,0,2650,0,0,3026,3018,3082,0,2578,0,0,0,0,0,3066,2994,2979,2530,3010,233
,0,0,0,281,3026,3018,3082,121,2986,0,0,0,0,0,353,0,3034,3002,3050,0,0,0
,3042,0,0,3058,0,121,0,0,0,0,0,0,0,0,3034,3002,0,0,0,0,0,3090,2594,2602
,2610,0,0,0,0,2514,0,2994,2979,0,0,233,0,0,0,281,0,0,0,0,2986,0,0,0,3074
,0,0,0,0,2650,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,0,0,2530,3010,0,0
,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0,0,353,2514,0,2994,2979,0,0
,233,0,0,0,281,0,121,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042
,0,2578,3058,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,2594
,2602,2610,0,0,0,353,2514,0,2994,2979,0,0,233,0,0,0,281,0,121,0,0,2986,0
,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042,0,2578,3058,0,0,0,0,3066,2994
,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,2594,2602,2610,0,0,0,353,2514
,0,0,3050,0,0,0,3042,0,0,3058,0,121,0,0,363,0,0,0,3074,363,3034,3002,0,2650
,0,0,0,3090,0,0,2578,363,0,363,0,0,3066,363,0,2530,3010,0,0,0,0,0,3026,3018
,3082,0,0,0,0,0,3074,0,353,0,0,0,0,363,363,363,0,0,0,0,0,121,0,0,3066,0
,0,0,3010,363,3034,3002,363,363,3026,3018,3082,0,2994,2979,0,0,233,0,0,0
,281,363,0,0,0,2986,0,0,0,0,0,0,363,0,0,3050,0,0,0,3042,3034,3002,3058,0
,0,0,2994,2979,0,0,233,0,0,0,281,0,0,0,0,2986,3090,2594,2602,2610,0,0,0
,0,2514,3050,0,0,0,3042,0,0,3058,0,0,0,2994,2979,0,0,233,0,0,3074,281,0
,0,0,2650,2986,3090,2594,2602,2610,0,2578,0,0,2514,3050,0,3066,0,3042,2530
,3010,3058,0,0,0,0,3026,3018,3082,0,0,0,3074,0,0,0,353,2650,0,3090,2594
,2602,2610,0,2578,0,0,2514,0,121,3066,0,0,2530,3010,0,0,0,3034,3002,3026
,3018,3082,0,0,0,3074,0,0,0,353,2650,0,0,0,0,0,0,2578,0,0,0,0,121,3066,0
,0,2530,3010,0,0,0,3034,3002,3026,3018,3082,0,2994,2979,0,0,233,0,353,0
,281,0,0,0,0,2986,459,0,0,459,0,121,0,0,459,3050,459,459,0,3042,3034,3002
,3058,0,0,0,2994,2979,0,459,233,0,0,459,281,0,459,0,0,2986,3090,2594,2602
,2610,0,0,0,0,2514,3050,0,0,0,3042,459,0,3058,0,0,0,0,0,0,0,0,0,0,3074,0
,0,0,0,2650,0,3090,2594,2602,2610,0,2578,0,459,2514,0,0,3066,0,0,2530,3010
,0,0,459,0,0,3026,3018,3082,0,459,0,3074,0,459,0,353,2650,0,0,459,459,459
,0,2578,0,0,0,0,121,3066,0,0,2530,3010,0,0,0,3034,3002,3026,3018,3082,0
,0,0,0,0,0,2867,353,0,459,459,0,0,0,0,2867,2867,0,0,1066,121,2867,2867,0
,0,0,0,0,0,3034,3002,2867,2867,2867,2867,0,1337,2874,0,2867,0,1074,1082
,1090,0,2867,0,0,0,0,0,0,0,0,2867,2867,0,1353,1066,0,2867,2867,0,0,0,0,2867
,2867,0,0,2867,2867,2867,2867,0,0,2874,0,2867,0,1074,1082,1090,0,0,0,0,0
,0,0,0,0,0,0,0,0,1353,0,0,0,0,0,0,0,0,2867,2867,0,2867,2994,2979,0,0,233
,0,0,0,281,0,0,0,0,2986,2867,0,0,0,0,0,0,2867,0,3050,0,0,2867,3042,0,0,3058
,0,0,0,0,2867,2994,2979,2867,2867,233,0,0,0,281,0,0,0,3090,2986,0,0,0,2867
,0,0,2514,0,0,3050,2867,0,0,3042,0,2867,3058,0,0,0,0,0,0,0,2867,3074,0,0
,2867,0,2650,0,0,0,3090,0,0,0,0,0,0,0,2514,3066,2994,2979,2530,3010,233
,0,0,0,281,3026,3018,3082,0,2986,0,0,0,3074,0,353,0,0,2650,3050,0,0,0,3042
,0,0,3058,0,121,0,0,3066,2994,2979,2530,3010,233,3034,3002,0,281,3026,3018
,3082,3090,2986,0,0,0,0,0,353,2514,0,0,3050,0,0,0,3042,0,0,3058,0,121,0
,0,0,0,0,0,3074,0,3034,3002,0,2650,0,0,0,3090,0,0,0,0,0,0,0,2514,3066,2994
,2979,2530,3010,233,0,0,0,281,3026,3018,3082,0,2986,0,0,0,3074,0,353,0,0
,2650,3050,0,0,0,3042,0,0,3058,0,121,0,0,3066,2994,2979,2530,3010,233,3034
,3002,0,281,3026,3018,3082,3090,2986,0,0,0,0,0,353,2514,0,0,3050,0,0,0,3042
,0,0,3058,0,121,0,0,0,0,0,0,3074,0,3034,3002,0,2650,0,0,0,3090,0,0,0,0,0
,0,0,2514,3066,2994,2979,2530,3010,233,0,0,0,281,3026,3018,3082,0,2986,0
,0,0,3074,0,353,0,0,2650,3050,0,0,0,3042,0,0,3058,0,121,0,0,3066,2994,2979
,2530,3010,233,3034,3002,0,281,3026,3018,3082,3090,2986,0,0,0,0,0,353,2514
,0,0,3050,0,0,0,3042,0,0,3058,0,121,0,0,0,0,0,0,3074,0,3034,3002,0,2650
,0,0,0,3090,0,0,0,0,0,0,0,2514,3066,2994,2979,2530,3010,233,0,0,0,281,3026
,3018,3082,0,2986,0,0,0,3074,0,353,0,0,2650,3050,0,0,0,3042,0,0,3058,0,121
,0,0,3066,2994,2979,2530,3010,233,3034,3002,0,281,3026,3018,3082,3090,2986
,0,0,0,0,0,353,2514,0,0,3050,0,0,0,3042,0,0,3058,0,121,0,0,0,0,0,0,3074
,0,3034,3002,0,2650,0,0,0,3090,0,0,0,0,0,0,0,2514,3066,2994,2979,2530,3010
,233,0,0,0,281,3026,3018,3082,0,2986,0,0,0,3074,0,353,0,0,2650,3050,0,0
,0,3042,0,0,3058,0,121,0,0,3066,2994,2979,2530,3010,233,3034,3002,0,281
,3026,3018,3082,3090,2986,0,0,0,0,0,353,2514,0,0,3050,0,0,0,3042,0,0,3058
,0,121,0,0,0,0,0,0,3074,0,3034,3002,0,2650,0,0,0,3090,0,0,0,0,0,0,0,2514
,3066,2994,2979,2530,3010,233,0,0,0,281,3026,3018,3082,0,2986,0,0,0,3074
,0,353,0,0,2650,3050,0,0,0,3042,0,0,3058,0,121,0,0,3066,0,0,2530,3010,0
,3034,3002,0,0,3026,3018,3082,3090,0,0,0,0,0,0,353,2514,0,2994,2979,0,227
,1961,0,0,0,0,0,121,0,0,2986,0,0,0,3074,0,3034,3002,0,2650,3050,0,0,0,3042
,0,0,3058,0,0,0,0,3066,0,0,2530,3010,0,0,0,0,0,3026,3018,3082,3090,0,0,0
,0,2994,2979,353,242,227,0,0,0,0,451,227,0,451,2986,0,121,0,451,0,474,482
,0,3074,3050,3034,3002,0,3042,0,0,3058,0,451,0,0,0,451,0,0,451,3066,0,0
,0,3010,0,0,0,3090,0,3026,3018,3082,0,0,0,314,451,0,0,0,2786,0,0,0,0,0,0
,0,0,2818,2826,0,0,0,3074,2883,2883,0,0,2650,0,3034,3002,451,0,2778,2794
,2802,2810,0,0,0,3066,425,451,0,3010,0,0,0,0,451,3026,3018,3082,451,2994
,0,0,530,0,451,451,451,2769,0,0,0,0,0,2883,2883,0,0,0,121,2994,0,0,3050
,0,0,0,3042,3034,3002,3058,0,0,0,2994,0,0,451,451,0,0,0,0,3050,0,0,0,3042
,3090,0,3058,0,0,0,2994,0,2883,3050,0,0,0,3042,0,0,3058,0,0,0,3090,0,0,1425
,0,0,0,3074,0,3050,2898,0,0,3042,3090,1409,3058,0,2705,0,0,0,0,0,2906,3066
,0,3074,2890,3010,0,0,2650,0,3090,3026,3018,3082,0,0,0,3074,0,0,0,3066,2650
,0,0,3010,2994,0,0,0,0,3026,3018,3082,0,3066,0,3074,0,3010,0,0,2650,3034
,3002,3026,3018,3082,0,3050,0,0,2994,3042,121,3066,3058,0,0,3010,0,0,0,3034
,3002,3026,3018,3082,121,0,0,0,0,0,3090,3050,0,3034,3002,3042,0,0,3058,0
,0,0,0,0,121,0,0,0,0,0,0,0,0,3034,3002,0,3090,3074,0,0,0,0,2650,0,0,0,2994
,0,0,0,0,0,0,0,0,3066,0,0,0,3010,2994,0,0,3074,0,3026,3018,3082,2650,3050
,0,0,0,3042,0,0,3058,0,0,0,2994,3066,0,3050,0,3010,0,3042,121,0,3058,3026
,3018,3082,3090,0,0,3034,3002,0,0,0,0,3050,2994,0,0,3042,3090,0,3058,0,0
,0,121,0,0,0,0,0,0,3074,0,3034,3002,0,2650,3050,3090,0,0,3042,0,0,3058,3074
,0,0,730,3066,2650,1977,0,3010,0,0,0,0,0,3026,3018,3082,3090,3066,0,3074
,0,3010,0,0,2650,0,0,3026,3018,3082,0,0,0,0,723,0,121,3066,0,723,0,3010
,0,3074,0,3034,3002,3026,3018,3082,121,723,0,723,0,1985,0,723,0,3034,3002
,3066,2867,0,0,3010,0,0,0,0,121,3026,3018,3082,0,747,0,0,0,3034,3002,723
,723,723,0,2867,0,0,0,2867,826,0,2867,0,0,0,0,723,747,2874,723,723,747,3034
,3002,747,0,0,0,0,2867,0,0,0,0,723,0,0,0,0,0,0,819,747,0,0,723,819,0,0,0
,0,0,0,0,0,0,2867,0,819,0,819,0,0,0,819,0,0,0,0,747,0,0,0,2867,2867,0,754
,0,2867,0,0,0,0,0,2867,2867,2867,747,819,819,819,747,0,0,1602,0,2867,747
,747,747,2867,0,0,2867,819,0,0,819,819,2994,2874,0,2915,0,0,0,2867,2867
,0,0,0,2867,819,0,2994,0,1595,2915,0,747,747,1595,3050,819,0,0,3042,0,0
,3058,0,0,0,1595,0,1595,0,3050,2867,1595,0,3042,0,0,3058,0,0,3090,0,0,0
,0,0,0,0,0,2867,0,2867,0,2867,0,3090,1595,1595,1595,2867,2867,2867,0,0,0
,0,794,3074,0,0,0,0,1595,0,2867,1595,1595,0,2867,0,0,2867,3074,0,0,3066
,0,0,2874,3010,1595,2867,2867,0,0,3026,3018,3082,787,2867,3066,1595,0,787
,3010,0,0,0,0,0,3026,3018,3082,0,0,787,0,787,0,0,0,787,0,0,0,0,2867,3034
,3002,0,2994,0,0,0,0,0,0,0,2769,0,0,0,3034,3002,2867,787,787,787,2867,0
,0,0,0,3050,2867,2867,2867,3042,0,0,3058,787,0,0,787,787,2994,0,0,0,0,2994
,0,0,2915,0,0,0,3090,787,0,0,0,0,0,0,2867,2867,0,3050,787,0,0,3042,3050
,0,3058,0,3042,0,0,3058,0,1977,0,3074,0,0,0,0,0,0,0,0,3090,0,0,0,0,3090
,0,0,0,3066,2994,0,0,3010,0,0,0,0,0,3026,3018,3082,0,0,0,0,0,3074,0,0,0
,0,3074,3050,0,0,2994,3042,0,0,3058,0,0,0,0,3066,0,0,0,3010,3066,3034,3002
,0,3010,3026,3018,3082,3090,3050,3026,3018,3082,3042,0,0,3058,0,0,0,0,0
,2994,0,0,0,0,0,0,0,0,0,0,0,3090,3074,0,3034,3002,2994,0,0,3034,3002,0,3050
,0,0,0,3042,0,0,3058,3066,0,0,0,3010,2994,0,0,3074,3050,3026,3018,3082,3042
,0,0,3058,3090,0,0,0,0,0,0,0,0,3066,0,3050,0,3010,0,3042,0,3090,3058,3026
,3018,3082,0,2994,0,3034,3002,3074,522,0,0,0,0,0,0,0,3090,0,2994,0,0,0,0
,0,3074,3066,3050,0,0,3010,3042,3034,3002,3058,0,3026,3018,3082,0,0,0,3050
,3066,3074,0,3042,3010,0,3058,0,0,3090,3026,3018,3082,0,0,0,0,0,0,3066,0
,0,0,3010,3090,3034,3002,0,0,3026,3018,3082,0,0,0,0,3074,0,0,0,2994,0,3034
,3002,0,2994,0,0,0,0,0,3074,0,0,3066,0,0,0,3010,2994,0,3034,3002,3050,3026
,3018,3082,3042,3050,3066,3058,0,3042,3010,0,3058,0,0,0,3026,3018,3082,3050
,0,0,0,3042,0,3090,3058,0,0,0,3090,0,0,3034,3002,0,2994,0,0,0,0,0,0,0,3090
,0,0,0,3034,3002,0,0,3074,0,0,0,0,3074,0,3050,0,0,0,3042,0,0,3058,0,0,0
,3066,3074,0,0,3010,3066,0,0,0,3010,3026,3018,3082,0,3090,3026,3018,3082
,0,3066,0,0,0,3010,0,0,0,0,2994,3026,3018,3082,0,0,0,0,0,2994,0,0,0,3074
,3034,3002,0,0,0,3034,3002,0,0,3050,2994,0,0,3042,0,0,3058,3066,3050,3034
,3002,3010,3042,0,0,3058,0,3026,3018,3082,0,0,0,3050,3090,0,0,3042,0,0,3058
,0,0,3090,0,2994,0,0,0,0,0,0,0,0,2994,0,0,0,3090,3034,3002,3074,0,0,0,0
,0,0,3050,0,3074,0,3042,0,0,3058,0,3050,0,3066,0,3042,0,3010,3058,3074,0
,0,3066,3026,3018,3082,3010,3090,0,0,0,0,3026,3018,3082,0,3090,3066,0,0
,0,3010,0,0,0,0,0,3026,3018,3082,0,0,0,0,3074,3034,3002,0,0,0,0,0,0,3074
,3034,3002,0,0,0,0,0,2994,3066,0,0,0,3010,0,0,3034,3002,3066,3026,3018,3082
,3010,2994,0,0,0,0,3026,3018,3082,3050,2994,0,0,3042,0,0,3058,0,0,0,0,0
,0,0,3050,0,0,2994,3042,3034,3002,3058,0,3050,3090,0,2994,3042,3034,3002
,3058,0,0,0,0,0,0,0,0,3090,3050,2994,0,0,3042,0,0,3058,3090,3050,0,3074
,0,3042,0,0,3058,0,0,0,0,0,0,0,3050,3090,3074,0,3042,3066,0,3058,0,3010
,3090,3074,0,0,0,3026,3018,3082,0,0,3066,0,0,0,3010,3090,0,0,3074,3066,3026
,3018,3082,3010,0,0,0,3074,0,3026,3018,3082,0,0,0,0,3066,3034,3002,0,3010
,0,3074,0,0,3066,3026,3018,3082,3010,2994,0,3034,3002,0,3026,3018,3082,0
,2994,3066,3034,3002,0,3010,0,0,0,0,0,3026,3018,3082,3050,2994,0,0,3042
,3034,3002,3058,0,3050,0,0,0,3042,3034,3002,3058,0,0,0,0,2994,0,0,3050,3090
,0,0,3042,3034,3002,3058,0,0,3090,0,2994,0,0,0,0,0,0,0,3050,2994,0,0,3042
,3090,0,3058,3074,0,0,0,0,0,0,3050,0,3074,0,3042,0,0,3058,0,3050,3090,3066
,0,3042,0,3010,3058,3074,0,0,3066,3026,3018,3082,3010,3090,0,0,0,0,3026
,3018,3082,0,3090,3066,0,3074,0,3010,0,0,0,0,0,3026,3018,3082,0,0,0,0,3074
,3034,3002,3066,0,0,0,3010,0,3074,3034,3002,0,3026,3018,3082,0,2994,3066
,0,0,0,3010,0,0,3034,3002,3066,3026,3018,3082,3010,2994,0,0,0,0,3026,3018
,3082,3050,2994,0,0,3042,3034,3002,3058,0,0,0,0,0,0,0,3050,0,0,2994,3042
,3034,3002,3058,0,3050,3090,0,2994,3042,3034,3002,3058,0,0,0,0,0,0,0,0,3090
,3050,2994,0,0,3042,0,0,3058,3090,3050,0,3074,0,3042,0,0,3058,0,0,0,0,0
,0,0,3050,3090,3074,0,3042,3066,0,3058,0,3010,3090,3074,0,0,0,3026,3018
,3082,0,0,3066,0,0,0,3010,3090,0,0,3074,3066,3026,3018,3082,3010,0,0,0,3074
,0,3026,3018,3082,0,0,0,0,3066,3034,3002,0,3010,0,3074,0,0,3066,3026,3018
,3082,3010,0,0,3034,3002,0,3026,3018,3082,0,0,3066,3034,3002,0,3010,0,0
,0,0,0,3026,3018,3082,0,0,0,0,0,3034,3002,0,0,0,0,0,0,0,3034,3002,0,0,0
,0,0,0,0,0,0,0,0,0,0,3034,3002}
,
{1,11,86,11,11,329,11,11,11,329,11,11,243,11,11,11,11,11,135,11,11,11,11
,11,11,128,11,11,11,11,11,11,11,11,11,11,87,11,11,11,11,135,11,11,11,11
,11,11,11,11,80,128,80,11,11,276,11,11,11,11,239,11,11,11,11,322,239,11
,11,11,11,11,11,11,322,11,11,11,11,11,11,153,297,298,64,253,64,64,64,11
,301,11,11,11,11,11,306,11,11,192,11,192,192,192,11,11,11,302,322,11,11
,11,64,11,306,153,276,210,11,11,11,277,11,11,11,11,11,192,125,11,11,11,11
,11,11,11,11,11,11,11,11,11,253,11,11,11,11,11,11,11,13,210,13,13,125,13
,13,13,292,13,13,304,13,13,13,13,13,305,13,13,13,13,13,13,292,13,13,13,13
,13,13,13,13,13,13,305,13,13,13,13,305,13,13,13,13,13,13,13,13,276,125,245
,13,13,277,13,13,13,13,296,13,13,13,13,33,149,13,13,13,13,13,13,13,183,13
,13,13,13,13,13,111,14,296,178,111,178,178,178,13,190,13,13,13,13,13,149
,13,13,194,13,194,194,194,13,13,13,156,183,13,13,13,178,13,227,106,190,194
,13,13,13,14,13,13,13,13,13,187,156,13,13,13,13,13,13,13,13,13,13,13,13
,13,227,13,13,13,13,13,13,13,26,97,26,26,82,97,26,26,106,26,26,187,26,26
,26,26,26,247,26,26,26,26,26,26,134,82,26,26,26,26,26,26,26,26,26,166,26
,26,26,26,141,26,26,26,26,26,26,26,26,199,134,141,26,26,269,26,26,26,26
,309,26,26,26,26,166,249,26,26,26,26,26,26,26,119,26,26,26,26,26,26,32,53
,53,32,122,32,35,122,26,116,26,26,26,26,26,181,26,26,180,26,180,180,180
,26,26,26,35,122,26,26,26,269,26,270,157,116,181,26,26,26,158,26,26,26,26
,26,53,53,26,26,26,26,26,26,26,26,26,26,26,26,26,17,26,26,26,26,26,26,26
,150,150,180,122,150,181,101,150,9,122,101,103,9,159,44,103,150,150,17,53
,150,270,150,150,150,143,30,150,150,30,129,150,150,150,150,150,150,150,150
,150,150,150,150,150,150,150,150,150,150,150,90,143,206,150,150,150,150
,150,150,150,150,150,150,150,318,150,162,150,150,150,150,150,129,150,59
,129,150,150,150,150,150,123,109,150,150,150,109,68,150,211,93,150,150,150
,150,129,150,150,150,150,150,325,150,150,150,150,150,167,150,150,150,150
,126,150,29,170,95,150,150,150,150,150,150,150,150,150,150,331,150,150,150
,150,150,150,150,150,150,150,150,150,129,150,70,150,150,150,129,150,150
,150,151,151,46,300,151,334,72,151,138,132,99,273,138,274,340,342,151,151
,74,136,151,300,151,151,151,278,300,151,151,346,138,151,151,151,151,151
,151,151,151,151,151,151,151,151,151,151,151,151,151,151,75,76,300,151,151
,151,151,151,151,151,151,151,151,151,349,151,139,151,151,151,151,151,104
,151,77,78,151,151,151,151,151,107,355,151,151,151,286,79,151,27,146,151
,151,151,151,81,151,151,151,151,151,361,151,151,151,151,151,5,151,151,151
,151,363,151,83,84,114,151,151,151,151,151,151,151,151,151,151,295,151,151
,151,151,151,151,151,151,151,151,151,151,368,151,369,151,151,151,85,151
,151,151,57,57,371,372,57,57,372,57,57,372,57,57,57,57,57,372,372,57,57
,57,57,372,372,372,57,372,57,57,372,57,57,57,57,372,57,57,57,372,372,57
,57,57,57,57,57,57,372,372,372,372,57,57,372,57,57,57,57,372,57,57,57,57
,372,372,57,57,57,57,57,57,57,372,57,57,57,57,57,57,131,372,372,372,131
,372,372,89,57,372,57,57,57,372,57,372,57,372,372,57,372,372,131,57,57,89
,89,372,57,57,57,372,57,372,372,372,372,57,57,57,372,57,57,57,57,57,372
,372,57,57,57,57,57,57,57,57,372,57,57,57,57,372,57,57,57,57,57,57,57,230
,89,89,372,230,372,230,230,230,230,230,372,294,230,372,230,230,372,372,372
,230,372,372,230,372,230,230,230,230,372,230,230,230,230,372,230,230,230
,230,230,230,230,372,89,372,294,230,230,230,230,230,230,230,230,230,230
,230,372,230,308,230,230,230,230,230,89,230,372,294,372,230,230,230,230
,372,372,372,308,372,89,372,372,308,89,230,230,230,311,372,372,230,372,372
,230,294,372,372,230,230,372,372,372,230,230,230,372,230,372,308,372,372
,230,230,230,372,230,230,230,230,230,372,311,230,230,230,230,230,230,230
,230,241,230,230,372,230,372,230,230,230,311,230,230,230,372,311,372,372
,372,372,241,372,241,241,241,372,372,241,241,372,372,241,372,372,372,372
,372,241,241,372,372,311,241,241,241,241,241,241,241,241,372,372,372,241
,241,372,241,241,241,241,372,241,241,241,372,372,372,241,241,241,241,241
,372,241,372,372,241,241,241,241,241,372,372,372,372,372,372,372,241,372
,372,241,241,241,241,372,372,241,241,372,241,372,372,372,241,241,241,372
,241,241,241,241,372,241,372,372,372,372,241,241,241,241,241,241,372,241
,241,372,372,241,241,241,241,241,241,241,241,241,241,241,372,241,372,241
,241,241,372,241,241,241,39,372,372,39,372,372,39,39,372,39,39,39,39,39
,372,372,39,39,39,39,372,372,372,39,372,39,39,372,39,39,39,39,0,372,39,39
,39,0,39,39,39,39,39,39,39,372,372,372,372,0,372,0,39,39,39,0,372,372,372
,372,39,372,372,39,39,39,39,39,39,39,372,39,39,39,39,39,39,372,372,0,0,0
,372,372,372,372,372,39,39,39,372,39,372,39,372,0,372,0,0,0,39,372,113,372
,372,39,39,39,372,39,372,372,0,0,372,372,113,113,39,39,39,39,39,372,0,372
,372,39,39,39,39,39,39,372,372,372,39,39,372,372,372,39,39,39,372,39,49
,49,372,372,49,372,372,49,49,372,49,49,49,49,49,113,113,372,49,49,49,372
,372,372,49,372,49,49,372,49,49,49,49,3,372,49,49,113,3,372,372,372,49,49
,49,49,372,372,372,372,3,372,3,49,49,49,3,113,372,372,372,49,372,372,49
,49,49,49,49,49,49,372,49,49,49,49,49,49,372,113,3,3,3,372,372,372,372,372
,49,49,49,372,49,113,49,372,3,113,372,3,3,49,372,372,372,372,49,49,49,372
,49,372,372,372,3,372,372,372,372,49,49,49,49,49,372,3,372,372,49,49,49
,49,49,49,372,372,372,49,49,372,372,372,49,49,49,38,49,372,38,372,372,38
,38,372,38,38,38,38,38,372,372,372,38,38,38,372,372,372,38,372,372,38,372
,38,38,38,38,2,372,38,38,372,2,372,372,372,38,38,38,38,372,372,372,372,2
,372,2,38,38,38,2,372,372,372,372,38,372,372,38,38,38,38,38,38,38,372,38
,38,38,38,38,38,372,372,2,2,2,372,372,372,372,372,38,38,38,372,38,372,38
,372,2,372,372,2,2,38,372,372,372,372,38,38,38,372,38,372,372,372,2,372
,372,372,372,38,38,38,38,38,372,2,372,372,38,38,38,38,38,38,372,372,372
,38,38,372,372,372,38,38,38,24,38,372,24,372,372,24,24,372,24,24,24,24,24
,372,372,372,24,24,24,372,372,372,24,372,372,24,372,24,24,24,24,372,372
,24,24,372,372,372,372,372,24,24,24,24,372,372,372,372,372,372,372,24,24
,24,372,372,372,372,372,24,372,372,24,24,24,24,24,24,24,372,24,24,24,24
,24,24,372,372,372,372,372,372,372,372,372,372,24,24,24,372,24,372,24,372
,372,372,372,372,372,24,372,372,92,92,24,24,24,372,24,372,372,372,4,4,372
,372,372,24,24,24,24,24,372,372,372,372,24,24,24,24,24,24,372,372,372,24
,24,372,372,372,24,24,24,229,24,229,229,92,92,372,229,372,372,372,372,372
,372,4,4,372,229,372,229,372,372,229,229,229,229,229,229,229,372,372,372
,372,229,229,229,229,229,372,229,229,229,229,229,372,229,92,229,229,229
,229,229,372,229,372,372,4,229,229,229,229,372,372,372,372,372,372,372,92
,372,372,229,229,229,372,372,372,229,4,372,229,372,92,372,229,229,92,372
,372,229,229,229,4,229,372,372,4,372,229,229,229,372,229,229,372,229,229
,372,372,229,229,229,229,229,229,229,372,372,229,229,372,229,372,229,229
,229,372,229,229,229,62,372,372,62,372,372,62,62,372,62,62,62,62,62,372
,372,372,62,62,62,372,372,372,62,372,372,62,372,62,62,62,62,372,372,62,62
,372,51,51,372,372,62,62,62,62,372,372,372,372,372,372,372,62,62,62,51,372
,372,372,372,62,372,372,62,62,62,62,62,62,62,372,62,62,62,62,62,62,372,372
,372,372,372,51,51,372,372,372,62,62,62,372,62,372,62,372,372,372,372,372
,372,62,372,372,372,372,62,62,62,372,62,372,372,372,372,372,372,372,372
,62,62,62,62,62,372,51,372,372,62,62,62,62,62,62,372,372,372,62,62,372,372
,372,62,62,62,66,62,51,66,372,372,66,66,372,66,66,66,66,66,372,372,51,66
,66,66,51,372,372,66,372,372,66,372,66,66,66,66,372,372,66,66,372,372,372
,372,372,66,66,66,66,372,372,372,372,372,372,372,66,66,66,372,372,372,372
,372,66,372,372,66,66,66,66,66,66,66,372,66,66,66,66,66,66,372,372,372,372
,372,372,372,372,372,372,66,66,66,372,66,372,66,372,372,372,372,372,372
,66,372,372,372,372,66,66,66,372,66,372,372,372,372,372,372,372,372,66,66
,66,66,66,372,372,372,372,66,66,66,66,66,66,372,372,372,66,66,372,372,372
,66,66,66,224,66,224,224,372,372,372,224,372,372,372,372,372,372,372,372
,372,224,372,372,372,372,224,224,224,224,224,224,224,372,372,372,372,224
,224,224,224,224,372,224,224,224,224,224,372,224,372,224,224,224,224,224
,372,224,372,372,372,224,224,224,224,372,372,372,372,372,372,372,372,372
,372,224,224,224,372,372,372,224,372,372,224,372,372,372,224,224,372,372
,372,224,224,224,372,224,372,372,372,372,224,224,224,372,224,224,372,224
,224,372,372,224,224,224,224,224,224,224,372,372,224,224,372,224,372,224
,224,224,372,224,224,224,250,372,250,250,372,372,372,250,372,372,372,372
,372,372,372,372,372,250,372,372,372,372,250,250,250,250,250,250,250,372
,372,372,372,250,250,372,250,250,372,250,250,250,250,250,372,250,372,250
,250,250,250,250,372,250,372,372,372,250,250,250,250,372,372,372,372,372
,250,372,372,372,372,250,250,250,372,372,372,250,372,372,250,372,372,372
,250,250,372,372,372,250,250,250,372,250,372,372,372,372,250,250,250,372
,250,250,372,250,250,372,372,250,250,250,250,250,250,250,372,372,250,250
,372,250,372,250,250,250,372,250,250,250,236,372,236,236,372,372,372,236
,372,372,372,372,372,372,372,372,372,236,372,372,372,372,236,236,236,236
,236,236,236,372,372,372,372,236,236,372,236,236,236,236,372,236,236,236
,372,372,372,236,236,236,236,236,372,236,372,372,372,236,236,236,236,372
,372,372,372,372,372,372,372,372,372,236,236,236,372,372,372,236,372,372
,236,372,372,372,236,236,372,372,372,236,236,236,372,236,372,372,372,372
,236,236,236,236,236,236,372,236,236,372,372,236,236,236,236,236,236,236
,372,372,236,236,372,236,372,236,236,236,372,236,236,236,221,372,221,221
,372,372,372,221,372,372,372,372,372,372,372,372,372,221,372,372,372,372
,221,221,221,221,221,221,221,372,372,372,372,221,221,221,221,221,372,221
,372,221,221,221,372,221,372,221,221,221,221,221,372,221,372,372,372,221
,221,221,221,372,372,372,372,372,372,372,372,372,372,221,221,221,372,372
,372,221,372,372,221,372,372,372,221,221,372,372,372,221,221,221,372,221
,372,372,372,372,221,221,221,372,221,221,372,221,221,372,372,221,221,221
,221,221,221,221,372,372,221,221,372,221,372,221,221,221,372,221,221,221
,217,372,217,217,372,372,372,217,372,372,372,372,372,372,372,372,372,217
,372,372,372,372,217,217,217,217,217,217,217,372,372,372,372,217,217,372
,217,217,372,217,217,217,217,217,372,372,372,217,217,217,217,217,372,217
,372,372,372,217,217,217,217,372,372,372,372,372,217,372,372,372,372,217
,217,217,372,372,372,217,372,372,217,372,372,372,217,217,372,372,372,217
,217,217,372,217,372,372,372,372,217,217,217,372,217,217,372,217,217,372
,372,217,217,217,217,217,217,217,372,372,217,217,372,217,372,217,217,217
,372,217,217,217,234,372,234,234,372,372,372,234,372,372,372,372,372,372
,372,372,372,234,372,372,372,372,234,234,234,234,234,234,234,372,372,372
,372,234,234,372,234,234,372,234,372,234,234,234,372,372,372,234,234,234
,234,234,372,234,372,372,372,234,234,234,234,372,372,372,372,372,372,372
,372,372,372,234,234,234,372,372,372,234,372,372,234,372,372,372,234,234
,372,372,372,234,234,234,372,234,372,372,372,372,234,234,234,234,234,234
,372,234,234,372,372,234,234,234,234,234,234,234,372,372,234,234,372,234
,372,234,234,234,372,234,234,234,252,372,252,252,372,372,372,252,372,372
,372,372,372,372,372,372,372,252,372,372,372,372,252,252,252,252,252,252
,252,372,372,372,372,252,252,372,252,252,372,252,372,252,252,252,372,252
,372,252,252,252,252,252,372,252,372,372,372,252,252,252,252,372,372,372
,372,372,372,372,372,372,372,252,252,252,372,372,372,252,372,372,252,372
,372,372,252,252,372,372,372,252,252,252,372,252,372,372,372,372,252,252
,252,372,252,252,372,252,252,372,372,252,252,252,252,252,252,252,372,372
,252,252,372,252,372,252,252,252,372,252,252,252,281,372,281,281,372,372
,372,281,372,372,372,372,372,372,372,372,372,281,372,372,372,372,281,281
,281,281,281,281,281,372,372,372,372,281,281,372,281,281,372,281,372,281
,281,281,372,281,372,281,281,281,281,281,372,281,372,372,372,281,281,281
,281,372,372,372,372,372,372,372,372,372,372,281,281,281,372,372,372,281
,372,372,281,372,372,372,281,281,372,372,372,281,281,281,372,281,372,372
,372,372,281,281,281,372,281,281,372,281,281,372,372,281,281,281,281,281
,281,281,372,372,281,281,372,281,372,281,281,281,372,281,281,281,285,372
,285,285,372,372,372,285,372,372,372,372,372,372,372,372,372,285,372,372
,372,372,285,285,285,285,285,285,285,372,372,372,372,285,285,372,285,285
,372,285,372,285,285,285,372,285,372,285,285,285,285,285,372,285,372,372
,372,285,285,285,285,372,372,372,372,372,372,372,372,372,372,285,285,285
,372,372,372,285,372,372,285,372,372,372,285,285,372,372,372,285,285,285
,372,285,372,372,372,372,285,285,285,372,285,285,372,285,285,372,372,285
,285,285,285,285,285,285,372,372,285,285,372,285,372,285,285,285,372,285
,285,285,290,372,290,290,372,372,372,290,372,372,372,372,372,372,372,372
,372,290,372,372,372,372,290,290,290,290,290,290,290,372,372,372,372,290
,290,372,290,290,372,290,372,290,290,290,372,290,372,290,290,290,290,290
,372,290,372,372,372,290,290,290,290,372,372,372,372,372,372,372,372,372
,372,290,290,290,372,372,372,290,372,372,290,372,372,372,290,290,372,372
,372,290,290,290,372,290,372,372,372,372,290,290,290,372,290,290,372,290
,290,372,372,290,290,290,290,290,290,290,372,372,290,290,372,290,372,290
,290,290,372,290,290,290,254,372,254,254,372,372,372,254,372,372,372,372
,372,372,372,372,372,254,372,372,372,372,254,254,254,254,254,254,254,372
,372,372,372,254,254,372,254,254,372,254,372,254,254,254,372,372,372,254
,254,254,254,254,372,254,372,372,372,254,254,254,254,372,372,372,372,372
,372,372,372,372,372,254,254,254,372,372,372,254,372,372,254,372,372,372
,254,254,372,372,372,254,254,254,372,254,372,372,372,372,254,254,254,372
,254,254,372,254,254,372,372,254,254,254,254,254,254,254,372,372,254,254
,372,254,372,254,254,254,372,254,254,254,255,372,255,255,372,372,372,255
,372,372,372,372,372,372,372,372,372,255,372,372,372,372,255,255,255,255
,255,255,255,372,372,372,372,255,255,372,255,255,372,255,372,255,255,255
,372,372,372,255,255,255,255,255,372,255,372,372,372,255,255,255,255,372
,372,372,372,372,372,372,372,372,372,255,255,255,372,372,372,255,372,372
,255,372,372,372,255,255,372,372,372,255,255,255,372,255,372,372,372,372
,255,255,255,372,255,255,372,255,255,372,372,255,255,255,255,255,255,255
,372,372,255,255,372,255,372,255,255,255,372,255,255,255,256,372,256,256
,372,372,372,256,372,372,372,372,372,372,372,372,372,256,372,372,372,372
,256,256,256,256,256,256,256,372,372,372,372,256,256,372,256,256,372,256
,372,256,256,256,372,372,372,256,256,256,256,256,372,256,372,372,372,256
,256,256,256,372,372,372,372,372,372,372,372,372,372,256,256,256,372,372
,372,256,372,372,256,372,372,372,256,256,372,372,372,256,256,256,372,256
,372,372,372,372,256,256,256,372,256,256,372,256,256,372,372,256,256,256
,256,256,256,256,372,372,256,256,372,256,372,256,256,256,372,256,256,256
,257,372,257,257,372,372,372,257,372,372,372,372,372,372,372,372,372,257
,372,372,372,372,257,257,257,257,257,257,257,372,372,372,372,257,257,372
,257,257,372,257,372,257,257,257,372,372,372,257,257,257,257,257,372,257
,372,372,372,257,257,257,257,372,372,372,372,372,372,372,372,372,372,257
,257,257,372,372,372,257,372,372,257,372,372,372,257,257,372,372,372,257
,257,257,372,257,372,372,372,372,257,257,257,372,257,257,372,257,257,372
,372,257,257,257,257,257,257,257,372,372,257,257,372,257,372,257,257,257
,372,257,257,257,264,372,264,264,372,372,372,264,372,372,372,372,372,372
,372,372,372,264,372,372,372,372,264,264,264,264,264,264,264,372,372,372
,372,264,264,372,264,264,372,264,372,264,264,264,372,372,372,264,264,264
,264,264,372,264,372,372,372,264,264,264,264,372,372,372,372,372,372,372
,372,372,372,264,264,264,372,372,372,264,372,372,264,372,372,372,264,264
,372,372,372,264,264,264,372,264,372,372,372,372,264,264,264,372,264,264
,372,264,264,372,372,264,264,264,264,264,264,264,372,372,264,264,372,264
,372,264,264,264,372,264,264,264,266,372,266,266,372,372,372,266,372,372
,372,372,372,372,372,372,372,266,372,372,372,372,266,266,266,266,266,266
,266,372,372,372,372,266,266,372,266,266,372,266,372,266,266,266,372,372
,372,266,266,266,266,266,372,266,372,372,372,266,266,266,266,372,372,372
,372,372,372,372,372,372,372,266,266,266,372,372,372,266,372,372,266,372
,372,372,266,266,372,372,372,266,266,266,372,266,372,372,372,372,266,266
,266,372,266,266,372,266,266,372,372,266,266,266,266,266,266,266,372,372
,266,266,372,266,372,266,266,266,372,266,266,266,268,372,268,268,372,372
,372,268,372,372,372,372,372,372,372,372,372,268,372,372,372,372,268,268
,268,268,268,268,268,372,372,372,372,268,268,372,268,268,372,268,372,268
,268,268,372,372,372,268,268,268,268,268,372,268,372,372,372,268,268,268
,268,372,372,372,372,372,372,372,372,372,372,268,268,268,372,372,372,268
,372,372,268,372,372,372,268,268,372,372,372,268,268,268,372,268,372,372
,372,372,268,268,268,372,268,268,372,268,268,372,372,268,268,268,268,268
,268,268,372,372,268,268,372,268,372,268,268,268,372,268,268,268,222,372
,222,222,372,372,372,222,372,372,372,372,372,372,372,372,372,222,372,372
,372,372,222,222,222,222,222,222,222,372,372,372,372,222,222,372,222,222
,372,222,372,222,222,222,372,372,372,222,222,222,222,222,372,222,372,372
,372,222,222,222,222,372,372,372,372,372,372,372,372,372,372,222,222,222
,372,372,372,222,372,372,222,372,372,372,222,222,372,372,372,222,222,222
,372,222,372,372,372,372,222,222,222,372,222,222,372,222,222,372,372,222
,222,222,222,222,222,222,372,372,222,222,372,222,372,222,222,222,372,222
,222,222,21,372,372,21,372,372,21,372,372,372,372,372,21,21,372,372,372
,21,21,21,372,372,372,21,372,372,21,372,21,21,21,21,372,372,21,21,372,372
,372,372,372,21,21,21,21,372,372,372,372,372,372,372,21,21,21,372,372,372
,372,372,21,372,372,21,21,21,21,21,21,21,372,21,21,21,21,21,21,372,372,372
,372,372,372,372,372,372,372,21,21,21,372,21,372,21,372,372,372,372,372
,372,21,372,372,372,372,21,21,21,372,21,372,372,372,372,372,372,372,372
,21,21,21,21,21,372,372,372,372,21,21,21,21,21,21,372,372,372,21,21,372
,372,372,21,21,21,37,21,372,37,372,372,37,372,372,372,372,372,37,37,372
,372,372,37,37,37,372,372,372,37,372,372,37,372,37,37,37,37,372,372,37,37
,372,372,372,372,372,37,37,37,37,372,372,372,372,372,372,372,37,37,37,372
,372,372,372,372,37,372,372,37,37,37,37,37,37,37,372,37,37,37,37,37,37,372
,372,372,372,372,372,372,372,372,372,37,37,37,372,37,372,37,372,372,372
,372,372,372,37,372,372,372,372,37,37,37,372,37,372,372,372,372,372,372
,372,372,37,37,37,37,37,344,372,372,372,37,37,37,37,37,37,372,372,372,37
,37,372,372,372,37,37,37,372,37,344,372,372,344,344,372,372,344,372,372
,372,372,344,372,372,344,372,344,372,372,372,344,344,344,344,344,372,372
,372,344,372,344,344,344,372,344,372,372,372,372,372,372,372,372,372,344
,344,344,372,344,372,372,344,344,344,344,344,372,372,344,344,344,372,372
,372,372,372,344,344,344,344,372,372,344,344,344,372,372,344,344,344,344
,344,372,372,372,344,344,372,344,372,372,372,344,372,372,372,372,344,344
,372,344,344,372,344,172,372,372,344,344,344,344,344,344,172,172,372,344
,172,372,172,172,372,344,372,172,372,372,372,372,172,172,172,172,372,172
,172,372,172,372,172,172,172,172,172,172,172,372,372,372,372,372,372,372
,172,172,172,372,372,372,372,372,372,372,372,172,172,172,172,172,372,172
,372,372,372,172,172,172,172,372,372,372,372,372,372,372,372,372,372,172
,172,172,372,372,372,172,372,372,372,372,372,372,172,372,372,372,372,172
,172,172,372,172,372,372,201,372,372,372,372,372,172,172,172,172,172,372
,372,372,372,172,172,172,172,172,172,372,372,201,372,172,201,201,372,172
,201,172,372,172,372,201,372,372,372,372,201,372,372,372,201,201,201,201
,201,372,372,372,201,372,201,201,201,372,201,372,372,372,372,372,372,372
,372,372,201,201,201,372,201,372,372,201,201,201,201,201,372,372,201,201
,201,372,372,372,372,372,201,201,201,201,372,372,201,201,201,372,372,201
,201,201,201,201,372,372,372,201,201,372,201,372,372,372,201,372,372,372
,372,201,201,372,201,201,372,201,169,372,372,201,201,201,201,201,201,169
,169,372,201,169,372,169,169,372,201,372,169,372,372,372,372,169,169,169
,169,372,169,169,372,169,372,169,169,169,169,169,169,169,372,372,372,372
,372,372,372,169,169,169,372,372,372,372,372,372,372,372,169,169,169,169
,169,372,169,372,372,372,169,169,169,169,372,372,372,372,372,372,372,372
,372,372,169,169,169,372,372,372,169,372,372,372,372,372,372,169,372,372
,372,372,169,169,169,372,169,372,372,372,372,372,372,372,372,169,169,169
,169,169,372,372,372,372,169,169,169,169,169,169,372,223,223,372,169,223
,372,372,169,223,169,372,169,372,223,372,372,372,372,372,145,372,145,145
,223,372,372,223,223,145,372,223,372,372,372,372,372,372,145,372,145,372
,145,145,145,223,223,223,223,223,223,223,223,372,372,372,223,223,372,372
,372,372,372,372,372,372,372,145,145,223,223,223,372,223,372,372,223,223
,223,223,223,223,372,372,372,372,372,372,223,372,372,223,223,223,223,372
,372,223,223,372,372,372,372,372,223,223,223,372,372,145,223,223,372,223
,223,372,372,372,372,372,372,238,223,223,145,223,223,223,372,372,372,145
,223,223,223,223,223,223,372,372,238,223,238,238,238,145,372,223,238,145
,372,238,372,372,372,372,372,238,238,372,372,372,238,238,238,372,372,372
,372,238,372,372,372,238,238,372,372,372,238,238,372,238,238,238,372,372
,372,238,238,372,372,372,372,372,372,372,238,372,372,372,372,372,372,372
,372,372,372,372,238,372,372,372,372,372,238,372,372,372,238,372,238,372
,372,372,238,238,238,372,238,238,372,372,372,372,372,372,372,372,238,238
,238,238,372,372,372,372,372,372,372,238,238,238,324,372,372,372,238,238
,238,238,372,324,324,238,238,238,324,372,238,238,324,324,324,324,372,372
,372,372,324,372,324,324,324,372,324,372,372,372,372,372,372,372,372,372
,324,324,324,372,324,372,372,372,324,324,324,324,372,372,324,324,324,372
,372,372,372,372,324,324,324,372,372,372,324,372,324,372,372,324,324,324
,372,372,372,372,372,324,324,372,324,372,372,372,324,372,372,372,372,324
,324,372,324,324,372,324,372,196,372,324,324,324,324,372,372,372,196,372
,324,372,372,196,372,372,324,196,196,196,196,372,372,372,372,196,372,196
,196,196,372,196,372,372,372,372,372,372,372,372,372,196,196,196,372,196
,372,372,372,196,196,196,196,372,372,196,196,196,372,372,372,372,372,196
,196,196,372,372,372,196,372,196,372,36,196,196,196,372,372,36,372,372,196
,196,372,196,372,372,372,196,36,372,372,372,196,196,36,196,196,36,196,372
,372,372,196,196,196,196,36,372,372,372,372,196,36,36,36,36,372,196,372
,372,372,372,372,36,36,36,372,372,372,372,372,36,372,372,372,372,36,36,36
,36,36,372,36,36,36,36,36,36,372,372,372,372,372,372,372,372,372,372,36
,36,36,372,36,372,36,372,372,372,19,372,372,36,372,372,19,372,372,36,36
,372,36,372,372,372,372,19,372,372,372,36,36,19,36,36,19,372,372,372,372
,36,36,36,36,19,372,372,372,36,36,19,19,19,19,36,36,372,372,372,372,372
,19,19,19,372,372,372,372,372,19,372,372,372,372,19,19,19,19,19,372,19,19
,19,19,19,19,372,372,372,372,372,372,372,372,372,372,19,19,19,372,19,48
,19,48,48,372,372,372,372,19,372,372,372,372,372,19,19,372,19,48,372,48
,372,48,48,48,372,19,19,372,19,19,372,372,272,372,372,19,19,19,19,372,372
,372,372,19,19,372,48,48,372,19,19,272,372,272,272,272,372,372,372,272,372
,372,272,372,372,372,372,372,272,272,372,372,372,272,272,272,372,372,372
,372,272,372,372,372,272,272,372,372,48,372,272,372,272,272,272,372,372
,372,272,272,372,372,372,372,372,372,372,272,372,372,48,372,372,372,372
,372,372,22,372,372,372,372,372,372,48,272,22,22,48,272,372,272,22,22,372
,272,272,272,372,372,272,372,22,22,22,22,372,372,372,272,272,272,372,372
,372,372,372,372,372,372,272,272,272,259,372,372,259,272,272,272,272,372
,372,372,272,272,272,22,22,272,272,372,259,372,259,259,259,372,372,372,259
,372,372,259,372,372,372,372,372,259,372,372,372,372,259,259,259,372,372
,372,372,259,372,372,372,259,259,372,372,22,372,259,372,259,259,259,372
,372,372,259,259,372,372,372,22,372,372,372,259,372,372,22,372,372,372,372
,22,372,372,372,372,372,372,372,372,22,259,372,372,22,259,372,259,372,372
,372,259,259,259,372,372,259,372,372,372,372,372,372,372,372,259,259,259
,372,372,372,372,372,372,372,110,259,259,259,372,372,212,372,259,259,259
,259,372,372,372,259,259,259,372,372,259,259,212,110,212,212,372,110,372
,372,110,372,372,372,372,372,372,372,372,212,372,372,372,372,212,212,212
,372,110,372,372,372,372,372,372,212,212,372,372,372,212,212,372,212,212
,212,372,372,372,212,212,372,372,372,372,110,372,372,372,372,110,372,372
,372,372,372,372,372,372,372,372,372,372,110,372,372,372,110,372,372,372
,372,212,110,110,110,372,212,212,212,212,212,372,372,372,372,372,372,372
,372,212,212,212,212,372,372,110,372,372,372,372,212,212,212,155,110,110
,372,372,372,212,212,372,372,155,212,212,212,372,372,212,212,155,155,155
,155,372,372,372,372,372,372,372,155,155,155,372,372,372,372,372,372,372
,372,372,372,155,155,155,372,155,372,372,372,155,155,155,155,372,372,372
,372,372,372,372,372,372,372,155,155,155,372,372,155,155,372,372,219,372
,372,372,155,372,372,372,372,372,155,155,372,155,372,372,372,372,219,219
,219,219,155,155,372,155,155,372,372,219,219,372,155,155,155,155,372,372
,372,372,372,155,219,219,219,372,219,155,372,372,219,219,219,219,372,219
,372,372,372,372,372,372,219,372,219,219,219,372,372,372,219,372,372,372
,372,372,372,219,372,372,372,372,185,219,219,372,219,372,219,372,372,372
,185,372,372,219,219,372,219,219,185,185,185,185,372,219,219,219,219,372
,372,185,185,185,219,372,372,372,372,372,219,372,372,372,185,185,185,372
,185,372,372,372,185,185,185,185,372,372,372,372,372,372,372,372,372,372
,185,185,185,372,372,185,185,372,372,372,372,372,372,185,372,372,372,372
,189,185,185,372,185,372,372,372,372,372,189,372,372,185,185,372,185,185
,189,189,189,189,372,185,185,185,185,372,372,189,189,189,185,372,372,372
,372,372,185,372,372,372,189,189,189,372,189,372,372,372,189,189,189,189
,372,372,372,372,372,372,372,372,372,372,189,189,189,372,372,189,189,372
,372,372,372,372,372,189,372,372,372,372,372,189,189,372,189,372,372,372
,372,372,372,372,372,189,189,372,189,189,213,372,213,213,372,189,189,189
,189,372,372,372,372,372,189,372,372,213,372,372,189,372,213,213,213,372
,372,372,372,372,372,372,372,213,213,372,372,372,213,213,372,213,213,213
,372,372,372,213,213,372,372,372,372,372,372,372,372,372,372,50,372,50,50
,372,372,372,372,372,372,372,372,372,372,372,372,372,372,50,372,50,213,50
,50,50,372,213,372,213,213,213,288,372,372,372,372,372,372,372,213,213,213
,213,372,372,372,372,50,50,372,213,213,213,372,288,372,372,288,372,213,213
,372,372,372,213,213,213,372,372,213,213,372,288,288,288,288,372,372,372
,372,372,372,372,288,288,372,372,372,372,50,372,372,372,372,372,372,288
,288,288,372,288,372,372,372,288,288,288,288,372,372,372,50,372,372,372
,372,372,372,288,288,288,372,372,372,288,50,372,280,372,50,372,288,372,372
,372,372,372,288,288,372,288,372,372,372,372,280,280,280,280,288,288,372
,288,288,372,372,280,280,372,288,288,288,288,372,372,372,280,372,288,280
,280,280,372,280,288,372,372,280,280,280,280,372,372,372,372,372,372,372
,372,280,372,280,280,280,372,372,372,280,372,372,372,372,372,372,280,372
,372,372,372,372,280,280,372,280,372,372,372,372,372,372,372,372,280,280
,372,280,280,225,372,225,225,372,280,280,280,280,372,372,372,372,372,280
,372,372,225,372,225,280,372,225,225,225,372,372,372,372,372,372,372,372
,225,225,225,372,372,372,225,225,225,225,225,176,225,372,225,225,372,372
,372,372,176,176,372,372,372,372,176,176,372,372,372,372,372,372,372,372
,176,176,176,176,372,372,176,372,372,372,372,225,372,372,372,372,225,372
,372,372,225,283,372,372,372,372,372,372,372,225,225,225,176,372,372,176
,176,372,372,372,225,225,225,372,283,372,372,283,372,225,225,372,372,372
,225,225,225,372,372,225,225,372,283,283,283,283,372,372,372,372,372,372
,372,283,283,372,372,176,372,372,372,372,372,372,372,372,283,283,283,372
,283,372,176,372,283,283,283,283,372,176,372,372,372,372,176,372,372,372
,283,283,283,372,372,176,283,372,372,176,372,372,372,283,372,372,372,372
,148,283,283,372,283,372,372,372,372,372,148,372,372,283,283,372,283,283
,148,148,148,148,372,283,283,283,283,372,372,148,148,372,283,372,372,372
,372,372,283,372,372,372,148,148,148,372,148,372,372,372,148,148,148,148
,372,372,372,372,372,372,372,372,372,372,148,148,148,372,372,372,148,372
,372,372,372,372,372,148,372,372,372,372,161,148,148,372,148,372,372,372
,372,372,161,372,372,148,148,372,148,148,161,161,161,161,372,148,148,148
,148,372,372,161,161,372,148,372,372,372,372,372,148,372,372,372,161,161
,161,372,161,372,372,372,161,161,161,161,372,372,372,372,372,372,372,372
,372,372,161,161,161,372,372,372,161,372,372,372,372,372,372,161,372,372
,372,372,372,161,161,372,161,372,372,372,372,372,372,372,372,161,161,372
,161,161,214,372,214,214,372,161,161,161,161,372,372,372,372,372,161,372
,372,214,372,372,161,372,214,214,214,372,372,372,372,372,372,372,372,214
,214,372,372,372,214,214,372,214,214,214,372,372,372,214,214,372,372,372
,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372
,372,372,372,372,372,372,372,372,372,372,214,372,372,372,372,214,6,372,214
,214,372,372,372,372,372,372,372,372,214,214,214,214,372,372,372,372,372
,372,372,214,214,214,372,6,372,372,372,372,214,214,372,372,372,214,214,214
,372,372,214,214,372,6,6,6,6,372,372,372,372,372,372,372,6,6,372,372,372
,372,372,372,372,372,372,372,372,6,6,6,372,6,372,372,372,6,6,6,6,372,7,372
,372,372,372,372,372,372,372,6,6,6,372,372,372,6,372,372,372,372,372,372
,6,372,372,372,372,7,6,6,372,6,372,372,372,372,372,372,372,372,6,6,372,6
,6,7,7,7,7,372,6,6,6,6,372,372,7,7,372,6,372,372,372,372,372,6,372,372,372
,7,7,7,372,7,372,372,372,7,7,7,7,372,372,372,372,372,372,372,372,372,372
,7,7,7,372,372,372,7,372,372,372,372,372,372,7,372,372,372,372,360,7,7,372
,7,372,372,372,372,372,360,372,372,7,7,372,7,7,360,360,360,360,372,7,7,7
,7,372,372,360,360,372,7,372,372,372,372,372,7,372,372,372,360,360,360,372
,360,372,372,372,360,360,360,360,372,372,372,372,372,372,372,372,372,372
,360,360,360,372,372,372,360,372,372,171,372,372,372,360,372,372,372,372
,372,360,360,372,360,372,372,372,372,171,171,171,171,360,360,372,360,360
,372,372,171,171,372,360,360,360,360,372,372,372,372,372,360,171,171,171
,372,171,360,372,372,171,171,171,171,372,372,372,372,372,372,372,372,372
,372,171,171,171,372,372,372,171,372,372,160,372,372,372,171,372,372,372
,372,372,171,171,372,171,372,372,372,372,160,160,160,160,171,171,372,171
,171,372,372,160,160,372,171,171,171,171,372,372,372,372,372,171,160,160
,160,372,160,171,372,372,160,160,160,160,372,372,372,372,372,372,372,372
,372,372,160,160,160,372,372,372,160,372,372,228,372,372,372,160,372,372
,372,372,372,160,160,372,160,372,372,372,372,228,228,228,228,160,160,372
,160,160,372,372,228,228,372,160,160,160,160,372,372,372,372,372,160,228
,228,228,372,228,160,372,372,228,228,228,228,372,372,372,372,372,372,372
,372,372,372,228,228,228,372,372,372,228,372,372,184,372,372,372,228,372
,372,372,372,372,228,228,372,228,372,372,372,372,184,184,184,184,228,228
,372,228,228,372,372,184,184,372,228,228,228,228,372,372,372,372,372,228
,184,184,184,372,184,228,372,372,184,184,184,184,372,372,372,372,372,372
,372,372,372,372,184,184,184,372,372,372,184,372,372,372,372,372,372,184
,372,372,372,372,372,184,184,372,184,372,372,372,372,372,261,261,372,184
,184,372,184,184,372,372,372,372,372,184,184,184,184,261,372,261,261,372
,184,372,263,372,372,372,184,372,372,372,372,372,261,372,372,372,372,261
,261,261,263,263,263,263,372,372,372,372,261,261,372,263,263,372,261,372
,261,261,261,372,372,372,261,261,263,263,263,372,263,372,372,372,263,263
,263,263,372,372,372,372,372,372,372,372,372,372,263,263,263,372,372,372
,263,372,372,261,372,372,372,263,261,372,372,372,261,263,263,372,263,372
,372,372,372,261,261,261,372,263,263,372,263,263,372,372,261,261,261,263
,263,263,263,154,372,261,261,372,263,372,261,261,261,372,263,261,261,372
,372,372,372,154,154,154,154,372,372,372,372,372,372,372,154,154,372,372
,372,372,372,372,372,372,372,372,372,154,154,154,372,154,372,372,372,154
,154,154,154,372,372,372,372,372,372,372,372,372,372,154,154,154,372,372
,372,154,372,372,265,372,372,372,154,372,372,372,372,372,154,154,372,154
,372,372,372,372,265,265,265,265,154,154,372,154,154,372,372,265,265,372
,154,154,154,154,372,372,372,372,372,154,265,265,265,372,265,154,372,372
,265,265,265,265,372,372,372,372,372,372,372,372,372,372,265,265,265,372
,372,372,265,372,372,372,372,372,372,265,372,372,372,372,372,265,265,372
,265,372,372,372,372,372,372,372,372,265,265,372,265,265,372,372,372,372
,232,265,265,265,265,232,232,372,372,232,265,232,232,232,232,232,265,372
,232,372,232,232,372,372,372,267,372,372,232,232,232,232,232,232,372,372
,232,232,232,372,232,232,232,267,267,267,267,372,372,372,372,372,372,372
,267,267,232,372,372,372,372,372,372,372,372,232,232,267,267,267,372,267
,372,372,372,267,267,267,267,372,372,372,372,372,372,372,372,372,372,267
,267,267,372,372,372,267,372,372,233,372,372,372,267,372,372,372,372,232
,267,267,372,267,372,372,372,372,233,233,233,233,267,267,232,267,267,372
,372,233,233,232,267,267,267,267,232,372,372,372,372,267,233,233,233,232
,233,267,372,232,233,233,233,233,372,372,372,372,372,372,372,372,372,372
,233,233,233,372,372,372,233,372,372,372,372,372,372,233,372,372,372,372
,372,233,233,372,233,372,372,372,372,372,372,372,372,233,233,372,233,233
,215,372,215,215,372,233,233,233,233,372,372,372,372,372,233,372,372,215
,372,372,233,372,215,215,215,372,372,372,372,372,372,372,372,215,215,372
,372,372,215,215,372,215,215,215,372,372,372,215,215,372,372,372,372,372
,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372
,372,372,372,372,372,372,372,372,215,372,372,372,372,215,372,372,372,215
,372,372,372,372,372,372,372,372,215,215,215,215,372,372,372,372,372,372
,372,215,215,215,235,372,372,372,372,372,215,215,372,372,372,215,215,215
,372,372,215,215,235,235,235,235,372,372,372,372,372,372,372,235,235,372
,372,372,372,372,372,372,372,372,372,372,235,235,235,372,235,372,372,372
,235,235,235,235,372,372,372,372,372,372,372,372,372,372,235,235,235,372
,372,372,235,372,372,188,372,372,372,235,372,372,372,372,372,235,235,372
,235,372,372,372,372,188,188,188,188,235,235,372,235,235,372,372,188,188
,372,235,235,235,235,372,372,372,372,372,235,188,188,188,372,188,235,372
,372,188,188,188,188,372,372,372,372,372,372,372,372,372,372,188,188,188
,372,372,372,188,372,372,168,372,372,372,188,372,372,372,372,372,188,188
,372,188,372,372,372,372,168,168,168,168,188,188,372,188,188,372,372,168
,168,372,188,188,188,188,372,372,372,372,372,188,168,168,168,372,168,188
,372,372,168,168,168,168,372,372,372,372,372,372,372,372,372,372,168,168
,168,372,372,372,168,372,372,284,372,372,372,168,372,372,372,372,372,168
,168,372,168,372,372,372,372,284,284,284,284,168,168,372,168,168,372,372
,284,284,372,168,168,168,168,372,372,372,372,372,168,284,284,284,372,284
,168,372,372,284,284,284,284,372,372,372,372,372,372,372,372,372,372,284
,284,284,372,372,372,284,372,372,240,372,372,372,284,372,372,372,372,372
,284,284,372,284,372,372,372,372,240,240,240,240,284,284,372,284,284,372
,372,240,240,372,284,284,284,284,372,372,372,372,372,284,240,240,240,372
,240,284,372,372,240,240,240,240,372,372,372,372,372,372,372,372,372,372
,240,240,240,372,372,372,240,372,372,220,372,372,372,240,372,372,372,372
,372,240,240,372,240,372,372,372,372,220,220,220,220,240,240,372,240,240
,372,372,220,220,372,240,240,240,240,372,372,372,372,372,240,220,220,220
,372,220,240,372,372,220,220,220,220,372,372,372,372,372,372,372,372,372
,372,220,220,220,372,372,372,220,372,372,289,372,372,372,220,372,372,372
,372,372,220,220,372,220,372,372,372,372,289,289,289,289,220,220,372,220
,220,372,372,289,289,372,220,220,220,220,372,372,372,372,372,220,289,289
,289,372,289,220,372,372,289,289,289,289,372,372,372,372,372,372,372,372
,372,372,289,289,289,372,372,372,289,372,372,195,372,372,372,289,372,372
,372,372,372,289,289,372,289,372,372,372,372,195,195,195,195,289,289,372
,289,289,372,372,195,195,372,289,289,289,289,372,372,372,372,372,289,195
,195,195,372,195,289,372,372,195,195,195,195,372,372,372,372,372,372,372
,372,372,372,195,195,195,372,372,372,195,372,372,323,372,372,372,195,372
,372,372,372,372,195,195,372,195,372,372,372,372,323,323,323,323,195,195
,372,195,195,372,372,323,323,372,195,195,195,195,372,372,372,372,372,195
,323,323,323,372,323,195,372,372,323,323,323,323,372,372,372,372,372,372
,372,372,372,372,323,323,323,372,372,372,323,372,372,372,372,372,372,323
,372,372,372,372,372,323,323,372,323,372,372,372,372,372,372,372,372,323
,323,372,323,323,251,372,251,251,372,323,323,323,323,372,372,372,372,372
,323,372,372,251,372,372,323,372,251,251,251,372,372,372,372,372,372,372
,372,251,251,372,372,372,372,251,251,251,251,251,372,251,372,251,251,372
,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372
,372,372,372,372,372,372,372,372,372,372,372,372,251,372,372,372,372,251
,372,372,372,251,372,372,372,372,372,372,372,372,251,251,251,372,372,372
,372,372,372,372,372,251,251,251,343,372,372,372,372,372,251,251,372,372
,372,251,251,251,372,372,251,251,343,343,343,343,372,372,372,372,372,372
,372,343,343,372,372,372,372,372,372,372,372,372,372,372,343,343,343,372
,343,372,372,372,343,343,343,343,372,372,372,372,372,372,372,372,372,372
,343,343,343,372,372,372,343,372,372,147,372,372,372,343,372,372,372,372
,372,343,343,372,343,372,372,372,372,147,147,147,147,343,343,372,343,343
,372,372,147,147,372,343,343,343,343,372,372,372,372,372,343,147,147,147
,372,147,343,372,372,147,147,147,147,372,372,372,372,372,372,372,372,372
,372,147,147,147,372,372,372,147,372,372,359,372,372,372,147,372,372,372
,372,372,147,147,372,147,372,372,372,372,359,359,359,359,147,147,372,147
,147,372,372,359,359,372,147,147,147,147,372,372,372,372,372,147,359,359
,359,372,359,147,372,372,359,359,359,359,372,372,372,372,372,372,372,372
,372,372,359,359,359,372,372,372,359,372,372,200,372,372,372,359,372,372
,372,372,372,359,359,372,359,372,372,372,372,200,200,200,200,359,359,372
,359,359,372,372,200,200,372,359,359,359,359,372,372,372,372,372,359,200
,200,200,372,200,359,372,372,200,200,200,200,372,372,372,372,372,372,372
,372,372,372,200,200,200,372,372,372,200,372,372,372,372,372,372,200,372
,372,372,372,372,200,200,209,200,372,372,372,372,372,372,372,372,200,200
,372,200,200,372,209,372,209,209,200,200,200,200,372,372,372,372,372,200
,372,372,372,209,372,200,372,372,209,209,209,372,372,372,372,372,372,372
,372,209,209,372,372,372,313,209,372,209,209,209,372,372,372,209,209,372
,372,372,372,372,313,372,313,313,372,372,372,372,372,372,372,372,372,372
,372,372,372,313,372,372,372,372,313,313,313,372,209,372,372,372,372,209
,372,313,313,209,372,372,372,313,372,313,313,313,209,209,209,313,313,372
,372,372,372,372,372,209,209,209,372,372,372,372,372,372,209,209,372,372
,372,209,209,209,372,372,209,209,372,372,372,372,313,372,372,372,372,313
,372,372,372,313,372,372,372,372,372,372,372,372,313,313,313,372,372,372
,372,372,372,372,372,313,313,313,372,315,372,315,315,372,313,313,372,372
,372,313,313,313,372,372,313,313,315,372,372,315,372,315,315,315,372,372
,372,372,372,372,372,372,315,315,372,372,372,372,315,372,315,315,315,372
,372,372,315,315,372,372,372,372,372,372,372,372,372,372,372,372,372,372
,372,120,120,372,372,120,372,372,372,120,372,372,372,372,120,372,372,315
,372,372,372,372,315,372,120,372,315,372,120,372,372,120,372,372,372,315
,315,315,372,372,372,372,372,372,372,372,315,315,315,120,120,120,120,372
,372,315,315,120,372,372,315,315,315,372,372,315,315,372,216,372,216,216
,120,372,120,120,120,372,372,372,372,120,372,372,372,216,372,372,120,372
,216,216,216,372,120,120,372,120,120,372,372,216,216,372,120,120,120,216
,372,216,216,216,372,372,120,216,216,372,372,372,372,372,372,372,372,372
,372,120,372,372,372,372,372,372,372,372,120,120,372,372,120,203,372,203
,203,372,120,372,216,372,372,372,372,216,372,372,372,216,203,372,372,203
,372,203,203,203,216,216,216,216,372,372,372,372,203,203,372,216,216,216
,203,372,203,203,203,372,216,216,203,203,372,216,216,216,372,372,216,216
,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,218,372
,218,218,372,372,372,203,372,372,372,372,203,372,372,372,203,218,372,372
,372,372,218,218,218,203,203,203,372,372,372,372,372,218,218,372,203,203
,203,218,218,218,218,218,372,203,203,218,218,372,203,203,203,372,372,203
,203,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,352
,372,352,352,372,372,372,218,372,372,372,372,218,372,372,372,218,352,372
,372,352,372,352,352,352,218,218,218,372,372,372,372,372,352,352,372,218
,218,218,352,372,352,352,352,372,218,218,352,352,372,218,218,218,372,372
,218,218,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372
,372,372,372,372,372,372,372,352,372,372,372,372,352,372,372,372,352,372
,372,372,372,372,372,372,372,352,352,352,372,372,372,372,372,372,372,372
,352,352,352,372,372,372,372,372,372,352,352,372,372,372,352,352,352,372
,372,352,352,231,372,231,372,372,231,372,372,372,231,372,231,231,231,231
,231,372,372,231,372,231,231,372,372,372,372,372,372,231,372,231,231,231
,231,372,372,231,231,231,372,231,231,231,372,372,372,279,372,279,279,372
,372,372,372,372,372,231,372,372,372,372,372,372,279,372,231,231,372,279
,279,279,372,372,372,372,367,367,372,367,279,279,372,372,372,372,279,372
,279,279,279,372,279,372,279,279,372,372,372,367,372,372,372,367,372,372
,367,372,231,372,372,372,372,372,372,372,372,372,372,372,372,372,372,231
,367,372,372,279,372,372,231,372,279,372,372,231,279,372,372,372,372,372
,372,372,231,279,279,279,231,372,372,367,372,372,372,372,279,279,279,372
,205,372,205,205,372,279,279,372,372,367,279,279,279,367,372,279,279,205
,372,367,367,367,205,205,205,372,372,372,372,372,372,372,372,205,205,372
,372,372,372,205,372,205,205,205,372,372,372,205,205,372,372,367,367,372
,316,372,316,316,372,372,372,372,372,372,372,372,372,372,372,372,372,316
,372,372,372,372,316,316,316,372,205,372,372,372,372,205,372,316,316,205
,372,372,372,316,372,316,316,316,205,205,205,316,316,372,372,372,372,372
,372,205,205,205,372,372,372,372,372,372,205,205,372,372,372,205,205,205
,372,372,205,205,372,372,372,372,316,372,372,372,372,316,372,372,372,316
,372,372,372,372,372,372,372,372,316,316,316,372,372,372,372,372,372,372
,372,316,316,316,372,317,372,317,317,372,316,316,372,372,372,316,316,316
,372,372,316,316,317,372,372,372,372,317,317,317,372,372,372,372,372,372
,372,372,317,317,372,372,372,372,317,372,317,317,317,372,372,372,317,317
,372,372,372,372,372,353,372,353,353,372,372,372,372,372,372,372,372,372
,372,372,372,372,353,372,372,372,372,353,353,353,372,317,372,372,372,372
,317,372,353,353,317,372,372,372,353,372,353,353,353,317,317,317,353,353
,372,372,372,372,372,372,317,317,317,372,372,372,372,372,372,317,317,372
,372,372,317,317,317,372,372,317,317,372,372,372,372,353,372,372,372,372
,353,372,372,372,353,372,372,372,372,372,372,372,372,353,353,353,372,372
,372,372,372,372,372,372,353,353,353,372,354,372,354,354,372,353,353,372
,372,372,353,353,353,372,372,353,353,354,372,372,372,372,354,354,354,372
,372,372,372,372,372,372,372,354,354,372,372,372,372,354,372,354,354,354
,372,372,372,354,354,372,372,372,372,372,372,372,121,121,372,372,121,372
,372,372,121,372,372,372,372,121,372,372,372,372,372,372,372,372,372,121
,354,372,372,121,372,354,121,372,372,354,372,372,372,372,372,372,372,372
,354,354,354,372,372,372,121,121,121,121,372,354,354,354,121,372,372,365
,372,372,354,354,372,372,372,354,354,354,372,121,354,354,121,121,365,372
,372,372,121,372,365,372,372,372,365,121,372,365,372,372,372,121,121,372
,121,121,372,204,372,204,204,121,121,121,372,365,372,372,372,372,372,121
,372,372,204,372,372,372,372,204,204,204,372,372,121,372,372,372,372,372
,204,204,365,121,121,372,204,121,204,204,204,372,372,121,204,204,372,372
,372,372,365,372,372,372,365,372,372,372,372,372,365,365,365,372,372,372
,372,372,372,372,372,372,372,372,372,372,372,204,372,372,372,372,204,372
,372,372,204,372,372,372,372,372,365,365,372,204,204,204,372,372,372,372
,372,372,372,372,204,204,204,372,15,15,372,372,15,204,204,372,15,372,204
,204,204,15,372,204,204,15,372,372,372,372,372,15,15,372,372,15,372,372
,15,372,372,372,372,15,356,372,372,356,372,372,372,372,372,372,372,372,15
,15,15,15,372,372,356,372,15,372,372,356,372,372,372,356,372,372,356,372
,372,372,372,356,372,372,372,15,356,372,372,372,15,372,372,372,356,372,372
,15,356,372,356,372,372,15,356,372,15,15,372,372,372,372,372,15,15,15,372
,372,372,372,372,356,372,15,372,372,372,372,356,356,356,338,372,372,372
,372,15,372,372,356,372,372,372,356,356,15,15,356,356,356,356,356,372,372
,338,372,372,372,338,372,372,338,356,372,372,372,338,372,372,338,372,338
,372,356,372,372,372,372,372,338,372,356,356,338,372,338,372,372,372,338
,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,338,372
,372,372,372,372,372,338,338,338,357,372,372,357,372,372,372,372,338,372
,372,372,338,338,112,372,338,338,338,338,338,372,372,357,372,372,372,357
,372,372,357,338,372,372,372,357,372,112,372,372,357,112,338,372,112,372
,372,372,357,372,338,338,357,372,357,372,372,372,357,372,372,372,112,372
,372,372,372,372,372,372,372,372,372,372,372,357,372,372,372,372,372,372
,357,357,357,207,372,372,207,112,372,372,372,357,112,372,372,357,357,56
,372,357,357,357,357,357,372,112,207,372,372,112,207,372,372,207,357,112
,112,112,207,372,56,372,372,207,56,357,372,56,372,372,372,207,372,357,357
,207,372,207,112,372,372,207,372,372,372,56,372,112,112,372,372,372,372
,372,372,372,372,372,207,372,372,372,372,372,372,207,207,207,319,372,372
,319,56,372,372,372,207,56,372,372,207,207,372,372,207,207,207,207,207,372
,56,319,372,372,56,319,372,372,319,207,56,56,56,319,372,372,372,372,319
,372,207,372,372,372,372,372,319,372,207,207,319,372,319,56,372,372,319
,372,372,372,372,372,56,56,372,372,372,372,372,372,372,372,372,319,372,372
,372,372,372,372,319,319,319,372,372,372,372,372,366,372,372,319,372,372
,372,319,319,372,372,319,319,319,319,319,372,366,372,372,372,372,372,366
,372,372,319,366,372,372,366,372,372,372,372,366,372,319,372,372,366,372
,372,372,12,319,319,372,366,372,372,372,366,372,366,372,372,372,366,372
,372,372,372,372,282,282,372,12,282,372,372,12,282,372,12,366,372,282,372
,372,372,372,366,366,366,372,372,282,372,372,372,282,12,366,282,372,372
,366,366,372,372,366,366,366,366,366,372,372,372,372,372,372,282,282,282
,282,366,372,372,12,282,372,372,372,12,372,372,366,372,372,372,372,372,372
,372,366,366,12,372,282,372,12,372,372,282,372,372,12,12,12,372,282,372
,372,372,372,372,282,20,20,282,282,20,372,372,372,20,282,282,282,12,20,372
,372,372,372,372,282,372,12,12,20,372,372,372,20,372,372,20,372,282,372
,28,28,372,372,372,28,372,282,282,372,372,372,372,28,20,20,20,20,372,372
,43,43,20,28,43,372,372,28,43,372,28,372,372,43,372,372,372,372,372,372
,372,20,43,43,372,372,20,43,28,372,43,372,372,20,372,372,28,372,372,20,372
,372,20,20,372,372,372,372,43,20,20,20,372,372,372,28,43,372,372,20,28,372
,372,372,372,372,372,372,372,372,372,372,20,28,372,43,372,28,372,372,43
,20,20,28,28,28,372,372,372,372,372,372,372,43,372,372,43,43,372,372,372
,372,372,43,43,43,28,372,372,372,124,124,372,43,124,28,28,372,124,372,372
,372,372,124,372,372,43,372,372,372,43,372,372,124,372,43,43,124,372,372
,124,372,372,372,43,372,372,372,43,372,372,372,372,372,372,372,372,372,124
,124,124,124,372,372,372,372,124,372,287,287,372,372,287,372,372,372,287
,372,372,372,372,287,372,372,372,124,372,372,372,372,124,287,372,372,372
,287,372,124,287,372,372,372,372,124,372,372,124,124,372,372,372,372,372
,124,124,124,287,287,287,287,372,372,372,124,287,372,127,127,372,372,127
,372,372,372,127,372,124,372,372,127,372,372,372,287,372,124,124,372,287
,127,372,372,372,127,372,287,127,372,372,372,372,287,372,372,287,287,372
,372,372,372,372,287,287,287,127,127,127,127,372,372,372,287,127,372,175
,175,372,372,175,372,372,372,175,372,287,372,372,175,372,372,372,127,372
,287,287,372,127,175,372,372,372,175,372,127,175,372,372,372,372,127,372
,372,127,127,372,372,372,372,372,127,127,127,175,175,175,175,372,372,372
,127,175,372,177,177,372,372,177,372,372,372,177,372,127,372,372,177,372
,372,372,175,372,127,127,372,175,177,372,372,372,177,372,175,177,372,372
,372,372,175,372,372,175,175,372,372,372,372,372,175,175,175,177,177,177
,177,372,372,372,175,177,372,179,179,372,372,179,372,372,372,179,372,175
,372,372,179,372,372,372,177,372,175,175,372,177,179,372,372,372,179,372
,177,179,372,372,372,372,177,372,372,177,177,372,372,372,372,372,177,177
,177,179,179,179,179,372,372,372,177,179,372,182,182,372,372,182,372,372
,372,182,372,177,372,372,182,372,372,372,179,372,177,177,372,179,182,372
,372,372,182,372,179,182,372,372,372,372,179,372,372,179,179,372,372,372
,372,372,179,179,179,182,182,182,182,372,372,372,179,182,372,133,133,372
,372,133,372,372,372,133,372,179,372,372,133,372,372,372,182,372,179,179
,372,182,133,372,372,372,133,372,182,133,372,372,372,372,182,372,372,182
,182,372,372,372,372,372,182,182,182,133,133,133,133,372,372,372,182,133
,372,142,142,372,372,142,372,372,372,142,372,182,372,372,142,372,372,372
,133,372,182,182,372,133,142,372,372,372,142,372,133,142,372,372,372,372
,133,372,372,133,133,372,372,372,372,372,133,133,133,142,142,142,142,372
,372,372,133,142,372,186,186,372,372,186,372,372,372,186,372,133,372,372
,186,372,372,372,142,372,133,133,372,142,186,372,372,372,186,372,142,186
,372,372,372,372,142,372,372,142,142,372,372,372,372,372,142,142,142,186
,186,186,186,372,372,372,142,186,372,321,321,372,372,321,372,372,372,321
,372,142,372,372,321,372,372,372,186,372,142,142,372,186,321,372,372,372
,321,372,186,321,372,372,372,372,186,372,372,186,186,372,372,372,372,372
,186,186,186,321,321,321,321,372,372,372,186,321,372,34,34,372,372,34,372
,372,372,34,372,186,372,372,34,372,372,372,321,372,186,186,372,321,34,372
,372,372,34,372,321,34,372,372,372,372,321,372,372,321,321,372,372,372,372
,372,321,321,321,34,34,34,34,372,372,372,321,34,372,18,18,372,372,18,372
,372,372,18,372,321,372,372,18,372,372,372,34,372,321,321,372,34,18,372
,372,372,18,372,34,18,372,372,372,372,34,328,372,34,34,372,372,372,372,372
,34,34,34,18,18,18,18,372,372,372,34,18,372,372,328,372,372,372,328,372
,372,328,372,34,372,372,328,372,372,372,18,328,34,34,372,18,372,372,372
,328,372,372,18,328,372,328,372,372,18,328,372,18,18,372,372,372,372,372
,18,18,18,372,372,372,372,372,328,372,18,372,372,372,372,328,328,328,333
,372,372,372,372,18,372,372,328,372,372,372,328,328,18,18,328,328,328,328
,328,372,372,333,372,372,372,333,372,372,333,328,372,372,372,333,372,372
,372,372,333,372,328,372,244,244,372,372,333,244,328,328,333,372,333,372
,372,244,333,372,372,372,372,372,191,191,372,244,191,372,372,244,191,372
,244,333,372,191,372,372,372,372,333,333,333,372,372,191,372,372,372,191
,244,333,191,372,372,333,333,372,244,333,333,333,333,333,372,372,372,372
,372,372,191,191,191,191,333,372,372,244,191,372,372,372,244,372,372,333
,372,372,372,372,372,372,372,333,333,244,372,191,372,244,372,372,191,372
,372,244,244,244,372,191,372,372,372,372,372,191,193,193,191,191,193,372
,372,372,193,191,191,191,244,193,372,372,372,372,372,191,372,244,244,193
,372,372,372,193,372,372,193,372,191,372,372,372,372,372,372,372,372,191
,191,372,372,372,372,372,193,193,193,193,372,372,372,372,193,372,61,61,372
,372,61,372,372,372,61,372,372,372,372,61,372,372,372,193,372,372,372,372
,193,61,372,372,372,61,372,193,61,372,372,372,372,193,372,372,193,193,372
,372,372,372,372,193,193,193,61,61,61,61,372,372,372,193,61,372,226,226
,372,372,226,372,372,372,226,372,193,372,372,226,372,372,372,61,372,193
,193,372,61,226,372,372,372,226,372,61,226,372,372,372,372,61,372,372,61
,61,372,372,372,372,372,61,61,61,226,226,226,226,372,372,372,61,226,372
,23,23,372,372,23,372,372,372,23,372,61,372,372,23,372,372,372,226,372,61
,61,372,226,23,372,372,372,23,372,226,23,372,372,372,372,226,198,372,226
,226,372,372,372,372,372,226,226,226,23,23,23,23,372,372,372,226,23,372
,372,198,372,372,372,198,372,372,198,372,226,372,372,198,372,372,372,23
,198,226,226,372,23,372,372,372,198,372,372,23,198,372,198,372,372,23,198
,372,23,23,372,372,372,372,372,23,23,23,372,372,372,372,372,198,372,23,372
,372,372,372,198,198,198,372,372,372,372,372,23,372,372,198,372,372,372
,198,198,23,23,198,198,198,198,198,372,152,152,372,372,152,372,372,372,152
,198,372,372,372,152,372,372,372,372,372,372,198,372,372,152,372,372,372
,152,198,198,152,372,372,372,63,63,372,372,63,372,372,372,63,372,372,372
,372,63,152,152,152,152,372,372,372,372,152,63,372,372,372,63,372,372,63
,372,372,372,65,65,372,372,65,372,372,152,65,372,372,372,152,65,63,63,63
,63,372,152,372,372,63,65,372,152,372,65,152,152,65,372,372,372,372,152
,152,152,372,372,372,63,372,372,372,152,63,372,65,65,65,65,372,63,372,372
,65,372,152,63,372,372,63,63,372,372,372,152,152,63,63,63,372,372,372,65
,372,372,372,63,65,372,372,372,372,372,372,65,372,372,372,372,63,65,372
,372,65,65,372,372,372,63,63,65,65,65,372,16,16,372,372,16,372,65,372,16
,372,372,372,372,16,347,372,372,347,372,65,372,372,347,16,347,347,372,16
,65,65,16,372,372,372,115,115,372,347,115,372,372,347,115,372,347,372,372
,115,16,16,16,16,372,372,372,372,16,115,372,372,372,115,347,372,115,372
,372,372,372,372,372,372,372,372,372,16,372,372,372,372,16,372,115,115,115
,115,372,16,372,347,115,372,372,16,372,372,16,16,372,372,347,372,372,16
,16,16,372,347,372,115,372,347,372,16,115,372,372,347,347,347,372,115,372
,372,372,372,16,115,372,372,115,115,372,372,372,16,16,115,115,115,372,372
,372,372,372,372,165,115,372,347,347,372,372,372,372,165,165,372,372,165
,115,165,165,372,372,372,372,372,372,115,115,165,165,165,165,372,165,165
,372,165,372,165,165,165,372,164,372,372,372,372,372,372,372,372,164,164
,372,165,164,372,164,164,372,372,372,372,165,165,372,372,164,164,164,164
,372,372,164,372,164,372,164,164,164,372,372,372,372,372,372,372,372,372
,372,372,372,372,164,372,372,372,372,372,372,372,372,164,164,372,165,163
,163,372,372,163,372,372,372,163,372,372,372,372,163,165,372,372,372,372
,372,372,165,372,163,372,372,165,163,372,372,163,372,372,372,372,165,67
,67,164,165,67,372,372,372,67,372,372,372,163,67,372,372,372,164,372,372
,163,372,372,67,164,372,372,67,372,164,67,372,372,372,372,372,372,372,164
,163,372,372,164,372,163,372,372,372,67,372,372,372,372,372,372,372,67,163
,88,88,163,163,88,372,372,372,88,163,163,163,372,88,372,372,372,67,372,163
,372,372,67,88,372,372,372,88,372,372,88,372,163,372,372,67,91,91,67,67
,91,163,163,372,91,67,67,67,88,91,372,372,372,372,372,67,88,372,372,91,372
,372,372,91,372,372,91,372,67,372,372,372,372,372,372,88,372,67,67,372,88
,372,372,372,91,372,372,372,372,372,372,372,91,88,94,94,88,88,94,372,372
,372,94,88,88,88,372,94,372,372,372,91,372,88,372,372,91,94,372,372,372
,94,372,372,94,372,88,372,372,91,98,98,91,91,98,88,88,372,98,91,91,91,94
,98,372,372,372,372,372,91,94,372,372,98,372,372,372,98,372,372,98,372,91
,372,372,372,372,372,372,94,372,91,91,372,94,372,372,372,98,372,372,372
,372,372,372,372,98,94,47,47,94,94,47,372,372,372,47,94,94,94,372,47,372
,372,372,98,372,94,372,372,98,47,372,372,372,47,372,372,47,372,94,372,372
,98,174,174,98,98,174,94,94,372,174,98,98,98,47,174,372,372,372,372,372
,98,47,372,372,174,372,372,372,174,372,372,174,372,98,372,372,372,372,372
,372,47,372,98,98,372,47,372,372,372,174,372,372,372,372,372,372,372,174
,47,117,117,47,47,117,372,372,372,117,47,47,47,372,117,372,372,372,174,372
,47,372,372,174,117,372,372,372,117,372,372,117,372,47,372,372,174,25,25
,174,174,25,47,47,372,25,174,174,174,117,25,372,372,372,372,372,174,117
,372,372,25,372,372,372,25,372,372,25,372,174,372,372,372,372,372,372,117
,372,174,174,372,117,372,372,372,25,372,372,372,372,372,372,372,25,117,54
,54,117,117,54,372,372,372,54,117,117,117,372,54,372,372,372,25,372,117
,372,372,25,54,372,372,372,54,372,372,54,372,117,372,372,25,55,55,25,25
,55,117,117,372,55,25,25,25,54,55,372,372,372,372,372,25,54,372,372,55,372
,372,372,55,372,372,55,372,25,372,372,372,372,372,372,54,372,25,25,372,54
,372,372,372,55,372,372,372,372,372,372,372,55,54,45,45,54,54,45,372,372
,372,45,54,54,54,372,45,372,372,372,55,372,54,372,372,55,45,372,372,372
,45,372,372,45,372,54,372,372,55,372,372,55,55,372,54,54,372,372,55,55,55
,45,372,372,372,372,372,372,55,45,372,242,242,372,242,242,372,372,372,372
,372,55,372,372,242,372,372,372,45,372,55,55,372,45,242,372,372,372,242
,372,372,242,372,372,372,372,45,372,372,45,45,372,372,372,372,372,45,45
,45,242,372,372,372,372,31,31,45,242,242,372,372,372,372,348,242,372,348
,31,372,45,372,348,372,348,348,372,242,31,45,45,372,31,372,372,31,372,348
,372,372,372,348,372,372,348,242,372,372,372,242,372,372,372,31,372,242
,242,242,372,372,372,31,348,372,372,372,173,372,372,372,372,372,372,372
,372,173,173,372,372,372,31,173,173,372,372,31,372,242,242,348,372,173,173
,173,173,372,372,372,31,173,348,372,31,372,372,372,372,348,31,31,31,348
,336,372,372,336,372,348,348,348,336,372,372,372,372,372,173,173,372,372
,372,31,96,372,372,336,372,372,372,336,31,31,336,372,372,372,8,372,372,348
,348,372,372,372,372,96,372,372,372,96,336,372,96,372,372,372,100,372,173
,8,372,372,372,8,372,372,8,372,372,372,96,372,372,173,372,372,372,336,372
,100,173,372,372,100,8,173,100,372,336,372,372,372,372,372,173,336,372,96
,173,336,372,372,96,372,100,336,336,336,372,372,372,8,372,372,372,96,8,372
,372,96,130,372,372,372,372,96,96,96,372,8,372,100,372,8,372,372,100,336
,336,8,8,8,372,130,372,372,102,130,96,100,130,372,372,100,372,372,372,96
,96,100,100,100,8,372,372,372,372,372,130,102,372,8,8,102,372,372,102,372
,372,372,372,372,100,372,372,372,372,372,372,372,372,100,100,372,102,130
,372,372,372,372,130,372,372,372,137,372,372,372,372,372,372,372,372,130
,372,372,372,130,140,372,372,102,372,130,130,130,102,137,372,372,372,137
,372,372,137,372,372,372,108,102,372,140,372,102,372,140,130,372,140,102
,102,102,137,372,372,130,130,372,372,372,372,108,237,372,372,108,140,372
,108,372,372,372,102,372,372,372,372,372,372,137,372,102,102,372,137,237
,108,372,372,237,372,372,237,140,372,372,208,137,140,237,372,137,372,372
,372,372,372,137,137,137,237,140,372,108,372,140,372,372,108,372,372,140
,140,140,372,372,372,372,208,372,137,108,372,208,372,108,372,237,372,137
,137,108,108,108,140,208,372,208,372,237,372,208,372,140,140,237,118,372
,372,237,372,372,372,372,108,237,237,237,372,350,372,372,372,108,108,208
,208,208,372,118,372,372,372,118,320,372,118,372,372,372,372,208,350,118
,208,208,350,237,237,350,372,372,372,372,118,372,372,372,372,208,372,372
,372,372,372,372,320,350,372,372,208,320,372,372,372,372,372,372,372,372
,372,118,372,320,372,320,372,372,372,320,372,372,372,372,350,372,372,372
,58,118,372,350,372,118,372,372,372,372,372,118,118,118,350,320,320,320
,350,372,372,326,372,58,350,350,350,58,372,372,58,320,372,372,320,320,299
,58,372,299,372,372,372,118,118,372,372,372,58,320,372,303,372,326,303,372
,350,350,326,299,320,372,372,299,372,372,299,372,372,372,326,372,326,372
,303,58,326,372,303,372,372,303,372,372,299,372,372,372,372,372,372,372
,372,58,372,41,372,58,372,303,326,326,326,58,58,58,372,372,372,372,358,299
,372,372,372,372,326,372,41,326,326,372,41,372,372,41,303,372,372,299,372
,372,41,299,326,58,58,372,372,299,299,299,358,41,303,326,372,358,303,372
,372,372,372,372,303,303,303,372,372,358,372,358,372,372,372,358,372,372
,372,372,41,299,299,372,335,372,372,372,372,372,372,372,335,372,372,372
,303,303,41,358,358,358,41,372,372,372,372,335,41,41,41,335,372,372,335
,358,372,372,358,358,271,372,372,372,372,362,372,372,362,372,372,372,335
,358,372,372,372,372,372,372,41,41,372,271,358,372,372,271,362,372,271,372
,362,372,372,362,372,271,372,335,372,372,372,372,372,372,372,372,271,372
,372,372,372,362,372,372,372,335,341,372,372,335,372,372,372,372,372,335
,335,335,372,372,372,372,372,271,372,372,372,372,362,341,372,372,197,341
,372,372,341,372,372,372,372,271,372,372,372,271,362,335,335,372,362,271
,271,271,341,197,362,362,362,197,372,372,197,372,372,372,372,372,73,372
,372,372,372,372,372,372,372,372,372,372,197,341,372,271,271,60,372,372
,362,362,372,73,372,372,372,73,372,372,73,341,372,372,372,341,327,372,372
,197,60,341,341,341,60,372,372,60,73,372,372,372,372,372,372,372,372,197
,372,327,372,197,372,327,372,60,327,197,197,197,372,144,372,341,341,73,341
,372,372,372,372,372,372,372,327,372,330,372,372,372,372,372,60,73,144,372
,372,73,144,197,197,144,372,73,73,73,372,372,372,330,60,327,372,330,60,372
,330,372,372,144,60,60,60,372,372,372,372,372,372,327,372,372,372,327,330
,73,73,372,372,327,327,327,372,372,372,372,144,372,372,372,332,372,60,60
,372,202,372,372,372,372,372,330,372,372,144,372,372,372,144,52,372,327
,327,332,144,144,144,332,202,330,332,372,202,330,372,202,372,372,372,330
,330,330,52,372,372,372,52,372,332,52,372,372,372,202,372,372,144,144,372
,258,372,372,372,372,372,372,372,52,372,372,372,330,330,372,372,332,372
,372,372,372,202,372,258,372,372,372,258,372,372,258,372,372,372,332,52
,372,372,332,202,372,372,372,202,332,332,332,372,258,202,202,202,372,52
,372,372,372,52,372,372,372,372,337,52,52,52,372,372,372,372,372,10,372
,372,372,258,332,332,372,372,372,202,202,372,372,337,339,372,372,337,372
,372,337,258,10,52,52,258,10,372,372,10,372,258,258,258,372,372,372,339
,337,372,372,339,372,372,339,372,372,10,372,260,372,372,372,372,372,372
,372,372,40,372,372,372,339,258,258,337,372,372,372,372,372,372,260,372
,10,372,260,372,372,260,372,40,372,337,372,40,372,337,40,339,372,372,10
,337,337,337,10,260,372,372,372,372,10,10,10,372,40,339,372,372,372,339
,372,372,372,372,372,339,339,339,372,372,372,372,260,337,337,372,372,372
,372,372,372,40,10,10,372,372,372,372,372,262,260,372,372,372,260,372,372
,339,339,40,260,260,260,40,345,372,372,372,372,40,40,40,262,291,372,372
,262,372,372,262,372,372,372,372,372,372,372,345,372,372,293,345,260,260
,345,372,291,262,372,351,291,40,40,291,372,372,372,372,372,372,372,372,345
,293,42,372,372,293,372,372,293,291,351,372,262,372,351,372,372,351,372
,372,372,372,372,372,372,42,293,345,372,42,262,372,42,372,262,351,291,372
,372,372,262,262,262,372,372,345,372,372,372,345,42,372,372,293,291,345
,345,345,291,372,372,372,351,372,291,291,291,372,372,372,372,293,262,262
,372,293,372,42,372,372,351,293,293,293,351,307,372,345,345,372,351,351
,351,372,310,42,291,291,372,42,372,372,372,372,372,42,42,42,307,312,372
,372,307,293,293,307,372,310,372,372,372,310,351,351,310,372,372,372,372
,314,372,372,312,307,372,372,312,42,42,312,372,372,310,372,105,372,372,372
,372,372,372,372,314,69,372,372,314,312,372,314,307,372,372,372,372,372
,372,105,372,310,372,105,372,372,105,372,69,314,307,372,69,372,307,69,312
,372,372,310,307,307,307,310,105,372,372,372,372,310,310,310,372,69,312
,372,314,372,312,372,372,372,372,372,312,312,312,372,372,372,372,105,307
,307,314,372,372,372,314,372,69,310,310,372,314,314,314,372,246,105,372
,372,372,105,372,372,312,312,69,105,105,105,69,364,372,372,372,372,69,69
,69,246,248,372,372,246,314,314,246,372,372,372,372,372,372,372,364,372
,372,71,364,105,105,364,372,248,246,372,275,248,69,69,248,372,372,372,372
,372,372,372,372,364,71,370,372,372,71,372,372,71,248,275,372,246,372,275
,372,372,275,372,372,372,372,372,372,372,370,71,364,372,370,246,372,370
,372,246,275,248,372,372,372,246,246,246,372,372,364,372,372,372,364,370
,372,372,71,248,364,364,364,248,372,372,372,275,372,248,248,248,372,372
,372,372,71,246,246,372,71,372,370,372,372,275,71,71,71,275,372,372,364
,364,372,275,275,275,372,372,370,248,248,372,370,372,372,372,372,372,370
,370,370,372,372,372,372,372,71,71,372,372,372,372,372,372,372,275,275,372
,372,372,372,372,372,372,372,372,372,372,372,372,370,370,372,372,372,372
,372,372,372,372,372,372,372,372}
,
{1170,0,1461,1317,1700,701,7402,7484,14440,452,15462,0,11630,149,133,11120
,13375,436,12604,5795,11744,4507,6002,13057,1605,14036,298,685,11778,556
,471,14299,376,212,12546,375,5698,4651,1461,1170,15521,14947,15669,11798
,439,14188,581,13906,5871,1317,6692,1898,15351,358,14094,14130,11425,745
,14852,491,15199,12941,1879,13234,73,13268,2023,13660,531,15820,586,15944
,600,15182,612,644,645,668,669,681,48,689,275,708,656,740,0,32,13718,829
,494,13754,1690,534,13812,541,14426,296,13848,536,14460,450,14550,455,570
,15811,260,675,14642,526,6181,226,11340,1268,625,13409,384,14000,14760,368
,9943,10908,311,457,11908,124,556,12024,21,448,14524,822,603,12314,319,10
,609,14608,602,660,14622,331,12372,469,15253,5273,659,9439,7107,168,448
,598,13200,51,8083,6289,219,376,392,457,7712,7189,486,13624,13554,13515
,222,551,8716,5136,499,7639,4899,14354,13942,12082,6976,12140,222,12198
,386,357,12256,193,7858,6444,12430,246,8643,6526,236,12789,88,12883,237
,9081,5601,15146,13093,340,9585,5014,15337,10064,10988,10499,417,11411,14697
,9693,12,398,6184,6633,7296,8465,9991,2671,10137,6362,8935,2541,4361,5273
,2151,6919,12999,233,7785,1733,888,10358,8285,8358,2801,8570,2411,14666
,5393,2,8862,1024,14246,10,12769,195,15903,314,15927,360,2281,9261,2931
,24,3451,3581,3711,3841,15391,6054,15512,7974,15604,7974,3971,8156,4101
,8285,4231,292,351,15062,5923,605,607,15953,51,56,558,10386,6812,3061,11650
,7025,8789,3191,594,11966,6739,9008,3321,15628,155,15645,903,721,172,45
,29,14888,564,53,54,14903,157,130,59,15752,917,305,15761,979,15776,9747
,15796,9860,10553,10666,476,11496,14785,12488,44,9154,5498,494,14870,15218
,12640,2,15268,571,15332,12725,596,15026,14406,15453,11241,15477,572,15120
,555,9366,4777,15619,617,13389,14308,643,14773,15654,10210,10720,10833,639
,11156,11326,14959,9512,7566,615,15067,706,15918,10967,11586,10434,734,736
,15968,746}
,
{
{{37,37}
,{1,1}
,{37,37}
,{86,86}
,{23,23}
,{5,5}
,{1,1}
,{1,1}
,{2,2}
,{5,5}
,{2,2}
,{2,4}
,{2,2}
,{2,4}
,{99,99}
,{2,2}
,{58,58}
,{5,5}
,{58,58}
,{5,5}
,{58,58}
,{5,5}
,{23,23}
,{58,58}
,{5,5}
,{58,58}
,{2,4}
,{3,3}
,{7,7}
,{7,7}
,{7,4}
,{2,2}
,{4,4}
,{3,3}
,{58,58}
,{11,11}
,{5,5}
,{5,5}
,{5,5}
,{5,5}
,{2,2}
,{2,2}
,{2,2}
,{24,24}
,{24,24}
,{58,58}
,{20,20}
,{58,58}
,{23,23}
,{5,4}
,{23,23}
,{23,23}
,{2,2}
,{68,68}
,{58,58}
,{58,58}
,{2,2}
,{4,4}
,{2,2}
,{32,32}
,{2,2}
,{58,58}
,{5,5}
,{58,58}
,{40,40}
,{58,58}
,{5,5}
,{58,58}
,{5,5}
,{2,2}
,{5,5}
,{2,2}
,{5,5}
,{2,2}
,{5,5}
,{5,5}
,{5,5}
,{5,5}
,{5,5}
,{5,5}
,{5,5}
,{5,5}
,{29,29}
,{5,5}
,{58,58}
,{5,5}
,{3,3}
,{5,5}
,{58,58}
,{5,5}
,{5,5}
,{58,58}
,{23,23}
,{5,5}
,{58,58}
,{24,24}
,{2,2}
,{5,5}
,{58,58}
,{73,73}
,{2,2}
,{5,5}
,{2,2}
,{5,5}
,{101,101}
,{2,2}
,{5,5}
,{5,5}
,{2,2}
,{5,5}
,{2,2}
,{5,5}
,{2,2}
,{90,90}
,{90,90}
,{58,58}
,{5,5}
,{58,58}
,{2,2}
,{5,5}
,{2,2}
,{73,73}
,{73,73}
,{73,73}
,{58,58}
,{5,5}
,{5,5}
,{58,58}
,{5,5}
,{73,73}
,{2,2}
,{5,5}
,{5,5}
,{58,58}
,{5,5}
,{32,32}
,{9,9}
,{2,2}
,{5,5}
,{5,5}
,{2,2}
,{20,20}
,{58,58}
,{5,5}
,{2,2}
,{30,30}
,{30,30}
,{58,58}
,{38,38}
,{48,48}
,{1,1}
,{1,1}
,{58,58}
,{65,65}
,{58,58}
,{38,38}
,{38,38}
,{38,38}
,{28,28}
,{5,5}
,{58,58}
,{38,38}
,{29,29}
,{58,58}
,{59,59}
,{38,38}
,{113,113}
,{5,5}
,{58,58}
,{8,8}
,{65,65}
,{58,58}
,{8,8}
,{23,23}
,{58,58}
,{58,58}
,{65,65}
,{58,58}
,{40,40}
,{58,58}
,{65,65}
,{38,38}
,{58,58}
,{65,65}
,{58,58}
,{38,38}
,{58,58}
,{65,65}
,{58,58}
,{38,38}
,{30,4}
,{58,58}
,{40,40}
,{58,58}
,{30,30}
,{58,58}
,{37,37}
,{2,2}
,{37,37}
,{9,9}
,{58,58}
,{2,2}
,{2,2}
,{21,21}
,{21,21}
,{38,38}
,{84,84}
,{5,5}
,{37,37}
,{21,21}
,{140,140}
,{140,140}
,{21,21}
,{21,21}
,{21,21}
,{21,21}
,{21,21}
,{21,21}
,{21,21}
,{28,28}
,{58,58}
,{21,21}
,{21,21}
,{58,58}
,{21,21}
,{21,21}
,{58,58}
,{59,59}
,{58,58}
,{21,21}
,{28,28}
,{5,5}
,{3,3}
,{58,58}
,{21,21}
,{58,58}
,{21,21}
,{2,2}
,{21,21}
,{59,59}
,{58,58}
,{2,2}
,{5,5}
,{3,3}
,{7,7}
,{7,7}
,{2,2}
,{3,3}
,{2,2}
,{5,5}
,{21,21}
,{21,21}
,{21,21}
,{119,119}
,{21,21}
,{21,21}
,{21,21}
,{21,21}
,{2,2}
,{21,21}
,{2,2}
,{21,4}
,{2,2}
,{58,58}
,{21,21}
,{58,58}
,{21,21}
,{58,58}
,{21,21}
,{119,119}
,{119,119}
,{2,2}
,{21,21}
,{5,5}
,{5,5}
,{2,2}
,{66,66}
,{66,66}
,{66,66}
,{21,21}
,{58,58}
,{21,21}
,{58,58}
,{28,28}
,{58,58}
,{21,21}
,{91,91}
,{58,58}
,{28,28}
,{58,58}
,{21,21}
,{2,2}
,{20,4}
,{2,2}
,{5,5}
,{5,5}
,{38,38}
,{38,38}
,{55,55}
,{5,5}
,{38,38}
,{38,38}
,{54,54}
,{5,5}
,{5,5}
,{38,38}
,{38,38}
,{2,2}
,{38,38}
,{54,54}
,{2,2}
,{38,4}
,{2,2}
,{21,21}
,{2,2}
,{21,21}
,{21,21}
,{38,38}
,{37,37}
,{5,5}
,{37,37}
,{58,58}
,{22,22}
,{58,58}
,{37,37}
,{56,56}
,{37,37}
,{2,2}
,{37,37}
,{8,4}
,{2,2}
,{5,5}
,{2,2}
,{37,37}
,{8,8}
,{2,2}
,{5,5}
,{2,2}
,{2,2}
,{2,2}
,{41,41}
,{2,2}
,{59,59}
,{58,58}
,{2,2}
,{2,2}
,{11,11}
,{2,2}
,{2,2}
,{20,20}
,{2,2}
,{2,2}
,{21,21}
,{21,21}
,{38,38}
,{42,42}
,{2,2}
,{5,5}
,{37,37}
,{58,58}
,{38,38}
,{85,85}
,{5,5}
,{5,5}
,{2,2}
,{2,2}
,{37,37}
,{5,5}
,{5,5}
,{5,5}
,{2,2}
,{5,5}
}
,
{8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
,
{0,0,0,0,6,0,3,192,0,0,15,0,12,0,0,0,64,17,4}
,
{52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
}
};
/* Non terminal table *\
\* ------------------ */
typedef struct {
UByte2 gto[2340]; /* Goto table */
UByte2 gtoRix[372]; /* Goto row mapping */
UByte2 lhs[386]; /* Left hand side symbols */
UByte1 rhsz[386]; /* Size of the RHS */
} NonTermTab;
static NonTermTab gto = {
{97,2177,2681,1002,97,217,2946,922,994,833,97,2586,297,690,473,217,658,1681
,2681,1633,2370,1482,193,1601,986,97,305,2946,97,857,881,930,946,217,321
,2641,97,473,97,2945,2442,897,473,265,377,97,690,714,401,882,913,2033,1689
,378,1161,2946,2097,2946,1945,954,50,137,553,2450,473,1634,842,2937,2482
,890,393,1801,2241,442,1809,1825,1322,706,938,1649,97,313,481,1913,2345
,113,2497,2409,410,906,2442,2626,2217,2922,97,2626,2225,1994,1529,217,2481
,2626,2922,2673,402,225,297,2177,2385,1002,1138,290,417,922,994,225,2626
,1674,1682,2626,305,97,249,1681,753,1650,81,2626,321,2626,986,2090,1658
,225,1130,417,2626,930,946,1329,1393,618,2634,273,2002,346,2634,898,2537
,1690,1698,1706,2634,433,1666,882,433,2033,1689,1969,1369,2729,417,361,393
,954,2177,2634,1002,1041,2634,2626,922,994,1921,313,481,1161,2634,434,2634
,1058,1681,1138,938,2626,1265,2634,1634,986,2441,178,154,2409,2025,906,930
,946,250,225,97,10,138,194,1362,785,2481,1130,738,802,170,122,2626,962,882
,1177,2033,1689,2449,1161,1994,1945,2634,1138,954,162,130,186,146,610,1642
,418,473,2458,2017,1401,2634,985,2929,1601,1674,1682,2417,938,49,1457,97
,1130,1650,1945,442,217,2409,898,906,1658,2474,17,2482,433,433,2922,1994
,2634,2377,2481,690,2002,1161,370,1234,106,1690,1698,1706,2409,1713,1666
,514,1634,721,1161,1674,1682,2881,65,970,2369,2481,345,1650,2626,1634,2185
,490,961,2449,1658,1785,97,2946,97,842,1953,465,1697,217,578,594,2002,1257
,1994,898,2457,1690,1698,1706,2713,433,1666,97,2098,25,1161,1994,217,914
,2729,345,2641,1393,1674,1682,1593,1634,745,1161,2626,1753,1650,1489,865
,2634,1106,1674,1682,1658,1634,2698,2569,1369,225,1650,1521,769,1610,426
,1945,2002,1658,2697,1114,2922,1690,1698,1706,1994,2201,1666,433,2426,2002
,842,2698,1161,1330,1690,1698,1706,1994,433,1666,690,1721,1641,1634,1674
,1682,2634,2458,2626,1577,2626,2633,1650,2193,2930,1490,2081,1674,1682,1658
,2233,345,1161,2745,225,1650,2922,2938,1729,2626,1737,2002,1658,1634,1274
,1994,1690,1698,1706,1617,2922,1666,97,225,2002,2945,2281,217,1089,1690
,1698,1706,209,1097,1666,1674,1682,338,729,2634,1161,2634,97,1650,185,1994
,58,217,1673,1769,1658,1634,2833,1161,2321,209,801,1193,498,2682,2634,1345
,2002,921,1634,1674,1682,1690,1698,1706,1249,1921,1666,1650,97,1418,2570
,2361,209,817,1658,33,433,1994,97,1089,569,977,97,265,1097,546,2002,265
,2873,1161,1994,1690,1698,1706,585,1362,1666,1674,1682,657,1634,433,2913
,602,2473,1650,1777,2626,993,601,1674,1682,1658,2626,2513,850,2529,433,1650
,185,2545,225,1017,97,2002,1658,209,2626,217,1690,1698,1706,1994,810,1666
,297,1202,2002,657,666,2593,225,1690,1698,1706,1161,1929,1666,209,305,1586
,298,1674,1682,1161,290,1634,321,2634,2626,1650,673,1841,1065,1057,1634
,249,1658,2657,2626,2626,1881,185,2626,234,2001,209,1121,2634,2002,2466
,337,209,273,1690,1698,1706,273,1994,1666,1169,2777,2793,393,466,1161,2817
,1994,1825,2825,209,2841,2418,241,313,481,1634,2865,1674,1682,2634,209,1897
,762,2626,2618,1650,1674,1682,1209,2634,1113,1210,1658,2634,1650,1442,2954
,225,2122,2953,2977,1658,0,0,2002,1161,0,1994,0,1690,1698,1706,97,2002,1666
,0,1634,217,1690,1698,1706,1089,1937,1666,297,0,1097,1674,1682,0,0,97,0
,0,2634,1650,217,0,305,0,0,0,1658,0,0,1161,321,0,1994,0,0,0,0,0,2002,0,1634
,0,0,1690,1698,1706,1297,0,1666,953,0,0,1674,1682,0,0,0,97,0,1161,1650,0
,217,0,0,0,393,1658,0,0,1634,1009,1994,0,0,97,2049,313,481,2002,217,0,0
,0,1690,1698,1706,2626,0,1666,0,1321,1674,1682,0,0,2626,1161,0,97,1650,225
,1994,0,217,0,2626,1658,1634,2722,1161,0,0,0,2065,0,0,0,0,2002,225,1634
,1674,1682,1690,1698,1706,2121,0,1666,1650,0,0,2730,0,0,0,1658,2634,0,1994
,0,0,0,0,0,0,1137,2626,2002,0,0,1161,1994,1690,1698,1706,2634,0,1666,1674
,1682,225,1634,0,1161,2626,97,1650,2137,0,0,217,1674,1682,1658,1634,0,97
,0,225,1650,2153,217,0,0,0,2002,1658,0,2626,0,1690,1698,1706,1994,0,1666
,0,2634,2002,2434,0,1161,225,1690,1698,1706,1994,0,1666,0,2490,0,1634,1674
,1682,2634,0,0,2257,0,0,1650,0,0,0,0,1674,1682,1658,0,0,1161,97,0,1650,0
,0,217,0,2634,2002,1658,1634,0,1994,1690,1698,1706,2289,0,1666,0,0,2002
,0,0,2626,0,1690,1698,1706,0,0,1666,1674,1682,2562,2626,0,1161,225,0,1650
,0,1994,0,0,0,0,1658,1634,225,1161,0,0,0,2329,0,0,0,0,2002,0,1634,1674,1682
,1690,1698,1706,1361,0,1666,1650,0,0,0,0,2634,0,1658,0,0,1994,0,0,0,0,0
,2634,0,0,2002,0,2626,1161,1994,1690,1698,1706,0,0,1666,1674,1682,0,1634
,0,225,0,0,1650,2601,0,0,0,1674,1682,1658,0,0,0,0,0,1650,0,0,0,0,0,2002
,1658,0,1161,0,1690,1698,1706,1994,0,1666,0,0,2002,1642,2634,0,0,1690,1698
,1706,0,0,1666,0,0,0,0,1674,1682,0,0,0,1161,0,0,1650,0,0,0,0,0,1161,1658
,1634,0,1994,0,0,0,2761,0,0,1634,0,2002,0,0,0,1385,1690,1698,1706,0,0,1666
,1674,1682,0,0,0,0,1161,0,1650,0,1994,0,0,0,1554,1658,0,1634,0,1994,0,0
,0,2889,0,0,0,2002,0,0,1674,1682,1690,1698,1706,0,0,1666,1650,1674,1682
,0,0,0,0,1658,0,1650,0,1994,1161,0,0,0,1658,0,0,2002,0,0,0,1642,1690,1698
,1706,0,2002,1666,0,1674,1682,1690,1698,1706,0,1434,1666,1650,0,0,1161,0
,0,0,1658,0,0,0,0,1161,0,1642,0,1994,0,0,2002,0,0,0,1642,1690,1698,1706
,0,0,1666,0,0,0,0,0,0,1674,1682,0,0,0,0,1161,0,1650,0,1994,0,0,0,0,1658
,0,1642,97,1994,0,0,0,217,0,0,0,2002,0,0,1674,1682,1690,1698,1706,0,0,1666
,1650,1674,1682,0,0,0,1161,1658,0,1650,0,1994,0,0,321,0,1658,1642,0,2002
,0,0,0,0,1690,1698,1706,0,2002,1666,0,1674,1682,1690,1698,1706,1161,0,1666
,1650,0,0,0,0,0,0,1658,1642,97,1994,393,0,0,217,0,0,0,0,2002,0,297,537,481
,1690,1698,1706,0,0,1666,1674,1682,2626,0,0,305,0,0,1650,1161,1994,0,0,321
,0,1658,225,0,0,0,1642,0,0,0,0,0,0,2002,0,0,1674,1682,1690,1698,1706,0,0
,1666,1650,1161,0,0,0,0,0,1658,0,0,1161,393,1642,0,1994,2634,1033,0,0,2002
,0,1642,313,481,1690,1698,1706,0,0,1666,0,0,2626,0,1674,1682,0,0,0,0,0,0
,1650,97,1994,0,225,0,217,1658,0,0,0,1994,0,297,0,0,0,1161,0,2002,0,0,1674
,1682,1690,1698,1706,305,1642,1666,1650,1674,1682,0,0,321,0,1658,0,1650
,97,2634,0,0,0,217,1658,0,0,2002,0,0,297,0,1690,1698,1706,0,2002,1666,1994
,1161,0,1690,1698,1706,305,0,1666,0,0,393,1642,0,321,0,1473,0,0,0,1674,1682
,313,481,0,0,0,0,1650,0,0,1161,2626,97,0,1658,0,0,217,0,0,0,1642,0,1994
,297,225,2002,0,0,393,0,1690,1698,1706,1081,0,1666,0,305,0,313,481,0,1674
,1682,0,321,0,1161,0,2626,1650,0,1994,0,0,0,0,1658,1642,0,1161,2634,0,225
,0,0,0,0,0,2002,0,1642,1674,1682,1690,1698,1706,0,0,1666,1650,393,0,0,0
,0,1505,1658,0,0,1994,0,313,481,0,0,97,0,0,2002,2634,217,2626,1994,1690
,1698,1706,0,297,1666,1674,1682,0,0,0,0,225,0,1650,0,0,1161,305,1674,1682
,1658,0,0,0,0,321,1650,1642,0,0,0,0,2002,1658,0,0,0,1690,1698,1706,0,0,1666
,0,97,2002,1161,0,2634,217,1690,1698,1706,0,0,1666,297,1642,0,1994,0,393
,0,0,0,0,1153,0,0,0,305,0,313,481,0,0,0,0,321,1674,1682,0,2626,0,1161,0
,0,1650,0,1994,0,0,0,0,1658,1642,225,1161,0,0,0,0,0,0,0,0,2002,0,1642,1674
,1682,1690,1698,1706,393,0,1666,1650,0,145,0,0,0,0,1658,313,481,1994,0,0
,0,0,97,2634,0,2626,2002,217,0,0,1994,1690,1698,1706,297,0,1666,1674,1682
,225,0,97,0,1161,0,1650,217,0,305,0,1674,1682,1658,297,1642,0,321,0,1650
,0,0,0,0,0,2002,1658,0,305,0,1690,1698,1706,0,0,1666,321,2634,2002,0,0,0
,0,1690,1698,1706,1161,1994,1666,0,0,0,0,393,0,1161,0,1642,2273,0,0,0,0
,0,313,481,1642,1674,1682,0,0,0,393,0,2626,1650,0,2313,0,0,0,0,1658,313
,481,1161,0,0,225,1994,0,0,0,2626,2002,0,1642,0,1994,1690,1698,1706,0,0
,1666,0,0,225,0,1674,1682,0,0,0,0,0,0,1650,1674,1682,0,0,0,1161,1658,2634
,1650,0,1994,0,0,0,0,1658,1642,97,2002,0,0,0,217,1690,1698,1706,2634,2002
,1666,297,1674,1682,1690,1698,1706,0,0,1666,1650,0,0,0,0,305,97,1658,0,0
,1994,217,0,321,0,0,0,0,297,2002,0,0,97,0,1690,1698,1706,217,0,1666,1674
,1682,305,0,161,0,1161,0,1650,0,321,0,0,0,0,1658,0,1642,305,393,0,0,0,0
,2585,0,321,2002,0,0,313,481,1690,1698,1706,0,0,1666,97,0,2626,0,0,217,0
,0,393,0,0,1994,297,1233,0,0,225,0,97,313,481,0,0,217,393,0,305,0,0,2626
,297,1674,1682,0,321,313,481,0,0,1650,1161,0,0,225,305,2626,1658,0,0,1161
,0,1642,321,2634,0,0,0,0,2002,225,1642,0,0,1690,1698,1706,0,0,1666,0,393
,0,0,0,0,289,0,0,0,0,2634,313,481,1994,0,0,0,0,393,0,1161,2626,1994,937
,0,0,2634,0,0,313,481,1642,0,1674,1682,225,0,0,0,2626,0,1650,1674,1682,0
,0,0,0,1658,0,1650,97,0,225,97,0,217,1658,0,217,2002,0,0,1994,0,1690,1698
,1706,0,2002,1666,0,2634,97,1690,1698,1706,1417,217,1666,177,0,0,1674,1682
,321,0,0,321,0,2634,1650,97,0,0,97,0,217,1658,0,217,0,0,0,0,0,0,321,0,0
,2002,0,0,0,0,1690,1698,1706,0,0,1666,393,0,0,393,0,321,0,0,321,0,0,313
,481,0,313,481,0,0,0,0,97,2626,393,0,2626,217,97,0,0,0,0,217,0,201,481,225
,0,0,225,0,0,393,0,2626,393,0,0,0,0,0,0,0,505,481,321,1433,481,225,97,0
,321,0,2626,217,97,2626,0,0,0,217,0,0,2634,0,0,2634,225,0,0,225,0,0,0,0
,0,0,0,0,0,0,393,0,321,0,2634,0,393,0,321,0,0,1449,481,0,0,0,0,1545,481
,0,0,2626,0,2634,0,0,2634,2626,0,0,0,0,0,0,0,225,0,0,393,0,0,225,0,0,393
,0,0,0,0,1561,481,0,0,0,0,521,481,0,0,2626,0,0,0,0,0,2626,0,0,0,0,0,0,2634
,225,0,0,0,0,2634,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,2634,0,0,0,0,0,2634}
,
{202,19,391,188,227,14,214,1978,121,13,461,13,80,13,13,8,1613,13,1896,13
,2066,347,3,2085,599,822,13,13,490,13,13,486,13,13,1942,13,13,481,564,588
,610,304,623,10,12,889,12,444,13,12,36,372,588,12,730,754,299,12,190,12
,11,2104,414,2197,437,1213,460,28,12,488,12,502,12,517,12,12,12,11,10,10
,420,9,500,9,9,9,9,9,246,331,7,301,107,6,320,6,200,6,424,6,476,6,4,6,6,29
,203,5,25,5,36,4,45,356,4,1960,4,670,229,4,334,94,359,4,651,426,3,1281,3
,3,430,435,3,1422,3,3,3,487,449,3,660,3,1560,2,598,63,2,388,1719,573,569
,2,1880,2,401,165,49,2,2,2,630,1117,2,712,41,231,396,2,885,1185,2,1004,1287
,216,833,2063,428,2107,514,2153,536,1,1383,1,269,1419,1475,1,282,1561,1
,2159,570,2191,588,320,1668,239,23,1,350,1787,19,255,3,0,1,362,6,19,175
,1,163,269,295,304,292,227,376,349,443,1928,1937,0,1108,1,531,1,499,1147
,1,381,1,508,1215,549,1257,58,357,459,590,1296,198,1,38,1,582,1,583,1,123
,260,1345,214,660,1389,698,1457,396,409,27,495,635,711,1470,753,1531,766
,1599,101,174,221,249,0,0,92,36,254,11,387,804,1612,1701,366,834,1710,0
,1720,393,872,1749,55,0,479,153,0,7,0,0,93,185,435,0,102,0,40,388,512,107
,0,57,0,522,475,524,19,452,106,0,261,495,1853,537,927,965,0,494,300,6,0
,576,0,18,2,0,250,73,161,0,327,0,278,0,995,1856,599,0,460,546,0,562,607
,325,533,165,0,571,408,576,1034,1078,0,422,0,634,39,427,638,0,0,639,0}
,
{206,271,271,187,187,179,179,172,172,172,172,243,243,234,234,234,234,234
,234,234,234,234,234,234,174,223,223,297,297,297,297,297,297,272,272,235
,235,224,224,224,188,244,244,290,189,245,245,181,173,236,236,237,261,261
,257,257,291,291,207,207,307,307,284,278,278,309,309,154,238,251,251,208
,208,279,279,274,273,209,262,262,262,225,225,167,252,252,157,165,228,192
,192,190,193,193,194,195,195,196,196,191,254,197,197,280,280,198,199,199
,227,227,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,201
,201,202,202,159,285,285,152,152,152,152,299,299,240,240,263,263,184,184
,160,160,183,229,210,158,182,286,286,298,203,203,281,281,258,258,264,264
,265,265,176,176,169,246,246,267,267,266,266,259,259,275,275,275,166,247
,230,175,211,211,212,212,161,161,161,213,213,214,214,155,162,162,282,282
,215,215,164,292,292,222,222,216,216,216,216,216,216,216,216,276,276,276
,276,276,276,276,204,204,204,204,204,305,305,305,305,269,269,300,300,300
,300,300,287,287,306,306,306,308,308,308,308,308,255,255,302,302,248,296
,296,231,231,288,288,295,218,218,249,249,241,241,301,219,219,303,303,303
,205,205,205,268,268,289,289,283,283,283,283,283,283,283,283,283,220,220
,294,294,226,226,163,163,177,177,177,177,177,232,232,232,232,232,186,186
,178,178,178,270,270,270,270,185,185,185,185,185,185,185,185,221,221,233
,233,233,217,156,156,242,242,242,242,293,293,260,260,168,168,168,168,168
,171,171,171,171,170,170,170,170,170,170,170,253,253,253,253,250,250,304
,304,304,304,239,239,153,153,180,180,277,277,256,256,151,151,151,151,151
,151,151,151,151,151,151,151,151}
,
{3,0,2,1,1,1,2,2,3,3,3,0,2,1,1,1,1,1,1,1,1,1,1,1,2,2,3,1,2,2,2,3,4,0,1,1
,3,1,1,2,2,1,2,4,2,1,2,3,2,1,2,4,1,2,1,4,0,2,1,1,1,3,5,1,1,1,2,3,3,0,1,1
,1,1,2,3,2,4,0,2,2,1,3,3,0,1,3,5,4,0,1,7,0,1,5,0,1,0,1,5,4,0,1,0,1,3,0,1
,0,2,2,1,1,2,1,1,1,1,1,2,2,2,1,1,1,0,1,0,1,6,0,5,1,1,1,1,0,1,3,2,1,1,1,2
,1,2,2,2,2,3,3,0,1,4,0,1,0,1,5,1,0,3,0,2,1,2,3,1,1,1,2,0,2,0,2,0,3,2,3,2
,4,5,0,1,1,2,2,5,6,0,1,0,1,5,1,1,0,3,0,1,4,0,1,1,2,1,1,1,1,1,1,1,1,1,3,4
,3,3,3,3,0,1,1,1,1,4,4,5,5,3,6,4,8,4,4,5,0,2,0,1,1,0,1,1,1,1,0,2,1,1,9,0
,1,4,5,0,2,7,1,1,1,2,2,3,8,0,1,0,1,4,1,1,2,3,5,0,2,2,2,2,2,2,3,3,3,3,1,1
,0,1,1,3,1,3,1,3,4,4,6,1,2,3,3,3,1,3,2,3,2,1,3,3,5,1,1,1,2,3,3,4,4,1,3,1
,1,1,2,1,1,1,1,2,2,3,3,0,1,2,2,3,3,3,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,0
,1,1,1,0,1,1,2,1,3,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
};
/* Vocabulary *\
\* ---------- */
typedef struct {
UByte1 scc; /* Scanner code value */
UByte1 iCost; /* Insertion cost */
UByte1 dCost; /* Deletion cost */
char *name; /* Name string */
char *psym; /* Print name */
} VocTab[150];
static VocTab voc = {{1,255,255,"EndOfText",""}
,{2,1,1,"Identifier","<identifier>"}
,{3,2,1,"Integer",""}
,{4,1,1,"','",""}
,{5,1,1,"'.'",""}
,{6,1,1,"'{'",""}
,{7,1,1,"'}'",""}
,{8,1,1,"'='",""}
,{9,1,1,"':'",""}
,{10,1,1,"'('",""}
,{11,1,1,"')'",""}
,{12,1,1,"'*'",""}
,{13,1,1,"'!'",""}
,{14,1,1,"'+'",""}
,{15,1,1,"'-'",""}
,{16,1,1,"'/'",""}
,{17,1,1,"'>'",""}
,{18,1,1,"'<'",""}
,{19,1,1,"'no'",""}
,{20,1,1,"'to'",""}
,{21,1,1,"'is'",""}
,{22,1,1,"'=>'",""}
,{23,1,1,"'at'",""}
,{24,1,1,"'in'",""}
,{25,1,1,"'it'",""}
,{26,1,1,"'an'",""}
,{27,1,1,"'by'",""}
,{28,1,1,"'if'",""}
,{29,1,1,"'on'",""}
,{30,1,1,"'do'",""}
,{31,1,1,"'or'",""}
,{32,1,1,"'of'",""}
,{33,1,1,"'<>'",""}
,{34,1,1,"'=='",""}
,{35,1,1,"'>='",""}
,{36,1,1,"'<='",""}
,{37,1,1,"'the'",""}
,{38,1,1,"'end'",""}
,{39,1,1,"'not'",""}
,{40,1,1,"'and'",""}
,{41,1,1,"'isa'",""}
,{42,1,1,"'add'",""}
,{43,1,1,"'are'",""}
,{44,1,1,"'has'",""}
,{45,1,1,"'can'",""}
,{46,1,1,"'say'",""}
,{47,1,1,"'set'",""}
,{48,1,1,"'for'",""}
,{49,1,1,"'use'",""}
,{50,1,1,"'off'",""}
,{51,1,1,"'max'",""}
,{52,1,1,"'min'",""}
,{53,1,1,"'sum'",""}
,{54,1,1,"'verb'",""}
,{55,1,1,"'exit'",""}
,{56,1,1,"'when'",""}
,{57,1,1,"'quit'",""}
,{58,1,1,"STRING",""}
,{59,1,1,"'else'",""}
,{60,1,1,"'meta'",""}
,{61,1,1,"'does'",""}
,{62,1,1,"'form'",""}
,{63,1,1,"'name'",""}
,{64,1,1,"'with'",""}
,{65,1,1,"'then'",""}
,{66,1,1,"'step'",""}
,{67,1,1,"'wait'",""}
,{68,1,1,"'here'",""}
,{69,1,1,"'near'",""}
,{70,1,1,"'list'",""}
,{71,1,1,"'show'",""}
,{72,1,1,"'play'",""}
,{73,1,1,"'from'",""}
,{74,1,1,"'make'",""}
,{75,1,1,"'last'",""}
,{76,1,1,"'word'",""}
,{77,1,1,"'into'",""}
,{78,1,1,"'each'",""}
,{79,1,1,"'stop'",""}
,{80,1,1,"'look'",""}
,{81,1,1,"'save'",""}
,{82,1,1,"'this'",""}
,{83,1,1,"'only'",""}
,{84,1,1,"'every'",""}
,{85,1,1,"'event'",""}
,{86,1,1,"'start'",""}
,{87,1,1,"'check'",""}
,{88,1,1,"'where'",""}
,{89,1,1,"'count'",""}
,{90,1,1,"'after'",""}
,{91,1,1,"'until'",""}
,{92,1,1,"'style'",""}
,{93,1,1,"'empty'",""}
,{94,1,1,"'strip'",""}
,{95,1,1,"'first'",""}
,{96,1,1,"'words'",""}
,{97,1,1,"'elsif'",""}
,{98,1,1,"'score'",""}
,{99,1,1,"'actor'",""}
,{100,1,1,"'syntax'",""}
,{101,1,1,"'script'",""}
,{102,1,1,"'option'",""}
,{103,1,1,"'import'",""}
,{104,1,1,"'prompt'",""}
,{105,1,1,"'visits'",""}
,{106,1,1,"'opaque'",""}
,{107,1,1,"'taking'",""}
,{108,1,1,"'limits'",""}
,{109,1,1,"'header'",""}
,{110,1,1,"'nearby'",""}
,{111,1,1,"'locate'",""}
,{112,1,1,"'cancel'",""}
,{113,1,1,"'depend'",""}
,{114,1,1,"'system'",""}
,{115,1,1,"'random'",""}
,{116,1,1,"'before'",""}
,{117,1,1,"'options'",""}
,{118,1,1,"'message'",""}
,{119,1,1,"'article'",""}
,{120,1,1,"'entered'",""}
,{121,1,1,"'pronoun'",""}
,{122,1,1,"'extract'",""}
,{123,1,1,"'include'",""}
,{124,1,1,"'exclude'",""}
,{125,1,1,"'between'",""}
,{126,1,1,"'restore'",""}
,{127,1,1,"'restart'",""}
,{128,1,1,"'current'",""}
,{129,1,1,"'synonyms'",""}
,{130,1,1,"'definite'",""}
,{131,1,1,"'negative'",""}
,{132,1,1,"'directly'",""}
,{133,1,1,"'describe'",""}
,{134,1,1,"'schedule'",""}
,{135,1,1,"'increase'",""}
,{136,1,1,"'decrease'",""}
,{137,1,1,"'contains'",""}
,{138,1,1,"'location'",""}
,{139,1,1,"'mentioned'",""}
,{140,1,1,"'container'",""}
,{141,1,1,"'character'",""}
,{142,1,1,"'depending'",""}
,{143,1,1,"'attributes'",""}
,{144,1,1,"'indefinite'",""}
,{145,1,1,"'initialize'",""}
,{146,1,1,"'indirectly'",""}
,{147,1,1,"'characters'",""}
,{148,1,1,"'transcript'",""}
,{149,1,1,"'description'",""}
,{150,1,1,"'transitively'",""}
}
;
/* Variables used in the parsing process *\
\* ------------------------------------- */
short pmStkP; /* Stack pointer */
Token pmSySt[PmStkMax]; /* Symbol stack */
pmGrammar pmSeSt[PmStkMax]; /* Semantic stack */
static UByte2 currstat; /* Current state number */
static UByte2 arg; /* Argument */
static UByte1 action; /* Action type */
static PmBoolean endparse; /* Termination flag */
static ParseStack parsStk; /* Parse stack */
static UByte1 scIndex[150 + 1]; /* Converts scanner code to internal value */
static Token tokenBuf; /* Scanner token buffer */
static Token *token = &tokenBuf; /* Pointer to it for readsymb */
/* Error recovery look-ahead buffer *\
\* -------------------------------- */
static Token la_buff[PmLaMax + 1]; /* Buffer */
static int la_ptr; /* Current pointer */
static int la_end; /* Last item */
static jmp_buf pmJmpB; /* Buffer for long jump */
/* Interface routines *\
\* ------------------ */
extern void pmRPoi( /* Error recovery - restart point */
Token *sym /* IN the restart symbol */
);
extern void pmISym( /* Error recovery - insert symbol */
int code, /* IN terminal code number */
char *sstr, /* IN terminal string */
char *pstr, /* IN the terminals print symbol */
Token *sym /* OUT the created scanner symbol */
);
extern void pmDSym( /* Error recovery - delete symbol */
Token *sym, /* IN terminal code number */
char *sstr, /* IN terminal string */
char *pstr /* IN terminals print string */
);
extern void pmMess( /* Error recovery - error message */
Token *sym, /* IN error token */
int method, /* IN recovery method */
int code, /* IN error classification */
int severity /* IN error severity code */
);
/* External functions */
extern void pmPaSema(
int rule /* IN production number */
);
/*----------------------------------------------------------------------------
* paAbort - Abort the parsing process
*----------------------------------------------------------------------------
*/
static void paAbort(
Token *token, /* IN current token */
short eClass, /* IN error classification */
short severity /* IN error severity code */
)
{
pmMess(token, HALT_REC, eClass, severity);
longjmp(pmJmpB, PMTRUE); /* Jump out to top level */
}/*paAbort()*/
/*----------------------------------------------------------------------------
* SetIns - Add one element to a set
*----------------------------------------------------------------------------
*/
#define SetIns(set, n) ((set)[(n) >> 3] |= (0x80 >> ((n) & 0x7)))
/*----------------------------------------------------------------------------
* SetClear - Clear a ParserMaker set
*----------------------------------------------------------------------------
*/
#define SetClear(set, length) memset((void *)set, 0, (size_t)((length) + 7) >> 3)
/*----------------------------------------------------------------------------
* SetMem - Check member inclusion
*----------------------------------------------------------------------------
*/
#define SetMem(set, n) ((set)[(n) >> 3] & (0x80 >> ((n) & 0x7)))
/*----------------------------------------------------------------------------
* paInit - Initialize the parsing process
*----------------------------------------------------------------------------
*/
static void paInit(void)
{
short i;
la_ptr = 0;
la_end = 0;
pmStkP = 0;
currstat = 1;
endparse = PMFALSE;
parsStk[0] = 1;
/* Scanner interface */
for (i = 0; i <= SccMax; i++) scIndex[i] = ERR_SYM;
for (i = TermMin; i <= Terms; i++) scIndex[voc[i - TermMin].scc] = (UByte1)i;
}/*paInit()*/
/*----------------------------------------------------------------------------
* pushStat[Tok] - Push the current state on the stack and possibly push current
* token on the symbol stack.
*----------------------------------------------------------------------------
*/
#define MOVETOKEN pmSySt[pmStkP] = *token
#define pushStatTok()\
{\
if (++pmStkP < PmStkMax) {\
parsStk[pmStkP] = currstat;\
MOVETOKEN;\
} else {\
token->code = voc[token->code-TermMin].scc;\
paAbort(token, OFLW_ERR, SYS_SEV);\
}\
}
#define pushStat()\
{\
if (++pmStkP < PmStkMax) {\
parsStk[pmStkP] = currstat;\
} else {\
token->code = voc[token->code-TermMin].scc;\
paAbort(token, OFLW_ERR, SYS_SEV);\
}\
}
/*----------------------------------------------------------------------------
* actTbl - Do a look-up in the action table
*----------------------------------------------------------------------------
*/
#define actTbl(st, sy, action, arg)\
{\
register int actEnt;\
register int actSt;\
register int actSy;\
actSt = st - StateMin;\
actSy = sy - TermMin;\
if (act.actCheck[act.actRix[actSt] + actSy] == actSt)\
actEnt = act.act[act.actRix[actSt] + actSy];\
else actEnt = ERROR_ACT;\
*action = actEnt & 0x7;\
*arg = actEnt >> 3;\
}/*actTbl()*/
/*----------------------------------------------------------------------------
* gtoTbl - Do a look-up in the goto table
*----------------------------------------------------------------------------
*/
#define gtoTbl(st, sy, action, arg)\
{\
register int gtoEnt;\
register int gtoSt;\
register int gtoSy;\
gtoSt = st - StateMin;\
gtoSy = sy - Terms - 1;\
gtoEnt = gto.gto[gto.gtoRix[gtoSt] + gtoSy];\
*action = gtoEnt & 0x7;\
*arg = gtoEnt >> 3;\
}/*gtoTbl()*/
/*----------------------------------------------------------------------------
* E R R O R R E C O V E R Y
* ---------------------------
*
* The error recovery algorithm tries to modify current configuration in such
* a way that parsing can be resumed correctly. Current configuration is
* characterized by:
*
* w = x t y, where x = parsed input
* t = current token
* y = unprocessed input
*----------------------------------------------------------------------------
*/
typedef struct {
Token err_tok;
Token res_tok;
short method;
short eClass;
short severity;
} ERR_REC;
static ERR_REC errdescr;
/*----------------------------------------------------------------------------
* ePush - Push a state during error recovery
*----------------------------------------------------------------------------
*/
static void ePush(
UByte2 state, /* IN state to push */
UByte2 stack[], /* INOUT parser stack */
short *sp /* INOUT current stack pointer */
)
{
if (++(*sp) < PmStkMax) stack[*sp] = state;
else paAbort(&errdescr.err_tok, OFLW_ERR, SYS_SEV);
}/*ePush()*/
/*----------------------------------------------------------------------------
* legalAct - Check if a symbol is legal to shift in current state
*----------------------------------------------------------------------------
*/
static PmBoolean legalAct(
UByte2 stack[], /* IN current stack */
short stack_p, /* IN current stack pointer */
UByte1 sym /* IN symbol code */
) /* RET true if "symbol" is read (shifted) */
/* in current state */
{
UByte2 state; /* Current state */
UByte1 action; /* Current parser action */
UByte2 arg; /* Current parser argument */
ParseStack t_stk; /* Temporary parser stack */
int i; /* For loop index */
/* Copy stack
*/
for (i = 0; i <= stack_p; i++) t_stk[i] = stack[i];
state = stack[stack_p];
for (;;) {
actTbl(state, sym, &action, &arg);
switch (action) {
case ERROR_ACT:
return(PMFALSE);
case SHIFT_ACT:
case SHIFTRED_ACT:
case ACCEPT_ACT:
return(PMTRUE);
case REDUCE_ACT:
do {
stack_p = stack_p - gto.rhsz[arg - ProdMin];
gtoTbl(t_stk[stack_p], gto.lhs[arg - ProdMin], &action, &arg);
ePush(state, t_stk, &stack_p);
} while (action != SHIFT_ACT);
state = arg; t_stk[stack_p] = state;
break;
}/*switch*/
}/*for*/
}/*legalAct()*/
/*----------------------------------------------------------------------------
* gLegSym - Get legal symbols
*----------------------------------------------------------------------------
*/
static void gLegSym(
ParseStack stack, /* IN current stack */
short stack_p, /* IN current stack pointer */
TermSet legals /* OUT legal symbols in current state */
)
{
short sym; /* Loop index */
SetClear(legals, Terms + 1);
for (sym = 1; sym <= Terms; sym++) {
if (legalAct(stack, stack_p, sym)) SetIns(legals, sym);
}/*for*/
}/*gLegSym()*/
/*----------------------------------------------------------------------------
* backup - Backup the parse stack until current symbol is accepted (shifted)
* or the parse stack becomes empty
*----------------------------------------------------------------------------
*/
static short backup(
ParseStack stack, /* IN current stack */
short stack_p, /* IN current stack pointer */
UByte1 sym /* IN recovery symbol */
) /* RET new stack pointer, 0 if symbol is */
/* not accepted */
{
while ((stack_p > 0) && (!legalAct(stack, stack_p, sym))) stack_p--;
return(stack_p);
}/*backup()*/
/*----------------------------------------------------------------------------
* delSym - Delete a symbol in the input stream
*----------------------------------------------------------------------------
*/
static void delSym(
Token *token /* INOUT symbol to delete, new symbol */
)
{
short t;
t = token->code - TermMin;
token->code = voc[t].scc;
pmDSym(token, voc[t].name, voc[t].psym);
{
if (la_ptr < la_end) {
la_ptr++;
*token = la_buff[la_ptr];
} else {
do {
smScan(lexContext, token);
if (token->code > SccMax || token->code < 0) {
token->code = ERR_SYM;
} else token->code = scIndex[token->code];
if (token->code == ERR_SYM) {
pmMess(token, DEL_REC, LEX_ERR, FAT_SEV);
}
} while (token->code == ERR_SYM);
}
}
if (errdescr.method == IN_REC) errdescr.method = REP_REC;
else if (errdescr.method != REP_REC) errdescr.method = DEL_REC;
}/*delSym()*/
/*----------------------------------------------------------------------------
* inSym - Insert a symbol in the input stream
*----------------------------------------------------------------------------
*/
static void inSym(
short isym, /* IN symbol code to insert */
Token *gen_symb /* OUT created symbol */
)
{
pmISym(voc[isym - TermMin].scc, voc[isym - TermMin].name,
voc[isym - TermMin].psym, gen_symb);
if (errdescr.method == DEL_REC) errdescr.method = REP_REC;
else if (errdescr.method != REP_REC) errdescr.method = IN_REC;
gen_symb->code = isym;
}/*inSym()*/
/*----------------------------------------------------------------------------
* M U L T I P L E R E C O V E R Y
* ---------------------------------
*
* The multiple symbols recovery technique is a "true local corrector", i.e.
* it will always return a legal configuration for any input. Logically the
* algorithm can be described as follows:
*
* 1) Roerich method (Karlsruhe):
* a. Find a continuation "u" of "x", such that "xu" is accepted.
* b. De composite "ty" into "qsy'", where q is a string.
* c. Delete "q".
* d. Insert u' (a prefix of u) between "x" and "sy'" giving xu' s y'.
*
* 2) Panic mode:
* If "q" contains a fiducial symbol "a" then:
* a. Pop stack until "a" is accepted.
* b. If not succeeded resume at step 1.
*----------------------------------------------------------------------------
*/
typedef struct {
UByte2 r_state; /* Recovery state */
PmBoolean r_sepa; /* Insert separator? */
UByte2 r_sstat; /* Where to insert separator */
} REC_POI;
/*----------------------------------------------------------------------------
* acceptbl - Check whether "symbol" is reachable from current state using
* the continuation grammar.
*----------------------------------------------------------------------------
*/
static void acceptbl(
UByte1 sym, /* IN terminal symbol code */
ParseStack stack, /* IN parse stack */
short stack_p, /* IN stack pointer */
Token *token, /* IN current token */
PmBoolean *found, /* OUT "symbol" accepted? */
REC_POI *point /* OUT recovery point description */
)
{
PmBoolean done; /* Terminator flag */
UByte2 state; /* Current state */
UByte1 action; /* Parser action */
UByte1 sep_act; /* Parser action separator test */
UByte2 arg; /* Parser prod/state */
UByte2 sep_arg; /* Parser prod/state separator test */
PmBoolean sepa_acc; /* Separator is accepted? */
ParseStack t_stk; /* Temporary parser stack */
short i; /* Copy loop index */
for (i = 0; i <= stack_p; i++) t_stk[i] = stack[i];
state = t_stk[stack_p];
done = PMFALSE;
while (!done) {
actTbl(state, sym, &action, &arg);
if (legalAct(t_stk, stack_p, sym)) {
/* Symbol is directly accepted */
done = PMTRUE;
*found = PMTRUE;
point->r_state = state;
} else {
/* Use the continuation grammar */
actTbl(state, act.recover.cont[state - StateMin].tsym, &action,
&arg);
actTbl(state, act.recover.cont[state - StateMin].ssym, &sep_act,
&sep_arg);
if ((action != sep_act) || (arg != sep_arg)) {
/* A separator is legal. Check if current symbol is accepted
* behind the separator
*/
ParseStack stk; /* Temporary stack */
short sp; /* Temporary stack pointer */
sp = stack_p;
for (i = 0; i <= stack_p; i++) stk[i] = t_stk[i];
sepa_acc = PMFALSE;
while (!sepa_acc) {
actTbl(stk[sp], act.recover.cont[state - StateMin].ssym,
&sep_act, &sep_arg);
switch (sep_act) {
case ERROR_ACT:
case ACCEPT_ACT:
sepa_acc = PMTRUE;
break;
case SHIFT_ACT:
sepa_acc = PMTRUE;
ePush(sep_arg, stk, &sp);
break;
case SHIFTRED_ACT:
ePush(1, stk, &sp);
sepa_acc = PMTRUE;
goto reduce;
case REDUCE_ACT:
reduce:
do {
sp -= gto.rhsz[sep_arg-ProdMin];
gtoTbl(stk[sp], gto.lhs[sep_arg-ProdMin], &sep_act,
&sep_arg);
ePush(1, stk, &sp);
} while (sep_act != SHIFT_ACT);
stk[sp] = sep_arg;
break;
}/*switch*/
}/*while*/
if ((sep_act == SHIFT_ACT) || (sep_act == SHIFTRED_ACT)) {
if (legalAct(stk, sp, sym)) {
/* Separator is to be inserted */
point->r_state = stk[sp];
point->r_sepa = PMTRUE;
point->r_sstat = state;
done = PMTRUE;
*found = PMTRUE;
}/*if*/
}/*if*/
}/*if*/
if (!*found) {
switch (action) {
case ERROR_ACT:
paAbort(token, TAB_ERR, SYS_SEV);
break;
case ACCEPT_ACT:
done = PMTRUE;
break;
case SHIFT_ACT:
state = arg;
ePush(state, t_stk, &stack_p);
break;
case SHIFTRED_ACT:
ePush(state, t_stk, &stack_p);
goto reduce2;
case REDUCE_ACT:
reduce2:
do {
stack_p -= gto.rhsz[arg-ProdMin];
gtoTbl(t_stk[stack_p], gto.lhs[arg-ProdMin], &action,
&arg);
ePush(state, t_stk, &stack_p);
} while (action != SHIFT_ACT);
state = arg;
t_stk[stack_p] = state;
break;
}/*switch*/
}/*if*/
}/*if*/
}/*while*/
}/*acceptbl()*/
/*----------------------------------------------------------------------------
* search - Search recovery point
*----------------------------------------------------------------------------
*/
static void search(
ParseStack stack, /* IN current stack */
short *stack_p, /* INOUT current stack pointer */
Token *token, /* INOUT current symbol */
REC_POI *point /* OUT descriptor of where to restart */
/* the parser */
)
{
UByte2 state; /* Current state */
PmBoolean rp_found; /* Recovery point found? */
short new_stkp; /* Temp stack pointer */
state = stack[*stack_p];
point->r_state = state;
point->r_sepa = PMFALSE;
point->r_sstat = 1;
rp_found = PMFALSE;
do {
if (!SetMem(act.recover.skip, token->code)) {
acceptbl(token->code, stack, *stack_p, token, &rp_found, point);
}/*if*/
if (!rp_found) {
new_stkp = 0;
if (SetMem(act.recover.fiduc, token->code)) {
new_stkp = backup(stack, *stack_p, token->code);
}/*if*/
if (new_stkp > 0) {
rp_found = PMTRUE;
*stack_p = new_stkp;
point->r_state = stack[*stack_p];
errdescr.method = BAK_REC;
} else
delSym(token);
}/*if*/
} while (!rp_found);
}/*search()*/
/*----------------------------------------------------------------------------
* reach - Use the continuation functions and insert symbols upto curr token.
*----------------------------------------------------------------------------
*/
static void reach(
ParseStack stack, /* INOUT current stack */
short *stack_p, /* INOUT current stack pointer */
Token *token, /* INOUT current symbol */
REC_POI *point /* IN recovery point descriptor */
)
{
UByte2 state; /* Current state */
UByte1 cont_sym; /* Continuation symbol */
Token gen_symb; /* Generated symbol */
UByte1 action; /* Current parser action */
UByte2 arg; /* Current prod/state */
PmBoolean sepaAccept; /* Separator accepted yet? */
PmBoolean useSepa; /* Use the separator now? */
state = stack[*stack_p];
gen_symb = *token;
useSepa = PMFALSE;
while (state != point->r_state) {
if (point->r_sepa)
if (state == point->r_sstat) {
/* Separator state reached, remember to use separator */
cont_sym = act.recover.cont[state-StateMin].ssym;
useSepa = PMTRUE;
} else cont_sym = act.recover.cont[state-StateMin].tsym;
else cont_sym = act.recover.cont[state-StateMin].tsym;
sepaAccept = PMFALSE;
do {
actTbl(state, cont_sym, &action, &arg);
switch (action) {
case ERROR_ACT:
paAbort(token, TAB_ERR, SYS_SEV);
break;
case ACCEPT_ACT:
break;
case SHIFT_ACT:
sepaAccept = PMTRUE;
state = arg;
inSym(cont_sym, &gen_symb);
ePush(state, stack, stack_p);
pmSySt[*stack_p] = gen_symb;
break;
case SHIFTRED_ACT:
sepaAccept = PMTRUE;
inSym(cont_sym, &gen_symb);
ePush(state, stack, stack_p);
pmSySt[*stack_p] = gen_symb;
goto reduce;
case REDUCE_ACT:
reduce:
do {
*stack_p = *stack_p - gto.rhsz[arg-ProdMin];
pmPaSema(arg);
gtoTbl(stack[*stack_p], gto.lhs[arg-ProdMin], &action, &arg);
ePush(state, stack, stack_p);
} while (action != SHIFT_ACT);
state = arg;
stack[*stack_p] = state;
}/*switch*/
} while (useSepa && !sepaAccept);
}/*while*/
}/*reach()*/
/*----------------------------------------------------------------------------
* global - Global error recovery
*----------------------------------------------------------------------------
*/
static void multiple(
ParseStack err_stk, /* INOUT current parse stack */
short *err_stkp, /* INOUT current stack pointer */
Token *err_tok, /* INOUT current token */
UByte2 *newstat /* OUT state after recovery */
)
{
REC_POI point; /* Recovery point descriptor */
search(err_stk, err_stkp, err_tok, &point);
reach(err_stk, err_stkp, err_tok, &point);
*newstat = err_stk[*err_stkp];
}/*multiple()*/
/*----------------------------------------------------------------------------
* S I N G L E R E C O V E R Y
* -----------------------------
*
* The single recovery technique tries to REPAIR the error by finding the
* least cost single symbol correction. One single symbol of:
* - insertion
* - deletion
* - replacement
* is concidered. The cost of the repair is the sum of the ADAPTION cost and
* the MODIFICATION cost. The adaption cost indicates how well a correction
* fits in the context. The modification cost is based on the
* insertion/deletion cost given in the input. A correction is applied if
* the cost is below a predefined threshold value.
*----------------------------------------------------------------------------
*/
#define ShiftCost (PmCost) /* The cost of shifting one symbol */
#define InfCost (ShiftCost * (PmLaMax)) /* Infinity */
#define Thresh (((PmLaMax) - 3) * ShiftCost) /* Acceptance cost */
/*----------------------------------------------------------------------------
* readLa - Read tokens to the look-ahead buffer
*----------------------------------------------------------------------------
*/
static void readLa(
Token *curtok /* IN current token */
)
{
int i;
Token tokbuf;
Token *token = &tokbuf;
la_buff[0] = *curtok;
*token = *curtok;
for (i = la_ptr + 1; i <= la_end; i++) {
/* Move old look_ahead to the beginning of the buffer */
la_buff[i - la_ptr] = la_buff[i];
}/*for*/
la_end = la_end - la_ptr;
la_ptr = -1;
while ((la_buff[la_end].code != ENDMARK) && (la_end < PmLaMax)) {
la_end++;
do {
smScan(lexContext, token);
if (token->code > SccMax || token->code < 0) {
token->code = ERR_SYM;
} else {
token->code = scIndex[token->code];
}/*if*/
if (token->code == ERR_SYM) {
pmMess(token, DEL_REC, LEX_ERR, FAT_SEV);
}/*if*/
} while (token->code == ERR_SYM);
la_buff[la_end] = *token;
}/*while*/
}/*readLa()*/
/*----------------------------------------------------------------------------
* rdLaSym - Fetches the i:th look-ahead symbol code from the look-ahead set
*----------------------------------------------------------------------------
*/
static UByte1 rdLaSym(
char index /* IN i:th look-ahead symbol */
) /* RET token code */
{
if (index > la_end) return(ENDMARK);
else return(la_buff[(int)index].code);
}/*rdLaSym()*/
/*----------------------------------------------------------------------------
* laParse - Continue the parsing process by reading tokens from the
* look-ahead set. The parse is terminated when:
* - out of read ahead
* - a new error is encountered
* Note! No semantic actions are carried out
*----------------------------------------------------------------------------
*/
static void laParse(
UByte1 sym, /* IN current terminal symbol */
char next_la, /* IN index to next look-ahead symbol */
ParseStack stack, /* IN parse stack */
short stack_p, /* IN current stack pointer */
short *cost /* OUT adaption cost */
)
{
PmBoolean done ; /* Terminator flag */
char sh_cnt; /* Number of shifted symbols */
UByte2 state; /* Current state number */
UByte1 action; /* Parser action */
UByte2 arg; /* Parser argument */
short i; /* Loop index */
ParseStack t_stk; /* Temporary stack */
/* Copy stack
*/
for (i = 0; i <= stack_p; i++) t_stk[i] = stack[i];
done = PMFALSE;
sh_cnt = 0;
state = t_stk[stack_p];
while (!done) {
actTbl(state, sym, &action, &arg);
switch (action) {
case ERROR_ACT:
done = PMTRUE;
break;
case SHIFT_ACT:
state = arg;
ePush(state, t_stk, &stack_p);
sh_cnt++;
if (sh_cnt == PmLaMax) done = PMTRUE;
else {
sym = rdLaSym(next_la);
next_la++;
}/*if*/
break;
case SHIFTRED_ACT:
ePush(state, t_stk, &stack_p);
sh_cnt++;
if (sh_cnt == PmLaMax) done = PMTRUE;
else {
sym = rdLaSym(next_la);
if (next_la < PmLaMax) next_la++;
}/*if*/
goto reduce;
case REDUCE_ACT:
reduce:
do {
stack_p -= gto.rhsz[arg-ProdMin];
gtoTbl(t_stk[stack_p], gto.lhs[arg-ProdMin], &action, &arg);
ePush(state, t_stk, &stack_p);
} while (action != SHIFT_ACT);
state = arg;
t_stk[stack_p] = state;
break;
case ACCEPT_ACT:
done = PMTRUE;
sh_cnt = PmLaMax;
break;
}/*switch*/
}/*while*/
*cost = InfCost - (sh_cnt*ShiftCost);
}/*laParse()*/
/*----------------------------------------------------------------------------
* tryIn - Tries to insert a symbol from the legal set in front of current
* token: x t y => x st y, where s becomes current symbol
*----------------------------------------------------------------------------
*/
static void tryIn(
TermSet legals, /* IN set of legal symbols */
ParseStack stack, /* IN current parser stack */
short stack_p, /* IN current stack pointer */
UByte1 *sym, /* OUT best insertion symbol */
short *cost, /* OUT best cost so far */
short *choice /* OUT best choice so far */
)
{
short i;
short mod_cost; /* Modification cost */
short ad_cost; /* Adaption cost */
short tot_cost; /* Total insertion cost */
for (i = 1; i <= Terms; i++) {
/* For all legal symbols
*/
if (SetMem(legals, i)) {
mod_cost = voc[i - TermMin].iCost;
if (mod_cost < *cost) {
laParse(i, 0, stack, stack_p, &ad_cost);
tot_cost = ad_cost + mod_cost;
if (tot_cost < *cost) {
*cost = tot_cost;
*choice = IN_REC;
*sym = (UByte1)i;
}/*if*/
}/*if*/
}/*if*/
}/*for*/
}/*tryIn()*/
/*----------------------------------------------------------------------------
* tryRep - Tries to replace currrent symbol with a new terminal:
* x t y => x s y, where s becomes current symbol
*----------------------------------------------------------------------------
*/
static void tryRep(
TermSet legals, /* IN set of legal symbols */
ParseStack stack, /* IN current parser stack */
short stack_p, /* IN current stack pointer */
UByte1 *sym, /* OUT best replacement symbol */
short *cost, /* OUT best cost so far */
short *choice /* OUT best choice so far */
)
{
short i;
short mod_cost; /* Modification cost */
short ad_cost; /* Adaption cost */
short tot_cost; /* Total replacment cost */
for (i = 1; i <= Terms; i++) {
/* For all legal symbols
*/
if (SetMem(legals, i)) {
mod_cost = (short) (voc[i-TermMin].iCost +
voc[rdLaSym(0)-TermMin].dCost) / 2 + 1;
if (mod_cost < *cost) {
laParse(i, 1, stack, stack_p, &ad_cost);
tot_cost = ad_cost + mod_cost;
if (tot_cost < *cost) {
*cost = tot_cost;
*choice = REP_REC;
*sym = (UByte1)i;
}/*if*/
}/*if*/
}/*if*/
}/*for*/
}/*tryRep()*/
/*----------------------------------------------------------------------------
* tryDel - Tries to delete current symbol: x t y => x y
*----------------------------------------------------------------------------
*/
static void tryDel(
ParseStack stack, /* IN current parser stack */
short stack_p, /* IN current stack pointer */
short *cost, /* INOUT best cost so far */
short *choice /* INOUT best choice so far */
)
{
short mod_cost; /* Modification cost */
short ad_cost; /* Adaption cost */
short tot_cost; /* Total deletion cost */
mod_cost = voc[rdLaSym(0) - TermMin].dCost;
if (mod_cost < *cost) {
laParse(rdLaSym(1), 2, stack, stack_p, &ad_cost);
tot_cost = ad_cost + mod_cost;
if (tot_cost < *cost) {
*cost = tot_cost;
*choice = DEL_REC;
}/*if*/
}/*if*/
}/*tryDel()*/
/*----------------------------------------------------------------------------
* _pmInsert
*----------------------------------------------------------------------------
*/
static void _pmInsert(
UByte1 sym, /* IN symbol code to insert */
Token *token /* OUT constructed token */
)
{
inSym(sym, token);
}/*_pmInsert()*/
/*----------------------------------------------------------------------------
* _pmReplace
*----------------------------------------------------------------------------
*/
static void _pmReplace(
UByte1 sym, /* IN replacement symbol code */
Token *token /* OUT constructed token */
)
{
delSym(token);
inSym(sym, token);
}/*_pmReplace()*/
/*----------------------------------------------------------------------------
* _pmDelete
*----------------------------------------------------------------------------
*/
static void _pmDelete(
Token *token /* OUT new token */
)
{
{
if (la_ptr < la_end) {
la_ptr++;
*token = la_buff[la_ptr];
} else {
do {
smScan(lexContext, token);
if (token->code > SccMax || token->code < 0) {
token->code = ERR_SYM;
} else token->code = scIndex[token->code];
if (token->code == ERR_SYM) {
pmMess(token, DEL_REC, LEX_ERR, FAT_SEV);
}
} while (token->code == ERR_SYM);
}
}
delSym(token);
}/*_pmDelete()*/
/*----------------------------------------------------------------------------
* single - Single error recovery
*----------------------------------------------------------------------------
*/
static void single(
TermSet leg_sys, /* IN legal symbols in current state */
ParseStack err_stk, /* INOUT current parser stack */
short *err_stkp, /* INOUT current stack pointer */
Token *token, /* INOUT current token */
UByte2 *newstat /* OUT recovery state */
)
{
short choice; /* Recovery action performed */
short cost; /* Best cost so far */
UByte1 sym; /* Insert symbol */
choice = NONE_REC;
cost = InfCost;
readLa(token);
tryIn(leg_sys, err_stk, *err_stkp, &sym, &cost, &choice);
tryRep(leg_sys, err_stk, *err_stkp, &sym, &cost, &choice);
tryDel(err_stk, *err_stkp, &cost, &choice);
if (cost > Thresh) choice = NONE_REC;
switch (choice) {
case IN_REC:
_pmInsert(sym, token);
break;
case DEL_REC:
_pmDelete(token);
break;
case REP_REC:
_pmReplace(sym, token);
break;
default:
{
if (la_ptr < la_end) {
la_ptr++;
*token = la_buff[la_ptr];
} else {
do {
smScan(lexContext, token);
if (token->code > SccMax || token->code < 0) {
token->code = ERR_SYM;
} else token->code = scIndex[token->code];
if (token->code == ERR_SYM) {
pmMess(token, DEL_REC, LEX_ERR, FAT_SEV);
}
} while (token->code == ERR_SYM);
}
}
}/*switch*/
*newstat = err_stk[*err_stkp];
}/*single()*/
/*----------------------------------------------------------------------------
* recover - From an error
*----------------------------------------------------------------------------
*/
static void recover(
ParseStack err_stk, /* INOUT updated parse stack */
short *err_stkp, /* INOUT updated stack pointer */
Token *err_symb, /* INOUT current token */
UByte2 *rec_stat /* OUT state after recovery */
)
{
TermSet legal_sy; /* Legal symbols */
errdescr.err_tok = *err_symb;
errdescr.err_tok.code = voc[errdescr.err_tok.code - TermMin].scc;
errdescr.method = NONE_REC;
errdescr.eClass = SYN_ERR;
errdescr.severity = ERR_SEV;
gLegSym(err_stk, *err_stkp, legal_sy);
single(legal_sy, err_stk, err_stkp, err_symb, rec_stat);
if (errdescr.method == NONE_REC) {
multiple(err_stk, err_stkp, err_symb, rec_stat);
pmMess(&errdescr.err_tok, errdescr.method, errdescr.eClass,
errdescr.severity);
} else {
pmMess(&errdescr.err_tok, errdescr.method, SYN_ERR, errdescr.severity);
}/*if*/
errdescr.res_tok = *err_symb;
errdescr.res_tok.code = voc[errdescr.res_tok.code - TermMin].scc;
pmRPoi(&errdescr.res_tok);
}/*recover()*/
/*----------------------------------------------------------------------------
* pmParse - Parser routine, entry point
*----------------------------------------------------------------------------
*/
void pmParse(void)
{
paInit();
{
if (la_ptr < la_end) {
la_ptr++;
*token = la_buff[la_ptr];
} else {
do {
smScan(lexContext, token);
if (token->code > SccMax || token->code < 0) {
token->code = ERR_SYM;
} else token->code = scIndex[token->code];
if (token->code == ERR_SYM) {
pmMess(token, DEL_REC, LEX_ERR, FAT_SEV);
}
} while (token->code == ERR_SYM);
}
}
pushStatTok()
if (setjmp(pmJmpB)) return;
while (!endparse) {
actTbl(currstat, token->code, &action, &arg);
switch (action) {
case ERROR_ACT:
recover(parsStk, &pmStkP, token, &currstat);
if (pmStkP == 0) endparse = PMTRUE;
break;
case SHIFT_ACT:
currstat = arg;
pushStatTok();
{
if (la_ptr < la_end) {
la_ptr++;
*token = la_buff[la_ptr];
} else {
do {
smScan(lexContext, token);
if (token->code > SccMax || token->code < 0) {
token->code = ERR_SYM;
} else token->code = scIndex[token->code];
if (token->code == ERR_SYM) {
pmMess(token, DEL_REC, LEX_ERR, FAT_SEV);
}
} while (token->code == ERR_SYM);
}
}
break;
case SHIFTRED_ACT:
pushStatTok();
{
if (la_ptr < la_end) {
la_ptr++;
*token = la_buff[la_ptr];
} else {
do {
smScan(lexContext, token);
if (token->code > SccMax || token->code < 0) {
token->code = ERR_SYM;
} else token->code = scIndex[token->code];
if (token->code == ERR_SYM) {
pmMess(token, DEL_REC, LEX_ERR, FAT_SEV);
}
} while (token->code == ERR_SYM);
}
}
goto reduce;
case REDUCE_ACT:
reduce:
do {
pmStkP -= gto.rhsz[arg - ProdMin];
pmPaSema(arg);
gtoTbl(parsStk[pmStkP], gto.lhs[arg - ProdMin], &action, &arg);
pushStat();
} while (action != SHIFT_ACT);
currstat = arg;
parsStk[pmStkP] = currstat;
break;
case ACCEPT_ACT:
endparse = PMTRUE;
break;
}/*switch*/
}/*while*/
}/*pmParse()*/
| 46.823684 | 81 | 0.652289 |
d5660715fd894d3e8aea994b92ec6726f157fbcd | 1,896 | h | C | MiComboAPCTool/MiCombo_APConnectFramework.framework/Versions/A/Headers/MHDevice.h | liduojun/MiComboAPCTool | 031e6ab3aa3617ef0e193859643b5afd1869ac58 | [
"MIT"
] | null | null | null | MiComboAPCTool/MiCombo_APConnectFramework.framework/Versions/A/Headers/MHDevice.h | liduojun/MiComboAPCTool | 031e6ab3aa3617ef0e193859643b5afd1869ac58 | [
"MIT"
] | null | null | null | MiComboAPCTool/MiCombo_APConnectFramework.framework/Versions/A/Headers/MHDevice.h | liduojun/MiComboAPCTool | 031e6ab3aa3617ef0e193859643b5afd1869ac58 | [
"MIT"
] | null | null | null | //
// MHDevice.h
// MSmartHomeFramework
//
// Created by zhangyinze on 16/8/17.
// Copyright © 2016年 zhangyinze. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MHDevice : NSObject
@property (nonatomic, copy) NSString* did; //设备的ID
@property (nonatomic, copy) NSString* token; //设备的Token,每次快连后,设备的token会发生变化
@property (nonatomic, assign) double longitude; //上次绑定时的经度
@property (nonatomic, assign) double latitude; //上次绑定时的纬度
@property (nonatomic, copy) NSString* name; //设备名称,用户可以修改
@property (nonatomic, copy) NSString* model; //设备类别标识,如插座、摄像头
@property (nonatomic, copy) NSString* parent_id; //父设备的ID
@property (nonatomic, copy) NSString* parent_model; //父设备的Model
@property (nonatomic, assign) NSInteger pid; //设备id
@property (nonatomic, assign) BOOL isOnline; //设备是否在线(是否通电)
@property (nonatomic, assign) BOOL adminFlag; //是否被绑定
@property (nonatomic, assign) BOOL shareFlag; //是否已分享
@property (nonatomic, assign) BOOL resetFlag; //本地设备才会返回该字段,为1时表示设备刚刚reset过
@property (nonatomic, retain) id prop; //可选字段,当该类型设备有默认属性时,这里为默认属性的值,否则无此字段;//并且,不同的设备类型,prop中包含的属性不同,prop实际是个dictionary
@property (nonatomic, copy) NSString* localip; //设备的Ip,局域网内的Ip
@property (nonatomic, strong) NSDictionary* extra;
@property (nonatomic, copy) NSString* mac; //设备的mac
@property (nonatomic, strong) NSDictionary* owner; //设备的拥有者
/*
@property (nonatomic, assign) NSInteger showMode; //仅对子设备有效,用来标明子设备是否显示在设备列表页,1:显示 0:不显示
@property (nonatomic, copy) NSString* desc; //设备在设备列表展示的副标题
@property (nonatomic, copy) NSString* ssid; //设备的ssid
@property (nonatomic, copy) NSString* bssid; //设备的bssid
@property (nonatomic, retain) NSArray* method;
@property (nonatomic, assign) NSInteger rssi; //信号强度
@property (nonatomic, assign) NSInteger permitLevel; //只读分享过来的设备 4:普通分享 36:只读分享
*/
@end
| 47.4 | 121 | 0.716245 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.