filename
stringlengths 3
9
| code
stringlengths 4
1.87M
|
---|---|
930937.c | /*
* Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include "bn_lcl.h"
#include "internal/nelem.h"
#ifndef OPENSSL_NO_SRP
#include <openssl/srp.h>
#include "internal/bn_srp.h"
# if (BN_BYTES == 8)
# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
# define bn_pack4(a1,a2,a3,a4) ((a1##UI64<<48)|(a2##UI64<<32)|(a3##UI64<<16)|a4##UI64)
# elif defined(__arch64__)
# define bn_pack4(a1,a2,a3,a4) ((a1##UL<<48)|(a2##UL<<32)|(a3##UL<<16)|a4##UL)
# else
# define bn_pack4(a1,a2,a3,a4) ((a1##ULL<<48)|(a2##ULL<<32)|(a3##ULL<<16)|a4##ULL)
# endif
# elif (BN_BYTES == 4)
# define bn_pack4(a1,a2,a3,a4) ((a3##UL<<16)|a4##UL), ((a1##UL<<16)|a2##UL)
# else
# error "unsupported BN_BYTES"
# endif
static const BN_ULONG bn_group_1024_value[] = {
bn_pack4(0x9FC6, 0x1D2F, 0xC0EB, 0x06E3),
bn_pack4(0xFD51, 0x38FE, 0x8376, 0x435B),
bn_pack4(0x2FD4, 0xCBF4, 0x976E, 0xAA9A),
bn_pack4(0x68ED, 0xBC3C, 0x0572, 0x6CC0),
bn_pack4(0xC529, 0xF566, 0x660E, 0x57EC),
bn_pack4(0x8255, 0x9B29, 0x7BCF, 0x1885),
bn_pack4(0xCE8E, 0xF4AD, 0x69B1, 0x5D49),
bn_pack4(0x5DC7, 0xD7B4, 0x6154, 0xD6B6),
bn_pack4(0x8E49, 0x5C1D, 0x6089, 0xDAD1),
bn_pack4(0xE0D5, 0xD8E2, 0x50B9, 0x8BE4),
bn_pack4(0x383B, 0x4813, 0xD692, 0xC6E0),
bn_pack4(0xD674, 0xDF74, 0x96EA, 0x81D3),
bn_pack4(0x9EA2, 0x314C, 0x9C25, 0x6576),
bn_pack4(0x6072, 0x6187, 0x75FF, 0x3C0B),
bn_pack4(0x9C33, 0xF80A, 0xFA8F, 0xC5E8),
bn_pack4(0xEEAF, 0x0AB9, 0xADB3, 0x8DD6)
};
const BIGNUM bn_group_1024 = {
(BN_ULONG *)bn_group_1024_value,
OSSL_NELEM(bn_group_1024_value),
OSSL_NELEM(bn_group_1024_value),
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_group_1536_value[] = {
bn_pack4(0xCF76, 0xE3FE, 0xD135, 0xF9BB),
bn_pack4(0x1518, 0x0F93, 0x499A, 0x234D),
bn_pack4(0x8CE7, 0xA28C, 0x2442, 0xC6F3),
bn_pack4(0x5A02, 0x1FFF, 0x5E91, 0x479E),
bn_pack4(0x7F8A, 0x2FE9, 0xB8B5, 0x292E),
bn_pack4(0x837C, 0x264A, 0xE3A9, 0xBEB8),
bn_pack4(0xE442, 0x734A, 0xF7CC, 0xB7AE),
bn_pack4(0x6577, 0x2E43, 0x7D6C, 0x7F8C),
bn_pack4(0xDB2F, 0xD53D, 0x24B7, 0xC486),
bn_pack4(0x6EDF, 0x0195, 0x3934, 0x9627),
bn_pack4(0x158B, 0xFD3E, 0x2B9C, 0x8CF5),
bn_pack4(0x764E, 0x3F4B, 0x53DD, 0x9DA1),
bn_pack4(0x4754, 0x8381, 0xDBC5, 0xB1FC),
bn_pack4(0x9B60, 0x9E0B, 0xE3BA, 0xB63D),
bn_pack4(0x8134, 0xB1C8, 0xB979, 0x8914),
bn_pack4(0xDF02, 0x8A7C, 0xEC67, 0xF0D0),
bn_pack4(0x80B6, 0x55BB, 0x9A22, 0xE8DC),
bn_pack4(0x1558, 0x903B, 0xA0D0, 0xF843),
bn_pack4(0x51C6, 0xA94B, 0xE460, 0x7A29),
bn_pack4(0x5F4F, 0x5F55, 0x6E27, 0xCBDE),
bn_pack4(0xBEEE, 0xA961, 0x4B19, 0xCC4D),
bn_pack4(0xDBA5, 0x1DF4, 0x99AC, 0x4C80),
bn_pack4(0xB1F1, 0x2A86, 0x17A4, 0x7BBB),
bn_pack4(0x9DEF, 0x3CAF, 0xB939, 0x277A)
};
const BIGNUM bn_group_1536 = {
(BN_ULONG *)bn_group_1536_value,
OSSL_NELEM(bn_group_1536_value),
OSSL_NELEM(bn_group_1536_value),
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_group_2048_value[] = {
bn_pack4(0x0FA7, 0x111F, 0x9E4A, 0xFF73),
bn_pack4(0x9B65, 0xE372, 0xFCD6, 0x8EF2),
bn_pack4(0x35DE, 0x236D, 0x525F, 0x5475),
bn_pack4(0x94B5, 0xC803, 0xD89F, 0x7AE4),
bn_pack4(0x71AE, 0x35F8, 0xE9DB, 0xFBB6),
bn_pack4(0x2A56, 0x98F3, 0xA8D0, 0xC382),
bn_pack4(0x9CCC, 0x041C, 0x7BC3, 0x08D8),
bn_pack4(0xAF87, 0x4E73, 0x03CE, 0x5329),
bn_pack4(0x6160, 0x2790, 0x04E5, 0x7AE6),
bn_pack4(0x032C, 0xFBDB, 0xF52F, 0xB378),
bn_pack4(0x5EA7, 0x7A27, 0x75D2, 0xECFA),
bn_pack4(0x5445, 0x23B5, 0x24B0, 0xD57D),
bn_pack4(0x5B9D, 0x32E6, 0x88F8, 0x7748),
bn_pack4(0xF1D2, 0xB907, 0x8717, 0x461A),
bn_pack4(0x76BD, 0x207A, 0x436C, 0x6481),
bn_pack4(0xCA97, 0xB43A, 0x23FB, 0x8016),
bn_pack4(0x1D28, 0x1E44, 0x6B14, 0x773B),
bn_pack4(0x7359, 0xD041, 0xD5C3, 0x3EA7),
bn_pack4(0xA80D, 0x740A, 0xDBF4, 0xFF74),
bn_pack4(0x55F9, 0x7993, 0xEC97, 0x5EEA),
bn_pack4(0x2918, 0xA996, 0x2F0B, 0x93B8),
bn_pack4(0x661A, 0x05FB, 0xD5FA, 0xAAE8),
bn_pack4(0xCF60, 0x9517, 0x9A16, 0x3AB3),
bn_pack4(0xE808, 0x3969, 0xEDB7, 0x67B0),
bn_pack4(0xCD7F, 0x48A9, 0xDA04, 0xFD50),
bn_pack4(0xD523, 0x12AB, 0x4B03, 0x310D),
bn_pack4(0x8193, 0xE075, 0x7767, 0xA13D),
bn_pack4(0xA373, 0x29CB, 0xB4A0, 0x99ED),
bn_pack4(0xFC31, 0x9294, 0x3DB5, 0x6050),
bn_pack4(0xAF72, 0xB665, 0x1987, 0xEE07),
bn_pack4(0xF166, 0xDE5E, 0x1389, 0x582F),
bn_pack4(0xAC6B, 0xDB41, 0x324A, 0x9A9B)
};
const BIGNUM bn_group_2048 = {
(BN_ULONG *)bn_group_2048_value,
OSSL_NELEM(bn_group_2048_value),
OSSL_NELEM(bn_group_2048_value),
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_group_3072_value[] = {
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF),
bn_pack4(0x4B82, 0xD120, 0xA93A, 0xD2CA),
bn_pack4(0x43DB, 0x5BFC, 0xE0FD, 0x108E),
bn_pack4(0x08E2, 0x4FA0, 0x74E5, 0xAB31),
bn_pack4(0x7709, 0x88C0, 0xBAD9, 0x46E2),
bn_pack4(0xBBE1, 0x1757, 0x7A61, 0x5D6C),
bn_pack4(0x521F, 0x2B18, 0x177B, 0x200C),
bn_pack4(0xD876, 0x0273, 0x3EC8, 0x6A64),
bn_pack4(0xF12F, 0xFA06, 0xD98A, 0x0864),
bn_pack4(0xCEE3, 0xD226, 0x1AD2, 0xEE6B),
bn_pack4(0x1E8C, 0x94E0, 0x4A25, 0x619D),
bn_pack4(0xABF5, 0xAE8C, 0xDB09, 0x33D7),
bn_pack4(0xB397, 0x0F85, 0xA6E1, 0xE4C7),
bn_pack4(0x8AEA, 0x7157, 0x5D06, 0x0C7D),
bn_pack4(0xECFB, 0x8504, 0x58DB, 0xEF0A),
bn_pack4(0xA855, 0x21AB, 0xDF1C, 0xBA64),
bn_pack4(0xAD33, 0x170D, 0x0450, 0x7A33),
bn_pack4(0x1572, 0x8E5A, 0x8AAA, 0xC42D),
bn_pack4(0x15D2, 0x2618, 0x98FA, 0x0510),
bn_pack4(0x3995, 0x497C, 0xEA95, 0x6AE5),
bn_pack4(0xDE2B, 0xCBF6, 0x9558, 0x1718),
bn_pack4(0xB5C5, 0x5DF0, 0x6F4C, 0x52C9),
bn_pack4(0x9B27, 0x83A2, 0xEC07, 0xA28F),
bn_pack4(0xE39E, 0x772C, 0x180E, 0x8603),
bn_pack4(0x3290, 0x5E46, 0x2E36, 0xCE3B),
bn_pack4(0xF174, 0x6C08, 0xCA18, 0x217C),
bn_pack4(0x670C, 0x354E, 0x4ABC, 0x9804),
bn_pack4(0x9ED5, 0x2907, 0x7096, 0x966D),
bn_pack4(0x1C62, 0xF356, 0x2085, 0x52BB),
bn_pack4(0x8365, 0x5D23, 0xDCA3, 0xAD96),
bn_pack4(0x6916, 0x3FA8, 0xFD24, 0xCF5F),
bn_pack4(0x98DA, 0x4836, 0x1C55, 0xD39A),
bn_pack4(0xC200, 0x7CB8, 0xA163, 0xBF05),
bn_pack4(0x4928, 0x6651, 0xECE4, 0x5B3D),
bn_pack4(0xAE9F, 0x2411, 0x7C4B, 0x1FE6),
bn_pack4(0xEE38, 0x6BFB, 0x5A89, 0x9FA5),
bn_pack4(0x0BFF, 0x5CB6, 0xF406, 0xB7ED),
bn_pack4(0xF44C, 0x42E9, 0xA637, 0xED6B),
bn_pack4(0xE485, 0xB576, 0x625E, 0x7EC6),
bn_pack4(0x4FE1, 0x356D, 0x6D51, 0xC245),
bn_pack4(0x302B, 0x0A6D, 0xF25F, 0x1437),
bn_pack4(0xEF95, 0x19B3, 0xCD3A, 0x431B),
bn_pack4(0x514A, 0x0879, 0x8E34, 0x04DD),
bn_pack4(0x020B, 0xBEA6, 0x3B13, 0x9B22),
bn_pack4(0x2902, 0x4E08, 0x8A67, 0xCC74),
bn_pack4(0xC4C6, 0x628B, 0x80DC, 0x1CD1),
bn_pack4(0xC90F, 0xDAA2, 0x2168, 0xC234),
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF)
};
const BIGNUM bn_group_3072 = {
(BN_ULONG *)bn_group_3072_value,
OSSL_NELEM(bn_group_3072_value),
OSSL_NELEM(bn_group_3072_value),
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_group_4096_value[] = {
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF),
bn_pack4(0x4DF4, 0x35C9, 0x3406, 0x3199),
bn_pack4(0x86FF, 0xB7DC, 0x90A6, 0xC08F),
bn_pack4(0x93B4, 0xEA98, 0x8D8F, 0xDDC1),
bn_pack4(0xD006, 0x9127, 0xD5B0, 0x5AA9),
bn_pack4(0xB81B, 0xDD76, 0x2170, 0x481C),
bn_pack4(0x1F61, 0x2970, 0xCEE2, 0xD7AF),
bn_pack4(0x233B, 0xA186, 0x515B, 0xE7ED),
bn_pack4(0x99B2, 0x964F, 0xA090, 0xC3A2),
bn_pack4(0x287C, 0x5947, 0x4E6B, 0xC05D),
bn_pack4(0x2E8E, 0xFC14, 0x1FBE, 0xCAA6),
bn_pack4(0xDBBB, 0xC2DB, 0x04DE, 0x8EF9),
bn_pack4(0x2583, 0xE9CA, 0x2AD4, 0x4CE8),
bn_pack4(0x1A94, 0x6834, 0xB615, 0x0BDA),
bn_pack4(0x99C3, 0x2718, 0x6AF4, 0xE23C),
bn_pack4(0x8871, 0x9A10, 0xBDBA, 0x5B26),
bn_pack4(0x1A72, 0x3C12, 0xA787, 0xE6D7),
bn_pack4(0x4B82, 0xD120, 0xA921, 0x0801),
bn_pack4(0x43DB, 0x5BFC, 0xE0FD, 0x108E),
bn_pack4(0x08E2, 0x4FA0, 0x74E5, 0xAB31),
bn_pack4(0x7709, 0x88C0, 0xBAD9, 0x46E2),
bn_pack4(0xBBE1, 0x1757, 0x7A61, 0x5D6C),
bn_pack4(0x521F, 0x2B18, 0x177B, 0x200C),
bn_pack4(0xD876, 0x0273, 0x3EC8, 0x6A64),
bn_pack4(0xF12F, 0xFA06, 0xD98A, 0x0864),
bn_pack4(0xCEE3, 0xD226, 0x1AD2, 0xEE6B),
bn_pack4(0x1E8C, 0x94E0, 0x4A25, 0x619D),
bn_pack4(0xABF5, 0xAE8C, 0xDB09, 0x33D7),
bn_pack4(0xB397, 0x0F85, 0xA6E1, 0xE4C7),
bn_pack4(0x8AEA, 0x7157, 0x5D06, 0x0C7D),
bn_pack4(0xECFB, 0x8504, 0x58DB, 0xEF0A),
bn_pack4(0xA855, 0x21AB, 0xDF1C, 0xBA64),
bn_pack4(0xAD33, 0x170D, 0x0450, 0x7A33),
bn_pack4(0x1572, 0x8E5A, 0x8AAA, 0xC42D),
bn_pack4(0x15D2, 0x2618, 0x98FA, 0x0510),
bn_pack4(0x3995, 0x497C, 0xEA95, 0x6AE5),
bn_pack4(0xDE2B, 0xCBF6, 0x9558, 0x1718),
bn_pack4(0xB5C5, 0x5DF0, 0x6F4C, 0x52C9),
bn_pack4(0x9B27, 0x83A2, 0xEC07, 0xA28F),
bn_pack4(0xE39E, 0x772C, 0x180E, 0x8603),
bn_pack4(0x3290, 0x5E46, 0x2E36, 0xCE3B),
bn_pack4(0xF174, 0x6C08, 0xCA18, 0x217C),
bn_pack4(0x670C, 0x354E, 0x4ABC, 0x9804),
bn_pack4(0x9ED5, 0x2907, 0x7096, 0x966D),
bn_pack4(0x1C62, 0xF356, 0x2085, 0x52BB),
bn_pack4(0x8365, 0x5D23, 0xDCA3, 0xAD96),
bn_pack4(0x6916, 0x3FA8, 0xFD24, 0xCF5F),
bn_pack4(0x98DA, 0x4836, 0x1C55, 0xD39A),
bn_pack4(0xC200, 0x7CB8, 0xA163, 0xBF05),
bn_pack4(0x4928, 0x6651, 0xECE4, 0x5B3D),
bn_pack4(0xAE9F, 0x2411, 0x7C4B, 0x1FE6),
bn_pack4(0xEE38, 0x6BFB, 0x5A89, 0x9FA5),
bn_pack4(0x0BFF, 0x5CB6, 0xF406, 0xB7ED),
bn_pack4(0xF44C, 0x42E9, 0xA637, 0xED6B),
bn_pack4(0xE485, 0xB576, 0x625E, 0x7EC6),
bn_pack4(0x4FE1, 0x356D, 0x6D51, 0xC245),
bn_pack4(0x302B, 0x0A6D, 0xF25F, 0x1437),
bn_pack4(0xEF95, 0x19B3, 0xCD3A, 0x431B),
bn_pack4(0x514A, 0x0879, 0x8E34, 0x04DD),
bn_pack4(0x020B, 0xBEA6, 0x3B13, 0x9B22),
bn_pack4(0x2902, 0x4E08, 0x8A67, 0xCC74),
bn_pack4(0xC4C6, 0x628B, 0x80DC, 0x1CD1),
bn_pack4(0xC90F, 0xDAA2, 0x2168, 0xC234),
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF)
};
const BIGNUM bn_group_4096 = {
(BN_ULONG *)bn_group_4096_value,
OSSL_NELEM(bn_group_4096_value),
OSSL_NELEM(bn_group_4096_value),
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_group_6144_value[] = {
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF),
bn_pack4(0xE694, 0xF91E, 0x6DCC, 0x4024),
bn_pack4(0x12BF, 0x2D5B, 0x0B74, 0x74D6),
bn_pack4(0x043E, 0x8F66, 0x3F48, 0x60EE),
bn_pack4(0x387F, 0xE8D7, 0x6E3C, 0x0468),
bn_pack4(0xDA56, 0xC9EC, 0x2EF2, 0x9632),
bn_pack4(0xEB19, 0xCCB1, 0xA313, 0xD55C),
bn_pack4(0xF550, 0xAA3D, 0x8A1F, 0xBFF0),
bn_pack4(0x06A1, 0xD58B, 0xB7C5, 0xDA76),
bn_pack4(0xA797, 0x15EE, 0xF29B, 0xE328),
bn_pack4(0x14CC, 0x5ED2, 0x0F80, 0x37E0),
bn_pack4(0xCC8F, 0x6D7E, 0xBF48, 0xE1D8),
bn_pack4(0x4BD4, 0x07B2, 0x2B41, 0x54AA),
bn_pack4(0x0F1D, 0x45B7, 0xFF58, 0x5AC5),
bn_pack4(0x23A9, 0x7A7E, 0x36CC, 0x88BE),
bn_pack4(0x59E7, 0xC97F, 0xBEC7, 0xE8F3),
bn_pack4(0xB5A8, 0x4031, 0x900B, 0x1C9E),
bn_pack4(0xD55E, 0x702F, 0x4698, 0x0C82),
bn_pack4(0xF482, 0xD7CE, 0x6E74, 0xFEF6),
bn_pack4(0xF032, 0xEA15, 0xD172, 0x1D03),
bn_pack4(0x5983, 0xCA01, 0xC64B, 0x92EC),
bn_pack4(0x6FB8, 0xF401, 0x378C, 0xD2BF),
bn_pack4(0x3320, 0x5151, 0x2BD7, 0xAF42),
bn_pack4(0xDB7F, 0x1447, 0xE6CC, 0x254B),
bn_pack4(0x44CE, 0x6CBA, 0xCED4, 0xBB1B),
bn_pack4(0xDA3E, 0xDBEB, 0xCF9B, 0x14ED),
bn_pack4(0x1797, 0x27B0, 0x865A, 0x8918),
bn_pack4(0xB06A, 0x53ED, 0x9027, 0xD831),
bn_pack4(0xE5DB, 0x382F, 0x4130, 0x01AE),
bn_pack4(0xF8FF, 0x9406, 0xAD9E, 0x530E),
bn_pack4(0xC975, 0x1E76, 0x3DBA, 0x37BD),
bn_pack4(0xC1D4, 0xDCB2, 0x6026, 0x46DE),
bn_pack4(0x36C3, 0xFAB4, 0xD27C, 0x7026),
bn_pack4(0x4DF4, 0x35C9, 0x3402, 0x8492),
bn_pack4(0x86FF, 0xB7DC, 0x90A6, 0xC08F),
bn_pack4(0x93B4, 0xEA98, 0x8D8F, 0xDDC1),
bn_pack4(0xD006, 0x9127, 0xD5B0, 0x5AA9),
bn_pack4(0xB81B, 0xDD76, 0x2170, 0x481C),
bn_pack4(0x1F61, 0x2970, 0xCEE2, 0xD7AF),
bn_pack4(0x233B, 0xA186, 0x515B, 0xE7ED),
bn_pack4(0x99B2, 0x964F, 0xA090, 0xC3A2),
bn_pack4(0x287C, 0x5947, 0x4E6B, 0xC05D),
bn_pack4(0x2E8E, 0xFC14, 0x1FBE, 0xCAA6),
bn_pack4(0xDBBB, 0xC2DB, 0x04DE, 0x8EF9),
bn_pack4(0x2583, 0xE9CA, 0x2AD4, 0x4CE8),
bn_pack4(0x1A94, 0x6834, 0xB615, 0x0BDA),
bn_pack4(0x99C3, 0x2718, 0x6AF4, 0xE23C),
bn_pack4(0x8871, 0x9A10, 0xBDBA, 0x5B26),
bn_pack4(0x1A72, 0x3C12, 0xA787, 0xE6D7),
bn_pack4(0x4B82, 0xD120, 0xA921, 0x0801),
bn_pack4(0x43DB, 0x5BFC, 0xE0FD, 0x108E),
bn_pack4(0x08E2, 0x4FA0, 0x74E5, 0xAB31),
bn_pack4(0x7709, 0x88C0, 0xBAD9, 0x46E2),
bn_pack4(0xBBE1, 0x1757, 0x7A61, 0x5D6C),
bn_pack4(0x521F, 0x2B18, 0x177B, 0x200C),
bn_pack4(0xD876, 0x0273, 0x3EC8, 0x6A64),
bn_pack4(0xF12F, 0xFA06, 0xD98A, 0x0864),
bn_pack4(0xCEE3, 0xD226, 0x1AD2, 0xEE6B),
bn_pack4(0x1E8C, 0x94E0, 0x4A25, 0x619D),
bn_pack4(0xABF5, 0xAE8C, 0xDB09, 0x33D7),
bn_pack4(0xB397, 0x0F85, 0xA6E1, 0xE4C7),
bn_pack4(0x8AEA, 0x7157, 0x5D06, 0x0C7D),
bn_pack4(0xECFB, 0x8504, 0x58DB, 0xEF0A),
bn_pack4(0xA855, 0x21AB, 0xDF1C, 0xBA64),
bn_pack4(0xAD33, 0x170D, 0x0450, 0x7A33),
bn_pack4(0x1572, 0x8E5A, 0x8AAA, 0xC42D),
bn_pack4(0x15D2, 0x2618, 0x98FA, 0x0510),
bn_pack4(0x3995, 0x497C, 0xEA95, 0x6AE5),
bn_pack4(0xDE2B, 0xCBF6, 0x9558, 0x1718),
bn_pack4(0xB5C5, 0x5DF0, 0x6F4C, 0x52C9),
bn_pack4(0x9B27, 0x83A2, 0xEC07, 0xA28F),
bn_pack4(0xE39E, 0x772C, 0x180E, 0x8603),
bn_pack4(0x3290, 0x5E46, 0x2E36, 0xCE3B),
bn_pack4(0xF174, 0x6C08, 0xCA18, 0x217C),
bn_pack4(0x670C, 0x354E, 0x4ABC, 0x9804),
bn_pack4(0x9ED5, 0x2907, 0x7096, 0x966D),
bn_pack4(0x1C62, 0xF356, 0x2085, 0x52BB),
bn_pack4(0x8365, 0x5D23, 0xDCA3, 0xAD96),
bn_pack4(0x6916, 0x3FA8, 0xFD24, 0xCF5F),
bn_pack4(0x98DA, 0x4836, 0x1C55, 0xD39A),
bn_pack4(0xC200, 0x7CB8, 0xA163, 0xBF05),
bn_pack4(0x4928, 0x6651, 0xECE4, 0x5B3D),
bn_pack4(0xAE9F, 0x2411, 0x7C4B, 0x1FE6),
bn_pack4(0xEE38, 0x6BFB, 0x5A89, 0x9FA5),
bn_pack4(0x0BFF, 0x5CB6, 0xF406, 0xB7ED),
bn_pack4(0xF44C, 0x42E9, 0xA637, 0xED6B),
bn_pack4(0xE485, 0xB576, 0x625E, 0x7EC6),
bn_pack4(0x4FE1, 0x356D, 0x6D51, 0xC245),
bn_pack4(0x302B, 0x0A6D, 0xF25F, 0x1437),
bn_pack4(0xEF95, 0x19B3, 0xCD3A, 0x431B),
bn_pack4(0x514A, 0x0879, 0x8E34, 0x04DD),
bn_pack4(0x020B, 0xBEA6, 0x3B13, 0x9B22),
bn_pack4(0x2902, 0x4E08, 0x8A67, 0xCC74),
bn_pack4(0xC4C6, 0x628B, 0x80DC, 0x1CD1),
bn_pack4(0xC90F, 0xDAA2, 0x2168, 0xC234),
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF)
};
const BIGNUM bn_group_6144 = {
(BN_ULONG *)bn_group_6144_value,
OSSL_NELEM(bn_group_6144_value),
OSSL_NELEM(bn_group_6144_value),
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_group_8192_value[] = {
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF),
bn_pack4(0x60C9, 0x80DD, 0x98ED, 0xD3DF),
bn_pack4(0xC81F, 0x56E8, 0x80B9, 0x6E71),
bn_pack4(0x9E30, 0x50E2, 0x7656, 0x94DF),
bn_pack4(0x9558, 0xE447, 0x5677, 0xE9AA),
bn_pack4(0xC919, 0x0DA6, 0xFC02, 0x6E47),
bn_pack4(0x889A, 0x002E, 0xD5EE, 0x382B),
bn_pack4(0x4009, 0x438B, 0x481C, 0x6CD7),
bn_pack4(0x3590, 0x46F4, 0xEB87, 0x9F92),
bn_pack4(0xFAF3, 0x6BC3, 0x1ECF, 0xA268),
bn_pack4(0xB1D5, 0x10BD, 0x7EE7, 0x4D73),
bn_pack4(0xF9AB, 0x4819, 0x5DED, 0x7EA1),
bn_pack4(0x64F3, 0x1CC5, 0x0846, 0x851D),
bn_pack4(0x4597, 0xE899, 0xA025, 0x5DC1),
bn_pack4(0xDF31, 0x0EE0, 0x74AB, 0x6A36),
bn_pack4(0x6D2A, 0x13F8, 0x3F44, 0xF82D),
bn_pack4(0x062B, 0x3CF5, 0xB3A2, 0x78A6),
bn_pack4(0x7968, 0x3303, 0xED5B, 0xDD3A),
bn_pack4(0xFA9D, 0x4B7F, 0xA2C0, 0x87E8),
bn_pack4(0x4BCB, 0xC886, 0x2F83, 0x85DD),
bn_pack4(0x3473, 0xFC64, 0x6CEA, 0x306B),
bn_pack4(0x13EB, 0x57A8, 0x1A23, 0xF0C7),
bn_pack4(0x2222, 0x2E04, 0xA403, 0x7C07),
bn_pack4(0xE3FD, 0xB8BE, 0xFC84, 0x8AD9),
bn_pack4(0x238F, 0x16CB, 0xE39D, 0x652D),
bn_pack4(0x3423, 0xB474, 0x2BF1, 0xC978),
bn_pack4(0x3AAB, 0x639C, 0x5AE4, 0xF568),
bn_pack4(0x2576, 0xF693, 0x6BA4, 0x2466),
bn_pack4(0x741F, 0xA7BF, 0x8AFC, 0x47ED),
bn_pack4(0x3BC8, 0x32B6, 0x8D9D, 0xD300),
bn_pack4(0xD8BE, 0xC4D0, 0x73B9, 0x31BA),
bn_pack4(0x3877, 0x7CB6, 0xA932, 0xDF8C),
bn_pack4(0x74A3, 0x926F, 0x12FE, 0xE5E4),
bn_pack4(0xE694, 0xF91E, 0x6DBE, 0x1159),
bn_pack4(0x12BF, 0x2D5B, 0x0B74, 0x74D6),
bn_pack4(0x043E, 0x8F66, 0x3F48, 0x60EE),
bn_pack4(0x387F, 0xE8D7, 0x6E3C, 0x0468),
bn_pack4(0xDA56, 0xC9EC, 0x2EF2, 0x9632),
bn_pack4(0xEB19, 0xCCB1, 0xA313, 0xD55C),
bn_pack4(0xF550, 0xAA3D, 0x8A1F, 0xBFF0),
bn_pack4(0x06A1, 0xD58B, 0xB7C5, 0xDA76),
bn_pack4(0xA797, 0x15EE, 0xF29B, 0xE328),
bn_pack4(0x14CC, 0x5ED2, 0x0F80, 0x37E0),
bn_pack4(0xCC8F, 0x6D7E, 0xBF48, 0xE1D8),
bn_pack4(0x4BD4, 0x07B2, 0x2B41, 0x54AA),
bn_pack4(0x0F1D, 0x45B7, 0xFF58, 0x5AC5),
bn_pack4(0x23A9, 0x7A7E, 0x36CC, 0x88BE),
bn_pack4(0x59E7, 0xC97F, 0xBEC7, 0xE8F3),
bn_pack4(0xB5A8, 0x4031, 0x900B, 0x1C9E),
bn_pack4(0xD55E, 0x702F, 0x4698, 0x0C82),
bn_pack4(0xF482, 0xD7CE, 0x6E74, 0xFEF6),
bn_pack4(0xF032, 0xEA15, 0xD172, 0x1D03),
bn_pack4(0x5983, 0xCA01, 0xC64B, 0x92EC),
bn_pack4(0x6FB8, 0xF401, 0x378C, 0xD2BF),
bn_pack4(0x3320, 0x5151, 0x2BD7, 0xAF42),
bn_pack4(0xDB7F, 0x1447, 0xE6CC, 0x254B),
bn_pack4(0x44CE, 0x6CBA, 0xCED4, 0xBB1B),
bn_pack4(0xDA3E, 0xDBEB, 0xCF9B, 0x14ED),
bn_pack4(0x1797, 0x27B0, 0x865A, 0x8918),
bn_pack4(0xB06A, 0x53ED, 0x9027, 0xD831),
bn_pack4(0xE5DB, 0x382F, 0x4130, 0x01AE),
bn_pack4(0xF8FF, 0x9406, 0xAD9E, 0x530E),
bn_pack4(0xC975, 0x1E76, 0x3DBA, 0x37BD),
bn_pack4(0xC1D4, 0xDCB2, 0x6026, 0x46DE),
bn_pack4(0x36C3, 0xFAB4, 0xD27C, 0x7026),
bn_pack4(0x4DF4, 0x35C9, 0x3402, 0x8492),
bn_pack4(0x86FF, 0xB7DC, 0x90A6, 0xC08F),
bn_pack4(0x93B4, 0xEA98, 0x8D8F, 0xDDC1),
bn_pack4(0xD006, 0x9127, 0xD5B0, 0x5AA9),
bn_pack4(0xB81B, 0xDD76, 0x2170, 0x481C),
bn_pack4(0x1F61, 0x2970, 0xCEE2, 0xD7AF),
bn_pack4(0x233B, 0xA186, 0x515B, 0xE7ED),
bn_pack4(0x99B2, 0x964F, 0xA090, 0xC3A2),
bn_pack4(0x287C, 0x5947, 0x4E6B, 0xC05D),
bn_pack4(0x2E8E, 0xFC14, 0x1FBE, 0xCAA6),
bn_pack4(0xDBBB, 0xC2DB, 0x04DE, 0x8EF9),
bn_pack4(0x2583, 0xE9CA, 0x2AD4, 0x4CE8),
bn_pack4(0x1A94, 0x6834, 0xB615, 0x0BDA),
bn_pack4(0x99C3, 0x2718, 0x6AF4, 0xE23C),
bn_pack4(0x8871, 0x9A10, 0xBDBA, 0x5B26),
bn_pack4(0x1A72, 0x3C12, 0xA787, 0xE6D7),
bn_pack4(0x4B82, 0xD120, 0xA921, 0x0801),
bn_pack4(0x43DB, 0x5BFC, 0xE0FD, 0x108E),
bn_pack4(0x08E2, 0x4FA0, 0x74E5, 0xAB31),
bn_pack4(0x7709, 0x88C0, 0xBAD9, 0x46E2),
bn_pack4(0xBBE1, 0x1757, 0x7A61, 0x5D6C),
bn_pack4(0x521F, 0x2B18, 0x177B, 0x200C),
bn_pack4(0xD876, 0x0273, 0x3EC8, 0x6A64),
bn_pack4(0xF12F, 0xFA06, 0xD98A, 0x0864),
bn_pack4(0xCEE3, 0xD226, 0x1AD2, 0xEE6B),
bn_pack4(0x1E8C, 0x94E0, 0x4A25, 0x619D),
bn_pack4(0xABF5, 0xAE8C, 0xDB09, 0x33D7),
bn_pack4(0xB397, 0x0F85, 0xA6E1, 0xE4C7),
bn_pack4(0x8AEA, 0x7157, 0x5D06, 0x0C7D),
bn_pack4(0xECFB, 0x8504, 0x58DB, 0xEF0A),
bn_pack4(0xA855, 0x21AB, 0xDF1C, 0xBA64),
bn_pack4(0xAD33, 0x170D, 0x0450, 0x7A33),
bn_pack4(0x1572, 0x8E5A, 0x8AAA, 0xC42D),
bn_pack4(0x15D2, 0x2618, 0x98FA, 0x0510),
bn_pack4(0x3995, 0x497C, 0xEA95, 0x6AE5),
bn_pack4(0xDE2B, 0xCBF6, 0x9558, 0x1718),
bn_pack4(0xB5C5, 0x5DF0, 0x6F4C, 0x52C9),
bn_pack4(0x9B27, 0x83A2, 0xEC07, 0xA28F),
bn_pack4(0xE39E, 0x772C, 0x180E, 0x8603),
bn_pack4(0x3290, 0x5E46, 0x2E36, 0xCE3B),
bn_pack4(0xF174, 0x6C08, 0xCA18, 0x217C),
bn_pack4(0x670C, 0x354E, 0x4ABC, 0x9804),
bn_pack4(0x9ED5, 0x2907, 0x7096, 0x966D),
bn_pack4(0x1C62, 0xF356, 0x2085, 0x52BB),
bn_pack4(0x8365, 0x5D23, 0xDCA3, 0xAD96),
bn_pack4(0x6916, 0x3FA8, 0xFD24, 0xCF5F),
bn_pack4(0x98DA, 0x4836, 0x1C55, 0xD39A),
bn_pack4(0xC200, 0x7CB8, 0xA163, 0xBF05),
bn_pack4(0x4928, 0x6651, 0xECE4, 0x5B3D),
bn_pack4(0xAE9F, 0x2411, 0x7C4B, 0x1FE6),
bn_pack4(0xEE38, 0x6BFB, 0x5A89, 0x9FA5),
bn_pack4(0x0BFF, 0x5CB6, 0xF406, 0xB7ED),
bn_pack4(0xF44C, 0x42E9, 0xA637, 0xED6B),
bn_pack4(0xE485, 0xB576, 0x625E, 0x7EC6),
bn_pack4(0x4FE1, 0x356D, 0x6D51, 0xC245),
bn_pack4(0x302B, 0x0A6D, 0xF25F, 0x1437),
bn_pack4(0xEF95, 0x19B3, 0xCD3A, 0x431B),
bn_pack4(0x514A, 0x0879, 0x8E34, 0x04DD),
bn_pack4(0x020B, 0xBEA6, 0x3B13, 0x9B22),
bn_pack4(0x2902, 0x4E08, 0x8A67, 0xCC74),
bn_pack4(0xC4C6, 0x628B, 0x80DC, 0x1CD1),
bn_pack4(0xC90F, 0xDAA2, 0x2168, 0xC234),
bn_pack4(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF)
};
const BIGNUM bn_group_8192 = {
(BN_ULONG *)bn_group_8192_value,
OSSL_NELEM(bn_group_8192_value),
OSSL_NELEM(bn_group_8192_value),
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_generator_19_value[] = { 19 };
const BIGNUM bn_generator_19 = {
(BN_ULONG *)bn_generator_19_value,
1,
1,
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_generator_5_value[] = { 5 };
const BIGNUM bn_generator_5 = {
(BN_ULONG *)bn_generator_5_value,
1,
1,
0,
BN_FLG_STATIC_DATA
};
static const BN_ULONG bn_generator_2_value[] = { 2 };
const BIGNUM bn_generator_2 = {
(BN_ULONG *)bn_generator_2_value,
1,
1,
0,
BN_FLG_STATIC_DATA
};
#endif
|
145054.c | #include <stdio.h>
#include <stdlib.h>
typedef struct {
unsigned long *icod,*ncod,*left,*right,nch,nodemax;
} huffcode;
void hufenc(unsigned long ich, unsigned char **codep, unsigned long *lcode,
unsigned long *nb, huffcode *hcode)
{
void nrerror(char error_text[]);
int l,n;
unsigned long k,nc;
static unsigned long setbit[32]={0x1L,0x2L,0x4L,0x8L,0x10L,0x20L,
0x40L,0x80L,0x100L,0x200L,0x400L,0x800L,0x1000L,0x2000L,
0x4000L,0x8000L,0x10000L,0x20000L,0x40000L,0x80000L,0x100000L,
0x200000L,0x400000L,0x800000L,0x1000000L,0x2000000L,0x4000000L,
0x8000000L,0x10000000L,0x20000000L,0x40000000L,0x80000000L};
k=ich+1;
if (k > hcode->nch || k < 1) nrerror("ich out of range in hufenc.");
for (n=hcode->ncod[k]-1;n>=0;n--,++(*nb)) {
nc=(*nb >> 3);
if (++nc >= *lcode) {
fprintf(stderr,"Reached the end of the 'code' array.\n");
fprintf(stderr,"Attempting to expand its size.\n");
*lcode *= 1.5;
if ((*codep=(unsigned char *)realloc(*codep,
(unsigned)(*lcode*sizeof(unsigned char)))) == NULL) {
nrerror("Size expansion failed.");
}
}
l=(*nb) & 7;
if (!l) (*codep)[nc]=0;
if (hcode->icod[k] & setbit[n]) (*codep)[nc] |= setbit[l];
}
}
/* (C) Copr. 1986-92 Numerical Recipes Software 9.1-5i. */
|
162712.c | /* ----------------------------------------------------------------------
* $Date: 5. February 2013
* $Revision: V1.02
*
* Project: CMSIS-RTOS API
* Title: cmsis_os.c
*
* Version 0.02
* Initial Proposal Phase
* Version 0.03
* osKernelStart added, optional feature: main started as thread
* osSemaphores have standard behavior
* osTimerCreate does not start the timer, added osTimerStart
* osThreadPass is renamed to osThreadYield
* Version 1.01
* Support for C++ interface
* - const attribute removed from the osXxxxDef_t typedef's
* - const attribute added to the osXxxxDef macros
* Added: osTimerDelete, osMutexDelete, osSemaphoreDelete
* Added: osKernelInitialize
* Version 1.02
* Control functions for short timeouts in microsecond resolution:
* Added: osKernelSysTick, osKernelSysTickFrequency, osKernelSysTickMicroSec
* Removed: osSignalGet
*
*
*----------------------------------------------------------------------------
*
* Portions Copyright � 2016 STMicroelectronics International N.V. All rights reserved.
* Portions Copyright (c) 2013 ARM LIMITED
* 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 ARM 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 COPYRIGHT HOLDERS AND 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.
*---------------------------------------------------------------------------*/
#include <string.h>
#include "cmsis_os.h"
/*
* ARM Compiler 4/5
*/
#if defined ( __CC_ARM )
#define __ASM __asm
#define __INLINE __inline
#define __STATIC_INLINE static __inline
#include "cmsis_armcc.h"
/*
* GNU Compiler
*/
#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline
#include "cmsis_gcc.h"
/*
* IAR Compiler
*/
#elif defined ( __ICCARM__ )
#ifndef __ASM
#define __ASM __asm
#endif
#ifndef __INLINE
#define __INLINE inline
#endif
#ifndef __STATIC_INLINE
#define __STATIC_INLINE static inline
#endif
#include <cmsis_iar.h>
#endif
extern void xPortSysTickHandler(void);
/* Convert from CMSIS type osPriority to FreeRTOS priority number */
static unsigned portBASE_TYPE makeFreeRtosPriority (osPriority priority)
{
unsigned portBASE_TYPE fpriority = tskIDLE_PRIORITY;
if (priority != osPriorityError) {
fpriority += (priority - osPriorityIdle);
}
return fpriority;
}
#if (INCLUDE_uxTaskPriorityGet == 1)
/* Convert from FreeRTOS priority number to CMSIS type osPriority */
static osPriority makeCmsisPriority (unsigned portBASE_TYPE fpriority)
{
osPriority priority = osPriorityError;
if ((fpriority - tskIDLE_PRIORITY) <= (osPriorityRealtime - osPriorityIdle)) {
priority = (osPriority)((int)osPriorityIdle + (int)(fpriority - tskIDLE_PRIORITY));
}
return priority;
}
#endif
/* Determine whether we are in thread mode or handler mode. */
static int inHandlerMode (void)
{
return __get_IPSR() != 0;
}
/*********************** Kernel Control Functions *****************************/
/**
* @brief Initialize the RTOS Kernel for creating objects.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osKernelInitialize shall be consistent in every CMSIS-RTOS.
*/
osStatus osKernelInitialize (void);
/**
* @brief Start the RTOS Kernel with executing the specified thread.
* @param thread_def thread definition referenced with \ref osThread.
* @param argument pointer that is passed to the thread function as start argument.
* @retval status code that indicates the execution status of the function
* @note MUST REMAIN UNCHANGED: \b osKernelStart shall be consistent in every CMSIS-RTOS.
*/
osStatus osKernelStart (void)
{
vTaskStartScheduler();
return osOK;
}
/**
* @brief Check if the RTOS kernel is already started
* @param None
* @retval (0) RTOS is not started
* (1) RTOS is started
* (-1) if this feature is disabled in FreeRTOSConfig.h
* @note MUST REMAIN UNCHANGED: \b osKernelRunning shall be consistent in every CMSIS-RTOS.
*/
int32_t osKernelRunning(void)
{
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
if (xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED)
return 0;
else
return 1;
#else
return (-1);
#endif
}
#if (defined (osFeature_SysTick) && (osFeature_SysTick != 0)) // System Timer available
/**
* @brief Get the value of the Kernel SysTick timer
* @param None
* @retval None
* @note MUST REMAIN UNCHANGED: \b osKernelSysTick shall be consistent in every CMSIS-RTOS.
*/
uint32_t osKernelSysTick(void)
{
if (inHandlerMode()) {
return xTaskGetTickCountFromISR();
}
else {
return xTaskGetTickCount();
}
}
#endif // System Timer available
/*********************** Thread Management *****************************/
/**
* @brief Create a thread and add it to Active Threads and set it to state READY.
* @param thread_def thread definition referenced with \ref osThread.
* @param argument pointer that is passed to the thread function as start argument.
* @retval thread ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osThreadCreate shall be consistent in every CMSIS-RTOS.
*/
osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument)
{
TaskHandle_t handle;
#if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
if((thread_def->buffer != NULL) && (thread_def->controlblock != NULL)) {
handle = xTaskCreateStatic((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
thread_def->buffer, thread_def->controlblock);
}
else {
if (xTaskCreate((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
&handle) != pdPASS) {
return NULL;
}
}
#elif( configSUPPORT_STATIC_ALLOCATION == 1 )
handle = xTaskCreateStatic((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
thread_def->buffer, thread_def->controlblock);
#else
if (xTaskCreate((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
&handle) != pdPASS) {
return NULL;
}
#endif
return handle;
}
/**
* @brief Return the thread ID of the current running thread.
* @retval thread ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osThreadGetId shall be consistent in every CMSIS-RTOS.
*/
osThreadId osThreadGetId (void)
{
#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
return xTaskGetCurrentTaskHandle();
#else
return NULL;
#endif
}
/**
* @brief Terminate execution of a thread and remove it from Active Threads.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osThreadTerminate shall be consistent in every CMSIS-RTOS.
*/
osStatus osThreadTerminate (osThreadId thread_id)
{
#if (INCLUDE_vTaskDelete == 1)
vTaskDelete(thread_id);
return osOK;
#else
return osErrorOS;
#endif
}
/**
* @brief Pass control to next thread that is in state \b READY.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osThreadYield shall be consistent in every CMSIS-RTOS.
*/
osStatus osThreadYield (void)
{
taskYIELD();
return osOK;
}
/**
* @brief Change priority of an active thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @param priority new priority value for the thread function.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osThreadSetPriority shall be consistent in every CMSIS-RTOS.
*/
osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority)
{
#if (INCLUDE_vTaskPrioritySet == 1)
vTaskPrioritySet(thread_id, makeFreeRtosPriority(priority));
return osOK;
#else
return osErrorOS;
#endif
}
/**
* @brief Get current priority of an active thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @retval current priority value of the thread function.
* @note MUST REMAIN UNCHANGED: \b osThreadGetPriority shall be consistent in every CMSIS-RTOS.
*/
osPriority osThreadGetPriority (osThreadId thread_id)
{
#if (INCLUDE_uxTaskPriorityGet == 1)
if (inHandlerMode())
{
return makeCmsisPriority(uxTaskPriorityGetFromISR(thread_id));
}
else
{
return makeCmsisPriority(uxTaskPriorityGet(thread_id));
}
#else
return osPriorityError;
#endif
}
/*********************** Generic Wait Functions *******************************/
/**
* @brief Wait for Timeout (Time Delay)
* @param millisec time delay value
* @retval status code that indicates the execution status of the function.
*/
osStatus osDelay (uint32_t millisec)
{
#if INCLUDE_vTaskDelay
TickType_t ticks = millisec / portTICK_PERIOD_MS;
vTaskDelay(ticks ? ticks : 1); /* Minimum delay = 1 tick */
return osOK;
#else
(void) millisec;
return osErrorResource;
#endif
}
#if (defined (osFeature_Wait) && (osFeature_Wait != 0)) /* Generic Wait available */
/**
* @brief Wait for Signal, Message, Mail, or Timeout
* @param millisec timeout value or 0 in case of no time-out
* @retval event that contains signal, message, or mail information or error code.
* @note MUST REMAIN UNCHANGED: \b osWait shall be consistent in every CMSIS-RTOS.
*/
osEvent osWait (uint32_t millisec);
#endif /* Generic Wait available */
/*********************** Timer Management Functions ***************************/
/**
* @brief Create a timer.
* @param timer_def timer object referenced with \ref osTimer.
* @param type osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
* @param argument argument to the timer call back function.
* @retval timer ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osTimerCreate shall be consistent in every CMSIS-RTOS.
*/
osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument)
{
#if (configUSE_TIMERS == 1)
#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
if(timer_def->controlblock != NULL) {
return xTimerCreateStatic((const char *)"",
1, // period should be filled when starting the Timer using osTimerStart
(type == osTimerPeriodic) ? pdTRUE : pdFALSE,
(void *) argument,
(TimerCallbackFunction_t)timer_def->ptimer,
(StaticTimer_t *)timer_def->controlblock);
}
else {
return xTimerCreate((const char *)"",
1, // period should be filled when starting the Timer using osTimerStart
(type == osTimerPeriodic) ? pdTRUE : pdFALSE,
(void *) argument,
(TimerCallbackFunction_t)timer_def->ptimer);
}
#elif( configSUPPORT_STATIC_ALLOCATION == 1 )
return xTimerCreateStatic((const char *)"",
1, // period should be filled when starting the Timer using osTimerStart
(type == osTimerPeriodic) ? pdTRUE : pdFALSE,
(void *) argument,
(TimerCallbackFunction_t)timer_def->ptimer,
(StaticTimer_t *)timer_def->controlblock);
#else
return xTimerCreate((const char *)"",
1, // period should be filled when starting the Timer using osTimerStart
(type == osTimerPeriodic) ? pdTRUE : pdFALSE,
(void *) argument,
(TimerCallbackFunction_t)timer_def->ptimer);
#endif
#else
return NULL;
#endif
}
/**
* @brief Start or restart a timer.
* @param timer_id timer ID obtained by \ref osTimerCreate.
* @param millisec time delay value of the timer.
* @retval status code that indicates the execution status of the function
* @note MUST REMAIN UNCHANGED: \b osTimerStart shall be consistent in every CMSIS-RTOS.
*/
osStatus osTimerStart (osTimerId timer_id, uint32_t millisec)
{
osStatus result = osOK;
#if (configUSE_TIMERS == 1)
portBASE_TYPE taskWoken = pdFALSE;
TickType_t ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0)
ticks = 1;
if (inHandlerMode())
{
if (xTimerChangePeriodFromISR(timer_id, ticks, &taskWoken) != pdPASS)
{
result = osErrorOS;
}
else
{
portEND_SWITCHING_ISR(taskWoken);
}
}
else
{
if (xTimerChangePeriod(timer_id, ticks, 0) != pdPASS)
result = osErrorOS;
}
#else
result = osErrorOS;
#endif
return result;
}
/**
* @brief Stop a timer.
* @param timer_id timer ID obtained by \ref osTimerCreate
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osTimerStop shall be consistent in every CMSIS-RTOS.
*/
osStatus osTimerStop (osTimerId timer_id)
{
osStatus result = osOK;
#if (configUSE_TIMERS == 1)
portBASE_TYPE taskWoken = pdFALSE;
if (inHandlerMode()) {
if (xTimerStopFromISR(timer_id, &taskWoken) != pdPASS) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else {
if (xTimerStop(timer_id, 0) != pdPASS) {
result = osErrorOS;
}
}
#else
result = osErrorOS;
#endif
return result;
}
/**
* @brief Delete a timer.
* @param timer_id timer ID obtained by \ref osTimerCreate
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osTimerDelete shall be consistent in every CMSIS-RTOS.
*/
osStatus osTimerDelete (osTimerId timer_id)
{
osStatus result = osOK;
#if (configUSE_TIMERS == 1)
if (inHandlerMode()) {
return osErrorISR;
}
else {
if ((xTimerDelete(timer_id, osWaitForever )) != pdPASS) {
result = osErrorOS;
}
}
#else
result = osErrorOS;
#endif
return result;
}
/*************************** Signal Management ********************************/
/**
* @brief Set the specified Signal Flags of an active thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @param signals specifies the signal flags of the thread that should be set.
* @retval previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
* @note MUST REMAIN UNCHANGED: \b osSignalSet shall be consistent in every CMSIS-RTOS.
*/
int32_t osSignalSet (osThreadId thread_id, int32_t signal)
{
#if( configUSE_TASK_NOTIFICATIONS == 1 )
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
uint32_t ulPreviousNotificationValue = 0;
if (inHandlerMode())
{
if(xTaskGenericNotifyFromISR( thread_id , (uint32_t)signal, eSetBits, &ulPreviousNotificationValue, &xHigherPriorityTaskWoken ) != pdPASS )
return 0x80000000;
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
else if(xTaskGenericNotify( thread_id , (uint32_t)signal, eSetBits, &ulPreviousNotificationValue) != pdPASS )
return 0x80000000;
return ulPreviousNotificationValue;
#else
(void) thread_id;
(void) signal;
return 0x80000000; /* Task Notification not supported */
#endif
}
/**
* @brief Clear the specified Signal Flags of an active thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @param signals specifies the signal flags of the thread that shall be cleared.
* @retval previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
* @note MUST REMAIN UNCHANGED: \b osSignalClear shall be consistent in every CMSIS-RTOS.
*/
int32_t osSignalClear (osThreadId thread_id, int32_t signal);
/**
* @brief Wait for one or more Signal Flags to become signaled for the current \b RUNNING thread.
* @param signals wait until all specified signal flags set or 0 for any single signal flag.
* @param millisec timeout value or 0 in case of no time-out.
* @retval event flag information or error code.
* @note MUST REMAIN UNCHANGED: \b osSignalWait shall be consistent in every CMSIS-RTOS.
*/
osEvent osSignalWait (int32_t signals, uint32_t millisec)
{
osEvent ret;
#if( configUSE_TASK_NOTIFICATIONS == 1 )
TickType_t ticks;
ret.value.signals = 0;
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
else if (millisec != 0) {
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0) {
ticks = 1;
}
}
if (inHandlerMode())
{
ret.status = osErrorISR; /*Not allowed in ISR*/
}
else
{
if(xTaskNotifyWait( 0,(uint32_t) signals, (uint32_t *)&ret.value.signals, ticks) != pdTRUE)
{
if(ticks == 0) ret.status = osOK;
else ret.status = osEventTimeout;
}
else if(ret.value.signals < 0)
{
ret.status = osErrorValue;
}
else ret.status = osEventSignal;
}
#else
(void) signals;
(void) millisec;
ret.status = osErrorOS; /* Task Notification not supported */
#endif
return ret;
}
/**************************** Mutex Management ********************************/
/**
* @brief Create and Initialize a Mutex object
* @param mutex_def mutex definition referenced with \ref osMutex.
* @retval mutex ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osMutexCreate shall be consistent in every CMSIS-RTOS.
*/
osMutexId osMutexCreate (const osMutexDef_t *mutex_def)
{
#if ( configUSE_MUTEXES == 1)
#if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
if (mutex_def->controlblock != NULL) {
return xSemaphoreCreateMutexStatic( mutex_def->controlblock );
}
else {
return xSemaphoreCreateMutex();
}
#elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
return xSemaphoreCreateMutexStatic( mutex_def->controlblock );
#else
return xSemaphoreCreateMutex();
#endif
#else
return NULL;
#endif
}
/**
* @brief Wait until a Mutex becomes available
* @param mutex_id mutex ID obtained by \ref osMutexCreate.
* @param millisec timeout value or 0 in case of no time-out.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osMutexWait shall be consistent in every CMSIS-RTOS.
*/
osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec)
{
TickType_t ticks;
portBASE_TYPE taskWoken = pdFALSE;
if (mutex_id == NULL) {
return osErrorParameter;
}
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
else if (millisec != 0) {
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0) {
ticks = 1;
}
}
if (inHandlerMode()) {
if (xSemaphoreTakeFromISR(mutex_id, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else if (xSemaphoreTake(mutex_id, ticks) != pdTRUE) {
return osErrorOS;
}
return osOK;
}
/**
* @brief Release a Mutex that was obtained by \ref osMutexWait
* @param mutex_id mutex ID obtained by \ref osMutexCreate.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osMutexRelease shall be consistent in every CMSIS-RTOS.
*/
osStatus osMutexRelease (osMutexId mutex_id)
{
osStatus result = osOK;
portBASE_TYPE taskWoken = pdFALSE;
if (inHandlerMode()) {
if (xSemaphoreGiveFromISR(mutex_id, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else if (xSemaphoreGive(mutex_id) != pdTRUE)
{
result = osErrorOS;
}
return result;
}
/**
* @brief Delete a Mutex
* @param mutex_id mutex ID obtained by \ref osMutexCreate.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osMutexDelete shall be consistent in every CMSIS-RTOS.
*/
osStatus osMutexDelete (osMutexId mutex_id)
{
if (inHandlerMode()) {
return osErrorISR;
}
vQueueDelete(mutex_id);
return osOK;
}
/******************** Semaphore Management Functions **************************/
#if (defined (osFeature_Semaphore) && (osFeature_Semaphore != 0))
/**
* @brief Create and Initialize a Semaphore object used for managing resources
* @param semaphore_def semaphore definition referenced with \ref osSemaphore.
* @param count number of available resources.
* @retval semaphore ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
*/
osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count)
{
#if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
osSemaphoreId sema;
if (semaphore_def->controlblock != NULL){
if (count == 1) {
return xSemaphoreCreateBinaryStatic( semaphore_def->controlblock );
}
else {
#if (configUSE_COUNTING_SEMAPHORES == 1 )
return xSemaphoreCreateCountingStatic( count, count, semaphore_def->controlblock );
#else
return NULL;
#endif
}
}
else {
if (count == 1) {
vSemaphoreCreateBinary(sema);
return sema;
}
else {
#if (configUSE_COUNTING_SEMAPHORES == 1 )
return xSemaphoreCreateCounting(count, count);
#else
return NULL;
#endif
}
}
#elif ( configSUPPORT_STATIC_ALLOCATION == 1 ) // configSUPPORT_DYNAMIC_ALLOCATION == 0
if(count == 1) {
return xSemaphoreCreateBinaryStatic( semaphore_def->controlblock );
}
else
{
#if (configUSE_COUNTING_SEMAPHORES == 1 )
return xSemaphoreCreateCountingStatic( count, count, semaphore_def->controlblock );
#else
return NULL;
#endif
}
#else // configSUPPORT_STATIC_ALLOCATION == 0 && configSUPPORT_DYNAMIC_ALLOCATION == 1
osSemaphoreId sema;
if (count == 1) {
vSemaphoreCreateBinary(sema);
return sema;
}
else {
#if (configUSE_COUNTING_SEMAPHORES == 1 )
return xSemaphoreCreateCounting(count, count);
#else
return NULL;
#endif
}
#endif
}
/**
* @brief Wait until a Semaphore token becomes available
* @param semaphore_id semaphore object referenced with \ref osSemaphore.
* @param millisec timeout value or 0 in case of no time-out.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osSemaphoreWait shall be consistent in every CMSIS-RTOS.
*/
osStatus osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec)
{
TickType_t ticks;
portBASE_TYPE taskWoken = pdFALSE;
if (semaphore_id == NULL) {
return osErrorParameter;
}
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
else if (millisec != 0) {
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0) {
ticks = 1;
}
}
if (inHandlerMode()) {
if (xSemaphoreTakeFromISR(semaphore_id, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else if (xSemaphoreTake(semaphore_id, ticks) != pdTRUE) {
return osErrorOS;
}
return osOK;
}
/**
* @brief Release a Semaphore token
* @param semaphore_id semaphore object referenced with \ref osSemaphore.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
*/
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
{
osStatus result = osOK;
portBASE_TYPE taskWoken = pdFALSE;
if (inHandlerMode()) {
if (xSemaphoreGiveFromISR(semaphore_id, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else {
if (xSemaphoreGive(semaphore_id) != pdTRUE) {
result = osErrorOS;
}
}
return result;
}
/**
* @brief Delete a Semaphore
* @param semaphore_id semaphore object referenced with \ref osSemaphore.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osSemaphoreDelete shall be consistent in every CMSIS-RTOS.
*/
osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)
{
if (inHandlerMode()) {
return osErrorISR;
}
vSemaphoreDelete(semaphore_id);
return osOK;
}
#endif /* Use Semaphores */
/******************* Memory Pool Management Functions ***********************/
#if (defined (osFeature_Pool) && (osFeature_Pool != 0))
//TODO
//This is a primitive and inefficient wrapper around the existing FreeRTOS memory management.
//A better implementation will have to modify heap_x.c!
typedef struct os_pool_cb {
void *pool;
uint8_t *markers;
uint32_t pool_sz;
uint32_t item_sz;
uint32_t currentIndex;
} os_pool_cb_t;
/**
* @brief Create and Initialize a memory pool
* @param pool_def memory pool definition referenced with \ref osPool.
* @retval memory pool ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osPoolCreate shall be consistent in every CMSIS-RTOS.
*/
osPoolId osPoolCreate (const osPoolDef_t *pool_def)
{
#if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
osPoolId thePool;
int itemSize = 4 * ((pool_def->item_sz + 3) / 4);
uint32_t i;
/* First have to allocate memory for the pool control block. */
thePool = pvPortMalloc(sizeof(os_pool_cb_t));
if (thePool) {
thePool->pool_sz = pool_def->pool_sz;
thePool->item_sz = itemSize;
thePool->currentIndex = 0;
/* Memory for markers */
thePool->markers = pvPortMalloc(pool_def->pool_sz);
if (thePool->markers) {
/* Now allocate the pool itself. */
thePool->pool = pvPortMalloc(pool_def->pool_sz * itemSize);
if (thePool->pool) {
for (i = 0; i < pool_def->pool_sz; i++) {
thePool->markers[i] = 0;
}
}
else {
vPortFree(thePool->markers);
vPortFree(thePool);
thePool = NULL;
}
}
else {
vPortFree(thePool);
thePool = NULL;
}
}
return thePool;
#else
return NULL;
#endif
}
/**
* @brief Allocate a memory block from a memory pool
* @param pool_id memory pool ID obtain referenced with \ref osPoolCreate.
* @retval address of the allocated memory block or NULL in case of no memory available.
* @note MUST REMAIN UNCHANGED: \b osPoolAlloc shall be consistent in every CMSIS-RTOS.
*/
void *osPoolAlloc (osPoolId pool_id)
{
int dummy = 0;
void *p = NULL;
uint32_t i;
uint32_t index;
if (inHandlerMode()) {
dummy = portSET_INTERRUPT_MASK_FROM_ISR();
}
else {
vPortEnterCritical();
}
for (i = 0; i < pool_id->pool_sz; i++) {
index = (pool_id->currentIndex + i) % pool_id->pool_sz;
if (pool_id->markers[index] == 0) {
pool_id->markers[index] = 1;
p = (void *)((uint32_t)(pool_id->pool) + (index * pool_id->item_sz));
pool_id->currentIndex = index;
break;
}
}
if (inHandlerMode()) {
portCLEAR_INTERRUPT_MASK_FROM_ISR(dummy);
}
else {
vPortExitCritical();
}
return p;
}
/**
* @brief Allocate a memory block from a memory pool and set memory block to zero
* @param pool_id memory pool ID obtain referenced with \ref osPoolCreate.
* @retval address of the allocated memory block or NULL in case of no memory available.
* @note MUST REMAIN UNCHANGED: \b osPoolCAlloc shall be consistent in every CMSIS-RTOS.
*/
void *osPoolCAlloc (osPoolId pool_id)
{
void *p = osPoolAlloc(pool_id);
if (p != NULL)
{
memset(p, 0, sizeof(pool_id->pool_sz));
}
return p;
}
/**
* @brief Return an allocated memory block back to a specific memory pool
* @param pool_id memory pool ID obtain referenced with \ref osPoolCreate.
* @param block address of the allocated memory block that is returned to the memory pool.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osPoolFree shall be consistent in every CMSIS-RTOS.
*/
osStatus osPoolFree (osPoolId pool_id, void *block)
{
uint32_t index;
if (pool_id == NULL) {
return osErrorParameter;
}
if (block == NULL) {
return osErrorParameter;
}
if (block < pool_id->pool) {
return osErrorParameter;
}
index = (uint32_t)block - (uint32_t)(pool_id->pool);
if (index % pool_id->item_sz) {
return osErrorParameter;
}
index = index / pool_id->item_sz;
if (index >= pool_id->pool_sz) {
return osErrorParameter;
}
pool_id->markers[index] = 0;
return osOK;
}
#endif /* Use Memory Pool Management */
/******************* Message Queue Management Functions *********************/
#if (defined (osFeature_MessageQ) && (osFeature_MessageQ != 0)) /* Use Message Queues */
/**
* @brief Create and Initialize a Message Queue
* @param queue_def queue definition referenced with \ref osMessageQ.
* @param thread_id thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.
* @retval message queue ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osMessageCreate shall be consistent in every CMSIS-RTOS.
*/
osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id)
{
(void) thread_id;
#if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
if ((queue_def->buffer != NULL) && (queue_def->controlblock != NULL)) {
return xQueueCreateStatic(queue_def->queue_sz, queue_def->item_sz, queue_def->buffer, queue_def->controlblock);
}
else {
return xQueueCreate(queue_def->queue_sz, queue_def->item_sz);
}
#elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
return xQueueCreateStatic(queue_def->queue_sz, queue_def->item_sz, queue_def->buffer, queue_def->controlblock);
#else
return xQueueCreate(queue_def->queue_sz, queue_def->item_sz);
#endif
}
/**
* @brief Put a Message to a Queue.
* @param queue_id message queue ID obtained with \ref osMessageCreate.
* @param info message information.
* @param millisec timeout value or 0 in case of no time-out.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osMessagePut shall be consistent in every CMSIS-RTOS.
*/
osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec)
{
portBASE_TYPE taskWoken = pdFALSE;
TickType_t ticks;
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0) {
ticks = 1;
}
if (inHandlerMode()) {
if (xQueueSendFromISR(queue_id, &info, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else {
if (xQueueSend(queue_id, &info, ticks) != pdTRUE) {
return osErrorOS;
}
}
return osOK;
}
/**
* @brief Get a Message or Wait for a Message from a Queue.
* @param queue_id message queue ID obtained with \ref osMessageCreate.
* @param millisec timeout value or 0 in case of no time-out.
* @retval event information that includes status code.
* @note MUST REMAIN UNCHANGED: \b osMessageGet shall be consistent in every CMSIS-RTOS.
*/
osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec)
{
portBASE_TYPE taskWoken;
TickType_t ticks;
osEvent event;
event.def.message_id = queue_id;
event.value.v = 0;
if (queue_id == NULL) {
event.status = osErrorParameter;
return event;
}
taskWoken = pdFALSE;
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
else if (millisec != 0) {
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0) {
ticks = 1;
}
}
if (inHandlerMode()) {
if (xQueueReceiveFromISR(queue_id, &event.value.v, &taskWoken) == pdTRUE) {
/* We have mail */
event.status = osEventMessage;
}
else {
event.status = osOK;
}
portEND_SWITCHING_ISR(taskWoken);
}
else {
if (xQueueReceive(queue_id, &event.value.v, ticks) == pdTRUE) {
/* We have mail */
event.status = osEventMessage;
}
else {
event.status = (ticks == 0) ? osOK : osEventTimeout;
}
}
return event;
}
#endif /* Use Message Queues */
/******************** Mail Queue Management Functions ***********************/
#if (defined (osFeature_MailQ) && (osFeature_MailQ != 0)) /* Use Mail Queues */
typedef struct os_mailQ_cb {
const osMailQDef_t *queue_def;
QueueHandle_t handle;
osPoolId pool;
} os_mailQ_cb_t;
/**
* @brief Create and Initialize mail queue
* @param queue_def reference to the mail queue definition obtain with \ref osMailQ
* @param thread_id thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.
* @retval mail queue ID for reference by other functions or NULL in case of error.
* @note MUST REMAIN UNCHANGED: \b osMailCreate shall be consistent in every CMSIS-RTOS.
*/
osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id)
{
#if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
(void) thread_id;
osPoolDef_t pool_def = {queue_def->queue_sz, queue_def->item_sz, NULL};
/* Create a mail queue control block */
*(queue_def->cb) = pvPortMalloc(sizeof(struct os_mailQ_cb));
if (*(queue_def->cb) == NULL) {
return NULL;
}
(*(queue_def->cb))->queue_def = queue_def;
/* Create a queue in FreeRTOS */
(*(queue_def->cb))->handle = xQueueCreate(queue_def->queue_sz, sizeof(void *));
if ((*(queue_def->cb))->handle == NULL) {
vPortFree(*(queue_def->cb));
return NULL;
}
/* Create a mail pool */
(*(queue_def->cb))->pool = osPoolCreate(&pool_def);
if ((*(queue_def->cb))->pool == NULL) {
//TODO: Delete queue. How to do it in FreeRTOS?
vPortFree(*(queue_def->cb));
return NULL;
}
return *(queue_def->cb);
#else
return NULL;
#endif
}
/**
* @brief Allocate a memory block from a mail
* @param queue_id mail queue ID obtained with \ref osMailCreate.
* @param millisec timeout value or 0 in case of no time-out.
* @retval pointer to memory block that can be filled with mail or NULL in case error.
* @note MUST REMAIN UNCHANGED: \b osMailAlloc shall be consistent in every CMSIS-RTOS.
*/
void *osMailAlloc (osMailQId queue_id, uint32_t millisec)
{
(void) millisec;
void *p;
if (queue_id == NULL) {
return NULL;
}
p = osPoolAlloc(queue_id->pool);
return p;
}
/**
* @brief Allocate a memory block from a mail and set memory block to zero
* @param queue_id mail queue ID obtained with \ref osMailCreate.
* @param millisec timeout value or 0 in case of no time-out.
* @retval pointer to memory block that can be filled with mail or NULL in case error.
* @note MUST REMAIN UNCHANGED: \b osMailCAlloc shall be consistent in every CMSIS-RTOS.
*/
void *osMailCAlloc (osMailQId queue_id, uint32_t millisec)
{
uint32_t i;
void *p = osMailAlloc(queue_id, millisec);
if (p) {
for (i = 0; i < queue_id->queue_def->item_sz; i++) {
((uint8_t *)p)[i] = 0;
}
}
return p;
}
/**
* @brief Put a mail to a queue
* @param queue_id mail queue ID obtained with \ref osMailCreate.
* @param mail memory block previously allocated with \ref osMailAlloc or \ref osMailCAlloc.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osMailPut shall be consistent in every CMSIS-RTOS.
*/
osStatus osMailPut (osMailQId queue_id, void *mail)
{
portBASE_TYPE taskWoken;
if (queue_id == NULL) {
return osErrorParameter;
}
taskWoken = pdFALSE;
if (inHandlerMode()) {
if (xQueueSendFromISR(queue_id->handle, &mail, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else {
if (xQueueSend(queue_id->handle, &mail, 0) != pdTRUE) {
return osErrorOS;
}
}
return osOK;
}
/**
* @brief Get a mail from a queue
* @param queue_id mail queue ID obtained with \ref osMailCreate.
* @param millisec timeout value or 0 in case of no time-out
* @retval event that contains mail information or error code.
* @note MUST REMAIN UNCHANGED: \b osMailGet shall be consistent in every CMSIS-RTOS.
*/
osEvent osMailGet (osMailQId queue_id, uint32_t millisec)
{
portBASE_TYPE taskWoken;
TickType_t ticks;
osEvent event;
event.def.mail_id = queue_id;
if (queue_id == NULL) {
event.status = osErrorParameter;
return event;
}
taskWoken = pdFALSE;
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
else if (millisec != 0) {
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0) {
ticks = 1;
}
}
if (inHandlerMode()) {
if (xQueueReceiveFromISR(queue_id->handle, &event.value.p, &taskWoken) == pdTRUE) {
/* We have mail */
event.status = osEventMail;
}
else {
event.status = osOK;
}
portEND_SWITCHING_ISR(taskWoken);
}
else {
if (xQueueReceive(queue_id->handle, &event.value.p, ticks) == pdTRUE) {
/* We have mail */
event.status = osEventMail;
}
else {
event.status = (ticks == 0) ? osOK : osEventTimeout;
}
}
return event;
}
/**
* @brief Free a memory block from a mail
* @param queue_id mail queue ID obtained with \ref osMailCreate.
* @param mail pointer to the memory block that was obtained with \ref osMailGet.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osMailFree shall be consistent in every CMSIS-RTOS.
*/
osStatus osMailFree (osMailQId queue_id, void *mail)
{
if (queue_id == NULL) {
return osErrorParameter;
}
return osPoolFree(queue_id->pool, mail);
}
#endif /* Use Mail Queues */
/*************************** Additional specific APIs to Free RTOS ************/
/**
* @brief Handles the tick increment
* @param none.
* @retval none.
*/
void osSystickHandler(void)
{
#if (INCLUDE_xTaskGetSchedulerState == 1 )
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
{
#endif /* INCLUDE_xTaskGetSchedulerState */
xPortSysTickHandler();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
}
#endif /* INCLUDE_xTaskGetSchedulerState */
}
#if ( INCLUDE_eTaskGetState == 1 )
/**
* @brief Obtain the state of any thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @retval the stae of the thread, states are encoded by the osThreadState enumerated type.
*/
osThreadState osThreadGetState(osThreadId thread_id)
{
eTaskState ThreadState;
osThreadState result;
ThreadState = eTaskGetState(thread_id);
switch (ThreadState)
{
case eRunning :
result = osThreadRunning;
break;
case eReady :
result = osThreadReady;
break;
case eBlocked :
result = osThreadBlocked;
break;
case eSuspended :
result = osThreadSuspended;
break;
case eDeleted :
result = osThreadDeleted;
break;
default:
result = osThreadError;
}
return result;
}
#endif /* INCLUDE_eTaskGetState */
#if (INCLUDE_eTaskGetState == 1)
/**
* @brief Check if a thread is already suspended or not.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @retval status code that indicates the execution status of the function.
*/
osStatus osThreadIsSuspended(osThreadId thread_id)
{
if (eTaskGetState(thread_id) == eSuspended)
return osOK;
else
return osErrorOS;
}
#endif /* INCLUDE_eTaskGetState */
/**
* @brief Suspend execution of a thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @retval status code that indicates the execution status of the function.
*/
osStatus osThreadSuspend (osThreadId thread_id)
{
#if (INCLUDE_vTaskSuspend == 1)
vTaskSuspend(thread_id);
return osOK;
#else
return osErrorResource;
#endif
}
/**
* @brief Resume execution of a suspended thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @retval status code that indicates the execution status of the function.
*/
osStatus osThreadResume (osThreadId thread_id)
{
#if (INCLUDE_vTaskSuspend == 1)
if(inHandlerMode())
{
if (xTaskResumeFromISR(thread_id) == pdTRUE)
{
portYIELD_FROM_ISR(pdTRUE);
}
}
else
{
vTaskResume(thread_id);
}
return osOK;
#else
return osErrorResource;
#endif
}
/**
* @brief Suspend execution of a all active threads.
* @retval status code that indicates the execution status of the function.
*/
osStatus osThreadSuspendAll (void)
{
vTaskSuspendAll();
return osOK;
}
/**
* @brief Resume execution of a all suspended threads.
* @retval status code that indicates the execution status of the function.
*/
osStatus osThreadResumeAll (void)
{
if (xTaskResumeAll() == pdTRUE)
return osOK;
else
return osErrorOS;
}
/**
* @brief Delay a task until a specified time
* @param PreviousWakeTime Pointer to a variable that holds the time at which the
* task was last unblocked. PreviousWakeTime must be initialised with the current time
* prior to its first use (PreviousWakeTime = osKernelSysTick() )
* @param millisec time delay value
* @retval status code that indicates the execution status of the function.
*/
osStatus osDelayUntil (uint32_t *PreviousWakeTime, uint32_t millisec)
{
#if INCLUDE_vTaskDelayUntil
TickType_t ticks = (millisec / portTICK_PERIOD_MS);
vTaskDelayUntil((TickType_t *) PreviousWakeTime, ticks ? ticks : 1);
return osOK;
#else
(void) millisec;
(void) PreviousWakeTime;
return osErrorResource;
#endif
}
/**
* @brief Abort the delay for a specific thread
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId
* @retval status code that indicates the execution status of the function.
*/
osStatus osAbortDelay(osThreadId thread_id)
{
#if INCLUDE_xTaskAbortDelay
xTaskAbortDelay(thread_id);
return osOK;
#else
(void) thread_id;
return osErrorResource;
#endif
}
/**
* @brief Lists all the current threads, along with their current state
* and stack usage high water mark.
* @param buffer A buffer into which the above mentioned details
* will be written
* @retval status code that indicates the execution status of the function.
*/
osStatus osThreadList (uint8_t *buffer)
{
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS == 1 ) )
vTaskList((char *)buffer);
#endif
return osOK;
}
/**
* @brief Receive an item from a queue without removing the item from the queue.
* @param queue_id message queue ID obtained with \ref osMessageCreate.
* @param millisec timeout value or 0 in case of no time-out.
* @retval event information that includes status code.
*/
osEvent osMessagePeek (osMessageQId queue_id, uint32_t millisec)
{
TickType_t ticks;
osEvent event;
event.def.message_id = queue_id;
if (queue_id == NULL) {
event.status = osErrorParameter;
return event;
}
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
else if (millisec != 0) {
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0) {
ticks = 1;
}
}
if (xQueuePeek(queue_id, &event.value.v, ticks) == pdTRUE)
{
/* We have mail */
event.status = osEventMessage;
}
else
{
event.status = (ticks == 0) ? osOK : osEventTimeout;
}
return event;
}
/**
* @brief Get the number of messaged stored in a queue.
* @param queue_id message queue ID obtained with \ref osMessageCreate.
* @retval number of messages stored in a queue.
*/
uint32_t osMessageWaiting(osMessageQId queue_id)
{
if (inHandlerMode()) {
return uxQueueMessagesWaitingFromISR(queue_id);
}
else
{
return uxQueueMessagesWaiting(queue_id);
}
}
/**
* @brief Get the available space in a message queue.
* @param queue_id message queue ID obtained with \ref osMessageCreate.
* @retval available space in a message queue.
*/
uint32_t osMessageAvailableSpace(osMessageQId queue_id)
{
return uxQueueSpacesAvailable(queue_id);
}
/**
* @brief Delete a Message Queue
* @param queue_id message queue ID obtained with \ref osMessageCreate.
* @retval status code that indicates the execution status of the function.
*/
osStatus osMessageDelete (osMessageQId queue_id)
{
if (inHandlerMode()) {
return osErrorISR;
}
vQueueDelete(queue_id);
return osOK;
}
/**
* @brief Create and Initialize a Recursive Mutex
* @param mutex_def mutex definition referenced with \ref osMutex.
* @retval mutex ID for reference by other functions or NULL in case of error..
*/
osMutexId osRecursiveMutexCreate (const osMutexDef_t *mutex_def)
{
#if (configUSE_RECURSIVE_MUTEXES == 1)
#if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
if (mutex_def->controlblock != NULL){
return xSemaphoreCreateRecursiveMutexStatic( mutex_def->controlblock );
}
else {
return xSemaphoreCreateRecursiveMutex();
}
#elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
return xSemaphoreCreateRecursiveMutexStatic( mutex_def->controlblock );
#else
return xSemaphoreCreateRecursiveMutex();
#endif
#else
return NULL;
#endif
}
/**
* @brief Release a Recursive Mutex
* @param mutex_id mutex ID obtained by \ref osRecursiveMutexCreate.
* @retval status code that indicates the execution status of the function.
*/
osStatus osRecursiveMutexRelease (osMutexId mutex_id)
{
#if (configUSE_RECURSIVE_MUTEXES == 1)
osStatus result = osOK;
if (xSemaphoreGiveRecursive(mutex_id) != pdTRUE)
{
result = osErrorOS;
}
return result;
#else
return osErrorResource;
#endif
}
/**
* @brief Release a Recursive Mutex
* @param mutex_id mutex ID obtained by \ref osRecursiveMutexCreate.
* @param millisec timeout value or 0 in case of no time-out.
* @retval status code that indicates the execution status of the function.
*/
osStatus osRecursiveMutexWait (osMutexId mutex_id, uint32_t millisec)
{
#if (configUSE_RECURSIVE_MUTEXES == 1)
TickType_t ticks;
if (mutex_id == NULL)
{
return osErrorParameter;
}
ticks = 0;
if (millisec == osWaitForever)
{
ticks = portMAX_DELAY;
}
else if (millisec != 0)
{
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0)
{
ticks = 1;
}
}
if (xSemaphoreTakeRecursive(mutex_id, ticks) != pdTRUE)
{
return osErrorOS;
}
return osOK;
#else
return osErrorResource;
#endif
}
/**
* @brief Returns the current count value of a counting semaphore
* @param semaphore_id semaphore_id ID obtained by \ref osSemaphoreCreate.
* @retval count value
*/
uint32_t osSemaphoreGetCount(osSemaphoreId semaphore_id)
{
return uxSemaphoreGetCount(semaphore_id);
}
|
850088.c | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65a.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-65a.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: console Read input from the console
* GoodSource: Fixed string
* Sinks: w32_spawnlp
* BadSink : execute command with wspawnlp
* Flow Variant: 65 Data/control flow: data passed as an argument from one function to a function in a different source file called via a function pointer
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir "
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#define COMMAND_ARG1 L"-c"
#define COMMAND_ARG2 L"ls "
#define COMMAND_ARG3 data
#endif
#include <process.h>
#ifndef OMITBAD
/* bad function declaration */
void CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65b_badSink(wchar_t * data);
void CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65_bad()
{
wchar_t * data;
/* define a function pointer */
void (*funcPtr) (wchar_t *) = CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65b_badSink;
wchar_t dataBuffer[100] = COMMAND_ARG2;
data = dataBuffer;
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
/* use the function pointer */
funcPtr(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65b_goodG2BSink(wchar_t * data);
static void goodG2B()
{
wchar_t * data;
void (*funcPtr) (wchar_t *) = CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65b_goodG2BSink;
wchar_t dataBuffer[100] = COMMAND_ARG2;
data = dataBuffer;
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
funcPtr(data);
}
void CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65_good()
{
goodG2B();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE78_OS_Command_Injection__wchar_t_console_w32_spawnlp_65_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
839942.c | /*-------------------------------------------------------------------------
*
* tsquery_rewrite.c
* Utilities for reconstructing tsquery
*
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
* src/backend/utils/adt/tsquery_rewrite.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "catalog/pg_type.h"
#include "executor/spi.h"
#include "miscadmin.h"
#include "tsearch/ts_utils.h"
#include "utils/builtins.h"
static int
addone(int *counters, int last, int total)
{
/* since this function recurses, it could be driven to stack overflow. */
check_stack_depth();
counters[last]++;
if (counters[last] >= total)
{
if (last == 0)
return 0;
if (addone(counters, last - 1, total - 1) == 0)
return 0;
counters[last] = counters[last - 1] + 1;
}
return 1;
}
/*
* If node is equal to ex, replace it with subs. Replacement is actually done
* by returning either node or a copy of subs.
*/
static QTNode *
findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
{
if ((node->sign & ex->sign) != ex->sign ||
node->valnode->type != ex->valnode->type)
return node;
if (node->flags & QTN_NOCHANGE)
return node;
if (node->valnode->type == QI_OPR)
{
if (node->valnode->qoperator.oper != ex->valnode->qoperator.oper)
return node;
if (node->nchild == ex->nchild)
{
if (QTNEq(node, ex))
{
QTNFree(node);
if (subs)
{
node = QTNCopy(subs);
node->flags |= QTN_NOCHANGE;
}
else
node = NULL;
*isfind = true;
}
}
else if (node->nchild > ex->nchild)
{
/*
* AND and NOT are commutative, so we check if a subset of the
* children match. For example, if tnode is A | B | C, and ex is B
* | C, we have a match after we convert tnode to A | (B | C).
*/
int *counters = (int *) palloc(sizeof(int) * node->nchild);
int i;
QTNode *tnode = (QTNode *) palloc(sizeof(QTNode));
memset(tnode, 0, sizeof(QTNode));
tnode->child = (QTNode **) palloc(sizeof(QTNode *) * ex->nchild);
tnode->nchild = ex->nchild;
tnode->valnode = (QueryItem *) palloc(sizeof(QueryItem));
*(tnode->valnode) = *(ex->valnode);
for (i = 0; i < ex->nchild; i++)
counters[i] = i;
do
{
tnode->sign = 0;
for (i = 0; i < ex->nchild; i++)
{
tnode->child[i] = node->child[counters[i]];
tnode->sign |= tnode->child[i]->sign;
}
if (QTNEq(tnode, ex))
{
int j = 0;
pfree(tnode->valnode);
pfree(tnode->child);
pfree(tnode);
if (subs)
{
tnode = QTNCopy(subs);
tnode->flags = QTN_NOCHANGE | QTN_NEEDFREE;
}
else
tnode = NULL;
node->child[counters[0]] = tnode;
for (i = 1; i < ex->nchild; i++)
node->child[counters[i]] = NULL;
for (i = 0; i < node->nchild; i++)
{
if (node->child[i])
{
node->child[j] = node->child[i];
j++;
}
}
node->nchild = j;
*isfind = true;
break;
}
} while (addone(counters, ex->nchild - 1, node->nchild));
if (tnode && (tnode->flags & QTN_NOCHANGE) == 0)
{
pfree(tnode->valnode);
pfree(tnode->child);
pfree(tnode);
}
else
QTNSort(node);
pfree(counters);
}
}
else
{
Assert(node->valnode->type == QI_VAL);
if (node->valnode->qoperand.valcrc != ex->valnode->qoperand.valcrc)
return node;
else if (QTNEq(node, ex))
{
QTNFree(node);
if (subs)
{
node = QTNCopy(subs);
node->flags |= QTN_NOCHANGE;
}
else
{
node = NULL;
}
*isfind = true;
}
}
return node;
}
static QTNode *
dofindsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind)
{
/* since this function recurses, it could be driven to stack overflow. */
check_stack_depth();
root = findeq(root, ex, subs, isfind);
if (root && (root->flags & QTN_NOCHANGE) == 0 && root->valnode->type == QI_OPR)
{
int i;
for (i = 0; i < root->nchild; i++)
root->child[i] = dofindsubquery(root->child[i], ex, subs, isfind);
}
return root;
}
static QTNode *
dropvoidsubtree(QTNode *root)
{
if (!root)
return NULL;
if (root->valnode->type == QI_OPR)
{
int i,
j = 0;
for (i = 0; i < root->nchild; i++)
{
if (root->child[i])
{
root->child[j] = root->child[i];
j++;
}
}
root->nchild = j;
if (root->nchild == 0)
{
QTNFree(root);
root = NULL;
}
else if (root->nchild == 1 && root->valnode->qoperator.oper != OP_NOT)
{
QTNode *nroot = root->child[0];
pfree(root);
root = nroot;
}
}
return root;
}
QTNode *
findsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind)
{
bool DidFind = false;
root = dofindsubquery(root, ex, subs, &DidFind);
if (!subs && DidFind)
root = dropvoidsubtree(root);
if (isfind)
*isfind = DidFind;
return root;
}
Datum
tsquery_rewrite_query(PG_FUNCTION_ARGS)
{
TSQuery query = PG_GETARG_TSQUERY_COPY(0);
text *in = PG_GETARG_TEXT_P(1);
TSQuery rewrited = query;
MemoryContext outercontext = CurrentMemoryContext;
MemoryContext oldcontext;
QTNode *tree;
char *buf;
SPIPlanPtr plan;
Portal portal;
bool isnull;
int i;
if (query->size == 0)
{
PG_FREE_IF_COPY(in, 1);
PG_RETURN_POINTER(rewrited);
}
tree = QT2QTN(GETQUERY(query), GETOPERAND(query));
QTNTernary(tree);
QTNSort(tree);
buf = text_to_cstring(in);
SPI_connect();
if ((plan = SPI_prepare(buf, 0, NULL)) == NULL)
elog(ERROR, "SPI_prepare(\"%s\") failed", buf);
if ((portal = SPI_cursor_open(NULL, plan, NULL, NULL, true)) == NULL)
elog(ERROR, "SPI_cursor_open(\"%s\") failed", buf);
SPI_cursor_fetch(portal, true, 100);
if (SPI_tuptable == NULL ||
SPI_tuptable->tupdesc->natts != 2 ||
SPI_gettypeid(SPI_tuptable->tupdesc, 1) != TSQUERYOID ||
SPI_gettypeid(SPI_tuptable->tupdesc, 2) != TSQUERYOID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("ts_rewrite query must return two tsquery columns")));
while (SPI_processed > 0 && tree)
{
for (i = 0; i < SPI_processed && tree; i++)
{
Datum qdata = SPI_getbinval(SPI_tuptable->vals[i], SPI_tuptable->tupdesc, 1, &isnull);
Datum sdata;
if (isnull)
continue;
sdata = SPI_getbinval(SPI_tuptable->vals[i], SPI_tuptable->tupdesc, 2, &isnull);
if (!isnull)
{
TSQuery qtex = DatumGetTSQuery(qdata);
TSQuery qtsubs = DatumGetTSQuery(sdata);
QTNode *qex,
*qsubs = NULL;
if (qtex->size == 0)
{
if (qtex != (TSQuery) DatumGetPointer(qdata))
pfree(qtex);
if (qtsubs != (TSQuery) DatumGetPointer(sdata))
pfree(qtsubs);
continue;
}
qex = QT2QTN(GETQUERY(qtex), GETOPERAND(qtex));
QTNTernary(qex);
QTNSort(qex);
if (qtsubs->size)
qsubs = QT2QTN(GETQUERY(qtsubs), GETOPERAND(qtsubs));
oldcontext = MemoryContextSwitchTo(outercontext);
tree = findsubquery(tree, qex, qsubs, NULL);
MemoryContextSwitchTo(oldcontext);
QTNFree(qex);
if (qtex != (TSQuery) DatumGetPointer(qdata))
pfree(qtex);
QTNFree(qsubs);
if (qtsubs != (TSQuery) DatumGetPointer(sdata))
pfree(qtsubs);
if (tree)
{
/* ready the tree for another pass */
QTNClearFlags(tree, QTN_NOCHANGE);
QTNSort(tree);
}
}
}
SPI_freetuptable(SPI_tuptable);
SPI_cursor_fetch(portal, true, 100);
}
SPI_freetuptable(SPI_tuptable);
SPI_cursor_close(portal);
SPI_freeplan(plan);
SPI_finish();
if (tree)
{
QTNBinary(tree);
rewrited = QTN2QT(tree);
QTNFree(tree);
PG_FREE_IF_COPY(query, 0);
}
else
{
SET_VARSIZE(rewrited, HDRSIZETQ);
rewrited->size = 0;
}
pfree(buf);
PG_FREE_IF_COPY(in, 1);
PG_RETURN_POINTER(rewrited);
}
Datum
tsquery_rewrite(PG_FUNCTION_ARGS)
{
TSQuery query = PG_GETARG_TSQUERY_COPY(0);
TSQuery ex = PG_GETARG_TSQUERY(1);
TSQuery subst = PG_GETARG_TSQUERY(2);
TSQuery rewrited = query;
QTNode *tree,
*qex,
*subs = NULL;
if (query->size == 0 || ex->size == 0)
{
PG_FREE_IF_COPY(ex, 1);
PG_FREE_IF_COPY(subst, 2);
PG_RETURN_POINTER(rewrited);
}
tree = QT2QTN(GETQUERY(query), GETOPERAND(query));
QTNTernary(tree);
QTNSort(tree);
qex = QT2QTN(GETQUERY(ex), GETOPERAND(ex));
QTNTernary(qex);
QTNSort(qex);
if (subst->size)
subs = QT2QTN(GETQUERY(subst), GETOPERAND(subst));
tree = findsubquery(tree, qex, subs, NULL);
QTNFree(qex);
QTNFree(subs);
if (!tree)
{
SET_VARSIZE(rewrited, HDRSIZETQ);
rewrited->size = 0;
PG_FREE_IF_COPY(ex, 1);
PG_FREE_IF_COPY(subst, 2);
PG_RETURN_POINTER(rewrited);
}
else
{
QTNBinary(tree);
rewrited = QTN2QT(tree);
QTNFree(tree);
}
PG_FREE_IF_COPY(query, 0);
PG_FREE_IF_COPY(ex, 1);
PG_FREE_IF_COPY(subst, 2);
PG_RETURN_POINTER(rewrited);
}
|
503578.c | /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
/*
*
*/
#include "mpid_nem_impl.h"
#include "llc_impl.h"
#undef FUNCNAME
#define FUNCNAME MPID_nem_llc_finalize
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
int MPID_nem_llc_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int rc;
MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPID_NEM_LLC_FINALIZE);
MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPID_NEM_LLC_FINALIZE);
rc = LLC_finalize();
MPIR_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
fn_exit:
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPID_NEM_LLC_FINALIZE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
|
896100.c | /***********************************************************************;
* Copyright (c) 2015, Intel Corporation
* 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.
***********************************************************************/
#include <sapi/tpm20.h>
#include "sysapi_util.h"
void Marshal_TPMT_ECC_SCHEME(
TSS2_SYS_CONTEXT *sysContext,
TPMT_ECC_SCHEME *eccScheme
)
{
if( SYS_CONTEXT->rval != TSS2_RC_SUCCESS )
return;
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), eccScheme->scheme, &( SYS_CONTEXT->rval ) );
Marshal_TPMU_ASYM_SCHEME( sysContext, &eccScheme->details, eccScheme->scheme );
return;
}
|
74508.c | /* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-optimized" } */
/* LLVM LOCAL test not applicable */
/* { dg-require-fdump "" } */
extern void link_error (void);
/* tests to check if cprop works when using non-return functions */
extern int not_returning (int) __attribute__ ((noreturn));
int b;
int test7 (int a)
{
b = 7;
if (a)
{
not_returning (a);
}
if (b != 7)
link_error ();
return b;
}
/* There should be not link_error calls, if there is any the
optimization has failed */
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
958375.c | #include <mruby.h>
#ifdef MRB_NO_STDIO
# error mruby-bin-mruby conflicts 'MRB_NO_STDIO' in your build configuration
#endif
#include <stdlib.h>
#include <string.h>
#include <mruby/array.h>
#include <mruby/compile.h>
#include <mruby/dump.h>
#include <mruby/variable.h>
#include <mruby/proc.h>
#if defined(_WIN32) || defined(_WIN64)
# include <io.h> /* for setmode */
# include <fcntl.h>
#endif
struct _args {
FILE *rfp;
char *cmdline;
mrb_bool fname : 1;
mrb_bool mrbfile : 1;
mrb_bool check_syntax : 1;
mrb_bool verbose : 1;
mrb_bool version : 1;
mrb_bool debug : 1;
int argc;
char **argv;
int libc;
char **libv;
};
struct options {
int argc;
char **argv;
char *program;
char *opt;
char short_opt[2];
};
static void
usage(const char *name)
{
static const char *const usage_msg[] = {
"switches:",
"-b load and execute RiteBinary (mrb) file",
"-c check syntax only",
"-d set debugging flags (set $DEBUG to true)",
"-e 'command' one line of script",
"-r library load the library before executing your script",
"-v print version number, then run in verbose mode",
"--verbose run in verbose mode",
"--version print the version",
"--copyright print the copyright",
NULL
};
const char *const *p = usage_msg;
printf("Usage: %s [switches] [programfile] [arguments]\n", name);
while (*p)
printf(" %s\n", *p++);
}
static mrb_bool
mrb_extension_p(const char *path)
{
const char *e = strrchr(path, '.');
if (e && e[1] == 'm' && e[2] == 'r' && e[3] == 'b' && e[4] == '\0') {
return TRUE;
}
return FALSE;
}
static void
options_init(struct options *opts, int argc, char **argv)
{
opts->argc = argc;
opts->argv = argv;
opts->program = *argv;
*opts->short_opt = 0;
}
static const char *
options_opt(struct options *opts)
{
/* concatenated short options (e.g. `-cv`) */
if (*opts->short_opt && *++opts->opt) {
short_opt:
opts->short_opt[0] = *opts->opt;
opts->short_opt[1] = 0;
return opts->short_opt;
}
while (++opts->argv, --opts->argc) {
opts->opt = *opts->argv;
/* empty || not start with `-` || `-` */
if (!opts->opt[0] || opts->opt[0] != '-' || !opts->opt[1]) return NULL;
if (opts->opt[1] == '-') {
/* `--` */
if (!opts->opt[2]) {
++opts->argv, --opts->argc;
return NULL;
}
/* long option */
opts->opt += 2;
*opts->short_opt = 0;
return opts->opt;
}
else {
/* short option */
++opts->opt;
goto short_opt;
}
}
return NULL;
}
static const char *
options_arg(struct options *opts)
{
if (*opts->short_opt && opts->opt[1]) {
/* concatenated short option and option argument (e.g. `-rLIBRARY`) */
*opts->short_opt = 0;
return opts->opt + 1;
}
--opts->argc, ++opts->argv;
return opts->argc ? *opts->argv : NULL;
}
static char *
dup_arg_item(mrb_state *mrb, const char *item)
{
size_t buflen = strlen(item) + 1;
char *buf = (char*)mrb_malloc(mrb, buflen);
memcpy(buf, item, buflen);
return buf;
}
static int
parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args)
{
static const struct _args args_zero = { 0 };
struct options opts[1];
const char *opt, *item;
*args = args_zero;
options_init(opts, argc, argv);
while ((opt = options_opt(opts))) {
if (strcmp(opt, "b") == 0) {
args->mrbfile = TRUE;
}
else if (strcmp(opt, "c") == 0) {
args->check_syntax = TRUE;
}
else if (strcmp(opt, "d") == 0) {
args->debug = TRUE;
}
else if (strcmp(opt, "e") == 0) {
if ((item = options_arg(opts))) {
if (!args->cmdline) {
args->cmdline = dup_arg_item(mrb, item);
}
else {
size_t cmdlinelen;
size_t itemlen;
cmdlinelen = strlen(args->cmdline);
itemlen = strlen(item);
args->cmdline =
(char *)mrb_realloc(mrb, args->cmdline, cmdlinelen + itemlen + 2);
args->cmdline[cmdlinelen] = '\n';
memcpy(args->cmdline + cmdlinelen + 1, item, itemlen + 1);
}
}
else {
fprintf(stderr, "%s: No code specified for -e\n", opts->program);
return EXIT_FAILURE;
}
}
else if (strcmp(opt, "h") == 0) {
usage(opts->program);
exit(EXIT_SUCCESS);
}
else if (strcmp(opt, "r") == 0) {
if ((item = options_arg(opts))) {
if (args->libc == 0) {
args->libv = (char**)mrb_malloc(mrb, sizeof(char*));
}
else {
args->libv = (char**)mrb_realloc(mrb, args->libv, sizeof(char*) * (args->libc + 1));
}
args->libv[args->libc++] = dup_arg_item(mrb, item);
}
else {
fprintf(stderr, "%s: No library specified for -r\n", opts->program);
return EXIT_FAILURE;
}
}
else if (strcmp(opt, "v") == 0) {
if (!args->verbose) {
mrb_show_version(mrb);
args->version = TRUE;
}
args->verbose = TRUE;
}
else if (strcmp(opt, "version") == 0) {
mrb_show_version(mrb);
exit(EXIT_SUCCESS);
}
else if (strcmp(opt, "verbose") == 0) {
args->verbose = TRUE;
}
else if (strcmp(opt, "copyright") == 0) {
mrb_show_copyright(mrb);
exit(EXIT_SUCCESS);
}
else {
fprintf(stderr, "%s: invalid option %s%s (-h will show valid options)\n",
opts->program, opt[1] ? "--" : "-", opt);
return EXIT_FAILURE;
}
}
argc = opts->argc; argv = opts->argv;
if (args->cmdline == NULL) {
if (*argv == NULL) {
if (args->version) exit(EXIT_SUCCESS);
args->rfp = stdin;
}
else {
args->rfp = strcmp(argv[0], "-") == 0 ?
stdin : fopen(argv[0], "rb");
if (args->rfp == NULL) {
fprintf(stderr, "%s: Cannot open program file: %s\n", opts->program, argv[0]);
return EXIT_FAILURE;
}
args->fname = TRUE;
args->cmdline = argv[0];
argc--; argv++;
}
}
#if defined(_WIN32) || defined(_WIN64)
if (args->rfp == stdin) {
_setmode(_fileno(stdin), O_BINARY);
}
#endif
args->argv = (char **)mrb_realloc(mrb, args->argv, sizeof(char*) * (argc + 1));
memcpy(args->argv, argv, (argc+1) * sizeof(char*));
args->argc = argc;
return EXIT_SUCCESS;
}
static void
cleanup(mrb_state *mrb, struct _args *args)
{
if (args->rfp && args->rfp != stdin)
fclose(args->rfp);
if (!args->fname)
mrb_free(mrb, args->cmdline);
mrb_free(mrb, args->argv);
if (args->libc) {
while (args->libc--) {
mrb_free(mrb, args->libv[args->libc]);
}
mrb_free(mrb, args->libv);
}
mrb_close(mrb);
}
int
main(int argc, char **argv)
{
mrb_state *mrb = mrb_open();
int n = -1;
int i;
struct _args args;
mrb_value ARGV;
mrbc_context *c;
mrb_value v;
if (mrb == NULL) {
fprintf(stderr, "%s: Invalid mrb_state, exiting mruby\n", *argv);
return EXIT_FAILURE;
}
n = parse_args(mrb, argc, argv, &args);
if (n == EXIT_FAILURE || (args.cmdline == NULL && args.rfp == NULL)) {
cleanup(mrb, &args);
return n;
}
else {
int ai = mrb_gc_arena_save(mrb);
ARGV = mrb_ary_new_capa(mrb, args.argc);
for (i = 0; i < args.argc; i++) {
char* utf8 = mrb_utf8_from_locale(args.argv[i], -1);
if (utf8) {
mrb_ary_push(mrb, ARGV, mrb_str_new_cstr(mrb, utf8));
mrb_utf8_free(utf8);
}
}
mrb_define_global_const(mrb, "ARGV", ARGV);
mrb_gv_set(mrb, mrb_intern_lit(mrb, "$DEBUG"), mrb_bool_value(args.debug));
c = mrbc_context_new(mrb);
if (args.verbose)
c->dump_result = TRUE;
if (args.check_syntax)
c->no_exec = TRUE;
/* Set $0 */
const char *cmdline;
if (args.rfp) {
cmdline = args.cmdline ? args.cmdline : "-";
}
else {
cmdline = "-e";
}
mrb_gv_set(mrb, mrb_intern_lit(mrb, "$0"), mrb_str_new_cstr(mrb, cmdline));
/* Load libraries */
for (i = 0; i < args.libc; i++) {
struct REnv *e;
FILE *lfp = fopen(args.libv[i], "rb");
if (lfp == NULL) {
fprintf(stderr, "%s: Cannot open library file: %s\n", *argv, args.libv[i]);
mrbc_context_free(mrb, c);
cleanup(mrb, &args);
return EXIT_FAILURE;
}
mrbc_filename(mrb, c, args.libv[i]);
if (mrb_extension_p(args.libv[i])) {
v = mrb_load_irep_file_cxt(mrb, lfp, c);
}
else {
v = mrb_load_detect_file_cxt(mrb, lfp, c);
}
fclose(lfp);
e = mrb_vm_ci_env(mrb->c->cibase);
mrb_vm_ci_env_set(mrb->c->cibase, NULL);
mrb_env_unshare(mrb, e);
mrbc_cleanup_local_variables(mrb, c);
}
/* set program file name */
mrbc_filename(mrb, c, cmdline);
/* Load program */
if (args.mrbfile || mrb_extension_p(cmdline)) {
v = mrb_load_irep_file_cxt(mrb, args.rfp, c);
}
else if (args.rfp) {
v = mrb_load_detect_file_cxt(mrb, args.rfp, c);
}
else {
char* utf8 = mrb_utf8_from_locale(args.cmdline, -1);
if (!utf8) abort();
v = mrb_load_string_cxt(mrb, utf8, c);
mrb_utf8_free(utf8);
}
mrb_gc_arena_restore(mrb, ai);
mrbc_context_free(mrb, c);
if (mrb->exc) {
if (!mrb_undef_p(v)) {
mrb_print_error(mrb);
}
n = EXIT_FAILURE;
}
else if (args.check_syntax) {
puts("Syntax OK");
}
}
cleanup(mrb, &args);
return n;
}
|
445809.c | /*
* Driver for NEC VR4100 series Real Time Clock unit.
*
* Copyright (C) 2003-2008 Yoichi Yuasa <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/log2.h>
#include <asm/div64.h>
#include <asm/io.h>
#include <asm/uaccess.h>
MODULE_AUTHOR("Yoichi Yuasa <[email protected]>");
MODULE_DESCRIPTION("NEC VR4100 series RTC driver");
MODULE_LICENSE("GPL v2");
/* RTC 1 registers */
#define ETIMELREG 0x00
#define ETIMEMREG 0x02
#define ETIMEHREG 0x04
/* RFU */
#define ECMPLREG 0x08
#define ECMPMREG 0x0a
#define ECMPHREG 0x0c
/* RFU */
#define RTCL1LREG 0x10
#define RTCL1HREG 0x12
#define RTCL1CNTLREG 0x14
#define RTCL1CNTHREG 0x16
#define RTCL2LREG 0x18
#define RTCL2HREG 0x1a
#define RTCL2CNTLREG 0x1c
#define RTCL2CNTHREG 0x1e
/* RTC 2 registers */
#define TCLKLREG 0x00
#define TCLKHREG 0x02
#define TCLKCNTLREG 0x04
#define TCLKCNTHREG 0x06
/* RFU */
#define RTCINTREG 0x1e
#define TCLOCK_INT 0x08
#define RTCLONG2_INT 0x04
#define RTCLONG1_INT 0x02
#define ELAPSEDTIME_INT 0x01
#define RTC_FREQUENCY 32768
#define MAX_PERIODIC_RATE 6553
static void __iomem *rtc1_base;
static void __iomem *rtc2_base;
#define rtc1_read(offset) readw(rtc1_base + (offset))
#define rtc1_write(offset, value) writew((value), rtc1_base + (offset))
#define rtc2_read(offset) readw(rtc2_base + (offset))
#define rtc2_write(offset, value) writew((value), rtc2_base + (offset))
static unsigned long epoch = 1970; /* Jan 1 1970 00:00:00 */
static DEFINE_SPINLOCK(rtc_lock);
static char rtc_name[] = "RTC";
static unsigned long periodic_count;
static unsigned int alarm_enabled;
static int aie_irq;
static int pie_irq;
static inline unsigned long read_elapsed_second(void)
{
unsigned long first_low, first_mid, first_high;
unsigned long second_low, second_mid, second_high;
do {
first_low = rtc1_read(ETIMELREG);
first_mid = rtc1_read(ETIMEMREG);
first_high = rtc1_read(ETIMEHREG);
second_low = rtc1_read(ETIMELREG);
second_mid = rtc1_read(ETIMEMREG);
second_high = rtc1_read(ETIMEHREG);
} while (first_low != second_low || first_mid != second_mid ||
first_high != second_high);
return (first_high << 17) | (first_mid << 1) | (first_low >> 15);
}
static inline void write_elapsed_second(unsigned long sec)
{
spin_lock_irq(&rtc_lock);
rtc1_write(ETIMELREG, (uint16_t)(sec << 15));
rtc1_write(ETIMEMREG, (uint16_t)(sec >> 1));
rtc1_write(ETIMEHREG, (uint16_t)(sec >> 17));
spin_unlock_irq(&rtc_lock);
}
static void vr41xx_rtc_release(struct device *dev)
{
spin_lock_irq(&rtc_lock);
rtc1_write(ECMPLREG, 0);
rtc1_write(ECMPMREG, 0);
rtc1_write(ECMPHREG, 0);
rtc1_write(RTCL1LREG, 0);
rtc1_write(RTCL1HREG, 0);
spin_unlock_irq(&rtc_lock);
disable_irq(aie_irq);
disable_irq(pie_irq);
}
static int vr41xx_rtc_read_time(struct device *dev, struct rtc_time *time)
{
unsigned long epoch_sec, elapsed_sec;
epoch_sec = mktime(epoch, 1, 1, 0, 0, 0);
elapsed_sec = read_elapsed_second();
rtc_time_to_tm(epoch_sec + elapsed_sec, time);
return 0;
}
static int vr41xx_rtc_set_time(struct device *dev, struct rtc_time *time)
{
unsigned long epoch_sec, current_sec;
epoch_sec = mktime(epoch, 1, 1, 0, 0, 0);
current_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday,
time->tm_hour, time->tm_min, time->tm_sec);
write_elapsed_second(current_sec - epoch_sec);
return 0;
}
static int vr41xx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
{
unsigned long low, mid, high;
struct rtc_time *time = &wkalrm->time;
spin_lock_irq(&rtc_lock);
low = rtc1_read(ECMPLREG);
mid = rtc1_read(ECMPMREG);
high = rtc1_read(ECMPHREG);
wkalrm->enabled = alarm_enabled;
spin_unlock_irq(&rtc_lock);
rtc_time_to_tm((high << 17) | (mid << 1) | (low >> 15), time);
return 0;
}
static int vr41xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
{
unsigned long alarm_sec;
struct rtc_time *time = &wkalrm->time;
alarm_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday,
time->tm_hour, time->tm_min, time->tm_sec);
spin_lock_irq(&rtc_lock);
if (alarm_enabled)
disable_irq(aie_irq);
rtc1_write(ECMPLREG, (uint16_t)(alarm_sec << 15));
rtc1_write(ECMPMREG, (uint16_t)(alarm_sec >> 1));
rtc1_write(ECMPHREG, (uint16_t)(alarm_sec >> 17));
if (wkalrm->enabled)
enable_irq(aie_irq);
alarm_enabled = wkalrm->enabled;
spin_unlock_irq(&rtc_lock);
return 0;
}
static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case RTC_EPOCH_READ:
return put_user(epoch, (unsigned long __user *)arg);
case RTC_EPOCH_SET:
/* Doesn't support before 1900 */
if (arg < 1900)
return -EINVAL;
epoch = arg;
break;
default:
return -ENOIOCTLCMD;
}
return 0;
}
static int vr41xx_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
{
spin_lock_irq(&rtc_lock);
if (enabled) {
if (!alarm_enabled) {
enable_irq(aie_irq);
alarm_enabled = 1;
}
} else {
if (alarm_enabled) {
disable_irq(aie_irq);
alarm_enabled = 0;
}
}
spin_unlock_irq(&rtc_lock);
return 0;
}
static irqreturn_t elapsedtime_interrupt(int irq, void *dev_id)
{
struct platform_device *pdev = (struct platform_device *)dev_id;
struct rtc_device *rtc = platform_get_drvdata(pdev);
rtc2_write(RTCINTREG, ELAPSEDTIME_INT);
rtc_update_irq(rtc, 1, RTC_AF);
return IRQ_HANDLED;
}
static irqreturn_t rtclong1_interrupt(int irq, void *dev_id)
{
struct platform_device *pdev = (struct platform_device *)dev_id;
struct rtc_device *rtc = platform_get_drvdata(pdev);
unsigned long count = periodic_count;
rtc2_write(RTCINTREG, RTCLONG1_INT);
rtc1_write(RTCL1LREG, count);
rtc1_write(RTCL1HREG, count >> 16);
rtc_update_irq(rtc, 1, RTC_PF);
return IRQ_HANDLED;
}
static const struct rtc_class_ops vr41xx_rtc_ops = {
.release = vr41xx_rtc_release,
.ioctl = vr41xx_rtc_ioctl,
.read_time = vr41xx_rtc_read_time,
.set_time = vr41xx_rtc_set_time,
.read_alarm = vr41xx_rtc_read_alarm,
.set_alarm = vr41xx_rtc_set_alarm,
};
static int __devinit rtc_probe(struct platform_device *pdev)
{
struct resource *res;
struct rtc_device *rtc;
int retval;
if (pdev->num_resources != 4)
return -EBUSY;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EBUSY;
rtc1_base = ioremap(res->start, resource_size(res));
if (!rtc1_base)
return -EBUSY;
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
retval = -EBUSY;
goto err_rtc1_iounmap;
}
rtc2_base = ioremap(res->start, resource_size(res));
if (!rtc2_base) {
retval = -EBUSY;
goto err_rtc1_iounmap;
}
rtc = rtc_device_register(rtc_name, &pdev->dev, &vr41xx_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) {
retval = PTR_ERR(rtc);
goto err_iounmap_all;
}
rtc->max_user_freq = MAX_PERIODIC_RATE;
spin_lock_irq(&rtc_lock);
rtc1_write(ECMPLREG, 0);
rtc1_write(ECMPMREG, 0);
rtc1_write(ECMPHREG, 0);
rtc1_write(RTCL1LREG, 0);
rtc1_write(RTCL1HREG, 0);
spin_unlock_irq(&rtc_lock);
aie_irq = platform_get_irq(pdev, 0);
if (aie_irq <= 0) {
retval = -EBUSY;
goto err_device_unregister;
}
retval = request_irq(aie_irq, elapsedtime_interrupt, 0,
"elapsed_time", pdev);
if (retval < 0)
goto err_device_unregister;
pie_irq = platform_get_irq(pdev, 1);
if (pie_irq <= 0)
goto err_free_irq;
retval = request_irq(pie_irq, rtclong1_interrupt, 0,
"rtclong1", pdev);
if (retval < 0)
goto err_free_irq;
platform_set_drvdata(pdev, rtc);
disable_irq(aie_irq);
disable_irq(pie_irq);
printk(KERN_INFO "rtc: Real Time Clock of NEC VR4100 series\n");
return 0;
err_free_irq:
free_irq(aie_irq, pdev);
err_device_unregister:
rtc_device_unregister(rtc);
err_iounmap_all:
iounmap(rtc2_base);
rtc2_base = NULL;
err_rtc1_iounmap:
iounmap(rtc1_base);
rtc1_base = NULL;
return retval;
}
static int __devexit rtc_remove(struct platform_device *pdev)
{
struct rtc_device *rtc;
rtc = platform_get_drvdata(pdev);
if (rtc)
rtc_device_unregister(rtc);
platform_set_drvdata(pdev, NULL);
free_irq(aie_irq, pdev);
free_irq(pie_irq, pdev);
if (rtc1_base)
iounmap(rtc1_base);
if (rtc2_base)
iounmap(rtc2_base);
return 0;
}
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:RTC");
static struct platform_driver rtc_platform_driver = {
.probe = rtc_probe,
.remove = __devexit_p(rtc_remove),
.driver = {
.name = rtc_name,
.owner = THIS_MODULE,
},
};
module_platform_driver(rtc_platform_driver);
|
182254.c | /******************************************************************************/
/* */
/* Copyright (c) 1990-2016, KAIST */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* 1. Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in */
/* the documentation and/or other materials provided with the */
/* distribution. */
/* */
/* 3. Neither the name of the copyright holder nor the names of its */
/* contributors may be used to endorse or promote products derived */
/* from this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
/* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
/* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
/* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
/* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
/* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/******************************************************************************/
/******************************************************************************/
/* */
/* ODYSSEUS/COSMOS General-Purpose Large-Scale Object Storage System -- */
/* Coarse-Granule Locking (Volume Lock) Version */
/* Version 3.0 */
/* */
/* Developed by Professor Kyu-Young Whang et al. */
/* */
/* Advanced Information Technology Research Center (AITrc) */
/* Korea Advanced Institute of Science and Technology (KAIST) */
/* */
/* e-mail: [email protected] */
/* */
/* Bibliography: */
/* [1] Whang, K., Lee, J., Lee, M., Han, W., Kim, M., and Kim, J., "DB-IR */
/* Integration Using Tight-Coupling in the Odysseus DBMS," World Wide */
/* Web, Vol. 18, No. 3, pp. 491-520, May 2015. */
/* [2] Whang, K., Lee, M., Lee, J., Kim, M., and Han, W., "Odysseus: a */
/* High-Performance ORDBMS Tightly-Coupled with IR Features," In Proc. */
/* IEEE 21st Int'l Conf. on Data Engineering (ICDE), pp. 1104-1105 */
/* (demo), Tokyo, Japan, April 5-8, 2005. This paper received the Best */
/* Demonstration Award. */
/* [3] Whang, K., Park, B., Han, W., and Lee, Y., "An Inverted Index */
/* Storage Structure Using Subindexes and Large Objects for Tight */
/* Coupling of Information Retrieval with Database Management */
/* Systems," U.S. Patent No.6,349,308 (2002) (Appl. No. 09/250,487 */
/* (1999)). */
/* [4] Whang, K., Lee, J., Kim, M., Lee, M., Lee, K., Han, W., and Kim, */
/* J., "Tightly-Coupled Spatial Database Features in the */
/* Odysseus/OpenGIS DBMS for High-Performance," GeoInformatica, */
/* Vol. 14, No. 4, pp. 425-446, Oct. 2010. */
/* [5] Whang, K., Lee, J., Kim, M., Lee, M., and Lee, K., "Odysseus: a */
/* High-Performance ORDBMS Tightly-Coupled with Spatial Database */
/* Features," In Proc. 23rd IEEE Int'l Conf. on Data Engineering */
/* (ICDE), pp. 1493-1494 (demo), Istanbul, Turkey, Apr. 16-20, 2007. */
/* */
/******************************************************************************/
/*
* Module: Err_Init.c
*
* Description:
* Initialize the error code system.
*
* Exports:
* void Err_Init(void)
*/
#include <stdio.h>
#include "common.h"
#include "error.h"
#include "err_InitVariables.i"
#include "perThreadDS.h"
#include "perProcessDS.h"
/*
* Function: void Err_Init(void)
*
* Description:
* Initialize the error code system.
*
* Returns:
* None
*/
void Err_Init(Four handle)
{
return;
} /* Err_Init() */
|
483981.c | // generated from rosidl_generator_py/resource/_idl_support.c.em
// with input from turtlesim:msg/Pose.idl
// generated code does not contain a copyright notice
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <stdbool.h>
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "numpy/ndarrayobject.h"
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
#include "rosidl_runtime_c/visibility_control.h"
#include "turtlesim/msg/detail/pose__struct.h"
#include "turtlesim/msg/detail/pose__functions.h"
ROSIDL_GENERATOR_C_EXPORT
bool turtlesim__msg__pose__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[25];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("turtlesim.msg._pose.Pose", full_classname_dest, 24) == 0);
}
turtlesim__msg__Pose * ros_message = _ros_message;
{ // x
PyObject * field = PyObject_GetAttrString(_pymsg, "x");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->x = (float)PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
{ // y
PyObject * field = PyObject_GetAttrString(_pymsg, "y");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->y = (float)PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
{ // theta
PyObject * field = PyObject_GetAttrString(_pymsg, "theta");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->theta = (float)PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
{ // linear_velocity
PyObject * field = PyObject_GetAttrString(_pymsg, "linear_velocity");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->linear_velocity = (float)PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
{ // angular_velocity
PyObject * field = PyObject_GetAttrString(_pymsg, "angular_velocity");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->angular_velocity = (float)PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * turtlesim__msg__pose__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Pose */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("turtlesim.msg._pose");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Pose");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
turtlesim__msg__Pose * ros_message = (turtlesim__msg__Pose *)raw_ros_message;
{ // x
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->x);
{
int rc = PyObject_SetAttrString(_pymessage, "x", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // y
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->y);
{
int rc = PyObject_SetAttrString(_pymessage, "y", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // theta
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->theta);
{
int rc = PyObject_SetAttrString(_pymessage, "theta", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // linear_velocity
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->linear_velocity);
{
int rc = PyObject_SetAttrString(_pymessage, "linear_velocity", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // angular_velocity
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->angular_velocity);
{
int rc = PyObject_SetAttrString(_pymessage, "angular_velocity", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
|
75680.c | /*
* Host1x init for Tegra210 SoCs
*
* Copyright (c) 2015 NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* include hw specification */
#include "host1x05.h"
#include "host1x05_hardware.h"
/* include code */
#include "cdma_hw.c"
#include "channel_hw.c"
#include "debug_hw.c"
#include "intr_hw.c"
#include "syncpt_hw.c"
#include "../dev.h"
int host1x05_init(struct host1x *host)
{
host->channel_op = &host1x_channel_ops;
host->cdma_op = &host1x_cdma_ops;
host->cdma_pb_op = &host1x_pushbuffer_ops;
host->syncpt_op = &host1x_syncpt_ops;
host->intr_op = &host1x_intr_ops;
host->debug_op = &host1x_debug_ops;
return 0;
}
|
897288.c | /*
* Serial driver for the amiga builtin port.
*
* This code was created by taking serial.c version 4.30 from kernel
* release 2.3.22, replacing all hardware related stuff with the
* corresponding amiga hardware actions, and removing all irrelevant
* code. As a consequence, it uses many of the constants and names
* associated with the registers and bits of 16550 compatible UARTS -
* but only to keep track of status, etc in the state variables. It
* was done this was to make it easier to keep the code in line with
* (non hardware specific) changes to serial.c.
*
* The port is registered with the tty driver as minor device 64, and
* therefore other ports should should only use 65 upwards.
*
* Richard Lucock 28/12/99
*
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997,
* 1998, 1999 Theodore Ts'o
*
*/
/*
* Serial driver configuration section. Here are the various options:
*
* SERIAL_PARANOIA_CHECK
* Check the magic number for the async_structure where
* ever possible.
*/
#include <linux/delay.h>
#undef SERIAL_PARANOIA_CHECK
/* Set of debugging defines */
#undef SERIAL_DEBUG_INTR
#undef SERIAL_DEBUG_OPEN
#undef SERIAL_DEBUG_FLOW
#undef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
/* Sanity checks */
#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
#define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
tty->name, (info->tport.flags), serial_driver->refcount,info->count,tty->count,s)
#else
#define DBG_CNT(s)
#endif
/*
* End of serial driver configuration section.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/serial.h>
#include <linux/serial_reg.h>
static char *serial_version = "4.30";
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/circ_buf.h>
#include <linux/console.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/mm.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <asm/setup.h>
#include <asm/irq.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
struct serial_state {
struct tty_port tport;
struct circ_buf xmit;
struct async_icount icount;
unsigned long port;
int baud_base;
int xmit_fifo_size;
int custom_divisor;
int read_status_mask;
int ignore_status_mask;
int timeout;
int quot;
int IER; /* Interrupt Enable Register */
int MCR; /* Modem control register */
int x_char; /* xon/xoff character */
};
#define custom amiga_custom
static char *serial_name = "Amiga-builtin serial driver";
static struct tty_driver *serial_driver;
/* number of characters left in xmit buffer before we ask for more */
#define WAKEUP_CHARS 256
static unsigned char current_ctl_bits;
static void change_speed(struct tty_struct *tty, struct serial_state *info,
struct ktermios *old);
static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
static struct serial_state rs_table[1];
#define NR_PORTS ARRAY_SIZE(rs_table)
#include <asm/uaccess.h>
#define serial_isroot() (capable(CAP_SYS_ADMIN))
static inline int serial_paranoia_check(struct serial_state *info,
char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
"Warning: bad magic number for serial struct (%s) in %s\n";
static const char *badinfo =
"Warning: null async_struct for (%s) in %s\n";
if (!info) {
printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
printk(badmagic, name, routine);
return 1;
}
#endif
return 0;
}
/* some serial hardware definitions */
#define SDR_OVRUN (1<<15)
#define SDR_RBF (1<<14)
#define SDR_TBE (1<<13)
#define SDR_TSRE (1<<12)
#define SERPER_PARENB (1<<15)
#define AC_SETCLR (1<<15)
#define AC_UARTBRK (1<<11)
#define SER_DTR (1<<7)
#define SER_RTS (1<<6)
#define SER_DCD (1<<5)
#define SER_CTS (1<<4)
#define SER_DSR (1<<3)
static __inline__ void rtsdtr_ctrl(int bits)
{
ciab.pra = ((bits & (SER_RTS | SER_DTR)) ^ (SER_RTS | SER_DTR)) | (ciab.pra & ~(SER_RTS | SER_DTR));
}
/*
* ------------------------------------------------------------
* rs_stop() and rs_start()
*
* This routines are called before setting or resetting tty->stopped.
* They enable or disable transmitter interrupts, as necessary.
* ------------------------------------------------------------
*/
static void rs_stop(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
local_irq_save(flags);
if (info->IER & UART_IER_THRI) {
info->IER &= ~UART_IER_THRI;
/* disable Tx interrupt and remove any pending interrupts */
custom.intena = IF_TBE;
mb();
custom.intreq = IF_TBE;
mb();
}
local_irq_restore(flags);
}
static void rs_start(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
local_irq_save(flags);
if (info->xmit.head != info->xmit.tail
&& info->xmit.buf
&& !(info->IER & UART_IER_THRI)) {
info->IER |= UART_IER_THRI;
custom.intena = IF_SETCLR | IF_TBE;
mb();
/* set a pending Tx Interrupt, transmitter should restart now */
custom.intreq = IF_SETCLR | IF_TBE;
mb();
}
local_irq_restore(flags);
}
/*
* ----------------------------------------------------------------------
*
* Here starts the interrupt handling routines. All of the following
* subroutines are declared as inline and are folded into
* rs_interrupt(). They were separated out for readability's sake.
*
* Note: rs_interrupt() is a "fast" interrupt, which means that it
* runs with interrupts turned off. People who may want to modify
* rs_interrupt() should try to keep the interrupt handler as fast as
* possible. After you are done making modifications, it is not a bad
* idea to do:
*
* gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer serial.c
*
* and look at the resulting assemble code in serial.s.
*
* - Ted Ts'o ([email protected]), 7-Mar-93
* -----------------------------------------------------------------------
*/
static void receive_chars(struct serial_state *info)
{
int status;
int serdatr;
unsigned char ch, flag;
struct async_icount *icount;
int oe = 0;
icount = &info->icount;
status = UART_LSR_DR; /* We obviously have a character! */
serdatr = custom.serdatr;
mb();
custom.intreq = IF_RBF;
mb();
if((serdatr & 0x1ff) == 0)
status |= UART_LSR_BI;
if(serdatr & SDR_OVRUN)
status |= UART_LSR_OE;
ch = serdatr & 0xff;
icount->rx++;
#ifdef SERIAL_DEBUG_INTR
printk("DR%02x:%02x...", ch, status);
#endif
flag = TTY_NORMAL;
/*
* We don't handle parity or frame errors - but I have left
* the code in, since I'm not sure that the errors can't be
* detected.
*/
if (status & (UART_LSR_BI | UART_LSR_PE |
UART_LSR_FE | UART_LSR_OE)) {
/*
* For statistics only
*/
if (status & UART_LSR_BI) {
status &= ~(UART_LSR_FE | UART_LSR_PE);
icount->brk++;
} else if (status & UART_LSR_PE)
icount->parity++;
else if (status & UART_LSR_FE)
icount->frame++;
if (status & UART_LSR_OE)
icount->overrun++;
/*
* Now check to see if character should be
* ignored, and mask off conditions which
* should be ignored.
*/
if (status & info->ignore_status_mask)
goto out;
status &= info->read_status_mask;
if (status & (UART_LSR_BI)) {
#ifdef SERIAL_DEBUG_INTR
printk("handling break....");
#endif
flag = TTY_BREAK;
if (info->tport.flags & ASYNC_SAK)
do_SAK(info->tport.tty);
} else if (status & UART_LSR_PE)
flag = TTY_PARITY;
else if (status & UART_LSR_FE)
flag = TTY_FRAME;
if (status & UART_LSR_OE) {
/*
* Overrun is special, since it's
* reported immediately, and doesn't
* affect the current character
*/
oe = 1;
}
}
tty_insert_flip_char(&info->tport, ch, flag);
if (oe == 1)
tty_insert_flip_char(&info->tport, 0, TTY_OVERRUN);
tty_flip_buffer_push(&info->tport);
out:
return;
}
static void transmit_chars(struct serial_state *info)
{
custom.intreq = IF_TBE;
mb();
if (info->x_char) {
custom.serdat = info->x_char | 0x100;
mb();
info->icount.tx++;
info->x_char = 0;
return;
}
if (info->xmit.head == info->xmit.tail
|| info->tport.tty->stopped
|| info->tport.tty->hw_stopped) {
info->IER &= ~UART_IER_THRI;
custom.intena = IF_TBE;
mb();
return;
}
custom.serdat = info->xmit.buf[info->xmit.tail++] | 0x100;
mb();
info->xmit.tail = info->xmit.tail & (SERIAL_XMIT_SIZE-1);
info->icount.tx++;
if (CIRC_CNT(info->xmit.head,
info->xmit.tail,
SERIAL_XMIT_SIZE) < WAKEUP_CHARS)
tty_wakeup(info->tport.tty);
#ifdef SERIAL_DEBUG_INTR
printk("THRE...");
#endif
if (info->xmit.head == info->xmit.tail) {
custom.intena = IF_TBE;
mb();
info->IER &= ~UART_IER_THRI;
}
}
static void check_modem_status(struct serial_state *info)
{
struct tty_port *port = &info->tport;
unsigned char status = ciab.pra & (SER_DCD | SER_CTS | SER_DSR);
unsigned char dstatus;
struct async_icount *icount;
/* Determine bits that have changed */
dstatus = status ^ current_ctl_bits;
current_ctl_bits = status;
if (dstatus) {
icount = &info->icount;
/* update input line counters */
if (dstatus & SER_DSR)
icount->dsr++;
if (dstatus & SER_DCD) {
icount->dcd++;
}
if (dstatus & SER_CTS)
icount->cts++;
wake_up_interruptible(&port->delta_msr_wait);
}
if (tty_port_check_carrier(port) && (dstatus & SER_DCD)) {
#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
printk("ttyS%d CD now %s...", info->line,
(!(status & SER_DCD)) ? "on" : "off");
#endif
if (!(status & SER_DCD))
wake_up_interruptible(&port->open_wait);
else {
#ifdef SERIAL_DEBUG_OPEN
printk("doing serial hangup...");
#endif
if (port->tty)
tty_hangup(port->tty);
}
}
if (tty_port_cts_enabled(port)) {
if (port->tty->hw_stopped) {
if (!(status & SER_CTS)) {
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk("CTS tx start...");
#endif
port->tty->hw_stopped = 0;
info->IER |= UART_IER_THRI;
custom.intena = IF_SETCLR | IF_TBE;
mb();
/* set a pending Tx Interrupt, transmitter should restart now */
custom.intreq = IF_SETCLR | IF_TBE;
mb();
tty_wakeup(port->tty);
return;
}
} else {
if ((status & SER_CTS)) {
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk("CTS tx stop...");
#endif
port->tty->hw_stopped = 1;
info->IER &= ~UART_IER_THRI;
/* disable Tx interrupt and remove any pending interrupts */
custom.intena = IF_TBE;
mb();
custom.intreq = IF_TBE;
mb();
}
}
}
}
static irqreturn_t ser_vbl_int( int irq, void *data)
{
/* vbl is just a periodic interrupt we tie into to update modem status */
struct serial_state *info = data;
/*
* TBD - is it better to unregister from this interrupt or to
* ignore it if MSI is clear ?
*/
if(info->IER & UART_IER_MSI)
check_modem_status(info);
return IRQ_HANDLED;
}
static irqreturn_t ser_rx_int(int irq, void *dev_id)
{
struct serial_state *info = dev_id;
#ifdef SERIAL_DEBUG_INTR
printk("ser_rx_int...");
#endif
if (!info->tport.tty)
return IRQ_NONE;
receive_chars(info);
#ifdef SERIAL_DEBUG_INTR
printk("end.\n");
#endif
return IRQ_HANDLED;
}
static irqreturn_t ser_tx_int(int irq, void *dev_id)
{
struct serial_state *info = dev_id;
if (custom.serdatr & SDR_TBE) {
#ifdef SERIAL_DEBUG_INTR
printk("ser_tx_int...");
#endif
if (!info->tport.tty)
return IRQ_NONE;
transmit_chars(info);
#ifdef SERIAL_DEBUG_INTR
printk("end.\n");
#endif
}
return IRQ_HANDLED;
}
/*
* -------------------------------------------------------------------
* Here ends the serial interrupt routines.
* -------------------------------------------------------------------
*/
/*
* ---------------------------------------------------------------
* Low level utility subroutines for the serial driver: routines to
* figure out the appropriate timeout for an interrupt chain, routines
* to initialize and startup a serial port, and routines to shutdown a
* serial port. Useful stuff like that.
* ---------------------------------------------------------------
*/
static int startup(struct tty_struct *tty, struct serial_state *info)
{
struct tty_port *port = &info->tport;
unsigned long flags;
int retval=0;
unsigned long page;
page = get_zeroed_page(GFP_KERNEL);
if (!page)
return -ENOMEM;
local_irq_save(flags);
if (tty_port_initialized(port)) {
free_page(page);
goto errout;
}
if (info->xmit.buf)
free_page(page);
else
info->xmit.buf = (unsigned char *) page;
#ifdef SERIAL_DEBUG_OPEN
printk("starting up ttys%d ...", info->line);
#endif
/* Clear anything in the input buffer */
custom.intreq = IF_RBF;
mb();
retval = request_irq(IRQ_AMIGA_VERTB, ser_vbl_int, 0, "serial status", info);
if (retval) {
if (serial_isroot()) {
set_bit(TTY_IO_ERROR, &tty->flags);
retval = 0;
}
goto errout;
}
/* enable both Rx and Tx interrupts */
custom.intena = IF_SETCLR | IF_RBF | IF_TBE;
mb();
info->IER = UART_IER_MSI;
/* remember current state of the DCD and CTS bits */
current_ctl_bits = ciab.pra & (SER_DCD | SER_CTS | SER_DSR);
info->MCR = 0;
if (C_BAUD(tty))
info->MCR = SER_DTR | SER_RTS;
rtsdtr_ctrl(info->MCR);
clear_bit(TTY_IO_ERROR, &tty->flags);
info->xmit.head = info->xmit.tail = 0;
/*
* Set up the tty->alt_speed kludge
*/
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
tty->alt_speed = 57600;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
tty->alt_speed = 115200;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
tty->alt_speed = 230400;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
tty->alt_speed = 460800;
/*
* and set the speed of the serial port
*/
change_speed(tty, info, NULL);
tty_port_set_initialized(port, 1);
local_irq_restore(flags);
return 0;
errout:
local_irq_restore(flags);
return retval;
}
/*
* This routine will shutdown a serial port; interrupts are disabled, and
* DTR is dropped if the hangup on close termio flag is on.
*/
static void shutdown(struct tty_struct *tty, struct serial_state *info)
{
unsigned long flags;
struct serial_state *state;
if (!tty_port_initialized(&info->tport))
return;
state = info;
#ifdef SERIAL_DEBUG_OPEN
printk("Shutting down serial port %d ....\n", info->line);
#endif
local_irq_save(flags); /* Disable interrupts */
/*
* clear delta_msr_wait queue to avoid mem leaks: we may free the irq
* here so the queue might never be waken up
*/
wake_up_interruptible(&info->tport.delta_msr_wait);
/*
* Free the IRQ, if necessary
*/
free_irq(IRQ_AMIGA_VERTB, info);
if (info->xmit.buf) {
free_page((unsigned long) info->xmit.buf);
info->xmit.buf = NULL;
}
info->IER = 0;
custom.intena = IF_RBF | IF_TBE;
mb();
/* disable break condition */
custom.adkcon = AC_UARTBRK;
mb();
if (C_HUPCL(tty))
info->MCR &= ~(SER_DTR|SER_RTS);
rtsdtr_ctrl(info->MCR);
set_bit(TTY_IO_ERROR, &tty->flags);
tty_port_set_initialized(&info->tport, 0);
local_irq_restore(flags);
}
/*
* This routine is called to set the UART divisor registers to match
* the specified baud rate for a serial port.
*/
static void change_speed(struct tty_struct *tty, struct serial_state *info,
struct ktermios *old_termios)
{
struct tty_port *port = &info->tport;
int quot = 0, baud_base, baud;
unsigned cflag, cval = 0;
int bits;
unsigned long flags;
cflag = tty->termios.c_cflag;
/* Byte size is always 8 bits plus parity bit if requested */
cval = 3; bits = 10;
if (cflag & CSTOPB) {
cval |= 0x04;
bits++;
}
if (cflag & PARENB) {
cval |= UART_LCR_PARITY;
bits++;
}
if (!(cflag & PARODD))
cval |= UART_LCR_EPAR;
#ifdef CMSPAR
if (cflag & CMSPAR)
cval |= UART_LCR_SPAR;
#endif
/* Determine divisor based on baud rate */
baud = tty_get_baud_rate(tty);
if (!baud)
baud = 9600; /* B0 transition handled in rs_set_termios */
baud_base = info->baud_base;
if (baud == 38400 && (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)
quot = info->custom_divisor;
else {
if (baud == 134)
/* Special case since 134 is really 134.5 */
quot = (2*baud_base / 269);
else if (baud)
quot = baud_base / baud;
}
/* If the quotient is zero refuse the change */
if (!quot && old_termios) {
/* FIXME: Will need updating for new tty in the end */
tty->termios.c_cflag &= ~CBAUD;
tty->termios.c_cflag |= (old_termios->c_cflag & CBAUD);
baud = tty_get_baud_rate(tty);
if (!baud)
baud = 9600;
if (baud == 38400 &&
(port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)
quot = info->custom_divisor;
else {
if (baud == 134)
/* Special case since 134 is really 134.5 */
quot = (2*baud_base / 269);
else if (baud)
quot = baud_base / baud;
}
}
/* As a last resort, if the quotient is zero, default to 9600 bps */
if (!quot)
quot = baud_base / 9600;
info->quot = quot;
info->timeout = ((info->xmit_fifo_size*HZ*bits*quot) / baud_base);
info->timeout += HZ/50; /* Add .02 seconds of slop */
/* CTS flow control flag and modem status interrupts */
info->IER &= ~UART_IER_MSI;
if (port->flags & ASYNC_HARDPPS_CD)
info->IER |= UART_IER_MSI;
tty_port_set_cts_flow(port, cflag & CRTSCTS);
if (cflag & CRTSCTS)
info->IER |= UART_IER_MSI;
tty_port_set_check_carrier(port, ~cflag & CLOCAL);
if (~cflag & CLOCAL)
info->IER |= UART_IER_MSI;
/* TBD:
* Does clearing IER_MSI imply that we should disable the VBL interrupt ?
*/
/*
* Set up parity check flag
*/
info->read_status_mask = UART_LSR_OE | UART_LSR_DR;
if (I_INPCK(tty))
info->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
if (I_BRKINT(tty) || I_PARMRK(tty))
info->read_status_mask |= UART_LSR_BI;
/*
* Characters to ignore
*/
info->ignore_status_mask = 0;
if (I_IGNPAR(tty))
info->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE;
if (I_IGNBRK(tty)) {
info->ignore_status_mask |= UART_LSR_BI;
/*
* If we're ignore parity and break indicators, ignore
* overruns too. (For real raw support).
*/
if (I_IGNPAR(tty))
info->ignore_status_mask |= UART_LSR_OE;
}
/*
* !!! ignore all characters if CREAD is not set
*/
if ((cflag & CREAD) == 0)
info->ignore_status_mask |= UART_LSR_DR;
local_irq_save(flags);
{
short serper;
/* Set up the baud rate */
serper = quot - 1;
/* Enable or disable parity bit */
if(cval & UART_LCR_PARITY)
serper |= (SERPER_PARENB);
custom.serper = serper;
mb();
}
local_irq_restore(flags);
}
static int rs_put_char(struct tty_struct *tty, unsigned char ch)
{
struct serial_state *info;
unsigned long flags;
info = tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return 0;
if (!info->xmit.buf)
return 0;
local_irq_save(flags);
if (CIRC_SPACE(info->xmit.head,
info->xmit.tail,
SERIAL_XMIT_SIZE) == 0) {
local_irq_restore(flags);
return 0;
}
info->xmit.buf[info->xmit.head++] = ch;
info->xmit.head &= SERIAL_XMIT_SIZE-1;
local_irq_restore(flags);
return 1;
}
static void rs_flush_chars(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
if (info->xmit.head == info->xmit.tail
|| tty->stopped
|| tty->hw_stopped
|| !info->xmit.buf)
return;
local_irq_save(flags);
info->IER |= UART_IER_THRI;
custom.intena = IF_SETCLR | IF_TBE;
mb();
/* set a pending Tx Interrupt, transmitter should restart now */
custom.intreq = IF_SETCLR | IF_TBE;
mb();
local_irq_restore(flags);
}
static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count)
{
int c, ret = 0;
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!info->xmit.buf)
return 0;
local_irq_save(flags);
while (1) {
c = CIRC_SPACE_TO_END(info->xmit.head,
info->xmit.tail,
SERIAL_XMIT_SIZE);
if (count < c)
c = count;
if (c <= 0) {
break;
}
memcpy(info->xmit.buf + info->xmit.head, buf, c);
info->xmit.head = ((info->xmit.head + c) &
(SERIAL_XMIT_SIZE-1));
buf += c;
count -= c;
ret += c;
}
local_irq_restore(flags);
if (info->xmit.head != info->xmit.tail
&& !tty->stopped
&& !tty->hw_stopped
&& !(info->IER & UART_IER_THRI)) {
info->IER |= UART_IER_THRI;
local_irq_disable();
custom.intena = IF_SETCLR | IF_TBE;
mb();
/* set a pending Tx Interrupt, transmitter should restart now */
custom.intreq = IF_SETCLR | IF_TBE;
mb();
local_irq_restore(flags);
}
return ret;
}
static int rs_write_room(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
}
static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
}
static void rs_flush_buffer(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
local_irq_save(flags);
info->xmit.head = info->xmit.tail = 0;
local_irq_restore(flags);
tty_wakeup(tty);
}
/*
* This function is used to send a high-priority XON/XOFF character to
* the device
*/
static void rs_send_xchar(struct tty_struct *tty, char ch)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_send_xchar"))
return;
info->x_char = ch;
if (ch) {
/* Make sure transmit interrupts are on */
/* Check this ! */
local_irq_save(flags);
if(!(custom.intenar & IF_TBE)) {
custom.intena = IF_SETCLR | IF_TBE;
mb();
/* set a pending Tx Interrupt, transmitter should restart now */
custom.intreq = IF_SETCLR | IF_TBE;
mb();
}
local_irq_restore(flags);
info->IER |= UART_IER_THRI;
}
}
/*
* ------------------------------------------------------------
* rs_throttle()
*
* This routine is called by the upper-layer tty layer to signal that
* incoming characters should be throttled.
* ------------------------------------------------------------
*/
static void rs_throttle(struct tty_struct * tty)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
#ifdef SERIAL_DEBUG_THROTTLE
printk("throttle %s ....\n", tty_name(tty));
#endif
if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
rs_send_xchar(tty, STOP_CHAR(tty));
if (C_CRTSCTS(tty))
info->MCR &= ~SER_RTS;
local_irq_save(flags);
rtsdtr_ctrl(info->MCR);
local_irq_restore(flags);
}
static void rs_unthrottle(struct tty_struct * tty)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
#ifdef SERIAL_DEBUG_THROTTLE
printk("unthrottle %s ....\n", tty_name(tty));
#endif
if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
if (info->x_char)
info->x_char = 0;
else
rs_send_xchar(tty, START_CHAR(tty));
}
if (C_CRTSCTS(tty))
info->MCR |= SER_RTS;
local_irq_save(flags);
rtsdtr_ctrl(info->MCR);
local_irq_restore(flags);
}
/*
* ------------------------------------------------------------
* rs_ioctl() and friends
* ------------------------------------------------------------
*/
static int get_serial_info(struct tty_struct *tty, struct serial_state *state,
struct serial_struct __user * retinfo)
{
struct serial_struct tmp;
if (!retinfo)
return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
tty_lock(tty);
tmp.line = tty->index;
tmp.port = state->port;
tmp.flags = state->tport.flags;
tmp.xmit_fifo_size = state->xmit_fifo_size;
tmp.baud_base = state->baud_base;
tmp.close_delay = state->tport.close_delay;
tmp.closing_wait = state->tport.closing_wait;
tmp.custom_divisor = state->custom_divisor;
tty_unlock(tty);
if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
return -EFAULT;
return 0;
}
static int set_serial_info(struct tty_struct *tty, struct serial_state *state,
struct serial_struct __user * new_info)
{
struct tty_port *port = &state->tport;
struct serial_struct new_serial;
bool change_spd;
int retval = 0;
if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
return -EFAULT;
tty_lock(tty);
change_spd = ((new_serial.flags ^ port->flags) & ASYNC_SPD_MASK) ||
new_serial.custom_divisor != state->custom_divisor;
if (new_serial.irq || new_serial.port != state->port ||
new_serial.xmit_fifo_size != state->xmit_fifo_size) {
tty_unlock(tty);
return -EINVAL;
}
if (!serial_isroot()) {
if ((new_serial.baud_base != state->baud_base) ||
(new_serial.close_delay != port->close_delay) ||
(new_serial.xmit_fifo_size != state->xmit_fifo_size) ||
((new_serial.flags & ~ASYNC_USR_MASK) !=
(port->flags & ~ASYNC_USR_MASK))) {
tty_unlock(tty);
return -EPERM;
}
port->flags = ((port->flags & ~ASYNC_USR_MASK) |
(new_serial.flags & ASYNC_USR_MASK));
state->custom_divisor = new_serial.custom_divisor;
goto check_and_exit;
}
if (new_serial.baud_base < 9600) {
tty_unlock(tty);
return -EINVAL;
}
/*
* OK, past this point, all the error checking has been done.
* At this point, we start making changes.....
*/
state->baud_base = new_serial.baud_base;
port->flags = ((port->flags & ~ASYNC_FLAGS) |
(new_serial.flags & ASYNC_FLAGS));
state->custom_divisor = new_serial.custom_divisor;
port->close_delay = new_serial.close_delay * HZ/100;
port->closing_wait = new_serial.closing_wait * HZ/100;
port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
check_and_exit:
if (tty_port_initialized(port)) {
if (change_spd) {
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
tty->alt_speed = 57600;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
tty->alt_speed = 115200;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
tty->alt_speed = 230400;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
tty->alt_speed = 460800;
change_speed(tty, state, NULL);
}
} else
retval = startup(tty, state);
tty_unlock(tty);
return retval;
}
/*
* get_lsr_info - get line status register info
*
* Purpose: Let user call ioctl() to get info when the UART physically
* is emptied. On bus types like RS485, the transmitter must
* release the bus after transmitting. This must be done when
* the transmit shift register is empty, not be done when the
* transmit holding register is empty. This functionality
* allows an RS485 driver to be written in user space.
*/
static int get_lsr_info(struct serial_state *info, unsigned int __user *value)
{
unsigned char status;
unsigned int result;
unsigned long flags;
local_irq_save(flags);
status = custom.serdatr;
mb();
local_irq_restore(flags);
result = ((status & SDR_TSRE) ? TIOCSER_TEMT : 0);
if (copy_to_user(value, &result, sizeof(int)))
return -EFAULT;
return 0;
}
static int rs_tiocmget(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
unsigned char control, status;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if (tty_io_error(tty))
return -EIO;
control = info->MCR;
local_irq_save(flags);
status = ciab.pra;
local_irq_restore(flags);
return ((control & SER_RTS) ? TIOCM_RTS : 0)
| ((control & SER_DTR) ? TIOCM_DTR : 0)
| (!(status & SER_DCD) ? TIOCM_CAR : 0)
| (!(status & SER_DSR) ? TIOCM_DSR : 0)
| (!(status & SER_CTS) ? TIOCM_CTS : 0);
}
static int rs_tiocmset(struct tty_struct *tty, unsigned int set,
unsigned int clear)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if (tty_io_error(tty))
return -EIO;
local_irq_save(flags);
if (set & TIOCM_RTS)
info->MCR |= SER_RTS;
if (set & TIOCM_DTR)
info->MCR |= SER_DTR;
if (clear & TIOCM_RTS)
info->MCR &= ~SER_RTS;
if (clear & TIOCM_DTR)
info->MCR &= ~SER_DTR;
rtsdtr_ctrl(info->MCR);
local_irq_restore(flags);
return 0;
}
/*
* rs_break() --- routine which turns the break handling on or off
*/
static int rs_break(struct tty_struct *tty, int break_state)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_break"))
return -EINVAL;
local_irq_save(flags);
if (break_state == -1)
custom.adkcon = AC_SETCLR | AC_UARTBRK;
else
custom.adkcon = AC_UARTBRK;
mb();
local_irq_restore(flags);
return 0;
}
/*
* Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
* Return: write counters to the user passed counter struct
* NB: both 1->0 and 0->1 transitions are counted except for
* RI where only 0->1 is counted.
*/
static int rs_get_icount(struct tty_struct *tty,
struct serial_icounter_struct *icount)
{
struct serial_state *info = tty->driver_data;
struct async_icount cnow;
unsigned long flags;
local_irq_save(flags);
cnow = info->icount;
local_irq_restore(flags);
icount->cts = cnow.cts;
icount->dsr = cnow.dsr;
icount->rng = cnow.rng;
icount->dcd = cnow.dcd;
icount->rx = cnow.rx;
icount->tx = cnow.tx;
icount->frame = cnow.frame;
icount->overrun = cnow.overrun;
icount->parity = cnow.parity;
icount->brk = cnow.brk;
icount->buf_overrun = cnow.buf_overrun;
return 0;
}
static int rs_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct serial_state *info = tty->driver_data;
struct async_icount cprev, cnow; /* kernel counter temps */
void __user *argp = (void __user *)arg;
unsigned long flags;
DEFINE_WAIT(wait);
int ret;
if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
(cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
(cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
if (tty_io_error(tty))
return -EIO;
}
switch (cmd) {
case TIOCGSERIAL:
return get_serial_info(tty, info, argp);
case TIOCSSERIAL:
return set_serial_info(tty, info, argp);
case TIOCSERCONFIG:
return 0;
case TIOCSERGETLSR: /* Get line status register */
return get_lsr_info(info, argp);
case TIOCSERGSTRUCT:
if (copy_to_user(argp,
info, sizeof(struct serial_state)))
return -EFAULT;
return 0;
/*
* Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
* - mask passed in arg for lines of interest
* (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
* Caller should use TIOCGICOUNT to see which one it was
*/
case TIOCMIWAIT:
local_irq_save(flags);
/* note the counters on entry */
cprev = info->icount;
local_irq_restore(flags);
while (1) {
prepare_to_wait(&info->tport.delta_msr_wait,
&wait, TASK_INTERRUPTIBLE);
local_irq_save(flags);
cnow = info->icount; /* atomic copy */
local_irq_restore(flags);
if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) {
ret = -EIO; /* no change => error */
break;
}
if ( ((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) ||
((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)) ) {
ret = 0;
break;
}
schedule();
/* see if a signal did it */
if (signal_pending(current)) {
ret = -ERESTARTSYS;
break;
}
cprev = cnow;
}
finish_wait(&info->tport.delta_msr_wait, &wait);
return ret;
case TIOCSERGWILD:
case TIOCSERSWILD:
/* "setserial -W" is called in Debian boot */
printk ("TIOCSER?WILD ioctl obsolete, ignored.\n");
return 0;
default:
return -ENOIOCTLCMD;
}
return 0;
}
static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
struct serial_state *info = tty->driver_data;
unsigned long flags;
unsigned int cflag = tty->termios.c_cflag;
change_speed(tty, info, old_termios);
/* Handle transition to B0 status */
if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) {
info->MCR &= ~(SER_DTR|SER_RTS);
local_irq_save(flags);
rtsdtr_ctrl(info->MCR);
local_irq_restore(flags);
}
/* Handle transition away from B0 status */
if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) {
info->MCR |= SER_DTR;
if (!C_CRTSCTS(tty) || !tty_throttled(tty))
info->MCR |= SER_RTS;
local_irq_save(flags);
rtsdtr_ctrl(info->MCR);
local_irq_restore(flags);
}
/* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) {
tty->hw_stopped = 0;
rs_start(tty);
}
#if 0
/*
* No need to wake up processes in open wait, since they
* sample the CLOCAL flag once, and don't recheck it.
* XXX It's not clear whether the current behavior is correct
* or not. Hence, this may change.....
*/
if (!(old_termios->c_cflag & CLOCAL) && C_CLOCAL(tty))
wake_up_interruptible(&info->open_wait);
#endif
}
/*
* ------------------------------------------------------------
* rs_close()
*
* This routine is called when the serial port gets closed. First, we
* wait for the last remaining data to be sent. Then, we unlink its
* async structure from the interrupt chain if necessary, and we free
* that IRQ if nothing is left in the chain.
* ------------------------------------------------------------
*/
static void rs_close(struct tty_struct *tty, struct file * filp)
{
struct serial_state *state = tty->driver_data;
struct tty_port *port = &state->tport;
if (serial_paranoia_check(state, tty->name, "rs_close"))
return;
if (tty_port_close_start(port, tty, filp) == 0)
return;
/*
* At this point we stop accepting input. To do this, we
* disable the receive line status interrupts, and tell the
* interrupt driver to stop checking the data ready bit in the
* line status register.
*/
state->read_status_mask &= ~UART_LSR_DR;
if (tty_port_initialized(port)) {
/* disable receive interrupts */
custom.intena = IF_RBF;
mb();
/* clear any pending receive interrupt */
custom.intreq = IF_RBF;
mb();
/*
* Before we drop DTR, make sure the UART transmitter
* has completely drained; this is especially
* important if there is a transmit FIFO!
*/
rs_wait_until_sent(tty, state->timeout);
}
shutdown(tty, state);
rs_flush_buffer(tty);
tty_ldisc_flush(tty);
port->tty = NULL;
tty_port_close_end(port, tty);
}
/*
* rs_wait_until_sent() --- wait until the transmitter is empty
*/
static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
{
struct serial_state *info = tty->driver_data;
unsigned long orig_jiffies, char_time;
int lsr;
if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
if (info->xmit_fifo_size == 0)
return; /* Just in case.... */
orig_jiffies = jiffies;
/*
* Set the check interval to be 1/5 of the estimated time to
* send a single character, and make it at least 1. The check
* interval should also be less than the timeout.
*
* Note: we have to use pretty tight timings here to satisfy
* the NIST-PCTS.
*/
char_time = (info->timeout - HZ/50) / info->xmit_fifo_size;
char_time = char_time / 5;
if (char_time == 0)
char_time = 1;
if (timeout)
char_time = min_t(unsigned long, char_time, timeout);
/*
* If the transmitter hasn't cleared in twice the approximate
* amount of time to send the entire FIFO, it probably won't
* ever clear. This assumes the UART isn't doing flow
* control, which is currently the case. Hence, if it ever
* takes longer than info->timeout, this is probably due to a
* UART bug of some kind. So, we clamp the timeout parameter at
* 2*info->timeout.
*/
if (!timeout || timeout > 2*info->timeout)
timeout = 2*info->timeout;
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
printk("In rs_wait_until_sent(%d) check=%lu...", timeout, char_time);
printk("jiff=%lu...", jiffies);
#endif
while(!((lsr = custom.serdatr) & SDR_TSRE)) {
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
printk("serdatr = %d (jiff=%lu)...", lsr, jiffies);
#endif
msleep_interruptible(jiffies_to_msecs(char_time));
if (signal_pending(current))
break;
if (timeout && time_after(jiffies, orig_jiffies + timeout))
break;
}
__set_current_state(TASK_RUNNING);
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies);
#endif
}
/*
* rs_hangup() --- called by tty_hangup() when a hangup is signaled.
*/
static void rs_hangup(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
rs_flush_buffer(tty);
shutdown(tty, info);
info->tport.count = 0;
tty_port_set_active(&info->tport, 0);
info->tport.tty = NULL;
wake_up_interruptible(&info->tport.open_wait);
}
/*
* This routine is called whenever a serial port is opened. It
* enables interrupts for a serial port, linking in its async structure into
* the IRQ chain. It also performs the serial-specific
* initialization for the tty structure.
*/
static int rs_open(struct tty_struct *tty, struct file * filp)
{
struct serial_state *info = rs_table + tty->index;
struct tty_port *port = &info->tport;
int retval;
port->count++;
port->tty = tty;
tty->driver_data = info;
tty->port = port;
if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
retval = startup(tty, info);
if (retval) {
return retval;
}
return tty_port_block_til_ready(port, tty, filp);
}
/*
* /proc fs routines....
*/
static inline void line_info(struct seq_file *m, int line,
struct serial_state *state)
{
char stat_buf[30], control, status;
unsigned long flags;
seq_printf(m, "%d: uart:amiga_builtin", line);
local_irq_save(flags);
status = ciab.pra;
control = tty_port_initialized(&state->tport) ? state->MCR : status;
local_irq_restore(flags);
stat_buf[0] = 0;
stat_buf[1] = 0;
if(!(control & SER_RTS))
strcat(stat_buf, "|RTS");
if(!(status & SER_CTS))
strcat(stat_buf, "|CTS");
if(!(control & SER_DTR))
strcat(stat_buf, "|DTR");
if(!(status & SER_DSR))
strcat(stat_buf, "|DSR");
if(!(status & SER_DCD))
strcat(stat_buf, "|CD");
if (state->quot)
seq_printf(m, " baud:%d", state->baud_base / state->quot);
seq_printf(m, " tx:%d rx:%d", state->icount.tx, state->icount.rx);
if (state->icount.frame)
seq_printf(m, " fe:%d", state->icount.frame);
if (state->icount.parity)
seq_printf(m, " pe:%d", state->icount.parity);
if (state->icount.brk)
seq_printf(m, " brk:%d", state->icount.brk);
if (state->icount.overrun)
seq_printf(m, " oe:%d", state->icount.overrun);
/*
* Last thing is the RS-232 status lines
*/
seq_printf(m, " %s\n", stat_buf+1);
}
static int rs_proc_show(struct seq_file *m, void *v)
{
seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version);
line_info(m, 0, &rs_table[0]);
return 0;
}
static int rs_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, rs_proc_show, NULL);
}
static const struct file_operations rs_proc_fops = {
.owner = THIS_MODULE,
.open = rs_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/*
* ---------------------------------------------------------------------
* rs_init() and friends
*
* rs_init() is called at boot-time to initialize the serial driver.
* ---------------------------------------------------------------------
*/
/*
* This routine prints out the appropriate serial driver version
* number, and identifies which options were configured into this
* driver.
*/
static void show_serial_version(void)
{
printk(KERN_INFO "%s version %s\n", serial_name, serial_version);
}
static const struct tty_operations serial_ops = {
.open = rs_open,
.close = rs_close,
.write = rs_write,
.put_char = rs_put_char,
.flush_chars = rs_flush_chars,
.write_room = rs_write_room,
.chars_in_buffer = rs_chars_in_buffer,
.flush_buffer = rs_flush_buffer,
.ioctl = rs_ioctl,
.throttle = rs_throttle,
.unthrottle = rs_unthrottle,
.set_termios = rs_set_termios,
.stop = rs_stop,
.start = rs_start,
.hangup = rs_hangup,
.break_ctl = rs_break,
.send_xchar = rs_send_xchar,
.wait_until_sent = rs_wait_until_sent,
.tiocmget = rs_tiocmget,
.tiocmset = rs_tiocmset,
.get_icount = rs_get_icount,
.proc_fops = &rs_proc_fops,
};
static int amiga_carrier_raised(struct tty_port *port)
{
return !(ciab.pra & SER_DCD);
}
static void amiga_dtr_rts(struct tty_port *port, int raise)
{
struct serial_state *info = container_of(port, struct serial_state,
tport);
unsigned long flags;
if (raise)
info->MCR |= SER_DTR|SER_RTS;
else
info->MCR &= ~(SER_DTR|SER_RTS);
local_irq_save(flags);
rtsdtr_ctrl(info->MCR);
local_irq_restore(flags);
}
static const struct tty_port_operations amiga_port_ops = {
.carrier_raised = amiga_carrier_raised,
.dtr_rts = amiga_dtr_rts,
};
/*
* The serial driver boot-time initialization code!
*/
static int __init amiga_serial_probe(struct platform_device *pdev)
{
unsigned long flags;
struct serial_state * state;
int error;
serial_driver = alloc_tty_driver(NR_PORTS);
if (!serial_driver)
return -ENOMEM;
show_serial_version();
/* Initialize the tty_driver structure */
serial_driver->driver_name = "amiserial";
serial_driver->name = "ttyS";
serial_driver->major = TTY_MAJOR;
serial_driver->minor_start = 64;
serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
serial_driver->subtype = SERIAL_TYPE_NORMAL;
serial_driver->init_termios = tty_std_termios;
serial_driver->init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(serial_driver, &serial_ops);
state = rs_table;
state->port = (int)&custom.serdatr; /* Just to give it a value */
state->custom_divisor = 0;
state->icount.cts = state->icount.dsr =
state->icount.rng = state->icount.dcd = 0;
state->icount.rx = state->icount.tx = 0;
state->icount.frame = state->icount.parity = 0;
state->icount.overrun = state->icount.brk = 0;
tty_port_init(&state->tport);
state->tport.ops = &amiga_port_ops;
tty_port_link_device(&state->tport, serial_driver, 0);
error = tty_register_driver(serial_driver);
if (error)
goto fail_put_tty_driver;
printk(KERN_INFO "ttyS0 is the amiga builtin serial port\n");
/* Hardware set up */
state->baud_base = amiga_colorclock;
state->xmit_fifo_size = 1;
/* set ISRs, and then disable the rx interrupts */
error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state);
if (error)
goto fail_unregister;
error = request_irq(IRQ_AMIGA_RBF, ser_rx_int, 0,
"serial RX", state);
if (error)
goto fail_free_irq;
local_irq_save(flags);
/* turn off Rx and Tx interrupts */
custom.intena = IF_RBF | IF_TBE;
mb();
/* clear any pending interrupt */
custom.intreq = IF_RBF | IF_TBE;
mb();
local_irq_restore(flags);
/*
* set the appropriate directions for the modem control flags,
* and clear RTS and DTR
*/
ciab.ddra |= (SER_DTR | SER_RTS); /* outputs */
ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
platform_set_drvdata(pdev, state);
return 0;
fail_free_irq:
free_irq(IRQ_AMIGA_TBE, state);
fail_unregister:
tty_unregister_driver(serial_driver);
fail_put_tty_driver:
tty_port_destroy(&state->tport);
put_tty_driver(serial_driver);
return error;
}
static int __exit amiga_serial_remove(struct platform_device *pdev)
{
int error;
struct serial_state *state = platform_get_drvdata(pdev);
/* printk("Unloading %s: version %s\n", serial_name, serial_version); */
error = tty_unregister_driver(serial_driver);
if (error)
printk("SERIAL: failed to unregister serial driver (%d)\n",
error);
put_tty_driver(serial_driver);
tty_port_destroy(&state->tport);
free_irq(IRQ_AMIGA_TBE, state);
free_irq(IRQ_AMIGA_RBF, state);
return error;
}
static struct platform_driver amiga_serial_driver = {
.remove = __exit_p(amiga_serial_remove),
.driver = {
.name = "amiga-serial",
},
};
module_platform_driver_probe(amiga_serial_driver, amiga_serial_probe);
#if defined(CONFIG_SERIAL_CONSOLE) && !defined(MODULE)
/*
* ------------------------------------------------------------
* Serial console driver
* ------------------------------------------------------------
*/
static void amiga_serial_putc(char c)
{
custom.serdat = (unsigned char)c | 0x100;
while (!(custom.serdatr & 0x2000))
barrier();
}
/*
* Print a string to the serial port trying not to disturb
* any possible real use of the port...
*
* The console must be locked when we get here.
*/
static void serial_console_write(struct console *co, const char *s,
unsigned count)
{
unsigned short intena = custom.intenar;
custom.intena = IF_TBE;
while (count--) {
if (*s == '\n')
amiga_serial_putc('\r');
amiga_serial_putc(*s++);
}
custom.intena = IF_SETCLR | (intena & IF_TBE);
}
static struct tty_driver *serial_console_device(struct console *c, int *index)
{
*index = 0;
return serial_driver;
}
static struct console sercons = {
.name = "ttyS",
.write = serial_console_write,
.device = serial_console_device,
.flags = CON_PRINTBUFFER,
.index = -1,
};
/*
* Register console.
*/
static int __init amiserial_console_init(void)
{
if (!MACH_IS_AMIGA)
return -ENODEV;
register_console(&sercons);
return 0;
}
console_initcall(amiserial_console_init);
#endif /* CONFIG_SERIAL_CONSOLE && !MODULE */
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:amiga-serial");
|
851300.c | // SPDX-License-Identifier: GPL-2.0
/*
* Texas Instruments Ethernet Switch Driver
*
* Copyright (C) 2019 Texas Instruments
*/
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/timer.h>
#include <linux/module.h>
#include <linux/irqreturn.h>
#include <linux/interrupt.h>
#include <linux/if_ether.h>
#include <linux/etherdevice.h>
#include <linux/net_tstamp.h>
#include <linux/phy.h>
#include <linux/phy/phy.h>
#include <linux/delay.h>
#include <linux/pm_runtime.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
#include <linux/of_device.h>
#include <linux/if_vlan.h>
#include <linux/kmemleak.h>
#include <linux/sys_soc.h>
#include <net/page_pool.h>
#include <net/pkt_cls.h>
#include <net/devlink.h>
#include "cpsw.h"
#include "cpsw_ale.h"
#include "cpsw_priv.h"
#include "cpsw_sl.h"
#include "cpsw_switchdev.h"
#include "cpts.h"
#include "davinci_cpdma.h"
#include <net/pkt_sched.h>
static int debug_level;
static int ale_ageout = CPSW_ALE_AGEOUT_DEFAULT;
static int rx_packet_max = CPSW_MAX_PACKET_SIZE;
static int descs_pool_size = CPSW_CPDMA_DESCS_POOL_SIZE_DEFAULT;
struct cpsw_devlink {
struct cpsw_common *cpsw;
};
enum cpsw_devlink_param_id {
CPSW_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
CPSW_DL_PARAM_SWITCH_MODE,
CPSW_DL_PARAM_ALE_BYPASS,
};
/* struct cpsw_common is not needed, kept here for compatibility
* reasons witrh the old driver
*/
static int cpsw_slave_index_priv(struct cpsw_common *cpsw,
struct cpsw_priv *priv)
{
if (priv->emac_port == HOST_PORT_NUM)
return -1;
return priv->emac_port - 1;
}
static bool cpsw_is_switch_en(struct cpsw_common *cpsw)
{
return !cpsw->data.dual_emac;
}
static void cpsw_set_promiscious(struct net_device *ndev, bool enable)
{
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
bool enable_uni = false;
int i;
if (cpsw_is_switch_en(cpsw))
return;
/* Enabling promiscuous mode for one interface will be
* common for both the interface as the interface shares
* the same hardware resource.
*/
for (i = 0; i < cpsw->data.slaves; i++)
if (cpsw->slaves[i].ndev &&
(cpsw->slaves[i].ndev->flags & IFF_PROMISC))
enable_uni = true;
if (!enable && enable_uni) {
enable = enable_uni;
dev_dbg(cpsw->dev, "promiscuity not disabled as the other interface is still in promiscuity mode\n");
}
if (enable) {
/* Enable unknown unicast, reg/unreg mcast */
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
ALE_P0_UNI_FLOOD, 1);
dev_dbg(cpsw->dev, "promiscuity enabled\n");
} else {
/* Disable unknown unicast */
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
ALE_P0_UNI_FLOOD, 0);
dev_dbg(cpsw->dev, "promiscuity disabled\n");
}
}
/**
* cpsw_set_mc - adds multicast entry to the table if it's not added or deletes
* if it's not deleted
* @ndev: device to sync
* @addr: address to be added or deleted
* @vid: vlan id, if vid < 0 set/unset address for real device
* @add: add address if the flag is set or remove otherwise
*/
static int cpsw_set_mc(struct net_device *ndev, const u8 *addr,
int vid, int add)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
int mask, flags, ret, slave_no;
slave_no = cpsw_slave_index(cpsw, priv);
if (vid < 0)
vid = cpsw->slaves[slave_no].port_vlan;
mask = ALE_PORT_HOST;
flags = vid ? ALE_VLAN : 0;
if (add)
ret = cpsw_ale_add_mcast(cpsw->ale, addr, mask, flags, vid, 0);
else
ret = cpsw_ale_del_mcast(cpsw->ale, addr, 0, flags, vid);
return ret;
}
static int cpsw_update_vlan_mc(struct net_device *vdev, int vid, void *ctx)
{
struct addr_sync_ctx *sync_ctx = ctx;
struct netdev_hw_addr *ha;
int found = 0, ret = 0;
if (!vdev || !(vdev->flags & IFF_UP))
return 0;
/* vlan address is relevant if its sync_cnt != 0 */
netdev_for_each_mc_addr(ha, vdev) {
if (ether_addr_equal(ha->addr, sync_ctx->addr)) {
found = ha->sync_cnt;
break;
}
}
if (found)
sync_ctx->consumed++;
if (sync_ctx->flush) {
if (!found)
cpsw_set_mc(sync_ctx->ndev, sync_ctx->addr, vid, 0);
return 0;
}
if (found)
ret = cpsw_set_mc(sync_ctx->ndev, sync_ctx->addr, vid, 1);
return ret;
}
static int cpsw_add_mc_addr(struct net_device *ndev, const u8 *addr, int num)
{
struct addr_sync_ctx sync_ctx;
int ret;
sync_ctx.consumed = 0;
sync_ctx.addr = addr;
sync_ctx.ndev = ndev;
sync_ctx.flush = 0;
ret = vlan_for_each(ndev, cpsw_update_vlan_mc, &sync_ctx);
if (sync_ctx.consumed < num && !ret)
ret = cpsw_set_mc(ndev, addr, -1, 1);
return ret;
}
static int cpsw_del_mc_addr(struct net_device *ndev, const u8 *addr, int num)
{
struct addr_sync_ctx sync_ctx;
sync_ctx.consumed = 0;
sync_ctx.addr = addr;
sync_ctx.ndev = ndev;
sync_ctx.flush = 1;
vlan_for_each(ndev, cpsw_update_vlan_mc, &sync_ctx);
if (sync_ctx.consumed == num)
cpsw_set_mc(ndev, addr, -1, 0);
return 0;
}
static int cpsw_purge_vlan_mc(struct net_device *vdev, int vid, void *ctx)
{
struct addr_sync_ctx *sync_ctx = ctx;
struct netdev_hw_addr *ha;
int found = 0;
if (!vdev || !(vdev->flags & IFF_UP))
return 0;
/* vlan address is relevant if its sync_cnt != 0 */
netdev_for_each_mc_addr(ha, vdev) {
if (ether_addr_equal(ha->addr, sync_ctx->addr)) {
found = ha->sync_cnt;
break;
}
}
if (!found)
return 0;
sync_ctx->consumed++;
cpsw_set_mc(sync_ctx->ndev, sync_ctx->addr, vid, 0);
return 0;
}
static int cpsw_purge_all_mc(struct net_device *ndev, const u8 *addr, int num)
{
struct addr_sync_ctx sync_ctx;
sync_ctx.addr = addr;
sync_ctx.ndev = ndev;
sync_ctx.consumed = 0;
vlan_for_each(ndev, cpsw_purge_vlan_mc, &sync_ctx);
if (sync_ctx.consumed < num)
cpsw_set_mc(ndev, addr, -1, 0);
return 0;
}
static void cpsw_ndo_set_rx_mode(struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
if (ndev->flags & IFF_PROMISC) {
/* Enable promiscuous mode */
cpsw_set_promiscious(ndev, true);
cpsw_ale_set_allmulti(cpsw->ale, IFF_ALLMULTI, priv->emac_port);
return;
}
/* Disable promiscuous mode */
cpsw_set_promiscious(ndev, false);
/* Restore allmulti on vlans if necessary */
cpsw_ale_set_allmulti(cpsw->ale,
ndev->flags & IFF_ALLMULTI, priv->emac_port);
/* add/remove mcast address either for real netdev or for vlan */
__hw_addr_ref_sync_dev(&ndev->mc, ndev, cpsw_add_mc_addr,
cpsw_del_mc_addr);
}
static unsigned int cpsw_rxbuf_total_len(unsigned int len)
{
len += CPSW_HEADROOM;
len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
return SKB_DATA_ALIGN(len);
}
static void cpsw_rx_handler(void *token, int len, int status)
{
struct page *new_page, *page = token;
void *pa = page_address(page);
int headroom = CPSW_HEADROOM;
struct cpsw_meta_xdp *xmeta;
struct cpsw_common *cpsw;
struct net_device *ndev;
int port, ch, pkt_size;
struct cpsw_priv *priv;
struct page_pool *pool;
struct sk_buff *skb;
struct xdp_buff xdp;
int ret = 0;
dma_addr_t dma;
xmeta = pa + CPSW_XMETA_OFFSET;
cpsw = ndev_to_cpsw(xmeta->ndev);
ndev = xmeta->ndev;
pkt_size = cpsw->rx_packet_max;
ch = xmeta->ch;
if (status >= 0) {
port = CPDMA_RX_SOURCE_PORT(status);
if (port)
ndev = cpsw->slaves[--port].ndev;
}
priv = netdev_priv(ndev);
pool = cpsw->page_pool[ch];
if (unlikely(status < 0) || unlikely(!netif_running(ndev))) {
/* In dual emac mode check for all interfaces */
if (cpsw->usage_count && status >= 0) {
/* The packet received is for the interface which
* is already down and the other interface is up
* and running, instead of freeing which results
* in reducing of the number of rx descriptor in
* DMA engine, requeue page back to cpdma.
*/
new_page = page;
goto requeue;
}
/* the interface is going down, pages are purged */
page_pool_recycle_direct(pool, page);
return;
}
new_page = page_pool_dev_alloc_pages(pool);
if (unlikely(!new_page)) {
new_page = page;
ndev->stats.rx_dropped++;
goto requeue;
}
if (priv->xdp_prog) {
if (status & CPDMA_RX_VLAN_ENCAP) {
xdp.data = pa + CPSW_HEADROOM +
CPSW_RX_VLAN_ENCAP_HDR_SIZE;
xdp.data_end = xdp.data + len -
CPSW_RX_VLAN_ENCAP_HDR_SIZE;
} else {
xdp.data = pa + CPSW_HEADROOM;
xdp.data_end = xdp.data + len;
}
xdp_set_data_meta_invalid(&xdp);
xdp.data_hard_start = pa;
xdp.rxq = &priv->xdp_rxq[ch];
xdp.frame_sz = PAGE_SIZE;
ret = cpsw_run_xdp(priv, ch, &xdp, page, priv->emac_port);
if (ret != CPSW_XDP_PASS)
goto requeue;
/* XDP prog might have changed packet data and boundaries */
len = xdp.data_end - xdp.data;
headroom = xdp.data - xdp.data_hard_start;
/* XDP prog can modify vlan tag, so can't use encap header */
status &= ~CPDMA_RX_VLAN_ENCAP;
}
/* pass skb to netstack if no XDP prog or returned XDP_PASS */
skb = build_skb(pa, cpsw_rxbuf_total_len(pkt_size));
if (!skb) {
ndev->stats.rx_dropped++;
page_pool_recycle_direct(pool, page);
goto requeue;
}
skb->offload_fwd_mark = priv->offload_fwd_mark;
skb_reserve(skb, headroom);
skb_put(skb, len);
skb->dev = ndev;
if (status & CPDMA_RX_VLAN_ENCAP)
cpsw_rx_vlan_encap(skb);
if (priv->rx_ts_enabled)
cpts_rx_timestamp(cpsw->cpts, skb);
skb->protocol = eth_type_trans(skb, ndev);
/* unmap page as no netstack skb page recycling */
page_pool_release_page(pool, page);
netif_receive_skb(skb);
ndev->stats.rx_bytes += len;
ndev->stats.rx_packets++;
requeue:
xmeta = page_address(new_page) + CPSW_XMETA_OFFSET;
xmeta->ndev = ndev;
xmeta->ch = ch;
dma = page_pool_get_dma_addr(new_page) + CPSW_HEADROOM;
ret = cpdma_chan_submit_mapped(cpsw->rxv[ch].ch, new_page, dma,
pkt_size, 0);
if (ret < 0) {
WARN_ON(ret == -ENOMEM);
page_pool_recycle_direct(pool, new_page);
}
}
static int cpsw_add_vlan_ale_entry(struct cpsw_priv *priv,
unsigned short vid)
{
struct cpsw_common *cpsw = priv->cpsw;
int unreg_mcast_mask = 0;
int mcast_mask;
u32 port_mask;
int ret;
port_mask = (1 << priv->emac_port) | ALE_PORT_HOST;
mcast_mask = ALE_PORT_HOST;
if (priv->ndev->flags & IFF_ALLMULTI)
unreg_mcast_mask = mcast_mask;
ret = cpsw_ale_add_vlan(cpsw->ale, vid, port_mask, 0, port_mask,
unreg_mcast_mask);
if (ret != 0)
return ret;
ret = cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
HOST_PORT_NUM, ALE_VLAN, vid);
if (ret != 0)
goto clean_vid;
ret = cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
mcast_mask, ALE_VLAN, vid, 0);
if (ret != 0)
goto clean_vlan_ucast;
return 0;
clean_vlan_ucast:
cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
HOST_PORT_NUM, ALE_VLAN, vid);
clean_vid:
cpsw_ale_del_vlan(cpsw->ale, vid, 0);
return ret;
}
static int cpsw_ndo_vlan_rx_add_vid(struct net_device *ndev,
__be16 proto, u16 vid)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
int ret, i;
if (cpsw_is_switch_en(cpsw)) {
dev_dbg(cpsw->dev, ".ndo_vlan_rx_add_vid called in switch mode\n");
return 0;
}
if (vid == cpsw->data.default_vlan)
return 0;
ret = pm_runtime_get_sync(cpsw->dev);
if (ret < 0) {
pm_runtime_put_noidle(cpsw->dev);
return ret;
}
/* In dual EMAC, reserved VLAN id should not be used for
* creating VLAN interfaces as this can break the dual
* EMAC port separation
*/
for (i = 0; i < cpsw->data.slaves; i++) {
if (cpsw->slaves[i].ndev &&
vid == cpsw->slaves[i].port_vlan) {
ret = -EINVAL;
goto err;
}
}
dev_dbg(priv->dev, "Adding vlanid %d to vlan filter\n", vid);
ret = cpsw_add_vlan_ale_entry(priv, vid);
err:
pm_runtime_put(cpsw->dev);
return ret;
}
static int cpsw_restore_vlans(struct net_device *vdev, int vid, void *arg)
{
struct cpsw_priv *priv = arg;
if (!vdev || !vid)
return 0;
cpsw_ndo_vlan_rx_add_vid(priv->ndev, 0, vid);
return 0;
}
/* restore resources after port reset */
static void cpsw_restore(struct cpsw_priv *priv)
{
struct cpsw_common *cpsw = priv->cpsw;
/* restore vlan configurations */
vlan_for_each(priv->ndev, cpsw_restore_vlans, priv);
/* restore MQPRIO offload */
cpsw_mqprio_resume(&cpsw->slaves[priv->emac_port - 1], priv);
/* restore CBS offload */
cpsw_cbs_resume(&cpsw->slaves[priv->emac_port - 1], priv);
}
static void cpsw_init_stp_ale_entry(struct cpsw_common *cpsw)
{
char stpa[] = {0x01, 0x80, 0xc2, 0x0, 0x0, 0x0};
cpsw_ale_add_mcast(cpsw->ale, stpa,
ALE_PORT_HOST, ALE_SUPER, 0,
ALE_MCAST_BLOCK_LEARN_FWD);
}
static void cpsw_init_host_port_switch(struct cpsw_common *cpsw)
{
int vlan = cpsw->data.default_vlan;
writel(CPSW_FIFO_NORMAL_MODE, &cpsw->host_port_regs->tx_in_ctl);
writel(vlan, &cpsw->host_port_regs->port_vlan);
cpsw_ale_add_vlan(cpsw->ale, vlan, ALE_ALL_PORTS,
ALE_ALL_PORTS, ALE_ALL_PORTS,
ALE_PORT_1 | ALE_PORT_2);
cpsw_init_stp_ale_entry(cpsw);
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_P0_UNI_FLOOD, 1);
dev_dbg(cpsw->dev, "Set P0_UNI_FLOOD\n");
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_PORT_NOLEARN, 0);
}
static void cpsw_init_host_port_dual_mac(struct cpsw_common *cpsw)
{
int vlan = cpsw->data.default_vlan;
writel(CPSW_FIFO_DUAL_MAC_MODE, &cpsw->host_port_regs->tx_in_ctl);
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_P0_UNI_FLOOD, 0);
dev_dbg(cpsw->dev, "unset P0_UNI_FLOOD\n");
writel(vlan, &cpsw->host_port_regs->port_vlan);
cpsw_ale_add_vlan(cpsw->ale, vlan, ALE_ALL_PORTS, ALE_ALL_PORTS, 0, 0);
/* learning make no sense in dual_mac mode */
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_PORT_NOLEARN, 1);
}
static void cpsw_init_host_port(struct cpsw_priv *priv)
{
struct cpsw_common *cpsw = priv->cpsw;
u32 control_reg;
/* soft reset the controller and initialize ale */
soft_reset("cpsw", &cpsw->regs->soft_reset);
cpsw_ale_start(cpsw->ale);
/* switch to vlan unaware mode */
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_VLAN_AWARE,
CPSW_ALE_VLAN_AWARE);
control_reg = readl(&cpsw->regs->control);
control_reg |= CPSW_VLAN_AWARE | CPSW_RX_VLAN_ENCAP;
writel(control_reg, &cpsw->regs->control);
/* setup host port priority mapping */
writel_relaxed(CPDMA_TX_PRIORITY_MAP,
&cpsw->host_port_regs->cpdma_tx_pri_map);
writel_relaxed(0, &cpsw->host_port_regs->cpdma_rx_chan_map);
/* disable priority elevation */
writel_relaxed(0, &cpsw->regs->ptype);
/* enable statistics collection only on all ports */
writel_relaxed(0x7, &cpsw->regs->stat_port_en);
/* Enable internal fifo flow control */
writel(0x7, &cpsw->regs->flow_control);
if (cpsw_is_switch_en(cpsw))
cpsw_init_host_port_switch(cpsw);
else
cpsw_init_host_port_dual_mac(cpsw);
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
ALE_PORT_STATE, ALE_PORT_STATE_FORWARD);
}
static void cpsw_port_add_dual_emac_def_ale_entries(struct cpsw_priv *priv,
struct cpsw_slave *slave)
{
u32 port_mask = 1 << priv->emac_port | ALE_PORT_HOST;
struct cpsw_common *cpsw = priv->cpsw;
u32 reg;
reg = (cpsw->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN :
CPSW2_PORT_VLAN;
slave_write(slave, slave->port_vlan, reg);
cpsw_ale_add_vlan(cpsw->ale, slave->port_vlan, port_mask,
port_mask, port_mask, 0);
cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
ALE_PORT_HOST, ALE_VLAN, slave->port_vlan,
ALE_MCAST_FWD);
cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
HOST_PORT_NUM, ALE_VLAN |
ALE_SECURE, slave->port_vlan);
cpsw_ale_control_set(cpsw->ale, priv->emac_port,
ALE_PORT_DROP_UNKNOWN_VLAN, 1);
/* learning make no sense in dual_mac mode */
cpsw_ale_control_set(cpsw->ale, priv->emac_port,
ALE_PORT_NOLEARN, 1);
}
static void cpsw_port_add_switch_def_ale_entries(struct cpsw_priv *priv,
struct cpsw_slave *slave)
{
u32 port_mask = 1 << priv->emac_port | ALE_PORT_HOST;
struct cpsw_common *cpsw = priv->cpsw;
u32 reg;
cpsw_ale_control_set(cpsw->ale, priv->emac_port,
ALE_PORT_DROP_UNKNOWN_VLAN, 0);
cpsw_ale_control_set(cpsw->ale, priv->emac_port,
ALE_PORT_NOLEARN, 0);
/* disabling SA_UPDATE required to make stp work, without this setting
* Host MAC addresses will jump between ports.
* As per TRM MAC address can be defined as unicast supervisory (super)
* by setting both (ALE_BLOCKED | ALE_SECURE) which should prevent
* SA_UPDATE, but HW seems works incorrectly and setting ALE_SECURE
* causes STP packets to be dropped due to ingress filter
* if (source address found) and (secure) and
* (receive port number != port_number))
* then discard the packet
*/
cpsw_ale_control_set(cpsw->ale, priv->emac_port,
ALE_PORT_NO_SA_UPDATE, 1);
cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
port_mask, ALE_VLAN, slave->port_vlan,
ALE_MCAST_FWD_2);
cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
HOST_PORT_NUM, ALE_VLAN, slave->port_vlan);
reg = (cpsw->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN :
CPSW2_PORT_VLAN;
slave_write(slave, slave->port_vlan, reg);
}
static void cpsw_adjust_link(struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
struct cpsw_slave *slave;
struct phy_device *phy;
u32 mac_control = 0;
slave = &cpsw->slaves[priv->emac_port - 1];
phy = slave->phy;
if (!phy)
return;
if (phy->link) {
mac_control = CPSW_SL_CTL_GMII_EN;
if (phy->speed == 1000)
mac_control |= CPSW_SL_CTL_GIG;
if (phy->duplex)
mac_control |= CPSW_SL_CTL_FULLDUPLEX;
/* set speed_in input in case RMII mode is used in 100Mbps */
if (phy->speed == 100)
mac_control |= CPSW_SL_CTL_IFCTL_A;
/* in band mode only works in 10Mbps RGMII mode */
else if ((phy->speed == 10) && phy_interface_is_rgmii(phy))
mac_control |= CPSW_SL_CTL_EXT_EN; /* In Band mode */
if (priv->rx_pause)
mac_control |= CPSW_SL_CTL_RX_FLOW_EN;
if (priv->tx_pause)
mac_control |= CPSW_SL_CTL_TX_FLOW_EN;
if (mac_control != slave->mac_control)
cpsw_sl_ctl_set(slave->mac_sl, mac_control);
/* enable forwarding */
cpsw_ale_control_set(cpsw->ale, priv->emac_port,
ALE_PORT_STATE, ALE_PORT_STATE_FORWARD);
netif_tx_wake_all_queues(ndev);
if (priv->shp_cfg_speed &&
priv->shp_cfg_speed != slave->phy->speed &&
!cpsw_shp_is_off(priv))
dev_warn(priv->dev, "Speed was changed, CBS shaper speeds are changed!");
} else {
netif_tx_stop_all_queues(ndev);
mac_control = 0;
/* disable forwarding */
cpsw_ale_control_set(cpsw->ale, priv->emac_port,
ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
cpsw_sl_wait_for_idle(slave->mac_sl, 100);
cpsw_sl_ctl_reset(slave->mac_sl);
}
if (mac_control != slave->mac_control)
phy_print_status(phy);
slave->mac_control = mac_control;
if (phy->link && cpsw_need_resplit(cpsw))
cpsw_split_res(cpsw);
}
static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
{
struct cpsw_common *cpsw = priv->cpsw;
struct phy_device *phy;
cpsw_sl_reset(slave->mac_sl, 100);
cpsw_sl_ctl_reset(slave->mac_sl);
/* setup priority mapping */
cpsw_sl_reg_write(slave->mac_sl, CPSW_SL_RX_PRI_MAP,
RX_PRIORITY_MAPPING);
switch (cpsw->version) {
case CPSW_VERSION_1:
slave_write(slave, TX_PRIORITY_MAPPING, CPSW1_TX_PRI_MAP);
/* Increase RX FIFO size to 5 for supporting fullduplex
* flow control mode
*/
slave_write(slave,
(CPSW_MAX_BLKS_TX << CPSW_MAX_BLKS_TX_SHIFT) |
CPSW_MAX_BLKS_RX, CPSW1_MAX_BLKS);
break;
case CPSW_VERSION_2:
case CPSW_VERSION_3:
case CPSW_VERSION_4:
slave_write(slave, TX_PRIORITY_MAPPING, CPSW2_TX_PRI_MAP);
/* Increase RX FIFO size to 5 for supporting fullduplex
* flow control mode
*/
slave_write(slave,
(CPSW_MAX_BLKS_TX << CPSW_MAX_BLKS_TX_SHIFT) |
CPSW_MAX_BLKS_RX, CPSW2_MAX_BLKS);
break;
}
/* setup max packet size, and mac address */
cpsw_sl_reg_write(slave->mac_sl, CPSW_SL_RX_MAXLEN,
cpsw->rx_packet_max);
cpsw_set_slave_mac(slave, priv);
slave->mac_control = 0; /* no link yet */
if (cpsw_is_switch_en(cpsw))
cpsw_port_add_switch_def_ale_entries(priv, slave);
else
cpsw_port_add_dual_emac_def_ale_entries(priv, slave);
if (!slave->data->phy_node)
dev_err(priv->dev, "no phy found on slave %d\n",
slave->slave_num);
phy = of_phy_connect(priv->ndev, slave->data->phy_node,
&cpsw_adjust_link, 0, slave->data->phy_if);
if (!phy) {
dev_err(priv->dev, "phy \"%pOF\" not found on slave %d\n",
slave->data->phy_node,
slave->slave_num);
return;
}
slave->phy = phy;
phy_attached_info(slave->phy);
phy_start(slave->phy);
/* Configure GMII_SEL register */
phy_set_mode_ext(slave->data->ifphy, PHY_MODE_ETHERNET,
slave->data->phy_if);
}
static int cpsw_ndo_stop(struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
struct cpsw_slave *slave;
cpsw_info(priv, ifdown, "shutting down ndev\n");
slave = &cpsw->slaves[priv->emac_port - 1];
if (slave->phy)
phy_stop(slave->phy);
netif_tx_stop_all_queues(priv->ndev);
if (slave->phy) {
phy_disconnect(slave->phy);
slave->phy = NULL;
}
__hw_addr_ref_unsync_dev(&ndev->mc, ndev, cpsw_purge_all_mc);
if (cpsw->usage_count <= 1) {
napi_disable(&cpsw->napi_rx);
napi_disable(&cpsw->napi_tx);
cpts_unregister(cpsw->cpts);
cpsw_intr_disable(cpsw);
cpdma_ctlr_stop(cpsw->dma);
cpsw_ale_stop(cpsw->ale);
cpsw_destroy_xdp_rxqs(cpsw);
}
if (cpsw_need_resplit(cpsw))
cpsw_split_res(cpsw);
cpsw->usage_count--;
pm_runtime_put_sync(cpsw->dev);
return 0;
}
static int cpsw_ndo_open(struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
int ret;
dev_info(priv->dev, "starting ndev. mode: %s\n",
cpsw_is_switch_en(cpsw) ? "switch" : "dual_mac");
ret = pm_runtime_get_sync(cpsw->dev);
if (ret < 0) {
pm_runtime_put_noidle(cpsw->dev);
return ret;
}
/* Notify the stack of the actual queue counts. */
ret = netif_set_real_num_tx_queues(ndev, cpsw->tx_ch_num);
if (ret) {
dev_err(priv->dev, "cannot set real number of tx queues\n");
goto pm_cleanup;
}
ret = netif_set_real_num_rx_queues(ndev, cpsw->rx_ch_num);
if (ret) {
dev_err(priv->dev, "cannot set real number of rx queues\n");
goto pm_cleanup;
}
/* Initialize host and slave ports */
if (!cpsw->usage_count)
cpsw_init_host_port(priv);
cpsw_slave_open(&cpsw->slaves[priv->emac_port - 1], priv);
/* initialize shared resources for every ndev */
if (!cpsw->usage_count) {
/* create rxqs for both infs in dual mac as they use same pool
* and must be destroyed together when no users.
*/
ret = cpsw_create_xdp_rxqs(cpsw);
if (ret < 0)
goto err_cleanup;
ret = cpsw_fill_rx_channels(priv);
if (ret < 0)
goto err_cleanup;
if (cpts_register(cpsw->cpts))
dev_err(priv->dev, "error registering cpts device\n");
napi_enable(&cpsw->napi_rx);
napi_enable(&cpsw->napi_tx);
if (cpsw->tx_irq_disabled) {
cpsw->tx_irq_disabled = false;
enable_irq(cpsw->irqs_table[1]);
}
if (cpsw->rx_irq_disabled) {
cpsw->rx_irq_disabled = false;
enable_irq(cpsw->irqs_table[0]);
}
}
cpsw_restore(priv);
/* Enable Interrupt pacing if configured */
if (cpsw->coal_intvl != 0) {
struct ethtool_coalesce coal;
coal.rx_coalesce_usecs = cpsw->coal_intvl;
cpsw_set_coalesce(ndev, &coal);
}
cpdma_ctlr_start(cpsw->dma);
cpsw_intr_enable(cpsw);
cpsw->usage_count++;
return 0;
err_cleanup:
cpsw_ndo_stop(ndev);
pm_cleanup:
pm_runtime_put_sync(cpsw->dev);
return ret;
}
static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
struct cpts *cpts = cpsw->cpts;
struct netdev_queue *txq;
struct cpdma_chan *txch;
int ret, q_idx;
if (skb_padto(skb, CPSW_MIN_PACKET_SIZE)) {
cpsw_err(priv, tx_err, "packet pad failed\n");
ndev->stats.tx_dropped++;
return NET_XMIT_DROP;
}
if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&
priv->tx_ts_enabled && cpts_can_timestamp(cpts, skb))
skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
q_idx = skb_get_queue_mapping(skb);
if (q_idx >= cpsw->tx_ch_num)
q_idx = q_idx % cpsw->tx_ch_num;
txch = cpsw->txv[q_idx].ch;
txq = netdev_get_tx_queue(ndev, q_idx);
skb_tx_timestamp(skb);
ret = cpdma_chan_submit(txch, skb, skb->data, skb->len,
priv->emac_port);
if (unlikely(ret != 0)) {
cpsw_err(priv, tx_err, "desc submit failed\n");
goto fail;
}
/* If there is no more tx desc left free then we need to
* tell the kernel to stop sending us tx frames.
*/
if (unlikely(!cpdma_check_free_tx_desc(txch))) {
netif_tx_stop_queue(txq);
/* Barrier, so that stop_queue visible to other cpus */
smp_mb__after_atomic();
if (cpdma_check_free_tx_desc(txch))
netif_tx_wake_queue(txq);
}
return NETDEV_TX_OK;
fail:
ndev->stats.tx_dropped++;
netif_tx_stop_queue(txq);
/* Barrier, so that stop_queue visible to other cpus */
smp_mb__after_atomic();
if (cpdma_check_free_tx_desc(txch))
netif_tx_wake_queue(txq);
return NETDEV_TX_BUSY;
}
static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p)
{
struct sockaddr *addr = (struct sockaddr *)p;
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
int ret, slave_no;
int flags = 0;
u16 vid = 0;
slave_no = cpsw_slave_index(cpsw, priv);
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
ret = pm_runtime_get_sync(cpsw->dev);
if (ret < 0) {
pm_runtime_put_noidle(cpsw->dev);
return ret;
}
vid = cpsw->slaves[slave_no].port_vlan;
flags = ALE_VLAN | ALE_SECURE;
cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, HOST_PORT_NUM,
flags, vid);
cpsw_ale_add_ucast(cpsw->ale, addr->sa_data, HOST_PORT_NUM,
flags, vid);
ether_addr_copy(priv->mac_addr, addr->sa_data);
ether_addr_copy(ndev->dev_addr, priv->mac_addr);
cpsw_set_slave_mac(&cpsw->slaves[slave_no], priv);
pm_runtime_put(cpsw->dev);
return 0;
}
static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev,
__be16 proto, u16 vid)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
int ret;
int i;
if (cpsw_is_switch_en(cpsw)) {
dev_dbg(cpsw->dev, "ndo del vlan is called in switch mode\n");
return 0;
}
if (vid == cpsw->data.default_vlan)
return 0;
ret = pm_runtime_get_sync(cpsw->dev);
if (ret < 0) {
pm_runtime_put_noidle(cpsw->dev);
return ret;
}
for (i = 0; i < cpsw->data.slaves; i++) {
if (cpsw->slaves[i].ndev &&
vid == cpsw->slaves[i].port_vlan)
goto err;
}
dev_dbg(priv->dev, "removing vlanid %d from vlan filter\n", vid);
cpsw_ale_del_vlan(cpsw->ale, vid, 0);
cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
HOST_PORT_NUM, ALE_VLAN, vid);
cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast,
0, ALE_VLAN, vid);
cpsw_ale_flush_multicast(cpsw->ale, 0, vid);
err:
pm_runtime_put(cpsw->dev);
return ret;
}
static int cpsw_ndo_get_phys_port_name(struct net_device *ndev, char *name,
size_t len)
{
struct cpsw_priv *priv = netdev_priv(ndev);
int err;
err = snprintf(name, len, "p%d", priv->emac_port);
if (err >= len)
return -EINVAL;
return 0;
}
#ifdef CONFIG_NET_POLL_CONTROLLER
static void cpsw_ndo_poll_controller(struct net_device *ndev)
{
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
cpsw_intr_disable(cpsw);
cpsw_rx_interrupt(cpsw->irqs_table[0], cpsw);
cpsw_tx_interrupt(cpsw->irqs_table[1], cpsw);
cpsw_intr_enable(cpsw);
}
#endif
static int cpsw_ndo_xdp_xmit(struct net_device *ndev, int n,
struct xdp_frame **frames, u32 flags)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct xdp_frame *xdpf;
int i, drops = 0;
if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK))
return -EINVAL;
for (i = 0; i < n; i++) {
xdpf = frames[i];
if (xdpf->len < CPSW_MIN_PACKET_SIZE) {
xdp_return_frame_rx_napi(xdpf);
drops++;
continue;
}
if (cpsw_xdp_tx_frame(priv, xdpf, NULL, priv->emac_port))
drops++;
}
return n - drops;
}
static int cpsw_get_port_parent_id(struct net_device *ndev,
struct netdev_phys_item_id *ppid)
{
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
ppid->id_len = sizeof(cpsw->base_mac);
memcpy(&ppid->id, &cpsw->base_mac, ppid->id_len);
return 0;
}
static const struct net_device_ops cpsw_netdev_ops = {
.ndo_open = cpsw_ndo_open,
.ndo_stop = cpsw_ndo_stop,
.ndo_start_xmit = cpsw_ndo_start_xmit,
.ndo_set_mac_address = cpsw_ndo_set_mac_address,
.ndo_do_ioctl = cpsw_ndo_ioctl,
.ndo_validate_addr = eth_validate_addr,
.ndo_tx_timeout = cpsw_ndo_tx_timeout,
.ndo_set_rx_mode = cpsw_ndo_set_rx_mode,
.ndo_set_tx_maxrate = cpsw_ndo_set_tx_maxrate,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = cpsw_ndo_poll_controller,
#endif
.ndo_vlan_rx_add_vid = cpsw_ndo_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = cpsw_ndo_vlan_rx_kill_vid,
.ndo_setup_tc = cpsw_ndo_setup_tc,
.ndo_get_phys_port_name = cpsw_ndo_get_phys_port_name,
.ndo_bpf = cpsw_ndo_bpf,
.ndo_xdp_xmit = cpsw_ndo_xdp_xmit,
.ndo_get_port_parent_id = cpsw_get_port_parent_id,
};
static void cpsw_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *info)
{
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
struct platform_device *pdev;
pdev = to_platform_device(cpsw->dev);
strlcpy(info->driver, "cpsw-switch", sizeof(info->driver));
strlcpy(info->version, "2.0", sizeof(info->version));
strlcpy(info->bus_info, pdev->name, sizeof(info->bus_info));
}
static int cpsw_set_pauseparam(struct net_device *ndev,
struct ethtool_pauseparam *pause)
{
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
struct cpsw_priv *priv = netdev_priv(ndev);
int slave_no;
slave_no = cpsw_slave_index(cpsw, priv);
if (!cpsw->slaves[slave_no].phy)
return -EINVAL;
if (!phy_validate_pause(cpsw->slaves[slave_no].phy, pause))
return -EINVAL;
priv->rx_pause = pause->rx_pause ? true : false;
priv->tx_pause = pause->tx_pause ? true : false;
phy_set_asym_pause(cpsw->slaves[slave_no].phy,
priv->rx_pause, priv->tx_pause);
return 0;
}
static int cpsw_set_channels(struct net_device *ndev,
struct ethtool_channels *chs)
{
return cpsw_set_channels_common(ndev, chs, cpsw_rx_handler);
}
static const struct ethtool_ops cpsw_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS,
.get_drvinfo = cpsw_get_drvinfo,
.get_msglevel = cpsw_get_msglevel,
.set_msglevel = cpsw_set_msglevel,
.get_link = ethtool_op_get_link,
.get_ts_info = cpsw_get_ts_info,
.get_coalesce = cpsw_get_coalesce,
.set_coalesce = cpsw_set_coalesce,
.get_sset_count = cpsw_get_sset_count,
.get_strings = cpsw_get_strings,
.get_ethtool_stats = cpsw_get_ethtool_stats,
.get_pauseparam = cpsw_get_pauseparam,
.set_pauseparam = cpsw_set_pauseparam,
.get_wol = cpsw_get_wol,
.set_wol = cpsw_set_wol,
.get_regs_len = cpsw_get_regs_len,
.get_regs = cpsw_get_regs,
.begin = cpsw_ethtool_op_begin,
.complete = cpsw_ethtool_op_complete,
.get_channels = cpsw_get_channels,
.set_channels = cpsw_set_channels,
.get_link_ksettings = cpsw_get_link_ksettings,
.set_link_ksettings = cpsw_set_link_ksettings,
.get_eee = cpsw_get_eee,
.set_eee = cpsw_set_eee,
.nway_reset = cpsw_nway_reset,
.get_ringparam = cpsw_get_ringparam,
.set_ringparam = cpsw_set_ringparam,
};
static int cpsw_probe_dt(struct cpsw_common *cpsw)
{
struct device_node *node = cpsw->dev->of_node, *tmp_node, *port_np;
struct cpsw_platform_data *data = &cpsw->data;
struct device *dev = cpsw->dev;
int ret;
u32 prop;
if (!node)
return -EINVAL;
tmp_node = of_get_child_by_name(node, "ethernet-ports");
if (!tmp_node)
return -ENOENT;
data->slaves = of_get_child_count(tmp_node);
if (data->slaves != CPSW_SLAVE_PORTS_NUM) {
of_node_put(tmp_node);
return -ENOENT;
}
data->active_slave = 0;
data->channels = CPSW_MAX_QUEUES;
data->ale_entries = CPSW_ALE_NUM_ENTRIES;
data->dual_emac = true;
data->bd_ram_size = CPSW_BD_RAM_SIZE;
data->mac_control = 0;
data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM,
sizeof(struct cpsw_slave_data),
GFP_KERNEL);
if (!data->slave_data)
return -ENOMEM;
/* Populate all the child nodes here...
*/
ret = devm_of_platform_populate(dev);
/* We do not want to force this, as in some cases may not have child */
if (ret)
dev_warn(dev, "Doesn't have any child node\n");
for_each_child_of_node(tmp_node, port_np) {
struct cpsw_slave_data *slave_data;
const void *mac_addr;
u32 port_id;
ret = of_property_read_u32(port_np, "reg", &port_id);
if (ret < 0) {
dev_err(dev, "%pOF error reading port_id %d\n",
port_np, ret);
goto err_node_put;
}
if (!port_id || port_id > CPSW_SLAVE_PORTS_NUM) {
dev_err(dev, "%pOF has invalid port_id %u\n",
port_np, port_id);
ret = -EINVAL;
goto err_node_put;
}
slave_data = &data->slave_data[port_id - 1];
slave_data->disabled = !of_device_is_available(port_np);
if (slave_data->disabled)
continue;
slave_data->slave_node = port_np;
slave_data->ifphy = devm_of_phy_get(dev, port_np, NULL);
if (IS_ERR(slave_data->ifphy)) {
ret = PTR_ERR(slave_data->ifphy);
dev_err(dev, "%pOF: Error retrieving port phy: %d\n",
port_np, ret);
goto err_node_put;
}
if (of_phy_is_fixed_link(port_np)) {
ret = of_phy_register_fixed_link(port_np);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(dev, "%pOF failed to register fixed-link phy: %d\n",
port_np, ret);
goto err_node_put;
}
slave_data->phy_node = of_node_get(port_np);
} else {
slave_data->phy_node =
of_parse_phandle(port_np, "phy-handle", 0);
}
if (!slave_data->phy_node) {
dev_err(dev, "%pOF no phy found\n", port_np);
ret = -ENODEV;
goto err_node_put;
}
ret = of_get_phy_mode(port_np, &slave_data->phy_if);
if (ret) {
dev_err(dev, "%pOF read phy-mode err %d\n",
port_np, ret);
goto err_node_put;
}
mac_addr = of_get_mac_address(port_np);
if (!IS_ERR(mac_addr)) {
ether_addr_copy(slave_data->mac_addr, mac_addr);
} else {
ret = ti_cm_get_macid(dev, port_id - 1,
slave_data->mac_addr);
if (ret)
goto err_node_put;
}
if (of_property_read_u32(port_np, "ti,dual-emac-pvid",
&prop)) {
dev_err(dev, "%pOF Missing dual_emac_res_vlan in DT.\n",
port_np);
slave_data->dual_emac_res_vlan = port_id;
dev_err(dev, "%pOF Using %d as Reserved VLAN\n",
port_np, slave_data->dual_emac_res_vlan);
} else {
slave_data->dual_emac_res_vlan = prop;
}
}
of_node_put(tmp_node);
return 0;
err_node_put:
of_node_put(port_np);
return ret;
}
static void cpsw_remove_dt(struct cpsw_common *cpsw)
{
struct cpsw_platform_data *data = &cpsw->data;
int i = 0;
for (i = 0; i < cpsw->data.slaves; i++) {
struct cpsw_slave_data *slave_data = &data->slave_data[i];
struct device_node *port_np = slave_data->phy_node;
if (port_np) {
if (of_phy_is_fixed_link(port_np))
of_phy_deregister_fixed_link(port_np);
of_node_put(port_np);
}
}
}
static int cpsw_create_ports(struct cpsw_common *cpsw)
{
struct cpsw_platform_data *data = &cpsw->data;
struct net_device *ndev, *napi_ndev = NULL;
struct device *dev = cpsw->dev;
struct cpsw_priv *priv;
int ret = 0, i = 0;
for (i = 0; i < cpsw->data.slaves; i++) {
struct cpsw_slave_data *slave_data = &data->slave_data[i];
if (slave_data->disabled)
continue;
ndev = devm_alloc_etherdev_mqs(dev, sizeof(struct cpsw_priv),
CPSW_MAX_QUEUES,
CPSW_MAX_QUEUES);
if (!ndev) {
dev_err(dev, "error allocating net_device\n");
return -ENOMEM;
}
priv = netdev_priv(ndev);
priv->cpsw = cpsw;
priv->ndev = ndev;
priv->dev = dev;
priv->msg_enable = netif_msg_init(debug_level, CPSW_DEBUG);
priv->emac_port = i + 1;
if (is_valid_ether_addr(slave_data->mac_addr)) {
ether_addr_copy(priv->mac_addr, slave_data->mac_addr);
dev_info(cpsw->dev, "Detected MACID = %pM\n",
priv->mac_addr);
} else {
eth_random_addr(slave_data->mac_addr);
dev_info(cpsw->dev, "Random MACID = %pM\n",
priv->mac_addr);
}
ether_addr_copy(ndev->dev_addr, slave_data->mac_addr);
ether_addr_copy(priv->mac_addr, slave_data->mac_addr);
cpsw->slaves[i].ndev = ndev;
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_NETNS_LOCAL;
ndev->netdev_ops = &cpsw_netdev_ops;
ndev->ethtool_ops = &cpsw_ethtool_ops;
SET_NETDEV_DEV(ndev, dev);
if (!napi_ndev) {
/* CPSW Host port CPDMA interface is shared between
* ports and there is only one TX and one RX IRQs
* available for all possible TX and RX channels
* accordingly.
*/
netif_napi_add(ndev, &cpsw->napi_rx,
cpsw->quirk_irq ?
cpsw_rx_poll : cpsw_rx_mq_poll,
CPSW_POLL_WEIGHT);
netif_tx_napi_add(ndev, &cpsw->napi_tx,
cpsw->quirk_irq ?
cpsw_tx_poll : cpsw_tx_mq_poll,
CPSW_POLL_WEIGHT);
}
napi_ndev = ndev;
}
return ret;
}
static void cpsw_unregister_ports(struct cpsw_common *cpsw)
{
int i = 0;
for (i = 0; i < cpsw->data.slaves; i++) {
if (!cpsw->slaves[i].ndev)
continue;
unregister_netdev(cpsw->slaves[i].ndev);
}
}
static int cpsw_register_ports(struct cpsw_common *cpsw)
{
int ret = 0, i = 0;
for (i = 0; i < cpsw->data.slaves; i++) {
if (!cpsw->slaves[i].ndev)
continue;
/* register the network device */
ret = register_netdev(cpsw->slaves[i].ndev);
if (ret) {
dev_err(cpsw->dev,
"cpsw: err registering net device%d\n", i);
cpsw->slaves[i].ndev = NULL;
break;
}
}
if (ret)
cpsw_unregister_ports(cpsw);
return ret;
}
bool cpsw_port_dev_check(const struct net_device *ndev)
{
if (ndev->netdev_ops == &cpsw_netdev_ops) {
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
return !cpsw->data.dual_emac;
}
return false;
}
static void cpsw_port_offload_fwd_mark_update(struct cpsw_common *cpsw)
{
int set_val = 0;
int i;
if (!cpsw->ale_bypass &&
(cpsw->br_members == (ALE_PORT_1 | ALE_PORT_2)))
set_val = 1;
dev_dbg(cpsw->dev, "set offload_fwd_mark %d\n", set_val);
for (i = 0; i < cpsw->data.slaves; i++) {
struct net_device *sl_ndev = cpsw->slaves[i].ndev;
struct cpsw_priv *priv = netdev_priv(sl_ndev);
priv->offload_fwd_mark = set_val;
}
}
static int cpsw_netdevice_port_link(struct net_device *ndev,
struct net_device *br_ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
if (!cpsw->br_members) {
cpsw->hw_bridge_dev = br_ndev;
} else {
/* This is adding the port to a second bridge, this is
* unsupported
*/
if (cpsw->hw_bridge_dev != br_ndev)
return -EOPNOTSUPP;
}
cpsw->br_members |= BIT(priv->emac_port);
cpsw_port_offload_fwd_mark_update(cpsw);
return NOTIFY_DONE;
}
static void cpsw_netdevice_port_unlink(struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
cpsw->br_members &= ~BIT(priv->emac_port);
cpsw_port_offload_fwd_mark_update(cpsw);
if (!cpsw->br_members)
cpsw->hw_bridge_dev = NULL;
}
/* netdev notifier */
static int cpsw_netdevice_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
struct netdev_notifier_changeupper_info *info;
int ret = NOTIFY_DONE;
if (!cpsw_port_dev_check(ndev))
return NOTIFY_DONE;
switch (event) {
case NETDEV_CHANGEUPPER:
info = ptr;
if (netif_is_bridge_master(info->upper_dev)) {
if (info->linking)
ret = cpsw_netdevice_port_link(ndev,
info->upper_dev);
else
cpsw_netdevice_port_unlink(ndev);
}
break;
default:
return NOTIFY_DONE;
}
return notifier_from_errno(ret);
}
static struct notifier_block cpsw_netdevice_nb __read_mostly = {
.notifier_call = cpsw_netdevice_event,
};
static int cpsw_register_notifiers(struct cpsw_common *cpsw)
{
int ret = 0;
ret = register_netdevice_notifier(&cpsw_netdevice_nb);
if (ret) {
dev_err(cpsw->dev, "can't register netdevice notifier\n");
return ret;
}
ret = cpsw_switchdev_register_notifiers(cpsw);
if (ret)
unregister_netdevice_notifier(&cpsw_netdevice_nb);
return ret;
}
static void cpsw_unregister_notifiers(struct cpsw_common *cpsw)
{
cpsw_switchdev_unregister_notifiers(cpsw);
unregister_netdevice_notifier(&cpsw_netdevice_nb);
}
static const struct devlink_ops cpsw_devlink_ops = {
};
static int cpsw_dl_switch_mode_get(struct devlink *dl, u32 id,
struct devlink_param_gset_ctx *ctx)
{
struct cpsw_devlink *dl_priv = devlink_priv(dl);
struct cpsw_common *cpsw = dl_priv->cpsw;
dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
if (id != CPSW_DL_PARAM_SWITCH_MODE)
return -EOPNOTSUPP;
ctx->val.vbool = !cpsw->data.dual_emac;
return 0;
}
static int cpsw_dl_switch_mode_set(struct devlink *dl, u32 id,
struct devlink_param_gset_ctx *ctx)
{
struct cpsw_devlink *dl_priv = devlink_priv(dl);
struct cpsw_common *cpsw = dl_priv->cpsw;
int vlan = cpsw->data.default_vlan;
bool switch_en = ctx->val.vbool;
bool if_running = false;
int i;
dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
if (id != CPSW_DL_PARAM_SWITCH_MODE)
return -EOPNOTSUPP;
if (switch_en == !cpsw->data.dual_emac)
return 0;
if (!switch_en && cpsw->br_members) {
dev_err(cpsw->dev, "Remove ports from BR before disabling switch mode\n");
return -EINVAL;
}
rtnl_lock();
for (i = 0; i < cpsw->data.slaves; i++) {
struct cpsw_slave *slave = &cpsw->slaves[i];
struct net_device *sl_ndev = slave->ndev;
if (!sl_ndev || !netif_running(sl_ndev))
continue;
if_running = true;
}
if (!if_running) {
/* all ndevs are down */
cpsw->data.dual_emac = !switch_en;
for (i = 0; i < cpsw->data.slaves; i++) {
struct cpsw_slave *slave = &cpsw->slaves[i];
struct net_device *sl_ndev = slave->ndev;
struct cpsw_priv *priv;
if (!sl_ndev)
continue;
priv = netdev_priv(sl_ndev);
if (switch_en)
vlan = cpsw->data.default_vlan;
else
vlan = slave->data->dual_emac_res_vlan;
slave->port_vlan = vlan;
}
goto exit;
}
if (switch_en) {
dev_info(cpsw->dev, "Enable switch mode\n");
/* enable bypass - no forwarding; all traffic goes to Host */
cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 1);
/* clean up ALE table */
cpsw_ale_control_set(cpsw->ale, 0, ALE_CLEAR, 1);
cpsw_ale_control_get(cpsw->ale, 0, ALE_AGEOUT);
cpsw_init_host_port_switch(cpsw);
for (i = 0; i < cpsw->data.slaves; i++) {
struct cpsw_slave *slave = &cpsw->slaves[i];
struct net_device *sl_ndev = slave->ndev;
struct cpsw_priv *priv;
if (!sl_ndev)
continue;
priv = netdev_priv(sl_ndev);
slave->port_vlan = vlan;
if (netif_running(sl_ndev))
cpsw_port_add_switch_def_ale_entries(priv,
slave);
}
cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 0);
cpsw->data.dual_emac = false;
} else {
dev_info(cpsw->dev, "Disable switch mode\n");
/* enable bypass - no forwarding; all traffic goes to Host */
cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 1);
cpsw_ale_control_set(cpsw->ale, 0, ALE_CLEAR, 1);
cpsw_ale_control_get(cpsw->ale, 0, ALE_AGEOUT);
cpsw_init_host_port_dual_mac(cpsw);
for (i = 0; i < cpsw->data.slaves; i++) {
struct cpsw_slave *slave = &cpsw->slaves[i];
struct net_device *sl_ndev = slave->ndev;
struct cpsw_priv *priv;
if (!sl_ndev)
continue;
priv = netdev_priv(slave->ndev);
slave->port_vlan = slave->data->dual_emac_res_vlan;
cpsw_port_add_dual_emac_def_ale_entries(priv, slave);
}
cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 0);
cpsw->data.dual_emac = true;
}
exit:
rtnl_unlock();
return 0;
}
static int cpsw_dl_ale_ctrl_get(struct devlink *dl, u32 id,
struct devlink_param_gset_ctx *ctx)
{
struct cpsw_devlink *dl_priv = devlink_priv(dl);
struct cpsw_common *cpsw = dl_priv->cpsw;
dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
switch (id) {
case CPSW_DL_PARAM_ALE_BYPASS:
ctx->val.vbool = cpsw_ale_control_get(cpsw->ale, 0, ALE_BYPASS);
break;
default:
return -EOPNOTSUPP;
}
return 0;
}
static int cpsw_dl_ale_ctrl_set(struct devlink *dl, u32 id,
struct devlink_param_gset_ctx *ctx)
{
struct cpsw_devlink *dl_priv = devlink_priv(dl);
struct cpsw_common *cpsw = dl_priv->cpsw;
int ret = -EOPNOTSUPP;
dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
switch (id) {
case CPSW_DL_PARAM_ALE_BYPASS:
ret = cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS,
ctx->val.vbool);
if (!ret) {
cpsw->ale_bypass = ctx->val.vbool;
cpsw_port_offload_fwd_mark_update(cpsw);
}
break;
default:
return -EOPNOTSUPP;
}
return 0;
}
static const struct devlink_param cpsw_devlink_params[] = {
DEVLINK_PARAM_DRIVER(CPSW_DL_PARAM_SWITCH_MODE,
"switch_mode", DEVLINK_PARAM_TYPE_BOOL,
BIT(DEVLINK_PARAM_CMODE_RUNTIME),
cpsw_dl_switch_mode_get, cpsw_dl_switch_mode_set,
NULL),
DEVLINK_PARAM_DRIVER(CPSW_DL_PARAM_ALE_BYPASS,
"ale_bypass", DEVLINK_PARAM_TYPE_BOOL,
BIT(DEVLINK_PARAM_CMODE_RUNTIME),
cpsw_dl_ale_ctrl_get, cpsw_dl_ale_ctrl_set, NULL),
};
static int cpsw_register_devlink(struct cpsw_common *cpsw)
{
struct device *dev = cpsw->dev;
struct cpsw_devlink *dl_priv;
int ret = 0;
cpsw->devlink = devlink_alloc(&cpsw_devlink_ops, sizeof(*dl_priv));
if (!cpsw->devlink)
return -ENOMEM;
dl_priv = devlink_priv(cpsw->devlink);
dl_priv->cpsw = cpsw;
ret = devlink_register(cpsw->devlink, dev);
if (ret) {
dev_err(dev, "DL reg fail ret:%d\n", ret);
goto dl_free;
}
ret = devlink_params_register(cpsw->devlink, cpsw_devlink_params,
ARRAY_SIZE(cpsw_devlink_params));
if (ret) {
dev_err(dev, "DL params reg fail ret:%d\n", ret);
goto dl_unreg;
}
devlink_params_publish(cpsw->devlink);
return ret;
dl_unreg:
devlink_unregister(cpsw->devlink);
dl_free:
devlink_free(cpsw->devlink);
return ret;
}
static void cpsw_unregister_devlink(struct cpsw_common *cpsw)
{
devlink_params_unpublish(cpsw->devlink);
devlink_params_unregister(cpsw->devlink, cpsw_devlink_params,
ARRAY_SIZE(cpsw_devlink_params));
devlink_unregister(cpsw->devlink);
devlink_free(cpsw->devlink);
}
static const struct of_device_id cpsw_of_mtable[] = {
{ .compatible = "ti,cpsw-switch"},
{ .compatible = "ti,am335x-cpsw-switch"},
{ .compatible = "ti,am4372-cpsw-switch"},
{ .compatible = "ti,dra7-cpsw-switch"},
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, cpsw_of_mtable);
static const struct soc_device_attribute cpsw_soc_devices[] = {
{ .family = "AM33xx", .revision = "ES1.0"},
{ /* sentinel */ }
};
static int cpsw_probe(struct platform_device *pdev)
{
const struct soc_device_attribute *soc;
struct device *dev = &pdev->dev;
struct cpsw_common *cpsw;
struct resource *ss_res;
struct gpio_descs *mode;
void __iomem *ss_regs;
int ret = 0, ch;
struct clk *clk;
int irq;
cpsw = devm_kzalloc(dev, sizeof(struct cpsw_common), GFP_KERNEL);
if (!cpsw)
return -ENOMEM;
cpsw_slave_index = cpsw_slave_index_priv;
cpsw->dev = dev;
cpsw->slaves = devm_kcalloc(dev,
CPSW_SLAVE_PORTS_NUM,
sizeof(struct cpsw_slave),
GFP_KERNEL);
if (!cpsw->slaves)
return -ENOMEM;
mode = devm_gpiod_get_array_optional(dev, "mode", GPIOD_OUT_LOW);
if (IS_ERR(mode)) {
ret = PTR_ERR(mode);
dev_err(dev, "gpio request failed, ret %d\n", ret);
return ret;
}
clk = devm_clk_get(dev, "fck");
if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
dev_err(dev, "fck is not found %d\n", ret);
return ret;
}
cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000;
ss_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ss_regs = devm_ioremap_resource(dev, ss_res);
if (IS_ERR(ss_regs)) {
ret = PTR_ERR(ss_regs);
return ret;
}
cpsw->regs = ss_regs;
irq = platform_get_irq_byname(pdev, "rx");
if (irq < 0)
return irq;
cpsw->irqs_table[0] = irq;
irq = platform_get_irq_byname(pdev, "tx");
if (irq < 0)
return irq;
cpsw->irqs_table[1] = irq;
irq = platform_get_irq_byname(pdev, "misc");
if (irq <= 0)
return irq;
cpsw->misc_irq = irq;
platform_set_drvdata(pdev, cpsw);
/* This may be required here for child devices. */
pm_runtime_enable(dev);
/* Need to enable clocks with runtime PM api to access module
* registers
*/
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
pm_runtime_put_noidle(dev);
pm_runtime_disable(dev);
return ret;
}
ret = cpsw_probe_dt(cpsw);
if (ret)
goto clean_dt_ret;
soc = soc_device_match(cpsw_soc_devices);
if (soc)
cpsw->quirk_irq = true;
cpsw->rx_packet_max = rx_packet_max;
cpsw->descs_pool_size = descs_pool_size;
eth_random_addr(cpsw->base_mac);
ret = cpsw_init_common(cpsw, ss_regs, ale_ageout,
(u32 __force)ss_res->start + CPSW2_BD_OFFSET,
descs_pool_size);
if (ret)
goto clean_dt_ret;
cpsw->wr_regs = cpsw->version == CPSW_VERSION_1 ?
ss_regs + CPSW1_WR_OFFSET :
ss_regs + CPSW2_WR_OFFSET;
ch = cpsw->quirk_irq ? 0 : 7;
cpsw->txv[0].ch = cpdma_chan_create(cpsw->dma, ch, cpsw_tx_handler, 0);
if (IS_ERR(cpsw->txv[0].ch)) {
dev_err(dev, "error initializing tx dma channel\n");
ret = PTR_ERR(cpsw->txv[0].ch);
goto clean_cpts;
}
cpsw->rxv[0].ch = cpdma_chan_create(cpsw->dma, 0, cpsw_rx_handler, 1);
if (IS_ERR(cpsw->rxv[0].ch)) {
dev_err(dev, "error initializing rx dma channel\n");
ret = PTR_ERR(cpsw->rxv[0].ch);
goto clean_cpts;
}
cpsw_split_res(cpsw);
/* setup netdevs */
ret = cpsw_create_ports(cpsw);
if (ret)
goto clean_unregister_netdev;
/* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and
* MISC IRQs which are always kept disabled with this driver so
* we will not request them.
*
* If anyone wants to implement support for those, make sure to
* first request and append them to irqs_table array.
*/
ret = devm_request_irq(dev, cpsw->irqs_table[0], cpsw_rx_interrupt,
0, dev_name(dev), cpsw);
if (ret < 0) {
dev_err(dev, "error attaching irq (%d)\n", ret);
goto clean_unregister_netdev;
}
ret = devm_request_irq(dev, cpsw->irqs_table[1], cpsw_tx_interrupt,
0, dev_name(dev), cpsw);
if (ret < 0) {
dev_err(dev, "error attaching irq (%d)\n", ret);
goto clean_unregister_netdev;
}
if (!cpsw->cpts)
goto skip_cpts;
ret = devm_request_irq(dev, cpsw->misc_irq, cpsw_misc_interrupt,
0, dev_name(&pdev->dev), cpsw);
if (ret < 0) {
dev_err(dev, "error attaching misc irq (%d)\n", ret);
goto clean_unregister_netdev;
}
/* Enable misc CPTS evnt_pend IRQ */
cpts_set_irqpoll(cpsw->cpts, false);
writel(0x10, &cpsw->wr_regs->misc_en);
skip_cpts:
ret = cpsw_register_notifiers(cpsw);
if (ret)
goto clean_unregister_netdev;
ret = cpsw_register_devlink(cpsw);
if (ret)
goto clean_unregister_notifiers;
ret = cpsw_register_ports(cpsw);
if (ret)
goto clean_unregister_notifiers;
dev_notice(dev, "initialized (regs %pa, pool size %d) hw_ver:%08X %d.%d (%d)\n",
&ss_res->start, descs_pool_size,
cpsw->version, CPSW_MAJOR_VERSION(cpsw->version),
CPSW_MINOR_VERSION(cpsw->version),
CPSW_RTL_VERSION(cpsw->version));
pm_runtime_put(dev);
return 0;
clean_unregister_notifiers:
cpsw_unregister_notifiers(cpsw);
clean_unregister_netdev:
cpsw_unregister_ports(cpsw);
clean_cpts:
cpts_release(cpsw->cpts);
cpdma_ctlr_destroy(cpsw->dma);
clean_dt_ret:
cpsw_remove_dt(cpsw);
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
return ret;
}
static int cpsw_remove(struct platform_device *pdev)
{
struct cpsw_common *cpsw = platform_get_drvdata(pdev);
int ret;
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) {
pm_runtime_put_noidle(&pdev->dev);
return ret;
}
cpsw_unregister_notifiers(cpsw);
cpsw_unregister_devlink(cpsw);
cpsw_unregister_ports(cpsw);
cpts_release(cpsw->cpts);
cpdma_ctlr_destroy(cpsw->dma);
cpsw_remove_dt(cpsw);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0;
}
static struct platform_driver cpsw_driver = {
.driver = {
.name = "cpsw-switch",
.of_match_table = cpsw_of_mtable,
},
.probe = cpsw_probe,
.remove = cpsw_remove,
};
module_platform_driver(cpsw_driver);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("TI CPSW switchdev Ethernet driver");
|
264831.c | #include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-features.h>
#include <sys/types.h>
#include <net-snmp/library/snmpUnixDomain.h>
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#if HAVE_STRING_H
#include <string.h>
#else
#include <strings.h>
#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <net-snmp/types.h>
#include <net-snmp/output_api.h>
#include <net-snmp/config_api.h>
#include <net-snmp/library/snmp_transport.h>
#include <net-snmp/library/snmpSocketBaseDomain.h>
#include <net-snmp/library/system.h> /* mkdirhier */
#include <net-snmp/library/tools.h>
#ifndef NETSNMP_NO_SYSTEMD
#include <net-snmp/library/sd-daemon.h>
#endif
netsnmp_feature_child_of(transport_unix_socket_all, transport_all);
netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all);
#ifndef NETSNMP_STREAM_QUEUE_LEN
#define NETSNMP_STREAM_QUEUE_LEN 5
#endif
#ifndef SUN_LEN
/*
* Evaluate to actual length of the `sockaddr_un' structure.
*/
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ strlen ((ptr)->sun_path))
#endif
oid netsnmp_UnixDomain[] = { TRANSPORT_DOMAIN_LOCAL };
static netsnmp_tdomain unixDomain;
/*
* This is the structure we use to hold transport-specific data.
*/
typedef struct _sockaddr_un_pair {
int local;
struct sockaddr_un server;
struct sockaddr_un client;
} sockaddr_un_pair;
/*
* Return a string representing the address in data, or else the "far end"
* address if data is NULL.
*/
static char *
netsnmp_unix_fmtaddr(netsnmp_transport *t, const void *data, int len)
{
const struct sockaddr_un *to = NULL;
if (data != NULL)
to = (const struct sockaddr_un *) data;
else if (t != NULL && t->data != NULL)
to = &(((const sockaddr_un_pair *) t->data)->server);
if (to == NULL) {
/*
* "Local IPC" is the Posix.1g term for Unix domain protocols,
* according to W. R. Stevens, ``Unix Network Programming Volume I
* Second Edition'', p. 374.
*/
return strdup("Local IPC: unknown");
} else if (to->sun_path[0] == 0) {
/*
* This is an abstract name. We could render it as hex or something
* but let's not worry about that for now.
*/
return strdup("Local IPC: abstract");
} else {
char *tmp;
if (asprintf(&tmp, "Local IPC: %s", to->sun_path) < 0)
tmp = NULL;
return tmp;
}
}
static void
netsnmp_unix_get_taddr(netsnmp_transport *t, void **addr, size_t *addr_len)
{
*addr_len = t->remote_length;
*addr = netsnmp_memdup(t->remote, *addr_len);
}
/*
* You can write something into opaque that will subsequently get passed back
* to your send function if you like. For instance, you might want to
* remember where a PDU came from, so that you can send a reply there...
*/
static int
netsnmp_unix_recv(netsnmp_transport *t, void *buf, int size,
void **opaque, int *olength)
{
int rc = -1;
socklen_t tolen = sizeof(struct sockaddr_un);
struct sockaddr *to;
if (t != NULL && t->sock >= 0) {
to = (struct sockaddr *) malloc(sizeof(struct sockaddr_un));
if (to == NULL) {
*opaque = NULL;
*olength = 0;
return -1;
} else {
memset(to, 0, tolen);
}
if(getsockname(t->sock, to, &tolen) != 0){
free(to);
*opaque = NULL;
*olength = 0;
return -1;
};
while (rc < 0) {
#ifdef MSG_DONTWAIT
rc = recvfrom(t->sock, buf, size, MSG_DONTWAIT, NULL, NULL);
#else
rc = recvfrom(t->sock, buf, size, 0, NULL, NULL);
#endif
if (rc < 0 && errno != EINTR) {
DEBUGMSGTL(("netsnmp_unix", "recv fd %d err %d (\"%s\")\n",
t->sock, errno, strerror(errno)));
return rc;
}
*opaque = (void*)to;
*olength = sizeof(struct sockaddr_un);
}
DEBUGMSGTL(("netsnmp_unix", "recv fd %d got %d bytes\n", t->sock, rc));
}
return rc;
}
static int
netsnmp_unix_send(netsnmp_transport *t, const void *buf, int size,
void **opaque, int *olength)
{
int rc = -1;
if (t != NULL && t->sock >= 0) {
DEBUGMSGTL(("netsnmp_unix", "send %d bytes to %p on fd %d\n",
size, buf, t->sock));
while (rc < 0) {
rc = sendto(t->sock, buf, size, 0, NULL, 0);
if (rc < 0 && errno != EINTR) {
break;
}
}
}
return rc;
}
static int
netsnmp_unix_close(netsnmp_transport *t)
{
int rc = 0;
sockaddr_un_pair *sup = (sockaddr_un_pair *) t->data;
if (t->sock >= 0) {
#ifndef HAVE_CLOSESOCKET
rc = close(t->sock);
#else
rc = closesocket(t->sock);
#endif
t->sock = -1;
if (sup != NULL) {
if (sup->local) {
if (sup->server.sun_path[0] != 0) {
DEBUGMSGTL(("netsnmp_unix", "close: server unlink(\"%s\")\n",
sup->server.sun_path));
unlink(sup->server.sun_path);
}
} else {
if (sup->client.sun_path[0] != 0) {
DEBUGMSGTL(("netsnmp_unix", "close: client unlink(\"%s\")\n",
sup->client.sun_path));
unlink(sup->client.sun_path);
}
}
}
return rc;
} else {
return -1;
}
}
static int
netsnmp_unix_accept(netsnmp_transport *t)
{
struct sockaddr *farend = NULL;
int newsock = -1;
socklen_t farendlen = sizeof(struct sockaddr_un);
farend = (struct sockaddr *) malloc(farendlen);
if (farend == NULL) {
/*
* Indicate that the acceptance of this socket failed.
*/
DEBUGMSGTL(("netsnmp_unix", "accept: malloc failed\n"));
return -1;
}
memset(farend, 0, farendlen);
if (t != NULL && t->sock >= 0) {
newsock = accept(t->sock, farend, &farendlen);
if (newsock < 0) {
DEBUGMSGTL(("netsnmp_unix","accept failed rc %d errno %d \"%s\"\n",
newsock, errno, strerror(errno)));
free(farend);
return newsock;
}
if (t->data != NULL) {
free(t->data);
}
DEBUGMSGTL(("netsnmp_unix", "accept succeeded (farend %p len %d)\n",
farend, (int) farendlen));
t->data = farend;
t->data_length = sizeof(struct sockaddr_un);
netsnmp_sock_buffer_set(newsock, SO_SNDBUF, 1, 0);
netsnmp_sock_buffer_set(newsock, SO_RCVBUF, 1, 0);
return newsock;
} else {
free(farend);
return -1;
}
}
static int create_path = 0;
static mode_t create_mode;
#ifndef NETSNMP_FEATURE_REMOVE_UNIX_SOCKET_PATHS
/** If trying to create unix sockets in nonexisting directories then
* try to create the directory with mask mode.
*/
void netsnmp_unix_create_path_with_mode(int mode)
{
create_path = 1;
create_mode = mode;
}
/** If trying to create unix sockets in nonexisting directories then
* fail.
*/
void netsnmp_unix_dont_create_path(void)
{
create_path = 0;
}
#endif /* NETSNMP_FEATURE_REMOVE_UNIX_SOCKET_PATHS */
/*
* Open a Unix-domain transport for SNMP. Local is TRUE if addr is the local
* address to bind to (i.e. this is a server-type session); otherwise addr is
* the remote address to send things to (and we make up a temporary name for
* the local end of the connection).
*/
netsnmp_transport *
netsnmp_unix_transport(const struct sockaddr_un *addr, int local)
{
netsnmp_transport *t = NULL;
sockaddr_un_pair *sup = NULL;
int rc = 0;
int socket_initialized = 0;
#ifdef NETSNMP_NO_LISTEN_SUPPORT
/* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate,
so we allow for unix domain socktes to still listen when everything
else isn't allowed to. Thus, we ignore this define in this file.
*/
#endif /* NETSNMP_NO_LISTEN_SUPPORT */
if (addr == NULL || addr->sun_family != AF_UNIX) {
return NULL;
}
t = SNMP_MALLOC_TYPEDEF(netsnmp_transport);
if (t == NULL) {
return NULL;
}
DEBUGIF("netsnmp_unix") {
char *str = netsnmp_unix_fmtaddr(NULL, addr,
sizeof(struct sockaddr_un));
DEBUGMSGTL(("netsnmp_unix", "open %s %s\n", local ? "local" : "remote",
str));
free(str);
}
t->domain = netsnmp_UnixDomain;
t->domain_length =
sizeof(netsnmp_UnixDomain) / sizeof(netsnmp_UnixDomain[0]);
t->data = malloc(sizeof(sockaddr_un_pair));
if (t->data == NULL) {
netsnmp_transport_free(t);
return NULL;
}
memset(t->data, 0, sizeof(sockaddr_un_pair));
t->data_length = sizeof(sockaddr_un_pair);
sup = (sockaddr_un_pair *) t->data;
#ifndef NETSNMP_NO_SYSTEMD
/*
* Maybe the socket was already provided by systemd...
*/
if (local) {
t->sock = netsnmp_sd_find_unix_socket(SOCK_STREAM, 1, addr->sun_path);
if (t->sock >= 0)
socket_initialized = 1;
}
#endif
if (!socket_initialized)
t->sock = socket(PF_UNIX, SOCK_STREAM, 0);
if (t->sock < 0) {
netsnmp_transport_free(t);
return NULL;
}
t->flags = NETSNMP_TRANSPORT_FLAG_STREAM;
if (local) {
t->local_length = strlen(addr->sun_path);
t->local = strdup(addr->sun_path);
if (t->local == NULL) {
netsnmp_transport_free(t);
return NULL;
}
/*
* This session is inteneded as a server, so we must bind to the given
* path (unlinking it first, to avoid errors).
*/
t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
if (!socket_initialized) {
unlink(addr->sun_path);
rc = bind(t->sock, (const struct sockaddr *)addr, SUN_LEN(addr));
if (rc != 0 && errno == ENOENT && create_path) {
rc = mkdirhier(addr->sun_path, create_mode, 1);
if (rc != 0) {
netsnmp_unix_close(t);
netsnmp_transport_free(t);
return NULL;
}
rc = bind(t->sock, (const struct sockaddr *)addr,
SUN_LEN(addr));
}
if (rc != 0) {
DEBUGMSGTL(("netsnmp_unix_transport",
"couldn't bind \"%s\", errno %d (%s)\n",
addr->sun_path, errno, strerror(errno)));
netsnmp_unix_close(t);
netsnmp_transport_free(t);
return NULL;
}
}
/*
* Save the address in the transport-specific data pointer for later
* use by netsnmp_unix_close.
*/
sup->server.sun_family = AF_UNIX;
strcpy(sup->server.sun_path, addr->sun_path);
sup->local = 1;
/*
* Now sit here and listen for connections to arrive.
*/
if (!socket_initialized) {
rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
if (rc != 0) {
DEBUGMSGTL(("netsnmp_unix_transport",
"couldn't listen to \"%s\", errno %d (%s)\n",
addr->sun_path, errno, strerror(errno)));
netsnmp_unix_close(t);
netsnmp_transport_free(t);
return NULL;
}
}
} else {
t->remote_length = strlen(addr->sun_path);
t->remote = strdup(addr->sun_path);
if (t->remote == NULL) {
netsnmp_transport_free(t);
return NULL;
}
rc = connect(t->sock, (const struct sockaddr *)addr,
sizeof(struct sockaddr_un));
if (rc != 0) {
DEBUGMSGTL(("netsnmp_unix_transport",
"couldn't connect to \"%s\", errno %d (%s)\n",
addr->sun_path, errno, strerror(errno)));
netsnmp_unix_close(t);
netsnmp_transport_free(t);
return NULL;
}
/*
* Save the remote address in the transport-specific data pointer for
* later use by netsnmp_unix_send.
*/
sup->server.sun_family = AF_UNIX;
strcpy(sup->server.sun_path, addr->sun_path);
sup->local = 0;
netsnmp_sock_buffer_set(t->sock, SO_SNDBUF, local, 0);
netsnmp_sock_buffer_set(t->sock, SO_RCVBUF, local, 0);
}
/*
* Message size is not limited by this transport (hence msgMaxSize
* is equal to the maximum legal size of an SNMP message).
*/
t->msgMaxSize = SNMP_MAX_PACKET_LEN;
t->f_recv = netsnmp_unix_recv;
t->f_send = netsnmp_unix_send;
t->f_close = netsnmp_unix_close;
t->f_accept = netsnmp_unix_accept;
t->f_fmtaddr = netsnmp_unix_fmtaddr;
t->f_get_taddr = netsnmp_unix_get_taddr;
return t;
}
netsnmp_transport *
netsnmp_unix_create_tstring(const char *string, int local,
const char *default_target)
{
struct sockaddr_un addr;
if (string && *string != '\0') {
} else if (default_target && *default_target != '\0') {
string = default_target;
}
if ((string != NULL && *string != '\0') &&
(strlen(string) < sizeof(addr.sun_path))) {
addr.sun_family = AF_UNIX;
memset(addr.sun_path, 0, sizeof(addr.sun_path));
strlcpy(addr.sun_path, string, sizeof(addr.sun_path));
return netsnmp_unix_transport(&addr, local);
} else {
if (string != NULL && *string != '\0') {
snmp_log(LOG_ERR, "Path too long for Unix domain transport\n");
}
return NULL;
}
}
netsnmp_transport *
netsnmp_unix_create_ostring(const void *ostring, size_t o_len, int local)
{
struct sockaddr_un addr;
if (o_len > 0 && o_len < (sizeof(addr.sun_path) - 1)) {
addr.sun_family = AF_UNIX;
memset(addr.sun_path, 0, sizeof(addr.sun_path));
strlcpy(addr.sun_path, ostring, sizeof(addr.sun_path));
return netsnmp_unix_transport(&addr, local);
} else {
if (o_len > 0) {
snmp_log(LOG_ERR, "Path too long for Unix domain transport\n");
}
}
return NULL;
}
void
netsnmp_unix_ctor(void)
{
unixDomain.name = netsnmp_UnixDomain;
unixDomain.name_length = sizeof(netsnmp_UnixDomain) / sizeof(oid);
unixDomain.prefix = (const char**)calloc(2, sizeof(char *));
unixDomain.prefix[0] = "unix";
unixDomain.f_create_from_tstring_new = netsnmp_unix_create_tstring;
unixDomain.f_create_from_ostring = netsnmp_unix_create_ostring;
netsnmp_tdomain_register(&unixDomain);
}
#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
/* support for SNMPv1 and SNMPv2c on unix domain*/
#define EXAMPLE_COMMUNITY "COMMUNITY"
typedef struct com2SecUnixEntry_s {
const char* sockpath;
const char* secName;
const char* contextName;
struct com2SecUnixEntry_s *next;
unsigned short pathlen;
const char community[1];
} com2SecUnixEntry;
static com2SecUnixEntry *com2SecUnixList = NULL, *com2SecUnixListLast = NULL;
int
netsnmp_unix_getSecName(void *opaque, int olength,
const char *community,
size_t community_len,
const char **secName, const char **contextName)
{
const com2SecUnixEntry *c;
struct sockaddr_un *to = (struct sockaddr_un *) opaque;
char *ztcommunity = NULL;
if (secName != NULL) {
*secName = NULL; /* Haven't found anything yet */
}
/*
* Special case if there are NO entries (as opposed to no MATCHING
* entries).
*/
if (com2SecUnixList == NULL) {
DEBUGMSGTL(("netsnmp_unix_getSecName", "no com2sec entries\n"));
return 0;
}
/*
* If there is no unix socket path, then there can be no valid security
* name.
*/
if (opaque == NULL || olength != sizeof(struct sockaddr_un) ||
to->sun_family != AF_UNIX) {
DEBUGMSGTL(("netsnmp_unix_getSecName",
"no unix destine address in PDU?\n"));
return 1;
}
DEBUGIF("netsnmp_unix_getSecName") {
ztcommunity = (char *)malloc(community_len + 1);
if (ztcommunity != NULL) {
memcpy(ztcommunity, community, community_len);
ztcommunity[community_len] = '\0';
}
DEBUGMSGTL(("netsnmp_unix_getSecName", "resolve <\"%s\">\n",
ztcommunity ? ztcommunity : "<malloc error>"));
}
for (c = com2SecUnixList; c != NULL; c = c->next) {
DEBUGMSGTL(("netsnmp_unix_getSecName","compare <\"%s\",to socket %s>",
c->community, c->sockpath ));
if ((community_len == strlen(c->community)) &&
(memcmp(community, c->community, community_len) == 0) &&
/* compare sockpath, if pathlen == 0, always match */
(strlen(to->sun_path) == c->pathlen || c->pathlen == 0) &&
(memcmp(to->sun_path, c->sockpath, c->pathlen) == 0)
) {
DEBUGMSG(("netsnmp_unix_getSecName", "... SUCCESS\n"));
if (secName != NULL) {
*secName = c->secName;
*contextName = c->contextName;
}
break;
}
DEBUGMSG(("netsnmp_unix_getSecName", "... nope\n"));
}
if (ztcommunity != NULL) {
free(ztcommunity);
}
return 1;
}
void
netsnmp_unix_parse_security(const char *token, char *param)
{
char secName[VACMSTRINGLEN + 1];
size_t secNameLen;
char contextName[VACMSTRINGLEN + 1];
size_t contextNameLen;
char community[COMMUNITY_MAX_LEN + 1];
size_t communityLen;
char sockpath[sizeof(((struct sockaddr_un*)0)->sun_path) + 1];
size_t sockpathLen;
param = copy_nword( param, secName, sizeof(secName));
if (strcmp(secName, "-Cn") == 0) {
if (!param) {
config_perror("missing CONTEXT_NAME parameter");
return;
}
param = copy_nword( param, contextName, sizeof(contextName));
contextNameLen = strlen(contextName) + 1;
if (contextNameLen > VACMSTRINGLEN) {
config_perror("context name too long");
return;
}
if (!param) {
config_perror("missing NAME parameter");
return;
}
param = copy_nword( param, secName, sizeof(secName));
} else {
contextNameLen = 0;
}
secNameLen = strlen(secName) + 1;
if (secNameLen == 1) {
config_perror("empty NAME parameter");
return;
} else if (secNameLen > VACMSTRINGLEN) {
config_perror("security name too long");
return;
}
if (!param) {
config_perror("missing SOCKPATH parameter");
return;
}
param = copy_nword( param, sockpath, sizeof(sockpath));
if (sockpath[0] == '\0') {
config_perror("empty SOCKPATH parameter");
return;
}
sockpathLen = strlen(sockpath) + 1;
if (sockpathLen > sizeof(((struct sockaddr_un*)0)->sun_path)) {
config_perror("sockpath too long");
return;
}
if (!param) {
config_perror("missing COMMUNITY parameter");
return;
}
param = copy_nword( param, community, sizeof(community));
if (community[0] == '\0') {
config_perror("empty COMMUNITY parameter");
return;
}
communityLen = strlen(community) + 1;
if (communityLen >= COMMUNITY_MAX_LEN) {
config_perror("community name too long");
return;
}
if (communityLen == sizeof(EXAMPLE_COMMUNITY) &&
memcmp(community, EXAMPLE_COMMUNITY, sizeof(EXAMPLE_COMMUNITY)) == 0) {
config_perror("example config COMMUNITY not properly configured");
return;
}
/* Deal with the "default" case */
if(strcmp(sockpath, "default") == 0) {
sockpathLen = 0;
}
{
void* v = malloc(offsetof(com2SecUnixEntry, community) + communityLen +
sockpathLen + secNameLen + contextNameLen);
com2SecUnixEntry* e = (com2SecUnixEntry*)v;
char* last = ((char*)v) + offsetof(com2SecUnixEntry, community);
if (e == NULL) {
config_perror("memory error");
return;
}
DEBUGMSGTL(("netsnmp_unix_parse_security",
"<\"%s\", \"%.*s\"> => \"%s\"\n",
community, (int)sockpathLen, sockpath, secName));
memcpy(last, community, communityLen);
last += communityLen;
if (sockpathLen) {
e->sockpath = last;
memcpy(last, sockpath, sockpathLen);
last += sockpathLen;
e->pathlen = sockpathLen - 1;
} else {
e->sockpath = last - 1;
e->pathlen = 0;
}
e->secName = last;
memcpy(last, secName, secNameLen);
last += secNameLen;
if (contextNameLen) {
e->contextName = last;
memcpy(last, contextName, contextNameLen);
last += contextNameLen;
} else
e->contextName = last - 1;
e->next = NULL;
if (com2SecUnixListLast != NULL) {
com2SecUnixListLast->next = e;
com2SecUnixListLast = e;
} else {
com2SecUnixListLast = com2SecUnixList = e;
}
}
}
void
netsnmp_unix_com2SecList_free(void)
{
com2SecUnixEntry *e = com2SecUnixList;
while (e != NULL) {
com2SecUnixEntry *tmp = e;
e = e->next;
free(tmp);
}
com2SecUnixList = com2SecUnixListLast = NULL;
}
#endif /* support for community based SNMP */
void
netsnmp_unix_agent_config_tokens_register(void)
{
#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
register_app_config_handler("com2secunix", netsnmp_unix_parse_security,
netsnmp_unix_com2SecList_free,
"[-Cn CONTEXT] secName sockpath community");
#endif /* support for community based SNMP */
}
|
876446.c | /*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include "internal/cryptlib.h"
#include "internal/refcount.h"
#include <openssl/bn.h>
#include "dsa_locl.h"
#include <openssl/asn1.h>
#include <openssl/engine.h>
#include <openssl/dh.h>
DSA *DSA_new(void)
{
return DSA_new_method(NULL);
}
int DSA_set_method(DSA *dsa, const DSA_METHOD *meth)
{
/*
* NB: The caller is specifically setting a method, so it's not up to us
* to deal with which ENGINE it comes from.
*/
const DSA_METHOD *mtmp;
mtmp = dsa->meth;
if (mtmp->finish)
mtmp->finish(dsa);
#ifndef OPENSSL_NO_ENGINE
ENGINE_finish(dsa->engine);
dsa->engine = NULL;
#endif
dsa->meth = meth;
if (meth->init)
meth->init(dsa);
return 1;
}
const DSA_METHOD *DSA_get_method(DSA *d)
{
return d->meth;
}
DSA *DSA_new_method(ENGINE *engine)
{
DSA *ret = OPENSSL_zalloc(sizeof(*ret));
if (ret == NULL) {
DSAerr(DSA_F_DSA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return NULL;
}
ret->references = 1;
ret->lock = CRYPTO_THREAD_lock_new();
if (ret->lock == NULL) {
DSAerr(DSA_F_DSA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
OPENSSL_free(ret);
return NULL;
}
ret->meth = DSA_get_default_method();
#ifndef OPENSSL_NO_ENGINE
ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; /* early default init */
if (engine && ENGINE_get_DSA(engine)) {
if (!ENGINE_init(engine)) {
DSAerr(DSA_F_DSA_NEW_METHOD, ERR_R_ENGINE_LIB);
goto err;
}
ret->engine = engine;
} else {
ret->engine = ENGINE_get_default_DSA();
}
if (ret->engine) {
ret->meth = ENGINE_get_DSA(ret->engine);
if (ret->meth == NULL) {
DSAerr(DSA_F_DSA_NEW_METHOD, ERR_R_ENGINE_LIB);
goto err;
}
}
#endif
ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data))
goto err;
if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
DSAerr(DSA_F_DSA_NEW_METHOD, ERR_R_INIT_FAIL);
err:
DSA_free(ret);
ret = NULL;
}
return ret;
}
void DSA_free(DSA *r)
{
int i;
if (r == NULL)
return;
CRYPTO_DOWN_REF(&r->references, &i, r->lock);
REF_PRINT_COUNT("DSA", r);
if (i > 0)
return;
REF_ASSERT_ISNT(i < 0);
if (r->meth->finish)
r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE
ENGINE_finish(r->engine);
#endif
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
CRYPTO_THREAD_lock_free(r->lock);
BN_clear_free(r->p);
BN_clear_free(r->q);
BN_clear_free(r->g);
BN_clear_free(r->pub_key);
BN_clear_free(r->priv_key);
OPENSSL_free(r);
}
int DSA_up_ref(DSA *r)
{
int i;
if (CRYPTO_UP_REF(&r->references, &i, r->lock) <= 0)
return 0;
REF_PRINT_COUNT("DSA", r);
REF_ASSERT_ISNT(i < 2);
return ((i > 1) ? 1 : 0);
}
int DSA_size(const DSA *r)
{
int ret, i;
ASN1_INTEGER bs;
unsigned char buf[4]; /* 4 bytes looks really small. However,
* i2d_ASN1_INTEGER() will not look beyond
* the first byte, as long as the second
* parameter is NULL. */
i = BN_num_bits(r->q);
bs.length = (i + 7) / 8;
bs.data = buf;
bs.type = V_ASN1_INTEGER;
/* If the top bit is set the asn1 encoding is 1 larger. */
buf[0] = 0xff;
i = i2d_ASN1_INTEGER(&bs, NULL);
i += i; /* r and s */
ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);
return ret;
}
int DSA_set_ex_data(DSA *d, int idx, void *arg)
{
return CRYPTO_set_ex_data(&d->ex_data, idx, arg);
}
void *DSA_get_ex_data(DSA *d, int idx)
{
return CRYPTO_get_ex_data(&d->ex_data, idx);
}
int DSA_security_bits(const DSA *d)
{
if (d->p && d->q)
return BN_security_bits(BN_num_bits(d->p), BN_num_bits(d->q));
return -1;
}
#ifndef OPENSSL_NO_DH
DH *DSA_dup_DH(const DSA *r)
{
/*
* DSA has p, q, g, optional pub_key, optional priv_key. DH has p,
* optional length, g, optional pub_key, optional priv_key, optional q.
*/
DH *ret = NULL;
BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub_key = NULL, *priv_key = NULL;
if (r == NULL)
goto err;
ret = DH_new();
if (ret == NULL)
goto err;
if (r->p != NULL || r->g != NULL || r->q != NULL) {
if (r->p == NULL || r->g == NULL || r->q == NULL) {
/* Shouldn't happen */
goto err;
}
p = BN_dup(r->p);
g = BN_dup(r->g);
q = BN_dup(r->q);
if (p == NULL || g == NULL || q == NULL || !DH_set0_pqg(ret, p, q, g))
goto err;
p = g = q = NULL;
}
if (r->pub_key != NULL) {
pub_key = BN_dup(r->pub_key);
if (pub_key == NULL)
goto err;
if (r->priv_key != NULL) {
priv_key = BN_dup(r->priv_key);
if (priv_key == NULL)
goto err;
}
if (!DH_set0_key(ret, pub_key, priv_key))
goto err;
} else if (r->priv_key != NULL) {
/* Shouldn't happen */
goto err;
}
return ret;
err:
BN_free(p);
BN_free(g);
BN_free(q);
BN_free(pub_key);
BN_free(priv_key);
DH_free(ret);
return NULL;
}
#endif
void DSA_get0_pqg(const DSA *d,
const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
{
if (p != NULL)
*p = d->p;
if (q != NULL)
*q = d->q;
if (g != NULL)
*g = d->g;
}
int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)
{
/* If the fields p, q and g in d are NULL, the corresponding input
* parameters MUST be non-NULL.
*/
if ((d->p == NULL && p == NULL)
|| (d->q == NULL && q == NULL)
|| (d->g == NULL && g == NULL))
return 0;
if (p != NULL) {
BN_free(d->p);
d->p = p;
}
if (q != NULL) {
BN_free(d->q);
d->q = q;
}
if (g != NULL) {
BN_free(d->g);
d->g = g;
}
return 1;
}
void DSA_get0_key(const DSA *d,
const BIGNUM **pub_key, const BIGNUM **priv_key)
{
if (pub_key != NULL)
*pub_key = d->pub_key;
if (priv_key != NULL)
*priv_key = d->priv_key;
}
int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
{
/* If the field pub_key in d is NULL, the corresponding input
* parameters MUST be non-NULL. The priv_key field may
* be left NULL.
*/
if (d->pub_key == NULL && pub_key == NULL)
return 0;
if (pub_key != NULL) {
BN_free(d->pub_key);
d->pub_key = pub_key;
}
if (priv_key != NULL) {
BN_free(d->priv_key);
d->priv_key = priv_key;
}
return 1;
}
const BIGNUM *DSA_get0_p(const DSA *d)
{
return d->p;
}
const BIGNUM *DSA_get0_q(const DSA *d)
{
return d->q;
}
const BIGNUM *DSA_get0_g(const DSA *d)
{
return d->g;
}
const BIGNUM *DSA_get0_pub_key(const DSA *d)
{
return d->pub_key;
}
const BIGNUM *DSA_get0_priv_key(const DSA *d)
{
return d->priv_key;
}
void DSA_clear_flags(DSA *d, int flags)
{
d->flags &= ~flags;
}
int DSA_test_flags(const DSA *d, int flags)
{
return d->flags & flags;
}
void DSA_set_flags(DSA *d, int flags)
{
d->flags |= flags;
}
ENGINE *DSA_get0_engine(DSA *d)
{
return d->engine;
}
int DSA_bits(const DSA *dsa)
{
return BN_num_bits(dsa->p);
}
|
286024.c | #include <stdio.h>
#include <stdbool.h>
#include <string.h>
typedef struct pessoa {
char nome[100];
int age;
} Pessoa;
void printPointer(char *name, void *p) {
printf("ponteiro %s: %p\n", name, p);
}
typedef bool (*predicado)(void*);
// meu predicado
bool idadeMaiorQueVinte(void *x) {
Pessoa *tmp = x;
puts(tmp->nome);
return tmp->age > 20 ? true : false;
}
bool allMatch(void **array, int size, predicado predi){
if( array == NULL || size <= 0) return false;
printf("printar pPessoa0 %p\n", array[0]);
for ( int i = 0; i < size; i++) {
puts("entrou");
if(predi(array[i])) {
return false;
}allMatch(pPessoas, 3, idadeMaiorQueVinte);
}
return true;
}
int main(void) {
Pessoa pessoas[3];
strcpy(pessoas[0].nome, "Pedro");
pessoas[0].age = 19;
strcpy(pessoas[1].nome, "Marcos");
pessoas[1].age = 13;
strcpy(pessoas[2].nome, "Antonio");
pessoas[2].age = 18;
void *pPessoas[3];
pPessoas[0] = &pessoas[0];
pPessoas[1] = &pessoas[1];
pPessoas[2] = &pessoas[2];
printf("printar pessoa0 %p\n", &pessoas[0]);
printf("printar pPessoa0 %p\n", pPessoas[0]);
bool result = allMatch(pPessoas, 3, idadeMaiorQueVinte);
printf( result ? "true" : "false");
return 0;
}
|
229866.c | /* ----------------------------------------------------------------------
* Project: CMSIS DSP Library
* Title: arm_cfft_init_f16.c
* Description: Initialization function for cfft f16 instance
*
* $Date: 07. January 2020
* $Revision: V1.7.0
*
* Target Processor: Cortex-M cores
* -------------------------------------------------------------------- */
/*
* Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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.
*/
#define FFTINIT(EXT,SIZE) \
S->bitRevLength = arm_cfft_sR_##EXT##_len##SIZE.bitRevLength; \
S->pBitRevTable = arm_cfft_sR_##EXT##_len##SIZE.pBitRevTable; \
S->pTwiddle = arm_cfft_sR_##EXT##_len##SIZE.pTwiddle;
/**
@addtogroup ComplexFFT
@{
*/
/**
@brief Initialization function for the cfft f16 function
@param[in,out] S points to an instance of the floating-point CFFT structure
@param[in] fftLen fft length (number of complex samples)
@return execution status
- \ref ARM_MATH_SUCCESS : Operation successful
- \ref ARM_MATH_ARGUMENT_ERROR : an error is detected
@par Use of this function is mandatory only for the MVE version of the FFT.
Other versions can still initialize directly the data structure using
variables declared in arm_const_structs.h
*/
#include "arm_math_f16.h"
#include "arm_common_tables_f16.h"
#include "arm_const_structs_f16.h"
#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE)
#include "arm_vec_fft.h"
#include "arm_mve_tables_f16.h"
arm_status arm_cfft_radix4by2_rearrange_twiddles_f16(arm_cfft_instance_f16 *S, int twidCoefModifier)
{
switch (S->fftLen >> (twidCoefModifier - 1)) {
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096)
case 4096U:
S->rearranged_twiddle_tab_stride1_arr = rearranged_twiddle_tab_stride1_arr_4096_f16;
S->rearranged_twiddle_stride1 = rearranged_twiddle_stride1_4096_f16;
S->rearranged_twiddle_tab_stride2_arr = rearranged_twiddle_tab_stride2_arr_4096_f16;
S->rearranged_twiddle_stride2 = rearranged_twiddle_stride2_4096_f16;
S->rearranged_twiddle_tab_stride3_arr = rearranged_twiddle_tab_stride3_arr_4096_f16;
S->rearranged_twiddle_stride3 = rearranged_twiddle_stride3_4096_f16;
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_1024) || defined(ARM_TABLE_BITREVIDX_FXT_2048)
case 1024U:
S->rearranged_twiddle_tab_stride1_arr = rearranged_twiddle_tab_stride1_arr_1024_f16;
S->rearranged_twiddle_stride1 = rearranged_twiddle_stride1_1024_f16;
S->rearranged_twiddle_tab_stride2_arr = rearranged_twiddle_tab_stride2_arr_1024_f16;
S->rearranged_twiddle_stride2 = rearranged_twiddle_stride2_1024_f16;
S->rearranged_twiddle_tab_stride3_arr = rearranged_twiddle_tab_stride3_arr_1024_f16;
S->rearranged_twiddle_stride3 = rearranged_twiddle_stride3_1024_f16;
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_256) || defined(ARM_TABLE_BITREVIDX_FXT_512)
case 256U:
S->rearranged_twiddle_tab_stride1_arr = rearranged_twiddle_tab_stride1_arr_256_f16;
S->rearranged_twiddle_stride1 = rearranged_twiddle_stride1_256_f16;
S->rearranged_twiddle_tab_stride2_arr = rearranged_twiddle_tab_stride2_arr_256_f16;
S->rearranged_twiddle_stride2 = rearranged_twiddle_stride2_256_f16;
S->rearranged_twiddle_tab_stride3_arr = rearranged_twiddle_tab_stride3_arr_256_f16;
S->rearranged_twiddle_stride3 = rearranged_twiddle_stride3_256_f16;
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_64) || defined(ARM_TABLE_BITREVIDX_FXT_128)
case 64U:
S->rearranged_twiddle_tab_stride1_arr = rearranged_twiddle_tab_stride1_arr_64_f16;
S->rearranged_twiddle_stride1 = rearranged_twiddle_stride1_64_f16;
S->rearranged_twiddle_tab_stride2_arr = rearranged_twiddle_tab_stride2_arr_64_f16;
S->rearranged_twiddle_stride2 = rearranged_twiddle_stride2_64_f16;
S->rearranged_twiddle_tab_stride3_arr = rearranged_twiddle_tab_stride3_arr_64_f16;
S->rearranged_twiddle_stride3 = rearranged_twiddle_stride3_64_f16;
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_16) || defined(ARM_TABLE_BITREVIDX_FXT_32)
case 16U:
S->rearranged_twiddle_tab_stride1_arr = rearranged_twiddle_tab_stride1_arr_16_f16;
S->rearranged_twiddle_stride1 = rearranged_twiddle_stride1_16_f16;
S->rearranged_twiddle_tab_stride2_arr = rearranged_twiddle_tab_stride2_arr_16_f16;
S->rearranged_twiddle_stride2 = rearranged_twiddle_stride2_16_f16;
S->rearranged_twiddle_tab_stride3_arr = rearranged_twiddle_tab_stride3_arr_16_f16;
S->rearranged_twiddle_stride3 = rearranged_twiddle_stride3_16_f16;
break;
#endif
default:
return(ARM_MATH_ARGUMENT_ERROR);
break;
/* invalid sizes already filtered */
}
return(ARM_MATH_SUCCESS);
}
arm_status arm_cfft_init_f16(
arm_cfft_instance_f16 * S,
uint16_t fftLen)
{
/* Initialise the default arm status */
arm_status status = ARM_MATH_SUCCESS;
/* Initialise the FFT length */
S->fftLen = fftLen;
/* Initialise the Twiddle coefficient pointer */
S->pTwiddle = NULL;
/* Initializations of Instance structure depending on the FFT length */
switch (S->fftLen) {
/* Initializations of structure parameters for 4096 point FFT */
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_4096) && defined(ARM_TABLE_TWIDDLECOEF_F16_4096))
case 4096U:
/* Initialise the bit reversal table modifier */
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_4096;
S->pTwiddle = (float16_t *)twiddleCoefF16_4096;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 1);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_2048) && defined(ARM_TABLE_TWIDDLECOEF_F16_2048))
/* Initializations of structure parameters for 2048 point FFT */
case 2048U:
/* Initialise the bit reversal table modifier */
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_2048;
S->pTwiddle = (float16_t *)twiddleCoefF16_2048;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 2);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_1024) && defined(ARM_TABLE_TWIDDLECOEF_F16_1024))
/* Initializations of structure parameters for 1024 point FFT */
case 1024U:
/* Initialise the bit reversal table modifier */
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_1024;
S->pTwiddle = (float16_t *)twiddleCoefF16_1024;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 1);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_512) && defined(ARM_TABLE_TWIDDLECOEF_F16_512))
/* Initializations of structure parameters for 512 point FFT */
case 512U:
/* Initialise the bit reversal table modifier */
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_512;
S->pTwiddle = (float16_t *)twiddleCoefF16_512;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 2);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_256) && defined(ARM_TABLE_TWIDDLECOEF_F16_256))
case 256U:
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_256;
S->pTwiddle = (float16_t *)twiddleCoefF16_256;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 1);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_128) && defined(ARM_TABLE_TWIDDLECOEF_F16_128))
case 128U:
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_128;
S->pTwiddle = (float16_t *)twiddleCoefF16_128;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 2);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_64) && defined(ARM_TABLE_TWIDDLECOEF_F16_64))
case 64U:
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_64;
S->pTwiddle = (float16_t *)twiddleCoefF16_64;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 1);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_32) && defined(ARM_TABLE_TWIDDLECOEF_F16_32))
case 32U:
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_32;
S->pTwiddle = (float16_t *)twiddleCoefF16_32;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 2);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_BITREVIDX_FXT_16) && defined(ARM_TABLE_TWIDDLECOEF_F16_16))
case 16U:
/* Initializations of structure parameters for 16 point FFT */
S->bitRevLength = ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH;
S->pBitRevTable = (uint16_t *)armBitRevIndexTable_fixed_16;
S->pTwiddle = (float16_t *)twiddleCoefF16_16;
status=arm_cfft_radix4by2_rearrange_twiddles_f16(S, 1);
break;
#endif
default:
/* Reporting argument error if fftSize is not valid value */
status = ARM_MATH_ARGUMENT_ERROR;
break;
}
return (status);
}
#else
#if defined(ARM_FLOAT16_SUPPORTED)
arm_status arm_cfft_init_f16(
arm_cfft_instance_f16 * S,
uint16_t fftLen)
{
/* Initialise the default arm status */
arm_status status = ARM_MATH_SUCCESS;
/* Initialise the FFT length */
S->fftLen = fftLen;
/* Initialise the Twiddle coefficient pointer */
S->pTwiddle = NULL;
/* Initializations of Instance structure depending on the FFT length */
switch (S->fftLen) {
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_4096) && defined(ARM_TABLE_BITREVIDX_FLT_4096))
/* Initializations of structure parameters for 4096 point FFT */
case 4096U:
/* Initialise the bit reversal table modifier */
FFTINIT(f16,4096);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_2048) && defined(ARM_TABLE_BITREVIDX_FLT_2048))
/* Initializations of structure parameters for 2048 point FFT */
case 2048U:
/* Initialise the bit reversal table modifier */
FFTINIT(f16,2048);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_1024) && defined(ARM_TABLE_BITREVIDX_FLT_1024))
/* Initializations of structure parameters for 1024 point FFT */
case 1024U:
/* Initialise the bit reversal table modifier */
FFTINIT(f16,1024);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_512) && defined(ARM_TABLE_BITREVIDX_FLT_512))
/* Initializations of structure parameters for 512 point FFT */
case 512U:
/* Initialise the bit reversal table modifier */
FFTINIT(f16,512);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_256) && defined(ARM_TABLE_BITREVIDX_FLT_256))
case 256U:
FFTINIT(f16,256);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_128) && defined(ARM_TABLE_BITREVIDX_FLT_128))
case 128U:
FFTINIT(f16,128);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_64) && defined(ARM_TABLE_BITREVIDX_FLT_64))
case 64U:
FFTINIT(f16,64);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_32) && defined(ARM_TABLE_BITREVIDX_FLT_32))
case 32U:
FFTINIT(f16,32);
break;
#endif
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_16) && defined(ARM_TABLE_BITREVIDX_FLT_16))
case 16U:
/* Initializations of structure parameters for 16 point FFT */
FFTINIT(f16,16);
break;
#endif
default:
/* Reporting argument error if fftSize is not valid value */
status = ARM_MATH_ARGUMENT_ERROR;
break;
}
return (status);
}
#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */
#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */
/**
@} end of ComplexFFT group
*/
|
9947.c | /*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "F1AP-IEs"
* found in "/home/labuser/Desktop/openairinterface5g_f1ap/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-IEs.asn"
* `asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D /home/labuser/Desktop/openairinterface5g_f1ap/cmake_targets/lte_build_oai/build/CMakeFiles/F1AP_R15.2.1`
*/
#include "F1AP_CauseMisc.h"
/*
* This type is implemented using NativeEnumerated,
* so here we adjust the DEF accordingly.
*/
static asn_oer_constraints_t asn_OER_type_F1AP_CauseMisc_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1};
asn_per_constraints_t asn_PER_type_F1AP_CauseMisc_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 4 } /* (0..4,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_F1AP_CauseMisc_value2enum_1[] = {
{ 0, 27, "control-processing-overload" },
{ 1, 42, "not-enough-user-plane-processing-resources" },
{ 2, 16, "hardware-failure" },
{ 3, 15, "om-intervention" },
{ 4, 11, "unspecified" }
/* This list is extensible */
};
static const unsigned int asn_MAP_F1AP_CauseMisc_enum2value_1[] = {
0, /* control-processing-overload(0) */
2, /* hardware-failure(2) */
1, /* not-enough-user-plane-processing-resources(1) */
3, /* om-intervention(3) */
4 /* unspecified(4) */
/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_F1AP_CauseMisc_specs_1 = {
asn_MAP_F1AP_CauseMisc_value2enum_1, /* "tag" => N; sorted by tag */
asn_MAP_F1AP_CauseMisc_enum2value_1, /* N => "tag"; sorted by N */
5, /* Number of elements in the maps */
6, /* Extensions before this member */
1, /* Strict enumeration */
0, /* Native long size */
0
};
static const ber_tlv_tag_t asn_DEF_F1AP_CauseMisc_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_F1AP_CauseMisc = {
"CauseMisc",
"CauseMisc",
&asn_OP_NativeEnumerated,
asn_DEF_F1AP_CauseMisc_tags_1,
sizeof(asn_DEF_F1AP_CauseMisc_tags_1)
/sizeof(asn_DEF_F1AP_CauseMisc_tags_1[0]), /* 1 */
asn_DEF_F1AP_CauseMisc_tags_1, /* Same as above */
sizeof(asn_DEF_F1AP_CauseMisc_tags_1)
/sizeof(asn_DEF_F1AP_CauseMisc_tags_1[0]), /* 1 */
{ &asn_OER_type_F1AP_CauseMisc_constr_1, &asn_PER_type_F1AP_CauseMisc_constr_1, NativeEnumerated_constraint },
0, 0, /* Defined elsewhere */
&asn_SPC_F1AP_CauseMisc_specs_1 /* Additional specs */
};
|
461194.c | // Copyright 2018 Schibsted
#include <ctype.h>
#include <string.h>
#include <syslog.h>
#include <sys/types.h>
#include "sbp/atomic.h"
#include "buf_string.h"
#include "cached_regex.h"
#include "memalloc_functions.h"
int
cached_regex_replace(struct buf_string *result, struct cached_regex *regex, const char* replacement, const char* haystack, int haystack_length, int global) {
pcre *re = NULL;
pcre_extra *extra;
const char* err;
int retval;
int alloced = 0;
int capture_count = 0;
int *offset = NULL;
int haystack_offset = 0;
const char *curr_replacement;
const char* replacement_start;
int backref;
if (haystack_length == -1)
haystack_length = strlen(haystack);
/* Handle empty regexes */
if (regex->regex[0] == '\0') {
bufwrite(&result->buf, &result->len, &result->pos, haystack, haystack_length);
return 0;
}
/* Compile pattern */
if (regex->state == 1) {
re = regex->pe;
extra = regex->extra;
capture_count = regex->capture_count;
} else {
alloced = 1;
re = pcre_compile(regex->regex, regex->options, &err, &retval, NULL);
if (!re) {
syslog(LOG_ERR, "pcre_compile(%s) %s at %i", regex->regex, err, retval);
return -1;
}
/* Fetch information about the pattern */
extra = pcre_study(re, 0, &err);
if (!extra && err) {
syslog(LOG_ERR, "pcre_study(%s) %s", regex->regex, err);
pcre_free(re);
return -1;
}
/* Get number of captures */
if (pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &capture_count) < 0) {
syslog(LOG_ERR, "pcre_fullinfo(PCRE_INFO_CAPTURECOUNT) failed");
pcre_free(extra);
pcre_free(re);
return -1;
}
capture_count += 1;
}
/* Make room for capture */
offset = xmalloc(sizeof(int) * capture_count * 3);
while (1) {
replacement_start = replacement;
curr_replacement = replacement - 1;
retval = pcre_exec(re, extra, haystack, haystack_length, haystack_offset, 0, offset, capture_count*3);
if (retval == PCRE_ERROR_NOMATCH) {
break;
}
if (retval < 0) {
syslog(LOG_ERR, "pcre_exec: %d", retval);
free(offset);
if (alloced) {
pcre_free(extra);
pcre_free(re);
}
return -1;
}
/* Print everyting up to the start of the pattern */
bufwrite(&result->buf, &result->len, &result->pos, haystack + haystack_offset, offset[0] - haystack_offset);
/* Walk through replacement string */
while (*(++curr_replacement) != '\0') {
/* Check if current char is a backref-sequence */
if (*curr_replacement == '$' && (*(curr_replacement + 1) == '$' || isdigit(*(curr_replacement + 1)))) {
/* Flush if there's any data */
if (replacement_start < curr_replacement) {
bufwrite(&result->buf, &result->len, &result->pos, replacement_start, curr_replacement - replacement_start);
}
/* Skip first dollar and forward replacement_start */
++curr_replacement;
replacement_start = curr_replacement;
/* If double dollar, update pointers and continue */
if (*curr_replacement == '$')
continue;
/* Back-references */
backref = *curr_replacement - '0';
if (backref < capture_count)
bufwrite(&result->buf, &result->len, &result->pos, haystack + offset[backref*2], offset[backref*2+1] - offset[backref*2]);
else
syslog(LOG_WARNING, "regex_replacement pattern uses unknown back-reference (%d) in \"%s\"", backref, regex->regex);
++replacement_start;
continue;
}
}
if (replacement_start < curr_replacement) {
bufwrite(&result->buf, &result->len, &result->pos, replacement_start, curr_replacement - replacement_start);
}
haystack_offset = offset[1];
if (!global)
break;
}
/* Print remainder of input after last match */
bufwrite(&result->buf, &result->len, &result->pos, haystack + haystack_offset, haystack_length - haystack_offset);
if (alloced) {
if (!atomic_cas_int(®ex->state, 0, -1)) {
regex->pe = re;
regex->extra = extra;
regex->capture_count = capture_count;
/* This needs to be a cas because of memory ordering. */
atomic_cas_int(®ex->state, -1, 1);
} else {
pcre_free(re);
if (extra)
pcre_free(extra);
}
}
free(offset);
return 0;
}
int
cached_regex_match(struct cached_regex *regex, const char *str, int *ov, int ovlen) {
int alloced = 0;
pcre *re;
pcre_extra *extra;
int retval;
const char* err;
/* Handle empty regexes */
if (regex->regex[0] == '\0') {
return 0;
}
/* Compile pattern */
if (regex->state == 1) {
re = regex->pe;
extra = regex->extra;
} else {
alloced = 1;
re = pcre_compile(regex->regex,
(ovlen ? 0 : PCRE_NO_AUTO_CAPTURE) | regex->options,
&err, &retval, NULL);
if(!re) {
syslog(LOG_ERR, "pcre_compile(%s) %s at %i", regex->regex, err, retval);
return 0;
}
/* Fetch information about the pattern */
extra = pcre_study(re, 0, &err);
if(!extra && err) {
syslog(LOG_ERR, "pcre_study(%s) %s", regex->regex, err);
pcre_free(re);
return 0;
}
}
retval = pcre_exec(re, extra, str, strlen(str), 0, 0, ov, ovlen);
if (retval < 0 && retval != PCRE_ERROR_NOMATCH) {
syslog(LOG_ERR, "pcre_exec < 0");
if (alloced) {
pcre_free(extra);
pcre_free(re);
}
return 0;
}
if (alloced) {
if (!atomic_cas_int(®ex->state, 0, -1)) {
regex->pe = re;
regex->extra = extra;
/* This needs to be a cas because of memory ordering. */
atomic_cas_int(®ex->state, -1, 1);
} else {
pcre_free(re);
if(extra)
pcre_free(extra);
}
}
return retval != PCRE_ERROR_NOMATCH;
}
void
cached_regex_cleanup(struct cached_regex *regex) {
/* This needs to be a cas because of memory ordering. */
atomic_cas_int(®ex->state, regex->state, -1);
if (regex->pe) {
pcre_free(regex->pe);
regex->pe = NULL;
}
if (regex->extra) {
pcre_free(regex->extra);
regex->extra = NULL;
}
/* This needs to be a cas because of memory ordering. */
atomic_cas_int(®ex->state, -1, 0);
}
|
915322.c | /* Handle real-time signal allocation. Generic version.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <[email protected]>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <signal.h>
/* Another sysdeps file can #define this and then #include this file. */
#ifndef RESERVED_SIGRT
# define RESERVED_SIGRT 0
#endif
/* In these variables we keep track of the used variables. If the
platform does not support any real-time signals we will define the
values to some unreasonable value which will signal failing of all
the functions below. */
#ifdef __SIGRTMIN
static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT;
static int current_rtmax = __SIGRTMAX;
#endif
/* Return number of available real-time signal with highest priority. */
int
__libc_current_sigrtmin (void)
{
#ifdef __SIGRTMIN
return current_rtmin;
#else
return -1;
#endif
}
libc_hidden_def (__libc_current_sigrtmin)
strong_alias (__libc_current_sigrtmin, __libc_current_sigrtmin_private)
/* Return number of available real-time signal with lowest priority. */
int
__libc_current_sigrtmax (void)
{
#ifdef __SIGRTMIN
return current_rtmax;
#else
return -1;
#endif
}
libc_hidden_def (__libc_current_sigrtmax)
strong_alias (__libc_current_sigrtmax, __libc_current_sigrtmax_private)
/* Allocate real-time signal with highest/lowest available
priority. Please note that we don't use a lock since we assume
this function to be called at program start. */
int
__libc_allocate_rtsig (int high)
{
#ifndef __SIGRTMIN
return -1;
#else
if (current_rtmin == -1 || current_rtmin > current_rtmax)
/* We don't have any more signals available. */
return -1;
return high ? current_rtmin++ : current_rtmax--;
#endif
}
strong_alias (__libc_allocate_rtsig, __libc_allocate_rtsig_private)
|
320813.c | #include "jtest.h"
#include "ref.h"
#include "arr_desc.h"
#include "fast_math_templates.h"
#include "fast_math_test_data.h"
#include "type_abbrev.h"
SQRT_TEST_TEMPLATE_ELT1(q31);
SQRT_TEST_TEMPLATE_ELT1(q15);
SIN_COS_TEST_TEMPLATE_ELT1(f32, float32_t, sin);
SIN_COS_TEST_TEMPLATE_ELT1(q31, q31_t, sin);
SIN_COS_TEST_TEMPLATE_ELT1(q15, q15_t, sin);
SIN_COS_TEST_TEMPLATE_ELT1(f32, float32_t, cos);
SIN_COS_TEST_TEMPLATE_ELT1(q31, q31_t, cos);
SIN_COS_TEST_TEMPLATE_ELT1(q15, q15_t, cos);
/*--------------------------------------------------------------------------------*/
/* Collect all tests in a group */
/*--------------------------------------------------------------------------------*/
JTEST_DEFINE_GROUP(fast_math_tests)
{
/*
To skip a test, comment it out.
*/
JTEST_TEST_CALL(arm_sqrt_q31_test);
JTEST_TEST_CALL(arm_sqrt_q15_test);
JTEST_TEST_CALL(arm_sin_f32_test);
JTEST_TEST_CALL(arm_sin_q31_test);
JTEST_TEST_CALL(arm_sin_q15_test);
JTEST_TEST_CALL(arm_cos_f32_test);
JTEST_TEST_CALL(arm_cos_q31_test);
JTEST_TEST_CALL(arm_cos_q15_test);
}
|
932464.c | #include "ds.h"
int min(int a, int b)
{
return a < b ? a : b;
}
int exchange_money_no_dup(int *money, int size, int aim)
{
if (!money || size <= 0 || aim <= 0)
return 0;
int imax = 2147483647;
int *dp = malloc(sizeof(int) * (aim + 1));
memset(dp, 0, sizeof(int) * (aim + 1));
for (int i = 1; i <= aim; i++)
dp[i] = imax;
if (money[0] <= aim)
dp[money[0]] = 1;
int left = 0;
for (int i = 1; i < size; i++) {
for (int j = aim; j >= 1; j--) {
left = imax;
if (j - money[i] >= 0 && dp[j - money[i]] != imax)
left = dp[j - money[i]] + 1;
dp[j] = min(left, dp[j]);
}
}
int res = dp[aim];
free(dp);
return res == imax ? -1 : res;
}
int main(int argc, char *argv[])
{
int k = randWithRange(0, 20);
int money[] = { 5, 2, 3, 4 };
int size = sizeof(money) / sizeof(money[0]);
int cnt = exchange_money_no_dup(money, size, k);
printArray(money, size);
printf("k = %d cnt = %d\n", k, cnt);
}
|
606480.c | #include "gfx/legato/generated/le_gen_assets.h"
/*********************************
* Legato Font Asset
* Name: NotoSans_Bold16
* Height: 18
* Baseline: 13
* Style: Antialias
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoSans_Bold16_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x04,0x00,0x0C,0x00,0x05,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x06,0x00,
0x04,0x00,0x08,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x30,0x00,0x00,0x00,
0x23,0x00,0x0A,0x00,0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,
0x48,0x00,0x00,0x00,0x24,0x00,0x09,0x00,0x0D,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0xC0,0x00,0x00,0x00,0x25,0x00,0x0E,0x00,0x0C,0x00,0x0E,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0x38,0x01,0x00,0x00,0x26,0x00,0x0C,0x00,
0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0xE0,0x01,0x00,0x00,
0x27,0x00,0x03,0x00,0x04,0x00,0x04,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x03,0x00,
0x70,0x02,0x00,0x00,0x28,0x00,0x05,0x00,0x0E,0x00,0x05,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x05,0x00,0x7C,0x02,0x00,0x00,0x29,0x00,0x05,0x00,0x0E,0x00,0x05,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x05,0x00,0xC4,0x02,0x00,0x00,0x2A,0x00,0x09,0x00,
0x08,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x0C,0x03,0x00,0x00,
0x2B,0x00,0x09,0x00,0x08,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x54,0x03,0x00,0x00,0x2C,0x00,0x04,0x00,0x04,0x00,0x05,0x00,0x00,0x00,0x02,0x00,
0x00,0x00,0x04,0x00,0x9C,0x03,0x00,0x00,0x2D,0x00,0x05,0x00,0x02,0x00,0x05,0x00,
0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0xAC,0x03,0x00,0x00,0x2E,0x00,0x04,0x00,
0x03,0x00,0x05,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0xB8,0x03,0x00,0x00,
0x2F,0x00,0x07,0x00,0x0C,0x00,0x07,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,
0xC4,0x03,0x00,0x00,0x30,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0x18,0x04,0x00,0x00,0x31,0x00,0x07,0x00,0x0C,0x00,0x09,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,0x84,0x04,0x00,0x00,0x32,0x00,0x09,0x00,
0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xD8,0x04,0x00,0x00,
0x33,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,
0x44,0x05,0x00,0x00,0x34,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0xB0,0x05,0x00,0x00,0x35,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x1C,0x06,0x00,0x00,0x36,0x00,0x09,0x00,
0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x88,0x06,0x00,0x00,
0x37,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,
0xF4,0x06,0x00,0x00,0x38,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0x60,0x07,0x00,0x00,0x39,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xCC,0x07,0x00,0x00,0x3A,0x00,0x04,0x00,
0x09,0x00,0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x04,0x00,0x38,0x08,0x00,0x00,
0x3B,0x00,0x04,0x00,0x0B,0x00,0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x04,0x00,
0x5C,0x08,0x00,0x00,0x3C,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0x88,0x08,0x00,0x00,0x3D,0x00,0x09,0x00,0x05,0x00,0x09,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0xDC,0x08,0x00,0x00,0x3E,0x00,0x09,0x00,
0x09,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x0C,0x09,0x00,0x00,
0x3F,0x00,0x08,0x00,0x0C,0x00,0x08,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x08,0x00,
0x60,0x09,0x00,0x00,0x40,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x0E,0x00,0xC0,0x09,0x00,0x00,0x41,0x00,0x0C,0x00,0x0C,0x00,0x0B,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x84,0x0A,0x00,0x00,0x42,0x00,0x09,0x00,
0x0C,0x00,0x0B,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x14,0x0B,0x00,0x00,
0x43,0x00,0x0A,0x00,0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,
0x80,0x0B,0x00,0x00,0x44,0x00,0x0A,0x00,0x0C,0x00,0x0C,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x0A,0x00,0xF8,0x0B,0x00,0x00,0x45,0x00,0x08,0x00,0x0C,0x00,0x09,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x08,0x00,0x70,0x0C,0x00,0x00,0x46,0x00,0x07,0x00,
0x0C,0x00,0x09,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,0xD0,0x0C,0x00,0x00,
0x47,0x00,0x0B,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0B,0x00,
0x24,0x0D,0x00,0x00,0x48,0x00,0x0A,0x00,0x0C,0x00,0x0C,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x0A,0x00,0xA8,0x0D,0x00,0x00,0x49,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x20,0x0E,0x00,0x00,0x4A,0x00,0x06,0x00,
0x0F,0x00,0x05,0x00,0xFE,0xFF,0x0C,0x00,0x00,0x00,0x06,0x00,0x68,0x0E,0x00,0x00,
0x4B,0x00,0x0A,0x00,0x0C,0x00,0x0B,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,
0xC4,0x0E,0x00,0x00,0x4C,0x00,0x08,0x00,0x0C,0x00,0x09,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x08,0x00,0x3C,0x0F,0x00,0x00,0x4D,0x00,0x0D,0x00,0x0C,0x00,0x0F,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x0D,0x00,0x9C,0x0F,0x00,0x00,0x4E,0x00,0x0B,0x00,
0x0C,0x00,0x0D,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x0B,0x00,0x38,0x10,0x00,0x00,
0x4F,0x00,0x0C,0x00,0x0C,0x00,0x0D,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,
0xBC,0x10,0x00,0x00,0x50,0x00,0x09,0x00,0x0C,0x00,0x0A,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0x4C,0x11,0x00,0x00,0x51,0x00,0x0C,0x00,0x0F,0x00,0x0D,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0xB8,0x11,0x00,0x00,0x52,0x00,0x0A,0x00,
0x0C,0x00,0x0B,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,0x6C,0x12,0x00,0x00,
0x53,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,
0xE4,0x12,0x00,0x00,0x54,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0x50,0x13,0x00,0x00,0x55,0x00,0x0A,0x00,0x0C,0x00,0x0C,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,0xBC,0x13,0x00,0x00,0x56,0x00,0x0B,0x00,
0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0B,0x00,0x34,0x14,0x00,0x00,
0x57,0x00,0x10,0x00,0x0C,0x00,0x0F,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x10,0x00,
0xB8,0x14,0x00,0x00,0x58,0x00,0x0B,0x00,0x0C,0x00,0x0B,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x0B,0x00,0x78,0x15,0x00,0x00,0x59,0x00,0x0A,0x00,0x0C,0x00,0x0A,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,0xFC,0x15,0x00,0x00,0x5A,0x00,0x09,0x00,
0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x74,0x16,0x00,0x00,
0x5B,0x00,0x04,0x00,0x0F,0x00,0x05,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x04,0x00,
0xE0,0x16,0x00,0x00,0x5C,0x00,0x07,0x00,0x0C,0x00,0x07,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x07,0x00,0x1C,0x17,0x00,0x00,0x5D,0x00,0x05,0x00,0x0F,0x00,0x05,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x05,0x00,0x70,0x17,0x00,0x00,0x5E,0x00,0x09,0x00,
0x08,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xBC,0x17,0x00,0x00,
0x5F,0x00,0x08,0x00,0x02,0x00,0x07,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x08,0x00,
0x04,0x18,0x00,0x00,0x60,0x00,0x06,0x00,0x03,0x00,0x06,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x06,0x00,0x14,0x18,0x00,0x00,0x61,0x00,0x09,0x00,0x09,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x28,0x18,0x00,0x00,0x62,0x00,0x09,0x00,
0x0C,0x00,0x0A,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x7C,0x18,0x00,0x00,
0x63,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x08,0x00,
0xE8,0x18,0x00,0x00,0x64,0x00,0x09,0x00,0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0x30,0x19,0x00,0x00,0x65,0x00,0x09,0x00,0x09,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x9C,0x19,0x00,0x00,0x66,0x00,0x07,0x00,
0x0C,0x00,0x06,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,0xF0,0x19,0x00,0x00,
0x67,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,
0x44,0x1A,0x00,0x00,0x68,0x00,0x09,0x00,0x0C,0x00,0x0B,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0xBC,0x1A,0x00,0x00,0x69,0x00,0x03,0x00,0x0C,0x00,0x05,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x03,0x00,0x28,0x1B,0x00,0x00,0x6A,0x00,0x06,0x00,
0x10,0x00,0x05,0x00,0xFE,0xFF,0x0C,0x00,0x00,0x00,0x06,0x00,0x4C,0x1B,0x00,0x00,
0x6B,0x00,0x09,0x00,0x0C,0x00,0x0A,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,
0xAC,0x1B,0x00,0x00,0x6C,0x00,0x03,0x00,0x0C,0x00,0x05,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x03,0x00,0x18,0x1C,0x00,0x00,0x6D,0x00,0x0E,0x00,0x09,0x00,0x10,0x00,
0x01,0x00,0x09,0x00,0x00,0x00,0x0E,0x00,0x3C,0x1C,0x00,0x00,0x6E,0x00,0x09,0x00,
0x09,0x00,0x0B,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0xBC,0x1C,0x00,0x00,
0x6F,0x00,0x0A,0x00,0x09,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,
0x10,0x1D,0x00,0x00,0x70,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,0x01,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x6C,0x1D,0x00,0x00,0x71,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0xE4,0x1D,0x00,0x00,0x72,0x00,0x06,0x00,
0x09,0x00,0x07,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x06,0x00,0x5C,0x1E,0x00,0x00,
0x73,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x08,0x00,
0x94,0x1E,0x00,0x00,0x74,0x00,0x07,0x00,0x0B,0x00,0x07,0x00,0x00,0x00,0x0B,0x00,
0x00,0x00,0x07,0x00,0xDC,0x1E,0x00,0x00,0x75,0x00,0x09,0x00,0x09,0x00,0x0B,0x00,
0x01,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x2C,0x1F,0x00,0x00,0x76,0x00,0x0A,0x00,
0x09,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x80,0x1F,0x00,0x00,
0x77,0x00,0x0E,0x00,0x09,0x00,0x0E,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0E,0x00,
0xDC,0x1F,0x00,0x00,0x78,0x00,0x0A,0x00,0x09,0x00,0x09,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x0A,0x00,0x5C,0x20,0x00,0x00,0x79,0x00,0x0A,0x00,0x0D,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0xB8,0x20,0x00,0x00,0x7A,0x00,0x08,0x00,
0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0x3C,0x21,0x00,0x00,
0x7B,0x00,0x06,0x00,0x0E,0x00,0x06,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,
0x84,0x21,0x00,0x00,0x7C,0x00,0x03,0x00,0x10,0x00,0x09,0x00,0x03,0x00,0x0C,0x00,
0x00,0x00,0x03,0x00,0xD8,0x21,0x00,0x00,0x7D,0x00,0x07,0x00,0x0E,0x00,0x06,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,0x08,0x22,0x00,0x00,0x7E,0x00,0x09,0x00,
0x04,0x00,0x09,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x6C,0x22,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoSans_Bold16_glyphs[8848] =
{
0x09,0xFF,0xFF,0x9D,0x00,0xFC,0xFF,0x91,0x00,0xEF,0xFF,0x84,0x00,0xE2,0xFF,0x78,
0x00,0xD5,0xFF,0x6B,0x00,0xC8,0xFF,0x5F,0x00,0xBB,0xFF,0x52,0x00,0xAE,0xFF,0x46,
0x00,0x00,0x00,0x00,0x00,0x90,0xC9,0x3A,0x0E,0xFF,0xFF,0x99,0x00,0xB8,0xF2,0x50,
0xEA,0xFF,0x2D,0x9E,0xFF,0x79,0xD6,0xFF,0x18,0x8A,0xFF,0x64,0xC2,0xFE,0x04,0x76,
0xFF,0x4F,0xAE,0xEE,0x00,0x62,0xFF,0x3A,0x00,0x00,0x00,0x4B,0xFF,0x68,0x09,0xFE,
0xA4,0x00,0x00,0x00,0x00,0x72,0xFF,0x41,0x2E,0xFF,0x7D,0x00,0x00,0x00,0x00,0x99,
0xFF,0x1A,0x55,0xFF,0x56,0x00,0x00,0x00,0x00,0xC0,0xF2,0x00,0x7C,0xFF,0x2F,0x00,
0x18,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x0F,0xA4,0xB3,0xFF,0xD4,0xA4,
0xFA,0xEA,0xA4,0xA1,0x00,0x00,0x5A,0xFF,0x57,0x1E,0xFF,0x93,0x00,0x00,0xA4,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x74,0x99,0xF0,0xFC,0xFE,0xF0,0xF9,0xFF,0xF2,
0xF0,0x6C,0x00,0x00,0xE8,0xCB,0x00,0xB1,0xFC,0x0A,0x00,0x00,0x00,0x18,0xFF,0x9A,
0x00,0xE4,0xD3,0x00,0x00,0x00,0x00,0x48,0xFF,0x68,0x16,0xFF,0xA1,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xF4,0x20,0x00,0x00,0x00,0x00,0x01,0x56,0xA1,0xFC,0xBC,0x96,
0x4D,0x04,0x01,0xAA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x2A,0x30,0xFF,0xFF,0x8F,0xF7,
0x68,0x85,0xA3,0x00,0x44,0xFF,0xFF,0x3E,0xF4,0x20,0x00,0x00,0x00,0x0C,0xE8,0xFF,
0xF9,0xFD,0x45,0x00,0x00,0x00,0x00,0x2C,0xCF,0xFF,0xFF,0xFF,0xC0,0x2F,0x00,0x00,
0x00,0x01,0x4E,0xFA,0xFF,0xFF,0xF2,0x23,0x00,0x00,0x00,0x00,0xF4,0x55,0xF4,0xFF,
0x78,0x3F,0x8F,0x3B,0x0B,0xF4,0x4B,0xF1,0xFF,0x6B,0x4C,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xE6,0x14,0x17,0x87,0xCA,0xE3,0xFF,0xD9,0x96,0x19,0x00,0x00,0x00,0x00,0x00,
0xF4,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5A,0xE5,0xF5,0x9D,0x04,0x00,0x00,
0x02,0xD4,0xF2,0x15,0x00,0x00,0x11,0xF7,0xFF,0xFD,0xFF,0x68,0x00,0x00,0x5E,0xFF,
0x80,0x00,0x00,0x00,0x59,0xFF,0xAE,0x44,0xFF,0xC1,0x00,0x06,0xDF,0xEB,0x0D,0x00,
0x00,0x00,0x75,0xFF,0x7D,0x12,0xFF,0xDF,0x00,0x6C,0xFF,0x72,0x00,0x00,0x00,0x00,
0x72,0xFF,0x7E,0x13,0xFF,0xDD,0x0B,0xE8,0xE2,0x07,0x00,0x00,0x00,0x00,0x53,0xFF,
0xB5,0x4F,0xFF,0xBF,0x7A,0xFF,0x63,0x60,0xDE,0xEE,0x9E,0x09,0x0A,0xF0,0xFF,0xFF,
0xFF,0x7B,0xEF,0xD8,0x24,0xFC,0xF3,0xD2,0xFF,0x7F,0x00,0x47,0xD3,0xE6,0x96,0x8D,
0xFF,0x54,0x64,0xFF,0x8F,0x24,0xFF,0xCD,0x00,0x00,0x00,0x00,0x19,0xF5,0xCC,0x01,
0x78,0xFF,0x7B,0x10,0xFF,0xE4,0x00,0x00,0x00,0x00,0x96,0xFF,0x46,0x00,0x62,0xFF,
0xA5,0x3B,0xFF,0xCE,0x00,0x00,0x00,0x22,0xFA,0xBE,0x00,0x00,0x1C,0xFB,0xFF,0xFC,
0xFF,0x84,0x00,0x00,0x00,0xA4,0xFF,0x38,0x00,0x00,0x00,0x58,0xDD,0xEF,0xA6,0x0D,
0x00,0x00,0x2F,0xB9,0xF4,0xF2,0xB2,0x21,0x00,0x00,0x00,0x00,0x00,0x12,0xEE,0xFF,
0xFD,0xFF,0xFF,0xD4,0x01,0x00,0x00,0x00,0x00,0x56,0xFF,0xEE,0x19,0x3B,0xFF,0xFF,
0x1D,0x00,0x00,0x00,0x00,0x4A,0xFF,0xED,0x01,0x35,0xFF,0xFD,0x0B,0x00,0x00,0x00,
0x00,0x14,0xF7,0xFF,0x92,0xE3,0xFF,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,
0xFF,0xFF,0xB4,0x09,0x00,0x00,0x00,0x00,0x00,0x49,0xF0,0xFF,0xFF,0xFC,0x44,0x00,
0x1E,0xFE,0xFF,0x56,0x14,0xF3,0xFF,0xAC,0x70,0xFF,0xF8,0x52,0x86,0xFF,0xEC,0x07,
0x4E,0xFF,0xFF,0x33,0x00,0x6B,0xFF,0xFC,0xF7,0xFF,0x72,0x00,0x46,0xFF,0xFF,0x8E,
0x06,0x04,0xA4,0xFF,0xFF,0xD9,0x02,0x00,0x05,0xD0,0xFF,0xFF,0xFB,0xFC,0xFF,0xFF,
0xFF,0xFF,0x7D,0x00,0x00,0x10,0x85,0xD7,0xF5,0xE8,0xC1,0x61,0x74,0xFF,0xFF,0x7F,
0xEA,0xFF,0x2D,0xD6,0xFF,0x18,0xC2,0xFE,0x04,0xAE,0xEE,0x00,0x00,0x00,0x5A,0xFF,
0xA3,0x00,0x12,0xED,0xF5,0x18,0x00,0x76,0xFF,0x9D,0x00,0x00,0xD6,0xFF,0x3F,0x00,
0x13,0xFF,0xF9,0x08,0x00,0x3E,0xFF,0xD6,0x00,0x00,0x52,0xFF,0xC2,0x00,0x00,0x54,
0xFF,0xC0,0x00,0x00,0x41,0xFF,0xD4,0x00,0x00,0x18,0xFF,0xF8,0x07,0x00,0x00,0xDC,
0xFF,0x3C,0x00,0x00,0x7E,0xFF,0x97,0x00,0x00,0x16,0xF1,0xF2,0x14,0x00,0x00,0x5D,
0xFF,0x9E,0x00,0x00,0x39,0xFE,0xC3,0x02,0x00,0x00,0xA3,0xFF,0x6A,0x00,0x00,0x35,
0xFF,0xDC,0x01,0x00,0x00,0xD8,0xFF,0x3E,0x00,0x00,0x99,0xFF,0x7C,0x00,0x00,0x6B,
0xFF,0xA9,0x00,0x00,0x57,0xFF,0xBC,0x00,0x00,0x55,0xFF,0xBF,0x00,0x00,0x69,0xFF,
0xAB,0x00,0x00,0x96,0xFF,0x82,0x00,0x00,0xD4,0xFF,0x44,0x00,0x30,0xFF,0xE3,0x03,
0x00,0x9E,0xFF,0x71,0x00,0x35,0xFD,0xC5,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x9E,
0xFF,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0x36,0x00,0x00,0x00,0x3D,0xB4,
0x6B,0x85,0xFF,0x50,0x7E,0xC5,0x06,0x6A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x25,
0x0A,0x24,0x53,0xFC,0xFF,0xDD,0x35,0x21,0x04,0x00,0x03,0xC1,0xFE,0xA1,0xFF,0x7A,
0x00,0x00,0x00,0x51,0xFE,0xB4,0x0F,0xF0,0xF1,0x17,0x00,0x00,0x00,0x30,0x31,0x00,
0x4B,0x19,0x00,0x00,0x00,0x00,0x00,0x48,0xFF,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,
0x48,0xFF,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0xFF,0x6C,0x00,0x00,0x00,0x4B,
0xF0,0xF0,0xF4,0xFF,0xF6,0xF0,0xF0,0x6C,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x74,0x00,0x00,0x00,0x48,0xFF,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0xFF,0x6C,
0x00,0x00,0x00,0x00,0x00,0x00,0x48,0xFF,0x6C,0x00,0x00,0x00,0x00,0xCF,0xFF,0x75,
0x03,0xF8,0xFF,0x29,0x2F,0xFF,0xCF,0x00,0x65,0xFF,0x68,0x00,0x7B,0xF0,0xF0,0xF0,
0xA1,0x84,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x90,0xC9,0x3A,0x0E,0xFF,0xFF,0x99,
0x00,0xB8,0xF2,0x50,0x00,0x00,0x00,0x00,0xCD,0xFF,0x5A,0x00,0x00,0x00,0x28,0xFF,
0xF4,0x0B,0x00,0x00,0x00,0x83,0xFF,0xA4,0x00,0x00,0x00,0x00,0xDD,0xFF,0x49,0x00,
0x00,0x00,0x39,0xFF,0xEA,0x04,0x00,0x00,0x00,0x94,0xFF,0x93,0x00,0x00,0x00,0x04,
0xEA,0xFF,0x38,0x00,0x00,0x00,0x4A,0xFF,0xDC,0x00,0x00,0x00,0x00,0xA5,0xFF,0x82,
0x00,0x00,0x00,0x0B,0xF4,0xFF,0x27,0x00,0x00,0x00,0x5B,0xFF,0xCC,0x00,0x00,0x00,
0x00,0xB6,0xFF,0x71,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0xD7,0xF7,0xDE,0x76,0x01,
0x00,0x00,0x6B,0xFF,0xFF,0xF9,0xFF,0xFF,0x7A,0x00,0x04,0xE6,0xFF,0x94,0x01,0x7D,
0xFF,0xF3,0x0C,0x2F,0xFF,0xFF,0x2C,0x00,0x12,0xFF,0xFF,0x4C,0x56,0xFF,0xFF,0x08,
0x00,0x00,0xEA,0xFF,0x77,0x65,0xFF,0xFA,0x00,0x00,0x00,0xDB,0xFF,0x89,0x66,0xFF,
0xFD,0x00,0x00,0x00,0xDB,0xFF,0x88,0x55,0xFF,0xFF,0x0A,0x00,0x00,0xE9,0xFF,0x79,
0x2C,0xFF,0xFF,0x30,0x00,0x10,0xFF,0xFF,0x50,0x00,0xE1,0xFF,0x93,0x03,0x83,0xFF,
0xF8,0x14,0x00,0x61,0xFF,0xFF,0xFB,0xFF,0xFF,0x8A,0x00,0x00,0x00,0x66,0xD8,0xF8,
0xDE,0x7C,0x02,0x00,0x00,0x00,0x00,0x20,0xD5,0xFF,0x9C,0x00,0x00,0x39,0xE9,0xFF,
0xFF,0x9C,0x00,0x58,0xF7,0xFF,0xF8,0xFF,0x9C,0x01,0xC2,0xFE,0x7A,0xC7,0xFF,0x9C,
0x00,0x1A,0x52,0x00,0xCE,0xFF,0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0x9C,0x00,0x00,
0x00,0x00,0xD0,0xFF,0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0x9C,0x00,0x00,0x00,0x00,
0xD0,0xFF,0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,
0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0x9C,0x00,0x1E,0x92,0xE2,0xFA,0xE7,0x93,0x0D,
0x00,0x26,0xF1,0xFF,0xFF,0xF9,0xFF,0xFF,0xBB,0x00,0x00,0xAB,0xC4,0x2E,0x00,0x67,
0xFF,0xFF,0x2C,0x00,0x0A,0x05,0x00,0x00,0x25,0xFF,0xFF,0x44,0x00,0x00,0x00,0x00,
0x00,0x5F,0xFF,0xFF,0x1E,0x00,0x00,0x00,0x00,0x13,0xE2,0xFF,0xB8,0x00,0x00,0x00,
0x00,0x07,0xC1,0xFF,0xED,0x1F,0x00,0x00,0x00,0x02,0xAA,0xFF,0xF5,0x3A,0x00,0x00,
0x00,0x00,0x96,0xFF,0xF5,0x41,0x00,0x00,0x00,0x00,0x81,0xFF,0xF4,0x40,0x00,0x00,
0x00,0x00,0x45,0xFF,0xFF,0xFA,0xF0,0xF0,0xF0,0xF0,0x96,0x5C,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xA0,0x01,0x52,0xBD,0xEF,0xF8,0xDC,0x8B,0x12,0x00,0x23,0xF8,0xFF,
0xFD,0xF9,0xFF,0xFF,0xCA,0x00,0x00,0x6F,0x6B,0x0A,0x01,0x82,0xFF,0xFF,0x20,0x00,
0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x10,0x00,0x00,0x00,0x04,0x24,0xB1,0xFF,0xA5,
0x00,0x00,0x00,0xA0,0xFF,0xFF,0xF6,0x7F,0x05,0x00,0x00,0x00,0x96,0xF3,0xFE,0xFF,
0xEC,0x72,0x00,0x00,0x00,0x00,0x00,0x0C,0x7B,0xFF,0xFF,0x44,0x00,0x00,0x00,0x00,
0x00,0x13,0xFF,0xFF,0x79,0x3C,0x5A,0x14,0x00,0x09,0x86,0xFF,0xFF,0x56,0x64,0xFF,
0xFF,0xF7,0xFF,0xFF,0xFF,0xCB,0x06,0x2C,0xA8,0xE0,0xF6,0xF5,0xD4,0x83,0x0D,0x00,
0x00,0x00,0x00,0x00,0x16,0xEF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xFF,
0x80,0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x05,0xD6,0xFF,
0xEF,0xFF,0x80,0x00,0x00,0x00,0x79,0xFF,0xB1,0xCE,0xFF,0x80,0x00,0x00,0x1F,0xF5,
0xF1,0x1C,0xD5,0xFF,0x80,0x00,0x00,0xB2,0xFF,0x64,0x00,0xD8,0xFF,0x80,0x00,0x4E,
0xFF,0xBB,0x00,0x00,0xD8,0xFF,0x80,0x00,0xB8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xE0,0xB0,0xF0,0xF0,0xF0,0xF0,0xFD,0xFF,0xF8,0xD2,0x00,0x00,0x00,0x00,0x00,0xD8,
0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0x80,0x00,0x00,0x99,0xFF,0xFF,
0xFF,0xFF,0xFF,0xA0,0x00,0x00,0xAC,0xFF,0xF8,0xF0,0xF0,0xF0,0x96,0x00,0x00,0xBF,
0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0xD2,0xFF,0x68,0x00,0x00,0x00,0x00,0x00,
0x00,0xE5,0xFF,0xE2,0xE9,0xDA,0x89,0x0B,0x00,0x00,0xE9,0xFF,0xFF,0xFF,0xFF,0xFF,
0xBD,0x00,0x00,0x17,0x2E,0x08,0x1E,0xA9,0xFF,0xFF,0x39,0x00,0x00,0x00,0x00,0x00,
0x19,0xFF,0xFF,0x62,0x00,0x00,0x00,0x00,0x00,0x19,0xFF,0xFF,0x5A,0x29,0x7A,0x24,
0x02,0x0D,0x9F,0xFF,0xFD,0x1F,0x38,0xFF,0xFF,0xFA,0xFE,0xFF,0xFF,0x8E,0x00,0x18,
0xA5,0xE2,0xF8,0xF5,0xCB,0x66,0x00,0x00,0x00,0x00,0x06,0x6D,0xC7,0xF0,0xFF,0xCA,
0x00,0x00,0x08,0xC1,0xFF,0xFF,0xFF,0xF5,0xD3,0x00,0x00,0x87,0xFF,0xE5,0x50,0x07,
0x00,0x05,0x00,0x01,0xEB,0xFF,0x3D,0x00,0x00,0x00,0x00,0x00,0x31,0xFF,0xE8,0x48,
0xCC,0xE4,0xB4,0x28,0x00,0x57,0xFF,0xEC,0xF8,0xFF,0xFF,0xFF,0xEC,0x10,0x69,0xFF,
0xFF,0x94,0x0C,0x42,0xFC,0xFF,0x6D,0x62,0xFF,0xFD,0x09,0x00,0x00,0xC6,0xFF,0x93,
0x42,0xFF,0xFF,0x18,0x00,0x00,0xCA,0xFF,0x92,0x06,0xED,0xFF,0x9E,0x03,0x3F,0xFD,
0xFF,0x5D,0x00,0x60,0xFF,0xFF,0xFA,0xFF,0xFF,0xD6,0x08,0x00,0x00,0x52,0xCB,0xF6,
0xEC,0xA2,0x17,0x00,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA0,0x87,0xF0,0xF0,
0xF0,0xF0,0xF0,0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x2D,0xFF,0xFF,0x31,0x00,
0x00,0x00,0x00,0x00,0x9A,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x11,0xF5,0xFF,0x5F,
0x00,0x00,0x00,0x00,0x00,0x74,0xFF,0xED,0x08,0x00,0x00,0x00,0x00,0x02,0xDE,0xFF,
0x8D,0x00,0x00,0x00,0x00,0x00,0x4E,0xFF,0xFE,0x25,0x00,0x00,0x00,0x00,0x00,0xBB,
0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x29,0xFF,0xFF,0x52,0x00,0x00,0x00,0x00,0x00,
0x95,0xFF,0xE5,0x04,0x00,0x00,0x00,0x00,0x0E,0xF3,0xFF,0x80,0x00,0x00,0x00,0x00,
0x00,0x0A,0x8A,0xDF,0xFA,0xE7,0x9B,0x16,0x00,0x00,0xAF,0xFF,0xFF,0xF9,0xFF,0xFF,
0xD0,0x02,0x0B,0xFF,0xFF,0x75,0x00,0x53,0xFF,0xFF,0x2A,0x04,0xFA,0xFF,0x4A,0x00,
0x26,0xFF,0xFF,0x1D,0x00,0x8F,0xFF,0xE7,0x6E,0xD8,0xFF,0xA9,0x00,0x00,0x01,0x9F,
0xFF,0xFF,0xFF,0x9E,0x06,0x00,0x00,0x4F,0xF1,0xFF,0xE9,0xFF,0xF0,0x50,0x00,0x1D,
0xF7,0xFF,0x68,0x02,0x75,0xFE,0xF9,0x32,0x60,0xFF,0xDA,0x00,0x00,0x00,0xB9,0xFF,
0x88,0x5D,0xFF,0xF7,0x38,0x00,0x24,0xE6,0xFF,0x78,0x10,0xE6,0xFF,0xFF,0xF7,0xFF,
0xFF,0xEA,0x19,0x00,0x1E,0x9B,0xDF,0xF9,0xE8,0xA4,0x22,0x00,0x00,0x0A,0x8F,0xE5,
0xF8,0xD4,0x66,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xFA,0xFF,0xFF,0x82,0x00,0x39,0xFF,
0xFF,0x5F,0x01,0x80,0xFF,0xFC,0x1B,0x6F,0xFF,0xEA,0x00,0x00,0x03,0xF4,0xFF,0x66,
0x6F,0xFF,0xE5,0x00,0x00,0x00,0xE6,0xFF,0x85,0x4A,0xFF,0xFF,0x5A,0x10,0x78,0xFF,
0xFF,0x8B,0x04,0xD7,0xFF,0xFF,0xFF,0xFC,0xE2,0xFF,0x78,0x00,0x1B,0xA9,0xE2,0xD7,
0x5B,0xC9,0xFF,0x51,0x00,0x00,0x00,0x00,0x00,0x22,0xFC,0xFD,0x10,0x00,0x04,0x00,
0x04,0x3E,0xD4,0xFF,0xA7,0x00,0x00,0xAF,0xF3,0xFD,0xFF,0xFF,0xD6,0x14,0x00,0x00,
0xA8,0xFF,0xF4,0xD1,0x7F,0x0D,0x00,0x00,0x00,0xB8,0xF1,0x51,0x0D,0xFF,0xFF,0x99,
0x00,0x90,0xCA,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x90,0xC9,0x3A,0x0E,0xFF,0xFF,0x99,0x00,0xB8,0xF2,0x50,0x00,0xB8,0xF1,0x51,
0x0D,0xFF,0xFF,0x99,0x00,0x90,0xCA,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,0xFF,0x75,0x03,0xF8,0xFF,0x29,
0x2F,0xFF,0xCF,0x00,0x65,0xFF,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x86,
0x66,0x00,0x00,0x00,0x00,0x13,0x87,0xF3,0xFF,0x6F,0x00,0x00,0x13,0x87,0xF3,0xFF,
0xC8,0x51,0x02,0x10,0x88,0xF3,0xFF,0xB6,0x3F,0x00,0x00,0x00,0x4F,0xFF,0xFF,0xA7,
0x17,0x00,0x00,0x00,0x00,0x04,0x58,0xC9,0xFF,0xFA,0xA8,0x40,0x00,0x00,0x00,0x00,
0x00,0x3B,0xAC,0xFC,0xFF,0xD6,0x3F,0x00,0x00,0x00,0x00,0x00,0x21,0x8F,0xF2,0x74,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x25,0x00,0x00,0x00,0x4B,0xF0,0xF0,0xF0,
0xF0,0xF0,0xF0,0xF0,0x6C,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x74,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x6C,
0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x49,0x98,0x1E,0x00,
0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xF9,0x98,0x1E,0x00,0x00,0x00,0x00,0x00,0x41,
0xB8,0xFF,0xFA,0x99,0x1F,0x00,0x00,0x00,0x00,0x00,0x2F,0xA6,0xFC,0xFA,0x99,0x1B,
0x00,0x00,0x00,0x00,0x0E,0x8D,0xFF,0xFF,0x73,0x00,0x00,0x31,0x9A,0xF4,0xFF,0xD7,
0x68,0x09,0x29,0xC8,0xFF,0xFF,0xBC,0x4B,0x01,0x00,0x00,0x50,0xF8,0x9E,0x2D,0x00,
0x00,0x00,0x00,0x00,0x1C,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x33,0x9C,0xE0,0xFA,0xE5,0xA3,0x1C,0x00,0xB4,0xFF,0xFF,0xF9,0xFF,0xFF,0xD2,0x03,
0x33,0x77,0x1E,0x00,0x3E,0xFF,0xFF,0x2D,0x00,0x00,0x00,0x00,0x2B,0xFF,0xFF,0x1E,
0x00,0x00,0x00,0x2D,0xDD,0xFF,0xA8,0x00,0x00,0x00,0x38,0xF3,0xFF,0xA0,0x06,0x00,
0x00,0x00,0xBA,0xFF,0x8C,0x00,0x00,0x00,0x00,0x00,0xAB,0xCC,0x2E,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x92,0xC9,0x3A,0x00,0x00,0x00,
0x00,0x0E,0xFF,0xFF,0x99,0x00,0x00,0x00,0x00,0x00,0xBA,0xF2,0x50,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3D,0xA4,0xE2,0xF8,0xE5,0xB3,0x48,0x00,0x00,0x00,0x00,0x00,
0x03,0x98,0xFF,0xFF,0xFF,0xF8,0xFF,0xFF,0xFF,0x95,0x01,0x00,0x00,0x00,0x96,0xFF,
0xE0,0x63,0x14,0x00,0x0A,0x58,0xE4,0xFF,0x70,0x00,0x00,0x3C,0xFF,0xD5,0x15,0x60,
0xD5,0xF7,0xE1,0xB2,0x45,0xEC,0xEF,0x08,0x00,0xAD,0xFF,0x38,0x68,0xFF,0xFF,0xF7,
0xFF,0xFF,0x4D,0x7D,0xFF,0x4F,0x04,0xF2,0xD3,0x03,0xEB,0xFD,0x4C,0x00,0x84,0xFF,
0x41,0x3D,0xFF,0x73,0x20,0xFF,0x9F,0x2C,0xFF,0xB2,0x00,0x00,0x90,0xFF,0x35,0x2F,
0xFF,0x84,0x2E,0xFF,0x8C,0x36,0xFF,0x94,0x00,0x00,0xB0,0xFF,0x2A,0x49,0xFF,0x6D,
0x1B,0xFF,0xA0,0x16,0xFF,0xD8,0x19,0x32,0xF4,0xFF,0x4D,0xA6,0xFF,0x34,0x03,0xF1,
0xDF,0x02,0xB2,0xFF,0xFF,0xFF,0xDC,0xF3,0xFF,0xFF,0xCF,0x00,0x00,0xA1,0xFF,0x6E,
0x10,0xA2,0xE1,0xC2,0x20,0x5D,0xE4,0xBF,0x23,0x00,0x00,0x23,0xF2,0xFE,0x95,0x31,
0x08,0x07,0x18,0x3B,0x52,0x00,0x00,0x00,0x00,0x00,0x44,0xEB,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x79,0xC3,0xE0,0xE2,0xC3,0x86,
0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,0xFF,0x27,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x79,0xFF,0xFF,0xFF,0x7D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,
0xFF,0xAE,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0xFF,0xFE,0x25,0xFA,0xFF,
0x2B,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xCA,0x00,0xBD,0xFF,0x81,0x00,0x00,0x00,
0x00,0x00,0xD1,0xFF,0x7E,0x00,0x6E,0xFF,0xD8,0x00,0x00,0x00,0x00,0x27,0xFF,0xFF,
0x32,0x00,0x20,0xFF,0xFF,0x2F,0x00,0x00,0x00,0x7D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x85,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDC,0x00,0x00,
0x29,0xFF,0xFF,0x55,0x0C,0x0C,0x0C,0x4E,0xFF,0xFF,0x33,0x00,0x7F,0xFF,0xFA,0x0C,
0x00,0x00,0x00,0x08,0xF6,0xFF,0x89,0x00,0xD5,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,
0xB5,0xFF,0xDF,0x00,0x90,0xFF,0xFF,0xFF,0xF9,0xE4,0xAD,0x3A,0x00,0x90,0xFF,0xFD,
0xF0,0xF8,0xFF,0xFF,0xFB,0x31,0x90,0xFF,0xDC,0x00,0x00,0x47,0xFD,0xFF,0x87,0x90,
0xFF,0xDC,0x00,0x00,0x00,0xE6,0xFF,0x91,0x90,0xFF,0xDC,0x00,0x00,0x45,0xFD,0xFF,
0x5C,0x90,0xFF,0xFD,0xF0,0xF7,0xFF,0xFB,0x98,0x03,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xC2,0x24,0x90,0xFF,0xDC,0x00,0x05,0x34,0xE8,0xFF,0xB5,0x90,0xFF,0xDC,0x00,
0x00,0x00,0xA7,0xFF,0xE1,0x90,0xFF,0xDC,0x00,0x00,0x27,0xE7,0xFF,0xC8,0x90,0xFF,
0xFD,0xF0,0xF4,0xFF,0xFF,0xFE,0x54,0x90,0xFF,0xFF,0xFF,0xFE,0xE7,0xB7,0x40,0x00,
0x00,0x00,0x00,0x44,0xB5,0xE7,0xF6,0xD7,0x9A,0x31,0x00,0x00,0x75,0xFF,0xFF,0xFE,
0xF7,0xFF,0xFF,0x59,0x00,0x36,0xFD,0xFF,0xA7,0x13,0x00,0x34,0x9D,0x08,0x00,0xA6,
0xFF,0xEC,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0xFF,0x9A,0x00,0x00,0x00,0x00,
0x00,0x00,0x08,0xFF,0xFF,0x7A,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xFF,0xFF,0x77,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0xFF,0x93,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xB8,0xFF,0xE0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0xFF,0xFF,0x92,0x0E,
0x00,0x15,0x58,0x1B,0x00,0x00,0xA8,0xFF,0xFF,0xFD,0xF7,0xFF,0xFF,0x34,0x00,0x00,
0x02,0x6A,0xCB,0xF0,0xF7,0xE1,0xA7,0x19,0x90,0xFF,0xFF,0xFF,0xF3,0xD6,0x8C,0x1E,
0x00,0x00,0x90,0xFF,0xFD,0xF0,0xFA,0xFF,0xFF,0xF0,0x46,0x00,0x90,0xFF,0xDC,0x00,
0x05,0x3B,0xD6,0xFF,0xEE,0x19,0x90,0xFF,0xDC,0x00,0x00,0x00,0x1D,0xFA,0xFF,0x7D,
0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0xBE,0xFF,0xC2,0x90,0xFF,0xDC,0x00,0x00,0x00,
0x00,0x9E,0xFF,0xDD,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0xA0,0xFF,0xDB,0x90,0xFF,
0xDC,0x00,0x00,0x00,0x00,0xC6,0xFF,0xBE,0x90,0xFF,0xDC,0x00,0x00,0x00,0x27,0xFD,
0xFF,0x7A,0x90,0xFF,0xDC,0x00,0x02,0x40,0xDA,0xFF,0xEC,0x12,0x90,0xFF,0xFD,0xF0,
0xFB,0xFF,0xFF,0xEB,0x3B,0x00,0x90,0xFF,0xFF,0xFF,0xF2,0xCD,0x83,0x16,0x00,0x00,
0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,0x90,0xFF,0xFD,0xF0,0xF0,0xF0,0xF0,0x03,
0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,
0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xFD,0xF0,0xF0,0xF0,0xB0,0x00,
0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xBC,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,
0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,
0x90,0xFF,0xFD,0xF0,0xF0,0xF0,0xF0,0x03,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,
0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x90,0xFF,0xFD,0xF0,0xF0,0xF0,0xEC,0x90,0xFF,
0xD4,0x00,0x00,0x00,0x00,0x90,0xFF,0xD4,0x00,0x00,0x00,0x00,0x90,0xFF,0xD4,0x00,
0x00,0x00,0x00,0x90,0xFF,0xFD,0xF0,0xF0,0xF0,0xA8,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,
0xB4,0x90,0xFF,0xD4,0x00,0x00,0x00,0x00,0x90,0xFF,0xD4,0x00,0x00,0x00,0x00,0x90,
0xFF,0xD4,0x00,0x00,0x00,0x00,0x90,0xFF,0xD4,0x00,0x00,0x00,0x00,0x90,0xFF,0xD4,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x96,0xDA,0xF5,0xEF,0xD2,0x8E,0x14,0x00,
0x00,0x5E,0xF8,0xFF,0xFF,0xFA,0xFE,0xFF,0xE8,0x06,0x00,0x2F,0xF9,0xFF,0xDA,0x3F,
0x02,0x07,0x36,0x4C,0x00,0x00,0xA2,0xFF,0xF5,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xEB,0xFF,0xA5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xFF,0xFF,0x78,0x00,
0x34,0xF0,0xF0,0xF0,0xF0,0x47,0x0C,0xFF,0xFF,0x73,0x00,0x38,0xFF,0xFF,0xFF,0xFF,
0x4C,0x00,0xF3,0xFF,0x93,0x00,0x00,0x00,0x10,0xFF,0xFF,0x4C,0x00,0xBB,0xFF,0xE1,
0x06,0x00,0x00,0x10,0xFF,0xFF,0x4C,0x00,0x54,0xFF,0xFF,0xAA,0x18,0x00,0x19,0xFF,
0xFF,0x4C,0x00,0x00,0x9E,0xFF,0xFF,0xFF,0xF5,0xFE,0xFF,0xFF,0x4C,0x00,0x00,0x01,
0x5E,0xC3,0xF1,0xFA,0xE9,0xCF,0x96,0x20,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x9C,
0xFF,0xCC,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x9C,0xFF,0xCC,0x90,0xFF,0xDC,0x00,
0x00,0x00,0x00,0x9C,0xFF,0xCC,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x9C,0xFF,0xCC,
0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x9C,0xFF,0xCC,0x90,0xFF,0xFD,0xF0,0xF0,0xF0,
0xF0,0xF9,0xFF,0xCC,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCC,0x90,0xFF,
0xDC,0x00,0x00,0x00,0x00,0x9C,0xFF,0xCC,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x9C,
0xFF,0xCC,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x9C,0xFF,0xCC,0x90,0xFF,0xDC,0x00,
0x00,0x00,0x00,0x9C,0xFF,0xCC,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x9C,0xFF,0xCC,
0x7C,0xFF,0xFF,0xFF,0xFF,0xB8,0x50,0xF0,0xFF,0xFF,0xFB,0x80,0x00,0x21,0xFF,0xFF,
0x59,0x00,0x00,0x18,0xFF,0xFF,0x50,0x00,0x00,0x18,0xFF,0xFF,0x50,0x00,0x00,0x18,
0xFF,0xFF,0x50,0x00,0x00,0x18,0xFF,0xFF,0x50,0x00,0x00,0x18,0xFF,0xFF,0x50,0x00,
0x00,0x18,0xFF,0xFF,0x50,0x00,0x00,0x1A,0xFF,0xFF,0x52,0x00,0x44,0xE1,0xFF,0xFF,
0xF1,0x6F,0x7C,0xFF,0xFF,0xFF,0xFF,0xB8,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,
0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x90,0xFF,0xDC,
0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x90,
0xFF,0xDC,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,
0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x90,0xFF,0xDB,0x00,0x00,0x00,0x9C,0xFF,0xCC,
0x06,0x0A,0x22,0xE2,0xFF,0x9E,0x30,0xFF,0xFF,0xFF,0xFB,0x32,0x27,0xE5,0xE8,0xBD,
0x41,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x78,0xFF,0xFC,0x3C,0x90,0xFF,
0xDC,0x00,0x00,0x3B,0xFB,0xFF,0x79,0x00,0x90,0xFF,0xDC,0x00,0x14,0xE3,0xFF,0xB8,
0x01,0x00,0x90,0xFF,0xDC,0x01,0xB6,0xFF,0xE5,0x15,0x00,0x00,0x90,0xFF,0xDC,0x70,
0xFF,0xFC,0x3F,0x00,0x00,0x00,0x90,0xFF,0xF0,0xF6,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0x4E,0x00,0x00,0x00,0x90,0xFF,0xF5,0x49,0xCE,0xFF,
0xDF,0x09,0x00,0x00,0x90,0xFF,0xDC,0x00,0x39,0xFE,0xFF,0x83,0x00,0x00,0x90,0xFF,
0xDC,0x00,0x00,0x9F,0xFF,0xF8,0x24,0x00,0x90,0xFF,0xDC,0x00,0x00,0x16,0xF0,0xFF,
0xB7,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x6D,0xFF,0xFF,0x52,0x90,0xFF,0xDC,0x00,
0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,
0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,
0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,
0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,
0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x04,0x04,0x04,0x04,0x02,0x90,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x80,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x90,0xFF,0xFF,0xE1,
0x00,0x00,0x00,0x00,0x00,0xCC,0xFF,0xFF,0xA4,0x90,0xFF,0xFF,0xFF,0x2C,0x00,0x00,
0x00,0x1C,0xFF,0xFF,0xFF,0xA4,0x90,0xFF,0xFF,0xFF,0x77,0x00,0x00,0x00,0x6C,0xFF,
0xF6,0xFF,0xA4,0x90,0xFF,0xD3,0xFF,0xC2,0x00,0x00,0x00,0xBC,0xFF,0xB6,0xFF,0xA4,
0x90,0xFF,0x95,0xFA,0xFC,0x11,0x00,0x10,0xFB,0xDB,0x93,0xFF,0xA4,0x90,0xFF,0x90,
0xBB,0xFF,0x59,0x00,0x5C,0xFF,0x8B,0x99,0xFF,0xA4,0x90,0xFF,0x96,0x6D,0xFF,0xA4,
0x00,0xAC,0xFF,0x3B,0x9B,0xFF,0xA4,0x90,0xFF,0x98,0x1F,0xFF,0xEC,0x0A,0xF3,0xE8,
0x02,0x9C,0xFF,0xA4,0x90,0xFF,0x98,0x00,0xCF,0xFF,0x86,0xFF,0x99,0x00,0x9C,0xFF,
0xA4,0x90,0xFF,0x98,0x00,0x81,0xFF,0xFA,0xFF,0x49,0x00,0x9C,0xFF,0xA4,0x90,0xFF,
0x98,0x00,0x32,0xFF,0xFF,0xF1,0x06,0x00,0x9C,0xFF,0xA4,0x90,0xFF,0x98,0x00,0x00,
0xE2,0xFF,0xA8,0x00,0x00,0x9C,0xFF,0xA4,0x90,0xFF,0xFF,0xC5,0x00,0x00,0x00,0x00,
0x9C,0xFF,0x90,0x90,0xFF,0xFF,0xFF,0x52,0x00,0x00,0x00,0x9C,0xFF,0x90,0x90,0xFF,
0xFF,0xFF,0xD9,0x04,0x00,0x00,0x9C,0xFF,0x90,0x90,0xFF,0xAF,0xFF,0xFF,0x6B,0x00,
0x00,0x9C,0xFF,0x90,0x90,0xFF,0x81,0xA8,0xFF,0xEA,0x0E,0x00,0x9C,0xFF,0x90,0x90,
0xFF,0x8D,0x21,0xF8,0xFF,0x85,0x00,0x9B,0xFF,0x90,0x90,0xFF,0x96,0x00,0x8C,0xFF,
0xF5,0x1B,0x96,0xFF,0x90,0x90,0xFF,0x98,0x00,0x10,0xED,0xFF,0x9E,0x8E,0xFF,0x90,
0x90,0xFF,0x98,0x00,0x00,0x71,0xFF,0xFD,0xB2,0xFF,0x90,0x90,0xFF,0x98,0x00,0x00,
0x06,0xDC,0xFF,0xFF,0xFF,0x90,0x90,0xFF,0x98,0x00,0x00,0x00,0x55,0xFF,0xFF,0xFF,
0x90,0x90,0xFF,0x98,0x00,0x00,0x00,0x00,0xC6,0xFF,0xFF,0x90,0x00,0x00,0x00,0x50,
0xB9,0xE6,0xF8,0xE0,0xA2,0x2F,0x00,0x00,0x00,0x00,0x8E,0xFF,0xFF,0xFF,0xF6,0xFF,
0xFF,0xF8,0x50,0x00,0x00,0x4A,0xFF,0xFF,0xA6,0x14,0x00,0x28,0xD0,0xFF,0xEE,0x14,
0x00,0xB4,0xFF,0xEE,0x09,0x00,0x00,0x00,0x39,0xFF,0xFF,0x6C,0x00,0xF1,0xFF,0xA2,
0x00,0x00,0x00,0x00,0x00,0xE5,0xFF,0xAC,0x09,0xFF,0xFF,0x85,0x00,0x00,0x00,0x00,
0x00,0xC9,0xFF,0xC4,0x09,0xFF,0xFF,0x85,0x00,0x00,0x00,0x00,0x00,0xC9,0xFF,0xC4,
0x00,0xEF,0xFF,0xA2,0x00,0x00,0x00,0x00,0x00,0xE5,0xFF,0xAB,0x00,0xB0,0xFF,0xED,
0x08,0x00,0x00,0x00,0x37,0xFF,0xFF,0x6A,0x00,0x47,0xFF,0xFF,0xA3,0x13,0x00,0x27,
0xCE,0xFF,0xEC,0x13,0x00,0x00,0x8B,0xFF,0xFF,0xFE,0xF5,0xFF,0xFF,0xF7,0x4E,0x00,
0x00,0x00,0x00,0x50,0xB9,0xE8,0xF8,0xE0,0xA1,0x2D,0x00,0x00,0x90,0xFF,0xFF,0xFF,
0xF9,0xD9,0x82,0x07,0x00,0x90,0xFF,0xFD,0xF0,0xFD,0xFF,0xFF,0xA8,0x00,0x90,0xFF,
0xDC,0x00,0x0A,0xA3,0xFF,0xFF,0x22,0x90,0xFF,0xDC,0x00,0x00,0x2F,0xFF,0xFF,0x4C,
0x90,0xFF,0xDC,0x00,0x00,0x38,0xFF,0xFF,0x42,0x90,0xFF,0xDC,0x01,0x24,0xBE,0xFF,
0xF8,0x0E,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x79,0x00,0x90,0xFF,0xFD,0xEF,0xE2,
0xBC,0x56,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,
0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x90,
0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xB9,0xE6,0xF8,0xE0,
0xA2,0x2F,0x00,0x00,0x00,0x00,0x8E,0xFF,0xFF,0xFF,0xF6,0xFF,0xFF,0xF8,0x50,0x00,
0x00,0x4A,0xFF,0xFF,0xA6,0x14,0x00,0x28,0xD0,0xFF,0xED,0x13,0x00,0xB4,0xFF,0xEE,
0x09,0x00,0x00,0x00,0x39,0xFF,0xFF,0x6A,0x00,0xF1,0xFF,0xA2,0x00,0x00,0x00,0x00,
0x00,0xE5,0xFF,0xAB,0x09,0xFF,0xFF,0x85,0x00,0x00,0x00,0x00,0x00,0xC9,0xFF,0xC4,
0x09,0xFF,0xFF,0x85,0x00,0x00,0x00,0x00,0x00,0xC9,0xFF,0xC4,0x00,0xEF,0xFF,0xA2,
0x00,0x00,0x00,0x00,0x00,0xE5,0xFF,0xAB,0x00,0xB0,0xFF,0xED,0x08,0x00,0x00,0x00,
0x37,0xFF,0xFF,0x6D,0x00,0x47,0xFF,0xFF,0xA3,0x13,0x00,0x27,0xCE,0xFF,0xF1,0x17,
0x00,0x00,0x8B,0xFF,0xFF,0xFE,0xF5,0xFF,0xFF,0xFA,0x56,0x00,0x00,0x00,0x00,0x50,
0xB9,0xE8,0xFE,0xFF,0xFF,0x4A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xE9,
0xFF,0xD3,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0xF8,0xFF,0xC8,0x0C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0x7C,0x7C,0x40,0x90,0xFF,0xFF,0xFF,
0xF4,0xCF,0x76,0x05,0x00,0x00,0x90,0xFF,0xFD,0xF2,0xFF,0xFF,0xFF,0xA4,0x00,0x00,
0x90,0xFF,0xDC,0x00,0x11,0xA8,0xFF,0xFF,0x20,0x00,0x90,0xFF,0xDC,0x00,0x00,0x30,
0xFF,0xFF,0x4B,0x00,0x90,0xFF,0xDC,0x00,0x00,0x36,0xFF,0xFF,0x45,0x00,0x90,0xFF,
0xDC,0x01,0x21,0xB8,0xFF,0xEC,0x0D,0x00,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xF9,0x4F,
0x00,0x00,0x90,0xFF,0xFD,0xF0,0xFD,0xFF,0x71,0x00,0x00,0x00,0x90,0xFF,0xDC,0x00,
0x78,0xFF,0xEB,0x19,0x00,0x00,0x90,0xFF,0xDC,0x00,0x03,0xC9,0xFF,0xBC,0x02,0x00,
0x90,0xFF,0xDC,0x00,0x00,0x29,0xF8,0xFF,0x79,0x00,0x90,0xFF,0xDC,0x00,0x00,0x00,
0x76,0xFF,0xFB,0x37,0x00,0x05,0x70,0xD3,0xF4,0xE8,0xC0,0x6D,0x05,0x00,0x9B,0xFF,
0xFF,0xF9,0xFF,0xFF,0xD5,0x00,0x0C,0xFB,0xFF,0x7F,0x00,0x12,0x5F,0x53,0x00,0x1E,
0xFF,0xFF,0x5B,0x00,0x00,0x00,0x00,0x00,0x04,0xEB,0xFF,0xF2,0x73,0x08,0x00,0x00,
0x00,0x00,0x54,0xFC,0xFF,0xFF,0xE3,0x54,0x00,0x00,0x00,0x00,0x3E,0xD2,0xFF,0xFF,
0xFF,0x72,0x00,0x00,0x00,0x00,0x02,0x5D,0xED,0xFF,0xF5,0x0A,0x00,0x00,0x00,0x00,
0x00,0x49,0xFF,0xFF,0x25,0x3A,0x9D,0x3D,0x04,0x01,0x7B,0xFF,0xFA,0x0D,0x44,0xFF,
0xFF,0xFC,0xF9,0xFF,0xFF,0x8D,0x00,0x1A,0x98,0xDA,0xF4,0xEE,0xC9,0x5F,0x02,0x00,
0xB0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xA5,0xF0,0xF0,0xF9,0xFF,0xFD,0xF0,
0xF0,0xE1,0x00,0x00,0x00,0x94,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,
0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,
0x94,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0xD8,0x00,0x00,0x00,0x00,
0x00,0x00,0x94,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0xD8,0x00,0x00,
0x00,0x00,0x00,0x00,0x94,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0xD8,
0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0xD8,0x00,0x00,0x00,0xA4,0xFF,0xC8,0x00,
0x00,0x00,0x00,0xB0,0xFF,0xBC,0xA4,0xFF,0xC8,0x00,0x00,0x00,0x00,0xB0,0xFF,0xBC,
0xA4,0xFF,0xC8,0x00,0x00,0x00,0x00,0xB0,0xFF,0xBC,0xA4,0xFF,0xC8,0x00,0x00,0x00,
0x00,0xB0,0xFF,0xBC,0xA4,0xFF,0xC8,0x00,0x00,0x00,0x00,0xB0,0xFF,0xBC,0xA4,0xFF,
0xC8,0x00,0x00,0x00,0x00,0xB0,0xFF,0xBC,0xA4,0xFF,0xC8,0x00,0x00,0x00,0x00,0xB0,
0xFF,0xBC,0xA2,0xFF,0xCF,0x00,0x00,0x00,0x00,0xB7,0xFF,0xBA,0x8E,0xFF,0xEE,0x05,
0x00,0x00,0x01,0xDD,0xFF,0xA3,0x46,0xFF,0xFF,0x95,0x1D,0x19,0x82,0xFF,0xFF,0x5A,
0x00,0xAD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBA,0x02,0x00,0x04,0x74,0xD1,0xF7,0xF4,
0xD1,0x76,0x05,0x00,0xD7,0xFF,0x9A,0x00,0x00,0x00,0x00,0x32,0xFF,0xFF,0x3E,0x84,
0xFF,0xE5,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE8,0x02,0x31,0xFF,0xFF,0x32,0x00,0x00,
0x00,0xCC,0xFF,0x98,0x00,0x00,0xDE,0xFF,0x7F,0x00,0x00,0x1A,0xFE,0xFF,0x45,0x00,
0x00,0x8C,0xFF,0xCB,0x00,0x00,0x66,0xFF,0xED,0x04,0x00,0x00,0x39,0xFF,0xFE,0x19,
0x00,0xB3,0xFF,0x9F,0x00,0x00,0x00,0x01,0xE5,0xFF,0x64,0x09,0xF6,0xFF,0x4C,0x00,
0x00,0x00,0x00,0x94,0xFF,0xAD,0x4B,0xFF,0xF2,0x07,0x00,0x00,0x00,0x00,0x41,0xFF,
0xEA,0x8D,0xFF,0xA6,0x00,0x00,0x00,0x00,0x00,0x03,0xEB,0xFF,0xE0,0xFF,0x53,0x00,
0x00,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF5,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,
0x49,0xFF,0xFF,0xAD,0x00,0x00,0x00,0x00,0xE1,0xFF,0x80,0x00,0x00,0x00,0x88,0xFF,
0xF7,0x07,0x00,0x00,0x09,0xFB,0xFF,0x59,0xA3,0xFF,0xB8,0x00,0x00,0x00,0xC7,0xFF,
0xFF,0x3E,0x00,0x00,0x3E,0xFF,0xFF,0x1B,0x65,0xFF,0xEF,0x01,0x00,0x0B,0xFB,0xFF,
0xFF,0x7E,0x00,0x00,0x77,0xFF,0xDD,0x00,0x27,0xFF,0xFF,0x29,0x00,0x46,0xFF,0xD7,
0xFF,0xBD,0x00,0x00,0xB0,0xFF,0x9F,0x00,0x00,0xE8,0xFF,0x62,0x00,0x86,0xFF,0x7D,
0xFB,0xF6,0x06,0x00,0xE9,0xFF,0x61,0x00,0x00,0xAB,0xFF,0x9A,0x00,0xC5,0xFF,0x41,
0xCD,0xFF,0x3C,0x22,0xFF,0xFF,0x23,0x00,0x00,0x6D,0xFF,0xD3,0x0A,0xFA,0xF9,0x0A,
0x90,0xFF,0x7B,0x5B,0xFF,0xE4,0x00,0x00,0x00,0x2F,0xFF,0xFC,0x48,0xFF,0xC4,0x00,
0x50,0xFF,0xB2,0x8F,0xFF,0xA7,0x00,0x00,0x00,0x02,0xEF,0xFF,0x9E,0xFF,0x85,0x00,
0x12,0xFE,0xE0,0xBD,0xFF,0x69,0x00,0x00,0x00,0x00,0xB3,0xFF,0xEB,0xFF,0x46,0x00,
0x00,0xD0,0xFE,0xEC,0xFF,0x2B,0x00,0x00,0x00,0x00,0x75,0xFF,0xFF,0xFB,0x0B,0x00,
0x00,0x90,0xFF,0xFF,0xEB,0x01,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xC7,0x00,0x00,
0x00,0x50,0xFF,0xFF,0xAF,0x00,0x00,0x00,0x76,0xFF,0xFD,0x31,0x00,0x00,0x00,0x7B,
0xFF,0xF7,0x23,0x05,0xD5,0xFF,0xBF,0x00,0x00,0x16,0xF2,0xFF,0x81,0x00,0x00,0x40,
0xFF,0xFF,0x50,0x00,0x97,0xFF,0xDE,0x08,0x00,0x00,0x00,0xA4,0xFF,0xDA,0x2E,0xFB,
0xFF,0x4D,0x00,0x00,0x00,0x00,0x17,0xF0,0xFF,0xEB,0xFF,0xB4,0x00,0x00,0x00,0x00,
0x00,0x00,0x6F,0xFF,0xFF,0xF7,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0xFF,0xFF,
0xF9,0x2A,0x00,0x00,0x00,0x00,0x00,0x39,0xFE,0xFF,0xDA,0xFF,0xC6,0x02,0x00,0x00,
0x00,0x04,0xD1,0xFF,0xA8,0x2D,0xFC,0xFF,0x6D,0x00,0x00,0x00,0x75,0xFF,0xF4,0x1C,
0x00,0x92,0xFF,0xF3,0x1D,0x00,0x1E,0xF4,0xFF,0x7A,0x00,0x00,0x10,0xEA,0xFF,0xB4,
0x00,0xB1,0xFF,0xDC,0x07,0x00,0x00,0x00,0x64,0xFF,0xFF,0x59,0xBF,0xFF,0xDC,0x04,
0x00,0x00,0x04,0xDC,0xFF,0xB9,0x3C,0xFF,0xFF,0x60,0x00,0x00,0x64,0xFF,0xFF,0x35,
0x00,0xB9,0xFF,0xDC,0x04,0x05,0xE0,0xFF,0xB1,0x00,0x00,0x37,0xFF,0xFF,0x61,0x68,
0xFF,0xFE,0x2E,0x00,0x00,0x00,0xB4,0xFF,0xDD,0xE2,0xFF,0xA9,0x00,0x00,0x00,0x00,
0x32,0xFF,0xFF,0xFF,0xFC,0x28,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0xFF,0xA1,0x00,
0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x34,
0xFF,0xFF,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xFF,0xFF,0x30,0x00,0x00,0x00,
0x00,0x00,0x00,0x34,0xFF,0xFF,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xFF,0xFF,
0x30,0x00,0x00,0x00,0x78,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBC,0x70,0xF0,0xF0,
0xF0,0xF0,0xF2,0xFF,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xF6,0x23,0x00,
0x00,0x00,0x00,0x2A,0xF9,0xFF,0x76,0x00,0x00,0x00,0x00,0x01,0xC5,0xFF,0xCE,0x04,
0x00,0x00,0x00,0x00,0x6B,0xFF,0xFC,0x32,0x00,0x00,0x00,0x00,0x1C,0xF2,0xFF,0x8B,
0x00,0x00,0x00,0x00,0x00,0xB1,0xFF,0xDD,0x09,0x00,0x00,0x00,0x00,0x55,0xFF,0xFF,
0x44,0x00,0x00,0x00,0x00,0x11,0xE7,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x87,0xFF,
0xFF,0xF4,0xF0,0xF0,0xF0,0xF0,0xD2,0x9C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,
0xE0,0xFF,0xFF,0xE4,0xE0,0xFF,0xF2,0xD5,0xE0,0xFF,0x28,0x00,0xE0,0xFF,0x28,0x00,
0xE0,0xFF,0x28,0x00,0xE0,0xFF,0x28,0x00,0xE0,0xFF,0x28,0x00,0xE0,0xFF,0x28,0x00,
0xE0,0xFF,0x28,0x00,0xE0,0xFF,0x28,0x00,0xE0,0xFF,0x28,0x00,0xE0,0xFF,0x28,0x00,
0xE0,0xFF,0x28,0x00,0xE0,0xFF,0xFF,0xE4,0xD2,0xF0,0xF0,0xD5,0xBA,0xFF,0x6D,0x00,
0x00,0x00,0x00,0x5F,0xFF,0xC8,0x00,0x00,0x00,0x00,0x0D,0xF6,0xFF,0x23,0x00,0x00,
0x00,0x00,0xA9,0xFF,0x7E,0x00,0x00,0x00,0x00,0x4E,0xFF,0xD9,0x00,0x00,0x00,0x00,
0x05,0xED,0xFF,0x34,0x00,0x00,0x00,0x00,0x98,0xFF,0x8F,0x00,0x00,0x00,0x00,0x3D,
0xFF,0xE7,0x03,0x00,0x00,0x00,0x01,0xE1,0xFF,0x45,0x00,0x00,0x00,0x00,0x87,0xFF,
0xA0,0x00,0x00,0x00,0x00,0x2C,0xFF,0xF2,0x09,0x00,0x00,0x00,0x00,0xD1,0xFF,0x56,
0x98,0xFF,0xFF,0xFF,0x2C,0x8E,0xF0,0xFD,0xFF,0x2C,0x00,0x00,0xDC,0xFF,0x2C,0x00,
0x00,0xDC,0xFF,0x2C,0x00,0x00,0xDC,0xFF,0x2C,0x00,0x00,0xDC,0xFF,0x2C,0x00,0x00,
0xDC,0xFF,0x2C,0x00,0x00,0xDC,0xFF,0x2C,0x00,0x00,0xDC,0xFF,0x2C,0x00,0x00,0xDC,
0xFF,0x2C,0x00,0x00,0xDC,0xFF,0x2C,0x00,0x00,0xDC,0xFF,0x2C,0x00,0x00,0xDC,0xFF,
0x2C,0x98,0xFF,0xFF,0xFF,0x2C,0x8E,0xF0,0xF0,0xF0,0x29,0x00,0x00,0x00,0x00,0x28,
0x7D,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xA9,0xFF,0x6C,0x00,0x00,0x00,0x00,0x00,
0x21,0xFC,0xFF,0xE6,0x09,0x00,0x00,0x00,0x00,0x92,0xFF,0x85,0xFF,0x74,0x00,0x00,
0x00,0x12,0xF4,0xBD,0x02,0xD4,0xEB,0x0D,0x00,0x00,0x7C,0xFF,0x4C,0x00,0x57,0xFF,
0x7D,0x00,0x08,0xE9,0xDA,0x01,0x00,0x02,0xD5,0xEF,0x10,0x66,0xFF,0x6C,0x00,0x00,
0x00,0x58,0xFF,0x85,0x07,0xF4,0xF4,0xF4,0xF4,0xF4,0xF4,0x94,0x01,0x24,0x24,0x24,
0x24,0x24,0x24,0x15,0x1D,0x7F,0x80,0x3F,0x00,0x00,0x00,0x6A,0xFB,0xED,0x20,0x00,
0x00,0x00,0x3D,0xE3,0xD4,0x0B,0x00,0x00,0x00,0x1D,0x88,0xD0,0xF3,0xEA,0xB9,0x36,
0x00,0x00,0x30,0xFE,0xFF,0xF7,0xFE,0xFF,0xEF,0x1A,0x00,0x00,0x38,0x13,0x00,0x1B,
0xF6,0xFF,0x5C,0x00,0x20,0x97,0xD2,0xEB,0xF0,0xFE,0xFF,0x77,0x0A,0xDD,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x78,0x3C,0xFF,0xFF,0x80,0x10,0x00,0xEC,0xFF,0x78,0x42,0xFF,
0xFF,0x47,0x01,0x59,0xFF,0xFF,0x78,0x12,0xF1,0xFF,0xFF,0xFA,0xFE,0xDE,0xFF,0x78,
0x00,0x48,0xD5,0xF8,0xDA,0x5B,0x5D,0xFF,0x78,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,
0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x97,0x7B,0xEB,0xF3,0xA5,0x0F,0x00,
0xC0,0xFF,0xEB,0xFF,0xFB,0xFF,0xFF,0xB3,0x00,0xC0,0xFF,0xF7,0x31,0x04,0x9B,0xFF,
0xFF,0x23,0xC0,0xFF,0xB6,0x00,0x00,0x25,0xFF,0xFF,0x55,0xC0,0xFF,0xA3,0x00,0x00,
0x0E,0xFF,0xFF,0x64,0xC0,0xFF,0xBC,0x00,0x00,0x29,0xFF,0xFF,0x55,0xC0,0xFF,0xF9,
0x38,0x04,0x9E,0xFF,0xFF,0x21,0xC0,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xB0,0x00,0xC0,
0xFF,0x54,0xA1,0xF2,0xF2,0xA1,0x0D,0x00,0x00,0x00,0x4F,0xC2,0xF2,0xF0,0xCC,0x5C,
0x00,0x64,0xFF,0xFF,0xFD,0xFC,0xFF,0x63,0x04,0xEA,0xFF,0xBF,0x10,0x07,0x46,0x0D,
0x2E,0xFF,0xFF,0x49,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,0x2E,0x00,0x00,0x00,0x00,
0x36,0xFF,0xFF,0x47,0x00,0x00,0x00,0x00,0x0A,0xF7,0xFF,0xBD,0x0F,0x05,0x39,0x41,
0x00,0x88,0xFF,0xFF,0xFD,0xFC,0xFF,0x74,0x00,0x02,0x71,0xD6,0xFA,0xF6,0xC3,0x35,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xFF,0xE0,0x00,0x05,0x8E,0xEC,0xF3,
0xA3,0x79,0xFF,0xE0,0x00,0x91,0xFF,0xFF,0xFB,0xFF,0xEF,0xFF,0xE0,0x0B,0xF7,0xFF,
0xB8,0x0A,0x19,0xD6,0xFF,0xE0,0x36,0xFF,0xFF,0x44,0x00,0x00,0x75,0xFF,0xE0,0x45,
0xFF,0xFF,0x2A,0x00,0x00,0x5C,0xFF,0xE0,0x37,0xFF,0xFF,0x41,0x00,0x00,0x71,0xFF,
0xE0,0x0C,0xF8,0xFF,0xB2,0x09,0x15,0xD1,0xFF,0xE0,0x00,0x94,0xFF,0xFF,0xFB,0xFE,
0xE9,0xFF,0xE0,0x00,0x06,0x93,0xEF,0xF1,0x96,0x24,0xFE,0xE0,0x00,0x00,0x52,0xC8,
0xF5,0xF0,0xB3,0x2D,0x00,0x00,0x62,0xFF,0xFF,0xF9,0xFD,0xFF,0xF1,0x22,0x03,0xE9,
0xFF,0x81,0x03,0x0C,0xBA,0xFF,0x90,0x2E,0xFF,0xFF,0xF3,0xF0,0xF0,0xF7,0xFF,0xBC,
0x41,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC4,0x2F,0xFF,0xFF,0x3D,0x00,0x00,0x00,
0x00,0x00,0x04,0xE8,0xFF,0xC0,0x19,0x00,0x10,0x51,0x24,0x00,0x59,0xFE,0xFF,0xFF,
0xF8,0xFF,0xFF,0x44,0x00,0x00,0x43,0xB9,0xEE,0xFC,0xE7,0x9E,0x19,0x00,0x00,0x00,
0x00,0x00,0x72,0xD5,0xF5,0xEB,0x9B,0x00,0x35,0xFF,0xFF,0xFD,0xF9,0x81,0x00,0x5D,
0xFF,0xFF,0x24,0x01,0x05,0x56,0xE5,0xFF,0xFF,0xFF,0xFF,0x14,0xA5,0xF6,0xFF,0xFF,
0xF0,0xF0,0x12,0x00,0x60,0xFF,0xFF,0x04,0x00,0x00,0x00,0x60,0xFF,0xFF,0x04,0x00,
0x00,0x00,0x60,0xFF,0xFF,0x04,0x00,0x00,0x00,0x60,0xFF,0xFF,0x04,0x00,0x00,0x00,
0x60,0xFF,0xFF,0x04,0x00,0x00,0x00,0x60,0xFF,0xFF,0x04,0x00,0x00,0x00,0x60,0xFF,
0xFF,0x04,0x00,0x00,0x00,0x05,0x90,0xEC,0xF3,0xA5,0x47,0xFF,0xE0,0x00,0x85,0xFF,
0xFF,0xFB,0xFF,0xEF,0xFF,0xE0,0x08,0xF1,0xFF,0xB4,0x09,0x18,0xD5,0xFF,0xE0,0x2A,
0xFF,0xFF,0x45,0x00,0x00,0x74,0xFF,0xE0,0x40,0xFF,0xFF,0x2D,0x00,0x00,0x5B,0xFF,
0xE0,0x2B,0xFF,0xFF,0x44,0x00,0x00,0x6B,0xFF,0xE0,0x09,0xF3,0xFF,0xB4,0x09,0x12,
0xC9,0xFF,0xE0,0x00,0x8B,0xFF,0xFF,0xFB,0xFE,0xF0,0xFF,0xE0,0x00,0x07,0x97,0xF0,
0xF1,0x9A,0x85,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x91,0xFF,0xD7,0x00,0x61,
0x3B,0x0C,0x00,0x25,0xE6,0xFF,0xA7,0x00,0xC0,0xFF,0xFF,0xF7,0xFF,0xFF,0xF7,0x31,
0x00,0x6B,0xCE,0xF0,0xFC,0xEC,0xB1,0x34,0x00,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,
0x9D,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x95,0x85,0xE9,0xF2,0xBB,0x2C,0x00,
0xC0,0xFF,0xED,0xFF,0xFB,0xFF,0xFF,0xDF,0x08,0xC0,0xFF,0xFD,0x4A,0x02,0x77,0xFF,
0xFF,0x33,0xC0,0xFF,0xC7,0x00,0x00,0x1D,0xFF,0xFF,0x4E,0xC0,0xFF,0xA7,0x00,0x00,
0x14,0xFF,0xFF,0x50,0xC0,0xFF,0xA0,0x00,0x00,0x14,0xFF,0xFF,0x50,0xC0,0xFF,0xA0,
0x00,0x00,0x14,0xFF,0xFF,0x50,0xC0,0xFF,0xA0,0x00,0x00,0x14,0xFF,0xFF,0x50,0xC0,
0xFF,0xA0,0x00,0x00,0x14,0xFF,0xFF,0x50,0x9A,0xF1,0x84,0x8D,0xE1,0x78,0x00,0x00,
0x00,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,
0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0x00,0x00,0x00,0x9A,
0xF1,0x84,0x00,0x00,0x00,0x8D,0xE1,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC0,0xFF,0xA0,
0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC0,
0xFF,0xA0,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,
0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC1,0xFF,0xA0,0x00,0x02,0x11,0xE8,0xFF,0x92,
0x08,0xF9,0xFB,0xFF,0xFF,0x4A,0x06,0xE9,0xFB,0xE0,0x71,0x00,0xC0,0xFF,0xA0,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,
0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x6A,0xFF,0xFB,0x4A,
0xC0,0xFF,0xA0,0x00,0x51,0xFD,0xFF,0x64,0x00,0xC0,0xFF,0x9C,0x3A,0xF7,0xFF,0x81,
0x00,0x00,0xC0,0xFF,0xA5,0xE8,0xFF,0x9F,0x00,0x00,0x00,0xC0,0xFF,0xFD,0xFF,0xFF,
0xA4,0x00,0x00,0x00,0xC0,0xFF,0xFE,0xA2,0xFE,0xFF,0x5F,0x00,0x00,0xC0,0xFF,0xA6,
0x00,0x90,0xFF,0xF3,0x25,0x00,0xC0,0xFF,0xA0,0x00,0x08,0xD6,0xFF,0xCD,0x06,0xC0,
0xFF,0xA0,0x00,0x00,0x32,0xFA,0xFF,0x8E,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,
0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,
0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0xA0,0xC0,0xFF,0x58,0xAF,
0xE8,0xF7,0xC8,0x3E,0x77,0xD6,0xF6,0xD8,0x5C,0x00,0xC0,0xFF,0xFF,0xFF,0xFB,0xFF,
0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xFC,0x2B,0xC0,0xFF,0xFC,0x40,0x03,0xAA,0xFF,0xFF,
0xA3,0x07,0x3D,0xFF,0xFF,0x6B,0xC0,0xFF,0xC4,0x00,0x00,0x58,0xFF,0xFF,0x32,0x00,
0x00,0xE8,0xFF,0x83,0xC0,0xFF,0xA6,0x00,0x00,0x50,0xFF,0xFF,0x17,0x00,0x00,0xE0,
0xFF,0x84,0xC0,0xFF,0xA0,0x00,0x00,0x50,0xFF,0xFF,0x14,0x00,0x00,0xE0,0xFF,0x84,
0xC0,0xFF,0xA0,0x00,0x00,0x50,0xFF,0xFF,0x14,0x00,0x00,0xE0,0xFF,0x84,0xC0,0xFF,
0xA0,0x00,0x00,0x50,0xFF,0xFF,0x14,0x00,0x00,0xE0,0xFF,0x84,0xC0,0xFF,0xA0,0x00,
0x00,0x50,0xFF,0xFF,0x14,0x00,0x00,0xE0,0xFF,0x84,0x00,0x00,0xC0,0xFF,0x39,0x91,
0xE9,0xF3,0xBD,0x2E,0x00,0xC0,0xFF,0xE8,0xFF,0xFA,0xFF,0xFF,0xE0,0x08,0xC0,0xFF,
0xFD,0x4A,0x01,0x75,0xFF,0xFF,0x34,0xC0,0xFF,0xC7,0x00,0x00,0x1D,0xFF,0xFF,0x4E,
0xC0,0xFF,0xA7,0x00,0x00,0x14,0xFF,0xFF,0x50,0xC0,0xFF,0xA0,0x00,0x00,0x14,0xFF,
0xFF,0x50,0xC0,0xFF,0xA0,0x00,0x00,0x14,0xFF,0xFF,0x50,0xC0,0xFF,0xA0,0x00,0x00,
0x14,0xFF,0xFF,0x50,0xC0,0xFF,0xA0,0x00,0x00,0x14,0xFF,0xFF,0x50,0x00,0x00,0x00,
0x00,0x00,0x52,0xC8,0xF6,0xF0,0xB7,0x37,0x00,0x00,0x00,0x65,0xFF,0xFF,0xFC,0xFE,
0xFF,0xFA,0x3F,0x00,0x05,0xEC,0xFF,0xB5,0x0B,0x11,0xC7,0xFF,0xCE,0x00,0x32,0xFF,
0xFF,0x44,0x00,0x00,0x5D,0xFF,0xFF,0x15,0x42,0xFF,0xFF,0x2D,0x00,0x00,0x46,0xFF,
0xFF,0x2A,0x2C,0xFF,0xFF,0x46,0x00,0x00,0x5F,0xFF,0xFF,0x17,0x02,0xE3,0xFF,0xB7,
0x0C,0x12,0xC9,0xFF,0xD5,0x00,0x00,0x55,0xFE,0xFF,0xFC,0xFE,0xFF,0xFC,0x49,0x00,
0x00,0x00,0x47,0xC2,0xF3,0xF4,0xBE,0x40,0x00,0x00,0x00,0x00,0xC0,0xFF,0x4F,0x7B,
0xEB,0xF3,0xA5,0x0F,0x00,0xC0,0xFF,0xE5,0xFF,0xFB,0xFF,0xFF,0xB3,0x00,0xC0,0xFF,
0xF7,0x31,0x04,0x93,0xFF,0xFF,0x23,0xC0,0xFF,0xB6,0x00,0x00,0x24,0xFF,0xFF,0x55,
0xC0,0xFF,0xA3,0x00,0x00,0x0E,0xFF,0xFF,0x64,0xC0,0xFF,0xBC,0x00,0x00,0x26,0xFF,
0xFF,0x54,0xC0,0xFF,0xF9,0x38,0x04,0x94,0xFF,0xFF,0x20,0xC0,0xFF,0xFB,0xFF,0xFB,
0xFF,0xFF,0xAC,0x00,0xC0,0xFF,0x95,0x96,0xF1,0xF2,0x9E,0x0C,0x00,0xC0,0xFF,0x9F,
0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,
0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x05,0x8F,0xED,0xF3,0xA3,0x42,0xFF,0xE0,0x00,0x91,0xFF,
0xFF,0xFB,0xFF,0xED,0xFF,0xE0,0x0B,0xF7,0xFF,0xB5,0x09,0x19,0xD6,0xFF,0xE0,0x36,
0xFF,0xFF,0x46,0x00,0x00,0x75,0xFF,0xE0,0x45,0xFF,0xFF,0x2D,0x00,0x00,0x5B,0xFF,
0xE0,0x37,0xFF,0xFF,0x44,0x00,0x00,0x70,0xFF,0xE0,0x0C,0xF8,0xFF,0xB4,0x09,0x13,
0xCF,0xFF,0xE0,0x00,0x97,0xFF,0xFF,0xFB,0xFE,0xEB,0xFF,0xE0,0x00,0x07,0x95,0xEF,
0xF2,0x97,0x7A,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xE0,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xE0,0x00,0x00,0x00,0xC0,0xFF,0x30,0x7C,
0xE7,0xDE,0xC0,0xFF,0xDB,0xFF,0xFE,0xC5,0xC0,0xFF,0xFE,0x6D,0x0D,0x00,0xC0,0xFF,
0xC0,0x00,0x00,0x00,0xC0,0xFF,0xA1,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,
0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,0x00,0x00,0xC0,0xFF,0xA0,0x00,
0x00,0x00,0x00,0x00,0x00,0x3E,0xBC,0xED,0xF4,0xD3,0x84,0x0F,0x16,0xF6,0xFF,0xFC,
0xFA,0xFF,0xEC,0x07,0x39,0xFF,0xFF,0x36,0x03,0x30,0x4C,0x00,0x0C,0xE8,0xFF,0xE7,
0x77,0x11,0x00,0x00,0x00,0x29,0xBB,0xFF,0xFF,0xF2,0x66,0x00,0x00,0x00,0x00,0x2B,
0xAF,0xFF,0xFF,0x2F,0x26,0x5D,0x19,0x00,0x27,0xFF,0xFF,0x4A,0x44,0xFF,0xFF,0xF8,
0xFE,0xFF,0xEF,0x15,0x20,0xB1,0xE9,0xFA,0xE8,0xB4,0x34,0x00,0x00,0x00,0xCC,0xE4,
0x00,0x00,0x00,0x00,0x25,0xFF,0xE4,0x00,0x00,0x00,0x39,0xDB,0xFF,0xFF,0xFF,0xFF,
0x58,0x96,0xF8,0xFF,0xFE,0xF0,0xF0,0x52,0x00,0x80,0xFF,0xE4,0x00,0x00,0x00,0x00,
0x80,0xFF,0xE4,0x00,0x00,0x00,0x00,0x80,0xFF,0xE4,0x00,0x00,0x00,0x00,0x80,0xFF,
0xE4,0x00,0x00,0x00,0x00,0x77,0xFF,0xF4,0x13,0x01,0x0B,0x00,0x45,0xFF,0xFF,0xFA,
0xF4,0x70,0x00,0x00,0x82,0xDF,0xF9,0xDF,0x4D,0x00,0x00,0x00,0xCC,0xFF,0x94,0x00,
0x00,0x20,0xFF,0xFF,0x44,0xCC,0xFF,0x94,0x00,0x00,0x20,0xFF,0xFF,0x44,0xCC,0xFF,
0x94,0x00,0x00,0x20,0xFF,0xFF,0x44,0xCC,0xFF,0x94,0x00,0x00,0x20,0xFF,0xFF,0x44,
0xCC,0xFF,0x94,0x00,0x00,0x26,0xFF,0xFF,0x44,0xCB,0xFF,0x9A,0x00,0x00,0x40,0xFF,
0xFF,0x44,0xB1,0xFF,0xD0,0x04,0x00,0xA2,0xFF,0xFF,0x44,0x67,0xFF,0xFF,0xE0,0xDF,
0xFD,0xFB,0xFF,0x44,0x02,0x7F,0xE1,0xF9,0xD2,0x54,0xB4,0xFF,0x44,0x00,0x00,0x00,
0xD1,0xFF,0xA9,0x00,0x00,0x00,0x8E,0xFF,0xE8,0x04,0x72,0xFF,0xF3,0x08,0x00,0x00,
0xE1,0xFF,0x8D,0x00,0x17,0xFB,0xFF,0x4F,0x00,0x37,0xFF,0xFF,0x2F,0x00,0x00,0xB5,
0xFF,0xA3,0x00,0x8B,0xFF,0xD0,0x00,0x00,0x00,0x56,0xFF,0xF0,0x06,0xDE,0xFF,0x71,
0x00,0x00,0x00,0x08,0xEF,0xFF,0x65,0xFF,0xFB,0x17,0x00,0x00,0x00,0x00,0x99,0xFF,
0xC8,0xFF,0xB4,0x00,0x00,0x00,0x00,0x00,0x3A,0xFF,0xFF,0xFF,0x55,0x00,0x00,0x00,
0x00,0x00,0x00,0xDA,0xFF,0xEF,0x07,0x00,0x00,0x00,0x00,0x00,0xB5,0xFF,0xA8,0x00,
0x00,0x93,0xFF,0xFF,0x4A,0x00,0x01,0xEB,0xFF,0x64,0x6E,0xFF,0xE7,0x00,0x00,0xD2,
0xFE,0xFF,0x86,0x00,0x30,0xFF,0xFF,0x1C,0x27,0xFF,0xFF,0x28,0x13,0xFE,0xB3,0xFA,
0xC3,0x00,0x73,0xFF,0xD5,0x00,0x00,0xE0,0xFF,0x68,0x50,0xFF,0x70,0xC6,0xF8,0x07,
0xB6,0xFF,0x8E,0x00,0x00,0x9A,0xFF,0xA2,0x8C,0xFF,0x36,0x8B,0xFF,0x3D,0xF1,0xFF,
0x47,0x00,0x00,0x53,0xFF,0xCE,0xBA,0xF7,0x06,0x50,0xFF,0x8B,0xFF,0xF7,0x09,0x00,
0x00,0x10,0xFC,0xF2,0xE0,0xC4,0x00,0x19,0xFF,0xD4,0xFF,0xB9,0x00,0x00,0x00,0x00,
0xC6,0xFF,0xFF,0x8A,0x00,0x00,0xE2,0xFF,0xFF,0x72,0x00,0x00,0x00,0x00,0x7F,0xFF,
0xFF,0x50,0x00,0x00,0xAB,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,0x76,0xFF,0xFE,0x38,
0x00,0x0D,0xE6,0xFF,0xB8,0x00,0x04,0xCE,0xFF,0xCB,0x02,0x8D,0xFF,0xF3,0x1E,0x00,
0x00,0x32,0xFC,0xFF,0x8C,0xFA,0xFF,0x6C,0x00,0x00,0x00,0x00,0x89,0xFF,0xFF,0xFF,
0xC4,0x01,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x5A,0x00,0x00,0x00,0x00,0x00,
0xA9,0xFF,0xFF,0xFF,0xDB,0x09,0x00,0x00,0x00,0x4E,0xFF,0xFF,0x61,0xF1,0xFF,0x8C,
0x00,0x00,0x0F,0xE5,0xFF,0xAF,0x00,0x70,0xFF,0xFC,0x35,0x00,0x99,0xFF,0xF5,0x1F,
0x00,0x03,0xD1,0xFF,0xD2,0x05,0x00,0x00,0xCF,0xFF,0xC4,0x00,0x00,0x00,0x9C,0xFF,
0xE8,0x04,0x6D,0xFF,0xFD,0x17,0x00,0x02,0xEA,0xFF,0x8F,0x00,0x12,0xF8,0xFF,0x66,
0x00,0x3D,0xFF,0xFF,0x32,0x00,0x00,0xA9,0xFF,0xB7,0x00,0x8E,0xFF,0xD5,0x00,0x00,
0x00,0x47,0xFF,0xF9,0x0F,0xDE,0xFF,0x78,0x00,0x00,0x00,0x02,0xE2,0xFF,0x80,0xFF,
0xFE,0x1D,0x00,0x00,0x00,0x00,0x82,0xFF,0xE2,0xFF,0xBE,0x00,0x00,0x00,0x00,0x00,
0x21,0xFE,0xFF,0xFF,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0xBE,0xFF,0xF6,0x0E,0x00,
0x00,0x00,0x00,0x00,0x00,0xB6,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x00,0x57,0xFF,
0xFF,0x3F,0x00,0x00,0x00,0x00,0x71,0xF6,0xFF,0xFF,0xAA,0x00,0x00,0x00,0x00,0x00,
0x6B,0xFB,0xE3,0x88,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x30,0x4E,0xF0,0xF0,0xF0,0xF8,0xFF,0xFF,0x24,0x00,0x00,0x00,0x0E,
0xDE,0xFF,0x90,0x00,0x00,0x00,0x00,0xA6,0xFF,0xCF,0x07,0x00,0x00,0x00,0x60,0xFF,
0xF4,0x27,0x00,0x00,0x00,0x25,0xF3,0xFF,0x62,0x00,0x00,0x00,0x06,0xCD,0xFF,0xA7,
0x00,0x00,0x00,0x00,0x77,0xFF,0xFF,0xF4,0xF0,0xF0,0xF0,0x4E,0x90,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x54,0x00,0x00,0x26,0xB7,0xED,0xA5,0x00,0x00,0xAA,0xFF,0xFF,0xA5,
0x00,0x00,0xC3,0xFF,0x7C,0x03,0x00,0x00,0xC4,0xFF,0x4C,0x00,0x00,0x00,0xC6,0xFF,
0x4C,0x00,0x00,0x32,0xF3,0xFF,0x3F,0x00,0xBE,0xFF,0xF3,0x9A,0x03,0x00,0xC4,0xFF,
0xEE,0x92,0x02,0x00,0x07,0x45,0xF6,0xFF,0x3E,0x00,0x00,0x00,0xC8,0xFF,0x4C,0x00,
0x00,0x00,0xC4,0xFF,0x4C,0x00,0x00,0x00,0xC3,0xFF,0x7B,0x03,0x00,0x00,0xAA,0xFF,
0xFF,0xA5,0x00,0x00,0x27,0xBB,0xEF,0xA5,0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,
0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,
0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,0x74,
0xFF,0x44,0x74,0xFF,0x44,0x74,0xFF,0x44,0x5B,0xF4,0xCE,0x51,0x00,0x00,0x00,0x57,
0xFE,0xFF,0xF2,0x01,0x00,0x00,0x00,0x2E,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0xFF,
0xFF,0x10,0x00,0x00,0x00,0x00,0xFF,0xFF,0x12,0x00,0x00,0x00,0x00,0xF3,0xFF,0x6E,
0x03,0x00,0x00,0x00,0x60,0xE3,0xFF,0xFB,0x0F,0x00,0x00,0x59,0xDC,0xFF,0xFF,0x10,
0x00,0x00,0xF2,0xFF,0x7F,0x0F,0x00,0x00,0x00,0xFF,0xFF,0x13,0x00,0x00,0x00,0x00,
0xFF,0xFF,0x10,0x00,0x00,0x00,0x2E,0xFF,0xFF,0x0F,0x00,0x00,0x57,0xFE,0xFF,0xF2,
0x02,0x00,0x00,0x5B,0xF5,0xD1,0x53,0x00,0x00,0x00,0x00,0x00,0x0A,0x97,0xE2,0xD7,
0x8C,0x29,0x00,0x3A,0x58,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xFF,0x74,0x46,0x62,
0x09,0x2F,0x8E,0xE1,0xF5,0xB9,0x1D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
leRasterFont NotoSans_Bold16 =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoSans_Bold16_glyphs, // glyph table variable pointer
8848, // data size
},
LE_RASTER_FONT,
},
18,
13,
LE_FONT_BPP_8, // bits per pixel
NotoSans_Bold16_data, // kerning table
};
/*********************************
* Legato Font Asset
* Name: NotoSans_Bold18
* Height: 19
* Baseline: 14
* Style: Antialias
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoSans_Bold18_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x04,0x00,0x0D,0x00,0x05,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x07,0x00,
0x05,0x00,0x09,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x07,0x00,0x34,0x00,0x00,0x00,
0x23,0x00,0x0C,0x00,0x0D,0x00,0x0C,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0C,0x00,
0x58,0x00,0x00,0x00,0x24,0x00,0x0A,0x00,0x0F,0x00,0x0A,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0A,0x00,0xF4,0x00,0x00,0x00,0x25,0x00,0x10,0x00,0x0D,0x00,0x10,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x10,0x00,0x8C,0x01,0x00,0x00,0x26,0x00,0x0E,0x00,
0x0D,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0E,0x00,0x5C,0x02,0x00,0x00,
0x27,0x00,0x03,0x00,0x05,0x00,0x05,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x03,0x00,
0x14,0x03,0x00,0x00,0x28,0x00,0x06,0x00,0x10,0x00,0x06,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x06,0x00,0x24,0x03,0x00,0x00,0x29,0x00,0x06,0x00,0x10,0x00,0x06,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x06,0x00,0x84,0x03,0x00,0x00,0x2A,0x00,0x0A,0x00,
0x09,0x00,0x0A,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0xE4,0x03,0x00,0x00,
0x2B,0x00,0x0A,0x00,0x09,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x0A,0x00,
0x40,0x04,0x00,0x00,0x2C,0x00,0x05,0x00,0x04,0x00,0x05,0x00,0x00,0x00,0x02,0x00,
0x00,0x00,0x05,0x00,0x9C,0x04,0x00,0x00,0x2D,0x00,0x06,0x00,0x03,0x00,0x06,0x00,
0x00,0x00,0x07,0x00,0x00,0x00,0x06,0x00,0xB0,0x04,0x00,0x00,0x2E,0x00,0x04,0x00,
0x03,0x00,0x05,0x00,0x01,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0xC4,0x04,0x00,0x00,
0x2F,0x00,0x08,0x00,0x0D,0x00,0x07,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x08,0x00,
0xD0,0x04,0x00,0x00,0x30,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x0A,0x00,0x38,0x05,0x00,0x00,0x31,0x00,0x07,0x00,0x0D,0x00,0x0A,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x07,0x00,0xBC,0x05,0x00,0x00,0x32,0x00,0x0A,0x00,
0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,0x18,0x06,0x00,0x00,
0x33,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,
0x9C,0x06,0x00,0x00,0x34,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x0A,0x00,0x20,0x07,0x00,0x00,0x35,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,0xA4,0x07,0x00,0x00,0x36,0x00,0x0A,0x00,
0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,0x28,0x08,0x00,0x00,
0x37,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,
0xAC,0x08,0x00,0x00,0x38,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x0A,0x00,0x30,0x09,0x00,0x00,0x39,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,0xB4,0x09,0x00,0x00,0x3A,0x00,0x04,0x00,
0x0A,0x00,0x05,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x04,0x00,0x38,0x0A,0x00,0x00,
0x3B,0x00,0x05,0x00,0x0C,0x00,0x05,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x05,0x00,
0x60,0x0A,0x00,0x00,0x3C,0x00,0x0A,0x00,0x0B,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x0A,0x00,0x9C,0x0A,0x00,0x00,0x3D,0x00,0x0A,0x00,0x06,0x00,0x0A,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0x0C,0x0B,0x00,0x00,0x3E,0x00,0x0A,0x00,
0x0B,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,0x48,0x0B,0x00,0x00,
0x3F,0x00,0x09,0x00,0x0D,0x00,0x09,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x09,0x00,
0xB8,0x0B,0x00,0x00,0x40,0x00,0x10,0x00,0x0F,0x00,0x10,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x10,0x00,0x30,0x0C,0x00,0x00,0x41,0x00,0x0D,0x00,0x0D,0x00,0x0C,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,0x20,0x0D,0x00,0x00,0x42,0x00,0x0B,0x00,
0x0D,0x00,0x0C,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0B,0x00,0xCC,0x0D,0x00,0x00,
0x43,0x00,0x0A,0x00,0x0D,0x00,0x0B,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,
0x5C,0x0E,0x00,0x00,0x44,0x00,0x0C,0x00,0x0D,0x00,0x0D,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x0C,0x00,0xE0,0x0E,0x00,0x00,0x45,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x09,0x00,0x7C,0x0F,0x00,0x00,0x46,0x00,0x08,0x00,
0x0D,0x00,0x0A,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x08,0x00,0xF4,0x0F,0x00,0x00,
0x47,0x00,0x0B,0x00,0x0D,0x00,0x0D,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0B,0x00,
0x5C,0x10,0x00,0x00,0x48,0x00,0x0C,0x00,0x0D,0x00,0x0E,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x0C,0x00,0xEC,0x10,0x00,0x00,0x49,0x00,0x07,0x00,0x0D,0x00,0x07,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x07,0x00,0x88,0x11,0x00,0x00,0x4A,0x00,0x07,0x00,
0x11,0x00,0x06,0x00,0xFE,0xFF,0x0D,0x00,0x00,0x00,0x07,0x00,0xE4,0x11,0x00,0x00,
0x4B,0x00,0x0B,0x00,0x0D,0x00,0x0C,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0B,0x00,
0x5C,0x12,0x00,0x00,0x4C,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x09,0x00,0xEC,0x12,0x00,0x00,0x4D,0x00,0x0F,0x00,0x0D,0x00,0x11,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x0F,0x00,0x64,0x13,0x00,0x00,0x4E,0x00,0x0D,0x00,
0x0D,0x00,0x0F,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,0x28,0x14,0x00,0x00,
0x4F,0x00,0x0D,0x00,0x0D,0x00,0x0E,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,
0xD4,0x14,0x00,0x00,0x50,0x00,0x0A,0x00,0x0D,0x00,0x0B,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x0A,0x00,0x80,0x15,0x00,0x00,0x51,0x00,0x0D,0x00,0x10,0x00,0x0E,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,0x04,0x16,0x00,0x00,0x52,0x00,0x0B,0x00,
0x0D,0x00,0x0C,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0B,0x00,0xD4,0x16,0x00,0x00,
0x53,0x00,0x0A,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,
0x64,0x17,0x00,0x00,0x54,0x00,0x0B,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x0B,0x00,0xE8,0x17,0x00,0x00,0x55,0x00,0x0C,0x00,0x0D,0x00,0x0E,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x0C,0x00,0x78,0x18,0x00,0x00,0x56,0x00,0x0C,0x00,
0x0D,0x00,0x0C,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0C,0x00,0x14,0x19,0x00,0x00,
0x57,0x00,0x12,0x00,0x0D,0x00,0x11,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x12,0x00,
0xB0,0x19,0x00,0x00,0x58,0x00,0x0C,0x00,0x0D,0x00,0x0C,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x0C,0x00,0x9C,0x1A,0x00,0x00,0x59,0x00,0x0C,0x00,0x0D,0x00,0x0B,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x0C,0x00,0x38,0x1B,0x00,0x00,0x5A,0x00,0x0A,0x00,
0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,0xD4,0x1B,0x00,0x00,
0x5B,0x00,0x05,0x00,0x11,0x00,0x06,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x05,0x00,
0x58,0x1C,0x00,0x00,0x5C,0x00,0x08,0x00,0x0D,0x00,0x07,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x08,0x00,0xB0,0x1C,0x00,0x00,0x5D,0x00,0x05,0x00,0x11,0x00,0x06,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x05,0x00,0x18,0x1D,0x00,0x00,0x5E,0x00,0x0A,0x00,
0x09,0x00,0x0A,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0x70,0x1D,0x00,0x00,
0x5F,0x00,0x09,0x00,0x02,0x00,0x07,0x00,0xFF,0xFF,0xFE,0xFF,0x00,0x00,0x09,0x00,
0xCC,0x1D,0x00,0x00,0x60,0x00,0x06,0x00,0x03,0x00,0x07,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x06,0x00,0xE0,0x1D,0x00,0x00,0x61,0x00,0x0A,0x00,0x0A,0x00,0x0B,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0xF4,0x1D,0x00,0x00,0x62,0x00,0x0A,0x00,
0x0E,0x00,0x0B,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0x58,0x1E,0x00,0x00,
0x63,0x00,0x09,0x00,0x0A,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0xE4,0x1E,0x00,0x00,0x64,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0A,0x00,0x40,0x1F,0x00,0x00,0x65,0x00,0x0A,0x00,0x0A,0x00,0x0B,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0xCC,0x1F,0x00,0x00,0x66,0x00,0x08,0x00,
0x0E,0x00,0x07,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08,0x00,0x30,0x20,0x00,0x00,
0x67,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,
0xA0,0x20,0x00,0x00,0x68,0x00,0x0A,0x00,0x0E,0x00,0x0C,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x0A,0x00,0x2C,0x21,0x00,0x00,0x69,0x00,0x04,0x00,0x0E,0x00,0x05,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x04,0x00,0xB8,0x21,0x00,0x00,0x6A,0x00,0x07,0x00,
0x12,0x00,0x05,0x00,0xFE,0xFF,0x0E,0x00,0x00,0x00,0x07,0x00,0xF0,0x21,0x00,0x00,
0x6B,0x00,0x0B,0x00,0x0E,0x00,0x0B,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,
0x70,0x22,0x00,0x00,0x6C,0x00,0x04,0x00,0x0E,0x00,0x05,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x04,0x00,0x0C,0x23,0x00,0x00,0x6D,0x00,0x10,0x00,0x0A,0x00,0x12,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x10,0x00,0x44,0x23,0x00,0x00,0x6E,0x00,0x0A,0x00,
0x0A,0x00,0x0C,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0xE4,0x23,0x00,0x00,
0x6F,0x00,0x0B,0x00,0x0A,0x00,0x0B,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,
0x48,0x24,0x00,0x00,0x70,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x01,0x00,0x0A,0x00,
0x00,0x00,0x0A,0x00,0xB8,0x24,0x00,0x00,0x71,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0x44,0x25,0x00,0x00,0x72,0x00,0x07,0x00,
0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0xD0,0x25,0x00,0x00,
0x73,0x00,0x09,0x00,0x0A,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x18,0x26,0x00,0x00,0x74,0x00,0x08,0x00,0x0C,0x00,0x08,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x08,0x00,0x74,0x26,0x00,0x00,0x75,0x00,0x0A,0x00,0x0A,0x00,0x0C,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0xD4,0x26,0x00,0x00,0x76,0x00,0x0B,0x00,
0x0A,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,0x38,0x27,0x00,0x00,
0x77,0x00,0x10,0x00,0x0A,0x00,0x0F,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x10,0x00,
0xA8,0x27,0x00,0x00,0x78,0x00,0x0B,0x00,0x0A,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x0B,0x00,0x48,0x28,0x00,0x00,0x79,0x00,0x0B,0x00,0x0E,0x00,0x0A,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,0xB8,0x28,0x00,0x00,0x7A,0x00,0x09,0x00,
0x0A,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x54,0x29,0x00,0x00,
0x7B,0x00,0x07,0x00,0x10,0x00,0x07,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x07,0x00,
0xB0,0x29,0x00,0x00,0x7C,0x00,0x02,0x00,0x12,0x00,0x0A,0x00,0x04,0x00,0x0E,0x00,
0x00,0x00,0x02,0x00,0x20,0x2A,0x00,0x00,0x7D,0x00,0x07,0x00,0x10,0x00,0x07,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x07,0x00,0x44,0x2A,0x00,0x00,0x7E,0x00,0x0A,0x00,
0x05,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0xB4,0x2A,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoSans_Bold18_glyphs[10984] =
{
0xEA,0xFF,0xFF,0x15,0xDD,0xFF,0xFF,0x08,0xD0,0xFF,0xFB,0x00,0xC3,0xFF,0xEE,0x00,
0xB6,0xFF,0xE1,0x00,0xA9,0xFF,0xD4,0x00,0x9C,0xFF,0xC7,0x00,0x8F,0xFF,0xBA,0x00,
0x82,0xFF,0xAE,0x00,0x00,0x00,0x00,0x00,0x8C,0xEE,0xA9,0x00,0xEE,0xFF,0xFF,0x11,
0x90,0xF6,0xAE,0x00,0xCB,0xFF,0x96,0x17,0xFF,0xFF,0x4A,0xB9,0xFF,0x84,0x05,0xFF,
0xFF,0x38,0xA6,0xFF,0x71,0x00,0xF2,0xFF,0x25,0x94,0xFF,0x5F,0x00,0xE0,0xFF,0x13,
0x81,0xFF,0x4D,0x00,0xCD,0xFE,0x02,0x00,0x00,0x00,0x00,0x00,0xD6,0xFF,0x16,0x2A,
0xFF,0xBA,0x00,0x00,0x00,0x00,0x00,0x06,0xFB,0xEA,0x00,0x56,0xFF,0x8E,0x00,0x00,
0x00,0x00,0x00,0x2E,0xFF,0xBE,0x00,0x82,0xFF,0x62,0x00,0x00,0x00,0x00,0x00,0x5A,
0xFF,0x92,0x00,0xAE,0xFF,0x36,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x3C,0x00,0xCD,0xD4,0xF6,0xFF,0xD9,0xDA,0xFF,0xF5,0xD4,0xD4,0x31,
0x00,0x00,0x00,0xE5,0xFB,0x07,0x41,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x14,0xFF,
0xD3,0x00,0x70,0xFF,0x77,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xA4,0x00,0x9C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA4,0x00,
0x18,0x28,0xAC,0xFF,0x66,0x2C,0xF9,0xEF,0x28,0x28,0x19,0x00,0x00,0x00,0xD2,0xFE,
0x13,0x38,0xFF,0xB4,0x00,0x00,0x00,0x00,0x00,0x0D,0xFD,0xD6,0x00,0x75,0xFF,0x76,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,
0x14,0x68,0xC3,0xE8,0x89,0x67,0x16,0x00,0x00,0x56,0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFA,0x34,0x0E,0xF4,0xFF,0xF8,0xDB,0xEB,0xC3,0xF4,0xE2,0x03,0x31,0xFF,0xFF,0x7E,
0x74,0xC4,0x00,0x08,0x27,0x00,0x13,0xFB,0xFF,0xDF,0xAA,0xC4,0x00,0x00,0x00,0x00,
0x00,0x7E,0xFF,0xFF,0xFF,0xEE,0x72,0x0F,0x00,0x00,0x00,0x00,0x50,0xD5,0xFF,0xFF,
0xFF,0xF0,0x61,0x00,0x00,0x00,0x00,0x01,0x8D,0xF5,0xFC,0xFF,0xFF,0x40,0x00,0x00,
0x00,0x00,0x74,0xC4,0x43,0xFF,0xFF,0x8A,0x30,0xAD,0x54,0x1A,0x76,0xC7,0x61,0xFF,
0xFF,0x77,0x34,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0x1C,0x16,0xA5,0xF1,0xFF,
0xFF,0xFF,0xF6,0xB5,0x2A,0x00,0x00,0x00,0x00,0x10,0x86,0xCA,0x04,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x74,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0xD0,0xF9,
0xDA,0x4F,0x00,0x00,0x00,0x00,0xAA,0xFF,0x6D,0x00,0x00,0x00,0x03,0xE2,0xFF,0xFF,
0xFF,0xF9,0x19,0x00,0x00,0x38,0xFF,0xDB,0x05,0x00,0x00,0x00,0x41,0xFF,0xF8,0x45,
0xDB,0xFF,0x75,0x00,0x00,0xC3,0xFF,0x55,0x00,0x00,0x00,0x00,0x61,0xFF,0xCD,0x00,
0x97,0xFF,0x97,0x00,0x50,0xFF,0xC7,0x00,0x00,0x00,0x00,0x00,0x63,0xFF,0xCA,0x00,
0x93,0xFF,0x9B,0x04,0xD8,0xFF,0x3C,0x00,0x00,0x00,0x00,0x00,0x45,0xFF,0xF3,0x1D,
0xCD,0xFF,0x7E,0x6A,0xFF,0xB0,0x24,0xA9,0xD1,0xB3,0x34,0x00,0x06,0xE7,0xFF,0xFF,
0xFF,0xFF,0x37,0xE9,0xFB,0x29,0xD7,0xFF,0xFF,0xFF,0xF1,0x12,0x00,0x4A,0xED,0xFF,
0xF9,0x7D,0x83,0xFF,0x97,0x3D,0xFF,0xF2,0x1D,0xCD,0xFF,0x70,0x00,0x00,0x06,0x22,
0x0C,0x1A,0xF5,0xF3,0x17,0x61,0xFF,0xCA,0x00,0x93,0xFF,0x96,0x00,0x00,0x00,0x00,
0x00,0x9C,0xFF,0x7E,0x00,0x63,0xFF,0xCE,0x00,0x97,0xFF,0x9B,0x00,0x00,0x00,0x00,
0x2B,0xFC,0xE6,0x0B,0x00,0x42,0xFF,0xF9,0x45,0xDB,0xFF,0x7B,0x00,0x00,0x00,0x00,
0xB5,0xFF,0x66,0x00,0x00,0x03,0xDF,0xFF,0xFF,0xFF,0xFD,0x23,0x00,0x00,0x00,0x41,
0xFF,0xD6,0x03,0x00,0x00,0x00,0x34,0xCD,0xFA,0xDF,0x5E,0x00,0x00,0x00,0x0F,0x8E,
0xE0,0xFA,0xE7,0x9C,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,0xFF,0xFF,0xFF,
0xFF,0xFF,0xD0,0x02,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xA5,0x39,0xA2,0xFF,
0xFF,0x24,0x00,0x00,0x00,0x00,0x00,0x1E,0xFF,0xFF,0x63,0x00,0x6C,0xFF,0xFE,0x0F,
0x00,0x00,0x00,0x00,0x00,0x00,0xCE,0xFF,0xD8,0x70,0xF5,0xFF,0x98,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x35,0xFE,0xFF,0xFF,0xFF,0x9D,0x05,0x00,0x00,0x00,0x00,0x00,
0x00,0x17,0xC9,0xFF,0xFF,0xFF,0xDF,0x13,0x00,0x08,0xF2,0xFF,0xCC,0x00,0x00,0xC6,
0xFF,0xFF,0xA9,0xF8,0xFF,0xD2,0x16,0x56,0xFF,0xFF,0x6C,0x00,0x29,0xFF,0xFF,0xBA,
0x00,0x47,0xF7,0xFF,0xD7,0xD4,0xFF,0xEF,0x10,0x00,0x41,0xFF,0xFF,0x9F,0x00,0x00,
0x46,0xF7,0xFF,0xFF,0xFF,0x6D,0x00,0x00,0x19,0xFD,0xFF,0xF9,0x6B,0x30,0x4C,0xCE,
0xFF,0xFF,0xF9,0x24,0x00,0x00,0x00,0x86,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xE1,0x21,0x00,0x00,0x00,0x4B,0xBA,0xE4,0xFA,0xE9,0xAF,0x48,0x54,0xFB,0xFF,
0xE0,0x20,0x00,0x00,0xCB,0xFF,0x96,0xB9,0xFF,0x84,0xA6,0xFF,0x71,0x94,0xFF,0x5F,
0x81,0xFF,0x4D,0x00,0x00,0x00,0x12,0xE7,0xFF,0x43,0x00,0x00,0xA2,0xFF,0xAC,0x00,
0x00,0x22,0xFD,0xFF,0x36,0x00,0x00,0x88,0xFF,0xD2,0x00,0x00,0x00,0xD0,0xFF,0x8A,
0x00,0x00,0x0C,0xFC,0xFF,0x50,0x00,0x00,0x2B,0xFF,0xFF,0x2D,0x00,0x00,0x3D,0xFF,
0xFF,0x1A,0x00,0x00,0x40,0xFF,0xFF,0x18,0x00,0x00,0x2D,0xFF,0xFF,0x2A,0x00,0x00,
0x10,0xFE,0xFF,0x4B,0x00,0x00,0x00,0xD6,0xFF,0x84,0x00,0x00,0x00,0x90,0xFF,0xCA,
0x00,0x00,0x00,0x28,0xFE,0xFF,0x2D,0x00,0x00,0x00,0xA9,0xFF,0xA3,0x00,0x00,0x00,
0x14,0xE8,0xFF,0x3E,0x2C,0xFB,0xF2,0x1E,0x00,0x00,0x00,0x90,0xFF,0xBB,0x00,0x00,
0x00,0x1E,0xFD,0xFF,0x38,0x00,0x00,0x00,0xB7,0xFF,0xA0,0x00,0x00,0x00,0x6F,0xFF,
0xE6,0x00,0x00,0x00,0x34,0xFF,0xFF,0x20,0x00,0x00,0x12,0xFF,0xFF,0x42,0x00,0x00,
0x02,0xFD,0xFF,0x54,0x00,0x00,0x01,0xFB,0xFF,0x57,0x00,0x00,0x10,0xFF,0xFF,0x44,
0x00,0x00,0x31,0xFF,0xFF,0x27,0x00,0x00,0x6C,0xFF,0xEC,0x01,0x00,0x00,0xB3,0xFF,
0xA8,0x00,0x00,0x1B,0xFC,0xFF,0x3F,0x00,0x00,0x8C,0xFF,0xC1,0x00,0x00,0x29,0xFA,
0xF2,0x21,0x00,0x00,0x00,0x00,0x00,0x32,0xFF,0xFB,0x02,0x00,0x00,0x00,0x00,0x00,
0x00,0x16,0xFF,0xE1,0x00,0x00,0x00,0x00,0x18,0x80,0x36,0x03,0xF8,0xC5,0x06,0x42,
0x89,0x02,0x47,0xFF,0xFF,0xEA,0xFA,0xF0,0xF3,0xFF,0xFF,0x1D,0x37,0x9B,0xB0,0xE2,
0xFF,0xFF,0xD4,0xAD,0x9A,0x1E,0x00,0x00,0x1A,0xEA,0xF3,0xFF,0xCA,0x06,0x00,0x00,
0x00,0x03,0xC1,0xFF,0x7E,0xBB,0xFF,0x90,0x00,0x00,0x00,0x26,0xD3,0xF7,0x15,0x3B,
0xFF,0xC1,0x0B,0x00,0x00,0x00,0x01,0x32,0x00,0x00,0x39,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD4,0xFF,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD4,0xFF,
0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD4,0xFF,0x1C,0x00,0x00,0x00,0x08,0x28,
0x28,0x28,0xDA,0xFF,0x3F,0x28,0x28,0x14,0x38,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x80,0x38,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,
0xD4,0xFF,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD4,0xFF,0x1C,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD4,0xFF,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xFF,0xE5,
0x00,0x00,0xDD,0xFF,0x90,0x00,0x16,0xFF,0xFE,0x2B,0x00,0x52,0xFF,0xB6,0x00,0x00,
0x12,0x28,0x28,0x28,0x28,0x0A,0x74,0xFF,0xFF,0xFF,0xFF,0x40,0x74,0xFF,0xFF,0xFF,
0xFF,0x40,0x00,0x00,0x8C,0xEE,0xA9,0x00,0xEE,0xFF,0xFF,0x11,0x90,0xF6,0xAE,0x00,
0x00,0x00,0x00,0x00,0x47,0xFF,0xFF,0x28,0x00,0x00,0x00,0x00,0xA6,0xFF,0xCA,0x00,
0x00,0x00,0x00,0x0D,0xF6,0xFF,0x6C,0x00,0x00,0x00,0x00,0x62,0xFF,0xFA,0x13,0x00,
0x00,0x00,0x00,0xC0,0xFF,0xB0,0x00,0x00,0x00,0x00,0x1F,0xFE,0xFF,0x52,0x00,0x00,
0x00,0x00,0x7C,0xFF,0xED,0x06,0x00,0x00,0x00,0x00,0xDA,0xFF,0x95,0x00,0x00,0x00,
0x00,0x39,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0x97,0xFF,0xD8,0x00,0x00,0x00,0x00,
0x06,0xEE,0xFF,0x7B,0x00,0x00,0x00,0x00,0x53,0xFF,0xFE,0x1E,0x00,0x00,0x00,0x00,
0xB1,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0xB4,0xEA,0xF5,0xC8,0x4F,
0x00,0x00,0x00,0x2D,0xF2,0xFF,0xFF,0xFF,0xFF,0xFF,0x56,0x00,0x00,0xB1,0xFF,0xF9,
0x59,0x3E,0xDF,0xFF,0xE4,0x05,0x09,0xFB,0xFF,0xA8,0x00,0x00,0x67,0xFF,0xFF,0x42,
0x37,0xFF,0xFF,0x75,0x00,0x00,0x31,0xFF,0xFF,0x77,0x4D,0xFF,0xFF,0x5F,0x00,0x00,
0x19,0xFF,0xFF,0x93,0x58,0xFF,0xFF,0x59,0x00,0x00,0x12,0xFF,0xFF,0x9C,0x50,0xFF,
0xFF,0x5F,0x00,0x00,0x18,0xFF,0xFF,0x90,0x35,0xFF,0xFF,0x75,0x00,0x00,0x2F,0xFF,
0xFF,0x7B,0x09,0xF7,0xFF,0xA7,0x00,0x00,0x66,0xFF,0xFF,0x4A,0x00,0xA9,0xFF,0xF9,
0x58,0x3E,0xDE,0xFF,0xEB,0x09,0x00,0x25,0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,0x62,0x00,
0x00,0x00,0x2C,0xB4,0xF0,0xF3,0xC9,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6A,
0xFB,0xFF,0x70,0x00,0x04,0x96,0xFF,0xFF,0xFF,0x70,0x12,0xBC,0xFF,0xFF,0xFF,0xFF,
0x70,0xB2,0xFF,0xF7,0x8D,0xFF,0xFF,0x70,0x26,0xD4,0x35,0x44,0xFF,0xFF,0x70,0x00,
0x01,0x00,0x47,0xFF,0xFF,0x70,0x00,0x00,0x00,0x48,0xFF,0xFF,0x70,0x00,0x00,0x00,
0x48,0xFF,0xFF,0x70,0x00,0x00,0x00,0x48,0xFF,0xFF,0x70,0x00,0x00,0x00,0x48,0xFF,
0xFF,0x70,0x00,0x00,0x00,0x48,0xFF,0xFF,0x70,0x00,0x00,0x00,0x48,0xFF,0xFF,0x70,
0x00,0x00,0x00,0x48,0xFF,0xFF,0x70,0x00,0x00,0x06,0x63,0xC7,0xF3,0xF8,0xD6,0x74,
0x04,0x00,0x16,0xD0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA2,0x00,0x01,0xAE,0xFD,0x9C,
0x3E,0x3C,0xD2,0xFF,0xFF,0x27,0x00,0x0B,0x3D,0x00,0x00,0x00,0x67,0xFF,0xFF,0x50,
0x00,0x00,0x00,0x00,0x00,0x00,0x7D,0xFF,0xFF,0x39,0x00,0x00,0x00,0x00,0x00,0x13,
0xE7,0xFF,0xE3,0x03,0x00,0x00,0x00,0x00,0x06,0xBD,0xFF,0xFF,0x54,0x00,0x00,0x00,
0x00,0x02,0xA7,0xFF,0xFF,0x83,0x00,0x00,0x00,0x00,0x00,0x99,0xFF,0xFF,0x8C,0x00,
0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x84,0x00,0x00,0x00,0x00,0x00,0x87,0xFF,0xFF,
0x9E,0x28,0x28,0x28,0x28,0x1C,0x3E,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB4,
0x48,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x35,0xA0,0xDF,
0xF8,0xEE,0xCF,0x75,0x0A,0x00,0x16,0xF4,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0x00,
0x00,0x64,0xBE,0x55,0x2E,0x46,0xD9,0xFF,0xFF,0x25,0x00,0x00,0x00,0x00,0x00,0x00,
0x88,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x0C,0x40,0xDF,0xFF,0xAD,0x00,0x00,0x00,
0x58,0xFF,0xFF,0xFF,0xE7,0x82,0x07,0x00,0x00,0x00,0x58,0xFF,0xFF,0xFF,0xF5,0xB8,
0x36,0x00,0x00,0x00,0x0D,0x28,0x34,0x62,0xE0,0xFF,0xF7,0x27,0x00,0x00,0x00,0x00,
0x00,0x00,0x58,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0xFF,0x83,
0x4C,0xB5,0x61,0x3B,0x32,0x61,0xE9,0xFF,0xFF,0x43,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xA1,0x00,0x1C,0x8E,0xD1,0xEC,0xFA,0xEA,0xBA,0x5C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,0x00,0x22,0xF3,
0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,0x02,0xC2,0xFF,0xFF,0xFF,0x70,0x00,0x00,0x00,
0x00,0x74,0xFF,0xB9,0xFF,0xFF,0x70,0x00,0x00,0x00,0x2B,0xF8,0xED,0x43,0xFF,0xFF,
0x70,0x00,0x00,0x05,0xCD,0xFF,0x5B,0x32,0xFF,0xFF,0x70,0x00,0x00,0x81,0xFF,0xB2,
0x00,0x34,0xFF,0xFF,0x70,0x00,0x34,0xFB,0xEE,0x19,0x00,0x34,0xFF,0xFF,0x70,0x00,
0xAB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xB0,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFC,0x1B,0x28,0x28,0x28,0x28,0x53,0xFF,0xFF,0x86,0x27,0x00,0x00,
0x00,0x00,0x00,0x34,0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xFF,0xFF,
0x70,0x00,0x00,0x00,0x00,0x69,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x98,0x00,0x00,0x7C,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x98,0x00,0x00,0x8E,0xFF,0xF8,0x28,0x28,0x28,0x28,
0x17,0x00,0x00,0xA1,0xFF,0xE3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB3,0xFF,0xCE,
0x18,0x22,0x09,0x00,0x00,0x00,0x00,0xC6,0xFF,0xFF,0xFF,0xFF,0xFA,0xAB,0x19,0x00,
0x00,0xC5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD3,0x04,0x00,0x09,0x3D,0x12,0x0A,0x39,
0xD5,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0xFF,0xFF,0x70,0x00,0x00,
0x00,0x00,0x00,0x00,0x65,0xFF,0xFF,0x61,0x1D,0xB3,0x68,0x41,0x30,0x5F,0xE8,0xFF,
0xFA,0x1D,0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x76,0x00,0x0B,0x88,0xD0,0xED,
0xFB,0xEA,0xB5,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x9A,0xDA,0xF5,0xFF,
0xBE,0x00,0x00,0x00,0x65,0xFB,0xFF,0xFF,0xFF,0xFF,0xCC,0x00,0x00,0x38,0xFC,0xFF,
0xDD,0x6B,0x3B,0x2E,0x3B,0x00,0x00,0xB3,0xFF,0xE4,0x13,0x00,0x00,0x00,0x00,0x00,
0x08,0xF6,0xFF,0x76,0x00,0x18,0x1D,0x00,0x00,0x00,0x3A,0xFF,0xFF,0x5C,0xCA,0xFF,
0xFF,0xE1,0x4D,0x00,0x4F,0xFF,0xFF,0xE9,0xFF,0xFF,0xFF,0xFF,0xF6,0x21,0x5A,0xFF,
0xFF,0xDB,0x37,0x0C,0x75,0xFF,0xFF,0x83,0x48,0xFF,0xFF,0x67,0x00,0x00,0x01,0xF7,
0xFF,0xA8,0x1C,0xFE,0xFF,0x8B,0x00,0x00,0x0C,0xFD,0xFF,0xA1,0x00,0xBE,0xFF,0xF9,
0x5E,0x34,0xA8,0xFF,0xFF,0x61,0x00,0x26,0xEC,0xFF,0xFF,0xFF,0xFF,0xFF,0xCA,0x06,
0x00,0x00,0x20,0xA0,0xE7,0xFA,0xDE,0x8A,0x0C,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xB4,0x84,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAB,
0x14,0x28,0x28,0x28,0x28,0x28,0x76,0xFF,0xFF,0x52,0x00,0x00,0x00,0x00,0x00,0x00,
0xC6,0xFF,0xE1,0x03,0x00,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0x77,0x00,0x00,0x00,
0x00,0x00,0x00,0xAA,0xFF,0xF7,0x13,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0xFF,0x9D,
0x00,0x00,0x00,0x00,0x00,0x00,0x8E,0xFF,0xFF,0x30,0x00,0x00,0x00,0x00,0x00,0x0E,
0xF1,0xFF,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0xFF,0xFF,0x55,0x00,0x00,0x00,
0x00,0x00,0x03,0xE0,0xFF,0xE4,0x04,0x00,0x00,0x00,0x00,0x00,0x56,0xFF,0xFF,0x7B,
0x00,0x00,0x00,0x00,0x00,0x00,0xC7,0xFF,0xF8,0x15,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x57,0xC1,0xF2,0xF8,0xD5,0x7E,0x09,0x00,0x00,0x72,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xB7,0x00,0x00,0xE2,0xFF,0xE8,0x4B,0x39,0xC1,0xFF,0xFF,0x28,0x00,0xE7,
0xFF,0xA1,0x00,0x00,0x59,0xFF,0xFF,0x2E,0x00,0x9D,0xFF,0xF2,0x4B,0x23,0xCC,0xFF,
0xD8,0x04,0x00,0x0D,0xB7,0xFF,0xFF,0xFB,0xFF,0xD5,0x24,0x00,0x00,0x00,0x67,0xFE,
0xFF,0xFF,0xFF,0x7B,0x04,0x00,0x00,0x8D,0xFF,0xFE,0x94,0x93,0xFC,0xFF,0xAD,0x03,
0x28,0xFE,0xFF,0x72,0x00,0x00,0x4D,0xFE,0xFF,0x68,0x56,0xFF,0xFF,0x36,0x00,0x00,
0x00,0xED,0xFF,0x9A,0x3F,0xFF,0xFF,0xBF,0x3E,0x33,0x8E,0xFF,0xFF,0x77,0x02,0xC0,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDB,0x12,0x00,0x09,0x70,0xCD,0xED,0xF7,0xD9,0x8B,
0x13,0x00,0x00,0x00,0x00,0x00,0x62,0xCC,0xF6,0xEF,0xBA,0x42,0x00,0x00,0x00,0x89,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x5C,0x00,0x1E,0xFC,0xFF,0xD5,0x43,0x42,0xDC,0xFF,
0xF1,0x10,0x5B,0xFF,0xFF,0x50,0x00,0x00,0x44,0xFF,0xFF,0x5F,0x61,0xFF,0xFF,0x40,
0x00,0x00,0x1A,0xFF,0xFF,0x8B,0x3C,0xFF,0xFF,0xAF,0x14,0x1F,0xAE,0xFF,0xFF,0x9E,
0x03,0xCF,0xFF,0xFF,0xFF,0xFF,0xF2,0xF4,0xFF,0x92,0x00,0x25,0xC7,0xFF,0xFF,0xEA,
0x42,0xF4,0xFF,0x7D,0x00,0x00,0x00,0x15,0x1F,0x04,0x2E,0xFF,0xFF,0x44,0x00,0x00,
0x00,0x00,0x00,0x01,0xAD,0xFF,0xF3,0x07,0x00,0x2A,0x33,0x33,0x56,0xBD,0xFF,0xFF,
0x7D,0x00,0x00,0x88,0xFF,0xFF,0xFF,0xFF,0xFF,0xA6,0x03,0x00,0x00,0x7F,0xFE,0xFA,
0xE7,0xB3,0x51,0x00,0x00,0x00,0x00,0x00,0x90,0xF6,0xAF,0x00,0xEE,0xFF,0xFF,0x11,
0x8F,0xF6,0xAE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x8C,0xEE,0xA9,0x00,0xEE,0xFF,0xFF,0x11,0x90,0xF6,0xAE,0x00,
0x00,0x90,0xF6,0xAF,0x00,0x00,0xEE,0xFF,0xFF,0x11,0x00,0x8F,0xF6,0xAE,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xFF,0xE5,0x00,0x00,0xDD,0xFF,
0x90,0x00,0x16,0xFF,0xFE,0x2B,0x00,0x52,0xFF,0xB6,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xC0,0x80,
0x00,0x00,0x00,0x00,0x00,0x40,0xC0,0xFF,0xFF,0x7A,0x00,0x00,0x00,0x40,0xC0,0xFF,
0xFF,0xC8,0x53,0x02,0x00,0x40,0xC0,0xFF,0xFF,0xB5,0x3F,0x00,0x00,0x00,0x34,0xFF,
0xFF,0xE2,0x33,0x00,0x00,0x00,0x00,0x00,0x16,0xAE,0xFD,0xFF,0xEA,0x87,0x20,0x00,
0x00,0x00,0x00,0x00,0x22,0x91,0xF2,0xFF,0xFD,0xB5,0x4C,0x02,0x00,0x00,0x00,0x00,
0x0F,0x73,0xE0,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x56,0xC7,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x00,0x00,0x08,0x28,0x28,0x28,
0x28,0x28,0x28,0x28,0x28,0x14,0x38,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,
0x38,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x08,0x28,0x28,0x28,0x28,0x28,
0x28,0x28,0x28,0x14,0x38,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x38,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x0A,0x05,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0xDE,0x64,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0xFF,0xFF,0xDE,
0x64,0x05,0x00,0x00,0x00,0x00,0x00,0x32,0xA8,0xFC,0xFF,0xDE,0x64,0x05,0x00,0x00,
0x00,0x00,0x00,0x22,0x96,0xF6,0xFF,0xDE,0x64,0x05,0x00,0x00,0x00,0x00,0x00,0x16,
0xBB,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x0E,0x6B,0xD4,0xFF,0xFF,0xCD,0x3C,0x00,0x2F,
0x98,0xF3,0xFF,0xFD,0xB0,0x3F,0x00,0x00,0x34,0xFF,0xFF,0xF3,0x92,0x23,0x00,0x00,
0x00,0x00,0x38,0xE2,0x75,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x04,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x80,0xCE,0xF3,0xF5,0xD3,0x72,0x06,
0x00,0xBD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA3,0x00,0x43,0xD8,0x72,0x3E,0x3A,0xC4,
0xFF,0xFE,0x13,0x00,0x01,0x00,0x00,0x00,0x73,0xFF,0xFF,0x14,0x00,0x00,0x00,0x00,
0x24,0xE3,0xFF,0xC9,0x00,0x00,0x00,0x00,0x4B,0xF0,0xFF,0xDB,0x22,0x00,0x00,0x00,
0x2E,0xF9,0xFF,0xB5,0x10,0x00,0x00,0x00,0x00,0x82,0xFF,0xDE,0x05,0x00,0x00,0x00,
0x00,0x00,0x4E,0x8C,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x71,0xED,0xBC,0x07,0x00,0x00,0x00,0x00,0x00,0xD1,0xFF,0xFF,
0x2D,0x00,0x00,0x00,0x00,0x00,0x74,0xF5,0xC2,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x05,0x64,0xB6,0xE5,0xF9,0xE7,0xC1,0x69,0x0A,0x00,0x00,0x00,
0x00,0x00,0x00,0x2E,0xDA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD9,0x2E,0x00,0x00,
0x00,0x00,0x2E,0xF1,0xFF,0xE5,0x82,0x49,0x2F,0x3D,0x79,0xE2,0xFF,0xE5,0x18,0x00,
0x00,0x04,0xD7,0xFF,0xAE,0x19,0x8C,0xE1,0xF7,0xDE,0xB3,0x54,0xC1,0xFF,0x98,0x00,
0x00,0x5F,0xFF,0xD2,0x0E,0xCC,0xFF,0xFF,0xFF,0xFF,0xFF,0x95,0x1D,0xFB,0xF3,0x06,
0x00,0xB9,0xFF,0x53,0x6A,0xFF,0xEC,0x5D,0x2D,0x91,0xFF,0x89,0x00,0xC9,0xFF,0x24,
0x00,0xF3,0xFC,0x08,0xB0,0xFF,0x6F,0x00,0x00,0x81,0xFF,0x7D,0x00,0xB8,0xFF,0x38,
0x0D,0xFF,0xE4,0x00,0xBE,0xFF,0x4B,0x00,0x00,0xAB,0xFF,0x72,0x00,0xDA,0xFF,0x1E,
0x0C,0xFF,0xE1,0x00,0x9B,0xFF,0xB9,0x35,0x5C,0xF9,0xFF,0xA8,0x62,0xFF,0xDD,0x01,
0x00,0xF3,0xFB,0x0B,0x32,0xFE,0xFF,0xFF,0xFF,0xDB,0xE1,0xFF,0xFF,0xFF,0x6D,0x00,
0x00,0xBC,0xFF,0x61,0x00,0x57,0xD8,0xF9,0xC8,0x22,0x43,0xE4,0xED,0x83,0x01,0x00,
0x00,0x5D,0xFF,0xED,0x2D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x02,0xBA,0xFF,0xF6,0x94,0x4B,0x2E,0x38,0x53,0x84,0xD1,0x27,0x00,0x00,0x00,
0x00,0x00,0x11,0xB2,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x27,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x4A,0xA6,0xDB,0xF4,0xF8,0xDD,0x9F,0x3D,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xA5,0xFF,0xFF,0xF8,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0A,0xF4,0xFF,0xFF,0xFF,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x57,0xFF,0xFF,
0xC5,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0xFF,0xD0,0x63,0xFF,0xFD,
0x18,0x00,0x00,0x00,0x00,0x00,0x10,0xF9,0xFF,0x86,0x18,0xFE,0xFF,0x70,0x00,0x00,
0x00,0x00,0x00,0x63,0xFF,0xFF,0x38,0x00,0xC8,0xFF,0xCA,0x00,0x00,0x00,0x00,0x00,
0xBC,0xFF,0xE8,0x01,0x00,0x79,0xFF,0xFF,0x23,0x00,0x00,0x00,0x18,0xFC,0xFF,0xC0,
0x48,0x48,0x6D,0xFF,0xFF,0x7D,0x00,0x00,0x00,0x6F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xD6,0x00,0x00,0x00,0xC8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x31,0x00,0x22,0xFF,0xFF,0xB8,0x00,0x00,0x00,0x00,0x4C,0xFF,0xFF,0x8B,0x00,0x7A,
0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x08,0xF3,0xFF,0xE3,0x01,0xD3,0xFF,0xFE,0x19,
0x00,0x00,0x00,0x00,0x00,0xAC,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,
0xFF,0xF6,0xDC,0xA6,0x3D,0x00,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,
0x50,0x00,0x60,0xFF,0xFF,0x72,0x28,0x38,0x94,0xFF,0xFF,0xB8,0x00,0x60,0xFF,0xFF,
0x58,0x00,0x00,0x06,0xFE,0xFF,0xC4,0x00,0x60,0xFF,0xFF,0x58,0x00,0x0D,0x6D,0xFF,
0xFF,0x8A,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xAC,0x0E,0x00,0x60,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xB1,0x23,0x00,0x60,0xFF,0xFF,0x72,0x28,0x35,0x7F,
0xFF,0xFF,0xCD,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0xC5,0xFF,0xFF,0x15,0x60,
0xFF,0xFF,0x58,0x00,0x00,0x00,0xCB,0xFF,0xFF,0x1A,0x60,0xFF,0xFF,0x72,0x28,0x33,
0x81,0xFF,0xFF,0xE3,0x01,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x53,0x00,
0x60,0xFF,0xFF,0xFF,0xFF,0xFD,0xEA,0xAF,0x3A,0x00,0x00,0x00,0x00,0x00,0x0F,0x75,
0xCD,0xEE,0xF2,0xD2,0x95,0x37,0x00,0x23,0xD9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x92,
0x04,0xCF,0xFF,0xFF,0x99,0x3A,0x33,0x70,0xD4,0x2A,0x5E,0xFF,0xFF,0xA2,0x00,0x00,
0x00,0x00,0x00,0x00,0xB2,0xFF,0xFF,0x2C,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xFF,
0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0xFF,0xE2,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xDF,0xFF,0xF4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBE,0xFF,0xFF,0x1F,
0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xFF,0xFF,0x89,0x00,0x00,0x00,0x00,0x00,0x00,
0x14,0xED,0xFF,0xFD,0x87,0x37,0x33,0x52,0x94,0x44,0x00,0x49,0xF5,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x58,0x00,0x00,0x28,0x98,0xDA,0xF6,0xF3,0xDC,0xA1,0x26,0x00,0x00,
0x60,0xFF,0xFF,0xFF,0xFE,0xEA,0xCB,0x7C,0x18,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xEE,0x4E,0x00,0x00,0x60,0xFF,0xFF,0x72,0x28,0x39,0x81,0xF7,
0xFF,0xF6,0x30,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xB2,0x00,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0xD1,0xFF,0xFC,0x0F,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x00,0x9D,0xFF,0xFF,0x2F,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,
0x90,0xFF,0xFF,0x41,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0xA1,0xFF,0xFF,0x31,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0xDB,0xFF,0xF9,0x09,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x60,0xFF,0xFF,0xB0,0x00,0x60,0xFF,0xFF,0x72,0x29,0x41,0x91,0xFC,
0xFF,0xF4,0x2B,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE9,0x42,0x00,0x00,
0x60,0xFF,0xFF,0xFF,0xFB,0xEA,0xBF,0x73,0x10,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x04,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,0x60,0xFF,
0xFF,0x72,0x28,0x28,0x28,0x28,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xB0,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB0,0x00,0x60,0xFF,0xFF,0x72,0x28,
0x28,0x28,0x1B,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,
0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x72,0x28,0x28,0x28,0x28,0x00,0x60,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x04,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x60,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFC,0x60,0xFF,0xFF,0x68,0x28,0x28,0x28,0x27,0x60,0xFF,0xFF,0x4C,
0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x4C,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x68,
0x28,0x28,0x28,0x1A,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA8,0x60,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xA8,0x60,0xFF,0xFF,0x4C,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x4C,
0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x4C,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x4C,
0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x58,
0xB3,0xDF,0xF7,0xEB,0xCD,0x8D,0x2A,0x00,0x18,0xC2,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x45,0x04,0xC4,0xFF,0xFF,0xD3,0x5E,0x32,0x43,0x76,0xB1,0x00,0x5A,0xFF,0xFF,
0xCC,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0xB2,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xDA,0xFF,0xF5,0x02,0x00,0x14,0x28,0x28,0x28,0x28,0x17,0xEF,0xFF,
0xE1,0x00,0x00,0x80,0xFF,0xFF,0xFF,0xFF,0x98,0xE3,0xFF,0xEE,0x00,0x00,0x80,0xFF,
0xFF,0xFF,0xFF,0x98,0xBF,0xFF,0xFF,0x20,0x00,0x00,0x00,0x14,0xFF,0xFF,0x98,0x78,
0xFF,0xFF,0x95,0x00,0x00,0x00,0x14,0xFF,0xFF,0x98,0x13,0xEB,0xFF,0xFF,0x9B,0x3F,
0x2C,0x4F,0xFF,0xFF,0x98,0x00,0x41,0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x98,
0x00,0x00,0x1E,0x91,0xD8,0xF6,0xFB,0xED,0xCB,0x93,0x3A,0x00,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,
0x90,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x28,
0x60,0xFF,0xFF,0x72,0x28,0x28,0x28,0x28,0xA1,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,
0x90,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x28,0x6C,0xFF,0xFF,0xFF,0xFF,0xFF,0x6C,0x56,
0xFD,0xFF,0xFF,0xFF,0xFD,0x56,0x00,0x23,0xEA,0xFF,0xEA,0x23,0x00,0x00,0x00,0xDC,
0xFF,0xDC,0x00,0x00,0x00,0x00,0xDC,0xFF,0xDC,0x00,0x00,0x00,0x00,0xDC,0xFF,0xDC,
0x00,0x00,0x00,0x00,0xDC,0xFF,0xDC,0x00,0x00,0x00,0x00,0xDC,0xFF,0xDC,0x00,0x00,
0x00,0x00,0xDC,0xFF,0xDC,0x00,0x00,0x00,0x00,0xDC,0xFF,0xDC,0x00,0x00,0x00,0x0B,
0xE4,0xFF,0xE4,0x0B,0x00,0x45,0xED,0xFF,0xFF,0xFF,0xED,0x45,0x6C,0xFF,0xFF,0xFF,
0xFF,0xFF,0x6C,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x60,0xFF,
0xFF,0x58,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,
0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x60,
0xFF,0xFF,0x58,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x60,0xFF,0xFF,
0x58,0x00,0x00,0x00,0x60,0xFF,0xFF,0x56,0x00,0x00,0x00,0x71,0xFF,0xFF,0x45,0x0B,
0x09,0x1F,0xCE,0xFF,0xFD,0x19,0x54,0xFF,0xFF,0xFF,0xFF,0xA7,0x00,0x53,0xFF,0xFF,
0xF7,0x9C,0x0C,0x00,0x01,0x1C,0x20,0x07,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x7F,0xFF,0xFF,0x89,0x60,0xFF,0xFF,0x58,0x00,0x00,0x47,0xFD,0xFF,
0xC1,0x03,0x60,0xFF,0xFF,0x58,0x00,0x1F,0xEC,0xFF,0xE7,0x18,0x00,0x60,0xFF,0xFF,
0x58,0x07,0xCA,0xFF,0xFC,0x3F,0x00,0x00,0x60,0xFF,0xFF,0x58,0x94,0xFF,0xFF,0x77,
0x00,0x00,0x00,0x60,0xFF,0xFF,0xA2,0xFF,0xFF,0xB6,0x01,0x00,0x00,0x00,0x60,0xFF,
0xFF,0xFF,0xFF,0xFF,0xD3,0x05,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,0xD3,0xFF,0xFF,
0x7B,0x00,0x00,0x00,0x60,0xFF,0xFF,0x75,0x0D,0xE4,0xFF,0xF7,0x24,0x00,0x00,0x60,
0xFF,0xFF,0x58,0x00,0x52,0xFF,0xFF,0xBD,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,
0xB3,0xFF,0xFF,0x5F,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x1E,0xF4,0xFF,0xEC,0x14,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x74,0xFF,0xFF,0xA3,0x00,0x60,0xFF,0xFF,0x58,
0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,
0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,
0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,
0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,
0x58,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x82,0x40,0x40,0x40,0x40,0x24,0x60,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x90,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x90,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x00,0x85,0xFF,
0xFF,0xFF,0x5C,0x60,0xFF,0xFF,0xFF,0xC9,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,
0xFF,0x5C,0x60,0xFF,0xFE,0xFF,0xFE,0x18,0x00,0x00,0x00,0x2B,0xFF,0xFE,0xFF,0xFF,
0x5C,0x60,0xFF,0xEA,0xDE,0xFF,0x65,0x00,0x00,0x00,0x7D,0xFF,0xC6,0xFF,0xFF,0x5C,
0x60,0xFF,0xF6,0x8F,0xFF,0xB3,0x00,0x00,0x00,0xD0,0xFF,0x7B,0xFF,0xFF,0x5C,0x60,
0xFF,0xFF,0x43,0xFF,0xF7,0x0A,0x00,0x23,0xFF,0xF8,0x36,0xFF,0xFF,0x5C,0x60,0xFF,
0xFF,0x0C,0xED,0xFF,0x50,0x00,0x75,0xFF,0xB3,0x2D,0xFF,0xFF,0x5C,0x60,0xFF,0xFF,
0x0B,0xA2,0xFF,0x9E,0x00,0xC8,0xFF,0x5F,0x30,0xFF,0xFF,0x5C,0x60,0xFF,0xFF,0x0C,
0x53,0xFF,0xE9,0x1E,0xFE,0xFA,0x10,0x30,0xFF,0xFF,0x5C,0x60,0xFF,0xFF,0x0C,0x0C,
0xF8,0xFF,0xA8,0xFF,0xB6,0x00,0x30,0xFF,0xFF,0x5C,0x60,0xFF,0xFF,0x0C,0x00,0xB5,
0xFF,0xFF,0xFF,0x62,0x00,0x30,0xFF,0xFF,0x5C,0x60,0xFF,0xFF,0x0C,0x00,0x66,0xFF,
0xFF,0xFB,0x12,0x00,0x30,0xFF,0xFF,0x5C,0x60,0xFF,0xFF,0x0C,0x00,0x19,0xFE,0xFF,
0xBA,0x00,0x00,0x30,0xFF,0xFF,0x5C,0x00,0x60,0xFF,0xFF,0xFF,0x58,0x00,0x00,0x00,
0x00,0x70,0xFF,0xFF,0x04,0x60,0xFF,0xFF,0xFF,0xE1,0x08,0x00,0x00,0x00,0x70,0xFF,
0xFF,0x04,0x60,0xFF,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x70,0xFF,0xFF,0x04,0x60,
0xFF,0xEE,0xE2,0xFF,0xF4,0x19,0x00,0x00,0x70,0xFF,0xFF,0x04,0x60,0xFF,0xF0,0x58,
0xFF,0xFF,0xA0,0x00,0x00,0x70,0xFF,0xFF,0x04,0x60,0xFF,0xFB,0x00,0xC4,0xFF,0xFE,
0x33,0x00,0x70,0xFF,0xFF,0x04,0x60,0xFF,0xFF,0x06,0x33,0xFD,0xFF,0xC3,0x00,0x6D,
0xFF,0xFF,0x04,0x60,0xFF,0xFF,0x0C,0x00,0x9D,0xFF,0xFF,0x56,0x67,0xFF,0xFF,0x04,
0x60,0xFF,0xFF,0x0C,0x00,0x17,0xF2,0xFF,0xDF,0x66,0xFF,0xFF,0x04,0x60,0xFF,0xFF,
0x0C,0x00,0x00,0x76,0xFF,0xFF,0xCD,0xFF,0xFF,0x04,0x60,0xFF,0xFF,0x0C,0x00,0x00,
0x06,0xDB,0xFF,0xFF,0xFF,0xFF,0x04,0x60,0xFF,0xFF,0x0C,0x00,0x00,0x00,0x4E,0xFF,
0xFF,0xFF,0xFF,0x04,0x60,0xFF,0xFF,0x0C,0x00,0x00,0x00,0x00,0xB9,0xFF,0xFF,0xFF,
0x04,0x00,0x00,0x00,0x00,0x00,0x17,0x7E,0xCF,0xEC,0xF6,0xDB,0xA0,0x35,0x00,0x00,
0x00,0x00,0x35,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x72,0x00,0x00,0x0D,0xE2,
0xFF,0xFF,0x97,0x3C,0x30,0x6A,0xEE,0xFF,0xFF,0x41,0x00,0x6E,0xFF,0xFF,0x9F,0x00,
0x00,0x00,0x00,0x4B,0xFF,0xFF,0xC1,0x00,0xBB,0xFF,0xFF,0x31,0x00,0x00,0x00,0x00,
0x01,0xDC,0xFF,0xFC,0x11,0xDE,0xFF,0xFD,0x04,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,
0xFF,0x30,0xEE,0xFF,0xEE,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,0xFF,0x42,0xDD,
0xFF,0xFD,0x04,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0xFF,0x30,0xB8,0xFF,0xFF,0x31,
0x00,0x00,0x00,0x00,0x01,0xDC,0xFF,0xFC,0x10,0x6B,0xFF,0xFF,0x9D,0x00,0x00,0x00,
0x00,0x49,0xFF,0xFF,0xC0,0x00,0x0B,0xE0,0xFF,0xFF,0x94,0x3A,0x30,0x69,0xEC,0xFF,
0xFF,0x41,0x00,0x00,0x33,0xE6,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x71,0x00,0x00,
0x00,0x00,0x17,0x7F,0xD0,0xEE,0xF6,0xDC,0xA0,0x35,0x00,0x00,0x00,0x00,0x00,0x00,
0x60,0xFF,0xFF,0xFF,0xFF,0xF3,0xCE,0x76,0x05,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xB3,0x00,0x60,0xFF,0xFF,0x72,0x2A,0x51,0xDF,0xFF,0xFF,0x40,0x60,0xFF,
0xFF,0x58,0x00,0x00,0x5E,0xFF,0xFF,0x75,0x60,0xFF,0xFF,0x58,0x00,0x00,0x5A,0xFF,
0xFF,0x70,0x60,0xFF,0xFF,0x58,0x08,0x39,0xD7,0xFF,0xFF,0x37,0x60,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xAF,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xE5,0x83,0x06,0x00,
0x60,0xFF,0xFF,0x72,0x25,0x13,0x01,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,
0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,
0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x7E,0xCF,0xEC,0xF6,0xDB,0xA0,0x35,0x00,0x00,
0x00,0x00,0x35,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x72,0x00,0x00,0x0D,0xE2,
0xFF,0xFF,0x97,0x3C,0x30,0x6A,0xEE,0xFF,0xFF,0x41,0x00,0x6E,0xFF,0xFF,0x9F,0x00,
0x00,0x00,0x00,0x4B,0xFF,0xFF,0xC0,0x00,0xBB,0xFF,0xFF,0x31,0x00,0x00,0x00,0x00,
0x01,0xDC,0xFF,0xFC,0x10,0xDE,0xFF,0xFD,0x04,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,
0xFF,0x30,0xEE,0xFF,0xEE,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,0xFF,0x41,0xDD,
0xFF,0xFD,0x04,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0xFF,0x2E,0xB8,0xFF,0xFF,0x31,
0x00,0x00,0x00,0x00,0x01,0xDC,0xFF,0xFD,0x10,0x6B,0xFF,0xFF,0x9D,0x00,0x00,0x00,
0x00,0x49,0xFF,0xFF,0xBD,0x00,0x0B,0xE0,0xFF,0xFF,0x94,0x3A,0x30,0x69,0xEC,0xFF,
0xFE,0x47,0x00,0x00,0x33,0xE6,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x7B,0x00,0x00,
0x00,0x00,0x17,0x7F,0xD0,0xEE,0xFF,0xFF,0xFF,0x67,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x42,0xFC,0xFF,0xE6,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x75,0xFF,0xFF,0xD5,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,
0xFC,0xFC,0xBE,0x06,0x60,0xFF,0xFF,0xFF,0xFD,0xEE,0xC4,0x6E,0x06,0x00,0x00,0x60,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB7,0x01,0x00,0x60,0xFF,0xFF,0x72,0x30,0x59,
0xE0,0xFF,0xFF,0x45,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0x5B,0xFF,0xFF,0x76,0x00,
0x60,0xFF,0xFF,0x58,0x00,0x00,0x61,0xFF,0xFF,0x6D,0x00,0x60,0xFF,0xFF,0x72,0x2F,
0x5B,0xE3,0xFF,0xF5,0x20,0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF6,0x56,0x00,
0x00,0x60,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x54,0x00,0x00,0x00,0x60,0xFF,0xFF,0x58,
0x08,0xDD,0xFF,0xD3,0x06,0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x49,0xFF,0xFF,0x87,
0x00,0x00,0x60,0xFF,0xFF,0x58,0x00,0x00,0xAC,0xFF,0xFC,0x35,0x00,0x60,0xFF,0xFF,
0x58,0x00,0x00,0x1C,0xF3,0xFF,0xD6,0x07,0x60,0xFF,0xFF,0x58,0x00,0x00,0x00,0x72,
0xFF,0xFF,0x8A,0x00,0x00,0x00,0x3B,0xB4,0xE3,0xF6,0xDA,0xAB,0x57,0x04,0x00,0x59,
0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0x02,0x00,0xDC,0xFF,0xEF,0x50,0x35,0x60,0xB8,
0x77,0x00,0x02,0xFF,0xFF,0xB2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE9,0xFF,0xF7,
0x5A,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0xFF,0xFF,0xFF,0xCD,0x4E,0x00,0x00,0x00,
0x00,0x01,0x81,0xFC,0xFF,0xFF,0xFF,0xB6,0x10,0x00,0x00,0x00,0x00,0x26,0xA4,0xFC,
0xFF,0xFF,0xB3,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0xE2,0xFF,0xFF,0x19,0x07,0x06,
0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0x2C,0x2C,0xEB,0x92,0x4B,0x2E,0x48,0xDE,0xFF,
0xF4,0x09,0x2C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x6C,0x00,0x0C,0x7C,0xC7,0xE9,
0xFB,0xED,0xB8,0x4A,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x10,0xA4,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x10,0x19,0x28,
0x28,0x46,0xFF,0xFF,0xA1,0x28,0x28,0x28,0x02,0x00,0x00,0x00,0x24,0xFF,0xFF,0x90,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x24,0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,
0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x24,0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,
0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0x90,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,
0xFF,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x78,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,
0xA4,0xFF,0xFF,0x14,0x78,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x14,
0x78,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x14,0x78,0xFF,0xFF,0x40,
0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x14,0x78,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,
0xA4,0xFF,0xFF,0x14,0x78,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x14,
0x78,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x14,0x78,0xFF,0xFF,0x40,
0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x14,0x72,0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,
0xB9,0xFF,0xFF,0x0C,0x51,0xFF,0xFF,0x95,0x00,0x00,0x00,0x0E,0xEE,0xFF,0xE8,0x00,
0x0C,0xEC,0xFF,0xFC,0x94,0x54,0x62,0xCB,0xFF,0xFF,0x8B,0x00,0x00,0x4F,0xFA,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xCA,0x0A,0x00,0x00,0x00,0x32,0xA6,0xE5,0xFA,0xEF,0xCA,
0x73,0x06,0x00,0x00,0xD5,0xFF,0xE6,0x01,0x00,0x00,0x00,0x00,0x34,0xFF,0xFF,0x88,
0x80,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0x85,0xFF,0xFF,0x32,0x2A,0xFF,0xFF,0x87,
0x00,0x00,0x00,0x00,0xD5,0xFF,0xDB,0x00,0x00,0xD4,0xFF,0xD7,0x00,0x00,0x00,0x25,
0xFF,0xFF,0x86,0x00,0x00,0x7E,0xFF,0xFF,0x26,0x00,0x00,0x76,0xFF,0xFF,0x30,0x00,
0x00,0x28,0xFF,0xFF,0x77,0x00,0x00,0xC6,0xFF,0xD9,0x00,0x00,0x00,0x00,0xD2,0xFF,
0xC6,0x00,0x18,0xFE,0xFF,0x83,0x00,0x00,0x00,0x00,0x7D,0xFF,0xFD,0x18,0x67,0xFF,
0xFF,0x2D,0x00,0x00,0x00,0x00,0x27,0xFF,0xFF,0x5C,0xB2,0xFF,0xD6,0x00,0x00,0x00,
0x00,0x00,0x00,0xD1,0xFF,0x9E,0xEE,0xFF,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,
0xFF,0xED,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0xFF,0xFF,0xFF,0xD5,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,0xFF,0xFF,0x7F,0x00,0x00,0x00,0x00,
0xE0,0xFF,0xCD,0x00,0x00,0x00,0x00,0xB5,0xFF,0xFF,0x1C,0x00,0x00,0x00,0x65,0xFF,
0xFF,0x47,0x9F,0xFF,0xFB,0x0B,0x00,0x00,0x04,0xF2,0xFF,0xFF,0x5E,0x00,0x00,0x00,
0xA0,0xFF,0xFA,0x0B,0x5F,0xFF,0xFF,0x41,0x00,0x00,0x39,0xFF,0xFF,0xFF,0xA0,0x00,
0x00,0x00,0xDB,0xFF,0xC6,0x00,0x1E,0xFF,0xFF,0x7C,0x00,0x00,0x7B,0xFF,0xEA,0xFF,
0xE1,0x00,0x00,0x16,0xFF,0xFF,0x85,0x00,0x00,0xDD,0xFF,0xB6,0x00,0x00,0xBC,0xFF,
0x92,0xFF,0xFF,0x23,0x00,0x51,0xFF,0xFF,0x44,0x00,0x00,0x9D,0xFF,0xEE,0x01,0x07,
0xF6,0xFF,0x44,0xE1,0xFF,0x65,0x00,0x8C,0xFF,0xF9,0x0A,0x00,0x00,0x5C,0xFF,0xFF,
0x2B,0x40,0xFF,0xFB,0x0C,0xA7,0xFF,0xA7,0x00,0xC7,0xFF,0xC3,0x00,0x00,0x00,0x1C,
0xFF,0xFF,0x65,0x81,0xFF,0xC7,0x00,0x65,0xFF,0xE7,0x06,0xF9,0xFF,0x83,0x00,0x00,
0x00,0x00,0xDB,0xFF,0x9A,0xB8,0xFF,0x85,0x00,0x23,0xFF,0xFF,0x51,0xFF,0xFF,0x42,
0x00,0x00,0x00,0x00,0x9A,0xFF,0xC9,0xE5,0xFF,0x44,0x00,0x00,0xE1,0xFF,0xB1,0xFF,
0xF8,0x08,0x00,0x00,0x00,0x00,0x5A,0xFF,0xF5,0xFF,0xF9,0x09,0x00,0x00,0x9E,0xFF,
0xF5,0xFF,0xC1,0x00,0x00,0x00,0x00,0x00,0x19,0xFF,0xFF,0xFF,0xC1,0x00,0x00,0x00,
0x5C,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0x80,0x00,
0x00,0x00,0x1A,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0x92,
0x00,0x00,0x00,0x00,0x85,0xFF,0xFF,0x64,0x02,0xC9,0xFF,0xFB,0x2A,0x00,0x00,0x1F,
0xF7,0xFF,0xC4,0x01,0x00,0x2F,0xFB,0xFF,0xB9,0x00,0x00,0xA8,0xFF,0xFB,0x2C,0x00,
0x00,0x00,0x8A,0xFF,0xFF,0x4E,0x3A,0xFF,0xFF,0x89,0x00,0x00,0x00,0x00,0x0A,0xDF,
0xFF,0xDB,0xCA,0xFF,0xE0,0x0A,0x00,0x00,0x00,0x00,0x00,0x49,0xFF,0xFF,0xFF,0xFF,
0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE3,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x76,0xFF,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,0x00,0x23,0xF6,
0xFF,0xB2,0xD8,0xFF,0xE9,0x14,0x00,0x00,0x00,0x00,0xBE,0xFF,0xF4,0x1D,0x43,0xFF,
0xFF,0xA9,0x00,0x00,0x00,0x64,0xFF,0xFF,0x74,0x00,0x00,0xA5,0xFF,0xFF,0x54,0x00,
0x19,0xEF,0xFF,0xD2,0x04,0x00,0x00,0x18,0xF0,0xFF,0xEA,0x15,0xAE,0xFF,0xFE,0x3B,
0x00,0x00,0x00,0x00,0x6B,0xFF,0xFF,0xAA,0xBD,0xFF,0xFF,0x34,0x00,0x00,0x00,0x0B,
0xE9,0xFF,0xEA,0x0D,0x37,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x77,0xFF,0xFF,0x6F,0x00,
0x00,0xAF,0xFF,0xFF,0x35,0x00,0x0C,0xEC,0xFF,0xDF,0x06,0x00,0x00,0x2B,0xFD,0xFF,
0xB5,0x00,0x7B,0xFF,0xFF,0x5E,0x00,0x00,0x00,0x00,0xA1,0xFF,0xFF,0x44,0xEE,0xFF,
0xD3,0x02,0x00,0x00,0x00,0x00,0x20,0xF9,0xFF,0xF4,0xFF,0xFF,0x4D,0x00,0x00,0x00,
0x00,0x00,0x00,0x93,0xFF,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,
0xF4,0xFF,0xFF,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBC,0xFF,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBC,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xBC,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xBC,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBC,0xFF,0xF8,0x00,
0x00,0x00,0x00,0x00,0x68,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD4,0x68,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCB,0x10,0x28,0x28,0x28,0x28,0x28,0xBD,0xFF,
0xFF,0x48,0x00,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0x9B,0x00,0x00,0x00,0x00,0x00,
0x13,0xE8,0xFF,0xE1,0x0D,0x00,0x00,0x00,0x00,0x00,0xA8,0xFF,0xFE,0x44,0x00,0x00,
0x00,0x00,0x00,0x54,0xFF,0xFF,0x97,0x00,0x00,0x00,0x00,0x00,0x15,0xEA,0xFF,0xDE,
0x0C,0x00,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFE,0x40,0x00,0x00,0x00,0x00,0x00,0x58,
0xFF,0xFF,0x93,0x00,0x00,0x00,0x00,0x00,0x17,0xEC,0xFF,0xEB,0x32,0x28,0x28,0x28,
0x28,0x27,0x87,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x90,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0xBC,0xFF,0xFF,0xFF,0x84,0xBC,0xFF,0xFF,
0xFF,0x84,0xBC,0xFF,0x9E,0x28,0x14,0xBC,0xFF,0x8C,0x00,0x00,0xBC,0xFF,0x8C,0x00,
0x00,0xBC,0xFF,0x8C,0x00,0x00,0xBC,0xFF,0x8C,0x00,0x00,0xBC,0xFF,0x8C,0x00,0x00,
0xBC,0xFF,0x8C,0x00,0x00,0xBC,0xFF,0x8C,0x00,0x00,0xBC,0xFF,0x8C,0x00,0x00,0xBC,
0xFF,0x8C,0x00,0x00,0xBC,0xFF,0x8C,0x00,0x00,0xBC,0xFF,0x8C,0x00,0x00,0xBC,0xFF,
0xFF,0xFF,0x84,0xBC,0xFF,0xFF,0xFF,0x84,0x1D,0x28,0x28,0x28,0x14,0x00,0x00,0x00,
0xB5,0xFF,0xB7,0x00,0x00,0x00,0x00,0x00,0x57,0xFF,0xFC,0x18,0x00,0x00,0x00,0x00,
0x08,0xF0,0xFF,0x73,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,0xD1,0x00,0x00,0x00,0x00,
0x00,0x3D,0xFF,0xFF,0x30,0x00,0x00,0x00,0x00,0x01,0xDE,0xFF,0x8F,0x00,0x00,0x00,
0x00,0x00,0x80,0xFF,0xE9,0x04,0x00,0x00,0x00,0x00,0x22,0xFF,0xFF,0x4C,0x00,0x00,
0x00,0x00,0x00,0xC4,0xFF,0xAA,0x00,0x00,0x00,0x00,0x00,0x66,0xFF,0xF8,0x10,0x00,
0x00,0x00,0x00,0x10,0xF7,0xFF,0x67,0x00,0x00,0x00,0x00,0x00,0xAA,0xFF,0xC6,0x00,
0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0x25,0x8C,0xFF,0xFF,0xFF,0xB4,0x8C,0xFF,0xFF,
0xFF,0xB4,0x15,0x28,0xA8,0xFF,0xB4,0x00,0x00,0x98,0xFF,0xB4,0x00,0x00,0x98,0xFF,
0xB4,0x00,0x00,0x98,0xFF,0xB4,0x00,0x00,0x98,0xFF,0xB4,0x00,0x00,0x98,0xFF,0xB4,
0x00,0x00,0x98,0xFF,0xB4,0x00,0x00,0x98,0xFF,0xB4,0x00,0x00,0x98,0xFF,0xB4,0x00,
0x00,0x98,0xFF,0xB4,0x00,0x00,0x98,0xFF,0xB4,0x00,0x00,0x98,0xFF,0xB4,0x8C,0xFF,
0xFF,0xFF,0xB4,0x8C,0xFF,0xFF,0xFF,0xB4,0x15,0x28,0x28,0x28,0x1C,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x6C,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0xFF,0xF4,
0x15,0x00,0x00,0x00,0x00,0x00,0x00,0xA5,0xFF,0xFF,0x8D,0x00,0x00,0x00,0x00,0x00,
0x1D,0xFB,0xDA,0xE6,0xF6,0x19,0x00,0x00,0x00,0x00,0x8D,0xFF,0x6B,0x71,0xFF,0x92,
0x00,0x00,0x00,0x0F,0xF2,0xF0,0x0C,0x09,0xE8,0xF8,0x1C,0x00,0x00,0x76,0xFF,0x8F,
0x00,0x00,0x74,0xFF,0x98,0x00,0x05,0xE4,0xFD,0x23,0x00,0x00,0x0B,0xEA,0xFA,0x20,
0x5E,0xFF,0xB3,0x00,0x00,0x00,0x00,0x77,0xFF,0x9E,0x00,0x00,0x07,0xFC,0xFC,0xFC,
0xFC,0xFC,0xFC,0xFC,0x6E,0x01,0x2C,0x2C,0x2C,0x2C,0x2C,0x2C,0x2C,0x13,0x00,0x00,
0x19,0xDE,0xFF,0xF1,0x1E,0x00,0x00,0x17,0xC9,0xFF,0xC4,0x04,0x00,0x00,0x08,0x9F,
0xFF,0x8E,0x00,0x00,0x00,0x06,0x58,0xB7,0xEC,0xF9,0xDE,0x9E,0x21,0x00,0x00,0x1B,
0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xEA,0x13,0x00,0x00,0x7C,0x7D,0x45,0x31,0xA2,0xFF,
0xFF,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0xFF,0xFF,0x81,0x00,0x18,0x94,0xDB,
0xF8,0xFF,0xFF,0xFF,0xFF,0x84,0x03,0xD8,0xFF,0xFF,0xF7,0xDE,0xDD,0xFF,0xFF,0x84,
0x32,0xFF,0xFF,0xBD,0x0B,0x00,0x2E,0xFF,0xFF,0x84,0x2B,0xFF,0xFF,0xC1,0x39,0x41,
0xBD,0xFF,0xFF,0x84,0x05,0xDE,0xFF,0xFF,0xFF,0xFF,0xDF,0xDE,0xFF,0x84,0x00,0x2B,
0xBB,0xF3,0xF0,0xAF,0x1E,0x83,0xFF,0x84,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x15,0x00,0x00,0x00,0x00,0x00,0x00,
0x98,0xFF,0xFF,0x2B,0xB5,0xF4,0xEB,0x94,0x0A,0x00,0x98,0xFF,0xFF,0xDE,0xFF,0xFF,
0xFF,0xFF,0xAE,0x00,0x98,0xFF,0xFF,0xCE,0x40,0x49,0xE4,0xFF,0xFF,0x31,0x98,0xFF,
0xFF,0x45,0x00,0x00,0x65,0xFF,0xFF,0x72,0x98,0xFF,0xFF,0x1E,0x00,0x00,0x34,0xFF,
0xFF,0x8C,0x98,0xFF,0xFF,0x23,0x00,0x00,0x35,0xFF,0xFF,0x8C,0x98,0xFF,0xFF,0x4E,
0x00,0x00,0x67,0xFF,0xFF,0x70,0x98,0xFF,0xFF,0xD5,0x44,0x48,0xE5,0xFF,0xFF,0x2E,
0x98,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAA,0x00,0x98,0xFF,0xAE,0x4A,0xD2,0xF9,
0xEA,0x90,0x08,0x00,0x00,0x00,0x1A,0x97,0xDF,0xF8,0xE6,0xBC,0x4A,0x00,0x21,0xEC,
0xFF,0xFF,0xFF,0xFF,0xFF,0x60,0x00,0xB1,0xFF,0xFF,0x8D,0x35,0x4D,0x97,0x0C,0x09,
0xFA,0xFF,0xCE,0x00,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,0x9A,0x00,0x00,0x00,0x00,
0x00,0x28,0xFF,0xFF,0x98,0x00,0x00,0x00,0x00,0x00,0x0F,0xFE,0xFF,0xCB,0x00,0x00,
0x00,0x00,0x00,0x00,0xC9,0xFF,0xFF,0x8A,0x34,0x48,0x8D,0x57,0x00,0x3F,0xFA,0xFF,
0xFF,0xFF,0xFF,0xFF,0x64,0x00,0x00,0x35,0xB1,0xEC,0xFC,0xEE,0xAA,0x24,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xB0,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFC,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xAD,0xFF,0xFC,0x00,0x00,0x50,0xD1,0xF8,0xDE,0x6E,0x9F,
0xFF,0xFC,0x00,0x4A,0xFE,0xFF,0xFF,0xFF,0xFF,0xE5,0xFF,0xFC,0x00,0xCC,0xFF,0xFF,
0x83,0x35,0x7A,0xFE,0xFF,0xFC,0x0F,0xFE,0xFF,0xC9,0x00,0x00,0x00,0xBE,0xFF,0xFC,
0x29,0xFF,0xFF,0x95,0x00,0x00,0x00,0x90,0xFF,0xFC,0x29,0xFF,0xFF,0x94,0x00,0x00,
0x00,0x8C,0xFF,0xFC,0x10,0xFF,0xFF,0xC4,0x00,0x00,0x00,0xB8,0xFF,0xFC,0x00,0xCE,
0xFF,0xFF,0x7E,0x34,0x73,0xFD,0xFF,0xFC,0x00,0x4C,0xFE,0xFF,0xFF,0xFF,0xFF,0xD4,
0xFF,0xFC,0x00,0x00,0x54,0xD5,0xF9,0xD9,0x5C,0x3D,0xFF,0xFC,0x00,0x00,0x1E,0x9D,
0xE4,0xF9,0xE1,0x91,0x11,0x00,0x00,0x20,0xEB,0xFF,0xFF,0xFF,0xFF,0xFF,0xD4,0x0C,
0x00,0xAD,0xFF,0xFC,0x6C,0x31,0x71,0xFE,0xFF,0x77,0x08,0xF8,0xFF,0xBD,0x28,0x28,
0x28,0xC9,0xFF,0xBE,0x23,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD8,0x24,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDC,0x09,0xFA,0xFF,0xAA,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xAC,0xFF,0xFE,0x83,0x36,0x32,0x4A,0x85,0x38,0x00,0x1B,0xE3,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x12,0x8B,0xD9,0xF7,0xF9,0xDD,0x90,0x19,
0x00,0x00,0x20,0xAD,0xED,0xF8,0xDF,0x77,0x00,0x00,0xCC,0xFF,0xFF,0xFF,0xFF,0x68,
0x00,0x15,0xFF,0xFF,0xCF,0x33,0x45,0x10,0x00,0x27,0xFF,0xFF,0x86,0x00,0x00,0x00,
0x3F,0xCF,0xFF,0xFF,0xFF,0xFF,0xD8,0x00,0xA4,0xFF,0xFF,0xFF,0xFF,0xFF,0xD8,0x00,
0x19,0x49,0xFF,0xFF,0x97,0x28,0x21,0x00,0x00,0x28,0xFF,0xFF,0x84,0x00,0x00,0x00,
0x00,0x28,0xFF,0xFF,0x84,0x00,0x00,0x00,0x00,0x28,0xFF,0xFF,0x84,0x00,0x00,0x00,
0x00,0x28,0xFF,0xFF,0x84,0x00,0x00,0x00,0x00,0x28,0xFF,0xFF,0x84,0x00,0x00,0x00,
0x00,0x28,0xFF,0xFF,0x84,0x00,0x00,0x00,0x00,0x28,0xFF,0xFF,0x84,0x00,0x00,0x00,
0x00,0x00,0x51,0xD2,0xF9,0xDD,0x6E,0x5B,0xFF,0xFC,0x00,0x47,0xFD,0xFF,0xFF,0xFF,
0xFF,0xDF,0xFF,0xFC,0x00,0xC9,0xFF,0xFF,0x7D,0x34,0x76,0xFE,0xFF,0xFC,0x0D,0xFE,
0xFF,0xC6,0x00,0x00,0x00,0xBB,0xFF,0xFC,0x29,0xFF,0xFF,0x98,0x00,0x00,0x00,0x90,
0xFF,0xFC,0x29,0xFF,0xFF,0x97,0x00,0x00,0x00,0x8A,0xFF,0xFC,0x10,0xFF,0xFF,0xC6,
0x00,0x00,0x00,0xAF,0xFF,0xFC,0x00,0xCE,0xFF,0xFF,0x7D,0x33,0x6C,0xFC,0xFF,0xFC,
0x00,0x51,0xFF,0xFF,0xFF,0xFF,0xFF,0xE4,0xFF,0xFC,0x00,0x00,0x5B,0xD7,0xF9,0xD9,
0x5C,0xAF,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,0xFF,0xEA,0x00,0x6B,
0x80,0x4C,0x36,0x32,0x84,0xFF,0xFF,0xAC,0x00,0x98,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xEF,0x28,0x00,0x4A,0xB4,0xE5,0xF7,0xF9,0xDF,0x9B,0x21,0x00,0x98,0xFF,0xFF,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x98,0xFF,0xFF,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x13,0x00,0x00,
0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x2B,0xB3,0xF4,0xEA,0xAF,0x26,0x00,0x98,0xFF,
0xFD,0xDE,0xFF,0xFF,0xFF,0xFF,0xEA,0x0F,0x98,0xFF,0xFF,0xE6,0x51,0x39,0xCA,0xFF,
0xFF,0x58,0x98,0xFF,0xFF,0x61,0x00,0x00,0x4F,0xFF,0xFF,0x74,0x98,0xFF,0xFF,0x2A,
0x00,0x00,0x35,0xFF,0xFF,0x78,0x98,0xFF,0xFF,0x19,0x00,0x00,0x34,0xFF,0xFF,0x78,
0x98,0xFF,0xFF,0x18,0x00,0x00,0x34,0xFF,0xFF,0x78,0x98,0xFF,0xFF,0x18,0x00,0x00,
0x34,0xFF,0xFF,0x78,0x98,0xFF,0xFF,0x18,0x00,0x00,0x34,0xFF,0xFF,0x78,0x98,0xFF,
0xFF,0x18,0x00,0x00,0x34,0xFF,0xFF,0x78,0x6F,0xED,0xCF,0x13,0x8B,0xFF,0xF2,0x1B,
0x00,0x16,0x05,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,
0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,
0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,
0x00,0x00,0x00,0x6F,0xED,0xCF,0x13,0x00,0x00,0x00,0x8B,0xFF,0xF2,0x1B,0x00,0x00,
0x00,0x00,0x16,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,
0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,
0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,
0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,
0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,
0xFF,0x18,0x00,0x00,0x00,0x9E,0xFF,0xFF,0x17,0x0B,0x32,0x3F,0xE5,0xFF,0xFA,0x06,
0x28,0xFF,0xFF,0xFF,0xFF,0xA7,0x00,0x21,0xEB,0xFC,0xE8,0x96,0x0D,0x00,0x00,0x00,
0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,
0x00,0x00,0x8C,0xFF,0xFF,0x78,0x00,0x98,0xFF,0xFF,0x18,0x00,0x75,0xFF,0xFF,0x92,
0x00,0x00,0x98,0xFF,0xFF,0x15,0x5E,0xFE,0xFF,0xAA,0x02,0x00,0x00,0x98,0xFF,0xFF,
0x45,0xFA,0xFF,0xBF,0x07,0x00,0x00,0x00,0x98,0xFF,0xFA,0xE3,0xFF,0xFF,0x39,0x00,
0x00,0x00,0x00,0x98,0xFF,0xFF,0xFF,0xFF,0xFF,0xD2,0x08,0x00,0x00,0x00,0x98,0xFF,
0xFF,0x90,0x65,0xFF,0xFF,0x97,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0xAF,0xFF,
0xFF,0x53,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x14,0xE7,0xFF,0xEF,0x1F,0x00,0x98,
0xFF,0xFF,0x18,0x00,0x00,0x4A,0xFF,0xFF,0xC5,0x04,0x00,0x00,0x98,0xFF,0xFF,0x18,
0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,
0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,
0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,0x98,0xFF,0xFF,0x18,
0x98,0xFF,0xFF,0x18,0x98,0xFF,0xA2,0x69,0xCD,0xF2,0xF4,0xC4,0x45,0x59,0xC7,0xEF,
0xEA,0xB0,0x23,0x00,0x98,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xDE,0x04,0x98,0xFF,0xFF,0xE0,0x48,0x47,0xEB,0xFF,0xFF,0xE9,0x52,0x3E,
0xDC,0xFF,0xFF,0x38,0x98,0xFF,0xFF,0x5B,0x00,0x00,0x91,0xFF,0xFF,0x70,0x00,0x00,
0x75,0xFF,0xFF,0x51,0x98,0xFF,0xFF,0x29,0x00,0x00,0x79,0xFF,0xFF,0x40,0x00,0x00,
0x5D,0xFF,0xFF,0x54,0x98,0xFF,0xFF,0x19,0x00,0x00,0x78,0xFF,0xFF,0x34,0x00,0x00,
0x5C,0xFF,0xFF,0x54,0x98,0xFF,0xFF,0x18,0x00,0x00,0x78,0xFF,0xFF,0x34,0x00,0x00,
0x5C,0xFF,0xFF,0x54,0x98,0xFF,0xFF,0x18,0x00,0x00,0x78,0xFF,0xFF,0x34,0x00,0x00,
0x5C,0xFF,0xFF,0x54,0x98,0xFF,0xFF,0x18,0x00,0x00,0x78,0xFF,0xFF,0x34,0x00,0x00,
0x5C,0xFF,0xFF,0x54,0x98,0xFF,0xFF,0x18,0x00,0x00,0x78,0xFF,0xFF,0x34,0x00,0x00,
0x5C,0xFF,0xFF,0x54,0x98,0xFF,0x93,0x31,0xBA,0xF3,0xEB,0xB1,0x28,0x00,0x98,0xFF,
0xE4,0xEF,0xFF,0xFF,0xFF,0xFF,0xEB,0x10,0x98,0xFF,0xFF,0xE4,0x50,0x38,0xC8,0xFF,
0xFF,0x59,0x98,0xFF,0xFF,0x5E,0x00,0x00,0x4E,0xFF,0xFF,0x74,0x98,0xFF,0xFF,0x29,
0x00,0x00,0x35,0xFF,0xFF,0x78,0x98,0xFF,0xFF,0x19,0x00,0x00,0x34,0xFF,0xFF,0x78,
0x98,0xFF,0xFF,0x18,0x00,0x00,0x34,0xFF,0xFF,0x78,0x98,0xFF,0xFF,0x18,0x00,0x00,
0x34,0xFF,0xFF,0x78,0x98,0xFF,0xFF,0x18,0x00,0x00,0x34,0xFF,0xFF,0x78,0x98,0xFF,
0xFF,0x18,0x00,0x00,0x34,0xFF,0xFF,0x78,0x00,0x00,0x1E,0x9B,0xE3,0xFA,0xE5,0x9E,
0x21,0x00,0x00,0x00,0x24,0xEB,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0x2C,0x00,0x00,0xB3,
0xFF,0xFF,0x7E,0x34,0x6C,0xF9,0xFF,0xC8,0x00,0x0A,0xFB,0xFF,0xC4,0x00,0x00,0x00,
0xA3,0xFF,0xFF,0x23,0x27,0xFF,0xFF,0x97,0x00,0x00,0x00,0x74,0xFF,0xFF,0x46,0x23,
0xFF,0xFF,0x98,0x00,0x00,0x00,0x75,0xFF,0xFF,0x4A,0x07,0xF7,0xFF,0xC7,0x00,0x00,
0x00,0xA5,0xFF,0xFF,0x27,0x00,0xA4,0xFF,0xFF,0x80,0x34,0x6C,0xFA,0xFF,0xD3,0x00,
0x00,0x17,0xE2,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0x39,0x00,0x00,0x00,0x14,0x93,0xE0,
0xFA,0xEA,0xA8,0x2B,0x00,0x00,0x00,0x00,0x98,0xFF,0xB4,0x1F,0xB5,0xF4,0xEB,0x94,
0x0A,0x00,0x98,0xFF,0xF3,0xDD,0xFF,0xFF,0xFF,0xFF,0xAE,0x00,0x98,0xFF,0xFF,0xCE,
0x40,0x46,0xDF,0xFF,0xFF,0x31,0x98,0xFF,0xFF,0x45,0x00,0x00,0x60,0xFF,0xFF,0x72,
0x98,0xFF,0xFF,0x1E,0x00,0x00,0x33,0xFF,0xFF,0x8C,0x98,0xFF,0xFF,0x23,0x00,0x00,
0x34,0xFF,0xFF,0x8C,0x98,0xFF,0xFF,0x4E,0x00,0x00,0x61,0xFF,0xFF,0x70,0x98,0xFF,
0xFF,0xD5,0x44,0x44,0xDF,0xFF,0xFF,0x2D,0x98,0xFF,0xFC,0xF2,0xFF,0xFF,0xFF,0xFF,
0xA7,0x00,0x98,0xFF,0xFE,0x31,0xC4,0xF7,0xE9,0x8C,0x07,0x00,0x98,0xFF,0xFF,0x17,
0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xD2,0xF8,0xDE,0x64,0x5D,0xFF,0xFC,0x00,0x4A,
0xFE,0xFF,0xFF,0xFF,0xFF,0xDA,0xFF,0xFC,0x00,0xCC,0xFF,0xFF,0x7E,0x35,0x78,0xFD,
0xFF,0xFC,0x0F,0xFE,0xFF,0xC8,0x00,0x00,0x00,0xBC,0xFF,0xFC,0x29,0xFF,0xFF,0x98,
0x00,0x00,0x00,0x90,0xFF,0xFC,0x29,0xFF,0xFF,0x97,0x00,0x00,0x00,0x8B,0xFF,0xFC,
0x10,0xFF,0xFF,0xC6,0x00,0x00,0x00,0xB5,0xFF,0xFC,0x00,0xCF,0xFF,0xFF,0x7D,0x33,
0x6D,0xFC,0xFF,0xFC,0x00,0x4F,0xFE,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFC,0x00,0x00,
0x56,0xD6,0xF9,0xDA,0x5F,0xA7,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,
0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xB0,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFC,
0x98,0xFF,0x8F,0x1E,0xAE,0xF3,0xBD,0x98,0xFF,0xDC,0xE2,0xFF,0xFF,0xA9,0x98,0xFF,
0xFF,0xF2,0x73,0x31,0x1E,0x98,0xFF,0xFF,0x5F,0x00,0x00,0x00,0x98,0xFF,0xFF,0x20,
0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,
0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,0xFF,0xFF,0x18,0x00,0x00,0x00,0x98,
0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x97,0xDF,0xF7,0xE8,0xBF,0x64,
0x05,0x05,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE1,0x02,0x29,0xFF,0xFF,0xAE,0x2F,0x49,
0x8A,0x67,0x00,0x10,0xFA,0xFF,0xDE,0x50,0x02,0x00,0x00,0x00,0x00,0x68,0xFA,0xFF,
0xFF,0xDF,0x6D,0x06,0x00,0x00,0x00,0x21,0x91,0xF0,0xFF,0xFF,0xBC,0x00,0x00,0x00,
0x00,0x00,0x0F,0xB2,0xFF,0xFF,0x30,0x26,0xB0,0x63,0x3D,0x30,0xAD,0xFF,0xFF,0x35,
0x2C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD5,0x03,0x12,0x9B,0xE0,0xFA,0xFA,0xDF,0x97,
0x16,0x00,0x00,0x00,0x00,0x00,0x88,0xFF,0x60,0x00,0x00,0x00,0x00,0x03,0xE5,0xFF,
0x60,0x00,0x00,0x00,0x24,0xB8,0xFF,0xFF,0xFF,0xFF,0xFF,0x20,0x98,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x20,0x17,0x6B,0xFF,0xFF,0x79,0x28,0x28,0x05,0x00,0x50,0xFF,0xFF,
0x60,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0x60,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,
0x60,0x00,0x00,0x00,0x00,0x4F,0xFF,0xFF,0x61,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,
0xAF,0x2B,0x40,0x17,0x00,0x0B,0xF0,0xFF,0xFF,0xFF,0xFF,0x3C,0x00,0x00,0x3F,0xCD,
0xF9,0xEF,0xC6,0x23,0xA8,0xFF,0xFF,0x08,0x00,0x00,0x44,0xFF,0xFF,0x6C,0xA8,0xFF,
0xFF,0x08,0x00,0x00,0x44,0xFF,0xFF,0x6C,0xA8,0xFF,0xFF,0x08,0x00,0x00,0x44,0xFF,
0xFF,0x6C,0xA8,0xFF,0xFF,0x08,0x00,0x00,0x44,0xFF,0xFF,0x6C,0xA8,0xFF,0xFF,0x08,
0x00,0x00,0x44,0xFF,0xFF,0x6C,0xA8,0xFF,0xFF,0x08,0x00,0x00,0x54,0xFF,0xFF,0x6C,
0xA5,0xFF,0xFF,0x19,0x00,0x00,0x7F,0xFF,0xFF,0x6C,0x8A,0xFF,0xFF,0x82,0x05,0x33,
0xE6,0xFF,0xFF,0x6C,0x31,0xFB,0xFF,0xFF,0xFE,0xFF,0xED,0xFC,0xFF,0x6C,0x00,0x42,
0xC4,0xF2,0xF0,0xB3,0x2A,0xC4,0xFF,0x6C,0xD0,0xFF,0xF2,0x07,0x00,0x00,0x00,0xBA,
0xFF,0xF9,0x12,0x70,0xFF,0xFF,0x4E,0x00,0x00,0x13,0xFB,0xFF,0xAC,0x00,0x15,0xFA,
0xFF,0xA3,0x00,0x00,0x64,0xFF,0xFF,0x4C,0x00,0x00,0xB0,0xFF,0xF1,0x07,0x00,0xB9,
0xFF,0xE8,0x04,0x00,0x00,0x50,0xFF,0xFF,0x4D,0x13,0xFB,0xFF,0x8D,0x00,0x00,0x00,
0x05,0xEA,0xFF,0xA1,0x62,0xFF,0xFF,0x2E,0x00,0x00,0x00,0x00,0x90,0xFF,0xE2,0xA8,
0xFF,0xCE,0x00,0x00,0x00,0x00,0x00,0x30,0xFF,0xFF,0xE1,0xFF,0x6E,0x00,0x00,0x00,
0x00,0x00,0x00,0xD0,0xFF,0xFF,0xFA,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xFF,
0xFF,0xAF,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xFF,0xF3,0x04,0x00,0x00,0xE0,0xFF,
0xFF,0x52,0x00,0x00,0x89,0xFF,0xFE,0x18,0x65,0xFF,0xFF,0x3A,0x00,0x21,0xFF,0xFF,
0xFF,0x8E,0x00,0x00,0xCC,0xFF,0xCF,0x00,0x1E,0xFF,0xFF,0x7C,0x00,0x61,0xFF,0xC1,
0xFF,0xCB,0x00,0x11,0xFD,0xFF,0x86,0x00,0x00,0xD7,0xFF,0xBE,0x00,0xA1,0xFF,0x57,
0xF2,0xFC,0x0C,0x52,0xFF,0xFF,0x3E,0x00,0x00,0x90,0xFF,0xF7,0x05,0xE0,0xFF,0x1A,
0xBA,0xFF,0x45,0x93,0xFF,0xF1,0x04,0x00,0x00,0x48,0xFF,0xFF,0x47,0xFF,0xE0,0x00,
0x80,0xFF,0x7C,0xCE,0xFF,0xAD,0x00,0x00,0x00,0x09,0xF7,0xFF,0x98,0xFF,0xA6,0x00,
0x45,0xFF,0xA7,0xF8,0xFF,0x65,0x00,0x00,0x00,0x00,0xBA,0xFF,0xE1,0xFF,0x6B,0x00,
0x0F,0xFE,0xE3,0xFF,0xFF,0x1C,0x00,0x00,0x00,0x00,0x73,0xFF,0xFF,0xFF,0x30,0x00,
0x00,0xD6,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x2C,0xFF,0xFF,0xF2,0x03,0x00,
0x00,0x9F,0xFF,0xFF,0x8C,0x00,0x00,0x00,0x6D,0xFF,0xFF,0x98,0x00,0x00,0x30,0xFC,
0xFF,0xD2,0x05,0x02,0xC5,0xFF,0xFD,0x33,0x01,0xC6,0xFF,0xFC,0x34,0x00,0x00,0x28,
0xF8,0xFF,0xC8,0x64,0xFF,0xFF,0x89,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,0xFA,0xFF,
0xD9,0x08,0x00,0x00,0x00,0x00,0x04,0xD2,0xFF,0xFF,0xFF,0x3D,0x00,0x00,0x00,0x00,
0x00,0x11,0xE8,0xFF,0xFF,0xFF,0x5B,0x00,0x00,0x00,0x00,0x00,0xA0,0xFF,0xFF,0xE6,
0xFF,0xEC,0x16,0x00,0x00,0x00,0x47,0xFF,0xFF,0xA6,0x41,0xFF,0xFF,0xAB,0x00,0x00,
0x0D,0xE1,0xFF,0xF1,0x18,0x00,0xA5,0xFF,0xFF,0x52,0x00,0x95,0xFF,0xFF,0x6E,0x00,
0x00,0x18,0xF1,0xFF,0xE8,0x12,0x00,0x00,0xCC,0xFF,0xFE,0x1C,0x00,0x00,0x00,0xCE,
0xFF,0xF8,0x12,0x65,0xFF,0xFF,0x71,0x00,0x00,0x23,0xFF,0xFF,0xA9,0x00,0x0B,0xF1,
0xFF,0xC7,0x00,0x00,0x78,0xFF,0xFF,0x48,0x00,0x00,0x96,0xFF,0xFE,0x1E,0x00,0xCC,
0xFF,0xE4,0x03,0x00,0x00,0x2E,0xFF,0xFF,0x73,0x21,0xFF,0xFF,0x86,0x00,0x00,0x00,
0x00,0xC7,0xFF,0xC6,0x74,0xFF,0xFF,0x26,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFC,0xBE,
0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x09,0xEE,0xFF,0xFB,0xFF,0x63,0x00,0x00,0x00,
0x00,0x00,0x00,0x90,0xFF,0xFF,0xF5,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0xFF,
0xFF,0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,0x40,0x00,0x00,0x00,
0x00,0x16,0x2D,0x5F,0xF6,0xFF,0xCC,0x00,0x00,0x00,0x00,0x00,0x64,0xFF,0xFF,0xFF,
0xF4,0x37,0x00,0x00,0x00,0x00,0x00,0x5A,0xFA,0xEE,0xB3,0x31,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x14,0x40,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x11,0x0A,0x28,0x28,0x28,0x61,0xFF,0xFF,0x97,0x00,0x00,
0x00,0x00,0x11,0xE0,0xFF,0xD2,0x08,0x00,0x00,0x00,0x00,0xAE,0xFF,0xF5,0x29,0x00,
0x00,0x00,0x00,0x6B,0xFF,0xFF,0x61,0x00,0x00,0x00,0x00,0x2F,0xF8,0xFF,0xA5,0x00,
0x00,0x00,0x00,0x0C,0xD9,0xFF,0xEB,0x35,0x28,0x28,0x28,0x0A,0x79,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x40,0x84,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x40,0x00,0x00,
0x00,0x00,0x00,0x79,0xD5,0xF4,0x5F,0x00,0x00,0x4E,0xFF,0xFF,0xFF,0x60,0x00,0x00,
0x78,0xFF,0xFA,0x56,0x10,0x00,0x00,0x7C,0xFF,0xDB,0x00,0x00,0x00,0x00,0x7C,0xFF,
0xD8,0x00,0x00,0x00,0x00,0x85,0xFF,0xD8,0x00,0x00,0x06,0x33,0xDD,0xFF,0xC1,0x00,
0x00,0xBC,0xFF,0xFF,0xCF,0x33,0x00,0x00,0xBC,0xFF,0xF8,0xAC,0x22,0x00,0x00,0x23,
0x5B,0xEC,0xFF,0xB8,0x00,0x00,0x00,0x00,0x89,0xFF,0xD7,0x00,0x00,0x00,0x00,0x7C,
0xFF,0xD8,0x00,0x00,0x00,0x00,0x7C,0xFF,0xDA,0x00,0x00,0x00,0x00,0x79,0xFF,0xFA,
0x55,0x10,0x00,0x00,0x51,0xFF,0xFF,0xFF,0x60,0x00,0x00,0x01,0x7D,0xD8,0xF5,0x5F,
0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,
0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,0xFF,0xEC,
0xFF,0xEC,0xFF,0xEC,0x47,0xF6,0xD9,0x87,0x04,0x00,0x00,0x48,0xFF,0xFF,0xFF,0x66,
0x00,0x00,0x0C,0x4C,0xF2,0xFF,0x90,0x00,0x00,0x00,0x00,0xC3,0xFF,0x94,0x00,0x00,
0x00,0x00,0xC0,0xFF,0x94,0x00,0x00,0x00,0x00,0xC0,0xFF,0x9C,0x00,0x00,0x00,0x00,
0xA9,0xFF,0xE9,0x3B,0x07,0x00,0x00,0x26,0xC6,0xFE,0xFF,0xD4,0x00,0x00,0x18,0xA3,
0xF3,0xFF,0xD4,0x00,0x00,0xA1,0xFF,0xF4,0x63,0x29,0x00,0x00,0xBF,0xFF,0xA1,0x00,
0x00,0x00,0x00,0xC0,0xFF,0x94,0x00,0x00,0x00,0x00,0xC2,0xFF,0x94,0x00,0x00,0x0C,
0x4C,0xF2,0xFF,0x90,0x00,0x00,0x48,0xFF,0xFF,0xFF,0x69,0x00,0x00,0x47,0xF7,0xDC,
0x8B,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xA2,
0xEA,0xF6,0xD2,0x89,0x46,0x33,0x73,0x6E,0x38,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x80,0x34,0x93,0x3D,0x39,0x75,0xBF,0xF1,0xF4,0xC1,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
leRasterFont NotoSans_Bold18 =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoSans_Bold18_glyphs, // glyph table variable pointer
10984, // data size
},
LE_RASTER_FONT,
},
19,
14,
LE_FONT_BPP_8, // bits per pixel
NotoSans_Bold18_data, // kerning table
};
/*********************************
* Legato Font Asset
* Name: NotoSans_Bold24
* Height: 25
* Baseline: 18
* Style: Antialias
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoSans_Bold24_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x05,0x00,0x11,0x00,0x07,0x00,
0x01,0x00,0x11,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x09,0x00,
0x06,0x00,0x0B,0x00,0x01,0x00,0x11,0x00,0x00,0x00,0x09,0x00,0x58,0x00,0x00,0x00,
0x23,0x00,0x0F,0x00,0x11,0x00,0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0F,0x00,
0x90,0x00,0x00,0x00,0x24,0x00,0x0C,0x00,0x13,0x00,0x0E,0x00,0x01,0x00,0x12,0x00,
0x00,0x00,0x0C,0x00,0x90,0x01,0x00,0x00,0x25,0x00,0x15,0x00,0x11,0x00,0x16,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x15,0x00,0x74,0x02,0x00,0x00,0x26,0x00,0x12,0x00,
0x11,0x00,0x12,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x12,0x00,0xDC,0x03,0x00,0x00,
0x27,0x00,0x04,0x00,0x06,0x00,0x06,0x00,0x01,0x00,0x11,0x00,0x00,0x00,0x04,0x00,
0x10,0x05,0x00,0x00,0x28,0x00,0x08,0x00,0x14,0x00,0x08,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x08,0x00,0x28,0x05,0x00,0x00,0x29,0x00,0x08,0x00,0x14,0x00,0x08,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x08,0x00,0xC8,0x05,0x00,0x00,0x2A,0x00,0x0D,0x00,
0x0B,0x00,0x0D,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0D,0x00,0x68,0x06,0x00,0x00,
0x2B,0x00,0x0C,0x00,0x0B,0x00,0x0E,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,
0xF8,0x06,0x00,0x00,0x2C,0x00,0x06,0x00,0x06,0x00,0x07,0x00,0x00,0x00,0x03,0x00,
0x00,0x00,0x06,0x00,0x7C,0x07,0x00,0x00,0x2D,0x00,0x08,0x00,0x03,0x00,0x08,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0xA0,0x07,0x00,0x00,0x2E,0x00,0x05,0x00,
0x04,0x00,0x07,0x00,0x01,0x00,0x04,0x00,0x00,0x00,0x05,0x00,0xB8,0x07,0x00,0x00,
0x2F,0x00,0x0A,0x00,0x11,0x00,0x0A,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0A,0x00,
0xCC,0x07,0x00,0x00,0x30,0x00,0x0D,0x00,0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x0D,0x00,0x78,0x08,0x00,0x00,0x31,0x00,0x09,0x00,0x11,0x00,0x0E,0x00,
0x01,0x00,0x11,0x00,0x00,0x00,0x09,0x00,0x58,0x09,0x00,0x00,0x32,0x00,0x0D,0x00,
0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0D,0x00,0xF4,0x09,0x00,0x00,
0x33,0x00,0x0D,0x00,0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0D,0x00,
0xD4,0x0A,0x00,0x00,0x34,0x00,0x0E,0x00,0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x0E,0x00,0xB4,0x0B,0x00,0x00,0x35,0x00,0x0C,0x00,0x11,0x00,0x0E,0x00,
0x01,0x00,0x11,0x00,0x00,0x00,0x0C,0x00,0xA4,0x0C,0x00,0x00,0x36,0x00,0x0D,0x00,
0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0D,0x00,0x70,0x0D,0x00,0x00,
0x37,0x00,0x0D,0x00,0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0D,0x00,
0x50,0x0E,0x00,0x00,0x38,0x00,0x0D,0x00,0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x0D,0x00,0x30,0x0F,0x00,0x00,0x39,0x00,0x0D,0x00,0x11,0x00,0x0E,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x0D,0x00,0x10,0x10,0x00,0x00,0x3A,0x00,0x05,0x00,
0x0D,0x00,0x07,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x05,0x00,0xF0,0x10,0x00,0x00,
0x3B,0x00,0x06,0x00,0x10,0x00,0x07,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x06,0x00,
0x34,0x11,0x00,0x00,0x3C,0x00,0x0C,0x00,0x0D,0x00,0x0E,0x00,0x01,0x00,0x0F,0x00,
0x00,0x00,0x0C,0x00,0x94,0x11,0x00,0x00,0x3D,0x00,0x0C,0x00,0x07,0x00,0x0E,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x30,0x12,0x00,0x00,0x3E,0x00,0x0C,0x00,
0x0D,0x00,0x0E,0x00,0x01,0x00,0x0F,0x00,0x00,0x00,0x0C,0x00,0x84,0x12,0x00,0x00,
0x3F,0x00,0x0B,0x00,0x11,0x00,0x0B,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0B,0x00,
0x20,0x13,0x00,0x00,0x40,0x00,0x14,0x00,0x13,0x00,0x16,0x00,0x01,0x00,0x11,0x00,
0x00,0x00,0x14,0x00,0xDC,0x13,0x00,0x00,0x41,0x00,0x11,0x00,0x11,0x00,0x11,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x11,0x00,0x58,0x15,0x00,0x00,0x42,0x00,0x0D,0x00,
0x11,0x00,0x10,0x00,0x02,0x00,0x11,0x00,0x00,0x00,0x0D,0x00,0x7C,0x16,0x00,0x00,
0x43,0x00,0x0E,0x00,0x11,0x00,0x0F,0x00,0x01,0x00,0x11,0x00,0x00,0x00,0x0E,0x00,
0x5C,0x17,0x00,0x00,0x44,0x00,0x0F,0x00,0x11,0x00,0x12,0x00,0x02,0x00,0x11,0x00,
0x00,0x00,0x0F,0x00,0x4C,0x18,0x00,0x00,0x45,0x00,0x0B,0x00,0x11,0x00,0x0D,0x00,
0x02,0x00,0x11,0x00,0x00,0x00,0x0B,0x00,0x4C,0x19,0x00,0x00,0x46,0x00,0x0A,0x00,
0x11,0x00,0x0D,0x00,0x02,0x00,0x11,0x00,0x00,0x00,0x0A,0x00,0x08,0x1A,0x00,0x00,
0x47,0x00,0x0F,0x00,0x11,0x00,0x11,0x00,0x01,0x00,0x11,0x00,0x00,0x00,0x0F,0x00,
0xB4,0x1A,0x00,0x00,0x48,0x00,0x0F,0x00,0x11,0x00,0x12,0x00,0x02,0x00,0x11,0x00,
0x00,0x00,0x0F,0x00,0xB4,0x1B,0x00,0x00,0x49,0x00,0x09,0x00,0x11,0x00,0x09,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x09,0x00,0xB4,0x1C,0x00,0x00,0x4A,0x00,0x08,0x00,
0x16,0x00,0x08,0x00,0xFE,0xFF,0x11,0x00,0x00,0x00,0x08,0x00,0x50,0x1D,0x00,0x00,
0x4B,0x00,0x0E,0x00,0x11,0x00,0x10,0x00,0x02,0x00,0x11,0x00,0x00,0x00,0x0E,0x00,
0x00,0x1E,0x00,0x00,0x4C,0x00,0x0B,0x00,0x11,0x00,0x0E,0x00,0x02,0x00,0x11,0x00,
0x00,0x00,0x0B,0x00,0xF0,0x1E,0x00,0x00,0x4D,0x00,0x13,0x00,0x11,0x00,0x17,0x00,
0x02,0x00,0x11,0x00,0x00,0x00,0x13,0x00,0xAC,0x1F,0x00,0x00,0x4E,0x00,0x10,0x00,
0x11,0x00,0x14,0x00,0x02,0x00,0x11,0x00,0x00,0x00,0x10,0x00,0xF0,0x20,0x00,0x00,
0x4F,0x00,0x11,0x00,0x11,0x00,0x13,0x00,0x01,0x00,0x11,0x00,0x00,0x00,0x11,0x00,
0x00,0x22,0x00,0x00,0x50,0x00,0x0C,0x00,0x11,0x00,0x0F,0x00,0x02,0x00,0x11,0x00,
0x00,0x00,0x0C,0x00,0x24,0x23,0x00,0x00,0x51,0x00,0x11,0x00,0x15,0x00,0x13,0x00,
0x01,0x00,0x11,0x00,0x00,0x00,0x11,0x00,0xF0,0x23,0x00,0x00,0x52,0x00,0x0E,0x00,
0x11,0x00,0x10,0x00,0x02,0x00,0x11,0x00,0x00,0x00,0x0E,0x00,0x58,0x25,0x00,0x00,
0x53,0x00,0x0C,0x00,0x11,0x00,0x0D,0x00,0x01,0x00,0x11,0x00,0x00,0x00,0x0C,0x00,
0x48,0x26,0x00,0x00,0x54,0x00,0x0E,0x00,0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x0E,0x00,0x14,0x27,0x00,0x00,0x55,0x00,0x0F,0x00,0x11,0x00,0x12,0x00,
0x02,0x00,0x11,0x00,0x00,0x00,0x0F,0x00,0x04,0x28,0x00,0x00,0x56,0x00,0x10,0x00,
0x11,0x00,0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x10,0x00,0x04,0x29,0x00,0x00,
0x57,0x00,0x18,0x00,0x11,0x00,0x17,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x18,0x00,
0x14,0x2A,0x00,0x00,0x58,0x00,0x11,0x00,0x11,0x00,0x10,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x11,0x00,0xAC,0x2B,0x00,0x00,0x59,0x00,0x0F,0x00,0x11,0x00,0x0F,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x0F,0x00,0xD0,0x2C,0x00,0x00,0x5A,0x00,0x0E,0x00,
0x11,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0E,0x00,0xD0,0x2D,0x00,0x00,
0x5B,0x00,0x07,0x00,0x15,0x00,0x08,0x00,0x01,0x00,0x11,0x00,0x00,0x00,0x07,0x00,
0xC0,0x2E,0x00,0x00,0x5C,0x00,0x0A,0x00,0x11,0x00,0x0A,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x0A,0x00,0x54,0x2F,0x00,0x00,0x5D,0x00,0x07,0x00,0x15,0x00,0x08,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x07,0x00,0x00,0x30,0x00,0x00,0x5E,0x00,0x0E,0x00,
0x0B,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x0E,0x00,0x94,0x30,0x00,0x00,
0x5F,0x00,0x0B,0x00,0x02,0x00,0x0A,0x00,0xFF,0xFF,0xFE,0xFF,0x00,0x00,0x0B,0x00,
0x30,0x31,0x00,0x00,0x60,0x00,0x08,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x12,0x00,
0x00,0x00,0x08,0x00,0x48,0x31,0x00,0x00,0x61,0x00,0x0C,0x00,0x0D,0x00,0x0F,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x0C,0x00,0x68,0x31,0x00,0x00,0x62,0x00,0x0E,0x00,
0x12,0x00,0x0F,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,0x04,0x32,0x00,0x00,
0x63,0x00,0x0B,0x00,0x0D,0x00,0x0C,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0B,0x00,
0x00,0x33,0x00,0x00,0x64,0x00,0x0D,0x00,0x12,0x00,0x0F,0x00,0x01,0x00,0x12,0x00,
0x00,0x00,0x0D,0x00,0x90,0x33,0x00,0x00,0x65,0x00,0x0D,0x00,0x0D,0x00,0x0E,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,0x7C,0x34,0x00,0x00,0x66,0x00,0x0B,0x00,
0x12,0x00,0x09,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0B,0x00,0x28,0x35,0x00,0x00,
0x67,0x00,0x0D,0x00,0x13,0x00,0x0F,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,
0xF0,0x35,0x00,0x00,0x68,0x00,0x0D,0x00,0x12,0x00,0x10,0x00,0x01,0x00,0x12,0x00,
0x00,0x00,0x0D,0x00,0xE8,0x36,0x00,0x00,0x69,0x00,0x05,0x00,0x12,0x00,0x07,0x00,
0x01,0x00,0x12,0x00,0x00,0x00,0x05,0x00,0xD4,0x37,0x00,0x00,0x6A,0x00,0x08,0x00,
0x18,0x00,0x07,0x00,0xFE,0xFF,0x12,0x00,0x00,0x00,0x08,0x00,0x30,0x38,0x00,0x00,
0x6B,0x00,0x0E,0x00,0x12,0x00,0x0F,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,
0xF0,0x38,0x00,0x00,0x6C,0x00,0x05,0x00,0x12,0x00,0x07,0x00,0x01,0x00,0x12,0x00,
0x00,0x00,0x05,0x00,0xEC,0x39,0x00,0x00,0x6D,0x00,0x15,0x00,0x0D,0x00,0x18,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x15,0x00,0x48,0x3A,0x00,0x00,0x6E,0x00,0x0D,0x00,
0x0D,0x00,0x10,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,0x5C,0x3B,0x00,0x00,
0x6F,0x00,0x0D,0x00,0x0D,0x00,0x0F,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,
0x08,0x3C,0x00,0x00,0x70,0x00,0x0E,0x00,0x13,0x00,0x0F,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x0E,0x00,0xB4,0x3C,0x00,0x00,0x71,0x00,0x0D,0x00,0x13,0x00,0x0F,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,0xC0,0x3D,0x00,0x00,0x72,0x00,0x0A,0x00,
0x0D,0x00,0x0B,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0A,0x00,0xB8,0x3E,0x00,0x00,
0x73,0x00,0x0B,0x00,0x0D,0x00,0x0C,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x0B,0x00,
0x3C,0x3F,0x00,0x00,0x74,0x00,0x0A,0x00,0x10,0x00,0x0A,0x00,0x00,0x00,0x10,0x00,
0x00,0x00,0x0A,0x00,0xCC,0x3F,0x00,0x00,0x75,0x00,0x0D,0x00,0x0D,0x00,0x10,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x0D,0x00,0x6C,0x40,0x00,0x00,0x76,0x00,0x0E,0x00,
0x0D,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0E,0x00,0x18,0x41,0x00,0x00,
0x77,0x00,0x15,0x00,0x0D,0x00,0x15,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x15,0x00,
0xD0,0x41,0x00,0x00,0x78,0x00,0x0E,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x0E,0x00,0xE4,0x42,0x00,0x00,0x79,0x00,0x0E,0x00,0x13,0x00,0x0E,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x0E,0x00,0x9C,0x43,0x00,0x00,0x7A,0x00,0x0B,0x00,
0x0D,0x00,0x0C,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x0B,0x00,0xA8,0x44,0x00,0x00,
0x7B,0x00,0x09,0x00,0x15,0x00,0x09,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x09,0x00,
0x38,0x45,0x00,0x00,0x7C,0x00,0x03,0x00,0x18,0x00,0x0D,0x00,0x05,0x00,0x12,0x00,
0x00,0x00,0x03,0x00,0xF8,0x45,0x00,0x00,0x7D,0x00,0x0A,0x00,0x15,0x00,0x09,0x00,
0x00,0x00,0x11,0x00,0x00,0x00,0x0A,0x00,0x40,0x46,0x00,0x00,0x7E,0x00,0x0C,0x00,
0x06,0x00,0x0E,0x00,0x01,0x00,0x0B,0x00,0x00,0x00,0x0C,0x00,0x14,0x47,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoSans_Bold24_glyphs[18268] =
{
0x8D,0xFF,0xFF,0xFF,0x71,0x80,0xFF,0xFF,0xFF,0x63,0x72,0xFF,0xFF,0xFF,0x55,0x64,
0xFF,0xFF,0xFF,0x47,0x56,0xFF,0xFF,0xFF,0x39,0x48,0xFF,0xFF,0xFF,0x2B,0x3B,0xFF,
0xFF,0xFF,0x1E,0x2D,0xFF,0xFF,0xFF,0x10,0x1F,0xFF,0xFF,0xFF,0x02,0x11,0xFF,0xFF,
0xF4,0x00,0x03,0xFF,0xFF,0xE6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x20,0xCB,0xF6,0xB7,0x0C,0x8B,0xFF,0xFF,0xFF,0x63,0x8A,0xFF,0xFF,0xFF,0x62,
0x1E,0xC9,0xF6,0xB5,0x0B,0x00,0x00,0x00,0x66,0xFF,0xFF,0xC9,0x00,0x76,0xFF,0xFF,
0xB9,0x51,0xFF,0xFF,0xB4,0x00,0x61,0xFF,0xFF,0xA4,0x3C,0xFF,0xFF,0xA0,0x00,0x4C,
0xFF,0xFF,0x90,0x28,0xFF,0xFF,0x8B,0x00,0x38,0xFF,0xFF,0x7B,0x13,0xFF,0xFF,0x76,
0x00,0x23,0xFF,0xFF,0x66,0x01,0xFC,0xFF,0x62,0x00,0x0E,0xFF,0xFF,0x52,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6F,0xFF,0xFF,0x24,0x00,0x88,0xFF,0xF8,0x04,0x00,0x00,
0x00,0x00,0x00,0x00,0x9E,0xFF,0xF3,0x01,0x00,0xB7,0xFF,0xCE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xCC,0xFF,0xC5,0x00,0x00,0xE6,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0xF7,0xFF,0x96,0x00,0x15,0xFF,0xFF,0x71,0x00,0x00,0x00,0x00,0x00,0x00,
0x29,0xFF,0xFF,0x67,0x00,0x44,0xFF,0xFF,0x43,0x00,0x00,0x00,0xA0,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0xA0,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x3E,0x64,0x64,0xD9,0xFF,0xE0,
0x64,0x64,0xEF,0xFF,0xC9,0x64,0x64,0x60,0x00,0x00,0x00,0x00,0xEB,0xFF,0xA0,0x00,
0x12,0xFF,0xFF,0x7A,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xFF,0xFF,0x6A,0x00,0x48,
0xFF,0xFF,0x43,0x00,0x00,0x00,0x78,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x30,0x78,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x30,0x61,0xD0,0xD0,0xF1,0xFF,0xF8,0xD0,0xD0,0xFA,0xFF,0xF0,0xD0,
0xD0,0xD0,0x27,0x00,0x00,0x00,0xD4,0xFF,0xB6,0x00,0x08,0xFA,0xFF,0x8D,0x00,0x00,
0x00,0x00,0x00,0x00,0x0B,0xFD,0xFF,0x7F,0x00,0x3B,0xFF,0xFF,0x56,0x00,0x00,0x00,
0x00,0x00,0x00,0x3D,0xFF,0xFF,0x49,0x00,0x74,0xFF,0xFF,0x1E,0x00,0x00,0x00,0x00,
0x00,0x00,0x72,0xFF,0xFF,0x13,0x00,0xAC,0xFF,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xEC,0xB0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x26,0xF1,0xC4,0x38,0x1C,0x00,0x00,0x00,0x00,0x19,0x94,0xF2,0xFF,0xFF,0xFF,0xFF,
0xFF,0xE7,0x98,0x24,0x2C,0xEC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,
0xB9,0xFF,0xFF,0xFF,0xCC,0xF9,0xE1,0xB9,0xE5,0xFF,0xD3,0x00,0xF0,0xFF,0xFF,0xAE,
0x00,0xEC,0xB0,0x00,0x00,0x30,0x37,0x00,0xE1,0xFF,0xFF,0xD2,0x13,0xEC,0xB0,0x00,
0x00,0x00,0x00,0x00,0x8F,0xFF,0xFF,0xFF,0xF0,0xFA,0xB3,0x00,0x00,0x00,0x00,0x00,
0x0A,0xBB,0xFF,0xFF,0xFF,0xFF,0xFF,0xC4,0x58,0x05,0x00,0x00,0x00,0x02,0x65,0xE0,
0xFF,0xFF,0xFF,0xFF,0xFF,0xD8,0x39,0x00,0x00,0x00,0x00,0x03,0x4F,0xF6,0xFF,0xFF,
0xFF,0xFF,0xF6,0x2D,0x00,0x00,0x00,0x00,0x00,0xEC,0xC2,0x9C,0xFF,0xFF,0xFF,0xA0,
0x15,0x00,0x00,0x00,0x00,0xEC,0xB0,0x00,0xCF,0xFF,0xFF,0xC3,0xEA,0xB0,0x61,0x28,
0x0A,0xEC,0xB7,0x55,0xF6,0xFF,0xFF,0xA7,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFE,0x3E,0xE4,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF6,0x61,0x00,
0x07,0x4E,0x96,0xBA,0xCA,0xFC,0xEC,0xAA,0x70,0x17,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xEC,0xB0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0xB0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x58,0xD0,0xF7,0xEC,0xA0,0x16,0x00,0x00,0x00,0x00,
0x00,0x28,0xFB,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x4F,0xFF,0xFF,0xFF,0xFF,0xFF,
0xD1,0x06,0x00,0x00,0x00,0x00,0xB3,0xFF,0xF8,0x20,0x00,0x00,0x00,0x00,0x00,0xCF,
0xFF,0xFF,0xEB,0xFA,0xFF,0xFF,0x63,0x00,0x00,0x00,0x42,0xFF,0xFF,0x89,0x00,0x00,
0x00,0x00,0x00,0x14,0xFF,0xFF,0xF2,0x10,0x65,0xFF,0xFF,0xAE,0x00,0x00,0x02,0xCF,
0xFF,0xEB,0x0F,0x00,0x00,0x00,0x00,0x00,0x34,0xFF,0xFF,0xC2,0x00,0x24,0xFF,0xFF,
0xD2,0x00,0x00,0x61,0xFF,0xFF,0x6B,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0xFF,0xFF,
0xB7,0x00,0x18,0xFF,0xFF,0xDC,0x00,0x0A,0xE5,0xFF,0xD8,0x04,0x00,0x00,0x00,0x00,
0x00,0x00,0x2E,0xFF,0xFF,0xC9,0x00,0x2B,0xFF,0xFF,0xCE,0x00,0x80,0xFF,0xFF,0x4D,
0x00,0x31,0x58,0x4C,0x11,0x00,0x00,0x09,0xFA,0xFF,0xF9,0x2A,0x84,0xFF,0xFF,0xA5,
0x1A,0xF4,0xFF,0xBE,0x0D,0xBE,0xFF,0xFF,0xFF,0xF3,0x5A,0x00,0x00,0xB1,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x54,0x9E,0xFF,0xFE,0x31,0x94,0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,
0x28,0x00,0x28,0xF0,0xFF,0xFF,0xFF,0xFF,0xBE,0x31,0xFD,0xFF,0xA0,0x04,0xF1,0xFF,
0xFC,0x30,0x8C,0xFF,0xFF,0x8F,0x00,0x00,0x25,0x9B,0xC8,0xBD,0x78,0x09,0xBC,0xFF,
0xF5,0x1B,0x29,0xFF,0xFF,0xCF,0x00,0x31,0xFF,0xFF,0xC6,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x4C,0xFF,0xFF,0x82,0x00,0x3B,0xFF,0xFF,0xB9,0x00,0x19,0xFF,0xFF,0xDA,
0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xD7,0xFF,0xE7,0x0C,0x00,0x36,0xFF,0xFF,0xBB,
0x00,0x1D,0xFF,0xFF,0xD6,0x00,0x00,0x00,0x00,0x00,0x00,0x6B,0xFF,0xFF,0x64,0x00,
0x00,0x16,0xFF,0xFF,0xD7,0x00,0x39,0xFF,0xFF,0xB7,0x00,0x00,0x00,0x00,0x00,0x0F,
0xEB,0xFF,0xD2,0x02,0x00,0x00,0x00,0xCF,0xFF,0xFE,0x58,0xA8,0xFF,0xFF,0x72,0x00,
0x00,0x00,0x00,0x00,0x89,0xFF,0xFF,0x46,0x00,0x00,0x00,0x00,0x4A,0xFE,0xFF,0xFF,
0xFF,0xFF,0xE1,0x0D,0x00,0x00,0x00,0x00,0x20,0xF8,0xFF,0xB7,0x00,0x00,0x00,0x00,
0x00,0x00,0x50,0xCD,0xF8,0xEE,0xAC,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x56,0xB9,0xEB,0xFA,0xE8,0xAF,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x9E,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x46,0xFF,0xFF,0xFF,0xF6,0xD9,0xFD,0xFF,0xFF,0xF3,0x0D,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x85,0xFF,0xFF,0xE7,0x14,0x00,0x4C,0xFF,0xFF,0xFF,0x31,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xC9,0x00,0x00,0x2D,0xFF,0xFF,0xFF,
0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0xFF,0xFF,0xFD,0x35,0x17,0xC8,0xFF,
0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC8,0xFF,0xFF,0xE5,0xEF,
0xFF,0xFF,0xEA,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2A,0xFD,0xFF,
0xFF,0xFF,0xFF,0xD0,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xD9,
0xFF,0xFF,0xFF,0xFF,0xF8,0x2B,0x00,0x00,0x00,0x97,0xFF,0xFF,0xFF,0x21,0x00,0x28,
0xEE,0xFF,0xFF,0xFA,0xE2,0xFF,0xFF,0xE8,0x2E,0x00,0x04,0xEA,0xFF,0xFF,0xC7,0x00,
0x00,0xAE,0xFF,0xFF,0xFF,0x50,0x1A,0xD9,0xFF,0xFF,0xEE,0x38,0x64,0xFF,0xFF,0xFF,
0x59,0x00,0x00,0xEF,0xFF,0xFF,0xD2,0x00,0x00,0x19,0xD8,0xFF,0xFF,0xF4,0xE7,0xFF,
0xFF,0xD3,0x03,0x00,0x05,0xFF,0xFF,0xFF,0xD6,0x00,0x00,0x00,0x18,0xD6,0xFF,0xFF,
0xFF,0xFF,0xFC,0x3E,0x00,0x00,0x00,0xE0,0xFF,0xFF,0xFF,0x76,0x04,0x00,0x00,0x58,
0xFE,0xFF,0xFF,0xFF,0xAE,0x00,0x00,0x00,0x00,0x75,0xFF,0xFF,0xFF,0xFF,0xF0,0xD7,
0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x71,0x00,0x00,0x00,0x02,0x99,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xE1,0xFF,0xFF,0xFF,0x77,0x00,0x00,0x00,0x00,0x40,
0xA3,0xDC,0xF7,0xFA,0xE8,0xBA,0x66,0x0B,0x18,0xD6,0xFF,0xFF,0xFF,0x7D,0x00,0x00,
0x66,0xFF,0xFF,0xC9,0x51,0xFF,0xFF,0xB4,0x3C,0xFF,0xFF,0xA0,0x28,0xFF,0xFF,0x8B,
0x13,0xFF,0xFF,0x76,0x01,0xFC,0xFF,0x62,0x00,0x00,0x00,0x09,0xD5,0xFF,0xF6,0x23,
0x00,0x00,0x00,0x96,0xFF,0xFF,0x76,0x00,0x00,0x00,0x38,0xFF,0xFF,0xDE,0x04,0x00,
0x00,0x00,0xAC,0xFF,0xFF,0x73,0x00,0x00,0x00,0x1E,0xFC,0xFF,0xF7,0x11,0x00,0x00,
0x00,0x65,0xFF,0xFF,0xBD,0x00,0x00,0x00,0x00,0xA2,0xFF,0xFF,0x7F,0x00,0x00,0x00,
0x00,0xD6,0xFF,0xFF,0x4A,0x00,0x00,0x00,0x00,0xED,0xFF,0xFF,0x33,0x00,0x00,0x00,
0x03,0xFD,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x04,0xFF,0xFF,0xFF,0x1C,0x00,0x00,0x00,
0x00,0xF0,0xFF,0xFF,0x31,0x00,0x00,0x00,0x00,0xDB,0xFF,0xFF,0x47,0x00,0x00,0x00,
0x00,0xAC,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x6E,0xFF,0xFF,0xB9,0x00,0x00,0x00,
0x00,0x27,0xFF,0xFF,0xF4,0x0D,0x00,0x00,0x00,0x00,0xB7,0xFF,0xFF,0x6C,0x00,0x00,
0x00,0x00,0x41,0xFF,0xFF,0xD7,0x02,0x00,0x00,0x00,0x00,0x9F,0xFF,0xFF,0x6D,0x00,
0x00,0x00,0x00,0x0B,0xD7,0xFF,0xF3,0x1E,0x10,0xE7,0xFF,0xE8,0x16,0x00,0x00,0x00,
0x00,0x54,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xFF,0x56,0x00,0x00,
0x00,0x00,0x53,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x03,0xE4,0xFF,0xFF,0x36,0x00,
0x00,0x00,0x00,0x9D,0xFF,0xFF,0x81,0x00,0x00,0x00,0x00,0x5E,0xFF,0xFF,0xBF,0x00,
0x00,0x00,0x00,0x27,0xFF,0xFF,0xF5,0x00,0x00,0x00,0x00,0x10,0xFF,0xFF,0xFF,0x0C,
0x00,0x00,0x00,0x00,0xFB,0xFF,0xFF,0x20,0x00,0x00,0x00,0x00,0xF9,0xFF,0xFF,0x23,
0x00,0x00,0x00,0x0E,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x24,0xFF,0xFF,0xF9,0x00,
0x00,0x00,0x00,0x59,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x99,0xFF,0xFF,0x89,0x00,
0x00,0x00,0x02,0xE0,0xFF,0xFF,0x42,0x00,0x00,0x00,0x4C,0xFF,0xFF,0xD2,0x00,0x00,
0x00,0x00,0xB9,0xFF,0xFF,0x5F,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xBC,0x02,0x00,0x00,
0x0C,0xE1,0xFF,0xE9,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF5,0xFF,0xFC,
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xE3,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBA,0xFF,0xC5,0x00,0x00,0x00,0x00,0x00,0x00,
0xC9,0xA3,0x5B,0x16,0x9D,0xFF,0xA8,0x12,0x55,0x9A,0xDD,0x07,0x0A,0xFE,0xFF,0xFF,
0xFE,0xF1,0xFF,0xF2,0xFD,0xFF,0xFF,0xFF,0x27,0x29,0xEB,0xFC,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xF2,0x41,0x00,0x00,0x01,0x11,0xA9,0xFF,0xFF,0xFF,0xB8,0x15,
0x04,0x00,0x00,0x00,0x00,0x00,0x54,0xFF,0xFF,0xCB,0xFF,0xFF,0x64,0x00,0x00,0x00,
0x00,0x00,0x25,0xF1,0xFF,0xEC,0x12,0xE6,0xFF,0xF7,0x31,0x00,0x00,0x00,0x00,0x91,
0xFF,0xFF,0x82,0x00,0x6D,0xFF,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x3B,0xB3,0x16,
0x00,0x07,0xB5,0x4E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0x24,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0x24,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x70,0xFF,0xFF,0x24,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xAC,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAC,
0xC9,0xD0,0xD0,0xD0,0xE5,0xFF,0xFF,0xD6,0xD0,0xD0,0xD0,0x8B,0x00,0x00,0x00,0x00,
0x70,0xFF,0xFF,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0x24,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0x24,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0x24,0x00,0x00,0x00,0x00,0x00,0x29,0xFF,0xFF,
0xFF,0x44,0x00,0x53,0xFF,0xFF,0xF3,0x07,0x00,0x83,0xFF,0xFF,0xA9,0x00,0x00,0xB8,
0xFF,0xFF,0x4F,0x00,0x00,0xED,0xFF,0xE5,0x03,0x00,0x25,0xFF,0xFF,0x83,0x00,0x00,
0x3A,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0x03,0x48,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,
0x48,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,0x20,0xCB,0xF6,0xB7,0x0C,0x8B,0xFF,0xFF,
0xFF,0x63,0x8A,0xFF,0xFF,0xFF,0x62,0x1E,0xC9,0xF6,0xB5,0x0B,0x00,0x00,0x00,0x00,
0x00,0x00,0xA4,0xFF,0xFF,0x9B,0x00,0x00,0x00,0x00,0x00,0x0E,0xF5,0xFF,0xFF,0x3B,
0x00,0x00,0x00,0x00,0x00,0x64,0xFF,0xFF,0xDA,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,
0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFD,0x1D,0x00,0x00,0x00,
0x00,0x00,0x84,0xFF,0xFF,0xBA,0x00,0x00,0x00,0x00,0x00,0x02,0xE1,0xFF,0xFF,0x5A,
0x00,0x00,0x00,0x00,0x00,0x44,0xFF,0xFF,0xF0,0x09,0x00,0x00,0x00,0x00,0x00,0xA4,
0xFF,0xFF,0x99,0x00,0x00,0x00,0x00,0x00,0x0E,0xF5,0xFF,0xFF,0x39,0x00,0x00,0x00,
0x00,0x00,0x64,0xFF,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xFF,0xFF,0x79,
0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFD,0x1B,0x00,0x00,0x00,0x00,0x00,0x84,
0xFF,0xFF,0xB8,0x00,0x00,0x00,0x00,0x00,0x02,0xE1,0xFF,0xFF,0x58,0x00,0x00,0x00,
0x00,0x00,0x44,0xFF,0xFF,0xEF,0x08,0x00,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x98,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x99,0xDE,0xF9,0xEF,
0xC5,0x65,0x01,0x00,0x00,0x00,0x00,0x2D,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB3,
0x03,0x00,0x00,0x05,0xDF,0xFF,0xFF,0xFF,0xDF,0xEE,0xFF,0xFF,0xFF,0x7E,0x00,0x00,
0x5C,0xFF,0xFF,0xFF,0x6E,0x00,0x08,0xBB,0xFF,0xFF,0xF2,0x0D,0x00,0xAD,0xFF,0xFF,
0xE6,0x02,0x00,0x00,0x3B,0xFF,0xFF,0xFF,0x56,0x00,0xE2,0xFF,0xFF,0xAD,0x00,0x00,
0x00,0x04,0xF9,0xFF,0xFF,0x91,0x06,0xFF,0xFF,0xFF,0x8D,0x00,0x00,0x00,0x00,0xDC,
0xFF,0xFF,0xB8,0x15,0xFF,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00,0xCB,0xFF,0xFF,0xCA,
0x20,0xFF,0xFF,0xFF,0x79,0x00,0x00,0x00,0x00,0xC6,0xFF,0xFF,0xD4,0x18,0xFF,0xFF,
0xFF,0x7D,0x00,0x00,0x00,0x00,0xCB,0xFF,0xFF,0xC8,0x08,0xFE,0xFF,0xFF,0x8D,0x00,
0x00,0x00,0x00,0xDB,0xFF,0xFF,0xB9,0x00,0xE0,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x03,
0xF8,0xFF,0xFF,0x95,0x00,0xA6,0xFF,0xFF,0xE4,0x01,0x00,0x00,0x38,0xFF,0xFF,0xFF,
0x5F,0x00,0x52,0xFF,0xFF,0xFF,0x6C,0x00,0x07,0xB9,0xFF,0xFF,0xF7,0x16,0x00,0x02,
0xD2,0xFF,0xFF,0xFF,0xDE,0xED,0xFF,0xFF,0xFF,0x93,0x00,0x00,0x00,0x27,0xE9,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xC1,0x08,0x00,0x00,0x00,0x00,0x15,0x8D,0xDA,0xF7,0xF5,
0xCE,0x77,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xA6,0xFF,0xFF,
0xE8,0x00,0x00,0x00,0x21,0xD0,0xFF,0xFF,0xFF,0xE8,0x00,0x00,0x46,0xED,0xFF,0xFF,
0xFF,0xFF,0xE8,0x00,0x77,0xFD,0xFF,0xFF,0xFB,0xFF,0xFF,0xE8,0x55,0xFF,0xFF,0xFF,
0xA6,0xA9,0xFF,0xFF,0xE8,0x01,0xAD,0xFE,0x7E,0x01,0xAE,0xFF,0xFF,0xE8,0x00,0x0B,
0x43,0x00,0x00,0xB5,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xE8,
0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,
0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,
0xB8,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xE8,0x00,0x00,0x00,
0x00,0x00,0xB8,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xE8,0x00,
0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,
0xE8,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xAB,0xE2,0xF7,0xF3,0xD5,0x88,0x15,0x00,
0x00,0x00,0x29,0xCB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEB,0x31,0x00,0x02,0xD1,
0xFF,0xFF,0xFF,0xFA,0xDA,0xEE,0xFF,0xFF,0xFF,0xDE,0x03,0x00,0x28,0xF0,0xF9,0x82,
0x12,0x00,0x05,0xA0,0xFF,0xFF,0xFF,0x47,0x00,0x00,0x43,0x35,0x00,0x00,0x00,0x00,
0x33,0xFF,0xFF,0xFF,0x6B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0xFF,0xFF,
0xFF,0x5D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8D,0xFF,0xFF,0xFF,0x25,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x36,0xF9,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1F,0xE6,0xFF,0xFF,0xF4,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0xDA,
0xFF,0xFF,0xFC,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0xD1,0xFF,0xFF,0xFD,0x5C,
0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xCE,0xFF,0xFF,0xFB,0x59,0x00,0x00,0x00,0x00,
0x00,0x00,0x0F,0xCA,0xFF,0xFF,0xF8,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0xC7,
0xFF,0xFF,0xF3,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC4,0xFF,0xFF,0xFF,0xEB,
0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0xC3,0x0C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xF0,0x0C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF0,0x00,0x00,0x00,0x00,0x00,0x35,0x92,0xCF,0xED,0xFB,0xF1,0xCE,0x88,0x1B,0x00,
0x00,0x01,0xAF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF3,0x43,0x00,0x00,0x76,
0xFF,0xFF,0xFF,0xE3,0xD9,0xF7,0xFF,0xFF,0xFF,0xE8,0x05,0x00,0x02,0xC0,0x92,0x21,
0x00,0x00,0x10,0xBD,0xFF,0xFF,0xFF,0x35,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x55,0xFF,0xFF,0xFF,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x71,0xFF,0xFF,
0xF2,0x0A,0x00,0x00,0x00,0x00,0x00,0x08,0x21,0x6A,0xF2,0xFF,0xFE,0x67,0x00,0x00,
0x00,0x00,0x74,0xFF,0xFF,0xFF,0xFF,0xFF,0xD5,0x49,0x00,0x00,0x00,0x00,0x00,0x74,
0xFF,0xFF,0xFF,0xFF,0xE9,0x86,0x38,0x00,0x00,0x00,0x00,0x00,0x5E,0xD0,0xD7,0xE9,
0xFF,0xFF,0xFF,0xFF,0x9E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0xAE,0xFF,
0xFF,0xFF,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0xFF,0xFF,0xFF,0xB5,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0xFF,0xFF,0xFF,0xB2,0x13,0xA5,0x50,
0x0A,0x00,0x00,0x00,0x19,0xC0,0xFF,0xFF,0xFF,0x7F,0x18,0xFF,0xFF,0xFD,0xE0,0xD2,
0xE0,0xFE,0xFF,0xFF,0xFF,0xEE,0x18,0x18,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xE3,0x37,0x00,0x02,0x45,0x8F,0xCA,0xE2,0xF8,0xF4,0xE1,0xB6,0x6D,0x0B,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0xFF,0xFF,0xFF,0x40,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF3,0xFF,0xFF,0xFF,0x40,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xBC,0xFF,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0x1E,0xF2,0xFF,0xDC,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xBA,0xFF,
0xFD,0x66,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x64,0xFF,0xFF,0x94,0x3D,
0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x1C,0xF1,0xFF,0xDF,0x0C,0x42,0xFF,0xFF,
0xFF,0x40,0x00,0x00,0x00,0x00,0xB7,0xFF,0xFE,0x42,0x00,0x44,0xFF,0xFF,0xFF,0x40,
0x00,0x00,0x00,0x62,0xFF,0xFF,0x97,0x00,0x00,0x44,0xFF,0xFF,0xFF,0x40,0x00,0x00,
0x1B,0xF0,0xFF,0xE0,0x0C,0x00,0x00,0x44,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x8E,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x50,0x98,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x50,0x7B,0xD0,0xD0,0xD0,0xD0,0xD0,
0xD0,0xDC,0xFF,0xFF,0xFF,0xDC,0xD0,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xFF,0xFF,
0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xFF,0xFF,0xFF,0x40,
0x00,0x00,0x00,0x00,0x00,0xE2,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x74,0x00,
0x00,0xF5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x74,0x00,0x08,0xFF,0xFF,0xFF,
0xDF,0xD0,0xD0,0xD0,0xD0,0xD0,0x5E,0x00,0x1B,0xFF,0xFF,0xFF,0x44,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x2E,0xFF,0xFF,0xFF,0x2E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x41,0xFF,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,
0xAD,0xC8,0xC7,0xAC,0x64,0x09,0x00,0x00,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xDB,0x27,0x00,0x58,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDA,0x05,
0x00,0x2B,0x49,0x1B,0x07,0x1A,0x5D,0xE6,0xFF,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x49,0xFF,0xFF,0xFF,0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,
0xFF,0xFF,0xFF,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0xFF,0xFF,0xFF,0x7C,
0x95,0x5D,0x17,0x00,0x00,0x00,0x2C,0xD2,0xFF,0xFF,0xFF,0x34,0xD4,0xFF,0xFF,0xE8,
0xD5,0xE7,0xFF,0xFF,0xFF,0xFF,0xAE,0x00,0xD4,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xB8,0x0C,0x00,0x3C,0x97,0xCC,0xE4,0xF9,0xF5,0xDE,0xA9,0x4E,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x4E,0xA0,0xD8,0xEF,0xFE,0xFD,0xA8,0x00,0x00,0x00,0x00,
0x23,0xCC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x20,0xE9,0xFF,0xFF,
0xFF,0xFD,0xEA,0xD6,0xE0,0xB9,0x00,0x00,0x00,0xC2,0xFF,0xFF,0xF6,0x73,0x16,0x00,
0x00,0x00,0x02,0x00,0x00,0x44,0xFF,0xFF,0xFE,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x9F,0xFF,0xFF,0xAD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,
0xFF,0xFF,0x62,0x3F,0xBD,0xEF,0xF6,0xCE,0x6D,0x02,0x00,0x02,0xFD,0xFF,0xFF,0x87,
0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xAB,0x01,0x12,0xFF,0xFF,0xFF,0xFE,0xFF,0xE5,0xE1,
0xFF,0xFF,0xFF,0xFF,0x5B,0x22,0xFF,0xFF,0xFF,0xFA,0x5B,0x00,0x00,0x43,0xFC,0xFF,
0xFF,0xB7,0x16,0xFF,0xFF,0xFF,0x91,0x00,0x00,0x00,0x00,0xB2,0xFF,0xFF,0xE1,0x02,
0xFC,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x99,0xFF,0xFF,0xE9,0x00,0xC8,0xFF,0xFF,
0xBD,0x00,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xD0,0x00,0x6F,0xFF,0xFF,0xFF,0x6C,0x00,
0x00,0x5A,0xFF,0xFF,0xFF,0x90,0x00,0x07,0xD3,0xFF,0xFF,0xFF,0xE6,0xE5,0xFF,0xFF,
0xFF,0xF5,0x21,0x00,0x00,0x24,0xD5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF6,0x4F,0x00,
0x00,0x00,0x00,0x0B,0x70,0xC9,0xEE,0xF8,0xDD,0x98,0x25,0x00,0x00,0x00,0x00,0x00,
0x5C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x5C,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x4A,0xD0,0xD0,0xD0,0xD0,0xD0,
0xD0,0xD0,0xD0,0xFD,0xFF,0xFF,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,
0xFF,0xFF,0xFF,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xFF,0xFF,0xE1,
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xFD,0xFF,0xFF,0x75,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x95,0xFF,0xFF,0xF4,0x11,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x13,0xF5,0xFF,0xFF,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7D,0xFF,
0xFF,0xFE,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE8,0xFF,0xFF,0xB7,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0xFF,0xFF,0xFF,0x48,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xD8,0xFF,0xFF,0xD7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x4E,0xFF,0xFF,0xFF,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC2,0xFF,0xFF,
0xEE,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0xFF,0xFF,0xFF,0x8A,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xFF,0xFF,0xFC,0x1E,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x21,0xFC,0xFF,0xFF,0xAB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x39,0xA2,0xDE,0xF8,0xF2,0xD2,0x8D,0x1E,0x00,0x00,0x00,0x00,0x83,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0x47,0x00,0x00,0x40,0xFF,0xFF,0xFF,0xFF,
0xDD,0xEA,0xFF,0xFF,0xFF,0xEA,0x0D,0x00,0x8B,0xFF,0xFF,0xF9,0x3E,0x00,0x02,0x84,
0xFF,0xFF,0xFF,0x42,0x00,0x8E,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x21,0xFF,0xFF,0xFF,
0x44,0x00,0x56,0xFF,0xFF,0xF9,0x2E,0x00,0x00,0x6E,0xFF,0xFF,0xF5,0x14,0x00,0x02,
0xC7,0xFF,0xFF,0xF4,0x77,0x9F,0xFE,0xFF,0xFF,0x6D,0x00,0x00,0x00,0x11,0xC0,0xFF,
0xFF,0xFF,0xFF,0xFF,0xED,0x5D,0x00,0x00,0x00,0x00,0x02,0x6C,0xFD,0xFF,0xFF,0xFF,
0xFF,0xBF,0x22,0x00,0x00,0x00,0x0A,0xB4,0xFF,0xFF,0xFF,0xBD,0xF1,0xFF,0xFF,0xF7,
0x5A,0x00,0x00,0x8F,0xFF,0xFF,0xEE,0x43,0x00,0x17,0xB5,0xFF,0xFF,0xFC,0x3A,0x02,
0xF7,0xFF,0xFF,0x65,0x00,0x00,0x00,0x03,0xBF,0xFF,0xFF,0xAF,0x1E,0xFF,0xFF,0xFF,
0x45,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0xD3,0x0E,0xFD,0xFF,0xFF,0xBE,0x14,0x00,
0x00,0x31,0xE9,0xFF,0xFF,0xB5,0x00,0xB2,0xFF,0xFF,0xFF,0xF9,0xDA,0xE3,0xFF,0xFF,
0xFF,0xFF,0x50,0x00,0x19,0xD4,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x7E,0x00,
0x00,0x00,0x07,0x6A,0xBC,0xEA,0xFB,0xF3,0xD8,0x98,0x30,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x48,0xB1,0xE8,0xF9,0xE4,0xB4,0x4F,0x00,0x00,0x00,0x00,0x00,0x94,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA5,0x07,0x00,0x00,0x66,0xFF,0xFF,0xFF,0xFD,
0xDC,0xF2,0xFF,0xFF,0xFF,0x8C,0x00,0x00,0xDE,0xFF,0xFF,0xE6,0x29,0x00,0x0B,0xAE,
0xFF,0xFF,0xFD,0x21,0x1E,0xFF,0xFF,0xFF,0x73,0x00,0x00,0x00,0x13,0xF8,0xFF,0xFF,
0x79,0x36,0xFF,0xFF,0xFF,0x4D,0x00,0x00,0x00,0x00,0xC8,0xFF,0xFF,0xB1,0x2E,0xFF,
0xFF,0xFF,0x66,0x00,0x00,0x00,0x01,0xDD,0xFF,0xFF,0xC9,0x0A,0xFA,0xFF,0xFF,0xD6,
0x19,0x00,0x08,0x91,0xFF,0xFF,0xFF,0xD5,0x00,0xAB,0xFF,0xFF,0xFF,0xF9,0xD9,0xF1,
0xFF,0xFF,0xFF,0xFF,0xC3,0x00,0x1C,0xE4,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xA3,0xFF,
0xFF,0xAF,0x00,0x00,0x18,0x94,0xE2,0xFA,0xE9,0xA9,0x21,0xAE,0xFF,0xFF,0x8D,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xF1,0xFF,0xFF,0x52,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x88,0xFF,0xFF,0xF0,0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x2B,
0x9C,0xFF,0xFF,0xFF,0x79,0x00,0x00,0x08,0xF3,0xD7,0xD9,0xEF,0xFF,0xFF,0xFF,0xFF,
0xBC,0x04,0x00,0x00,0x08,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x9E,0x09,0x00,0x00,
0x00,0x07,0xF1,0xFF,0xFB,0xEB,0xCB,0x8D,0x2D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0xCB,0xF6,0xB7,0x0C,0x8B,0xFF,0xFF,0xFF,0x63,0x8A,0xFF,0xFF,0xFF,0x62,0x1E,
0xC9,0xF6,0xB5,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xCB,0xF6,
0xB7,0x0C,0x8B,0xFF,0xFF,0xFF,0x63,0x8A,0xFF,0xFF,0xFF,0x62,0x1E,0xC9,0xF6,0xB5,
0x0B,0x00,0x00,0x00,0x00,0x20,0xCB,0xF6,0xB7,0x0C,0x00,0x8B,0xFF,0xFF,0xFF,0x63,
0x00,0x8A,0xFF,0xFF,0xFF,0x62,0x00,0x1E,0xC9,0xF6,0xB5,0x0B,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x29,0xFF,0xFF,0xFF,0x44,0x00,0x53,0xFF,0xFF,0xF3,0x07,0x00,0x83,0xFF,0xFF,
0xA9,0x00,0x00,0xB8,0xFF,0xFF,0x4F,0x00,0x00,0xED,0xFF,0xE5,0x03,0x00,0x25,0xFF,
0xFF,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x6A,0x8F,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x6A,0xE3,0xFF,0xAC,0x00,0x00,0x00,0x00,
0x00,0x07,0x6B,0xE3,0xFF,0xFF,0xFF,0xA2,0x00,0x00,0x00,0x07,0x6B,0xE3,0xFF,0xFF,
0xFF,0xD1,0x5B,0x04,0x00,0x07,0x6B,0xE3,0xFF,0xFF,0xFF,0xBF,0x48,0x00,0x00,0x00,
0x6A,0xE4,0xFF,0xFF,0xFD,0xAD,0x36,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xF2,
0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAD,0xFD,0xFF,0xFF,0xFD,0xB6,0x4D,0x03,
0x00,0x00,0x00,0x00,0x00,0x24,0x93,0xF4,0xFF,0xFF,0xFF,0xE1,0x7B,0x18,0x00,0x00,
0x00,0x00,0x00,0x10,0x75,0xE2,0xFF,0xFF,0xFF,0xFA,0xAA,0x37,0x00,0x00,0x00,0x00,
0x00,0x04,0x58,0xC9,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3A,0xAB,0xFC,0xAC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x52,
0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAC,0xF8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAC,0xC9,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,
0xD0,0xD0,0xD0,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xC9,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0x8B,0xF8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAC,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xAC,0xBB,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xF8,0xFF,0xC3,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0xFF,0xFF,0xFF,
0xC4,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x7F,0xEB,0xFF,0xFF,0xFF,0xC4,0x45,
0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x6C,0xDF,0xFF,0xFF,0xFF,0xC4,0x45,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0x5A,0xD0,0xFF,0xFF,0xFF,0xC5,0x3C,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0x86,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x00,0x0F,0x6C,0xD5,0xFF,
0xFF,0xFF,0xF2,0x6C,0x00,0x00,0x32,0x9B,0xF5,0xFF,0xFF,0xFF,0xDF,0x71,0x0E,0x00,
0x5F,0xC9,0xFF,0xFF,0xFF,0xFF,0xC4,0x53,0x03,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFB,
0xA7,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xEE,0x89,0x1C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x66,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x24,0x88,0xC8,0xED,0xFB,0xF0,0xC7,0x6F,0x06,0x00,0x9A,0xFE,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xC7,0x0B,0x65,0xFF,0xFF,0xFF,0xE3,0xD7,0xF7,0xFF,0xFF,0xFF,
0x85,0x05,0xC3,0x7C,0x1A,0x00,0x00,0x11,0xCE,0xFF,0xFF,0xD0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x92,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xE8,0xFF,
0xFF,0x97,0x00,0x00,0x00,0x00,0x00,0x3F,0xE4,0xFF,0xFF,0xE3,0x19,0x00,0x00,0x00,
0x00,0x6C,0xFC,0xFF,0xFF,0xCE,0x1F,0x00,0x00,0x00,0x00,0x46,0xFE,0xFF,0xFF,0x92,
0x07,0x00,0x00,0x00,0x00,0x00,0xA9,0xFF,0xFF,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC2,0xFF,0xFF,0x5B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x18,0x18,0x08,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7B,0xEF,0xE6,0x56,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xFF,0xFF,0xFF,
0xDF,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xDE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x78,0xEF,0xE5,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x04,0x51,0x99,0xD3,0xEA,0xF9,0xE5,0xCA,0x8B,0x31,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x59,0xDD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB1,
0x18,0x00,0x00,0x00,0x00,0x00,0x04,0x99,0xFF,0xFF,0xF9,0xAC,0x60,0x44,0x2F,0x42,
0x71,0xCC,0xFF,0xFF,0xEB,0x25,0x00,0x00,0x00,0x00,0x95,0xFF,0xFF,0xBB,0x18,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xF9,0xFF,0xD8,0x0F,0x00,0x00,0x52,0xFF,0xFF,
0xA4,0x02,0x01,0x5D,0xBE,0xEA,0xF8,0xE4,0xCC,0xA0,0x37,0x65,0xFF,0xFF,0x87,0x00,
0x03,0xD8,0xFF,0xDC,0x0C,0x07,0xB7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x75,0x00,
0xD0,0xFF,0xE9,0x03,0x3F,0xFF,0xFF,0x6D,0x00,0x93,0xFF,0xFF,0xB2,0x3A,0x1C,0x5F,
0xFF,0xFF,0x68,0x00,0x73,0xFF,0xFF,0x2A,0x88,0xFF,0xFF,0x16,0x13,0xF8,0xFF,0xCF,
0x03,0x00,0x00,0x4F,0xFF,0xFF,0x5C,0x00,0x50,0xFF,0xFF,0x49,0xAF,0xFF,0xEC,0x00,
0x49,0xFF,0xFF,0x73,0x00,0x00,0x00,0x5D,0xFF,0xFF,0x4F,0x00,0x45,0xFF,0xFF,0x4E,
0xC5,0xFF,0xD3,0x00,0x5E,0xFF,0xFF,0x5A,0x00,0x00,0x00,0x7D,0xFF,0xFF,0x43,0x00,
0x5F,0xFF,0xFF,0x34,0xC2,0xFF,0xDA,0x00,0x47,0xFF,0xFF,0x7D,0x00,0x00,0x00,0xC1,
0xFF,0xFF,0x41,0x00,0x90,0xFF,0xF3,0x07,0xA5,0xFF,0xF7,0x07,0x0C,0xF1,0xFF,0xEB,
0x4D,0x26,0x7D,0xFF,0xFF,0xFF,0x8D,0x3E,0xF2,0xFF,0x98,0x00,0x6D,0xFF,0xFF,0x4B,
0x00,0x65,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xBC,0xFF,0xFF,0xFF,0xFF,0xE5,0x17,0x00,
0x19,0xF8,0xFF,0xCB,0x06,0x00,0x4F,0xC4,0xF4,0xF4,0xBF,0x3C,0x07,0x97,0xF0,0xF1,
0xAE,0x1F,0x00,0x00,0x00,0x7E,0xFF,0xFF,0xAC,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xAC,0xFF,0xFF,0xE3,0x7A,0x35,
0x10,0x04,0x15,0x2B,0x48,0x83,0xC3,0x2F,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x79,
0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x34,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1F,0x77,0xC9,0xF6,0xFF,0xFF,0xFF,0xFF,0xE6,0xAE,0x65,0x09,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x22,0x1E,0x0B,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x22,0xFF,0xFF,
0xFF,0xFF,0xA9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7D,0xFF,
0xFF,0xFF,0xFF,0xF6,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,
0xFF,0xFF,0xF8,0xFF,0xFF,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,
0xFF,0xFF,0xFC,0x8F,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x8E,0xFF,0xFF,0xC4,0x34,0xFF,0xFF,0xFD,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0xE6,0xFF,0xFF,0x7A,0x01,0xE5,0xFF,0xFF,0x73,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x44,0xFF,0xFF,0xFF,0x2B,0x00,0x97,0xFF,0xFF,0xCE,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x9F,0xFF,0xFF,0xDB,0x00,0x00,0x46,0xFF,0xFF,0xFF,0x29,0x00,0x00,0x00,
0x00,0x00,0x08,0xF1,0xFF,0xFF,0x8C,0x00,0x00,0x05,0xEF,0xFF,0xFF,0x85,0x00,0x00,
0x00,0x00,0x00,0x55,0xFF,0xFF,0xFF,0x3D,0x00,0x00,0x00,0xA3,0xFF,0xFF,0xDF,0x01,
0x00,0x00,0x00,0x00,0xB0,0xFF,0xFF,0xFF,0xF8,0xF8,0xF8,0xF8,0xFB,0xFF,0xFF,0xFF,
0x3C,0x00,0x00,0x00,0x11,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x98,0x00,0x00,0x00,0x66,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xED,0x05,0x00,0x00,0xC1,0xFF,0xFF,0xF6,0x0A,0x00,0x00,0x00,0x00,0x00,
0x70,0xFF,0xFF,0xFF,0x4F,0x00,0x1E,0xFE,0xFF,0xFF,0xB0,0x00,0x00,0x00,0x00,0x00,
0x00,0x21,0xFF,0xFF,0xFF,0xAA,0x00,0x77,0xFF,0xFF,0xFF,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xD2,0xFF,0xFF,0xF7,0x0E,0xD2,0xFF,0xFF,0xFC,0x13,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0x62,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,
0xFF,0xFE,0xF5,0xE1,0xBB,0x7A,0x1A,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xF5,0x51,0x00,0xD8,0xFF,0xFF,0xF5,0xD0,0xD1,0xE2,0xFD,0xFF,0xFF,
0xFF,0xF3,0x0F,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x1E,0xCC,0xFF,0xFF,0xFF,0x50,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x5E,0xFF,0xFF,0xFF,0x64,0xD8,0xFF,0xFF,
0xC8,0x00,0x00,0x00,0x00,0x6A,0xFF,0xFF,0xFF,0x48,0xD8,0xFF,0xFF,0xC8,0x00,0x00,
0x0E,0x43,0xE1,0xFF,0xFF,0xE9,0x08,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xEC,0x3F,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0x6B,0x0C,
0x00,0xD8,0xFF,0xFF,0xF5,0xD0,0xD0,0xD6,0xF4,0xFF,0xFF,0xFF,0xDE,0x18,0xD8,0xFF,
0xFF,0xC8,0x00,0x00,0x00,0x06,0x8C,0xFF,0xFF,0xFF,0x92,0xD8,0xFF,0xFF,0xC8,0x00,
0x00,0x00,0x00,0x05,0xF8,0xFF,0xFF,0xCC,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x08,0xFB,0xFF,0xFF,0xD3,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x0A,0x98,0xFF,0xFF,
0xFF,0xA9,0xD8,0xFF,0xFF,0xF5,0xD0,0xD0,0xDA,0xF7,0xFF,0xFF,0xFF,0xFE,0x3E,0xD8,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF9,0x68,0x00,0xD8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFE,0xF2,0xD0,0x8F,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x26,0x8C,0xCE,0xF1,0xFB,0xED,0xC6,0x84,0x2F,0x00,0x00,0x00,0x00,0x75,0xFC,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x45,0x00,0x00,0x90,0xFF,0xFF,0xFF,0xFF,0xEC,
0xD6,0xF0,0xFF,0xFF,0xE0,0x02,0x00,0x46,0xFF,0xFF,0xFF,0xE4,0x47,0x01,0x00,0x02,
0x40,0xAE,0x76,0x00,0x00,0xCF,0xFF,0xFF,0xFB,0x2E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x27,0xFF,0xFF,0xFF,0xA5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x68,0xFF,0xFF,0xFF,0x5A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xFF,
0xFF,0xFF,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x96,0xFF,0xFF,0xFF,
0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xFF,0xFF,0xFF,0x30,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0xFF,0x52,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0xFF,0xFF,0xFF,0x94,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0xED,0xFF,0xFF,0xF2,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7B,0xFF,0xFF,0xFF,0xD3,0x35,0x00,0x00,0x00,0x10,0x54,0x77,0x00,
0x00,0x06,0xCF,0xFF,0xFF,0xFF,0xFF,0xE8,0xD6,0xEE,0xFF,0xFF,0xCC,0x00,0x00,0x00,
0x0F,0xBB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCC,0x00,0x00,0x00,0x00,0x02,
0x54,0xAD,0xE1,0xF9,0xFC,0xEF,0xCE,0x8F,0x3F,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,
0xFF,0xFD,0xE8,0xD0,0x9B,0x47,0x04,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xD2,0x32,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xF5,0xD0,0xD0,
0xE0,0xFE,0xFF,0xFF,0xFF,0xFB,0x45,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,
0x15,0x87,0xFE,0xFF,0xFF,0xED,0x20,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x71,0xFF,0xFF,0xFF,0xA1,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,
0x03,0xE2,0xFF,0xFF,0xF5,0x08,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,
0x9B,0xFF,0xFF,0xFF,0x36,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x76,
0xFF,0xFF,0xFF,0x54,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,
0xFF,0xFF,0x5A,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0xFF,0xFF,
0xFF,0x48,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xFF,0xFF,
0x2A,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x08,0xED,0xFF,0xFF,0xE9,0x01,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x8E,0xFF,0xFF,0xFF,0x8C,0x00,0xD8,
0xFF,0xFF,0xC8,0x00,0x00,0x00,0x26,0xA2,0xFF,0xFF,0xFF,0xEB,0x14,0x00,0xD8,0xFF,
0xFF,0xF5,0xD0,0xD3,0xE9,0xFF,0xFF,0xFF,0xFF,0xF4,0x38,0x00,0x00,0xD8,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC4,0x25,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,
0xFF,0xF8,0xE8,0xC7,0x8E,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x08,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x08,0xD8,0xFF,0xFF,0xF5,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0x06,0xD8,0xFF,0xFF,
0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,
0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x98,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x98,0x00,0xD8,
0xFF,0xFF,0xF5,0xD0,0xD0,0xD0,0xD0,0xD0,0x7B,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xF5,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,
0x06,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x08,0xD8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x08,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xF8,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xD8,0xFF,0xFF,0xF3,
0xD0,0xD0,0xD0,0xD0,0xD0,0xC9,0xD8,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,
0xD8,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xBC,0x00,0x00,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,
0xFF,0xF3,0xD0,0xD0,0xD0,0xD0,0xD0,0x71,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x8C,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8C,0xD8,0xFF,0xFF,0xBC,
0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,
0xD8,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xBC,0x00,0x00,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,
0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x62,0xAE,0xDC,0xF5,0xFC,0xEF,0xCD,
0x93,0x47,0x07,0x00,0x00,0x00,0x47,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x37,0x00,0x00,0x6F,0xFE,0xFF,0xFF,0xFF,0xFF,0xE9,0xD5,0xE9,0xFF,0xFF,0xC6,
0x00,0x00,0x3A,0xFB,0xFF,0xFF,0xFF,0x9F,0x24,0x00,0x00,0x00,0x1F,0x78,0x47,0x00,
0x00,0xCF,0xFF,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,
0xFF,0xFF,0xFF,0xCF,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6D,0xFF,
0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8E,0xFF,0xFF,
0xFF,0x3D,0x00,0x00,0x47,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0x5E,0x98,0xFF,0xFF,0xFF,
0x29,0x00,0x00,0x58,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x74,0x8B,0xFF,0xFF,0xFF,0x35,
0x00,0x00,0x58,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x74,0x73,0xFF,0xFF,0xFF,0x59,0x00,
0x00,0x00,0x00,0x00,0x18,0xFF,0xFF,0xFF,0x74,0x3E,0xFF,0xFF,0xFF,0xA2,0x00,0x00,
0x00,0x00,0x00,0x18,0xFF,0xFF,0xFF,0x74,0x06,0xE9,0xFF,0xFF,0xFB,0x2C,0x00,0x00,
0x00,0x00,0x18,0xFF,0xFF,0xFF,0x74,0x00,0x7A,0xFF,0xFF,0xFF,0xE7,0x4E,0x01,0x00,
0x00,0x1D,0xFF,0xFF,0xFF,0x74,0x00,0x04,0xC4,0xFF,0xFF,0xFF,0xFF,0xF3,0xD6,0xDA,
0xFA,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x0C,0xAD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x3A,0x99,0xD6,0xF0,0xFD,0xF6,0xE5,0xC6,
0x90,0x52,0x11,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,
0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,
0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xFF,
0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xFF,0x34,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xFF,0x34,0xD8,
0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,
0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xF5,0xD0,
0xD0,0xD0,0xD0,0xD0,0xD0,0xE4,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,
0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,
0x00,0x00,0x00,0x6C,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x00,0x6C,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,
0x00,0x6C,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,
0x6C,0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,
0xFF,0xFF,0xFF,0x34,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,
0xFF,0xFF,0x34,0x00,0x3C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x90,0x3C,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x90,0x07,0x67,0xDB,0xFF,0xFF,0xFF,0xF4,0x8F,0x1C,0x00,
0x00,0x24,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFF,0x7C,0x00,
0x00,0x00,0x00,0x24,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFF,
0x7C,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x24,0xFF,
0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,
0x24,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFF,0x7C,0x00,0x00,
0x00,0x00,0x24,0xFF,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0x24,0xFF,0xFF,0xFF,0x7C,
0x00,0x00,0x05,0x62,0xD7,0xFF,0xFF,0xFF,0xF1,0x8A,0x19,0x3C,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x90,0x3C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x90,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC7,
0x00,0x00,0x00,0x00,0xE1,0xFF,0xFF,0xB7,0x00,0x00,0x00,0x0E,0xFB,0xFF,0xFF,0x9E,
0x1A,0x07,0x1E,0xA0,0xFF,0xFF,0xFF,0x5A,0xC8,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x0B,
0xC8,0xFF,0xFF,0xFF,0xFF,0xE7,0x36,0x00,0x84,0xC4,0xCA,0xB2,0x74,0x14,0x00,0x00,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x8A,0xFF,0xFF,0xFF,0x7E,0xD8,0xFF,
0xFF,0xC8,0x00,0x00,0x00,0x00,0x57,0xFF,0xFF,0xFF,0xB2,0x01,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x2E,0xF5,0xFF,0xFF,0xD9,0x0F,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,
0x11,0xDD,0xFF,0xFF,0xF3,0x2A,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x02,0xB8,0xFF,
0xFF,0xFF,0x53,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x87,0xFF,0xFF,0xFF,0x87,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x47,0xFE,0xFF,0xFF,0xB9,0x02,0x00,0x00,
0x00,0x00,0xD8,0xFF,0xFF,0xDB,0xE8,0xFF,0xFF,0xFC,0x1A,0x00,0x00,0x00,0x00,0x00,
0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x83,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,
0xFF,0xFF,0xFF,0xF9,0xFF,0xFF,0xFA,0x2C,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xF8,
0x6D,0x47,0xFF,0xFF,0xFF,0xC7,0x02,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,
0xA5,0xFF,0xFF,0xFF,0x6D,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x16,0xEE,
0xFF,0xFF,0xF2,0x1D,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x63,0xFF,0xFF,
0xFF,0xB3,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x01,0xC1,0xFF,0xFF,0xFF,
0x57,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x28,0xF9,0xFF,0xFF,0xE8,0x11,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0xFF,0x9E,0x00,0x00,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,
0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,
0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,
0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFC,0xF0,0xF0,
0xF0,0xF0,0xF0,0xF0,0xB4,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,
0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0xD8,0xFF,0xFF,0xFF,
0xFF,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA2,0xFF,0xFF,0xFF,0xFF,0x78,0xD8,
0xFF,0xFF,0xFF,0xFF,0x93,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xF0,0xFF,0xFF,0xFF,
0xFF,0x78,0xD8,0xFF,0xFF,0xFF,0xFF,0xE2,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0xFF,
0xFF,0xFF,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0xEE,0xFF,0xFF,0x32,0x00,0x00,0x00,0x00,
0x00,0xA0,0xFF,0xFF,0xF6,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0xA9,0xFF,0xFF,0x82,0x00,
0x00,0x00,0x00,0x06,0xEF,0xFF,0xE4,0xCA,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x66,0xFF,
0xFF,0xD2,0x00,0x00,0x00,0x00,0x4A,0xFF,0xFF,0x90,0xD2,0xFF,0xFF,0x78,0xD8,0xFF,
0xFF,0x51,0xD1,0xFF,0xFF,0x21,0x00,0x00,0x00,0x9E,0xFF,0xFF,0x3B,0xDB,0xFF,0xFF,
0x78,0xD8,0xFF,0xFF,0x5B,0x83,0xFF,0xFF,0x71,0x00,0x00,0x04,0xED,0xFF,0xE4,0x01,
0xE1,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x63,0x34,0xFF,0xFF,0xC1,0x00,0x00,0x47,0xFF,
0xFF,0x91,0x00,0xE6,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x67,0x01,0xE4,0xFF,0xFC,0x13,
0x00,0x9C,0xFF,0xFF,0x3C,0x00,0xE8,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x68,0x00,0x97,
0xFF,0xFF,0x60,0x04,0xEC,0xFF,0xE5,0x01,0x00,0xE8,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,
0x68,0x00,0x48,0xFF,0xFF,0xB0,0x45,0xFF,0xFF,0x92,0x00,0x00,0xE8,0xFF,0xFF,0x78,
0xD8,0xFF,0xFF,0x68,0x00,0x07,0xF3,0xFF,0xF6,0xA4,0xFF,0xFF,0x3D,0x00,0x00,0xE8,
0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x68,0x00,0x00,0xAB,0xFF,0xFF,0xFF,0xFF,0xE6,0x02,
0x00,0x00,0xE8,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x68,0x00,0x00,0x5D,0xFF,0xFF,0xFF,
0xFF,0x93,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x68,0x00,0x00,0x12,
0xFC,0xFF,0xFF,0xFF,0x3E,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x78,0xD8,0xFF,0xFF,0x68,
0x00,0x00,0x00,0xBF,0xFF,0xFF,0xE7,0x02,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x78,0x00,
0xD8,0xFF,0xFF,0xFF,0xF2,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0xFF,0xFF,0xFE,0x36,0x00,0x00,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xC9,0x01,0x00,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0xBC,0xFF,0xFF,0xFF,0x5F,0x00,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x4B,0xE6,0xFF,0xFF,0xE7,0x0D,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x4A,0x5D,0xFF,0xFF,0xFF,0x8A,0x00,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x56,0x01,0xC7,0xFF,0xFF,0xF9,0x25,0x00,0x00,0xE8,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x61,0x00,0x35,0xFE,0xFF,0xFF,0xB5,0x00,0x00,0xE5,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x67,0x00,0x00,0x9E,0xFF,0xFF,0xFF,0x4A,0x00,0xDE,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x68,0x00,0x00,0x17,0xF1,0xFF,0xFF,0xD9,0x05,0xD7,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x68,0x00,0x00,0x00,0x74,0xFF,0xFF,0xFF,0x75,0xCD,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x68,0x00,0x00,0x00,0x05,0xD9,0xFF,0xFF,0xF2,0xDA,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x4A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x00,0xB5,0xFF,0xFF,0xFF,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x00,0x26,0xFA,0xFF,0xFF,0xFF,0xFF,0x5C,
0xD8,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFF,0xFF,0x5C,
0x00,0x00,0x00,0x00,0x33,0x93,0xD0,0xF1,0xFC,0xF3,0xD5,0x9D,0x3F,0x00,0x00,0x00,
0x00,0x00,0x00,0x05,0x93,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA7,0x0A,
0x00,0x00,0x00,0x01,0xB5,0xFF,0xFF,0xFF,0xFF,0xEE,0xD6,0xE9,0xFF,0xFF,0xFF,0xFF,
0xC9,0x05,0x00,0x00,0x67,0xFF,0xFF,0xFF,0xE3,0x47,0x01,0x00,0x00,0x36,0xD4,0xFF,
0xFF,0xFF,0x7D,0x00,0x01,0xE3,0xFF,0xFF,0xFC,0x2E,0x00,0x00,0x00,0x00,0x00,0x1C,
0xF4,0xFF,0xFF,0xF3,0x08,0x36,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x94,0xFF,0xFF,0xFF,0x4E,0x6E,0xFF,0xFF,0xFF,0x66,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x4D,0xFF,0xFF,0xFF,0x88,0x86,0xFF,0xFF,0xFF,0x41,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x2A,0xFF,0xFF,0xFF,0xA0,0x96,0xFF,0xFF,0xFF,0x37,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xB1,0x84,0xFF,0xFF,0xFF,0x41,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x2A,0xFF,0xFF,0xFF,0x9F,0x6C,0xFF,0xFF,0xFF,0x65,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x4D,0xFF,0xFF,0xFF,0x87,0x31,0xFF,0xFF,0xFF,0xAB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0xFF,0x4C,0x00,0xE0,0xFF,0xFF,
0xFB,0x2C,0x00,0x00,0x00,0x00,0x00,0x1A,0xF3,0xFF,0xFF,0xF2,0x07,0x00,0x61,0xFF,
0xFF,0xFF,0xE1,0x44,0x01,0x00,0x00,0x35,0xD3,0xFF,0xFF,0xFF,0x7A,0x00,0x00,0x00,
0xB1,0xFF,0xFF,0xFF,0xFF,0xEC,0xD5,0xE9,0xFF,0xFF,0xFF,0xFF,0xC6,0x04,0x00,0x00,
0x00,0x04,0x92,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA5,0x09,0x00,0x00,
0x00,0x00,0x00,0x00,0x33,0x95,0xD0,0xF2,0xFD,0xF4,0xD5,0x9C,0x3E,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFE,0xF2,0xD7,0x9D,0x36,0x00,0x00,
0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x7A,0x00,0xD8,0xFF,0xFF,0xF5,
0xD0,0xD5,0xF4,0xFF,0xFF,0xFF,0xFF,0x46,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x05,0x80,
0xFF,0xFF,0xFF,0xB4,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xDB,0xFF,0xFF,0xE9,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xBB,0xFF,0xFF,0xF4,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x04,0xE4,0xFF,0xFF,0xDA,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x13,0x9F,
0xFF,0xFF,0xFF,0x94,0xD8,0xFF,0xFF,0xF5,0xD0,0xDF,0xFB,0xFF,0xFF,0xFF,0xF4,0x25,
0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x4D,0x00,0xD8,0xFF,0xFF,0xFF,
0xFF,0xFE,0xF1,0xCE,0x8A,0x1D,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x33,0x93,0xD0,0xF1,0xFC,0xF3,0xD5,0x9D,0x3F,0x00,0x00,0x00,
0x00,0x00,0x00,0x05,0x93,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA7,0x0A,
0x00,0x00,0x00,0x01,0xB5,0xFF,0xFF,0xFF,0xFF,0xEE,0xD6,0xE9,0xFF,0xFF,0xFF,0xFF,
0xC8,0x04,0x00,0x00,0x67,0xFF,0xFF,0xFF,0xE3,0x47,0x01,0x00,0x00,0x36,0xD4,0xFF,
0xFF,0xFF,0x7B,0x00,0x01,0xE3,0xFF,0xFF,0xFC,0x2E,0x00,0x00,0x00,0x00,0x00,0x1C,
0xF4,0xFF,0xFF,0xF2,0x07,0x36,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x94,0xFF,0xFF,0xFF,0x4D,0x6E,0xFF,0xFF,0xFF,0x66,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x4D,0xFF,0xFF,0xFF,0x87,0x86,0xFF,0xFF,0xFF,0x41,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x2A,0xFF,0xFF,0xFF,0xA0,0x96,0xFF,0xFF,0xFF,0x37,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xB3,0x84,0xFF,0xFF,0xFF,0x41,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x2A,0xFF,0xFF,0xFF,0xAA,0x6C,0xFF,0xFF,0xFF,0x65,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x4D,0xFF,0xFF,0xFF,0x8D,0x31,0xFF,0xFF,0xFF,0xAB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0xFF,0x58,0x00,0xE0,0xFF,0xFF,
0xFB,0x2C,0x00,0x00,0x00,0x00,0x00,0x1A,0xF3,0xFF,0xFF,0xF5,0x10,0x00,0x61,0xFF,
0xFF,0xFF,0xE1,0x44,0x01,0x00,0x00,0x35,0xD3,0xFF,0xFF,0xFF,0x90,0x00,0x00,0x00,
0xB1,0xFF,0xFF,0xFF,0xFF,0xEC,0xD5,0xE9,0xFF,0xFF,0xFF,0xFF,0xD4,0x0E,0x00,0x00,
0x00,0x04,0x92,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBB,0x16,0x00,0x00,
0x00,0x00,0x00,0x00,0x33,0x95,0xD0,0xF2,0xFE,0xFF,0xFF,0xFF,0xCB,0x04,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xB8,0xFF,0xFF,0xFF,0xA7,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0xCA,0xFF,0xFF,0xFF,
0xA4,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0xDA,0xFF,
0xFF,0xFF,0xA0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
0x7C,0x7C,0x7C,0x7C,0x2D,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFB,0xED,0xCA,
0x8F,0x2C,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,
0x79,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xF5,0xD0,0xDF,0xF9,0xFF,0xFF,0xFF,0xFF,0x4C,
0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x0C,0x85,0xFF,0xFF,0xFF,0xB8,0x00,0x00,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xEA,0x00,0x00,0xD8,0xFF,
0xFF,0xC8,0x00,0x00,0x00,0x00,0xBC,0xFF,0xFF,0xF4,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x0A,0xE9,0xFF,0xFF,0xD4,0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x06,
0x30,0xB2,0xFF,0xFF,0xFF,0x79,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xC5,0x07,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x88,
0x08,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xF5,0xD0,0xD9,0xFF,0xFF,0xF9,0x31,0x00,0x00,
0x00,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x04,0xCC,0xFF,0xFF,0xD8,0x0A,0x00,0x00,0x00,
0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x2D,0xFA,0xFF,0xFF,0x9B,0x00,0x00,0x00,0xD8,0xFF,
0xFF,0xC8,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0x53,0x00,0x00,0xD8,0xFF,0xFF,0xC8,
0x00,0x00,0x00,0x05,0xD1,0xFF,0xFF,0xEE,0x1C,0x00,0xD8,0xFF,0xFF,0xC8,0x00,0x00,
0x00,0x00,0x32,0xFB,0xFF,0xFF,0xC0,0x02,0xD8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x84,0xFF,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x2B,0x99,0xD9,0xF6,0xFA,0xE6,
0xB8,0x75,0x21,0x00,0x00,0x64,0xFA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF4,0x0C,
0x2B,0xFB,0xFF,0xFF,0xFF,0xE0,0xD9,0xF9,0xFF,0xFF,0x99,0x00,0x89,0xFF,0xFF,0xFE,
0x49,0x00,0x00,0x07,0x50,0xAF,0x2D,0x00,0xAC,0xFF,0xFF,0xE6,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xA0,0xFF,0xFF,0xFF,0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x57,0xFF,0xFF,0xFF,0xFE,0xA3,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0xFF,
0xFF,0xFF,0xFC,0xA2,0x21,0x00,0x00,0x00,0x00,0x0B,0x9F,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF6,0x6A,0x00,0x00,0x00,0x00,0x00,0x3E,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF,0x6A,0x00,
0x00,0x00,0x00,0x00,0x00,0x3F,0xC6,0xFF,0xFF,0xFF,0xEE,0x08,0x00,0x00,0x00,0x00,
0x00,0x00,0x02,0xA7,0xFF,0xFF,0xFF,0x32,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x55,
0xFF,0xFF,0xFF,0x3A,0xDC,0xA8,0x4A,0x0A,0x00,0x00,0x0F,0xB8,0xFF,0xFF,0xFB,0x12,
0xE4,0xFF,0xFF,0xFA,0xDE,0xD8,0xF6,0xFF,0xFF,0xFF,0x9F,0x00,0xE4,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xB9,0x0B,0x00,0x2A,0x7C,0xC1,0xDE,0xF5,0xF8,0xE2,0xAF,
0x54,0x01,0x00,0x00,0x84,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x6C,0x84,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x6C,
0x6B,0xD0,0xD0,0xD0,0xD0,0xF9,0xFF,0xFF,0xF4,0xD0,0xD0,0xD0,0xD0,0x57,0x00,0x00,
0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,
0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,
0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,
0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,
0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,0xC4,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xF4,0xFF,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,
0xFF,0xFF,0x1C,0xF4,0xFF,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,
0xFF,0x1C,0xF4,0xFF,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,
0x1C,0xF4,0xFF,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0x1C,
0xF4,0xFF,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0x1C,0xF4,
0xFF,0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0x1C,0xF4,0xFF,
0xFF,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0x1C,0xF4,0xFF,0xFF,
0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0x1C,0xF4,0xFF,0xFF,0xA8,
0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0x1C,0xF4,0xFF,0xFF,0xA8,0x00,
0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0x1C,0xF3,0xFF,0xFF,0xAB,0x00,0x00,
0x00,0x00,0x00,0x00,0x88,0xFF,0xFF,0xFF,0x1B,0xE5,0xFF,0xFF,0xC3,0x00,0x00,0x00,
0x00,0x00,0x00,0xA2,0xFF,0xFF,0xFF,0x08,0xBD,0xFF,0xFF,0xF9,0x18,0x00,0x00,0x00,
0x00,0x0B,0xE9,0xFF,0xFF,0xE0,0x00,0x68,0xFF,0xFF,0xFF,0xD1,0x43,0x0D,0x09,0x35,
0xC3,0xFF,0xFF,0xFF,0x84,0x00,0x06,0xD0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,
0xFF,0xFF,0xDB,0x0F,0x00,0x00,0x1B,0xCA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xCB,0x24,0x00,0x00,0x00,0x00,0x04,0x5A,0xB0,0xE3,0xF8,0xF4,0xDD,0xAE,0x57,0x04,
0x00,0x00,0x00,0x00,0xD4,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3D,
0xFF,0xFF,0xFF,0x6C,0x7D,0xFF,0xFF,0xFF,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x8F,
0xFF,0xFF,0xFC,0x17,0x25,0xFF,0xFF,0xFF,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,
0xFF,0xFF,0xBC,0x00,0x00,0xCE,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x33,0xFF,
0xFF,0xFF,0x64,0x00,0x00,0x76,0xFF,0xFF,0xFE,0x1A,0x00,0x00,0x00,0x00,0x84,0xFF,
0xFF,0xFA,0x12,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x6B,0x00,0x00,0x00,0x00,0xD6,0xFF,
0xFF,0xB5,0x00,0x00,0x00,0x00,0xC7,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x27,0xFF,0xFF,
0xFF,0x5D,0x00,0x00,0x00,0x00,0x70,0xFF,0xFF,0xFB,0x12,0x00,0x00,0x7A,0xFF,0xFF,
0xF7,0x0D,0x00,0x00,0x00,0x00,0x1A,0xFD,0xFF,0xFF,0x5F,0x00,0x00,0xCB,0xFF,0xFF,
0xAD,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,0xFF,0xFF,0xB0,0x00,0x1D,0xFF,0xFF,0xFF,
0x56,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0xFF,0xFF,0xF5,0x06,0x6D,0xFF,0xFF,0xF4,
0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0xFC,0xFF,0xFF,0x40,0xB2,0xFF,0xFF,0xA6,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBA,0xFF,0xFF,0x83,0xEE,0xFF,0xFF,0x4E,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0xFF,0xFF,0xDA,0xFF,0xFF,0xF0,0x06,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xFA,0xFF,0xFF,0xFF,0xFF,0x9F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB4,0xFF,0xFF,0xFF,0xFF,0x47,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0xFF,0xFF,0xFF,0xEB,0x04,0x00,
0x00,0x00,0x00,0x00,0xDF,0xFF,0xFF,0xB2,0x00,0x00,0x00,0x00,0x00,0x3E,0xFF,0xFF,
0xFF,0x71,0x00,0x00,0x00,0x00,0x00,0x7E,0xFF,0xFF,0xFE,0x14,0x9E,0xFF,0xFF,0xEC,
0x01,0x00,0x00,0x00,0x00,0x81,0xFF,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x00,0x00,0xBA,
0xFF,0xFF,0xD1,0x00,0x5C,0xFF,0xFF,0xFF,0x2A,0x00,0x00,0x00,0x00,0xC4,0xFF,0xFF,
0xFF,0xF2,0x04,0x00,0x00,0x00,0x03,0xF2,0xFF,0xFF,0x8F,0x00,0x1A,0xFF,0xFF,0xFF,
0x66,0x00,0x00,0x00,0x0C,0xFA,0xFF,0xFF,0xFF,0xFF,0x3A,0x00,0x00,0x00,0x32,0xFF,
0xFF,0xFF,0x4E,0x00,0x00,0xD8,0xFF,0xFF,0xA2,0x00,0x00,0x00,0x4A,0xFF,0xFF,0xE1,
0xFF,0xFF,0x7D,0x00,0x00,0x00,0x6E,0xFF,0xFF,0xFC,0x0F,0x00,0x00,0x96,0xFF,0xFF,
0xDF,0x00,0x00,0x00,0x8D,0xFF,0xFF,0x88,0xFF,0xFF,0xC0,0x00,0x00,0x00,0xA9,0xFF,
0xFF,0xCA,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,0x1B,0x00,0x00,0xD1,0xFF,0xFF,0x2B,
0xF5,0xFF,0xF9,0x0A,0x00,0x00,0xE4,0xFF,0xFF,0x89,0x00,0x00,0x00,0x13,0xFE,0xFF,
0xFF,0x57,0x00,0x15,0xFE,0xFF,0xED,0x01,0xBF,0xFF,0xFF,0x47,0x00,0x21,0xFF,0xFF,
0xFF,0x47,0x00,0x00,0x00,0x00,0xD0,0xFF,0xFF,0x93,0x00,0x57,0xFF,0xFF,0xB2,0x00,
0x80,0xFF,0xFF,0x8A,0x00,0x5D,0xFF,0xFF,0xFA,0x0B,0x00,0x00,0x00,0x00,0x8F,0xFF,
0xFF,0xD0,0x00,0x99,0xFF,0xFF,0x6F,0x00,0x3D,0xFF,0xFF,0xCD,0x00,0x97,0xFF,0xFF,
0xC4,0x00,0x00,0x00,0x00,0x00,0x4D,0xFF,0xFF,0xFC,0x09,0xD6,0xFF,0xFF,0x2D,0x00,
0x05,0xF4,0xFF,0xFD,0x0C,0xD1,0xFF,0xFF,0x82,0x00,0x00,0x00,0x00,0x00,0x0E,0xFC,
0xFF,0xFF,0x41,0xFD,0xFF,0xE9,0x01,0x00,0x00,0xB8,0xFF,0xFF,0x43,0xFB,0xFF,0xFF,
0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xC9,0xFF,0xFF,0x9B,0xFF,0xFF,0xA9,0x00,0x00,
0x00,0x75,0xFF,0xFF,0x9B,0xFF,0xFF,0xF7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x87,
0xFF,0xFF,0xE9,0xFF,0xFF,0x67,0x00,0x00,0x00,0x32,0xFF,0xFF,0xE9,0xFF,0xFF,0xBD,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0xFF,0xFF,0xFF,0xFF,0xFF,0x25,0x00,0x00,
0x00,0x02,0xED,0xFF,0xFF,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,
0xF9,0xFF,0xFF,0xFF,0xE2,0x00,0x00,0x00,0x00,0x00,0xAC,0xFF,0xFF,0xFF,0xFF,0x3A,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,0xFF,0xFF,0xFF,0xA1,0x00,0x00,0x00,
0x00,0x00,0x69,0xFF,0xFF,0xFF,0xF3,0x04,0x00,0x00,0x00,0x00,0x51,0xFF,0xFF,0xFF,
0xAC,0x00,0x00,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xFF,0x46,0x00,0x00,0xAC,0xFF,
0xFF,0xFF,0x46,0x00,0x00,0x00,0x00,0x35,0xFE,0xFF,0xFF,0xA3,0x00,0x00,0x00,0x18,
0xEE,0xFF,0xFF,0xD9,0x06,0x00,0x00,0x01,0xC8,0xFF,0xFF,0xEB,0x14,0x00,0x00,0x00,
0x00,0x61,0xFF,0xFF,0xFF,0x79,0x00,0x00,0x61,0xFF,0xFF,0xFF,0x5D,0x00,0x00,0x00,
0x00,0x00,0x00,0xBC,0xFF,0xFF,0xF5,0x1D,0x0F,0xE9,0xFF,0xFF,0xBA,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x21,0xF5,0xFF,0xFF,0xAD,0x8F,0xFF,0xFF,0xF6,0x22,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x71,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0x75,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xC9,0xFF,0xFF,0xFF,0xFF,0xCE,0x04,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xFF,0xFF,0x62,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0xF8,0xFF,0xFF,0xFF,0xFF,0xDF,
0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xC4,0xFF,0xFF,0xE7,0xFC,0xFF,
0xFF,0x9B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6D,0xFF,0xFF,0xFF,0x4D,0x8E,
0xFF,0xFF,0xFF,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF3,0xFF,0xFF,0xAE,0x00,
0x0C,0xE3,0xFF,0xFF,0xE4,0x10,0x00,0x00,0x00,0x00,0x00,0xB9,0xFF,0xFF,0xF3,0x1C,
0x00,0x00,0x50,0xFF,0xFF,0xFF,0xA4,0x00,0x00,0x00,0x00,0x60,0xFF,0xFF,0xFF,0x70,
0x00,0x00,0x00,0x00,0xB1,0xFF,0xFF,0xFF,0x51,0x00,0x00,0x18,0xEE,0xFF,0xFF,0xCE,
0x03,0x00,0x00,0x00,0x00,0x1E,0xF4,0xFF,0xFF,0xE9,0x15,0x00,0xAD,0xFF,0xFF,0xFD,
0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x00,
0xBB,0xFF,0xFF,0xFF,0x31,0x00,0x00,0x00,0x00,0x00,0x31,0xFF,0xFF,0xFF,0xB1,0x32,
0xFE,0xFF,0xFF,0xB0,0x00,0x00,0x00,0x00,0x00,0xB3,0xFF,0xFF,0xFC,0x28,0x00,0xA6,
0xFF,0xFF,0xFF,0x31,0x00,0x00,0x00,0x35,0xFF,0xFF,0xFF,0x98,0x00,0x00,0x22,0xF9,
0xFF,0xFF,0xB1,0x00,0x00,0x00,0xB6,0xFF,0xFF,0xF3,0x18,0x00,0x00,0x00,0x91,0xFF,
0xFF,0xFF,0x32,0x00,0x38,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x14,0xF2,0xFF,
0xFF,0xB2,0x00,0xBA,0xFF,0xFF,0xE7,0x0C,0x00,0x00,0x00,0x00,0x00,0x7C,0xFF,0xFF,
0xFF,0x6F,0xFF,0xFF,0xFF,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0xE7,0xFF,0xFF,
0xFF,0xFF,0xFF,0xD7,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0xFF,0xFF,
0xFF,0xFF,0x4E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xD9,0xFF,0xFF,0xFF,
0xC1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0xFF,0xFF,0xFF,0x51,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0xFF,0x48,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0xFF,0x48,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0xFF,0x48,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0xFF,0x48,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0xFF,0x48,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x50,0xFF,0xFF,0xFF,0x48,0x00,0x00,0x00,0x00,0x00,0x00,
0x34,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1C,0x34,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1C,0x2A,0xD0,0xD0,0xD0,
0xD0,0xD0,0xD0,0xD0,0xDD,0xFF,0xFF,0xFF,0xDD,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xB0,0xFF,0xFF,0xFD,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,
0xFF,0xFF,0xFF,0x8A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0xF1,0xFF,0xFF,
0xD3,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xBD,0xFF,0xFF,0xFA,0x30,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6D,0xFF,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x26,0xF6,0xFF,0xFF,0xC7,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0xC8,0xFF,0xFF,0xF5,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,
0xFF,0xFF,0xFF,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xFA,0xFF,0xFF,
0xBB,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xD2,0xFF,0xFF,0xEF,0x1C,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0xFF,0xFF,0xFF,0x5C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x37,0xFD,0xFF,0xFF,0xFD,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,0xD0,
0xD0,0x41,0x6C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x50,
0x6C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x50,0x00,0x00,
0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0x58,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0x58,0x50,0xFF,
0xFF,0xF3,0xD0,0xD0,0x47,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,
0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,
0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,
0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,
0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,
0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,
0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x50,0xFF,
0xFF,0xF3,0xD0,0xD0,0x47,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0x58,0x50,0xFF,0xFF,0xFF,
0xFF,0xFF,0x58,0x00,0xAC,0xFF,0xFF,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0xFF,
0xFF,0xED,0x06,0x00,0x00,0x00,0x00,0x00,0x04,0xE7,0xFF,0xFF,0x54,0x00,0x00,0x00,
0x00,0x00,0x00,0x8C,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0xFF,0xFF,
0xFB,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xCB,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,
0x00,0x00,0x6B,0xFF,0xFF,0xD3,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0xF8,0xFF,0xFF,
0x34,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xFF,0xFF,0x94,0x00,0x00,0x00,0x00,0x00,
0x00,0x4A,0xFF,0xFF,0xED,0x06,0x00,0x00,0x00,0x00,0x00,0x03,0xE6,0xFF,0xFF,0x54,
0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x00,0x00,0x00,
0x29,0xFF,0xFF,0xFB,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xC9,0xFF,0xFF,0x74,0x00,
0x00,0x00,0x00,0x00,0x00,0x69,0xFF,0xFF,0xD3,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
0xF8,0xFF,0xFF,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xFF,0xFF,0x94,0x00,0x00,
0x68,0xFF,0xFF,0xFF,0xFF,0xFF,0x44,0x68,0xFF,0xFF,0xFF,0xFF,0xFF,0x44,0x54,0xD0,
0xD0,0xF5,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,
0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,
0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,
0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,
0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,
0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,
0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x00,0x00,0x00,0xC8,0xFF,0xFF,0x44,0x54,0xD0,
0xD0,0xF5,0xFF,0xFF,0x44,0x68,0xFF,0xFF,0xFF,0xFF,0xFF,0x44,0x68,0xFF,0xFF,0xFF,
0xFF,0xFF,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0xFF,0xA3,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xF2,0xFF,0xFD,0x2B,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,0xFF,0xB0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x09,0xE9,0xFF,0xF1,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6B,
0xFF,0xFF,0x44,0xEB,0xFF,0xBE,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xDE,0xFF,0xC4,
0x00,0x75,0xFF,0xFF,0x45,0x00,0x00,0x00,0x00,0x00,0x5A,0xFF,0xFF,0x52,0x00,0x0A,
0xE7,0xFF,0xCB,0x00,0x00,0x00,0x00,0x00,0xD1,0xFF,0xDD,0x02,0x00,0x00,0x6E,0xFF,
0xFF,0x53,0x00,0x00,0x00,0x49,0xFF,0xFF,0x6D,0x00,0x00,0x00,0x07,0xE2,0xFF,0xD6,
0x03,0x00,0x00,0xC1,0xFF,0xEF,0x0B,0x00,0x00,0x00,0x00,0x66,0xFF,0xFF,0x61,0x00,
0x38,0xFF,0xFF,0x89,0x00,0x00,0x00,0x00,0x00,0x04,0xDD,0xFF,0xE1,0x07,0x00,0x00,
0x0A,0xD8,0xD8,0xD8,0xD8,0xD8,0xD8,0xD8,0xD8,0xD8,0xC3,0x0C,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xE8,0x00,0x00,0x03,0x7A,0x80,0x80,0x7F,0x14,0x00,0x00,
0x00,0x3D,0xE7,0xFF,0xFF,0xBB,0x04,0x00,0x00,0x00,0x18,0xBB,0xFF,0xFF,0x9B,0x00,
0x00,0x00,0x00,0x01,0x6F,0xF5,0xFF,0x7D,0x00,0x01,0x48,0x9B,0xD4,0xF2,0xFB,0xE9,
0xB8,0x59,0x01,0x00,0x00,0x8D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA8,0x00,
0x00,0x2A,0xFD,0xFF,0xFD,0xE4,0xDC,0xFF,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x69,0x47,
0x06,0x00,0x00,0x41,0xFE,0xFF,0xFF,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xE2,0xFF,0xFF,0xB1,0x00,0x14,0x7D,0xC3,0xE8,0xF7,0xFC,0xFC,0xFF,0xFF,0xFF,0xB4,
0x2A,0xE9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB4,0xB6,0xFF,0xFF,0xFF,
0x7B,0x1B,0x03,0x00,0xDC,0xFF,0xFF,0xB4,0xF0,0xFF,0xFF,0xC5,0x00,0x00,0x00,0x05,
0xF6,0xFF,0xFF,0xB4,0xF2,0xFF,0xFF,0xDD,0x0B,0x00,0x0D,0x9E,0xFF,0xFF,0xFF,0xB4,
0xC2,0xFF,0xFF,0xFF,0xF2,0xD8,0xF6,0xFF,0xFB,0xFF,0xFF,0xB4,0x46,0xFD,0xFF,0xFF,
0xFF,0xFF,0xFF,0xCB,0x59,0xFF,0xFF,0xB4,0x00,0x37,0xB7,0xEA,0xF6,0xD9,0x84,0x09,
0x06,0xF0,0xFF,0xB4,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,
0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,
0x71,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x69,0x30,
0xB2,0xED,0xF6,0xCC,0x60,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x96,0xF7,0xFF,0xFF,
0xFF,0xFF,0xFF,0x90,0x00,0x00,0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xEB,0xFF,0xFF,
0xFF,0xFF,0x45,0x00,0x20,0xFF,0xFF,0xFF,0xFC,0x4A,0x00,0x00,0x7D,0xFF,0xFF,0xFF,
0xB0,0x00,0x20,0xFF,0xFF,0xFF,0xB2,0x00,0x00,0x00,0x02,0xDB,0xFF,0xFF,0xED,0x00,
0x20,0xFF,0xFF,0xFF,0x84,0x00,0x00,0x00,0x00,0xA2,0xFF,0xFF,0xFF,0x0D,0x20,0xFF,
0xFF,0xFF,0x77,0x00,0x00,0x00,0x00,0x8F,0xFF,0xFF,0xFF,0x18,0x20,0xFF,0xFF,0xFF,
0x8A,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0xFF,0x0C,0x20,0xFF,0xFF,0xFF,0xC0,0x00,
0x00,0x00,0x02,0xDF,0xFF,0xFF,0xEA,0x00,0x20,0xFF,0xFF,0xFF,0xFE,0x57,0x00,0x00,
0x7C,0xFF,0xFF,0xFF,0xAC,0x00,0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xEB,0xEA,0xFF,0xFF,
0xFF,0xFF,0x40,0x00,0x20,0xFF,0xFF,0xFC,0x41,0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,0x88,
0x00,0x00,0x20,0xFF,0xFF,0xC2,0x00,0x2D,0xB5,0xEF,0xF5,0xC8,0x59,0x00,0x00,0x00,
0x00,0x00,0x07,0x6B,0xBE,0xE6,0xFA,0xF1,0xCB,0x81,0x21,0x00,0x22,0xD4,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x57,0x08,0xD1,0xFF,0xFF,0xFF,0xFA,0xDB,0xF3,0xFF,0xEA,
0x06,0x5C,0xFF,0xFF,0xFF,0xB6,0x0E,0x00,0x00,0x31,0x4A,0x00,0xB0,0xFF,0xFF,0xFB,
0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0xD1,0xFF,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xE6,0xFF,0xFF,0xC2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE,0xFF,0xFF,
0xD6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBD,0xFF,0xFF,0xF9,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x7C,0xFF,0xFF,0xFF,0xB1,0x0D,0x00,0x00,0x1F,0x90,0x28,0x17,0xF1,
0xFF,0xFF,0xFF,0xFA,0xD8,0xE4,0xFF,0xFF,0x30,0x00,0x48,0xF3,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x30,0x00,0x00,0x1F,0x8E,0xD4,0xF4,0xFC,0xED,0xC0,0x66,0x04,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x40,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0xFF,0xFF,0xFF,
0x50,0x00,0x00,0x3C,0xB8,0xEF,0xF5,0xCE,0x63,0x2B,0xFF,0xFF,0xFF,0x50,0x00,0x5B,
0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xA1,0xFF,0xFF,0xFF,0x50,0x1B,0xF4,0xFF,0xFF,0xFF,
0xF5,0xD8,0xFA,0xFF,0xFF,0xFF,0xFF,0x50,0x7D,0xFF,0xFF,0xFF,0xAC,0x07,0x00,0x17,
0xD0,0xFF,0xFF,0xFF,0x50,0xBC,0xFF,0xFF,0xF9,0x17,0x00,0x00,0x00,0x55,0xFF,0xFF,
0xFF,0x50,0xDD,0xFF,0xFF,0xCF,0x00,0x00,0x00,0x00,0x1D,0xFF,0xFF,0xFF,0x50,0xE8,
0xFF,0xFF,0xBA,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0x50,0xDE,0xFF,0xFF,0xCD,
0x00,0x00,0x00,0x00,0x19,0xFF,0xFF,0xFF,0x50,0xBD,0xFF,0xFF,0xF6,0x12,0x00,0x00,
0x00,0x4C,0xFF,0xFF,0xFF,0x50,0x80,0xFF,0xFF,0xFF,0xA4,0x06,0x00,0x19,0xCF,0xFF,
0xFF,0xFF,0x50,0x1E,0xF6,0xFF,0xFF,0xFF,0xF5,0xDD,0xFC,0xFF,0xFF,0xFF,0xFF,0x50,
0x00,0x62,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x6E,0xEE,0xFF,0xFF,0x50,0x00,0x00,0x43,
0xBD,0xF3,0xF3,0xC5,0x4D,0x00,0x9A,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x0A,0x6F,
0xC6,0xEA,0xF9,0xE2,0xA4,0x34,0x00,0x00,0x00,0x00,0x21,0xD5,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFD,0x6E,0x00,0x00,0x05,0xCC,0xFF,0xFF,0xFF,0xEE,0xDA,0xF9,0xFF,0xFF,
0xFE,0x41,0x00,0x57,0xFF,0xFF,0xFF,0x7E,0x03,0x00,0x18,0xCC,0xFF,0xFF,0xBB,0x00,
0xAC,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x4F,0xFF,0xFF,0xF8,0x06,0xD1,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1D,0xE5,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x27,0xD3,0xFF,0xFF,0xF2,0xD0,0xD0,0xD0,0xD0,0xD0,
0xD0,0xD0,0xD0,0x20,0xB1,0xFF,0xFF,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x57,0xFF,0xFF,0xFF,0x99,0x11,0x00,0x00,0x00,0x10,0x51,0x34,0x00,0x05,0xC5,
0xFF,0xFF,0xFF,0xFA,0xDD,0xD9,0xED,0xFE,0xFF,0x68,0x00,0x00,0x16,0xC2,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x68,0x00,0x00,0x00,0x01,0x57,0xAE,0xE1,0xF8,0xF9,
0xE4,0xB3,0x59,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x8B,0xD6,0xF5,0xF5,
0xDE,0xB3,0x27,0x00,0x00,0x06,0xD2,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x10,0x00,0x00,
0x52,0xFF,0xFF,0xFF,0xFA,0xD8,0xEE,0xAE,0x00,0x00,0x00,0x7D,0xFF,0xFF,0xFF,0x44,
0x00,0x00,0x0B,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFF,0x09,0x00,0x00,0x00,0x00,0x0F,
0x82,0xF2,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x20,0x00,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x20,0x00,0x6B,0xD0,0xEA,0xFF,0xFF,0xFF,0xD1,0xD0,0xD0,0x1A,0x00,
0x00,0x00,0x8C,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0xFF,0xFF,
0xFF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,
0x00,0x00,0x00,0x8C,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0xFF,
0xFF,0xFF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0xFF,0xFF,0xFF,0x08,0x00,0x00,
0x00,0x00,0x00,0x00,0x8C,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,
0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0xFF,0xFF,0xFF,0x08,0x00,
0x00,0x00,0x00,0x00,0x00,0x8C,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0xB9,0xEF,0xF5,0xCB,0x60,0x00,0xC7,0xFF,0xFF,0x50,0x00,0x5B,0xFD,
0xFF,0xFF,0xFF,0xFF,0xFF,0x94,0xEE,0xFF,0xFF,0x50,0x19,0xF3,0xFF,0xFF,0xFF,0xF5,
0xDE,0xFD,0xFF,0xFF,0xFF,0xFF,0x50,0x7A,0xFF,0xFF,0xFF,0xA4,0x05,0x00,0x1D,0xD2,
0xFF,0xFF,0xFF,0x50,0xBB,0xFF,0xFF,0xF9,0x14,0x00,0x00,0x00,0x49,0xFF,0xFF,0xFF,
0x50,0xDD,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x14,0xFF,0xFF,0xFF,0x50,0xE8,0xFF,
0xFF,0xC2,0x00,0x00,0x00,0x00,0x05,0xFF,0xFF,0xFF,0x50,0xDD,0xFF,0xFF,0xD4,0x00,
0x00,0x00,0x00,0x0D,0xFF,0xFF,0xFF,0x50,0xBD,0xFF,0xFF,0xF8,0x14,0x00,0x00,0x00,
0x39,0xFF,0xFF,0xFF,0x50,0x7E,0xFF,0xFF,0xFF,0xA5,0x06,0x00,0x16,0xC1,0xFF,0xFF,
0xFF,0x50,0x1D,0xF6,0xFF,0xFF,0xFF,0xF5,0xDB,0xFA,0xFF,0xFF,0xFF,0xFF,0x50,0x00,
0x66,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x93,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x49,0xC0,
0xF3,0xF3,0xC3,0x4B,0x3E,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x4F,0xFF,0xFF,0xFF,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0xFF,
0xFF,0xFF,0x31,0x1B,0xA5,0x4E,0x10,0x00,0x00,0x00,0x3A,0xEF,0xFF,0xFF,0xED,0x03,
0x20,0xFF,0xFF,0xFF,0xE8,0xD5,0xE5,0xFF,0xFF,0xFF,0xFF,0x78,0x00,0x20,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x9D,0x02,0x00,0x06,0x64,0xAD,0xD8,0xEA,0xFA,
0xF5,0xDC,0xA4,0x42,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
0xFF,0xFF,0xFF,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,
0x6D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x64,0x30,0xAE,
0xEC,0xF9,0xDE,0x93,0x17,0x00,0x20,0xFF,0xFF,0xFF,0x91,0xF9,0xFF,0xFF,0xFF,0xFF,
0xFF,0xE4,0x1B,0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xEA,0xDD,0xFE,0xFF,0xFF,0xFF,0x97,
0x20,0xFF,0xFF,0xFF,0xFF,0x70,0x01,0x00,0x3F,0xFD,0xFF,0xFF,0xDB,0x20,0xFF,0xFF,
0xFF,0xDA,0x00,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xF3,0x20,0xFF,0xFF,0xFF,0x96,0x00,
0x00,0x00,0x00,0xA0,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x7F,0x00,0x00,0x00,0x00,
0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,
0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,
0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,
0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,
0xFF,0xF8,0x00,0x00,0x0C,0xBE,0xF8,0xDE,0x3E,0x36,0xFF,0xFF,0xFF,0x8D,0x04,0x8E,
0xC8,0xAF,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,
0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,
0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,
0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,
0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,
0x00,0x00,0x00,0x0C,0xBE,0xF8,0xDE,0x3E,0x00,0x00,0x00,0x36,0xFF,0xFF,0xFF,0x8D,
0x00,0x00,0x00,0x04,0x8E,0xC8,0xAF,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x2B,0xFF,0xFF,0xFF,0x72,
0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0x5B,0x82,0xD9,0xE0,0xFF,0xFF,0xFF,0xFC,0x19,
0x88,0xFF,0xFF,0xFF,0xFF,0xFF,0x82,0x00,0x68,0xE6,0xFA,0xEF,0xC6,0x5D,0x00,0x00,
0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,
0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,
0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x15,0xD8,
0xFF,0xFF,0xEE,0x2C,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x0E,0xCE,0xFF,0xFF,0xF5,
0x39,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x09,0xC1,0xFF,0xFF,0xFA,0x48,0x00,0x00,
0x20,0xFF,0xFF,0xFF,0x6E,0x04,0xB3,0xFF,0xFF,0xFE,0x59,0x00,0x00,0x00,0x20,0xFF,
0xFF,0xFF,0x61,0x97,0xFF,0xFF,0xFF,0x6C,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,
0xAB,0xFF,0xFF,0xFF,0x99,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xE6,0x16,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0xFF,0xF4,0xFB,0xFF,
0xFF,0xBB,0x02,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0xDB,0x2C,0x7B,0xFF,0xFF,0xFF,
0x7E,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x02,0xC0,0xFF,0xFF,0xFC,0x41,
0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x1D,0xEE,0xFF,0xFF,0xE7,0x17,0x00,
0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,0xBC,0x02,0x20,0xFF,
0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xFF,0x7F,0x20,0xFF,0xFF,0xFF,
0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,
0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,
0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,
0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,
0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,0x74,0x20,0xFF,0xFF,0xFF,
0x74,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x20,0xFF,0xFF,0xBB,0x00,0x3E,0xB6,0xEF,
0xF5,0xD4,0x7B,0x06,0x00,0x2E,0xAA,0xEA,0xFA,0xE0,0x96,0x15,0x00,0x20,0xFF,0xFF,
0xF4,0x59,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xB3,0x3D,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,
0xDC,0x0D,0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xE3,0xE6,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF3,0xE0,0xFF,0xFF,0xFF,0xFF,0x6E,0x20,0xFF,0xFF,0xFF,0xFF,0x5D,0x00,0x00,0x8E,
0xFF,0xFF,0xFF,0xFF,0x8A,0x02,0x00,0x67,0xFF,0xFF,0xFF,0xAA,0x20,0xFF,0xFF,0xFF,
0xD3,0x00,0x00,0x00,0x19,0xFF,0xFF,0xFF,0xEA,0x05,0x00,0x00,0x02,0xEF,0xFF,0xFF,
0xBF,0x20,0xFF,0xFF,0xFF,0x93,0x00,0x00,0x00,0x00,0xFB,0xFF,0xFF,0xB5,0x00,0x00,
0x00,0x00,0xD4,0xFF,0xFF,0xC4,0x20,0xFF,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00,0xF8,
0xFF,0xFF,0xA0,0x00,0x00,0x00,0x00,0xD0,0xFF,0xFF,0xC4,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0xFF,0xC4,
0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0x9C,0x00,0x00,0x00,
0x00,0xD0,0xFF,0xFF,0xC4,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0xF8,0xFF,
0xFF,0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0xFF,0xC4,0x20,0xFF,0xFF,0xFF,0x74,0x00,
0x00,0x00,0x00,0xF8,0xFF,0xFF,0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0xFF,0xC4,0x20,
0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0x9C,0x00,0x00,0x00,0x00,
0xD0,0xFF,0xFF,0xC4,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,
0x9C,0x00,0x00,0x00,0x00,0xD0,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x20,0xFF,0xFF,0xBC,
0x00,0x40,0xB2,0xEB,0xFA,0xE0,0x97,0x19,0x00,0x20,0xFF,0xFF,0xF6,0x6C,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xE6,0x1C,0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xE9,0xDD,0xFD,0xFF,
0xFF,0xFF,0x98,0x20,0xFF,0xFF,0xFF,0xFF,0x6B,0x01,0x00,0x3A,0xFC,0xFF,0xFF,0xDB,
0x20,0xFF,0xFF,0xFF,0xD7,0x00,0x00,0x00,0x00,0xBD,0xFF,0xFF,0xF3,0x20,0xFF,0xFF,
0xFF,0x95,0x00,0x00,0x00,0x00,0xA0,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x7E,0x00,
0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,
0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,
0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,
0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,
0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xF8,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,
0x00,0x9C,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x09,0x6C,0xC0,0xED,0xF9,0xE2,
0xB0,0x4D,0x00,0x00,0x00,0x00,0x20,0xD5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA9,
0x08,0x00,0x06,0xD3,0xFF,0xFF,0xFF,0xF8,0xDC,0xFB,0xFF,0xFF,0xFF,0x98,0x00,0x61,
0xFF,0xFF,0xFF,0xA5,0x07,0x00,0x11,0xC2,0xFF,0xFF,0xFF,0x28,0xB1,0xFF,0xFF,0xF8,
0x13,0x00,0x00,0x00,0x32,0xFF,0xFF,0xFF,0x85,0xDA,0xFF,0xFF,0xD4,0x00,0x00,0x00,
0x00,0x00,0xF8,0xFF,0xFF,0xAC,0xE6,0xFF,0xFF,0xC2,0x00,0x00,0x00,0x00,0x00,0xE6,
0xFF,0xFF,0xC2,0xD1,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0xF9,0xFF,0xFF,0xB4,
0xA9,0xFF,0xFF,0xF9,0x15,0x00,0x00,0x00,0x35,0xFF,0xFF,0xFF,0x89,0x50,0xFF,0xFF,
0xFF,0xA7,0x08,0x00,0x12,0xC4,0xFF,0xFF,0xFF,0x38,0x02,0xBD,0xFF,0xFF,0xFF,0xF8,
0xDC,0xFB,0xFF,0xFF,0xFF,0xAD,0x00,0x00,0x15,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xBB,0x0E,0x00,0x00,0x00,0x03,0x61,0xBD,0xE8,0xFA,0xE9,0xB7,0x59,0x02,0x00,
0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xE8,0x00,0x30,0xB2,0xED,0xF6,0xCC,0x60,0x00,
0x00,0x00,0x20,0xFF,0xFF,0xFF,0x6B,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0x90,0x00,0x00,
0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xEA,0xFF,0xFF,0xFF,0xFF,0x45,0x00,0x20,0xFF,
0xFF,0xFF,0xFC,0x4A,0x00,0x00,0x6D,0xFF,0xFF,0xFF,0xB0,0x00,0x20,0xFF,0xFF,0xFF,
0xB2,0x00,0x00,0x00,0x00,0xD5,0xFF,0xFF,0xED,0x00,0x20,0xFF,0xFF,0xFF,0x84,0x00,
0x00,0x00,0x00,0xA0,0xFF,0xFF,0xFF,0x0D,0x20,0xFF,0xFF,0xFF,0x77,0x00,0x00,0x00,
0x00,0x8E,0xFF,0xFF,0xFF,0x18,0x20,0xFF,0xFF,0xFF,0x8A,0x00,0x00,0x00,0x00,0xA1,
0xFF,0xFF,0xFF,0x0C,0x20,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFF,
0xE9,0x00,0x20,0xFF,0xFF,0xFF,0xFE,0x57,0x00,0x00,0x6C,0xFF,0xFF,0xFF,0xAA,0x00,
0x20,0xFF,0xFF,0xFF,0xFF,0xFF,0xEB,0xE9,0xFF,0xFF,0xFF,0xFE,0x3C,0x00,0x20,0xFF,
0xFF,0xFF,0xB3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x20,0xFF,0xFF,0xFF,
0x5C,0x47,0xC1,0xF2,0xF5,0xC6,0x54,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x71,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3D,0xB8,0xF0,0xF4,0xCD,0x63,0x00,0xCA,0xFF,0xFF,0x50,0x00,0x5B,0xFD,
0xFF,0xFF,0xFF,0xFF,0xFF,0x94,0xF3,0xFF,0xFF,0x50,0x1B,0xF4,0xFF,0xFF,0xFF,0xF5,
0xDE,0xFE,0xFF,0xFF,0xFF,0xFF,0x50,0x7D,0xFF,0xFF,0xFF,0xA3,0x05,0x00,0x1C,0xD5,
0xFF,0xFF,0xFF,0x50,0xBC,0xFF,0xFF,0xF9,0x14,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,
0x50,0xDD,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x1D,0xFF,0xFF,0xFF,0x50,0xE8,0xFF,
0xFF,0xC2,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0x50,0xDF,0xFF,0xFF,0xD4,0x00,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x50,0xBE,0xFF,0xFF,0xF8,0x14,0x00,0x00,0x00,
0x48,0xFF,0xFF,0xFF,0x50,0x81,0xFF,0xFF,0xFF,0xA5,0x06,0x00,0x15,0xC9,0xFF,0xFF,
0xFF,0x50,0x20,0xF7,0xFF,0xFF,0xFF,0xF5,0xDC,0xFB,0xFF,0xFF,0xFF,0xFF,0x50,0x00,
0x66,0xFE,0xFF,0xFF,0xFF,0xFF,0xFE,0x86,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x46,0xBE,
0xF3,0xF3,0xC5,0x4B,0x35,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x3F,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xFF,
0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0x50,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x40,0xFF,0xFF,0xFF,0x50,0x00,0x20,0xFF,0xFF,0xB4,0x00,0x29,0xA8,0xEA,
0xFE,0x53,0x20,0xFF,0xFF,0xF1,0x43,0xF4,0xFF,0xFF,0xFF,0x42,0x20,0xFF,0xFF,0xFF,
0xFB,0xFF,0xFE,0xDE,0xDA,0x28,0x20,0xFF,0xFF,0xFF,0xFF,0xAB,0x1B,0x00,0x00,0x00,
0x20,0xFF,0xFF,0xFF,0xD5,0x03,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x88,0x00,
0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,
0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,
0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,
0x74,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,
0x20,0xFF,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x8B,0xD2,
0xEC,0xFB,0xE9,0xBD,0x74,0x14,0x00,0x44,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xB1,0x00,0xC7,0xFF,0xFF,0xFF,0xE5,0xDB,0xFA,0xFF,0xFF,0x4B,0x00,0xE5,0xFF,0xFF,
0xBC,0x00,0x00,0x04,0x3F,0x88,0x02,0x00,0xC0,0xFF,0xFF,0xF5,0x6F,0x0C,0x00,0x00,
0x00,0x00,0x00,0x3F,0xF7,0xFF,0xFF,0xFF,0xF1,0x96,0x2A,0x00,0x00,0x00,0x00,0x2E,
0xB7,0xFF,0xFF,0xFF,0xFF,0xFD,0x9A,0x08,0x00,0x00,0x00,0x00,0x28,0x91,0xF3,0xFF,
0xFF,0xFF,0x93,0x00,0x00,0x00,0x00,0x00,0x00,0x16,0xCF,0xFF,0xFF,0xEF,0x00,0x96,
0x5D,0x14,0x00,0x00,0x02,0xAF,0xFF,0xFF,0xF9,0x00,0xE4,0xFF,0xFF,0xE6,0xD4,0xEC,
0xFF,0xFF,0xFF,0xC2,0x00,0xE4,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x32,0x00,
0x48,0xA0,0xDE,0xF6,0xFD,0xF2,0xD0,0x8C,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
0x80,0x6A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xD4,0x00,0x00,0x00,0x00,
0x00,0x00,0x3E,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x4D,0xDD,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x80,0x66,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x5E,0xD0,
0xF4,0xFF,0xFF,0xF7,0xD0,0xD0,0xD0,0x68,0x00,0x00,0xC0,0xFF,0xFF,0xD4,0x00,0x00,
0x00,0x00,0x00,0x00,0xC0,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,
0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,
0x00,0x00,0xC0,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xD4,
0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFF,0xF3,0x16,0x00,0x00,0x0E,0x00,0x00,
0x85,0xFF,0xFF,0xFF,0xF0,0xCA,0xE3,0xA4,0x00,0x00,0x20,0xF0,0xFF,0xFF,0xFF,0xFF,
0xFF,0xA4,0x00,0x00,0x00,0x2E,0xB1,0xEC,0xFA,0xE8,0xC5,0x58,0x34,0xFF,0xFF,0xFF,
0x60,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFF,0xE4,0x34,0xFF,0xFF,0xFF,0x60,0x00,0x00,
0x00,0x00,0xB0,0xFF,0xFF,0xE4,0x34,0xFF,0xFF,0xFF,0x60,0x00,0x00,0x00,0x00,0xB0,
0xFF,0xFF,0xE4,0x34,0xFF,0xFF,0xFF,0x60,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFF,0xE4,
0x34,0xFF,0xFF,0xFF,0x60,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFF,0xE4,0x34,0xFF,0xFF,
0xFF,0x60,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFF,0xE4,0x34,0xFF,0xFF,0xFF,0x60,0x00,
0x00,0x00,0x00,0xB7,0xFF,0xFF,0xE4,0x34,0xFF,0xFF,0xFF,0x61,0x00,0x00,0x00,0x00,
0xCC,0xFF,0xFF,0xE4,0x30,0xFF,0xFF,0xFF,0x76,0x00,0x00,0x00,0x0B,0xF6,0xFF,0xFF,
0xE4,0x19,0xFF,0xFF,0xFF,0xC7,0x03,0x00,0x00,0x6E,0xFF,0xFF,0xFF,0xE4,0x00,0xD6,
0xFF,0xFF,0xFF,0xCD,0x94,0xB6,0xFE,0xFF,0xFF,0xFF,0xE4,0x00,0x47,0xFB,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFC,0x9B,0xFF,0xFF,0xE4,0x00,0x00,0x35,0xAE,0xEB,0xFB,0xE7,0xAC,
0x38,0x07,0xF5,0xFF,0xE4,0x00,0x00,0x00,0xCF,0xFF,0xFF,0xE8,0x03,0x00,0x00,0x00,
0x00,0x44,0xFF,0xFF,0xFF,0x76,0x6D,0xFF,0xFF,0xFF,0x42,0x00,0x00,0x00,0x00,0x9B,
0xFF,0xFF,0xFB,0x18,0x12,0xF8,0xFF,0xFF,0x99,0x00,0x00,0x00,0x05,0xED,0xFF,0xFF,
0xB1,0x00,0x00,0xA9,0xFF,0xFF,0xEB,0x04,0x00,0x00,0x49,0xFF,0xFF,0xFF,0x4F,0x00,
0x00,0x47,0xFF,0xFF,0xFF,0x47,0x00,0x00,0xA0,0xFF,0xFF,0xE8,0x04,0x00,0x00,0x02,
0xE2,0xFF,0xFF,0x9E,0x00,0x06,0xF0,0xFF,0xFF,0x8A,0x00,0x00,0x00,0x00,0x82,0xFF,
0xFF,0xEF,0x06,0x4E,0xFF,0xFF,0xFF,0x28,0x00,0x00,0x00,0x00,0x21,0xFE,0xFF,0xFF,
0x48,0xA2,0xFF,0xFF,0xC5,0x00,0x00,0x00,0x00,0x00,0x00,0xBE,0xFF,0xFF,0x86,0xE6,
0xFF,0xFF,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0xFF,0xFF,0xC1,0xFF,0xFF,0xF3,
0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0xF0,0xFF,0xFE,0xFF,0xFF,0x9D,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0xFF,0xFF,0x3B,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x35,0xFF,0xFF,0xFF,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x9F,0xFF,0xFF,0xEB,0x01,0x00,0x00,0x00,0xCD,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,
0x57,0xFF,0xFF,0xFF,0x26,0x56,0xFF,0xFF,0xFF,0x2F,0x00,0x00,0x12,0xFD,0xFF,0xFF,
0xFF,0xA1,0x00,0x00,0x00,0x9D,0xFF,0xFF,0xDC,0x00,0x11,0xFC,0xFF,0xFF,0x72,0x00,
0x00,0x52,0xFF,0xFF,0xF5,0xFF,0xE0,0x00,0x00,0x00,0xE2,0xFF,0xFF,0x92,0x00,0x00,
0xC4,0xFF,0xFF,0xB5,0x00,0x00,0x94,0xFF,0xFB,0x92,0xFF,0xFF,0x1F,0x00,0x28,0xFF,
0xFF,0xFF,0x48,0x00,0x00,0x7B,0xFF,0xFF,0xF3,0x04,0x00,0xD6,0xFF,0xCA,0x4A,0xFF,
0xFF,0x5E,0x00,0x6D,0xFF,0xFF,0xF5,0x08,0x00,0x00,0x31,0xFF,0xFF,0xFF,0x3A,0x18,
0xFF,0xFF,0x8F,0x0E,0xFD,0xFF,0x9D,0x00,0xB2,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x01,
0xE7,0xFF,0xFF,0x73,0x56,0xFF,0xFF,0x53,0x00,0xD1,0xFF,0xDA,0x00,0xEC,0xFF,0xFF,
0x69,0x00,0x00,0x00,0x00,0x9F,0xFF,0xFF,0xA3,0x87,0xFF,0xFF,0x17,0x00,0x95,0xFF,
0xFE,0x2C,0xFF,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,0x56,0xFF,0xFF,0xCB,0xB2,0xFF,
0xDC,0x00,0x00,0x5A,0xFF,0xFF,0x80,0xFF,0xFF,0xD5,0x00,0x00,0x00,0x00,0x00,0x10,
0xFC,0xFF,0xF2,0xD5,0xFF,0x9F,0x00,0x00,0x22,0xFF,0xFF,0xCA,0xFF,0xFF,0x8B,0x00,
0x00,0x00,0x00,0x00,0x00,0xC3,0xFF,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0xE9,0xFF,
0xFF,0xFF,0xFF,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x7A,0xFF,0xFF,0xFF,0xFF,0x26,
0x00,0x00,0x00,0xB1,0xFF,0xFF,0xFF,0xF1,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x31,
0xFF,0xFF,0xFF,0xE9,0x00,0x00,0x00,0x00,0x78,0xFF,0xFF,0xFF,0xAD,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x53,0xFF,0xFF,0xFF,0xB2,0x00,0x00,0x00,0x02,0xCC,0xFF,0xFF,
0xFD,0x3C,0x00,0xAA,0xFF,0xFF,0xFF,0x4E,0x00,0x00,0x6D,0xFF,0xFF,0xFF,0x8D,0x00,
0x00,0x15,0xEA,0xFF,0xFF,0xE0,0x0A,0x19,0xF1,0xFF,0xFF,0xD7,0x08,0x00,0x00,0x00,
0x56,0xFF,0xFF,0xFF,0x88,0xA9,0xFF,0xFF,0xFC,0x37,0x00,0x00,0x00,0x00,0x00,0xAC,
0xFF,0xFF,0xFC,0xFF,0xFF,0xFF,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x16,0xEC,0xFF,
0xFF,0xFF,0xFF,0xD4,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9E,0xFF,0xFF,0xFF,
0xFF,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0xFC,0xFF,0xFF,0xFF,0xFF,0xEF,
0x1B,0x00,0x00,0x00,0x00,0x00,0x07,0xD6,0xFF,0xFF,0xEA,0xF7,0xFF,0xFF,0xB7,0x00,
0x00,0x00,0x00,0x00,0x89,0xFF,0xFF,0xFF,0x5A,0x7B,0xFF,0xFF,0xFF,0x64,0x00,0x00,
0x00,0x37,0xFC,0xFF,0xFF,0xBA,0x00,0x05,0xD5,0xFF,0xFF,0xF2,0x1E,0x00,0x08,0xD7,
0xFF,0xFF,0xF7,0x23,0x00,0x00,0x3D,0xFE,0xFF,0xFF,0xBB,0x01,0x8A,0xFF,0xFF,0xFF,
0x7B,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0xFF,0x69,0x00,0x00,0xCE,0xFF,0xFF,0xFC,
0x15,0x00,0x00,0x00,0x00,0x59,0xFF,0xFF,0xFF,0x78,0x69,0xFF,0xFF,0xFF,0x66,0x00,
0x00,0x00,0x00,0xAC,0xFF,0xFF,0xFD,0x1B,0x0F,0xF5,0xFF,0xFF,0xBB,0x00,0x00,0x00,
0x09,0xF5,0xFF,0xFF,0xB9,0x00,0x00,0x9F,0xFF,0xFF,0xFB,0x14,0x00,0x00,0x51,0xFF,
0xFF,0xFF,0x59,0x00,0x00,0x3A,0xFF,0xFF,0xFF,0x65,0x00,0x00,0xA4,0xFF,0xFF,0xF1,
0x09,0x00,0x00,0x00,0xD5,0xFF,0xFF,0xBA,0x00,0x06,0xF0,0xFF,0xFF,0x9B,0x00,0x00,
0x00,0x00,0x70,0xFF,0xFF,0xFB,0x13,0x49,0xFF,0xFF,0xFF,0x3B,0x00,0x00,0x00,0x00,
0x13,0xF8,0xFF,0xFF,0x61,0x9A,0xFF,0xFF,0xDB,0x00,0x00,0x00,0x00,0x00,0x00,0xA7,
0xFF,0xFF,0xA1,0xE1,0xFF,0xFF,0x7D,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,
0xD7,0xFF,0xFF,0xFE,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xDC,0xFF,0xFF,0xFF,
0xFF,0xBE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xFF,0xFF,0xFF,0xFF,0x5F,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0xFB,0xFF,0xFF,0xF3,0x0B,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xE7,0xFF,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x52,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x2F,0xE7,0xFF,0xFF,0xD5,0x01,0x00,0x00,0x00,0x00,0x00,0x2C,0xD9,0xDC,0xFD,
0xFF,0xFF,0xFE,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xFF,0xFF,0xFF,0xFF,0xFE,
0x71,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0xEA,0xFC,0xEC,0xB0,0x3B,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xC8,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC8,0x00,0xCC,
0xD0,0xD0,0xD0,0xD0,0xE0,0xFF,0xFF,0xFF,0xA3,0x00,0x00,0x00,0x00,0x00,0x05,0xC8,
0xFF,0xFF,0xDF,0x10,0x00,0x00,0x00,0x00,0x00,0x8F,0xFF,0xFF,0xF9,0x34,0x00,0x00,
0x00,0x00,0x00,0x51,0xFF,0xFF,0xFF,0x6C,0x00,0x00,0x00,0x00,0x00,0x22,0xF0,0xFF,
0xFF,0xAA,0x00,0x00,0x00,0x00,0x00,0x07,0xCD,0xFF,0xFF,0xDA,0x0E,0x00,0x00,0x00,
0x00,0x00,0x96,0xFF,0xFF,0xF7,0x2F,0x00,0x00,0x00,0x00,0x00,0x58,0xFF,0xFF,0xFF,
0x65,0x00,0x00,0x00,0x00,0x00,0x24,0xF2,0xFF,0xFF,0xFD,0xD0,0xD0,0xD0,0xD0,0xD0,
0xCC,0x5C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x5C,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x40,0xAC,0xDE,0xF3,
0x7E,0x00,0x00,0x00,0x3A,0xFC,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x8F,0xFF,0xFF,
0xFF,0xF0,0x6B,0x00,0x00,0x00,0xA3,0xFF,0xFF,0xB9,0x05,0x00,0x00,0x00,0x00,0xA4,
0xFF,0xFF,0x77,0x00,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,
0x00,0xA4,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0xC2,0xFF,0xFF,0x73,0x00,0x00,
0x04,0x1E,0x7E,0xFF,0xFF,0xFF,0x51,0x00,0x00,0xA4,0xFF,0xFF,0xFF,0xFF,0xA8,0x02,
0x00,0x00,0xA4,0xFF,0xFF,0xF0,0x75,0x05,0x00,0x00,0x00,0x8A,0xEE,0xFF,0xFF,0xFF,
0xCF,0x0B,0x00,0x00,0x00,0x01,0x52,0xF8,0xFF,0xFF,0x5C,0x00,0x00,0x00,0x00,0x00,
0xB8,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x74,0x00,0x00,0x00,
0x00,0x00,0xA4,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,0x7B,0x00,
0x00,0x00,0x00,0x00,0xA1,0xFF,0xFF,0xCE,0x24,0x02,0x00,0x00,0x00,0x86,0xFF,0xFF,
0xFF,0xFF,0x80,0x00,0x00,0x00,0x28,0xF1,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,
0x1E,0x80,0xB1,0xC5,0x66,0x00,0x00,0x00,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,
0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,
0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,
0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,
0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,0xAC,0xFF,0xE4,
0x0B,0xF9,0xEC,0xC6,0x7B,0x0A,0x00,0x00,0x00,0x00,0x0C,0xFF,0xFF,0xFF,0xFF,0xA8,
0x00,0x00,0x00,0x00,0x09,0xDE,0xFF,0xFF,0xFF,0xFC,0x05,0x00,0x00,0x00,0x00,0x00,
0x4C,0xFF,0xFF,0xFF,0x17,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x18,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x36,0x00,0x00,0x00,
0x00,0x00,0x00,0xDE,0xFF,0xFF,0xCB,0x3B,0x0D,0x00,0x00,0x00,0x00,0x49,0xEE,0xFF,
0xFF,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x35,0xC2,0xFF,0xFF,0xFF,0x18,0x00,0x00,
0x00,0x6A,0xFD,0xFF,0xFF,0xFA,0xDF,0x13,0x00,0x00,0x00,0xE9,0xFF,0xFF,0xAC,0x13,
0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x2C,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x18,0x00,0x00,0x00,
0x00,0x00,0x08,0xFF,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x0D,0x75,0xFF,0xFF,0xFF,
0x15,0x00,0x00,0x00,0x0C,0xFF,0xFF,0xFF,0xFF,0xF6,0x02,0x00,0x00,0x00,0x0C,0xFF,
0xFF,0xFF,0xFF,0x8A,0x00,0x00,0x00,0x00,0x09,0xCA,0xBD,0x99,0x4F,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x40,0xBD,0xF4,0xF6,0xDC,0x9C,0x47,0x06,0x00,0x00,0x46,0x8B,0xF6,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xF7,0xDA,0xE5,0xFF,0xAC,0xF8,0xFE,0xDA,0xE2,0xFE,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xAB,0xB1,0x23,0x00,0x00,0x12,0x60,0xAF,0xE4,0xF9,0xEA,0xA3,0x1F,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
leRasterFont NotoSans_Bold24 =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoSans_Bold24_glyphs, // glyph table variable pointer
18268, // data size
},
LE_RASTER_FONT,
},
25,
18,
LE_FONT_BPP_8, // bits per pixel
NotoSans_Bold24_data, // kerning table
};
/*********************************
* Legato Font Asset
* Name: NotoSansCJKsc_Bold16
* Height: 23
* Baseline: 17
* Style: Antialias
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoSansCJKsc_Bold16_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x04,0x00,0x0E,0x00,0x07,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x08,0x00,
0x07,0x00,0x0A,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x08,0x00,0x38,0x00,0x00,0x00,
0x23,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,
0x70,0x00,0x00,0x00,0x24,0x00,0x0A,0x00,0x12,0x00,0x0B,0x00,0x00,0x00,0x10,0x00,
0x00,0x00,0x0A,0x00,0xFC,0x00,0x00,0x00,0x25,0x00,0x11,0x00,0x0E,0x00,0x11,0x00,
0x00,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,0xB0,0x01,0x00,0x00,0x26,0x00,0x0D,0x00,
0x0E,0x00,0x0D,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,0xA0,0x02,0x00,0x00,
0x27,0x00,0x04,0x00,0x07,0x00,0x06,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x04,0x00,
0x58,0x03,0x00,0x00,0x28,0x00,0x05,0x00,0x13,0x00,0x07,0x00,0x01,0x00,0x0F,0x00,
0x00,0x00,0x05,0x00,0x74,0x03,0x00,0x00,0x29,0x00,0x06,0x00,0x13,0x00,0x07,0x00,
0x00,0x00,0x0F,0x00,0x00,0x00,0x06,0x00,0xD4,0x03,0x00,0x00,0x2A,0x00,0x09,0x00,
0x08,0x00,0x09,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x09,0x00,0x48,0x04,0x00,0x00,
0x2B,0x00,0x0A,0x00,0x0A,0x00,0x0B,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,
0x90,0x04,0x00,0x00,0x2C,0x00,0x05,0x00,0x08,0x00,0x06,0x00,0x00,0x00,0x04,0x00,
0x00,0x00,0x05,0x00,0xF4,0x04,0x00,0x00,0x2D,0x00,0x06,0x00,0x02,0x00,0x07,0x00,
0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x1C,0x05,0x00,0x00,0x2E,0x00,0x04,0x00,
0x04,0x00,0x06,0x00,0x01,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x28,0x05,0x00,0x00,
0x2F,0x00,0x07,0x00,0x12,0x00,0x07,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x07,0x00,
0x38,0x05,0x00,0x00,0x30,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0A,0x00,0xB8,0x05,0x00,0x00,0x31,0x00,0x09,0x00,0x0E,0x00,0x0B,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x09,0x00,0x44,0x06,0x00,0x00,0x32,0x00,0x0A,0x00,
0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0xC4,0x06,0x00,0x00,
0x33,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,
0x50,0x07,0x00,0x00,0x34,0x00,0x0B,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0B,0x00,0xDC,0x07,0x00,0x00,0x35,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,
0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0x78,0x08,0x00,0x00,0x36,0x00,0x0A,0x00,
0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0x04,0x09,0x00,0x00,
0x37,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,
0x90,0x09,0x00,0x00,0x38,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0A,0x00,0x1C,0x0A,0x00,0x00,0x39,0x00,0x0A,0x00,0x0E,0x00,0x0B,0x00,
0x00,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0xA8,0x0A,0x00,0x00,0x3A,0x00,0x04,0x00,
0x0B,0x00,0x06,0x00,0x01,0x00,0x0B,0x00,0x00,0x00,0x04,0x00,0x34,0x0B,0x00,0x00,
0x3B,0x00,0x05,0x00,0x0E,0x00,0x06,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x05,0x00,
0x60,0x0B,0x00,0x00,0x3C,0x00,0x0A,0x00,0x09,0x00,0x0B,0x00,0x00,0x00,0x0B,0x00,
0x00,0x00,0x0A,0x00,0xA8,0x0B,0x00,0x00,0x3D,0x00,0x0A,0x00,0x07,0x00,0x0B,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0x04,0x0C,0x00,0x00,0x3E,0x00,0x0A,0x00,
0x09,0x00,0x0B,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x0A,0x00,0x4C,0x0C,0x00,0x00,
0x3F,0x00,0x09,0x00,0x0F,0x00,0x09,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x09,0x00,
0xA8,0x0C,0x00,0x00,0x40,0x00,0x11,0x00,0x12,0x00,0x12,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x11,0x00,0x30,0x0D,0x00,0x00,0x41,0x00,0x0D,0x00,0x0E,0x00,0x0C,0x00,
0xFF,0xFF,0x0E,0x00,0x00,0x00,0x0D,0x00,0x64,0x0E,0x00,0x00,0x42,0x00,0x0B,0x00,
0x0E,0x00,0x0C,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,0x1C,0x0F,0x00,0x00,
0x43,0x00,0x0C,0x00,0x0E,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,
0xB8,0x0F,0x00,0x00,0x44,0x00,0x0B,0x00,0x0E,0x00,0x0D,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x0B,0x00,0x60,0x10,0x00,0x00,0x45,0x00,0x09,0x00,0x0E,0x00,0x0B,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x09,0x00,0xFC,0x10,0x00,0x00,0x46,0x00,0x09,0x00,
0x0E,0x00,0x0B,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x09,0x00,0x7C,0x11,0x00,0x00,
0x47,0x00,0x0C,0x00,0x0E,0x00,0x0D,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,
0xFC,0x11,0x00,0x00,0x48,0x00,0x0B,0x00,0x0E,0x00,0x0E,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x0B,0x00,0xA4,0x12,0x00,0x00,0x49,0x00,0x04,0x00,0x0E,0x00,0x06,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x04,0x00,0x40,0x13,0x00,0x00,0x4A,0x00,0x09,0x00,
0x0E,0x00,0x0A,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x09,0x00,0x78,0x13,0x00,0x00,
0x4B,0x00,0x0C,0x00,0x0E,0x00,0x0C,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,
0xF8,0x13,0x00,0x00,0x4C,0x00,0x09,0x00,0x0E,0x00,0x0A,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x09,0x00,0xA0,0x14,0x00,0x00,0x4D,0x00,0x0D,0x00,0x0E,0x00,0x0F,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,0x20,0x15,0x00,0x00,0x4E,0x00,0x0B,0x00,
0x0E,0x00,0x0D,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,0xD8,0x15,0x00,0x00,
0x4F,0x00,0x0D,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,
0x74,0x16,0x00,0x00,0x50,0x00,0x0B,0x00,0x0E,0x00,0x0C,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x0B,0x00,0x2C,0x17,0x00,0x00,0x51,0x00,0x0E,0x00,0x12,0x00,0x0E,0x00,
0x00,0x00,0x0E,0x00,0x00,0x00,0x0E,0x00,0xC8,0x17,0x00,0x00,0x52,0x00,0x0B,0x00,
0x0E,0x00,0x0C,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,0xC4,0x18,0x00,0x00,
0x53,0x00,0x0B,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,
0x60,0x19,0x00,0x00,0x54,0x00,0x0B,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0B,0x00,0xFC,0x19,0x00,0x00,0x55,0x00,0x0B,0x00,0x0E,0x00,0x0D,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,0x98,0x1A,0x00,0x00,0x56,0x00,0x0D,0x00,
0x0E,0x00,0x0B,0x00,0xFF,0xFF,0x0E,0x00,0x00,0x00,0x0D,0x00,0x34,0x1B,0x00,0x00,
0x57,0x00,0x11,0x00,0x0E,0x00,0x10,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x11,0x00,
0xEC,0x1B,0x00,0x00,0x58,0x00,0x0C,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0C,0x00,0xDC,0x1C,0x00,0x00,0x59,0x00,0x0C,0x00,0x0E,0x00,0x0A,0x00,
0xFF,0xFF,0x0E,0x00,0x00,0x00,0x0C,0x00,0x84,0x1D,0x00,0x00,0x5A,0x00,0x0B,0x00,
0x0E,0x00,0x0B,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,0x2C,0x1E,0x00,0x00,
0x5B,0x00,0x05,0x00,0x12,0x00,0x07,0x00,0x01,0x00,0x0F,0x00,0x00,0x00,0x05,0x00,
0xC8,0x1E,0x00,0x00,0x5C,0x00,0x07,0x00,0x12,0x00,0x07,0x00,0x00,0x00,0x0F,0x00,
0x00,0x00,0x07,0x00,0x24,0x1F,0x00,0x00,0x5D,0x00,0x05,0x00,0x12,0x00,0x07,0x00,
0x00,0x00,0x0F,0x00,0x00,0x00,0x05,0x00,0xA4,0x1F,0x00,0x00,0x5E,0x00,0x09,0x00,
0x09,0x00,0x0B,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x09,0x00,0x00,0x20,0x00,0x00,
0x5F,0x00,0x0A,0x00,0x02,0x00,0x0A,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x0A,0x00,
0x54,0x20,0x00,0x00,0x60,0x00,0x06,0x00,0x05,0x00,0x0B,0x00,0x01,0x00,0x11,0x00,
0x00,0x00,0x06,0x00,0x68,0x20,0x00,0x00,0x61,0x00,0x0A,0x00,0x0A,0x00,0x0B,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0x88,0x20,0x00,0x00,0x62,0x00,0x0A,0x00,
0x0F,0x00,0x0C,0x00,0x01,0x00,0x0F,0x00,0x00,0x00,0x0A,0x00,0xEC,0x20,0x00,0x00,
0x63,0x00,0x09,0x00,0x0A,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x84,0x21,0x00,0x00,0x64,0x00,0x0B,0x00,0x0F,0x00,0x0C,0x00,0x00,0x00,0x0F,0x00,
0x00,0x00,0x0B,0x00,0xE0,0x21,0x00,0x00,0x65,0x00,0x0A,0x00,0x0A,0x00,0x0A,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0x88,0x22,0x00,0x00,0x66,0x00,0x08,0x00,
0x0F,0x00,0x07,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x08,0x00,0xEC,0x22,0x00,0x00,
0x67,0x00,0x0B,0x00,0x0E,0x00,0x0B,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,
0x64,0x23,0x00,0x00,0x68,0x00,0x0A,0x00,0x0F,0x00,0x0C,0x00,0x01,0x00,0x0F,0x00,
0x00,0x00,0x0A,0x00,0x00,0x24,0x00,0x00,0x69,0x00,0x04,0x00,0x0F,0x00,0x05,0x00,
0x01,0x00,0x0F,0x00,0x00,0x00,0x04,0x00,0x98,0x24,0x00,0x00,0x6A,0x00,0x06,0x00,
0x13,0x00,0x05,0x00,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x06,0x00,0xD4,0x24,0x00,0x00,
0x6B,0x00,0x0A,0x00,0x0F,0x00,0x0B,0x00,0x01,0x00,0x0F,0x00,0x00,0x00,0x0A,0x00,
0x48,0x25,0x00,0x00,0x6C,0x00,0x05,0x00,0x0F,0x00,0x06,0x00,0x01,0x00,0x0F,0x00,
0x00,0x00,0x05,0x00,0xE0,0x25,0x00,0x00,0x6D,0x00,0x10,0x00,0x0A,0x00,0x11,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x10,0x00,0x2C,0x26,0x00,0x00,0x6E,0x00,0x0A,0x00,
0x0A,0x00,0x0C,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0xCC,0x26,0x00,0x00,
0x6F,0x00,0x0B,0x00,0x0A,0x00,0x0B,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,
0x30,0x27,0x00,0x00,0x70,0x00,0x0A,0x00,0x0E,0x00,0x0C,0x00,0x01,0x00,0x0A,0x00,
0x00,0x00,0x0A,0x00,0xA0,0x27,0x00,0x00,0x71,0x00,0x0B,0x00,0x0E,0x00,0x0C,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,0x2C,0x28,0x00,0x00,0x72,0x00,0x07,0x00,
0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0xC8,0x28,0x00,0x00,
0x73,0x00,0x09,0x00,0x0A,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x10,0x29,0x00,0x00,0x74,0x00,0x08,0x00,0x0D,0x00,0x08,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x08,0x00,0x6C,0x29,0x00,0x00,0x75,0x00,0x0A,0x00,0x0A,0x00,0x0B,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0xD4,0x29,0x00,0x00,0x76,0x00,0x0B,0x00,
0x0A,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,0x38,0x2A,0x00,0x00,
0x77,0x00,0x10,0x00,0x0A,0x00,0x10,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x10,0x00,
0xA8,0x2A,0x00,0x00,0x78,0x00,0x0A,0x00,0x0A,0x00,0x0A,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x0A,0x00,0x48,0x2B,0x00,0x00,0x79,0x00,0x0B,0x00,0x0E,0x00,0x0A,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x0B,0x00,0xAC,0x2B,0x00,0x00,0x7A,0x00,0x09,0x00,
0x0A,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x48,0x2C,0x00,0x00,
0x7B,0x00,0x06,0x00,0x12,0x00,0x07,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x06,0x00,
0xA4,0x2C,0x00,0x00,0x7C,0x00,0x03,0x00,0x15,0x00,0x05,0x00,0x01,0x00,0x10,0x00,
0x00,0x00,0x03,0x00,0x10,0x2D,0x00,0x00,0x7D,0x00,0x07,0x00,0x12,0x00,0x07,0x00,
0x00,0x00,0x0F,0x00,0x00,0x00,0x07,0x00,0x50,0x2D,0x00,0x00,0x7E,0x00,0x0A,0x00,
0x04,0x00,0x0B,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0xD0,0x2D,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoSansCJKsc_Bold16_glyphs[11768] =
{
0x00,0xEB,0xEB,0x96,0x00,0xF6,0xFF,0x99,0x00,0xEC,0xFF,0x8F,0x00,0xDE,0xFF,0x81,
0x00,0xD0,0xFF,0x73,0x00,0xC1,0xFF,0x64,0x00,0xB3,0xFF,0x56,0x00,0xA5,0xFF,0x48,
0x00,0x96,0xFF,0x39,0x00,0x1F,0x37,0x0A,0x00,0x2F,0x64,0x10,0x0E,0xF5,0xFF,0xAE,
0x33,0xFF,0xFF,0xDE,0x00,0x9F,0xE2,0x5C,0x6B,0xFF,0xFF,0x3E,0x00,0xEB,0xFF,0xBE,
0x61,0xFF,0xFF,0x34,0x00,0xE1,0xFF,0xB4,0x55,0xFF,0xFF,0x28,0x00,0xD5,0xFF,0xA8,
0x36,0xFF,0xFE,0x09,0x00,0xB6,0xFF,0x89,0x14,0xFF,0xE5,0x00,0x00,0x94,0xFF,0x67,
0x00,0xF2,0xC2,0x00,0x00,0x72,0xFF,0x45,0x00,0x51,0x3F,0x00,0x00,0x21,0x5F,0x11,
0x00,0x00,0x00,0x1A,0x28,0x00,0x00,0x21,0x21,0x00,0x00,0x00,0x00,0xAE,0xDA,0x00,
0x00,0xD6,0xB2,0x00,0x00,0x00,0x00,0xCE,0xBC,0x00,0x01,0xF7,0x94,0x00,0x00,0x00,
0x00,0xEE,0x9E,0x00,0x19,0xFF,0x76,0x00,0x00,0xA3,0xB8,0xFF,0xDF,0xB7,0xC5,0xFF,
0xD4,0xB5,0x00,0xE3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x00,0x00,0x51,0xFF,
0x3E,0x00,0x7C,0xFF,0x1A,0x00,0x00,0x00,0x74,0xFF,0x1B,0x00,0x9E,0xF6,0x01,0x00,
0x38,0xB3,0xDD,0xFF,0xB5,0xB3,0xE9,0xF6,0xB3,0x68,0x4F,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x93,0x00,0x00,0xCE,0xC4,0x00,0x01,0xF9,0x98,0x00,0x00,0x00,0x00,
0xEC,0xA5,0x00,0x18,0xFF,0x7A,0x00,0x00,0x00,0x0B,0xFF,0x86,0x00,0x36,0xFF,0x5C,
0x00,0x00,0x00,0x28,0xFF,0x67,0x00,0x54,0xFF,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,
0x14,0x23,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0x33,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x94,0xFF,0x36,0x00,0x00,0x00,0x00,0x00,0x23,0xB6,0xFC,0xFF,
0xF1,0xA0,0x19,0x00,0x00,0x11,0xEA,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0x08,0x00,0x74,
0xFF,0xFF,0x70,0x12,0x39,0xC5,0x5A,0x00,0x00,0x99,0xFF,0xF9,0x04,0x00,0x00,0x00,
0x00,0x00,0x00,0x73,0xFF,0xFF,0x82,0x04,0x00,0x00,0x00,0x00,0x00,0x0C,0xD2,0xFF,
0xFF,0xDA,0x59,0x00,0x00,0x00,0x00,0x00,0x08,0x8B,0xFD,0xFF,0xFF,0xB1,0x16,0x00,
0x00,0x00,0x00,0x00,0x2C,0xB5,0xFF,0xFF,0xD0,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
0x8C,0xFF,0xFF,0x3A,0x00,0x05,0x17,0x00,0x00,0x00,0x46,0xFF,0xFF,0x53,0x00,0x80,
0xF1,0x7D,0x3D,0x34,0xBC,0xFF,0xFF,0x28,0x05,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xA7,0x00,0x00,0x07,0x73,0xC2,0xFA,0xFF,0xE4,0x83,0x05,0x00,0x00,0x00,0x00,0x00,
0x93,0xFF,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0x33,0x00,0x00,0x00,
0x00,0x10,0xA4,0xEC,0xD8,0x68,0x00,0x00,0x00,0x00,0x00,0xC2,0xCC,0x00,0x00,0x00,
0x00,0x00,0xB9,0xFF,0x9F,0xCD,0xFF,0x58,0x00,0x00,0x00,0x46,0xFF,0x48,0x00,0x00,
0x00,0x00,0x2C,0xFF,0xB4,0x00,0x18,0xFC,0xCB,0x00,0x00,0x00,0xCA,0xC3,0x00,0x00,
0x00,0x00,0x00,0x57,0xFF,0x7E,0x00,0x00,0xDD,0xF5,0x00,0x00,0x4F,0xFF,0x3F,0x00,
0x00,0x00,0x00,0x00,0x65,0xFF,0x76,0x00,0x00,0xD3,0xFE,0x06,0x01,0xD2,0xBA,0x00,
0x00,0x00,0x00,0x00,0x00,0x45,0xFF,0x91,0x00,0x02,0xEE,0xE3,0x00,0x57,0xFF,0x37,
0x00,0x41,0x6D,0x41,0x00,0x00,0x0C,0xEC,0xE6,0x20,0x65,0xFF,0x97,0x03,0xD8,0xB1,
0x00,0xA1,0xFF,0xFF,0xFF,0xA2,0x00,0x00,0x5A,0xFA,0xFF,0xFF,0xD9,0x1A,0x60,0xFE,
0x2F,0x48,0xFF,0xA9,0x12,0xAE,0xFF,0x4A,0x00,0x00,0x29,0x6C,0x59,0x0E,0x05,0xDF,
0xA8,0x00,0x95,0xFF,0x3C,0x00,0x43,0xFF,0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x68,
0xFC,0x27,0x00,0xB5,0xFF,0x21,0x00,0x27,0xFF,0xB5,0x00,0x00,0x00,0x00,0x00,0x08,
0xE4,0x9F,0x00,0x00,0xA6,0xFF,0x2C,0x00,0x30,0xFF,0xA3,0x00,0x00,0x00,0x00,0x00,
0x71,0xFA,0x20,0x00,0x00,0x7A,0xFF,0x66,0x00,0x68,0xFF,0x76,0x00,0x00,0x00,0x00,
0x0B,0xEA,0x96,0x00,0x00,0x00,0x14,0xF1,0xEE,0x91,0xEF,0xF0,0x11,0x00,0x00,0x00,
0x00,0x79,0xF7,0x1A,0x00,0x00,0x00,0x00,0x31,0xC5,0xF2,0xC4,0x2F,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0xC4,0xF2,0xDD,0x76,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x34,
0xFC,0xFF,0xE4,0xFC,0xFF,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0xA4,0xFF,0xB4,0x03,
0x6B,0xFF,0xB3,0x00,0x00,0x00,0x00,0x00,0x00,0xC5,0xFF,0x76,0x00,0x6D,0xFF,0xA8,
0x00,0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xAC,0x42,0xED,0xFF,0x4E,0x00,0x00,0x00,
0x00,0x00,0x00,0x52,0xFF,0xF8,0xFC,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3A,0xFF,0xFF,0xFE,0x5C,0x00,0x00,0x00,0x8D,0xC7,0x87,0x00,0x4E,0xF5,0xFF,0xFF,
0xFF,0x81,0x00,0x00,0x11,0xF8,0xFF,0x56,0x16,0xF3,0xFF,0xC7,0x84,0xFF,0xFF,0x76,
0x00,0x80,0xFF,0xEB,0x07,0x5B,0xFF,0xFF,0x35,0x00,0x8C,0xFF,0xFF,0xA3,0xF7,0xFF,
0x65,0x00,0x67,0xFF,0xFF,0x25,0x00,0x00,0x99,0xFF,0xFF,0xFF,0xD0,0x02,0x00,0x31,
0xFF,0xFF,0xBE,0x2A,0x16,0x61,0xFB,0xFF,0xFF,0xFD,0xA9,0x46,0x00,0x9A,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xDA,0xDC,0xFF,0xFF,0xBD,0x00,0x01,0x63,0xC7,0xEF,0xE6,0xBC,
0x6C,0x05,0x04,0x64,0xC0,0x6E,0x00,0x00,0x6B,0xFF,0xFF,0x3E,0x61,0xFF,0xFF,0x34,
0x55,0xFF,0xFF,0x28,0x36,0xFF,0xFE,0x09,0x14,0xFF,0xE5,0x00,0x00,0xF2,0xC2,0x00,
0x00,0x51,0x3F,0x00,0x00,0x00,0x1A,0xD3,0x63,0x00,0x00,0x98,0xFF,0x79,0x00,0x16,
0xFA,0xF1,0x0E,0x00,0x73,0xFF,0xA2,0x00,0x00,0xCB,0xFF,0x52,0x00,0x0B,0xFC,0xFF,
0x16,0x00,0x3F,0xFF,0xE7,0x00,0x00,0x5B,0xFF,0xC5,0x00,0x00,0x6D,0xFF,0xB6,0x00,
0x00,0x77,0xFF,0xAF,0x00,0x00,0x67,0xFF,0xBC,0x00,0x00,0x55,0xFF,0xCE,0x00,0x00,
0x2C,0xFF,0xF5,0x02,0x00,0x02,0xF1,0xFF,0x27,0x00,0x00,0xB0,0xFF,0x6D,0x00,0x00,
0x51,0xFF,0xBF,0x00,0x00,0x05,0xE6,0xFE,0x2B,0x00,0x00,0x68,0xFF,0xA3,0x00,0x00,
0x04,0x77,0x1B,0x00,0x01,0x89,0xC0,0x02,0x00,0x00,0x00,0xB2,0xFF,0x5D,0x00,0x00,
0x00,0x38,0xFF,0xD8,0x00,0x00,0x00,0x00,0xDB,0xFF,0x3A,0x00,0x00,0x00,0x8A,0xFF,
0x94,0x00,0x00,0x00,0x4D,0xFF,0xCE,0x00,0x00,0x00,0x1E,0xFF,0xFC,0x09,0x00,0x00,
0x00,0xFB,0xFF,0x22,0x00,0x00,0x00,0xEC,0xFF,0x34,0x00,0x00,0x00,0xE4,0xFF,0x3E,
0x00,0x00,0x00,0xF2,0xFF,0x2D,0x00,0x00,0x06,0xFE,0xFF,0x1C,0x00,0x00,0x2E,0xFF,
0xF1,0x02,0x00,0x00,0x5E,0xFF,0xBA,0x00,0x00,0x00,0xA6,0xFF,0x78,0x00,0x00,0x06,
0xF1,0xFC,0x1B,0x00,0x00,0x63,0xFF,0xB1,0x00,0x00,0x01,0xDA,0xFD,0x2F,0x00,0x00,
0x00,0x30,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xFF,0x4F,0x00,0x00,
0x00,0x00,0x0B,0x00,0x4E,0xFF,0x66,0x00,0x0B,0x00,0x01,0xE4,0xDD,0xCC,0xFF,0xD2,
0xD7,0xF3,0x09,0x05,0x78,0xE6,0xFF,0xFF,0xFF,0xEC,0x83,0x0B,0x00,0x00,0x38,0xFF,
0xFF,0xFF,0x4C,0x00,0x00,0x00,0x00,0xC3,0xFD,0x85,0xF9,0xD4,0x04,0x00,0x00,0x08,
0xB1,0x6F,0x00,0x59,0xBE,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7B,0xB3,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,
0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0x47,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xAF,0xFF,0x47,0x00,0x00,0x00,0x48,0xDB,0xDB,0xDB,0xF4,0xFF,0xE6,0xDB,
0xDB,0xC7,0x53,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0x00,0x00,0x00,0x00,
0xAF,0xFF,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0x47,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xAF,0xFF,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xD7,
0x3C,0x00,0x00,0x00,0x00,0x00,0x05,0x08,0x00,0x00,0x54,0xED,0xF7,0x4A,0x00,0xAA,
0xFF,0xFF,0xC3,0x00,0x45,0xD9,0xFF,0xDE,0x00,0x00,0x07,0xF7,0xBF,0x00,0x08,0x9B,
0xFF,0x64,0x00,0xD2,0xFF,0xAF,0x04,0x00,0x8F,0x6F,0x03,0x00,0x1F,0xFF,0xFF,0xFF,
0xFF,0xCB,0x1C,0xE3,0xE3,0xE3,0xE3,0xB5,0x03,0x59,0x48,0x00,0x6F,0xFF,0xFF,0x42,
0x9F,0xFF,0xFF,0x72,0x32,0xD3,0xC0,0x18,0x00,0x00,0x00,0x00,0x4D,0xC3,0x48,0x00,
0x00,0x00,0x00,0x9D,0xFF,0x25,0x00,0x00,0x00,0x00,0xDD,0xE5,0x00,0x00,0x00,0x00,
0x1E,0xFF,0xA5,0x00,0x00,0x00,0x00,0x5D,0xFF,0x65,0x00,0x00,0x00,0x00,0x9D,0xFF,
0x25,0x00,0x00,0x00,0x00,0xDE,0xE5,0x00,0x00,0x00,0x00,0x1F,0xFF,0xA4,0x00,0x00,
0x00,0x00,0x5E,0xFF,0x64,0x00,0x00,0x00,0x00,0x9E,0xFF,0x24,0x00,0x00,0x00,0x00,
0xDE,0xE4,0x00,0x00,0x00,0x00,0x1F,0xFF,0xA4,0x00,0x00,0x00,0x00,0x5F,0xFF,0x64,
0x00,0x00,0x00,0x00,0x9F,0xFF,0x23,0x00,0x00,0x00,0x00,0xDF,0xE3,0x00,0x00,0x00,
0x00,0x1F,0xFF,0xA3,0x00,0x00,0x00,0x00,0x5F,0xFF,0x63,0x00,0x00,0x00,0x00,0x9F,
0xFF,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x84,0xD0,0xEE,0xB7,0x42,
0x00,0x00,0x00,0x03,0xB3,0xFF,0xFF,0xFF,0xFF,0xF9,0x50,0x00,0x00,0x4F,0xFF,0xFF,
0x69,0x25,0xBC,0xFF,0xE0,0x03,0x00,0xBB,0xFF,0xBE,0x00,0x00,0x2A,0xFF,0xFF,0x50,
0x00,0xF6,0xFF,0x79,0x00,0x00,0x00,0xE6,0xFF,0x8B,0x11,0xFF,0xFF,0x5F,0x00,0x00,
0x00,0xCC,0xFF,0xA7,0x2C,0xFF,0xFF,0x4F,0x00,0x00,0x00,0xBB,0xFF,0xC3,0x29,0xFF,
0xFF,0x50,0x00,0x00,0x00,0xBD,0xFF,0xC0,0x0F,0xFF,0xFF,0x60,0x00,0x00,0x00,0xCD,
0xFF,0xA5,0x00,0xF4,0xFF,0x7D,0x00,0x00,0x00,0xE8,0xFF,0x89,0x00,0xB3,0xFF,0xC1,
0x00,0x00,0x2D,0xFF,0xFF,0x49,0x00,0x49,0xFF,0xFF,0x6C,0x26,0xC0,0xFF,0xDC,0x01,
0x00,0x01,0xAB,0xFF,0xFF,0xFF,0xFF,0xF7,0x4A,0x00,0x00,0x00,0x03,0x81,0xCF,0xEE,
0xB6,0x3F,0x00,0x00,0x00,0x0C,0x4E,0xBE,0xFF,0xFB,0x00,0x00,0x00,0x11,0xFA,0xFF,
0xFF,0xFF,0xFB,0x00,0x00,0x00,0x0F,0xC3,0xC3,0xEC,0xFF,0xFB,0x00,0x00,0x00,0x00,
0x00,0x00,0xAB,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFB,0x00,0x00,
0x00,0x00,0x00,0x00,0xAB,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFB,
0x00,0x00,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0xAB,
0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,
0x00,0xAB,0xFF,0xFB,0x00,0x00,0x00,0x13,0x23,0x23,0xB7,0xFF,0xFC,0x23,0x23,0x11,
0x87,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7B,0x87,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x7B,0x00,0x00,0x00,0x00,0x65,0xCD,0xF4,0xE3,0xAD,0x26,0x00,0x00,0x0A,0xA6,
0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0x2A,0x00,0x14,0xD5,0xF2,0x6F,0x29,0x60,0xF9,0xFF,
0xB7,0x00,0x00,0x19,0x31,0x00,0x00,0x00,0xA0,0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x86,0xFF,0xFA,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0xBB,0xFF,0xD2,0x00,
0x00,0x00,0x00,0x00,0x00,0x26,0xF9,0xFF,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,
0xFF,0xF5,0x15,0x00,0x00,0x00,0x00,0x00,0x72,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,
0x00,0x4D,0xFD,0xFF,0xBA,0x01,0x00,0x00,0x00,0x00,0x41,0xF5,0xFF,0xD8,0x14,0x00,
0x00,0x00,0x00,0x45,0xF6,0xFF,0xEE,0x41,0x32,0x37,0x37,0x27,0x25,0xF7,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xB3,0x3B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB3,
0x00,0x01,0x67,0xB7,0xEB,0xE9,0xBF,0x4F,0x00,0x00,0x04,0xC1,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x69,0x00,0x00,0x76,0xF4,0x71,0x29,0x5B,0xF1,0xFF,0xEF,0x00,0x00,0x00,
0x1F,0x00,0x00,0x00,0x9E,0xFF,0xFF,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0xA1,0xFF,
0xFB,0x0C,0x00,0x00,0x00,0x06,0x21,0x7A,0xFD,0xFF,0x97,0x00,0x00,0x00,0x00,0xBB,
0xFF,0xFF,0xFE,0x83,0x04,0x00,0x00,0x00,0x00,0xB3,0xFF,0xFF,0xFF,0xD9,0x40,0x00,
0x00,0x00,0x00,0x00,0x06,0x3B,0xC7,0xFF,0xF8,0x24,0x00,0x00,0x00,0x00,0x00,0x00,
0x2B,0xFF,0xFF,0x7D,0x00,0x36,0x0E,0x00,0x00,0x00,0x2D,0xFF,0xFF,0x86,0x1F,0xEE,
0xDE,0x6E,0x39,0x64,0xD0,0xFF,0xFF,0x48,0x2F,0xDE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xA0,0x00,0x00,0x0F,0x8B,0xD7,0xF5,0xEB,0xC3,0x5A,0x02,0x00,0x00,0x00,0x00,0x00,
0x0E,0xE6,0xFF,0xFF,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0xFF,0x83,
0x00,0x00,0x00,0x00,0x00,0x2F,0xFC,0xF3,0xEB,0xFF,0x83,0x00,0x00,0x00,0x00,0x01,
0xC5,0xFF,0x8B,0xE3,0xFF,0x83,0x00,0x00,0x00,0x00,0x60,0xFF,0xF5,0x19,0xEC,0xFF,
0x83,0x00,0x00,0x00,0x11,0xEA,0xFF,0x77,0x00,0xF3,0xFF,0x83,0x00,0x00,0x00,0x96,
0xFF,0xD5,0x05,0x00,0xF3,0xFF,0x83,0x00,0x00,0x33,0xFD,0xFF,0x3E,0x00,0x00,0xF3,
0xFF,0x83,0x00,0x00,0x9C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x17,0x9F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x17,0x04,0x07,0x07,0x07,0x07,0x07,
0xF4,0xFF,0x87,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0xFF,0x83,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0xFF,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xF3,0xFF,0x83,0x00,0x00,0x00,0x00,0x00,0x26,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x03,0x00,0x34,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x42,0xFF,0xFF,
0x54,0x37,0x37,0x37,0x37,0x00,0x00,0x4F,0xFF,0xFF,0x11,0x00,0x00,0x00,0x00,0x00,
0x00,0x5D,0xFF,0xFB,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x6A,0xFF,0xF9,0xBF,0xF2,
0xD6,0x7F,0x08,0x00,0x00,0x71,0xFF,0xFF,0xF1,0xFD,0xFF,0xFF,0xB6,0x00,0x00,0x03,
0x6A,0x33,0x00,0x11,0xB9,0xFF,0xFF,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0xFF,
0xFF,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x91,0x00,0x3A,0x0E,0x00,
0x00,0x00,0x48,0xFF,0xFF,0x63,0x1E,0xEF,0xDB,0x6E,0x37,0x59,0xE3,0xFF,0xF4,0x1F,
0x31,0xDD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x63,0x00,0x00,0x0C,0x84,0xD3,0xF4,0xE8,
0xB6,0x38,0x00,0x00,0x00,0x00,0x00,0x2A,0xAB,0xE1,0xE6,0xAF,0x4C,0x00,0x00,0x00,
0x4F,0xF4,0xFF,0xFF,0xFF,0xFF,0xFF,0x5C,0x00,0x0C,0xEA,0xFF,0xD2,0x47,0x35,0x8E,
0xBC,0x06,0x00,0x7C,0xFF,0xF5,0x15,0x00,0x00,0x00,0x01,0x00,0x00,0xD2,0xFF,0x9E,
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFD,0xFF,0x72,0x58,0xB5,0xC8,0x93,0x15,0x00,
0x13,0xFF,0xFF,0xD2,0xFF,0xFF,0xFF,0xFF,0xE6,0x0F,0x15,0xFF,0xFF,0xFB,0x62,0x10,
0x52,0xFC,0xFF,0x83,0x06,0xFF,0xFF,0x7E,0x00,0x00,0x00,0xB7,0xFF,0xB7,0x00,0xDC,
0xFF,0x8B,0x00,0x00,0x00,0x9C,0xFF,0xD0,0x00,0x92,0xFF,0xD5,0x01,0x00,0x00,0xBE,
0xFF,0xAB,0x00,0x1D,0xFA,0xFF,0x81,0x0C,0x55,0xFE,0xFF,0x67,0x00,0x00,0x76,0xFE,
0xFF,0xFF,0xFF,0xFF,0xC6,0x02,0x00,0x00,0x00,0x50,0xBF,0xF0,0xD8,0x88,0x08,0x00,
0x1B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0x1B,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xB3,0x06,0x37,0x37,0x37,0x37,0x37,0x7B,0xFF,0xFA,0x2F,0x00,0x00,
0x00,0x00,0x00,0x05,0xD6,0xFF,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x71,0xFF,0xDE,
0x06,0x00,0x00,0x00,0x00,0x00,0x03,0xE6,0xFF,0x79,0x00,0x00,0x00,0x00,0x00,0x00,
0x4C,0xFF,0xFB,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xFF,0xC2,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xEB,0xFF,0x93,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xFF,0xFF,
0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0xFF,0xFF,0x2E,0x00,0x00,0x00,0x00,0x00,0x00,0x86,0xFF,0xFF,0x1E,0x00,
0x00,0x00,0x00,0x00,0x00,0x9C,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x17,0x97,
0xDC,0xF4,0xD0,0x6B,0x03,0x00,0x00,0x0E,0xDB,0xFF,0xFF,0xEC,0xFF,0xFF,0x8B,0x00,
0x00,0x6D,0xFF,0xFD,0x36,0x00,0x6C,0xFF,0xFD,0x0C,0x00,0x95,0xFF,0xC7,0x00,0x00,
0x0A,0xF8,0xFF,0x34,0x00,0x63,0xFF,0xED,0x13,0x00,0x10,0xFE,0xFD,0x17,0x00,0x19,
0xEB,0xFF,0xDC,0x51,0x86,0xFF,0x97,0x00,0x00,0x00,0x32,0xF9,0xFF,0xFF,0xFF,0xC3,
0x03,0x00,0x00,0x04,0x98,0xFF,0xC7,0xFD,0xFF,0xFA,0x60,0x00,0x00,0x98,0xFF,0xA6,
0x00,0x25,0xC0,0xFF,0xFF,0x44,0x07,0xFB,0xFF,0x45,0x00,0x00,0x0A,0xE8,0xFF,0xA1,
0x1A,0xFF,0xFF,0x34,0x00,0x00,0x00,0xC2,0xFF,0xB6,0x00,0xE6,0xFF,0xB8,0x11,0x02,
0x47,0xF7,0xFF,0x82,0x00,0x4E,0xFE,0xFF,0xFA,0xEE,0xFF,0xFF,0xD9,0x0F,0x00,0x00,
0x35,0xAF,0xE2,0xF4,0xD1,0x85,0x0F,0x00,0x00,0x00,0x2D,0xB4,0xEA,0xDE,0xA2,0x17,
0x00,0x00,0x00,0x39,0xF9,0xFF,0xFF,0xFF,0xFF,0xE4,0x29,0x00,0x00,0xD2,0xFF,0xCE,
0x1F,0x27,0xD2,0xFF,0xB0,0x00,0x18,0xFF,0xFF,0x4F,0x00,0x00,0x3F,0xFF,0xFE,0x2E,
0x3D,0xFF,0xFF,0x2B,0x00,0x00,0x01,0xF3,0xFF,0x75,0x25,0xFF,0xFF,0x46,0x00,0x00,
0x06,0xE0,0xFF,0x9D,0x04,0xED,0xFF,0xC4,0x1D,0x23,0xAF,0xFF,0xFF,0xAD,0x00,0x66,
0xFF,0xFF,0xFF,0xFF,0xED,0xE6,0xFF,0xA8,0x00,0x00,0x4F,0xB8,0xD6,0xA2,0x24,0xE1,
0xFF,0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFD,0xFF,0x64,0x00,0x00,0x01,0x00,
0x00,0x00,0x78,0xFF,0xF5,0x17,0x00,0x3A,0xD7,0x60,0x36,0x77,0xFA,0xFF,0x8A,0x00,
0x01,0xC8,0xFF,0xFF,0xFF,0xFF,0xFF,0xC5,0x11,0x00,0x00,0x0C,0x86,0xC7,0xF2,0xCD,
0x83,0x05,0x00,0x00,0x00,0x42,0x2F,0x00,0x6D,0xFF,0xFF,0x40,0x9F,0xFF,0xFF,0x72,
0x33,0xD4,0xC1,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x59,0x33,0x00,0x6F,0xFF,0xFF,0x44,0x9F,0xFF,0xFF,0x70,0x32,0xD3,0xD5,0x17,
0x00,0x32,0xD2,0xBE,0x18,0x00,0x9E,0xFF,0xFF,0x71,0x00,0x70,0xFF,0xFF,0x43,0x00,
0x01,0x47,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x05,0x08,0x00,0x00,0x54,0xED,0xF7,0x4A,0x00,0xAA,0xFF,0xFF,0xC3,0x00,0x45,0xD9,
0xFF,0xDE,0x00,0x00,0x07,0xF7,0xBF,0x00,0x08,0x9B,0xFF,0x64,0x00,0xD2,0xFF,0xAF,
0x04,0x00,0x8F,0x6F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,
0x74,0xBF,0x00,0x00,0x00,0x00,0x03,0x4C,0xAF,0xFB,0xFF,0xE7,0x00,0x00,0x25,0x86,
0xE6,0xFF,0xFF,0xF6,0xAB,0x4F,0x29,0xC1,0xFF,0xFF,0xFA,0xB4,0x5B,0x0C,0x00,0x00,
0x53,0xFF,0xFF,0xCD,0x27,0x00,0x00,0x00,0x00,0x00,0x2A,0xC2,0xFF,0xFF,0xFA,0xB3,
0x5A,0x0C,0x00,0x00,0x00,0x00,0x25,0x87,0xE6,0xFF,0xFF,0xF6,0xAA,0x4F,0x00,0x00,
0x00,0x00,0x03,0x4D,0xB0,0xFB,0xFF,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,
0x75,0xBF,0x00,0x00,0x53,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0x4A,0xE3,
0xE3,0xE3,0xE3,0xE3,0xE3,0xE3,0xE3,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x53,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,
0x4A,0xE3,0xE3,0xE3,0xE3,0xE3,0xE3,0xE3,0xE3,0xCE,0x00,0x00,0x4E,0xAD,0x4A,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x53,0xFF,0xFF,0xE5,0x85,0x23,0x00,0x00,0x00,0x00,
0x14,0x78,0xD0,0xFF,0xFF,0xFE,0xBF,0x5C,0x09,0x00,0x00,0x00,0x00,0x28,0x7F,0xD8,
0xFF,0xFF,0xF0,0x8D,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0xF5,0xFF,0xE7,0x00,0x00,
0x00,0x27,0x7E,0xD8,0xFF,0xFF,0xF1,0x8E,0x14,0x77,0xCF,0xFF,0xFF,0xFE,0xC0,0x5D,
0x0A,0x00,0x53,0xFF,0xFF,0xE5,0x86,0x24,0x00,0x00,0x00,0x00,0x4E,0xAE,0x4B,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x02,0x00,0x00,
0x00,0x00,0x09,0x8D,0xD8,0xFF,0xF8,0xAE,0x1F,0x00,0x06,0xCB,0xFF,0xFF,0xFF,0xFF,
0xFF,0xD0,0x04,0x00,0x51,0xC6,0x37,0x1A,0xAA,0xFF,0xFF,0x30,0x00,0x00,0x00,0x00,
0x00,0x49,0xFF,0xFF,0x43,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,0xF5,0x08,0x00,0x00,
0x00,0x00,0x54,0xFE,0xFF,0x6B,0x00,0x00,0x00,0x00,0x1A,0xF0,0xFF,0xA4,0x00,0x00,
0x00,0x00,0x00,0x9C,0xFF,0xDF,0x0C,0x00,0x00,0x00,0x00,0x00,0xD4,0xFF,0x8A,0x00,
0x00,0x00,0x00,0x00,0x00,0x31,0x3B,0x1D,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x65,
0x11,0x00,0x00,0x00,0x00,0x00,0x0E,0xF5,0xFF,0xAE,0x00,0x00,0x00,0x00,0x00,0x33,
0xFF,0xFF,0xDE,0x00,0x00,0x00,0x00,0x00,0x00,0x9F,0xE2,0x5C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x39,0x93,0xD5,0xF1,0xF3,0xD6,0x92,0x1D,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x17,0xB0,0xFF,0xFF,0xD4,0xAF,0xB5,0xE1,0xFF,0xEF,0x5A,0x00,
0x00,0x00,0x00,0x00,0x28,0xE0,0xFF,0xC7,0x2A,0x00,0x00,0x00,0x00,0x4C,0xEC,0xFF,
0x67,0x00,0x00,0x00,0x0F,0xDB,0xFF,0x8C,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,
0xE4,0xED,0x13,0x00,0x00,0x9B,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x65,0xFF,0x8C,0x00,0x22,0xFB,0xEC,0x14,0x00,0x00,0x68,0xCB,0xEA,0x65,0xCA,
0x96,0x00,0x04,0xEB,0xC4,0x00,0x7A,0xFF,0x6D,0x00,0x00,0x86,0xFF,0xF7,0xD1,0xFF,
0xFF,0x85,0x00,0x00,0xC2,0xEE,0x00,0xC1,0xFE,0x19,0x00,0x2C,0xFD,0xE8,0x20,0x00,
0xB4,0xFF,0x50,0x00,0x00,0xA2,0xFF,0x10,0xE4,0xE7,0x00,0x00,0x8F,0xFF,0x76,0x00,
0x00,0xCB,0xFF,0x1B,0x00,0x00,0xB8,0xF0,0x00,0xF9,0xD3,0x00,0x00,0xBB,0xFF,0x3D,
0x00,0x03,0xF7,0xEE,0x00,0x00,0x0C,0xEE,0xC4,0x00,0xEF,0xF0,0x00,0x00,0xB4,0xFF,
0x63,0x00,0x5A,0xFF,0xEA,0x01,0x01,0x96,0xFF,0x55,0x00,0xD5,0xFF,0x1E,0x00,0x6D,
0xFF,0xF7,0xC3,0xFA,0xDE,0xFF,0xD5,0xD5,0xFF,0xA8,0x00,0x00,0x95,0xFF,0x65,0x00,
0x05,0x95,0xED,0xCF,0x53,0x18,0xB8,0xF0,0xCE,0x6C,0x01,0x00,0x00,0x31,0xFB,0xED,
0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,
0xFF,0xC0,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x05,0xC3,0xFF,0xF1,0x79,0x3C,0x0F,0x1A,0x4D,0xB8,0x22,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x02,0x6C,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x59,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x12,0x49,0x74,0x9A,0x8A,0x68,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xF1,0xFF,0xFF,0x7A,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x44,0xFF,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x92,0xFF,0xAE,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,
0xFF,0x49,0xE1,0xFF,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0xFF,0xFB,0x0C,0x9E,
0xFF,0xB3,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xFF,0xC7,0x00,0x5B,0xFF,0xF7,0x0A,
0x00,0x00,0x00,0x00,0x00,0xCA,0xFF,0x87,0x00,0x18,0xFF,0xFF,0x50,0x00,0x00,0x00,
0x00,0x1A,0xFE,0xFF,0x44,0x00,0x00,0xD5,0xFF,0x9E,0x00,0x00,0x00,0x00,0x66,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEA,0x02,0x00,0x00,0x00,0xB4,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x3A,0x00,0x00,0x0B,0xF7,0xFF,0x7E,0x13,0x13,0x13,0x1C,0xFB,
0xFF,0x89,0x00,0x00,0x50,0xFF,0xFF,0x38,0x00,0x00,0x00,0x00,0xC9,0xFF,0xD7,0x00,
0x00,0x9E,0xFF,0xF6,0x05,0x00,0x00,0x00,0x00,0x8C,0xFF,0xFF,0x25,0x02,0xEA,0xFF,
0xBE,0x00,0x00,0x00,0x00,0x00,0x4E,0xFF,0xFF,0x74,0x00,0x00,0x5F,0xFF,0xFF,0xFF,
0xFF,0xF5,0xDE,0xA0,0x33,0x00,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF6,
0x3A,0x00,0x5F,0xFF,0xFF,0x54,0x0C,0x1D,0x75,0xFF,0xFF,0xA6,0x00,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x00,0xCD,0xFF,0xD0,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0xD2,
0xFF,0xA0,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x15,0x7C,0xFF,0xFF,0x53,0x00,0x5F,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x00,0x00,0x5F,0xFF,0xFF,0xFD,0xFB,0xFF,0xFF,
0xFF,0xF1,0x65,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x05,0x2A,0xB5,0xFF,0xFD,0x2F,0x5F,
0xFF,0xFF,0x4B,0x00,0x00,0x00,0x21,0xFF,0xFF,0x75,0x5F,0xFF,0xFF,0x4B,0x00,0x00,
0x00,0x2F,0xFF,0xFF,0x70,0x5F,0xFF,0xFF,0x54,0x0B,0x14,0x40,0xCC,0xFF,0xFF,0x34,
0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x89,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,
0xFA,0xDF,0xB4,0x4B,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0xAA,0xDD,0xF3,
0xC9,0x62,0x00,0x00,0x00,0x00,0x0C,0xA1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAB,0x00,
0x00,0x00,0x96,0xFF,0xFF,0xD6,0x76,0x60,0xA6,0xFF,0x6B,0x00,0x00,0x33,0xFD,0xFF,
0xC5,0x0D,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x9C,0xFF,0xFF,0x37,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC6,0xFF,0xE2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xF0,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF4,0xFF,0xBF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCD,0xFF,0xDF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xA5,0xFF,0xFF,0x2F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x4A,0xFF,0xFF,0xBA,0x08,0x00,0x00,0x00,0x4F,0x1D,0x00,0x00,0x00,0xAF,0xFF,
0xFF,0xCD,0x71,0x62,0xA6,0xFE,0xCF,0x0B,0x00,0x00,0x18,0xBC,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xAC,0x0D,0x00,0x00,0x00,0x01,0x66,0xB4,0xE4,0xE8,0xB2,0x65,0x00,0x00,
0x5F,0xFF,0xFF,0xFF,0xF5,0xD1,0xAB,0x4E,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xB4,0x12,0x00,0x5F,0xFF,0xFF,0x62,0x2F,0x5A,0xD3,0xFF,0xFF,0x9C,
0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x06,0xC8,0xFF,0xFE,0x38,0x5F,0xFF,0xFF,0x4B,
0x00,0x00,0x00,0x43,0xFF,0xFF,0x92,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x08,0xFE,
0xFF,0xC4,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xE6,0xFF,0xD7,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x00,0x00,0xE9,0xFF,0xCA,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x0A,
0xFF,0xFF,0xA5,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x4B,0xFF,0xFF,0x80,0x5F,0xFF,
0xFF,0x4B,0x00,0x00,0x0A,0xD0,0xFF,0xFC,0x2F,0x5F,0xFF,0xFF,0x65,0x33,0x5F,0xDA,
0xFF,0xFF,0x95,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAE,0x10,0x00,0x5F,
0xFF,0xFF,0xFF,0xF9,0xD5,0xAC,0x51,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xCF,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF,0x5F,0xFF,
0xFF,0x73,0x37,0x37,0x37,0x37,0x2D,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,
0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x73,0x37,0x37,0x37,
0x37,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFB,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,
0xFF,0xFF,0x73,0x37,0x37,0x37,0x37,0x37,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x5F,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xD7,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD7,0x5F,0xFF,
0xFF,0x73,0x37,0x37,0x37,0x37,0x2F,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,
0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,
0x00,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x5F,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x07,0x5F,0xFF,0xFF,0x76,0x3B,0x3B,0x3B,0x3B,0x01,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,
0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,
0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x49,0xA5,0xD5,0xF6,0xDC,0x91,0x13,0x00,0x00,0x00,0x0D,0xA1,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xE6,0x2F,0x00,0x00,0x9C,0xFF,0xFF,0xDB,0x7C,0x58,0x81,0xE5,0xC4,0x08,
0x00,0x41,0xFF,0xFF,0xC0,0x0C,0x00,0x00,0x00,0x11,0x12,0x00,0x00,0xA2,0xFF,0xFD,
0x2A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,0xFF,0xDB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xF8,0xFF,0xB9,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xAB,
0x00,0xEB,0xFF,0xC8,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xAB,0x00,0xC4,0xFF,0xE9,
0x00,0x00,0x02,0x2F,0x2F,0xC2,0xFF,0xAB,0x00,0x9C,0xFF,0xFF,0x47,0x00,0x00,0x00,
0x00,0xB3,0xFF,0xAB,0x00,0x37,0xFE,0xFF,0xD2,0x18,0x00,0x00,0x00,0xB3,0xFF,0xAB,
0x00,0x00,0x9C,0xFF,0xFF,0xE4,0x87,0x58,0x78,0xEE,0xFF,0xAB,0x00,0x00,0x10,0xA8,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF9,0x6A,0x00,0x00,0x00,0x00,0x52,0xAB,0xD8,0xF3,
0xC9,0x99,0x2A,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,0x5F,
0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,0x5F,0xFF,0xFF,0x4B,0x00,0x00,
0x00,0x00,0xA7,0xFF,0xFB,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,
0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,0x5F,0xFF,0xFF,0x84,0x4F,
0x4F,0x4F,0x4F,0xC3,0xFF,0xFB,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFB,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x5F,0xFF,0xFF,0x4B,
0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xA7,
0xFF,0xFB,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,
0xA7,0xFF,0xFB,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0xA7,0xFF,0xFB,0x00,0x00,
0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,
0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,
0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,
0x5F,0xFF,0xFF,0x4B,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,
0xA7,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x03,
0xFF,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xA7,0x00,0x00,0x00,0x00,
0x00,0x03,0xFF,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xA7,0x00,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xA7,
0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x0D,0xFF,
0xFF,0xA1,0x00,0x35,0x5D,0x00,0x00,0x38,0xFF,0xFF,0x80,0x4D,0xF9,0xFB,0x86,0x5B,
0xD0,0xFF,0xFF,0x3E,0x18,0xE2,0xFF,0xFF,0xFF,0xFF,0xFF,0xB2,0x00,0x00,0x16,0x96,
0xE2,0xF6,0xCF,0x82,0x04,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x99,
0xFF,0xFF,0x55,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x54,0xFF,0xFF,0x97,0x00,0x00,
0x5F,0xFF,0xFF,0x4B,0x00,0x1E,0xEF,0xFF,0xD2,0x08,0x00,0x00,0x5F,0xFF,0xFF,0x4B,
0x03,0xC4,0xFF,0xF4,0x28,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x82,0xFF,0xFF,0x5F,
0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x8B,0xFD,0xFF,0xCA,0x00,0x00,0x00,0x00,0x00,
0x5F,0xFF,0xFF,0xFE,0xFF,0xFF,0xFD,0x30,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFF,
0xFB,0xF7,0xFF,0xBE,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFF,0x76,0x86,0xFF,0xFF,
0x4F,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xB7,0x01,0x0F,0xEB,0xFF,0xDA,0x05,0x00,0x00,
0x5F,0xFF,0xFF,0x4C,0x00,0x00,0x6E,0xFF,0xFF,0x70,0x00,0x00,0x5F,0xFF,0xFF,0x4B,
0x00,0x00,0x06,0xDD,0xFF,0xEE,0x12,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x56,
0xFF,0xFF,0x92,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x01,0xC9,0xFF,0xFB,0x28,
0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,
0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,
0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,
0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,
0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,
0x00,0x00,0x00,0x5F,0xFF,0xFF,0x73,0x37,0x37,0x37,0x37,0x27,0x5F,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xB3,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB3,0x00,0x00,
0x5F,0xFF,0xFF,0xC1,0x00,0x00,0x00,0x00,0x00,0x64,0xFF,0xFF,0xBB,0x5F,0xFF,0xFF,
0xFE,0x1F,0x00,0x00,0x00,0x00,0xBE,0xFF,0xFF,0xBB,0x5F,0xFF,0xFF,0xFF,0x79,0x00,
0x00,0x00,0x1A,0xFD,0xFF,0xFF,0xBB,0x5F,0xFF,0xEA,0xFF,0xD5,0x00,0x00,0x00,0x71,
0xFF,0xE8,0xFF,0xBB,0x5F,0xFF,0xCB,0xE2,0xFF,0x31,0x00,0x00,0xCB,0xFF,0xA8,0xFF,
0xBB,0x5F,0xFF,0xE2,0x8F,0xFF,0x8D,0x00,0x25,0xFF,0xD8,0x91,0xFF,0xBB,0x5F,0xFF,
0xF1,0x3B,0xFF,0xE5,0x01,0x7B,0xFF,0x83,0xA1,0xFF,0xBB,0x5F,0xFF,0xFD,0x02,0xDE,
0xFF,0x34,0xCA,0xFF,0x28,0xAE,0xFF,0xBB,0x5F,0xFF,0xFF,0x07,0x82,0xFF,0x9B,0xFE,
0xCB,0x00,0xB3,0xFF,0xBB,0x5F,0xFF,0xFF,0x07,0x25,0xFF,0xFF,0xFF,0x6F,0x00,0xB3,
0xFF,0xBB,0x5F,0xFF,0xFF,0x07,0x00,0xC7,0xFF,0xFC,0x17,0x00,0xB3,0xFF,0xBB,0x5F,
0xFF,0xFF,0x07,0x00,0x69,0xFF,0xB7,0x00,0x00,0xB3,0xFF,0xBB,0x5F,0xFF,0xFF,0x07,
0x00,0x0E,0x53,0x28,0x00,0x00,0xB3,0xFF,0xBB,0x5F,0xFF,0xFF,0x07,0x00,0x00,0x00,
0x00,0x00,0x00,0xB3,0xFF,0xBB,0x00,0x00,0x5F,0xFF,0xFF,0x98,0x00,0x00,0x00,0x00,
0xB3,0xFF,0xD3,0x5F,0xFF,0xFF,0xFA,0x20,0x00,0x00,0x00,0xB3,0xFF,0xD3,0x5F,0xFF,
0xFF,0xFF,0x9E,0x00,0x00,0x00,0xB3,0xFF,0xD3,0x5F,0xFF,0xE8,0xF3,0xFC,0x25,0x00,
0x00,0xB3,0xFF,0xD3,0x5F,0xFF,0xE6,0x91,0xFF,0xA4,0x00,0x00,0xB3,0xFF,0xD3,0x5F,
0xFF,0xF7,0x23,0xFD,0xFD,0x2A,0x00,0xB2,0xFF,0xD3,0x5F,0xFF,0xFF,0x07,0xAC,0xFF,
0xAA,0x00,0xA9,0xFF,0xD3,0x5F,0xFF,0xFF,0x18,0x2E,0xFE,0xFE,0x2D,0x9E,0xFF,0xD3,
0x5F,0xFF,0xFF,0x26,0x00,0xAA,0xFF,0x9D,0x8E,0xFF,0xD3,0x5F,0xFF,0xFF,0x27,0x00,
0x2B,0xFD,0xF7,0x8B,0xFF,0xD3,0x5F,0xFF,0xFF,0x27,0x00,0x00,0xA6,0xFF,0xDD,0xFF,
0xD3,0x5F,0xFF,0xFF,0x27,0x00,0x00,0x28,0xFC,0xFF,0xFF,0xD3,0x5F,0xFF,0xFF,0x27,
0x00,0x00,0x00,0xA2,0xFF,0xFF,0xD3,0x5F,0xFF,0xFF,0x27,0x00,0x00,0x00,0x24,0xFC,
0xFF,0xD3,0x00,0x00,0x00,0x00,0x00,0x05,0x77,0xB9,0xEA,0xE2,0xB1,0x63,0x00,0x00,
0x00,0x00,0x00,0x21,0xCA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB2,0x11,0x00,0x00,0x00,
0xC1,0xFF,0xFF,0xBC,0x66,0x6F,0xCE,0xFF,0xFF,0x9B,0x00,0x00,0x51,0xFF,0xFF,0xA8,
0x02,0x00,0x00,0x0A,0xC7,0xFF,0xFD,0x2D,0x00,0xAB,0xFF,0xFD,0x23,0x00,0x00,0x00,
0x00,0x47,0xFF,0xFF,0x86,0x00,0xD1,0xFF,0xD9,0x00,0x00,0x00,0x00,0x00,0x03,0xFC,
0xFF,0xAB,0x01,0xF6,0xFF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0xE1,0xFF,0xD2,0x00,
0xF3,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0xE4,0xFF,0xCE,0x00,0xCE,0xFF,0xDC,
0x00,0x00,0x00,0x00,0x00,0x05,0xFD,0xFF,0xA8,0x00,0xA8,0xFF,0xFF,0x2A,0x00,0x00,
0x00,0x00,0x50,0xFF,0xFF,0x82,0x00,0x46,0xFF,0xFF,0xB0,0x03,0x00,0x00,0x0D,0xCD,
0xFF,0xFA,0x25,0x00,0x00,0xBA,0xFF,0xFF,0xBF,0x66,0x6F,0xD1,0xFF,0xFF,0x93,0x00,
0x00,0x00,0x1B,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAA,0x0D,0x00,0x00,0x00,0x00,
0x03,0x73,0xB8,0xEA,0xE3,0xB0,0x5F,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFF,
0xFF,0xF2,0xD7,0x98,0x29,0x00,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,
0x36,0x00,0x5F,0xFF,0xFF,0x5F,0x1C,0x2D,0x71,0xF9,0xFF,0xD8,0x00,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x00,0x92,0xFF,0xFF,0x10,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x6E,
0xFF,0xFF,0x2E,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0xA0,0xFF,0xFB,0x08,0x5F,0xFF,
0xFF,0x5C,0x18,0x2B,0x7C,0xFD,0xFF,0xBE,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xEB,0x1E,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xF2,0xD0,0x87,0x13,0x00,0x00,0x5F,
0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x76,0xB8,0xEA,0xE2,
0xB0,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xAF,0x10,0x00,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xBD,0x66,0x6F,0xD0,0xFF,0xFF,0x97,
0x00,0x00,0x00,0x4D,0xFF,0xFF,0xAB,0x03,0x00,0x00,0x0C,0xC9,0xFF,0xFC,0x29,0x00,
0x00,0xAA,0xFF,0xFE,0x25,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0x85,0x00,0x00,0xCF,
0xFF,0xDB,0x00,0x00,0x00,0x00,0x00,0x04,0xFD,0xFF,0xAA,0x00,0x00,0xF4,0xFF,0xBE,
0x00,0x00,0x00,0x00,0x00,0x00,0xE3,0xFF,0xCF,0x00,0x01,0xF7,0xFF,0xBC,0x00,0x00,
0x00,0x00,0x00,0x00,0xE1,0xFF,0xD4,0x00,0x00,0xD8,0xFF,0xD7,0x00,0x00,0x00,0x00,
0x00,0x02,0xFB,0xFF,0xB5,0x00,0x00,0xB3,0xFF,0xFB,0x18,0x00,0x00,0x00,0x00,0x3A,
0xFF,0xFF,0x90,0x00,0x00,0x54,0xFF,0xFF,0x88,0x00,0x00,0x00,0x00,0xAE,0xFF,0xFF,
0x30,0x00,0x00,0x03,0xDB,0xFF,0xFF,0x81,0x23,0x2C,0x9D,0xFF,0xFF,0xBA,0x00,0x00,
0x00,0x00,0x26,0xE5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD5,0x13,0x00,0x00,0x00,0x00,
0x00,0x21,0x99,0xF3,0xFF,0xFF,0xF1,0x88,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x17,0xE5,0xFF,0xED,0x6B,0x22,0x07,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x32,0xE4,0xFF,0xFF,0xFF,0xFF,0xFF,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x16,
0x88,0xE7,0xFF,0xFF,0xFB,0x4D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x20,0x08,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xF8,0xDE,0xAA,0x38,0x00,0x00,0x5F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x4A,0x00,0x5F,0xFF,0xFF,0x5F,0x1B,0x28,
0x63,0xF3,0xFF,0xE9,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x80,0xFF,0xFF,0x1D,
0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x5F,0xFF,0xFF,0x3E,0x5F,0xFF,0xFF,0x4B,0x00,
0x00,0x00,0x92,0xFF,0xFF,0x26,0x5F,0xFF,0xFF,0x5C,0x17,0x28,0x74,0xFA,0xFF,0xDA,
0x01,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,0x46,0x00,0x5F,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xED,0x2F,0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x91,0xFF,0xFF,0x44,
0x00,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x14,0xF1,0xFF,0xD4,0x03,0x00,0x5F,0xFF,0xFF,
0x4B,0x00,0x00,0x79,0xFF,0xFF,0x6B,0x00,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x09,0xE4,
0xFF,0xEC,0x11,0x5F,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x61,0xFF,0xFF,0x91,0x00,0x00,
0x00,0x00,0x02,0x61,0xC4,0xED,0xE2,0xAF,0x54,0x00,0x00,0x00,0x00,0xAD,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xA9,0x02,0x00,0x58,0xFF,0xFF,0xC3,0x69,0x68,0xAD,0xFF,0x77,
0x00,0x00,0x99,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x95,0xFF,0xFF,
0x5C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0xFF,0xFF,0xFF,0xC4,0x51,0x03,0x00,
0x00,0x00,0x00,0x00,0x7A,0xFB,0xFF,0xFF,0xFF,0xE0,0x62,0x00,0x00,0x00,0x00,0x00,
0x36,0xC2,0xFF,0xFF,0xFF,0xFF,0x97,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xAC,0xFE,
0xFF,0xFF,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0xFF,0xFF,0x6E,0x00,0x15,
0x92,0x12,0x00,0x00,0x00,0x50,0xFF,0xFF,0x60,0x06,0xC3,0xFF,0xE7,0x90,0x5A,0x6D,
0xE3,0xFF,0xF9,0x21,0x08,0x8A,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x6A,0x00,0x00,
0x00,0x32,0x99,0xCA,0xF4,0xDC,0xAF,0x35,0x00,0x00,0x00,0x00,0x77,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB7,0x77,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xB7,0x1A,0x37,0x37,0x37,0xC7,0xFF,0xF3,0x37,0x37,0x37,0x28,0x00,0x00,0x00,
0x00,0xB7,0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xFF,0xEF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xB7,0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xFF,0xEF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xB7,0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xFF,
0xEF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xFF,0xEF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xB7,0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,
0xFF,0xEF,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,
0xA7,0xFF,0xE3,0x6F,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0xA7,0xFF,0xE3,0x6F,0xFF,
0xFF,0x37,0x00,0x00,0x00,0x00,0xA7,0xFF,0xE3,0x6F,0xFF,0xFF,0x37,0x00,0x00,0x00,
0x00,0xA7,0xFF,0xE3,0x6F,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0xA7,0xFF,0xE3,0x6F,
0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0xA7,0xFF,0xE3,0x6F,0xFF,0xFF,0x37,0x00,0x00,
0x00,0x00,0xA7,0xFF,0xE3,0x6D,0xFF,0xFF,0x38,0x00,0x00,0x00,0x00,0xA8,0xFF,0xE1,
0x55,0xFF,0xFF,0x46,0x00,0x00,0x00,0x00,0xB8,0xFF,0xC8,0x36,0xFF,0xFF,0x63,0x00,
0x00,0x00,0x00,0xD7,0xFF,0xA9,0x12,0xFA,0xFF,0xBE,0x00,0x00,0x00,0x36,0xFF,0xFF,
0x81,0x00,0x97,0xFF,0xFF,0xAC,0x5A,0x71,0xEA,0xFF,0xF6,0x18,0x00,0x1B,0xDD,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFE,0x73,0x00,0x00,0x00,0x0C,0x8D,0xCC,0xF3,0xE1,0xB7,0x41,
0x00,0x00,0x00,0x00,0x03,0xEF,0xFF,0xD0,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFE,
0x18,0x00,0xA8,0xFF,0xFE,0x13,0x00,0x00,0x00,0x00,0xDA,0xFF,0xCB,0x00,0x00,0x5E,
0xFF,0xFF,0x53,0x00,0x00,0x00,0x1B,0xFF,0xFF,0x80,0x00,0x00,0x16,0xFE,0xFF,0x94,
0x00,0x00,0x00,0x5C,0xFF,0xFF,0x35,0x00,0x00,0x00,0xC9,0xFF,0xD6,0x00,0x00,0x00,
0x9D,0xFF,0xE8,0x01,0x00,0x00,0x00,0x7F,0xFF,0xFF,0x18,0x00,0x00,0xDE,0xFF,0x9F,
0x00,0x00,0x00,0x00,0x35,0xFF,0xFF,0x5A,0x00,0x1F,0xFF,0xFF,0x54,0x00,0x00,0x00,
0x00,0x01,0xE9,0xFF,0x99,0x00,0x5F,0xFF,0xFB,0x0F,0x00,0x00,0x00,0x00,0x00,0xA0,
0xFF,0xD8,0x00,0x9E,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0xFF,0xFF,0x17,
0xDC,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xFB,0xFF,0x72,0xFF,0xFF,0x29,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,0xFF,0xE8,0xFF,0xDE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x77,0xFF,0xFF,0xFF,0x93,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x2D,0xFF,0xFF,0xFF,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0x1B,
0x00,0x00,0x01,0xEF,0xFF,0x8C,0x00,0x00,0x00,0x83,0xFF,0xFC,0x08,0x69,0xFF,0xFF,
0x42,0x00,0x00,0x2A,0xFF,0xFF,0xC5,0x00,0x00,0x00,0xA9,0xFF,0xD7,0x00,0x3A,0xFF,
0xFF,0x69,0x00,0x00,0x63,0xFF,0xFF,0xF8,0x07,0x00,0x00,0xCF,0xFF,0xAA,0x00,0x0D,
0xFE,0xFF,0x90,0x00,0x00,0x9C,0xFF,0xFD,0xFF,0x39,0x00,0x01,0xF4,0xFF,0x7D,0x00,
0x00,0xDC,0xFF,0xB8,0x00,0x00,0xD5,0xFF,0xB9,0xFF,0x73,0x00,0x1B,0xFF,0xFF,0x50,
0x00,0x00,0xAD,0xFF,0xDF,0x00,0x10,0xFE,0xE6,0x77,0xFF,0xAC,0x00,0x41,0xFF,0xFF,
0x23,0x00,0x00,0x7D,0xFF,0xFD,0x09,0x48,0xFF,0xB9,0x4A,0xFF,0xE7,0x00,0x67,0xFF,
0xF4,0x01,0x00,0x00,0x4E,0xFF,0xFF,0x2B,0x7B,0xFF,0x89,0x19,0xFF,0xFF,0x1A,0x8B,
0xFF,0xC8,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x4D,0xAB,0xFF,0x52,0x00,0xE1,0xFF,0x4A,
0xAD,0xFF,0x9B,0x00,0x00,0x00,0x00,0xEF,0xFF,0x70,0xDB,0xFF,0x1C,0x00,0xA9,0xFF,
0x7A,0xCE,0xFF,0x6E,0x00,0x00,0x00,0x00,0xC1,0xFF,0xA0,0xFE,0xE6,0x00,0x00,0x70,
0xFF,0xAB,0xF0,0xFF,0x41,0x00,0x00,0x00,0x00,0x92,0xFF,0xEF,0xFF,0xAF,0x00,0x00,
0x38,0xFF,0xED,0xFF,0xFF,0x14,0x00,0x00,0x00,0x00,0x63,0xFF,0xFF,0xFF,0x78,0x00,
0x00,0x07,0xF9,0xFF,0xFF,0xE7,0x00,0x00,0x00,0x00,0x00,0x33,0xFF,0xFF,0xFF,0x42,
0x00,0x00,0x00,0xC8,0xFF,0xFF,0xBA,0x00,0x00,0x00,0x00,0x00,0x41,0xFF,0xFF,0xAA,
0x00,0x00,0x00,0x3C,0xFF,0xFF,0x8A,0x00,0x00,0xBD,0xFF,0xFD,0x23,0x00,0x00,0xAD,
0xFF,0xF3,0x14,0x00,0x00,0x3A,0xFF,0xFF,0x97,0x00,0x20,0xFC,0xFF,0x85,0x00,0x00,
0x00,0x00,0xB5,0xFF,0xF6,0x13,0x87,0xFF,0xF1,0x12,0x00,0x00,0x00,0x00,0x32,0xFF,
0xFF,0x80,0xE7,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xAD,0xFF,0xFC,0xFF,0xEF,
0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0xFF,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x63,0xFF,0xFF,0xFF,0x97,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xE1,
0xFF,0xE7,0xFF,0xFB,0x24,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFB,0x32,0xF8,0xFF,
0xA6,0x00,0x00,0x00,0x00,0x09,0xE7,0xFF,0xAB,0x00,0x9B,0xFF,0xFE,0x2F,0x00,0x00,
0x00,0x75,0xFF,0xFF,0x39,0x00,0x26,0xFD,0xFF,0xB5,0x00,0x00,0x0D,0xEC,0xFF,0xC3,
0x00,0x00,0x00,0xA6,0xFF,0xFF,0x3C,0x00,0x7D,0xFF,0xFF,0x4E,0x00,0x00,0x00,0x2C,
0xFE,0xFF,0xC3,0x00,0x03,0xDF,0xFF,0xE5,0x03,0x00,0x00,0x00,0x69,0xFF,0xFF,0x55,
0x00,0x70,0xFF,0xFF,0x4C,0x00,0x00,0x00,0xCD,0xFF,0xDE,0x03,0x00,0x0D,0xF0,0xFF,
0xB0,0x00,0x00,0x31,0xFF,0xFF,0x6D,0x00,0x00,0x00,0x8A,0xFF,0xFB,0x18,0x00,0x95,
0xFF,0xEE,0x0B,0x00,0x00,0x00,0x1C,0xFB,0xFF,0x73,0x08,0xEF,0xFF,0x85,0x00,0x00,
0x00,0x00,0x00,0xA4,0xFF,0xD2,0x59,0xFF,0xF9,0x19,0x00,0x00,0x00,0x00,0x00,0x31,
0xFF,0xFF,0xDD,0xFF,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBE,0xFF,0xFF,0xFF,
0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0xFF,0xFF,0xB8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x1F,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x8B,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3B,0x00,0xA3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x2F,0x00,0x23,0x37,0x37,0x37,0x37,0x6B,0xFF,0xFF,0xAE,0x00,0x00,0x00,0x00,
0x00,0x00,0x02,0xCA,0xFF,0xF4,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0xFF,0xFF,
0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x16,0xEE,0xFF,0xD6,0x05,0x00,0x00,0x00,0x00,
0x00,0x00,0xA1,0xFF,0xFF,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xFF,0xFF,0xA4,
0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xD4,0xFF,0xF1,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x75,0xFF,0xFF,0x6D,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0xF4,0xFF,0xCF,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0xAE,0xFF,0xFF,0x70,0x37,0x37,0x37,0x37,0x37,0x11,
0x2F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x4F,0x3B,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x12,0x63,0x63,0x63,0x5D,0x2F,0xFF,0xFF,
0xFF,0xEF,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,
0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,
0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,
0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,
0xCB,0x00,0x00,0x2F,0xFF,0xCB,0x00,0x00,0x2F,0xFF,0xE2,0x6F,0x68,0x2F,0xFF,0xFF,
0xFF,0xEF,0x00,0x00,0x4F,0xC3,0x43,0x00,0x00,0x00,0x00,0x2E,0xFF,0x90,0x00,0x00,
0x00,0x00,0x01,0xEC,0xD1,0x00,0x00,0x00,0x00,0x00,0xAD,0xFE,0x13,0x00,0x00,0x00,
0x00,0x6D,0xFF,0x51,0x00,0x00,0x00,0x00,0x2D,0xFF,0x92,0x00,0x00,0x00,0x00,0x01,
0xEB,0xD2,0x00,0x00,0x00,0x00,0x00,0xAC,0xFE,0x14,0x00,0x00,0x00,0x00,0x6B,0xFF,
0x53,0x00,0x00,0x00,0x00,0x2B,0xFF,0x93,0x00,0x00,0x00,0x00,0x01,0xEA,0xD4,0x00,
0x00,0x00,0x00,0x00,0xAA,0xFF,0x15,0x00,0x00,0x00,0x00,0x6A,0xFF,0x55,0x00,0x00,
0x00,0x00,0x29,0xFF,0x95,0x00,0x00,0x00,0x00,0x00,0xE9,0xD5,0x00,0x00,0x00,0x00,
0x00,0xA9,0xFF,0x17,0x00,0x00,0x00,0x00,0x68,0xFF,0x56,0x00,0x00,0x00,0x00,0x28,
0xFF,0x97,0x00,0x00,0x0E,0x63,0x63,0x63,0x62,0x23,0xFF,0xFF,0xFF,0xFB,0x00,0x00,
0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,
0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,
0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,
0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,0x00,0x00,0xFF,0xFB,0x00,
0x00,0x00,0xFF,0xFB,0x0F,0x6F,0x6F,0xFF,0xFB,0x23,0xFF,0xFF,0xFF,0xFB,0x00,0x00,
0x00,0x00,0x00,0x57,0x63,0x2E,0x00,0x00,0x00,0x00,0x00,0x25,0xFF,0xFF,0xBC,0x00,
0x00,0x00,0x00,0x00,0x88,0xFF,0xFF,0xFE,0x21,0x00,0x00,0x00,0x04,0xE7,0xFC,0x94,
0xFF,0x83,0x00,0x00,0x00,0x4F,0xFF,0xBD,0x26,0xFF,0xE4,0x03,0x00,0x00,0xB2,0xFF,
0x66,0x00,0xCF,0xFF,0x4B,0x00,0x19,0xFC,0xF9,0x12,0x00,0x72,0xFF,0xAF,0x00,0x79,
0xFF,0xAE,0x00,0x00,0x18,0xFC,0xFB,0x18,0x85,0xA7,0x40,0x00,0x00,0x00,0x82,0xA7,
0x43,0x00,0x00,0x00,0x68,0x8B,0x8B,0x8B,0x8B,0x8B,0x8B,0x8B,0x8B,0x87,0xBF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0x00,0x03,0x97,0x31,0x00,0x00,0x00,0xA5,
0xFF,0xE3,0x19,0x00,0x00,0x52,0xF6,0xFF,0xCB,0x09,0x00,0x00,0x39,0xEB,0xFF,0x9C,
0x00,0x00,0x00,0x25,0xC4,0x2C,0x00,0x00,0x00,0x00,0x3F,0xA3,0xD2,0xF4,0xD3,0x7A,
0x03,0x00,0x00,0x7D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x93,0x00,0x00,0x1F,0xDB,0x77,
0x38,0x38,0xD4,0xFF,0xFA,0x16,0x00,0x00,0x00,0x00,0x00,0x03,0x7F,0xFF,0xFF,0x3E,
0x00,0x00,0x1E,0x81,0xD0,0xF8,0xFF,0xFF,0xFF,0x59,0x00,0x47,0xF7,0xFF,0xBB,0x69,
0x79,0xFF,0xFF,0x5B,0x00,0xE1,0xFF,0x9B,0x00,0x00,0x4B,0xFF,0xFF,0x5B,0x09,0xFF,
0xFF,0xBF,0x24,0x3E,0xCB,0xFF,0xFF,0x5B,0x00,0xBF,0xFF,0xFF,0xFF,0xFF,0xE6,0xFE,
0xFF,0x5B,0x00,0x17,0xA7,0xED,0xDC,0x94,0x11,0xE2,0xFF,0x5B,0x04,0x07,0x07,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,
0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,
0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,
0xFF,0x2B,0xAE,0xEC,0xD6,0x88,0x05,0x00,0x93,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,
0xB6,0x00,0x93,0xFF,0xFF,0xCA,0x51,0x47,0xCD,0xFF,0xFF,0x47,0x93,0xFF,0xFF,0x0E,
0x00,0x00,0x2F,0xFF,0xFF,0x92,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x02,0xFC,0xFF,0xB6,
0x93,0xFF,0xFF,0x0B,0x00,0x00,0x09,0xFF,0xFF,0xA7,0x93,0xFF,0xFF,0x0B,0x00,0x00,
0x47,0xFF,0xFF,0x7C,0x93,0xFF,0xFF,0x9B,0x3C,0x51,0xE1,0xFF,0xF8,0x22,0x93,0xFF,
0xEC,0xFC,0xFF,0xFF,0xFF,0xFF,0x76,0x00,0x93,0xFF,0x92,0x3E,0xC3,0xF1,0xC5,0x52,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5A,0xBC,0xEB,0xE2,0xA6,0x23,0x00,0x02,0xB1,
0xFF,0xFF,0xFF,0xFF,0xFF,0x91,0x00,0x7A,0xFF,0xFF,0xBC,0x48,0x42,0x91,0x07,0x00,
0xE9,0xFF,0xDB,0x06,0x00,0x00,0x00,0x00,0x1D,0xFF,0xFF,0x91,0x00,0x00,0x00,0x00,
0x00,0x22,0xFF,0xFF,0x8E,0x00,0x00,0x00,0x00,0x00,0x01,0xF2,0xFF,0xD6,0x04,0x00,
0x00,0x00,0x00,0x00,0x92,0xFF,0xFF,0xB2,0x40,0x41,0xA1,0x34,0x00,0x0B,0xCF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xC4,0x00,0x00,0x05,0x7A,0xC9,0xF2,0xDD,0x9E,0x1C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x07,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,
0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7A,0xFF,0xFF,0x2B,0x00,0x00,0x0B,0x92,0xDD,0xE7,0xA1,0x7F,0xFF,
0xFF,0x2B,0x00,0x09,0xD1,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0x2B,0x00,0x7D,0xFF,
0xFF,0xA7,0x3E,0x5C,0xDB,0xFF,0xFF,0x2B,0x00,0xE1,0xFF,0xDD,0x04,0x00,0x00,0x7B,
0xFF,0xFF,0x2B,0x0C,0xFF,0xFF,0xA0,0x00,0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x1B,0xFF,
0xFF,0x9D,0x00,0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x01,0xF5,0xFF,0xD3,0x00,0x00,0x00,
0x7D,0xFF,0xFF,0x2B,0x00,0xAB,0xFF,0xFF,0x93,0x39,0x66,0xF1,0xFF,0xFF,0x2B,0x00,
0x25,0xEF,0xFF,0xFF,0xFF,0xFF,0xEB,0xFF,0xFF,0x2B,0x00,0x00,0x22,0xAD,0xE7,0xDE,
0x8E,0x1C,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,0x00,0x03,0x74,0xCA,0xF2,0xCB,0x78,
0x02,0x00,0x00,0x05,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x80,0xFF,0xFB,
0x6B,0x20,0x53,0xFC,0xFF,0x42,0x00,0xEC,0xFF,0x97,0x00,0x00,0x00,0xBE,0xFF,0x89,
0x1E,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAB,0x21,0xFF,0xFF,0xD9,0xBF,0xBF,
0xBF,0xBF,0xBF,0x76,0x01,0xF0,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,
0xFF,0xFF,0x80,0x1E,0x14,0x45,0x5A,0x00,0x00,0x08,0xC7,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF6,0x1A,0x00,0x00,0x03,0x70,0xC5,0xF0,0xE3,0xB5,0x49,0x00,0x00,0x00,0x03,0x7E,
0xD6,0xF6,0xD8,0x23,0x00,0x00,0x83,0xFF,0xFF,0xFF,0xF8,0x08,0x00,0x00,0xEE,0xFF,
0xDE,0x3C,0x38,0x00,0x00,0x13,0xFF,0xFF,0x8F,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,
0x83,0x00,0x00,0x00,0x70,0xF8,0xFF,0xFF,0xFF,0xFF,0x67,0x00,0x7B,0xFF,0xFF,0xFF,
0xFF,0xFF,0x67,0x00,0x0B,0x38,0xFF,0xFF,0x8F,0x17,0x09,0x00,0x00,0x23,0xFF,0xFF,
0x83,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,0x83,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,
0x83,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,0x83,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,
0x83,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,0x83,0x00,0x00,0x00,0x00,0x23,0xFF,0xFF,
0x83,0x00,0x00,0x00,0x00,0x00,0x34,0xB0,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0x43,0x00,
0x3D,0xF9,0xFF,0xF8,0xEE,0xFF,0xFF,0xFA,0xF3,0x40,0x00,0xBD,0xFF,0xE1,0x11,0x06,
0xAF,0xFF,0xBA,0x00,0x00,0x00,0xE1,0xFF,0xA5,0x00,0x00,0x69,0xFF,0xF2,0x00,0x00,
0x00,0x9C,0xFF,0xEE,0x39,0x24,0xC9,0xFF,0xC1,0x00,0x00,0x00,0x10,0xD7,0xFF,0xFF,
0xFF,0xFF,0xED,0x2C,0x00,0x00,0x00,0x39,0xF7,0xCF,0x87,0x96,0x6D,0x0F,0x00,0x00,
0x00,0x00,0xA3,0xFF,0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,
0xF5,0xEB,0xEA,0xD8,0xAE,0x3E,0x00,0x00,0x18,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF8,0x28,0x02,0xD6,0xFF,0x36,0x0C,0x13,0x1E,0x71,0xFF,0xFF,0x5F,0x2C,0xFF,0xFD,
0x26,0x00,0x00,0x00,0x64,0xFF,0xFF,0x2A,0x04,0xE0,0xFF,0xF8,0xC1,0xB8,0xEA,0xFF,
0xFF,0x74,0x00,0x00,0x19,0x93,0xDB,0xF5,0xF0,0xD1,0x9C,0x30,0x00,0x00,0x00,0x00,
0x04,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,
0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,
0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0A,0x00,0x00,0x00,0x00,
0x00,0x00,0x93,0xFF,0xFD,0x11,0x90,0xD7,0xEB,0xA5,0x10,0x00,0x93,0xFF,0xFA,0xDE,
0xFF,0xFF,0xFF,0xFF,0xAA,0x00,0x93,0xFF,0xFF,0xE7,0x73,0x5B,0xE6,0xFF,0xFC,0x0C,
0x93,0xFF,0xFF,0x21,0x00,0x00,0x84,0xFF,0xFF,0x2A,0x93,0xFF,0xFF,0x0B,0x00,0x00,
0x6D,0xFF,0xFF,0x37,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x6B,0xFF,0xFF,0x37,0x93,0xFF,
0xFF,0x0B,0x00,0x00,0x6B,0xFF,0xFF,0x37,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x6B,0xFF,
0xFF,0x37,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x6B,0xFF,0xFF,0x37,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x6B,0xFF,0xFF,0x37,0x00,0x00,0x43,0xC3,0x96,0x01,0xBC,0xFF,0xFF,0x33,
0x56,0xE3,0xB5,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,
0x93,0xFF,0xFF,0x0B,0x93,0xFF,0xFF,0x0B,0x93,0xFF,0xFF,0x0B,0x93,0xFF,0xFF,0x0B,
0x93,0xFF,0xFF,0x0B,0x93,0xFF,0xFF,0x0B,0x93,0xFF,0xFF,0x0B,0x93,0xFF,0xFF,0x0B,
0x93,0xFF,0xFF,0x0B,0x00,0x00,0x3F,0xC3,0x9A,0x02,0x00,0x00,0xB4,0xFF,0xFF,0x3B,
0x00,0x00,0x52,0xE2,0xB9,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x8F,0xFF,0xFF,0x13,0x00,0x00,0x8F,0xFF,0xFF,0x13,0x00,0x00,
0x8F,0xFF,0xFF,0x13,0x00,0x00,0x8F,0xFF,0xFF,0x13,0x00,0x00,0x8F,0xFF,0xFF,0x13,
0x00,0x00,0x8F,0xFF,0xFF,0x13,0x00,0x00,0x8F,0xFF,0xFF,0x13,0x00,0x00,0x8F,0xFF,
0xFF,0x13,0x00,0x00,0x8F,0xFF,0xFF,0x13,0x00,0x00,0x8F,0xFF,0xFF,0x13,0x00,0x00,
0x9E,0xFF,0xFF,0x0A,0x18,0x32,0xDD,0xFF,0xE7,0x00,0xAA,0xFF,0xFF,0xFF,0x84,0x00,
0xD9,0xFB,0xDA,0x86,0x04,0x00,0x00,0x00,0x29,0x47,0x46,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x93,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFB,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x93,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFB,0x00,0x00,0x0A,
0xD0,0xFF,0xE5,0x1C,0x93,0xFF,0xFB,0x00,0x00,0xA9,0xFF,0xF4,0x32,0x00,0x93,0xFF,
0xFB,0x00,0x77,0xFF,0xFD,0x4F,0x00,0x00,0x93,0xFF,0xFB,0x48,0xFD,0xFF,0x71,0x00,
0x00,0x00,0x93,0xFF,0xFE,0xEF,0xFF,0xFE,0x36,0x00,0x00,0x00,0x93,0xFF,0xFF,0xFF,
0xFC,0xFF,0xD2,0x05,0x00,0x00,0x93,0xFF,0xFF,0xD3,0x3E,0xFC,0xFF,0x7E,0x00,0x00,
0x93,0xFF,0xFE,0x1C,0x00,0x95,0xFF,0xF9,0x2B,0x00,0x93,0xFF,0xFB,0x00,0x00,0x12,
0xEC,0xFF,0xC8,0x02,0x93,0xFF,0xFB,0x00,0x00,0x00,0x67,0xFF,0xFF,0x70,0x00,0x00,
0x5A,0x9B,0x9B,0x07,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x93,
0xFF,0xFF,0x0B,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x93,0xFF,
0xFF,0x0B,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x93,0xFF,0xFF,
0x0B,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x85,0xFF,0xFF,0x4E,
0x00,0x4F,0xFF,0xFF,0xFF,0x0D,0x02,0x92,0xEC,0xE7,0x29,0x00,0x93,0xFF,0xA1,0x14,
0x98,0xE1,0xD7,0x85,0x01,0x12,0xA2,0xEF,0xE1,0x87,0x03,0x00,0x93,0xFF,0xD6,0xDE,
0xFF,0xFF,0xFF,0xFF,0x93,0xD9,0xFF,0xFF,0xFF,0xFF,0x77,0x00,0x93,0xFF,0xFF,0xE6,
0x6C,0x6B,0xF9,0xFF,0xFF,0xE6,0x6C,0x6B,0xF9,0xFF,0xD8,0x00,0x93,0xFF,0xFF,0x20,
0x00,0x00,0xB4,0xFF,0xFF,0x20,0x00,0x00,0xB4,0xFF,0xF8,0x01,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x9D,0xFF,0xFF,0x0B,0x00,0x00,0x9D,0xFF,0xFF,0x07,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x9B,0xFF,0xFF,0x0B,0x00,0x00,0x9B,0xFF,0xFF,0x07,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x9B,0xFF,0xFF,0x0B,0x00,0x00,0x9B,0xFF,0xFF,0x07,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x9B,0xFF,0xFF,0x0B,0x00,0x00,0x9B,0xFF,0xFF,0x07,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x9B,0xFF,0xFF,0x0B,0x00,0x00,0x9B,0xFF,0xFF,0x07,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x9B,0xFF,0xFF,0x0B,0x00,0x00,0x9B,0xFF,0xFF,0x07,0x93,0xFF,0xA1,0x0F,
0x8F,0xD6,0xEB,0xA5,0x10,0x00,0x93,0xFF,0xD7,0xDC,0xFF,0xFF,0xFF,0xFF,0xAA,0x00,
0x93,0xFF,0xFF,0xE7,0x73,0x5B,0xE6,0xFF,0xFC,0x0C,0x93,0xFF,0xFF,0x21,0x00,0x00,
0x84,0xFF,0xFF,0x2A,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x6D,0xFF,0xFF,0x37,0x93,0xFF,
0xFF,0x0B,0x00,0x00,0x6B,0xFF,0xFF,0x37,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x6B,0xFF,
0xFF,0x37,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x6B,0xFF,0xFF,0x37,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x6B,0xFF,0xFF,0x37,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x6B,0xFF,0xFF,0x37,
0x00,0x00,0x02,0x6F,0xC6,0xF2,0xD3,0x90,0x0F,0x00,0x00,0x00,0x05,0xC1,0xFF,0xFF,
0xFF,0xFF,0xFF,0xE5,0x22,0x00,0x00,0x83,0xFF,0xFF,0x96,0x3B,0x6F,0xF8,0xFF,0xC1,
0x01,0x00,0xEC,0xFF,0xCA,0x00,0x00,0x00,0x8B,0xFF,0xFF,0x2B,0x1D,0xFF,0xFF,0x8B,
0x00,0x00,0x00,0x4C,0xFF,0xFF,0x5C,0x20,0xFF,0xFF,0x8A,0x00,0x00,0x00,0x4B,0xFF,
0xFF,0x60,0x00,0xEE,0xFF,0xC6,0x00,0x00,0x00,0x87,0xFF,0xFF,0x2D,0x00,0x88,0xFF,
0xFF,0x90,0x36,0x69,0xF6,0xFF,0xC5,0x02,0x00,0x06,0xC4,0xFF,0xFF,0xFF,0xFF,0xFF,
0xE7,0x24,0x00,0x00,0x00,0x03,0x72,0xC9,0xF3,0xD5,0x92,0x11,0x00,0x00,0x00,0x00,
0x93,0xFF,0xA4,0x2B,0xAD,0xEA,0xD7,0x8A,0x06,0x00,0x93,0xFF,0xED,0xF9,0xFF,0xFF,
0xFF,0xFF,0xB8,0x00,0x93,0xFF,0xFF,0xCA,0x51,0x47,0xCD,0xFF,0xFF,0x47,0x93,0xFF,
0xFF,0x0E,0x00,0x00,0x2F,0xFF,0xFF,0x92,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x02,0xFC,
0xFF,0xB6,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x09,0xFF,0xFF,0xA7,0x93,0xFF,0xFF,0x0B,
0x00,0x00,0x4B,0xFF,0xFF,0x7C,0x93,0xFF,0xFF,0xA1,0x3E,0x53,0xE3,0xFF,0xF8,0x23,
0x93,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x76,0x00,0x93,0xFF,0xFD,0x45,0xC7,0xF1,
0xC5,0x52,0x00,0x00,0x93,0xFF,0xFF,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,
0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,
0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x92,
0xDD,0xE8,0xA5,0x1A,0xF9,0xFF,0x2B,0x00,0x0A,0xD4,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,
0xFF,0x2B,0x00,0x85,0xFF,0xFF,0xA7,0x3E,0x5C,0xDB,0xFF,0xFF,0x2B,0x00,0xE4,0xFF,
0xDD,0x04,0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x11,0xFF,0xFF,0xA0,0x00,0x00,0x00,0x7B,
0xFF,0xFF,0x2B,0x17,0xFF,0xFF,0x9D,0x00,0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x00,0xF2,
0xFF,0xD3,0x00,0x00,0x00,0x7D,0xFF,0xFF,0x2B,0x00,0xA4,0xFF,0xFF,0x93,0x39,0x66,
0xF1,0xFF,0xFF,0x2B,0x00,0x22,0xEE,0xFF,0xFF,0xFF,0xFF,0xF8,0xFF,0xFF,0x2B,0x00,
0x00,0x21,0xAD,0xE7,0xE0,0x8F,0x76,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x7A,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,0x2B,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7B,0xFF,0xFF,0x2B,0x00,0x00,0x93,0xFF,0x9E,0x0A,0xA5,0xF5,0xC7,0x93,
0xFF,0xB6,0xB0,0xFF,0xFF,0x97,0x93,0xFF,0xFE,0xFD,0xA0,0x65,0x36,0x93,0xFF,0xFF,
0x6B,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0C,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,
0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,
0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x93,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,
0x00,0x02,0x6A,0xD0,0xF4,0xD6,0x9E,0x26,0x00,0x00,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,
0xDB,0x05,0x00,0xEB,0xFF,0xAE,0x11,0x22,0x89,0x34,0x00,0x00,0xE8,0xFF,0xD0,0x36,
0x00,0x00,0x00,0x00,0x00,0x5A,0xF7,0xFF,0xFF,0xD3,0x5C,0x03,0x00,0x00,0x00,0x1B,
0x93,0xF2,0xFF,0xFF,0xBE,0x03,0x00,0x00,0x00,0x00,0x0B,0x91,0xFF,0xFF,0x35,0x01,
0xA7,0x81,0x21,0x08,0x76,0xFF,0xFF,0x2E,0x45,0xFD,0xFF,0xFF,0xFE,0xFF,0xFF,0xBA,
0x02,0x00,0x30,0xA4,0xD8,0xF5,0xD4,0x81,0x0C,0x00,0x00,0x00,0x00,0x00,0x90,0xAF,
0x4C,0x00,0x00,0x00,0x00,0x00,0xE9,0xFF,0x6F,0x00,0x00,0x00,0x00,0x07,0xFE,0xFF,
0x6F,0x00,0x00,0x00,0x8D,0xF5,0xFF,0xFF,0xFF,0xFF,0xEB,0x00,0x9F,0xFF,0xFF,0xFF,
0xFF,0xFF,0xEB,0x00,0x0E,0x47,0xFF,0xFF,0x7D,0x17,0x16,0x00,0x00,0x33,0xFF,0xFF,
0x6F,0x00,0x00,0x00,0x00,0x33,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x00,0x33,0xFF,0xFF,
0x6F,0x00,0x00,0x00,0x00,0x2C,0xFF,0xFF,0x81,0x00,0x00,0x00,0x00,0x0F,0xFE,0xFF,
0xD6,0x34,0x2A,0x00,0x00,0x00,0xAE,0xFF,0xFF,0xFF,0xF4,0x04,0x00,0x00,0x10,0xA0,
0xE5,0xED,0xC1,0x1B,0xAF,0xFF,0xF3,0x00,0x00,0x00,0x97,0xFF,0xFF,0x0F,0xAF,0xFF,
0xF3,0x00,0x00,0x00,0x97,0xFF,0xFF,0x0F,0xAF,0xFF,0xF3,0x00,0x00,0x00,0x97,0xFF,
0xFF,0x0F,0xAF,0xFF,0xF3,0x00,0x00,0x00,0x97,0xFF,0xFF,0x0F,0xAF,0xFF,0xF3,0x00,
0x00,0x00,0x97,0xFF,0xFF,0x0F,0xAF,0xFF,0xF4,0x00,0x00,0x00,0x97,0xFF,0xFF,0x0F,
0xA3,0xFF,0xFF,0x0A,0x00,0x00,0xB4,0xFF,0xFF,0x0F,0x83,0xFF,0xFF,0x9A,0x53,0xAB,
0xFF,0xFF,0xFF,0x0F,0x28,0xFE,0xFF,0xFF,0xFF,0xFD,0xA9,0xFF,0xFF,0x0F,0x00,0x51,
0xD3,0xF0,0xB9,0x4A,0x2A,0xFF,0xFF,0x0F,0x93,0xFF,0xFC,0x11,0x00,0x00,0x00,0x92,
0xFF,0xEC,0x04,0x3B,0xFF,0xFF,0x59,0x00,0x00,0x00,0xDE,0xFF,0x9A,0x00,0x01,0xE2,
0xFF,0xA5,0x00,0x00,0x2A,0xFF,0xFF,0x44,0x00,0x00,0x8B,0xFF,0xEE,0x03,0x00,0x76,
0xFF,0xEB,0x03,0x00,0x00,0x33,0xFF,0xFF,0x3E,0x00,0xC3,0xFF,0x98,0x00,0x00,0x00,
0x00,0xDB,0xFF,0x86,0x0F,0xFC,0xFF,0x42,0x00,0x00,0x00,0x00,0x83,0xFF,0xCB,0x50,
0xFF,0xE9,0x03,0x00,0x00,0x00,0x00,0x2B,0xFF,0xFD,0xA7,0xFF,0x96,0x00,0x00,0x00,
0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,
0xFF,0xE8,0x02,0x00,0x00,0x00,0x00,0x00,0x62,0xFF,0xFF,0x3B,0x00,0x00,0x7B,0xFF,
0xFF,0x1F,0x00,0x00,0x88,0xFF,0xE7,0x00,0x20,0xFF,0xFF,0x74,0x00,0x00,0xB9,0xFF,
0xFF,0x60,0x00,0x00,0xC1,0xFF,0xA7,0x00,0x00,0xDD,0xFF,0xAC,0x00,0x04,0xF3,0xF8,
0xFF,0xA0,0x00,0x04,0xF5,0xFF,0x68,0x00,0x00,0x9A,0xFF,0xE5,0x00,0x35,0xFF,0xA1,
0xFF,0xE1,0x00,0x32,0xFF,0xFF,0x28,0x00,0x00,0x57,0xFF,0xFF,0x1E,0x73,0xFF,0x5C,
0xDF,0xFF,0x22,0x6A,0xFF,0xE8,0x00,0x00,0x00,0x16,0xFE,0xFF,0x50,0xAF,0xFF,0x2A,
0xAB,0xFF,0x5E,0x9D,0xFF,0xA9,0x00,0x00,0x00,0x00,0xD2,0xFF,0x7E,0xE8,0xED,0x01,
0x6F,0xFF,0x97,0xCA,0xFF,0x69,0x00,0x00,0x00,0x00,0x8F,0xFF,0xCE,0xFF,0xB2,0x00,
0x30,0xFF,0xD4,0xF5,0xFF,0x2A,0x00,0x00,0x00,0x00,0x4C,0xFF,0xFF,0xFF,0x76,0x00,
0x02,0xF0,0xFF,0xFF,0xEA,0x00,0x00,0x00,0x00,0x00,0x0D,0xFB,0xFF,0xFF,0x39,0x00,
0x00,0xB3,0xFF,0xFF,0xAB,0x00,0x00,0x00,0x37,0xFE,0xFF,0x9A,0x00,0x00,0x58,0xFF,
0xFF,0x55,0x00,0x97,0xFF,0xFC,0x2C,0x00,0xCF,0xFF,0xC0,0x00,0x00,0x11,0xE9,0xFF,
0xB4,0x45,0xFF,0xFD,0x2F,0x00,0x00,0x00,0x5C,0xFF,0xFF,0xDC,0xFF,0x97,0x00,0x00,
0x00,0x00,0x00,0xC4,0xFF,0xFF,0xEF,0x14,0x00,0x00,0x00,0x00,0x12,0xEB,0xFF,0xFF,
0xE3,0x0C,0x00,0x00,0x00,0x00,0x98,0xFF,0xD0,0xF6,0xFF,0x92,0x00,0x00,0x00,0x36,
0xFD,0xFF,0x47,0x84,0xFF,0xFD,0x39,0x00,0x02,0xCC,0xFF,0xC9,0x00,0x0D,0xE4,0xFF,
0xD5,0x06,0x6A,0xFF,0xFF,0x45,0x00,0x00,0x53,0xFF,0xFF,0x81,0x8C,0xFF,0xFC,0x17,
0x00,0x00,0x00,0x99,0xFF,0xE7,0x03,0x27,0xFF,0xFF,0x6C,0x00,0x00,0x00,0xE4,0xFF,
0x91,0x00,0x00,0xC0,0xFF,0xC5,0x00,0x00,0x31,0xFF,0xFF,0x38,0x00,0x00,0x59,0xFF,
0xFE,0x1F,0x00,0x7D,0xFF,0xDE,0x00,0x00,0x00,0x07,0xEC,0xFF,0x76,0x00,0xC8,0xFF,
0x86,0x00,0x00,0x00,0x00,0x8C,0xFF,0xC5,0x0F,0xFC,0xFF,0x2D,0x00,0x00,0x00,0x00,
0x27,0xFF,0xFD,0x63,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xFF,0xE6,0xFF,
0x7B,0x00,0x00,0x00,0x00,0x00,0x00,0x59,0xFF,0xFF,0xFF,0x23,0x00,0x00,0x00,0x00,
0x00,0x00,0x07,0xEF,0xFF,0xC9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFB,0xFF,
0x69,0x00,0x00,0x00,0x00,0x00,0x1B,0x3C,0xC2,0xFF,0xEB,0x09,0x00,0x00,0x00,0x00,
0x00,0xC4,0xFF,0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x05,0xF7,0xF5,0xCA,0x4B,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x8B,0x00,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x6F,0x00,0x12,0x17,0x17,0x35,0xF5,
0xFF,0xC9,0x04,0x00,0x00,0x00,0x01,0xBC,0xFF,0xF5,0x26,0x00,0x00,0x00,0x00,0x6F,
0xFF,0xFF,0x69,0x00,0x00,0x00,0x00,0x29,0xF7,0xFF,0xB6,0x00,0x00,0x00,0x00,0x05,
0xCD,0xFF,0xEC,0x18,0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0x66,0x13,0x13,0x13,0x0D,
0x29,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAF,0x43,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xAF,0x00,0x00,0x00,0x00,0x00,0x29,0x5A,0x5D,0x00,0x00,0x51,0xFD,0xFF,0xEF,
0x00,0x00,0xB1,0xFF,0x9B,0x0C,0x00,0x00,0xC7,0xFF,0x5B,0x00,0x00,0x00,0xBE,0xFF,
0x5E,0x00,0x00,0x00,0xB0,0xFF,0x65,0x00,0x00,0x00,0xA2,0xFF,0x6C,0x00,0x00,0x00,
0xCF,0xFF,0x5F,0x00,0x36,0xC3,0xFF,0xD5,0x17,0x00,0x5B,0xFF,0xFF,0x6E,0x01,0x00,
0x03,0x39,0xF2,0xFF,0x45,0x00,0x00,0x00,0xAB,0xFF,0x6A,0x00,0x00,0x00,0xA9,0xFF,
0x69,0x00,0x00,0x00,0xB6,0xFF,0x62,0x00,0x00,0x00,0xC4,0xFF,0x5B,0x00,0x00,0x00,
0xC2,0xFF,0x62,0x00,0x00,0x00,0x99,0xFF,0xDB,0x74,0x00,0x00,0x1F,0xC2,0xF7,0xEF,
0x15,0x67,0x35,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,
0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,
0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,
0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x33,0xFF,0x83,0x00,
0x0E,0x63,0x55,0x19,0x00,0x00,0x00,0x23,0xFF,0xFF,0xF3,0x22,0x00,0x00,0x00,0x18,
0xC7,0xFF,0x78,0x00,0x00,0x00,0x00,0x93,0xFF,0x8E,0x00,0x00,0x00,0x00,0x97,0xFF,
0x85,0x00,0x00,0x00,0x00,0x9E,0xFF,0x78,0x00,0x00,0x00,0x00,0xA5,0xFF,0x6A,0x00,
0x00,0x00,0x00,0x98,0xFF,0x97,0x00,0x00,0x00,0x00,0x39,0xEA,0xFD,0xAF,0x12,0x00,
0x00,0x09,0x9B,0xFF,0xFF,0x1F,0x00,0x00,0x7E,0xFF,0xD1,0x23,0x00,0x00,0x00,0xA3,
0xFF,0x72,0x00,0x00,0x00,0x00,0xA2,0xFF,0x70,0x00,0x00,0x00,0x00,0x9B,0xFF,0x7E,
0x00,0x00,0x00,0x00,0x94,0xFF,0x8B,0x00,0x00,0x00,0x00,0x9B,0xFF,0x89,0x00,0x00,
0x0F,0x88,0xEF,0xFF,0x60,0x00,0x00,0x23,0xFF,0xF1,0xA8,0x06,0x00,0x00,0x00,0x00,
0x00,0x12,0x9C,0xD4,0xA0,0x1C,0x00,0x00,0x00,0x00,0x0B,0xD3,0xFF,0xFF,0xFF,0xEA,
0x40,0x11,0xC4,0x5C,0x1A,0xCA,0x97,0x20,0xAC,0xFF,0xFE,0xF8,0xFF,0x93,0x00,0x06,
0x04,0x00,0x01,0x72,0xE0,0xED,0x83,0x02,
};
leRasterFont NotoSansCJKsc_Bold16 =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoSansCJKsc_Bold16_glyphs, // glyph table variable pointer
11768, // data size
},
LE_RASTER_FONT,
},
23,
17,
LE_FONT_BPP_8, // bits per pixel
NotoSansCJKsc_Bold16_data, // kerning table
};
/*********************************
* Legato Font Asset
* Name: NotoSansCJKsc_Bold24
* Height: 30
* Baseline: 22
* Style: Antialias
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoSansCJKsc_Bold24_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x05,0x00,0x13,0x00,0x09,0x00,
0x02,0x00,0x13,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x0A,0x00,
0x09,0x00,0x0E,0x00,0x02,0x00,0x13,0x00,0x00,0x00,0x0A,0x00,0x60,0x00,0x00,0x00,
0x23,0x00,0x0E,0x00,0x12,0x00,0x0E,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,
0xBC,0x00,0x00,0x00,0x24,0x00,0x0C,0x00,0x18,0x00,0x0E,0x00,0x01,0x00,0x15,0x00,
0x00,0x00,0x0C,0x00,0xB8,0x01,0x00,0x00,0x25,0x00,0x17,0x00,0x12,0x00,0x17,0x00,
0x00,0x00,0x12,0x00,0x00,0x00,0x17,0x00,0xD8,0x02,0x00,0x00,0x26,0x00,0x12,0x00,
0x12,0x00,0x12,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x12,0x00,0x78,0x04,0x00,0x00,
0x27,0x00,0x04,0x00,0x09,0x00,0x08,0x00,0x02,0x00,0x13,0x00,0x00,0x00,0x04,0x00,
0xBC,0x05,0x00,0x00,0x28,0x00,0x06,0x00,0x19,0x00,0x09,0x00,0x02,0x00,0x14,0x00,
0x00,0x00,0x06,0x00,0xE0,0x05,0x00,0x00,0x29,0x00,0x07,0x00,0x19,0x00,0x09,0x00,
0x01,0x00,0x14,0x00,0x00,0x00,0x07,0x00,0x78,0x06,0x00,0x00,0x2A,0x00,0x0A,0x00,
0x0A,0x00,0x0C,0x00,0x01,0x00,0x14,0x00,0x00,0x00,0x0A,0x00,0x28,0x07,0x00,0x00,
0x2B,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x0E,0x00,
0x8C,0x07,0x00,0x00,0x2C,0x00,0x06,0x00,0x0B,0x00,0x08,0x00,0x01,0x00,0x05,0x00,
0x00,0x00,0x06,0x00,0x50,0x08,0x00,0x00,0x2D,0x00,0x07,0x00,0x03,0x00,0x09,0x00,
0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,0x94,0x08,0x00,0x00,0x2E,0x00,0x06,0x00,
0x05,0x00,0x08,0x00,0x01,0x00,0x05,0x00,0x00,0x00,0x06,0x00,0xAC,0x08,0x00,0x00,
0x2F,0x00,0x09,0x00,0x18,0x00,0x09,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x09,0x00,
0xCC,0x08,0x00,0x00,0x30,0x00,0x0D,0x00,0x12,0x00,0x0E,0x00,0x01,0x00,0x12,0x00,
0x00,0x00,0x0D,0x00,0xA4,0x09,0x00,0x00,0x31,0x00,0x0C,0x00,0x12,0x00,0x0E,0x00,
0x01,0x00,0x12,0x00,0x00,0x00,0x0C,0x00,0x90,0x0A,0x00,0x00,0x32,0x00,0x0D,0x00,
0x12,0x00,0x0E,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0D,0x00,0x68,0x0B,0x00,0x00,
0x33,0x00,0x0D,0x00,0x12,0x00,0x0E,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0D,0x00,
0x54,0x0C,0x00,0x00,0x34,0x00,0x0E,0x00,0x12,0x00,0x0E,0x00,0x00,0x00,0x12,0x00,
0x00,0x00,0x0E,0x00,0x40,0x0D,0x00,0x00,0x35,0x00,0x0D,0x00,0x12,0x00,0x0E,0x00,
0x00,0x00,0x12,0x00,0x00,0x00,0x0D,0x00,0x3C,0x0E,0x00,0x00,0x36,0x00,0x0D,0x00,
0x12,0x00,0x0E,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0D,0x00,0x28,0x0F,0x00,0x00,
0x37,0x00,0x0C,0x00,0x12,0x00,0x0E,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0C,0x00,
0x14,0x10,0x00,0x00,0x38,0x00,0x0D,0x00,0x12,0x00,0x0E,0x00,0x01,0x00,0x12,0x00,
0x00,0x00,0x0D,0x00,0xEC,0x10,0x00,0x00,0x39,0x00,0x0D,0x00,0x12,0x00,0x0E,0x00,
0x00,0x00,0x12,0x00,0x00,0x00,0x0D,0x00,0xD8,0x11,0x00,0x00,0x3A,0x00,0x06,0x00,
0x0E,0x00,0x08,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x06,0x00,0xC4,0x12,0x00,0x00,
0x3B,0x00,0x06,0x00,0x14,0x00,0x08,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x06,0x00,
0x18,0x13,0x00,0x00,0x3C,0x00,0x0E,0x00,0x0C,0x00,0x0E,0x00,0x00,0x00,0x0F,0x00,
0x00,0x00,0x0E,0x00,0x90,0x13,0x00,0x00,0x3D,0x00,0x0E,0x00,0x0A,0x00,0x0E,0x00,
0x00,0x00,0x0E,0x00,0x00,0x00,0x0E,0x00,0x38,0x14,0x00,0x00,0x3E,0x00,0x0E,0x00,
0x0C,0x00,0x0E,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0E,0x00,0xC4,0x14,0x00,0x00,
0x3F,0x00,0x0B,0x00,0x13,0x00,0x0C,0x00,0x01,0x00,0x13,0x00,0x00,0x00,0x0B,0x00,
0x6C,0x15,0x00,0x00,0x40,0x00,0x16,0x00,0x17,0x00,0x18,0x00,0x01,0x00,0x12,0x00,
0x00,0x00,0x16,0x00,0x40,0x16,0x00,0x00,0x41,0x00,0x11,0x00,0x12,0x00,0x0F,0x00,
0xFF,0xFF,0x12,0x00,0x00,0x00,0x11,0x00,0x3C,0x18,0x00,0x00,0x42,0x00,0x0E,0x00,
0x12,0x00,0x10,0x00,0x02,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,0x70,0x19,0x00,0x00,
0x43,0x00,0x0F,0x00,0x12,0x00,0x10,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0F,0x00,
0x6C,0x1A,0x00,0x00,0x44,0x00,0x0E,0x00,0x12,0x00,0x11,0x00,0x02,0x00,0x12,0x00,
0x00,0x00,0x0E,0x00,0x7C,0x1B,0x00,0x00,0x45,0x00,0x0C,0x00,0x12,0x00,0x0F,0x00,
0x02,0x00,0x12,0x00,0x00,0x00,0x0C,0x00,0x78,0x1C,0x00,0x00,0x46,0x00,0x0C,0x00,
0x12,0x00,0x0E,0x00,0x02,0x00,0x12,0x00,0x00,0x00,0x0C,0x00,0x50,0x1D,0x00,0x00,
0x47,0x00,0x0F,0x00,0x12,0x00,0x11,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0F,0x00,
0x28,0x1E,0x00,0x00,0x48,0x00,0x0E,0x00,0x12,0x00,0x12,0x00,0x02,0x00,0x12,0x00,
0x00,0x00,0x0E,0x00,0x38,0x1F,0x00,0x00,0x49,0x00,0x04,0x00,0x12,0x00,0x08,0x00,
0x02,0x00,0x12,0x00,0x00,0x00,0x04,0x00,0x34,0x20,0x00,0x00,0x4A,0x00,0x0C,0x00,
0x12,0x00,0x0E,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0C,0x00,0x7C,0x20,0x00,0x00,
0x4B,0x00,0x0F,0x00,0x12,0x00,0x10,0x00,0x02,0x00,0x12,0x00,0x00,0x00,0x0F,0x00,
0x54,0x21,0x00,0x00,0x4C,0x00,0x0B,0x00,0x12,0x00,0x0E,0x00,0x02,0x00,0x12,0x00,
0x00,0x00,0x0B,0x00,0x64,0x22,0x00,0x00,0x4D,0x00,0x11,0x00,0x12,0x00,0x15,0x00,
0x02,0x00,0x12,0x00,0x00,0x00,0x11,0x00,0x2C,0x23,0x00,0x00,0x4E,0x00,0x0E,0x00,
0x12,0x00,0x12,0x00,0x02,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,0x60,0x24,0x00,0x00,
0x4F,0x00,0x11,0x00,0x12,0x00,0x12,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x11,0x00,
0x5C,0x25,0x00,0x00,0x50,0x00,0x0D,0x00,0x12,0x00,0x10,0x00,0x02,0x00,0x12,0x00,
0x00,0x00,0x0D,0x00,0x90,0x26,0x00,0x00,0x51,0x00,0x11,0x00,0x17,0x00,0x12,0x00,
0x01,0x00,0x12,0x00,0x00,0x00,0x11,0x00,0x7C,0x27,0x00,0x00,0x52,0x00,0x0E,0x00,
0x12,0x00,0x10,0x00,0x02,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,0x04,0x29,0x00,0x00,
0x53,0x00,0x0E,0x00,0x12,0x00,0x0F,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,
0x00,0x2A,0x00,0x00,0x54,0x00,0x0F,0x00,0x12,0x00,0x0F,0x00,0x00,0x00,0x12,0x00,
0x00,0x00,0x0F,0x00,0xFC,0x2A,0x00,0x00,0x55,0x00,0x0E,0x00,0x12,0x00,0x12,0x00,
0x02,0x00,0x12,0x00,0x00,0x00,0x0E,0x00,0x0C,0x2C,0x00,0x00,0x56,0x00,0x10,0x00,
0x12,0x00,0x0F,0x00,0xFF,0xFF,0x12,0x00,0x00,0x00,0x10,0x00,0x08,0x2D,0x00,0x00,
0x57,0x00,0x16,0x00,0x12,0x00,0x16,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x16,0x00,
0x28,0x2E,0x00,0x00,0x58,0x00,0x0F,0x00,0x12,0x00,0x0F,0x00,0x00,0x00,0x12,0x00,
0x00,0x00,0x0F,0x00,0xB4,0x2F,0x00,0x00,0x59,0x00,0x10,0x00,0x12,0x00,0x0E,0x00,
0xFF,0xFF,0x12,0x00,0x00,0x00,0x10,0x00,0xC4,0x30,0x00,0x00,0x5A,0x00,0x0D,0x00,
0x12,0x00,0x0F,0x00,0x01,0x00,0x12,0x00,0x00,0x00,0x0D,0x00,0xE4,0x31,0x00,0x00,
0x5B,0x00,0x06,0x00,0x17,0x00,0x09,0x00,0x02,0x00,0x13,0x00,0x00,0x00,0x06,0x00,
0xD0,0x32,0x00,0x00,0x5C,0x00,0x09,0x00,0x18,0x00,0x09,0x00,0x00,0x00,0x13,0x00,
0x00,0x00,0x09,0x00,0x5C,0x33,0x00,0x00,0x5D,0x00,0x06,0x00,0x17,0x00,0x09,0x00,
0x01,0x00,0x13,0x00,0x00,0x00,0x06,0x00,0x34,0x34,0x00,0x00,0x5E,0x00,0x0C,0x00,
0x0C,0x00,0x0E,0x00,0x01,0x00,0x13,0x00,0x00,0x00,0x0C,0x00,0xC0,0x34,0x00,0x00,
0x5F,0x00,0x0E,0x00,0x03,0x00,0x0E,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x0E,0x00,
0x50,0x35,0x00,0x00,0x60,0x00,0x08,0x00,0x07,0x00,0x0F,0x00,0x02,0x00,0x16,0x00,
0x00,0x00,0x08,0x00,0x7C,0x35,0x00,0x00,0x61,0x00,0x0C,0x00,0x0E,0x00,0x0E,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0xB4,0x35,0x00,0x00,0x62,0x00,0x0E,0x00,
0x14,0x00,0x0F,0x00,0x01,0x00,0x14,0x00,0x00,0x00,0x0E,0x00,0x5C,0x36,0x00,0x00,
0x63,0x00,0x0B,0x00,0x0E,0x00,0x0D,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0B,0x00,
0x74,0x37,0x00,0x00,0x64,0x00,0x0D,0x00,0x14,0x00,0x0F,0x00,0x01,0x00,0x14,0x00,
0x00,0x00,0x0D,0x00,0x10,0x38,0x00,0x00,0x65,0x00,0x0C,0x00,0x0E,0x00,0x0E,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0x14,0x39,0x00,0x00,0x66,0x00,0x0A,0x00,
0x14,0x00,0x09,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x0A,0x00,0xBC,0x39,0x00,0x00,
0x67,0x00,0x0D,0x00,0x14,0x00,0x0E,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,
0x84,0x3A,0x00,0x00,0x68,0x00,0x0D,0x00,0x14,0x00,0x0F,0x00,0x01,0x00,0x14,0x00,
0x00,0x00,0x0D,0x00,0x88,0x3B,0x00,0x00,0x69,0x00,0x05,0x00,0x14,0x00,0x07,0x00,
0x01,0x00,0x14,0x00,0x00,0x00,0x05,0x00,0x8C,0x3C,0x00,0x00,0x6A,0x00,0x08,0x00,
0x19,0x00,0x07,0x00,0xFE,0xFF,0x14,0x00,0x00,0x00,0x08,0x00,0xF0,0x3C,0x00,0x00,
0x6B,0x00,0x0E,0x00,0x14,0x00,0x0F,0x00,0x01,0x00,0x14,0x00,0x00,0x00,0x0E,0x00,
0xB8,0x3D,0x00,0x00,0x6C,0x00,0x07,0x00,0x14,0x00,0x08,0x00,0x01,0x00,0x14,0x00,
0x00,0x00,0x07,0x00,0xD0,0x3E,0x00,0x00,0x6D,0x00,0x15,0x00,0x0E,0x00,0x17,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x15,0x00,0x5C,0x3F,0x00,0x00,0x6E,0x00,0x0D,0x00,
0x0E,0x00,0x0F,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,0x84,0x40,0x00,0x00,
0x6F,0x00,0x0D,0x00,0x0E,0x00,0x0F,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,
0x3C,0x41,0x00,0x00,0x70,0x00,0x0E,0x00,0x13,0x00,0x0F,0x00,0x01,0x00,0x0E,0x00,
0x00,0x00,0x0E,0x00,0xF4,0x41,0x00,0x00,0x71,0x00,0x0D,0x00,0x13,0x00,0x0F,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,0x00,0x43,0x00,0x00,0x72,0x00,0x0A,0x00,
0x0E,0x00,0x0A,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x0A,0x00,0xF8,0x43,0x00,0x00,
0x73,0x00,0x0C,0x00,0x0E,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,
0x84,0x44,0x00,0x00,0x74,0x00,0x0A,0x00,0x12,0x00,0x0A,0x00,0x00,0x00,0x12,0x00,
0x00,0x00,0x0A,0x00,0x2C,0x45,0x00,0x00,0x75,0x00,0x0D,0x00,0x0E,0x00,0x0F,0x00,
0x01,0x00,0x0E,0x00,0x00,0x00,0x0D,0x00,0xE0,0x45,0x00,0x00,0x76,0x00,0x0E,0x00,
0x0E,0x00,0x0E,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0E,0x00,0x98,0x46,0x00,0x00,
0x77,0x00,0x15,0x00,0x0E,0x00,0x15,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x15,0x00,
0x5C,0x47,0x00,0x00,0x78,0x00,0x0E,0x00,0x0E,0x00,0x0D,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x0E,0x00,0x84,0x48,0x00,0x00,0x79,0x00,0x0E,0x00,0x13,0x00,0x0E,0x00,
0x00,0x00,0x0E,0x00,0x00,0x00,0x0E,0x00,0x48,0x49,0x00,0x00,0x7A,0x00,0x0C,0x00,
0x0E,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0x54,0x4A,0x00,0x00,
0x7B,0x00,0x08,0x00,0x17,0x00,0x09,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x08,0x00,
0xFC,0x4A,0x00,0x00,0x7C,0x00,0x03,0x00,0x1C,0x00,0x07,0x00,0x02,0x00,0x15,0x00,
0x00,0x00,0x03,0x00,0xB4,0x4B,0x00,0x00,0x7D,0x00,0x08,0x00,0x17,0x00,0x09,0x00,
0x01,0x00,0x13,0x00,0x00,0x00,0x08,0x00,0x08,0x4C,0x00,0x00,0x7E,0x00,0x0E,0x00,
0x06,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0xC0,0x4C,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoSansCJKsc_Bold24_glyphs[19732] =
{
0x30,0x8F,0x8F,0x8F,0x1B,0x4D,0xFF,0xFF,0xFF,0x2A,0x44,0xFF,0xFF,0xFF,0x21,0x3A,
0xFF,0xFF,0xFF,0x19,0x2D,0xFF,0xFF,0xFF,0x0C,0x1F,0xFF,0xFF,0xFC,0x00,0x10,0xFF,
0xFF,0xEE,0x00,0x03,0xFF,0xFF,0xDF,0x00,0x00,0xF3,0xFF,0xD0,0x00,0x00,0xE5,0xFF,
0xC2,0x00,0x00,0xD6,0xFF,0xB3,0x00,0x00,0xC8,0xFF,0xA4,0x00,0x00,0x76,0x9F,0x5F,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0x8A,0x42,0x00,0x62,0xFF,0xFF,0xFF,0x45,
0xB2,0xFF,0xFF,0xFF,0x95,0x92,0xFF,0xFF,0xFF,0x74,0x15,0xBB,0xF3,0xAB,0x09,0x00,
0x71,0x7B,0x7B,0x54,0x00,0x00,0x71,0x7B,0x7B,0x54,0xE2,0xFF,0xFF,0xA5,0x00,0x00,
0xE2,0xFF,0xFF,0xA5,0xD9,0xFF,0xFF,0x9C,0x00,0x00,0xD9,0xFF,0xFF,0x9C,0xCF,0xFF,
0xFF,0x92,0x00,0x00,0xCF,0xFF,0xFF,0x92,0xB5,0xFF,0xFF,0x78,0x00,0x00,0xB5,0xFF,
0xFF,0x78,0x93,0xFF,0xFF,0x55,0x00,0x00,0x93,0xFF,0xFF,0x55,0x71,0xFF,0xFF,0x32,
0x00,0x00,0x71,0xFF,0xFF,0x32,0x4F,0xFF,0xFF,0x0F,0x00,0x00,0x4F,0xFF,0xFF,0x0F,
0x2D,0xFF,0xEC,0x00,0x00,0x00,0x2D,0xFF,0xEC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x4A,0x97,0x54,0x00,0x00,0x38,0x97,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0xFF,
0x75,0x00,0x00,0x79,0xFF,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0xB9,0xFF,0x57,0x00,
0x00,0x9B,0xFF,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0xDA,0xFF,0x38,0x00,0x00,0xBD,
0xFF,0x57,0x00,0x00,0x00,0x00,0x00,0x02,0xF9,0xFF,0x1A,0x00,0x00,0xDF,0xFF,0x3A,
0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x4F,
0x00,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x4F,0x00,0x29,
0x4F,0x91,0xFF,0xCC,0x4F,0x4F,0x7D,0xFF,0xE5,0x4F,0x4F,0x18,0x00,0x00,0x00,0x79,
0xFF,0x9B,0x00,0x00,0x5C,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x99,0xFF,0x7C,
0x00,0x00,0x7A,0xFF,0xA0,0x00,0x00,0x00,0x05,0x43,0x43,0xC8,0xFF,0x8C,0x43,0x43,
0xB1,0xFF,0xA7,0x43,0x34,0x00,0x13,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xC3,0x00,0x13,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xC3,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x0B,0x00,0x00,0xF3,0xFF,0x27,0x00,0x00,0x00,
0x00,0x00,0x2F,0xFF,0xE8,0x00,0x00,0x13,0xFF,0xFE,0x08,0x00,0x00,0x00,0x00,0x00,
0x4F,0xFF,0xC7,0x00,0x00,0x33,0xFF,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0xFF,
0xA5,0x00,0x00,0x53,0xFF,0xC7,0x00,0x00,0x00,0x00,0x00,0x00,0x8F,0xFF,0x84,0x00,
0x00,0x73,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x83,0x83,0x23,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0x43,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,
0x9F,0xFF,0xFF,0xBE,0x59,0x0B,0x00,0x00,0x00,0x03,0x91,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xE7,0x39,0x00,0x00,0x6D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0x0F,
0x00,0xE7,0xFF,0xFF,0xCB,0x2B,0x0D,0x3F,0xB4,0xFC,0x4D,0x00,0x16,0xFF,0xFF,0xFF,
0x4A,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x1D,0xFF,0xFF,0xFF,0x5C,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xE8,0xFF,0xFF,0xE6,0x34,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x5F,0xFF,0xFF,0xFF,0xFD,0xA4,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x5A,0xEE,
0xFF,0xFF,0xFF,0xFB,0x90,0x0E,0x00,0x00,0x00,0x00,0x00,0x1A,0xB2,0xFF,0xFF,0xFF,
0xFF,0xD6,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0xCF,0xFF,0xFF,0xFF,0xC5,0x01,
0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x9A,0xFF,0xFF,0xFF,0x3D,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0D,0xF9,0xFF,0xFF,0x6C,0x00,0x42,0x24,0x00,0x00,0x00,0x00,0x05,
0xF8,0xFF,0xFF,0x68,0x10,0xE8,0xF8,0x89,0x3D,0x0D,0x1C,0x9C,0xFF,0xFF,0xFF,0x3F,
0x95,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF,0x01,0x2E,0xC6,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0x31,0x00,0x00,0x01,0x55,0xA0,0xE4,0xFF,0xFF,0xE8,
0x91,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0x43,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x87,0x87,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0xA1,0xDF,0xE8,0xAF,0x27,
0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xE6,0xFC,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,
0x19,0xE2,0xFF,0xFF,0xFF,0xFF,0xF1,0x34,0x00,0x00,0x00,0x00,0x00,0x7A,0xFF,0x9C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xEB,0x34,0x20,0xD6,0xFF,0xBE,0x00,
0x00,0x00,0x00,0x12,0xF0,0xF7,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF4,0xFF,
0x86,0x00,0x00,0x5B,0xFF,0xFF,0x23,0x00,0x00,0x00,0x8C,0xFF,0x89,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1A,0xFF,0xFF,0x55,0x00,0x00,0x2A,0xFF,0xFF,0x48,0x00,0x00,
0x1D,0xF7,0xEF,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0xFF,0xFF,0x45,0x00,
0x00,0x1A,0xFF,0xFF,0x62,0x00,0x00,0x9E,0xFF,0x76,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0xFF,0xFF,0x55,0x00,0x00,0x2B,0xFF,0xFF,0x46,0x00,0x2A,0xFC,0xE4,
0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0xFF,0x88,0x00,0x00,0x5E,
0xFF,0xFF,0x21,0x00,0xB0,0xFF,0x63,0x00,0x1D,0xA8,0xE4,0xE3,0xA7,0x1C,0x00,0x00,
0x00,0x8F,0xFF,0xEC,0x30,0x1D,0xD6,0xFF,0xBA,0x00,0x39,0xFF,0xD7,0x03,0x25,0xEA,
0xFF,0xFF,0xFF,0xFF,0xEA,0x25,0x00,0x00,0x17,0xE1,0xFF,0xFF,0xFF,0xFF,0xF0,0x32,
0x00,0xC2,0xFF,0x50,0x00,0xA8,0xFF,0xE0,0x29,0x29,0xE1,0xFF,0xA8,0x00,0x00,0x00,
0x15,0xA1,0xE0,0xE8,0xB0,0x26,0x00,0x4C,0xFF,0xC6,0x00,0x0D,0xFE,0xFF,0x6C,0x00,
0x00,0x70,0xFF,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xD2,0xFF,
0x3D,0x00,0x31,0xFF,0xFF,0x39,0x00,0x00,0x3F,0xFF,0xFF,0x33,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x5E,0xFF,0xB3,0x00,0x00,0x4B,0xFF,0xFF,0x29,0x00,0x00,0x2D,
0xFF,0xFF,0x4E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0xFD,0x2D,0x00,0x00,
0x30,0xFF,0xFF,0x3B,0x00,0x00,0x3F,0xFF,0xFF,0x31,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0xFF,0xA0,0x00,0x00,0x00,0x0D,0xFD,0xFF,0x6F,0x00,0x00,0x72,0xFF,0xFD,
0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0xEB,0xF8,0x1E,0x00,0x00,0x00,0x00,0xA4,
0xFF,0xE2,0x2D,0x2D,0xE3,0xFF,0xA4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xFF,
0x8D,0x00,0x00,0x00,0x00,0x00,0x23,0xE8,0xFF,0xFF,0xFF,0xFF,0xE8,0x22,0x00,0x00,
0x00,0x00,0x00,0x00,0x17,0xF4,0xF1,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xA8,
0xE4,0xE4,0xA7,0x1B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x84,0xCC,0xF4,
0xD8,0x92,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0xD6,0xFF,
0xFF,0xFF,0xFF,0xFF,0xD7,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,
0xFF,0xFF,0xCB,0x6E,0xC3,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xE6,0xFF,0xF9,0x15,0x00,0x24,0xFF,0xFF,0xA2,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x09,0xFF,0xFF,0xE1,0x00,0x00,0x32,0xFF,0xFF,0x8E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xE8,0xFF,0xFB,0x0C,0x15,0xC9,0xFF,0xFF,0x42,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFF,0x9A,0xE6,0xFF,0xFF,0x98,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xFF,0xFF,0xFF,0xFF,0xFE,0x7E,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x72,0xFF,0xFF,0xFF,0xFD,
0x50,0x00,0x00,0x00,0x00,0x49,0xFF,0xFF,0xE4,0x03,0x00,0x03,0xA8,0xFF,0xFF,0xFF,
0xFF,0xFF,0x8E,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFF,0x80,0x00,0x00,0x7E,0xFF,0xFF,
0xFF,0xB2,0xFF,0xFF,0xFF,0x85,0x00,0x00,0x20,0xF9,0xFF,0xFC,0x1C,0x00,0x08,0xF4,
0xFF,0xFF,0x96,0x00,0x82,0xFF,0xFF,0xFF,0xA4,0x08,0xB7,0xFF,0xFF,0x9A,0x00,0x00,
0x30,0xFF,0xFF,0xFF,0x30,0x00,0x00,0x97,0xFF,0xFF,0xFF,0xDE,0xFF,0xFF,0xE9,0x11,
0x00,0x00,0x31,0xFF,0xFF,0xFF,0x39,0x00,0x00,0x00,0x81,0xFF,0xFF,0xFF,0xFF,0xFF,
0x5F,0x00,0x00,0x00,0x05,0xF8,0xFF,0xFF,0xC6,0x16,0x00,0x00,0x17,0xCB,0xFF,0xFF,
0xFF,0xFF,0xE2,0x6F,0x17,0x00,0x00,0x83,0xFF,0xFF,0xFF,0xF4,0xC5,0xCC,0xF9,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x1C,0x00,0x04,0xAD,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xE7,0x66,0x6B,0xE6,0xFF,0xFF,0xD6,0x00,0x00,0x00,0x00,0x4A,0xAE,0xD6,
0xF5,0xD6,0xAB,0x74,0x0C,0x00,0x00,0x0A,0x66,0xB8,0x83,0x00,0x71,0x7B,0x7B,0x54,
0xE2,0xFF,0xFF,0xA5,0xD9,0xFF,0xFF,0x9C,0xCF,0xFF,0xFF,0x92,0xB5,0xFF,0xFF,0x78,
0x93,0xFF,0xFF,0x55,0x71,0xFF,0xFF,0x32,0x4F,0xFF,0xFF,0x0F,0x2D,0xFF,0xEC,0x00,
0x00,0x00,0x00,0xA0,0x9E,0x30,0x00,0x00,0x32,0xFE,0xFF,0x8A,0x00,0x00,0xB9,0xFF,
0xF7,0x18,0x00,0x28,0xFF,0xFF,0x97,0x00,0x00,0x88,0xFF,0xFF,0x3C,0x00,0x02,0xE5,
0xFF,0xE8,0x02,0x00,0x2D,0xFF,0xFF,0x9D,0x00,0x00,0x66,0xFF,0xFF,0x6A,0x00,0x00,
0x9E,0xFF,0xFF,0x3B,0x00,0x00,0xC3,0xFF,0xFF,0x12,0x00,0x00,0xD5,0xFF,0xFE,0x02,
0x00,0x00,0xE7,0xFF,0xF1,0x00,0x00,0x00,0xF3,0xFF,0xE7,0x00,0x00,0x00,0xE4,0xFF,
0xF3,0x00,0x00,0x00,0xD2,0xFF,0xFF,0x03,0x00,0x00,0xC0,0xFF,0xFF,0x16,0x00,0x00,
0x96,0xFF,0xFF,0x42,0x00,0x00,0x5D,0xFF,0xFF,0x70,0x00,0x00,0x25,0xFF,0xFF,0xA7,
0x00,0x00,0x00,0xD9,0xFF,0xF0,0x05,0x00,0x00,0x79,0xFF,0xFF,0x47,0x00,0x00,0x1B,
0xFD,0xFF,0xA7,0x00,0x00,0x00,0xA4,0xFF,0xFC,0x25,0x00,0x00,0x21,0xFA,0xFF,0x9A,
0x00,0x00,0x00,0x7D,0x77,0x13,0x00,0x00,0x2C,0x9A,0xA6,0x00,0x00,0x00,0x00,0x7F,
0xFF,0xFF,0x3A,0x00,0x00,0x00,0x11,0xF2,0xFF,0xC3,0x00,0x00,0x00,0x00,0x8B,0xFF,
0xFF,0x32,0x00,0x00,0x00,0x30,0xFF,0xFF,0x94,0x00,0x00,0x00,0x00,0xDF,0xFF,0xEE,
0x07,0x00,0x00,0x00,0x91,0xFF,0xFF,0x3B,0x00,0x00,0x00,0x5D,0xFF,0xFF,0x74,0x00,
0x00,0x00,0x2E,0xFF,0xFF,0xAD,0x00,0x00,0x00,0x05,0xFE,0xFF,0xD1,0x00,0x00,0x00,
0x00,0xF1,0xFF,0xE3,0x00,0x00,0x00,0x00,0xE2,0xFF,0xF6,0x00,0x00,0x00,0x00,0xD8,
0xFF,0xFF,0x03,0x00,0x00,0x00,0xE4,0xFF,0xF3,0x00,0x00,0x00,0x00,0xF3,0xFF,0xE1,
0x00,0x00,0x00,0x09,0xFF,0xFF,0xCF,0x00,0x00,0x00,0x35,0xFF,0xFF,0xA4,0x00,0x00,
0x00,0x64,0xFF,0xFF,0x6B,0x00,0x00,0x00,0x9A,0xFF,0xFF,0x33,0x00,0x00,0x02,0xE8,
0xFF,0xE4,0x03,0x00,0x00,0x3C,0xFF,0xFF,0x85,0x00,0x00,0x00,0x9B,0xFF,0xFF,0x25,
0x00,0x00,0x1D,0xF9,0xFF,0xAE,0x00,0x00,0x00,0x8F,0xFF,0xFC,0x28,0x00,0x00,0x00,
0x10,0x72,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x5B,0x04,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF6,0xFF,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,
0xFF,0xFF,0x31,0x00,0x00,0x00,0x56,0xB4,0x7A,0x61,0xFF,0xFF,0x76,0x73,0xAC,0x72,
0xAF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD3,0x13,0x7D,0xE8,0xFF,0xFF,0xFF,
0xFF,0xEF,0x8A,0x1D,0x00,0x00,0x34,0xFF,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,
0xBE,0xFF,0xF4,0xE9,0xFF,0xD6,0x05,0x00,0x00,0x51,0xFF,0xFB,0x4A,0x33,0xF4,0xFF,
0x70,0x00,0x00,0x11,0xAC,0x65,0x00,0x00,0x49,0xBC,0x1C,0x00,0x00,0x00,0x00,0x00,
0x00,0x06,0x1B,0x1B,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,
0xFF,0xFF,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,
0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x5F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x5F,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x5F,0x00,0x00,0x00,0x00,0x00,
0x17,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x37,0x17,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x37,0x0B,0x7F,0x7F,0x7F,
0x7F,0x9F,0xFF,0xFF,0xAF,0x7F,0x7F,0x7F,0x7F,0x1B,0x00,0x00,0x00,0x00,0x00,0x3F,
0xFF,0xFF,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,
0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x5F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x5F,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x9B,0x9B,0x3A,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x16,0x11,0x00,0x00,0x00,0x9C,0xFF,0xFE,0x90,0x00,0x31,0xFF,0xFF,0xFF,
0xFF,0x36,0x27,0xFF,0xFF,0xFF,0xFF,0x72,0x00,0x78,0xEE,0xFF,0xFF,0x80,0x00,0x00,
0x01,0xF2,0xFF,0x5C,0x00,0x00,0x5A,0xFF,0xFB,0x21,0x01,0x5D,0xF6,0xFF,0x99,0x00,
0x8C,0xFF,0xFF,0xBB,0x0B,0x00,0x43,0xEE,0x7F,0x06,0x00,0x00,0x01,0x0D,0x00,0x00,
0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xB7,0xD3,0xFF,0xFF,0xFF,0xFF,
0xFF,0xB7,0x70,0x87,0x87,0x87,0x87,0x87,0x61,0x00,0x00,0x00,0x00,0x1E,0x83,0x73,
0x0B,0x00,0x0B,0xE4,0xFF,0xFF,0xB9,0x00,0x3F,0xFF,0xFF,0xFF,0xFE,0x0A,0x21,0xFD,
0xFF,0xFF,0xE8,0x00,0x00,0x6E,0xEB,0xDC,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xD8,0xFF,0x83,0x00,0x00,0x00,0x00,0x00,0x19,0xFF,0xFF,0x42,0x00,0x00,
0x00,0x00,0x00,0x58,0xFF,0xF9,0x09,0x00,0x00,0x00,0x00,0x00,0x99,0xFF,0xC2,0x00,
0x00,0x00,0x00,0x00,0x00,0xD9,0xFF,0x81,0x00,0x00,0x00,0x00,0x00,0x1A,0xFF,0xFF,
0x41,0x00,0x00,0x00,0x00,0x00,0x5A,0xFF,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x9A,
0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0xDA,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,
0x1B,0xFF,0xFF,0x40,0x00,0x00,0x00,0x00,0x00,0x5B,0xFF,0xF8,0x08,0x00,0x00,0x00,
0x00,0x00,0x9B,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xFF,0x7F,0x00,0x00,
0x00,0x00,0x00,0x1C,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x5C,0xFF,0xF7,0x07,
0x00,0x00,0x00,0x00,0x00,0x9C,0xFF,0xBE,0x00,0x00,0x00,0x00,0x00,0x00,0xDD,0xFF,
0x7E,0x00,0x00,0x00,0x00,0x00,0x1E,0xFF,0xFF,0x3D,0x00,0x00,0x00,0x00,0x00,0x5D,
0xFF,0xF6,0x07,0x00,0x00,0x00,0x00,0x00,0x9D,0xFF,0xBD,0x00,0x00,0x00,0x00,0x00,
0x00,0xDE,0xFF,0x7D,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x3C,0x00,0x00,0x00,
0x00,0x00,0x5E,0xFF,0xF6,0x06,0x00,0x00,0x00,0x00,0x00,0x69,0xB3,0x8B,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x57,0xC0,0xEF,0xF3,0xCA,0x68,0x02,0x00,0x00,
0x00,0x00,0x00,0x9C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB6,0x05,0x00,0x00,0x00,0x6E,
0xFF,0xFF,0xFF,0xE7,0xDE,0xFF,0xFF,0xFF,0x8C,0x00,0x00,0x0B,0xEE,0xFF,0xFF,0x9D,
0x00,0x00,0x7E,0xFF,0xFF,0xF9,0x1C,0x00,0x57,0xFF,0xFF,0xF0,0x09,0x00,0x00,0x00,
0xDA,0xFF,0xFF,0x74,0x00,0x9B,0xFF,0xFF,0xB0,0x00,0x00,0x00,0x00,0x92,0xFF,0xFF,
0xB9,0x00,0xC7,0xFF,0xFF,0x86,0x00,0x00,0x00,0x00,0x69,0xFF,0xFF,0xE6,0x00,0xE0,
0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,0x51,0xFF,0xFF,0xFD,0x01,0xEE,0xFF,0xFF,0x67,
0x00,0x00,0x00,0x00,0x47,0xFF,0xFF,0xFF,0x0D,0xEC,0xFF,0xFF,0x67,0x00,0x00,0x00,
0x00,0x48,0xFF,0xFF,0xFF,0x0B,0xDF,0xFF,0xFF,0x71,0x00,0x00,0x00,0x00,0x52,0xFF,
0xFF,0xFD,0x00,0xC3,0xFF,0xFF,0x8A,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xE1,0x00,
0x95,0xFF,0xFF,0xB4,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0xB4,0x00,0x4F,0xFF,0xFF,
0xF3,0x0C,0x00,0x00,0x02,0xDF,0xFF,0xFF,0x6D,0x00,0x07,0xE8,0xFF,0xFF,0xA2,0x01,
0x00,0x84,0xFF,0xFF,0xF6,0x17,0x00,0x00,0x63,0xFF,0xFF,0xFF,0xE8,0xDF,0xFF,0xFF,
0xFF,0x83,0x00,0x00,0x00,0x00,0x92,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAF,0x03,0x00,
0x00,0x00,0x00,0x00,0x51,0xBF,0xEF,0xF3,0xCA,0x64,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0A,0x6B,0xE2,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x3E,0xBE,0xF9,
0xFF,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x6F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x4F,0x00,0x00,0x00,0x00,0x4C,0xAF,0xAF,0xC1,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,
0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,
0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x37,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0xFF,0xFF,0xFF,
0x4F,0x00,0x00,0x00,0x0A,0xD7,0xD7,0xD7,0xE0,0xFF,0xFF,0xFF,0xE4,0xD7,0xD7,0x8A,
0x0B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA3,0x0B,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA3,0x00,0x00,0x00,0x51,0xB2,0xE3,0xF6,0xD3,
0xA5,0x2E,0x00,0x00,0x00,0x00,0x12,0xB8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x75,
0x00,0x00,0x04,0xD0,0xFF,0xFF,0xFF,0xE2,0xE0,0xFF,0xFF,0xFF,0xFD,0x39,0x00,0x00,
0x59,0xFC,0xE2,0x3C,0x00,0x00,0x3A,0xF1,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x4A,0x19,
0x00,0x00,0x00,0x00,0x84,0xFF,0xFF,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x56,0xFF,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6A,0xFF,
0xFF,0xE3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB8,0xFF,0xFF,0xB2,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,0xFF,0x4D,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xDA,0xFF,0xFF,0xC9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x96,0xFF,0xFF,0xFC,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xFF,0xFF,0xFF,
0x79,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5D,0xFF,0xFF,0xFF,0xB4,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x5E,0xFC,0xFF,0xFF,0xC6,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,
0x6B,0xFE,0xFF,0xFF,0xCE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0xFF,0xFF,0xFF,
0xFF,0xDD,0xDD,0xED,0xF7,0xF7,0xF7,0xE4,0x00,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xEB,0x00,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xEB,0x00,0x00,0x00,0x00,0x00,0x50,0xB0,0xE5,0xF7,0xDB,0xB8,0x58,0x02,0x00,
0x00,0x00,0x1A,0xB1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCB,0x0B,0x00,0x00,0x8C,
0xFF,0xFF,0xFF,0xF2,0xD1,0xF6,0xFF,0xFF,0xFF,0xA5,0x00,0x00,0x03,0xB6,0xD9,0x43,
0x03,0x00,0x16,0xCE,0xFF,0xFF,0xF7,0x05,0x00,0x00,0x0B,0x09,0x00,0x00,0x00,0x00,
0x62,0xFF,0xFF,0xFF,0x2E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x71,0xFF,0xFF,
0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0xE8,0xFF,0xFF,0xB7,0x00,0x00,
0x00,0x00,0x00,0x5B,0xA2,0xC8,0xFF,0xFF,0xFF,0xD0,0x18,0x00,0x00,0x00,0x00,0x00,
0xA3,0xFF,0xFF,0xFF,0xFF,0xA6,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xFF,
0xFF,0xFF,0xFF,0xCB,0x23,0x00,0x00,0x00,0x00,0x00,0x02,0x0C,0x2A,0x76,0xE4,0xFF,
0xFF,0xE9,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0xF9,0xFF,0xFF,0x85,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,0xFF,0xFF,0xBB,0x00,0x08,0x66,
0x02,0x00,0x00,0x00,0x00,0x04,0xEA,0xFF,0xFF,0xAC,0x00,0x9B,0xFF,0xC1,0x37,0x00,
0x00,0x17,0xA5,0xFF,0xFF,0xFF,0x70,0x2C,0xFE,0xFF,0xFF,0xFF,0xF4,0xE9,0xFF,0xFF,
0xFF,0xFF,0xDC,0x13,0x00,0x58,0xEE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDD,0x27,
0x00,0x00,0x00,0x13,0x75,0xC3,0xE6,0xF8,0xDD,0xB9,0x63,0x04,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x32,0xFC,0xFF,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xCC,0xFF,0xFF,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x6F,0xFF,0xFF,0xFF,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF3,
0xFF,0xE7,0xDC,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0xFF,0x70,
0xDD,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,0x00,0x4F,0xFF,0xFF,0xE6,0x08,0xE7,0xFF,
0xFF,0x57,0x00,0x00,0x00,0x00,0x0C,0xE3,0xFF,0xFF,0x5D,0x00,0xEE,0xFF,0xFF,0x57,
0x00,0x00,0x00,0x00,0x8F,0xFF,0xFF,0xB8,0x00,0x00,0xEF,0xFF,0xFF,0x57,0x00,0x00,
0x00,0x32,0xFC,0xFF,0xF4,0x20,0x00,0x00,0xEF,0xFF,0xFF,0x57,0x00,0x00,0x02,0xCB,
0xFF,0xFF,0x70,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x57,0x00,0x00,0x62,0xFF,0xFF,0xFE,
0xB2,0xAF,0xAF,0xAF,0xFA,0xFF,0xFF,0xCB,0xAF,0x4F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x73,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEF,0xFF,
0xFF,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x57,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x57,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x57,0x00,0x00,0x00,0x00,0x83,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x92,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0xA1,0xFF,0xFF,0xFA,0xF3,0xF3,0xF3,0xF3,
0xF3,0xF3,0x03,0x00,0x00,0xB0,0xFF,0xFF,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xBE,0xFF,0xFF,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCD,
0xFF,0xFF,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xFF,0xFF,0xB9,
0xE4,0xF5,0xD0,0x97,0x18,0x00,0x00,0x00,0x00,0xEB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xF1,0x44,0x00,0x00,0x00,0xB3,0xFF,0xEF,0xA9,0x95,0xCB,0xFF,0xFF,0xFF,0xE3,
0x0F,0x00,0x00,0x00,0x4F,0x12,0x00,0x00,0x00,0x81,0xFF,0xFF,0xFF,0x70,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xE9,0xFF,0xFF,0x9E,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xBE,0xFF,0xFF,0xC7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xCD,0xFF,0xFF,0xC0,0x00,0x0B,0x72,0x03,0x00,0x00,0x00,0x00,0x21,0xF9,0xFF,
0xFF,0x95,0x00,0x9D,0xFF,0xBF,0x34,0x00,0x00,0x2E,0xCD,0xFF,0xFF,0xFD,0x38,0x2B,
0xFE,0xFF,0xFF,0xFF,0xF3,0xEF,0xFF,0xFF,0xFF,0xFF,0x8C,0x00,0x00,0x55,0xE9,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA4,0x07,0x00,0x00,0x00,0x0E,0x6E,0xBD,0xE4,0xF8,
0xD8,0xAB,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x6F,0xC7,0xF0,0xF3,
0xD2,0x85,0x10,0x00,0x00,0x00,0x00,0x1E,0xD6,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE1,
0x3E,0x00,0x00,0x0D,0xDD,0xFF,0xFF,0xFF,0xF9,0xE9,0xFF,0xFF,0xFF,0x6E,0x00,0x00,
0x92,0xFF,0xFF,0xF6,0x62,0x05,0x00,0x20,0xA7,0x7C,0x00,0x00,0x10,0xF5,0xFF,0xFF,
0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5A,0xFF,0xFF,0xE5,0x06,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0xFF,0xA0,0x00,0x1D,0x66,0x69,0x3E,0x08,
0x00,0x00,0x00,0xB5,0xFF,0xFF,0x7B,0x73,0xFC,0xFF,0xFF,0xFF,0xDC,0x41,0x00,0x00,
0xC6,0xFF,0xFF,0xE6,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF6,0x20,0x00,0xC9,0xFF,0xFF,
0xFF,0xBD,0x42,0x0E,0x4A,0xE9,0xFF,0xFF,0xA8,0x00,0xB9,0xFF,0xFF,0xC5,0x05,0x00,
0x00,0x00,0x67,0xFF,0xFF,0xE4,0x00,0x9F,0xFF,0xFF,0x9A,0x00,0x00,0x00,0x00,0x2C,
0xFF,0xFF,0xFF,0x0D,0x6A,0xFF,0xFF,0xCC,0x00,0x00,0x00,0x00,0x26,0xFF,0xFF,0xFF,
0x11,0x23,0xFE,0xFF,0xFE,0x2A,0x00,0x00,0x00,0x54,0xFF,0xFF,0xE2,0x00,0x00,0xB9,
0xFF,0xFF,0xBF,0x0C,0x00,0x0F,0xCF,0xFF,0xFF,0xA8,0x00,0x00,0x28,0xF7,0xFF,0xFF,
0xE6,0xB5,0xE7,0xFF,0xFF,0xF4,0x1F,0x00,0x00,0x00,0x4A,0xF5,0xFF,0xFF,0xFF,0xFF,
0xFF,0xF2,0x56,0x00,0x00,0x00,0x00,0x00,0x20,0x98,0xE1,0xF7,0xD3,0x9D,0x1F,0x00,
0x00,0x00,0x00,0x00,0xCF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xCF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC6,0xF3,0xF3,0xF3,
0xF3,0xF3,0xF3,0xF3,0xFD,0xFF,0xFF,0xB9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,
0xFA,0xFF,0xE6,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,0xFF,0xFF,0x4E,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x5D,0xFF,0xFF,0xB3,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x08,0xE8,0xFF,0xFF,0x3A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5D,0xFF,0xFF,
0xD2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xFF,0xFF,0x6A,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x2A,0xFF,0xFF,0xFE,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x76,0xFF,0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAD,0xFF,0xFF,0xAC,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE5,0xFF,0xFF,0x7D,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3A,
0xFF,0xFF,0xFF,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0xFF,0xFF,0xFF,0x2A,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0xFF,0xFF,0xFF,0x1B,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0xFF,0xFF,0xFF,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x60,
0xBD,0xE4,0xF0,0xC8,0x84,0x0C,0x00,0x00,0x00,0x00,0x09,0xC6,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xE5,0x1F,0x00,0x00,0x00,0x98,0xFF,0xFF,0xF5,0x99,0x8F,0xE2,0xFF,0xFF,
0xC0,0x00,0x00,0x02,0xF1,0xFF,0xFF,0x44,0x00,0x00,0x12,0xE7,0xFF,0xFF,0x19,0x00,
0x23,0xFF,0xFF,0xFA,0x01,0x00,0x00,0x00,0x9D,0xFF,0xFF,0x46,0x00,0x12,0xFF,0xFF,
0xFF,0x28,0x00,0x00,0x00,0xAD,0xFF,0xFF,0x31,0x00,0x00,0xBF,0xFF,0xFF,0xCC,0x1A,
0x00,0x10,0xEB,0xFF,0xD5,0x01,0x00,0x00,0x23,0xE4,0xFF,0xFF,0xF0,0x86,0xAB,0xFF,
0xEC,0x2D,0x00,0x00,0x00,0x00,0x25,0xF4,0xFF,0xFF,0xFF,0xFF,0xFF,0x46,0x00,0x00,
0x00,0x00,0x07,0xA0,0xFF,0xF0,0xF9,0xFF,0xFF,0xFF,0xE8,0x40,0x00,0x00,0x09,0xC8,
0xFF,0xF7,0x36,0x17,0x83,0xF6,0xFF,0xFF,0xF4,0x2A,0x00,0x76,0xFF,0xFF,0x8B,0x00,
0x00,0x00,0x27,0xE9,0xFF,0xFF,0xA9,0x00,0xBE,0xFF,0xFF,0x49,0x00,0x00,0x00,0x00,
0x72,0xFF,0xFF,0xE7,0x00,0xD0,0xFF,0xFF,0x49,0x00,0x00,0x00,0x00,0x55,0xFF,0xFF,
0xF6,0x01,0x98,0xFF,0xFF,0xC3,0x09,0x00,0x00,0x01,0xB1,0xFF,0xFF,0xC0,0x00,0x33,
0xF7,0xFF,0xFF,0xE3,0x94,0x89,0xCF,0xFF,0xFF,0xFE,0x52,0x00,0x00,0x54,0xF3,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,0x75,0x00,0x00,0x00,0x00,0x15,0x89,0xC5,0xEB,0xEF,
0xC9,0x98,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x92,0xCC,0xF5,0xE4,
0xA2,0x2D,0x00,0x00,0x00,0x00,0x00,0x43,0xEA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x64,
0x00,0x00,0x00,0x11,0xE8,0xFF,0xFF,0xEF,0xBA,0xE3,0xFF,0xFF,0xFE,0x41,0x00,0x00,
0x8E,0xFF,0xFF,0xDF,0x19,0x00,0x06,0xA8,0xFF,0xFF,0xD7,0x01,0x00,0xC9,0xFF,0xFF,
0x6C,0x00,0x00,0x00,0x14,0xF4,0xFF,0xFF,0x41,0x02,0xF5,0xFF,0xFF,0x3E,0x00,0x00,
0x00,0x00,0xAC,0xFF,0xFF,0x88,0x01,0xF5,0xFF,0xFF,0x42,0x00,0x00,0x00,0x00,0x7A,
0xFF,0xFF,0xBC,0x00,0xCE,0xFF,0xFF,0x7C,0x00,0x00,0x00,0x00,0xAB,0xFF,0xFF,0xD5,
0x00,0x92,0xFF,0xFF,0xF1,0x54,0x0E,0x38,0xAA,0xFF,0xFF,0xFF,0xE5,0x00,0x14,0xED,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE6,0xFF,0xFF,0xDF,0x00,0x00,0x37,0xD6,0xFF,0xFF,
0xFF,0xFF,0x93,0x68,0xFF,0xFF,0xCD,0x00,0x00,0x00,0x06,0x45,0x70,0x77,0x33,0x00,
0x89,0xFF,0xFF,0xA9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xD3,0xFF,0xFF,
0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4F,0xFF,0xFF,0xFC,0x1E,0x00,0x00,
0x5E,0xB8,0x2F,0x02,0x05,0x53,0xF0,0xFF,0xFF,0xA8,0x00,0x00,0x52,0xFC,0xFF,0xFF,
0xF3,0xF8,0xFF,0xFF,0xFF,0xEA,0x17,0x00,0x00,0x32,0xD7,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xE3,0x2C,0x00,0x00,0x00,0x00,0x09,0x7A,0xCC,0xF0,0xF5,0xD1,0x7D,0x0D,0x00,
0x00,0x00,0x00,0x00,0x00,0x1C,0x7F,0x70,0x0A,0x00,0x0B,0xE2,0xFF,0xFF,0xB7,0x00,
0x3E,0xFF,0xFF,0xFF,0xFE,0x0A,0x23,0xFE,0xFF,0xFF,0xEA,0x01,0x00,0x71,0xEC,0xDE,
0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x83,0x73,0x0B,0x00,
0x0B,0xE4,0xFF,0xFF,0xB8,0x00,0x3F,0xFF,0xFF,0xFF,0xFE,0x0A,0x22,0xFD,0xFF,0xFF,
0xE9,0x01,0x00,0x6F,0xEC,0xDD,0x46,0x00,0x00,0x1C,0x7F,0x70,0x0A,0x00,0x0B,0xE2,
0xFF,0xFF,0xB7,0x00,0x3E,0xFF,0xFF,0xFF,0xFE,0x0A,0x23,0xFE,0xFF,0xFF,0xEA,0x01,
0x00,0x71,0xEC,0xDE,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x16,0x11,0x00,0x00,0x00,0x9C,0xFF,0xFE,0x90,0x00,0x31,0xFF,0xFF,0xFF,0xFF,0x36,
0x27,0xFF,0xFF,0xFF,0xFF,0x72,0x00,0x78,0xEE,0xFF,0xFF,0x80,0x00,0x00,0x01,0xF2,
0xFF,0x5C,0x00,0x00,0x5A,0xFF,0xFB,0x21,0x01,0x5D,0xF6,0xFF,0x99,0x00,0x8C,0xFF,
0xFF,0xBB,0x0B,0x00,0x43,0xEE,0x7F,0x06,0x00,0x00,0x01,0x0D,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x55,0xB8,0x35,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x8F,0xEC,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,
0x00,0x0D,0x65,0xC8,0xFF,0xFF,0xFF,0xFF,0xFF,0x34,0x00,0x00,0x00,0x3C,0x9F,0xF5,
0xFF,0xFF,0xFF,0xFF,0xD7,0x7F,0x27,0x00,0x06,0x76,0xD9,0xFF,0xFF,0xFF,0xFF,0xDF,
0x87,0x2F,0x00,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0xEC,0x95,0x3B,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0xEC,0x95,0x3C,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x06,0x7B,0xDC,0xFF,0xFF,0xFF,0xFF,0xE2,0x8B,0x32,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0x40,0xA3,0xF6,0xFF,0xFF,0xFF,0xFF,0xDA,0x81,0x2A,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0x69,0xCB,0xFF,0xFF,0xFF,0xFF,0xFF,0x35,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x2E,0x91,0xEC,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0x56,0xB9,0x35,0x0C,0x83,0x83,0x83,0x83,0x83,0x83,0x83,
0x83,0x83,0x83,0x83,0x83,0x1C,0x17,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x37,0x17,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x37,0x17,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x37,0x0C,0x87,0x87,0x87,0x87,0x87,0x87,0x87,0x87,0x87,
0x87,0x87,0x87,0x1D,0x17,0xC4,0x61,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x17,0xFF,0xFF,0xF2,0x9B,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x16,0xFE,0xFF,0xFF,0xFF,0xFF,0xD4,0x71,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,
0x73,0xCB,0xFF,0xFF,0xFF,0xFF,0xF9,0xAB,0x48,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x24,0x7B,0xD4,0xFF,0xFF,0xFF,0xFF,0xE3,0x82,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x2E,0x89,0xE3,0xFF,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,
0x89,0xE3,0xFF,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0x27,0x7E,0xD7,0xFF,0xFF,0xFF,
0xFF,0xE6,0x87,0x10,0x00,0x20,0x77,0xCE,0xFF,0xFF,0xFF,0xFF,0xFB,0xAF,0x4C,0x03,
0x00,0x00,0x16,0xFF,0xFF,0xFF,0xFF,0xFF,0xD7,0x75,0x17,0x00,0x00,0x00,0x00,0x00,
0x17,0xFF,0xFF,0xF3,0x9D,0x3A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0xC5,
0x62,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x94,
0xBF,0xC5,0xA1,0x57,0x01,0x00,0x00,0x02,0x86,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xC5,
0x08,0x00,0x98,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x90,0x00,0x16,0xCD,0xE4,
0x56,0x12,0x2E,0xD4,0xFF,0xFF,0xE4,0x00,0x00,0x0D,0x16,0x00,0x00,0x00,0x57,0xFF,
0xFF,0xFF,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x5E,0xFF,0xFF,0xFB,0x05,0x00,0x00,
0x00,0x00,0x00,0x06,0xD1,0xFF,0xFF,0xAC,0x00,0x00,0x00,0x00,0x00,0x00,0x9E,0xFF,
0xFF,0xEA,0x1C,0x00,0x00,0x00,0x00,0x00,0x64,0xFF,0xFF,0xFC,0x41,0x00,0x00,0x00,
0x00,0x00,0x1A,0xF0,0xFF,0xFF,0x7A,0x00,0x00,0x00,0x00,0x00,0x00,0x8D,0xFF,0xFF,
0xC6,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0xA3,0xA3,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x29,0x86,0x6A,0x05,0x00,0x00,0x00,
0x00,0x00,0x00,0x19,0xF1,0xFF,0xFF,0x9D,0x00,0x00,0x00,0x00,0x00,0x00,0x5A,0xFF,
0xFF,0xFF,0xED,0x00,0x00,0x00,0x00,0x00,0x00,0x3A,0xFF,0xFF,0xFF,0xCD,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x83,0xEF,0xD3,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x54,0xA1,0xD1,0xEA,0xF9,0xE5,0xC7,0x84,
0x2E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x75,0xED,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xAB,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x23,0xD4,0xFF,0xFF,0xEF,0xA1,0x5D,0x3F,0x39,0x4E,0x82,0xD2,0xFF,0xFF,0xE2,0x2A,
0x00,0x00,0x00,0x00,0x00,0x32,0xED,0xFF,0xFA,0x86,0x0E,0x00,0x00,0x00,0x00,0x00,
0x00,0x01,0x58,0xF2,0xFF,0xDC,0x10,0x00,0x00,0x00,0x17,0xE2,0xFF,0xEC,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xFC,0xFF,0x94,0x00,0x00,0x00,
0xB5,0xFF,0xF8,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x97,0xFF,0xF8,0x17,0x00,0x3E,0xFF,0xFF,0x6D,0x00,0x00,0x00,0x08,0x88,0xDF,0xEF,
0x9A,0x36,0xC7,0xC2,0x02,0x00,0x15,0xF4,0xFF,0x61,0x00,0xB9,0xFF,0xDC,0x04,0x00,
0x00,0x11,0xC3,0xFF,0xFF,0xFF,0xFF,0xE8,0xFF,0xCE,0x00,0x00,0x00,0xC8,0xFF,0x9F,
0x0D,0xFA,0xFF,0x6F,0x00,0x00,0x00,0xBA,0xFF,0xFF,0xAD,0x65,0xCB,0xFF,0xFF,0x9A,
0x00,0x00,0x00,0xA1,0xFF,0xB9,0x51,0xFF,0xFF,0x23,0x00,0x00,0x43,0xFF,0xFF,0x9E,
0x00,0x00,0x37,0xFF,0xFF,0x67,0x00,0x00,0x00,0x81,0xFF,0xCA,0x79,0xFF,0xE9,0x00,
0x00,0x00,0xB1,0xFF,0xFA,0x18,0x00,0x00,0x59,0xFF,0xFF,0x34,0x00,0x00,0x00,0x97,
0xFF,0xB9,0x90,0xFF,0xD0,0x00,0x00,0x00,0xE0,0xFF,0xC1,0x00,0x00,0x00,0x84,0xFF,
0xFA,0x07,0x00,0x00,0x00,0xBC,0xFF,0x96,0xA2,0xFF,0xC1,0x00,0x00,0x09,0xFF,0xFF,
0xA0,0x00,0x00,0x00,0xB0,0xFF,0xD4,0x00,0x00,0x00,0x20,0xFB,0xFF,0x52,0x90,0xFF,
0xD3,0x00,0x00,0x01,0xF6,0xFF,0xB9,0x00,0x00,0x1B,0xEA,0xFF,0xC3,0x00,0x00,0x03,
0xAC,0xFF,0xCE,0x03,0x78,0xFF,0xF3,0x05,0x00,0x00,0xC8,0xFF,0xFD,0x6F,0x57,0xD9,
0xFF,0xFF,0xF8,0x62,0x4E,0xB5,0xFF,0xFE,0x39,0x00,0x3B,0xFF,0xFF,0x45,0x00,0x00,
0x4C,0xFF,0xFF,0xFF,0xFF,0xFA,0x77,0xF8,0xFF,0xFF,0xFF,0xFF,0xF4,0x5E,0x00,0x00,
0x02,0xE8,0xFF,0xBE,0x00,0x00,0x00,0x56,0xD0,0xEF,0xB3,0x3F,0x00,0x3F,0xAC,0xEA,
0xD9,0x9F,0x26,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0x74,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xC6,0xFF,
0xFF,0x99,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x12,0xD0,0xFF,0xFF,0xF5,0x8B,0x51,0x2C,0x0A,0x15,0x33,0x6F,
0xC7,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x93,0xFC,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x20,0x89,0xCF,0xFD,0xFF,0xFF,0xFF,0xF4,0xC0,0x5D,0x09,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x1E,0x2A,0x11,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x94,0xFF,0xFF,0xFF,0xE9,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xE4,0xFF,0xFF,0xFF,0xFF,0x3D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x36,0xFF,0xFF,0xF1,0xFF,0xFF,0x8E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x87,0xFF,0xFF,0x76,0xFF,0xFF,0xDF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xFE,0x13,0xDA,0xFF,0xFF,0x30,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x29,0xFF,0xFF,0xCD,0x00,0x94,0xFF,0xFF,0x81,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x7A,0xFF,0xFF,0x89,0x00,0x4E,0xFF,0xFF,0xD2,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB,0xFF,0xFF,0x45,0x00,0x0D,0xFB,0xFF,0xFF,
0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xFF,0xFF,0xF7,0x09,0x00,0x00,0xC1,0xFF,
0xFF,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFF,0xFF,0xB8,0x00,0x00,0x00,0x79,
0xFF,0xFF,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0xBD,0xFF,0xFF,0xE3,0xBF,0xBF,0xBF,
0xD3,0xFF,0xFF,0xFE,0x19,0x00,0x00,0x00,0x00,0x12,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB9,0x00,0x00,0x00,0x00,0xB0,0xFF,0xFF,0x9F,0x00,
0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFA,0x10,0x00,0x00,0x0A,0xF6,0xFF,0xFF,0x5F,
0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x5B,0x00,0x00,0x52,0xFF,0xFF,0xFF,
0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0xDF,0xFF,0xFF,0xAC,0x00,0x00,0xA3,0xFF,0xFF,
0xDF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9F,0xFF,0xFF,0xF4,0x08,0x04,0xEF,0xFF,
0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xFF,0xFF,0x4E,0x00,0x00,
0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xF6,0xDF,0xC4,0x74,0x1A,0x00,0x00,0x00,0xD3,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF2,0x3A,0x00,0x00,0xD3,0xFF,0xFF,0xEC,
0xB7,0xB8,0xC7,0xEE,0xFF,0xFF,0xFF,0xF2,0x0C,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x07,0x90,0xFF,0xFF,0xFF,0x43,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x10,0xFF,0xFF,0xFF,0x70,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x12,0xFF,
0xFF,0xFF,0x53,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x06,0x99,0xFF,0xFF,0xED,
0x0A,0x00,0xD3,0xFF,0xFF,0xE6,0x9F,0xA0,0xB4,0xE6,0xFF,0xFF,0xF7,0x4B,0x00,0x00,
0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x09,0x00,0x00,0xD3,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDB,0x28,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x07,0x1F,0x68,0xEE,0xFF,0xFF,0xCE,0x02,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x53,0xFF,0xFF,0xFF,0x36,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x1D,0xFF,0xFF,0xFF,0x5C,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x49,
0xFF,0xFF,0xFF,0x52,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x33,0xDE,0xFF,0xFF,
0xFC,0x19,0xD3,0xFF,0xFF,0xED,0xBB,0xBB,0xC3,0xDF,0xFF,0xFF,0xFF,0xFF,0x81,0x00,
0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x94,0x00,0x00,0xD3,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFC,0xE3,0xC6,0x90,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0x66,0xB7,0xE5,0xF8,0xE2,0xAD,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xE1,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x9E,0x0B,0x00,0x00,0x00,0x52,0xFA,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x79,0x00,0x00,0x27,0xF3,0xFF,0xFF,0xFF,0xAC,
0x4D,0x1E,0x43,0x90,0xFC,0xB3,0x02,0x00,0x00,0xAD,0xFF,0xFF,0xFF,0x77,0x00,0x00,
0x00,0x00,0x00,0x38,0x0C,0x00,0x00,0x1E,0xFE,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x65,0xFF,0xFF,0xFF,0x4D,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x96,0xFF,0xFF,0xFF,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xAB,0xFF,0xFF,0xF7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xAF,0xFF,0xFF,0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x9A,0xFF,0xFF,0xFF,0x1B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x72,0xFF,0xFF,0xFF,0x4A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x2E,0xFF,0xFF,0xFF,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xC7,0xFF,0xFF,0xFF,0x67,0x00,0x00,0x00,0x00,0x00,0x3B,0x64,0x00,0x00,0x00,0x3F,
0xFD,0xFF,0xFF,0xFF,0x9D,0x48,0x1D,0x47,0x8F,0xFB,0xFD,0x52,0x00,0x00,0x00,0x75,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD2,0x02,0x00,0x00,0x00,0x60,
0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x19,0x00,0x00,0x00,0x00,0x00,0x12,
0x79,0xC4,0xEB,0xF9,0xE3,0xB0,0x56,0x01,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,
0xFF,0xF7,0xE6,0xBE,0x80,0x1E,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFB,0x8D,0x05,0x00,0x00,0xD3,0xFF,0xFF,0xF5,0xD8,0xF1,0xFF,0xFF,
0xFF,0xFF,0xFF,0xB6,0x02,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x17,0x72,0xF3,0xFF,
0xFF,0xFF,0x7C,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x26,0xF7,0xFF,0xFF,
0xEF,0x0E,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x85,0xFF,0xFF,0xFF,0x58,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x97,0xD3,0xFF,
0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0xE6,0xFF,0xFF,0xB8,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xCB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0xDF,0xFF,0xFF,0xC8,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x04,0xFC,0xFF,0xFF,0xB6,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x25,
0xFF,0xFF,0xFF,0x91,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,
0xFF,0x52,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x32,0xFB,0xFF,0xFF,0xE9,0x09,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x1A,0x7B,0xF8,0xFF,0xFF,0xFF,0x6F,0x00,0xD3,0xFF,
0xFF,0xF5,0xD8,0xF2,0xFF,0xFF,0xFF,0xFF,0xFF,0xAC,0x01,0x00,0xD3,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,0x88,0x03,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFA,
0xE8,0xC3,0x82,0x1E,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x13,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x13,
0xD3,0xFF,0xFF,0xFC,0xF3,0xF3,0xF3,0xF3,0xF3,0xF3,0xF3,0x13,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFD,
0xF7,0xF7,0xF7,0xF7,0xF7,0xF0,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xF7,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFD,
0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0x55,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x57,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x57,
0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0xD3,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0xD3,0xFF,0xFF,0xFC,0xF3,0xF3,0xF3,0xF3,
0xF3,0xF3,0xF3,0x1E,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0B,0x00,0xD3,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0B,0x00,0xD3,0xFF,0xFF,0xFE,0xFB,0xFB,0xFB,0xFB,
0xFB,0xFB,0x0B,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x5A,0xAA,0xE0,
0xF7,0xEB,0xCB,0x7E,0x1A,0x00,0x00,0x00,0x00,0x00,0x37,0xDA,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xF3,0x66,0x00,0x00,0x00,0x4C,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xF1,0x18,0x00,0x25,0xF2,0xFF,0xFF,0xFF,0xBD,0x57,0x25,0x2E,0x61,
0xD2,0xFA,0x44,0x00,0x00,0xAC,0xFF,0xFF,0xFF,0x83,0x02,0x00,0x00,0x00,0x00,0x07,
0x3A,0x00,0x00,0x1F,0xFE,0xFF,0xFF,0xCB,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x67,0xFF,0xFF,0xFF,0x4D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x97,0xFF,0xFF,0xFF,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xAD,0xFF,0xFF,0xF6,0x01,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0xAE,
0xFF,0xFF,0xF9,0x02,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x99,0xFF,
0xFF,0xFF,0x1D,0x00,0x00,0x00,0xAD,0xE7,0xE7,0xF6,0xFF,0xFF,0x8F,0x70,0xFF,0xFF,
0xFF,0x4E,0x00,0x00,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0x8F,0x2A,0xFF,0xFF,0xFF,
0xC9,0x00,0x00,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0x8F,0x00,0xC1,0xFF,0xFF,0xFF,
0x7E,0x01,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0x8F,0x00,0x38,0xFB,0xFF,0xFF,0xFF,
0xBD,0x5B,0x2D,0x1C,0x4D,0xD8,0xFF,0xFF,0x8F,0x00,0x00,0x67,0xFE,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8D,0x00,0x00,0x00,0x4F,0xE8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xAC,0x10,0x00,0x00,0x00,0x00,0x0A,0x69,0xB4,0xE3,0xF8,
0xEF,0xD3,0x92,0x35,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,
0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,
0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,
0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xC3,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x98,0xFF,
0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,
0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,
0x8B,0xFF,0xFF,0xFB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,
0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,
0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,
0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,
0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xFF,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x19,0xFF,0xFF,0xFF,0x73,0x00,0x06,0x8F,0x40,0x00,0x00,0x00,0x4E,
0xFF,0xFF,0xFF,0x50,0x22,0xCD,0xFF,0xEE,0x67,0x21,0x3E,0xDA,0xFF,0xFF,0xF9,0x1B,
0x1C,0xEC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x95,0x00,0x00,0x3C,0xE9,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x14,0x00,0x00,0x00,0x18,0x82,0xD2,0xF0,0xE9,0xB8,
0x75,0x03,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0xAF,0xFF,0xFF,
0xFB,0x3B,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x72,0xFF,0xFF,0xFF,0x71,
0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x38,0xFA,0xFF,0xFF,0xAE,0x00,0x00,
0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x12,0xE1,0xFF,0xFF,0xDB,0x0F,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x01,0xB4,0xFF,0xFF,0xF7,0x2F,0x00,0x00,0x00,0x00,0xD3,
0xFF,0xFF,0xBB,0x00,0x76,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,
0xFF,0xBB,0x3B,0xFB,0xFF,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,
0xCF,0xE3,0xFF,0xFF,0xFF,0x6A,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xEC,0x11,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x93,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xA0,
0x9E,0xFF,0xFF,0xFC,0x2C,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xD1,0x09,0x19,
0xF4,0xFF,0xFF,0xBE,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xF1,0x24,0x00,0x00,0x7B,
0xFF,0xFF,0xFF,0x54,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x09,0xE1,
0xFF,0xFF,0xE0,0x09,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x59,0xFF,
0xFF,0xFF,0x7F,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0xC7,0xFF,
0xFF,0xF6,0x1E,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x37,0xFE,0xFF,
0xFF,0xAA,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0xA4,0xFF,0xFF,
0xFF,0x41,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,
0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,
0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,
0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xFD,0xF7,0xF7,0xF7,
0xF7,0xF7,0xF7,0xE4,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEB,0xD3,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEB,0x00,0x00,0xD3,0xFF,0xFF,0xFF,
0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xFF,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,
0xFF,0xA4,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0xFF,0xFF,0xFF,0xFF,0x4F,0xD3,0xFF,
0xFF,0xFF,0xF4,0x0B,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0x4F,0xD3,
0xFF,0xFF,0xFF,0xFF,0x5C,0x00,0x00,0x00,0x00,0x00,0xD9,0xFF,0xFF,0xFF,0xFF,0x4F,
0xD3,0xFF,0xF7,0xF4,0xFF,0xB8,0x00,0x00,0x00,0x00,0x32,0xFF,0xFF,0xED,0xFF,0xFF,
0x4F,0xD3,0xFF,0xFD,0xAD,0xFF,0xFC,0x17,0x00,0x00,0x00,0x8C,0xFF,0xFC,0xAE,0xFF,
0xFF,0x4F,0xD3,0xFF,0xFF,0x70,0xFF,0xFF,0x6F,0x00,0x00,0x02,0xE3,0xFF,0xBE,0xAF,
0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x3E,0xF7,0xFF,0xCB,0x00,0x00,0x3F,0xFF,0xFF,0x69,
0xC6,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x41,0xB0,0xFF,0xFF,0x26,0x00,0x96,0xFF,0xFD,
0x17,0xD5,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x50,0x56,0xFF,0xFF,0x74,0x01,0xE4,0xFF,
0xBA,0x00,0xE2,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x5E,0x08,0xF0,0xFF,0xC2,0x33,0xFF,
0xFF,0x5D,0x00,0xEE,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x5F,0x00,0x9C,0xFF,0xFC,0x95,
0xFF,0xF4,0x0B,0x00,0xEF,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x5F,0x00,0x3E,0xFF,0xFF,
0xFF,0xFF,0xA3,0x00,0x00,0xEF,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x5F,0x00,0x01,0xE0,
0xFF,0xFF,0xFF,0x46,0x00,0x00,0xEF,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x5F,0x00,0x00,
0x83,0xFF,0xFF,0xE6,0x03,0x00,0x00,0xEF,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x5F,0x00,
0x00,0x26,0xFF,0xFF,0x8D,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,0x5F,
0x00,0x00,0x00,0x60,0x6B,0x1F,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x4F,0xD3,0xFF,0xFF,
0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEF,0xFF,0xFF,0x4F,0x00,0x00,
0xD3,0xFF,0xFF,0xF6,0x1A,0x00,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0xC3,0xD3,0xFF,
0xFF,0xFF,0x99,0x00,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0xFF,
0xFB,0x26,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0xFF,0xFF,0xAC,
0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0xE1,0xFF,0xFF,0x36,0x00,
0x00,0x00,0x97,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0x78,0xFF,0xFF,0xBE,0x00,0x00,0x00,
0x97,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0x3F,0xD2,0xFF,0xFF,0x48,0x00,0x00,0x97,0xFF,
0xFF,0xC3,0xD3,0xFF,0xFF,0x4F,0x5B,0xFF,0xFF,0xCF,0x01,0x00,0x93,0xFF,0xFF,0xC3,
0xD3,0xFF,0xFF,0x60,0x04,0xDB,0xFF,0xFF,0x5A,0x00,0x87,0xFF,0xFF,0xC3,0xD3,0xFF,
0xFF,0x71,0x00,0x59,0xFF,0xFF,0xDE,0x04,0x7B,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0x82,
0x00,0x01,0xD0,0xFF,0xFF,0x5A,0x6D,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0x87,0x00,0x00,
0x49,0xFF,0xFF,0xCE,0x56,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0x87,0x00,0x00,0x00,0xC2,
0xFF,0xFF,0x80,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0x87,0x00,0x00,0x00,0x3B,0xFF,0xFF,
0xE0,0xFF,0xFF,0xC3,0xD3,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0xB2,0xFF,0xFF,0xFF,
0xFF,0xC3,0xD3,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x2D,0xFD,0xFF,0xFF,0xFF,0xC3,
0xD3,0xFF,0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xFF,0xFF,0xC3,0xD3,0xFF,
0xFF,0x87,0x00,0x00,0x00,0x00,0x00,0x21,0xFA,0xFF,0xFF,0xC3,0x00,0x00,0x00,0x00,
0x22,0x88,0xCE,0xED,0xF8,0xE1,0xAA,0x55,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7C,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCB,0x1F,0x00,0x00,0x00,0x00,0x00,
0x91,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE6,0x1D,0x00,0x00,0x00,
0x4F,0xFF,0xFF,0xFF,0xFB,0x83,0x3A,0x22,0x59,0xD2,0xFF,0xFF,0xFF,0xC1,0x00,0x00,
0x00,0xD2,0xFF,0xFF,0xFD,0x47,0x00,0x00,0x00,0x00,0x0D,0xC2,0xFF,0xFF,0xFF,0x45,
0x00,0x36,0xFF,0xFF,0xFF,0xA9,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0xFF,0xFF,0xFF,
0xA8,0x00,0x75,0xFF,0xFF,0xFF,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xFF,
0xFF,0xE7,0x00,0x9C,0xFF,0xFF,0xFF,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA1,
0xFF,0xFF,0xFF,0x0E,0xAF,0xFF,0xFF,0xF5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x82,0xFF,0xFF,0xFF,0x23,0xAD,0xFF,0xFF,0xF7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x85,0xFF,0xFF,0xFF,0x20,0x9A,0xFF,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xA5,0xFF,0xFF,0xFF,0x0D,0x6E,0xFF,0xFF,0xFF,0x46,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xD3,0xFF,0xFF,0xE0,0x00,0x2D,0xFF,0xFF,0xFF,0xB4,0x00,0x00,0x00,
0x00,0x00,0x00,0x40,0xFF,0xFF,0xFF,0x9F,0x00,0x00,0xAF,0xFF,0xFF,0xFE,0x54,0x00,
0x00,0x00,0x00,0x12,0xCC,0xFF,0xFF,0xFA,0x27,0x00,0x00,0x23,0xF9,0xFF,0xFF,0xFD,
0x88,0x3B,0x23,0x5B,0xD7,0xFF,0xFF,0xFF,0x8F,0x00,0x00,0x00,0x00,0x7C,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0x11,0x00,0x00,0x00,0x00,0x00,0x72,
0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC4,0x19,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1E,0x85,0xCE,0xEE,0xF8,0xE1,0xA9,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xF2,0xD7,0xBB,0x63,0x09,0x00,0x00,0xD3,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEC,0x36,0x00,0xD3,0xFF,0xFF,0xF3,0xCF,0xD0,
0xE2,0xFA,0xFF,0xFF,0xFF,0xE6,0x1B,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x10,0x89,
0xFF,0xFF,0xFF,0x96,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0xC6,0xFF,0xFF,
0xD8,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x92,0xFF,0xFF,0xF0,0xD3,0xFF,
0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0xA2,0xFF,0xFF,0xE4,0xD3,0xFF,0xFF,0xBB,0x00,
0x00,0x00,0x00,0x10,0xE6,0xFF,0xFF,0xBC,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x14,0x44,
0xC9,0xFF,0xFF,0xFF,0x5C,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xA4,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,0x9A,0x0A,0x00,0xD3,
0xFF,0xFF,0xF3,0xCF,0xCF,0xC3,0xA1,0x7D,0x20,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,
0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x21,0x87,0xCE,0xED,0xF8,0xE0,0xA9,0x53,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x79,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC8,0x1C,0x00,0x00,0x00,0x00,0x00,
0x8B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE3,0x1A,0x00,0x00,0x00,
0x49,0xFF,0xFF,0xFF,0xFD,0x86,0x3B,0x23,0x5B,0xD5,0xFF,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0xCD,0xFF,0xFF,0xFE,0x4E,0x00,0x00,0x00,0x00,0x10,0xC8,0xFF,0xFF,0xFF,0x3E,
0x00,0x31,0xFF,0xFF,0xFF,0xB1,0x00,0x00,0x00,0x00,0x00,0x00,0x3D,0xFF,0xFF,0xFF,
0xA2,0x00,0x70,0xFF,0xFF,0xFF,0x45,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD1,0xFF,
0xFF,0xE1,0x00,0x9A,0xFF,0xFF,0xFF,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA5,
0xFF,0xFF,0xFF,0x0C,0xAD,0xFF,0xFF,0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x86,0xFF,0xFF,0xFF,0x1F,0xAA,0xFF,0xFF,0xF3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x80,0xFF,0xFF,0xFF,0x1E,0x88,0xFF,0xFF,0xFF,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x9D,0xFF,0xFF,0xFA,0x03,0x66,0xFF,0xFF,0xFF,0x31,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xBD,0xFF,0xFF,0xDD,0x00,0x3A,0xFF,0xFF,0xFF,0x8A,0x00,0x00,0x00,
0x00,0x00,0x00,0x1B,0xFB,0xFF,0xFF,0xAD,0x00,0x00,0xCC,0xFF,0xFF,0xEF,0x12,0x00,
0x00,0x00,0x00,0x00,0x8D,0xFF,0xFF,0xFF,0x40,0x00,0x00,0x53,0xFF,0xFF,0xFF,0xD3,
0x1B,0x00,0x00,0x00,0x7A,0xFF,0xFF,0xFF,0xCE,0x00,0x00,0x00,0x02,0xAB,0xFF,0xFF,
0xFF,0xFB,0xC8,0xAF,0xE9,0xFF,0xFF,0xFF,0xEC,0x2D,0x00,0x00,0x00,0x00,0x03,0xA2,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0x32,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x52,0xB6,0xFD,0xFF,0xFF,0xFF,0xE7,0x79,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x38,0xFD,0xFF,0xFF,0xBC,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x95,0xFF,0xFF,0xFF,0xCE,0x60,0x2C,0x0B,0x2B,0x19,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xB7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x91,0xF8,0xFF,0xFF,0xFF,0xFF,
0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x7D,0xA9,0xCC,
0xD0,0xB8,0x72,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,0xE1,0xC7,0x83,0x1C,0x00,
0x00,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x65,0x00,0x00,
0xD3,0xFF,0xFF,0xF3,0xCF,0xCF,0xDA,0xF4,0xFF,0xFF,0xFF,0xFB,0x44,0x00,0xD3,0xFF,
0xFF,0xBB,0x00,0x00,0x00,0x05,0x5C,0xFA,0xFF,0xFF,0xC1,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x00,0x00,0x00,0x9D,0xFF,0xFF,0xF5,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x7D,0xFF,0xFF,0xFE,0x04,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x00,0xB2,0xFF,0xFF,0xE3,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x09,0x7C,0xFF,
0xFF,0xFF,0xA3,0x00,0xD3,0xFF,0xFF,0xF2,0xCB,0xCB,0xD9,0xF7,0xFF,0xFF,0xFF,0xF6,
0x2A,0x00,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xED,0x44,0x00,0x00,
0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDC,0x10,0x00,0x00,0x00,0xD3,0xFF,
0xFF,0xBB,0x00,0x00,0x89,0xFF,0xFF,0xFF,0x3B,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,
0x00,0x00,0x12,0xF1,0xFF,0xFF,0xC7,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x7F,0xFF,0xFF,0xFF,0x55,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x0E,
0xEC,0xFF,0xFF,0xDC,0x05,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x75,0xFF,
0xFF,0xFF,0x6F,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x09,0xE6,0xFF,0xFF,
0xEC,0x0F,0xD3,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x6A,0xFF,0xFF,0xFF,0x89,
0x00,0x00,0x00,0x21,0x96,0xC6,0xEF,0xEF,0xCE,0x85,0x1E,0x00,0x00,0x00,0x00,0x00,
0x78,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x7C,0x01,0x00,0x00,0x58,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x34,0x00,0x00,0xE5,0xFF,0xFF,0xE9,0x54,
0x1B,0x2C,0x5B,0xC6,0xFF,0x72,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x6B,0x00,0x00,0x00,
0x00,0x01,0x45,0x00,0x00,0x00,0x2B,0xFF,0xFF,0xFF,0x8C,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x04,0xF4,0xFF,0xFF,0xFE,0x9D,0x2A,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x77,0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0x51,0x04,0x00,0x00,0x00,0x00,
0x00,0x03,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE1,0x67,0x02,0x00,0x00,0x00,0x00,
0x00,0x3E,0xBB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xAD,0x05,0x00,0x00,0x00,0x00,0x00,
0x00,0x27,0x91,0xF0,0xFF,0xFF,0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0B,0x85,0xFF,0xFF,0xFF,0xD3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xBB,0xFF,0xFF,0xF6,0x00,0x00,0x5B,0xAC,0x18,0x00,0x00,0x00,0x00,0x00,0xBE,
0xFF,0xFF,0xD7,0x00,0x3D,0xF9,0xFF,0xEF,0x7D,0x32,0x17,0x2C,0x8F,0xFF,0xFF,0xFF,
0x99,0x00,0xB5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE5,0x16,0x00,
0x06,0x8C,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD7,0x34,0x00,0x00,0x00,0x00,
0x1B,0x7A,0xC3,0xE8,0xF8,0xD7,0xAF,0x68,0x04,0x00,0x00,0x00,0x47,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x4B,0x47,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x4B,0x44,0xF3,0xF3,0xF3,0xF3,0xF7,
0xFF,0xFF,0xFF,0xF6,0xF3,0xF3,0xF3,0xF3,0x48,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,
0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,
0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,
0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x4B,0xFF,0xFF,0xFF,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEB,0xFF,0xFF,0x9F,
0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xDB,0xEB,0xFF,0xFF,0x9F,0x00,0x00,
0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xDB,0xEB,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,
0x00,0x00,0x8B,0xFF,0xFF,0xDB,0xEB,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,
0x8B,0xFF,0xFF,0xDB,0xEB,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,
0xFF,0xDB,0xEB,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xDB,
0xEB,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xDB,0xEB,0xFF,
0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xDB,0xEB,0xFF,0xFF,0x9F,
0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xDB,0xEB,0xFF,0xFF,0x9F,0x00,0x00,
0x00,0x00,0x00,0x00,0x8B,0xFF,0xFF,0xDB,0xE0,0xFF,0xFF,0xAB,0x00,0x00,0x00,0x00,
0x00,0x00,0x99,0xFF,0xFF,0xCF,0xD1,0xFF,0xFF,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,
0xB4,0xFF,0xFF,0xBF,0xA7,0xFF,0xFF,0xEB,0x06,0x00,0x00,0x00,0x00,0x02,0xE0,0xFF,
0xFF,0x96,0x6C,0xFF,0xFF,0xFF,0x60,0x00,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,0x5E,
0x13,0xF7,0xFF,0xFF,0xF7,0x6E,0x26,0x25,0x6B,0xF5,0xFF,0xFF,0xF2,0x0C,0x00,0x79,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x02,0x93,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8E,0x01,0x00,0x00,0x00,0x00,0x3C,0x98,0xC2,
0xEB,0xEB,0xC2,0x98,0x3A,0x00,0x00,0x00,0x06,0xF2,0xFF,0xFF,0xB9,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xC1,0xFF,0xFF,0xD0,0x00,0xAC,0xFF,0xFF,0xF6,0x07,0x00,0x00,
0x00,0x00,0x00,0x0B,0xFA,0xFF,0xFF,0x82,0x00,0x5F,0xFF,0xFF,0xFF,0x41,0x00,0x00,
0x00,0x00,0x00,0x49,0xFF,0xFF,0xFF,0x35,0x00,0x15,0xFD,0xFF,0xFF,0x85,0x00,0x00,
0x00,0x00,0x00,0x8C,0xFF,0xFF,0xE6,0x01,0x00,0x00,0xC5,0xFF,0xFF,0xCA,0x00,0x00,
0x00,0x00,0x00,0xD0,0xFF,0xFF,0x9A,0x00,0x00,0x00,0x78,0xFF,0xFF,0xFD,0x11,0x00,
0x00,0x00,0x15,0xFE,0xFF,0xFF,0x4C,0x00,0x00,0x00,0x2B,0xFF,0xFF,0xFF,0x52,0x00,
0x00,0x00,0x57,0xFF,0xFF,0xF6,0x09,0x00,0x00,0x00,0x00,0xDE,0xFF,0xFF,0x96,0x00,
0x00,0x00,0x9A,0xFF,0xFF,0xB1,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0xDB,0x00,
0x00,0x00,0xDE,0xFF,0xFF,0x64,0x00,0x00,0x00,0x00,0x00,0x43,0xFF,0xFF,0xFF,0x1E,
0x00,0x20,0xFF,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x05,0xF1,0xFF,0xFF,0x5F,
0x00,0x62,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA9,0xFF,0xFF,0xA1,
0x00,0xA5,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0xFF,0xFF,0xE3,
0x00,0xE7,0xFF,0xFF,0x2D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0xFC,0xFF,0xFF,
0x4E,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC2,0xFF,0xFF,
0xD4,0xFF,0xFF,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x75,0xFF,0xFF,
0xFF,0xFF,0xFF,0x45,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0xFF,0xFF,
0xFF,0xFF,0xF1,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xFF,
0xFF,0xFF,0xAA,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,0xFF,0x20,0x00,0x00,0x00,
0x00,0x8D,0xFF,0xFF,0xB5,0x00,0x00,0x00,0x00,0x03,0xF8,0xFF,0xFF,0x60,0x4B,0xFF,
0xFF,0xFF,0x49,0x00,0x00,0x00,0x00,0xC9,0xFF,0xFF,0xEF,0x01,0x00,0x00,0x00,0x24,
0xFF,0xFF,0xFF,0x31,0x1A,0xFF,0xFF,0xFF,0x72,0x00,0x00,0x00,0x0A,0xFB,0xFF,0xFF,
0xFF,0x2C,0x00,0x00,0x00,0x4D,0xFF,0xFF,0xFB,0x07,0x00,0xE9,0xFF,0xFF,0x9B,0x00,
0x00,0x00,0x41,0xFF,0xFF,0xFF,0xFF,0x68,0x00,0x00,0x00,0x75,0xFF,0xFF,0xD4,0x00,
0x00,0xB8,0xFF,0xFF,0xC5,0x00,0x00,0x00,0x7D,0xFF,0xFF,0xFF,0xFF,0xA4,0x00,0x00,
0x00,0x9D,0xFF,0xFF,0xA5,0x00,0x00,0x87,0xFF,0xFF,0xEE,0x00,0x00,0x00,0xB9,0xFF,
0xCE,0xE3,0xFF,0xE0,0x00,0x00,0x00,0xC6,0xFF,0xFF,0x76,0x00,0x00,0x56,0xFF,0xFF,
0xFF,0x17,0x00,0x03,0xF2,0xFF,0x9F,0xB4,0xFF,0xFF,0x1C,0x00,0x00,0xEE,0xFF,0xFF,
0x48,0x00,0x00,0x25,0xFF,0xFF,0xFF,0x41,0x00,0x31,0xFF,0xFF,0x70,0x85,0xFF,0xFF,
0x58,0x00,0x17,0xFF,0xFF,0xFF,0x19,0x00,0x00,0x01,0xF2,0xFF,0xFF,0x6A,0x00,0x6D,
0xFF,0xFF,0x41,0x56,0xFF,0xFF,0x94,0x00,0x3F,0xFF,0xFF,0xEB,0x00,0x00,0x00,0x00,
0xC3,0xFF,0xFF,0x8F,0x00,0xA2,0xFF,0xFE,0x10,0x23,0xFF,0xFF,0xC9,0x00,0x64,0xFF,
0xFF,0xBC,0x00,0x00,0x00,0x00,0x93,0xFF,0xFF,0xB3,0x00,0xD4,0xFF,0xD6,0x00,0x00,
0xEA,0xFF,0xF7,0x04,0x88,0xFF,0xFF,0x8D,0x00,0x00,0x00,0x00,0x62,0xFF,0xFF,0xD7,
0x0A,0xFC,0xFF,0x9E,0x00,0x00,0xB1,0xFF,0xFF,0x2D,0xAB,0xFF,0xFF,0x5E,0x00,0x00,
0x00,0x00,0x31,0xFF,0xFF,0xF9,0x3C,0xFF,0xFF,0x66,0x00,0x00,0x77,0xFF,0xFF,0x5F,
0xCE,0xFF,0xFF,0x30,0x00,0x00,0x00,0x00,0x06,0xFA,0xFF,0xFF,0x8B,0xFF,0xFF,0x2E,
0x00,0x00,0x3E,0xFF,0xFF,0x92,0xF2,0xFF,0xFA,0x06,0x00,0x00,0x00,0x00,0x00,0xCF,
0xFF,0xFF,0xE3,0xFF,0xF3,0x03,0x00,0x00,0x0A,0xFB,0xFF,0xDF,0xFF,0xFF,0xD2,0x00,
0x00,0x00,0x00,0x00,0x00,0x9E,0xFF,0xFF,0xFF,0xFF,0xBE,0x00,0x00,0x00,0x00,0xCB,
0xFF,0xFF,0xFF,0xFF,0xA4,0x00,0x00,0x00,0x00,0x00,0x00,0x6D,0xFF,0xFF,0xFF,0xFF,
0x86,0x00,0x00,0x00,0x00,0x92,0xFF,0xFF,0xFF,0xFF,0x75,0x00,0x00,0x00,0x00,0x00,
0x00,0x3C,0xFF,0xFF,0xFF,0xFF,0x4F,0x00,0x00,0x00,0x00,0x58,0xFF,0xFF,0xFF,0xFF,
0x46,0x00,0x00,0x00,0x1E,0xF8,0xFF,0xFF,0xD0,0x00,0x00,0x00,0x00,0x00,0x92,0xFF,
0xFF,0xFB,0x25,0x00,0x8D,0xFF,0xFF,0xFF,0x4C,0x00,0x00,0x00,0x12,0xF4,0xFF,0xFF,
0x99,0x00,0x00,0x13,0xF1,0xFF,0xFF,0xC7,0x00,0x00,0x00,0x7B,0xFF,0xFF,0xF7,0x1B,
0x00,0x00,0x00,0x7A,0xFF,0xFF,0xFF,0x42,0x00,0x07,0xE8,0xFF,0xFF,0x8C,0x00,0x00,
0x00,0x00,0x0A,0xE6,0xFF,0xFF,0xB9,0x00,0x5C,0xFF,0xFF,0xF2,0x13,0x00,0x00,0x00,
0x00,0x00,0x67,0xFF,0xFF,0xFF,0x30,0xC5,0xFF,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,
0x00,0x04,0xD9,0xFF,0xFF,0xCD,0xFF,0xFF,0xEB,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x53,0xFF,0xFF,0xFF,0xFF,0xFF,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xD4,0xFF,0xFF,0xFF,0xE5,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,
0xF8,0xFF,0xFF,0xFF,0xF4,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA1,0xFF,
0xFF,0xFF,0xFF,0xFF,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0xFD,0xFF,0xFA,
0x81,0xFF,0xFF,0xFC,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0xB5,0xFF,0xFF,0xA6,0x07,
0xE6,0xFF,0xFF,0xB0,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0x38,0x00,0x75,
0xFF,0xFF,0xFF,0x3D,0x00,0x00,0x00,0x00,0xC8,0xFF,0xFF,0xC4,0x00,0x00,0x0D,0xED,
0xFF,0xFF,0xC8,0x00,0x00,0x00,0x53,0xFF,0xFF,0xFF,0x49,0x00,0x00,0x00,0x7A,0xFF,
0xFF,0xFF,0x54,0x00,0x04,0xD9,0xFF,0xFF,0xCE,0x00,0x00,0x00,0x00,0x0D,0xED,0xFF,
0xFF,0xDB,0x05,0x67,0xFF,0xFF,0xFF,0x54,0x00,0x00,0x00,0x00,0x00,0x7B,0xFF,0xFF,
0xFF,0x6D,0x00,0x00,0x06,0xE5,0xFF,0xFF,0xCF,0x00,0x00,0x00,0x00,0x00,0x00,0xCF,
0xFF,0xFF,0xD6,0x01,0x00,0x75,0xFF,0xFF,0xFF,0x36,0x00,0x00,0x00,0x00,0x37,0xFF,
0xFF,0xFF,0x5F,0x00,0x00,0x0E,0xF0,0xFF,0xFF,0x9E,0x00,0x00,0x00,0x00,0x9F,0xFF,
0xFF,0xE2,0x05,0x00,0x00,0x00,0x86,0xFF,0xFF,0xF6,0x10,0x00,0x00,0x11,0xF6,0xFF,
0xFF,0x6F,0x00,0x00,0x00,0x00,0x17,0xF7,0xFF,0xFF,0x6D,0x00,0x00,0x6F,0xFF,0xFF,
0xED,0x0B,0x00,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0xD0,0x00,0x00,0xD4,0xFF,0xFF,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xFC,0xFF,0xFF,0x32,0x3A,0xFF,0xFF,0xF5,
0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xFF,0xFF,0x95,0x9F,0xFF,0xFF,0x90,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0xFF,0xFF,0xF1,0xF5,0xFF,0xFB,0x1E,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB9,0xFF,0xFF,0xFF,0xFF,0xA1,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,0xFF,0xFE,0x2B,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE,0xFF,0xFF,0xC6,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD3,0xFF,0xFF,0xBB,0x00,0x00,
0x00,0x00,0x00,0x00,0x2F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xA7,0x2F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA7,0x2D,0xF3,
0xF3,0xF3,0xF3,0xF3,0xF3,0xF3,0xFC,0xFF,0xFF,0xFF,0x68,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x19,0xF0,0xFF,0xFF,0xC4,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAD,
0xFF,0xFF,0xF9,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0xFF,0xFF,0xFF,0x7D,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE6,0xFF,0xFF,0xD4,0x05,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x9A,0xFF,0xFF,0xFD,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x40,0xFE,0xFF,0xFF,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xDA,0xFF,0xFF,
0xE1,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x86,0xFF,0xFF,0xFF,0x4A,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x2F,0xFB,0xFF,0xFF,0xA5,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0xCB,0xFF,0xFF,0xEC,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0xFF,
0xFF,0xFF,0x5E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xF5,0xFF,0xFF,0xBA,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB9,0xFF,0xFF,0xFF,0xFB,0xF7,0xF7,0xF7,0xF7,
0xF7,0xF7,0xF7,0xB9,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xBF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0x00,0x00,
0x93,0xFF,0xFF,0xFF,0xFF,0xE7,0x93,0xFF,0xFF,0xE1,0xDF,0xCA,0x93,0xFF,0xFF,0x0F,
0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,
0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,
0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,
0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,
0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,
0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,
0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,0xFF,0x0F,0x00,0x00,0x93,0xFF,
0xFF,0xE9,0xE7,0xD2,0x93,0xFF,0xFF,0xFF,0xFF,0xE7,0x00,0x00,0x33,0xFF,0xFF,0x1F,
0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0xFF,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0xB3,
0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,
0x00,0x33,0xFF,0xFF,0x21,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0xFF,0x61,0x00,0x00,
0x00,0x00,0x00,0x00,0xB3,0xFF,0xA2,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0xFF,0xE2,
0x00,0x00,0x00,0x00,0x00,0x00,0x32,0xFF,0xFF,0x23,0x00,0x00,0x00,0x00,0x00,0x02,
0xF0,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0xB2,0xFF,0xA4,0x00,0x00,0x00,0x00,
0x00,0x00,0x72,0xFF,0xE4,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0xFF,0xFF,0x25,0x00,
0x00,0x00,0x00,0x00,0x02,0xF0,0xFF,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0xB2,0xFF,
0xA5,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0xFF,0xE6,0x00,0x00,0x00,0x00,0x00,0x00,
0x31,0xFF,0xFF,0x26,0x00,0x00,0x00,0x00,0x00,0x02,0xEF,0xFF,0x67,0x00,0x00,0x00,
0x00,0x00,0x00,0xB1,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0x00,0x71,0xFF,0xE7,0x00,
0x00,0x00,0x00,0x00,0x00,0x31,0xFF,0xFF,0x28,0x00,0x00,0x00,0x00,0x00,0x02,0xEF,
0xFF,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0xB1,0xFF,0xA9,0x00,0x00,0x00,0x00,0x00,
0x00,0x56,0xB3,0x9E,0xDB,0xFF,0xFF,0xFF,0xFF,0xA3,0xC0,0xDF,0xDF,0xFF,0xFF,0xA3,
0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,
0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,
0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,
0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,
0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,
0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,
0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xFF,
0xFF,0xA3,0xC7,0xE7,0xE7,0xFF,0xFF,0xA3,0xDB,0xFF,0xFF,0xFF,0xFF,0xA3,0x00,0x00,
0x00,0x00,0x00,0x00,0x14,0x2F,0x2F,0x1A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xA8,0xFF,0xFF,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0xF9,0xFF,0xFF,0xFF,
0x2D,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0xFF,0xFF,0xFF,0xFF,0x90,0x00,0x00,0x00,
0x00,0x00,0x00,0xD3,0xFF,0xD4,0xB4,0xFF,0xED,0x07,0x00,0x00,0x00,0x00,0x36,0xFF,
0xFF,0x7D,0x5E,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x9A,0xFF,0xFF,0x26,0x0F,0xF8,
0xFF,0xBD,0x00,0x00,0x00,0x0B,0xF2,0xFF,0xCF,0x00,0x00,0xB0,0xFF,0xFE,0x23,0x00,
0x00,0x61,0xFF,0xFF,0x74,0x00,0x00,0x54,0xFF,0xFF,0x85,0x00,0x00,0xC4,0xFF,0xFD,
0x1A,0x00,0x00,0x07,0xEF,0xFF,0xE5,0x03,0x28,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,
0x9A,0xFF,0xFF,0x4E,0x3F,0x8B,0x8B,0x3F,0x00,0x00,0x00,0x00,0x2C,0x8B,0x8B,0x55,
0x0A,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x04,0xAB,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x4B,0xAB,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x4B,0x00,0x00,0x00,0x00,0x74,0x7A,
0x00,0x00,0x00,0x00,0x00,0x7C,0xFF,0xFE,0x53,0x00,0x00,0x00,0x21,0xF2,0xFF,0xFF,
0xF5,0x32,0x00,0x00,0x00,0x2F,0xE5,0xFF,0xFF,0xE4,0x1A,0x00,0x00,0x00,0x1E,0xD5,
0xFF,0xFF,0xCC,0x06,0x00,0x00,0x00,0x10,0xC0,0xFF,0x83,0x00,0x00,0x00,0x00,0x00,
0x07,0x55,0x00,0x00,0x00,0x00,0x1C,0x83,0xC8,0xEC,0xF4,0xCB,0x92,0x10,0x00,0x00,
0x12,0x99,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE2,0x26,0x00,0x07,0xE1,0xFF,0xFF,
0xFF,0xE6,0xF9,0xFF,0xFF,0xFF,0xAC,0x00,0x00,0x60,0xDC,0x62,0x15,0x00,0x0A,0xB0,
0xFF,0xFF,0xFE,0x20,0x00,0x02,0x03,0x00,0x00,0x00,0x00,0x30,0xFF,0xFF,0xFF,0x46,
0x00,0x00,0x00,0x00,0x27,0x63,0x93,0xBC,0xFF,0xFF,0xFF,0x67,0x00,0x00,0x5D,0xD2,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x77,0x00,0x8B,0xFF,0xFF,0xFF,0xD5,0x8D,0x66,
0xFF,0xFF,0xFF,0x77,0x55,0xFF,0xFF,0xF7,0x53,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0x77,
0x9A,0xFF,0xFF,0xA8,0x00,0x00,0x00,0x10,0xFF,0xFF,0xFF,0x77,0xB8,0xFF,0xFF,0xCE,
0x08,0x00,0x13,0xB5,0xFF,0xFF,0xFF,0x77,0x85,0xFF,0xFF,0xFF,0xF5,0xD1,0xFB,0xFF,
0xFF,0xFF,0xFF,0x77,0x11,0xE4,0xFF,0xFF,0xFF,0xFF,0xFF,0xBA,0xB9,0xFF,0xFF,0x77,
0x00,0x17,0x9E,0xDF,0xF5,0xCA,0x61,0x00,0x7B,0xFF,0xFF,0x77,0x0A,0x5F,0x5F,0x5F,
0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x1B,0xFF,0xFF,0xFF,0x5B,0x2F,0xA4,0xDF,0xE6,0xAD,0x4D,0x00,0x00,0x00,0x1B,0xFF,
0xFF,0xFF,0xBE,0xFA,0xFF,0xFF,0xFF,0xFF,0xFE,0x7D,0x00,0x00,0x1B,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFD,0xF9,0xFF,0xFF,0xFF,0xFF,0x3E,0x00,0x1B,0xFF,0xFF,0xFF,0xFA,0x72,
0x10,0x07,0x6A,0xFD,0xFF,0xFF,0xBB,0x00,0x1B,0xFF,0xFF,0xFF,0x71,0x00,0x00,0x00,
0x00,0xB2,0xFF,0xFF,0xFF,0x0B,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x69,
0xFF,0xFF,0xFF,0x2C,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x51,0xFF,0xFF,
0xFF,0x4C,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x5B,0xFF,0xFF,0xFF,0x39,
0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x7D,0xFF,0xFF,0xFF,0x12,0x1B,0xFF,
0xFF,0xFF,0x63,0x00,0x00,0x00,0x01,0xD9,0xFF,0xFF,0xE8,0x00,0x1B,0xFF,0xFF,0xFF,
0xD1,0x3C,0x01,0x0D,0x99,0xFF,0xFF,0xFF,0x7C,0x00,0x1B,0xFF,0xFF,0xFF,0xFF,0xFF,
0xF4,0xFC,0xFF,0xFF,0xFF,0xE3,0x09,0x00,0x1B,0xFF,0xFF,0xEA,0x99,0xFF,0xFF,0xFF,
0xFF,0xFF,0xE0,0x33,0x00,0x00,0x1B,0xFF,0xFF,0xBD,0x00,0x53,0xB9,0xEF,0xCE,0x90,
0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x8A,0xBD,0xEC,0xE1,0xAF,0x52,0x00,0x00,
0x00,0x63,0xEE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x88,0x00,0x54,0xFF,0xFF,0xFF,0xFF,
0xFA,0xF6,0xFF,0xF1,0x23,0x17,0xEB,0xFF,0xFF,0xF2,0x5B,0x08,0x04,0x5A,0x51,0x00,
0x86,0xFF,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xFF,0xFF,0xE4,0x01,
0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xDF,0xFF,0xFF,0xB9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB4,0xFF,0xFF,0xE1,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0xFF,0xFF,0xFF,0x51,0x00,0x00,0x00,0x00,
0x00,0x00,0x27,0xF8,0xFF,0xFF,0xEE,0x50,0x04,0x05,0x48,0xB0,0x05,0x00,0x7E,0xFF,
0xFF,0xFF,0xFF,0xF6,0xF7,0xFF,0xFF,0x76,0x00,0x05,0x8B,0xFC,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x9F,0x00,0x00,0x00,0x36,0x9F,0xCD,0xF4,0xD8,0xAC,0x3F,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x5F,0x5F,0x34,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xF7,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,
0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF4,0xFF,0xFF,0x8B,0x00,0x00,
0x00,0x5A,0xB3,0xEC,0xD7,0x9A,0x17,0xE4,0xFF,0xFF,0x8B,0x00,0x06,0x98,0xFF,0xFF,
0xFF,0xFF,0xFF,0xEA,0xEF,0xFF,0xFF,0x8B,0x00,0x79,0xFF,0xFF,0xFF,0xFF,0xF5,0xFF,
0xFF,0xFF,0xFF,0xFF,0x8B,0x16,0xF2,0xFF,0xFF,0xE5,0x3A,0x00,0x17,0x94,0xFF,0xFF,
0xFF,0x8B,0x73,0xFF,0xFF,0xFF,0x4E,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0x9C,
0xFF,0xFF,0xEF,0x01,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0xC5,0xFF,0xFF,0xCF,
0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0xD3,0xFF,0xFF,0xCC,0x00,0x00,0x00,
0x00,0x00,0xF7,0xFF,0xFF,0x8B,0xB2,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0xF7,
0xFF,0xFF,0x8B,0x8F,0xFF,0xFF,0xFF,0x3A,0x00,0x00,0x00,0x08,0xF9,0xFF,0xFF,0x8B,
0x3D,0xFF,0xFF,0xFF,0xD5,0x27,0x00,0x22,0xC3,0xFF,0xFF,0xFF,0x8B,0x00,0xB9,0xFF,
0xFF,0xFF,0xFF,0xF2,0xFF,0xFF,0xFF,0xFF,0xFF,0x8B,0x00,0x20,0xD2,0xFF,0xFF,0xFF,
0xFF,0xFF,0xD7,0xB4,0xFF,0xFF,0x8B,0x00,0x00,0x0A,0x86,0xC4,0xF1,0xC8,0x80,0x0A,
0x62,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x31,0x9C,0xD3,0xF1,0xC3,0x8C,0x11,0x00,0x00,
0x00,0x01,0x77,0xFA,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0x31,0x00,0x00,0x67,0xFF,0xFF,
0xFF,0xEA,0xCC,0xF4,0xFF,0xFF,0xD7,0x03,0x19,0xF0,0xFF,0xFF,0x89,0x04,0x00,0x13,
0xC9,0xFF,0xFF,0x5F,0x88,0xFF,0xFF,0xCD,0x01,0x00,0x00,0x00,0x49,0xFF,0xFF,0xA6,
0xCB,0xFF,0xFF,0xAF,0x53,0x53,0x53,0x53,0x6B,0xFF,0xFF,0xCA,0xE7,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE6,0xEA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xD7,0xD1,0xFF,0xFF,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x92,0xFF,0xFF,0xEC,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xF5,0xFF,0xFF,
0xC0,0x1E,0x00,0x00,0x00,0x48,0x3B,0x00,0x00,0x72,0xFF,0xFF,0xFF,0xF9,0xCD,0xC1,
0xE8,0xFF,0xD5,0x03,0x00,0x02,0x7E,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEC,0x2F,
0x00,0x00,0x00,0x2B,0x99,0xC7,0xF2,0xE0,0xB8,0x74,0x0C,0x00,0x00,0x00,0x00,0x00,
0x42,0xB3,0xE0,0xF5,0xD6,0x69,0x00,0x00,0x00,0x68,0xFD,0xFF,0xFF,0xFF,0xFF,0x75,
0x00,0x00,0x10,0xEF,0xFF,0xFF,0xFD,0xD8,0xF4,0x34,0x00,0x00,0x53,0xFF,0xFF,0xFF,
0x5E,0x00,0x02,0x01,0x00,0x00,0x75,0xFF,0xFF,0xFF,0x0E,0x00,0x00,0x00,0x00,0x00,
0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x44,0xE9,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,
0x87,0x00,0x4F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x87,0x00,0x3F,0xCB,0xE6,0xFF,
0xFF,0xFF,0xCC,0xCB,0x6C,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,
0x00,0x00,0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,
0x03,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,
0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0x03,0x00,
0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,
0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,
0x00,0x00,0x83,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,
0x03,0x00,0x00,0x00,0x00,0x00,0x12,0x87,0xCA,0xF2,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xB3,0x00,0x34,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB3,0x11,0xE3,
0xFF,0xFF,0xD9,0x78,0x8F,0xF7,0xFF,0xFF,0xCB,0x97,0x6A,0x54,0xFF,0xFF,0xF2,0x15,
0x00,0x00,0x64,0xFF,0xFF,0xCC,0x00,0x00,0x88,0xFF,0xFF,0xC3,0x00,0x00,0x00,0x20,
0xFF,0xFF,0xF7,0x00,0x00,0x79,0xFF,0xFF,0xDE,0x01,0x00,0x00,0x3A,0xFF,0xFF,0xD6,
0x00,0x00,0x21,0xF7,0xFF,0xFF,0x86,0x10,0x25,0xC8,0xFF,0xFF,0x97,0x00,0x00,0x00,
0x51,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDD,0x10,0x00,0x00,0x00,0x31,0xF4,0xFF,
0xF3,0xFF,0xFF,0xF2,0x91,0x17,0x00,0x00,0x00,0x01,0xE1,0xFF,0xB4,0x01,0x1F,0x17,
0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xFF,0xFF,0xA1,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x26,0xFF,0xFF,0xFE,0xB6,0x93,0x8F,0x8F,0x81,0x6A,0x32,0x00,0x00,
0x00,0xBD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC4,0x10,0x00,0x60,0xFF,
0xFF,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x9C,0x6B,0xFE,0xFF,0x5B,0x00,0x00,
0x00,0x03,0x1E,0xBF,0xFF,0xFF,0xD7,0xEB,0xFF,0xFA,0x05,0x00,0x00,0x00,0x00,0x00,
0x95,0xFF,0xFF,0xC4,0xD3,0xFF,0xFF,0xA7,0x33,0x0C,0x09,0x2A,0x87,0xFD,0xFF,0xFD,
0x4F,0x61,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x5C,0x00,0x00,0x47,
0xB8,0xFB,0xFF,0xFF,0xFF,0xFD,0xDF,0x83,0x1B,0x00,0x00,0x00,0x00,0x00,0x09,0x22,
0x35,0x21,0x05,0x00,0x00,0x00,0x00,0x00,0x0A,0x5F,0x5F,0x5F,0x25,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,
0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,
0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x61,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x54,0x12,0x8E,0xDD,0xF5,0xCB,
0x75,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x81,0xE2,0xFF,0xFF,0xFF,0xFF,0xFF,0x95,0x00,
0x1B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x1C,0x1B,0xFF,0xFF,
0xFF,0xFF,0xA8,0x39,0x18,0x99,0xFF,0xFF,0xFF,0x69,0x1B,0xFF,0xFF,0xFF,0x96,0x00,
0x00,0x00,0x12,0xFF,0xFF,0xFF,0x85,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,
0xF0,0xFF,0xFF,0x9D,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,
0x9F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,
0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,0x63,
0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,
0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,
0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,
0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x06,0xA8,0xF3,0xCD,
0x28,0x5C,0xFF,0xFF,0xFF,0xA8,0x4F,0xFF,0xFF,0xFF,0x9A,0x01,0x7F,0xCC,0xA5,0x16,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,
0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,
0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,
0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,
0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,0x1B,0xFF,0xFF,0xFF,0x63,
0x00,0x00,0x00,0x04,0xA3,0xF3,0xD0,0x2D,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,0xB3,
0x00,0x00,0x00,0x47,0xFF,0xFF,0xFF,0xA5,0x00,0x00,0x00,0x00,0x7A,0xCB,0xA8,0x19,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,
0x00,0x00,0x00,0x17,0xFF,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x18,0xFF,0xFF,0xFF,0x6F,
0x00,0x00,0x00,0x22,0xFF,0xFF,0xFF,0x5C,0x00,0x00,0x00,0x66,0xFF,0xFF,0xFF,0x3F,
0x00,0xB8,0xD3,0xFB,0xFF,0xFF,0xE5,0x06,0x05,0xF8,0xFF,0xFF,0xFF,0xFD,0x61,0x00,
0x31,0xF5,0xFB,0xE5,0xB5,0x47,0x00,0x00,0x13,0xB3,0xB3,0xB3,0x3B,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,
0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,
0x53,0x00,0x00,0x00,0x4F,0xFE,0xFF,0xFF,0x7F,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,
0x00,0x23,0xF0,0xFF,0xFF,0xAE,0x01,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x08,0xCF,
0xFF,0xFF,0xD3,0x0C,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x9C,0xFF,0xFF,0xED,
0x22,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x61,0xFF,0xFF,0xFC,0x43,0x00,0x00,
0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x83,0xF6,0xFF,0xFF,0x7D,0x00,0x00,0x00,0x00,0x00,
0x1B,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xB7,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,
0xFF,0xE7,0xA7,0xFF,0xFF,0xE5,0x0E,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0xF7,0x36,
0x12,0xEE,0xFF,0xFF,0x91,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x70,0x00,0x00,0x70,
0xFF,0xFF,0xFC,0x32,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x05,0xDB,0xFF,
0xFF,0xCA,0x02,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x00,0x50,0xFF,0xFF,0xFF,
0x6A,0x00,0x1B,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x00,0x00,0xC0,0xFF,0xFF,0xF0,0x18,
0x0D,0x7B,0x7B,0x7B,0x30,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,
0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,
0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,
0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,
0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,
0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,
0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,
0x0C,0xFF,0xFF,0xFF,0x85,0x00,0x00,0x00,0xEC,0xFF,0xFF,0xFE,0x9A,0x00,0x00,0x8A,
0xFF,0xFF,0xFF,0xD4,0x00,0x00,0x06,0x8E,0xDF,0xF8,0xD1,0x00,0x1B,0xFF,0xFF,0xD2,
0x00,0x1A,0x9B,0xE5,0xF5,0xCE,0x5A,0x00,0x00,0x19,0x98,0xE4,0xEE,0xBD,0x46,0x00,
0x00,0x1B,0xFF,0xFF,0xEF,0x36,0xE6,0xFF,0xFF,0xFF,0xFF,0xFF,0x63,0x2F,0xE3,0xFF,
0xFF,0xFF,0xFF,0xFC,0x51,0x00,0x1B,0xFF,0xFF,0xFF,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xEF,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD3,0x00,0x1B,0xFF,0xFF,0xFF,0xFF,
0xA6,0x2F,0x23,0xC8,0xFF,0xFF,0xFF,0xFF,0xA5,0x2E,0x23,0xCA,0xFF,0xFF,0xFF,0x28,
0x1B,0xFF,0xFF,0xFF,0x95,0x00,0x00,0x00,0x4F,0xFF,0xFF,0xFF,0x95,0x00,0x00,0x00,
0x52,0xFF,0xFF,0xFF,0x44,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x2C,0xFF,0xFF,
0xFF,0x63,0x00,0x00,0x00,0x30,0xFF,0xFF,0xFF,0x5D,0x1B,0xFF,0xFF,0xFF,0x63,0x00,
0x00,0x00,0x23,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x27,0xFF,0xFF,0xFF,0x5F,0x1B,
0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x23,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x27,
0xFF,0xFF,0xFF,0x5F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x23,0xFF,0xFF,0xFF,
0x63,0x00,0x00,0x00,0x27,0xFF,0xFF,0xFF,0x5F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,
0x00,0x23,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x27,0xFF,0xFF,0xFF,0x5F,0x1B,0xFF,
0xFF,0xFF,0x63,0x00,0x00,0x00,0x23,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x27,0xFF,
0xFF,0xFF,0x5F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x23,0xFF,0xFF,0xFF,0x63,
0x00,0x00,0x00,0x27,0xFF,0xFF,0xFF,0x5F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,
0x23,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x27,0xFF,0xFF,0xFF,0x5F,0x1B,0xFF,0xFF,
0xFF,0x63,0x00,0x00,0x00,0x23,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x27,0xFF,0xFF,
0xFF,0x5F,0x00,0x00,0x1B,0xFF,0xFF,0xD2,0x00,0x12,0x8C,0xDD,0xF4,0xCB,0x75,0x00,
0x00,0x1B,0xFF,0xFF,0xF0,0x34,0xE0,0xFF,0xFF,0xFF,0xFF,0xFF,0x95,0x00,0x1B,0xFF,
0xFF,0xFF,0xFA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x1C,0x1B,0xFF,0xFF,0xFF,0xFF,
0xA8,0x39,0x18,0x99,0xFF,0xFF,0xFF,0x69,0x1B,0xFF,0xFF,0xFF,0x96,0x00,0x00,0x00,
0x12,0xFF,0xFF,0xFF,0x85,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xF0,0xFF,
0xFF,0x9D,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,
0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,
0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,
0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,
0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,
0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x1B,0xFF,0xFF,
0xFF,0x63,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x2B,
0x9A,0xCC,0xF2,0xCC,0x9A,0x2B,0x00,0x00,0x00,0x00,0x01,0x78,0xF8,0xFF,0xFF,0xFF,
0xFF,0xFF,0xF8,0x79,0x01,0x00,0x00,0x68,0xFF,0xFF,0xFF,0xFF,0xF3,0xFF,0xFF,0xFF,
0xFF,0x69,0x00,0x1C,0xF1,0xFF,0xFF,0xD7,0x2A,0x00,0x29,0xD6,0xFF,0xFF,0xF2,0x1D,
0x8B,0xFF,0xFF,0xFF,0x31,0x00,0x00,0x00,0x2F,0xFF,0xFF,0xFF,0x8D,0xCC,0xFF,0xFF,
0xD6,0x00,0x00,0x00,0x00,0x00,0xD4,0xFF,0xFF,0xCF,0xE8,0xFF,0xFF,0xB5,0x00,0x00,
0x00,0x00,0x00,0xB3,0xFF,0xFF,0xEB,0xE9,0xFF,0xFF,0xB5,0x00,0x00,0x00,0x00,0x00,
0xB2,0xFF,0xFF,0xEC,0xCF,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0xD2,0xFF,0xFF,
0xD1,0x8D,0xFF,0xFF,0xFF,0x2D,0x00,0x00,0x00,0x2B,0xFF,0xFF,0xFF,0x90,0x1F,0xF3,
0xFF,0xFF,0xD3,0x24,0x00,0x23,0xD1,0xFF,0xFF,0xF4,0x20,0x00,0x6C,0xFF,0xFF,0xFF,
0xFF,0xEE,0xFF,0xFF,0xFF,0xFF,0x6C,0x00,0x00,0x01,0x7D,0xF9,0xFF,0xFF,0xFF,0xFF,
0xFF,0xF9,0x7D,0x01,0x00,0x00,0x00,0x00,0x2D,0x9C,0xCE,0xF3,0xCE,0x9C,0x2D,0x00,
0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xD5,0x00,0x32,0xAD,0xEC,0xE6,0xAD,0x4E,0x00,
0x00,0x00,0x1B,0xFF,0xFF,0xF8,0x86,0xFB,0xFF,0xFF,0xFF,0xFF,0xFE,0x7E,0x00,0x00,
0x1B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xF9,0xFF,0xFF,0xFF,0xFF,0x3F,0x00,0x1B,0xFF,
0xFF,0xFF,0xFA,0x72,0x10,0x07,0x6A,0xFD,0xFF,0xFF,0xBB,0x00,0x1B,0xFF,0xFF,0xFF,
0x71,0x00,0x00,0x00,0x00,0xB2,0xFF,0xFF,0xFF,0x0C,0x1B,0xFF,0xFF,0xFF,0x63,0x00,
0x00,0x00,0x00,0x69,0xFF,0xFF,0xFF,0x2C,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,
0x00,0x51,0xFF,0xFF,0xFF,0x4C,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x5C,
0xFF,0xFF,0xFF,0x3A,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x7E,0xFF,0xFF,
0xFF,0x13,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x02,0xDA,0xFF,0xFF,0xE9,0x00,
0x1B,0xFF,0xFF,0xFF,0xD5,0x40,0x02,0x0E,0x9D,0xFF,0xFF,0xFF,0x7D,0x00,0x1B,0xFF,
0xFF,0xFF,0xFF,0xFF,0xF4,0xFD,0xFF,0xFF,0xFF,0xE4,0x0A,0x00,0x1B,0xFF,0xFF,0xFF,
0xD9,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x33,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x55,0x59,
0xC0,0xF1,0xCE,0x90,0x12,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x60,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x5A,0xB3,0xEC,0xD8,0x9F,0x1A,0x4A,0xFF,0xFF,0x8B,0x00,0x06,0x9A,
0xFF,0xFF,0xFF,0xFF,0xFF,0xEA,0xB1,0xFF,0xFF,0x8B,0x00,0x7D,0xFF,0xFF,0xFF,0xFF,
0xF5,0xFF,0xFF,0xFF,0xFF,0xFF,0x8B,0x1A,0xF4,0xFF,0xFF,0xE5,0x3A,0x00,0x17,0x94,
0xFF,0xFF,0xFF,0x8B,0x76,0xFF,0xFF,0xFF,0x4E,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,
0x8B,0xA0,0xFF,0xFF,0xEF,0x01,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0xCA,0xFF,
0xFF,0xCF,0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0xD0,0xFF,0xFF,0xCC,0x00,
0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0xAE,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,
0x00,0xF7,0xFF,0xFF,0x8B,0x8C,0xFF,0xFF,0xFF,0x3A,0x00,0x00,0x00,0x08,0xF9,0xFF,
0xFF,0x8B,0x37,0xFF,0xFF,0xFF,0xD5,0x27,0x00,0x22,0xC3,0xFF,0xFF,0xFF,0x8B,0x00,
0xB5,0xFF,0xFF,0xFF,0xFF,0xF2,0xFF,0xFF,0xFF,0xFF,0xFF,0x8B,0x00,0x1E,0xCF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xD7,0xEB,0xFF,0xFF,0x8B,0x00,0x00,0x09,0x85,0xC4,0xF1,0xCB,
0x83,0x09,0xE6,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF5,
0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xF7,0xFF,0xFF,0x8B,0x00,0x1B,0xFF,0xFF,0xCF,0x00,0x18,0x9F,0xED,
0xF8,0x65,0x1B,0xFF,0xFF,0xE6,0x1B,0xDE,0xFF,0xFF,0xFF,0x37,0x1B,0xFF,0xFF,0xFC,
0xBE,0xFF,0xFF,0xFF,0xFD,0x0A,0x1B,0xFF,0xFF,0xFF,0xFF,0xE7,0x60,0x2A,0x40,0x00,
0x1B,0xFF,0xFF,0xFF,0xF4,0x27,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x85,0x00,
0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,
0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,
0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,
0x63,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,
0x1B,0xFF,0xFF,0xFF,0x63,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,0xFF,0xFF,0x63,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0xB8,0xE1,0xF7,0xDC,0x98,0x26,0x00,0x00,
0x00,0x00,0x9B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,0x76,0x00,0x00,0x51,0xFF,0xFF,
0xFF,0xE0,0xB4,0xE4,0xFF,0xFC,0x3E,0x00,0x00,0x97,0xFF,0xFF,0xCB,0x00,0x00,0x00,
0x56,0x6C,0x00,0x00,0x00,0xA0,0xFF,0xFF,0xD5,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x57,0xFF,0xFF,0xFF,0xEC,0x8D,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x91,0xFE,
0xFF,0xFF,0xFF,0xFF,0xB8,0x29,0x00,0x00,0x00,0x00,0x00,0x32,0xBC,0xFF,0xFF,0xFF,
0xFF,0xF7,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0xA5,0xFE,0xFF,0xFF,0xCA,0x00,
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x73,0xFF,0xFF,0xFB,0x06,0x00,0x39,0xDA,0x4D,
0x00,0x00,0x00,0x7A,0xFF,0xFF,0xEC,0x00,0x10,0xE0,0xFF,0xFF,0xE6,0xB2,0xB8,0xFB,
0xFF,0xFF,0xA0,0x00,0x15,0x9F,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD4,0x0E,0x00,
0x00,0x00,0x33,0x9E,0xDD,0xF8,0xE4,0xBF,0x6C,0x05,0x00,0x00,0x00,0x00,0x0A,0x97,
0x97,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0xFF,0xFF,0xEB,0x00,0x00,0x00,0x00,
0x00,0x00,0x45,0xFF,0xFF,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0xFF,0xFF,0xEB,
0x00,0x00,0x00,0x00,0x6C,0xE8,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3B,0x7F,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3B,0x65,0xCB,0xEB,0xFF,0xFF,0xFB,0xCB,0xCB,
0xCB,0x2F,0x00,0x00,0x9B,0xFF,0xFF,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,
0xFF,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,0xFF,0xEB,0x00,0x00,0x00,0x00,
0x00,0x00,0x9B,0xFF,0xFF,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,0xFF,0xEB,
0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xFF,0xFF,0xEC,0x00,0x00,0x00,0x00,0x00,0x00,
0x8B,0xFF,0xFF,0xFA,0x02,0x00,0x00,0x00,0x00,0x00,0x6E,0xFF,0xFF,0xFF,0x5B,0x00,
0x02,0x01,0x00,0x00,0x25,0xFD,0xFF,0xFF,0xFD,0xD5,0xF0,0x30,0x00,0x00,0x00,0x97,
0xFF,0xFF,0xFF,0xFF,0xFF,0x69,0x00,0x00,0x00,0x00,0x6C,0xC5,0xF0,0xEE,0xCD,0x59,
0x3F,0xFF,0xFF,0xFF,0x43,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x67,0x3F,0xFF,0xFF,
0xFF,0x43,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x67,0x3F,0xFF,0xFF,0xFF,0x43,0x00,
0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x67,0x3F,0xFF,0xFF,0xFF,0x43,0x00,0x00,0x00,0x1F,
0xFF,0xFF,0xFF,0x67,0x3F,0xFF,0xFF,0xFF,0x43,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,
0x67,0x3F,0xFF,0xFF,0xFF,0x43,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x67,0x3F,0xFF,
0xFF,0xFF,0x43,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x67,0x3F,0xFF,0xFF,0xFF,0x43,
0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x67,0x3D,0xFF,0xFF,0xFF,0x4C,0x00,0x00,0x00,
0x1F,0xFF,0xFF,0xFF,0x67,0x27,0xFF,0xFF,0xFF,0x6B,0x00,0x00,0x00,0x59,0xFF,0xFF,
0xFF,0x67,0x0C,0xFF,0xFF,0xFF,0xD7,0x27,0x1E,0x6F,0xF7,0xFF,0xFF,0xFF,0x67,0x00,
0xBB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xF1,0xFF,0xFF,0x67,0x00,0x40,0xF9,0xFF,
0xFF,0xFF,0xFF,0xF8,0x56,0xA5,0xFF,0xFF,0x67,0x00,0x00,0x3B,0xBA,0xEC,0xEC,0xB4,
0x36,0x00,0x87,0xFF,0xFF,0x67,0x00,0x00,0x82,0xFF,0xFF,0xF8,0x0A,0x00,0x00,0x00,
0x00,0x0F,0xFB,0xFF,0xFF,0x52,0x2E,0xFF,0xFF,0xFF,0x4A,0x00,0x00,0x00,0x00,0x53,
0xFF,0xFF,0xF6,0x0A,0x00,0xDA,0xFF,0xFF,0x92,0x00,0x00,0x00,0x00,0x9B,0xFF,0xFF,
0xAE,0x00,0x00,0x87,0xFF,0xFF,0xD9,0x00,0x00,0x00,0x00,0xE2,0xFF,0xFF,0x5C,0x00,
0x00,0x33,0xFF,0xFF,0xFF,0x21,0x00,0x00,0x2A,0xFF,0xFF,0xFA,0x10,0x00,0x00,0x00,
0xDF,0xFF,0xFF,0x68,0x00,0x00,0x71,0xFF,0xFF,0xB8,0x00,0x00,0x00,0x00,0x8B,0xFF,
0xFF,0xB0,0x00,0x00,0xB9,0xFF,0xFF,0x66,0x00,0x00,0x00,0x00,0x38,0xFF,0xFF,0xF1,
0x03,0x06,0xF6,0xFF,0xFD,0x17,0x00,0x00,0x00,0x00,0x01,0xE3,0xFF,0xFF,0x34,0x3D,
0xFF,0xFF,0xC2,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0xFF,0x74,0x7D,0xFF,0xFF,
0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x3D,0xFF,0xFF,0xB4,0xBD,0xFF,0xFF,0x1F,0x00,
0x00,0x00,0x00,0x00,0x00,0x02,0xE7,0xFF,0xF5,0xF8,0xFF,0xCC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x95,0xFF,0xFF,0xFF,0xFF,0x7A,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x41,0xFF,0xFF,0xFF,0xFF,0x28,0x00,0x00,0x00,0x00,0x3C,0xFF,0xFF,0xFF,
0x46,0x00,0x00,0x00,0x45,0xFF,0xFF,0xFF,0x1E,0x00,0x00,0x00,0x56,0xFF,0xFF,0xE9,
0x00,0x06,0xF6,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x81,0xFF,0xFF,0xFF,0x5C,0x00,0x00,
0x00,0x8C,0xFF,0xFF,0xAC,0x00,0x00,0xBC,0xFF,0xFF,0xB1,0x00,0x00,0x00,0xBD,0xFF,
0xFF,0xFF,0x9A,0x00,0x00,0x00,0xC2,0xFF,0xFF,0x6F,0x00,0x00,0x7D,0xFF,0xFF,0xE7,
0x00,0x00,0x04,0xF5,0xFF,0xF1,0xFF,0xD8,0x00,0x00,0x03,0xF5,0xFF,0xFF,0x33,0x00,
0x00,0x3D,0xFF,0xFF,0xFF,0x1D,0x00,0x35,0xFF,0xFF,0x96,0xFF,0xFF,0x17,0x00,0x2E,
0xFF,0xFF,0xF3,0x03,0x00,0x00,0x07,0xF6,0xFF,0xFF,0x53,0x00,0x70,0xFF,0xF2,0x49,
0xFF,0xFF,0x54,0x00,0x64,0xFF,0xFF,0xBA,0x00,0x00,0x00,0x00,0xBD,0xFF,0xFF,0x8A,
0x00,0xAC,0xFF,0xC6,0x19,0xFF,0xFF,0x93,0x00,0x9A,0xFF,0xFF,0x7D,0x00,0x00,0x00,
0x00,0x7E,0xFF,0xFF,0xB8,0x00,0xE2,0xFF,0x99,0x00,0xEB,0xFF,0xCA,0x00,0xC9,0xFF,
0xFF,0x41,0x00,0x00,0x00,0x00,0x3E,0xFF,0xFF,0xE2,0x15,0xFF,0xFF,0x66,0x00,0xB5,
0xFF,0xF8,0x05,0xF1,0xFF,0xFA,0x0A,0x00,0x00,0x00,0x00,0x07,0xF7,0xFF,0xFF,0x53,
0xFF,0xFF,0x2C,0x00,0x7A,0xFF,0xFF,0x4A,0xFF,0xFF,0xC7,0x00,0x00,0x00,0x00,0x00,
0x00,0xBF,0xFF,0xFF,0xAE,0xFF,0xF0,0x02,0x00,0x3F,0xFF,0xFF,0xA6,0xFF,0xFF,0x8B,
0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFC,0xFF,0xB8,0x00,0x00,0x09,0xFA,
0xFF,0xFB,0xFF,0xFF,0x4E,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,
0x7E,0x00,0x00,0x00,0xC9,0xFF,0xFF,0xFF,0xFE,0x13,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0xF7,0xFF,0xFF,0xFF,0x44,0x00,0x00,0x00,0x8D,0xFF,0xFF,0xFF,0xD5,0x00,0x00,
0x00,0x00,0x00,0x00,0x1C,0xF4,0xFF,0xFF,0xB3,0x00,0x00,0x00,0x13,0xF5,0xFF,0xFF,
0x8C,0x00,0x00,0x7A,0xFF,0xFF,0xFF,0x3C,0x00,0x00,0x7B,0xFF,0xFF,0xEE,0x11,0x00,
0x00,0x07,0xDC,0xFF,0xFF,0xC4,0x00,0x06,0xE7,0xFF,0xFF,0x72,0x00,0x00,0x00,0x00,
0x4D,0xFF,0xFF,0xFF,0x48,0x5A,0xFF,0xFF,0xDE,0x06,0x00,0x00,0x00,0x00,0x00,0xB8,
0xFF,0xFF,0xCC,0xC7,0xFF,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0xFA,0xFF,
0xFF,0xFF,0xFF,0xCA,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x97,0xFF,0xFF,0xFF,
0xFF,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xDB,0xFF,0xFF,0xFF,0xFA,0x24,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x75,0xFF,0xFF,0xFF,0xFF,0xFF,0xB8,0x00,0x00,
0x00,0x00,0x00,0x00,0x17,0xF1,0xFF,0xFE,0x63,0xFF,0xFF,0xFF,0x55,0x00,0x00,0x00,
0x00,0x00,0x9C,0xFF,0xFF,0xB3,0x00,0xB0,0xFF,0xFF,0xE4,0x0D,0x00,0x00,0x00,0x32,
0xFD,0xFF,0xFF,0x3D,0x00,0x2B,0xFC,0xFF,0xFF,0x8F,0x00,0x00,0x00,0xC2,0xFF,0xFF,
0xC1,0x00,0x00,0x00,0x92,0xFF,0xFF,0xFC,0x30,0x00,0x56,0xFF,0xFF,0xFF,0x45,0x00,
0x00,0x00,0x10,0xEA,0xFF,0xFF,0xC7,0x01,0x79,0xFF,0xFF,0xF9,0x10,0x00,0x00,0x00,
0x00,0x14,0xFD,0xFF,0xFF,0x47,0x1A,0xFC,0xFF,0xFF,0x61,0x00,0x00,0x00,0x00,0x5D,
0xFF,0xFF,0xEC,0x04,0x00,0xB1,0xFF,0xFF,0xB8,0x00,0x00,0x00,0x00,0xA8,0xFF,0xFF,
0x99,0x00,0x00,0x4C,0xFF,0xFF,0xFB,0x13,0x00,0x00,0x04,0xEF,0xFF,0xFF,0x42,0x00,
0x00,0x03,0xE4,0xFF,0xFF,0x66,0x00,0x00,0x3F,0xFF,0xFF,0xE8,0x03,0x00,0x00,0x00,
0x83,0xFF,0xFF,0xBC,0x00,0x00,0x8B,0xFF,0xFF,0x94,0x00,0x00,0x00,0x00,0x21,0xFE,
0xFF,0xFC,0x14,0x00,0xD3,0xFF,0xFF,0x3D,0x00,0x00,0x00,0x00,0x00,0xBB,0xFF,0xFF,
0x5C,0x15,0xFE,0xFF,0xE4,0x01,0x00,0x00,0x00,0x00,0x00,0x56,0xFF,0xFF,0xA7,0x53,
0xFF,0xFF,0x8E,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xEB,0xFF,0xEF,0x98,0xFF,0xFF,
0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8D,0xFF,0xFF,0xFA,0xFF,0xDF,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x2A,0xFF,0xFF,0xFF,0xFF,0x89,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC4,0xFF,0xFF,0xFF,0x32,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x86,0xFF,0xFF,0xDB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0xDC,0xFF,0xFF,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x90,0xFF,
0xFF,0xF2,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0xDB,0xEB,0xFF,0xFF,0xFF,0x72,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x75,0xFF,0xFF,0xFF,0xFF,0xA8,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xA9,0xFB,0xED,0xC2,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x5B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x63,
0x00,0x5B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x63,0x00,0x49,0xCB,0xCB,
0xCB,0xCB,0xD0,0xFF,0xFF,0xFF,0xEC,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xFF,
0xFF,0xFF,0x5B,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0xF7,0xFF,0xFF,0xB6,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xC1,0xFF,0xFF,0xF3,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,
0x68,0xFF,0xFF,0xFF,0x6B,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF1,0xFF,0xFF,0xC4,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xB3,0xFF,0xFF,0xF8,0x28,0x00,0x00,0x00,0x00,
0x00,0x00,0x58,0xFF,0xFF,0xFF,0x7B,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0xEA,0xFF,
0xFF,0xD1,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xFF,0xFF,0xE0,0xC7,0xC7,
0xC7,0xC7,0xC7,0x73,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x93,
0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x93,0x00,0x00,0x00,0x13,
0x9E,0xE4,0xFD,0xE7,0x00,0x00,0x00,0x9F,0xFF,0xFF,0xFA,0xCD,0x00,0x00,0x00,0xED,
0xFF,0xF6,0x1C,0x00,0x00,0x00,0x08,0xFF,0xFF,0xD1,0x00,0x00,0x00,0x00,0x05,0xFF,
0xFF,0xD0,0x00,0x00,0x00,0x00,0x00,0xF6,0xFF,0xD9,0x00,0x00,0x00,0x00,0x00,0xE8,
0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0xD9,0xFF,0xE7,0x00,0x00,0x00,0x00,0x00,0xE2,
0xFF,0xDF,0x00,0x00,0x00,0x18,0x87,0xFF,0xFF,0xAF,0x00,0x00,0x23,0xFF,0xFF,0xFF,
0xCA,0x24,0x00,0x00,0x23,0xFF,0xFF,0xFF,0xAE,0x14,0x00,0x00,0x03,0x36,0xAD,0xFF,
0xFF,0x9E,0x00,0x00,0x00,0x00,0x07,0xEF,0xFF,0xD9,0x00,0x00,0x00,0x00,0x00,0xD5,
0xFF,0xE9,0x00,0x00,0x00,0x00,0x00,0xE1,0xFF,0xE3,0x00,0x00,0x00,0x00,0x00,0xEE,
0xFF,0xDC,0x00,0x00,0x00,0x00,0x00,0xFB,0xFF,0xD5,0x00,0x00,0x00,0x00,0x08,0xFF,
0xFF,0xCE,0x00,0x00,0x00,0x00,0x06,0xFF,0xFF,0xD4,0x00,0x00,0x00,0x00,0x00,0xEA,
0xFF,0xFA,0x24,0x00,0x00,0x00,0x00,0x98,0xFF,0xFF,0xFD,0xD4,0x00,0x00,0x00,0x11,
0x9C,0xE5,0xFE,0xE7,0x1F,0x33,0x24,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,
0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,
0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,
0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,
0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,
0xFF,0xB3,0x9B,0xFF,0xB3,0x9B,0xFF,0xB3,0xDB,0xFE,0xE6,0xA5,0x17,0x00,0x00,0x00,
0xC1,0xF9,0xFF,0xFF,0xAB,0x00,0x00,0x00,0x00,0x16,0xF0,0xFF,0xF7,0x00,0x00,0x00,
0x00,0x00,0xC6,0xFF,0xFF,0x13,0x00,0x00,0x00,0x00,0xC5,0xFF,0xFF,0x0F,0x00,0x00,
0x00,0x00,0xCB,0xFF,0xFE,0x02,0x00,0x00,0x00,0x00,0xD2,0xFF,0xF0,0x00,0x00,0x00,
0x00,0x00,0xD8,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0xD0,0xFF,0xE9,0x01,0x00,0x00,
0x00,0x00,0xA1,0xFF,0xFF,0x8E,0x1A,0x00,0x00,0x00,0x1D,0xC3,0xFF,0xFF,0xFF,0x2B,
0x00,0x00,0x0F,0xA6,0xFE,0xFF,0xFF,0x2B,0x00,0x00,0x90,0xFF,0xFF,0xB3,0x38,0x04,
0x00,0x00,0xCA,0xFF,0xF4,0x0A,0x00,0x00,0x00,0x00,0xD9,0xFF,0xDD,0x00,0x00,0x00,
0x00,0x00,0xD5,0xFF,0xE9,0x00,0x00,0x00,0x00,0x00,0xCF,0xFF,0xF8,0x00,0x00,0x00,
0x00,0x00,0xC9,0xFF,0xFF,0x05,0x00,0x00,0x00,0x00,0xC2,0xFF,0xFF,0x12,0x00,0x00,
0x00,0x00,0xC9,0xFF,0xFF,0x11,0x00,0x00,0x00,0x1E,0xF5,0xFF,0xF5,0x00,0x00,0x00,
0xC8,0xFD,0xFF,0xFF,0xA3,0x00,0x00,0x00,0xDB,0xFE,0xE7,0xA3,0x15,0x00,0x00,0x00,
0x00,0x00,0x00,0x3C,0x77,0x57,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,
0xA8,0xFF,0xFF,0xFF,0xE8,0x4B,0x00,0x00,0x00,0x4E,0x02,0x00,0x00,0xA3,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFD,0x87,0x1B,0x7C,0xFF,0xBD,0x11,0x07,0xB3,0xFF,0x98,0x1D,0x75,
0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0xC5,0x05,0x00,0x01,0x5A,0x03,0x00,0x00,0x3A,0xDD,
0xFF,0xFF,0xFF,0xC5,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x53,0x7C,
0x4E,0x02,0x00,0x00,
};
leRasterFont NotoSansCJKsc_Bold24 =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoSansCJKsc_Bold24_glyphs, // glyph table variable pointer
19732, // data size
},
LE_RASTER_FONT,
},
30,
22,
LE_FONT_BPP_8, // bits per pixel
NotoSansCJKsc_Bold24_data, // kerning table
};
/*********************************
* Legato Font Asset
* Name: NotoSansCJKsc_Regular16
* Height: 20
* Baseline: 14
* Style: Antialias
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoSansCJKsc_Regular16_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x03,0x00,0x0D,0x00,0x05,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x06,0x00,
0x05,0x00,0x08,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x06,0x00,0x28,0x00,0x00,0x00,
0x23,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,
0x48,0x00,0x00,0x00,0x24,0x00,0x08,0x00,0x10,0x00,0x09,0x00,0x00,0x00,0x0E,0x00,
0x00,0x00,0x08,0x00,0xB4,0x00,0x00,0x00,0x25,0x00,0x0F,0x00,0x0C,0x00,0x0F,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x0F,0x00,0x34,0x01,0x00,0x00,0x26,0x00,0x0B,0x00,
0x0C,0x00,0x0B,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0B,0x00,0xE8,0x01,0x00,0x00,
0x27,0x00,0x02,0x00,0x05,0x00,0x04,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x02,0x00,
0x6C,0x02,0x00,0x00,0x28,0x00,0x04,0x00,0x11,0x00,0x05,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x04,0x00,0x78,0x02,0x00,0x00,0x29,0x00,0x04,0x00,0x11,0x00,0x05,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x04,0x00,0xBC,0x02,0x00,0x00,0x2A,0x00,0x06,0x00,
0x06,0x00,0x07,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x06,0x00,0x00,0x03,0x00,0x00,
0x2B,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x24,0x03,0x00,0x00,0x2C,0x00,0x04,0x00,0x07,0x00,0x04,0x00,0x00,0x00,0x03,0x00,
0x00,0x00,0x04,0x00,0x78,0x03,0x00,0x00,0x2D,0x00,0x05,0x00,0x02,0x00,0x06,0x00,
0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0x94,0x03,0x00,0x00,0x2E,0x00,0x03,0x00,
0x03,0x00,0x04,0x00,0x01,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0xA0,0x03,0x00,0x00,
0x2F,0x00,0x07,0x00,0x10,0x00,0x06,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x07,0x00,
0xAC,0x03,0x00,0x00,0x30,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0x1C,0x04,0x00,0x00,0x31,0x00,0x07,0x00,0x0C,0x00,0x09,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,0x88,0x04,0x00,0x00,0x32,0x00,0x09,0x00,
0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xDC,0x04,0x00,0x00,
0x33,0x00,0x08,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x08,0x00,
0x48,0x05,0x00,0x00,0x34,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0xA8,0x05,0x00,0x00,0x35,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x14,0x06,0x00,0x00,0x36,0x00,0x09,0x00,
0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x80,0x06,0x00,0x00,
0x37,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,
0xEC,0x06,0x00,0x00,0x38,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0x58,0x07,0x00,0x00,0x39,0x00,0x08,0x00,0x0C,0x00,0x09,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x08,0x00,0xC4,0x07,0x00,0x00,0x3A,0x00,0x03,0x00,
0x09,0x00,0x04,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x03,0x00,0x24,0x08,0x00,0x00,
0x3B,0x00,0x04,0x00,0x0D,0x00,0x04,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x04,0x00,
0x40,0x08,0x00,0x00,0x3C,0x00,0x09,0x00,0x08,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0x74,0x08,0x00,0x00,0x3D,0x00,0x09,0x00,0x06,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0xBC,0x08,0x00,0x00,0x3E,0x00,0x09,0x00,
0x08,0x00,0x09,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0xF4,0x08,0x00,0x00,
0x3F,0x00,0x07,0x00,0x0D,0x00,0x08,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x07,0x00,
0x3C,0x09,0x00,0x00,0x40,0x00,0x0F,0x00,0x0F,0x00,0x0F,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x0F,0x00,0x98,0x09,0x00,0x00,0x41,0x00,0x0A,0x00,0x0C,0x00,0x0A,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,0x7C,0x0A,0x00,0x00,0x42,0x00,0x09,0x00,
0x0C,0x00,0x0B,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xF4,0x0A,0x00,0x00,
0x43,0x00,0x0A,0x00,0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,
0x60,0x0B,0x00,0x00,0x44,0x00,0x0A,0x00,0x0C,0x00,0x0B,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x0A,0x00,0xD8,0x0B,0x00,0x00,0x45,0x00,0x08,0x00,0x0C,0x00,0x09,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x08,0x00,0x50,0x0C,0x00,0x00,0x46,0x00,0x08,0x00,
0x0C,0x00,0x09,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x08,0x00,0xB0,0x0C,0x00,0x00,
0x47,0x00,0x0A,0x00,0x0C,0x00,0x0B,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,
0x10,0x0D,0x00,0x00,0x48,0x00,0x0A,0x00,0x0C,0x00,0x0C,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x0A,0x00,0x88,0x0D,0x00,0x00,0x49,0x00,0x03,0x00,0x0C,0x00,0x05,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x0E,0x00,0x00,0x4A,0x00,0x07,0x00,
0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,0x24,0x0E,0x00,0x00,
0x4B,0x00,0x0A,0x00,0x0C,0x00,0x0A,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,
0x78,0x0E,0x00,0x00,0x4C,0x00,0x08,0x00,0x0C,0x00,0x09,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x08,0x00,0xF0,0x0E,0x00,0x00,0x4D,0x00,0x0B,0x00,0x0C,0x00,0x0D,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x0B,0x00,0x50,0x0F,0x00,0x00,0x4E,0x00,0x09,0x00,
0x0C,0x00,0x0C,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xD4,0x0F,0x00,0x00,
0x4F,0x00,0x0B,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0B,0x00,
0x40,0x10,0x00,0x00,0x50,0x00,0x09,0x00,0x0C,0x00,0x0A,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0xC4,0x10,0x00,0x00,0x51,0x00,0x0C,0x00,0x0F,0x00,0x0C,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x30,0x11,0x00,0x00,0x52,0x00,0x09,0x00,
0x0C,0x00,0x0A,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xE4,0x11,0x00,0x00,
0x53,0x00,0x09,0x00,0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,
0x50,0x12,0x00,0x00,0x54,0x00,0x0A,0x00,0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x0A,0x00,0xBC,0x12,0x00,0x00,0x55,0x00,0x09,0x00,0x0C,0x00,0x0C,0x00,
0x01,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0x34,0x13,0x00,0x00,0x56,0x00,0x0A,0x00,
0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0A,0x00,0xA0,0x13,0x00,0x00,
0x57,0x00,0x0E,0x00,0x0C,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,
0x18,0x14,0x00,0x00,0x58,0x00,0x09,0x00,0x0C,0x00,0x09,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x09,0x00,0xC0,0x14,0x00,0x00,0x59,0x00,0x0A,0x00,0x0C,0x00,0x09,0x00,
0xFF,0xFF,0x0C,0x00,0x00,0x00,0x0A,0x00,0x2C,0x15,0x00,0x00,0x5A,0x00,0x09,0x00,
0x0C,0x00,0x0A,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x09,0x00,0xA4,0x15,0x00,0x00,
0x5B,0x00,0x04,0x00,0x10,0x00,0x05,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x04,0x00,
0x10,0x16,0x00,0x00,0x5C,0x00,0x07,0x00,0x10,0x00,0x06,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x07,0x00,0x50,0x16,0x00,0x00,0x5D,0x00,0x04,0x00,0x10,0x00,0x05,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x04,0x00,0xC0,0x16,0x00,0x00,0x5E,0x00,0x07,0x00,
0x07,0x00,0x09,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x07,0x00,0x00,0x17,0x00,0x00,
0x5F,0x00,0x09,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x09,0x00,
0x34,0x17,0x00,0x00,0x60,0x00,0x04,0x00,0x04,0x00,0x0A,0x00,0x02,0x00,0x0E,0x00,
0x00,0x00,0x04,0x00,0x40,0x17,0x00,0x00,0x61,0x00,0x08,0x00,0x09,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0x50,0x17,0x00,0x00,0x62,0x00,0x09,0x00,
0x0D,0x00,0x0A,0x00,0x01,0x00,0x0D,0x00,0x00,0x00,0x09,0x00,0x98,0x17,0x00,0x00,
0x63,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x08,0x00,
0x10,0x18,0x00,0x00,0x64,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,0x00,0x00,0x0D,0x00,
0x00,0x00,0x09,0x00,0x58,0x18,0x00,0x00,0x65,0x00,0x09,0x00,0x09,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0xD0,0x18,0x00,0x00,0x66,0x00,0x06,0x00,
0x0E,0x00,0x05,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x06,0x00,0x24,0x19,0x00,0x00,
0x67,0x00,0x09,0x00,0x0D,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,
0x78,0x19,0x00,0x00,0x68,0x00,0x08,0x00,0x0D,0x00,0x0A,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x08,0x00,0xF0,0x19,0x00,0x00,0x69,0x00,0x03,0x00,0x0D,0x00,0x04,0x00,
0x01,0x00,0x0D,0x00,0x00,0x00,0x03,0x00,0x58,0x1A,0x00,0x00,0x6A,0x00,0x05,0x00,
0x11,0x00,0x04,0x00,0xFF,0xFF,0x0D,0x00,0x00,0x00,0x05,0x00,0x80,0x1A,0x00,0x00,
0x6B,0x00,0x08,0x00,0x0E,0x00,0x09,0x00,0x01,0x00,0x0E,0x00,0x00,0x00,0x08,0x00,
0xD8,0x1A,0x00,0x00,0x6C,0x00,0x03,0x00,0x0D,0x00,0x05,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x03,0x00,0x48,0x1B,0x00,0x00,0x6D,0x00,0x0D,0x00,0x09,0x00,0x0F,0x00,
0x01,0x00,0x09,0x00,0x00,0x00,0x0D,0x00,0x70,0x1B,0x00,0x00,0x6E,0x00,0x08,0x00,
0x09,0x00,0x0A,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0xE8,0x1B,0x00,0x00,
0x6F,0x00,0x09,0x00,0x09,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,
0x30,0x1C,0x00,0x00,0x70,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,0x01,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x84,0x1C,0x00,0x00,0x71,0x00,0x09,0x00,0x0D,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0xFC,0x1C,0x00,0x00,0x72,0x00,0x06,0x00,
0x09,0x00,0x06,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x06,0x00,0x74,0x1D,0x00,0x00,
0x73,0x00,0x07,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x07,0x00,
0xAC,0x1D,0x00,0x00,0x74,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,0x00,0x00,0x0C,0x00,
0x00,0x00,0x06,0x00,0xEC,0x1D,0x00,0x00,0x75,0x00,0x08,0x00,0x09,0x00,0x0A,0x00,
0x01,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0x34,0x1E,0x00,0x00,0x76,0x00,0x09,0x00,
0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x7C,0x1E,0x00,0x00,
0x77,0x00,0x0D,0x00,0x09,0x00,0x0D,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0D,0x00,
0xD0,0x1E,0x00,0x00,0x78,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x08,0x00,0x48,0x1F,0x00,0x00,0x79,0x00,0x09,0x00,0x0D,0x00,0x08,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x90,0x1F,0x00,0x00,0x7A,0x00,0x08,0x00,
0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0x08,0x20,0x00,0x00,
0x7B,0x00,0x05,0x00,0x10,0x00,0x05,0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x05,0x00,
0x50,0x20,0x00,0x00,0x7C,0x00,0x02,0x00,0x12,0x00,0x04,0x00,0x01,0x00,0x0D,0x00,
0x00,0x00,0x02,0x00,0xA0,0x20,0x00,0x00,0x7D,0x00,0x05,0x00,0x10,0x00,0x05,0x00,
0x00,0x00,0x0D,0x00,0x00,0x00,0x05,0x00,0xC4,0x20,0x00,0x00,0x7E,0x00,0x09,0x00,
0x04,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x14,0x21,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoSansCJKsc_Regular16_glyphs[8504] =
{
0x08,0x2F,0x0F,0x27,0xFF,0x4E,0x1F,0xFF,0x47,0x18,0xFF,0x3F,0x10,0xFF,0x37,0x08,
0xFF,0x2F,0x01,0xFF,0x28,0x00,0xF9,0x20,0x00,0xF2,0x19,0x00,0x3F,0x05,0x00,0x1F,
0x00,0x51,0xFF,0x75,0x39,0xE6,0x55,0x00,0x57,0x96,0x00,0x42,0x9B,0x12,0x8B,0xF2,
0x00,0x65,0xFF,0x1A,0x7D,0xE4,0x00,0x55,0xFF,0x0B,0x64,0xCB,0x00,0x3C,0xF0,0x00,
0x4C,0xB3,0x00,0x24,0xD5,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x00,0x00,0x2E,0x15,
0x00,0x00,0x00,0x10,0xE2,0x00,0x00,0xBA,0x36,0x00,0x00,0x00,0x30,0xC2,0x00,0x00,
0xDB,0x16,0x00,0x00,0x00,0x50,0xA3,0x00,0x02,0xF0,0x00,0x00,0x03,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x53,0x00,0x00,0x94,0x5E,0x00,0x40,0xB5,0x00,0x00,0x00,0x00,
0xBE,0x34,0x00,0x6A,0x89,0x00,0x00,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0x00,
0x02,0x0C,0xEF,0x07,0x07,0xB0,0x4C,0x07,0x00,0x00,0x1D,0xD4,0x00,0x00,0xC9,0x2B,
0x00,0x00,0x00,0x39,0xB7,0x00,0x00,0xE5,0x10,0x00,0x00,0x00,0x55,0x9A,0x00,0x04,
0xF2,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF7,0x07,0x00,0x00,0x00,0x00,0x00,0x0E,
0xFF,0x15,0x00,0x00,0x00,0x00,0x7E,0xF6,0xFF,0xF9,0xA6,0x0D,0x00,0x4A,0xFF,0x7F,
0x16,0x38,0xC8,0x41,0x00,0x8F,0xE9,0x03,0x00,0x00,0x01,0x00,0x00,0x83,0xF2,0x0B,
0x00,0x00,0x00,0x00,0x00,0x27,0xF7,0xC2,0x28,0x00,0x00,0x00,0x00,0x00,0x2F,0xD2,
0xFB,0x87,0x05,0x00,0x00,0x00,0x00,0x06,0x7F,0xF8,0xCC,0x11,0x00,0x00,0x00,0x00,
0x00,0x34,0xF7,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0xB6,0xBD,0x00,0x29,0x03,0x00,
0x00,0x00,0xBF,0xAE,0x01,0xD5,0xC9,0x64,0x3B,0x81,0xFF,0x50,0x00,0x15,0x91,0xDD,
0xFF,0xD4,0x5F,0x00,0x00,0x00,0x00,0x03,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x03,
0xFB,0x07,0x00,0x00,0x00,0x31,0xCE,0xE6,0x97,0x05,0x00,0x00,0x00,0x2E,0xCB,0x01,
0x00,0x00,0x00,0x03,0xDF,0x52,0x06,0xBD,0x71,0x00,0x00,0x00,0xB6,0x44,0x00,0x00,
0x00,0x00,0x3B,0xE0,0x00,0x00,0x52,0xC9,0x00,0x00,0x40,0xBA,0x00,0x00,0x00,0x00,
0x00,0x59,0xC0,0x00,0x00,0x30,0xE8,0x00,0x00,0xC8,0x32,0x00,0x00,0x00,0x00,0x00,
0x52,0xC5,0x00,0x00,0x37,0xE0,0x00,0x54,0xA6,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,
0xED,0x04,0x00,0x62,0xBD,0x04,0xD4,0x22,0x17,0xB8,0xE9,0xAB,0x0D,0x00,0x00,0xCD,
0x76,0x1A,0xD3,0x5B,0x68,0x92,0x00,0xB2,0x87,0x04,0xA1,0x97,0x00,0x00,0x1E,0xB7,
0xD9,0x7A,0x0B,0xDA,0x16,0x0F,0xFC,0x11,0x00,0x2D,0xF1,0x00,0x00,0x00,0x00,0x00,
0x00,0x7C,0x7E,0x00,0x2D,0xEC,0x00,0x00,0x08,0xFF,0x11,0x00,0x00,0x00,0x00,0x14,
0xDA,0x0C,0x00,0x1D,0xF7,0x02,0x00,0x17,0xFC,0x05,0x00,0x00,0x00,0x00,0x90,0x6A,
0x00,0x00,0x01,0xCF,0x63,0x00,0x80,0xB4,0x00,0x00,0x00,0x00,0x21,0xD5,0x05,0x00,
0x00,0x00,0x27,0xC3,0xE5,0xB8,0x1B,0x00,0x00,0x00,0x0C,0x9F,0xEE,0xDD,0x4B,0x00,
0x00,0x00,0x00,0x00,0x00,0x90,0xD7,0x38,0x7B,0xEE,0x02,0x00,0x00,0x00,0x00,0x00,
0xD5,0x77,0x00,0x21,0xFE,0x0D,0x00,0x00,0x00,0x00,0x00,0xC7,0x7E,0x00,0x92,0xBE,
0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xD5,0xA9,0xD2,0x1C,0x00,0x00,0x00,0x00,0x00,
0x00,0x57,0xFF,0xC3,0x0C,0x00,0x00,0x01,0x6B,0x29,0x00,0x59,0xF8,0xBF,0xEF,0x23,
0x00,0x00,0x3D,0xFC,0x1B,0x1F,0xF8,0x80,0x02,0xB7,0xD2,0x13,0x00,0xA7,0xB4,0x00,
0x60,0xFF,0x18,0x00,0x11,0xCE,0xD4,0x5A,0xF9,0x2B,0x00,0x4C,0xFF,0x33,0x00,0x00,
0x11,0xCD,0xFF,0xA2,0x00,0x00,0x09,0xD6,0xDA,0x52,0x36,0x77,0xF1,0xD4,0xFF,0xAB,
0x30,0x00,0x1B,0xA2,0xE5,0xEE,0xBE,0x55,0x00,0x40,0xBA,0x5C,0x57,0x96,0x8B,0xF2,
0x7D,0xE4,0x64,0xCB,0x4C,0xB3,0x00,0x00,0x00,0x00,0x72,0x76,0x00,0x0F,0xEC,0x30,
0x00,0x6D,0xBB,0x00,0x00,0xCD,0x64,0x00,0x13,0xFF,0x1D,0x00,0x4A,0xEB,0x00,0x00,
0x6B,0xC8,0x00,0x00,0x7D,0xB8,0x00,0x00,0x81,0xB5,0x00,0x00,0x6F,0xC4,0x00,0x00,
0x57,0xE0,0x00,0x00,0x21,0xFF,0x11,0x00,0x00,0xE2,0x4E,0x00,0x00,0x86,0xA3,0x00,
0x00,0x22,0xF1,0x17,0x00,0x00,0x97,0x86,0x00,0x00,0x0E,0x07,0x1E,0xC1,0x03,0x00,
0x00,0xC5,0x63,0x00,0x00,0x52,0xD3,0x00,0x00,0x08,0xF3,0x35,0x00,0x00,0xB3,0x7A,
0x00,0x00,0x82,0xB4,0x00,0x00,0x5E,0xD5,0x00,0x00,0x4E,0xE7,0x00,0x00,0x4A,0xEC,
0x00,0x00,0x5A,0xD9,0x00,0x00,0x76,0xC0,0x00,0x00,0xA7,0x89,0x00,0x01,0xE3,0x4A,
0x00,0x3A,0xE8,0x04,0x00,0xA4,0x83,0x00,0x1F,0xE9,0x0F,0x00,0x00,0x15,0x00,0x00,
0x00,0x00,0xBF,0x31,0x00,0x00,0x54,0x35,0xD8,0x62,0x59,0x1B,0x7D,0xE7,0xFF,0xFC,
0xB0,0x25,0x00,0x85,0xEB,0xE6,0x0E,0x00,0x12,0xE0,0x20,0x9B,0x79,0x00,0x00,0x0B,
0x00,0x05,0x06,0x00,0x00,0x00,0x00,0x16,0x8F,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x27,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0xFF,0x03,0x00,0x00,0x00,0x08,
0x13,0x13,0x38,0xFF,0x17,0x13,0x13,0x05,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x43,0x00,0x00,0x00,0x27,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0xFF,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x27,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x14,
0x83,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x89,0xE5,0x2B,
0x00,0x89,0xFE,0x75,0x00,0x00,0xBC,0x66,0x00,0x51,0xE8,0x11,0x0A,0xCE,0x33,0x00,
0x00,0x00,0x00,0x00,0x43,0xFF,0xFF,0xFF,0xD3,0x08,0x1F,0x1F,0x1F,0x1A,0x00,0x00,
0x05,0x1A,0x00,0xAD,0xFC,0x20,0x86,0xDD,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x10,0x83,0x00,0x00,0x00,0x00,0x00,0x5B,0xB4,0x00,0x00,0x00,0x00,0x00,0xAA,0x65,
0x00,0x00,0x00,0x00,0x06,0xF0,0x18,0x00,0x00,0x00,0x00,0x48,0xC7,0x00,0x00,0x00,
0x00,0x00,0x97,0x78,0x00,0x00,0x00,0x00,0x01,0xE5,0x29,0x00,0x00,0x00,0x00,0x35,
0xDA,0x00,0x00,0x00,0x00,0x00,0x84,0x8B,0x00,0x00,0x00,0x00,0x00,0xD3,0x3C,0x00,
0x00,0x00,0x00,0x22,0xEA,0x02,0x00,0x00,0x00,0x00,0x71,0x9E,0x00,0x00,0x00,0x00,
0x00,0xC0,0x4F,0x00,0x00,0x00,0x00,0x13,0xF2,0x0A,0x00,0x00,0x00,0x00,0x5E,0xB1,
0x00,0x00,0x00,0x00,0x00,0xAC,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0xC4,
0xEF,0xBC,0x2B,0x00,0x00,0x00,0x32,0xF6,0x97,0x44,0xAE,0xEB,0x1B,0x00,0x00,0xA1,
0xC8,0x00,0x00,0x07,0xE4,0x7E,0x00,0x00,0xF4,0x76,0x00,0x00,0x00,0x97,0xD4,0x00,
0x13,0xFF,0x4F,0x00,0x00,0x00,0x71,0xF2,0x00,0x2C,0xFF,0x3C,0x00,0x00,0x00,0x5D,
0xFF,0x0B,0x2B,0xFF,0x3D,0x00,0x00,0x00,0x5E,0xFF,0x0A,0x12,0xFF,0x4F,0x00,0x00,
0x00,0x71,0xF1,0x00,0x00,0xF3,0x76,0x00,0x00,0x00,0x98,0xD3,0x00,0x00,0x9E,0xC8,
0x00,0x00,0x06,0xE4,0x7C,0x00,0x00,0x30,0xF5,0x91,0x3B,0xA9,0xEA,0x1A,0x00,0x00,
0x00,0x3F,0xC4,0xF0,0xBC,0x2B,0x00,0x00,0x03,0x4D,0x9D,0xF8,0x7B,0x00,0x00,0x0F,
0xC3,0xC3,0xFF,0x7B,0x00,0x00,0x00,0x00,0x00,0xFB,0x7B,0x00,0x00,0x00,0x00,0x00,
0xFB,0x7B,0x00,0x00,0x00,0x00,0x00,0xFB,0x7B,0x00,0x00,0x00,0x00,0x00,0xFB,0x7B,
0x00,0x00,0x00,0x00,0x00,0xFB,0x7B,0x00,0x00,0x00,0x00,0x00,0xFB,0x7B,0x00,0x00,
0x00,0x00,0x00,0xFB,0x7B,0x00,0x00,0x00,0x00,0x00,0xFB,0x7B,0x00,0x00,0x1E,0x33,
0x33,0xFC,0x96,0x33,0x2B,0x97,0xFF,0xFF,0xFF,0xFF,0xFF,0xD3,0x00,0x17,0x98,0xD9,
0xEC,0xB1,0x23,0x00,0x00,0x1E,0xE3,0xB6,0x53,0x51,0xD0,0xDF,0x0A,0x00,0x01,0x58,
0x01,0x00,0x00,0x24,0xFF,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6,0x74,0x00,
0x00,0x00,0x00,0x00,0x00,0x1E,0xFF,0x4E,0x00,0x00,0x00,0x00,0x00,0x00,0x75,0xF4,
0x13,0x00,0x00,0x00,0x00,0x00,0x14,0xF0,0x86,0x00,0x00,0x00,0x00,0x00,0x04,0xBC,
0xD8,0x0D,0x00,0x00,0x00,0x00,0x00,0x98,0xF3,0x2A,0x00,0x00,0x00,0x00,0x01,0x90,
0xF7,0x43,0x00,0x00,0x00,0x00,0x02,0x9C,0xFE,0x74,0x3A,0x3F,0x3F,0x3F,0x04,0x49,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x13,0x00,0x18,0x9A,0xD9,0xF2,0xC4,0x45,0x00,
0x02,0xD1,0xB4,0x52,0x4F,0xB8,0xFA,0x31,0x00,0x15,0x00,0x00,0x00,0x08,0xF8,0x7F,
0x00,0x00,0x00,0x00,0x00,0x0F,0xFC,0x73,0x00,0x00,0x00,0x10,0x3C,0xBF,0xCB,0x10,
0x00,0x00,0x27,0xFF,0xFF,0xD3,0x17,0x00,0x00,0x00,0x05,0x31,0x54,0xBE,0xE9,0x2F,
0x00,0x00,0x00,0x00,0x00,0x04,0xCC,0xBE,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xEF,
0x0B,0x4E,0x00,0x00,0x00,0x00,0xC2,0xCB,0x45,0xF9,0xA3,0x59,0x44,0xA0,0xFF,0x57,
0x00,0x35,0xA2,0xD9,0xF3,0xC8,0x51,0x00,0x00,0x00,0x00,0x00,0x25,0xF8,0xCF,0x00,
0x00,0x00,0x00,0x00,0x00,0xB9,0xF0,0xCF,0x00,0x00,0x00,0x00,0x00,0x54,0xEF,0x96,
0xCF,0x00,0x00,0x00,0x00,0x0B,0xE3,0x7A,0x8F,0xCF,0x00,0x00,0x00,0x00,0x8A,0xD9,
0x07,0x93,0xCF,0x00,0x00,0x00,0x2A,0xFA,0x44,0x00,0x93,0xCF,0x00,0x00,0x00,0xBF,
0xA6,0x00,0x00,0x93,0xCF,0x00,0x00,0x5B,0xF9,0x40,0x27,0x27,0xA4,0xD7,0x27,0x0E,
0xAF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5B,0x00,0x00,0x00,0x00,0x00,0x93,0xCF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x93,0xCF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x93,0xCF,0x00,0x00,0x00,0x4C,0xFF,0xFF,0xFF,0xFF,0xFF,0x73,0x00,0x00,0x5E,0xFC,
0x40,0x3F,0x3F,0x3F,0x1C,0x00,0x00,0x6F,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xD0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x92,0xE4,0xBC,0xF2,0xD3,0x5F,0x00,
0x00,0x00,0x53,0x9E,0x38,0x2F,0x97,0xFF,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xC8,0xCB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xF3,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x90,0xE4,0x00,0x0A,0x44,0x00,0x00,0x00,0x07,0xDD,0xAE,0x00,0x4B,0xFA,
0x9C,0x55,0x4B,0xBF,0xF7,0x27,0x00,0x00,0x3B,0xA5,0xDB,0xEF,0xB8,0x2D,0x00,0x00,
0x00,0x00,0x03,0x84,0xD6,0xED,0xB6,0x2D,0x00,0x00,0x00,0xB4,0xEA,0x68,0x4A,0xA9,
0xAD,0x00,0x00,0x45,0xFD,0x2C,0x00,0x00,0x00,0x08,0x00,0x00,0xB6,0xB3,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xF0,0x74,0x00,0x04,0x03,0x00,0x00,0x00,0x0D,0xFF,0x64,
0xA0,0xF2,0xF7,0xAE,0x17,0x00,0x16,0xFF,0xE9,0x65,0x12,0x31,0xD9,0xB2,0x00,0x03,
0xFA,0x65,0x00,0x00,0x00,0x5B,0xFE,0x09,0x00,0xDD,0x79,0x00,0x00,0x00,0x3D,0xFF,
0x20,0x00,0x88,0xD3,0x01,0x00,0x00,0x6F,0xF3,0x02,0x00,0x17,0xE9,0xA3,0x34,0x53,
0xED,0x7C,0x00,0x00,0x00,0x1F,0xB1,0xEC,0xDC,0x74,0x02,0x00,0x37,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x1E,0x0D,0x3F,0x3F,0x3F,0x3F,0x3F,0xD4,0xBA,0x00,0x00,0x00,
0x00,0x00,0x00,0x4B,0xF4,0x20,0x00,0x00,0x00,0x00,0x00,0x04,0xDC,0x78,0x00,0x00,
0x00,0x00,0x00,0x00,0x52,0xF8,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0xB8,0xA5,0x00,
0x00,0x00,0x00,0x00,0x00,0x0F,0xFD,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x45,0xFF,
0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x7D,0xF5,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x9F,0xDB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB6,0xC9,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xCC,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0xD2,0xF4,0xD2,0x59,0x00,
0x00,0x00,0x48,0xFC,0x65,0x20,0x67,0xFC,0x44,0x00,0x00,0xA0,0xB7,0x00,0x00,0x00,
0xAB,0x9C,0x00,0x00,0x8E,0xC1,0x00,0x00,0x00,0x9F,0xA5,0x00,0x00,0x34,0xF9,0x78,
0x06,0x12,0xE6,0x4B,0x00,0x00,0x00,0x61,0xFF,0xE1,0xCB,0x81,0x00,0x00,0x00,0x30,
0xDB,0x63,0x94,0xF8,0xBD,0x12,0x00,0x06,0xE1,0x74,0x00,0x00,0x1C,0xD8,0xBD,0x00,
0x36,0xFF,0x24,0x00,0x00,0x00,0x5E,0xFF,0x10,0x26,0xFF,0x3B,0x00,0x00,0x00,0x61,
0xFB,0x0A,0x00,0xB7,0xDC,0x4A,0x1D,0x4F,0xE6,0x9C,0x00,0x00,0x0C,0x85,0xDA,0xF6,
0xD7,0x7A,0x07,0x00,0x00,0x06,0x87,0xE1,0xE7,0xA5,0x14,0x00,0x00,0x9C,0xE2,0x4E,
0x41,0xBA,0xDF,0x0A,0x17,0xFE,0x50,0x00,0x00,0x08,0xE6,0x75,0x40,0xFF,0x1D,0x00,
0x00,0x00,0x92,0xC3,0x28,0xFF,0x39,0x00,0x00,0x00,0x83,0xE6,0x02,0xD0,0xC4,0x24,
0x18,0x7A,0xEF,0xFA,0x00,0x25,0xC2,0xFC,0xEE,0x92,0x7D,0xED,0x00,0x00,0x00,0x08,
0x02,0x00,0x97,0xCD,0x00,0x00,0x00,0x00,0x00,0x00,0xD7,0x90,0x00,0x07,0x00,0x00,
0x00,0x4A,0xFD,0x23,0x01,0xC7,0x96,0x45,0x6B,0xF3,0x92,0x00,0x00,0x3E,0xBE,0xF0,
0xD3,0x74,0x00,0x00,0x82,0xDB,0x10,0xB1,0xFD,0x22,0x07,0x1E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x1A,0x00,0xAD,0xFC,0x22,0x85,0xDB,0x10,0x00,
0x00,0x05,0x1A,0x00,0x00,0xAD,0xFC,0x20,0x00,0x86,0xDD,0x12,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x89,0xE5,0x2B,
0x00,0x8A,0xFE,0x75,0x00,0x00,0xBC,0x65,0x00,0x51,0xE7,0x10,0x0A,0xCE,0x31,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00,0x00,
0x00,0x00,0x1A,0x7A,0xDD,0x43,0x00,0x00,0x04,0x4E,0xB2,0xFA,0xBC,0x5D,0x08,0x19,
0x85,0xE6,0xD9,0x7A,0x1D,0x00,0x00,0x00,0x67,0xFF,0xA3,0x11,0x00,0x00,0x00,0x00,
0x00,0x08,0x5A,0xBF,0xF7,0xAA,0x4A,0x03,0x00,0x00,0x00,0x00,0x00,0x24,0x87,0xE7,
0xE7,0x8C,0x15,0x00,0x00,0x00,0x00,0x00,0x04,0x4F,0xB3,0x40,0x08,0x13,0x13,0x13,
0x13,0x13,0x13,0x13,0x05,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x43,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x05,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x43,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xD1,0x6C,
0x11,0x00,0x00,0x00,0x00,0x00,0x10,0x6A,0xCA,0xF7,0xA3,0x3F,0x01,0x00,0x00,0x00,
0x00,0x00,0x29,0x88,0xE4,0xDB,0x77,0x0F,0x00,0x00,0x00,0x00,0x00,0x1C,0xBA,0xFF,
0x43,0x00,0x00,0x08,0x58,0xB7,0xF8,0xB0,0x4C,0x03,0x23,0x99,0xF0,0xDB,0x78,0x19,
0x00,0x00,0x00,0x5F,0xA5,0x41,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,
0x13,0x00,0x00,0x00,0x62,0xE7,0xFF,0xFF,0xAE,0x08,0x15,0xCD,0x52,0x13,0x60,0xFF,
0x7A,0x00,0x00,0x00,0x00,0x00,0xCB,0xAD,0x00,0x00,0x00,0x00,0x06,0xEF,0x78,0x00,
0x00,0x00,0x00,0x86,0xE8,0x18,0x00,0x00,0x00,0x42,0xFD,0x45,0x00,0x00,0x00,0x01,
0xDA,0x96,0x00,0x00,0x00,0x00,0x23,0xFF,0x47,0x00,0x00,0x00,0x00,0x0D,0x53,0x0E,
0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x5D,0xFF,0x6F,0x00,0x00,
0x00,0x00,0x42,0xE6,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x5A,0xB1,0xE0,
0xEC,0xC1,0x90,0x1B,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xCF,0xCA,0x50,0x15,0x0E,
0x3B,0x83,0xEA,0x57,0x00,0x00,0x00,0x00,0x17,0xE8,0x88,0x05,0x00,0x00,0x00,0x00,
0x00,0x31,0xEB,0x24,0x00,0x00,0x00,0xA8,0x93,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x78,0xB1,0x00,0x00,0x49,0xE5,0x0E,0x00,0x04,0x8C,0xE3,0xCB,0x91,0x5D,0x00,
0x0F,0xF1,0x00,0x00,0xB2,0x70,0x00,0x00,0xA1,0xC0,0x29,0x51,0xFF,0x3F,0x00,0x00,
0xE6,0x1D,0x00,0xF2,0x29,0x00,0x2C,0xF6,0x15,0x00,0x14,0xFE,0x0F,0x00,0x00,0xD8,
0x27,0x0C,0xFF,0x0A,0x00,0x6F,0xB9,0x00,0x00,0x3E,0xDC,0x00,0x00,0x03,0xF3,0x04,
0x0E,0xFF,0x0B,0x00,0x85,0xA4,0x00,0x00,0x6A,0xB7,0x00,0x00,0x59,0xBB,0x00,0x00,
0xE4,0x33,0x00,0x57,0xE4,0x2B,0x3F,0xDC,0xDB,0x14,0x41,0xE5,0x32,0x00,0x00,0xB9,
0x67,0x00,0x03,0xA1,0xF1,0xB5,0x1B,0x9C,0xF1,0xCD,0x3C,0x00,0x00,0x00,0x5F,0xE2,
0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBD,0xA2,
0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0xBD,0xD5,
0x59,0x26,0x0B,0x31,0x8D,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x61,0xAE,
0xDC,0xF1,0xD2,0x89,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x22,
0xFF,0xD6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0xC7,0xFC,0x2B,0x00,0x00,0x00,
0x00,0x00,0x00,0xCC,0x6A,0xC1,0x80,0x00,0x00,0x00,0x00,0x00,0x21,0xFF,0x1F,0x75,
0xD5,0x00,0x00,0x00,0x00,0x00,0x76,0xD4,0x00,0x29,0xFF,0x2A,0x00,0x00,0x00,0x00,
0xCB,0x87,0x00,0x00,0xDC,0x7F,0x00,0x00,0x00,0x20,0xFF,0x34,0x00,0x00,0x8C,0xD4,
0x00,0x00,0x00,0x75,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x29,0x00,0x00,0xCA,0xA5,0x2F,
0x2F,0x2F,0x30,0xED,0x7E,0x00,0x20,0xFF,0x4A,0x00,0x00,0x00,0x00,0xA5,0xD3,0x00,
0x74,0xF5,0x08,0x00,0x00,0x00,0x00,0x59,0xFF,0x28,0xC9,0xB1,0x00,0x00,0x00,0x00,
0x00,0x11,0xFC,0x7D,0x67,0xFF,0xFF,0xFF,0xF4,0xD8,0x87,0x0C,0x00,0x67,0xFF,0x3C,
0x2C,0x39,0x6E,0xF2,0xB0,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x78,0xFB,0x09,0x67,
0xFF,0x13,0x00,0x00,0x00,0x6F,0xEB,0x02,0x67,0xFF,0x13,0x00,0x10,0x4E,0xE8,0x7F,
0x00,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0x18,0x00,0x67,0xFF,0x35,0x23,0x2E,0x51,
0xC0,0xEB,0x28,0x67,0xFF,0x13,0x00,0x00,0x00,0x07,0xE1,0x9D,0x67,0xFF,0x13,0x00,
0x00,0x00,0x00,0xB9,0xBB,0x67,0xFF,0x13,0x00,0x00,0x00,0x10,0xEB,0x8F,0x67,0xFF,
0x3C,0x2B,0x36,0x5D,0xD0,0xED,0x23,0x67,0xFF,0xFF,0xFF,0xF9,0xDD,0x9E,0x26,0x00,
0x00,0x00,0x00,0x34,0xAB,0xDE,0xE7,0xAA,0x34,0x00,0x00,0x00,0x67,0xFA,0xC0,0x6F,
0x62,0xAF,0xF7,0x1D,0x00,0x23,0xF8,0x95,0x02,0x00,0x00,0x00,0x2E,0x00,0x00,0xA2,
0xEB,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD7,0xA2,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x04,0xFA,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xFB,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDA,0xA2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xA7,0xEA,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x29,0xFB,0x8E,0x00,0x00,
0x00,0x00,0x4D,0x0F,0x00,0x00,0x72,0xFC,0xB8,0x68,0x60,0xA6,0xFA,0x4F,0x00,0x00,
0x00,0x3E,0xB1,0xE5,0xE6,0xB0,0x3C,0x00,0x67,0xFF,0xFF,0xFB,0xD6,0xAB,0x3A,0x00,
0x00,0x00,0x67,0xFF,0x43,0x3C,0x65,0xBA,0xFD,0x7F,0x00,0x00,0x67,0xFF,0x13,0x00,
0x00,0x01,0x89,0xFE,0x34,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x09,0xE7,0xB1,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0xA4,0xDE,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,
0x00,0x83,0xFC,0x06,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x85,0xFB,0x04,0x67,0xFF,
0x13,0x00,0x00,0x00,0x00,0xA6,0xDB,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x0C,0xEA,
0xAC,0x00,0x67,0xFF,0x13,0x00,0x00,0x01,0x90,0xFD,0x2E,0x00,0x67,0xFF,0x43,0x3C,
0x65,0xBD,0xFC,0x7A,0x00,0x00,0x67,0xFF,0xFF,0xFC,0xD8,0xAC,0x3A,0x00,0x00,0x00,
0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5B,0x67,0xFF,0x4E,0x3F,0x3F,0x3F,0x3F,0x16,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0x87,0x00,
0x67,0xFF,0x52,0x43,0x43,0x43,0x24,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x4E,0x3F,0x3F,0x3F,0x3F,0x22,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8B,
0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5B,0x67,0xFF,0x4E,0x3F,0x3F,0x3F,0x3F,0x16,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x00,
0x67,0xFF,0x4E,0x3F,0x3F,0x3F,0x23,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x2A,0xA5,0xD7,0xEF,0xB9,0x63,0x00,0x00,0x00,0x5F,0xF7,0xCB,0x77,
0x5B,0x8E,0xF4,0x68,0x00,0x1F,0xF6,0xA0,0x04,0x00,0x00,0x00,0x24,0x06,0x00,0x9F,
0xED,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6,0xA4,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x04,0xFA,0x80,0x00,0x00,0x00,0x37,0x37,0x37,0x2F,0x05,0xFB,0x81,0x00,
0x00,0x00,0xFF,0xFF,0xFF,0xD7,0x00,0xD9,0xA2,0x00,0x00,0x00,0x00,0x00,0x87,0xD7,
0x00,0xA5,0xEC,0x0C,0x00,0x00,0x00,0x00,0x87,0xD7,0x00,0x26,0xFA,0x96,0x02,0x00,
0x00,0x00,0x87,0xD7,0x00,0x00,0x6C,0xFB,0xC3,0x71,0x53,0x7F,0xEC,0xBE,0x00,0x00,
0x00,0x35,0xAC,0xDE,0xF0,0xC4,0x7C,0x06,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x6F,
0xFF,0x07,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x6F,0xFF,0x07,0x67,0xFF,0x13,0x00,
0x00,0x00,0x00,0x6F,0xFF,0x07,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x6F,0xFF,0x07,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x6F,0xFF,0x07,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x07,0x67,0xFF,0x56,0x47,0x47,0x47,0x47,0x98,0xFF,0x07,0x67,0xFF,
0x13,0x00,0x00,0x00,0x00,0x6F,0xFF,0x07,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x6F,
0xFF,0x07,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x6F,0xFF,0x07,0x67,0xFF,0x13,0x00,
0x00,0x00,0x00,0x6F,0xFF,0x07,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x6F,0xFF,0x07,
0x67,0xFF,0x13,0x67,0xFF,0x13,0x67,0xFF,0x13,0x67,0xFF,0x13,0x67,0xFF,0x13,0x67,
0xFF,0x13,0x67,0xFF,0x13,0x67,0xFF,0x13,0x67,0xFF,0x13,0x67,0xFF,0x13,0x67,0xFF,
0x13,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x77,0xFF,0x00,0x00,0x00,0x00,0x00,
0x77,0xFF,0x00,0x00,0x00,0x00,0x00,0x77,0xFF,0x00,0x00,0x00,0x00,0x00,0x77,0xFF,
0x00,0x00,0x00,0x00,0x00,0x77,0xFF,0x00,0x00,0x00,0x00,0x00,0x77,0xFF,0x00,0x00,
0x00,0x00,0x00,0x77,0xFF,0x00,0x00,0x00,0x00,0x00,0x77,0xFF,0x00,0x00,0x00,0x00,
0x00,0x80,0xF8,0x05,0x63,0x03,0x00,0x00,0xAE,0xD7,0x28,0xEE,0xB1,0x59,0x82,0xFC,
0x75,0x00,0x36,0xB0,0xEC,0xDC,0x80,0x02,0x67,0xFF,0x13,0x00,0x00,0x00,0x60,0xFD,
0x4B,0x00,0x67,0xFF,0x13,0x00,0x00,0x38,0xF8,0x7C,0x00,0x00,0x67,0xFF,0x13,0x00,
0x1A,0xE6,0xAF,0x01,0x00,0x00,0x67,0xFF,0x13,0x07,0xC9,0xD6,0x0D,0x00,0x00,0x00,
0x67,0xFF,0x14,0xA1,0xFF,0x36,0x00,0x00,0x00,0x00,0x67,0xFF,0x85,0xFE,0xF6,0x8D,
0x00,0x00,0x00,0x00,0x67,0xFF,0xFF,0x79,0x7B,0xFA,0x25,0x00,0x00,0x00,0x67,0xFF,
0xA6,0x00,0x09,0xE2,0xB1,0x00,0x00,0x00,0x67,0xFF,0x18,0x00,0x00,0x5B,0xFF,0x44,
0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x01,0xCA,0xD2,0x03,0x00,0x67,0xFF,0x13,0x00,
0x00,0x00,0x3C,0xFF,0x67,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0xAB,0xEA,0x0F,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,
0x67,0xFF,0x4E,0x3F,0x3F,0x3F,0x3F,0x0C,0x67,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x33,
0x67,0xFF,0x90,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x63,0x67,0xFA,0xE6,0x02,0x00,
0x00,0x00,0x03,0xE9,0xFA,0x63,0x67,0xD0,0xEB,0x42,0x00,0x00,0x00,0x45,0xE1,0xDB,
0x63,0x67,0xD8,0x9A,0x9B,0x00,0x00,0x00,0x9E,0x8D,0xE7,0x63,0x67,0xE4,0x44,0xEE,
0x06,0x00,0x07,0xF0,0x38,0xF4,0x63,0x67,0xEF,0x03,0xE7,0x4E,0x00,0x4F,0xDD,0x00,
0xFF,0x63,0x67,0xEF,0x00,0x8F,0xA7,0x00,0xA6,0x82,0x00,0xFF,0x63,0x67,0xEF,0x00,
0x34,0xF2,0x0E,0xF1,0x27,0x00,0xFF,0x63,0x67,0xEF,0x00,0x00,0xD8,0x95,0xCB,0x00,
0x00,0xFF,0x63,0x67,0xEF,0x00,0x00,0x7D,0xFF,0x70,0x00,0x00,0xFF,0x63,0x67,0xEF,
0x00,0x00,0x22,0xD3,0x18,0x00,0x00,0xFF,0x63,0x67,0xEF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xFF,0x63,0x67,0xFF,0x67,0x00,0x00,0x00,0x00,0x73,0xF3,0x67,0xFD,0xE9,
0x0E,0x00,0x00,0x00,0x73,0xF3,0x67,0xDB,0xCE,0x87,0x00,0x00,0x00,0x73,0xF3,0x67,
0xE5,0x4C,0xF7,0x1F,0x00,0x00,0x73,0xF3,0x67,0xF1,0x00,0xC7,0xA7,0x00,0x00,0x73,
0xF3,0x67,0xFC,0x00,0x3A,0xFE,0x38,0x00,0x73,0xF3,0x67,0xFF,0x00,0x00,0xA9,0xC6,
0x00,0x70,0xF3,0x67,0xFF,0x00,0x00,0x21,0xF8,0x56,0x64,0xF3,0x67,0xFF,0x00,0x00,
0x00,0x8A,0xD7,0x5A,0xF3,0x67,0xFF,0x00,0x00,0x00,0x0F,0xEB,0xA6,0xF3,0x67,0xFF,
0x00,0x00,0x00,0x00,0x6B,0xFD,0xF3,0x67,0xFF,0x00,0x00,0x00,0x00,0x04,0xD7,0xF3,
0x00,0x00,0x00,0x49,0xB4,0xE8,0xE1,0xAD,0x33,0x00,0x00,0x00,0x00,0x7C,0xFE,0xB1,
0x65,0x6C,0xC3,0xF9,0x5D,0x00,0x00,0x2E,0xFD,0x85,0x00,0x00,0x00,0x04,0xA7,0xF1,
0x15,0x00,0xAB,0xE6,0x07,0x00,0x00,0x00,0x00,0x1B,0xF9,0x85,0x00,0xDC,0x9F,0x00,
0x00,0x00,0x00,0x00,0x00,0xC4,0xB7,0x05,0xFC,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,
0xA3,0xDE,0x04,0xFB,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xA5,0xDA,0x00,0xDA,0xA1,
0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xB5,0x00,0xA7,0xE9,0x09,0x00,0x00,0x00,0x00,
0x1E,0xFA,0x82,0x00,0x2B,0xFC,0x88,0x00,0x00,0x00,0x04,0xA9,0xEF,0x12,0x00,0x00,
0x78,0xFE,0xB0,0x61,0x68,0xC2,0xF8,0x59,0x00,0x00,0x00,0x00,0x47,0xB4,0xE8,0xE2,
0xAD,0x32,0x00,0x00,0x67,0xFF,0xFF,0xFF,0xF0,0xD4,0x7D,0x0D,0x00,0x67,0xFF,0x43,
0x34,0x44,0x78,0xEF,0xB6,0x01,0x67,0xFF,0x13,0x00,0x00,0x00,0x5D,0xFF,0x24,0x67,
0xFF,0x13,0x00,0x00,0x00,0x2B,0xFF,0x4B,0x67,0xFF,0x13,0x00,0x00,0x00,0x54,0xFF,
0x27,0x67,0xFF,0x13,0x00,0x11,0x4D,0xE3,0xC1,0x01,0x67,0xFF,0xFF,0xFF,0xFF,0xFB,
0xA1,0x16,0x00,0x67,0xFF,0x43,0x33,0x25,0x07,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,
0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,
0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x48,0xB3,0xE8,0xE1,0xAC,0x32,0x00,0x00,0x00,0x00,0x00,0x7B,0xFE,
0xB2,0x65,0x6D,0xC4,0xF8,0x5C,0x00,0x00,0x00,0x2D,0xFD,0x87,0x00,0x00,0x00,0x04,
0xA9,0xF1,0x14,0x00,0x00,0xA9,0xE8,0x08,0x00,0x00,0x00,0x00,0x1D,0xFA,0x83,0x00,
0x00,0xDB,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xC5,0xB5,0x00,0x05,0xFB,0x7F,0x00,
0x00,0x00,0x00,0x00,0x00,0xA5,0xDB,0x00,0x06,0xFD,0x7E,0x00,0x00,0x00,0x00,0x00,
0x00,0xA3,0xDF,0x00,0x00,0xE1,0x9D,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xBD,0x00,
0x00,0xAC,0xE2,0x05,0x00,0x00,0x00,0x00,0x16,0xF6,0x86,0x00,0x00,0x36,0xFF,0x6F,
0x00,0x00,0x00,0x00,0x95,0xF9,0x1A,0x00,0x00,0x00,0x85,0xFE,0x8E,0x3E,0x45,0xA4,
0xFD,0x62,0x00,0x00,0x00,0x00,0x00,0x5F,0xC8,0xFF,0xFE,0xBB,0x48,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x8D,0xF9,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x11,0xD3,0xEF,0x84,0x48,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x8A,
0xDC,0xF9,0xE6,0x15,0x67,0xFF,0xFF,0xFF,0xF8,0xDE,0x90,0x16,0x00,0x67,0xFF,0x43,
0x33,0x3F,0x6E,0xE8,0xC9,0x04,0x67,0xFF,0x13,0x00,0x00,0x00,0x4E,0xFF,0x32,0x67,
0xFF,0x13,0x00,0x00,0x00,0x24,0xFF,0x55,0x67,0xFF,0x13,0x00,0x00,0x00,0x5C,0xFF,
0x32,0x67,0xFF,0x40,0x2F,0x3D,0x75,0xEF,0xBB,0x00,0x67,0xFF,0xFF,0xFF,0xFF,0xF2,
0x88,0x0A,0x00,0x67,0xFF,0x13,0x00,0x86,0xF7,0x21,0x00,0x00,0x67,0xFF,0x13,0x00,
0x0D,0xE7,0xAE,0x00,0x00,0x67,0xFF,0x13,0x00,0x00,0x62,0xFF,0x43,0x00,0x67,0xFF,
0x13,0x00,0x00,0x02,0xCD,0xD4,0x04,0x67,0xFF,0x13,0x00,0x00,0x00,0x3E,0xFF,0x6D,
0x00,0x00,0x32,0xB4,0xEB,0xE4,0xAF,0x36,0x00,0x00,0x2A,0xF4,0xC8,0x71,0x66,0xAA,
0xFB,0x30,0x00,0x8E,0xEB,0x06,0x00,0x00,0x00,0x2D,0x00,0x00,0x9B,0xED,0x07,0x00,
0x00,0x00,0x00,0x00,0x00,0x44,0xFF,0xC1,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x4B,
0xE1,0xFF,0xC2,0x4D,0x00,0x00,0x00,0x00,0x00,0x09,0x65,0xD6,0xFF,0xAA,0x0F,0x00,
0x00,0x00,0x00,0x00,0x03,0x69,0xFD,0x8F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBB,
0xCA,0x00,0x72,0x25,0x00,0x00,0x00,0x03,0xD6,0xAB,0x0E,0xC7,0xF4,0x97,0x5E,0x5D,
0xBB,0xF9,0x34,0x00,0x03,0x71,0xB9,0xEC,0xE6,0xB2,0x32,0x00,0x83,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x13,0x20,0x3F,0x3F,0x3F,0xF6,0xA5,0x3F,0x3F,0x3F,0x04,
0x00,0x00,0x00,0x00,0xF3,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x87,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x87,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xF3,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x87,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xF3,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x87,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xF3,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x87,
0x00,0x00,0x00,0x00,0x73,0xFF,0x07,0x00,0x00,0x00,0x00,0x6F,0xFB,0x73,0xFF,0x07,
0x00,0x00,0x00,0x00,0x6F,0xFB,0x73,0xFF,0x07,0x00,0x00,0x00,0x00,0x6F,0xFB,0x73,
0xFF,0x07,0x00,0x00,0x00,0x00,0x6F,0xFB,0x73,0xFF,0x07,0x00,0x00,0x00,0x00,0x6F,
0xFB,0x73,0xFF,0x07,0x00,0x00,0x00,0x00,0x6F,0xFB,0x73,0xFF,0x07,0x00,0x00,0x00,
0x00,0x70,0xFB,0x60,0xFF,0x17,0x00,0x00,0x00,0x00,0x80,0xE7,0x3E,0xFF,0x38,0x00,
0x00,0x00,0x00,0xA3,0xC4,0x11,0xF1,0x9D,0x00,0x00,0x00,0x16,0xF4,0x89,0x00,0x75,
0xFF,0x9F,0x55,0x69,0xDD,0xEB,0x10,0x00,0x00,0x5E,0xCE,0xF3,0xE3,0xA7,0x1D,0x00,
0xD4,0xB4,0x00,0x00,0x00,0x00,0x00,0x75,0xFB,0x10,0x84,0xF6,0x09,0x00,0x00,0x00,
0x00,0xBF,0xBB,0x00,0x34,0xFF,0x4A,0x00,0x00,0x00,0x0E,0xFB,0x6C,0x00,0x01,0xE4,
0x94,0x00,0x00,0x00,0x53,0xFF,0x1D,0x00,0x00,0x95,0xDF,0x00,0x00,0x00,0x9D,0xCC,
0x00,0x00,0x00,0x45,0xFF,0x2A,0x00,0x01,0xE6,0x7D,0x00,0x00,0x00,0x05,0xF0,0x75,
0x00,0x31,0xFF,0x2D,0x00,0x00,0x00,0x00,0xA6,0xBE,0x00,0x7A,0xDD,0x00,0x00,0x00,
0x00,0x00,0x56,0xFA,0x0D,0xC3,0x8E,0x00,0x00,0x00,0x00,0x00,0x0E,0xF9,0x61,0xFB,
0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xE5,0xEB,0x03,0x00,0x00,0x00,0x00,0x00,
0x00,0x67,0xFF,0x9F,0x00,0x00,0x00,0x00,0x81,0xFB,0x08,0x00,0x00,0x00,0xBF,0xD7,
0x00,0x00,0x00,0x00,0xE8,0x81,0x4C,0xFF,0x33,0x00,0x00,0x07,0xF7,0xFF,0x18,0x00,
0x00,0x18,0xFF,0x4D,0x17,0xFF,0x64,0x00,0x00,0x3E,0xE0,0xD9,0x59,0x00,0x00,0x49,
0xFF,0x1A,0x00,0xE1,0x94,0x00,0x00,0x7D,0xA9,0xA3,0x9A,0x00,0x00,0x79,0xE6,0x00,
0x00,0xAC,0xC4,0x00,0x00,0xBC,0x72,0x6D,0xDB,0x00,0x00,0xA9,0xB2,0x00,0x00,0x76,
0xF3,0x01,0x05,0xF5,0x37,0x31,0xFF,0x1C,0x00,0xDA,0x7F,0x00,0x00,0x41,0xFF,0x26,
0x39,0xF5,0x05,0x02,0xF0,0x5C,0x0C,0xFE,0x4B,0x00,0x00,0x0E,0xFE,0x52,0x72,0xBC,
0x00,0x00,0xB3,0x93,0x36,0xFF,0x18,0x00,0x00,0x00,0xD6,0x7F,0xAA,0x7E,0x00,0x00,
0x74,0xC9,0x62,0xE4,0x00,0x00,0x00,0x00,0xA1,0xAC,0xE2,0x41,0x00,0x00,0x35,0xF9,
0x95,0xB0,0x00,0x00,0x00,0x00,0x6C,0xEE,0xFA,0x09,0x00,0x00,0x03,0xF2,0xEC,0x7C,
0x00,0x00,0x00,0x00,0x36,0xFF,0xC6,0x00,0x00,0x00,0x00,0xB7,0xFF,0x49,0x00,0x00,
0x3D,0xFF,0x62,0x00,0x00,0x00,0x28,0xFC,0x65,0x00,0xB0,0xE0,0x06,0x00,0x00,0xA8,
0xD6,0x03,0x00,0x27,0xFB,0x6C,0x00,0x2C,0xFE,0x4F,0x00,0x00,0x00,0x95,0xE8,0x0B,
0xA9,0xC4,0x00,0x00,0x00,0x00,0x16,0xF2,0xA0,0xFC,0x39,0x00,0x00,0x00,0x00,0x00,
0x7F,0xFF,0xAF,0x00,0x00,0x00,0x00,0x00,0x00,0xB3,0xF9,0xCC,0x01,0x00,0x00,0x00,
0x00,0x41,0xFC,0x49,0xFB,0x5E,0x00,0x00,0x00,0x01,0xCC,0xA4,0x00,0x9B,0xE3,0x09,
0x00,0x00,0x5B,0xFB,0x25,0x00,0x1C,0xF7,0x7C,0x00,0x07,0xE0,0x99,0x00,0x00,0x00,
0x8A,0xF3,0x18,0x75,0xF7,0x1B,0x00,0x00,0x00,0x11,0xEF,0x9B,0x00,0xCA,0xC8,0x00,
0x00,0x00,0x00,0x41,0xFF,0x42,0x00,0x4F,0xFF,0x39,0x00,0x00,0x00,0xB3,0xC7,0x00,
0x00,0x01,0xD3,0xAA,0x00,0x00,0x27,0xFE,0x4C,0x00,0x00,0x00,0x59,0xFC,0x1F,0x00,
0x98,0xD1,0x01,0x00,0x00,0x00,0x03,0xDB,0x8C,0x14,0xF6,0x57,0x00,0x00,0x00,0x00,
0x00,0x63,0xF0,0x8A,0xDA,0x03,0x00,0x00,0x00,0x00,0x00,0x05,0xE2,0xFF,0x62,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xFD,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7F,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7F,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFB,
0x00,0x00,0x00,0x00,0x00,0xA3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCE,0x00,0x28,0x3F,
0x3F,0x3F,0x3F,0x70,0xFF,0x6A,0x00,0x00,0x00,0x00,0x00,0x02,0xCA,0xC8,0x02,0x00,
0x00,0x00,0x00,0x00,0x6D,0xFB,0x2F,0x00,0x00,0x00,0x00,0x00,0x1B,0xF2,0x89,0x00,
0x00,0x00,0x00,0x00,0x00,0xAD,0xDF,0x0A,0x00,0x00,0x00,0x00,0x00,0x4E,0xFF,0x49,
0x00,0x00,0x00,0x00,0x00,0x0C,0xE2,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x8F,0xEF,
0x18,0x00,0x00,0x00,0x00,0x00,0x32,0xFC,0x67,0x00,0x00,0x00,0x00,0x00,0x03,0xCC,
0xE3,0x41,0x3F,0x3F,0x3F,0x3F,0x37,0x32,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,
0x44,0xCF,0xCF,0xB2,0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,
0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,
0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,
0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,0x53,0xC7,0x00,0x00,0x46,0xD7,0xD7,0xB9,
0x5F,0x33,0x00,0x00,0x00,0x00,0x00,0x71,0x9A,0x00,0x00,0x00,0x00,0x00,0x23,0xE7,
0x01,0x00,0x00,0x00,0x00,0x00,0xD4,0x38,0x00,0x00,0x00,0x00,0x00,0x85,0x87,0x00,
0x00,0x00,0x00,0x00,0x37,0xD6,0x00,0x00,0x00,0x00,0x00,0x01,0xE6,0x25,0x00,0x00,
0x00,0x00,0x00,0x99,0x74,0x00,0x00,0x00,0x00,0x00,0x4A,0xC3,0x00,0x00,0x00,0x00,
0x00,0x08,0xF1,0x15,0x00,0x00,0x00,0x00,0x00,0xAD,0x61,0x00,0x00,0x00,0x00,0x00,
0x5E,0xB0,0x00,0x00,0x00,0x00,0x00,0x13,0xF2,0x09,0x00,0x00,0x00,0x00,0x00,0xC1,
0x4E,0x00,0x00,0x00,0x00,0x00,0x72,0x9D,0x00,0x00,0x00,0x00,0x00,0x23,0xE9,0x02,
0x61,0xCF,0xCF,0x95,0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,
0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,
0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,
0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,0x00,0x00,0x5F,0xB7,0x65,0xD7,0xD7,0x9B,
0x00,0x00,0x6A,0xFF,0x45,0x00,0x00,0x00,0x00,0xCF,0xCE,0xAA,0x00,0x00,0x00,0x33,
0xF0,0x29,0xF8,0x15,0x00,0x00,0x98,0x9B,0x00,0xBF,0x73,0x00,0x0B,0xF1,0x3C,0x00,
0x61,0xD7,0x00,0x61,0xDD,0x00,0x00,0x0D,0xF5,0x3C,0xB2,0x79,0x00,0x00,0x00,0x9A,
0x91,0x00,0x00,0x00,0xC5,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xB2,0x00,0x00,0x00,
0x3E,0xAD,0x04,0x00,0x3B,0xF1,0x96,0x00,0x00,0x36,0xEF,0x6F,0x00,0x00,0x31,0x51,
0x00,0x0C,0x78,0xC2,0xF1,0xD8,0x67,0x00,0x00,0x7E,0xCF,0x6C,0x46,0x96,0xFF,0x3E,
0x00,0x06,0x02,0x00,0x00,0x03,0xF2,0x95,0x00,0x00,0x00,0x0B,0x3F,0x6C,0xE6,0xB2,
0x00,0x0A,0x95,0xE6,0xA6,0x73,0xD2,0xB7,0x00,0xB0,0xC4,0x0F,0x00,0x00,0xBB,0xB7,
0x06,0xFA,0x6E,0x00,0x00,0x02,0xC9,0xB7,0x00,0xE4,0xD2,0x44,0x4D,0xBE,0xF1,0xB7,
0x00,0x39,0xCE,0xF3,0xC1,0x4F,0x88,0xB7,0x6E,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xE4,0x34,0xB7,
0xEF,0xCD,0x58,0x00,0x00,0x87,0xF9,0xE3,0x70,0x4D,0xAA,0xFF,0x4D,0x00,0x87,0xF3,
0x17,0x00,0x00,0x01,0xD3,0xC3,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x8B,0xF3,0x00,
0x87,0xEB,0x00,0x00,0x00,0x00,0x7C,0xFE,0x06,0x87,0xEB,0x00,0x00,0x00,0x00,0x9B,
0xE1,0x00,0x87,0xED,0x00,0x00,0x00,0x0D,0xED,0xA1,0x00,0x87,0xFD,0xBE,0x50,0x4E,
0xC9,0xF2,0x1F,0x00,0x87,0xB2,0x5D,0xD2,0xF0,0xB8,0x27,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x22,0xAB,0xE6,0xE4,0x9D,0x14,0x00,0x28,0xF4,0xCB,0x57,0x52,0xBD,0x34,
0x00,0xBD,0xDF,0x08,0x00,0x00,0x00,0x00,0x06,0xFB,0x7D,0x00,0x00,0x00,0x00,0x00,
0x25,0xFF,0x5D,0x00,0x00,0x00,0x00,0x00,0x09,0xFD,0x79,0x00,0x00,0x00,0x00,0x00,
0x00,0xC9,0xD8,0x05,0x00,0x00,0x00,0x00,0x00,0x38,0xFA,0xC1,0x4F,0x4E,0xB1,0x6A,
0x00,0x00,0x31,0xB8,0xED,0xE2,0x9E,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xCF,
0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0x6B,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0xFF,0x6B,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xFF,0x6B,0x00,0x00,0x30,0xBC,
0xF0,0xCF,0x55,0xFB,0x6B,0x00,0x2D,0xF7,0xC3,0x53,0x5D,0xD0,0xFF,0x6B,0x00,0xB7,
0xDE,0x06,0x00,0x00,0x0B,0xFF,0x6B,0x02,0xF7,0x7E,0x00,0x00,0x00,0x07,0xFF,0x6B,
0x1D,0xFF,0x5F,0x00,0x00,0x00,0x07,0xFF,0x6B,0x0A,0xFF,0x75,0x00,0x00,0x00,0x07,
0xFF,0x6B,0x00,0xD8,0xC6,0x00,0x00,0x00,0x20,0xFF,0x6B,0x00,0x5A,0xFF,0xA3,0x45,
0x67,0xE1,0xFA,0x6B,0x00,0x00,0x5C,0xD0,0xF1,0xBB,0x35,0xD0,0x6B,0x00,0x00,0x00,
0x00,0x00,0x26,0xB4,0xEE,0xD7,0x75,0x01,0x00,0x00,0x27,0xF3,0xA1,0x3D,0x5B,0xEA,
0x77,0x00,0x00,0xB5,0xBB,0x00,0x00,0x00,0x61,0xEB,0x00,0x04,0xF9,0x63,0x07,0x07,
0x07,0x2E,0xFF,0x18,0x24,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x28,0x0C,0xFE,0x5F,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xBD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0xFA,0xAF,0x44,0x36,0x6D,0x6A,0x00,0x00,0x00,0x2D,0xB4,0xEA,0xEA,0xB8,0x43,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x17,0x00,0x00,0x00,0x79,0xFC,0xFF,0x89,
0x00,0x1C,0xFD,0x95,0x13,0x12,0x00,0x45,0xFF,0x36,0x00,0x00,0x00,0x4B,0xFF,0x27,
0x00,0x00,0x72,0xFA,0xFF,0xFF,0xFF,0x00,0x17,0x6D,0xFF,0x50,0x2F,0x00,0x00,0x4B,
0xFF,0x27,0x00,0x00,0x00,0x4B,0xFF,0x27,0x00,0x00,0x00,0x4B,0xFF,0x27,0x00,0x00,
0x00,0x4B,0xFF,0x27,0x00,0x00,0x00,0x4B,0xFF,0x27,0x00,0x00,0x00,0x4B,0xFF,0x27,
0x00,0x00,0x00,0x4B,0xFF,0x27,0x00,0x00,0x00,0x00,0x65,0xD6,0xFC,0xFF,0xFF,0xFF,
0xA3,0x00,0x63,0xF9,0x59,0x20,0x82,0xFC,0x43,0x14,0x00,0xC3,0xA2,0x00,0x00,0x00,
0xDE,0x7A,0x00,0x00,0xC0,0x9E,0x00,0x00,0x00,0xDA,0x73,0x00,0x00,0x5E,0xF5,0x44,
0x09,0x70,0xF6,0x25,0x00,0x00,0x12,0xE4,0xCD,0xF3,0xC8,0x40,0x00,0x00,0x00,0x8C,
0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xDB,0x46,0x34,0x33,0x20,0x03,0x00,
0x00,0x27,0xFC,0xFF,0xFF,0xFF,0xFF,0xE4,0x39,0x00,0xB3,0x85,0x00,0x00,0x04,0x2E,
0xE9,0xB2,0x1E,0xFF,0x25,0x00,0x00,0x00,0x00,0xBD,0x9F,0x07,0xEB,0xA7,0x23,0x03,
0x1D,0x89,0xF0,0x2C,0x00,0x2B,0xAD,0xE8,0xF7,0xD9,0x9B,0x23,0x00,0x00,0x00,0x00,
0x6E,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,
0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,
0x87,0xE5,0x1D,0xA5,0xEA,0xDB,0x53,0x00,0x87,0xF3,0xDD,0x83,0x56,0xC7,0xF6,0x14,
0x87,0xF7,0x2E,0x00,0x00,0x34,0xFF,0x4D,0x87,0xEB,0x00,0x00,0x00,0x11,0xFF,0x65,
0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,
0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,
0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,0x75,0xC0,0x09,0x8D,0xDE,0x0F,0x00,0x00,
0x00,0x00,0x00,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,
0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x00,
0x00,0x00,0x72,0xC1,0x0B,0x00,0x00,0x89,0xDF,0x11,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x83,0xEF,0x00,0x00,0x00,0x83,0xEF,0x00,0x00,0x00,
0x83,0xEF,0x00,0x00,0x00,0x83,0xEF,0x00,0x00,0x00,0x83,0xEF,0x00,0x00,0x00,0x83,
0xEF,0x00,0x00,0x00,0x83,0xEF,0x00,0x00,0x00,0x83,0xEF,0x00,0x00,0x00,0x83,0xEF,
0x00,0x00,0x00,0x83,0xEF,0x00,0x00,0x00,0x98,0xE3,0x00,0x23,0x49,0xE0,0xB2,0x00,
0x9B,0xFB,0xCB,0x28,0x00,0x00,0x00,0x00,0x06,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,
0x87,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,
0x87,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xE7,0x00,0x00,0x00,0x00,0x00,0x00,
0x87,0xE7,0x00,0x00,0x02,0xB6,0xD4,0x0C,0x87,0xE7,0x00,0x00,0x81,0xEF,0x24,0x00,
0x87,0xE7,0x00,0x4B,0xFB,0x49,0x00,0x00,0x87,0xE7,0x23,0xEF,0x92,0x00,0x00,0x00,
0x87,0xEE,0xD0,0xEC,0xDE,0x09,0x00,0x00,0x87,0xFF,0xCE,0x1B,0xEA,0x85,0x00,0x00,
0x87,0xF6,0x1D,0x00,0x64,0xF9,0x28,0x00,0x87,0xE7,0x00,0x00,0x02,0xCC,0xBE,0x00,
0x87,0xE7,0x00,0x00,0x00,0x39,0xFE,0x5C,0x7F,0xDD,0x00,0x87,0xEB,0x00,0x87,0xEB,
0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,
0x87,0xEB,0x00,0x87,0xEB,0x00,0x87,0xEB,0x00,0x6C,0xF9,0x2B,0x21,0xE1,0xB8,0x00,
0x87,0xB6,0x23,0xAE,0xEC,0xB9,0x2A,0x08,0x8E,0xE4,0xDE,0x5C,0x00,0x87,0xE5,0xDC,
0x7A,0x5E,0xE5,0xD0,0xC4,0x97,0x57,0xC0,0xFA,0x1B,0x87,0xF7,0x2C,0x00,0x00,0x6D,
0xFF,0x68,0x00,0x00,0x29,0xFF,0x59,0x87,0xEB,0x00,0x00,0x00,0x49,0xFF,0x2F,0x00,
0x00,0x05,0xFF,0x71,0x87,0xEB,0x00,0x00,0x00,0x43,0xFF,0x2F,0x00,0x00,0x00,0xFF,
0x73,0x87,0xEB,0x00,0x00,0x00,0x43,0xFF,0x2F,0x00,0x00,0x00,0xFF,0x73,0x87,0xEB,
0x00,0x00,0x00,0x43,0xFF,0x2F,0x00,0x00,0x00,0xFF,0x73,0x87,0xEB,0x00,0x00,0x00,
0x43,0xFF,0x2F,0x00,0x00,0x00,0xFF,0x73,0x87,0xEB,0x00,0x00,0x00,0x43,0xFF,0x2F,
0x00,0x00,0x00,0xFF,0x73,0x00,0x00,0x00,0x87,0xB6,0x1E,0xA6,0xEA,0xDB,0x53,0x00,
0x87,0xE6,0xDE,0x83,0x56,0xC7,0xF6,0x14,0x87,0xF7,0x2E,0x00,0x00,0x34,0xFF,0x4D,
0x87,0xEB,0x00,0x00,0x00,0x11,0xFF,0x65,0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,
0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,
0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,0x87,0xEB,0x00,0x00,0x00,0x0B,0xFF,0x67,
0x00,0x00,0x29,0xB4,0xEC,0xDD,0x91,0x0C,0x00,0x00,0x2E,0xF7,0xB9,0x4E,0x61,0xE4,
0xCF,0x05,0x00,0xC1,0xD5,0x03,0x00,0x00,0x2A,0xFD,0x70,0x07,0xFC,0x78,0x00,0x00,
0x00,0x00,0xC6,0xB1,0x25,0xFF,0x5C,0x00,0x00,0x00,0x00,0xA9,0xD4,0x08,0xFC,0x76,
0x00,0x00,0x00,0x00,0xC4,0xB3,0x00,0xC3,0xD1,0x02,0x00,0x00,0x26,0xFC,0x72,0x00,
0x30,0xF8,0xB4,0x49,0x5B,0xE0,0xD2,0x06,0x00,0x00,0x2B,0xB6,0xED,0xDF,0x93,0x0D,
0x00,0x00,0x00,0x00,0x87,0xB8,0x38,0xB6,0xEF,0xCE,0x58,0x00,0x00,0x87,0xF5,0xE5,
0x70,0x4D,0xAA,0xFF,0x4C,0x00,0x87,0xF3,0x17,0x00,0x00,0x01,0xD3,0xC3,0x00,0x87,
0xEB,0x00,0x00,0x00,0x00,0x8B,0xF2,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x7C,0xFE,
0x06,0x87,0xEB,0x00,0x00,0x00,0x00,0x9C,0xE1,0x00,0x87,0xEE,0x01,0x00,0x00,0x0E,
0xED,0xA2,0x00,0x87,0xFF,0xC3,0x51,0x4F,0xCA,0xF3,0x1F,0x00,0x87,0xE7,0x61,0xD4,
0xF0,0xB8,0x28,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xEB,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0xBD,
0xF0,0xD0,0x55,0xCA,0x6B,0x00,0x31,0xF8,0xC3,0x53,0x5D,0xD0,0xFE,0x6B,0x00,0xBC,
0xDE,0x06,0x00,0x00,0x0B,0xFF,0x6B,0x04,0xF9,0x7E,0x00,0x00,0x00,0x07,0xFF,0x6B,
0x1E,0xFF,0x5F,0x00,0x00,0x00,0x07,0xFF,0x6B,0x08,0xFE,0x75,0x00,0x00,0x00,0x07,
0xFF,0x6B,0x00,0xD5,0xC6,0x00,0x00,0x00,0x20,0xFF,0x6B,0x00,0x57,0xFF,0xA3,0x45,
0x67,0xE1,0xFE,0x6B,0x00,0x00,0x5A,0xCF,0xF1,0xBC,0x36,0xFC,0x6B,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0xFF,0x6B,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0x6B,0x00,
0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0x6B,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,
0x6B,0x00,0x00,0x00,0x87,0xB4,0x23,0xB4,0xFB,0x24,0x87,0xD3,0xCF,0x84,0x68,0x02,
0x87,0xFF,0x64,0x00,0x00,0x00,0x87,0xF1,0x02,0x00,0x00,0x00,0x87,0xEB,0x00,0x00,
0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x87,0xEB,
0x00,0x00,0x00,0x00,0x87,0xEB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x22,0xB2,0xEE,
0xE1,0x9F,0x1E,0x00,0xCF,0xCC,0x48,0x46,0xAB,0x40,0x06,0xFE,0x6C,0x00,0x00,0x00,
0x00,0x00,0xB2,0xED,0x74,0x11,0x00,0x00,0x00,0x07,0x6C,0xE3,0xF2,0x88,0x0B,0x00,
0x00,0x00,0x06,0x61,0xF1,0x9E,0x00,0x05,0x00,0x00,0x00,0x98,0xD9,0x3E,0xE4,0x69,
0x30,0x56,0xE9,0x99,0x02,0x66,0xC4,0xF1,0xE3,0x92,0x0C,0x00,0x00,0x05,0x6B,0x12,
0x00,0x00,0x00,0x1A,0xFF,0x2B,0x00,0x00,0x00,0x2E,0xFF,0x2B,0x00,0x00,0x89,0xFA,
0xFF,0xFF,0xFF,0x87,0x1B,0x6A,0xFF,0x53,0x2F,0x19,0x00,0x47,0xFF,0x2B,0x00,0x00,
0x00,0x47,0xFF,0x2B,0x00,0x00,0x00,0x47,0xFF,0x2B,0x00,0x00,0x00,0x47,0xFF,0x2B,
0x00,0x00,0x00,0x3C,0xFF,0x43,0x00,0x00,0x00,0x13,0xF8,0xB8,0x41,0x32,0x00,0x00,
0x5F,0xE1,0xEF,0x8C,0xA3,0xCF,0x00,0x00,0x00,0x33,0xFF,0x3F,0xA3,0xCF,0x00,0x00,
0x00,0x33,0xFF,0x3F,0xA3,0xCF,0x00,0x00,0x00,0x33,0xFF,0x3F,0xA3,0xCF,0x00,0x00,
0x00,0x33,0xFF,0x3F,0xA3,0xCF,0x00,0x00,0x00,0x33,0xFF,0x3F,0xA1,0xD3,0x00,0x00,
0x00,0x33,0xFF,0x3F,0x8C,0xEE,0x04,0x00,0x00,0x7C,0xFF,0x3F,0x4B,0xFF,0x97,0x4F,
0x9A,0xC8,0xFF,0x3F,0x01,0x87,0xE8,0xDD,0x8B,0x09,0xFE,0x3F,0x9F,0xDF,0x00,0x00,
0x00,0x00,0x79,0xEE,0x05,0x46,0xFF,0x31,0x00,0x00,0x00,0xCB,0x9B,0x00,0x03,0xE9,
0x82,0x00,0x00,0x1E,0xFF,0x43,0x00,0x00,0x93,0xD4,0x00,0x00,0x6F,0xE8,0x03,0x00,
0x00,0x3A,0xFF,0x25,0x00,0xC2,0x93,0x00,0x00,0x00,0x01,0xDF,0x76,0x15,0xFD,0x3B,
0x00,0x00,0x00,0x00,0x87,0xC3,0x5E,0xE2,0x01,0x00,0x00,0x00,0x00,0x2E,0xFD,0xC0,
0x8B,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0xFF,0x33,0x00,0x00,0x00,0x00,0x00,0x00,
0x71,0xFB,0x0C,0x00,0x00,0x64,0xFF,0x49,0x00,0x00,0x1B,0xFF,0x42,0x2D,0xFF,0x46,
0x00,0x00,0xA6,0xE8,0x8C,0x00,0x00,0x5A,0xF7,0x08,0x00,0xE7,0x86,0x00,0x00,0xE8,
0x7A,0xCF,0x00,0x00,0x99,0xBD,0x00,0x00,0xA3,0xC5,0x00,0x2A,0xE9,0x1E,0xFE,0x14,
0x00,0xD8,0x7B,0x00,0x00,0x5E,0xFA,0x0B,0x6C,0xAE,0x00,0xE0,0x56,0x17,0xFF,0x39,
0x00,0x00,0x1A,0xFF,0x42,0xAC,0x6D,0x00,0x9D,0x98,0x52,0xF2,0x04,0x00,0x00,0x00,
0xD4,0x75,0xE8,0x2C,0x00,0x5B,0xD3,0x88,0xB4,0x00,0x00,0x00,0x00,0x8F,0xCE,0xEB,
0x01,0x00,0x19,0xFD,0xCF,0x72,0x00,0x00,0x00,0x00,0x4A,0xFF,0xAB,0x00,0x00,0x00,
0xD5,0xFF,0x30,0x00,0x00,0x00,0x00,0x00,0x3E,0xFF,0x51,0x00,0x00,0x48,0xFE,0x35,
0x00,0xA1,0xDE,0x07,0x02,0xD0,0x9C,0x00,0x00,0x16,0xEE,0x7A,0x5B,0xEF,0x15,0x00,
0x00,0x00,0x67,0xF4,0xE1,0x6D,0x00,0x00,0x00,0x00,0x18,0xFC,0xF7,0x0B,0x00,0x00,
0x00,0x00,0xA1,0xBF,0xEA,0x81,0x00,0x00,0x00,0x3E,0xFC,0x2C,0x64,0xF9,0x29,0x00,
0x05,0xD4,0x9A,0x00,0x02,0xC9,0xC3,0x01,0x75,0xF3,0x18,0x00,0x00,0x31,0xFC,0x66,
0x9B,0xE2,0x01,0x00,0x00,0x00,0x73,0xEF,0x06,0x3A,0xFF,0x3D,0x00,0x00,0x00,0xC2,
0xA0,0x00,0x00,0xD8,0x97,0x00,0x00,0x14,0xFC,0x4B,0x00,0x00,0x77,0xEC,0x05,0x00,
0x60,0xF0,0x06,0x00,0x00,0x19,0xFC,0x4B,0x00,0xAE,0xA1,0x00,0x00,0x00,0x00,0xB4,
0xA2,0x06,0xF4,0x4C,0x00,0x00,0x00,0x00,0x53,0xEF,0x4A,0xF0,0x06,0x00,0x00,0x00,
0x00,0x06,0xEB,0xD3,0xA2,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xFF,0x4D,0x00,0x00,
0x00,0x00,0x00,0x00,0x6A,0xF1,0x07,0x00,0x00,0x00,0x00,0x00,0x03,0xD6,0x96,0x00,
0x00,0x00,0x00,0x0E,0x3E,0x98,0xF2,0x1F,0x00,0x00,0x00,0x00,0x47,0xF4,0xCE,0x3C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0xFF,0xFF,0xFF,0xFF,0xF4,0x00,
0x00,0x2D,0x2F,0x2F,0x50,0xFC,0x82,0x00,0x00,0x00,0x00,0x00,0xBA,0xD5,0x06,0x00,
0x00,0x00,0x00,0x61,0xFD,0x37,0x00,0x00,0x00,0x00,0x19,0xEF,0x8E,0x00,0x00,0x00,
0x00,0x00,0xAF,0xDD,0x0A,0x00,0x00,0x00,0x00,0x55,0xFF,0x42,0x00,0x00,0x00,0x00,
0x13,0xE9,0xB7,0x2B,0x2B,0x2B,0x2B,0x05,0x70,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,
0x00,0x00,0x3F,0xBB,0xB2,0x00,0x00,0xD8,0x8A,0x08,0x00,0x01,0xFC,0x31,0x00,0x00,
0x00,0xFC,0x30,0x00,0x00,0x00,0xF1,0x38,0x00,0x00,0x00,0xE6,0x40,0x00,0x00,0x00,
0xE7,0x3D,0x00,0x03,0x51,0xF9,0x14,0x00,0x63,0xFF,0x7E,0x00,0x00,0x00,0x35,0xFD,
0x1B,0x00,0x00,0x00,0xE2,0x42,0x00,0x00,0x00,0xEB,0x3D,0x00,0x00,0x00,0xF7,0x34,
0x00,0x00,0x00,0xFE,0x34,0x00,0x00,0x00,0xE1,0x86,0x07,0x00,0x00,0x49,0xC5,0xB9,
0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,
0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,0x5B,0xAB,
0x5B,0xAB,0x51,0x99,0x61,0xC8,0x86,0x00,0x00,0x00,0x39,0xF5,0x3F,0x00,0x00,0x00,
0xCD,0x64,0x00,0x00,0x00,0xCC,0x63,0x00,0x00,0x00,0xD1,0x5A,0x00,0x00,0x00,0xD7,
0x50,0x00,0x00,0x00,0xD2,0x52,0x00,0x00,0x00,0xA5,0xAD,0x0E,0x00,0x00,0x23,0xF6,
0xC7,0x00,0x00,0xB1,0x99,0x02,0x00,0x00,0xD7,0x4D,0x00,0x00,0x00,0xD4,0x55,0x00,
0x00,0x00,0xCE,0x60,0x00,0x00,0x00,0xD0,0x67,0x00,0x00,0x2F,0xF8,0x48,0x00,0x65,
0xD1,0x92,0x02,0x00,0x00,0x52,0xE9,0xC8,0x28,0x00,0x00,0x01,0x00,0x19,0xF1,0x54,
0xA6,0xEC,0x42,0x2F,0xD0,0x0C,0x16,0x5F,0x00,0x00,0x75,0xF4,0xED,0x5B,0x00,0x00,
0x00,0x00,0x00,0x00,0x05,0x05,0x00,0x00,
};
leRasterFont NotoSansCJKsc_Regular16 =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoSansCJKsc_Regular16_glyphs, // glyph table variable pointer
8504, // data size
},
LE_RASTER_FONT,
},
20,
14,
LE_FONT_BPP_8, // bits per pixel
NotoSansCJKsc_Regular16_data, // kerning table
};
/*********************************
* Legato Font Asset
* Name: NotoMono_Regular
* Height: 16
* Baseline: 12
* Style: Antialias
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoMono_Regular_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x03,0x00,0x0A,0x00,0x08,0x00,
0x03,0x00,0x0A,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x06,0x00,
0x03,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x06,0x00,0x20,0x00,0x00,0x00,
0x23,0x00,0x09,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x34,0x00,0x00,0x00,0x24,0x00,0x07,0x00,0x0E,0x00,0x08,0x00,0x01,0x00,0x0C,0x00,
0x00,0x00,0x07,0x00,0x90,0x00,0x00,0x00,0x25,0x00,0x09,0x00,0x0A,0x00,0x08,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0xF4,0x00,0x00,0x00,0x26,0x00,0x09,0x00,
0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x50,0x01,0x00,0x00,
0x27,0x00,0x03,0x00,0x03,0x00,0x08,0x00,0x03,0x00,0x0A,0x00,0x00,0x00,0x03,0x00,
0xAC,0x01,0x00,0x00,0x28,0x00,0x05,0x00,0x0C,0x00,0x08,0x00,0x02,0x00,0x0A,0x00,
0x00,0x00,0x05,0x00,0xB8,0x01,0x00,0x00,0x29,0x00,0x05,0x00,0x0C,0x00,0x08,0x00,
0x02,0x00,0x0A,0x00,0x00,0x00,0x05,0x00,0xF4,0x01,0x00,0x00,0x2A,0x00,0x08,0x00,
0x06,0x00,0x08,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x08,0x00,0x30,0x02,0x00,0x00,
0x2B,0x00,0x07,0x00,0x07,0x00,0x08,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,
0x60,0x02,0x00,0x00,0x2C,0x00,0x03,0x00,0x03,0x00,0x08,0x00,0x03,0x00,0x02,0x00,
0x00,0x00,0x03,0x00,0x94,0x02,0x00,0x00,0x2D,0x00,0x06,0x00,0x02,0x00,0x08,0x00,
0x01,0x00,0x04,0x00,0x00,0x00,0x06,0x00,0xA0,0x02,0x00,0x00,0x2E,0x00,0x03,0x00,
0x02,0x00,0x08,0x00,0x03,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0xAC,0x02,0x00,0x00,
0x2F,0x00,0x06,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x06,0x00,
0xB4,0x02,0x00,0x00,0x30,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,
0x00,0x00,0x07,0x00,0xF0,0x02,0x00,0x00,0x31,0x00,0x05,0x00,0x0A,0x00,0x08,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x05,0x00,0x38,0x03,0x00,0x00,0x32,0x00,0x07,0x00,
0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0x6C,0x03,0x00,0x00,
0x33,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,
0xB4,0x03,0x00,0x00,0x34,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x08,0x00,0x04,0x04,0x00,0x00,0x35,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0x54,0x04,0x00,0x00,0x36,0x00,0x07,0x00,
0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0x9C,0x04,0x00,0x00,
0x37,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,
0xE4,0x04,0x00,0x00,0x38,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,
0x00,0x00,0x07,0x00,0x34,0x05,0x00,0x00,0x39,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0x7C,0x05,0x00,0x00,0x3A,0x00,0x03,0x00,
0x08,0x00,0x08,0x00,0x03,0x00,0x08,0x00,0x00,0x00,0x03,0x00,0xC4,0x05,0x00,0x00,
0x3B,0x00,0x04,0x00,0x09,0x00,0x08,0x00,0x02,0x00,0x08,0x00,0x00,0x00,0x04,0x00,
0xDC,0x05,0x00,0x00,0x3C,0x00,0x07,0x00,0x07,0x00,0x08,0x00,0x01,0x00,0x08,0x00,
0x00,0x00,0x07,0x00,0x00,0x06,0x00,0x00,0x3D,0x00,0x07,0x00,0x03,0x00,0x08,0x00,
0x01,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x34,0x06,0x00,0x00,0x3E,0x00,0x07,0x00,
0x07,0x00,0x08,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,0x4C,0x06,0x00,0x00,
0x3F,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,
0x80,0x06,0x00,0x00,0x40,0x00,0x09,0x00,0x0B,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0xC8,0x06,0x00,0x00,0x41,0x00,0x09,0x00,0x0A,0x00,0x08,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0x2C,0x07,0x00,0x00,0x42,0x00,0x08,0x00,
0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,0x88,0x07,0x00,0x00,
0x43,0x00,0x09,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0xD8,0x07,0x00,0x00,0x44,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x08,0x00,0x34,0x08,0x00,0x00,0x45,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0x84,0x08,0x00,0x00,0x46,0x00,0x07,0x00,
0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0xCC,0x08,0x00,0x00,
0x47,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,
0x14,0x09,0x00,0x00,0x48,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x08,0x00,0x64,0x09,0x00,0x00,0x49,0x00,0x06,0x00,0x0A,0x00,0x08,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x06,0x00,0xB4,0x09,0x00,0x00,0x4A,0x00,0x07,0x00,
0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0xF0,0x09,0x00,0x00,
0x4B,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,
0x38,0x0A,0x00,0x00,0x4C,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,
0x00,0x00,0x07,0x00,0x88,0x0A,0x00,0x00,0x4D,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,0xD0,0x0A,0x00,0x00,0x4E,0x00,0x08,0x00,
0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,0x20,0x0B,0x00,0x00,
0x4F,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,
0x70,0x0B,0x00,0x00,0x50,0x00,0x07,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,
0x00,0x00,0x07,0x00,0xC0,0x0B,0x00,0x00,0x51,0x00,0x08,0x00,0x0D,0x00,0x08,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,0x08,0x0C,0x00,0x00,0x52,0x00,0x07,0x00,
0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0x70,0x0C,0x00,0x00,
0x53,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,
0xB8,0x0C,0x00,0x00,0x54,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x08,0x00,0x08,0x0D,0x00,0x00,0x55,0x00,0x08,0x00,0x0A,0x00,0x08,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,0x58,0x0D,0x00,0x00,0x56,0x00,0x09,0x00,
0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0xA8,0x0D,0x00,0x00,
0x57,0x00,0x09,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x04,0x0E,0x00,0x00,0x58,0x00,0x09,0x00,0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0x60,0x0E,0x00,0x00,0x59,0x00,0x09,0x00,0x0A,0x00,0x08,0x00,
0x00,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,0xBC,0x0E,0x00,0x00,0x5A,0x00,0x08,0x00,
0x0A,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,0x18,0x0F,0x00,0x00,
0x5B,0x00,0x05,0x00,0x0C,0x00,0x08,0x00,0x02,0x00,0x0A,0x00,0x00,0x00,0x05,0x00,
0x68,0x0F,0x00,0x00,0x5C,0x00,0x06,0x00,0x0A,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,
0x00,0x00,0x06,0x00,0xA4,0x0F,0x00,0x00,0x5D,0x00,0x05,0x00,0x0C,0x00,0x08,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x05,0x00,0xE0,0x0F,0x00,0x00,0x5E,0x00,0x08,0x00,
0x06,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x08,0x00,0x1C,0x10,0x00,0x00,
0x5F,0x00,0x0A,0x00,0x01,0x00,0x08,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x0A,0x00,
0x4C,0x10,0x00,0x00,0x60,0x00,0x04,0x00,0x02,0x00,0x08,0x00,0x02,0x00,0x0B,0x00,
0x00,0x00,0x04,0x00,0x58,0x10,0x00,0x00,0x61,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x60,0x10,0x00,0x00,0x62,0x00,0x07,0x00,
0x0B,0x00,0x08,0x00,0x01,0x00,0x0B,0x00,0x00,0x00,0x07,0x00,0xA0,0x10,0x00,0x00,
0x63,0x00,0x07,0x00,0x08,0x00,0x08,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,
0xF0,0x10,0x00,0x00,0x64,0x00,0x08,0x00,0x0B,0x00,0x08,0x00,0x00,0x00,0x0B,0x00,
0x00,0x00,0x08,0x00,0x28,0x11,0x00,0x00,0x65,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x80,0x11,0x00,0x00,0x66,0x00,0x07,0x00,
0x0B,0x00,0x08,0x00,0x01,0x00,0x0B,0x00,0x00,0x00,0x07,0x00,0xC0,0x11,0x00,0x00,
0x67,0x00,0x08,0x00,0x0B,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,
0x10,0x12,0x00,0x00,0x68,0x00,0x07,0x00,0x0B,0x00,0x08,0x00,0x01,0x00,0x0B,0x00,
0x00,0x00,0x07,0x00,0x68,0x12,0x00,0x00,0x69,0x00,0x07,0x00,0x0B,0x00,0x08,0x00,
0x01,0x00,0x0B,0x00,0x00,0x00,0x07,0x00,0xB8,0x12,0x00,0x00,0x6A,0x00,0x06,0x00,
0x0E,0x00,0x08,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x06,0x00,0x08,0x13,0x00,0x00,
0x6B,0x00,0x07,0x00,0x0B,0x00,0x08,0x00,0x01,0x00,0x0B,0x00,0x00,0x00,0x07,0x00,
0x5C,0x13,0x00,0x00,0x6C,0x00,0x07,0x00,0x0B,0x00,0x08,0x00,0x01,0x00,0x0B,0x00,
0x00,0x00,0x07,0x00,0xAC,0x13,0x00,0x00,0x6D,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0xFC,0x13,0x00,0x00,0x6E,0x00,0x07,0x00,
0x08,0x00,0x08,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,0x3C,0x14,0x00,0x00,
0x6F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,
0x74,0x14,0x00,0x00,0x70,0x00,0x07,0x00,0x0B,0x00,0x08,0x00,0x01,0x00,0x08,0x00,
0x00,0x00,0x07,0x00,0xB4,0x14,0x00,0x00,0x71,0x00,0x08,0x00,0x0B,0x00,0x08,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x04,0x15,0x00,0x00,0x72,0x00,0x07,0x00,
0x08,0x00,0x08,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,0x5C,0x15,0x00,0x00,
0x73,0x00,0x07,0x00,0x08,0x00,0x08,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,
0x94,0x15,0x00,0x00,0x74,0x00,0x08,0x00,0x0B,0x00,0x08,0x00,0x00,0x00,0x0B,0x00,
0x00,0x00,0x08,0x00,0xCC,0x15,0x00,0x00,0x75,0x00,0x07,0x00,0x08,0x00,0x08,0x00,
0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,0x24,0x16,0x00,0x00,0x76,0x00,0x08,0x00,
0x08,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x5C,0x16,0x00,0x00,
0x77,0x00,0x0A,0x00,0x08,0x00,0x08,0x00,0xFF,0xFF,0x08,0x00,0x00,0x00,0x0A,0x00,
0x9C,0x16,0x00,0x00,0x78,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x08,0x00,
0x00,0x00,0x08,0x00,0xEC,0x16,0x00,0x00,0x79,0x00,0x08,0x00,0x0B,0x00,0x08,0x00,
0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x2C,0x17,0x00,0x00,0x7A,0x00,0x07,0x00,
0x08,0x00,0x08,0x00,0x01,0x00,0x08,0x00,0x00,0x00,0x07,0x00,0x84,0x17,0x00,0x00,
0x7B,0x00,0x06,0x00,0x0C,0x00,0x08,0x00,0x01,0x00,0x0A,0x00,0x00,0x00,0x06,0x00,
0xBC,0x17,0x00,0x00,0x7C,0x00,0x02,0x00,0x0E,0x00,0x08,0x00,0x03,0x00,0x0B,0x00,
0x00,0x00,0x02,0x00,0x04,0x18,0x00,0x00,0x7D,0x00,0x06,0x00,0x0C,0x00,0x08,0x00,
0x01,0x00,0x0A,0x00,0x00,0x00,0x06,0x00,0x20,0x18,0x00,0x00,0x7E,0x00,0x07,0x00,
0x03,0x00,0x08,0x00,0x01,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x68,0x18,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoMono_Regular_glyphs[6272] =
{
0x86,0xF1,0x00,0x79,0xE4,0x00,0x6D,0xD8,0x00,0x60,0xCB,0x00,0x54,0xBF,0x00,0x47,
0xB2,0x00,0x3A,0xA6,0x00,0x00,0x00,0x00,0x68,0xBF,0x00,0x78,0xD7,0x02,0x00,0x00,
0x03,0xFD,0x84,0x20,0xFF,0x68,0x00,0xE8,0x6C,0x08,0xFF,0x50,0x00,0xD0,0x54,0x00,
0xF0,0x38,0x00,0x00,0x00,0x00,0x00,0xEE,0x10,0x00,0xEB,0x10,0x00,0x00,0x00,0x20,
0xE0,0x00,0x1E,0xDD,0x00,0x00,0x00,0x00,0x50,0xB0,0x00,0x4F,0xAC,0x00,0x00,0x2C,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x18,0x01,0x08,0xB3,0x55,0x08,0xB6,0x51,0x08,
0x00,0x00,0x00,0xEA,0x18,0x00,0xEA,0x14,0x00,0x00,0xB0,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x9C,0x00,0x05,0x50,0xB7,0x08,0x55,0xB2,0x08,0x04,0x00,0x00,0x78,0x86,0x00,
0x7F,0x80,0x00,0x00,0x00,0x00,0xA5,0x57,0x00,0xB0,0x50,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x44,0xAC,0x00,0x00,0x00,0x00,0x00,0x44,0xAC,0x00,0x00,0x00,0x02,0x85,
0xEB,0xFF,0xEA,0x96,0x00,0x63,0xDF,0x66,0xAE,0x29,0x44,0x00,0x9A,0x97,0x44,0xAC,
0x00,0x00,0x00,0x76,0xD6,0x58,0xAC,0x00,0x00,0x00,0x0D,0xBE,0xFD,0xD1,0x24,0x00,
0x00,0x00,0x00,0x6F,0xF7,0xFB,0x61,0x00,0x00,0x00,0x44,0xAC,0x66,0xF5,0x07,0x00,
0x00,0x44,0xAC,0x1B,0xFF,0x18,0x63,0x39,0x52,0xB9,0x96,0xD5,0x00,0x7B,0xE1,0xFA,
0xF6,0xAC,0x21,0x00,0x00,0x00,0x44,0xAC,0x00,0x00,0x00,0x00,0x00,0x44,0xAC,0x00,
0x00,0x00,0x00,0x00,0x46,0xD6,0xD5,0x3F,0x00,0x21,0xE6,0x0C,0x00,0xD6,0x38,0x39,
0xD2,0x00,0x9C,0x78,0x00,0x00,0xF7,0x11,0x11,0xF7,0x20,0xE7,0x0C,0x00,0x00,0xD2,
0x39,0x3A,0xD2,0x9B,0x7A,0x00,0x00,0x00,0x42,0xD6,0xD6,0x62,0xE8,0x0D,0x00,0x00,
0x00,0x00,0x00,0x00,0x9A,0x8B,0xBA,0xD8,0x93,0x00,0x00,0x00,0x1F,0xE8,0x80,0x9C,
0x02,0xD3,0x39,0x00,0x00,0x99,0x7D,0x93,0x75,0x00,0xAD,0x5F,0x00,0x1E,0xE9,0x0F,
0x6F,0x9D,0x02,0xD3,0x3B,0x00,0x98,0x7F,0x00,0x0C,0xB7,0xD9,0x96,0x00,0x00,0x00,
0x00,0x10,0xAF,0xF2,0xE8,0x76,0x00,0x00,0x00,0x00,0x84,0xCD,0x1A,0x47,0xFE,0x29,
0x00,0x00,0x00,0x99,0xA4,0x00,0x0A,0xFA,0x37,0x00,0x00,0x00,0x40,0xF1,0x2B,0xAB,
0xB1,0x00,0x00,0x00,0x00,0x03,0xC9,0xFD,0x8F,0x05,0x00,0x00,0x00,0x08,0xBE,0xB4,
0xAE,0xA3,0x00,0x67,0xDA,0x00,0x68,0xE5,0x07,0x0B,0xD1,0x61,0xB4,0x8A,0x00,0x89,
0xC4,0x00,0x00,0x20,0xE1,0xEE,0x1A,0x00,0x51,0xFC,0x51,0x13,0x6B,0xF0,0xEF,0x31,
0x00,0x00,0x7D,0xE5,0xF7,0xBF,0x36,0x73,0xE2,0x17,0x00,0x00,0x90,0xF7,0x00,0x78,
0xE0,0x00,0x60,0xC8,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0xCB,0x11,0x00,0x67,0xDD,
0x10,0x00,0x1D,0xF3,0x40,0x00,0x00,0x82,0xCA,0x00,0x00,0x00,0xCE,0x7B,0x00,0x00,
0x00,0xEE,0x5A,0x00,0x00,0x00,0xEE,0x5A,0x00,0x00,0x00,0xD0,0x7A,0x00,0x00,0x00,
0x86,0xC9,0x00,0x00,0x00,0x21,0xF5,0x3C,0x00,0x00,0x00,0x6D,0xDA,0x0E,0x00,0x00,
0x00,0x7B,0xC8,0x0F,0x77,0xCA,0x11,0x00,0x00,0x00,0x87,0xC9,0x04,0x00,0x00,0x06,
0xD4,0x79,0x00,0x00,0x00,0x67,0xE6,0x02,0x00,0x00,0x17,0xFF,0x35,0x00,0x00,0x00,
0xF6,0x55,0x00,0x00,0x00,0xF6,0x56,0x00,0x00,0x17,0xFF,0x37,0x00,0x00,0x65,0xE9,
0x04,0x00,0x05,0xD2,0x7E,0x00,0x00,0x83,0xCD,0x05,0x00,0x72,0xCB,0x13,0x00,0x00,
0x00,0x00,0x00,0x75,0xD5,0x00,0x00,0x00,0x00,0x0E,0x00,0x58,0xB7,0x00,0x03,0x0A,
0x05,0xF8,0xCB,0xAB,0xD0,0xB1,0xF1,0x69,0x01,0x1F,0x34,0xDA,0xF1,0x5F,0x27,0x0C,
0x00,0x00,0x80,0xC5,0x6B,0xD5,0x0C,0x00,0x00,0x07,0xB5,0x4E,0x06,0xC5,0x3F,0x00,
0x00,0x00,0x34,0x76,0x00,0x00,0x00,0x00,0x00,0x50,0xB4,0x00,0x00,0x00,0x00,0x00,
0x50,0xB4,0x00,0x00,0x00,0xF4,0xFF,0xFF,0xFF,0xFF,0xFF,0x58,0x07,0x08,0x55,0xB6,
0x08,0x08,0x02,0x00,0x00,0x50,0xB4,0x00,0x00,0x00,0x00,0x00,0x34,0x76,0x00,0x00,
0x00,0x00,0x00,0x00,0x59,0xFF,0x37,0x94,0xCF,0x00,0xD9,0x4E,0x00,0x00,0x00,0x00,
0x0C,0xFF,0xFF,0xFF,0xFF,0x74,0x01,0x28,0x28,0x28,0x28,0x12,0xA3,0xED,0x1C,0xA3,
0xED,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xBD,0x00,0x00,0x00,0x04,0xE4,0x4F,
0x00,0x00,0x00,0x57,0xDE,0x02,0x00,0x00,0x00,0xC5,0x73,0x00,0x00,0x00,0x32,0xF4,
0x10,0x00,0x00,0x00,0xA1,0x97,0x00,0x00,0x00,0x16,0xF7,0x2A,0x00,0x00,0x00,0x7D,
0xBB,0x00,0x00,0x00,0x05,0xE5,0x4D,0x00,0x00,0x00,0x59,0xDC,0x02,0x00,0x00,0x00,
0x00,0x75,0xE7,0xF5,0xAB,0x11,0x00,0x51,0xF1,0x43,0x20,0xBB,0xAA,0x00,0xB5,0x8A,
0x00,0x00,0x2A,0xFD,0x15,0xE7,0x58,0x00,0x00,0x00,0xF5,0x48,0xFB,0x47,0x00,0x00,
0x00,0xE4,0x5E,0xFB,0x47,0x00,0x00,0x00,0xE4,0x5E,0xE5,0x58,0x00,0x00,0x00,0xF5,
0x49,0xB2,0x89,0x00,0x00,0x29,0xFE,0x19,0x4C,0xF0,0x41,0x20,0xBA,0xB3,0x00,0x00,
0x70,0xE6,0xF6,0xB0,0x15,0x00,0x00,0x00,0x00,0x00,0x77,0xFD,0x30,0x0A,0xA8,0xCE,
0xFC,0x30,0x31,0xB3,0x0F,0xFF,0x30,0x00,0x00,0x03,0xFF,0x30,0x00,0x00,0x04,0xFF,
0x30,0x00,0x00,0x04,0xFF,0x30,0x00,0x00,0x04,0xFF,0x30,0x00,0x00,0x04,0xFF,0x30,
0x00,0x00,0x04,0xFF,0x30,0x00,0x00,0x04,0xFF,0x30,0x00,0x00,0x22,0xA8,0xEF,0xEE,
0xA8,0x13,0x00,0x81,0x92,0x27,0x21,0xC9,0xA3,0x00,0x00,0x00,0x00,0x00,0x63,0xE0,
0x00,0x00,0x00,0x00,0x00,0x7B,0xC9,0x00,0x00,0x00,0x00,0x0F,0xE2,0x66,0x00,0x00,
0x00,0x03,0xB2,0xB5,0x01,0x00,0x00,0x00,0x97,0xCF,0x0E,0x00,0x00,0x00,0x81,0xDA,
0x16,0x00,0x00,0x00,0x6C,0xE6,0x26,0x08,0x08,0x08,0x02,0xEB,0xFF,0xFF,0xFF,0xFF,
0xFF,0x50,0x00,0x00,0x00,0x56,0xC7,0xF6,0xED,0xAC,0x1A,0x00,0x00,0x9A,0x60,0x1B,
0x22,0xC0,0xB5,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0xD9,0x00,0x00,0x00,0x00,0x06,
0x39,0xDB,0x6E,0x00,0x00,0x00,0x94,0xFF,0xF8,0x85,0x03,0x00,0x00,0x00,0x04,0x0E,
0x32,0xBB,0xBA,0x01,0x00,0x00,0x00,0x00,0x00,0x25,0xFF,0x25,0x00,0x00,0x00,0x00,
0x00,0x2C,0xFF,0x1C,0x13,0x76,0x29,0x0F,0x2F,0xC0,0xC0,0x00,0x0D,0xAB,0xE7,0xF9,
0xE0,0x97,0x14,0x00,0x00,0x00,0x00,0x00,0x5E,0xFF,0x3C,0x00,0x00,0x00,0x00,0x16,
0xDC,0xEE,0x3C,0x00,0x00,0x00,0x00,0xA8,0x7E,0xEC,0x3C,0x00,0x00,0x00,0x4C,0xD9,
0x08,0xF4,0x3C,0x00,0x00,0x0D,0xE2,0x3F,0x00,0xF7,0x3C,0x00,0x00,0x96,0x9A,0x00,
0x00,0xF8,0x3C,0x00,0x3C,0xE4,0x0F,0x00,0x00,0xF8,0x3C,0x00,0x93,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xB4,0x04,0x08,0x08,0x08,0x08,0xF8,0x42,0x05,0x00,0x00,0x00,0x00,
0x00,0xF8,0x3C,0x00,0x46,0xFF,0xFF,0xFF,0xFF,0x7C,0x00,0x5A,0xCE,0x08,0x08,0x08,
0x03,0x00,0x6E,0xB7,0x00,0x00,0x00,0x00,0x00,0x82,0xA1,0x00,0x00,0x00,0x00,0x00,
0x8E,0xF4,0xF4,0xED,0xB0,0x22,0x00,0x09,0x23,0x0D,0x2B,0xB6,0xD8,0x02,0x00,0x00,
0x00,0x00,0x24,0xFF,0x27,0x00,0x00,0x00,0x00,0x29,0xFF,0x18,0x6F,0x30,0x10,0x29,
0xB9,0xBA,0x00,0x82,0xE1,0xF8,0xE1,0x96,0x13,0x00,0x00,0x00,0x00,0x15,0x99,0xE6,
0xF9,0x89,0x00,0x08,0xD5,0xC0,0x37,0x12,0x16,0x00,0x6D,0xDE,0x06,0x00,0x00,0x00,
0x00,0xBA,0x89,0x00,0x00,0x00,0x00,0x00,0xE2,0x83,0xC8,0xF6,0xD0,0x42,0x00,0xEF,
0xCE,0x2E,0x07,0x6A,0xF0,0x13,0xDC,0x5B,0x00,0x00,0x00,0xEA,0x48,0xB3,0x78,0x00,
0x00,0x02,0xF2,0x3D,0x44,0xEC,0x45,0x15,0x86,0xE0,0x09,0x00,0x68,0xE1,0xF4,0xC0,
0x2D,0x00,0x00,0x00,0x04,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x67,0x00,0x08,0x08,0x08,
0x08,0x21,0xFA,0x27,0x00,0x00,0x00,0x00,0x00,0x81,0xBB,0x00,0x00,0x00,0x00,0x00,
0x06,0xE8,0x51,0x00,0x00,0x00,0x00,0x00,0x5D,0xE2,0x03,0x00,0x00,0x00,0x00,0x00,
0xCA,0x7B,0x00,0x00,0x00,0x00,0x00,0x38,0xF9,0x17,0x00,0x00,0x00,0x00,0x00,0xA6,
0xA6,0x00,0x00,0x00,0x00,0x00,0x19,0xFA,0x3B,0x00,0x00,0x00,0x00,0x00,0x81,0xD0,
0x00,0x00,0x00,0x00,0x02,0x86,0xE6,0xF3,0xBC,0x28,0x00,0x66,0xE6,0x30,0x15,0xA1,
0xCE,0x00,0x91,0xA5,0x00,0x00,0x3F,0xF7,0x00,0x44,0xE0,0x12,0x00,0x93,0xA2,0x00,
0x00,0x6E,0xE5,0xB8,0xA8,0x07,0x00,0x29,0xD6,0x4C,0x3B,0xD3,0x64,0x00,0xBE,0x76,
0x00,0x00,0x1C,0xF6,0x21,0xE4,0x53,0x00,0x00,0x00,0xEE,0x45,0xA7,0xC0,0x23,0x14,
0x7D,0xED,0x12,0x13,0xA0,0xE9,0xF3,0xC1,0x36,0x00,0x00,0x00,0x09,0x91,0xE6,0xF3,
0xA4,0x0E,0x00,0x89,0xD0,0x29,0x1F,0xB3,0xA3,0x00,0xDA,0x58,0x00,0x00,0x14,0xFA,
0x17,0xE5,0x4E,0x00,0x00,0x01,0xF2,0x3E,0xA4,0xBD,0x17,0x0F,0x89,0xFC,0x53,0x15,
0xAA,0xEF,0xE9,0x66,0xF9,0x45,0x00,0x00,0x00,0x00,0x21,0xFF,0x1D,0x00,0x00,0x00,
0x00,0x7B,0xD0,0x00,0x08,0x10,0x16,0x6D,0xF5,0x46,0x00,0x2A,0xF7,0xF5,0xC2,0x44,
0x00,0x00,0x00,0x00,0x75,0xD5,0x01,0x76,0xD5,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x75,0xD5,0x01,0x76,0xD5,0x01,0x00,0x6A,0xDC,0x05,
0x00,0x6B,0xDC,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xA1,0xCB,0x00,0x00,0xDC,0x6D,0x00,0x17,0xEC,0x0A,0x00,
0x00,0x00,0x00,0x00,0x1B,0x94,0x50,0x00,0x00,0x1C,0x95,0xE9,0x83,0x0F,0x1C,0x95,
0xE7,0x7F,0x10,0x00,0x00,0xE8,0xDC,0x1D,0x00,0x00,0x00,0x00,0x1A,0x93,0xE6,0x7E,
0x0F,0x00,0x00,0x00,0x00,0x1B,0x94,0xE8,0x82,0x0F,0x00,0x00,0x00,0x00,0x1B,0x94,
0x50,0x00,0x00,0x00,0xF4,0xFF,0xFF,0xFF,0xFF,0xFF,0x58,0x0F,0x10,0x10,0x10,0x10,
0x10,0x05,0xF4,0xFF,0xFF,0xFF,0xFF,0xFF,0x58,0x00,0x00,0x00,0xB9,0x46,0x00,0x00,
0x00,0x00,0x00,0x50,0xCF,0xC6,0x46,0x00,0x00,0x00,0x00,0x00,0x4E,0xCC,0xC6,0x47,
0x00,0x00,0x00,0x00,0x01,0x94,0xFF,0x4C,0x00,0x00,0x4D,0xCB,0xC4,0x45,0x00,0x50,
0xCE,0xC4,0x45,0x00,0x00,0x00,0xB9,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x60,0xC7,0xEF,0xF1,0xC0,0x39,0x00,0x5E,0x5C,0x1F,0x14,0x7B,0xF1,0x0D,0x00,0x00,
0x00,0x00,0x02,0xFC,0x32,0x00,0x00,0x00,0x00,0x58,0xEB,0x0A,0x00,0x00,0x01,0x79,
0xE7,0x39,0x00,0x00,0x00,0x78,0xD3,0x1E,0x00,0x00,0x00,0x00,0xCB,0x5A,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xC3,0x64,0x00,0x00,0x00,0x00,
0x04,0xDB,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x76,0xD9,0xE4,0xD4,0x56,0x00,
0x00,0x00,0x90,0xAA,0x14,0x00,0x24,0xD2,0x50,0x00,0x2B,0xE0,0x05,0x00,0x00,0x00,
0x3B,0xD2,0x00,0x82,0x7D,0x1C,0xBD,0xE7,0xE4,0x29,0xE4,0x13,0xB2,0x4D,0xA9,0x82,
0x00,0xE6,0x28,0xC7,0x2A,0xC3,0x33,0xE1,0x34,0x02,0xFA,0x1A,0xC9,0x1F,0xBC,0x43,
0xCE,0x53,0x3A,0xF9,0x29,0xDB,0x03,0x97,0x6A,0x4B,0xE5,0xC9,0x56,0xE7,0x6B,0x00,
0x48,0xD4,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB1,0x9E,0x13,0x00,0x05,0x46,
0x00,0x00,0x00,0x07,0x83,0xDB,0xE4,0xE0,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0xA2,
0xF8,0x0D,0x00,0x00,0x00,0x00,0x00,0x06,0xF0,0xD4,0x5A,0x00,0x00,0x00,0x00,0x00,
0x4C,0xDF,0x79,0xAF,0x00,0x00,0x00,0x00,0x00,0xA1,0x98,0x34,0xF7,0x0C,0x00,0x00,
0x00,0x06,0xEF,0x50,0x01,0xE9,0x59,0x00,0x00,0x00,0x4A,0xFA,0x0D,0x00,0xA1,0xAE,
0x00,0x00,0x00,0x9F,0xFF,0xFF,0xFF,0xFF,0xF6,0x0B,0x00,0x05,0xEE,0x71,0x20,0x20,
0x25,0xF4,0x57,0x00,0x49,0xF9,0x11,0x00,0x00,0x00,0xA8,0xAC,0x00,0x9E,0xB3,0x00,
0x00,0x00,0x00,0x50,0xF6,0x0B,0x00,0x00,0x14,0xFF,0xFF,0xFF,0xF8,0xD8,0x75,0x00,
0x14,0xFF,0x47,0x18,0x22,0x68,0xFD,0x4A,0x14,0xFF,0x34,0x00,0x00,0x00,0xDC,0x73,
0x14,0xFF,0x34,0x00,0x08,0x4E,0xF0,0x2A,0x14,0xFF,0xFF,0xFF,0xFF,0xE3,0x43,0x00,
0x14,0xFF,0x47,0x18,0x21,0x62,0xF2,0x45,0x14,0xFF,0x34,0x00,0x00,0x00,0xA8,0xB0,
0x14,0xFF,0x34,0x00,0x00,0x00,0xAD,0xAC,0x14,0xFF,0x47,0x18,0x20,0x62,0xFB,0x5A,
0x14,0xFF,0xFF,0xFF,0xFB,0xDA,0x6D,0x00,0x00,0x00,0x1B,0x9C,0xE6,0xF9,0xE2,0x97,
0x01,0x00,0x1A,0xE5,0xC9,0x47,0x27,0x4B,0x67,0x00,0x00,0xA0,0xE5,0x0B,0x00,0x00,
0x00,0x00,0x00,0x02,0xF1,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0x4D,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0xFF,0x4B,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF5,
0x6F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAF,0xD7,0x03,0x00,0x00,0x00,0x00,0x00,
0x00,0x2B,0xF3,0xC3,0x4B,0x28,0x3F,0x4C,0x00,0x00,0x00,0x2F,0xB2,0xF0,0xFA,0xE3,
0x79,0x00,0x00,0x00,0x14,0xFF,0xFF,0xFA,0xD9,0x81,0x08,0x00,0x14,0xFF,0x47,0x28,
0x5C,0xE3,0xBE,0x03,0x14,0xFF,0x34,0x00,0x00,0x22,0xFA,0x61,0x14,0xFF,0x34,0x00,
0x00,0x00,0xB2,0xB0,0x14,0xFF,0x34,0x00,0x00,0x00,0x8E,0xD0,0x14,0xFF,0x34,0x00,
0x00,0x00,0x93,0xCD,0x14,0xFF,0x34,0x00,0x00,0x00,0xBA,0xAA,0x14,0xFF,0x34,0x00,
0x00,0x31,0xFD,0x58,0x14,0xFF,0x47,0x31,0x6C,0xEE,0xB4,0x02,0x14,0xFF,0xFF,0xF6,
0xD0,0x74,0x04,0x00,0x84,0xFF,0xFF,0xFF,0xFF,0xFF,0x3C,0x84,0xC8,0x20,0x20,0x20,
0x20,0x07,0x84,0xC0,0x00,0x00,0x00,0x00,0x00,0x84,0xC0,0x00,0x00,0x00,0x00,0x00,
0x84,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x84,0xC8,0x20,0x20,0x20,0x1F,0x00,0x84,0xC0,
0x00,0x00,0x00,0x00,0x00,0x84,0xC0,0x00,0x00,0x00,0x00,0x00,0x84,0xC8,0x20,0x20,
0x20,0x20,0x07,0x84,0xFF,0xFF,0xFF,0xFF,0xFF,0x3C,0x00,0x00,0x54,0xFF,0xFF,0xFF,
0xFF,0xFF,0x6C,0x54,0xF2,0x20,0x20,0x20,0x20,0x0D,0x54,0xF0,0x00,0x00,0x00,0x00,
0x00,0x54,0xF0,0x00,0x00,0x00,0x00,0x00,0x54,0xFF,0xFF,0xFF,0xFF,0xFF,0x28,0x54,
0xF2,0x20,0x20,0x20,0x20,0x05,0x54,0xF0,0x00,0x00,0x00,0x00,0x00,0x54,0xF0,0x00,
0x00,0x00,0x00,0x00,0x54,0xF0,0x00,0x00,0x00,0x00,0x00,0x54,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x39,0xBE,0xF5,0xEF,0xBA,0x1D,0x00,0x38,0xF8,0x94,
0x2E,0x38,0x84,0x05,0x00,0xC2,0xB9,0x00,0x00,0x00,0x00,0x00,0x0F,0xFE,0x55,0x00,
0x00,0x00,0x00,0x00,0x2C,0xFF,0x32,0x00,0x68,0xFF,0xFF,0x7C,0x2D,0xFF,0x30,0x00,
0x0D,0x20,0xCF,0x7C,0x11,0xFF,0x4D,0x00,0x00,0x00,0xC8,0x7C,0x00,0xCD,0xA5,0x00,
0x00,0x00,0xC8,0x7C,0x00,0x4B,0xFD,0x8A,0x33,0x3C,0xDB,0x7C,0x00,0x00,0x54,0xD3,
0xF9,0xEB,0xBC,0x3F,0x14,0xFF,0x34,0x00,0x00,0x00,0xCC,0x7C,0x14,0xFF,0x34,0x00,
0x00,0x00,0xCC,0x7C,0x14,0xFF,0x34,0x00,0x00,0x00,0xCC,0x7C,0x14,0xFF,0x34,0x00,
0x00,0x00,0xCC,0x7C,0x14,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7C,0x14,0xFF,0x4D,0x20,
0x20,0x20,0xD2,0x7C,0x14,0xFF,0x34,0x00,0x00,0x00,0xCC,0x7C,0x14,0xFF,0x34,0x00,
0x00,0x00,0xCC,0x7C,0x14,0xFF,0x34,0x00,0x00,0x00,0xCC,0x7C,0x14,0xFF,0x34,0x00,
0x00,0x00,0xCC,0x7C,0x72,0xFE,0xFF,0xFF,0xFF,0xD1,0x00,0x04,0x7A,0xD7,0x0B,0x00,
0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x70,0xD4,
0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,
0x70,0xD4,0x00,0x00,0x00,0x03,0x7A,0xD7,0x0A,0x00,0x72,0xFE,0xFF,0xFF,0xFF,0xD1,
0x00,0x00,0x00,0x00,0x00,0x94,0xB0,0x00,0x00,0x00,0x00,0x00,0x94,0xB0,0x00,0x00,
0x00,0x00,0x00,0x94,0xB0,0x00,0x00,0x00,0x00,0x00,0x94,0xB0,0x00,0x00,0x00,0x00,
0x00,0x94,0xB0,0x00,0x00,0x00,0x00,0x00,0x94,0xB0,0x00,0x00,0x00,0x00,0x00,0x94,
0xAF,0x00,0x00,0x00,0x00,0x00,0xBA,0x8F,0x08,0x61,0x2E,0x2F,0x86,0xF9,0x32,0x09,
0xC7,0xF3,0xF2,0xC4,0x42,0x00,0x00,0x00,0x90,0xB8,0x00,0x00,0x02,0xBB,0xA6,0x00,
0x90,0xB8,0x00,0x00,0x82,0xCC,0x09,0x00,0x90,0xB8,0x00,0x47,0xE6,0x1C,0x00,0x00,
0x90,0xB8,0x1D,0xE5,0x3A,0x00,0x00,0x00,0x90,0xBA,0xC1,0xAF,0x00,0x00,0x00,0x00,
0x90,0xF2,0x7D,0xF8,0x3F,0x00,0x00,0x00,0x90,0xB8,0x00,0x81,0xDB,0x09,0x00,0x00,
0x90,0xB8,0x00,0x06,0xD5,0x8D,0x00,0x00,0x90,0xB8,0x00,0x00,0x39,0xFA,0x37,0x00,
0x90,0xB8,0x00,0x00,0x00,0x92,0xD5,0x06,0x68,0xE0,0x00,0x00,0x00,0x00,0x00,0x68,
0xE0,0x00,0x00,0x00,0x00,0x00,0x68,0xE0,0x00,0x00,0x00,0x00,0x00,0x68,0xE0,0x00,
0x00,0x00,0x00,0x00,0x68,0xE0,0x00,0x00,0x00,0x00,0x00,0x68,0xE0,0x00,0x00,0x00,
0x00,0x00,0x68,0xE0,0x00,0x00,0x00,0x00,0x00,0x68,0xE0,0x00,0x00,0x00,0x00,0x00,
0x68,0xE4,0x20,0x20,0x20,0x20,0x07,0x68,0xFF,0xFF,0xFF,0xFF,0xFF,0x38,0x00,0x00,
0x3C,0xFF,0x8F,0x00,0x00,0x34,0xFF,0xA0,0x3C,0xEB,0xC6,0x00,0x00,0x6C,0xEB,0xA0,
0x3C,0xC9,0xF0,0x05,0x00,0xA3,0xBB,0xA0,0x3C,0xCC,0xC7,0x34,0x00,0xDB,0x8A,0xA0,
0x3C,0xCF,0x8F,0x6B,0x13,0xE6,0x6C,0xA0,0x3C,0xD0,0x57,0xA2,0x4A,0xAF,0x6C,0xA0,
0x3C,0xD0,0x20,0xDA,0x82,0x76,0x6C,0xA0,0x3C,0xD0,0x00,0xE7,0xCC,0x3D,0x6C,0xA0,
0x3C,0xD0,0x00,0xB0,0xFA,0x09,0x6C,0xA0,0x3C,0xD0,0x00,0x78,0xCC,0x00,0x6C,0xA0,
0x14,0xFF,0x9B,0x00,0x00,0x00,0xB8,0x78,0x14,0xFD,0xE5,0x19,0x00,0x00,0xB8,0x78,
0x14,0xFF,0x85,0x89,0x00,0x00,0xB8,0x78,0x14,0xFF,0x25,0xE6,0x0F,0x00,0xB8,0x78,
0x14,0xFF,0x17,0x90,0x78,0x00,0xB8,0x78,0x14,0xFF,0x18,0x1E,0xE2,0x07,0xB8,0x78,
0x14,0xFF,0x18,0x00,0xA2,0x66,0xB3,0x78,0x14,0xFF,0x18,0x00,0x2B,0xD9,0xAD,0x78,
0x14,0xFF,0x18,0x00,0x00,0xB3,0xED,0x78,0x14,0xFF,0x18,0x00,0x00,0x3C,0xFF,0x78,
0x00,0x0A,0x95,0xEA,0xF7,0xC2,0x30,0x00,0x00,0xA4,0xEA,0x52,0x33,0xA3,0xEC,0x14,
0x19,0xFE,0x5B,0x00,0x00,0x02,0xDE,0x7B,0x4F,0xFF,0x0F,0x00,0x00,0x00,0x9D,0xB7,
0x66,0xF6,0x00,0x00,0x00,0x00,0x84,0xD1,0x66,0xF6,0x00,0x00,0x00,0x00,0x84,0xD0,
0x4F,0xFF,0x0E,0x00,0x00,0x00,0x9E,0xB6,0x18,0xFE,0x5A,0x00,0x00,0x03,0xDF,0x78,
0x00,0xA4,0xE9,0x50,0x33,0xA5,0xEA,0x13,0x00,0x0A,0x96,0xEB,0xF8,0xC0,0x2E,0x00,
0xCC,0xFF,0xFF,0xEF,0xC4,0x47,0x00,0xCC,0x84,0x18,0x2D,0x99,0xF8,0x26,0xCC,0x78,
0x00,0x00,0x01,0xED,0x68,0xCC,0x78,0x00,0x00,0x00,0xED,0x61,0xCC,0x78,0x01,0x18,
0x8A,0xF1,0x1C,0xCC,0xFF,0xFF,0xFC,0xCA,0x3E,0x00,0xCC,0x84,0x17,0x04,0x00,0x00,
0x00,0xCC,0x78,0x00,0x00,0x00,0x00,0x00,0xCC,0x78,0x00,0x00,0x00,0x00,0x00,0xCC,
0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x95,0xEA,0xF7,0xC2,0x30,0x00,
0x00,0xA4,0xEA,0x52,0x33,0xA3,0xEC,0x14,0x19,0xFE,0x5B,0x00,0x00,0x02,0xDE,0x7B,
0x4F,0xFF,0x0F,0x00,0x00,0x00,0x9D,0xB8,0x66,0xF6,0x00,0x00,0x00,0x00,0x84,0xD1,
0x66,0xF6,0x00,0x00,0x00,0x00,0x84,0xCD,0x4F,0xFF,0x0E,0x00,0x00,0x00,0x9E,0xB5,
0x18,0xFE,0x5A,0x00,0x00,0x03,0xDF,0x75,0x00,0xA4,0xE9,0x50,0x33,0xA5,0xE9,0x11,
0x00,0x0A,0x96,0xEB,0xFC,0xFC,0x2B,0x00,0x00,0x00,0x00,0x00,0x0E,0xEB,0x71,0x00,
0x00,0x00,0x00,0x00,0x00,0x68,0xFB,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x5B,
0xBC,0xFF,0xFE,0xE7,0xAE,0x28,0x00,0xBC,0x96,0x19,0x34,0xB4,0xDE,0x06,0xBC,0x8C,
0x00,0x00,0x21,0xFF,0x2F,0xBC,0x8C,0x00,0x00,0x20,0xFF,0x30,0xBC,0x8C,0x01,0x1D,
0xA8,0xD0,0x02,0xBC,0xFF,0xFF,0xFF,0xB4,0x17,0x00,0xBC,0x96,0x18,0xA6,0xC5,0x01,
0x00,0xBC,0x8C,0x00,0x17,0xEF,0x6A,0x00,0xBC,0x8C,0x00,0x00,0x69,0xF1,0x1A,0xBC,
0x8C,0x00,0x00,0x02,0xC9,0xAE,0x00,0x00,0x00,0x0F,0x98,0xE4,0xF9,0xE5,0xAD,0x10,
0x00,0xA4,0xC7,0x3D,0x28,0x48,0x80,0x00,0x00,0xDC,0x60,0x00,0x00,0x00,0x00,0x00,
0x00,0xAD,0xBC,0x10,0x00,0x00,0x00,0x00,0x00,0x1C,0xC8,0xF1,0x98,0x31,0x00,0x00,
0x00,0x00,0x00,0x44,0xAB,0xFB,0x9D,0x01,0x00,0x00,0x00,0x00,0x00,0x32,0xF8,0x48,
0x00,0x00,0x00,0x00,0x00,0x00,0xDF,0x5F,0x05,0x82,0x3E,0x20,0x29,0x83,0xF3,0x1F,
0x04,0xB0,0xE7,0xF9,0xEB,0xB9,0x39,0x00,0x4C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB0,
0x09,0x20,0x20,0x82,0xD9,0x20,0x20,0x16,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,
0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,
0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,
0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,
0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x23,0xFC,0x1F,0x00,0x00,0x00,0xB8,0x8C,
0x24,0xFF,0x20,0x00,0x00,0x00,0xB8,0x8C,0x24,0xFF,0x20,0x00,0x00,0x00,0xB8,0x8C,
0x24,0xFF,0x20,0x00,0x00,0x00,0xB8,0x8C,0x24,0xFF,0x20,0x00,0x00,0x00,0xB8,0x8C,
0x24,0xFF,0x20,0x00,0x00,0x00,0xB8,0x8C,0x1D,0xFF,0x27,0x00,0x00,0x00,0xC0,0x85,
0x03,0xFB,0x53,0x00,0x00,0x05,0xE9,0x64,0x00,0xA4,0xDC,0x47,0x2E,0x9A,0xEF,0x13,
0x00,0x10,0x9C,0xE6,0xF1,0xC1,0x35,0x00,0x9D,0xB7,0x00,0x00,0x00,0x00,0x57,0xF5,
0x0B,0x48,0xF9,0x0D,0x00,0x00,0x00,0xA6,0xAB,0x00,0x04,0xED,0x55,0x00,0x00,0x04,
0xEF,0x55,0x00,0x00,0x9D,0xA4,0x00,0x00,0x43,0xF5,0x0A,0x00,0x00,0x47,0xEE,0x04,
0x00,0x91,0xAA,0x00,0x00,0x00,0x04,0xEC,0x42,0x00,0xDF,0x55,0x00,0x00,0x00,0x00,
0x9C,0x90,0x2D,0xF4,0x0A,0x00,0x00,0x00,0x00,0x46,0xD9,0x77,0xA9,0x00,0x00,0x00,
0x00,0x00,0x04,0xEC,0xD1,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0xF4,0x09,0x00,
0x00,0x00,0x00,0x00,0xEA,0x3D,0x00,0x00,0x00,0x00,0x00,0xD6,0x53,0xC7,0x5F,0x00,
0x00,0x00,0x00,0x00,0xF1,0x32,0xA3,0x81,0x00,0x00,0x00,0x00,0x0C,0xFF,0x11,0x80,
0xA4,0x00,0x86,0xE3,0x03,0x28,0xF0,0x00,0x5C,0xC5,0x00,0xC7,0x9D,0x38,0x43,0xD0,
0x00,0x38,0xE1,0x11,0xCA,0x5A,0x7D,0x60,0xAF,0x00,0x15,0xF9,0x53,0x8E,0x1A,0xC2,
0x7B,0x8E,0x00,0x00,0xF1,0xA2,0x50,0x00,0xD2,0xA1,0x6D,0x00,0x00,0xCE,0xEA,0x13,
0x00,0x94,0xEB,0x4C,0x00,0x00,0xAA,0xD3,0x00,0x00,0x51,0xFF,0x2C,0x00,0x00,0x00,
0x26,0xF8,0x3C,0x00,0x00,0x02,0xCD,0x7A,0x00,0x00,0x86,0xCF,0x03,0x00,0x69,0xD8,
0x06,0x00,0x00,0x0A,0xE1,0x6A,0x13,0xED,0x43,0x00,0x00,0x00,0x00,0x52,0xED,0xA9,
0xA7,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xFC,0x1B,0x00,0x00,0x00,0x00,0x00,0x0F,
0xE9,0xEF,0x5C,0x00,0x00,0x00,0x00,0x00,0x91,0xAB,0x60,0xE6,0x0D,0x00,0x00,0x00,
0x2D,0xF3,0x20,0x02,0xCF,0x8C,0x00,0x00,0x00,0xC0,0x84,0x00,0x00,0x42,0xFA,0x29,
0x00,0x58,0xE5,0x0B,0x00,0x00,0x00,0xB3,0xBB,0x00,0x00,0x00,0x81,0xDA,0x04,0x00,
0x00,0x00,0x7B,0xDB,0x05,0x0B,0xE6,0x63,0x00,0x00,0x11,0xF0,0x53,0x00,0x00,0x63,
0xE1,0x06,0x00,0x88,0xC4,0x00,0x00,0x00,0x02,0xD2,0x6D,0x18,0xF4,0x38,0x00,0x00,
0x00,0x00,0x46,0xE8,0x9E,0xA9,0x00,0x00,0x00,0x00,0x00,0x00,0xB7,0xF9,0x21,0x00,
0x00,0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xD4,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x70,0xD4,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8B,
0x05,0x20,0x20,0x20,0x20,0x4A,0xF8,0x35,0x00,0x00,0x00,0x00,0x05,0xCC,0x81,0x00,
0x00,0x00,0x00,0x00,0x81,0xCC,0x04,0x00,0x00,0x00,0x00,0x35,0xF3,0x29,0x00,0x00,
0x00,0x00,0x08,0xD7,0x71,0x00,0x00,0x00,0x00,0x00,0x90,0xBF,0x01,0x00,0x00,0x00,
0x00,0x40,0xF0,0x1F,0x00,0x00,0x00,0x00,0x0E,0xE0,0x7E,0x20,0x20,0x20,0x20,0x16,
0x4B,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB0,0x30,0xFF,0xFF,0xFF,0x6C,0x30,0xFF,0x17,
0x08,0x03,0x30,0xFF,0x10,0x00,0x00,0x30,0xFF,0x10,0x00,0x00,0x30,0xFF,0x10,0x00,
0x00,0x30,0xFF,0x10,0x00,0x00,0x30,0xFF,0x10,0x00,0x00,0x30,0xFF,0x10,0x00,0x00,
0x30,0xFF,0x10,0x00,0x00,0x30,0xFF,0x10,0x00,0x00,0x30,0xFF,0x17,0x08,0x03,0x30,
0xFF,0xFF,0xFF,0x6C,0x59,0xDC,0x02,0x00,0x00,0x00,0x05,0xE5,0x4D,0x00,0x00,0x00,
0x00,0x7D,0xBB,0x00,0x00,0x00,0x00,0x16,0xF7,0x29,0x00,0x00,0x00,0x00,0xA1,0x97,
0x00,0x00,0x00,0x00,0x33,0xF4,0x10,0x00,0x00,0x00,0x00,0xC5,0x73,0x00,0x00,0x00,
0x00,0x57,0xDE,0x02,0x00,0x00,0x00,0x04,0xE4,0x4F,0x00,0x00,0x00,0x00,0x7B,0xBD,
0x08,0xFF,0xFF,0xFF,0x94,0x00,0x08,0x08,0xAA,0x94,0x00,0x00,0x00,0xA8,0x94,0x00,
0x00,0x00,0xA8,0x94,0x00,0x00,0x00,0xA8,0x94,0x00,0x00,0x00,0xA8,0x94,0x00,0x00,
0x00,0xA8,0x94,0x00,0x00,0x00,0xA8,0x94,0x00,0x00,0x00,0xA8,0x94,0x00,0x00,0x00,
0xA8,0x94,0x00,0x08,0x08,0xAA,0x94,0x08,0xFF,0xFF,0xFF,0x94,0x00,0x00,0x00,0x96,
0xA2,0x00,0x00,0x00,0x00,0x00,0x19,0xDC,0xD7,0x30,0x00,0x00,0x00,0x00,0x8C,0x74,
0x56,0xBA,0x00,0x00,0x00,0x13,0xE4,0x0D,0x01,0xCC,0x46,0x00,0x00,0x83,0x88,0x00,
0x00,0x45,0xCF,0x02,0x0E,0xE8,0x19,0x00,0x00,0x00,0xBC,0x5E,0x1A,0xF4,0xF4,0xF4,
0xF4,0xF4,0xF4,0xF4,0xF4,0x7A,0x00,0x00,0x07,0xC9,0xA8,0x00,0x00,0x14,0xC6,0x4D,
0x00,0x37,0xB9,0xED,0xF2,0xC3,0x30,0x00,0x00,0x25,0x60,0x1D,0x16,0xA0,0xCC,0x00,
0x00,0x00,0x00,0x00,0x00,0x3A,0xFA,0x01,0x00,0x16,0x91,0xD3,0xE1,0xE4,0xFF,0x04,
0x00,0xC4,0xB5,0x1B,0x00,0x3A,0xFF,0x04,0x08,0xFE,0x44,0x00,0x00,0x60,0xFF,0x04,
0x00,0xE7,0x85,0x06,0x34,0xD9,0xFF,0x04,0x00,0x47,0xDA,0xF9,0xCD,0x3C,0xF9,0x04,
0xEC,0x54,0x00,0x00,0x00,0x00,0x00,0xEC,0x54,0x00,0x00,0x00,0x00,0x00,0xEC,0x53,
0x00,0x00,0x00,0x00,0x00,0xEC,0x79,0xCC,0xF9,0xCF,0x33,0x00,0xEC,0xE2,0x3A,0x18,
0x99,0xDF,0x04,0xEC,0x80,0x00,0x00,0x0E,0xF9,0x46,0xEC,0x5D,0x00,0x00,0x00,0xDF,
0x69,0xEC,0x5F,0x00,0x00,0x00,0xE0,0x68,0xEC,0x84,0x00,0x00,0x0F,0xFA,0x45,0xEC,
0xE5,0x3D,0x18,0x99,0xDE,0x03,0xEC,0x4A,0xCA,0xF9,0xCF,0x32,0x00,0x00,0x00,0x00,
0x00,0x40,0xC3,0xF6,0xF3,0xCB,0x16,0x24,0xF9,0x81,0x1E,0x19,0x53,0x00,0x97,0xC0,
0x00,0x00,0x00,0x00,0x00,0xC1,0x87,0x00,0x00,0x00,0x00,0x00,0xC3,0x86,0x00,0x00,
0x00,0x00,0x00,0x9A,0xBB,0x00,0x00,0x00,0x00,0x00,0x29,0xFA,0x7A,0x1A,0x17,0x4F,
0x0F,0x00,0x47,0xC9,0xF8,0xF3,0xC5,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x54,
0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x54,
0x00,0x06,0x9B,0xF3,0xE8,0x72,0xE3,0x54,0x00,0x7C,0xE1,0x32,0x1C,0xAB,0xFD,0x54,
0x00,0xDE,0x70,0x00,0x00,0x1E,0xFF,0x54,0x04,0xFC,0x47,0x00,0x00,0x00,0xF7,0x54,
0x04,0xFD,0x46,0x00,0x00,0x00,0xF2,0x54,0x00,0xDF,0x6F,0x00,0x00,0x17,0xFF,0x54,
0x00,0x7D,0xE0,0x32,0x1A,0xA1,0xFC,0x54,0x00,0x07,0x9E,0xF4,0xE8,0x6D,0xC5,0x54,
0x00,0x00,0x75,0xE2,0xF4,0xC2,0x33,0x00,0x00,0x63,0xD6,0x31,0x13,0x79,0xEC,0x14,
0x00,0xD9,0x59,0x00,0x00,0x00,0xED,0x5F,0x06,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0x7E,
0x08,0xFE,0x49,0x08,0x08,0x08,0x08,0x04,0x00,0xDA,0x78,0x00,0x00,0x00,0x00,0x00,
0x00,0x5D,0xED,0x4D,0x11,0x23,0x67,0x0B,0x00,0x00,0x67,0xD9,0xFA,0xE8,0xAC,0x09,
0x00,0x00,0x22,0xC0,0xF3,0xEA,0x68,0x00,0x00,0xA0,0xBD,0x16,0x1C,0x12,0x00,0x00,
0xC4,0x7D,0x00,0x00,0x00,0xCE,0xF4,0xFF,0xFD,0xFC,0xFC,0x23,0x00,0x00,0xC4,0x7C,
0x00,0x00,0x00,0x00,0x00,0xC4,0x7C,0x00,0x00,0x00,0x00,0x00,0xC4,0x7C,0x00,0x00,
0x00,0x00,0x00,0xC4,0x7C,0x00,0x00,0x00,0x00,0x00,0xC4,0x7C,0x00,0x00,0x00,0x00,
0x00,0xC4,0x7C,0x00,0x00,0x00,0x00,0x00,0xC4,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x08,0x99,0xE2,0xF4,0xFF,0xF1,0x92,0x00,0x79,0xCC,0x0B,0x06,0xB9,0x96,0x00,
0x00,0xAE,0x8C,0x00,0x00,0x75,0xC2,0x00,0x00,0x87,0xC5,0x07,0x03,0xB2,0x93,0x00,
0x00,0x0D,0xC9,0xED,0xDD,0xA8,0x10,0x00,0x00,0x2D,0xE5,0x13,0x00,0x00,0x00,0x00,
0x00,0x23,0xEF,0xFF,0xFF,0xF3,0xAD,0x0C,0x0D,0xE4,0x57,0x0B,0x08,0x1D,0xCB,0x78,
0x41,0xEA,0x00,0x00,0x00,0x00,0xA5,0x8A,0x1D,0xF9,0x4D,0x04,0x0E,0x5A,0xF4,0x41,
0x00,0x55,0xD2,0xF6,0xED,0xC5,0x52,0x00,0xE8,0x58,0x00,0x00,0x00,0x00,0x00,0xE8,
0x58,0x00,0x00,0x00,0x00,0x00,0xE8,0x58,0x00,0x00,0x00,0x00,0x00,0xE8,0x79,0xC5,
0xF8,0xDC,0x56,0x00,0xE8,0xED,0x4C,0x13,0x76,0xF6,0x15,0xE8,0x8E,0x00,0x00,0x02,
0xFA,0x42,0xE8,0x62,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,
0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,
0x00,0x00,0x00,0xF0,0x50,0x00,0x00,0x00,0x00,0x00,0x3F,0xD6,0x01,0x00,0x00,0x00,
0x00,0x3F,0xD1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0xE5,0xF8,
0xF0,0x00,0x00,0x00,0x00,0x00,0x4C,0xF0,0x00,0x00,0x00,0x00,0x00,0x4C,0xF0,0x00,
0x00,0x00,0x00,0x00,0x4C,0xF0,0x00,0x00,0x00,0x00,0x00,0x4C,0xF0,0x00,0x00,0x00,
0x00,0x00,0x4C,0xF0,0x00,0x00,0x00,0x00,0x00,0x4C,0xF0,0x00,0x00,0x00,0x91,0xE9,
0xF9,0xFF,0xF3,0xE4,0x4B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xA0,0x00,0x00,
0x00,0x00,0x76,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3D,0xE2,0xEF,0xFB,0xD8,
0x00,0x00,0x00,0x00,0x68,0xD8,0x00,0x00,0x00,0x00,0x68,0xD8,0x00,0x00,0x00,0x00,
0x68,0xD8,0x00,0x00,0x00,0x00,0x68,0xD8,0x00,0x00,0x00,0x00,0x68,0xD8,0x00,0x00,
0x00,0x00,0x68,0xD8,0x00,0x00,0x00,0x00,0x68,0xD8,0x00,0x00,0x00,0x00,0x6E,0xCF,
0x05,0x34,0x14,0x25,0xCC,0x95,0x0F,0xE0,0xFA,0xEB,0xA1,0x0F,0x88,0xB4,0x00,0x00,
0x00,0x00,0x00,0x88,0xB4,0x00,0x00,0x00,0x00,0x00,0x88,0xB4,0x00,0x00,0x00,0x00,
0x00,0x88,0xB4,0x00,0x00,0x43,0xF3,0x4E,0x88,0xB3,0x00,0x39,0xF0,0x55,0x00,0x88,
0xAC,0x2E,0xEC,0x5C,0x00,0x00,0x88,0xB7,0xE3,0x98,0x00,0x00,0x00,0x88,0xF2,0x8E,
0xF4,0x31,0x00,0x00,0x88,0xB4,0x00,0x7E,0xE0,0x14,0x00,0x88,0xB4,0x00,0x01,0xB0,
0xBC,0x03,0x88,0xB4,0x00,0x00,0x0E,0xD8,0x8D,0x00,0x00,0x00,0x28,0xE6,0xF9,0xE4,
0x00,0x00,0x00,0x00,0x00,0x5C,0xE4,0x00,0x00,0x00,0x00,0x00,0x5C,0xE4,0x00,0x00,
0x00,0x00,0x00,0x5C,0xE4,0x00,0x00,0x00,0x00,0x00,0x5C,0xE4,0x00,0x00,0x00,0x00,
0x00,0x5C,0xE4,0x00,0x00,0x00,0x00,0x00,0x5C,0xE4,0x00,0x00,0x00,0x00,0x00,0x5C,
0xE4,0x00,0x00,0x00,0x00,0x00,0x5C,0xE4,0x00,0x00,0x00,0x00,0x00,0x5C,0xE4,0x00,
0x00,0x00,0x9E,0xEA,0xFA,0xFF,0xF2,0xE3,0x40,0x00,0x00,0x00,0x60,0x99,0xC0,0xE8,
0x3D,0xC7,0xE7,0x35,0x60,0xF1,0x2E,0xA2,0xF0,0x39,0x92,0xA2,0x60,0xCD,0x00,0x5F,
0xD8,0x00,0x59,0xC0,0x60,0xBE,0x00,0x58,0xC6,0x00,0x54,0xC8,0x60,0xBC,0x00,0x58,
0xC4,0x00,0x54,0xC8,0x60,0xBC,0x00,0x58,0xC4,0x00,0x54,0xC8,0x60,0xBC,0x00,0x58,
0xC4,0x00,0x54,0xC8,0x60,0xBC,0x00,0x58,0xC4,0x00,0x54,0xC8,0xE8,0x55,0xC5,0xF8,
0xDC,0x56,0x00,0xE8,0xED,0x4C,0x13,0x76,0xF6,0x15,0xE8,0x8E,0x00,0x00,0x02,0xFA,
0x42,0xE8,0x62,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,0xE8,
0x58,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,0x00,
0x00,0x00,0xF0,0x50,0x00,0x05,0x8B,0xE8,0xF7,0xB8,0x23,0x00,0x00,0x87,0xD5,0x31,
0x1A,0x8F,0xDB,0x06,0x06,0xF6,0x4E,0x00,0x00,0x04,0xE7,0x5D,0x26,0xFF,0x20,0x00,
0x00,0x00,0xBC,0x89,0x25,0xFF,0x21,0x00,0x00,0x00,0xBE,0x89,0x04,0xF3,0x50,0x00,
0x00,0x04,0xE7,0x5E,0x00,0x7D,0xD6,0x31,0x18,0x8E,0xDF,0x07,0x00,0x03,0x86,0xE9,
0xF7,0xBB,0x27,0x00,0xEC,0x53,0xC9,0xF8,0xCF,0x33,0x00,0xEC,0xE0,0x39,0x18,0x99,
0xDF,0x04,0xEC,0x7E,0x00,0x00,0x0E,0xF9,0x46,0xEC,0x5A,0x00,0x00,0x00,0xDF,0x69,
0xEC,0x5F,0x00,0x00,0x00,0xE0,0x68,0xEC,0x84,0x00,0x00,0x0F,0xFA,0x45,0xEC,0xE6,
0x3D,0x18,0x99,0xDE,0x03,0xEC,0x7A,0xCA,0xF9,0xCF,0x32,0x00,0xEC,0x54,0x00,0x00,
0x00,0x00,0x00,0xEC,0x54,0x00,0x00,0x00,0x00,0x00,0xEC,0x54,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x07,0x9C,0xF4,0xE7,0x6C,0xC5,0x54,0x00,0x7C,0xE1,0x32,
0x1C,0xAA,0xFC,0x54,0x00,0xDE,0x70,0x00,0x00,0x1E,0xFF,0x54,0x04,0xFC,0x47,0x00,
0x00,0x00,0xF7,0x54,0x04,0xFD,0x46,0x00,0x00,0x00,0xF2,0x54,0x00,0xDF,0x6F,0x00,
0x00,0x17,0xFF,0x54,0x00,0x7D,0xE0,0x32,0x1A,0xA1,0xFB,0x54,0x00,0x07,0x9E,0xF4,
0xE8,0x6D,0xE5,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x54,0x00,0x00,0x00,0x00,
0x00,0x00,0xEC,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x54,0x30,0xDC,0x26,0xC4,
0xF8,0xE1,0x19,0x30,0xF7,0xB2,0x38,0x12,0x44,0x00,0x30,0xFF,0x42,0x00,0x00,0x00,
0x00,0x30,0xFF,0x13,0x00,0x00,0x00,0x00,0x30,0xFF,0x0C,0x00,0x00,0x00,0x00,0x30,
0xFF,0x0C,0x00,0x00,0x00,0x00,0x30,0xFF,0x0C,0x00,0x00,0x00,0x00,0x30,0xFF,0x0C,
0x00,0x00,0x00,0x00,0x02,0x88,0xE5,0xF8,0xE1,0x84,0x00,0x5D,0xDD,0x26,0x10,0x38,
0x44,0x00,0x68,0xDD,0x1A,0x00,0x00,0x00,0x00,0x0B,0xB2,0xF8,0xA7,0x35,0x00,0x00,
0x00,0x00,0x33,0x9E,0xFA,0x79,0x00,0x00,0x00,0x00,0x00,0x58,0xF5,0x00,0x4E,0x3F,
0x14,0x16,0x91,0xD3,0x00,0x62,0xDB,0xF6,0xF0,0xBA,0x2B,0x00,0x00,0x00,0x00,0x02,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD7,0x04,0x00,0x00,0x00,0x00,0x00,0x1B,0xFF,
0x04,0x00,0x00,0x00,0x08,0xCD,0xF6,0xFF,0xFC,0xFC,0xFC,0x03,0x00,0x00,0x38,0xFF,
0x04,0x00,0x00,0x00,0x00,0x00,0x38,0xFF,0x04,0x00,0x00,0x00,0x00,0x00,0x38,0xFF,
0x04,0x00,0x00,0x00,0x00,0x00,0x38,0xFF,0x04,0x00,0x00,0x00,0x00,0x00,0x34,0xFF,
0x07,0x00,0x00,0x00,0x00,0x00,0x12,0xFA,0x5E,0x0C,0x1C,0x00,0x00,0x00,0x00,0x63,
0xE3,0xF5,0xD1,0x00,0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,0x00,0x00,0x00,
0xF0,0x50,0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,0xE8,0x58,0x00,0x00,0x00,0xF0,0x50,
0xE8,0x58,0x00,0x00,0x00,0xF9,0x50,0xDB,0x64,0x00,0x00,0x21,0xFF,0x50,0xA5,0xC8,
0x1F,0x20,0xB1,0xFB,0x50,0x1B,0xB8,0xF3,0xE6,0x6D,0xC5,0x50,0x42,0xF6,0x0B,0x00,
0x00,0x00,0xA2,0xA6,0x02,0xE5,0x57,0x00,0x00,0x06,0xF0,0x4B,0x00,0x8C,0xAD,0x00,
0x00,0x4C,0xEB,0x04,0x00,0x31,0xF6,0x0B,0x00,0xA0,0x95,0x00,0x00,0x00,0xD6,0x57,
0x05,0xEF,0x3A,0x00,0x00,0x00,0x7B,0xAA,0x44,0xDE,0x00,0x00,0x00,0x00,0x21,0xF1,
0x93,0x84,0x00,0x00,0x00,0x00,0x00,0xC5,0xF3,0x29,0x00,0x00,0x00,0xEE,0x28,0x00,
0x8A,0xEF,0x02,0x00,0xBD,0x53,0x00,0xBE,0x50,0x00,0xBB,0xB3,0x28,0x00,0xE8,0x22,
0x00,0x8D,0x79,0x01,0xCC,0x7B,0x59,0x12,0xF0,0x01,0x00,0x5C,0xA1,0x24,0xB0,0x4B,
0x8A,0x3D,0xC0,0x00,0x00,0x2B,0xC8,0x56,0x7D,0x1B,0xBA,0x66,0x8F,0x00,0x00,0x03,
0xDF,0x82,0x4A,0x00,0xCE,0x8A,0x5E,0x00,0x00,0x00,0xC8,0xB7,0x17,0x00,0xB8,0xB9,
0x2D,0x00,0x00,0x00,0x98,0xDD,0x00,0x00,0x88,0xF0,0x04,0x00,0x07,0xD4,0x8D,0x00,
0x00,0x2C,0xF7,0x44,0x00,0x31,0xF7,0x39,0x03,0xCB,0x91,0x00,0x00,0x00,0x7A,0xD8,
0x82,0xD6,0x08,0x00,0x00,0x00,0x03,0xC8,0xFC,0x32,0x00,0x00,0x00,0x00,0x0E,0xE1,
0xFA,0x52,0x00,0x00,0x00,0x00,0xA0,0xBF,0x5B,0xEA,0x16,0x00,0x00,0x50,0xF3,0x21,
0x00,0xB0,0xB0,0x00,0x16,0xEA,0x69,0x00,0x00,0x18,0xED,0x60,0x3E,0xF7,0x0F,0x00,
0x00,0x00,0xA3,0xA3,0x00,0xD9,0x65,0x00,0x00,0x07,0xF1,0x42,0x00,0x76,0xC3,0x00,
0x00,0x4D,0xDF,0x01,0x00,0x17,0xF9,0x21,0x00,0xA3,0x80,0x00,0x00,0x00,0xAE,0x7F,
0x07,0xEF,0x21,0x00,0x00,0x00,0x4A,0xD7,0x4A,0xBE,0x00,0x00,0x00,0x00,0x02,0xE3,
0xB3,0x5D,0x00,0x00,0x00,0x00,0x00,0x82,0xF1,0x0A,0x00,0x00,0x00,0x00,0x00,0x88,
0x99,0x00,0x00,0x00,0x07,0x0D,0x42,0xEF,0x27,0x00,0x00,0x00,0x48,0xF7,0xE3,0x5A,
0x00,0x00,0x00,0x00,0x85,0xFC,0xFC,0xFC,0xFD,0xFF,0x04,0x00,0x00,0x00,0x00,0xA1,
0xAA,0x00,0x00,0x00,0x00,0x5E,0xDE,0x0F,0x00,0x00,0x00,0x26,0xEE,0x36,0x00,0x00,
0x00,0x07,0xCF,0x73,0x00,0x00,0x00,0x00,0x94,0xB5,0x01,0x00,0x00,0x00,0x51,0xE4,
0x14,0x00,0x00,0x00,0x00,0xBF,0xFE,0xFC,0xFC,0xFC,0xFC,0x23,0x00,0x00,0x00,0x64,
0xD5,0xCF,0x00,0x00,0x15,0xFF,0x60,0x0D,0x00,0x00,0x28,0xFF,0x18,0x00,0x00,0x00,
0x28,0xFF,0x17,0x00,0x01,0x17,0x8D,0xED,0x05,0x00,0x78,0xFF,0xE1,0x33,0x00,0x00,
0x06,0x24,0xA3,0xD7,0x01,0x00,0x00,0x00,0x2D,0xFF,0x15,0x00,0x00,0x00,0x28,0xFF,
0x18,0x00,0x00,0x00,0x27,0xFF,0x18,0x00,0x00,0x00,0x0A,0xF8,0x6D,0x0F,0x00,0x00,
0x00,0x4C,0xCD,0xCD,0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,
0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,0x50,0xB4,
0x71,0xE7,0xA0,0x0E,0x00,0x00,0x05,0x27,0xDE,0x78,0x00,0x00,0x00,0x00,0xB4,0x8C,
0x00,0x00,0x00,0x00,0xB4,0x8C,0x00,0x00,0x00,0x00,0x8F,0xD5,0x2E,0x06,0x00,0x00,
0x06,0xA8,0xFF,0xDC,0x00,0x00,0x74,0xE3,0x3F,0x0F,0x00,0x00,0xB1,0x90,0x00,0x00,
0x00,0x00,0xB4,0x8C,0x00,0x00,0x00,0x00,0xB4,0x8B,0x00,0x00,0x05,0x2C,0xE6,0x66,
0x00,0x00,0x71,0xE3,0x8E,0x04,0x00,0x00,0x88,0xEE,0xD6,0x72,0x1A,0x50,0x4A,0x8D,
0x1B,0x49,0xB4,0xF3,0xC5,0x1D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
leRasterFont NotoMono_Regular =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoMono_Regular_glyphs, // glyph table variable pointer
6272, // data size
},
LE_RASTER_FONT,
},
16,
12,
LE_FONT_BPP_8, // bits per pixel
NotoMono_Regular_data, // kerning table
};
/*********************************
* Legato Font Asset
* Name: NotoSans_Black
* Height: 14
* Baseline: 10
* Style: Plain
* Glyph Count: 95
* Range Count: 1
* Glyph Ranges: 0x20-0x7E
*********************************/
/*********************************
* font glyph kerning table description
*
* unsigned int - number of glyphs
* for each glyph:
* unsigned short - codepoint * the glyph's codepoint
* short - width * the glyph's width in pixels
* short - height * the glyph's height in pixels
* short - advance * the glyph's advance value in pixels
* short - bearingX * the glyph's bearing value in pixels on the X axis
* short - bearingY * the glyph's bearing value in pixels on the Y axis
* unsigned short - flags * status flags for this glyph
* unsigned short - data row width * the size of a row of glyph data in bytes
* unsigned int - data table offset * the offset into the corresponding font data table
********************************/
const uint8_t NotoSans_Black_data[1904] =
{
0x5F,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x03,0x00,0x09,0x00,0x03,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x06,0x00,
0x03,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,
0x23,0x00,0x08,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x10,0x00,0x00,0x00,0x24,0x00,0x07,0x00,0x0A,0x00,0x06,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x1C,0x00,0x00,0x00,0x25,0x00,0x0B,0x00,0x09,0x00,0x0A,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x02,0x00,0x28,0x00,0x00,0x00,0x26,0x00,0x09,0x00,
0x09,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x02,0x00,0x3C,0x00,0x00,0x00,
0x27,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x50,0x00,0x00,0x00,0x28,0x00,0x04,0x00,0x0B,0x00,0x04,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x54,0x00,0x00,0x00,0x29,0x00,0x04,0x00,0x0B,0x00,0x04,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x60,0x00,0x00,0x00,0x2A,0x00,0x06,0x00,
0x07,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x6C,0x00,0x00,0x00,
0x2B,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,
0x74,0x00,0x00,0x00,0x2C,0x00,0x03,0x00,0x04,0x00,0x03,0x00,0x00,0x00,0x02,0x00,
0x00,0x00,0x01,0x00,0x7C,0x00,0x00,0x00,0x2D,0x00,0x04,0x00,0x02,0x00,0x04,0x00,
0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x80,0x00,0x00,0x00,0x2E,0x00,0x03,0x00,
0x02,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x84,0x00,0x00,0x00,
0x2F,0x00,0x05,0x00,0x09,0x00,0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x88,0x00,0x00,0x00,0x30,0x00,0x07,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x94,0x00,0x00,0x00,0x31,0x00,0x06,0x00,0x09,0x00,0x06,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xA0,0x00,0x00,0x00,0x32,0x00,0x07,0x00,
0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xAC,0x00,0x00,0x00,
0x33,0x00,0x06,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0xB8,0x00,0x00,0x00,0x34,0x00,0x07,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0xC4,0x00,0x00,0x00,0x35,0x00,0x06,0x00,0x09,0x00,0x06,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xD0,0x00,0x00,0x00,0x36,0x00,0x07,0x00,
0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xDC,0x00,0x00,0x00,
0x37,0x00,0x07,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0xE8,0x00,0x00,0x00,0x38,0x00,0x07,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0xF4,0x00,0x00,0x00,0x39,0x00,0x07,0x00,0x09,0x00,0x06,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x3A,0x00,0x03,0x00,
0x07,0x00,0x03,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x0C,0x01,0x00,0x00,
0x3B,0x00,0x03,0x00,0x08,0x00,0x03,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,
0x14,0x01,0x00,0x00,0x3C,0x00,0x06,0x00,0x07,0x00,0x06,0x00,0x00,0x00,0x07,0x00,
0x00,0x00,0x01,0x00,0x1C,0x01,0x00,0x00,0x3D,0x00,0x06,0x00,0x05,0x00,0x06,0x00,
0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x24,0x01,0x00,0x00,0x3E,0x00,0x06,0x00,
0x07,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x2C,0x01,0x00,0x00,
0x3F,0x00,0x06,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x34,0x01,0x00,0x00,0x40,0x00,0x0A,0x00,0x0A,0x00,0x0A,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x02,0x00,0x40,0x01,0x00,0x00,0x41,0x00,0x08,0x00,0x09,0x00,0x08,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x54,0x01,0x00,0x00,0x42,0x00,0x07,0x00,
0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x60,0x01,0x00,0x00,
0x43,0x00,0x07,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x6C,0x01,0x00,0x00,0x44,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x78,0x01,0x00,0x00,0x45,0x00,0x06,0x00,0x09,0x00,0x06,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x84,0x01,0x00,0x00,0x46,0x00,0x06,0x00,
0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x90,0x01,0x00,0x00,
0x47,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x9C,0x01,0x00,0x00,0x48,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0xA8,0x01,0x00,0x00,0x49,0x00,0x05,0x00,0x09,0x00,0x05,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xB4,0x01,0x00,0x00,0x4A,0x00,0x05,0x00,
0x0C,0x00,0x04,0x00,0xFF,0xFF,0x09,0x00,0x00,0x00,0x01,0x00,0xC0,0x01,0x00,0x00,
0x4B,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0xCC,0x01,0x00,0x00,0x4C,0x00,0x06,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0xD8,0x01,0x00,0x00,0x4D,0x00,0x0A,0x00,0x09,0x00,0x0B,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x02,0x00,0xE4,0x01,0x00,0x00,0x4E,0x00,0x09,0x00,
0x09,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x02,0x00,0xF8,0x01,0x00,0x00,
0x4F,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x02,0x00,
0x0C,0x02,0x00,0x00,0x50,0x00,0x07,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x20,0x02,0x00,0x00,0x51,0x00,0x09,0x00,0x0B,0x00,0x09,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x02,0x00,0x2C,0x02,0x00,0x00,0x52,0x00,0x08,0x00,
0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x44,0x02,0x00,0x00,
0x53,0x00,0x06,0x00,0x09,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x50,0x02,0x00,0x00,0x54,0x00,0x07,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x5C,0x02,0x00,0x00,0x55,0x00,0x08,0x00,0x09,0x00,0x08,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x68,0x02,0x00,0x00,0x56,0x00,0x08,0x00,
0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x74,0x02,0x00,0x00,
0x57,0x00,0x0C,0x00,0x09,0x00,0x0B,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x02,0x00,
0x80,0x02,0x00,0x00,0x58,0x00,0x08,0x00,0x09,0x00,0x08,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x94,0x02,0x00,0x00,0x59,0x00,0x08,0x00,0x09,0x00,0x07,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xA0,0x02,0x00,0x00,0x5A,0x00,0x07,0x00,
0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xAC,0x02,0x00,0x00,
0x5B,0x00,0x04,0x00,0x0C,0x00,0x04,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0xB8,0x02,0x00,0x00,0x5C,0x00,0x05,0x00,0x09,0x00,0x05,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0xC4,0x02,0x00,0x00,0x5D,0x00,0x03,0x00,0x0C,0x00,0x04,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xD0,0x02,0x00,0x00,0x5E,0x00,0x07,0x00,
0x06,0x00,0x06,0x00,0xFF,0xFF,0x09,0x00,0x00,0x00,0x01,0x00,0xDC,0x02,0x00,0x00,
0x5F,0x00,0x07,0x00,0x02,0x00,0x06,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x01,0x00,
0xE4,0x02,0x00,0x00,0x60,0x00,0x05,0x00,0x02,0x00,0x05,0x00,0x00,0x00,0x0A,0x00,
0x00,0x00,0x01,0x00,0xE8,0x02,0x00,0x00,0x61,0x00,0x07,0x00,0x07,0x00,0x07,0x00,
0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0xEC,0x02,0x00,0x00,0x62,0x00,0x07,0x00,
0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0xF4,0x02,0x00,0x00,
0x63,0x00,0x06,0x00,0x07,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,
0x00,0x03,0x00,0x00,0x64,0x00,0x07,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x08,0x03,0x00,0x00,0x65,0x00,0x07,0x00,0x07,0x00,0x07,0x00,
0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x14,0x03,0x00,0x00,0x66,0x00,0x05,0x00,
0x09,0x00,0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x1C,0x03,0x00,0x00,
0x67,0x00,0x07,0x00,0x0A,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,
0x28,0x03,0x00,0x00,0x68,0x00,0x07,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x34,0x03,0x00,0x00,0x69,0x00,0x03,0x00,0x09,0x00,0x04,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x40,0x03,0x00,0x00,0x6A,0x00,0x04,0x00,
0x0C,0x00,0x04,0x00,0xFF,0xFF,0x09,0x00,0x00,0x00,0x01,0x00,0x4C,0x03,0x00,0x00,
0x6B,0x00,0x08,0x00,0x09,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x58,0x03,0x00,0x00,0x6C,0x00,0x03,0x00,0x09,0x00,0x04,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x64,0x03,0x00,0x00,0x6D,0x00,0x0B,0x00,0x07,0x00,0x0B,0x00,
0x00,0x00,0x07,0x00,0x00,0x00,0x02,0x00,0x70,0x03,0x00,0x00,0x6E,0x00,0x07,0x00,
0x07,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x80,0x03,0x00,0x00,
0x6F,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,
0x88,0x03,0x00,0x00,0x70,0x00,0x07,0x00,0x0A,0x00,0x07,0x00,0x00,0x00,0x07,0x00,
0x00,0x00,0x01,0x00,0x90,0x03,0x00,0x00,0x71,0x00,0x07,0x00,0x0A,0x00,0x07,0x00,
0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x9C,0x03,0x00,0x00,0x72,0x00,0x06,0x00,
0x07,0x00,0x05,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0xA8,0x03,0x00,0x00,
0x73,0x00,0x06,0x00,0x07,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,
0xB0,0x03,0x00,0x00,0x74,0x00,0x05,0x00,0x09,0x00,0x05,0x00,0x00,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0xB8,0x03,0x00,0x00,0x75,0x00,0x07,0x00,0x07,0x00,0x07,0x00,
0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0xC4,0x03,0x00,0x00,0x76,0x00,0x07,0x00,
0x07,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0xCC,0x03,0x00,0x00,
0x77,0x00,0x0A,0x00,0x07,0x00,0x0A,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x02,0x00,
0xD4,0x03,0x00,0x00,0x78,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x00,0x00,0x07,0x00,
0x00,0x00,0x01,0x00,0xE4,0x03,0x00,0x00,0x79,0x00,0x08,0x00,0x0A,0x00,0x07,0x00,
0xFF,0xFF,0x07,0x00,0x00,0x00,0x01,0x00,0xEC,0x03,0x00,0x00,0x7A,0x00,0x06,0x00,
0x07,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0xF8,0x03,0x00,0x00,
0x7B,0x00,0x05,0x00,0x0B,0x00,0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,
0x00,0x04,0x00,0x00,0x7C,0x00,0x02,0x00,0x0C,0x00,0x06,0x00,0x02,0x00,0x09,0x00,
0x00,0x00,0x01,0x00,0x0C,0x04,0x00,0x00,0x7D,0x00,0x05,0x00,0x0B,0x00,0x05,0x00,
0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x18,0x04,0x00,0x00,0x7E,0x00,0x06,0x00,
0x04,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x01,0x00,0x24,0x04,0x00,0x00,
};
/*********************************
* raw font glyph data
********************************/
const uint8_t NotoSans_Black_glyphs[1064] =
{
0xE0,0x60,0x60,0x60,0x60,0x60,0x00,0x40,0x60,0x00,0x00,0x00,0x78,0x58,0x58,0x00,
0x34,0x34,0x7E,0x7E,0x2C,0xFE,0xFE,0x68,0x78,0x00,0x00,0x00,0x78,0xFC,0xF0,0xF0,
0x78,0x3C,0x1C,0xFC,0x78,0x10,0x00,0x00,0x63,0x00,0xF2,0x00,0xD6,0x00,0xD4,0x00,
0x7D,0xC0,0x6F,0xC0,0x1B,0x40,0x1B,0xC0,0x31,0x80,0x00,0x00,0x38,0x00,0x7C,0x00,
0x6C,0x00,0x3C,0x00,0x7B,0x00,0x7F,0x00,0xEF,0x00,0x7E,0x00,0x7F,0x00,0x00,0x00,
0x60,0x40,0x40,0x00,0x20,0x60,0x60,0x40,0xC0,0xC0,0xC0,0x40,0x60,0x60,0x20,0x00,
0x40,0x60,0x60,0x20,0x20,0x30,0x20,0x20,0x60,0x60,0x40,0x00,0x30,0x30,0xFC,0x78,
0x78,0x58,0x00,0x00,0x30,0x30,0xFC,0x7C,0x30,0x30,0x00,0x00,0x60,0x40,0x40,0xC0,
0xE0,0xE0,0x00,0x00,0x40,0x60,0x00,0x00,0x18,0x30,0x30,0x30,0x20,0x60,0x60,0x40,
0xC0,0x00,0x00,0x00,0x38,0x78,0x6C,0xEC,0xEC,0xEC,0x6C,0x7C,0x38,0x00,0x00,0x00,
0x18,0x38,0x78,0x58,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x78,0xFC,0x4C,0x1C,
0x18,0x38,0x70,0xFC,0xFC,0x00,0x00,0x00,0x78,0x7C,0x0C,0x38,0x38,0x1C,0x0C,0xFC,
0x78,0x00,0x00,0x00,0x18,0x18,0x38,0x78,0x78,0xFC,0xFC,0x18,0x18,0x00,0x00,0x00,
0x78,0x78,0x60,0x78,0x7C,0x0C,0x0C,0xFC,0x78,0x00,0x00,0x00,0x3C,0x7C,0x60,0x78,
0xFC,0xEC,0x6C,0x7C,0x38,0x00,0x00,0x00,0xFC,0x7C,0x0C,0x18,0x18,0x38,0x30,0x30,
0x70,0x00,0x00,0x00,0x38,0x7C,0x6C,0x78,0x78,0x7C,0xCC,0x7C,0x78,0x00,0x00,0x00,
0x38,0x7C,0xCC,0xCC,0x7C,0x7C,0x0C,0x78,0x70,0x00,0x00,0x00,0x60,0x40,0x00,0x00,
0x00,0x40,0x60,0x00,0x60,0x40,0x00,0x00,0x60,0x40,0x40,0xC0,0x04,0x1C,0x70,0x70,
0x3C,0x04,0x00,0x00,0xFC,0x7C,0x00,0xFC,0x7C,0x00,0x00,0x00,0x40,0x70,0x38,0x1C,
0x70,0x40,0x00,0x00,0x70,0xF8,0x18,0x18,0x30,0x20,0x00,0x20,0x20,0x00,0x00,0x00,
0x1E,0x00,0x3F,0x00,0x7F,0x80,0x5E,0x80,0x52,0x80,0xD2,0x80,0x5F,0x80,0x7F,0x00,
0x7F,0x00,0x1E,0x00,0x3C,0x3C,0x3C,0x3C,0x66,0x7E,0x7E,0xE7,0xC3,0x00,0x00,0x00,
0x7C,0x7E,0x6E,0x7C,0x7C,0x6E,0x66,0x7E,0x7C,0x00,0x00,0x00,0x1C,0x7C,0x60,0x60,
0x60,0x60,0x60,0x7C,0x3C,0x00,0x00,0x00,0x7C,0x7E,0x66,0x66,0x66,0x66,0x66,0x7E,
0x78,0x00,0x00,0x00,0x7C,0x78,0x60,0x78,0x78,0x60,0x60,0x78,0x7C,0x00,0x00,0x00,
0x78,0x78,0x60,0x60,0x78,0x78,0x60,0x60,0x60,0x00,0x00,0x00,0x1E,0x7E,0x60,0x60,
0x6E,0x6E,0x66,0x7E,0x3E,0x00,0x00,0x00,0x67,0x67,0x67,0x7F,0x7F,0x67,0x67,0x67,
0x67,0x00,0x00,0x00,0xF0,0x70,0x60,0x60,0x60,0x60,0x60,0x70,0xF0,0x00,0x00,0x00,
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xF0,0xE0,0x66,0x6E,0x6C,0x78,
0x78,0x7C,0x6C,0x6E,0x66,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x7C,
0x7C,0x00,0x00,0x00,0x71,0xC0,0x71,0xC0,0x73,0xC0,0x7B,0xC0,0x7B,0xC0,0x7A,0xC0,
0x6E,0xC0,0x6E,0xC0,0x6C,0xC0,0x00,0x00,0x73,0x00,0x73,0x00,0x7B,0x00,0x7B,0x00,
0x7F,0x00,0x6F,0x00,0x6F,0x00,0x67,0x00,0x67,0x00,0x00,0x00,0x3C,0x00,0x7E,0x00,
0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x3C,0x00,0x00,0x00,
0x78,0x7C,0x6C,0x6C,0x7C,0x78,0x60,0x60,0x60,0x00,0x00,0x00,0x3C,0x00,0x7E,0x00,
0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x3E,0x00,0x06,0x00,
0x07,0x00,0x00,0x00,0x78,0x7C,0x6E,0x6C,0x7C,0x7C,0x6C,0x6E,0x66,0x00,0x00,0x00,
0x3C,0x7C,0x60,0x70,0x78,0x1C,0x0C,0xFC,0x78,0x00,0x00,0x00,0xFC,0xFC,0x30,0x30,
0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x67,0x67,0x67,0x67,0x67,0x67,0x66,0x7E,
0x3C,0x00,0x00,0x00,0xE7,0xE6,0x66,0x6E,0x6C,0x3C,0x3C,0x38,0x38,0x00,0x00,0x00,
0xC6,0x60,0xEE,0x60,0x6E,0x60,0x6E,0x60,0x6F,0xC0,0x7B,0xC0,0x3B,0xC0,0x39,0xC0,
0x39,0x80,0x00,0x00,0xE6,0x66,0x3C,0x3C,0x38,0x3C,0x7C,0x66,0xE7,0x00,0x00,0x00,
0xE6,0x6E,0x7C,0x3C,0x38,0x38,0x18,0x18,0x18,0x00,0x00,0x00,0xFC,0x7C,0x1C,0x18,
0x38,0x30,0x60,0xFC,0xFC,0x00,0x00,0x00,0x60,0x60,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x60,0x60,0xC0,0x40,0x60,0x60,0x60,0x30,0x30,0x30,0x18,0x00,0x00,0x00,
0xE0,0xE0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xE0,0xE0,0x10,0x18,0x38,0x2C,
0x64,0x66,0x00,0x00,0x7C,0x7E,0x00,0x00,0x60,0x30,0x00,0x00,0x78,0x7C,0x3C,0x7C,
0xEC,0x7C,0x7C,0x00,0x60,0x60,0x7C,0x7C,0x6C,0x6E,0x6C,0x7C,0x7C,0x00,0x00,0x00,
0x38,0x78,0x60,0xE0,0x60,0x78,0x38,0x00,0x0C,0x0C,0x3C,0x7C,0x6C,0xEC,0x6C,0x7C,
0x7C,0x00,0x00,0x00,0x38,0x7C,0x7C,0xFC,0x60,0x7C,0x3C,0x00,0x38,0x70,0x70,0xF0,
0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x3C,0x7C,0x6C,0xEC,0x6C,0x7C,0x7C,0x0C,
0x7C,0x78,0x00,0x00,0x60,0x60,0x7C,0x7E,0x6E,0x66,0x66,0x66,0x66,0x00,0x00,0x00,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x30,0x30,0x30,0x30,
0x30,0x30,0x30,0x30,0x30,0x30,0xF0,0xE0,0x60,0x60,0x6E,0x6C,0x78,0x78,0x7C,0x6C,
0x66,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,
0x7D,0xC0,0x7F,0xC0,0x6E,0xC0,0x6E,0xC0,0x6E,0xC0,0x6E,0xC0,0x6E,0xC0,0x00,0x00,
0x7C,0x7E,0x6E,0x66,0x66,0x66,0x66,0x00,0x38,0x7C,0x6C,0xEE,0x6C,0x7C,0x38,0x00,
0x7C,0x7C,0x6E,0x6E,0x6E,0x7C,0x7C,0x60,0x60,0x60,0x00,0x00,0x3C,0x7C,0x6C,0xEC,
0x6C,0x7C,0x7C,0x0C,0x0C,0x0C,0x00,0x00,0x58,0x78,0x60,0x60,0x60,0x60,0x60,0x00,
0x78,0x78,0x60,0x78,0x18,0xF8,0x70,0x00,0x20,0x60,0x78,0xF0,0x60,0x60,0x60,0x78,
0x38,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x6E,0x7E,0x36,0x00,0xCE,0xEC,0x6C,0x6C,
0x78,0x38,0x38,0x00,0xCC,0xC0,0xCC,0xC0,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x73,0x80,
0x33,0x00,0x00,0x00,0xEE,0x7C,0x38,0x38,0x78,0x6C,0xEE,0x00,0x67,0x76,0x36,0x36,
0x1C,0x1C,0x1C,0x18,0x38,0x30,0x00,0x00,0xF8,0x78,0x38,0x30,0x60,0xF8,0xF8,0x00,
0x30,0x30,0x20,0x20,0x60,0xE0,0xE0,0x20,0x20,0x30,0x30,0x00,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,0x60,0x60,0x60,0x30,0x30,0x60,
0x60,0xE0,0xE0,0x00,0x60,0x7C,0x1C,0x00,
};
leRasterFont NotoSans_Black =
{
{
{
LE_STREAM_LOCATION_ID_INTERNAL, // data location id
(void*)NotoSans_Black_glyphs, // glyph table variable pointer
1064, // data size
},
LE_RASTER_FONT,
},
14,
10,
LE_FONT_BPP_1, // bits per pixel
NotoSans_Black_data, // kerning table
};
|
266562.c | #include <emote.h>
EMOTE( "~Name ~verbgo `Spackle!'@@going `Spackle!'",
"~Name ~verbgo `Spackle!' at ~targ.@@going `Spackle!' at ~targ")
EMOTE_ATTRIBUTE( ATT_FOOLISH ) |
569269.c | /* ----------------------------------------------------------------------
* Project: CMSIS DSP Library
* Title: dsp_iir_lattice_f32.c
* Description: Floating-point IIR Lattice filter processing function
*
* $Date: 27. January 2017
* $Revision: V.1.5.1
*
* Target Processor: Cortex-M cores
* -------------------------------------------------------------------- */
/*
* Copyright (C) 2010-2017 dsp Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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 "dsp_math.h"
/**
* @ingroup groupFilters
*/
/**
* @defgroup IIR_Lattice Infinite Impulse Response (IIR) Lattice Filters
*
* This set of functions implements lattice filters
* for Q15, Q31 and floating-point data types. Lattice filters are used in a
* variety of adaptive filter applications. The filter structure has feedforward and
* feedback components and the net impulse response is infinite length.
* The functions operate on blocks
* of input and output data and each call to the function processes
* <code>blockSize</code> samples through the filter. <code>pSrc</code> and
* <code>pDst</code> point to input and output arrays containing <code>blockSize</code> values.
* \par Algorithm:
* \image html IIRLattice.gif "Infinite Impulse Response Lattice filter"
* <pre>
* fN(n) = x(n)
* fm-1(n) = fm(n) - km * gm-1(n-1) for m = N, N-1, ...1
* gm(n) = km * fm-1(n) + gm-1(n-1) for m = N, N-1, ...1
* y(n) = vN * gN(n) + vN-1 * gN-1(n) + ...+ v0 * g0(n)
* </pre>
* \par
* <code>pkCoeffs</code> points to array of reflection coefficients of size <code>numStages</code>.
* Reflection coefficients are stored in time-reversed order.
* \par
* <pre>
* {kN, kN-1, ....k1}
* </pre>
* <code>pvCoeffs</code> points to the array of ladder coefficients of size <code>(numStages+1)</code>.
* Ladder coefficients are stored in time-reversed order.
* \par
* <pre>
* {vN, vN-1, ...v0}
* </pre>
* <code>pState</code> points to a state array of size <code>numStages + blockSize</code>.
* The state variables shown in the figure above (the g values) are stored in the <code>pState</code> array.
* The state variables are updated after each block of data is processed; the coefficients are untouched.
* \par Instance Structure
* The coefficients and state variables for a filter are stored together in an instance data structure.
* A separate instance structure must be defined for each filter.
* Coefficient arrays may be shared among several instances while state variable arrays cannot be shared.
* There are separate instance structure declarations for each of the 3 supported data types.
*
* \par Initialization Functions
* There is also an associated initialization function for each data type.
* The initialization function performs the following operations:
* - Sets the values of the internal structure fields.
* - Zeros out the values in the state buffer.
* To do this manually without calling the init function, assign the follow subfields of the instance structure:
* numStages, pkCoeffs, pvCoeffs, pState. Also set all of the values in pState to zero.
*
* \par
* Use of the initialization function is optional.
* However, if the initialization function is used, then the instance structure cannot be placed into a const data section.
* To place an instance structure into a const data section, the instance structure must be manually initialized.
* Set the values in the state buffer to zeros and then manually initialize the instance structure as follows:
* <pre>
*dsp_iir_lattice_instance_f32 S = {numStages, pState, pkCoeffs, pvCoeffs};
*dsp_iir_lattice_instance_q31 S = {numStages, pState, pkCoeffs, pvCoeffs};
*dsp_iir_lattice_instance_q15 S = {numStages, pState, pkCoeffs, pvCoeffs};
* </pre>
* \par
* where <code>numStages</code> is the number of stages in the filter; <code>pState</code> points to the state buffer array;
* <code>pkCoeffs</code> points to array of the reflection coefficients; <code>pvCoeffs</code> points to the array of ladder coefficients.
* \par Fixed-Point Behavior
* Care must be taken when using the fixed-point versions of the IIR lattice filter functions.
* In particular, the overflow and saturation behavior of the accumulator used in each function must be considered.
* Refer to the function specific documentation below for usage guidelines.
*/
/**
* @addtogroup IIR_Lattice
* @{
*/
/**
* @brief Processing function for the floating-point IIR lattice filter.
* @param[in] *S points to an instance of the floating-point IIR lattice structure.
* @param[in] *pSrc points to the block of input data.
* @param[out] *pDst points to the block of output data.
* @param[in] blockSize number of samples to process.
* @return none.
*/
void dsp_iir_lattice_f32(
const dsp_iir_lattice_instance_f32 *S,
float32_t *pSrc,
float32_t *pDst,
uint32_t blockSize)
{
float32_t fcurr, fnext = 0, gcurr, gnext; /* Temporary variables for lattice stages */
float32_t acc; /* Accumlator */
uint32_t blkCnt, tapCnt; /* temporary variables for counts */
float32_t *px1, *px2, *pk, *pv; /* temporary pointers for state and coef */
uint32_t numStages = S->numStages; /* number of stages */
float32_t *pState; /* State pointer */
float32_t *pStateCurnt; /* State current pointer */
/* Run the below code for Cortex-M0 */
blkCnt = blockSize;
pState = &S->pState[0];
/* Sample processing */
while (blkCnt > 0U) {
/* Read Sample from input buffer */
/* fN(n) = x(n) */
fcurr = *pSrc++;
/* Initialize state read pointer */
px1 = pState;
/* Initialize state write pointer */
px2 = pState;
/* Set accumulator to zero */
acc = 0.0f;
/* Initialize Ladder coeff pointer */
pv = &S->pvCoeffs[0];
/* Initialize Reflection coeff pointer */
pk = &S->pkCoeffs[0];
/* Process sample for numStages */
tapCnt = numStages;
while (tapCnt > 0U) {
gcurr = *px1++;
/* Process sample for last taps */
fnext = fcurr - ((*pk) * gcurr);
gnext = (fnext * (*pk++)) + gcurr;
/* Output samples for last taps */
acc += (gnext * (*pv++));
*px2++ = gnext;
fcurr = fnext;
/* Decrementing loop counter */
tapCnt--;
}
/* y(n) += g0(n) * v0 */
acc += (fnext * (*pv));
*px2++ = fnext;
/* write out into pDst */
*pDst++ = acc;
/* Advance the state pointer by 1 to process the next group of samples */
pState = pState + 1U;
blkCnt--;
}
/* Processing is complete. Now copy last S->numStages samples to start of the buffer
for the preperation of next frame process */
/* Points to the start of the state buffer */
pStateCurnt = &S->pState[0];
pState = &S->pState[blockSize];
tapCnt = numStages;
/* Copy the data */
while (tapCnt > 0U) {
*pStateCurnt++ = *pState++;
/* Decrement the loop counter */
tapCnt--;
}
}
/**
* @} end of IIR_Lattice group
*/
|
241224.c | #include <stdio.h>
#include <caml/alloc.h>
#include <caml/callback.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#include <string.h>
#include "caml_values.h"
#ifdef WIN32
#include "ReveryWin32.h"
#elif __APPLE__
#include "ReveryCocoa.h"
#else
#include "ReveryGtk.h"
#include <locale.h>
#endif
CAMLprim value revery_getUserLocale() {
CAMLparam0();
CAMLlocal1(camlRet);
char *ret;
int shouldFree;
#ifdef __APPLE__
ret = revery_getUserLocale_cocoa();
shouldFree = 0;
#elif WIN32
ret = revery_getUserLocale_win32();
shouldFree = 1;
#else
setlocale(LC_CTYPE, "");
ret = setlocale(LC_CTYPE, NULL);
shouldFree = 0;
#endif
camlRet = caml_copy_string(ret);
if (shouldFree) {
free(ret);
}
CAMLreturn(camlRet);
}
|
874915.c | //
// Created by Jedrzej on 03.07.2018.
//
#include <stdio.h>
void cwiczenie102(void) {
for(char c = 0; c != EOF; c++)
printf("Numer znaku %d - znak: %c\n",c,c);
} |
786879.c | #include <stdlib.h>
#include "buffer.h"
#include "chunk.h"
#include "cmark-gfm.h"
#include "utf8.h"
#include "render.h"
#include "node.h"
#include "syntax_extension.h"
static CMARK_INLINE void S_cr(cmark_renderer *renderer) {
if (renderer->need_cr < 1) {
renderer->need_cr = 1;
}
}
static CMARK_INLINE void S_blankline(cmark_renderer *renderer) {
if (renderer->need_cr < 2) {
renderer->need_cr = 2;
}
}
static void S_out(cmark_renderer *renderer, cmark_node *node,
const char *source, bool wrap,
cmark_escaping escape) {
int length = (int)strlen(source);
unsigned char nextc;
int32_t c;
int i = 0;
int last_nonspace;
int len;
cmark_chunk remainder = cmark_chunk_literal("");
int k = renderer->buffer->size - 1;
cmark_syntax_extension *ext = NULL;
cmark_node *n = node;
while (n && !ext) {
ext = n->extension;
if (!ext)
n = n->parent;
}
if (ext && !ext->commonmark_escape_func)
ext = NULL;
wrap = wrap && !renderer->no_linebreaks;
if (renderer->in_tight_list_item && renderer->need_cr > 1) {
renderer->need_cr = 1;
}
while (renderer->need_cr) {
if (k < 0 || renderer->buffer->ptr[k] == '\n') {
k -= 1;
} else {
cmark_strbuf_putc(renderer->buffer, '\n');
if (renderer->need_cr > 1) {
cmark_strbuf_put(renderer->buffer, renderer->prefix->ptr,
renderer->prefix->size);
}
}
renderer->column = 0;
renderer->last_breakable = 0;
renderer->begin_line = true;
renderer->begin_content = true;
renderer->need_cr -= 1;
}
while (i < length) {
if (renderer->begin_line) {
cmark_strbuf_put(renderer->buffer, renderer->prefix->ptr,
renderer->prefix->size);
// note: this assumes prefix is ascii:
renderer->column = renderer->prefix->size;
}
len = cmark_utf8proc_iterate((const uint8_t *)source + i, length - i, &c);
if (len == -1) { // error condition
return; // return without rendering rest of string
}
if (ext && ext->commonmark_escape_func(ext, node, c))
cmark_strbuf_putc(renderer->buffer, '\\');
nextc = source[i + len];
if (c == 32 && wrap) {
if (!renderer->begin_line) {
last_nonspace = renderer->buffer->size;
cmark_strbuf_putc(renderer->buffer, ' ');
renderer->column += 1;
renderer->begin_line = false;
renderer->begin_content = false;
// skip following spaces
while (source[i + 1] == ' ') {
i++;
}
// We don't allow breaks that make a digit the first character
// because this causes problems with commonmark output.
if (!cmark_isdigit(source[i + 1])) {
renderer->last_breakable = last_nonspace;
}
}
} else if (c == 10) {
cmark_strbuf_putc(renderer->buffer, '\n');
renderer->column = 0;
renderer->begin_line = true;
renderer->begin_content = true;
renderer->last_breakable = 0;
} else if (escape == LITERAL) {
cmark_render_code_point(renderer, c);
renderer->begin_line = false;
// we don't set 'begin_content' to false til we've
// finished parsing a digit. Reason: in commonmark
// we need to escape a potential list marker after
// a digit:
renderer->begin_content =
renderer->begin_content && cmark_isdigit((char)c) == 1;
} else {
(renderer->outc)(renderer, node, escape, c, nextc);
renderer->begin_line = false;
renderer->begin_content =
renderer->begin_content && cmark_isdigit((char)c) == 1;
}
// If adding the character went beyond width, look for an
// earlier place where the line could be broken:
if (renderer->width > 0 && renderer->column > renderer->width &&
!renderer->begin_line && renderer->last_breakable > 0) {
// copy from last_breakable to remainder
cmark_chunk_set_cstr(renderer->mem, &remainder,
(char *)renderer->buffer->ptr +
renderer->last_breakable + 1);
// truncate at last_breakable
cmark_strbuf_truncate(renderer->buffer, renderer->last_breakable);
// add newline, prefix, and remainder
cmark_strbuf_putc(renderer->buffer, '\n');
cmark_strbuf_put(renderer->buffer, renderer->prefix->ptr,
renderer->prefix->size);
cmark_strbuf_put(renderer->buffer, remainder.data, remainder.len);
renderer->column = renderer->prefix->size + remainder.len;
cmark_chunk_free(renderer->mem, &remainder);
renderer->last_breakable = 0;
renderer->begin_line = false;
renderer->begin_content = false;
}
i += len;
}
}
// Assumes no newlines, assumes ascii content:
void cmark_render_ascii(cmark_renderer *renderer, const char *s) {
int origsize = renderer->buffer->size;
cmark_strbuf_puts(renderer->buffer, s);
renderer->column += renderer->buffer->size - origsize;
}
void cmark_render_code_point(cmark_renderer *renderer, uint32_t c) {
cmark_utf8proc_encode_char(c, renderer->buffer);
renderer->column += 1;
}
char *cmark_render(cmark_mem *mem, cmark_node *root, int options, int width,
void (*outc)(cmark_renderer *, cmark_node *,
cmark_escaping, int32_t,
unsigned char),
int (*render_node)(cmark_renderer *renderer,
cmark_node *node,
cmark_event_type ev_type, int options)) {
cmark_strbuf pref = CMARK_BUF_INIT(mem);
cmark_strbuf buf = CMARK_BUF_INIT(mem);
cmark_node *cur;
cmark_event_type ev_type;
char *result;
cmark_iter *iter = cmark_iter_new(root);
cmark_renderer renderer = {mem, &buf, &pref, 0, width,
0, 0, true, true, false,
false, outc, S_cr, S_blankline, S_out,
0};
while ((ev_type = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
cur = cmark_iter_get_node(iter);
if (!render_node(&renderer, cur, ev_type, options)) {
// a false value causes us to skip processing
// the node's contents. this is used for
// autolinks.
cmark_iter_reset(iter, cur, CMARK_EVENT_EXIT);
}
}
// ensure final newline
if (renderer.buffer->size == 0 || renderer.buffer->ptr[renderer.buffer->size - 1] != '\n') {
cmark_strbuf_putc(renderer.buffer, '\n');
}
result = (char *)cmark_strbuf_detach(renderer.buffer);
cmark_iter_free(iter);
cmark_strbuf_free(renderer.prefix);
cmark_strbuf_free(renderer.buffer);
return result;
}
|
108003.c | /*******************************************************************
** This code is part of the Dark Overload Framework.
**
MIT License
Copyright (c) 2018 Dark Overlord of Data
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.
******************************************************************/
/**
* tglm is Tiny GLM for c99
*
* opengl math helpers inspired by GLM.
* using clang vector extensions and function overload.
*
*/
#include "tglm.h"
/**
* clamp number/vector between MIN and MAX values
*
* @param val value
* @param minVal minimum
* @param maxVal maximum
* @returns clamped value
*
*/
float __attribute__((overloadable)) glm_clamp(float val, float minVal, float maxVal)
{
float min = (val > minVal) ? val : minVal;
return (min < maxVal) ? min : maxVal;
}
Vec2 __attribute__((overloadable)) glm_clamp(Vec2 v, float minVal, float maxVal)
{
return (Vec2) {
glm_clamp(v.x, minVal, maxVal),
glm_clamp(v.y, minVal, maxVal)
};
}
Vec2 __attribute__((overloadable)) glm_clamp(Vec2 v, Vec2 minVal, Vec2 maxVal)
{
return (Vec2) {
glm_clamp(v.x, minVal.x, maxVal.x),
glm_clamp(v.y, minVal.y, maxVal.y)
};
}
Vec3 __attribute__((overloadable)) glm_clamp(Vec3 v, float minVal, float maxVal)
{
return (Vec3) {
glm_clamp(v.x, minVal, maxVal),
glm_clamp(v.y, minVal, maxVal),
glm_clamp(v.z, minVal, maxVal)
};
}
Vec4 __attribute__((overloadable)) glm_clamp(Vec4 v, float minVal, float maxVal)
{
return (Vec4) {
glm_clamp(v.x, minVal, maxVal),
glm_clamp(v.y, minVal, maxVal),
glm_clamp(v.z, minVal, maxVal),
glm_clamp(v.w, minVal, maxVal)
};
}
/**
* translate transform matrix by v vector
*
* @param m affine transfrom
* @param v translate vector [x, y, z]
* @returns translated matrix
*
*/
Mat glm_translate(Mat m, Vec3 v)
{
m.scdef = m.scdef + m.s0123 * v.x + m.s4567 * v.y + m.s89ab * v.z;
return m;
}
/**
* length - return scalar Euclidean length of a vector
*
* @param v vector
* @returns norm * norm
*
*/
float __attribute__((overloadable)) glm_length(Vec2 v)
{
return sqrtf(v.x * v.x + v.y * v.y);
}
float __attribute__((overloadable)) glm_length(Vec3 v)
{
return sqrtf(v.x * v.x + v.y * v.y + v.z * v.z);
}
float __attribute__((overloadable)) glm_length(Vec4 v)
{
return sqrtf(v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w);
}
/**
* vector dot product
*
* @param a vector1
* @param b vector2
* @returns dot product
*
*/
float __attribute__((overloadable)) glm_dot(Vec2 a, Vec2 b)
{
return a.x * b.x + a.y * b.y;
}
float __attribute__((overloadable)) glm_dot(Vec3 a, Vec3 b)
{
return a.x * b.x + a.y * b.y + a.z * b.z;
}
float __attribute__((overloadable)) glm_dot(Vec4 a, Vec4 b)
{
return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
}
/**
* norm * norm (magnitude) of vector
*
* @param v vector
* @returns norm * norm
*
*/
float __attribute__((overloadable)) glm_norm2(Vec2 v)
{
return glm_dot(v, v);
}
float __attribute__((overloadable)) glm_norm2(Vec3 v)
{
return glm_dot(v, v);
}
float __attribute__((overloadable)) glm_norm2(Vec4 v)
{
return glm_dot(v, v);
}
/**
* norm (magnitude) of vec3
*
* @param vec vector
* @returns norm
*/
float __attribute__((overloadable)) glm_norm(Vec2 vec)
{
return sqrtf(glm_norm2(vec));
}
float __attribute__((overloadable)) glm_norm(Vec3 vec)
{
return sqrtf(glm_norm2(vec));
}
float __attribute__((overloadable)) glm_norm(Vec4 vec)
{
return sqrtf(glm_norm2(vec));
}
/**
* return an identity matrix
*/
Mat mat_identity()
{
return (Mat) { 1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f };
}
/**
* normalize vector and store result in same vec
*
* @param v vector
* @returns normalized vector
*
*/
Vec3 __attribute__((overloadable)) glm_normalize(Vec3 v)
{
float n = glm_norm(v);
if (n == 0.0f) {
v.x = v.y = v.z = 0.0f;
return v;
}
v = v * 1.0f / n;
return v;
}
Vec2 __attribute__((overloadable)) glm_normalize(Vec2 v)
{
float n = glm_norm(v);
if (n == 0.0f) {
v.x = v.y = 0.0f;
return v;
}
v = v * 1.0f / n;
return v;
}
/**
* scales existing transform matrix by v vector
* and stores result in same matrix
*
* @param m affine transfrom
* @param v scale vector [x, y, z]
* @returns scaled Vec3
*/
Mat glm_scale(Mat m, Vec3 v)
{
m.s0123 = m.s0123 * v.x;
m.s4567 = m.s4567 * v.y;
m.s89ab = m.s89ab * v.z;
return m;
}
/**
* set up orthographic projection matrix
*
* @param left left and right vertical clipping planes
* @param right left and right vertical clipping planes
* @param bottom bottom and top horizontal clipping planes
* @param top bottom and top horizontal clipping planes
* @param nearVal nearer and farther depth clipping planes
* @param farVal nearer and farther depth clipping planes
* @returns projection matrix
*/
Mat glm_ortho(float left,
float right,
float bottom,
float top,
float nearVal,
float farVal)
{
Mat proj = mat_identity();
proj.s0 = 2 / (right - left);
proj.s5 = 2 / (top - bottom);
proj.sa = -1;
proj.sc = -(right + left) / (right - left);
proj.sd = -(top + bottom) / (top - bottom);
proj.se = -nearVal / (farVal - nearVal);
return proj;
}
/**
* rotate existing transform matrix around given axis by angle
*
* @param m affine transfrom
* @param angle angle (radians)
* @param axis axis
*/
Mat glm_rotate(Mat m, float angle, Vec3 v)
{
float a = angle;
float c = cos(a);
float s = sin(a);
Vec3 axis = glm_normalize(v);
Vec3 temp = (1 - c) * axis;
Mat rotate;
rotate.s0 = c + temp.x * axis.x;
rotate.s1 = temp.x * axis.y + s * axis.z;
rotate.s2 = temp.x * axis.z - s * axis.y;
rotate.s4 = temp.y * axis.x - s * axis.z;
rotate.s5 = c + temp.y * axis.y;
rotate.s6 = temp.y * axis.z + s * axis.x;
rotate.s8 = temp.z * axis.x + s * axis.y;
rotate.s9 = temp.z * axis.y - s * axis.x;
rotate.sa = c + temp.z * axis.z;
Mat result;
result.s0123 = m.s0123 * rotate.s0 + m.s4567 * rotate.s1 + m.s89ab * rotate.s2;
result.s4567 = m.s0123 * rotate.s4 + m.s4567 * rotate.s5 + m.s89ab * rotate.s6;
result.s89ab = m.s0123 * rotate.s8 + m.s4567 * rotate.s9 + m.s89ab * rotate.sa;
result.scdef = m.scdef;
return result;
}
Mat glm_mat_mul(Mat a, Mat b)
{
Mat temp;
int k, r, c;
for (c = 0; c < 4; ++c)
for (r = 0; r < 4; ++r) {
temp[c + r * 4] = 0.f;
for (k = 0; k < 4; ++k)
temp[c + r * 4] += a[k + r * 4] * b[c + k * 4];
}
return temp;
}
Mat glm_rotateZ(Mat m, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
Mat r = {
c, s, 0.f, 0.f,
-s, c, 0.f, 0.f,
0.f, 0.f, 1.f, 0.f,
0.f, 0.f, 0.f, 1.f
};
return glm_mat_mul(m, r);
}
Mat glm_rotateY(Mat m, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
Mat r = {
c, 0.f, -s, 0.f,
0.f, 1.f, 0.f, 0.f,
s, 0.f, c, 0.f,
0.f, 0.f, 0.f, 1.f
};
return glm_mat_mul(m, r);
} |
607708.c | /*
* Copyright 2014-2017 Frank Hunleth
*
* 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 "mbr.h"
#include "util.h"
#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// Hardcode the cylinder/head/sector geometry, since it's not relevant for
// the types of memory that we use.
#define SECTORS_PER_HEAD 63
#define HEADS_PER_CYLINDER 255
/**
* @brief mbr_verify check that the specified partitions make sense and don't overlap
* @param partitions the partitions
* @return 0 if successful
*/
int mbr_verify(const struct mbr_partition partitions[4])
{
int i;
// Check for overlap
for (i = 0; i < 4; i++) {
if (partitions[i].partition_type > 0xff || partitions[i].partition_type < 0)
ERR_RETURN("invalid partition type");
uint32_t ileft = partitions[i].block_offset;
uint32_t iright = ileft + partitions[i].block_count;
// Check if empty.
if (partitions[i].partition_type == 0 ||
ileft == iright)
continue;
int j;
for (j = 0; j < 4; j++) {
if (j == i)
continue;
uint32_t jleft = partitions[j].block_offset;
uint32_t jright = jleft + partitions[j].block_count;
if (partitions[j].partition_type == 0 ||
jleft == jright)
continue;
if ((ileft >= jleft && ileft < jright) ||
(iright > jleft && iright <= jright))
ERR_RETURN("partitions %d (blocks %u to %u) and %d (blocks %u to %u) overlap",
i, ileft, iright, j, jleft, jright);
}
}
return 0;
}
static void lba_to_chs(uint32_t lba, uint8_t *output)
{
// If the block offset can't be represented in CHS form,
// don't bother since it's mostly likely not used anyway.
if (lba <= (SECTORS_PER_HEAD * HEADS_PER_CYLINDER * 0x3ff)) {
uint16_t cylinder = lba / (SECTORS_PER_HEAD * HEADS_PER_CYLINDER);
uint8_t head = (uint8_t) ((lba / SECTORS_PER_HEAD) % HEADS_PER_CYLINDER);
uint8_t sector = (uint8_t) (lba % SECTORS_PER_HEAD) + 1;
output[0] = head;
output[1] = ((cylinder & 0x300) >> 2) | sector;
output[2] = (cylinder & 0xff);
}
}
static void copy_le32(uint8_t *output, uint32_t v)
{
output[0] = v & 0xff;
output[1] = (v >> 8) & 0xff;
output[2] = (v >> 16) & 0xff;
output[3] = (v >> 24) & 0xff;
}
static void copy_le16(uint8_t *output, uint16_t v)
{
output[0] = v & 0xff;
output[1] = (v >> 8) & 0xff;
}
static int create_partition(const struct mbr_partition *partition, uint8_t *output)
{
// Clear out the partition entry
memset(output, 0, 16);
// Don't write most of the partition entry if it is unused.
if (partition->partition_type > 0) {
output[0] = partition->boot_flag ? 0x80 : 0x00;
lba_to_chs(partition->block_offset, &output[1]);
output[4] = partition->partition_type;
lba_to_chs(partition->block_offset + partition->block_count - 1, &output[5]);
}
// There's an ugly hack use case where data is stored in the block offset and
// count of unused partition entries. That's why the following two lines aren't
// in the "if" block above.
copy_le32(&output[8], partition->block_offset);
copy_le32(&output[12], partition->block_count);
return 0;
}
static int write_osip(const struct osip_header *osip, uint8_t *output)
{
// OSIP Signature "$OS$"
output[0] = '$';
output[1] = 'O';
output[2] = 'S';
output[3] = '$';
output[4] = 0; // Reserved
output[5] = osip->minor; // Header minor revision
output[6] = osip->major; // Header major revision
output[7] = 0; // Placeholder for header checksum
output[8] = osip->num_pointers;
output[9] = osip->num_images;
uint16_t header_size = 32 + 24 * osip->num_images;
copy_le16(&output[10], header_size);
memset(&output[12], 0, 20); // Reserved
int i;
uint8_t *osii_out = &output[32];
for (i = 0; i < osip->num_images; i++) {
const struct osii *descriptor = &osip->descriptors[i];
copy_le16(&osii_out[0], descriptor->os_minor);
copy_le16(&osii_out[2], descriptor->os_major);
copy_le32(&osii_out[4], descriptor->start_block_offset);
copy_le32(&osii_out[8], descriptor->ddr_load_address);
copy_le32(&osii_out[12], descriptor->entry_point);
copy_le32(&osii_out[16], descriptor->image_size);
osii_out[20] = descriptor->attribute;
memset(&osii_out[21], 0, 3); // Reserved
osii_out += 24;
}
// Calculate and save the checksum
uint8_t sum = output[0];
for (i = 1; i < header_size; i++)
sum = sum ^ output[i];
output[7] = sum;
return 0;
}
/**
* @brief Create a master boot record and put it in output
* @param partitions the list of partitions
* @param bootstrap optional bootstrap code (must be 440 bytes or NULL if none)
* @param osip optional OSIP header (NULL if none)
* @param output the output location
* @return 0 if success
*/
int mbr_create(const struct mbr_partition partitions[4],
const uint8_t *bootstrap,
const struct osip_header *osip,
uint32_t signature,
uint8_t output[512])
{
if (bootstrap && osip->include_osip)
ERR_RETURN("Can't specify both bootstrap and OSIP in MBR");
if (mbr_verify(partitions) < 0)
return -1;
memset(output, 0, 512);
if (bootstrap)
memcpy(output, bootstrap, 440);
if (osip->include_osip && write_osip(osip, output) < 0)
return -1;
copy_le32(&output[440], signature);
int i;
for (i = 0; i < 4; i++) {
if (create_partition(&partitions[i], &output[446 + i * 16]) < 0)
return -1;
}
output[510] = 0x55;
output[511] = 0xaa;
return 0;
}
static int read_partition(const uint8_t *input, struct mbr_partition *partition)
{
if (input[0] & 0x80)
partition->boot_flag = true;
else
partition->boot_flag = false;
partition->partition_type = input[4];
partition->block_offset =
(input[8]) | (input[9] << 8) | (input[10] << 16) | (input[11] << 24);
partition->block_count =
(input[12]) | (input[13] << 8) | (input[14] << 16) | (input[15] << 24);
return 0;
}
/**
* @brief Decode the MBR data found in input
* @param input the 512 byte MBR
* @param partitions decoded data from the 4 partitions in the MBR
* @return 0 if successful
*/
int mbr_decode(const uint8_t input[512], struct mbr_partition partitions[4])
{
memset(partitions, 0, 4 * sizeof(struct mbr_partition));
if (input[510] != 0x55 || input[511] != 0xaa)
ERR_RETURN("MBR signature missing");
int i;
for (i = 0; i < 4; i++) {
if (read_partition(&input[446 + i * 16], &partitions[i]) < 0)
return -1;
}
return 0;
}
static int mbr_cfg_to_partitions(cfg_t *cfg, struct mbr_partition *partitions, int *found_partitions)
{
cfg_t *partition;
int i = 0;
int found = 0;
memset(partitions, 0, 4 * sizeof(struct mbr_partition));
while ((partition = cfg_getnsec(cfg, "partition", i++)) != NULL) {
int partition_ix = strtoul(cfg_title(partition), NULL, 0);
if (partition_ix < 0 || partition_ix >= 4)
ERR_RETURN("partition must be numbered 0 through 3");
if (found & (1 << partition_ix))
ERR_RETURN("invalid or duplicate partition number found for %d", partition_ix);
found = found | (1 << partition_ix);
int unverified_type = cfg_getint(partition, "type");
if (unverified_type < 0 || unverified_type > 0xff)
ERR_RETURN("partition %d's type must be between 0 and 255", partition_ix);
partitions[partition_ix].partition_type = unverified_type;
const char *unverified_block_offset = cfg_getstr(partition, "block-offset");
if (!unverified_block_offset || *unverified_block_offset == '\0')
ERR_RETURN("partition %d's block_offset is required", partition_ix);
char *endptr;
unsigned long block_offset = strtoul(unverified_block_offset, &endptr, 0);
// strtoul returns error by returning ULONG_MAX and setting errno.
// Values bigger than 2^32-1 won't fit in the MBR, so report an
// error for those too.
if ((block_offset == ULONG_MAX && errno != 0) || block_offset >= UINT32_MAX)
ERR_RETURN("partition %d's block_offset must be positive and less than 2^32 - 1: '%s'", partition_ix, unverified_block_offset);
if (*endptr != '\0')
ERR_RETURN("error parsing partition %d's block offset", partition_ix);
partitions[partition_ix].block_offset = block_offset;
partitions[partition_ix].block_count = cfg_getint(partition, "block-count");
if (partitions[partition_ix].block_count >= INT32_MAX)
ERR_RETURN("partition %d's block-count must be specified and less than 2^31 - 1", partition_ix);
partitions[partition_ix].boot_flag = cfg_getbool(partition, "boot");
}
if (found_partitions)
*found_partitions = found;
return 0;
}
static int mbr_cfg_to_osip(cfg_t *cfg, struct osip_header *osip)
{
cfg_t *osii;
int i = 0;
int found = 0;
int largest_osii_ix = -1;
memset(osip, 0, sizeof(struct osip_header));
osip->include_osip = cfg_getbool(cfg, "include-osip");
if (!osip->include_osip)
return 0;
osip->major = cfg_getint(cfg, "osip-major");
osip->minor = cfg_getint(cfg, "osip-minor");
osip->num_pointers = cfg_getint(cfg, "osip-num-pointers");
while ((osii = cfg_getnsec(cfg, "osii", i++)) != NULL) {
int osii_ix = strtoul(cfg_title(osii), NULL, 0);
if (osii_ix < 0 || osii_ix >= 15)
ERR_RETURN("osii must be numbered 0 through 15");
if (found & (1 << osii_ix))
ERR_RETURN("invalid or duplicate osii number found");
found = found | (1 << osii_ix);
if (osii_ix > largest_osii_ix)
largest_osii_ix = osii_ix;
osip->descriptors[osii_ix].os_major = cfg_getint(osii, "os-major");
osip->descriptors[osii_ix].os_minor = cfg_getint(osii, "os-minor");
osip->descriptors[osii_ix].start_block_offset = cfg_getint(osii, "start-block-offset");
osip->descriptors[osii_ix].ddr_load_address = cfg_getint(osii, "ddr-load-address");
osip->descriptors[osii_ix].entry_point = cfg_getint(osii, "entry-point");
osip->descriptors[osii_ix].image_size = cfg_getint(osii, "image-size-blocks");
osip->descriptors[osii_ix].attribute = cfg_getint(osii, "attribute");
}
osip->num_images = largest_osii_ix + 1;
if (osip->num_images == 0)
ERR_RETURN("need to specify one or more osii");
return 0;
}
int mbr_verify_cfg(cfg_t *cfg)
{
int found_partitions = 0;
struct mbr_partition partitions[4];
struct osip_header osip;
const char *bootstrap_hex = cfg_getstr(cfg, "bootstrap-code");
if (bootstrap_hex) {
if (strlen(bootstrap_hex) != 440 * 2)
ERR_RETURN("bootstrap-code should be exactly 440 bytes");
}
if (mbr_cfg_to_osip(cfg, &osip) < 0)
return -1;
if (osip.include_osip && bootstrap_hex)
ERR_RETURN("cannot specify OSIP if including bootstrap code");
if (mbr_cfg_to_partitions(cfg, partitions, &found_partitions) < 0)
return -1;
if (found_partitions == 0)
ERR_RETURN("empty partition table?");
return mbr_verify(partitions);
}
int mbr_create_cfg(cfg_t *cfg, uint8_t output[512])
{
struct mbr_partition partitions[4];
struct osip_header osip;
if (mbr_cfg_to_partitions(cfg, partitions, NULL) < 0)
return -1;
if (mbr_cfg_to_osip(cfg, &osip) < 0)
return -1;
uint8_t bootstrap[440];
memset(bootstrap, 0, sizeof(bootstrap));
const char *bootstrap_hex = cfg_getstr(cfg, "bootstrap-code");
if (bootstrap_hex &&
(hex_to_bytes(bootstrap_hex, bootstrap, sizeof(bootstrap)) < 0))
return -1;
const char *raw_signature = cfg_getstr(cfg, "signature");
uint32_t signature = !raw_signature ? 0 : strtoul(raw_signature, NULL, 0);
return mbr_create(partitions, bootstrap_hex ? bootstrap : NULL, &osip, signature, output);
}
|
649984.c | /* resample with an index image
*
* 15/11/15
* - from affine.c
*/
/*
This file is part of VIPS.
VIPS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
/*
#define DEBUG_VERBOSE
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <vips/vips.h>
#include <vips/debug.h>
#include <vips/internal.h>
#include <vips/transform.h>
#include "presample.h"
typedef struct _VipsMapim {
VipsResample parent_instance;
VipsImage *index;
VipsInterpolate *interpolate;
/* Need an image vector for start_many / stop_many
*/
VipsImage *in_array[3];
} VipsMapim;
typedef VipsResampleClass VipsMapimClass;
G_DEFINE_TYPE( VipsMapim, vips_mapim, VIPS_TYPE_RESAMPLE );
#define MINMAX( TYPE ) { \
TYPE * restrict p1 = (TYPE *) p; \
\
for( x = 0; x < r->width; x++ ) { \
TYPE px = p1[0]; \
TYPE py = p1[1]; \
\
if( first ) { \
min_x = px; \
max_x = px; \
min_y = py; \
max_y = py; \
\
first = FALSE; \
} \
else { \
if( px > max_x ) \
max_x = px; \
if( px < min_x ) \
min_x = px; \
if( py > max_y ) \
max_y = py; \
if( py < min_y ) \
min_y = py; \
} \
\
p1 += 2; \
} \
}
/* Scan a region and find min/max in the two axes.
*/
static void
vips_mapim_region_minmax( VipsRegion *region, VipsRect *r, VipsRect *bounds )
{
int min_x;
int max_x;
int min_y;
int max_y;
gboolean first;
int x, y;
/* Stop compiler warnings.
*/
min_x = 0;
max_x = 0;
min_y = 0;
max_y = 0;
first = TRUE;
for( y = 0; y < r->height; y++ ) {
VipsPel * restrict p =
VIPS_REGION_ADDR( region, r->left, y + r->top );
switch( region->im->BandFmt ) {
case VIPS_FORMAT_UCHAR:
MINMAX( unsigned char ); break;
case VIPS_FORMAT_CHAR:
MINMAX( signed char ); break;
case VIPS_FORMAT_USHORT:
MINMAX( unsigned short ); break;
case VIPS_FORMAT_SHORT:
MINMAX( signed short ); break;
case VIPS_FORMAT_UINT:
MINMAX( unsigned int ); break;
case VIPS_FORMAT_INT:
MINMAX( signed int ); break;
case VIPS_FORMAT_FLOAT:
case VIPS_FORMAT_COMPLEX:
MINMAX( float ); break;
case VIPS_FORMAT_DOUBLE:
case VIPS_FORMAT_DPCOMPLEX:
MINMAX( double ); break;
default:
g_assert_not_reached();
}
}
/* Add 1 to width/height, since we are rounding float down.
*/
bounds->left = min_x;
bounds->top = min_y;
bounds->width = 1 + max_x - min_x;
bounds->height = 1 + max_y - min_y;
}
#define LOOKUP( TYPE ) { \
TYPE * restrict p1 = (TYPE *) p; \
\
for( x = 0; x < r->width; x++ ) { \
TYPE px = p1[0]; \
TYPE py = p1[1]; \
\
if( px < 0 || \
px >= resample->in->Xsize || \
py < 0 || \
py >= resample->in->Ysize ) { \
for( z = 0; z < ps; z++ ) \
q[z] = 0; \
} \
else \
interpolate( mapim->interpolate, q, ir[0], \
px + window_offset, py + window_offset ); \
\
p1 += 2; \
q += ps; \
} \
}
static int
vips_mapim_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
{
VipsRect *r = &or->valid;
VipsRegion **ir = (VipsRegion **) seq;
const VipsImage **in_array = (const VipsImage **) a;
const VipsMapim *mapim = (VipsMapim *) b;
const VipsResample *resample = VIPS_RESAMPLE( mapim );
const VipsImage *in = in_array[0];
const int window_size =
vips_interpolate_get_window_size( mapim->interpolate );
const int window_offset =
vips_interpolate_get_window_offset( mapim->interpolate );
const VipsInterpolateMethod interpolate =
vips_interpolate_get_method( mapim->interpolate );
const int ps = VIPS_IMAGE_SIZEOF_PEL( in );
VipsRect bounds, image, clipped;
int x, y, z;
#ifdef DEBUG_VERBOSE
printf( "vips_mapim_gen: "
"generating left=%d, top=%d, width=%d, height=%d\n",
r->left,
r->top,
r->width,
r->height );
#endif /*DEBUG_VERBOSE*/
/* Fetch the chunk of the mapim image we need, and find the max/min in
* x and y.
*/
if( vips_region_prepare( ir[1], r ) )
return( -1 );
VIPS_GATE_START( "vips_mapim_gen: work" );
vips_mapim_region_minmax( ir[1], r, &bounds );
VIPS_GATE_STOP( "vips_mapim_gen: work" );
/* The bounding box of that area is what we will need from @in. Add
* enough for the interpolation stencil as well.
*/
bounds.width += window_size - 1;
bounds.height += window_size - 1;
/* Clip against the source image.
*/
image.left = 0;
image.top = 0;
image.width = in->Xsize;
image.height = in->Ysize;
vips_rect_intersectrect( &bounds, &image, &clipped );
#ifdef DEBUG_VERBOSE
printf( "vips_mapim_gen: "
"preparing left=%d, top=%d, width=%d, height=%d\n",
clipped.left,
clipped.top,
clipped.width,
clipped.height );
#endif /*DEBUG_VERBOSE*/
if( vips_rect_isempty( &clipped ) ) {
vips_region_black( or );
return( 0 );
}
if( vips_region_prepare( ir[0], &clipped ) )
return( -1 );
VIPS_GATE_START( "vips_mapim_gen: work" );
/* Resample! x/y loop over pixels in the output image (5).
*/
for( y = 0; y < r->height; y++ ) {
VipsPel * restrict p =
VIPS_REGION_ADDR( ir[1], r->left, y + r->top );
VipsPel * restrict q =
VIPS_REGION_ADDR( or, r->left, y + r->top );
switch( ir[1]->im->BandFmt ) {
case VIPS_FORMAT_UCHAR:
LOOKUP( unsigned char ); break;
case VIPS_FORMAT_CHAR:
LOOKUP( signed char ); break;
case VIPS_FORMAT_USHORT:
LOOKUP( unsigned short ); break;
case VIPS_FORMAT_SHORT:
LOOKUP( signed short ); break;
case VIPS_FORMAT_UINT:
LOOKUP( unsigned int ); break;
case VIPS_FORMAT_INT:
LOOKUP( signed int ); break;
case VIPS_FORMAT_FLOAT:
case VIPS_FORMAT_COMPLEX:
LOOKUP( float ); break;
break;
case VIPS_FORMAT_DOUBLE:
case VIPS_FORMAT_DPCOMPLEX:
LOOKUP( double ); break;
default:
g_assert_not_reached();
}
}
VIPS_GATE_STOP( "vips_mapim_gen: work" );
return( 0 );
}
static int
vips_mapim_build( VipsObject *object )
{
VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object );
VipsResample *resample = VIPS_RESAMPLE( object );
VipsMapim *mapim = (VipsMapim *) object;
VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 );
VipsImage *in;
int window_size;
int window_offset;
if( VIPS_OBJECT_CLASS( vips_mapim_parent_class )->build( object ) )
return( -1 );
if( vips_check_coding_known( class->nickname, resample->in ) ||
vips_check_twocomponents( class->nickname, mapim->index ) )
return( -1 );
in = resample->in;
if( vips_image_decode( in, &t[0] ) )
return( -1 );
in = t[0];
/* We can't use vips_object_argument_isset(), since it may have been
* set to NULL, see vips_similarity().
*/
if( !mapim->interpolate ) {
VipsInterpolate *interpolate;
interpolate = vips_interpolate_new( "bilinear" );
g_object_set( object,
"interpolate", interpolate,
NULL );
g_object_unref( interpolate );
/* coverity gets confused by this, it thinks
* mapim->interpolate may still be null. Assign ourselves,
* even though we don't need to.
*/
mapim->interpolate = interpolate;
}
window_size = vips_interpolate_get_window_size( mapim->interpolate );
window_offset =
vips_interpolate_get_window_offset( mapim->interpolate );
/* Add new pixels around the input so we can interpolate at the edges.
*/
if( vips_embed( in, &t[1],
window_offset, window_offset,
in->Xsize + window_size - 1, in->Ysize + window_size - 1,
"extend", VIPS_EXTEND_COPY,
NULL ) )
return( -1 );
in = t[1];
if( vips_image_pipelinev( resample->out, VIPS_DEMAND_STYLE_SMALLTILE,
in, NULL ) )
return( -1 );
resample->out->Xsize = mapim->index->Xsize;
resample->out->Ysize = mapim->index->Ysize;
mapim->in_array[0] = in;
mapim->in_array[1] = mapim->index;
mapim->in_array[2] = NULL;
if( vips_image_generate( resample->out,
vips_start_many, vips_mapim_gen, vips_stop_many,
mapim->in_array, mapim ) )
return( -1 );
return( 0 );
}
static void
vips_mapim_class_init( VipsMapimClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
VIPS_DEBUG_MSG( "vips_mapim_class_init\n" );
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
vobject_class->nickname = "mapim";
vobject_class->description = _( "resample with an mapim image" );
vobject_class->build = vips_mapim_build;
VIPS_ARG_IMAGE( class, "index", 3,
_( "Index" ),
_( "Index pixels with this" ),
VIPS_ARGUMENT_REQUIRED_INPUT,
G_STRUCT_OFFSET( VipsMapim, index ) );
VIPS_ARG_INTERPOLATE( class, "interpolate", 4,
_( "Interpolate" ),
_( "Interpolate pixels with this" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsMapim, interpolate ) );
}
static void
vips_mapim_init( VipsMapim *mapim )
{
}
/**
* vips_mapim:
* @in: input image
* @out: output image
* @index: index image
* @...: %NULL-terminated list of optional named arguments
*
* Optional arguments:
*
* * @interpolate: interpolate pixels with this
*
* This operator resamples @in using @index to look up pixels. @out is
* the same size as @index, with each pixel being fetched from that position in
* @in. That is:
*
* |[
* out[x, y] = in[index[x, y]]
* ]|
*
* If @index has one band, that band must be complex. Otherwise, @index must
* have two bands of any format.
* Coordinates in @index are in pixels, with (0, 0) being the top-left corner
* of @in, and with y increasing down the image. Use vips_xyz() to build index
* images.
*
* @interpolate defaults to bilinear.
*
* This operation does not change xres or yres. The image resolution needs to
* be updated by the application.
*
* See vips_maplut() for a 1D equivalent of this operation.
*
* See also: vips_xyz(), vips_affine(), vips_resize(),
* vips_maplut(), #VipsInterpolate.
*
* Returns: 0 on success, -1 on error
*/
int
vips_mapim( VipsImage *in, VipsImage **out, VipsImage *index, ... )
{
va_list ap;
int result;
va_start( ap, index );
result = vips_call_split( "mapim", ap, in, out, index );
va_end( ap );
return( result );
}
|
348251.c | /***** ltl3ba : lex.c *****/
/* Written by Denis Oddoux, LIAFA, France */
/* Copyright (c) 2001 Denis Oddoux */
/* Modified by Paul Gastin, LSV, France */
/* Copyright (c) 2007 Paul Gastin */
/* Modified by Tomas Babiak, FI MU, Brno, Czech Republic */
/* Copyright (c) 2012 Tomas Babiak */
/*
/* */
/* 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*/
/* */
/* Based on the translation algorithm by Gastin and Oddoux, */
/* presented at the 13th International Conference on Computer Aided */
/* Verification, CAV 2001, Paris, France. */
/* Proceedings - LNCS 2102, pp. 53-65 */
/* */
/* Send bug-reports and/or questions to Paul Gastin */
/* http://www.lsv.ens-cachan.fr/~gastin */
/* */
/* Some of the code in this file was taken from the Spin software */
/* Written by Gerard J. Holzmann, Bell Laboratories, U.S.A. */
#include <stdlib.h>
#include <ctype.h>
#include "ltl3ba.h"
static Symbol *symtab[Nhash+1];
static int tl_lex(void);
extern YYSTYPE tl_yylval;
char yytext[2048];
#define Token(y) tl_yylval = tl_nn(y,ZN,ZN); return y
int
isalnum_(int c)
{ return (isalnum(c) || c == '_');
}
int
hash(char *s)
{ int h=0;
while (*s)
{ h += *s++;
h <<= 1;
if (h&(Nhash+1))
h |= 1;
}
return h&Nhash;
}
static void
getword(int first, int (*tst)(int))
{ int i=0; char c;
yytext[i++]= (char ) first;
while (tst(c = tl_Getchar()))
yytext[i++] = c;
yytext[i] = '\0';
tl_UnGetchar();
}
static int
follow(int tok, int ifyes, int ifno)
{ int c;
char buf[32];
extern int tl_yychar;
if ((c = tl_Getchar()) == tok)
return ifyes;
tl_UnGetchar();
tl_yychar = c;
sprintf(buf, "expected '%c'", tok);
tl_yyerror(buf); /* no return from here */
return ifno;
}
int
tl_yylex(void)
{ int c = tl_lex();
#if 0
printf("c = %d\n", c);
#endif
return c;
}
static int
tl_lex(void)
{ int c;
do {
c = tl_Getchar();
yytext[0] = (char ) c;
yytext[1] = '\0';
if (c <= 0)
{ Token(';');
}
} while (c == ' '); /* '\t' is removed in tl_main.c */
if (islower(c))
{ getword(c, isalnum_);
if (strcmp("true", yytext) == 0)
{ Token(TRUE);
}
if (strcmp("false", yytext) == 0)
{ Token(FALSE);
}
tl_yylval = tl_nn(PREDICATE,ZN,ZN);
tl_yylval->sym = tl_lookup(yytext);
return PREDICATE;
}
if (c == '<')
{ c = tl_Getchar();
if (c == '>')
{ Token(EVENTUALLY);
}
if (c != '-')
{ tl_UnGetchar();
tl_yyerror("expected '<>' or '<->'");
}
c = tl_Getchar();
if (c == '>')
{ Token(EQUIV);
}
tl_UnGetchar();
tl_yyerror("expected '<->'");
}
switch (c) {
case '/' : c = follow('\\', AND, '/'); break;
case '\\': c = follow('/', OR, '\\'); break;
case '&' : c = follow('&', AND, '&'); break;
case '|' : c = follow('|', OR, '|'); break;
case '[' : c = follow(']', ALWAYS, '['); break;
case '-' : c = follow('>', IMPLIES, '-'); break;
case '!' : c = NOT; break;
case 'U' : c = U_OPER; break;
case 'V' : c = V_OPER; break;
case 'R' : c = V_OPER; break;
case 'G' : c = ALWAYS; break;
case 'F' : c = EVENTUALLY; break;
#ifdef NXT
case 'X' : c = NEXT; break;
#endif
default : break;
}
Token(c);
}
Symbol *
tl_lookup(char *s)
{ Symbol *sp;
int h = hash(s);
for (sp = symtab[h]; sp; sp = sp->next)
if (strcmp(sp->name, s) == 0)
return sp;
sp = (Symbol *) tl_emalloc(sizeof(Symbol));
sp->name = (char *) tl_emalloc(strlen(s) + 1);
strcpy(sp->name, s);
sp->next = symtab[h];
symtab[h] = sp;
return sp;
}
Symbol *
getsym(Symbol *s)
{ Symbol *n = (Symbol *) tl_emalloc(sizeof(Symbol));
n->name = s->name;
return n;
}
|
299168.c | /*
* comedi/drivers/dt2801.c
* Device Driver for DataTranslation DT2801
*
*/
/*
Driver: dt2801
Description: Data Translation DT2801 series and DT01-EZ
Author: ds
Status: works
Devices: [Data Translation] DT2801 (dt2801), DT2801-A, DT2801/5716A,
DT2805, DT2805/5716A, DT2808, DT2818, DT2809, DT01-EZ
This driver can autoprobe the type of board.
Configuration options:
[0] - I/O port base address
[1] - unused
[2] - A/D reference 0=differential, 1=single-ended
[3] - A/D range
0 = [-10, 10]
1 = [0,10]
[4] - D/A 0 range
0 = [-10, 10]
1 = [-5,5]
2 = [-2.5,2.5]
3 = [0,10]
4 = [0,5]
[5] - D/A 1 range (same choices)
*/
#include "../comedidev.h"
#include <linux/delay.h>
#include <linux/ioport.h>
#define DT2801_TIMEOUT 1000
/* Hardware Configuration */
/* ====================== */
#define DT2801_MAX_DMA_SIZE (64 * 1024)
/* Ports */
#define DT2801_IOSIZE 2
/* define's */
/* ====================== */
/* Commands */
#define DT_C_RESET 0x0
#define DT_C_CLEAR_ERR 0x1
#define DT_C_READ_ERRREG 0x2
#define DT_C_SET_CLOCK 0x3
#define DT_C_TEST 0xb
#define DT_C_STOP 0xf
#define DT_C_SET_DIGIN 0x4
#define DT_C_SET_DIGOUT 0x5
#define DT_C_READ_DIG 0x6
#define DT_C_WRITE_DIG 0x7
#define DT_C_WRITE_DAIM 0x8
#define DT_C_SET_DA 0x9
#define DT_C_WRITE_DA 0xa
#define DT_C_READ_ADIM 0xc
#define DT_C_SET_AD 0xd
#define DT_C_READ_AD 0xe
/* Command modifiers (only used with read/write), EXTTRIG can be
used with some other commands.
*/
#define DT_MOD_DMA (1<<4)
#define DT_MOD_CONT (1<<5)
#define DT_MOD_EXTCLK (1<<6)
#define DT_MOD_EXTTRIG (1<<7)
/* Bits in status register */
#define DT_S_DATA_OUT_READY (1<<0)
#define DT_S_DATA_IN_FULL (1<<1)
#define DT_S_READY (1<<2)
#define DT_S_COMMAND (1<<3)
#define DT_S_COMPOSITE_ERROR (1<<7)
/* registers */
#define DT2801_DATA 0
#define DT2801_STATUS 1
#define DT2801_CMD 1
#if 0
/* ignore 'defined but not used' warning */
static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = { 4, {
RANGE(-10,
10),
RANGE(-5,
5),
RANGE
(-2.5,
2.5),
RANGE
(-1.25,
1.25),
}
};
#endif
static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = { 4, {
RANGE(-10,
10),
RANGE(-1,
1),
RANGE
(-0.1,
0.1),
RANGE
(-0.02,
0.02),
}
};
#if 0
/* ignore 'defined but not used' warning */
static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = { 4, {
RANGE(0,
10),
RANGE(0,
5),
RANGE(0,
2.5),
RANGE(0,
1.25),
}
};
#endif
static const struct comedi_lrange range_dt2801_ai_pgl_unipolar = { 4, {
RANGE(0,
10),
RANGE(0,
1),
RANGE(0,
0.1),
RANGE(0,
0.02),
}
};
struct dt2801_board {
const char *name;
int boardcode;
int ad_diff;
int ad_chan;
int adbits;
int adrangetype;
int dabits;
};
/* Typeid's for the different boards of the DT2801-series
(taken from the test-software, that comes with the board)
*/
static const struct dt2801_board boardtypes[] = {
{
.name = "dt2801",
.boardcode = 0x09,
.ad_diff = 2,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2801-a",
.boardcode = 0x52,
.ad_diff = 2,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2801/5716a",
.boardcode = 0x82,
.ad_diff = 1,
.ad_chan = 16,
.adbits = 16,
.adrangetype = 1,
.dabits = 12},
{
.name = "dt2805",
.boardcode = 0x12,
.ad_diff = 1,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2805/5716a",
.boardcode = 0x92,
.ad_diff = 1,
.ad_chan = 16,
.adbits = 16,
.adrangetype = 1,
.dabits = 12},
{
.name = "dt2808",
.boardcode = 0x20,
.ad_diff = 0,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 2,
.dabits = 8},
{
.name = "dt2818",
.boardcode = 0xa2,
.ad_diff = 0,
.ad_chan = 4,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2809",
.boardcode = 0xb0,
.ad_diff = 0,
.ad_chan = 8,
.adbits = 12,
.adrangetype = 1,
.dabits = 12},
};
#define boardtype (*(const struct dt2801_board *)dev->board_ptr)
struct dt2801_private {
const struct comedi_lrange *dac_range_types[2];
unsigned int ao_readback[2];
};
#define devpriv ((struct dt2801_private *)dev->private)
/* These are the low-level routines:
writecommand: write a command to the board
writedata: write data byte
readdata: read data byte
*/
/* Only checks DataOutReady-flag, not the Ready-flag as it is done
in the examples of the manual. I don't see why this should be
necessary. */
static int dt2801_readdata(struct comedi_device *dev, int *data)
{
int stat = 0;
int timeout = DT2801_TIMEOUT;
do {
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & (DT_S_COMPOSITE_ERROR | DT_S_READY))
return stat;
if (stat & DT_S_DATA_OUT_READY) {
*data = inb_p(dev->iobase + DT2801_DATA);
return 0;
}
} while (--timeout > 0);
return -ETIME;
}
static int dt2801_readdata2(struct comedi_device *dev, int *data)
{
int lb, hb;
int ret;
ret = dt2801_readdata(dev, &lb);
if (ret)
return ret;
ret = dt2801_readdata(dev, &hb);
if (ret)
return ret;
*data = (hb << 8) + lb;
return 0;
}
static int dt2801_writedata(struct comedi_device *dev, unsigned int data)
{
int stat = 0;
int timeout = DT2801_TIMEOUT;
do {
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_COMPOSITE_ERROR)
return stat;
if (!(stat & DT_S_DATA_IN_FULL)) {
outb_p(data & 0xff, dev->iobase + DT2801_DATA);
return 0;
}
#if 0
if (stat & DT_S_READY) {
printk
("dt2801: ready flag set (bad!) in dt2801_writedata()\n");
return -EIO;
}
#endif
} while (--timeout > 0);
return -ETIME;
}
static int dt2801_writedata2(struct comedi_device *dev, unsigned int data)
{
int ret;
ret = dt2801_writedata(dev, data & 0xff);
if (ret < 0)
return ret;
ret = dt2801_writedata(dev, (data >> 8));
if (ret < 0)
return ret;
return 0;
}
static int dt2801_wait_for_ready(struct comedi_device *dev)
{
int timeout = DT2801_TIMEOUT;
int stat;
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_READY)
return 0;
do {
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_COMPOSITE_ERROR)
return stat;
if (stat & DT_S_READY)
return 0;
} while (--timeout > 0);
return -ETIME;
}
static int dt2801_writecmd(struct comedi_device *dev, int command)
{
int stat;
dt2801_wait_for_ready(dev);
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_COMPOSITE_ERROR) {
printk
("dt2801: composite-error in dt2801_writecmd(), ignoring\n");
}
if (!(stat & DT_S_READY))
printk("dt2801: !ready in dt2801_writecmd(), ignoring\n");
outb_p(command, dev->iobase + DT2801_CMD);
return 0;
}
static int dt2801_reset(struct comedi_device *dev)
{
int board_code = 0;
unsigned int stat;
int timeout;
DPRINTK("dt2801: resetting board...\n");
DPRINTK("fingerprint: 0x%02x 0x%02x\n", inb_p(dev->iobase),
inb_p(dev->iobase + 1));
/* pull random data from data port */
inb_p(dev->iobase + DT2801_DATA);
inb_p(dev->iobase + DT2801_DATA);
inb_p(dev->iobase + DT2801_DATA);
inb_p(dev->iobase + DT2801_DATA);
DPRINTK("dt2801: stop\n");
/* dt2801_writecmd(dev,DT_C_STOP); */
outb_p(DT_C_STOP, dev->iobase + DT2801_CMD);
/* dt2801_wait_for_ready(dev); */
udelay(100);
timeout = 10000;
do {
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_READY)
break;
} while (timeout--);
if (!timeout)
printk("dt2801: timeout 1 status=0x%02x\n", stat);
/* printk("dt2801: reading dummy\n"); */
/* dt2801_readdata(dev,&board_code); */
DPRINTK("dt2801: reset\n");
outb_p(DT_C_RESET, dev->iobase + DT2801_CMD);
/* dt2801_writecmd(dev,DT_C_RESET); */
udelay(100);
timeout = 10000;
do {
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_READY)
break;
} while (timeout--);
if (!timeout)
printk("dt2801: timeout 2 status=0x%02x\n", stat);
DPRINTK("dt2801: reading code\n");
dt2801_readdata(dev, &board_code);
DPRINTK("dt2801: ok. code=0x%02x\n", board_code);
return board_code;
}
static int probe_number_of_ai_chans(struct comedi_device *dev)
{
int n_chans;
int stat;
int data;
for (n_chans = 0; n_chans < 16; n_chans++) {
stat = dt2801_writecmd(dev, DT_C_READ_ADIM);
dt2801_writedata(dev, 0);
dt2801_writedata(dev, n_chans);
stat = dt2801_readdata2(dev, &data);
if (stat)
break;
}
dt2801_reset(dev);
dt2801_reset(dev);
return n_chans;
}
static const struct comedi_lrange *dac_range_table[] = {
&range_bipolar10,
&range_bipolar5,
&range_bipolar2_5,
&range_unipolar10,
&range_unipolar5
};
static const struct comedi_lrange *dac_range_lkup(int opt)
{
if (opt < 0 || opt >= 5)
return &range_unknown;
return dac_range_table[opt];
}
static const struct comedi_lrange *ai_range_lkup(int type, int opt)
{
switch (type) {
case 0:
return (opt) ?
&range_dt2801_ai_pgl_unipolar :
&range_dt2801_ai_pgl_bipolar;
case 1:
return (opt) ? &range_unipolar10 : &range_bipolar10;
case 2:
return &range_unipolar5;
}
return &range_unknown;
}
static int dt2801_error(struct comedi_device *dev, int stat)
{
if (stat < 0) {
if (stat == -ETIME)
printk("dt2801: timeout\n");
else
printk("dt2801: error %d\n", stat);
return stat;
}
printk("dt2801: error status 0x%02x, resetting...\n", stat);
dt2801_reset(dev);
dt2801_reset(dev);
return -EIO;
}
static int dt2801_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int d;
int stat;
int i;
for (i = 0; i < insn->n; i++) {
stat = dt2801_writecmd(dev, DT_C_READ_ADIM);
dt2801_writedata(dev, CR_RANGE(insn->chanspec));
dt2801_writedata(dev, CR_CHAN(insn->chanspec));
stat = dt2801_readdata2(dev, &d);
if (stat != 0)
return dt2801_error(dev, stat);
data[i] = d;
}
return i;
}
static int dt2801_ao_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
data[0] = devpriv->ao_readback[CR_CHAN(insn->chanspec)];
return 1;
}
static int dt2801_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
dt2801_writecmd(dev, DT_C_WRITE_DAIM);
dt2801_writedata(dev, CR_CHAN(insn->chanspec));
dt2801_writedata2(dev, data[0]);
devpriv->ao_readback[CR_CHAN(insn->chanspec)] = data[0];
return 1;
}
static int dt2801_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int which = 0;
if (s == &dev->subdevices[3])
which = 1;
if (data[0]) {
s->state &= ~data[0];
s->state |= (data[0] & data[1]);
dt2801_writecmd(dev, DT_C_WRITE_DIG);
dt2801_writedata(dev, which);
dt2801_writedata(dev, s->state);
}
dt2801_writecmd(dev, DT_C_READ_DIG);
dt2801_writedata(dev, which);
dt2801_readdata(dev, data + 1);
return insn->n;
}
static int dt2801_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int which = 0;
if (s == &dev->subdevices[3])
which = 1;
/* configure */
switch (data[0]) {
case INSN_CONFIG_DIO_OUTPUT:
s->io_bits = 0xff;
dt2801_writecmd(dev, DT_C_SET_DIGOUT);
break;
case INSN_CONFIG_DIO_INPUT:
s->io_bits = 0;
dt2801_writecmd(dev, DT_C_SET_DIGIN);
break;
case INSN_CONFIG_DIO_QUERY:
data[1] = s->io_bits ? COMEDI_OUTPUT : COMEDI_INPUT;
return insn->n;
default:
return -EINVAL;
}
dt2801_writedata(dev, which);
return 1;
}
/*
options:
[0] - i/o base
[1] - unused
[2] - a/d 0=differential, 1=single-ended
[3] - a/d range 0=[-10,10], 1=[0,10]
[4] - dac0 range 0=[-10,10], 1=[-5,5], 2=[-2.5,2.5] 3=[0,10], 4=[0,5]
[5] - dac1 range 0=[-10,10], 1=[-5,5], 2=[-2.5,2.5] 3=[0,10], 4=[0,5]
*/
static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
unsigned long iobase;
int board_code, type;
int ret = 0;
int n_ai_chans;
iobase = it->options[0];
if (!request_region(iobase, DT2801_IOSIZE, "dt2801")) {
comedi_error(dev, "I/O port conflict");
return -EIO;
}
dev->iobase = iobase;
/* do some checking */
board_code = dt2801_reset(dev);
/* heh. if it didn't work, try it again. */
if (!board_code)
board_code = dt2801_reset(dev);
for (type = 0; type < ARRAY_SIZE(boardtypes); type++) {
if (boardtypes[type].boardcode == board_code)
goto havetype;
}
printk("dt2801: unrecognized board code=0x%02x, contact author\n",
board_code);
type = 0;
havetype:
dev->board_ptr = boardtypes + type;
printk("dt2801: %s at port 0x%lx", boardtype.name, iobase);
n_ai_chans = probe_number_of_ai_chans(dev);
printk(" (ai channels = %d)\n", n_ai_chans);
ret = comedi_alloc_subdevices(dev, 4);
if (ret)
goto out;
ret = alloc_private(dev, sizeof(struct dt2801_private));
if (ret < 0)
return ret;
dev->board_name = boardtype.name;
s = &dev->subdevices[0];
/* ai subdevice */
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND;
#if 1
s->n_chan = n_ai_chans;
#else
if (it->options[2])
s->n_chan = boardtype.ad_chan;
else
s->n_chan = boardtype.ad_chan / 2;
#endif
s->maxdata = (1 << boardtype.adbits) - 1;
s->range_table = ai_range_lkup(boardtype.adrangetype, it->options[3]);
s->insn_read = dt2801_ai_insn_read;
s = &dev->subdevices[1];
/* ao subdevice */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
s->n_chan = 2;
s->maxdata = (1 << boardtype.dabits) - 1;
s->range_table_list = devpriv->dac_range_types;
devpriv->dac_range_types[0] = dac_range_lkup(it->options[4]);
devpriv->dac_range_types[1] = dac_range_lkup(it->options[5]);
s->insn_read = dt2801_ao_insn_read;
s->insn_write = dt2801_ao_insn_write;
s = &dev->subdevices[2];
/* 1st digital subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = dt2801_dio_insn_bits;
s->insn_config = dt2801_dio_insn_config;
s = &dev->subdevices[3];
/* 2nd digital subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = dt2801_dio_insn_bits;
s->insn_config = dt2801_dio_insn_config;
ret = 0;
out:
return ret;
}
static void dt2801_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, DT2801_IOSIZE);
}
static struct comedi_driver dt2801_driver = {
.driver_name = "dt2801",
.module = THIS_MODULE,
.attach = dt2801_attach,
.detach = dt2801_detach,
};
module_comedi_driver(dt2801_driver);
MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi low-level driver");
MODULE_LICENSE("GPL");
|
596663.c | /****************************************************************************
* heli_q8_main.c
*
* This file was generated automatically by QUARC. It serves as the main
* entry point for the real-time code.
*
* Date: Sat Nov 14 10:45:51 2020
* Model version: 1.67
* Matlab version: 8.9 (R2015b) 13-Aug-2015
****************************************************************************/
#include <windows.h>
#include <mmsystem.h>
#include <direct.h>
#include <signal.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "rtwtypes.h"
#include "rtmodel.h"
#include "rt_sim.h"
#include "rt_nonfinite.h"
#include "ext_work.h"
#include "quanser_timer.h"
#include "quanser_semaphore.h"
#include "quanser_thread.h"
#include "quanser_signal.h"
#include "quanser_string.h"
#include "quanser_messages.h"
/*=========*
* Defines *
*=========*/
static const int_T exit_failure = 1;
static const int_T exit_success = 0;
#define STRINGIZE1(name) #name
#define STRINGIZE(name) STRINGIZE1(name) /* need to expand name */
#ifndef RT
# error "must define RT"
#endif
static const real_T RUN_FOREVER = -1.0;
typedef RT_MODEL_heli_q8_T RT_MODEL;
/*====================*
* External functions *
*====================*/
EXTERN RT_MODEL * heli_q8(void);
/* A global buffer for storing error messages (defined in quanser_common library) */
EXTERN char _rt_error_message[512];
EXTERN void MdlInitializeSizes(void);
EXTERN void MdlInitializeSampleTimes(void);
EXTERN void MdlStart(void);
EXTERN void MdlOutputs(int_T tid);
EXTERN void MdlUpdate(int_T tid);
EXTERN void MdlTerminate(void);
static void initialize_sizes(RT_MODEL * S)
{
MdlInitializeSizes();
}
static void initialize_sample_times(RT_MODEL * S)
{
MdlInitializeSampleTimes();
}
static void start(RT_MODEL * S)
{
MdlStart();
}
static void outputs(RT_MODEL * S, int_T tid)
{
MdlOutputs(tid);
}
static void update(RT_MODEL * S, int_T tid)
{
MdlUpdate(tid);
}
static void terminate(RT_MODEL * S)
{
MdlTerminate();
}
EXTERN void rt_ODECreateIntegrationData(RTWSolverInfo *si);
EXTERN void rt_ODEUpdateContinuousStates(RTWSolverInfo *si);
static void rt_CreateIntegrationData(RT_MODEL * S)
{
rt_ODECreateIntegrationData(rtmGetRTWSolverInfo(S));
}
static void rt_UpdateContinuousStates(RT_MODEL * S)
{
rt_ODEUpdateContinuousStates(rtmGetRTWSolverInfo(S));
}
/*==================================*
* Global data local to this module *
*==================================*/
static struct {
int_T overrunFlags[1];
int_T isrOverrun;
boolean_T stopExecutionFlag;
boolean_T startedFlag;
char message[256];
char submessage[192];
} GBLbuf;
EXTERN void rtExtModeStart(void);
EXTERN void rtExtModeQuarcCleanup(int_T numSampTimes);
EXTERN boolean_T rtExtModeQuarcStartup(RTWExtModeInfo *ei,
int_T num_sample_times,
boolean_T *stopReqPtr,
int_T priority,
int32_T stack_size,
boolean_T enable_printing);
EXTERN void rtExtModeQuarcParseArgs(int_T argc,
const char_T *argv[],
const char_T *default_uri);
EXTERN void rtExtSetReturnStatus(const char * message);
EXTERN void
_do_assertion(const char * expression, const char * file_name, int line_number)
{
string_format(GBLbuf.message, sizeof(GBLbuf.message),
"Assertion in %s at line %d: (%s) is false",
file_name, line_number, expression);
rtmSetErrorStatus(heli_q8_M, GBLbuf.message);
}
typedef struct tag_subrate_info {
RT_MODEL * S;
qthread_t thread;
qthread_id_t thread_id;
qsem_t sem;
int_T tid;
int_T eventFlag;
} subrate_info_T;
static subrate_info_T subrate_info[1];
/* Function: tSubRate ========================================================
* Abstract:
* This is the entry point for each sub-rate task. This task simply executes
* the appropriate blocks in the model each time the passed semaphore is
* given. This routine returns only when execution should be stopped.
*/
static int_T tSubRate(RT_MODEL * S, qsem_t * sem, int_T tid)
{
while (1) {
if (qsem_wait(sem) || GBLbuf.stopExecutionFlag) {
break;
}
/*
If the semaphore is still signaled after we wait then
it was signaled twice so the sub-rate task has not been
able to keep up. An overrun has occurred.
*/
if (qsem_trywait(sem) == 0) {
(void) fprintf(stderr, "Rate for subrate task %d is too fast.\n", tid);
fflush(stderr);
}
outputs(S, tid);
rtExtModeUpload(tid, rtmGetTaskTime(S, tid));
update(S, tid);
rt_SimUpdateDiscreteTaskTime(rtmGetTPtr(S), rtmGetTimingData(S), tid);
}
return(1);
} /* end tSubRate */
qthread_return_t QTHREAD_DECL subrate_start_routine(void * argument)
{
subrate_info_T * context = (subrate_info_T *) argument;
qsigset_t signal_set;
qsigemptyset(&signal_set);
qsigaddset(&signal_set, SIGINT);
qsigaddset(&signal_set, SIGBREAK);
qthread_sigmask(QSIG_BLOCK, &signal_set, NULL);
tSubRate(context->S, &context->sem, context->tid);
return (qthread_return_t) 0;
}
/* Function: rtOneStep =======================================================
*
* Abstract:
* Perform one step of the model for the base rate task and signal
* subrate tasks to run when appropriate.
*/
static void rt_OneStep(RT_MODEL * S)
{
int_T i;
int_T eventFlags[1];
real_T tnext;
int_T *sampleHit = rtmGetSampleHitPtr(S);
/***********************************************
* Check and see if error status has been set *
***********************************************/
if (rtmGetErrorStatus(S) != NULL) {
GBLbuf.stopExecutionFlag = 1;
return;
}
/* enable interrupts here */
/************************************************************************
* Update discrete events and buffer event flags locally so that ISR is *
* re-entrant. *
************************************************************************/
tnext = rt_SimUpdateDiscreteEvents(rtmGetNumSampleTimes(S),
rtmGetTimingData(S),
rtmGetSampleHitPtr(S),
rtmGetPerTaskSampleHitsPtr(S));
rtsiSetSolverStopTime(rtmGetRTWSolverInfo(S),tnext);
for (i=0; i < 1; i++) {
eventFlags[i] = sampleHit[i + 2];
}
/*******************************************
* Step the model for the base sample time *
*******************************************/
outputs(S, 1);
rtExtModeUploadCheckTrigger(rtmGetNumSampleTimes(S));
rtExtModeUpload(1, rtmGetTaskTime(S, 1));
update(S, 1);
if (rtmGetSampleTime(S,0) == CONTINUOUS_SAMPLE_TIME) {
rt_UpdateContinuousStates(S);
} else {
rt_SimUpdateDiscreteTaskTime(rtmGetTPtr(S),
rtmGetTimingData(S), 0);
}
rt_SimUpdateDiscreteTaskTime(rtmGetTPtr(S),
rtmGetTimingData(S),1);
/************************************************************************
* Model step complete for base sample time, now it is okay to *
* re-interrupt this ISR. *
************************************************************************/
/*********************************************
* Step the model for any other sample times *
*********************************************/
for (i=0; i < 1; i++) {
if (eventFlags[i]) {
/* Signal any lower priority tasks that have a hit,
* then check to see if the task locked the semaphore
* (i.e. if it was blocking at the time the semaphore
* was posted). If not, it means that task did not
* finish in its alloted time period.
*
* NOTE: On a single (not hyperthreaded) CPU, these tasks
* won't run until the base rate thread goes to sleep
* because they have a lower priority. However, on a
* hyperthreaded or multiple CPU system, a task may
* run immediately.
*/
qsem_post(&subrate_info[i].sem);
}
}
rtExtModeCheckEndTrigger();
} /* end rtOneStep */
static void
control_c_handler(int signal_number)
{
/*
Set a global flag to stop model execution and
terminate cleanly. Signal the start semaphore
to make the model exit if it is waiting for
a start signal from the host.
*/
GBLbuf.stopExecutionFlag = 1;
rtExtModeStart();
hil_task_stop(heli_q8_DW.HILReadEncoderTimebase_Task)
;
}
int
main(int argc, char * argv[])
{
RT_MODEL * S;
const char * status;
int_T count;
int exit_code = exit_success;
boolean_T parseError = false;
real_T final_time = -2; /* Let model select final time */
int scheduling_priority;
struct qsched_param scheduling;
t_error result;
/*
* Make controller threads higher priority than external mode threads:
* ext_priority = priority of lowest priority external mode thread
* min_priority = minimum allowable priority of lowest priority model task
* max_priority = maximum allowable priority of lowest priority model task
*/
int ext_priority = qsched_get_priority_min(QSCHED_FIFO);
int min_priority = ext_priority + 2;
int max_priority = qsched_get_priority_max(QSCHED_FIFO) - 1;
qsigset_t signal_set;
qsigaction_t action;
int_T stack_size = 0; /* default stack size */
(void) ssPrintf("Entered main(argc=%d, argv=%p)\n", argc, argv);
for (count = 0; count < argc; count++) {
(void) ssPrintf(" argv[%d] = %s\n", count, argv[count]);
}
scheduling_priority = 2; /* default priority */
if (scheduling_priority < min_priority) {
scheduling_priority = min_priority;
} else if (scheduling_priority > max_priority) {
scheduling_priority = max_priority;
}
/*
* Parse the standard RTW parameters. Let all unrecognized parameters
* pass through to external mode for parsing. NULL out all args handled
* so that the external mode parsing can ignore them.
*/
for (count = 1; count < argc; ) {
const char *option = argv[count++];
char extraneous_characters[2];
if ((strcmp(option, "-tf") == 0) && (count != argc)) {/* final time */
const char * tf_argument = argv[count++];
double time_value; /* use a double for the sscanf since real_T may be a float or a double depending on the platform */
if (strcmp(tf_argument, "inf") == 0) {
time_value = RUN_FOREVER;
} else {
int items = sscanf(tf_argument, "%lf%1s", &time_value,
extraneous_characters);
if ((items != 1) || (time_value < 0.0) ) {
(void) fprintf(stderr,
"final_time must be a positive, real value or inf.\n");
parseError = true;
break;
}
}
final_time = (real_T) time_value;
argv[count-2] = NULL;
argv[count-1] = NULL;
} else if ((strcmp(option, "-pri") == 0) && (count != argc)) {/* base priority */
const char * pri_argument = argv[count++];
int priority; /* use an int for the sscanf since int_T may be the wrong size depending on the platform */
int items = sscanf(pri_argument, "%d%1s", &priority, extraneous_characters);
if ((items != 1) || (priority < min_priority) ) {
(void) fprintf(stderr,
"priority must be a greater than or equal to %d.\n",
min_priority);
parseError = true;
break;
}
if (priority > max_priority) {
(void) fprintf(stderr, "priority must be less than or equal to %d.\n",
max_priority);
parseError = true;
break;
}
scheduling_priority = priority;
argv[count-2] = NULL;
argv[count-1] = NULL;
} else if ((strcmp(option, "-ss") == 0) && (count != argc)) {/* stack size */
const char * stack_argument = argv[count++];
int stack; /* use an int for the sscanf since int_T may be the wrong size depending on the platform */
int items = sscanf(stack_argument, "%d%1s", &stack, extraneous_characters);
if ((items != 1) || (stack < QTHREAD_STACK_MIN) ) {
(void) fprintf(stderr,
"stack size must be a integral value greater than or equal to %d.\n",
QTHREAD_STACK_MIN);
parseError = true;
break;
}
stack_size = (int_T)stack;
argv[count-2] = NULL;
argv[count-1] = NULL;
} else if ((strcmp(option, "-d") == 0) && (count != argc)) {/* current directory */
const char * path_name = argv[count++];
_chdir(path_name);
argv[count-2] = NULL;
argv[count-1] = NULL;
}
}
rtExtModeQuarcParseArgs(argc, (const char **) argv, "shmem://heli_q8:1");
/*
* Check for unprocessed ("unhandled") args.
*/
for (count = 1; count < argc; count++) {
if (argv[count] != NULL) {
(void) fprintf(stderr, "Unexpected command line argument: \"%s\".\n",
argv[count]);
parseError = true;
}
}
if (parseError) {
(void) fprintf(stderr,
"\nUsage: heli_q8 -option1 val1 -option2 val2 -option3 ...\n\n");
(void) fprintf(stderr,
"\t-tf 20 - sets final time to 20 seconds\n");
(void) fprintf(stderr,
"\t-d C:\\data - sets current directory to C:\\data\n");
(void) fprintf(stderr,
"\t-pri 5 - sets the minimum thread priority\n");
(void) fprintf(stderr,
"\t-ss 65536 - sets the stack size for model threads\n");
(void) fprintf(stderr,
"\t-w - wait for host to connect before starting\n");
(void) fprintf(stderr,
"\t-uri shmem://mymodel - set external mode URL to \"shmem://mymodel\"\n");
(void) fprintf(stderr, "\n");
return (exit_failure);
}
/****************************
* Initialize global memory *
****************************/
(void)memset(&GBLbuf, 0, sizeof(GBLbuf));
/************************
* Initialize the model *
************************/
S = heli_q8();
if (rtmGetErrorStatus(S) != NULL) {
(void) fprintf(stderr, "Error during model registration: %s\n",
rtmGetErrorStatus(S));
return (exit_failure);
}
if (final_time >= 0.0 || final_time == RUN_FOREVER) {
rtmSetTFinal(S,final_time);
} else {
rtmSetTFinal(S,rtInf);
}
action.sa_handler = control_c_handler;
action.sa_flags = 0;
qsigemptyset(&action.sa_mask);
qsigaction(SIGINT, &action, NULL);
qsigaction(SIGBREAK, &action, NULL);
qsigemptyset(&signal_set);
qsigaddset(&signal_set, SIGINT);
qsigaddset(&signal_set, SIGBREAK);
qthread_sigmask(QSIG_UNBLOCK, &signal_set, NULL);
initialize_sizes(S);
initialize_sample_times(S);
status = rt_SimInitTimingEngine(rtmGetNumSampleTimes(S),
rtmGetStepSize(S),
rtmGetSampleTimePtr(S),
rtmGetOffsetTimePtr(S),
rtmGetSampleHitPtr(S),
rtmGetSampleTimeTaskIDPtr(S),
rtmGetTStart(S),
&rtmGetSimTimeStep(S),
&rtmGetTimingData(S));
if (status != NULL) {
(void) fprintf(stderr, "Failed to initialize sample time engine: %s\n",
status);
return (exit_failure);
}
rt_CreateIntegrationData(S);
fflush(stdout);
if (rtExtModeQuarcStartup(rtmGetRTWExtModeInfo(S),
rtmGetNumSampleTimes(S),
&rtmGetStopRequested(S),
ext_priority, /* external mode thread priority */
stack_size,
SS_HAVESTDIO)) {
(void) ssPrintf("\n** starting the model **\n");
start(S);
if (rtmGetErrorStatus(S) == NULL) {
int subrate_index;
int subrate;
/*************************************************************************
* Execute the model.
*************************************************************************/
if (rtmGetTFinal(S) == RUN_FOREVER) {
(void) ssPrintf("\n**May run forever. Model stop time set to infinity.**\n");
}
(void) ssPrintf("Creating a multithreaded model\n");
for (subrate_index = 0; subrate_index >= 0; --subrate_index) {
subrate_info[subrate_index].S = S;
subrate_info[subrate_index].tid = 2 + subrate_index;
result = qsem_init(&subrate_info[subrate_index].sem, 0);
if (result == 0) {
qthread_attr_t thread_attr;
(void) ssPrintf("Creating subrate thread %d with priority %d...\n",
subrate_info[subrate_index].tid, scheduling_priority);
qthread_attr_init(&thread_attr);
if (stack_size > 0)
qthread_attr_setstacksize(&thread_attr, stack_size);
qthread_attr_setschedpolicy(&thread_attr, QSCHED_FIFO);
qthread_attr_setinheritsched(&thread_attr, QTHREAD_EXPLICIT_SCHED);
scheduling.sched_priority = scheduling_priority;
qthread_attr_setschedparam(&thread_attr, &scheduling);
result = qthread_create(&subrate_info[subrate_index].thread,
&subrate_info[subrate_index].thread_id, &thread_attr,
subrate_start_routine, &subrate_info[subrate_index]);
qthread_attr_destroy(&thread_attr);
if (result == 0) {
scheduling_priority++;
} else {
msg_get_error_messageA(NULL, result, GBLbuf.submessage, sizeof
(GBLbuf.submessage));
string_format(GBLbuf.message, sizeof(GBLbuf.message),
"Unable to create subrate thread %d. %s",
subrate_info[subrate_index].tid, GBLbuf.submessage);
rtmSetErrorStatus(S, GBLbuf.message);
qsem_destroy(&subrate_info[subrate_index].sem);
break;
}
} else {
msg_get_error_messageA(NULL, result, GBLbuf.submessage, sizeof
(GBLbuf.submessage));
string_format(GBLbuf.message, sizeof(GBLbuf.message),
"Unable to create semaphore for subrate thread %d. %s",
subrate_info[subrate_index].tid, GBLbuf.submessage);
rtmSetErrorStatus(S, GBLbuf.message);
break;
}
}
if (subrate_index < 0) { /* all threads successfully created */
scheduling.sched_priority = scheduling_priority;
qthread_setschedparam(qthread_self(), QSCHED_FIFO, &scheduling);
(void) ssPrintf("Creating main thread with priority %d and period %g...\n",
scheduling_priority, rtmGetStepSize(S));
fflush(stdout);
result = hil_task_start(heli_q8_DW.HILReadEncoderTimebase_Task, (t_clock)
heli_q8_P.HILReadEncoderTimebase_clock, 500.0, -1)
;
if (result == 0) {
/* Enter the periodic loop */
while (true) {
if (GBLbuf.stopExecutionFlag || rtmGetStopRequested(S)) {
break;
}
if (rtmGetTFinal(S) != RUN_FOREVER && rtmGetTFinal(S) - rtmGetT(S) <=
rtmGetT(S)*DBL_EPSILON) {
break;
}
rt_OneStep(S);
}
if (rtmGetStopRequested(S) == false && rtmGetErrorStatus(S) == NULL) {
/* Execute model last time step if final time expired */
rt_OneStep(S);
}
/* disarm the timebase */
hil_task_stop(heli_q8_DW.HILReadEncoderTimebase_Task)
;
(void) ssPrintf("Main thread exited\n");
} else {
msg_get_error_messageA(NULL, result, GBLbuf.submessage, sizeof
(GBLbuf.submessage));
string_format(GBLbuf.message, sizeof(GBLbuf.message),
"Unable to start timebase. %s", GBLbuf.submessage);
rtmSetErrorStatus(S, GBLbuf.message);
}
/* Do NOT use the subrate_index variable for this loop! */
for (subrate = 0; subrate < 1; subrate++) {
qthread_cancel(subrate_info[subrate].thread, subrate_info[subrate].
thread_id);
}
GBLbuf.stopExecutionFlag = 1;
}
/*
If all the subrate threads were created successfully, then subrate_index is
equal to -1 and subrate_index++ is 0. If some of the subrate threads could
not be created successfully then subrate_index++ is the index of the last
successfully created thread.
*/
for (subrate_index++; subrate_index < 1; subrate_index++) {
qthread_return_t exit_code;
/*qsem_post(&subrate_info[subrate_index].sem);*/
qthread_cancel(subrate_info[subrate_index].thread,
subrate_info[subrate_index].thread_id);
qthread_join(subrate_info[subrate_index].thread, &exit_code);
qsem_destroy(&subrate_info[subrate_index].sem);
(void) ssPrintf("Subrate thread %d returned exit_code: %p\n",
subrate_info[subrate_index].tid, exit_code);
}
}
} else {
rtmSetErrorStatus(S, "Unable to initialize external mode.");
}
rtExtSetReturnStatus(rtmGetErrorStatus(S));
rtExtModeQuarcCleanup(rtmGetNumSampleTimes(S));
/********************
* Cleanup and exit *
********************/
if (rtmGetErrorStatus(S) != NULL) {
(void) fprintf(stderr, "%s\n", rtmGetErrorStatus(S));
exit_code = exit_failure;
}
(void) ssPrintf("Invoking model termination function...\n");
terminate(S);
(void) ssPrintf("Exiting real-time code\n");
return (exit_code);
}
|
69917.c | /**
******************************************************************************
* @file stm32f3xx_hal_cec.c
* @author MCD Application Team
* @brief CEC HAL module driver.
* This file provides firmware functions to manage the following
* functionalities of the High Definition Multimedia Interface
* Consumer Electronics Control Peripheral (CEC).
* + Initialization and de-initialization functions
* + IO operation functions
* + Peripheral Control functions
*
*
@verbatim
===============================================================================
##### How to use this driver #####
===============================================================================
[..]
The CEC HAL driver can be used as follow:
(#) Declare a CEC_HandleTypeDef handle structure.
(#) Initialize the CEC low level resources by implementing the HAL_CEC_MspInit ()API:
(##) Enable the CEC interface clock.
(##) CEC pins configuration:
(+) Enable the clock for the CEC GPIOs.
(+) Configure these CEC pins as alternate function pull-up.
(##) NVIC configuration if you need to use interrupt process (HAL_CEC_Transmit_IT()
and HAL_CEC_Receive_IT() APIs):
(+) Configure the CEC interrupt priority.
(+) Enable the NVIC CEC IRQ handle.
(@) The specific CEC interrupts (Transmission complete interrupt,
RXNE interrupt and Error Interrupts) will be managed using the macros
__HAL_CEC_ENABLE_IT() and __HAL_CEC_DISABLE_IT() inside the transmit
and receive process.
(#) Program the Signal Free Time (SFT) and SFT option, Tolerance, reception stop in
in case of Bit Rising Error, Error-Bit generation conditions, device logical
address and Listen mode in the hcec Init structure.
(#) Initialize the CEC registers by calling the HAL_CEC_Init() API.
(@) This API (HAL_CEC_Init()) configures also the low level Hardware GPIO, CLOCK, CORTEX...etc)
by calling the customed HAL_CEC_MspInit() API.
@endverbatim
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f3xx_hal.h"
/** @addtogroup STM32F3xx_HAL_Driver
* @{
*/
#ifdef HAL_CEC_MODULE_ENABLED
#if defined(STM32F373xC) || defined(STM32F378xx)
/** @defgroup CEC CEC
* @brief HAL CEC module driver
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/** @defgroup CEC_Private_Constants CEC Private Constants
* @{
*/
/**
* @}
*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/** @defgroup CEC_Private_Functions CEC Private Functions
* @{
*/
/**
* @}
*/
/* Exported functions ---------------------------------------------------------*/
/** @defgroup CEC_Exported_Functions CEC Exported Functions
* @{
*/
/** @defgroup CEC_Exported_Functions_Group1 Initialization and de-initialization functions
* @brief Initialization and Configuration functions
*
@verbatim
===============================================================================
##### Initialization and Configuration functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to initialize the CEC
(+) The following parameters need to be configured:
(++) SignalFreeTime
(++) Tolerance
(++) BRERxStop (RX stopped or not upon Bit Rising Error)
(++) BREErrorBitGen (Error-Bit generation in case of Bit Rising Error)
(++) LBPEErrorBitGen (Error-Bit generation in case of Long Bit Period Error)
(++) BroadcastMsgNoErrorBitGen (Error-bit generation in case of broadcast message error)
(++) SignalFreeTimeOption (SFT Timer start definition)
(++) OwnAddress (CEC device address)
(++) ListenMode
@endverbatim
* @{
*/
/**
* @brief Initializes the CEC mode according to the specified
* parameters in the CEC_InitTypeDef and creates the associated handle .
* @param hcec CEC handle
* @retval HAL status
*/
HAL_StatusTypeDef HAL_CEC_Init(CEC_HandleTypeDef *hcec)
{
/* Check the CEC handle allocation */
if((hcec == NULL) ||(hcec->Init.RxBuffer == NULL))
{
return HAL_ERROR;
}
/* Check the parameters */
assert_param(IS_CEC_ALL_INSTANCE(hcec->Instance));
assert_param(IS_CEC_SIGNALFREETIME(hcec->Init.SignalFreeTime));
assert_param(IS_CEC_TOLERANCE(hcec->Init.Tolerance));
assert_param(IS_CEC_BRERXSTOP(hcec->Init.BRERxStop));
assert_param(IS_CEC_BREERRORBITGEN(hcec->Init.BREErrorBitGen));
assert_param(IS_CEC_LBPEERRORBITGEN(hcec->Init.LBPEErrorBitGen));
assert_param(IS_CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION(hcec->Init.BroadcastMsgNoErrorBitGen));
assert_param(IS_CEC_SFTOP(hcec->Init.SignalFreeTimeOption));
assert_param(IS_CEC_LISTENING_MODE(hcec->Init.ListenMode));
assert_param(IS_CEC_OWN_ADDRESS(hcec->Init.OwnAddress));
if(hcec->gState == HAL_CEC_STATE_RESET)
{
/* Allocate lock resource and initialize it */
hcec->Lock = HAL_UNLOCKED;
/* Init the low level hardware : GPIO, CLOCK */
HAL_CEC_MspInit(hcec);
}
hcec->gState = HAL_CEC_STATE_BUSY;
/* Disable the Peripheral */
__HAL_CEC_DISABLE(hcec);
/* Write to CEC Control Register */
hcec->Instance->CFGR = hcec->Init.SignalFreeTime | hcec->Init.Tolerance | hcec->Init.BRERxStop|\
hcec->Init.BREErrorBitGen | hcec->Init.LBPEErrorBitGen | hcec->Init.BroadcastMsgNoErrorBitGen |\
hcec->Init.SignalFreeTimeOption |((uint32_t)(hcec->Init.OwnAddress)<<16U) |\
hcec->Init.ListenMode;
/* Enable the following CEC Transmission/Reception interrupts as
* well as the following CEC Transmission/Reception Errors interrupts
* Rx Byte Received IT
* End of Reception IT
* Rx overrun
* Rx bit rising error
* Rx short bit period error
* Rx long bit period error
* Rx missing acknowledge
* Tx Byte Request IT
* End of Transmission IT
* Tx Missing Acknowledge IT
* Tx-Error IT
* Tx-Buffer Underrun IT
* Tx arbitration lost */
__HAL_CEC_ENABLE_IT(hcec, CEC_IT_RXBR|CEC_IT_RXEND|CEC_IER_RX_ALL_ERR|CEC_IT_TXBR|CEC_IT_TXEND|CEC_IER_TX_ALL_ERR);
/* Enable the CEC Peripheral */
__HAL_CEC_ENABLE(hcec);
hcec->ErrorCode = HAL_CEC_ERROR_NONE;
hcec->gState = HAL_CEC_STATE_READY;
hcec->RxState = HAL_CEC_STATE_READY;
return HAL_OK;
}
/**
* @brief DeInitializes the CEC peripheral
* @param hcec CEC handle
* @retval HAL status
*/
HAL_StatusTypeDef HAL_CEC_DeInit(CEC_HandleTypeDef *hcec)
{
/* Check the CEC handle allocation */
if(hcec == NULL)
{
return HAL_ERROR;
}
/* Check the parameters */
assert_param(IS_CEC_ALL_INSTANCE(hcec->Instance));
hcec->gState = HAL_CEC_STATE_BUSY;
/* DeInit the low level hardware */
HAL_CEC_MspDeInit(hcec);
/* Disable the Peripheral */
__HAL_CEC_DISABLE(hcec);
/* Clear Flags */
__HAL_CEC_CLEAR_FLAG(hcec,CEC_FLAG_TXEND|CEC_FLAG_TXBR|CEC_FLAG_RXBR|CEC_FLAG_RXEND|CEC_ISR_ALL_ERROR);
/* Disable the following CEC Transmission/Reception interrupts as
* well as the following CEC Transmission/Reception Errors interrupts
* Rx Byte Received IT
* End of Reception IT
* Rx overrun
* Rx bit rising error
* Rx short bit period error
* Rx long bit period error
* Rx missing acknowledge
* Tx Byte Request IT
* End of Transmission IT
* Tx Missing Acknowledge IT
* Tx-Error IT
* Tx-Buffer Underrun IT
* Tx arbitration lost */
__HAL_CEC_DISABLE_IT(hcec, CEC_IT_RXBR|CEC_IT_RXEND|CEC_IER_RX_ALL_ERR|CEC_IT_TXBR|CEC_IT_TXEND|CEC_IER_TX_ALL_ERR);
hcec->ErrorCode = HAL_CEC_ERROR_NONE;
hcec->gState = HAL_CEC_STATE_RESET;
hcec->RxState = HAL_CEC_STATE_RESET;
/* Process Unlock */
__HAL_UNLOCK(hcec);
return HAL_OK;
}
/**
* @brief Initializes the Own Address of the CEC device
* @param hcec CEC handle
* @param CEC_OwnAddress The CEC own address.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_CEC_SetDeviceAddress(CEC_HandleTypeDef *hcec, uint16_t CEC_OwnAddress)
{
/* Check the parameters */
assert_param(IS_CEC_OWN_ADDRESS(CEC_OwnAddress));
if ((hcec->gState == HAL_CEC_STATE_READY) && (hcec->RxState == HAL_CEC_STATE_READY))
{
/* Process Locked */
__HAL_LOCK(hcec);
hcec->gState = HAL_CEC_STATE_BUSY;
/* Disable the Peripheral */
__HAL_CEC_DISABLE(hcec);
if(CEC_OwnAddress != CEC_OWN_ADDRESS_NONE)
{
hcec->Instance->CFGR |= ((uint32_t)CEC_OwnAddress<<16U);
}
else
{
hcec->Instance->CFGR &= ~(CEC_CFGR_OAR);
}
hcec->gState = HAL_CEC_STATE_READY;
hcec->ErrorCode = HAL_CEC_ERROR_NONE;
/* Process Unlocked */
__HAL_UNLOCK(hcec);
/* Enable the Peripheral */
__HAL_CEC_ENABLE(hcec);
return HAL_OK;
}
else
{
return HAL_BUSY;
}
}
/**
* @brief CEC MSP Init
* @param hcec CEC handle
* @retval None
*/
__weak void HAL_CEC_MspInit(CEC_HandleTypeDef *hcec)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hcec);
/* NOTE : This function should not be modified, when the callback is needed,
the HAL_CEC_MspInit can be implemented in the user file
*/
}
/**
* @brief CEC MSP DeInit
* @param hcec CEC handle
* @retval None
*/
__weak void HAL_CEC_MspDeInit(CEC_HandleTypeDef *hcec)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hcec);
/* NOTE : This function should not be modified, when the callback is needed,
the HAL_CEC_MspDeInit can be implemented in the user file
*/
}
/**
* @}
*/
/** @defgroup CEC_Exported_Functions_Group2 Input and Output operation functions
* @brief CEC Transmit/Receive functions
*
@verbatim
===============================================================================
##### IO operation functions #####
===============================================================================
This subsection provides a set of functions allowing to manage the CEC data transfers.
(#) The CEC handle must contain the initiator (TX side) and the destination (RX side)
logical addresses (4-bit long addresses, 0x0F for broadcast messages destination)
(#) The communication is performed using Interrupts.
These API's return the HAL status.
The end of the data processing will be indicated through the
dedicated CEC IRQ when using Interrupt mode.
The HAL_CEC_TxCpltCallback(), HAL_CEC_RxCpltCallback() user callbacks
will be executed respectivelly at the end of the transmit or Receive process
The HAL_CEC_ErrorCallback()user callback will be executed when a communication
error is detected
(#) API's with Interrupt are :
(+) HAL_CEC_Transmit_IT()
(+) HAL_CEC_IRQHandler()
(#) A set of User Callbacks are provided:
(+) HAL_CEC_TxCpltCallback()
(+) HAL_CEC_RxCpltCallback()
(+) HAL_CEC_ErrorCallback()
@endverbatim
* @{
*/
/**
* @brief Send data in interrupt mode
* @param hcec CEC handle
* @param InitiatorAddress Initiator address
* @param DestinationAddress destination logical address
* @param pData pointer to input byte data buffer
* @param Size amount of data to be sent in bytes (without counting the header).
* 0 means only the header is sent (ping operation).
* Maximum TX size is 15 bytes (1 opcode and up to 14 operands).
* @retval HAL status
*/
HAL_StatusTypeDef HAL_CEC_Transmit_IT(CEC_HandleTypeDef *hcec, uint8_t InitiatorAddress, uint8_t DestinationAddress, uint8_t *pData, uint32_t Size)
{
/* if the IP isn't already busy and if there is no previous transmission
already pending due to arbitration lost */
if (hcec->gState == HAL_CEC_STATE_READY)
{
if((pData == NULL ) && (Size > 0U))
{
return HAL_ERROR;
}
assert_param(IS_CEC_ADDRESS(DestinationAddress));
assert_param(IS_CEC_ADDRESS(InitiatorAddress));
assert_param(IS_CEC_MSGSIZE(Size));
/* Process Locked */
__HAL_LOCK(hcec);
hcec->pTxBuffPtr = pData;
hcec->gState = HAL_CEC_STATE_BUSY_TX;
hcec->ErrorCode = HAL_CEC_ERROR_NONE;
/* initialize the number of bytes to send,
* 0 means only one header is sent (ping operation) */
hcec->TxXferCount = Size;
/* in case of no payload (Size = 0U), sender is only pinging the system;
Set TX End of Message (TXEOM) bit, must be set before writing data to TXDR */
if (Size == 0U)
{
__HAL_CEC_LAST_BYTE_TX_SET(hcec);
}
/* send header block */
hcec->Instance->TXDR = ((uint8_t)(InitiatorAddress << CEC_INITIATOR_LSB_POS) |(uint8_t) DestinationAddress);
/* Set TX Start of Message (TXSOM) bit */
__HAL_CEC_FIRST_BYTE_TX_SET(hcec);
/* Process Unlocked */
__HAL_UNLOCK(hcec);
return HAL_OK;
}
else
{
return HAL_BUSY;
}
}
/**
* @brief Get size of the received frame.
* @param hcec CEC handle
* @retval Frame size
*/
uint32_t HAL_CEC_GetLastReceivedFrameSize(CEC_HandleTypeDef *hcec)
{
return hcec->RxXferSize;
}
/**
* @brief Change Rx Buffer.
* @param hcec CEC handle
* @param Rxbuffer Rx Buffer
* @note This function can be called only inside the HAL_CEC_RxCpltCallback()
* @retval Frame size
*/
void HAL_CEC_ChangeRxBuffer(CEC_HandleTypeDef *hcec, uint8_t* Rxbuffer)
{
hcec->Init.RxBuffer = Rxbuffer;
}
/**
* @brief This function handles CEC interrupt requests.
* @param hcec CEC handle
* @retval None
*/
void HAL_CEC_IRQHandler(CEC_HandleTypeDef *hcec)
{
/* save interrupts register for further error or interrupts handling purposes */
uint32_t reg = 0U;
reg = hcec->Instance->ISR;
/* ----------------------------Arbitration Lost Management----------------------------------*/
/* CEC TX arbitration error interrupt occurred --------------------------------------*/
if((reg & CEC_FLAG_ARBLST) != RESET)
{
hcec->ErrorCode = HAL_CEC_ERROR_ARBLST;
__HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_ARBLST);
}
/* ----------------------------Rx Management----------------------------------*/
/* CEC RX byte received interrupt ---------------------------------------------------*/
if((reg & CEC_FLAG_RXBR) != RESET)
{
/* reception is starting */
hcec->RxState = HAL_CEC_STATE_BUSY_RX;
hcec->RxXferSize++;
/* read received byte */
*hcec->Init.RxBuffer++ = hcec->Instance->RXDR;
__HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_RXBR);
}
/* CEC RX end received interrupt ---------------------------------------------------*/
if((reg & CEC_FLAG_RXEND) != RESET)
{
/* clear IT */
__HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_RXEND);
/* Rx process is completed, restore hcec->RxState to Ready */
hcec->RxState = HAL_CEC_STATE_READY;
hcec->ErrorCode = HAL_CEC_ERROR_NONE;
hcec->Init.RxBuffer -= hcec->RxXferSize;
HAL_CEC_RxCpltCallback(hcec, hcec->RxXferSize);
hcec->RxXferSize = 0U;
}
/* ----------------------------Tx Management----------------------------------*/
/* CEC TX byte request interrupt ------------------------------------------------*/
if((reg & CEC_FLAG_TXBR) != RESET)
{
if (hcec->TxXferCount == 0U)
{
/* if this is the last byte transmission, set TX End of Message (TXEOM) bit */
__HAL_CEC_LAST_BYTE_TX_SET(hcec);
hcec->Instance->TXDR = *hcec->pTxBuffPtr++;
}
else
{
hcec->Instance->TXDR = *hcec->pTxBuffPtr++;
hcec->TxXferCount--;
}
/* clear Tx-Byte request flag */
__HAL_CEC_CLEAR_FLAG(hcec,CEC_FLAG_TXBR);
}
/* CEC TX end interrupt ------------------------------------------------*/
if((reg & CEC_FLAG_TXEND) != RESET)
{
__HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_TXEND);
/* Tx process is ended, restore hcec->gState to Ready */
hcec->gState = HAL_CEC_STATE_READY;
/* Call the Process Unlocked before calling the Tx call back API to give the possibility to
start again the Transmission under the Tx call back API */
__HAL_UNLOCK(hcec);
hcec->ErrorCode = HAL_CEC_ERROR_NONE;
HAL_CEC_TxCpltCallback(hcec);
}
/* ----------------------------Rx/Tx Error Management----------------------------------*/
if ((reg & (CEC_ISR_RXOVR|CEC_ISR_BRE|CEC_ISR_SBPE|CEC_ISR_LBPE|CEC_ISR_RXACKE|CEC_ISR_TXUDR|CEC_ISR_TXERR|CEC_ISR_TXACKE)) != 0U)
{
hcec->ErrorCode = reg;
__HAL_CEC_CLEAR_FLAG(hcec, HAL_CEC_ERROR_RXOVR|HAL_CEC_ERROR_BRE|CEC_FLAG_LBPE|CEC_FLAG_SBPE|HAL_CEC_ERROR_RXACKE|HAL_CEC_ERROR_TXUDR|HAL_CEC_ERROR_TXERR|HAL_CEC_ERROR_TXACKE);
if((reg & (CEC_ISR_RXOVR|CEC_ISR_BRE|CEC_ISR_SBPE|CEC_ISR_LBPE|CEC_ISR_RXACKE)) != RESET)
{
hcec->Init.RxBuffer-=hcec->RxXferSize;
hcec->RxXferSize = 0U;
hcec->RxState = HAL_CEC_STATE_READY;
}
else if (((reg & (CEC_ISR_TXUDR|CEC_ISR_TXERR|CEC_ISR_TXACKE)) != RESET) && ((reg & CEC_ISR_ARBLST) == RESET))
{
/* Set the CEC state ready to be able to start again the process */
hcec->gState = HAL_CEC_STATE_READY;
}
/* Error Call Back */
HAL_CEC_ErrorCallback(hcec);
}
}
/**
* @brief Tx Transfer completed callback
* @param hcec CEC handle
* @retval None
*/
__weak void HAL_CEC_TxCpltCallback(CEC_HandleTypeDef *hcec)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hcec);
/* NOTE : This function should not be modified, when the callback is needed,
the HAL_CEC_TxCpltCallback can be implemented in the user file
*/
}
/**
* @brief Rx Transfer completed callback
* @param hcec CEC handle
* @param RxFrameSize Size of frame
* @retval None
*/
__weak void HAL_CEC_RxCpltCallback(CEC_HandleTypeDef *hcec, uint32_t RxFrameSize)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hcec);
UNUSED(RxFrameSize);
/* NOTE : This function should not be modified, when the callback is needed,
the HAL_CEC_RxCpltCallback can be implemented in the user file
*/
}
/**
* @brief CEC error callbacks
* @param hcec CEC handle
* @retval None
*/
__weak void HAL_CEC_ErrorCallback(CEC_HandleTypeDef *hcec)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hcec);
/* NOTE : This function should not be modified, when the callback is needed,
the HAL_CEC_ErrorCallback can be implemented in the user file
*/
}
/**
* @}
*/
/** @defgroup CEC_Exported_Functions_Group3 Peripheral Control function
* @brief CEC control functions
*
@verbatim
===============================================================================
##### Peripheral Control function #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the CEC.
(+) HAL_CEC_GetState() API can be helpful to check in run-time the state of the CEC peripheral.
(+) HAL_CEC_GetError() API can be helpful to check in run-time the error of the CEC peripheral.
@endverbatim
* @{
*/
/**
* @brief return the CEC state
* @param hcec pointer to a CEC_HandleTypeDef structure that contains
* the configuration information for the specified CEC module.
* @retval HAL state
*/
HAL_CEC_StateTypeDef HAL_CEC_GetState(CEC_HandleTypeDef *hcec)
{
uint32_t temp1 = 0x00U, temp2 = 0x00U;
temp1 = hcec->gState;
temp2 = hcec->RxState;
return (HAL_CEC_StateTypeDef)(temp1 | temp2);
}
/**
* @brief Return the CEC error code
* @param hcec pointer to a CEC_HandleTypeDef structure that contains
* the configuration information for the specified CEC.
* @retval CEC Error Code
*/
uint32_t HAL_CEC_GetError(CEC_HandleTypeDef *hcec)
{
return hcec->ErrorCode;
}
/**
* @}
*/
/**
* @}
*/
#endif /* defined(STM32F373xC) || defined(STM32F378xx) */
#endif /* HAL_CEC_MODULE_ENABLED */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
356095.c | //
// Homekit Multi-Button
//
// Notes:
// o Acts as multiple Programmable Switches in a single unit
// o One button per programmable device
// o Presses result in the following Homekit actions:
// - Single press: Generates a HomeKit "Single Press" event
// - Long press: Generates a HomeKit "Double Press" event
// - Double press: Part of a reset sequence - see below
// - Triple press: Generates a HomeKit "Triple Press" event
// o Why not just use "double press" directly rather than a long press? Because unlike lights,
// it is a big deal to accidentally turn off some devices (e.g. a 3D printer plugged into a
// controllable outlet). I wanted the off gesture to be very intentional
// o To use this device to trigger an on/off action in Homekit, map
// + Single press to ON for the device under control (e.g. light, outlet, etc.)
// + Double press to Off for the device under control (e.g. light, outlet, etc.)
// + Triple Press to any other desired scene
// o Reseting the device: To remove pairings and wifi configuration, the device can be reset
// using a sequence of double presses on any button. At the moment, (3) double-presses in
// a row are required with no intervening button presses.
//
//
// Building:
// o Sample make command:
// make -C examples/button all -DDEV_PASS="123-45-678" -DDEV_SERIAL="1200345" -DDEV_SETUP="J81Q"
// o Generating a qrcode
// esp-homekit-demo/components/common/homekit/tools/gen_qrcode 15 123-45-678 J81Q qrcode.png
//
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <espressif/esp_system.h>
#include <espressif/esp_wifi.h>
#include <esp/uart.h>
#include <esp8266.h>
#include <FreeRTOS.h>
#include <task.h>
#include <homekit/homekit.h>
#include <homekit/characteristics.h>
#include <wifi_config.h>
#include <button.h>
/*------------------------------------------------------------------------------
*
* Macros, Constants
*
*----------------------------------------------------------------------------*/
#define SWITCH_SERVICE(_INDEX, _IS_PRIMARY) \
HOMEKIT_SERVICE( \
STATELESS_PROGRAMMABLE_SWITCH, \
.primary=_IS_PRIMARY, \
.characteristics=(homekit_characteristic_t*[]) { \
HOMEKIT_CHARACTERISTIC(NAME, "B ## _INDEX"), \
&buttons[_INDEX], \
NULL \
}, \
)
#if !defined(DEV_SERIAL) || !defined(DEV_PASS) || !defined(DEV_SETUP)
#error The following must be defined: DEV_SERIAL, DEV_PASS, DEV_SETUP
#endif
#define Q(x) #x
#define QUOTE(x) Q(x)
char DeviceModel[] = "JP2B";
char DeviceSetupID[] = QUOTE(DEV_SETUP);
char DevicePassword[] = QUOTE(DEV_PASS);
char DeviceSerial[] = QUOTE(DEV_SERIAL);
char DeviceName[] = QUOTE(DEV_NAME);
#define N_BUTTONS (4)
static const uint8_t ButtonPins[] = {
2, // D4
4, // D2
5, // D1
14 // D5
};
homekit_characteristic_t buttons[] = {
HOMEKIT_CHARACTERISTIC_(PROGRAMMABLE_SWITCH_EVENT, 0),
HOMEKIT_CHARACTERISTIC_(PROGRAMMABLE_SWITCH_EVENT, 0),
HOMEKIT_CHARACTERISTIC_(PROGRAMMABLE_SWITCH_EVENT, 0),
HOMEKIT_CHARACTERISTIC_(PROGRAMMABLE_SWITCH_EVENT, 0),
};
static const uint8_t Pin_LED = 15; // D8
static const uint8_t ResetSequenceThreshold = 2;
// Determines how many double-presses of a button are required to trigger a reset
void identifyDevice(homekit_value_t _value);
void homekit_event_handler(homekit_event_t event);
/*------------------------------------------------------------------------------
*
* HomeKit Device Configuration Structures
*
*----------------------------------------------------------------------------*/
homekit_accessory_t *accessories[] = {
HOMEKIT_ACCESSORY(
.id=1,
.category=homekit_accessory_category_programmable_switch,
.services=(homekit_service_t*[]) {
HOMEKIT_SERVICE(
ACCESSORY_INFORMATION,
.characteristics=(homekit_characteristic_t*[]) {
HOMEKIT_CHARACTERISTIC(NAME, DeviceName),
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "BitsPlusAtoms"),
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, DeviceSerial),
HOMEKIT_CHARACTERISTIC(MODEL, DeviceModel),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.0.1"),
HOMEKIT_CHARACTERISTIC(IDENTIFY, identifyDevice),
NULL
},
),
SWITCH_SERVICE(1, true),
SWITCH_SERVICE(2, false),
SWITCH_SERVICE(3, false),
SWITCH_SERVICE(4, false),
NULL
},
),
NULL
};
homekit_server_config_t config = {
.accessories = accessories,
.password = DevicePassword,
.setupId = DeviceSetupID,
.on_event = homekit_event_handler
};
/*------------------------------------------------------------------------------
*
* Utility functions
*
*----------------------------------------------------------------------------*/
// ----- General Utlitities -----
void delayMS(uint32_t delayMillis) { vTaskDelay(delayMillis / portTICK_PERIOD_MS); }
// ----- LED-related -----
void setLED(bool on) { gpio_write(Pin_LED, on ? 0 : 1); }
void blinkIt(uint8_t cycles, uint32_t delayMillis) {
for (int i = 0; i < cycles; i++) {
setLED(true);
delayMS(delayMillis);
setLED(false);
delayMS(delayMillis);
}
}
void identifyDeviceTask(void *_args) {
for (int i = 0; i < 3; i++) {
blinkIt(2, 200);
delayMS(500);
}
setLED(false);
vTaskDelete(NULL);
}
void identifyDevice(homekit_value_t _value) {
printf("LED identify\n");
xTaskCreate(identifyDeviceTask, "Identify Device", 128, NULL, 2, NULL);
}
void indicateStationModeTask(void *_args) {
while (true) {
blinkIt(4, 250);
delayMS(1000);
}
}
void indicateStationMode(bool on) {
static TaskHandle_t xHandle = NULL;
if (on) {
xTaskCreate(indicateStationModeTask, "StationMode", 128, NULL, 2, &xHandle);
} else {
if (xHandle != NULL) {
vTaskDelete(xHandle);
}
setLED(false);
}
}
void prepLED() {
gpio_enable(Pin_LED, GPIO_OUTPUT);
setLED(false);
}
// ----- Reset Handling -----
void resetConfigTask() {
// Flash the LED first before we start the reset
blinkIt(5, 100);
printf("Resetting Wifi Config\n");
wifi_config_reset();
delayMS(1000);
printf("Resetting HomeKit Config\n");
homekit_server_reset();
delayMS(1000);
printf("Restarting\n");
sdk_system_restart();
vTaskDelete(NULL);
}
void resetConfig() {
printf("Resetting configuration\n");
xTaskCreate(resetConfigTask, "Reset configuration", 256, NULL, 2, NULL);
}
/*------------------------------------------------------------------------------
*
* Button Handling
*
*----------------------------------------------------------------------------*/
// Think of a way to trigger a reset - maybe two triple presses in a row
void buttonCallback(button_event_t event, void *context) {
static uint8_t resetSequenceCount = 0;
homekit_characteristic_t* button = (homekit_characteristic_t*)context;
if (event == button_event_single_press) {
printf("single press of on button\n");
resetSequenceCount = 0;
homekit_characteristic_notify(button, HOMEKIT_UINT8(0));
blinkIt(1, 75);
} else if (event == button_event_long_press) {
printf("long press of on button\n");
resetSequenceCount = 0;
homekit_characteristic_notify(button, HOMEKIT_UINT8(1));
blinkIt(2, 75);
} else if (event == button_event_tripple_press) {
printf("triple press of on button\n");
resetSequenceCount = 0;
homekit_characteristic_notify(button, HOMEKIT_UINT8(2));
blinkIt(3, 75);
} else if (event == button_event_double_press) {
printf("double press of on button\n");
resetSequenceCount++;
if (resetSequenceCount == ResetSequenceThreshold) {
resetConfig();
}
} else {
resetSequenceCount = 0;
printf("Unused button event: %d\n", event);
}
}
/*------------------------------------------------------------------------------
*
* Homekit Callbacks
*
*----------------------------------------------------------------------------*/
void homekit_event_handler(homekit_event_t event) {
switch(event) {
case HOMEKIT_EVENT_SERVER_INITIALIZED:
printf("HOMEKIT_EVENT_SERVER_INITIALIZED\n");
break;
case HOMEKIT_EVENT_CLIENT_CONNECTED:
printf("HOMEKIT_EVENT_CLIENT_CONNECTED\n");
break;
case HOMEKIT_EVENT_CLIENT_VERIFIED:
printf("HOMEKIT_EVENT_CLIENT_VERIFIED\n");
break;
case HOMEKIT_EVENT_CLIENT_DISCONNECTED:
printf("HOMEKIT_EVENT_CLIENT_DISCONNECTED\n");
break;
case HOMEKIT_EVENT_PAIRING_ADDED:
printf("HOMEKIT_EVENT_PAIRING_ADDED\n");
break;
case HOMEKIT_EVENT_PAIRING_REMOVED:
printf("HOMEKIT_EVENT_PAIRING_REMOVED\n");
break;
default:
printf("Unknown event type: %d\n", event);
break;
}
}
void handleWiFiEvent(wifi_config_event_t event) {
switch (event) {
case WIFI_CONFIG_CONNECTED:
printf("Connected to WiFi\n");
homekit_server_init(&config);
break;
case WIFI_CONFIG_DISCONNECTED:
printf("Disconnected from WiFi\n");
break;
case WIFI_CONFIG_AP_START:
printf("Entering Station Mode\n");
indicateStationMode(true);
break;
case WIFI_CONFIG_AP_STOP:
printf("Leaving Station Mode\n");
indicateStationMode(false);
break;
default:
printf("Unknown event type: %d", event);
break;
}
}
/*------------------------------------------------------------------------------
*
* Setup
*
*----------------------------------------------------------------------------*/
void user_init(void) {
uart_set_baud(0, 115200);
prepLED();
printf("DeviceSetupID = %s\n", DeviceSetupID);
printf("DevicePassword = %s\n", DevicePassword);
printf("DeviceSerial = %s\n", DeviceSerial);
printf("DeviceName = %s\n", DeviceName);
// accessories[0]->services[N_BUTTONS+1] = NULL;
for (int i = 0; i < 6; i++) {
printf("Service addr = 0x%lx\n", (unsigned long)accessories[0]->services[i]);
}
wifi_config_init2(DeviceModel, NULL, handleWiFiEvent);
button_config_t button_config = BUTTON_CONFIG(
button_active_low,
.max_repeat_presses=3,
.long_press_time=4500,
);
for (int i = 0; i < N_BUTTONS; i++) {
if (button_create(ButtonPins[i], button_config, buttonCallback, &buttons[i])) {
printf("Failed to initialize on button\n");
}
}
}
|
131581.c | #include <kernel/task.h>
#include <kernel/sysfunc.h>
//#define TASK_DEBUG
#define TASK_STATE_NULL 0
#define TASK_STATE_IDLE 1
#define TASK_STATE_ACTIVE 2
#define TASK_STATE_WAITPID 3
#define TASK_STATE_WAITIPC 4
typedef struct thread_t thread_t;
struct thread_t {
tss_entry_t tss;
uint32_t pid;
thread_t *parent;
uint8_t state;
uint32_t waitval;
uint32_t cr3;
void *tables;
char savedfloats[512] __attribute__((aligned(16)));
};
thread_t *current_task;
thread_t *threads;
uint32_t max_threads;
void *last_entrypoint;
void *last_stack;
void init_tasking(uint32_t num_pages) {
threads = alloc_page(num_pages);
memset(threads,0,num_pages*4096);
max_threads = (num_pages*4096)/sizeof(thread_t);
printf("Max threads: %u\n",max_threads);
kprint("[INIT] Tasking initialized.");
}
uint32_t init_new_process(void *prgm, size_t size, uint32_t argl_paddr, uint32_t envl_paddr) {
uint32_t pid;
for (pid = 1; pid < max_threads; pid++) {
if (threads[pid-1].pid==0)
break;
}
if (pid>=max_threads) {
kerror("[KERR] Process tried to start, but no available PID!");
return 0;
}
if (!verify_elf(prgm, size))
return 0;
void * new = clone_tables();
threads[pid-1].pid = pid;
threads[pid-1].state = TASK_STATE_IDLE;
threads[pid-1].cr3 = (uint32_t)(uintptr_t)new;
threads[pid-1].tables = get_current_tables();
void *elf_enter = load_elf(prgm);
threads[pid-1].tss.eip = (uintptr_t)elf_enter;
// Map arguments to the process
if (argl_paddr) {
map_page_secretly((void *)(uintptr_t)0xBFFFE000,(void *)argl_paddr);
} else {
map_page_to((void *)(uintptr_t)0xBFFFE000);
}
mark_user((void *)(uintptr_t)0xBFFFE000,true);
// Map environment variables to the process
if (envl_paddr) {
map_page_secretly((void *)(uintptr_t)0xBFFFF000,(void *)envl_paddr);
} else {
map_page_to((void *)(uintptr_t)0xBFFFF000);
}
mark_user((void *)(uintptr_t)0xBFFFF000,true);
// Create stack: 4 pages = 16KiB
for (uint8_t i = 0; i < 4; i++) {
map_page_to((void *)(uintptr_t)(0xBFFFA000+(i*4096)));
mark_user((void *)(uintptr_t)(0xBFFFA000+(i*4096)), true);
}
threads[pid-1].tss.esp = 0xBFFFFFFB;
last_entrypoint = elf_enter;
threads[pid-1].tss.eax = 0;
threads[pid-1].tss.ebx = 0;
threads[pid-1].tss.ecx = 0;
threads[pid-1].tss.edx = 0;
#ifdef TASK_DEBUG
kprint("[KDBG] New process created:");
printf("====== pid=%$\n",pid);
dprintf("====== pid=%$\n",pid);
#endif
return pid;
}
void create_idle_process(void *prgm, size_t size) {
init_new_process(prgm,size,0,0);
use_kernel_map();
}
extern void enter_usermode();
void create_process(void *prgm,size_t size) {
uint32_t pid = init_new_process(prgm,size,0,0);
if (!pid)
return;
current_task = &threads[pid-1];
current_task->state = TASK_STATE_ACTIVE;
enable_tasking();
last_stack = (void *)(uintptr_t)current_task->tss.esp;
enter_usermode();
}
bool is_task_runnable(thread_t *thread) {
if (thread->state == TASK_STATE_WAITIPC) {
if (transfer_avail(thread->pid, thread->waitval)) {
thread->state = TASK_STATE_ACTIVE;
return true;
}
}
return (thread->state == TASK_STATE_ACTIVE || thread->state == TASK_STATE_IDLE);
}
uint32_t next_task() {
for (uint32_t i = current_task->pid+1; i < max_threads; i++) {
if (threads[i-1].pid!=0) {
if (is_task_runnable(&threads[i-1])) {
return i;
}
}
}
for (uint32_t i = 1; i < max_threads; i++) {
if (threads[i-1].pid!=0) {
if (is_task_runnable(&threads[i-1])) {
return i;
}
}
}
return 0;
}
inline void set_cr3(uint32_t new_cr3) {
asm volatile("mov %0, %%cr3"::"r"(new_cr3));
}
inline uint32_t get_cr3() {
uint32_t retval;
asm volatile("mov %%cr3,%0":"=r"(retval));
return retval;
}
volatile uint32_t ready_esp;
volatile tss_entry_t new_temp_tss;
volatile char fxsave_region[512];
extern void switch_task();
extern void exit_usermode();
void task_switch(tss_entry_t tss) {
disable_tasking();
memcpy(current_task->savedfloats, (char *)fxsave_region, 512);
current_task->tss = tss; //Save the program's state
uint32_t new_pid = next_task();
if (!new_pid) {
kerror("[KERR] No programs remaining. Shutting down.");
last_stack = (void *)(uintptr_t)ready_esp;
last_entrypoint = &kernel_exit;
exit_usermode();
}
current_task = &threads[new_pid-1];
switch_tables(threads[new_pid-1].tables);
set_cr3((current_task->cr3));
new_temp_tss = current_task->tss;
memcpy((char *)fxsave_region, current_task->savedfloats, 512);
enable_tasking();
switch_task();
}
void kill_program(uint32_t pid, uint32_t retval) {
disable_tasking();
deregister_ipc_ports_pid(pid);
uint32_t old_pid = current_task->pid;
thread_t *parent = threads[pid-1].parent;
if (parent!=0) {
if (parent->state==TASK_STATE_WAITPID&&(parent->waitval==current_task->pid||parent->waitval==0)) {
parent->state = TASK_STATE_ACTIVE;
parent->waitval = retval;
}
}
uint32_t current_cr3;
current_cr3 = get_cr3();
uint32_t *current_tables = get_current_tables();
switch_tables(threads[pid-1].tables);
set_cr3((threads[pid-1].cr3));
free_all_user_pages();
use_kernel_map();
free_page(threads[pid-1].tables-4096,1025);
threads[pid-1].state = TASK_STATE_NULL;
threads[pid-1].cr3 = 0;
threads[pid-1].tables = 0;
threads[pid-1].waitval = 0;
threads[pid-1].pid = 0;
#ifdef TASK_DEBUG
kprint("[KDBG] Process killed:");
printf("====== pid=%u\n",pid);
dprintf("====== pid=%u\n",pid);
#endif
// Check whether the process exited or was killed by another process
if (pid==old_pid) {
task_switch(current_task->tss);
}
switch_tables(current_tables);
set_cr3((current_cr3));
enable_tasking();
}
void exit_program(int retval) {
kill_program(current_task->pid,retval);
}
tss_entry_t syscall_temp_tss;
void yield() {
enable_tasking();
task_switch(syscall_temp_tss);
}
FILE prgm;
uint32_t argl_v;
uint32_t envl_v;
uint32_t exec_syscall(char *name, char **arguments, char **environment) {
uint32_t current_cr3;
current_cr3 = get_cr3();
uint32_t *current_tables = get_current_tables();
prgm = fopen(name,"r");
if (prgm.valid&&!prgm.directory) {
//Process environment variables
uint32_t envc = 0;
char **envp = alloc_page(1);
memset(envp,0,4096);
void *eptr = envp;
if (environment) {
//Count environment variables untill we reach NULL.
while(environment[envc]!=NULL)
envc++;
}
eptr+=sizeof(char *)*(envc+1); //Reserve space for the pointers
if (environment) {
for (uint32_t i = 0; i < envc; i++) {
envp[i] = (char *)(((uint32_t)eptr%0x1000)+0xBFFFF000);
strcpy(eptr,environment[i]);
eptr+=strlen(environment[i]);
eptr++;
}
}
envl_v = (uint32_t)get_phys_addr(envp);
//Now process arguments
uint32_t argc = 0;
char **argv = alloc_page(1);
memset(argv,0,4096);
void *aptr = argv;
if (arguments) {
//Count arguments until we reach a NULL.
while (arguments[argc]!=NULL)
argc++;
}
aptr+=sizeof(char *)*(argc+2); //Reserve space for the pointers
argv[0] = (char *)(((uint32_t)aptr%0x1000)+0xBFFFE000);
strcpy(aptr,name);
aptr+=strlen(name);
aptr++;
argc++;
//Make sure arguments are present
if (arguments) {
for (uint32_t i = 0; i < argc-1; i++) {
argv[i+1] = (char *)(((uint32_t)aptr%0x1000)+0xBFFFE000);
strcpy(aptr,arguments[i]);
aptr+=strlen(arguments[i]);
aptr++;
}
}
argl_v = (uint32_t)get_phys_addr(argv);
use_kernel_map();
void *buf = alloc_page((prgm.size/4096)+1);
memset(buf,0,((prgm.size/4096)+1)*4096);
if (!fread(&prgm,buf,0,prgm.size)) {
uint32_t pid = init_new_process(buf,prgm.size,argl_v,envl_v);
if (pid) {
threads[pid-1].parent=current_task;
threads[pid-1].tss.eax=argc;
threads[pid-1].tss.ebx=envc;
threads[pid-1].tss.ecx=0xBFFFE000;
threads[pid-1].tss.edx=0xBFFFF000;
}
free_page(buf,(prgm.size/4096)+1);
switch_tables((void *)current_tables);
set_cr3(current_cr3);
if (pid) {
trade_vaddr(argv);
trade_vaddr(envp);
} else {
free_page(argv,1);
free_page(envp,1);
}
return pid;
} else {
free_page(buf,(prgm.size/4096)+1);
switch_tables((void *)current_tables);
set_cr3(current_cr3);
free_page(argv,1);
free_page(envp,1);
return 0;
}
} else {
return 0;
}
}
// Fork will simply duplicate the process's memory and thread data and assign a new PID.
uint32_t fork_process() {
disable_tasking();
uint32_t current_cr3;
current_cr3 = get_cr3();
uint32_t *current_tables = get_current_tables();
uint32_t pid;
for (pid = 1; pid < max_threads; pid++) {
if (threads[pid-1].pid==0)
break;
}
if (pid>=max_threads) {
kerror("[KERR] Process tried to start, but no available PID!");
return 0;
}
void *new = clone_tables();
clone_user_pages();
memcpy(&threads[pid-1],current_task,sizeof(thread_t));
threads[pid-1].cr3 = (uint32_t)(uintptr_t)new;
threads[pid-1].pid = pid;
threads[pid-1].tables = get_current_tables();
threads[pid-1].tss = syscall_temp_tss;
threads[pid-1].tss.eax = 0;
threads[pid-1].parent = current_task;
switch_tables((void *)current_tables);
set_cr3(current_cr3);
#ifdef TASK_DEBUG
kprint("[KDBG] New process forked:");
printf("====== pid=%$\n",pid);
dprintf("====== pid=%$\n",pid);
#endif
enable_tasking();
return pid;
}
uint32_t getpid() {
return current_task->pid;
}
void waitpid(uint32_t wait) {
disable_tasking();
if (threads[wait-1].parent!=current_task || threads[wait-1].pid==0)
yield(); // Assume child has exited before we could wait for it.
current_task->state = TASK_STATE_WAITPID;
current_task->waitval = wait;
yield();
}
void waitipc(uint32_t port) {
disable_tasking();
if (!verify_ipc_port_ownership(port))
yield();
current_task->state = TASK_STATE_WAITIPC;
current_task->waitval = port;
yield();
}
uint32_t get_retval() {
return current_task->waitval;
}
/*uint32_t get_process_state(uint32_t pid) {
return (uint32_t)threads[pid-1].state;
}*/
|
417912.c | void foo()
{
void foobar_1(union union_tag_1 *xxx);
void foobar_2(union union_tag_2 *xxx);
}
|
576325.c | #include <cstdio>
#include <queue>
using namespace std;
int n, nn[1010][1010];
queue<pair<int, int>> q[1010]; // 목적지, 간선 고유번호
int id; // 간선 고유번호
vector<int> visited;
void euc(int csr){
while(1){
while(!q[csr].empty() && visited[q[csr].front().second]) q[csr].pop();
if(q[csr].empty()) break;
auto [x, y] = q[csr].front();
q[csr].pop();
visited[y] = 1;
euc(x);
}
printf("%d ", csr);
}
int main(void){
scanf("%d", &n);
for(int i=1;i<=n;i++){
int cnt = 0;
for(int j=1;j<=n;j++){
int tmp;
scanf("%d", &tmp);
if(tmp) cnt+=tmp;
nn[i][j] = tmp;
}
if(cnt%2){
printf("-1");
return 0;
}
}
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
while(nn[i][j]){
nn[i][j]--;
id++;
q[i].push({j, id});
q[j].push({i, id});
}
}
}
visited.resize(id + 1);
euc(1);
return 0;
}
|
26413.c | /* $NetBSD: res_init.c,v 1.30 2015/02/24 17:56:20 christos Exp $ */
/*
* Copyright (c) 1985, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*/
/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <port_before.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <kits/support/String.h>
#include <unistd.h>
#include <fcntl.h>
#include <netdb.h>
#ifndef HAVE_MD5
# include <kits/dst/md5.h>
#else
# ifdef SOLARIS2
# include <sys/md5.h>
# endif
#endif
#ifndef _MD5_H_
# define _MD5_H_ 1 /*%< make sure we do not include rsaref md5.h file */
#endif
#include <port_after.h>
/* ensure that sockaddr_in6 and IN6ADDR_ANY_INIT are declared / defined */
#include <resolv.h>
#include <FindDirectory.h>
#include <res_private.h>
#define RESOLVSORT
/*% Options. Should all be left alone. */
#ifndef DEBUG
//#define DEBUG
#endif
#ifdef SOLARIS2
#include <sys/systeminfo.h>
#endif
static void res_setoptions(res_state, const char *, const char *);
#ifdef RESOLVSORT
static const char sort_mask[] = "/&";
#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)
static uint32_t net_mask __P((struct in_addr));
#endif
#if !defined(isascii) /*%< XXX - could be a function */
# define isascii(c) (!(c & 0200))
#endif
static const struct timespec ts = { 0, 0 };
/*
* Resolver state default settings.
*/
/*%
* Set up default settings. If the configuration file exist, the values
* there will have precedence. Otherwise, the server address is set to
* INADDR_ANY and the default domain name comes from the gethostname().
*
* An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
* rather than INADDR_ANY ("0.0.0.0") as the default name server address
* since it was noted that INADDR_ANY actually meant ``the first interface
* you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
* it had to be "up" in order for you to reach your own name server. It
* was later decided that since the recommended practice is to always
* install local static routes through 127.0.0.1 for all your network
* interfaces, that we could solve this problem without a code change.
*
* The configuration file should always be used, since it is the only way
* to specify a default domain. If you are running a server on your local
* machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
* in the configuration file.
*
* Return 0 if completes successfully, -1 on error
*/
int
res_ninit(res_state statp) {
return (__res_vinit(statp, 0));
}
/*% This function has to be reachable by res_data.c but not publically. */
int
__res_vinit(res_state statp, int preinit) {
register FILE *fp;
register char *cp, **pp;
register int n;
char path[PATH_MAX];
char buf[BUFSIZ];
int nserv = 0; /*%< number of nameserver records read from file */
int haveenv = 0;
int havesearch = 0;
#ifdef RESOLVSORT
int nsort = 0;
char *net;
#endif
int dots;
union res_sockaddr_union u[2];
int maxns = MAXNS;
RES_SET_H_ERRNO(statp, 0);
if ((statp->options & RES_INIT) != 0U)
res_ndestroy(statp);
if (!preinit) {
statp->retrans = RES_TIMEOUT;
statp->retry = RES_DFLRETRY;
statp->options = RES_DEFAULT;
}
res_rndinit(statp);
statp->id = res_nrandomid(statp);
memset(u, 0, sizeof(u));
#ifdef USELOOPBACK
u[nserv].sin.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
#else
u[nserv].sin.sin_addr.s_addr = INADDR_ANY;
#endif
u[nserv].sin.sin_family = AF_INET;
u[nserv].sin.sin_port = htons(NAMESERVER_PORT);
#ifdef HAVE_SA_LEN
u[nserv].sin.sin_len = sizeof(struct sockaddr_in);
#endif
nserv++;
#ifdef HAS_INET6_STRUCTS
#ifdef USELOOPBACK
u[nserv].sin6.sin6_addr = in6addr_loopback;
#else
u[nserv].sin6.sin6_addr = in6addr_any;
#endif
u[nserv].sin6.sin6_family = AF_INET6;
u[nserv].sin6.sin6_port = htons(NAMESERVER_PORT);
#ifdef HAVE_SA_LEN
u[nserv].sin6.sin6_len = sizeof(struct sockaddr_in6);
#endif
nserv++;
#endif
statp->nscount = 0;
statp->ndots = 1;
statp->pfcode = 0;
statp->_vcsock = -1;
statp->_flags = 0;
statp->qhook = NULL;
statp->rhook = NULL;
statp->_u._ext.nscount = 0;
statp->_u._ext.ext = malloc(sizeof(*statp->_u._ext.ext));
if (statp->_u._ext.ext != NULL) {
memset(statp->_u._ext.ext, 0, sizeof(*statp->_u._ext.ext));
statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr;
strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa");
strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int");
} else {
/*
* Historically res_init() rarely, if at all, failed.
* Examples and applications exist which do not check
* our return code. Furthermore several applications
* simply call us to get the systems domainname. So
* rather than immediately fail here we store the
* failure, which is returned later, in h_errno. And
* prevent the collection of 'nameserver' information
* by setting maxns to 0. Thus applications that fail
* to check our return code wont be able to make
* queries anyhow.
*/
RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
maxns = 0;
}
#ifdef RESOLVSORT
statp->nsort = 0;
#endif
res_setservers(statp, u, nserv);
#ifdef SOLARIS2
/*
* The old libresolv derived the defaultdomain from NIS/NIS+.
* We want to keep this behaviour
*/
{
char buf[sizeof(statp->defdname)], *cp;
int ret;
if ((ret = sysinfo(SI_SRPC_DOMAIN, buf, sizeof(buf))) > 0 &&
(unsigned int)ret <= sizeof(buf)) {
if (buf[0] == '+')
buf[0] = '.';
cp = strchr(buf, '.');
cp = (cp == NULL) ? buf : (cp + 1);
(void)strlcpy(statp->defdname, cp,
sizeof(statp->defdname));
}
}
#endif /* SOLARIS2 */
/* Allow user to override the local domain definition */
if ((cp = getenv("LOCALDOMAIN")) != NULL) {
(void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
statp->defdname[sizeof(statp->defdname) - 1] = '\0';
haveenv++;
/*
* Set search list to be blank-separated strings
* from rest of env value. Permits users of LOCALDOMAIN
* to still have a search list, and anyone to set the
* one that they want to use as an individual (even more
* important now that the rfc1535 stuff restricts searches)
*/
cp = statp->defdname;
pp = statp->dnsrch;
*pp++ = cp;
for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
if (*cp == '\n') /*%< silly backwards compat */
break;
else if (*cp == ' ' || *cp == '\t') {
*cp = 0;
n = 1;
} else if (n) {
*pp++ = cp;
n = 0;
havesearch = 1;
}
}
/* null terminate last domain if there are excess */
while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
cp++;
*cp = '\0';
*pp++ = 0;
}
#define MATCH(line, name) \
(!strncmp(line, name, sizeof(name) - 1) && \
(line[sizeof(name) - 1] == ' ' || \
line[sizeof(name) - 1] == '\t'))
if (find_directory(B_SYSTEM_SETTINGS_DIRECTORY, -1, false, path,
sizeof(path)) == B_OK)
strlcat(path, "/network/resolv.conf", sizeof(path));
nserv = 0;
if ((fp = fopen(path, "re")) != NULL) {
/* read the config file */
while (fgets(buf, (int)sizeof(buf), fp) != NULL) {
/* skip comments */
if (*buf == ';' || *buf == '#')
continue;
/* read default domain name */
if (MATCH(buf, "domain")) {
if (haveenv) /*%< skip if have from environ */
continue;
cp = buf + sizeof("domain") - 1;
while (*cp == ' ' || *cp == '\t')
cp++;
if ((*cp == '\0') || (*cp == '\n'))
continue;
strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
statp->defdname[sizeof(statp->defdname) - 1] = '\0';
if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL)
*cp = '\0';
havesearch = 0;
continue;
}
/* set search list */
if (MATCH(buf, "search")) {
if (haveenv) /*%< skip if have from environ */
continue;
cp = buf + sizeof("search") - 1;
while (*cp == ' ' || *cp == '\t')
cp++;
if ((*cp == '\0') || (*cp == '\n'))
continue;
strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
statp->defdname[sizeof(statp->defdname) - 1] = '\0';
if ((cp = strchr(statp->defdname, '\n')) != NULL)
*cp = '\0';
/*
* Set search list to be blank-separated strings
* on rest of line.
*/
cp = statp->defdname;
pp = statp->dnsrch;
*pp++ = cp;
for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
if (*cp == ' ' || *cp == '\t') {
*cp = 0;
n = 1;
} else if (n) {
*pp++ = cp;
n = 0;
}
}
/* null terminate last domain if there are excess */
while (*cp != '\0' && *cp != ' ' && *cp != '\t')
cp++;
*cp = '\0';
*pp++ = 0;
havesearch = 1;
continue;
}
/* read nameservers to query */
if (MATCH(buf, "nameserver") && nserv < maxns) {
struct addrinfo hints, *ai;
char sbuf[NI_MAXSERV];
const size_t minsiz =
sizeof(statp->_u._ext.ext->nsaddrs[0]);
cp = buf + sizeof("nameserver") - 1;
while (*cp == ' ' || *cp == '\t')
cp++;
cp[strcspn(cp, ";# \t\n")] = '\0';
if ((*cp != '\0') && (*cp != '\n')) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = AI_NUMERICHOST;
sprintf(sbuf, "%u", NAMESERVER_PORT);
if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 &&
ai->ai_addrlen <= minsiz) {
if (statp->_u._ext.ext != NULL) {
memcpy(&statp->_u._ext.ext->nsaddrs[nserv],
ai->ai_addr, ai->ai_addrlen);
}
if (ai->ai_addrlen <=
sizeof(statp->nsaddr_list[nserv])) {
memcpy(&statp->nsaddr_list[nserv],
ai->ai_addr, ai->ai_addrlen);
} else
statp->nsaddr_list[nserv].sin_family = 0;
freeaddrinfo(ai);
nserv++;
}
}
continue;
}
#ifdef RESOLVSORT
if (MATCH(buf, "sortlist")) {
struct in_addr a;
cp = buf + sizeof("sortlist") - 1;
while (nsort < MAXRESOLVSORT) {
while (*cp == ' ' || *cp == '\t')
cp++;
if (*cp == '\0' || *cp == '\n' || *cp == ';')
break;
net = cp;
while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
isascii(*cp) && !isspace((unsigned char)*cp))
cp++;
n = *cp;
*cp = 0;
if (inet_aton(net, &a)) {
statp->sort_list[nsort].addr = a;
if (ISSORTMASK(n)) {
*cp++ = n;
net = cp;
while (*cp && *cp != ';' &&
isascii(*cp) &&
!isspace((unsigned char)*cp))
cp++;
n = *cp;
*cp = 0;
if (inet_aton(net, &a)) {
statp->sort_list[nsort].mask = a.s_addr;
} else {
statp->sort_list[nsort].mask =
net_mask(statp->sort_list[nsort].addr);
}
} else {
statp->sort_list[nsort].mask =
net_mask(statp->sort_list[nsort].addr);
}
nsort++;
}
*cp = n;
}
continue;
}
#endif
if (MATCH(buf, "options")) {
res_setoptions(statp, buf + sizeof("options") - 1, "conf");
continue;
}
}
if (nserv > 0)
statp->nscount = nserv;
#ifdef RESOLVSORT
statp->nsort = nsort;
#endif
(void) fclose(fp);
}
/*
* Last chance to get a nameserver. This should not normally
* be necessary
*/
#ifdef NO_RESOLV_CONF
if(nserv == 0)
nserv = get_nameservers(statp);
#endif
if (statp->defdname[0] == 0 &&
gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
(cp = strchr(buf, '.')) != NULL)
strcpy(statp->defdname, cp + 1);
/* find components of local domain that might be searched */
if (havesearch == 0) {
pp = statp->dnsrch;
*pp++ = statp->defdname;
*pp = NULL;
dots = 0;
for (cp = statp->defdname; *cp; cp++)
dots += (*cp == '.');
cp = statp->defdname;
while (pp < statp->dnsrch + MAXDFLSRCH) {
if (dots < LOCALDOMAINPARTS)
break;
cp = strchr(cp, '.') + 1; /*%< we know there is one */
*pp++ = cp;
dots--;
}
*pp = NULL;
#ifdef DEBUG
if (statp->options & RES_DEBUG) {
printf(";; res_init()... default dnsrch list:\n");
for (pp = statp->dnsrch; *pp; pp++)
printf(";;\t%s\n", *pp);
printf(";;\t..END..\n");
}
#endif
}
if ((cp = getenv("RES_OPTIONS")) != NULL)
res_setoptions(statp, cp, "env");
statp->options |= RES_INIT;
return (statp->res_h_errno);
}
static void
res_setoptions(res_state statp, const char *options, const char *source)
{
const char *cp = options;
int i;
size_t j;
struct __res_state_ext *ext = statp->_u._ext.ext;
#ifdef DEBUG
if (statp->options & RES_DEBUG)
printf(";; res_setoptions(\"%s\", \"%s\")...\n",
options, source);
#endif
while (*cp) {
/* skip leading and inner runs of spaces */
while (*cp == ' ' || *cp == '\t')
cp++;
/* search for and process individual options */
if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
i = atoi(cp + sizeof("ndots:") - 1);
if (i <= RES_MAXNDOTS)
statp->ndots = i;
else
statp->ndots = RES_MAXNDOTS;
#ifdef DEBUG
if (statp->options & RES_DEBUG)
printf(";;\tndots=%d\n", statp->ndots);
#endif
} else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) {
i = atoi(cp + sizeof("timeout:") - 1);
if (i <= RES_MAXRETRANS)
statp->retrans = i;
else
statp->retrans = RES_MAXRETRANS;
#ifdef DEBUG
if (statp->options & RES_DEBUG)
printf(";;\ttimeout=%d\n", statp->retrans);
#endif
#ifdef SOLARIS2
} else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) {
/*
* For backward compatibility, 'retrans' is
* supported as an alias for 'timeout', though
* without an imposed maximum.
*/
statp->retrans = atoi(cp + sizeof("retrans:") - 1);
} else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){
/*
* For backward compatibility, 'retry' is
* supported as an alias for 'attempts', though
* without an imposed maximum.
*/
statp->retry = atoi(cp + sizeof("retry:") - 1);
#endif /* SOLARIS2 */
} else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
i = atoi(cp + sizeof("attempts:") - 1);
if (i <= RES_MAXRETRY)
statp->retry = i;
else
statp->retry = RES_MAXRETRY;
#ifdef DEBUG
if (statp->options & RES_DEBUG)
printf(";;\tattempts=%d\n", statp->retry);
#endif
} else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
#ifdef DEBUG
if (!(statp->options & RES_DEBUG)) {
printf(";; res_setoptions(\"%s\", \"%s\")..\n",
options, source);
statp->options |= RES_DEBUG;
}
printf(";;\tdebug\n");
#endif
} else if (!strncmp(cp, "no_tld_query",
sizeof("no_tld_query") - 1) ||
!strncmp(cp, "no-tld-query",
sizeof("no-tld-query") - 1)) {
statp->options |= RES_NOTLDQUERY;
} else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
statp->options |= RES_USE_INET6;
} else if (!strncmp(cp, "inet4", sizeof("inet4") - 1)) {
statp->options |= RES_USE_INET4;
} else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) {
statp->options |= RES_ROTATE;
} else if (!strncmp(cp, "no-check-names",
sizeof("no-check-names") - 1)) {
statp->options |= RES_NOCHECKNAME;
}
#ifdef RES_USE_EDNS0
else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
statp->options |= RES_USE_EDNS0;
}
#endif
else if (!strncmp(cp, "dname", sizeof("dname") - 1)) {
statp->options |= RES_USE_DNAME;
}
else if (!strncmp(cp, "nibble:", sizeof("nibble:") - 1)) {
if (ext == NULL)
goto skip;
cp += sizeof("nibble:") - 1;
j = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1);
strncpy(ext->nsuffix, cp, j);
ext->nsuffix[j] = '\0';
}
else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) {
if (ext == NULL)
goto skip;
cp += sizeof("nibble2:") - 1;
j = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1);
strncpy(ext->nsuffix2, cp, j);
ext->nsuffix2[j] = '\0';
}
else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) {
cp += sizeof("v6revmode:") - 1;
/* "nibble" and "bitstring" used to be valid */
if (!strncmp(cp, "single", sizeof("single") - 1)) {
statp->options |= RES_NO_NIBBLE2;
} else if (!strncmp(cp, "both", sizeof("both") - 1)) {
statp->options &=
~RES_NO_NIBBLE2;
}
}
else {
/* XXX - print a warning here? */
}
skip:
/* skip to next run of spaces */
while (*cp && *cp != ' ' && *cp != '\t')
cp++;
}
}
#ifdef RESOLVSORT
/* XXX - should really support CIDR which means explicit masks always. */
static uint32_t
net_mask(struct in_addr in) /*!< XXX - should really use system's version of this */
{
register uint32_t i = ntohl(in.s_addr);
if (IN_CLASSA(i))
return (htonl(IN_CLASSA_NET));
else if (IN_CLASSB(i))
return (htonl(IN_CLASSB_NET));
return (htonl(IN_CLASSC_NET));
}
#endif
void
res_rndinit(res_state statp)
{
struct timeval now;
uint32_t u32;
uint16_t u16;
u_char *rnd = statp->_rnd;
gettimeofday(&now, NULL);
u32 = (uint32_t)now.tv_sec;
memcpy(rnd, &u32, 4);
u32 = now.tv_usec;
memcpy(rnd + 4, &u32, 4);
u32 += (uint32_t)now.tv_sec;
memcpy(rnd + 8, &u32, 4);
u16 = getpid();
memcpy(rnd + 12, &u16, 2);
}
u_int
res_nrandomid(res_state statp)
{
struct timeval now;
uint16_t u16;
MD5_CTX ctx;
u_char *rnd = statp->_rnd;
gettimeofday(&now, NULL);
u16 = (uint16_t) (now.tv_sec ^ now.tv_usec);
memcpy(rnd + 14, &u16, 2);
#ifndef HAVE_MD5
MD5_Init(&ctx);
MD5_Update(&ctx, rnd, 16);
MD5_Final(rnd, &ctx);
#else
MD5Init(&ctx);
MD5Update(&ctx, rnd, 16);
MD5Final(rnd, &ctx);
#endif
memcpy(&u16, rnd + 14, 2);
return ((u_int) u16);
}
/*%
* This routine is for closing the socket if a virtual circuit is used and
* the program wants to close it. This provides support for endhostent()
* which expects to close the socket.
*
* This routine is not expected to be user visible.
*/
void
res_nclose(res_state statp)
{
int ns;
if (statp->_vcsock >= 0) {
(void) close(statp->_vcsock);
statp->_vcsock = -1;
statp->_flags &= ~(RES_F_VC | RES_F_CONN);
}
for (ns = 0; ns < statp->_u._ext.nscount; ns++) {
if (statp->_u._ext.nssocks[ns] != -1) {
(void) close(statp->_u._ext.nssocks[ns]);
statp->_u._ext.nssocks[ns] = -1;
}
}
}
void
res_ndestroy(res_state statp)
{
res_nclose(statp);
if (statp->_u._ext.ext != NULL) {
if (statp->_u._ext.ext->kq != -1)
(void)close(statp->_u._ext.ext->kq);
if (statp->_u._ext.ext->resfd != -1)
(void)close(statp->_u._ext.ext->resfd);
free(statp->_u._ext.ext);
statp->_u._ext.ext = NULL;
}
statp->options &= ~RES_INIT;
}
const char *
res_get_nibblesuffix(res_state statp)
{
if (statp->_u._ext.ext)
return (statp->_u._ext.ext->nsuffix);
return ("ip6.arpa");
}
const char *
res_get_nibblesuffix2(res_state statp)
{
if (statp->_u._ext.ext)
return (statp->_u._ext.ext->nsuffix2);
return ("ip6.int");
}
void
res_setservers(res_state statp, const union res_sockaddr_union *set, int cnt)
{
int i, nserv;
size_t size;
/* close open servers */
res_nclose(statp);
/* cause rtt times to be forgotten */
statp->_u._ext.nscount = 0;
nserv = 0;
for (i = 0; i < cnt && nserv < MAXNS; i++) {
switch (set->sin.sin_family) {
case AF_INET:
size = sizeof(set->sin);
if (statp->_u._ext.ext)
memcpy(&statp->_u._ext.ext->nsaddrs[nserv],
&set->sin, size);
if (size <= sizeof(statp->nsaddr_list[nserv]))
memcpy(&statp->nsaddr_list[nserv],
&set->sin, size);
else
statp->nsaddr_list[nserv].sin_family = 0;
nserv++;
break;
#ifdef HAS_INET6_STRUCTS
case AF_INET6:
size = sizeof(set->sin6);
if (statp->_u._ext.ext)
memcpy(&statp->_u._ext.ext->nsaddrs[nserv],
&set->sin6, size);
if (size <= sizeof(statp->nsaddr_list[nserv]))
memcpy(&statp->nsaddr_list[nserv],
&set->sin6, size);
else
statp->nsaddr_list[nserv].sin_family = 0;
nserv++;
break;
#endif
default:
break;
}
set++;
}
statp->nscount = nserv;
}
int
res_getservers(res_state statp, union res_sockaddr_union *set, int cnt)
{
int i;
size_t size;
uint16_t family;
for (i = 0; i < statp->nscount && i < cnt; i++) {
if (statp->_u._ext.ext)
family = statp->_u._ext.ext->nsaddrs[i].sin.sin_family;
else
family = statp->nsaddr_list[i].sin_family;
switch (family) {
case AF_INET:
size = sizeof(set->sin);
if (statp->_u._ext.ext)
memcpy(&set->sin,
&statp->_u._ext.ext->nsaddrs[i],
size);
else
memcpy(&set->sin, &statp->nsaddr_list[i],
size);
break;
#ifdef HAS_INET6_STRUCTS
case AF_INET6:
size = sizeof(set->sin6);
if (statp->_u._ext.ext)
memcpy(&set->sin6,
&statp->_u._ext.ext->nsaddrs[i],
size);
else
memcpy(&set->sin6, &statp->nsaddr_list[i],
size);
break;
#endif
default:
set->sin.sin_family = 0;
break;
}
set++;
}
return (statp->nscount);
}
/*! \file */
|
551463.c | //------------------------------------------------------------------------------
// gbsize: dimension and type of a GraphBLAS or MATLAB matrix
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//------------------------------------------------------------------------------
// The input may be either a GraphBLAS matrix struct or a standard MATLAB
// matrix. Note that the output may be int64, to accomodate huge hypersparse
// matrices. Also returns the type of the matrix.
// Usage:
// [m, n, type] = gbsize (X)
#include "gb_matlab.h"
void mexFunction
(
int nargout,
mxArray *pargout [ ],
int nargin,
const mxArray *pargin [ ]
)
{
//--------------------------------------------------------------------------
// check inputs
//--------------------------------------------------------------------------
gb_usage (nargin == 1 && nargout <= 4, "usage: [m n type] = gbsize (X)") ;
//--------------------------------------------------------------------------
// get the # of rows and columns of a GraphBLAS or MATLAB matrix
//--------------------------------------------------------------------------
GrB_Index nrows, ncols ;
int typecode = -1 ;
if (mxIsStruct (pargin [0]))
{
//----------------------------------------------------------------------
// get the size of a GraphBLAS matrix
//----------------------------------------------------------------------
// get the type
mxArray *mx_type = mxGetField (pargin [0], 0, "GraphBLASv4") ;
CHECK_ERROR (mx_type == NULL, "invalid GraphBLASv4 struct") ;
// get the scalar info
mxArray *opaque = mxGetField (pargin [0], 0, "s") ;
CHECK_ERROR (opaque == NULL, "invalid GraphBLASv4 struct") ;
int64_t *s = mxGetInt64s (opaque) ;
int64_t vlen = s [1] ;
int64_t vdim = s [2] ;
bool is_csc = (bool) (s [6]) ;
nrows = (is_csc) ? vlen : vdim ;
ncols = (is_csc) ? vdim : vlen ;
//----------------------------------------------------------------------
// return type of a GraphBLAS matrix, if requested
//----------------------------------------------------------------------
if (nargout > 2)
{
// return the type
pargout [2] = mxDuplicateArray (mx_type) ;
}
}
else
{
//----------------------------------------------------------------------
// get the size of a MATLAB matrix
//----------------------------------------------------------------------
nrows = (GrB_Index) mxGetM (pargin [0]) ;
ncols = (GrB_Index) mxGetN (pargin [0]) ;
//----------------------------------------------------------------------
// get the type of a MATLAB matrix, if requested
//----------------------------------------------------------------------
if (nargout > 2)
{
mxClassID class = mxGetClassID (pargin [0]) ;
bool is_complex = mxIsComplex (pargin [0]) ;
pargout [2] = gb_mxclass_to_mxstring (class, is_complex) ;
}
}
//--------------------------------------------------------------------------
// return the size as int64 or double
//--------------------------------------------------------------------------
if (nrows > FLINTMAX || ncols > FLINTMAX)
{
// output is int64 to avoid flint overflow
int64_t *p ;
pargout [0] = mxCreateNumericMatrix (1, 1, mxINT64_CLASS, mxREAL) ;
p = mxGetInt64s (pargout [0]) ;
p [0] = (int64_t) nrows ;
pargout [1] = mxCreateNumericMatrix (1, 1, mxINT64_CLASS, mxREAL) ;
p = mxGetInt64s (pargout [1]) ;
p [0] = (int64_t) ncols ;
}
else
{
// output is double
pargout [0] = mxCreateDoubleScalar ((double) nrows) ;
pargout [1] = mxCreateDoubleScalar ((double) ncols) ;
}
GB_WRAPUP ;
}
|
711631.c | /* vim: set et fdm=syntax sts=4 sw=4 ts=4 : */
/**
* Copyright © 2010 Saleem Abdulrasool <[email protected]>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. The name of the author may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
**/
#include <gtk/gtk.h>
#include "lash/lash.h"
#include "invenio-status-icon.h"
#include "invenio-search-window.h"
#include "libinvenio/invenio-configuration.h"
typedef struct InvenioStatusIcon
{
GtkStatusIcon *status_icon;
GtkWidget *context_menu;
GtkWidget *search_window;
LashKeyBinding *key_binding;
} InvenioStatusIcon;
static InvenioStatusIcon *icon;
static void
_icon_activate (GtkStatusIcon *status_icon,
gpointer user_data)
{
GtkWidget *menu;
GdkScreen *screen;
InvenioStatusIcon *icon;
gint window_width, window_height;
GdkRectangle geometry;
gint menu_x, menu_y;
gboolean pushed_in;
gint monitor;
gint x, y;
g_return_if_fail (status_icon);
g_return_if_fail (GTK_IS_STATUS_ICON (status_icon));
g_return_if_fail (user_data);
icon = (InvenioStatusIcon *) user_data;
menu = gtk_menu_new ();
gtk_status_icon_position_menu (GTK_MENU (menu),
&menu_x, &menu_y, &pushed_in,
status_icon);
screen = gtk_status_icon_get_screen (status_icon);
monitor = gdk_screen_get_monitor_at_point (screen, menu_x, menu_y);
gdk_screen_get_monitor_geometry (screen, monitor, &geometry);
gtk_window_get_size (GTK_WINDOW (icon->search_window),
&window_width, &window_height);
x = CLAMP (menu_x, 0, geometry.width - window_width);
y = CLAMP (menu_y, 0, geometry.height - window_height);
gtk_window_move (GTK_WINDOW (icon->search_window), x, y);
gtk_window_set_keep_above (GTK_WINDOW (icon->search_window), TRUE);
gtk_window_present (GTK_WINDOW (icon->search_window));
g_object_ref_sink (menu);
}
static void
_icon_popup_menu (GtkStatusIcon *status_icon,
guint button,
guint activate_time,
gpointer user_data)
{
InvenioStatusIcon *icon;
icon = (InvenioStatusIcon *) user_data;
gtk_menu_popup (GTK_MENU (icon->context_menu),
NULL, NULL,
gtk_status_icon_position_menu, status_icon,
button, activate_time);
}
static void
_menu_about_activate (GtkMenuItem *menu_item,
gpointer user_data)
{
/* TODO Implement About Dialog */
}
static void
_menu_quit_activate (GtkMenuItem *menu_item,
gpointer user_data)
{
gtk_main_quit ();
}
static GtkWidget *
_context_menu_create_for_icon (InvenioStatusIcon *icon)
{
GtkWidget *menu, *item;
menu = gtk_menu_new ();
/* About */
item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (_menu_about_activate), icon);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
/* Quit */
item = gtk_image_menu_item_new_from_stock (GTK_STOCK_QUIT, NULL);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (_menu_quit_activate), icon);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show_all (GTK_WIDGET (menu));
return menu;
}
static void
_icon_activate_wrapper (const gchar *string,
gpointer user_data)
{
_icon_activate (icon->status_icon, icon);
}
void
invenio_status_icon_create (void)
{
gchar *menu_shortcut;
g_return_if_fail (! icon);
lash_init ();
invenio_configuration_load ();
icon = g_new (InvenioStatusIcon, 1);
icon->status_icon = gtk_status_icon_new_from_stock (GTK_STOCK_FIND);
icon->context_menu = _context_menu_create_for_icon (icon);
icon->search_window = invenio_search_window_get_default ();
menu_shortcut = invenio_configuration_get_menu_shortcut ();
if (menu_shortcut && g_strcmp0 (menu_shortcut, "") != 0) {
icon->key_binding = lash_bind (menu_shortcut, _icon_activate_wrapper, icon);
g_free (menu_shortcut);
}
/* TODO create a _destroy and call there */
invenio_configuration_save ();
g_signal_connect (G_OBJECT (icon->status_icon), "activate",
G_CALLBACK (_icon_activate), icon);
g_signal_connect (G_OBJECT (icon->status_icon), "popup-menu",
G_CALLBACK (_icon_popup_menu), icon);
}
|
802193.c | /* parser.c -- without the optimizations */
#include "global.h"
int lookahead;
void match(int);
void start(), list(), expr(), moreterms(), term(), morefactors(), factor(), assignment(),exponential(),arguments();
void parse() /* parses and translates expression list */
{
lookahead = lexan();
start();
}
void start ()
{
/* Just one production for start, so we don't need to check lookahead */
list(); match(DONE);
}
void list()
{
if (lookahead == '(' || lookahead == ID || lookahead == NUM) {
assignment(); match(';'); list();
//expr(); match(';'); list();
}
else {
/* Empty */
}
}
void assignment(){
int id_lexeme = token_value;
match(ID);
emit(ID, id_lexeme);
match('=');
expr();
emit('=', token_value);
}
void expr ()
{
/* Just one production for expr, so we don't need to check lookahead */
term(); moreterms();
}
void moreterms()
{
if (lookahead == '+') {
match('+'); term(); emit('+', token_value); moreterms();
}
else if (lookahead == '-') {
match('-'); term(); emit('-', token_value); moreterms();
}
else {
/* Empty */
}
}
void term ()
{
/* Just one production for term, so we don't need to check lookahead */
factor(); morefactors();
}
void morefactors ()
{
if (lookahead == '*') {
match('*'); factor(); emit('*', token_value); morefactors();
}
else if (lookahead == '/') {
match('/'); factor(); emit('/', token_value); morefactors();
}
else if (lookahead == DIV) {
match(DIV); factor(); emit(DIV, token_value); morefactors();
}
else if (lookahead == MOD) {
match(MOD); factor(); emit(MOD, token_value); morefactors();
}
else {
/* Empty */
}
}
void factor(){
arguments(); exponential();
}
void exponential(){
if (lookahead == '^') {
match('^'); arguments(); emit('^', token_value); exponential();
}
else {
/* Empty */
}
}
void arguments ()
{
if (lookahead == '(') {
match('('); expr(); match(')');
}
else if (lookahead == ID) {
int id_lexeme = token_value;
match(ID);
emit(ID, id_lexeme);
}
else if (lookahead == NUM) {
int num_value = token_value;
match(NUM);
emit(NUM, num_value);
}
else
error("syntax error in factor");
}
void match(int t)
{
if (lookahead == t)
lookahead = lexan();
else
error ("syntax error in match");
}
|
799935.c | /***************************************************************************\
* Module Name: KBDGR.C
*
* keyboard layout for German
*
* Copyright (c) 1985-2000, Microsoft Corporation
*
* History:
* KBDTOOL v3.11 - Created Thu Aug 24 18:10:19 2000
\***************************************************************************/
#include <windows.h>
#include "kbd.h"
#include "kbdGR.h"
#if defined(_M_IA64)
#pragma section(".data")
#define ALLOC_SECTION_LDATA __declspec(allocate(".data"))
#else
#pragma data_seg(".data")
#define ALLOC_SECTION_LDATA
#endif
/***************************************************************************\
* ausVK[] - Virtual Scan Code to Virtual Key conversion table for German
\***************************************************************************/
static ALLOC_SECTION_LDATA USHORT ausVK[] = {
T00, T01, T02, T03, T04, T05, T06, T07,
T08, T09, T0A, T0B, T0C, T0D, T0E, T0F,
T10, T11, T12, T13, T14, T15, T16, T17,
T18, T19, T1A, T1B, T1C, T1D, T1E, T1F,
T20, T21, T22, T23, T24, T25, T26, T27,
T28, T29, T2A, T2B, T2C, T2D, T2E, T2F,
T30, T31, T32, T33, T34, T35,
/*
* Right-hand Shift key must have KBDEXT bit set.
*/
T36 | KBDEXT,
T37 | KBDMULTIVK, // numpad_* + Shift/Alt -> SnapShot
T38, T39, T3A, T3B, T3C, T3D, T3E,
T3F, T40, T41, T42, T43, T44,
/*
* NumLock Key:
* KBDEXT - VK_NUMLOCK is an Extended key
* KBDMULTIVK - VK_NUMLOCK or VK_PAUSE (without or with CTRL)
*/
T45 | KBDEXT | KBDMULTIVK,
T46 | KBDMULTIVK,
/*
* Number Pad keys:
* KBDNUMPAD - digits 0-9 and decimal point.
* KBDSPECIAL - require special processing by Windows
*/
T47 | KBDNUMPAD | KBDSPECIAL, // Numpad 7 (Home)
T48 | KBDNUMPAD | KBDSPECIAL, // Numpad 8 (Up),
T49 | KBDNUMPAD | KBDSPECIAL, // Numpad 9 (PgUp),
T4A,
T4B | KBDNUMPAD | KBDSPECIAL, // Numpad 4 (Left),
T4C | KBDNUMPAD | KBDSPECIAL, // Numpad 5 (Clear),
T4D | KBDNUMPAD | KBDSPECIAL, // Numpad 6 (Right),
T4E,
T4F | KBDNUMPAD | KBDSPECIAL, // Numpad 1 (End),
T50 | KBDNUMPAD | KBDSPECIAL, // Numpad 2 (Down),
T51 | KBDNUMPAD | KBDSPECIAL, // Numpad 3 (PgDn),
T52 | KBDNUMPAD | KBDSPECIAL, // Numpad 0 (Ins),
T53 | KBDNUMPAD | KBDSPECIAL, // Numpad . (Del),
T54, T55, T56, T57, T58, T59, T5A, T5B,
T5C, T5D, T5E, T5F, T60, T61, T62, T63,
T64, T65, T66, T67, T68, T69, T6A, T6B,
T6C, T6D, T6E, T6F, T70, T71, T72, T73,
T74, T75, T76, T77, T78, T79, T7A, T7B,
T7C, T7D, T7E
};
static ALLOC_SECTION_LDATA VSC_VK aE0VscToVk[] = {
{ 0x10, X10 | KBDEXT }, // Speedracer: Previous Track
{ 0x19, X19 | KBDEXT }, // Speedracer: Next Track
{ 0x1D, X1D | KBDEXT }, // RControl
{ 0x20, X20 | KBDEXT }, // Speedracer: Volume Mute
{ 0x21, X21 | KBDEXT }, // Speedracer: Launch App 2
{ 0x22, X22 | KBDEXT }, // Speedracer: Media Play/Pause
{ 0x24, X24 | KBDEXT }, // Speedracer: Media Stop
{ 0x2E, X2E | KBDEXT }, // Speedracer: Volume Down
{ 0x30, X30 | KBDEXT }, // Speedracer: Volume Up
{ 0x32, X32 | KBDEXT }, // Speedracer: Browser Home
{ 0x35, X35 | KBDEXT }, // Numpad Divide
{ 0x37, X37 | KBDEXT }, // Snapshot
{ 0x38, X38 | KBDEXT }, // RMenu
{ 0x47, X47 | KBDEXT }, // Home
{ 0x48, X48 | KBDEXT }, // Up
{ 0x49, X49 | KBDEXT }, // Prior
{ 0x4B, X4B | KBDEXT }, // Left
{ 0x4D, X4D | KBDEXT }, // Right
{ 0x4F, X4F | KBDEXT }, // End
{ 0x50, X50 | KBDEXT }, // Down
{ 0x51, X51 | KBDEXT }, // Next
{ 0x52, X52 | KBDEXT }, // Insert
{ 0x53, X53 | KBDEXT }, // Delete
{ 0x5B, X5B | KBDEXT }, // Left Win
{ 0x5C, X5C | KBDEXT }, // Right Win
{ 0x5D, X5D | KBDEXT }, // Application
{ 0x5F, X5F | KBDEXT }, // Speedracer: Sleep
{ 0x65, X65 | KBDEXT }, // Speedracer: Browser Search
{ 0x66, X66 | KBDEXT }, // Speedracer: Browser Favorites
{ 0x67, X67 | KBDEXT }, // Speedracer: Browser Refresh
{ 0x68, X68 | KBDEXT }, // Speedracer: Browser Stop
{ 0x69, X69 | KBDEXT }, // Speedracer: Browser Forward
{ 0x6A, X6A | KBDEXT }, // Speedracer: Browser Back
{ 0x6B, X6B | KBDEXT }, // Speedracer: Launch App 1
{ 0x6C, X6C | KBDEXT }, // Speedracer: Launch Mail
{ 0x6D, X6D | KBDEXT }, // Speedracer: Launch Media Selector
{ 0x1C, X1C | KBDEXT }, // Numpad Enter
{ 0x46, X46 | KBDEXT }, // Break (Ctrl + Pause)
{ 0, 0 }
};
static ALLOC_SECTION_LDATA VSC_VK aE1VscToVk[] = {
{ 0x1D, Y1D }, // Pause
{ 0 , 0 }
};
/***************************************************************************\
* aVkToBits[] - map Virtual Keys to Modifier Bits
*
* See kbd.h for a full description.
*
* German Keyboard has only three shifter keys:
* SHIFT (L & R) affects alphabnumeric keys,
* CTRL (L & R) is used to generate control characters
* ALT (L & R) used for generating characters by number with numpad
\***************************************************************************/
static ALLOC_SECTION_LDATA VK_TO_BIT aVkToBits[] = {
{ VK_SHIFT , KBDSHIFT },
{ VK_CONTROL , KBDCTRL },
{ VK_MENU , KBDALT },
{ 0 , 0 }
};
/***************************************************************************\
* aModification[] - map character modifier bits to modification number
*
* See kbd.h for a full description.
*
\***************************************************************************/
static ALLOC_SECTION_LDATA MODIFIERS CharModifiers = {
&aVkToBits[0],
6,
{
// Modification# // Keys Pressed
// ============= // =============
0, //
1, // Shift
3, // Control
4, // Shift + Control
SHFT_INVALID, // Menu
SHFT_INVALID, // Shift + Menu
2 // Control + Menu
}
};
/***************************************************************************\
*
* aVkToWch2[] - Virtual Key to WCHAR translation for 2 shift states
* aVkToWch3[] - Virtual Key to WCHAR translation for 3 shift states
* aVkToWch4[] - Virtual Key to WCHAR translation for 4 shift states
* aVkToWch5[] - Virtual Key to WCHAR translation for 5 shift states
*
* Table attributes: Unordered Scan, null-terminated
*
* Search this table for an entry with a matching Virtual Key to find the
* corresponding unshifted and shifted WCHAR characters.
*
* Special values for VirtualKey (column 1)
* 0xff - dead chars for the previous entry
* 0 - terminate the list
*
* Special values for Attributes (column 2)
* CAPLOK bit - CAPS-LOCK affect this key like SHIFT
*
* Special values for wch[*] (column 3 & 4)
* WCH_NONE - No character
* WCH_DEAD - Dead Key (diaresis) or invalid (US keyboard has none)
* WCH_LGTR - Ligature (generates multiple characters)
*
\***************************************************************************/
static ALLOC_SECTION_LDATA VK_TO_WCHARS2 aVkToWch2[] = {
// | | Shift |
// |=========|=========|
{VK_OEM_5 ,0 ,WCH_DEAD ,0x00b0 },
{0xff ,0 ,'^' ,WCH_NONE },
{'1' ,CAPLOK ,'1' ,'!' },
{'4' ,CAPLOK ,'4' ,'$' },
{'5' ,CAPLOK ,'5' ,'%' },
{VK_OEM_6 ,0 ,WCH_DEAD ,WCH_DEAD },
{0xff ,0 ,0x00b4 ,'`' },
{'W' ,CAPLOK ,'w' ,'W' },
{'R' ,CAPLOK ,'r' ,'R' },
{'T' ,CAPLOK ,'t' ,'T' },
{'Z' ,CAPLOK ,'z' ,'Z' },
{'U' ,CAPLOK ,'u' ,'U' },
{'I' ,CAPLOK ,'i' ,'I' },
{'O' ,CAPLOK ,'o' ,'O' },
{'P' ,CAPLOK ,'p' ,'P' },
{'A' ,CAPLOK ,'a' ,'A' },
{'S' ,CAPLOK ,'s' ,'S' },
{'D' ,CAPLOK ,'d' ,'D' },
{'F' ,CAPLOK ,'f' ,'F' },
{'G' ,CAPLOK ,'g' ,'G' },
{'H' ,CAPLOK ,'h' ,'H' },
{'J' ,CAPLOK ,'j' ,'J' },
{'K' ,CAPLOK ,'k' ,'K' },
{'L' ,CAPLOK ,'l' ,'L' },
{VK_OEM_3 ,CAPLOK ,0x00f6 ,0x00d6 },
{VK_OEM_7 ,CAPLOK ,0x00e4 ,0x00c4 },
{'Y' ,CAPLOK ,'y' ,'Y' },
{'X' ,CAPLOK ,'x' ,'X' },
{'C' ,CAPLOK ,'c' ,'C' },
{'V' ,CAPLOK ,'v' ,'V' },
{'B' ,CAPLOK ,'b' ,'B' },
{'N' ,CAPLOK ,'n' ,'N' },
{VK_OEM_COMMA ,CAPLOK ,',' ,';' },
{VK_OEM_PERIOD,CAPLOK ,'.' ,':' },
{VK_DECIMAL ,0 ,',' ,',' },
{VK_TAB ,0 ,'\t' ,'\t' },
{VK_ADD ,0 ,'+' ,'+' },
{VK_DIVIDE ,0 ,'/' ,'/' },
{VK_MULTIPLY ,0 ,'*' ,'*' },
{VK_SUBTRACT ,0 ,'-' ,'-' },
{0 ,0 ,0 ,0 }
};
static ALLOC_SECTION_LDATA VK_TO_WCHARS3 aVkToWch3[] = {
// | | Shift | Ctl+Alt|
// |=========|=========|=========|
{'3' ,CAPLOK ,'3' ,0x00a7 ,0x00b3 },
{'7' ,CAPLOK ,'7' ,'/' ,'{' },
{'8' ,CAPLOK ,'8' ,'(' ,'[' },
{'9' ,CAPLOK ,'9' ,')' ,']' },
{'0' ,CAPLOK ,'0' ,'=' ,'}' },
{VK_OEM_4 ,CAPLOK ,0x00df ,'?' ,'\\' },
{'Q' ,CAPLOK ,'q' ,'Q' ,'@' },
{'E' ,CAPLOK ,'e' ,'E' ,0x20ac },
{'M' ,CAPLOK ,'m' ,'M' ,0x00b5 },
{VK_OEM_102 ,0 ,'<' ,'>' ,'|' },
{0 ,0 ,0 ,0 ,0 }
};
static ALLOC_SECTION_LDATA VK_TO_WCHARS4 aVkToWch4[] = {
// | | Shift | Ctl+Alt| Ctrl |
// |=========|=========|=========|=========|
{VK_OEM_1 ,CAPLOK ,0x00fc ,0x00dc ,WCH_NONE ,0x001b },
{VK_OEM_PLUS ,CAPLOK ,'+' ,'*' ,'~' ,0x001d },
{VK_OEM_2 ,CAPLOK ,'#' ,'\'' ,WCH_NONE ,0x001c },
{VK_BACK ,0 ,'\b' ,'\b' ,WCH_NONE ,0x007f },
{VK_ESCAPE ,0 ,0x001b ,0x001b ,WCH_NONE ,0x001b },
{VK_RETURN ,0 ,'\r' ,'\r' ,WCH_NONE ,'\n' },
{VK_SPACE ,0 ,' ' ,' ' ,WCH_NONE ,' ' },
{VK_CANCEL ,0 ,0x0003 ,0x0003 ,WCH_NONE ,0x0003 },
{0 ,0 ,0 ,0 ,0 ,0 }
};
static ALLOC_SECTION_LDATA VK_TO_WCHARS5 aVkToWch5[] = {
// | | Shift | Ctl+Alt| Ctrl |S+Ctrl |
// |=========|=========|=========|=========|=========|
{'2' ,CAPLOK ,'2' ,'\"' ,0x00b2 ,WCH_NONE ,0x0000 },
{'6' ,CAPLOK ,'6' ,'&' ,WCH_NONE ,WCH_NONE ,0x001e },
{VK_OEM_MINUS ,0 ,'-' ,'_' ,WCH_NONE ,WCH_NONE ,0x001f },
{0 ,0 ,0 ,0 ,0 ,0 ,0 }
};
// Put this last so that VkKeyScan interprets number characters
// as coming from the main section of the kbd (aVkToWch2 and
// aVkToWch5) before considering the numpad (aVkToWch1).
static ALLOC_SECTION_LDATA VK_TO_WCHARS1 aVkToWch1[] = {
{ VK_NUMPAD0 , 0 , '0' },
{ VK_NUMPAD1 , 0 , '1' },
{ VK_NUMPAD2 , 0 , '2' },
{ VK_NUMPAD3 , 0 , '3' },
{ VK_NUMPAD4 , 0 , '4' },
{ VK_NUMPAD5 , 0 , '5' },
{ VK_NUMPAD6 , 0 , '6' },
{ VK_NUMPAD7 , 0 , '7' },
{ VK_NUMPAD8 , 0 , '8' },
{ VK_NUMPAD9 , 0 , '9' },
{ 0 , 0 , '\0' }
};
static ALLOC_SECTION_LDATA VK_TO_WCHAR_TABLE aVkToWcharTable[] = {
{ (PVK_TO_WCHARS1)aVkToWch3, 3, sizeof(aVkToWch3[0]) },
{ (PVK_TO_WCHARS1)aVkToWch4, 4, sizeof(aVkToWch4[0]) },
{ (PVK_TO_WCHARS1)aVkToWch5, 5, sizeof(aVkToWch5[0]) },
{ (PVK_TO_WCHARS1)aVkToWch2, 2, sizeof(aVkToWch2[0]) },
{ (PVK_TO_WCHARS1)aVkToWch1, 1, sizeof(aVkToWch1[0]) },
{ NULL, 0, 0 },
};
/***************************************************************************\
* aKeyNames[], aKeyNamesExt[] - Virtual Scancode to Key Name tables
*
* Table attributes: Ordered Scan (by scancode), null-terminated
*
* Only the names of Extended, NumPad, Dead and Non-Printable keys are here.
* (Keys producing printable characters are named by that character)
\***************************************************************************/
static ALLOC_SECTION_LDATA VSC_LPWSTR aKeyNames[] = {
0x01, L"ESC",
0x0e, L"R\x00DC" L"CK",
0x0f, L"TABULATOR",
0x1c, L"EINGABE",
0x1d, L"STRG",
0x2a, L"UMSCHALT",
0x36, L"UMSCHALT RECHTS",
0x37, L" (ZEHNERTASTATUR)",
0x38, L"ALT",
0x39, L"LEER",
0x3a, L"FESTSTELL",
0x3b, L"F1",
0x3c, L"F2",
0x3d, L"F3",
0x3e, L"F4",
0x3f, L"F5",
0x40, L"F6",
0x41, L"F7",
0x42, L"F8",
0x43, L"F9",
0x44, L"F10",
0x45, L"PAUSE",
0x46, L"ROLLEN-FESTSTELL",
0x47, L"7 (ZEHNERTASTATUR)",
0x48, L"8 (ZEHNERTASTATUR)",
0x49, L"9 (ZEHNERTASTATUR)",
0x4a, L"- (ZEHNERTASTATUR)",
0x4b, L"4 (ZEHNERTASTATUR)",
0x4c, L"5 (ZEHNERTASTATUR)",
0x4d, L"6 (ZEHNERTASTATUR)",
0x4e, L"+ (ZEHNERTASTATUR)",
0x4f, L"1 (ZEHNERTASTATUR)",
0x50, L"2 (ZEHNERTASTATUR)",
0x51, L"3 (ZEHNERTASTATUR)",
0x52, L"0 (ZEHNERTASTATUR)",
0x53, L"KOMMA (ZEHNERTASTATUR)",
0x57, L"F11",
0x58, L"F12",
0 , NULL
};
static ALLOC_SECTION_LDATA VSC_LPWSTR aKeyNamesExt[] = {
0x1c, L"EINGABE (ZEHNERTASTATUR)",
0x1d, L"STRG-RECHTS",
0x35, L" (ZEHNERTASTATUR)",
0x37, L"DRUCK",
0x38, L"ALT GR",
0x45, L"NUM-FESTSTELL",
0x46, L"UNTBR",
0x47, L"POS1",
0x48, L"NACH-OBEN",
0x49, L"BILD-NACH-OBEN",
0x4b, L"NACH-LINKS",
0x4d, L"NACH-RECHTS",
0x4f, L"ENDE",
0x50, L"NACH-UNTEN",
0x51, L"BILD-NACH-UNTEN",
0x52, L"EINFG",
0x53, L"ENTF",
0x54, L"<00>",
0x56, L"HILFE",
0x5b, L"LINKE WINDOWS",
0x5c, L"RECHTE WINDOWS",
0x5d, L"ANWENDUNG",
0 , NULL
};
static ALLOC_SECTION_LDATA DEADKEY_LPWSTR aKeyNamesDead[] = {
L"\x00b4" L"AKUT",
L"`" L"GRAVIS",
L"^" L"ZIRKUMFLEX",
NULL
};
static ALLOC_SECTION_LDATA DEADKEY aDeadKey[] = {
DEADTRANS( L'a' , L'^' , 0x00e2 , 0x0000),
DEADTRANS( L'e' , L'^' , 0x00ea , 0x0000),
DEADTRANS( L'i' , L'^' , 0x00ee , 0x0000),
DEADTRANS( L'o' , L'^' , 0x00f4 , 0x0000),
DEADTRANS( L'u' , L'^' , 0x00fb , 0x0000),
DEADTRANS( L'A' , L'^' , 0x00c2 , 0x0000),
DEADTRANS( L'E' , L'^' , 0x00ca , 0x0000),
DEADTRANS( L'I' , L'^' , 0x00ce , 0x0000),
DEADTRANS( L'O' , L'^' , 0x00d4 , 0x0000),
DEADTRANS( L'U' , L'^' , 0x00db , 0x0000),
DEADTRANS( L' ' , L'^' , L'^' , 0x0000),
DEADTRANS( L'a' , 0x00b4 , 0x00e1 , 0x0000),
DEADTRANS( L'e' , 0x00b4 , 0x00e9 , 0x0000),
DEADTRANS( L'i' , 0x00b4 , 0x00ed , 0x0000),
DEADTRANS( L'o' , 0x00b4 , 0x00f3 , 0x0000),
DEADTRANS( L'u' , 0x00b4 , 0x00fa , 0x0000),
DEADTRANS( L'y' , 0x00b4 , 0x00fd , 0x0000),
DEADTRANS( L'A' , 0x00b4 , 0x00c1 , 0x0000),
DEADTRANS( L'E' , 0x00b4 , 0x00c9 , 0x0000),
DEADTRANS( L'I' , 0x00b4 , 0x00cd , 0x0000),
DEADTRANS( L'O' , 0x00b4 , 0x00d3 , 0x0000),
DEADTRANS( L'U' , 0x00b4 , 0x00da , 0x0000),
DEADTRANS( L'Y' , 0x00b4 , 0x00dd , 0x0000),
DEADTRANS( L' ' , 0x00b4 , 0x00b4 , 0x0000),
DEADTRANS( L'a' , L'`' , 0x00e0 , 0x0000),
DEADTRANS( L'e' , L'`' , 0x00e8 , 0x0000),
DEADTRANS( L'i' , L'`' , 0x00ec , 0x0000),
DEADTRANS( L'o' , L'`' , 0x00f2 , 0x0000),
DEADTRANS( L'u' , L'`' , 0x00f9 , 0x0000),
DEADTRANS( L'A' , L'`' , 0x00c0 , 0x0000),
DEADTRANS( L'E' , L'`' , 0x00c8 , 0x0000),
DEADTRANS( L'I' , L'`' , 0x00cc , 0x0000),
DEADTRANS( L'O' , L'`' , 0x00d2 , 0x0000),
DEADTRANS( L'U' , L'`' , 0x00d9 , 0x0000),
DEADTRANS( L' ' , L'`' , L'`' , 0x0000),
0, 0
};
static ALLOC_SECTION_LDATA KBDTABLES KbdTables = {
/*
* Modifier keys
*/
&CharModifiers,
/*
* Characters tables
*/
aVkToWcharTable,
/*
* Diacritics
*/
aDeadKey,
/*
* Names of Keys
*/
aKeyNames,
aKeyNamesExt,
aKeyNamesDead,
/*
* Scan codes to Virtual Keys
*/
ausVK,
sizeof(ausVK) / sizeof(ausVK[0]),
aE0VscToVk,
aE1VscToVk,
/*
* Locale-specific special processing
*/
MAKELONG(KLLF_ALTGR, KBD_VERSION),
/*
* Ligatures
*/
0,
0,
NULL
};
PKBDTABLES KbdLayerDescriptor(VOID)
{
return &KbdTables;
}
|
736177.c | /*
* WPA Supplicant / Configuration parser and common functions
* Copyright (c) 2003-2012, Jouni Malinen <[email protected]>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#include "includes.h"
#include "common.h"
#include "utils/uuid.h"
#include "crypto/sha1.h"
#include "rsn_supp/wpa.h"
#include "eap_peer/eap.h"
#include "p2p/p2p.h"
#include "config.h"
#if !defined(CONFIG_CTRL_IFACE) && defined(CONFIG_NO_CONFIG_WRITE)
#define NO_CONFIG_WRITE
#endif
/*
* Structure for network configuration parsing. This data is used to implement
* a generic parser for each network block variable. The table of configuration
* variables is defined below in this file (ssid_fields[]).
*/
struct parse_data {
/* Configuration variable name */
char *name;
/* Parser function for this variable */
int (*parser)(const struct parse_data *data, struct wpa_ssid *ssid,
int line, const char *value);
#ifndef NO_CONFIG_WRITE
/* Writer function (i.e., to get the variable in text format from
* internal presentation). */
char * (*writer)(const struct parse_data *data, struct wpa_ssid *ssid);
#endif /* NO_CONFIG_WRITE */
/* Variable specific parameters for the parser. */
void *param1, *param2, *param3, *param4;
/* 0 = this variable can be included in debug output and ctrl_iface
* 1 = this variable contains key/private data and it must not be
* included in debug output unless explicitly requested. In
* addition, this variable will not be readable through the
* ctrl_iface.
*/
int key_data;
};
static int wpa_config_parse_str(const struct parse_data *data,
struct wpa_ssid *ssid,
int line, const char *value)
{
size_t res_len, *dst_len;
char **dst, *tmp;
if (os_strcmp(value, "NULL") == 0) {
wpa_printf(MSG_DEBUG, "Unset configuration string '%s'",
data->name);
tmp = NULL;
res_len = 0;
goto set;
}
tmp = wpa_config_parse_string(value, &res_len);
if (tmp == NULL) {
wpa_printf(MSG_ERROR, "Line %d: failed to parse %s '%s'.",
line, data->name,
data->key_data ? "[KEY DATA REMOVED]" : value);
return -1;
}
if (data->key_data) {
wpa_hexdump_ascii_key(MSG_MSGDUMP, data->name,
(u8 *) tmp, res_len);
} else {
wpa_hexdump_ascii(MSG_MSGDUMP, data->name,
(u8 *) tmp, res_len);
}
if (data->param3 && res_len < (size_t) data->param3) {
wpa_printf(MSG_ERROR, "Line %d: too short %s (len=%lu "
"min_len=%ld)", line, data->name,
(unsigned long) res_len, (long) data->param3);
os_free(tmp);
return -1;
}
if (data->param4 && res_len > (size_t) data->param4) {
wpa_printf(MSG_ERROR, "Line %d: too long %s (len=%lu "
"max_len=%ld)", line, data->name,
(unsigned long) res_len, (long) data->param4);
os_free(tmp);
return -1;
}
set:
dst = (char **) (((u8 *) ssid) + (long) data->param1);
dst_len = (size_t *) (((u8 *) ssid) + (long) data->param2);
os_free(*dst);
*dst = tmp;
if (data->param2)
*dst_len = res_len;
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_string_ascii(const u8 *value, size_t len)
{
char *buf;
buf = os_malloc(len + 3);
if (buf == NULL)
return NULL;
buf[0] = '"';
os_memcpy(buf + 1, value, len);
buf[len + 1] = '"';
buf[len + 2] = '\0';
return buf;
}
static char * wpa_config_write_string_hex(const u8 *value, size_t len)
{
char *buf;
buf = os_zalloc(2 * len + 1);
if (buf == NULL)
return NULL;
wpa_snprintf_hex(buf, 2 * len + 1, value, len);
return buf;
}
static char * wpa_config_write_string(const u8 *value, size_t len)
{
if (value == NULL)
return NULL;
if (is_hex(value, len))
return wpa_config_write_string_hex(value, len);
else
return wpa_config_write_string_ascii(value, len);
}
static char * wpa_config_write_str(const struct parse_data *data,
struct wpa_ssid *ssid)
{
size_t len;
char **src;
src = (char **) (((u8 *) ssid) + (long) data->param1);
if (*src == NULL)
return NULL;
if (data->param2)
len = *((size_t *) (((u8 *) ssid) + (long) data->param2));
else
len = os_strlen(*src);
return wpa_config_write_string((const u8 *) *src, len);
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_int(const struct parse_data *data,
struct wpa_ssid *ssid,
int line, const char *value)
{
int val, *dst;
char *end;
dst = (int *) (((u8 *) ssid) + (long) data->param1);
val = strtol(value, &end, 0);
if (*end) {
wpa_printf(MSG_ERROR, "Line %d: invalid number \"%s\"",
line, value);
return -1;
}
*dst = val;
wpa_printf(MSG_MSGDUMP, "%s=%d (0x%x)", data->name, *dst, *dst);
if (data->param3 && *dst < (long) data->param3) {
wpa_printf(MSG_ERROR, "Line %d: too small %s (value=%d "
"min_value=%ld)", line, data->name, *dst,
(long) data->param3);
*dst = (long) data->param3;
return -1;
}
if (data->param4 && *dst > (long) data->param4) {
wpa_printf(MSG_ERROR, "Line %d: too large %s (value=%d "
"max_value=%ld)", line, data->name, *dst,
(long) data->param4);
*dst = (long) data->param4;
return -1;
}
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_int(const struct parse_data *data,
struct wpa_ssid *ssid)
{
int *src, res;
char *value;
src = (int *) (((u8 *) ssid) + (long) data->param1);
value = os_malloc(20);
if (value == NULL)
return NULL;
res = os_snprintf(value, 20, "%d", *src);
if (res < 0 || res >= 20) {
os_free(value);
return NULL;
}
value[20 - 1] = '\0';
return value;
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_bssid(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
if (value[0] == '\0' || os_strcmp(value, "\"\"") == 0 ||
os_strcmp(value, "any") == 0) {
ssid->bssid_set = 0;
wpa_printf(MSG_MSGDUMP, "BSSID any");
return 0;
}
if (hwaddr_aton(value, ssid->bssid)) {
wpa_printf(MSG_ERROR, "Line %d: Invalid BSSID '%s'.",
line, value);
return -1;
}
ssid->bssid_set = 1;
wpa_hexdump(MSG_MSGDUMP, "BSSID", ssid->bssid, ETH_ALEN);
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_bssid(const struct parse_data *data,
struct wpa_ssid *ssid)
{
char *value;
int res;
if (!ssid->bssid_set)
return NULL;
value = os_malloc(20);
if (value == NULL)
return NULL;
res = os_snprintf(value, 20, MACSTR, MAC2STR(ssid->bssid));
if (res < 0 || res >= 20) {
os_free(value);
return NULL;
}
value[20 - 1] = '\0';
return value;
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_psk(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
#ifdef CONFIG_EXT_PASSWORD
if (os_strncmp(value, "ext:", 4) == 0) {
os_free(ssid->passphrase);
ssid->passphrase = NULL;
ssid->psk_set = 0;
os_free(ssid->ext_psk);
ssid->ext_psk = os_strdup(value + 4);
if (ssid->ext_psk == NULL)
return -1;
wpa_printf(MSG_DEBUG, "PSK: External password '%s'",
ssid->ext_psk);
return 0;
}
#endif /* CONFIG_EXT_PASSWORD */
if (*value == '"') {
#ifndef CONFIG_NO_PBKDF2
const char *pos;
size_t len;
value++;
pos = os_strrchr(value, '"');
if (pos)
len = pos - value;
else
len = os_strlen(value);
if (len < 8 || len > 63) {
wpa_printf(MSG_ERROR, "Line %d: Invalid passphrase "
"length %lu (expected: 8..63) '%s'.",
line, (unsigned long) len, value);
return -1;
}
wpa_hexdump_ascii_key(MSG_MSGDUMP, "PSK (ASCII passphrase)",
(u8 *) value, len);
if (ssid->passphrase && os_strlen(ssid->passphrase) == len &&
os_memcmp(ssid->passphrase, value, len) == 0)
return 0;
ssid->psk_set = 0;
os_free(ssid->passphrase);
ssid->passphrase = dup_binstr(value, len);
if (ssid->passphrase == NULL)
return -1;
return 0;
#else /* CONFIG_NO_PBKDF2 */
wpa_printf(MSG_ERROR, "Line %d: ASCII passphrase not "
"supported.", line);
return -1;
#endif /* CONFIG_NO_PBKDF2 */
}
if (hexstr2bin(value, ssid->psk, PMK_LEN) ||
value[PMK_LEN * 2] != '\0') {
wpa_printf(MSG_ERROR, "Line %d: Invalid PSK '%s'.",
line, value);
return -1;
}
os_free(ssid->passphrase);
ssid->passphrase = NULL;
ssid->psk_set = 1;
wpa_hexdump_key(MSG_MSGDUMP, "PSK", ssid->psk, PMK_LEN);
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_psk(const struct parse_data *data,
struct wpa_ssid *ssid)
{
#ifdef CONFIG_EXT_PASSWORD
if (ssid->ext_psk) {
size_t len = 4 + os_strlen(ssid->ext_psk) + 1;
char *buf = os_malloc(len);
if (buf == NULL)
return NULL;
os_snprintf(buf, len, "ext:%s", ssid->ext_psk);
return buf;
}
#endif /* CONFIG_EXT_PASSWORD */
if (ssid->passphrase)
return wpa_config_write_string_ascii(
(const u8 *) ssid->passphrase,
os_strlen(ssid->passphrase));
if (ssid->psk_set)
return wpa_config_write_string_hex(ssid->psk, PMK_LEN);
return NULL;
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_proto(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int val = 0, last, errors = 0;
char *start, *end, *buf;
buf = os_strdup(value);
if (buf == NULL)
return -1;
start = buf;
while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
break;
end = start;
while (*end != ' ' && *end != '\t' && *end != '\0')
end++;
last = *end == '\0';
*end = '\0';
if (os_strcmp(start, "WPA") == 0)
val |= WPA_PROTO_WPA;
else if (os_strcmp(start, "RSN") == 0 ||
os_strcmp(start, "WPA2") == 0)
val |= WPA_PROTO_RSN;
else {
wpa_printf(MSG_ERROR, "Line %d: invalid proto '%s'",
line, start);
errors++;
}
if (last)
break;
start = end + 1;
}
os_free(buf);
if (val == 0) {
wpa_printf(MSG_ERROR,
"Line %d: no proto values configured.", line);
errors++;
}
wpa_printf(MSG_MSGDUMP, "proto: 0x%x", val);
ssid->proto = val;
return errors ? -1 : 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_proto(const struct parse_data *data,
struct wpa_ssid *ssid)
{
int first = 1, ret;
char *buf, *pos, *end;
pos = buf = os_zalloc(10);
if (buf == NULL)
return NULL;
end = buf + 10;
if (ssid->proto & WPA_PROTO_WPA) {
ret = os_snprintf(pos, end - pos, "%sWPA", first ? "" : " ");
if (ret < 0 || ret >= end - pos)
return buf;
pos += ret;
first = 0;
}
if (ssid->proto & WPA_PROTO_RSN) {
ret = os_snprintf(pos, end - pos, "%sRSN", first ? "" : " ");
if (ret < 0 || ret >= end - pos)
return buf;
pos += ret;
first = 0;
}
return buf;
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_key_mgmt(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int val = 0, last, errors = 0;
char *start, *end, *buf;
buf = os_strdup(value);
if (buf == NULL)
return -1;
start = buf;
while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
break;
end = start;
while (*end != ' ' && *end != '\t' && *end != '\0')
end++;
last = *end == '\0';
*end = '\0';
if (os_strcmp(start, "WPA-PSK") == 0)
val |= WPA_KEY_MGMT_PSK;
else if (os_strcmp(start, "WPA-EAP") == 0)
val |= WPA_KEY_MGMT_IEEE8021X;
else if (os_strcmp(start, "IEEE8021X") == 0)
val |= WPA_KEY_MGMT_IEEE8021X_NO_WPA;
else if (os_strcmp(start, "NONE") == 0)
val |= WPA_KEY_MGMT_NONE;
else if (os_strcmp(start, "WPA-NONE") == 0)
val |= WPA_KEY_MGMT_WPA_NONE;
#ifdef CONFIG_IEEE80211R
else if (os_strcmp(start, "FT-PSK") == 0)
val |= WPA_KEY_MGMT_FT_PSK;
else if (os_strcmp(start, "FT-EAP") == 0)
val |= WPA_KEY_MGMT_FT_IEEE8021X;
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
else if (os_strcmp(start, "WPA-PSK-SHA256") == 0)
val |= WPA_KEY_MGMT_PSK_SHA256;
else if (os_strcmp(start, "WPA-EAP-SHA256") == 0)
val |= WPA_KEY_MGMT_IEEE8021X_SHA256;
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_WPS
else if (os_strcmp(start, "WPS") == 0)
val |= WPA_KEY_MGMT_WPS;
#endif /* CONFIG_WPS */
#ifdef CONFIG_SAE
else if (os_strcmp(start, "SAE") == 0)
val |= WPA_KEY_MGMT_SAE;
else if (os_strcmp(start, "FT-SAE") == 0)
val |= WPA_KEY_MGMT_FT_SAE;
#endif /* CONFIG_SAE */
else {
wpa_printf(MSG_ERROR, "Line %d: invalid key_mgmt '%s'",
line, start);
errors++;
}
if (last)
break;
start = end + 1;
}
os_free(buf);
if (val == 0) {
wpa_printf(MSG_ERROR,
"Line %d: no key_mgmt values configured.", line);
errors++;
}
wpa_printf(MSG_MSGDUMP, "key_mgmt: 0x%x", val);
ssid->key_mgmt = val;
return errors ? -1 : 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_key_mgmt(const struct parse_data *data,
struct wpa_ssid *ssid)
{
char *buf, *pos, *end;
int ret;
pos = buf = os_zalloc(50);
if (buf == NULL)
return NULL;
end = buf + 50;
if (ssid->key_mgmt & WPA_KEY_MGMT_PSK) {
ret = os_snprintf(pos, end - pos, "%sWPA-PSK",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
if (ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X) {
ret = os_snprintf(pos, end - pos, "%sWPA-EAP",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
if (ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X_NO_WPA) {
ret = os_snprintf(pos, end - pos, "%sIEEE8021X",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
if (ssid->key_mgmt & WPA_KEY_MGMT_NONE) {
ret = os_snprintf(pos, end - pos, "%sNONE",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
if (ssid->key_mgmt & WPA_KEY_MGMT_WPA_NONE) {
ret = os_snprintf(pos, end - pos, "%sWPA-NONE",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
#ifdef CONFIG_IEEE80211R
if (ssid->key_mgmt & WPA_KEY_MGMT_FT_PSK)
pos += os_snprintf(pos, end - pos, "%sFT-PSK",
pos == buf ? "" : " ");
if (ssid->key_mgmt & WPA_KEY_MGMT_FT_IEEE8021X)
pos += os_snprintf(pos, end - pos, "%sFT-EAP",
pos == buf ? "" : " ");
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
if (ssid->key_mgmt & WPA_KEY_MGMT_PSK_SHA256)
pos += os_snprintf(pos, end - pos, "%sWPA-PSK-SHA256",
pos == buf ? "" : " ");
if (ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X_SHA256)
pos += os_snprintf(pos, end - pos, "%sWPA-EAP-SHA256",
pos == buf ? "" : " ");
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_WPS
if (ssid->key_mgmt & WPA_KEY_MGMT_WPS)
pos += os_snprintf(pos, end - pos, "%sWPS",
pos == buf ? "" : " ");
#endif /* CONFIG_WPS */
return buf;
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_cipher(int line, const char *value)
{
int val = wpa_parse_cipher(value);
if (val < 0) {
wpa_printf(MSG_ERROR, "Line %d: invalid cipher '%s'.",
line, value);
return -1;
}
if (val == 0) {
wpa_printf(MSG_ERROR, "Line %d: no cipher values configured.",
line);
return -1;
}
return val;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_cipher(int cipher)
{
char *buf = os_zalloc(50);
if (buf == NULL)
return NULL;
if (wpa_write_ciphers(buf, buf + 50, cipher, " ") < 0) {
os_free(buf);
return NULL;
}
return buf;
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_pairwise(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int val;
val = wpa_config_parse_cipher(line, value);
if (val == -1)
return -1;
if (val & ~WPA_ALLOWED_PAIRWISE_CIPHERS) {
wpa_printf(MSG_ERROR, "Line %d: not allowed pairwise cipher "
"(0x%x).", line, val);
return -1;
}
wpa_printf(MSG_MSGDUMP, "pairwise: 0x%x", val);
ssid->pairwise_cipher = val;
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_pairwise(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_cipher(ssid->pairwise_cipher);
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_group(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int val;
val = wpa_config_parse_cipher(line, value);
if (val == -1)
return -1;
if (val & ~WPA_ALLOWED_GROUP_CIPHERS) {
wpa_printf(MSG_ERROR, "Line %d: not allowed group cipher "
"(0x%x).", line, val);
return -1;
}
wpa_printf(MSG_MSGDUMP, "group: 0x%x", val);
ssid->group_cipher = val;
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_group(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_cipher(ssid->group_cipher);
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_auth_alg(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int val = 0, last, errors = 0;
char *start, *end, *buf;
buf = os_strdup(value);
if (buf == NULL)
return -1;
start = buf;
while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
break;
end = start;
while (*end != ' ' && *end != '\t' && *end != '\0')
end++;
last = *end == '\0';
*end = '\0';
if (os_strcmp(start, "OPEN") == 0)
val |= WPA_AUTH_ALG_OPEN;
else if (os_strcmp(start, "SHARED") == 0)
val |= WPA_AUTH_ALG_SHARED;
else if (os_strcmp(start, "LEAP") == 0)
val |= WPA_AUTH_ALG_LEAP;
else {
wpa_printf(MSG_ERROR, "Line %d: invalid auth_alg '%s'",
line, start);
errors++;
}
if (last)
break;
start = end + 1;
}
os_free(buf);
if (val == 0) {
wpa_printf(MSG_ERROR,
"Line %d: no auth_alg values configured.", line);
errors++;
}
wpa_printf(MSG_MSGDUMP, "auth_alg: 0x%x", val);
ssid->auth_alg = val;
return errors ? -1 : 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_auth_alg(const struct parse_data *data,
struct wpa_ssid *ssid)
{
char *buf, *pos, *end;
int ret;
pos = buf = os_zalloc(30);
if (buf == NULL)
return NULL;
end = buf + 30;
if (ssid->auth_alg & WPA_AUTH_ALG_OPEN) {
ret = os_snprintf(pos, end - pos, "%sOPEN",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
if (ssid->auth_alg & WPA_AUTH_ALG_SHARED) {
ret = os_snprintf(pos, end - pos, "%sSHARED",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
if (ssid->auth_alg & WPA_AUTH_ALG_LEAP) {
ret = os_snprintf(pos, end - pos, "%sLEAP",
pos == buf ? "" : " ");
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
return buf;
}
#endif /* NO_CONFIG_WRITE */
static int * wpa_config_parse_int_array(const char *value)
{
int *freqs;
size_t used, len;
const char *pos;
used = 0;
len = 10;
freqs = os_calloc(len + 1, sizeof(int));
if (freqs == NULL)
return NULL;
pos = value;
while (pos) {
while (*pos == ' ')
pos++;
if (used == len) {
int *n;
size_t i;
n = os_realloc_array(freqs, len * 2 + 1, sizeof(int));
if (n == NULL) {
os_free(freqs);
return NULL;
}
for (i = len; i <= len * 2; i++)
n[i] = 0;
freqs = n;
len *= 2;
}
freqs[used] = atoi(pos);
if (freqs[used] == 0)
break;
used++;
pos = os_strchr(pos + 1, ' ');
}
return freqs;
}
static int wpa_config_parse_scan_freq(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int *freqs;
freqs = wpa_config_parse_int_array(value);
if (freqs == NULL)
return -1;
os_free(ssid->scan_freq);
ssid->scan_freq = freqs;
return 0;
}
static int wpa_config_parse_freq_list(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int *freqs;
freqs = wpa_config_parse_int_array(value);
if (freqs == NULL)
return -1;
os_free(ssid->freq_list);
ssid->freq_list = freqs;
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_freqs(const struct parse_data *data,
const int *freqs)
{
char *buf, *pos, *end;
int i, ret;
size_t count;
if (freqs == NULL)
return NULL;
count = 0;
for (i = 0; freqs[i]; i++)
count++;
pos = buf = os_zalloc(10 * count + 1);
if (buf == NULL)
return NULL;
end = buf + 10 * count + 1;
for (i = 0; freqs[i]; i++) {
ret = os_snprintf(pos, end - pos, "%s%u",
i == 0 ? "" : " ", freqs[i]);
if (ret < 0 || ret >= end - pos) {
end[-1] = '\0';
return buf;
}
pos += ret;
}
return buf;
}
static char * wpa_config_write_scan_freq(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_freqs(data, ssid->scan_freq);
}
static char * wpa_config_write_freq_list(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_freqs(data, ssid->freq_list);
}
#endif /* NO_CONFIG_WRITE */
#ifdef IEEE8021X_EAPOL
static int wpa_config_parse_eap(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
int last, errors = 0;
char *start, *end, *buf;
struct eap_method_type *methods = NULL, *tmp;
size_t num_methods = 0;
buf = os_strdup(value);
if (buf == NULL)
return -1;
start = buf;
while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
break;
end = start;
while (*end != ' ' && *end != '\t' && *end != '\0')
end++;
last = *end == '\0';
*end = '\0';
tmp = methods;
methods = os_realloc_array(methods, num_methods + 1,
sizeof(*methods));
if (methods == NULL) {
os_free(tmp);
os_free(buf);
return -1;
}
methods[num_methods].method = eap_peer_get_type(
start, &methods[num_methods].vendor);
if (methods[num_methods].vendor == EAP_VENDOR_IETF &&
methods[num_methods].method == EAP_TYPE_NONE) {
wpa_printf(MSG_ERROR, "Line %d: unknown EAP method "
"'%s'", line, start);
wpa_printf(MSG_ERROR, "You may need to add support for"
" this EAP method during wpa_supplicant\n"
"build time configuration.\n"
"See README for more information.");
errors++;
} else if (methods[num_methods].vendor == EAP_VENDOR_IETF &&
methods[num_methods].method == EAP_TYPE_LEAP)
ssid->leap++;
else
ssid->non_leap++;
num_methods++;
if (last)
break;
start = end + 1;
}
os_free(buf);
tmp = methods;
methods = os_realloc_array(methods, num_methods + 1, sizeof(*methods));
if (methods == NULL) {
os_free(tmp);
return -1;
}
methods[num_methods].vendor = EAP_VENDOR_IETF;
methods[num_methods].method = EAP_TYPE_NONE;
num_methods++;
wpa_hexdump(MSG_MSGDUMP, "eap methods",
(u8 *) methods, num_methods * sizeof(*methods));
os_free(ssid->eap.eap_methods);
ssid->eap.eap_methods = methods;
return errors ? -1 : 0;
}
static char * wpa_config_write_eap(const struct parse_data *data,
struct wpa_ssid *ssid)
{
int i, ret;
char *buf, *pos, *end;
const struct eap_method_type *eap_methods = ssid->eap.eap_methods;
const char *name;
if (eap_methods == NULL)
return NULL;
pos = buf = os_zalloc(100);
if (buf == NULL)
return NULL;
end = buf + 100;
for (i = 0; eap_methods[i].vendor != EAP_VENDOR_IETF ||
eap_methods[i].method != EAP_TYPE_NONE; i++) {
name = eap_get_name(eap_methods[i].vendor,
eap_methods[i].method);
if (name) {
ret = os_snprintf(pos, end - pos, "%s%s",
pos == buf ? "" : " ", name);
if (ret < 0 || ret >= end - pos)
break;
pos += ret;
}
}
end[-1] = '\0';
return buf;
}
static int wpa_config_parse_password(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
u8 *hash;
if (os_strcmp(value, "NULL") == 0) {
wpa_printf(MSG_DEBUG, "Unset configuration string 'password'");
os_free(ssid->eap.password);
ssid->eap.password = NULL;
ssid->eap.password_len = 0;
return 0;
}
#ifdef CONFIG_EXT_PASSWORD
if (os_strncmp(value, "ext:", 4) == 0) {
char *name = os_strdup(value + 4);
if (name == NULL)
return -1;
os_free(ssid->eap.password);
ssid->eap.password = (u8 *) name;
ssid->eap.password_len = os_strlen(name);
ssid->eap.flags &= ~EAP_CONFIG_FLAGS_PASSWORD_NTHASH;
ssid->eap.flags |= EAP_CONFIG_FLAGS_EXT_PASSWORD;
return 0;
}
#endif /* CONFIG_EXT_PASSWORD */
if (os_strncmp(value, "hash:", 5) != 0) {
char *tmp;
size_t res_len;
tmp = wpa_config_parse_string(value, &res_len);
if (tmp == NULL) {
wpa_printf(MSG_ERROR, "Line %d: failed to parse "
"password.", line);
return -1;
}
wpa_hexdump_ascii_key(MSG_MSGDUMP, data->name,
(u8 *) tmp, res_len);
os_free(ssid->eap.password);
ssid->eap.password = (u8 *) tmp;
ssid->eap.password_len = res_len;
ssid->eap.flags &= ~EAP_CONFIG_FLAGS_PASSWORD_NTHASH;
ssid->eap.flags &= ~EAP_CONFIG_FLAGS_EXT_PASSWORD;
return 0;
}
/* NtPasswordHash: hash:<32 hex digits> */
if (os_strlen(value + 5) != 2 * 16) {
wpa_printf(MSG_ERROR, "Line %d: Invalid password hash length "
"(expected 32 hex digits)", line);
return -1;
}
hash = os_malloc(16);
if (hash == NULL)
return -1;
if (hexstr2bin(value + 5, hash, 16)) {
os_free(hash);
wpa_printf(MSG_ERROR, "Line %d: Invalid password hash", line);
return -1;
}
wpa_hexdump_key(MSG_MSGDUMP, data->name, hash, 16);
os_free(ssid->eap.password);
ssid->eap.password = hash;
ssid->eap.password_len = 16;
ssid->eap.flags |= EAP_CONFIG_FLAGS_PASSWORD_NTHASH;
ssid->eap.flags &= ~EAP_CONFIG_FLAGS_EXT_PASSWORD;
return 0;
}
static char * wpa_config_write_password(const struct parse_data *data,
struct wpa_ssid *ssid)
{
char *buf;
if (ssid->eap.password == NULL)
return NULL;
#ifdef CONFIG_EXT_PASSWORD
if (ssid->eap.flags & EAP_CONFIG_FLAGS_EXT_PASSWORD) {
buf = os_zalloc(4 + ssid->eap.password_len + 1);
if (buf == NULL)
return NULL;
os_memcpy(buf, "ext:", 4);
os_memcpy(buf + 4, ssid->eap.password, ssid->eap.password_len);
return buf;
}
#endif /* CONFIG_EXT_PASSWORD */
if (!(ssid->eap.flags & EAP_CONFIG_FLAGS_PASSWORD_NTHASH)) {
return wpa_config_write_string(
ssid->eap.password, ssid->eap.password_len);
}
buf = os_malloc(5 + 32 + 1);
if (buf == NULL)
return NULL;
os_memcpy(buf, "hash:", 5);
wpa_snprintf_hex(buf + 5, 32 + 1, ssid->eap.password, 16);
return buf;
}
#endif /* IEEE8021X_EAPOL */
static int wpa_config_parse_wep_key(u8 *key, size_t *len, int line,
const char *value, int idx)
{
char *buf, title[20];
int res;
buf = wpa_config_parse_string(value, len);
if (buf == NULL) {
wpa_printf(MSG_ERROR, "Line %d: Invalid WEP key %d '%s'.",
line, idx, value);
return -1;
}
if (*len > MAX_WEP_KEY_LEN) {
wpa_printf(MSG_ERROR, "Line %d: Too long WEP key %d '%s'.",
line, idx, value);
os_free(buf);
return -1;
}
if (*len && *len != 5 && *len != 13 && *len != 16) {
wpa_printf(MSG_ERROR, "Line %d: Invalid WEP key length %u - "
"this network block will be ignored",
line, (unsigned int) *len);
}
os_memcpy(key, buf, *len);
os_free(buf);
res = os_snprintf(title, sizeof(title), "wep_key%d", idx);
if (res >= 0 && (size_t) res < sizeof(title))
wpa_hexdump_key(MSG_MSGDUMP, title, key, *len);
return 0;
}
static int wpa_config_parse_wep_key0(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
return wpa_config_parse_wep_key(ssid->wep_key[0],
&ssid->wep_key_len[0], line,
value, 0);
}
static int wpa_config_parse_wep_key1(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
return wpa_config_parse_wep_key(ssid->wep_key[1],
&ssid->wep_key_len[1], line,
value, 1);
}
static int wpa_config_parse_wep_key2(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
return wpa_config_parse_wep_key(ssid->wep_key[2],
&ssid->wep_key_len[2], line,
value, 2);
}
static int wpa_config_parse_wep_key3(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
return wpa_config_parse_wep_key(ssid->wep_key[3],
&ssid->wep_key_len[3], line,
value, 3);
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_wep_key(struct wpa_ssid *ssid, int idx)
{
if (ssid->wep_key_len[idx] == 0)
return NULL;
return wpa_config_write_string(ssid->wep_key[idx],
ssid->wep_key_len[idx]);
}
static char * wpa_config_write_wep_key0(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_wep_key(ssid, 0);
}
static char * wpa_config_write_wep_key1(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_wep_key(ssid, 1);
}
static char * wpa_config_write_wep_key2(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_wep_key(ssid, 2);
}
static char * wpa_config_write_wep_key3(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return wpa_config_write_wep_key(ssid, 3);
}
#endif /* NO_CONFIG_WRITE */
#ifdef CONFIG_P2P
static int wpa_config_parse_p2p_client_list(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
const char *pos;
u8 *buf, *n, addr[ETH_ALEN];
size_t count;
buf = NULL;
count = 0;
pos = value;
while (pos && *pos) {
while (*pos == ' ')
pos++;
if (hwaddr_aton(pos, addr)) {
if (count == 0) {
wpa_printf(MSG_ERROR, "Line %d: Invalid "
"p2p_client_list address '%s'.",
line, value);
os_free(buf);
return -1;
}
/* continue anyway since this could have been from a
* truncated configuration file line */
wpa_printf(MSG_INFO, "Line %d: Ignore likely "
"truncated p2p_client_list address '%s'",
line, pos);
} else {
n = os_realloc_array(buf, count + 1, ETH_ALEN);
if (n == NULL) {
os_free(buf);
return -1;
}
buf = n;
os_memmove(buf + ETH_ALEN, buf, count * ETH_ALEN);
os_memcpy(buf, addr, ETH_ALEN);
count++;
wpa_hexdump(MSG_MSGDUMP, "p2p_client_list",
addr, ETH_ALEN);
}
pos = os_strchr(pos, ' ');
}
os_free(ssid->p2p_client_list);
ssid->p2p_client_list = buf;
ssid->num_p2p_clients = count;
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_p2p_client_list(const struct parse_data *data,
struct wpa_ssid *ssid)
{
char *value, *end, *pos;
int res;
size_t i;
if (ssid->p2p_client_list == NULL || ssid->num_p2p_clients == 0)
return NULL;
value = os_malloc(20 * ssid->num_p2p_clients);
if (value == NULL)
return NULL;
pos = value;
end = value + 20 * ssid->num_p2p_clients;
for (i = ssid->num_p2p_clients; i > 0; i--) {
res = os_snprintf(pos, end - pos, MACSTR " ",
MAC2STR(ssid->p2p_client_list +
(i - 1) * ETH_ALEN));
if (res < 0 || res >= end - pos) {
os_free(value);
return NULL;
}
pos += res;
}
if (pos > value)
pos[-1] = '\0';
return value;
}
#endif /* NO_CONFIG_WRITE */
static int wpa_config_parse_psk_list(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
{
struct psk_list_entry *p;
const char *pos;
p = os_zalloc(sizeof(*p));
if (p == NULL)
return -1;
pos = value;
if (os_strncmp(pos, "P2P-", 4) == 0) {
p->p2p = 1;
pos += 4;
}
if (hwaddr_aton(pos, p->addr)) {
wpa_printf(MSG_ERROR, "Line %d: Invalid psk_list address '%s'",
line, pos);
os_free(p);
return -1;
}
pos += 17;
if (*pos != '-') {
wpa_printf(MSG_ERROR, "Line %d: Invalid psk_list '%s'",
line, pos);
os_free(p);
return -1;
}
pos++;
if (hexstr2bin(pos, p->psk, PMK_LEN) || pos[PMK_LEN * 2] != '\0') {
wpa_printf(MSG_ERROR, "Line %d: Invalid psk_list PSK '%s'",
line, pos);
os_free(p);
return -1;
}
dl_list_add(&ssid->psk_list, &p->list);
return 0;
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_psk_list(const struct parse_data *data,
struct wpa_ssid *ssid)
{
return NULL;
}
#endif /* NO_CONFIG_WRITE */
#endif /* CONFIG_P2P */
/* Helper macros for network block parser */
#ifdef OFFSET
#undef OFFSET
#endif /* OFFSET */
/* OFFSET: Get offset of a variable within the wpa_ssid structure */
#define OFFSET(v) ((void *) &((struct wpa_ssid *) 0)->v)
/* STR: Define a string variable for an ASCII string; f = field name */
#ifdef NO_CONFIG_WRITE
#define _STR(f) #f, wpa_config_parse_str, OFFSET(f)
#define _STRe(f) #f, wpa_config_parse_str, OFFSET(eap.f)
#else /* NO_CONFIG_WRITE */
#define _STR(f) #f, wpa_config_parse_str, wpa_config_write_str, OFFSET(f)
#define _STRe(f) #f, wpa_config_parse_str, wpa_config_write_str, OFFSET(eap.f)
#endif /* NO_CONFIG_WRITE */
#define STR(f) _STR(f), NULL, NULL, NULL, 0
#define STRe(f) _STRe(f), NULL, NULL, NULL, 0
#define STR_KEY(f) _STR(f), NULL, NULL, NULL, 1
#define STR_KEYe(f) _STRe(f), NULL, NULL, NULL, 1
/* STR_LEN: Define a string variable with a separate variable for storing the
* data length. Unlike STR(), this can be used to store arbitrary binary data
* (i.e., even nul termination character). */
#define _STR_LEN(f) _STR(f), OFFSET(f ## _len)
#define _STR_LENe(f) _STRe(f), OFFSET(eap.f ## _len)
#define STR_LEN(f) _STR_LEN(f), NULL, NULL, 0
#define STR_LENe(f) _STR_LENe(f), NULL, NULL, 0
#define STR_LEN_KEY(f) _STR_LEN(f), NULL, NULL, 1
/* STR_RANGE: Like STR_LEN(), but with minimum and maximum allowed length
* explicitly specified. */
#define _STR_RANGE(f, min, max) _STR_LEN(f), (void *) (min), (void *) (max)
#define STR_RANGE(f, min, max) _STR_RANGE(f, min, max), 0
#define STR_RANGE_KEY(f, min, max) _STR_RANGE(f, min, max), 1
#ifdef NO_CONFIG_WRITE
#define _INT(f) #f, wpa_config_parse_int, OFFSET(f), (void *) 0
#define _INTe(f) #f, wpa_config_parse_int, OFFSET(eap.f), (void *) 0
#else /* NO_CONFIG_WRITE */
#define _INT(f) #f, wpa_config_parse_int, wpa_config_write_int, \
OFFSET(f), (void *) 0
#define _INTe(f) #f, wpa_config_parse_int, wpa_config_write_int, \
OFFSET(eap.f), (void *) 0
#endif /* NO_CONFIG_WRITE */
/* INT: Define an integer variable */
#define INT(f) _INT(f), NULL, NULL, 0
#define INTe(f) _INTe(f), NULL, NULL, 0
/* INT_RANGE: Define an integer variable with allowed value range */
#define INT_RANGE(f, min, max) _INT(f), (void *) (min), (void *) (max), 0
/* FUNC: Define a configuration variable that uses a custom function for
* parsing and writing the value. */
#ifdef NO_CONFIG_WRITE
#define _FUNC(f) #f, wpa_config_parse_ ## f, NULL, NULL, NULL, NULL
#else /* NO_CONFIG_WRITE */
#define _FUNC(f) #f, wpa_config_parse_ ## f, wpa_config_write_ ## f, \
NULL, NULL, NULL, NULL
#endif /* NO_CONFIG_WRITE */
#define FUNC(f) _FUNC(f), 0
#define FUNC_KEY(f) _FUNC(f), 1
/*
* Table of network configuration variables. This table is used to parse each
* network configuration variable, e.g., each line in wpa_supplicant.conf file
* that is inside a network block.
*
* This table is generated using the helper macros defined above and with
* generous help from the C pre-processor. The field name is stored as a string
* into .name and for STR and INT types, the offset of the target buffer within
* struct wpa_ssid is stored in .param1. .param2 (if not NULL) is similar
* offset to the field containing the length of the configuration variable.
* .param3 and .param4 can be used to mark the allowed range (length for STR
* and value for INT).
*
* For each configuration line in wpa_supplicant.conf, the parser goes through
* this table and select the entry that matches with the field name. The parser
* function (.parser) is then called to parse the actual value of the field.
*
* This kind of mechanism makes it easy to add new configuration parameters,
* since only one line needs to be added into this table and into the
* struct wpa_ssid definition if the new variable is either a string or
* integer. More complex types will need to use their own parser and writer
* functions.
*/
static const struct parse_data ssid_fields[] = {
{ STR_RANGE(ssid, 0, MAX_SSID_LEN) },
{ INT_RANGE(scan_ssid, 0, 1) },
{ FUNC(bssid) },
{ FUNC_KEY(psk) },
{ FUNC(proto) },
{ FUNC(key_mgmt) },
{ INT(bg_scan_period) },
{ FUNC(pairwise) },
{ FUNC(group) },
{ FUNC(auth_alg) },
{ FUNC(scan_freq) },
{ FUNC(freq_list) },
#ifdef IEEE8021X_EAPOL
{ FUNC(eap) },
{ STR_LENe(identity) },
{ STR_LENe(anonymous_identity) },
{ FUNC_KEY(password) },
{ STRe(ca_cert) },
{ STRe(ca_path) },
{ STRe(client_cert) },
{ STRe(private_key) },
{ STR_KEYe(private_key_passwd) },
{ STRe(dh_file) },
{ STRe(subject_match) },
{ STRe(altsubject_match) },
{ STRe(ca_cert2) },
{ STRe(ca_path2) },
{ STRe(client_cert2) },
{ STRe(private_key2) },
{ STR_KEYe(private_key2_passwd) },
{ STRe(dh_file2) },
{ STRe(subject_match2) },
{ STRe(altsubject_match2) },
{ STRe(phase1) },
{ STRe(phase2) },
{ STRe(pcsc) },
{ STR_KEYe(pin) },
{ STRe(engine_id) },
{ STRe(key_id) },
{ STRe(cert_id) },
{ STRe(ca_cert_id) },
{ STR_KEYe(pin2) },
{ STRe(engine2_id) },
{ STRe(key2_id) },
{ STRe(cert2_id) },
{ STRe(ca_cert2_id) },
{ INTe(engine) },
{ INTe(engine2) },
{ INT(eapol_flags) },
#endif /* IEEE8021X_EAPOL */
{ FUNC_KEY(wep_key0) },
{ FUNC_KEY(wep_key1) },
{ FUNC_KEY(wep_key2) },
{ FUNC_KEY(wep_key3) },
{ INT(wep_tx_keyidx) },
{ INT(priority) },
#ifdef IEEE8021X_EAPOL
{ INT(eap_workaround) },
{ STRe(pac_file) },
{ INTe(fragment_size) },
{ INTe(ocsp) },
#endif /* IEEE8021X_EAPOL */
{ INT_RANGE(mode, 0, 4) },
{ INT_RANGE(proactive_key_caching, 0, 1) },
{ INT_RANGE(disabled, 0, 2) },
{ STR(id_str) },
#ifdef CONFIG_IEEE80211W
{ INT_RANGE(ieee80211w, 0, 2) },
#endif /* CONFIG_IEEE80211W */
{ INT_RANGE(peerkey, 0, 1) },
{ INT_RANGE(mixed_cell, 0, 1) },
{ INT_RANGE(frequency, 0, 65000) },
{ INT(wpa_ptk_rekey) },
{ STR(bgscan) },
{ INT_RANGE(ignore_broadcast_ssid, 0, 2) },
#ifdef CONFIG_P2P
{ FUNC(p2p_client_list) },
{ FUNC(psk_list) },
#endif /* CONFIG_P2P */
#ifdef CONFIG_HT_OVERRIDES
{ INT_RANGE(disable_ht, 0, 1) },
{ INT_RANGE(disable_ht40, -1, 1) },
{ INT_RANGE(disable_sgi, 0, 1) },
{ INT_RANGE(disable_max_amsdu, -1, 1) },
{ INT_RANGE(ampdu_factor, -1, 3) },
{ INT_RANGE(ampdu_density, -1, 7) },
{ STR(ht_mcs) },
#endif /* CONFIG_HT_OVERRIDES */
#ifdef CONFIG_VHT_OVERRIDES
{ INT_RANGE(disable_vht, 0, 1) },
{ INT(vht_capa) },
{ INT(vht_capa_mask) },
{ INT_RANGE(vht_rx_mcs_nss_1, -1, 3) },
{ INT_RANGE(vht_rx_mcs_nss_2, -1, 3) },
{ INT_RANGE(vht_rx_mcs_nss_3, -1, 3) },
{ INT_RANGE(vht_rx_mcs_nss_4, -1, 3) },
{ INT_RANGE(vht_rx_mcs_nss_5, -1, 3) },
{ INT_RANGE(vht_rx_mcs_nss_6, -1, 3) },
{ INT_RANGE(vht_rx_mcs_nss_7, -1, 3) },
{ INT_RANGE(vht_rx_mcs_nss_8, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_1, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_2, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_3, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_4, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_5, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_6, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_7, -1, 3) },
{ INT_RANGE(vht_tx_mcs_nss_8, -1, 3) },
#endif /* CONFIG_VHT_OVERRIDES */
{ INT(ap_max_inactivity) },
{ INT(dtim_period) },
{ INT(beacon_int) },
};
#undef OFFSET
#undef _STR
#undef STR
#undef STR_KEY
#undef _STR_LEN
#undef STR_LEN
#undef STR_LEN_KEY
#undef _STR_RANGE
#undef STR_RANGE
#undef STR_RANGE_KEY
#undef _INT
#undef INT
#undef INT_RANGE
#undef _FUNC
#undef FUNC
#undef FUNC_KEY
#define NUM_SSID_FIELDS (sizeof(ssid_fields) / sizeof(ssid_fields[0]))
/**
* wpa_config_add_prio_network - Add a network to priority lists
* @config: Configuration data from wpa_config_read()
* @ssid: Pointer to the network configuration to be added to the list
* Returns: 0 on success, -1 on failure
*
* This function is used to add a network block to the priority list of
* networks. This must be called for each network when reading in the full
* configuration. In addition, this can be used indirectly when updating
* priorities by calling wpa_config_update_prio_list().
*/
int wpa_config_add_prio_network(struct wpa_config *config,
struct wpa_ssid *ssid)
{
int prio;
struct wpa_ssid *prev, **nlist;
/*
* Add to an existing priority list if one is available for the
* configured priority level for this network.
*/
for (prio = 0; prio < config->num_prio; prio++) {
prev = config->pssid[prio];
if (prev->priority == ssid->priority) {
while (prev->pnext)
prev = prev->pnext;
prev->pnext = ssid;
return 0;
}
}
/* First network for this priority - add a new priority list */
nlist = os_realloc_array(config->pssid, config->num_prio + 1,
sizeof(struct wpa_ssid *));
if (nlist == NULL)
return -1;
for (prio = 0; prio < config->num_prio; prio++) {
if (nlist[prio]->priority < ssid->priority) {
os_memmove(&nlist[prio + 1], &nlist[prio],
(config->num_prio - prio) *
sizeof(struct wpa_ssid *));
break;
}
}
nlist[prio] = ssid;
config->num_prio++;
config->pssid = nlist;
return 0;
}
/**
* wpa_config_update_prio_list - Update network priority list
* @config: Configuration data from wpa_config_read()
* Returns: 0 on success, -1 on failure
*
* This function is called to update the priority list of networks in the
* configuration when a network is being added or removed. This is also called
* if a priority for a network is changed.
*/
int wpa_config_update_prio_list(struct wpa_config *config)
{
struct wpa_ssid *ssid;
int ret = 0;
os_free(config->pssid);
config->pssid = NULL;
config->num_prio = 0;
ssid = config->ssid;
while (ssid) {
ssid->pnext = NULL;
if (wpa_config_add_prio_network(config, ssid) < 0)
ret = -1;
ssid = ssid->next;
}
return ret;
}
#ifdef IEEE8021X_EAPOL
static void eap_peer_config_free(struct eap_peer_config *eap)
{
os_free(eap->eap_methods);
os_free(eap->identity);
os_free(eap->anonymous_identity);
os_free(eap->password);
os_free(eap->ca_cert);
os_free(eap->ca_path);
os_free(eap->client_cert);
os_free(eap->private_key);
os_free(eap->private_key_passwd);
os_free(eap->dh_file);
os_free(eap->subject_match);
os_free(eap->altsubject_match);
os_free(eap->ca_cert2);
os_free(eap->ca_path2);
os_free(eap->client_cert2);
os_free(eap->private_key2);
os_free(eap->private_key2_passwd);
os_free(eap->dh_file2);
os_free(eap->subject_match2);
os_free(eap->altsubject_match2);
os_free(eap->phase1);
os_free(eap->phase2);
os_free(eap->pcsc);
os_free(eap->pin);
os_free(eap->engine_id);
os_free(eap->key_id);
os_free(eap->cert_id);
os_free(eap->ca_cert_id);
os_free(eap->key2_id);
os_free(eap->cert2_id);
os_free(eap->ca_cert2_id);
os_free(eap->pin2);
os_free(eap->engine2_id);
os_free(eap->otp);
os_free(eap->pending_req_otp);
os_free(eap->pac_file);
os_free(eap->new_password);
}
#endif /* IEEE8021X_EAPOL */
/**
* wpa_config_free_ssid - Free network/ssid configuration data
* @ssid: Configuration data for the network
*
* This function frees all resources allocated for the network configuration
* data.
*/
void wpa_config_free_ssid(struct wpa_ssid *ssid)
{
struct psk_list_entry *psk;
os_free(ssid->ssid);
os_free(ssid->passphrase);
os_free(ssid->ext_psk);
#ifdef IEEE8021X_EAPOL
eap_peer_config_free(&ssid->eap);
#endif /* IEEE8021X_EAPOL */
os_free(ssid->id_str);
os_free(ssid->scan_freq);
os_free(ssid->freq_list);
os_free(ssid->bgscan);
os_free(ssid->p2p_client_list);
#ifdef CONFIG_HT_OVERRIDES
os_free(ssid->ht_mcs);
#endif /* CONFIG_HT_OVERRIDES */
while ((psk = dl_list_first(&ssid->psk_list, struct psk_list_entry,
list))) {
dl_list_del(&psk->list);
os_free(psk);
}
os_free(ssid);
}
void wpa_config_free_cred(struct wpa_cred *cred)
{
size_t i;
os_free(cred->realm);
os_free(cred->username);
os_free(cred->password);
os_free(cred->ca_cert);
os_free(cred->client_cert);
os_free(cred->private_key);
os_free(cred->private_key_passwd);
os_free(cred->imsi);
os_free(cred->milenage);
for (i = 0; i < cred->num_domain; i++)
os_free(cred->domain[i]);
os_free(cred->domain);
os_free(cred->eap_method);
os_free(cred->phase1);
os_free(cred->phase2);
os_free(cred->excluded_ssid);
os_free(cred);
}
/**
* wpa_config_free - Free configuration data
* @config: Configuration data from wpa_config_read()
*
* This function frees all resources allocated for the configuration data by
* wpa_config_read().
*/
void wpa_config_free(struct wpa_config *config)
{
#ifndef CONFIG_NO_CONFIG_BLOBS
struct wpa_config_blob *blob, *prevblob;
#endif /* CONFIG_NO_CONFIG_BLOBS */
struct wpa_ssid *ssid, *prev = NULL;
struct wpa_cred *cred, *cprev;
ssid = config->ssid;
while (ssid) {
prev = ssid;
ssid = ssid->next;
wpa_config_free_ssid(prev);
}
cred = config->cred;
while (cred) {
cprev = cred;
cred = cred->next;
wpa_config_free_cred(cprev);
}
#ifndef CONFIG_NO_CONFIG_BLOBS
blob = config->blobs;
prevblob = NULL;
while (blob) {
prevblob = blob;
blob = blob->next;
wpa_config_free_blob(prevblob);
}
#endif /* CONFIG_NO_CONFIG_BLOBS */
wpabuf_free(config->wps_vendor_ext_m1);
os_free(config->ctrl_interface);
os_free(config->ctrl_interface_group);
os_free(config->opensc_engine_path);
os_free(config->pkcs11_engine_path);
os_free(config->pkcs11_module_path);
os_free(config->pcsc_reader);
os_free(config->pcsc_pin);
os_free(config->driver_param);
os_free(config->device_name);
os_free(config->manufacturer);
os_free(config->model_name);
os_free(config->model_number);
os_free(config->serial_number);
os_free(config->config_methods);
os_free(config->p2p_ssid_postfix);
os_free(config->pssid);
os_free(config->p2p_pref_chan);
os_free(config->autoscan);
os_free(config->freq_list);
wpabuf_free(config->wps_nfc_dh_pubkey);
wpabuf_free(config->wps_nfc_dh_privkey);
wpabuf_free(config->wps_nfc_dev_pw);
os_free(config->ext_password_backend);
os_free(config->sae_groups);
wpabuf_free(config->ap_vendor_elements);
os_free(config);
}
/**
* wpa_config_foreach_network - Iterate over each configured network
* @config: Configuration data from wpa_config_read()
* @func: Callback function to process each network
* @arg: Opaque argument to pass to callback function
*
* Iterate over the set of configured networks calling the specified
* function for each item. We guard against callbacks removing the
* supplied network.
*/
void wpa_config_foreach_network(struct wpa_config *config,
void (*func)(void *, struct wpa_ssid *),
void *arg)
{
struct wpa_ssid *ssid, *next;
ssid = config->ssid;
while (ssid) {
next = ssid->next;
func(arg, ssid);
ssid = next;
}
}
/**
* wpa_config_get_network - Get configured network based on id
* @config: Configuration data from wpa_config_read()
* @id: Unique network id to search for
* Returns: Network configuration or %NULL if not found
*/
struct wpa_ssid * wpa_config_get_network(struct wpa_config *config, int id)
{
struct wpa_ssid *ssid;
ssid = config->ssid;
while (ssid) {
if (id == ssid->id)
break;
ssid = ssid->next;
}
return ssid;
}
/**
* wpa_config_add_network - Add a new network with empty configuration
* @config: Configuration data from wpa_config_read()
* Returns: The new network configuration or %NULL if operation failed
*/
struct wpa_ssid * wpa_config_add_network(struct wpa_config *config)
{
int id;
struct wpa_ssid *ssid, *last = NULL;
id = -1;
ssid = config->ssid;
while (ssid) {
if (ssid->id > id)
id = ssid->id;
last = ssid;
ssid = ssid->next;
}
id++;
ssid = os_zalloc(sizeof(*ssid));
if (ssid == NULL)
return NULL;
ssid->id = id;
dl_list_init(&ssid->psk_list);
if (last)
last->next = ssid;
else
config->ssid = ssid;
wpa_config_update_prio_list(config);
return ssid;
}
/**
* wpa_config_remove_network - Remove a configured network based on id
* @config: Configuration data from wpa_config_read()
* @id: Unique network id to search for
* Returns: 0 on success, or -1 if the network was not found
*/
int wpa_config_remove_network(struct wpa_config *config, int id)
{
struct wpa_ssid *ssid, *prev = NULL;
ssid = config->ssid;
while (ssid) {
if (id == ssid->id)
break;
prev = ssid;
ssid = ssid->next;
}
if (ssid == NULL)
return -1;
if (prev)
prev->next = ssid->next;
else
config->ssid = ssid->next;
wpa_config_update_prio_list(config);
wpa_config_free_ssid(ssid);
return 0;
}
/**
* wpa_config_set_network_defaults - Set network default values
* @ssid: Pointer to network configuration data
*/
void wpa_config_set_network_defaults(struct wpa_ssid *ssid)
{
ssid->proto = DEFAULT_PROTO;
ssid->pairwise_cipher = DEFAULT_PAIRWISE;
ssid->group_cipher = DEFAULT_GROUP;
ssid->key_mgmt = DEFAULT_KEY_MGMT;
ssid->bg_scan_period = DEFAULT_BG_SCAN_PERIOD;
#ifdef IEEE8021X_EAPOL
ssid->eapol_flags = DEFAULT_EAPOL_FLAGS;
ssid->eap_workaround = DEFAULT_EAP_WORKAROUND;
ssid->eap.fragment_size = DEFAULT_FRAGMENT_SIZE;
#endif /* IEEE8021X_EAPOL */
#ifdef CONFIG_HT_OVERRIDES
ssid->disable_ht = DEFAULT_DISABLE_HT;
ssid->disable_ht40 = DEFAULT_DISABLE_HT40;
ssid->disable_sgi = DEFAULT_DISABLE_SGI;
ssid->disable_max_amsdu = DEFAULT_DISABLE_MAX_AMSDU;
ssid->ampdu_factor = DEFAULT_AMPDU_FACTOR;
ssid->ampdu_density = DEFAULT_AMPDU_DENSITY;
#endif /* CONFIG_HT_OVERRIDES */
#ifdef CONFIG_VHT_OVERRIDES
ssid->vht_rx_mcs_nss_1 = -1;
ssid->vht_rx_mcs_nss_2 = -1;
ssid->vht_rx_mcs_nss_3 = -1;
ssid->vht_rx_mcs_nss_4 = -1;
ssid->vht_rx_mcs_nss_5 = -1;
ssid->vht_rx_mcs_nss_6 = -1;
ssid->vht_rx_mcs_nss_7 = -1;
ssid->vht_rx_mcs_nss_8 = -1;
ssid->vht_tx_mcs_nss_1 = -1;
ssid->vht_tx_mcs_nss_2 = -1;
ssid->vht_tx_mcs_nss_3 = -1;
ssid->vht_tx_mcs_nss_4 = -1;
ssid->vht_tx_mcs_nss_5 = -1;
ssid->vht_tx_mcs_nss_6 = -1;
ssid->vht_tx_mcs_nss_7 = -1;
ssid->vht_tx_mcs_nss_8 = -1;
#endif /* CONFIG_VHT_OVERRIDES */
ssid->proactive_key_caching = -1;
#ifdef CONFIG_IEEE80211W
ssid->ieee80211w = MGMT_FRAME_PROTECTION_DEFAULT;
#endif /* CONFIG_IEEE80211W */
}
/**
* wpa_config_set - Set a variable in network configuration
* @ssid: Pointer to network configuration data
* @var: Variable name, e.g., "ssid"
* @value: Variable value
* @line: Line number in configuration file or 0 if not used
* Returns: 0 on success, -1 on failure
*
* This function can be used to set network configuration variables based on
* both the configuration file and management interface input. The value
* parameter must be in the same format as the text-based configuration file is
* using. For example, strings are using double quotation marks.
*/
int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value,
int line)
{
size_t i;
int ret = 0;
if (ssid == NULL || var == NULL || value == NULL)
return -1;
for (i = 0; i < NUM_SSID_FIELDS; i++) {
const struct parse_data *field = &ssid_fields[i];
if (os_strcmp(var, field->name) != 0)
continue;
if (field->parser(field, ssid, line, value)) {
if (line) {
wpa_printf(MSG_ERROR, "Line %d: failed to "
"parse %s '%s'.", line, var, value);
}
ret = -1;
}
break;
}
if (i == NUM_SSID_FIELDS) {
if (line) {
wpa_printf(MSG_ERROR, "Line %d: unknown network field "
"'%s'.", line, var);
}
ret = -1;
}
return ret;
}
int wpa_config_set_quoted(struct wpa_ssid *ssid, const char *var,
const char *value)
{
size_t len;
char *buf;
int ret;
len = os_strlen(value);
buf = os_malloc(len + 3);
if (buf == NULL)
return -1;
buf[0] = '"';
os_memcpy(buf + 1, value, len);
buf[len + 1] = '"';
buf[len + 2] = '\0';
ret = wpa_config_set(ssid, var, buf, 0);
os_free(buf);
return ret;
}
/**
* wpa_config_get_all - Get all options from network configuration
* @ssid: Pointer to network configuration data
* @get_keys: Determines if keys/passwords will be included in returned list
* (if they may be exported)
* Returns: %NULL terminated list of all set keys and their values in the form
* of [key1, val1, key2, val2, ... , NULL]
*
* This function can be used to get list of all configured network properties.
* The caller is responsible for freeing the returned list and all its
* elements.
*/
char ** wpa_config_get_all(struct wpa_ssid *ssid, int get_keys)
{
const struct parse_data *field;
char *key, *value;
size_t i;
char **props;
int fields_num;
get_keys = get_keys && ssid->export_keys;
props = os_calloc(2 * NUM_SSID_FIELDS + 1, sizeof(char *));
if (!props)
return NULL;
fields_num = 0;
for (i = 0; i < NUM_SSID_FIELDS; i++) {
field = &ssid_fields[i];
if (field->key_data && !get_keys)
continue;
value = field->writer(field, ssid);
if (value == NULL)
continue;
if (os_strlen(value) == 0) {
os_free(value);
continue;
}
key = os_strdup(field->name);
if (key == NULL) {
os_free(value);
goto err;
}
props[fields_num * 2] = key;
props[fields_num * 2 + 1] = value;
fields_num++;
}
return props;
err:
value = *props;
while (value)
os_free(value++);
os_free(props);
return NULL;
}
#ifndef NO_CONFIG_WRITE
/**
* wpa_config_get - Get a variable in network configuration
* @ssid: Pointer to network configuration data
* @var: Variable name, e.g., "ssid"
* Returns: Value of the variable or %NULL on failure
*
* This function can be used to get network configuration variables. The
* returned value is a copy of the configuration variable in text format, i.e,.
* the same format that the text-based configuration file and wpa_config_set()
* are using for the value. The caller is responsible for freeing the returned
* value.
*/
char * wpa_config_get(struct wpa_ssid *ssid, const char *var)
{
size_t i;
if (ssid == NULL || var == NULL)
return NULL;
for (i = 0; i < NUM_SSID_FIELDS; i++) {
const struct parse_data *field = &ssid_fields[i];
if (os_strcmp(var, field->name) == 0)
return field->writer(field, ssid);
}
return NULL;
}
/**
* wpa_config_get_no_key - Get a variable in network configuration (no keys)
* @ssid: Pointer to network configuration data
* @var: Variable name, e.g., "ssid"
* Returns: Value of the variable or %NULL on failure
*
* This function can be used to get network configuration variable like
* wpa_config_get(). The only difference is that this functions does not expose
* key/password material from the configuration. In case a key/password field
* is requested, the returned value is an empty string or %NULL if the variable
* is not set or "*" if the variable is set (regardless of its value). The
* returned value is a copy of the configuration variable in text format, i.e,.
* the same format that the text-based configuration file and wpa_config_set()
* are using for the value. The caller is responsible for freeing the returned
* value.
*/
char * wpa_config_get_no_key(struct wpa_ssid *ssid, const char *var)
{
size_t i;
if (ssid == NULL || var == NULL)
return NULL;
for (i = 0; i < NUM_SSID_FIELDS; i++) {
const struct parse_data *field = &ssid_fields[i];
if (os_strcmp(var, field->name) == 0) {
char *res = field->writer(field, ssid);
if (field->key_data) {
if (res && res[0]) {
wpa_printf(MSG_DEBUG, "Do not allow "
"key_data field to be "
"exposed");
os_free(res);
return os_strdup("*");
}
os_free(res);
return NULL;
}
return res;
}
}
return NULL;
}
#endif /* NO_CONFIG_WRITE */
/**
* wpa_config_update_psk - Update WPA PSK based on passphrase and SSID
* @ssid: Pointer to network configuration data
*
* This function must be called to update WPA PSK when either SSID or the
* passphrase has changed for the network configuration.
*/
void wpa_config_update_psk(struct wpa_ssid *ssid)
{
#ifndef CONFIG_NO_PBKDF2
pbkdf2_sha1(ssid->passphrase, ssid->ssid, ssid->ssid_len, 4096,
ssid->psk, PMK_LEN);
wpa_hexdump_key(MSG_MSGDUMP, "PSK (from passphrase)",
ssid->psk, PMK_LEN);
ssid->psk_set = 1;
#endif /* CONFIG_NO_PBKDF2 */
}
int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
const char *value, int line)
{
char *val;
size_t len;
if (os_strcmp(var, "priority") == 0) {
cred->priority = atoi(value);
return 0;
}
if (os_strcmp(var, "pcsc") == 0) {
cred->pcsc = atoi(value);
return 0;
}
if (os_strcmp(var, "eap") == 0) {
struct eap_method_type method;
method.method = eap_peer_get_type(value, &method.vendor);
if (method.vendor == EAP_VENDOR_IETF &&
method.method == EAP_TYPE_NONE) {
wpa_printf(MSG_ERROR, "Line %d: unknown EAP type '%s' "
"for a credential", line, value);
return -1;
}
os_free(cred->eap_method);
cred->eap_method = os_malloc(sizeof(*cred->eap_method));
if (cred->eap_method == NULL)
return -1;
os_memcpy(cred->eap_method, &method, sizeof(method));
return 0;
}
if (os_strcmp(var, "password") == 0 &&
os_strncmp(value, "ext:", 4) == 0) {
os_free(cred->password);
cred->password = os_strdup(value);
cred->ext_password = 1;
return 0;
}
val = wpa_config_parse_string(value, &len);
if (val == NULL) {
wpa_printf(MSG_ERROR, "Line %d: invalid field '%s' string "
"value '%s'.", line, var, value);
return -1;
}
if (os_strcmp(var, "realm") == 0) {
os_free(cred->realm);
cred->realm = val;
return 0;
}
if (os_strcmp(var, "username") == 0) {
os_free(cred->username);
cred->username = val;
return 0;
}
if (os_strcmp(var, "password") == 0) {
os_free(cred->password);
cred->password = val;
cred->ext_password = 0;
return 0;
}
if (os_strcmp(var, "ca_cert") == 0) {
os_free(cred->ca_cert);
cred->ca_cert = val;
return 0;
}
if (os_strcmp(var, "client_cert") == 0) {
os_free(cred->client_cert);
cred->client_cert = val;
return 0;
}
if (os_strcmp(var, "private_key") == 0) {
os_free(cred->private_key);
cred->private_key = val;
return 0;
}
if (os_strcmp(var, "private_key_passwd") == 0) {
os_free(cred->private_key_passwd);
cred->private_key_passwd = val;
return 0;
}
if (os_strcmp(var, "imsi") == 0) {
os_free(cred->imsi);
cred->imsi = val;
return 0;
}
if (os_strcmp(var, "milenage") == 0) {
os_free(cred->milenage);
cred->milenage = val;
return 0;
}
if (os_strcmp(var, "domain") == 0) {
char **new_domain;
new_domain = os_realloc_array(cred->domain,
cred->num_domain + 1,
sizeof(char *));
if (new_domain == NULL) {
os_free(val);
return -1;
}
new_domain[cred->num_domain++] = val;
cred->domain = new_domain;
return 0;
}
if (os_strcmp(var, "phase1") == 0) {
os_free(cred->phase1);
cred->phase1 = val;
return 0;
}
if (os_strcmp(var, "phase2") == 0) {
os_free(cred->phase2);
cred->phase2 = val;
return 0;
}
if (os_strcmp(var, "roaming_consortium") == 0) {
if (len < 3 || len > sizeof(cred->roaming_consortium)) {
wpa_printf(MSG_ERROR, "Line %d: invalid "
"roaming_consortium length %d (3..15 "
"expected)", line, (int) len);
os_free(val);
return -1;
}
os_memcpy(cred->roaming_consortium, val, len);
cred->roaming_consortium_len = len;
os_free(val);
return 0;
}
if (os_strcmp(var, "excluded_ssid") == 0) {
struct excluded_ssid *e;
if (len > MAX_SSID_LEN) {
wpa_printf(MSG_ERROR, "Line %d: invalid "
"excluded_ssid length %d", line, (int) len);
os_free(val);
return -1;
}
e = os_realloc_array(cred->excluded_ssid,
cred->num_excluded_ssid + 1,
sizeof(struct excluded_ssid));
if (e == NULL) {
os_free(val);
return -1;
}
cred->excluded_ssid = e;
e = &cred->excluded_ssid[cred->num_excluded_ssid++];
os_memcpy(e->ssid, val, len);
e->ssid_len = len;
os_free(val);
return 0;
}
if (line) {
wpa_printf(MSG_ERROR, "Line %d: unknown cred field '%s'.",
line, var);
}
os_free(val);
return -1;
}
struct wpa_cred * wpa_config_get_cred(struct wpa_config *config, int id)
{
struct wpa_cred *cred;
cred = config->cred;
while (cred) {
if (id == cred->id)
break;
cred = cred->next;
}
return cred;
}
struct wpa_cred * wpa_config_add_cred(struct wpa_config *config)
{
int id;
struct wpa_cred *cred, *last = NULL;
id = -1;
cred = config->cred;
while (cred) {
if (cred->id > id)
id = cred->id;
last = cred;
cred = cred->next;
}
id++;
cred = os_zalloc(sizeof(*cred));
if (cred == NULL)
return NULL;
cred->id = id;
if (last)
last->next = cred;
else
config->cred = cred;
return cred;
}
int wpa_config_remove_cred(struct wpa_config *config, int id)
{
struct wpa_cred *cred, *prev = NULL;
cred = config->cred;
while (cred) {
if (id == cred->id)
break;
prev = cred;
cred = cred->next;
}
if (cred == NULL)
return -1;
if (prev)
prev->next = cred->next;
else
config->cred = cred->next;
wpa_config_free_cred(cred);
return 0;
}
#ifndef CONFIG_NO_CONFIG_BLOBS
/**
* wpa_config_get_blob - Get a named configuration blob
* @config: Configuration data from wpa_config_read()
* @name: Name of the blob
* Returns: Pointer to blob data or %NULL if not found
*/
const struct wpa_config_blob * wpa_config_get_blob(struct wpa_config *config,
const char *name)
{
struct wpa_config_blob *blob = config->blobs;
while (blob) {
if (os_strcmp(blob->name, name) == 0)
return blob;
blob = blob->next;
}
return NULL;
}
/**
* wpa_config_set_blob - Set or add a named configuration blob
* @config: Configuration data from wpa_config_read()
* @blob: New value for the blob
*
* Adds a new configuration blob or replaces the current value of an existing
* blob.
*/
void wpa_config_set_blob(struct wpa_config *config,
struct wpa_config_blob *blob)
{
wpa_config_remove_blob(config, blob->name);
blob->next = config->blobs;
config->blobs = blob;
}
/**
* wpa_config_free_blob - Free blob data
* @blob: Pointer to blob to be freed
*/
void wpa_config_free_blob(struct wpa_config_blob *blob)
{
if (blob) {
os_free(blob->name);
os_free(blob->data);
os_free(blob);
}
}
/**
* wpa_config_remove_blob - Remove a named configuration blob
* @config: Configuration data from wpa_config_read()
* @name: Name of the blob to remove
* Returns: 0 if blob was removed or -1 if blob was not found
*/
int wpa_config_remove_blob(struct wpa_config *config, const char *name)
{
struct wpa_config_blob *pos = config->blobs, *prev = NULL;
while (pos) {
if (os_strcmp(pos->name, name) == 0) {
if (prev)
prev->next = pos->next;
else
config->blobs = pos->next;
wpa_config_free_blob(pos);
return 0;
}
prev = pos;
pos = pos->next;
}
return -1;
}
#endif /* CONFIG_NO_CONFIG_BLOBS */
/**
* wpa_config_alloc_empty - Allocate an empty configuration
* @ctrl_interface: Control interface parameters, e.g., path to UNIX domain
* socket
* @driver_param: Driver parameters
* Returns: Pointer to allocated configuration data or %NULL on failure
*/
struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
const char *driver_param)
{
struct wpa_config *config;
const int aCWmin = 4, aCWmax = 10;
const struct hostapd_wmm_ac_params ac_bk =
{ aCWmin, aCWmax, 7, 0, 0 }; /* background traffic */
const struct hostapd_wmm_ac_params ac_be =
{ aCWmin, aCWmax, 3, 0, 0 }; /* best effort traffic */
const struct hostapd_wmm_ac_params ac_vi = /* video traffic */
{ aCWmin - 1, aCWmin, 2, 3000 / 32, 0 };
const struct hostapd_wmm_ac_params ac_vo = /* voice traffic */
{ aCWmin - 2, aCWmin - 1, 2, 1500 / 32, 0 };
config = os_zalloc(sizeof(*config));
if (config == NULL)
return NULL;
config->eapol_version = DEFAULT_EAPOL_VERSION;
config->ap_scan = DEFAULT_AP_SCAN;
config->fast_reauth = DEFAULT_FAST_REAUTH;
config->p2p_go_intent = DEFAULT_P2P_GO_INTENT;
config->p2p_intra_bss = DEFAULT_P2P_INTRA_BSS;
config->p2p_go_max_inactivity = DEFAULT_P2P_GO_MAX_INACTIVITY;
config->bss_max_count = DEFAULT_BSS_MAX_COUNT;
config->bss_expiration_age = DEFAULT_BSS_EXPIRATION_AGE;
config->bss_expiration_scan_count = DEFAULT_BSS_EXPIRATION_SCAN_COUNT;
config->max_num_sta = DEFAULT_MAX_NUM_STA;
config->access_network_type = DEFAULT_ACCESS_NETWORK_TYPE;
config->scan_cur_freq = DEFAULT_SCAN_CUR_FREQ;
config->wmm_ac_params[0] = ac_be;
config->wmm_ac_params[1] = ac_bk;
config->wmm_ac_params[2] = ac_vi;
config->wmm_ac_params[3] = ac_vo;
if (ctrl_interface)
config->ctrl_interface = os_strdup(ctrl_interface);
if (driver_param)
config->driver_param = os_strdup(driver_param);
return config;
}
#ifndef CONFIG_NO_STDOUT_DEBUG
/**
* wpa_config_debug_dump_networks - Debug dump of configured networks
* @config: Configuration data from wpa_config_read()
*/
void wpa_config_debug_dump_networks(struct wpa_config *config)
{
int prio;
struct wpa_ssid *ssid;
for (prio = 0; prio < config->num_prio; prio++) {
ssid = config->pssid[prio];
wpa_printf(MSG_DEBUG, "Priority group %d",
ssid->priority);
while (ssid) {
wpa_printf(MSG_DEBUG, " id=%d ssid='%s'",
ssid->id,
wpa_ssid_txt(ssid->ssid, ssid->ssid_len));
ssid = ssid->pnext;
}
}
}
#endif /* CONFIG_NO_STDOUT_DEBUG */
struct global_parse_data {
char *name;
int (*parser)(const struct global_parse_data *data,
struct wpa_config *config, int line, const char *value);
void *param1, *param2, *param3;
unsigned int changed_flag;
};
static int wpa_global_config_parse_int(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *pos)
{
int val, *dst;
char *end;
dst = (int *) (((u8 *) config) + (long) data->param1);
val = strtol(pos, &end, 0);
if (*end) {
wpa_printf(MSG_ERROR, "Line %d: invalid number \"%s\"",
line, pos);
return -1;
}
*dst = val;
wpa_printf(MSG_DEBUG, "%s=%d", data->name, *dst);
if (data->param2 && *dst < (long) data->param2) {
wpa_printf(MSG_ERROR, "Line %d: too small %s (value=%d "
"min_value=%ld)", line, data->name, *dst,
(long) data->param2);
*dst = (long) data->param2;
return -1;
}
if (data->param3 && *dst > (long) data->param3) {
wpa_printf(MSG_ERROR, "Line %d: too large %s (value=%d "
"max_value=%ld)", line, data->name, *dst,
(long) data->param3);
*dst = (long) data->param3;
return -1;
}
return 0;
}
static int wpa_global_config_parse_str(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *pos)
{
size_t len;
char **dst, *tmp;
len = os_strlen(pos);
if (data->param2 && len < (size_t) data->param2) {
wpa_printf(MSG_ERROR, "Line %d: too short %s (len=%lu "
"min_len=%ld)", line, data->name,
(unsigned long) len, (long) data->param2);
return -1;
}
if (data->param3 && len > (size_t) data->param3) {
wpa_printf(MSG_ERROR, "Line %d: too long %s (len=%lu "
"max_len=%ld)", line, data->name,
(unsigned long) len, (long) data->param3);
return -1;
}
tmp = os_strdup(pos);
if (tmp == NULL)
return -1;
dst = (char **) (((u8 *) config) + (long) data->param1);
os_free(*dst);
*dst = tmp;
wpa_printf(MSG_DEBUG, "%s='%s'", data->name, *dst);
return 0;
}
static int wpa_global_config_parse_bin(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *pos)
{
size_t len;
struct wpabuf **dst, *tmp;
len = os_strlen(pos);
if (len & 0x01)
return -1;
tmp = wpabuf_alloc(len / 2);
if (tmp == NULL)
return -1;
if (hexstr2bin(pos, wpabuf_put(tmp, len / 2), len / 2)) {
wpabuf_free(tmp);
return -1;
}
dst = (struct wpabuf **) (((u8 *) config) + (long) data->param1);
wpabuf_free(*dst);
*dst = tmp;
wpa_printf(MSG_DEBUG, "%s", data->name);
return 0;
}
static int wpa_config_process_freq_list(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *value)
{
int *freqs;
freqs = wpa_config_parse_int_array(value);
if (freqs == NULL)
return -1;
os_free(config->freq_list);
config->freq_list = freqs;
return 0;
}
static int wpa_config_process_country(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *pos)
{
if (!pos[0] || !pos[1]) {
wpa_printf(MSG_DEBUG, "Invalid country set");
return -1;
}
config->country[0] = pos[0];
config->country[1] = pos[1];
wpa_printf(MSG_DEBUG, "country='%c%c'",
config->country[0], config->country[1]);
return 0;
}
static int wpa_config_process_load_dynamic_eap(
const struct global_parse_data *data, struct wpa_config *config,
int line, const char *so)
{
int ret;
wpa_printf(MSG_DEBUG, "load_dynamic_eap=%s", so);
ret = eap_peer_method_load(so);
if (ret == -2) {
wpa_printf(MSG_DEBUG, "This EAP type was already loaded - not "
"reloading.");
} else if (ret) {
wpa_printf(MSG_ERROR, "Line %d: Failed to load dynamic EAP "
"method '%s'.", line, so);
return -1;
}
return 0;
}
#ifdef CONFIG_WPS
static int wpa_config_process_uuid(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *pos)
{
char buf[40];
if (uuid_str2bin(pos, config->uuid)) {
wpa_printf(MSG_ERROR, "Line %d: invalid UUID", line);
return -1;
}
uuid_bin2str(config->uuid, buf, sizeof(buf));
wpa_printf(MSG_DEBUG, "uuid=%s", buf);
return 0;
}
static int wpa_config_process_device_type(
const struct global_parse_data *data,
struct wpa_config *config, int line, const char *pos)
{
return wps_dev_type_str2bin(pos, config->device_type);
}
static int wpa_config_process_os_version(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *pos)
{
if (hexstr2bin(pos, config->os_version, 4)) {
wpa_printf(MSG_ERROR, "Line %d: invalid os_version", line);
return -1;
}
wpa_printf(MSG_DEBUG, "os_version=%08x",
WPA_GET_BE32(config->os_version));
return 0;
}
static int wpa_config_process_wps_vendor_ext_m1(
const struct global_parse_data *data,
struct wpa_config *config, int line, const char *pos)
{
struct wpabuf *tmp;
int len = os_strlen(pos) / 2;
u8 *p;
if (!len) {
wpa_printf(MSG_ERROR, "Line %d: "
"invalid wps_vendor_ext_m1", line);
return -1;
}
tmp = wpabuf_alloc(len);
if (tmp) {
p = wpabuf_put(tmp, len);
if (hexstr2bin(pos, p, len)) {
wpa_printf(MSG_ERROR, "Line %d: "
"invalid wps_vendor_ext_m1", line);
wpabuf_free(tmp);
return -1;
}
wpabuf_free(config->wps_vendor_ext_m1);
config->wps_vendor_ext_m1 = tmp;
} else {
wpa_printf(MSG_ERROR, "Can not allocate "
"memory for wps_vendor_ext_m1");
return -1;
}
return 0;
}
#endif /* CONFIG_WPS */
#ifdef CONFIG_P2P
static int wpa_config_process_sec_device_type(
const struct global_parse_data *data,
struct wpa_config *config, int line, const char *pos)
{
int idx;
if (config->num_sec_device_types >= MAX_SEC_DEVICE_TYPES) {
wpa_printf(MSG_ERROR, "Line %d: too many sec_device_type "
"items", line);
return -1;
}
idx = config->num_sec_device_types;
if (wps_dev_type_str2bin(pos, config->sec_device_type[idx]))
return -1;
config->num_sec_device_types++;
return 0;
}
static int wpa_config_process_p2p_pref_chan(
const struct global_parse_data *data,
struct wpa_config *config, int line, const char *pos)
{
struct p2p_channel *pref = NULL, *n;
unsigned int num = 0;
const char *pos2;
u8 op_class, chan;
/* format: class:chan,class:chan,... */
while (*pos) {
op_class = atoi(pos);
pos2 = os_strchr(pos, ':');
if (pos2 == NULL)
goto fail;
pos2++;
chan = atoi(pos2);
n = os_realloc_array(pref, num + 1,
sizeof(struct p2p_channel));
if (n == NULL)
goto fail;
pref = n;
pref[num].op_class = op_class;
pref[num].chan = chan;
num++;
pos = os_strchr(pos2, ',');
if (pos == NULL)
break;
pos++;
}
os_free(config->p2p_pref_chan);
config->p2p_pref_chan = pref;
config->num_p2p_pref_chan = num;
wpa_hexdump(MSG_DEBUG, "P2P: Preferred class/channel pairs",
(u8 *) config->p2p_pref_chan,
config->num_p2p_pref_chan * sizeof(struct p2p_channel));
return 0;
fail:
os_free(pref);
wpa_printf(MSG_ERROR, "Line %d: Invalid p2p_pref_chan list", line);
return -1;
}
#endif /* CONFIG_P2P */
static int wpa_config_process_hessid(
const struct global_parse_data *data,
struct wpa_config *config, int line, const char *pos)
{
if (hwaddr_aton2(pos, config->hessid) < 0) {
wpa_printf(MSG_ERROR, "Line %d: Invalid hessid '%s'",
line, pos);
return -1;
}
return 0;
}
static int wpa_config_process_sae_groups(
const struct global_parse_data *data,
struct wpa_config *config, int line, const char *pos)
{
int *groups = wpa_config_parse_int_array(pos);
if (groups == NULL) {
wpa_printf(MSG_ERROR, "Line %d: Invalid sae_groups '%s'",
line, pos);
return -1;
}
os_free(config->sae_groups);
config->sae_groups = groups;
return 0;
}
static int wpa_config_process_ap_vendor_elements(
const struct global_parse_data *data,
struct wpa_config *config, int line, const char *pos)
{
struct wpabuf *tmp;
int len = os_strlen(pos) / 2;
u8 *p;
if (!len) {
wpa_printf(MSG_ERROR, "Line %d: invalid ap_vendor_elements",
line);
return -1;
}
tmp = wpabuf_alloc(len);
if (tmp) {
p = wpabuf_put(tmp, len);
if (hexstr2bin(pos, p, len)) {
wpa_printf(MSG_ERROR, "Line %d: invalid "
"ap_vendor_elements", line);
wpabuf_free(tmp);
return -1;
}
wpabuf_free(config->ap_vendor_elements);
config->ap_vendor_elements = tmp;
} else {
wpa_printf(MSG_ERROR, "Cannot allocate memory for "
"ap_vendor_elements");
return -1;
}
return 0;
}
#ifdef OFFSET
#undef OFFSET
#endif /* OFFSET */
/* OFFSET: Get offset of a variable within the wpa_config structure */
#define OFFSET(v) ((void *) &((struct wpa_config *) 0)->v)
#define FUNC(f) #f, wpa_config_process_ ## f, OFFSET(f), NULL, NULL
#define FUNC_NO_VAR(f) #f, wpa_config_process_ ## f, NULL, NULL, NULL
#define _INT(f) #f, wpa_global_config_parse_int, OFFSET(f)
#define INT(f) _INT(f), NULL, NULL
#define INT_RANGE(f, min, max) _INT(f), (void *) min, (void *) max
#define _STR(f) #f, wpa_global_config_parse_str, OFFSET(f)
#define STR(f) _STR(f), NULL, NULL
#define STR_RANGE(f, min, max) _STR(f), (void *) min, (void *) max
#define BIN(f) #f, wpa_global_config_parse_bin, OFFSET(f), NULL, NULL
static const struct global_parse_data global_fields[] = {
#ifdef CONFIG_CTRL_IFACE
{ STR(ctrl_interface), 0 },
{ STR(ctrl_interface_group), 0 } /* deprecated */,
#endif /* CONFIG_CTRL_IFACE */
{ INT_RANGE(eapol_version, 1, 2), 0 },
{ INT(ap_scan), 0 },
{ INT(disable_scan_offload), 0 },
{ INT(fast_reauth), 0 },
{ STR(opensc_engine_path), 0 },
{ STR(pkcs11_engine_path), 0 },
{ STR(pkcs11_module_path), 0 },
{ STR(pcsc_reader), 0 },
{ STR(pcsc_pin), 0 },
{ STR(driver_param), 0 },
{ INT(dot11RSNAConfigPMKLifetime), 0 },
{ INT(dot11RSNAConfigPMKReauthThreshold), 0 },
{ INT(dot11RSNAConfigSATimeout), 0 },
#ifndef CONFIG_NO_CONFIG_WRITE
{ INT(update_config), 0 },
#endif /* CONFIG_NO_CONFIG_WRITE */
{ FUNC_NO_VAR(load_dynamic_eap), 0 },
#ifdef CONFIG_WPS
{ FUNC(uuid), CFG_CHANGED_UUID },
{ STR_RANGE(device_name, 0, 32), CFG_CHANGED_DEVICE_NAME },
{ STR_RANGE(manufacturer, 0, 64), CFG_CHANGED_WPS_STRING },
{ STR_RANGE(model_name, 0, 32), CFG_CHANGED_WPS_STRING },
{ STR_RANGE(model_number, 0, 32), CFG_CHANGED_WPS_STRING },
{ STR_RANGE(serial_number, 0, 32), CFG_CHANGED_WPS_STRING },
{ FUNC(device_type), CFG_CHANGED_DEVICE_TYPE },
{ FUNC(os_version), CFG_CHANGED_OS_VERSION },
{ STR(config_methods), CFG_CHANGED_CONFIG_METHODS },
{ INT_RANGE(wps_cred_processing, 0, 2), 0 },
{ FUNC(wps_vendor_ext_m1), CFG_CHANGED_VENDOR_EXTENSION },
#endif /* CONFIG_WPS */
#ifdef CONFIG_P2P
{ FUNC(sec_device_type), CFG_CHANGED_SEC_DEVICE_TYPE },
{ INT(p2p_listen_reg_class), 0 },
{ INT(p2p_listen_channel), 0 },
{ INT(p2p_oper_reg_class), 0 },
{ INT(p2p_oper_channel), 0 },
{ INT_RANGE(p2p_go_intent, 0, 15), 0 },
{ STR(p2p_ssid_postfix), CFG_CHANGED_P2P_SSID_POSTFIX },
{ INT_RANGE(persistent_reconnect, 0, 1), 0 },
{ INT_RANGE(p2p_intra_bss, 0, 1), CFG_CHANGED_P2P_INTRA_BSS },
{ INT(p2p_group_idle), 0 },
{ FUNC(p2p_pref_chan), CFG_CHANGED_P2P_PREF_CHAN },
{ INT(p2p_go_ht40), 0 },
{ INT(p2p_disabled), 0 },
{ INT(p2p_no_group_iface), 0 },
{ INT_RANGE(p2p_ignore_shared_freq, 0, 1), 0 },
#endif /* CONFIG_P2P */
{ FUNC(country), CFG_CHANGED_COUNTRY },
{ INT(bss_max_count), 0 },
{ INT(bss_expiration_age), 0 },
{ INT(bss_expiration_scan_count), 0 },
{ INT_RANGE(filter_ssids, 0, 1), 0 },
{ INT_RANGE(filter_rssi, -100, 0), 0 },
{ INT(max_num_sta), 0 },
{ INT_RANGE(disassoc_low_ack, 0, 1), 0 },
#ifdef CONFIG_HS20
{ INT_RANGE(hs20, 0, 1), 0 },
#endif /* CONFIG_HS20 */
{ INT_RANGE(interworking, 0, 1), 0 },
{ FUNC(hessid), 0 },
{ INT_RANGE(access_network_type, 0, 15), 0 },
{ INT_RANGE(pbc_in_m1, 0, 1), 0 },
{ STR(autoscan), 0 },
{ INT_RANGE(wps_nfc_dev_pw_id, 0x10, 0xffff),
CFG_CHANGED_NFC_PASSWORD_TOKEN },
{ BIN(wps_nfc_dh_pubkey), CFG_CHANGED_NFC_PASSWORD_TOKEN },
{ BIN(wps_nfc_dh_privkey), CFG_CHANGED_NFC_PASSWORD_TOKEN },
{ BIN(wps_nfc_dev_pw), CFG_CHANGED_NFC_PASSWORD_TOKEN },
{ STR(ext_password_backend), CFG_CHANGED_EXT_PW_BACKEND },
{ INT(p2p_go_max_inactivity), 0 },
{ INT_RANGE(auto_interworking, 0, 1), 0 },
{ INT(okc), 0 },
{ INT(pmf), 0 },
{ FUNC(sae_groups), 0 },
{ INT(dtim_period), 0 },
{ INT(beacon_int), 0 },
{ FUNC(ap_vendor_elements), 0 },
{ INT_RANGE(ignore_old_scan_res, 0, 1), 0 },
{ FUNC(freq_list), 0 },
{ INT(scan_cur_freq), 0 },
{ INT(sched_scan_interval), 0 },
{ INT(tdls_external_control), 0},
};
#undef FUNC
#undef _INT
#undef INT
#undef INT_RANGE
#undef _STR
#undef STR
#undef STR_RANGE
#undef BIN
#define NUM_GLOBAL_FIELDS (sizeof(global_fields) / sizeof(global_fields[0]))
int wpa_config_process_global(struct wpa_config *config, char *pos, int line)
{
size_t i;
int ret = 0;
for (i = 0; i < NUM_GLOBAL_FIELDS; i++) {
const struct global_parse_data *field = &global_fields[i];
size_t flen = os_strlen(field->name);
if (os_strncmp(pos, field->name, flen) != 0 ||
pos[flen] != '=')
continue;
if (field->parser(field, config, line, pos + flen + 1)) {
wpa_printf(MSG_ERROR, "Line %d: failed to "
"parse '%s'.", line, pos);
ret = -1;
}
if (field->changed_flag == CFG_CHANGED_NFC_PASSWORD_TOKEN)
config->wps_nfc_pw_from_config = 1;
config->changed_parameters |= field->changed_flag;
break;
}
if (i == NUM_GLOBAL_FIELDS) {
#ifdef CONFIG_AP
if (os_strncmp(pos, "wmm_ac_", 7) == 0) {
char *tmp = os_strchr(pos, '=');
if (tmp == NULL) {
if (line < 0)
return -1;
wpa_printf(MSG_ERROR, "Line %d: invalid line "
"'%s'", line, pos);
return -1;
}
*tmp++ = '\0';
if (hostapd_config_wmm_ac(config->wmm_ac_params, pos,
tmp)) {
wpa_printf(MSG_ERROR, "Line %d: invalid WMM "
"AC item", line);
return -1;
}
}
#endif /* CONFIG_AP */
if (line < 0)
return -1;
wpa_printf(MSG_ERROR, "Line %d: unknown global field '%s'.",
line, pos);
ret = -1;
}
return ret;
}
|
618644.c |
#ifdef HAVE_CONFIG_H
#include "../../../ext_config.h"
#endif
#include <php.h>
#include "../../../php_ext.h"
#include "../../../ext.h"
#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "kernel/main.h"
#include "kernel/fcall.h"
#include "kernel/memory.h"
#include "kernel/array.h"
#include "kernel/object.h"
/**
* log 服务提供者
*
* @author Xiangmin Liu <[email protected]>
*
* @since 2017.05.12
* @version 1.0
*/
ZEPHIR_INIT_CLASS(Leevel_Log_Provider_Register) {
ZEPHIR_REGISTER_CLASS_EX(Leevel\\Log\\Provider, Register, leevel, log_provider_register, leevel_di_provider_ce, leevel_log_provider_register_method_entry, 0);
return SUCCESS;
}
/**
* 创建一个服务容器提供者实例
*
* @param \Leevel\Di\IContainer $container
* @return void
*/
PHP_METHOD(Leevel_Log_Provider_Register, __construct) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_0 = NULL;
zval *container, container_sub;
zval *this_ptr = getThis();
ZVAL_UNDEF(&container_sub);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &container);
ZEPHIR_CALL_PARENT(NULL, leevel_log_provider_register_ce, getThis(), "__construct", &_0, 0, container);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
/**
* 注册服务
*
* @return void
*/
PHP_METHOD(Leevel_Log_Provider_Register, register) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZEPHIR_MM_GROW();
ZEPHIR_CALL_METHOD(NULL, this_ptr, "logs", NULL, 0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, this_ptr, "middleware", NULL, 0);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
/**
* 可用服务提供者
*
* @return array
*/
PHP_METHOD(Leevel_Log_Provider_Register, providers) {
zval _1;
zval _0;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
zephir_create_array(return_value, 3, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(&_0);
zephir_create_array(&_0, 1, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(&_1);
ZVAL_STRING(&_1, "Leevel\\Log\\Manager");
zephir_array_fast_append(&_0, &_1);
zephir_array_update_string(return_value, SL("logs"), &_0, PH_COPY | PH_SEPARATE);
ZEPHIR_INIT_NVAR(&_0);
zephir_create_array(&_0, 2, 0 TSRMLS_CC);
ZEPHIR_INIT_NVAR(&_1);
ZVAL_STRING(&_1, "Leevel\\Log\\Log");
zephir_array_fast_append(&_0, &_1);
ZEPHIR_INIT_NVAR(&_1);
ZVAL_STRING(&_1, "Leevel\\Log\\ILog");
zephir_array_fast_append(&_0, &_1);
zephir_array_update_string(return_value, SL("log"), &_0, PH_COPY | PH_SEPARATE);
ZEPHIR_INIT_NVAR(&_1);
ZVAL_STRING(&_1, "Leevel\\Log\\Middleware\\Log");
zephir_array_fast_append(return_value, &_1);
RETURN_MM();
}
/**
* 注册 logs 服务
*
* @return void
*/
PHP_METHOD(Leevel_Log_Provider_Register, logs) {
zval _3;
zend_class_entry *_2;
zval _0, _1, _4;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_3);
ZEPHIR_MM_GROW();
zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
_2 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO);
ZEPHIR_INIT_VAR(&_3);
zephir_create_array(&_3, 2, 0 TSRMLS_CC);
zephir_array_fast_append(&_3, this_ptr);
ZEPHIR_INIT_VAR(&_4);
ZVAL_STRING(&_4, "logsClosure");
zephir_array_fast_append(&_3, &_4);
ZEPHIR_CALL_CE_STATIC(&_1, _2, "fromcallable", NULL, 0, &_3);
zephir_check_call_status();
ZEPHIR_INIT_NVAR(&_4);
ZVAL_STRING(&_4, "logs");
ZEPHIR_CALL_METHOD(NULL, &_0, "singleton", NULL, 0, &_4, &_1);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
/**
* 创建 logs 闭包
*
* @param \Leevel\Di\IContainer $container
* @return \Leevel\Log\Manager
*/
PHP_METHOD(Leevel_Log_Provider_Register, logsClosure) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *container, container_sub;
zval *this_ptr = getThis();
ZVAL_UNDEF(&container_sub);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &container);
object_init_ex(return_value, leevel_log_manager_ce);
ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 90, container);
zephir_check_call_status();
RETURN_MM();
}
/**
* 注册 log 服务
*
* @return void
*/
PHP_METHOD(Leevel_Log_Provider_Register, log) {
zval _3;
zend_class_entry *_2;
zval _0, _1, _4;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_3);
ZEPHIR_MM_GROW();
zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
_2 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO);
ZEPHIR_INIT_VAR(&_3);
zephir_create_array(&_3, 2, 0 TSRMLS_CC);
zephir_array_fast_append(&_3, this_ptr);
ZEPHIR_INIT_VAR(&_4);
ZVAL_STRING(&_4, "logClosure");
zephir_array_fast_append(&_3, &_4);
ZEPHIR_CALL_CE_STATIC(&_1, _2, "fromcallable", NULL, 0, &_3);
zephir_check_call_status();
ZEPHIR_INIT_NVAR(&_4);
ZVAL_STRING(&_4, "log");
ZEPHIR_CALL_METHOD(NULL, &_0, "singleton", NULL, 0, &_4, &_1);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
/**
* 创建 log 服务闭包
*
* @param \Leevel\Di\IContainer $container
* @return object
*/
PHP_METHOD(Leevel_Log_Provider_Register, logClosure) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *container, container_sub, _0, _1;
zval *this_ptr = getThis();
ZVAL_UNDEF(&container_sub);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &container);
ZEPHIR_INIT_VAR(&_1);
ZVAL_STRING(&_1, "logs");
ZEPHIR_CALL_METHOD(&_0, container, "make", NULL, 0, &_1);
zephir_check_call_status();
ZEPHIR_RETURN_CALL_METHOD(&_0, "connect", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
/**
* 注册 middleware 服务
*
* @return void
*/
PHP_METHOD(Leevel_Log_Provider_Register, middleware) {
zval _0, _1;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
ZEPHIR_INIT_VAR(&_1);
ZVAL_STRING(&_1, "Leevel\\Log\\Middleware\\Log");
ZEPHIR_CALL_METHOD(NULL, &_0, "singleton", NULL, 0, &_1);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
|
690940.c | /*******************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to comply with third party license terms applicable to your
* use of third party software (including open source software) that may
* accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
* INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
* WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
* BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
* FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
* ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*******************************************************************************/
#include "device.h"
#include "plib_clk.h"
/*********************************************************************************
Initialize Generic clock
*********************************************************************************/
static void CLK_GenericClockInitialize(void)
{
}
/*********************************************************************************
Initialize Peripheral clock
*********************************************************************************/
static void CLK_PeripheralClockInitialize(void)
{
/* Enable clock for the selected peripherals, since the rom boot will turn on
* certain clocks turn off all clocks not expressly enabled */
PMC_REGS->PMC_PCER0=0x42000;
PMC_REGS->PMC_PCDR0=~0x42000;
PMC_REGS->PMC_PCER1=0x100008;
PMC_REGS->PMC_PCDR1=~0x100008;
}
/*********************************************************************************
Clock Initialize
*********************************************************************************/
void CLK_Initialize( void )
{
/* Initialize Generic Clock */
CLK_GenericClockInitialize();
/* Initialize Peripheral Clock */
CLK_PeripheralClockInitialize();
}
|
130609.c | // Auto-generated file. Do not edit!
// Template: src/qs8-igemm/scalar.c.in
// Generator: tools/xngen
//
// Copyright 2021 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <assert.h>
#include <xnnpack/math.h>
#include <xnnpack/gemm.h>
void xnn_qs8_igemm_minmax_rndnu_ukernel_3x4__scalar(
size_t mr,
size_t nc,
size_t kc,
size_t ks,
const int8_t**restrict a,
const void*restrict w,
int8_t*restrict c,
size_t cm_stride,
size_t cn_stride,
size_t a_offset,
const int8_t* zero,
const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)])
{
assert(mr != 0);
assert(mr <= 3);
assert(nc != 0);
assert(kc != 0);
assert(ks != 0);
assert(ks % (3 * sizeof(void*)) == 0);
assert(a != NULL);
assert(w != NULL);
assert(c != NULL);
int8_t* c0 = c;
int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
if XNN_UNPREDICTABLE(mr < 2) {
c1 = c0;
}
int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
if XNN_UNPREDICTABLE(mr <= 2) {
c2 = c1;
}
do {
int32_t vacc0x0 = ((const int32_t*) w)[0];
int32_t vacc0x1 = ((const int32_t*) w)[1];
int32_t vacc0x2 = ((const int32_t*) w)[2];
int32_t vacc0x3 = ((const int32_t*) w)[3];
int32_t vacc1x0 = vacc0x0;
int32_t vacc1x1 = vacc0x1;
int32_t vacc1x2 = vacc0x2;
int32_t vacc1x3 = vacc0x3;
int32_t vacc2x0 = vacc0x0;
int32_t vacc2x1 = vacc0x1;
int32_t vacc2x2 = vacc0x2;
int32_t vacc2x3 = vacc0x3;
w = (const void*) ((const int32_t*) w + 4);
size_t p = ks;
do {
const int8_t* restrict a0 = a[0];
assert(a0 != NULL);
if XNN_UNPREDICTABLE(a0 != zero) {
a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
}
const int8_t* restrict a1 = a[1];
assert(a1 != NULL);
if XNN_UNPREDICTABLE(a1 != zero) {
a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
}
const int8_t* restrict a2 = a[2];
assert(a2 != NULL);
if XNN_UNPREDICTABLE(a2 != zero) {
a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
}
a += 3;
size_t k = kc;
do {
const int32_t va0 = (int32_t) *a0++;
const int32_t va1 = (int32_t) *a1++;
const int32_t va2 = (int32_t) *a2++;
const int32_t vb0 = (int32_t) ((const int8_t*) w)[0];
const int32_t vb1 = (int32_t) ((const int8_t*) w)[1];
const int32_t vb2 = (int32_t) ((const int8_t*) w)[2];
const int32_t vb3 = (int32_t) ((const int8_t*) w)[3];
w = (const void*) ((const int8_t*) w + 4);
vacc0x0 += va0 * vb0;
vacc0x1 += va0 * vb1;
vacc0x2 += va0 * vb2;
vacc0x3 += va0 * vb3;
vacc1x0 += va1 * vb0;
vacc1x1 += va1 * vb1;
vacc1x2 += va1 * vb2;
vacc1x3 += va1 * vb3;
vacc2x0 += va2 * vb0;
vacc2x1 += va2 * vb1;
vacc2x2 += va2 * vb2;
vacc2x3 += va2 * vb3;
k -= sizeof(int8_t);
} while (k != 0);
p -= 3 * sizeof(void*);
} while (p != 0);
const int32_t vmultiplier = params->rndnu_scalar.multiplier;
const int64_t vproduct0x0 = (int64_t) vacc0x0 * (int64_t) vmultiplier;
const int64_t vproduct0x1 = (int64_t) vacc0x1 * (int64_t) vmultiplier;
const int64_t vproduct0x2 = (int64_t) vacc0x2 * (int64_t) vmultiplier;
const int64_t vproduct0x3 = (int64_t) vacc0x3 * (int64_t) vmultiplier;
const int64_t vproduct1x0 = (int64_t) vacc1x0 * (int64_t) vmultiplier;
const int64_t vproduct1x1 = (int64_t) vacc1x1 * (int64_t) vmultiplier;
const int64_t vproduct1x2 = (int64_t) vacc1x2 * (int64_t) vmultiplier;
const int64_t vproduct1x3 = (int64_t) vacc1x3 * (int64_t) vmultiplier;
const int64_t vproduct2x0 = (int64_t) vacc2x0 * (int64_t) vmultiplier;
const int64_t vproduct2x1 = (int64_t) vacc2x1 * (int64_t) vmultiplier;
const int64_t vproduct2x2 = (int64_t) vacc2x2 * (int64_t) vmultiplier;
const int64_t vproduct2x3 = (int64_t) vacc2x3 * (int64_t) vmultiplier;
const uint32_t shift = params->rndnu_scalar.shift;
const int64_t rounding = params->rndnu_scalar.rounding;
int32_t vout0x0 = (int32_t) asr_s64(vproduct0x0 + rounding, shift);
int32_t vout0x1 = (int32_t) asr_s64(vproduct0x1 + rounding, shift);
int32_t vout0x2 = (int32_t) asr_s64(vproduct0x2 + rounding, shift);
int32_t vout0x3 = (int32_t) asr_s64(vproduct0x3 + rounding, shift);
int32_t vout1x0 = (int32_t) asr_s64(vproduct1x0 + rounding, shift);
int32_t vout1x1 = (int32_t) asr_s64(vproduct1x1 + rounding, shift);
int32_t vout1x2 = (int32_t) asr_s64(vproduct1x2 + rounding, shift);
int32_t vout1x3 = (int32_t) asr_s64(vproduct1x3 + rounding, shift);
int32_t vout2x0 = (int32_t) asr_s64(vproduct2x0 + rounding, shift);
int32_t vout2x1 = (int32_t) asr_s64(vproduct2x1 + rounding, shift);
int32_t vout2x2 = (int32_t) asr_s64(vproduct2x2 + rounding, shift);
int32_t vout2x3 = (int32_t) asr_s64(vproduct2x3 + rounding, shift);
const int32_t voutput_min_less_zero_point = params->rndnu_scalar.output_min_less_zero_point;
vout0x0 = math_max_s32(vout0x0, voutput_min_less_zero_point);
vout0x1 = math_max_s32(vout0x1, voutput_min_less_zero_point);
vout0x2 = math_max_s32(vout0x2, voutput_min_less_zero_point);
vout0x3 = math_max_s32(vout0x3, voutput_min_less_zero_point);
vout1x0 = math_max_s32(vout1x0, voutput_min_less_zero_point);
vout1x1 = math_max_s32(vout1x1, voutput_min_less_zero_point);
vout1x2 = math_max_s32(vout1x2, voutput_min_less_zero_point);
vout1x3 = math_max_s32(vout1x3, voutput_min_less_zero_point);
vout2x0 = math_max_s32(vout2x0, voutput_min_less_zero_point);
vout2x1 = math_max_s32(vout2x1, voutput_min_less_zero_point);
vout2x2 = math_max_s32(vout2x2, voutput_min_less_zero_point);
vout2x3 = math_max_s32(vout2x3, voutput_min_less_zero_point);
const int32_t voutput_max_less_zero_point = params->rndnu_scalar.output_max_less_zero_point;
vout0x0 = math_min_s32(vout0x0, voutput_max_less_zero_point);
vout0x1 = math_min_s32(vout0x1, voutput_max_less_zero_point);
vout0x2 = math_min_s32(vout0x2, voutput_max_less_zero_point);
vout0x3 = math_min_s32(vout0x3, voutput_max_less_zero_point);
vout1x0 = math_min_s32(vout1x0, voutput_max_less_zero_point);
vout1x1 = math_min_s32(vout1x1, voutput_max_less_zero_point);
vout1x2 = math_min_s32(vout1x2, voutput_max_less_zero_point);
vout1x3 = math_min_s32(vout1x3, voutput_max_less_zero_point);
vout2x0 = math_min_s32(vout2x0, voutput_max_less_zero_point);
vout2x1 = math_min_s32(vout2x1, voutput_max_less_zero_point);
vout2x2 = math_min_s32(vout2x2, voutput_max_less_zero_point);
vout2x3 = math_min_s32(vout2x3, voutput_max_less_zero_point);
const int32_t voutput_zero_point = params->rndnu_scalar.output_zero_point;
vout0x0 += voutput_zero_point;
vout0x1 += voutput_zero_point;
vout0x2 += voutput_zero_point;
vout0x3 += voutput_zero_point;
vout1x0 += voutput_zero_point;
vout1x1 += voutput_zero_point;
vout1x2 += voutput_zero_point;
vout1x3 += voutput_zero_point;
vout2x0 += voutput_zero_point;
vout2x1 += voutput_zero_point;
vout2x2 += voutput_zero_point;
vout2x3 += voutput_zero_point;
if XNN_LIKELY(nc >= 4) {
c2[0] = (int8_t) vout2x0;
c2[1] = (int8_t) vout2x1;
c2[2] = (int8_t) vout2x2;
c2[3] = (int8_t) vout2x3;
c1[0] = (int8_t) vout1x0;
c1[1] = (int8_t) vout1x1;
c1[2] = (int8_t) vout1x2;
c1[3] = (int8_t) vout1x3;
c0[0] = (int8_t) vout0x0;
c0[1] = (int8_t) vout0x1;
c0[2] = (int8_t) vout0x2;
c0[3] = (int8_t) vout0x3;
c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
a = (const int8_t**restrict) ((uintptr_t) a - ks);
nc -= 4;
} else {
if (nc & 2) {
c2[0] = (int8_t) vout2x0;
c2[1] = (int8_t) vout2x1;
vout2x0 = vout2x2;
c2 += 2;
c1[0] = (int8_t) vout1x0;
c1[1] = (int8_t) vout1x1;
vout1x0 = vout1x2;
c1 += 2;
c0[0] = (int8_t) vout0x0;
c0[1] = (int8_t) vout0x1;
vout0x0 = vout0x2;
c0 += 2;
}
if (nc & 1) {
c2[0] = (int8_t) vout2x0;
c1[0] = (int8_t) vout1x0;
c0[0] = (int8_t) vout0x0;
}
nc = 0;
}
} while (nc != 0);
}
|
391295.c | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier
* 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 name of author 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
* REGENTS 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.
*/
/* List of contributors:
*
* Initial Name/description
* -------------------------------------------------------------------
* AC Angelo Ciceri
*
*
* Change history:
*
* MMDDYY BY Description
* -------------------------------------------------------------------
* 022005 AC Creation
*
*/
/**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/
/* All code within this section is automatically
* generated by gen_code. Any modification will be lost
* next time gen_code is run.
*/
/* Generated */
/* Generated */ #if defined( _MANAGED )
/* Generated */ #include "TA-Lib-Core.h"
/* Generated */ #define TA_INTERNAL_ERROR(Id) (RetCode::InternalError)
/* Generated */ namespace TicTacTec { namespace TA { namespace Library {
/* Generated */ #elif defined( _JAVA )
/* Generated */ #include "ta_defs.h"
/* Generated */ #include "ta_java_defs.h"
/* Generated */ #define TA_INTERNAL_ERROR(Id) (RetCode.InternalError)
/* Generated */ #else
/* Generated */ #include <string.h>
/* Generated */ #include <math.h>
/* Generated */ #include "ta_func.h"
/* Generated */ #endif
/* Generated */
/* Generated */ #ifndef TA_UTILITY_H
/* Generated */ #include "ta_utility.h"
/* Generated */ #endif
/* Generated */
/* Generated */ #ifndef TA_MEMORY_H
/* Generated */ #include "ta_memory.h"
/* Generated */ #endif
/* Generated */
/* Generated */ #define TA_PREFIX(x) TA_##x
/* Generated */ #define INPUT_TYPE double
/* Generated */
/* Generated */ #if defined( _MANAGED )
/* Generated */ int Core::CdlClosingMarubozuLookback( void )
/* Generated */
/* Generated */ #elif defined( _JAVA )
/* Generated */ public int cdlClosingMarubozuLookback( )
/* Generated */
/* Generated */ #else
/* Generated */ int TA_CDLCLOSINGMARUBOZU_Lookback( void )
/* Generated */
/* Generated */ #endif
/**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/
{
/* insert local variable here */
/**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/
/* Generated */ /* No parameters to validate. */
/**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/
/* insert lookback code here. */
return max( TA_CANDLEAVGPERIOD(BodyLong), TA_CANDLEAVGPERIOD(ShadowVeryShort) );
}
/**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/
/*
* TA_CDLCLOSINGMARUBOZU - Closing Marubozu
*
* Input = Open, High, Low, Close
* Output = int
*
*/
/* Generated */
/* Generated */ #if defined( _MANAGED ) && defined( USE_SUBARRAY )
/* Generated */ enum class Core::RetCode Core::CdlClosingMarubozu( int startIdx,
/* Generated */ int endIdx,
/* Generated */ SubArray^ inOpen,
/* Generated */ SubArray^ inHigh,
/* Generated */ SubArray^ inLow,
/* Generated */ SubArray^ inClose,
/* Generated */ [Out]int% outBegIdx,
/* Generated */ [Out]int% outNBElement,
/* Generated */ cli::array<int>^ outInteger )
/* Generated */ #elif defined( _MANAGED )
/* Generated */ enum class Core::RetCode Core::CdlClosingMarubozu( int startIdx,
/* Generated */ int endIdx,
/* Generated */ cli::array<double>^ inOpen,
/* Generated */ cli::array<double>^ inHigh,
/* Generated */ cli::array<double>^ inLow,
/* Generated */ cli::array<double>^ inClose,
/* Generated */ [Out]int% outBegIdx,
/* Generated */ [Out]int% outNBElement,
/* Generated */ cli::array<int>^ outInteger )
/* Generated */ #elif defined( _JAVA )
/* Generated */ public RetCode cdlClosingMarubozu( int startIdx,
/* Generated */ int endIdx,
/* Generated */ double inOpen[],
/* Generated */ double inHigh[],
/* Generated */ double inLow[],
/* Generated */ double inClose[],
/* Generated */ MInteger outBegIdx,
/* Generated */ MInteger outNBElement,
/* Generated */ int outInteger[] )
/* Generated */ #else
/* Generated */ TA_RetCode TA_CDLCLOSINGMARUBOZU( int startIdx,
/* Generated */ int endIdx,
/* Generated */ const double inOpen[],
/* Generated */ const double inHigh[],
/* Generated */ const double inLow[],
/* Generated */ const double inClose[],
/* Generated */ int *outBegIdx,
/* Generated */ int *outNBElement,
/* Generated */ int outInteger[] )
/* Generated */ #endif
/**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/
{
/* Insert local variables here. */
double BodyLongPeriodTotal, ShadowVeryShortPeriodTotal;
int i, outIdx, BodyLongTrailingIdx, ShadowVeryShortTrailingIdx, lookbackTotal;
/**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/
/* Generated */
/* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK
/* Generated */
/* Generated */ /* Validate the requested output range. */
/* Generated */ if( startIdx < 0 )
/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex);
/* Generated */ if( (endIdx < 0) || (endIdx < startIdx))
/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex);
/* Generated */
/* Generated */ #if !defined(_JAVA)
/* Generated */ /* Verify required price component. */
/* Generated */ if(!inOpen||!inHigh||!inLow||!inClose)
/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
/* Generated */
/* Generated */ #endif /* !defined(_JAVA)*/
/* Generated */ #if !defined(_JAVA)
/* Generated */ if( !outInteger )
/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
/* Generated */
/* Generated */ #endif /* !defined(_JAVA) */
/* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */
/* Generated */
/**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/
/* Identify the minimum number of price bar needed
* to calculate at least one output.
*/
lookbackTotal = LOOKBACK_CALL(CDLCLOSINGMARUBOZU)();
/* Move up the start index if there is not
* enough initial data.
*/
if( startIdx < lookbackTotal )
startIdx = lookbackTotal;
/* Make sure there is still something to evaluate. */
if( startIdx > endIdx )
{
VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);
VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);
return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
}
/* Do the calculation using tight loops. */
/* Add-up the initial period, except for the last value. */
BodyLongPeriodTotal = 0;
BodyLongTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyLong);
ShadowVeryShortPeriodTotal = 0;
ShadowVeryShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryShort);
i = BodyLongTrailingIdx;
while( i < startIdx ) {
BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i );
i++;
}
i = ShadowVeryShortTrailingIdx;
while( i < startIdx ) {
ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i );
i++;
}
/* Proceed with the calculation for the requested range.
* Must have:
* - long white (black) real body
* - no or very short upper (lower) shadow
* The meaning of "long" and "very short" is specified with TA_SetCandleSettings
* outInteger is positive (1 to 100) when white (bullish), negative (-1 to -100) when black (bearish)
*/
outIdx = 0;
do
{
if( TA_REALBODY(i) > TA_CANDLEAVERAGE( BodyLong, BodyLongPeriodTotal, i ) && // long body
(
( // white body and very short lower shadow
TA_CANDLECOLOR(i) == 1 &&
TA_UPPERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i )
) ||
( // black body and very short upper shadow
TA_CANDLECOLOR(i) == -1 &&
TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i )
)
) )
outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100;
else
outInteger[outIdx++] = 0;
/* add the current range and subtract the first range: this is done after the pattern recognition
* when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle)
*/
BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx );
ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i )
- TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx );
i++;
BodyLongTrailingIdx++;
ShadowVeryShortTrailingIdx++;
} while( i <= endIdx );
/* All done. Indicate the output limits and return. */
VALUE_HANDLE_DEREF(outNBElement) = outIdx;
VALUE_HANDLE_DEREF(outBegIdx) = startIdx;
return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
}
/**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/
/* Generated */
/* Generated */ #define USE_SINGLE_PRECISION_INPUT
/* Generated */ #if !defined( _MANAGED ) && !defined( _JAVA )
/* Generated */ #undef TA_PREFIX
/* Generated */ #define TA_PREFIX(x) TA_S_##x
/* Generated */ #endif
/* Generated */ #undef INPUT_TYPE
/* Generated */ #define INPUT_TYPE float
/* Generated */ #if defined( _MANAGED )
/* Generated */ enum class Core::RetCode Core::CdlClosingMarubozu( int startIdx,
/* Generated */ int endIdx,
/* Generated */ cli::array<float>^ inOpen,
/* Generated */ cli::array<float>^ inHigh,
/* Generated */ cli::array<float>^ inLow,
/* Generated */ cli::array<float>^ inClose,
/* Generated */ [Out]int% outBegIdx,
/* Generated */ [Out]int% outNBElement,
/* Generated */ cli::array<int>^ outInteger )
/* Generated */ #elif defined( _JAVA )
/* Generated */ public RetCode cdlClosingMarubozu( int startIdx,
/* Generated */ int endIdx,
/* Generated */ float inOpen[],
/* Generated */ float inHigh[],
/* Generated */ float inLow[],
/* Generated */ float inClose[],
/* Generated */ MInteger outBegIdx,
/* Generated */ MInteger outNBElement,
/* Generated */ int outInteger[] )
/* Generated */ #else
/* Generated */ TA_RetCode TA_S_CDLCLOSINGMARUBOZU( int startIdx,
/* Generated */ int endIdx,
/* Generated */ const float inOpen[],
/* Generated */ const float inHigh[],
/* Generated */ const float inLow[],
/* Generated */ const float inClose[],
/* Generated */ int *outBegIdx,
/* Generated */ int *outNBElement,
/* Generated */ int outInteger[] )
/* Generated */ #endif
/* Generated */ {
/* Generated */ double BodyLongPeriodTotal, ShadowVeryShortPeriodTotal;
/* Generated */ int i, outIdx, BodyLongTrailingIdx, ShadowVeryShortTrailingIdx, lookbackTotal;
/* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK
/* Generated */ if( startIdx < 0 )
/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex);
/* Generated */ if( (endIdx < 0) || (endIdx < startIdx))
/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex);
/* Generated */ #if !defined(_JAVA)
/* Generated */ if(!inOpen||!inHigh||!inLow||!inClose)
/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
/* Generated */ #endif
/* Generated */ #if !defined(_JAVA)
/* Generated */ if( !outInteger )
/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
/* Generated */ #endif
/* Generated */ #endif
/* Generated */ lookbackTotal = LOOKBACK_CALL(CDLCLOSINGMARUBOZU)();
/* Generated */ if( startIdx < lookbackTotal )
/* Generated */ startIdx = lookbackTotal;
/* Generated */ if( startIdx > endIdx )
/* Generated */ {
/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);
/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);
/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
/* Generated */ }
/* Generated */ BodyLongPeriodTotal = 0;
/* Generated */ BodyLongTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyLong);
/* Generated */ ShadowVeryShortPeriodTotal = 0;
/* Generated */ ShadowVeryShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(ShadowVeryShort);
/* Generated */ i = BodyLongTrailingIdx;
/* Generated */ while( i < startIdx ) {
/* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i );
/* Generated */ i++;
/* Generated */ }
/* Generated */ i = ShadowVeryShortTrailingIdx;
/* Generated */ while( i < startIdx ) {
/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i );
/* Generated */ i++;
/* Generated */ }
/* Generated */ outIdx = 0;
/* Generated */ do
/* Generated */ {
/* Generated */ if( TA_REALBODY(i) > TA_CANDLEAVERAGE( BodyLong, BodyLongPeriodTotal, i ) && // long body
/* Generated */ (
/* Generated */ ( // white body and very short lower shadow
/* Generated */ TA_CANDLECOLOR(i) == 1 &&
/* Generated */ TA_UPPERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i )
/* Generated */ ) ||
/* Generated */ ( // black body and very short upper shadow
/* Generated */ TA_CANDLECOLOR(i) == -1 &&
/* Generated */ TA_LOWERSHADOW(i) < TA_CANDLEAVERAGE( ShadowVeryShort, ShadowVeryShortPeriodTotal, i )
/* Generated */ )
/* Generated */ ) )
/* Generated */ outInteger[outIdx++] = TA_CANDLECOLOR(i) * 100;
/* Generated */ else
/* Generated */ outInteger[outIdx++] = 0;
/* Generated */ BodyLongPeriodTotal += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx );
/* Generated */ ShadowVeryShortPeriodTotal += TA_CANDLERANGE( ShadowVeryShort, i )
/* Generated */ - TA_CANDLERANGE( ShadowVeryShort, ShadowVeryShortTrailingIdx );
/* Generated */ i++;
/* Generated */ BodyLongTrailingIdx++;
/* Generated */ ShadowVeryShortTrailingIdx++;
/* Generated */ } while( i <= endIdx );
/* Generated */ VALUE_HANDLE_DEREF(outNBElement) = outIdx;
/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx;
/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
/* Generated */ }
/* Generated */
/* Generated */ #if defined( _MANAGED )
/* Generated */ }}} // Close namespace TicTacTec.TA.Lib
/* Generated */ #endif
/**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/
|
458416.c | #include <stdlib.h>
#include <string.h>
#include "sorting_algorithms.h"
void insert(int *array, int array_size) {
int left = 0;
int tmp;
for (int i = 0; i < array_size; i++) {
if (array[i] > array[i - 1])
continue;
left = i;
tmp = array[i];
while (left > 0 && tmp < array[--left]) {
array[left + 1] = array[left];
array[left] = tmp;
}
}
}
void bubble(int *array, int array_size) {
int swapped = 1;
int tmp;
while (swapped) {
swapped = 0;
for (int i = 0; i < array_size - 1; i++) {
/*if (array[i] <= array[i + 1]) {*/
/*continue;*/
/*}*/
if (array[i] > array[i + 1]) {
swapped = 1;
tmp = array[i];
array[i] = array[i + 1];
array[i + 1] = tmp;
}
}
}
}
int *merge_sort(int *array, int array_size) {
int *left;
int *right;
int *merged;
int middle;
int left_size;
int right_size;
if (array_size == 1) {
return array;
}
middle = (array_size + 1) / 2;
left_size = middle;
right_size = array_size - middle;
left = malloc(left_size * sizeof(int));
right = malloc(right_size * sizeof(int));
/* split array in half */
memcpy(left, array, left_size * sizeof(int));
memcpy(right, array + left_size, right_size * sizeof(int));
left = merge_sort(left, left_size);
right = merge_sort(right, right_size);
merged = merge(left, right, left_size, right_size);
free(left);
free(right);
return merged;
}
int *merge(int *left, int *right, int left_size, int right_size) {
int *merged = calloc(left_size + right_size, sizeof(int));
int lp = 0;
int rp = 0;
for (int i = 0; i < left_size + right_size; i++) {
if (lp == left_size) {
merged[i] = right[rp++];
continue;
}
if (rp == right_size) {
merged[i] = left[lp++];
continue;
}
merged[i] = left[lp] < right[rp] ? left[lp++] : right[rp++];
}
return merged;
}
void selection(int *array, int array_size) {
int lowest;
int tmp;
for (int i = 0; i < array_size; i++) {
lowest = i;
for (int j = i; j < array_size; j++) {
if (array[j] < array[lowest])
lowest = j;
}
tmp = array[i];
array[i] = array[lowest];
array[lowest] = tmp;
}
}
|
869441.c | /*
* Copyright (c) 2012 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#include <smpc/rtc.h>
#include "smpc-internal.h"
/* Command type: RTC */
uint8_t
smpc_rtc_settime_call(struct smpc_time *time)
{
time->month = (time->month) ? time->month : 0x1;
MEMORY_WRITE(8, IREG(0), time->year & 0x7F);
MEMORY_WRITE(8, IREG(1), (time->year >> 8) & 0x7F);
MEMORY_WRITE(8, IREG(2), time->day << 4);
MEMORY_WRITE(8, IREG(2), time->month);
MEMORY_WRITE(8, IREG(3), time->days);
MEMORY_WRITE(8, IREG(4), time->hour);
MEMORY_WRITE(8, IREG(5), time->minute);
MEMORY_WRITE(8, IREG(6), time->seconds);
smpc_smc_call(SMPC_RTC_SETTIME, SMPC_CMD_ISSUE_TYPE_C, NULL);
return MEMORY_READ(8, OREG(31));
}
|
960434.c | #include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"
#define UNCACHEBIT ((~UNMAPPED)&UNCACHED)
#define LINEWORDS (64/sizeof(ulong))
/*
* Allocate memory for use in kernel bitblts.
* The allocated memory must have a flushed instruction
* cache, and the data cache must be flushed by bbdflush().
* To avoid the need for frequent cache flushes, the memory
* is allocated out of an arena, and the i-cache is only
* flushed when it has to be reused
*
* This code will have to be interlocked if we ever get
* a multiprocessor with a bitmapped display.
*/
/* a 0->3 bitblt can take 900 words */
enum {
narena=2, /* put interrupt time stuff in separate arena */
nbbarena=4096 /* number of words in an arena */
};
static ulong bbarena[narena][nbbarena+LINEWORDS];
static ulong *bbcur[narena] = {&bbarena[0][0], &bbarena[1][0]};
static ulong *bblast[narena] = {0, 0};
#define INTLEVEL(v) (((v)&IEC) == 0)
void *
bbmalloc(int nbytes)
{
int nw, a;
int s;
ulong *ans;
nw = nbytes/sizeof(long);
s = splhi();
a = INTLEVEL(s)? 1 : 0;
if(bbcur[a] + nw > &bbarena[a][nbbarena])
ans = bbarena[a];
else
ans = bbcur[a];
bbcur[a] = ans + nw + (LINEWORDS);
splx(s);
if(ans == bbarena[a])
icflush(ans, nbbarena*sizeof(ulong));
bblast[a] = ans;
return ans;
}
void
bbfree(void *p, int n)
{
int a, s;
s = splhi();
a = INTLEVEL(s)? 1 : 0;
if(p == bblast[a])
bbcur[a] = (ulong *)(((char *)bblast[a]) + n + LINEWORDS*sizeof(long));
splx(s);
}
int
bbonstack(void)
{
if(u)
return 1;
return 0;
}
|
673396.c | #include <stdio.h>
int main()
{
char s[1000], i;
printf("Enter a string: ");
scanf("%s",&s);
for(i=0;s[i]!='\0';i++);
printf("Length of string: %d", i);
return 0;
}
|
372843.c | /*
* Copyright © 2013 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 (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <err.h>
#include "glproxy/gl.h"
#include "glproxy/glx.h"
#include <X11/Xlib.h>
#include "glx_common.h"
static Display *dpy;
static bool
test_has_extensions(void)
{
int num_extensions;
glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
for (int i = 0; i < num_extensions; i++) {
char *ext = (char *)glGetStringi(GL_EXTENSIONS, i);
if (!glproxy_has_gl_extension(ext)) {
fprintf(stderr, "GL implementation reported support for %s, "
"but glproxy didn't\n", ext);
return false;
}
}
if (glproxy_has_gl_extension("GL_ARB_ham_sandwich")) {
fprintf(stderr, "glproxy implementation reported support for "
"GL_ARB_ham_sandwich, but it shouldn't\n");
return false;
}
return true;
}
static bool
test_gl_version(void)
{
int gl_version, glproxy_version;
int major, minor;
glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);
gl_version = major * 10 + minor;
if (gl_version < 32) {
fprintf(stderr,
"Implementation reported GL version %d, should be at least 32\n",
gl_version);
return false;
}
glproxy_version = glproxy_gl_version();
if (glproxy_version != gl_version) {
fprintf(stderr,
"GLproxy reported GL version %d, should be %d\n",
glproxy_version, gl_version);
return false;
}
return true;
}
static bool
test_glx_version(void)
{
int version = glproxy_glx_version(dpy, 0);
const char *version_string;
int ret;
int server_major, server_minor;
int client_major, client_minor;
int server, client, expected;
if (version < 13) {
fprintf(stderr,
"Reported GLX version %d, should be at least 13 "
"according to Linux GL ABI\n",
version);
return false;
}
version_string = glXQueryServerString(dpy, 0, GLX_VERSION);
ret = sscanf(version_string, "%d.%d", &server_major, &server_minor);
assert(ret == 2);
server = server_major * 10 + server_minor;
version_string = glXGetClientString(dpy, GLX_VERSION);
ret = sscanf(version_string, "%d.%d", &client_major, &client_minor);
assert(ret == 2);
client = client_major * 10 + client_minor;
if (client < server)
expected = client;
else
expected = server;
if (version != expected) {
fprintf(stderr,
"Reported GLX version %d, should be %d (%s)\n",
version, expected, version_string);
return false;
}
return true;
}
int main(void)
{
bool pass = true;
XVisualInfo *visinfo;
Window win;
GLXFBConfig config;
static const int attribs[] = {
GLX_CONTEXT_PROFILE_MASK_ARB,
GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
GLX_CONTEXT_MAJOR_VERSION_ARB,
3,
GLX_CONTEXT_MINOR_VERSION_ARB,
2,
None
};
GLXContext ctx;
dpy = get_display_or_skip();
if (!glproxy_has_glx_extension(dpy, 0, "GLX_ARB_create_context_profile"))
errx(77, "Test requires GLX_ARB_create_context_profile");
visinfo = get_glx_visual(dpy);
win = get_glx_window(dpy, visinfo, false);
config = get_fbconfig_for_visinfo(dpy, visinfo);
ctx = glXCreateContextAttribsARB(dpy, config, NULL, True, attribs);
if (ctx == None)
errx(77, "glXCreateContext failed");
glXMakeCurrent(dpy, win, ctx);
pass = test_gl_version() && pass;
pass = test_glx_version() && pass;
pass = test_has_extensions() && pass;
return pass != true;
}
|
947372.c | /*
* File : dfs.c
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2005-02-22 Bernard The first version.
*/
#include <dfs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
/* Global variables */
const struct dfs_filesystem_operation *filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX];
struct dfs_filesystem filesystem_table[DFS_FILESYSTEMS_MAX];
/* device filesystem lock */
static struct rt_mutex fslock;
#ifdef DFS_USING_WORKDIR
char working_directory[DFS_PATH_MAX] = {"/"};
#endif
#ifdef DFS_USING_STDIO
struct dfs_fd fd_table[3 + DFS_FD_MAX];
#else
struct dfs_fd fd_table[DFS_FD_MAX];
#endif
/**
* @addtogroup DFS
*/
/*@{*/
/**
* this function will initialize device file system.
*/
int dfs_init(void)
{
/* clear filesystem operations table */
rt_memset((void *)filesystem_operation_table, 0, sizeof(filesystem_operation_table));
/* clear filesystem table */
rt_memset(filesystem_table, 0, sizeof(filesystem_table));
/* clean fd table */
rt_memset(fd_table, 0, sizeof(fd_table));
/* create device filesystem lock */
rt_mutex_init(&fslock, "fslock", RT_IPC_FLAG_FIFO);
#ifdef DFS_USING_WORKDIR
/* set current working directory */
rt_memset(working_directory, 0, sizeof(working_directory));
working_directory[0] = '/';
#endif
return 0;
}
INIT_COMPONENT_EXPORT(dfs_init);
/**
* this function will lock device file system.
*
* @note please don't invoke it on ISR.
*/
void dfs_lock(void)
{
rt_err_t result;
result = rt_mutex_take(&fslock, RT_WAITING_FOREVER);
if (result != RT_EOK)
{
RT_ASSERT(0);
}
}
/**
* this function will lock device file system.
*
* @note please don't invoke it on ISR.
*/
void dfs_unlock(void)
{
rt_mutex_release(&fslock);
}
/**
* @ingroup Fd
* This function will allocate a file descriptor.
*
* @return -1 on failed or the allocated file descriptor.
*/
int fd_new(void)
{
struct dfs_fd *d;
int idx;
/* lock filesystem */
dfs_lock();
/* find an empty fd entry */
#ifdef DFS_USING_STDIO
for (idx = 3; idx < DFS_FD_MAX + 3 && fd_table[idx].ref_count > 0; idx++);
#else
for (idx = 0; idx < DFS_FD_MAX && fd_table[idx].ref_count > 0; idx++);
#endif
/* can't find an empty fd entry */
#ifdef DFS_USING_STDIO
if (idx == DFS_FD_MAX + 3)
#else
if (idx == DFS_FD_MAX)
#endif
{
idx = -1;
goto __result;
}
d = &(fd_table[idx]);
d->ref_count = 1;
d->magic = DFS_FD_MAGIC;
__result:
dfs_unlock();
return idx;
}
/**
* @ingroup Fd
*
* This function will return a file descriptor structure according to file
* descriptor.
*
* @return NULL on on this file descriptor or the file descriptor structure
* pointer.
*/
struct dfs_fd *fd_get(int fd)
{
struct dfs_fd *d;
#ifdef DFS_USING_STDIO
if (fd < 3 || fd >= DFS_FD_MAX + 3)
return RT_NULL;
#else
if (fd < 0 || fd >= DFS_FD_MAX)
return RT_NULL;
#endif
dfs_lock();
d = &fd_table[fd];
/* check dfs_fd valid or not */
if (d->magic != DFS_FD_MAGIC)
{
dfs_unlock();
return RT_NULL;
}
/* increase the reference count */
d->ref_count ++;
dfs_unlock();
return d;
}
/**
* @ingroup Fd
*
* This function will put the file descriptor.
*/
void fd_put(struct dfs_fd *fd)
{
RT_ASSERT(fd != RT_NULL);
dfs_lock();
fd->ref_count --;
/* clear this fd entry */
if (fd->ref_count == 0)
{
rt_memset(fd, 0, sizeof(struct dfs_fd));
}
dfs_unlock();
};
/**
* @ingroup Fd
*
* This function will return whether this file has been opend.
*
* @param pathname the file path name.
*
* @return 0 on file has been open successfully, -1 on open failed.
*/
int fd_is_open(const char *pathname)
{
char *fullpath;
unsigned int index;
struct dfs_filesystem *fs;
struct dfs_fd *fd;
fullpath = dfs_normalize_path(RT_NULL, pathname);
if (fullpath != RT_NULL)
{
char *mountpath;
fs = dfs_filesystem_lookup(fullpath);
if (fs == RT_NULL)
{
/* can't find mounted file system */
rt_free(fullpath);
return -1;
}
/* get file path name under mounted file system */
if (fs->path[0] == '/' && fs->path[1] == '\0')
mountpath = fullpath;
else
mountpath = fullpath + strlen(fs->path);
dfs_lock();
#ifdef DFS_USING_STDIO
for (index = 3; index < DFS_FD_MAX+3; index++)
#else
for (index = 0; index < DFS_FD_MAX; index++)
#endif
{
fd = &(fd_table[index]);
if (fd->fs == RT_NULL)
continue;
if (fd->fs == fs && strcmp(fd->path, mountpath) == 0)
{
/* found file in file descriptor table */
rt_free(fullpath);
dfs_unlock();
return 0;
}
}
dfs_unlock();
rt_free(fullpath);
}
return -1;
}
/**
* this function will return a sub-path name under directory.
*
* @param directory the parent directory.
* @param filename the filename.
*
* @return the subdir pointer in filename
*/
const char *dfs_subdir(const char *directory, const char *filename)
{
const char *dir;
if (strlen(directory) == strlen(filename)) /* it's a same path */
return RT_NULL;
dir = filename + strlen(directory);
if ((*dir != '/') && (dir != filename))
{
dir --;
}
return dir;
}
/**
* this function will normalize a path according to specified parent directory
* and file name.
*
* @param directory the parent path
* @param filename the file name
*
* @return the built full file path (absolute path)
*/
char *dfs_normalize_path(const char *directory, const char *filename)
{
char *fullpath;
char *dst0, *dst, *src;
/* check parameters */
RT_ASSERT(filename != RT_NULL);
#ifdef DFS_USING_WORKDIR
if (directory == RT_NULL) /* shall use working directory */
directory = &working_directory[0];
#else
if ((directory == RT_NULL) && (filename[0] != '/'))
{
rt_kprintf(NO_WORKING_DIR);
return RT_NULL;
}
#endif
if (filename[0] != '/') /* it's a absolute path, use it directly */
{
fullpath = rt_malloc(strlen(directory) + strlen(filename) + 2);
if (fullpath == RT_NULL)
return RT_NULL;
/* join path and file name */
rt_snprintf(fullpath, strlen(directory) + strlen(filename) + 2,
"%s/%s", directory, filename);
}
else
{
fullpath = rt_strdup(filename); /* copy string */
if (fullpath == RT_NULL)
return RT_NULL;
}
src = fullpath;
dst = fullpath;
dst0 = dst;
while (1)
{
char c = *src;
if (c == '.')
{
if (!src[1]) src ++; /* '.' and ends */
else if (src[1] == '/')
{
/* './' case */
src += 2;
while ((*src == '/') && (*src != '\0'))
src ++;
continue;
}
else if (src[1] == '.')
{
if (!src[2])
{
/* '..' and ends case */
src += 2;
goto up_one;
}
else if (src[2] == '/')
{
/* '../' case */
src += 3;
while ((*src == '/') && (*src != '\0'))
src ++;
goto up_one;
}
}
}
/* copy up the next '/' and erase all '/' */
while ((c = *src++) != '\0' && c != '/')
*dst ++ = c;
if (c == '/')
{
*dst ++ = '/';
while (c == '/')
c = *src++;
src --;
}
else if (!c)
break;
continue;
up_one:
dst --;
if (dst < dst0)
{
rt_free(fullpath);
return RT_NULL;
}
while (dst0 < dst && dst[-1] != '/')
dst --;
}
*dst = '\0';
/* remove '/' in the end of path if exist */
dst --;
if ((dst != fullpath) && (*dst == '/'))
*dst = '\0';
return fullpath;
}
/*@}*/
|
692558.c | // Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <string.h>
#include "esp_spi_flash.h"
#include "esp32/rom/spi_flash.h"
#include "esp32/rom/cache.h"
static inline void IRAM_ATTR spi_flash_guard_start(void)
{
const spi_flash_guard_funcs_t *ops = spi_flash_guard_get();
if (ops && ops->start) {
ops->start();
}
}
static inline void IRAM_ATTR spi_flash_guard_end(void)
{
const spi_flash_guard_funcs_t *ops = spi_flash_guard_get();
if (ops && ops->end) {
ops->end();
}
}
esp_rom_spiflash_result_t IRAM_ATTR spi_flash_write_encrypted_chip(size_t dest_addr, const void *src, size_t size)
{
const uint8_t *ssrc = (const uint8_t *)src;
esp_rom_spiflash_result_t rc = ESP_ROM_SPIFLASH_RESULT_OK;
assert((dest_addr % 16) == 0);
assert((size % 16) == 0);
/* esp_rom_spiflash_write_encrypted encrypts data in RAM as it writes,
so copy to a temporary buffer - 32 bytes at a time.
Each call to esp_rom_spiflash_write_encrypted takes a 32 byte "row" of
data to encrypt, and each row is two 16 byte AES blocks
that share a key (as derived from flash address).
*/
uint8_t encrypt_buf[32] __attribute__((aligned(4)));
uint32_t row_size;
for (size_t i = 0; i < size; i += row_size) {
uint32_t row_addr = dest_addr + i;
if (i == 0 && (row_addr % 32) != 0) {
/* writing to second block of a 32 byte row */
row_size = 16;
row_addr -= 16;
/* copy to second block in buffer */
memcpy(encrypt_buf + 16, ssrc + i, 16);
/* decrypt the first block from flash, will reencrypt to same bytes */
spi_flash_read_encrypted(row_addr, encrypt_buf, 16);
} else if (size - i == 16) {
/* 16 bytes left, is first block of a 32 byte row */
row_size = 16;
/* copy to first block in buffer */
memcpy(encrypt_buf, ssrc + i, 16);
/* decrypt the second block from flash, will reencrypt to same bytes */
spi_flash_read_encrypted(row_addr + 16, encrypt_buf + 16, 16);
} else {
/* Writing a full 32 byte row (2 blocks) */
row_size = 32;
memcpy(encrypt_buf, ssrc + i, 32);
}
spi_flash_guard_start();
rc = esp_rom_spiflash_write_encrypted(row_addr, (uint32_t *)encrypt_buf, 32);
spi_flash_guard_end();
if (rc != ESP_ROM_SPIFLASH_RESULT_OK) {
break;
}
}
bzero(encrypt_buf, sizeof(encrypt_buf));
return rc;
}
|
414682.c | /****************************************************************************
* drivers/net/telnet.c
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <assert.h>
#include <stdio.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/kmalloc.h>
#include <nuttx/kthread.h>
#include <nuttx/signal.h>
#include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/net.h>
#include <nuttx/net/telnet.h>
#ifdef CONFIG_NETDEV_TELNET
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_TELNET_RXBUFFER_SIZE
# define CONFIG_TELNET_RXBUFFER_SIZE 256
#endif
#ifndef CONFIG_TELNET_TXBUFFER_SIZE
# define CONFIG_TELNET_TXBUFFER_SIZE 256
#endif
#ifndef CONFIG_TELNET_MAXLCLIENTS
# define CONFIG_TELNET_MAXLCLIENTS 8
#endif
#ifndef CONFIG_TELNET_IOTHREAD_PRIORITY
# define CONFIG_TELNET_IOTHREAD_PRIORITY 100
#endif
#ifndef CONFIG_TELNET_IOTHREAD_STACKSIZE
# define CONFIG_TELNET_IOTHREAD_STACKSIZE 1024
#endif
#undef HAVE_SIGNALS
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP)
# define HAVE_SIGNALS
#endif
/* Telnet protocol stuff ****************************************************/
#define TELNET_NL 0x0a
#define TELNET_CR 0x0d
/* Telnet commands */
#define TELNET_ECHO 1
#define TELNET_SGA 3 /* Suppress Go Ahead */
#define TELNET_NAWS 31 /* Negotiate about window size */
/* Telnet control */
#define TELNET_IAC 255
#define TELNET_WILL 251
#define TELNET_WONT 252
#define TELNET_DO 253
#define TELNET_DONT 254
#define TELNET_SB 250
#define TELNET_SE 240
/* Device stuff *************************************************************/
#define TELNET_DEVFMT "/dev/telnet%d"
/****************************************************************************
* Private Types
****************************************************************************/
/* The state of the telnet parser */
enum telnet_state_e
{
STATE_NORMAL = 0,
STATE_IAC,
STATE_WILL,
STATE_WONT,
STATE_DO,
STATE_DONT,
STATE_SB,
STATE_SB_NAWS,
STATE_SE
};
/* This structure describes the internal state of the driver */
struct telnet_dev_s
{
sem_t td_exclsem; /* Enforces mutually exclusive access */
sem_t td_iosem; /* I/O thread will notify that data is available */
uint8_t td_state; /* (See telnet_state_e) */
uint8_t td_crefs; /* The number of open references to the session */
uint8_t td_minor; /* Minor device number */
uint16_t td_offset; /* Offset to the valid, pending bytes in the rxbuffer */
uint16_t td_pending; /* Number of valid, pending bytes in the rxbuffer */
#ifdef CONFIG_TELNET_SUPPORT_NAWS
uint16_t td_rows; /* Number of NAWS rows */
uint16_t td_cols; /* Number of NAWS cols */
int td_sb_count; /* Count of TELNET_SB bytes received */
#endif
#ifdef HAVE_SIGNALS
pid_t td_pid;
#endif
struct pollfd td_fds;
FAR struct socket td_psock; /* A clone of the internal socket structure */
char td_rxbuffer[CONFIG_TELNET_RXBUFFER_SIZE];
char td_txbuffer[CONFIG_TELNET_TXBUFFER_SIZE];
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/* Support functions */
#ifdef CONFIG_TELNET_DUMPBUFFER
static inline void telnet_dumpbuffer(FAR const char *msg,
FAR const char *buffer, unsigned int nbytes);
#else
# define telnet_dumpbuffer(msg,buffer,nbytes)
#endif
static void telnet_getchar(FAR struct telnet_dev_s *priv, uint8_t ch,
FAR char *dest, int *nread);
static ssize_t telnet_receive(FAR struct telnet_dev_s *priv,
FAR const char *src, size_t srclen, FAR char *dest,
size_t destlen);
static bool telnet_putchar(FAR struct telnet_dev_s *priv, uint8_t ch,
int *nwritten);
static void telnet_sendopt(FAR struct telnet_dev_s *priv, uint8_t option,
uint8_t value);
static int telnet_io_main(int argc, FAR char** argv);
/* Telnet character driver methods */
static int telnet_open(FAR struct file *filep);
static int telnet_close(FAR struct file *filep);
static ssize_t telnet_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static ssize_t telnet_write(FAR struct file *filep, FAR const char *buffer,
size_t len);
static int telnet_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int telnet_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
/* Telnet session creation */
static int telnet_session(FAR struct telnet_session_s *session);
/* Telnet factory driver methods */
static ssize_t factory_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t factory_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen);
static int factory_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
/****************************************************************************
* Private Data
****************************************************************************/
static const struct file_operations g_telnet_fops =
{
telnet_open, /* open */
telnet_close, /* close */
telnet_read, /* read */
telnet_write, /* write */
NULL, /* seek */
telnet_ioctl, /* ioctl */
telnet_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
};
static const struct file_operations g_factory_fops =
{
NULL, /* open */
NULL, /* close */
factory_read, /* read */
factory_write, /* write */
NULL, /* seek */
factory_ioctl, /* ioctl */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
};
/* This is an global data set of all of all active Telnet drivers. This
* additional logic in included to handle killing of task via control
* characters received via Telenet (via Ctrl-C SIGINT, in particular).
*/
static pid_t g_telnet_io_kthread;
static struct telnet_dev_s *g_telnet_clients[CONFIG_TELNET_MAXLCLIENTS];
static sem_t g_iosem = SEM_INITIALIZER(0);
static sem_t g_clients_sem = SEM_INITIALIZER(1);
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: telnet_dumpbuffer
*
* Description:
* Dump a buffer of data (debug only)
*
****************************************************************************/
#ifdef CONFIG_TELNET_DUMPBUFFER
static inline void telnet_dumpbuffer(FAR const char *msg,
FAR const char *buffer,
unsigned int nbytes)
{
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_NET have to
* be defined or the following does nothing.
*/
ninfodumpbuffer(msg, (FAR const uint8_t *)buffer, nbytes);
}
#endif
/****************************************************************************
* Name: telnet_check_ctrlchar
*
* Description:
* Check if an incoming control character should generate a signal.
*
****************************************************************************/
#ifdef HAVE_SIGNALS
static void telnet_check_ctrlchar(FAR struct telnet_dev_s *priv,
FAR char *buffer, size_t len)
{
int signo = 0;
for (; priv->td_pid >= 0 && len > 0; buffer++, len--)
{
#ifdef CONFIG_TTY_SIGINT
/* Is this the special character that will generate the SIGINT
* signal?
*/
if (*buffer == CONFIG_TTY_SIGINT_CHAR)
{
/* Yes.. note that the kill is needed and do not put the character
* into the Rx buffer. It should not be read as normal data.
*/
signo = SIGINT;
break;
}
#endif
#ifdef CONFIG_TTY_SIGTSTP
/* Is this the special character that will generate the SIGTSTP
* signal?
*/
if (*buffer == CONFIG_TTY_SIGTSTP_CHAR)
{
/* Note that the kill is needed and do not put the character
* into the Rx buffer. It should not be read as normal data.
*/
signo = SIGTSTP;
#ifndef CONFIG_TTY_SIGINT
break;
#endif
}
#endif
}
/* Send the signal if necessary */
if (signo != 0)
{
nxsig_kill(priv->td_pid, signo);
}
}
#endif
/****************************************************************************
* Name: telnet_getchar
*
* Description:
* Get another character for the user received buffer from the RX buffer
*
****************************************************************************/
static void telnet_getchar(FAR struct telnet_dev_s *priv, uint8_t ch,
FAR char *dest, int *nread)
{
register int index;
#ifndef CONFIG_TELNET_CHARACTER_MODE
/* Ignore carriage returns */
if (ch != TELNET_CR)
#endif
{
/* Add all other characters to the destination buffer */
index = *nread;
dest[index++] = ch;
*nread = index;
}
}
/****************************************************************************
* Name: telnet_receive
*
* Description:
* Process a received Telnet buffer
*
****************************************************************************/
static ssize_t telnet_receive(FAR struct telnet_dev_s *priv,
FAR const char *src, size_t srclen,
FAR char *dest, size_t destlen)
{
int nread;
uint8_t ch;
ninfo("srclen: %zd destlen: %zd\n", srclen, destlen);
for (nread = 0; srclen > 0 && nread < destlen; srclen--)
{
ch = *src++;
ninfo("ch=%02x state=%d\n", ch, priv->td_state);
switch (priv->td_state)
{
case STATE_IAC:
if (ch == TELNET_IAC)
{
telnet_getchar(priv, ch, dest, &nread);
priv->td_state = STATE_NORMAL;
}
else
{
switch (ch)
{
case TELNET_WILL:
priv->td_state = STATE_WILL;
break;
case TELNET_WONT:
priv->td_state = STATE_WONT;
break;
case TELNET_DO:
priv->td_state = STATE_DO;
break;
case TELNET_DONT:
priv->td_state = STATE_DONT;
break;
#ifdef CONFIG_TELNET_SUPPORT_NAWS
case TELNET_SB:
priv->td_state = STATE_SB;
priv->td_sb_count = 0;
break;
case TELNET_SE:
priv->td_state = STATE_NORMAL;
break;
#endif
default:
priv->td_state = STATE_NORMAL;
break;
}
}
break;
case STATE_WILL:
#ifdef CONFIG_TELNET_SUPPORT_NAWS
/* For NAWS, Reply with a DO */
if (ch == TELNET_NAWS)
{
telnet_sendopt(priv, TELNET_DO, ch);
}
/* Reply with a DON'T */
else
#endif
{
telnet_sendopt(priv, TELNET_DONT, ch);
ninfo("Suppress: 0x%02X (%d)\n", ch, ch);
}
priv->td_state = STATE_NORMAL;
break;
case STATE_WONT:
telnet_sendopt(priv, TELNET_DONT, ch);
priv->td_state = STATE_NORMAL;
break;
case STATE_DO:
#ifdef CONFIG_TELNET_CHARACTER_MODE
if (ch == TELNET_SGA || ch == TELNET_ECHO)
{
/* If it received 'ECHO' or 'Suppress Go Ahead', then do
* nothing.
*/
}
else
{
/* Reply with a WONT */
telnet_sendopt(priv, TELNET_WONT, ch);
ninfo("WONT: 0x%02X\n", ch);
}
#else
/* Reply with a WONT */
telnet_sendopt(priv, TELNET_WONT, ch);
#endif
priv->td_state = STATE_NORMAL;
break;
case STATE_DONT:
/* Reply with a WONT */
telnet_sendopt(priv, TELNET_WONT, ch);
priv->td_state = STATE_NORMAL;
break;
case STATE_NORMAL:
if (ch == TELNET_IAC)
{
priv->td_state = STATE_IAC;
}
else
{
telnet_getchar(priv, ch, dest, &nread);
}
break;
#ifdef CONFIG_TELNET_SUPPORT_NAWS
/* Handle Telnet Sub negotiation request */
case STATE_SB:
switch (ch)
{
case TELNET_NAWS:
priv->td_state = STATE_SB_NAWS;
break;
default:
priv->td_state = STATE_NORMAL;
break;
}
break;
/* Handle NAWS sub-option negotiation */
case STATE_SB_NAWS:
/* Update cols / rows based on received byte count */
switch (priv->td_sb_count)
{
case 0:
priv->td_cols = (priv->td_cols & 0x00ff) | (ch << 8);
break;
case 1:
priv->td_cols = (priv->td_cols & 0xff00) | ch;
break;
case 2:
priv->td_rows = (priv->td_rows & 0x00ff) | (ch << 8);
break;
case 3:
priv->td_rows = (priv->td_rows & 0xff00) | ch;
ninfo("NAWS: %d,%d", priv->td_cols, priv->td_rows);
break;
}
/* Increment SB count and switch to NORMAL when complete */
if (++priv->td_sb_count == 4)
{
priv->td_state = STATE_NORMAL;
}
break;
#endif
}
}
/* We get here if (1) all of the received bytes have been processed, or
* (2) if the user's buffer has become full.
*/
if (srclen > 0)
{
/* Remember where we left off. These bytes will be returned the next
* time that telnet_read() is called.
*/
priv->td_pending = srclen;
priv->td_offset = (src - priv->td_rxbuffer);
}
else
{
/* All of the received bytes were consumed */
priv->td_pending = 0;
priv->td_offset = 0;
}
return nread;
}
/****************************************************************************
* Name: telnet_putchar
*
* Description:
* Put another character from the user buffer to the TX buffer.
*
****************************************************************************/
static bool telnet_putchar(FAR struct telnet_dev_s *priv, uint8_t ch,
int *nread)
{
register int index;
bool ret = false;
/* Ignore carriage returns (we will put these in automatically as
* necessary).
*/
if (ch != TELNET_CR)
{
/* Add all other characters to the destination buffer */
index = *nread;
priv->td_txbuffer[index++] = ch;
/* Check for line feeds */
if (ch == TELNET_NL)
{
/* Now add the carriage return */
priv->td_txbuffer[index++] = TELNET_CR;
/* End of line */
ret = true;
}
*nread = index;
}
return ret;
}
/****************************************************************************
* Name: telnet_sendopt
*
* Description:
* Send the telnet option bytes
*
****************************************************************************/
static void telnet_sendopt(FAR struct telnet_dev_s *priv, uint8_t option,
uint8_t value)
{
uint8_t optbuf[3];
int ret;
optbuf[0] = TELNET_IAC;
optbuf[1] = option;
optbuf[2] = value;
telnet_dumpbuffer("Send optbuf", optbuf, 3);
ret = psock_send(&priv->td_psock, optbuf, 3, 0);
if (ret < 0)
{
nerr("ERROR: Failed to send TELNET_IAC: %d\n", ret);
}
}
/****************************************************************************
* Name: telnet_open
****************************************************************************/
static int telnet_open(FAR struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
FAR struct telnet_dev_s *priv = inode->i_private;
int tmp;
int ret;
ninfo("td_crefs: %d\n", priv->td_crefs);
/* Get exclusive access to the device structures */
ret = nxsem_wait(&priv->td_exclsem);
if (ret < 0)
{
nerr("ERROR: nxsem_wait failed: %d\n", ret);
goto errout;
}
/* Increment the count of references to the device. If this the first
* time that the driver has been opened for this device, then initialize
* the device.
*/
tmp = priv->td_crefs + 1;
if (tmp > 255)
{
/* More than 255 opens; uint8_t would overflow to zero */
ret = -EMFILE;
goto errout_with_sem;
}
/* Save the new open count on success */
priv->td_crefs = tmp;
ret = OK;
errout_with_sem:
nxsem_post(&priv->td_exclsem);
errout:
return ret;
}
/****************************************************************************
* Name: telnet_close
****************************************************************************/
static int telnet_close(FAR struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
FAR struct telnet_dev_s *priv = inode->i_private;
FAR char *devpath;
int ret;
int i;
ninfo("td_crefs: %d\n", priv->td_crefs);
/* Get exclusive access to the device structures */
ret = nxsem_wait(&priv->td_exclsem);
if (ret < 0)
{
nerr("ERROR: nxsem_wait failed: %d\n", ret);
goto errout;
}
/* Decrement the references to the driver. If the reference count will
* decrement to 0, then uninitialize the driver.
*/
if (priv->td_crefs > 1)
{
/* Just decrement the reference count and release the semaphore */
priv->td_crefs--;
nxsem_post(&priv->td_exclsem);
}
else
{
/* Re-create the path to the driver. */
ret = asprintf(&devpath, TELNET_DEVFMT, priv->td_minor);
if (ret < 0)
{
nerr("ERROR: Failed to allocate the driver path\n");
}
else
{
/* Un-register the character driver */
ret = unregister_driver(devpath);
if (ret < 0)
{
/* NOTE: a return value of -EBUSY is not an error, it simply
* means that the Telnet driver is busy now and cannot be
* registered now because there are other sessions using the
* connection. The driver will be properly unregistered when
* the final session terminates.
*/
if (ret != -EBUSY)
{
nerr("ERROR: Failed to unregister the driver %s: %d\n",
devpath, ret);
}
else
{
ret = OK;
}
}
kmm_free(devpath);
}
/* Remove ourself from the clients list */
nxsem_wait(&g_clients_sem);
for (i = 0; i < CONFIG_TELNET_MAXLCLIENTS; i++)
{
if (g_telnet_clients[i] == priv)
{
g_telnet_clients[i] = NULL;
break;
}
}
/* If the socket is still polling */
if (priv->td_fds.events)
{
/* Tear down the poll */
psock_poll(&priv->td_psock, &priv->td_fds, FALSE);
priv->td_fds.events = 0;
}
nxsem_post(&g_clients_sem);
/* Notify the I/O thread that a client was removed */
nxsem_post(&g_iosem);
/* Close the socket */
psock_close(&priv->td_psock);
/* Release the driver memory. What if there are threads waiting on
* td_exclsem? They will never be awakened! How could this happen?
* crefs == 1 so there are no other open references to the driver.
* But this could have if someone were trying to re-open the driver
* after every other thread has closed it. That really should not
* happen in the intended usage model.
*/
DEBUGASSERT(priv->td_exclsem.semcount == 0);
nxsem_destroy(&priv->td_exclsem);
kmm_free(priv);
}
errout:
return ret;
}
/****************************************************************************
* Name: telnet_read
****************************************************************************/
static ssize_t telnet_read(FAR struct file *filep, FAR char *buffer,
size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct telnet_dev_s *priv = inode->i_private;
ssize_t nread = 0;
int ret;
ninfo("len: %zd\n", len);
/* First, handle the case where there are still valid bytes left in the
* I/O buffer from the last time that read was called. NOTE: Much of
* what we read may be protocol stuff and may not correspond to user
* data. Hence we need the loop and we need may need to wait for data
* multiple times in order to get data that the client is interested in.
*/
do
{
FAR const char *src;
if (priv->td_pending == 0)
{
/* poll fds.revents contains last poll status in case of error */
if ((priv->td_fds.revents & (POLLHUP | POLLERR)) != 0)
{
return -EPIPE;
}
if (filep->f_oflags & O_NONBLOCK)
{
return -EAGAIN;
}
/* Wait for new data, interrupt, or thread cancellation */
ret = nxsem_wait(&priv->td_iosem);
if (ret < 0)
{
nerr("ERROR: nxsem_wait failed: %d\n", ret);
return (ssize_t)ret;
}
continue;
}
/* Take exclusive access to data buffer */
ret = nxsem_wait(&priv->td_exclsem);
if (ret < 0)
{
nerr("ERROR: nxsem_wait failed: %d\n", ret);
return (ssize_t)ret;
}
/* Process the buffered telnet data */
src = &priv->td_rxbuffer[priv->td_offset];
nread = telnet_receive(priv, src, priv->td_pending, buffer, len);
nxsem_post(&priv->td_exclsem);
}
while (nread == 0);
/* Notify the I/O thread the rxbuffer is available */
if (nread > 0)
{
nxsem_post(&g_iosem);
}
/* Returned Value:
*
* nread > 0: The number of characters copied into the user buffer by
* telnet_receive().
* nread <= 0: Loss of connection or error events reported by recv().
*/
return nread;
}
/****************************************************************************
* Name: telnet_write
****************************************************************************/
static ssize_t telnet_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct telnet_dev_s *priv = inode->i_private;
FAR const char *src = buffer;
ssize_t nsent;
ssize_t ret;
int ncopied;
char ch;
bool eol;
ninfo("len: %zd\n", len);
/* Process each character from the user buffer */
for (nsent = 0, ncopied = 0; nsent < len; nsent++)
{
/* Get the next character from the user buffer */
ch = *src++;
/* Add the character to the TX buffer */
eol = telnet_putchar(priv, ch, &ncopied);
/* Was that the end of a line? Or is the buffer too full to hold the
* next largest character sequence ("\r\n")?
*/
if (eol || ncopied > CONFIG_TELNET_TXBUFFER_SIZE - 2)
{
/* Yes... send the data now */
ret = psock_send(&priv->td_psock, priv->td_txbuffer, ncopied, 0);
if (ret < 0)
{
nerr("ERROR: psock_send failed '%s': %zd\n",
priv->td_txbuffer, ret);
return ret;
}
/* Reset the index to the beginning of the TX buffer. */
ncopied = 0;
}
}
/* Send anything remaining in the TX buffer */
if (ncopied > 0)
{
ret = psock_send(&priv->td_psock, priv->td_txbuffer, ncopied, 0);
if (ret < 0)
{
nerr("ERROR: psock_send failed '%s': %zd\n",
priv->td_txbuffer, ret);
return ret;
}
}
/* Notice that we don't actually return the number of bytes sent, but
* rather, the number of bytes that the caller asked us to send. We may
* have sent more bytes (because of CR-LF expansion). But it confuses
* some logic if you report that you sent more than you were requested to.
*/
return len;
}
/****************************************************************************
* Name: telnet_session
*
* Description:
* Create a character driver to "wrap" the telnet session. This function
* will select and return a unique path for the new telnet device.
*
* Input Parameters:
* session - On input, contains the socket descriptor that represents the
* new telnet connection. On output, it holds the path to the new Telnet
* driver.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
static int telnet_session(FAR struct telnet_session_s *session)
{
FAR struct telnet_dev_s *priv;
FAR struct socket *psock;
int ret;
/* Allocate instance data for this driver */
priv = (FAR struct telnet_dev_s *)kmm_zalloc(sizeof(struct telnet_dev_s));
if (!priv)
{
nerr("ERROR: Failed to allocate the driver data structure\n");
return -ENOMEM;
}
/* Initialize the allocated driver instance */
nxsem_init(&priv->td_exclsem, 0, 1);
nxsem_init(&priv->td_iosem, 0, 0);
/* td_iosem is used for signaling and, hence, must not participate in
* priority inheritance.
*/
nxsem_set_protocol(&priv->td_iosem, SEM_PRIO_NONE);
priv->td_state = STATE_NORMAL;
priv->td_crefs = 0;
priv->td_minor = 0;
priv->td_pending = 0;
priv->td_offset = 0;
#ifdef HAVE_SIGNALS
priv->td_pid = -1;
#endif
#ifdef CONFIG_TELNET_SUPPORT_NAWS
priv->td_rows = 25;
priv->td_cols = 80;
priv->td_sb_count = 0;
#endif
/* Clone the internal socket structure. We do this so that it will be
* independent of threads and of socket descriptors (the original socket
* instance resided in the daemon's task group`).
*/
psock = sockfd_socket(session->ts_sd);
if (!psock)
{
nerr("ERROR: Failed to convert sd=%d to a socket structure\n",
session->ts_sd);
ret = -EINVAL;
goto errout_with_dev;
}
ret = psock_dup2(psock, &priv->td_psock);
if (ret < 0)
{
nerr("ERROR: psock_dup2 failed: %d\n", ret);
goto errout_with_dev;
}
/* Allocate a unique minor device number of the telnet driver.
* Get exclusive access to the minor counter.
*/
ret = nxsem_wait_uninterruptible(&g_clients_sem);
if (ret < 0)
{
nerr("ERROR: nxsem_wait failed: %d\n", ret);
goto errout_with_clone;
}
/* Loop until the device name is verified to be unique. */
while (priv->td_minor < CONFIG_TELNET_MAXLCLIENTS)
{
if (g_telnet_clients[priv->td_minor] == NULL)
{
snprintf(session->ts_devpath, TELNET_DEVPATH_MAX,
TELNET_DEVFMT, priv->td_minor);
break;
}
priv->td_minor++;
}
if (priv->td_minor >= CONFIG_TELNET_MAXLCLIENTS)
{
nerr("ERROR: Too many sessions\n");
ret = -ENFILE;
goto errout_with_semaphore;
}
/* Register the driver */
ret = register_driver(session->ts_devpath, &g_telnet_fops, 0666, priv);
if (ret < 0)
{
nerr("ERROR: Failed to register the driver %s: %d\n",
session->ts_devpath, ret);
goto errout_with_semaphore;
}
/* Close the original psock (keeping the clone) */
nx_close(session->ts_sd);
#ifdef CONFIG_TELNET_SUPPORT_NAWS
telnet_sendopt(priv, TELNET_DO, TELNET_NAWS);
#endif
#ifdef CONFIG_TELNET_CHARACTER_MODE
telnet_sendopt(priv, TELNET_WILL, TELNET_SGA);
telnet_sendopt(priv, TELNET_WILL, TELNET_ECHO);
#endif
/* Has the I/O thread been started? */
if (g_telnet_io_kthread == (pid_t)0)
{
/* g_iosem is used for signaling and, hence, must not participate in
* priority inheritance.
*/
nxsem_set_protocol(&g_iosem, SEM_PRIO_NONE);
/* Start the I/O thread */
g_telnet_io_kthread =
kthread_create("telnet_io", CONFIG_TELNET_IOTHREAD_PRIORITY,
CONFIG_TELNET_IOTHREAD_STACKSIZE, telnet_io_main,
NULL);
}
/* Save ourself in the list of Telnet client threads */
g_telnet_clients[priv->td_minor] = priv;
nxsem_post(&g_clients_sem);
nxsem_post(&g_iosem);
return OK;
errout_with_semaphore:
nxsem_post(&g_clients_sem);
errout_with_clone:
psock_close(&priv->td_psock);
errout_with_dev:
kmm_free(priv);
return ret;
}
/****************************************************************************
* Name: factory_read
****************************************************************************/
static ssize_t factory_read(FAR struct file *filep, FAR char *buffer,
size_t len)
{
return 0; /* Return EOF */
}
/****************************************************************************
* Name: factory_write
****************************************************************************/
static ssize_t factory_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
return len; /* Say that everything was written */
}
/****************************************************************************
* Name: telnet_ioctl
****************************************************************************/
static int telnet_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
FAR struct inode *inode = filep->f_inode;
FAR struct telnet_dev_s *priv = inode->i_private;
int ret = OK;
switch (cmd)
{
#ifdef HAVE_SIGNALS
/* Make the given terminal the controlling terminal of the calling
* process.
*/
case TIOCSCTTY:
{
/* Check if the ISIG flag is set in the termios c_lflag to enable
* this feature. This flag is set automatically for a serial console
* device.
*/
/* Save the PID of the recipient of the SIGINT signal. */
priv->td_pid = (pid_t)arg;
DEBUGASSERT((unsigned long)(priv->td_pid) == arg);
}
break;
#endif
#ifdef CONFIG_TELNET_SUPPORT_NAWS
case TIOCGWINSZ:
{
FAR struct winsize *pw = (FAR struct winsize *)((uintptr_t)arg);
/* Get row/col from the private data */
pw->ws_row = priv->td_rows;
pw->ws_col = priv->td_cols;
}
break;
#endif
default:
ret = -ENOTTY;
break;
}
UNUSED(priv); /* Avoid warning if not used */
return ret;
}
/****************************************************************************
* Name: telnet_poll
*
* Description:
* The standard poll() operation redirects operations on socket descriptors
* to this function.
*
* Input Parameters:
* fd - The socket descriptor of interest
* fds - The structure describing the events to be monitored, OR NULL if
* this is a request to stop monitoring events.
* setup - true: Setup up the poll; false: Teardown the poll
*
* Returned Value:
* 0: Success; Negated errno on failure
*
****************************************************************************/
static int telnet_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
FAR struct inode *inode = filep->f_inode;
FAR struct telnet_dev_s *priv = inode->i_private;
FAR struct socket *psock;
DEBUGASSERT(fds != NULL);
/* Get the underlying socket structure and verify that the sockfd
* corresponds to valid, allocated socket
*/
psock = &priv->td_psock;
if (psock == NULL || psock->s_conn == NULL)
{
return -EBADF;
}
/* Test if we have cached data waiting to be read */
if (priv->td_pending > 0)
{
/* Yes.. then signal the poll logic */
fds->revents |= (POLLRDNORM & fds->events);
if (fds->revents)
{
nxsem_post(fds->sem);
}
}
/* Then let psock_poll() do the heavy lifting */
return psock_poll(psock, fds, setup);
}
/****************************************************************************
* Name: telnet_io_main
****************************************************************************/
static int telnet_io_main(int argc, FAR char** argv)
{
FAR struct telnet_dev_s *priv;
FAR char *buffer;
int i;
int ret;
while (1)
{
nxsem_reset(&g_iosem, 0);
/* Poll each client in the g_telnet_clients[] array. */
nxsem_wait(&g_clients_sem);
for (i = 0; i < CONFIG_TELNET_MAXLCLIENTS; i++)
{
priv = g_telnet_clients[i];
if (priv != NULL &&
!(priv->td_fds.revents & (POLLHUP | POLLERR)) &&
(CONFIG_TELNET_RXBUFFER_SIZE -
priv->td_pending - priv->td_offset) > 0)
{
priv->td_fds.sem = &g_iosem;
priv->td_fds.events = POLLIN | POLLHUP | POLLERR;
priv->td_fds.revents = 0;
psock_poll(&priv->td_psock, &priv->td_fds, TRUE);
}
}
nxsem_post(&g_clients_sem);
/* Wait for any Telnet connect/disconnect events
* to include/remove client sockets from polling
*/
nxsem_wait(&g_iosem);
/* Revisit each client in the g_telnet_clients[] array */
nxsem_wait(&g_clients_sem);
for (i = 0; i < CONFIG_TELNET_MAXLCLIENTS; i++)
{
priv = g_telnet_clients[i];
/* If poll was setup previously (events != 0) */
if (priv != NULL && priv->td_fds.events)
{
/* Check for a pending poll() */
if (priv->td_fds.revents & POLLIN)
{
if (priv->td_pending < CONFIG_TELNET_RXBUFFER_SIZE)
{
/* Take exclusive access to data buffer */
nxsem_wait(&priv->td_exclsem);
buffer = priv->td_rxbuffer + priv->td_pending +
priv->td_offset;
ret = psock_recv(&priv->td_psock, buffer,
CONFIG_TELNET_RXBUFFER_SIZE -
priv->td_pending - priv->td_offset,
0);
priv->td_pending += ret;
nxsem_post(&priv->td_exclsem);
/* Notify the client thread that data is available */
nxsem_post(&priv->td_iosem);
#ifdef HAVE_SIGNALS
/* Check if any of the received characters is a
* control that should generate a signal.
*/
telnet_check_ctrlchar(priv, buffer, ret);
#endif
}
}
/* Tear it down */
psock_poll(&priv->td_psock, &priv->td_fds, FALSE);
priv->td_fds.events = 0;
/* POLLHUP (or POLLERR) indicates that this session has
* terminated.
*/
if (priv->td_fds.revents & (POLLHUP | POLLERR))
{
/* notify the client thread */
nxsem_post(&priv->td_iosem);
}
}
}
nxsem_post(&g_clients_sem);
}
return 0;
}
/****************************************************************************
* Name: factory_ioctl
****************************************************************************/
static int factory_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
int ret = OK;
switch (cmd)
{
/* Command: SIOCTELNET
* Description: Create a Telnet sessions.
* Argument: A pointer to a write-able instance of struct
* telnet_session_s.
* Dependencies: CONFIG_NETDEV_TELNET
*/
case SIOCTELNET:
{
FAR struct telnet_session_s *session =
(FAR struct telnet_session_s *)((uintptr_t)arg);
if (session == NULL)
{
ret = -EINVAL;
}
else
{
ret = telnet_session(session);
}
}
break;
default:
ret = -ENOTTY;
break;
}
return ret;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: telnet_initialize
*
* Description:
* Create the Telnet factory at /dev/telnet.
*
* Input Parameters:
* None
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int telnet_initialize(void)
{
return register_driver("/dev/telnet", &g_factory_fops, 0666, NULL);
}
#endif /* CONFIG_NETDEV_TELNET */
|
889107.c | /* $NetBSD: byteorder.c,v 1.3 2007/11/24 13:20:54 isaki Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
* All rights reserved.
*
* Written by Jason R. Thorpe for Wasabi Systems, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed for the NetBSD Project by
* Wasabi Systems, Inc.
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "byteorder.h"
typedef union {
uint16_t val;
uint8_t bytes[2];
} un16;
typedef union {
uint32_t val;
uint8_t bytes[4];
} un32;
typedef union {
uint64_t val;
uint32_t words[2];
} un64;
/* 16-bit */
uint16_t
sa_htobe16(uint16_t val)
{
un16 un;
un.bytes[1] = val & 0xff;
un.bytes[0] = (val >> 8) & 0xff;
return un.val;
}
uint16_t
sa_htole16(uint16_t val)
{
un16 un;
un.bytes[0] = val & 0xff;
un.bytes[1] = (val >> 8) & 0xff;
return un.val;
}
uint16_t
sa_be16toh(uint16_t val)
{
un16 un;
un.val = val;
return ((un.bytes[0] << 8) |
un.bytes[1]);
}
uint16_t
sa_le16toh(uint16_t val)
{
un16 un;
un.val = val;
return ((un.bytes[1] << 8) |
un.bytes[0]);
}
/* 32-bit */
uint32_t
sa_htobe32(uint32_t val)
{
un32 un;
un.bytes[3] = val & 0xff;
un.bytes[2] = (val >> 8) & 0xff;
un.bytes[1] = (val >> 16) & 0xff;
un.bytes[0] = (val >> 24) & 0xff;
return un.val;
}
uint32_t
sa_htole32(uint32_t val)
{
un32 un;
un.bytes[0] = val & 0xff;
un.bytes[1] = (val >> 8) & 0xff;
un.bytes[2] = (val >> 16) & 0xff;
un.bytes[3] = (val >> 24) & 0xff;
return un.val;
}
uint32_t
sa_be32toh(uint32_t val)
{
un32 un;
un.val = val;
return ((un.bytes[0] << 24) |
(un.bytes[1] << 16) |
(un.bytes[2] << 8) |
un.bytes[3]);
}
uint32_t
sa_le32toh(uint32_t val)
{
un32 un;
un.val = val;
return ((un.bytes[3] << 24) |
(un.bytes[2] << 16) |
(un.bytes[1] << 8) |
un.bytes[0]);
}
/* 64-bit */
uint64_t
sa_htobe64(uint64_t val)
{
un64 un;
un.words[BE64_HI] = sa_htobe32(val >> 32);
un.words[BE64_LO] = sa_htobe32(val & 0xffffffffU);
return un.val;
}
uint64_t
sa_htole64(uint64_t val)
{
un64 un;
un.words[LE64_HI] = sa_htole32(val >> 32);
un.words[LE64_LO] = sa_htole32(val & 0xffffffffU);
return un.val;
}
uint64_t
sa_be64toh(uint64_t val)
{
un64 un;
uint64_t rv;
un.val = val;
un.words[BE64_HI] = sa_be32toh(un.words[BE64_HI]);
un.words[BE64_LO] = sa_be32toh(un.words[BE64_LO]);
rv = (((uint64_t)un.words[BE64_HI]) << 32) |
un.words[BE64_LO];
return rv;
}
uint64_t
sa_le64toh(uint64_t val)
{
un64 un;
uint64_t rv;
un.val = val;
un.words[LE64_HI] = sa_le32toh(un.words[LE64_HI]);
un.words[LE64_LO] = sa_le32toh(un.words[LE64_LO]);
rv = (((uint64_t)un.words[LE64_HI]) << 32) |
un.words[LE64_LO];
return rv;
}
|
826945.c | /* $OpenBSD: inet_addr.c,v 1.9 2005/08/06 20:30:03 espie Exp $ */
/*
* ++Copyright++ 1983, 1990, 1993
* -
* Copyright (c) 1983, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
* -
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
* -
* --Copyright--
*/
#include <sys/types.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
/*
* Check whether "cp" is a valid ascii representation
* of an Internet address and convert to a binary address.
* Returns 1 if the address is valid, 0 if not.
* This replaces inet_addr, the return value from which
* cannot distinguish between failure and a local broadcast address.
*/
int
inet_aton(const char *cp, struct in_addr *addr)
{
in_addr_t val;
int base, n;
char c;
u_int parts[4];
u_int *pp = parts;
c = *cp;
for (;;) {
/*
* Collect number up to ``.''.
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
if (!isdigit(c))
return (0);
val = 0; base = 10;
if (c == '0') {
c = *++cp;
if (c == 'x' || c == 'X')
base = 16, c = *++cp;
else
base = 8;
}
for (;;) {
if (isascii(c) && isdigit(c)) {
val = (val * base) + (c - '0');
c = *++cp;
} else if (base == 16 && isascii(c) && isxdigit(c)) {
val = (val << 4) |
(c + 10 - (islower(c) ? 'a' : 'A'));
c = *++cp;
} else
break;
}
if (c == '.') {
/*
* Internet format:
* a.b.c.d
* a.b.c (with c treated as 16 bits)
* a.b (with b treated as 24 bits)
*/
if (pp >= parts + 3)
return (0);
*pp++ = val;
c = *++cp;
} else
break;
}
/*
* Check for trailing characters.
*/
if (c != '\0' && (!isascii(c) || !isspace(c)))
return (0);
/*
* Concoct the address according to
* the number of parts specified.
*/
n = pp - parts + 1;
switch (n) {
case 0:
return (0); /* initial nondigit */
case 1: /* a -- 32 bits */
break;
case 2: /* a.b -- 8.24 bits */
if ((val > 0xffffff) || (parts[0] > 0xff))
return (0);
val |= parts[0] << 24;
break;
case 3: /* a.b.c -- 8.8.16 bits */
if ((val > 0xffff) || (parts[0] > 0xff) || (parts[1] > 0xff))
return (0);
val |= (parts[0] << 24) | (parts[1] << 16);
break;
case 4: /* a.b.c.d -- 8.8.8.8 bits */
if ((val > 0xff) || (parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff))
return (0);
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
break;
}
if (addr)
addr->s_addr = htonl(val);
return (1);
}
|
213274.c | // RUN: clang-cc -emit-llvm %s -o %t
// <rdar://problem/6827047>
void f(void* arg);
void g() {
__attribute__((cleanup(f))) void *g;
}
|
234532.c | /* ----------------------------------------------------------------------
* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
*
* $Date: 17. January 2013
* $Revision: V1.4.0
*
* Project: CMSIS DSP Library
* Title: arm_fft_bin_example_f32.c
*
* Description: Example code demonstrating calculation of Max energy bin of
* frequency domain of input signal.
*
* Target Processor: Cortex-M4/Cortex-M3
*
* 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 ARM LIMITED 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.
* -------------------------------------------------------------------- */
/**
* @ingroup groupExamples
*/
/**
* @defgroup FrequencyBin Frequency Bin Example
*
* \par Description
* \par
* Demonstrates the calculation of the maximum energy bin in the frequency
* domain of the input signal with the use of Complex FFT, Complex
* Magnitude, and Maximum functions.
*
* \par Algorithm:
* \par
* The input test signal contains a 10 kHz signal with uniformly distributed white noise.
* Calculating the FFT of the input signal will give us the maximum energy of the
* bin corresponding to the input frequency of 10 kHz.
*
* \par Block Diagram:
* \image html FFTBin.gif "Block Diagram"
* \par
* The figure below shows the time domain signal of 10 kHz signal with
* uniformly distributed white noise, and the next figure shows the input
* in the frequency domain. The bin with maximum energy corresponds to 10 kHz signal.
* \par
* \image html FFTBinInput.gif "Input signal in Time domain"
* \image html FFTBinOutput.gif "Input signal in Frequency domain"
*
* \par Variables Description:
* \par
* \li \c testInput_f32_10khz points to the input data
* \li \c testOutput points to the output data
* \li \c fftSize length of FFT
* \li \c ifftFlag flag for the selection of CFFT/CIFFT
* \li \c doBitReverse Flag for selection of normal order or bit reversed order
* \li \c refIndex reference index value at which maximum energy of bin ocuurs
* \li \c testIndex calculated index value at which maximum energy of bin ocuurs
*
* \par CMSIS DSP Software Library Functions Used:
* \par
* - arm_cfft_f32()
* - arm_cmplx_mag_f32()
* - arm_max_f32()
*
* <b> Refer </b>
* \link arm_fft_bin_example_f32.c \endlink
*
*/
/** \example arm_fft_bin_example_f32.c
*/
#include "arm_math.h"
#include "arm_const_structs.h"
#define TEST_LENGTH_SAMPLES 2048
/* -------------------------------------------------------------------
* External Input and Output buffer Declarations for FFT Bin Example
* ------------------------------------------------------------------- */
extern float32_t testInput_f32_10khz[TEST_LENGTH_SAMPLES];
static float32_t testOutput[TEST_LENGTH_SAMPLES/2];
/* ------------------------------------------------------------------
* Global variables for FFT Bin Example
* ------------------------------------------------------------------- */
uint32_t fftSize = 1024;
uint32_t ifftFlag = 0;
uint32_t doBitReverse = 1;
/* Reference index at which max energy of bin ocuurs */
uint32_t refIndex = 213, testIndex = 0;
/* ----------------------------------------------------------------------
* Max magnitude FFT Bin test
* ------------------------------------------------------------------- */
int32_t main(void)
{
arm_status status;
float32_t maxValue;
status = ARM_MATH_SUCCESS;
/* Process the data through the CFFT/CIFFT module */
arm_cfft_f32(&arm_cfft_sR_f32_len1024, testInput_f32_10khz, ifftFlag, doBitReverse);
/* Process the data through the Complex Magnitude Module for
calculating the magnitude at each bin */
arm_cmplx_mag_f32(testInput_f32_10khz, testOutput, fftSize);
/* Calculates maxValue and returns corresponding BIN value */
arm_max_f32(testOutput, fftSize, &maxValue, &testIndex);
if (testIndex != refIndex)
{
status = ARM_MATH_TEST_FAILURE;
}
/* ----------------------------------------------------------------------
** Loop here if the signals fail the PASS check.
** This denotes a test failure
** ------------------------------------------------------------------- */
if ( status != ARM_MATH_SUCCESS)
{
while (1);
}
while (1); /* main function does not return */
}
/** \endlink */
|
980172.c | /*x
* Copyright (c) 2015, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/clk-provider.h>
#include <linux/regmap.h>
#include <linux/reset-controller.h>
#include <linux/clk.h>
#include <dt-bindings/clock/qcom,mmcc-msm8996.h>
#include "common.h"
#include "clk-regmap.h"
#include "clk-regmap-divider.h"
#include "clk-alpha-pll.h"
#include "clk-rcg.h"
#include "clk-branch.h"
#include "reset.h"
#include "gdsc.h"
#define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
enum {
P_XO,
P_MMPLL0,
P_GPLL0,
P_GPLL0_DIV,
P_MMPLL1,
P_MMPLL9,
P_MMPLL2,
P_MMPLL8,
P_MMPLL3,
P_DSI0PLL,
P_DSI1PLL,
P_MMPLL5,
P_HDMIPLL,
P_DSI0PLL_BYTE,
P_DSI1PLL_BYTE,
P_MMPLL4,
};
static const struct parent_map mmss_xo_hdmi_map[] = {
{ P_XO, 0 },
{ P_HDMIPLL, 1 }
};
static const char * const mmss_xo_hdmi[] = {
"xo",
"hdmipll"
};
static const struct parent_map mmss_xo_dsi0pll_dsi1pll_map[] = {
{ P_XO, 0 },
{ P_DSI0PLL, 1 },
{ P_DSI1PLL, 2 }
};
static const char * const mmss_xo_dsi0pll_dsi1pll[] = {
"xo",
"dsi0pll",
"dsi1pll"
};
static const struct parent_map mmss_xo_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_gpll0_gpll0_div[] = {
"xo",
"gpll0",
"gpll0_div"
};
static const struct parent_map mmss_xo_dsibyte_map[] = {
{ P_XO, 0 },
{ P_DSI0PLL_BYTE, 1 },
{ P_DSI1PLL_BYTE, 2 }
};
static const char * const mmss_xo_dsibyte[] = {
"xo",
"dsi0pllbyte",
"dsi1pllbyte"
};
static const struct parent_map mmss_xo_mmpll0_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_mmpll0_gpll0_gpll0_div[] = {
"xo",
"mmpll0",
"gpll0",
"gpll0_div"
};
static const struct parent_map mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_MMPLL1, 2 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div[] = {
"xo",
"mmpll0",
"mmpll1",
"gpll0",
"gpll0_div"
};
static const struct parent_map mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_MMPLL3, 3 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div[] = {
"xo",
"mmpll0",
"mmpll3",
"gpll0",
"gpll0_div"
};
static const struct parent_map mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_MMPLL5, 2 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div[] = {
"xo",
"mmpll0",
"mmpll5",
"gpll0",
"gpll0_div"
};
static const struct parent_map mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_MMPLL4, 3 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div[] = {
"xo",
"mmpll0",
"mmpll4",
"gpll0",
"gpll0_div"
};
static const struct parent_map mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_MMPLL9, 2 },
{ P_MMPLL2, 3 },
{ P_MMPLL8, 4 },
{ P_GPLL0, 5 }
};
static const char * const mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0[] = {
"xo",
"mmpll0",
"mmpll9",
"mmpll2",
"mmpll8",
"gpll0"
};
static const struct parent_map mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_MMPLL9, 2 },
{ P_MMPLL2, 3 },
{ P_MMPLL8, 4 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div[] = {
"xo",
"mmpll0",
"mmpll9",
"mmpll2",
"mmpll8",
"gpll0",
"gpll0_div"
};
static const struct parent_map mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map[] = {
{ P_XO, 0 },
{ P_MMPLL0, 1 },
{ P_MMPLL1, 2 },
{ P_MMPLL4, 3 },
{ P_MMPLL3, 4 },
{ P_GPLL0, 5 },
{ P_GPLL0_DIV, 6 }
};
static const char * const mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div[] = {
"xo",
"mmpll0",
"mmpll1",
"mmpll4",
"mmpll3",
"gpll0",
"gpll0_div"
};
static struct clk_fixed_factor gpll0_div = {
.mult = 1,
.div = 2,
.hw.init = &(struct clk_init_data){
.name = "gpll0_div",
.parent_names = (const char *[]){ "gpll0" },
.num_parents = 1,
.ops = &clk_fixed_factor_ops,
},
};
static struct pll_vco mmpll_p_vco[] = {
{ 250000000, 500000000, 3 },
{ 500000000, 1000000000, 2 },
{ 1000000000, 1500000000, 1 },
{ 1500000000, 2000000000, 0 },
};
static struct pll_vco mmpll_gfx_vco[] = {
{ 400000000, 1000000000, 2 },
{ 1000000000, 1500000000, 1 },
{ 1500000000, 2000000000, 0 },
};
static struct pll_vco mmpll_t_vco[] = {
{ 500000000, 1500000000, 0 },
};
static struct clk_alpha_pll mmpll0_early = {
.offset = 0x0,
.vco_table = mmpll_p_vco,
.num_vco = ARRAY_SIZE(mmpll_p_vco),
.clkr = {
.enable_reg = 0x100,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmpll0_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
},
},
};
static struct clk_alpha_pll_postdiv mmpll0 = {
.offset = 0x0,
.width = 4,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll0",
.parent_names = (const char *[]){ "mmpll0_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_alpha_pll mmpll1_early = {
.offset = 0x30,
.vco_table = mmpll_p_vco,
.num_vco = ARRAY_SIZE(mmpll_p_vco),
.clkr = {
.enable_reg = 0x100,
.enable_mask = BIT(1),
.hw.init = &(struct clk_init_data){
.name = "mmpll1_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
}
},
};
static struct clk_alpha_pll_postdiv mmpll1 = {
.offset = 0x30,
.width = 4,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll1",
.parent_names = (const char *[]){ "mmpll1_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_alpha_pll mmpll2_early = {
.offset = 0x4100,
.vco_table = mmpll_gfx_vco,
.num_vco = ARRAY_SIZE(mmpll_gfx_vco),
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll2_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
},
};
static struct clk_alpha_pll_postdiv mmpll2 = {
.offset = 0x4100,
.width = 4,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll2",
.parent_names = (const char *[]){ "mmpll2_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_alpha_pll mmpll3_early = {
.offset = 0x60,
.vco_table = mmpll_p_vco,
.num_vco = ARRAY_SIZE(mmpll_p_vco),
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll3_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
},
};
static struct clk_alpha_pll_postdiv mmpll3 = {
.offset = 0x60,
.width = 4,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll3",
.parent_names = (const char *[]){ "mmpll3_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_alpha_pll mmpll4_early = {
.offset = 0x90,
.vco_table = mmpll_t_vco,
.num_vco = ARRAY_SIZE(mmpll_t_vco),
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll4_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
},
};
static struct clk_alpha_pll_postdiv mmpll4 = {
.offset = 0x90,
.width = 2,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll4",
.parent_names = (const char *[]){ "mmpll4_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_alpha_pll mmpll5_early = {
.offset = 0xc0,
.vco_table = mmpll_p_vco,
.num_vco = ARRAY_SIZE(mmpll_p_vco),
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll5_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
},
};
static struct clk_alpha_pll_postdiv mmpll5 = {
.offset = 0xc0,
.width = 4,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll5",
.parent_names = (const char *[]){ "mmpll5_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_alpha_pll mmpll8_early = {
.offset = 0x4130,
.vco_table = mmpll_gfx_vco,
.num_vco = ARRAY_SIZE(mmpll_gfx_vco),
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll8_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
},
};
static struct clk_alpha_pll_postdiv mmpll8 = {
.offset = 0x4130,
.width = 4,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll8",
.parent_names = (const char *[]){ "mmpll8_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_alpha_pll mmpll9_early = {
.offset = 0x4200,
.vco_table = mmpll_t_vco,
.num_vco = ARRAY_SIZE(mmpll_t_vco),
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll9_early",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
},
};
static struct clk_alpha_pll_postdiv mmpll9 = {
.offset = 0x4200,
.width = 2,
.clkr.hw.init = &(struct clk_init_data){
.name = "mmpll9",
.parent_names = (const char *[]){ "mmpll9_early" },
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static const struct freq_tbl ftbl_ahb_clk_src[] = {
F(19200000, P_XO, 1, 0, 0),
F(40000000, P_GPLL0_DIV, 7.5, 0, 0),
F(80000000, P_MMPLL0, 10, 0, 0),
{ }
};
static struct clk_rcg2 ahb_clk_src = {
.cmd_rcgr = 0x5000,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_gpll0_gpll0_div_map,
.freq_tbl = ftbl_ahb_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "ahb_clk_src",
.parent_names = mmss_xo_mmpll0_gpll0_gpll0_div,
.num_parents = 4,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_axi_clk_src[] = {
F(19200000, P_XO, 1, 0, 0),
F(75000000, P_GPLL0_DIV, 4, 0, 0),
F(100000000, P_GPLL0, 6, 0, 0),
F(171430000, P_GPLL0, 3.5, 0, 0),
F(200000000, P_GPLL0, 3, 0, 0),
F(320000000, P_MMPLL0, 2.5, 0, 0),
F(400000000, P_MMPLL0, 2, 0, 0),
{ }
};
static struct clk_rcg2 axi_clk_src = {
.cmd_rcgr = 0x5040,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div_map,
.freq_tbl = ftbl_axi_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "axi_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 maxi_clk_src = {
.cmd_rcgr = 0x5090,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div_map,
.freq_tbl = ftbl_axi_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "maxi_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 gfx3d_clk_src = {
.cmd_rcgr = 0x4000,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_map,
.clkr.hw.init = &(struct clk_init_data){
.name = "gfx3d_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0,
.num_parents = 6,
.ops = &clk_gfx3d_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static const struct freq_tbl ftbl_rbbmtimer_clk_src[] = {
F(19200000, P_XO, 1, 0, 0),
{ }
};
static struct clk_rcg2 rbbmtimer_clk_src = {
.cmd_rcgr = 0x4090,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_gpll0_gpll0_div_map,
.freq_tbl = ftbl_rbbmtimer_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "rbbmtimer_clk_src",
.parent_names = mmss_xo_mmpll0_gpll0_gpll0_div,
.num_parents = 4,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 isense_clk_src = {
.cmd_rcgr = 0x4010,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div_map,
.clkr.hw.init = &(struct clk_init_data){
.name = "isense_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_rbcpr_clk_src[] = {
F(19200000, P_XO, 1, 0, 0),
F(50000000, P_GPLL0, 12, 0, 0),
{ }
};
static struct clk_rcg2 rbcpr_clk_src = {
.cmd_rcgr = 0x4060,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_gpll0_gpll0_div_map,
.freq_tbl = ftbl_rbcpr_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "rbcpr_clk_src",
.parent_names = mmss_xo_mmpll0_gpll0_gpll0_div,
.num_parents = 4,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_video_core_clk_src[] = {
F(75000000, P_GPLL0_DIV, 4, 0, 0),
F(150000000, P_GPLL0, 4, 0, 0),
F(346666667, P_MMPLL3, 3, 0, 0),
F(520000000, P_MMPLL3, 2, 0, 0),
{ }
};
static struct clk_rcg2 video_core_clk_src = {
.cmd_rcgr = 0x1000,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_video_core_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "video_core_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 video_subcore0_clk_src = {
.cmd_rcgr = 0x1060,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_video_core_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "video_subcore0_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 video_subcore1_clk_src = {
.cmd_rcgr = 0x1080,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_video_core_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "video_subcore1_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 pclk0_clk_src = {
.cmd_rcgr = 0x2000,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_dsi0pll_dsi1pll_map,
.clkr.hw.init = &(struct clk_init_data){
.name = "pclk0_clk_src",
.parent_names = mmss_xo_dsi0pll_dsi1pll,
.num_parents = 3,
.ops = &clk_pixel_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_rcg2 pclk1_clk_src = {
.cmd_rcgr = 0x2020,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_dsi0pll_dsi1pll_map,
.clkr.hw.init = &(struct clk_init_data){
.name = "pclk1_clk_src",
.parent_names = mmss_xo_dsi0pll_dsi1pll,
.num_parents = 3,
.ops = &clk_pixel_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static const struct freq_tbl ftbl_mdp_clk_src[] = {
F(85714286, P_GPLL0, 7, 0, 0),
F(100000000, P_GPLL0, 6, 0, 0),
F(150000000, P_GPLL0, 4, 0, 0),
F(171428571, P_GPLL0, 3.5, 0, 0),
F(200000000, P_GPLL0, 3, 0, 0),
F(275000000, P_MMPLL5, 3, 0, 0),
F(300000000, P_GPLL0, 2, 0, 0),
F(330000000, P_MMPLL5, 2.5, 0, 0),
F(412500000, P_MMPLL5, 2, 0, 0),
{ }
};
static struct clk_rcg2 mdp_clk_src = {
.cmd_rcgr = 0x2040,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div_map,
.freq_tbl = ftbl_mdp_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "mdp_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct freq_tbl extpclk_freq_tbl[] = {
{ .src = P_HDMIPLL },
{ }
};
static struct clk_rcg2 extpclk_clk_src = {
.cmd_rcgr = 0x2060,
.hid_width = 5,
.parent_map = mmss_xo_hdmi_map,
.freq_tbl = extpclk_freq_tbl,
.clkr.hw.init = &(struct clk_init_data){
.name = "extpclk_clk_src",
.parent_names = mmss_xo_hdmi,
.num_parents = 2,
.ops = &clk_byte_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct freq_tbl ftbl_mdss_vsync_clk[] = {
F(19200000, P_XO, 1, 0, 0),
{ }
};
static struct clk_rcg2 vsync_clk_src = {
.cmd_rcgr = 0x2080,
.hid_width = 5,
.parent_map = mmss_xo_gpll0_gpll0_div_map,
.freq_tbl = ftbl_mdss_vsync_clk,
.clkr.hw.init = &(struct clk_init_data){
.name = "vsync_clk_src",
.parent_names = mmss_xo_gpll0_gpll0_div,
.num_parents = 3,
.ops = &clk_rcg2_ops,
},
};
static struct freq_tbl ftbl_mdss_hdmi_clk[] = {
F(19200000, P_XO, 1, 0, 0),
{ }
};
static struct clk_rcg2 hdmi_clk_src = {
.cmd_rcgr = 0x2100,
.hid_width = 5,
.parent_map = mmss_xo_gpll0_gpll0_div_map,
.freq_tbl = ftbl_mdss_hdmi_clk,
.clkr.hw.init = &(struct clk_init_data){
.name = "hdmi_clk_src",
.parent_names = mmss_xo_gpll0_gpll0_div,
.num_parents = 3,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 byte0_clk_src = {
.cmd_rcgr = 0x2120,
.hid_width = 5,
.parent_map = mmss_xo_dsibyte_map,
.clkr.hw.init = &(struct clk_init_data){
.name = "byte0_clk_src",
.parent_names = mmss_xo_dsibyte,
.num_parents = 3,
.ops = &clk_byte2_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct clk_rcg2 byte1_clk_src = {
.cmd_rcgr = 0x2140,
.hid_width = 5,
.parent_map = mmss_xo_dsibyte_map,
.clkr.hw.init = &(struct clk_init_data){
.name = "byte1_clk_src",
.parent_names = mmss_xo_dsibyte,
.num_parents = 3,
.ops = &clk_byte2_ops,
.flags = CLK_SET_RATE_PARENT,
},
};
static struct freq_tbl ftbl_mdss_esc0_1_clk[] = {
F(19200000, P_XO, 1, 0, 0),
{ }
};
static struct clk_rcg2 esc0_clk_src = {
.cmd_rcgr = 0x2160,
.hid_width = 5,
.parent_map = mmss_xo_dsibyte_map,
.freq_tbl = ftbl_mdss_esc0_1_clk,
.clkr.hw.init = &(struct clk_init_data){
.name = "esc0_clk_src",
.parent_names = mmss_xo_dsibyte,
.num_parents = 3,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 esc1_clk_src = {
.cmd_rcgr = 0x2180,
.hid_width = 5,
.parent_map = mmss_xo_dsibyte_map,
.freq_tbl = ftbl_mdss_esc0_1_clk,
.clkr.hw.init = &(struct clk_init_data){
.name = "esc1_clk_src",
.parent_names = mmss_xo_dsibyte,
.num_parents = 3,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_camss_gp0_clk_src[] = {
F(10000, P_XO, 16, 1, 120),
F(24000, P_XO, 16, 1, 50),
F(6000000, P_GPLL0_DIV, 10, 1, 5),
F(12000000, P_GPLL0_DIV, 1, 1, 25),
F(13000000, P_GPLL0_DIV, 2, 13, 150),
F(24000000, P_GPLL0_DIV, 1, 2, 25),
{ }
};
static struct clk_rcg2 camss_gp0_clk_src = {
.cmd_rcgr = 0x3420,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_camss_gp0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "camss_gp0_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 camss_gp1_clk_src = {
.cmd_rcgr = 0x3450,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_camss_gp0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "camss_gp1_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_mclk0_clk_src[] = {
F(4800000, P_XO, 4, 0, 0),
F(6000000, P_GPLL0_DIV, 10, 1, 5),
F(8000000, P_GPLL0_DIV, 1, 2, 75),
F(9600000, P_XO, 2, 0, 0),
F(16666667, P_GPLL0_DIV, 2, 1, 9),
F(19200000, P_XO, 1, 0, 0),
F(24000000, P_GPLL0_DIV, 1, 2, 25),
F(33333333, P_GPLL0_DIV, 1, 1, 9),
F(48000000, P_GPLL0, 1, 2, 25),
F(66666667, P_GPLL0, 1, 1, 9),
{ }
};
static struct clk_rcg2 mclk0_clk_src = {
.cmd_rcgr = 0x3360,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_mclk0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "mclk0_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 mclk1_clk_src = {
.cmd_rcgr = 0x3390,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_mclk0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "mclk1_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 mclk2_clk_src = {
.cmd_rcgr = 0x33c0,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_mclk0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "mclk2_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 mclk3_clk_src = {
.cmd_rcgr = 0x33f0,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_mclk0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "mclk3_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_cci_clk_src[] = {
F(19200000, P_XO, 1, 0, 0),
F(37500000, P_GPLL0, 16, 0, 0),
F(50000000, P_GPLL0, 12, 0, 0),
F(100000000, P_GPLL0, 6, 0, 0),
{ }
};
static struct clk_rcg2 cci_clk_src = {
.cmd_rcgr = 0x3300,
.mnd_width = 8,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_cci_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "cci_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_csi0phytimer_clk_src[] = {
F(100000000, P_GPLL0_DIV, 3, 0, 0),
F(200000000, P_GPLL0, 3, 0, 0),
F(266666667, P_MMPLL0, 3, 0, 0),
{ }
};
static struct clk_rcg2 csi0phytimer_clk_src = {
.cmd_rcgr = 0x3000,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csi0phytimer_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csi0phytimer_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 csi1phytimer_clk_src = {
.cmd_rcgr = 0x3030,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csi0phytimer_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csi1phytimer_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 csi2phytimer_clk_src = {
.cmd_rcgr = 0x3060,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csi0phytimer_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csi2phytimer_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_csiphy0_3p_clk_src[] = {
F(100000000, P_GPLL0_DIV, 3, 0, 0),
F(200000000, P_GPLL0, 3, 0, 0),
F(320000000, P_MMPLL4, 3, 0, 0),
F(384000000, P_MMPLL4, 2.5, 0, 0),
{ }
};
static struct clk_rcg2 csiphy0_3p_clk_src = {
.cmd_rcgr = 0x3240,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csiphy0_3p_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csiphy0_3p_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 csiphy1_3p_clk_src = {
.cmd_rcgr = 0x3260,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csiphy0_3p_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csiphy1_3p_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 csiphy2_3p_clk_src = {
.cmd_rcgr = 0x3280,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csiphy0_3p_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csiphy2_3p_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_jpeg0_clk_src[] = {
F(75000000, P_GPLL0_DIV, 4, 0, 0),
F(150000000, P_GPLL0, 4, 0, 0),
F(228571429, P_MMPLL0, 3.5, 0, 0),
F(266666667, P_MMPLL0, 3, 0, 0),
F(320000000, P_MMPLL0, 2.5, 0, 0),
F(480000000, P_MMPLL4, 2, 0, 0),
{ }
};
static struct clk_rcg2 jpeg0_clk_src = {
.cmd_rcgr = 0x3500,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_jpeg0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "jpeg0_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_jpeg2_clk_src[] = {
F(75000000, P_GPLL0_DIV, 4, 0, 0),
F(150000000, P_GPLL0, 4, 0, 0),
F(228571429, P_MMPLL0, 3.5, 0, 0),
F(266666667, P_MMPLL0, 3, 0, 0),
F(320000000, P_MMPLL0, 2.5, 0, 0),
{ }
};
static struct clk_rcg2 jpeg2_clk_src = {
.cmd_rcgr = 0x3540,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_jpeg2_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "jpeg2_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 jpeg_dma_clk_src = {
.cmd_rcgr = 0x3560,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_jpeg0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "jpeg_dma_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_vfe0_clk_src[] = {
F(75000000, P_GPLL0_DIV, 4, 0, 0),
F(100000000, P_GPLL0_DIV, 3, 0, 0),
F(300000000, P_GPLL0, 2, 0, 0),
F(320000000, P_MMPLL0, 2.5, 0, 0),
F(480000000, P_MMPLL4, 2, 0, 0),
F(600000000, P_GPLL0, 1, 0, 0),
{ }
};
static struct clk_rcg2 vfe0_clk_src = {
.cmd_rcgr = 0x3600,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_vfe0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "vfe0_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 vfe1_clk_src = {
.cmd_rcgr = 0x3620,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_vfe0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "vfe1_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_cpp_clk_src[] = {
F(100000000, P_GPLL0_DIV, 3, 0, 0),
F(200000000, P_GPLL0, 3, 0, 0),
F(320000000, P_MMPLL0, 2.5, 0, 0),
F(480000000, P_MMPLL4, 2, 0, 0),
F(640000000, P_MMPLL4, 1.5, 0, 0),
{ }
};
static struct clk_rcg2 cpp_clk_src = {
.cmd_rcgr = 0x3640,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_cpp_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "cpp_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_csi0_clk_src[] = {
F(100000000, P_GPLL0_DIV, 3, 0, 0),
F(200000000, P_GPLL0, 3, 0, 0),
F(266666667, P_MMPLL0, 3, 0, 0),
F(480000000, P_MMPLL4, 2, 0, 0),
F(600000000, P_GPLL0, 1, 0, 0),
{ }
};
static struct clk_rcg2 csi0_clk_src = {
.cmd_rcgr = 0x3090,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csi0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csi0_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 csi1_clk_src = {
.cmd_rcgr = 0x3100,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csi0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csi1_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 csi2_clk_src = {
.cmd_rcgr = 0x3160,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csi0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csi2_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static struct clk_rcg2 csi3_clk_src = {
.cmd_rcgr = 0x31c0,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map,
.freq_tbl = ftbl_csi0_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "csi3_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div,
.num_parents = 7,
.ops = &clk_rcg2_ops,
},
};
static const struct freq_tbl ftbl_fd_core_clk_src[] = {
F(100000000, P_GPLL0_DIV, 3, 0, 0),
F(200000000, P_GPLL0, 3, 0, 0),
F(400000000, P_MMPLL0, 2, 0, 0),
{ }
};
static struct clk_rcg2 fd_core_clk_src = {
.cmd_rcgr = 0x3b00,
.hid_width = 5,
.parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map,
.freq_tbl = ftbl_fd_core_clk_src,
.clkr.hw.init = &(struct clk_init_data){
.name = "fd_core_clk_src",
.parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div,
.num_parents = 5,
.ops = &clk_rcg2_ops,
},
};
static struct clk_branch mmss_mmagic_ahb_clk = {
.halt_reg = 0x5024,
.clkr = {
.enable_reg = 0x5024,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmss_mmagic_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmss_mmagic_cfg_ahb_clk = {
.halt_reg = 0x5054,
.clkr = {
.enable_reg = 0x5054,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmss_mmagic_cfg_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmss_misc_ahb_clk = {
.halt_reg = 0x5018,
.clkr = {
.enable_reg = 0x5018,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmss_misc_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmss_misc_cxo_clk = {
.halt_reg = 0x5014,
.clkr = {
.enable_reg = 0x5014,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmss_misc_cxo_clk",
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmss_mmagic_maxi_clk = {
.halt_reg = 0x5074,
.clkr = {
.enable_reg = 0x5074,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmss_mmagic_maxi_clk",
.parent_names = (const char *[]){ "maxi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmagic_camss_axi_clk = {
.halt_reg = 0x3c44,
.clkr = {
.enable_reg = 0x3c44,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmagic_camss_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmagic_camss_noc_cfg_ahb_clk = {
.halt_reg = 0x3c48,
.clkr = {
.enable_reg = 0x3c48,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmagic_camss_noc_cfg_ahb_clk",
.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_vfe_ahb_clk = {
.halt_reg = 0x3c04,
.clkr = {
.enable_reg = 0x3c04,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_vfe_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_vfe_axi_clk = {
.halt_reg = 0x3c08,
.clkr = {
.enable_reg = 0x3c08,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_vfe_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_cpp_ahb_clk = {
.halt_reg = 0x3c14,
.clkr = {
.enable_reg = 0x3c14,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_cpp_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_cpp_axi_clk = {
.halt_reg = 0x3c18,
.clkr = {
.enable_reg = 0x3c18,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_cpp_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_jpeg_ahb_clk = {
.halt_reg = 0x3c24,
.clkr = {
.enable_reg = 0x3c24,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_jpeg_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_jpeg_axi_clk = {
.halt_reg = 0x3c28,
.clkr = {
.enable_reg = 0x3c28,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_jpeg_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmagic_mdss_axi_clk = {
.halt_reg = 0x2474,
.clkr = {
.enable_reg = 0x2474,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmagic_mdss_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmagic_mdss_noc_cfg_ahb_clk = {
.halt_reg = 0x2478,
.clkr = {
.enable_reg = 0x2478,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmagic_mdss_noc_cfg_ahb_clk",
.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_rot_ahb_clk = {
.halt_reg = 0x2444,
.clkr = {
.enable_reg = 0x2444,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_rot_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_rot_axi_clk = {
.halt_reg = 0x2448,
.clkr = {
.enable_reg = 0x2448,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_rot_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_mdp_ahb_clk = {
.halt_reg = 0x2454,
.clkr = {
.enable_reg = 0x2454,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_mdp_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_mdp_axi_clk = {
.halt_reg = 0x2458,
.clkr = {
.enable_reg = 0x2458,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_mdp_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmagic_video_axi_clk = {
.halt_reg = 0x1194,
.clkr = {
.enable_reg = 0x1194,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmagic_video_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmagic_video_noc_cfg_ahb_clk = {
.halt_reg = 0x1198,
.clkr = {
.enable_reg = 0x1198,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmagic_video_noc_cfg_ahb_clk",
.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_video_ahb_clk = {
.halt_reg = 0x1174,
.clkr = {
.enable_reg = 0x1174,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_video_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch smmu_video_axi_clk = {
.halt_reg = 0x1178,
.clkr = {
.enable_reg = 0x1178,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "smmu_video_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmagic_bimc_noc_cfg_ahb_clk = {
.halt_reg = 0x5298,
.clkr = {
.enable_reg = 0x5298,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmagic_bimc_noc_cfg_ahb_clk",
.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_gx_gfx3d_clk = {
.halt_reg = 0x4028,
.clkr = {
.enable_reg = 0x4028,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "gpu_gx_gfx3d_clk",
.parent_names = (const char *[]){ "gfx3d_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_gx_rbbmtimer_clk = {
.halt_reg = 0x40b0,
.clkr = {
.enable_reg = 0x40b0,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "gpu_gx_rbbmtimer_clk",
.parent_names = (const char *[]){ "rbbmtimer_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_ahb_clk = {
.halt_reg = 0x403c,
.clkr = {
.enable_reg = 0x403c,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "gpu_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_aon_isense_clk = {
.halt_reg = 0x4044,
.clkr = {
.enable_reg = 0x4044,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "gpu_aon_isense_clk",
.parent_names = (const char *[]){ "isense_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch vmem_maxi_clk = {
.halt_reg = 0x1204,
.clkr = {
.enable_reg = 0x1204,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "vmem_maxi_clk",
.parent_names = (const char *[]){ "maxi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch vmem_ahb_clk = {
.halt_reg = 0x1208,
.clkr = {
.enable_reg = 0x1208,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "vmem_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmss_rbcpr_clk = {
.halt_reg = 0x4084,
.clkr = {
.enable_reg = 0x4084,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmss_rbcpr_clk",
.parent_names = (const char *[]){ "rbcpr_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mmss_rbcpr_ahb_clk = {
.halt_reg = 0x4088,
.clkr = {
.enable_reg = 0x4088,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mmss_rbcpr_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_core_clk = {
.halt_reg = 0x1028,
.clkr = {
.enable_reg = 0x1028,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "video_core_clk",
.parent_names = (const char *[]){ "video_core_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_axi_clk = {
.halt_reg = 0x1034,
.clkr = {
.enable_reg = 0x1034,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "video_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_maxi_clk = {
.halt_reg = 0x1038,
.clkr = {
.enable_reg = 0x1038,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "video_maxi_clk",
.parent_names = (const char *[]){ "maxi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_ahb_clk = {
.halt_reg = 0x1030,
.clkr = {
.enable_reg = 0x1030,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "video_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_subcore0_clk = {
.halt_reg = 0x1048,
.clkr = {
.enable_reg = 0x1048,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "video_subcore0_clk",
.parent_names = (const char *[]){ "video_subcore0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_subcore1_clk = {
.halt_reg = 0x104c,
.clkr = {
.enable_reg = 0x104c,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "video_subcore1_clk",
.parent_names = (const char *[]){ "video_subcore1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_ahb_clk = {
.halt_reg = 0x2308,
.clkr = {
.enable_reg = 0x2308,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_hdmi_ahb_clk = {
.halt_reg = 0x230c,
.clkr = {
.enable_reg = 0x230c,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_hdmi_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_axi_clk = {
.halt_reg = 0x2310,
.clkr = {
.enable_reg = 0x2310,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_pclk0_clk = {
.halt_reg = 0x2314,
.clkr = {
.enable_reg = 0x2314,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_pclk0_clk",
.parent_names = (const char *[]){ "pclk0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_pclk1_clk = {
.halt_reg = 0x2318,
.clkr = {
.enable_reg = 0x2318,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_pclk1_clk",
.parent_names = (const char *[]){ "pclk1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_mdp_clk = {
.halt_reg = 0x231c,
.clkr = {
.enable_reg = 0x231c,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_mdp_clk",
.parent_names = (const char *[]){ "mdp_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_extpclk_clk = {
.halt_reg = 0x2324,
.clkr = {
.enable_reg = 0x2324,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_extpclk_clk",
.parent_names = (const char *[]){ "extpclk_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_vsync_clk = {
.halt_reg = 0x2328,
.clkr = {
.enable_reg = 0x2328,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_vsync_clk",
.parent_names = (const char *[]){ "vsync_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_hdmi_clk = {
.halt_reg = 0x2338,
.clkr = {
.enable_reg = 0x2338,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_hdmi_clk",
.parent_names = (const char *[]){ "hdmi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_byte0_clk = {
.halt_reg = 0x233c,
.clkr = {
.enable_reg = 0x233c,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_byte0_clk",
.parent_names = (const char *[]){ "byte0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_byte1_clk = {
.halt_reg = 0x2340,
.clkr = {
.enable_reg = 0x2340,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_byte1_clk",
.parent_names = (const char *[]){ "byte1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_esc0_clk = {
.halt_reg = 0x2344,
.clkr = {
.enable_reg = 0x2344,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_esc0_clk",
.parent_names = (const char *[]){ "esc0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch mdss_esc1_clk = {
.halt_reg = 0x2348,
.clkr = {
.enable_reg = 0x2348,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "mdss_esc1_clk",
.parent_names = (const char *[]){ "esc1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_top_ahb_clk = {
.halt_reg = 0x3484,
.clkr = {
.enable_reg = 0x3484,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_top_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_ahb_clk = {
.halt_reg = 0x348c,
.clkr = {
.enable_reg = 0x348c,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_micro_ahb_clk = {
.halt_reg = 0x3494,
.clkr = {
.enable_reg = 0x3494,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_micro_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_gp0_clk = {
.halt_reg = 0x3444,
.clkr = {
.enable_reg = 0x3444,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_gp0_clk",
.parent_names = (const char *[]){ "camss_gp0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_gp1_clk = {
.halt_reg = 0x3474,
.clkr = {
.enable_reg = 0x3474,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_gp1_clk",
.parent_names = (const char *[]){ "camss_gp1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_mclk0_clk = {
.halt_reg = 0x3384,
.clkr = {
.enable_reg = 0x3384,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_mclk0_clk",
.parent_names = (const char *[]){ "mclk0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_mclk1_clk = {
.halt_reg = 0x33b4,
.clkr = {
.enable_reg = 0x33b4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_mclk1_clk",
.parent_names = (const char *[]){ "mclk1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_mclk2_clk = {
.halt_reg = 0x33e4,
.clkr = {
.enable_reg = 0x33e4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_mclk2_clk",
.parent_names = (const char *[]){ "mclk2_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_mclk3_clk = {
.halt_reg = 0x3414,
.clkr = {
.enable_reg = 0x3414,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_mclk3_clk",
.parent_names = (const char *[]){ "mclk3_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_cci_clk = {
.halt_reg = 0x3344,
.clkr = {
.enable_reg = 0x3344,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_cci_clk",
.parent_names = (const char *[]){ "cci_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_cci_ahb_clk = {
.halt_reg = 0x3348,
.clkr = {
.enable_reg = 0x3348,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_cci_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi0phytimer_clk = {
.halt_reg = 0x3024,
.clkr = {
.enable_reg = 0x3024,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi0phytimer_clk",
.parent_names = (const char *[]){ "csi0phytimer_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi1phytimer_clk = {
.halt_reg = 0x3054,
.clkr = {
.enable_reg = 0x3054,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi1phytimer_clk",
.parent_names = (const char *[]){ "csi1phytimer_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi2phytimer_clk = {
.halt_reg = 0x3084,
.clkr = {
.enable_reg = 0x3084,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi2phytimer_clk",
.parent_names = (const char *[]){ "csi2phytimer_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csiphy0_3p_clk = {
.halt_reg = 0x3234,
.clkr = {
.enable_reg = 0x3234,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csiphy0_3p_clk",
.parent_names = (const char *[]){ "csiphy0_3p_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csiphy1_3p_clk = {
.halt_reg = 0x3254,
.clkr = {
.enable_reg = 0x3254,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csiphy1_3p_clk",
.parent_names = (const char *[]){ "csiphy1_3p_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csiphy2_3p_clk = {
.halt_reg = 0x3274,
.clkr = {
.enable_reg = 0x3274,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csiphy2_3p_clk",
.parent_names = (const char *[]){ "csiphy2_3p_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_jpeg0_clk = {
.halt_reg = 0x35a8,
.clkr = {
.enable_reg = 0x35a8,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_jpeg0_clk",
.parent_names = (const char *[]){ "jpeg0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_jpeg2_clk = {
.halt_reg = 0x35b0,
.clkr = {
.enable_reg = 0x35b0,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_jpeg2_clk",
.parent_names = (const char *[]){ "jpeg2_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_jpeg_dma_clk = {
.halt_reg = 0x35c0,
.clkr = {
.enable_reg = 0x35c0,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_jpeg_dma_clk",
.parent_names = (const char *[]){ "jpeg_dma_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_jpeg_ahb_clk = {
.halt_reg = 0x35b4,
.clkr = {
.enable_reg = 0x35b4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_jpeg_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_jpeg_axi_clk = {
.halt_reg = 0x35b8,
.clkr = {
.enable_reg = 0x35b8,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_jpeg_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe_ahb_clk = {
.halt_reg = 0x36b8,
.clkr = {
.enable_reg = 0x36b8,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe_axi_clk = {
.halt_reg = 0x36bc,
.clkr = {
.enable_reg = 0x36bc,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe0_clk = {
.halt_reg = 0x36a8,
.clkr = {
.enable_reg = 0x36a8,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe0_clk",
.parent_names = (const char *[]){ "vfe0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe0_stream_clk = {
.halt_reg = 0x3720,
.clkr = {
.enable_reg = 0x3720,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe0_stream_clk",
.parent_names = (const char *[]){ "vfe0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe0_ahb_clk = {
.halt_reg = 0x3668,
.clkr = {
.enable_reg = 0x3668,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe0_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe1_clk = {
.halt_reg = 0x36ac,
.clkr = {
.enable_reg = 0x36ac,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe1_clk",
.parent_names = (const char *[]){ "vfe1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe1_stream_clk = {
.halt_reg = 0x3724,
.clkr = {
.enable_reg = 0x3724,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe1_stream_clk",
.parent_names = (const char *[]){ "vfe1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_vfe1_ahb_clk = {
.halt_reg = 0x3678,
.clkr = {
.enable_reg = 0x3678,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_vfe1_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi_vfe0_clk = {
.halt_reg = 0x3704,
.clkr = {
.enable_reg = 0x3704,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi_vfe0_clk",
.parent_names = (const char *[]){ "vfe0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi_vfe1_clk = {
.halt_reg = 0x3714,
.clkr = {
.enable_reg = 0x3714,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi_vfe1_clk",
.parent_names = (const char *[]){ "vfe1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_cpp_vbif_ahb_clk = {
.halt_reg = 0x36c8,
.clkr = {
.enable_reg = 0x36c8,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_cpp_vbif_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_cpp_axi_clk = {
.halt_reg = 0x36c4,
.clkr = {
.enable_reg = 0x36c4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_cpp_axi_clk",
.parent_names = (const char *[]){ "axi_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_cpp_clk = {
.halt_reg = 0x36b0,
.clkr = {
.enable_reg = 0x36b0,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_cpp_clk",
.parent_names = (const char *[]){ "cpp_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_cpp_ahb_clk = {
.halt_reg = 0x36b4,
.clkr = {
.enable_reg = 0x36b4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_cpp_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi0_clk = {
.halt_reg = 0x30b4,
.clkr = {
.enable_reg = 0x30b4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi0_clk",
.parent_names = (const char *[]){ "csi0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi0_ahb_clk = {
.halt_reg = 0x30bc,
.clkr = {
.enable_reg = 0x30bc,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi0_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi0phy_clk = {
.halt_reg = 0x30c4,
.clkr = {
.enable_reg = 0x30c4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi0phy_clk",
.parent_names = (const char *[]){ "csi0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi0rdi_clk = {
.halt_reg = 0x30d4,
.clkr = {
.enable_reg = 0x30d4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi0rdi_clk",
.parent_names = (const char *[]){ "csi0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi0pix_clk = {
.halt_reg = 0x30e4,
.clkr = {
.enable_reg = 0x30e4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi0pix_clk",
.parent_names = (const char *[]){ "csi0_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi1_clk = {
.halt_reg = 0x3124,
.clkr = {
.enable_reg = 0x3124,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi1_clk",
.parent_names = (const char *[]){ "csi1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi1_ahb_clk = {
.halt_reg = 0x3128,
.clkr = {
.enable_reg = 0x3128,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi1_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi1phy_clk = {
.halt_reg = 0x3134,
.clkr = {
.enable_reg = 0x3134,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi1phy_clk",
.parent_names = (const char *[]){ "csi1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi1rdi_clk = {
.halt_reg = 0x3144,
.clkr = {
.enable_reg = 0x3144,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi1rdi_clk",
.parent_names = (const char *[]){ "csi1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi1pix_clk = {
.halt_reg = 0x3154,
.clkr = {
.enable_reg = 0x3154,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi1pix_clk",
.parent_names = (const char *[]){ "csi1_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi2_clk = {
.halt_reg = 0x3184,
.clkr = {
.enable_reg = 0x3184,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi2_clk",
.parent_names = (const char *[]){ "csi2_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi2_ahb_clk = {
.halt_reg = 0x3188,
.clkr = {
.enable_reg = 0x3188,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi2_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi2phy_clk = {
.halt_reg = 0x3194,
.clkr = {
.enable_reg = 0x3194,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi2phy_clk",
.parent_names = (const char *[]){ "csi2_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi2rdi_clk = {
.halt_reg = 0x31a4,
.clkr = {
.enable_reg = 0x31a4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi2rdi_clk",
.parent_names = (const char *[]){ "csi2_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi2pix_clk = {
.halt_reg = 0x31b4,
.clkr = {
.enable_reg = 0x31b4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi2pix_clk",
.parent_names = (const char *[]){ "csi2_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi3_clk = {
.halt_reg = 0x31e4,
.clkr = {
.enable_reg = 0x31e4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi3_clk",
.parent_names = (const char *[]){ "csi3_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi3_ahb_clk = {
.halt_reg = 0x31e8,
.clkr = {
.enable_reg = 0x31e8,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi3_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi3phy_clk = {
.halt_reg = 0x31f4,
.clkr = {
.enable_reg = 0x31f4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi3phy_clk",
.parent_names = (const char *[]){ "csi3_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi3rdi_clk = {
.halt_reg = 0x3204,
.clkr = {
.enable_reg = 0x3204,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi3rdi_clk",
.parent_names = (const char *[]){ "csi3_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_csi3pix_clk = {
.halt_reg = 0x3214,
.clkr = {
.enable_reg = 0x3214,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_csi3pix_clk",
.parent_names = (const char *[]){ "csi3_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch camss_ispif_ahb_clk = {
.halt_reg = 0x3224,
.clkr = {
.enable_reg = 0x3224,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camss_ispif_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch fd_core_clk = {
.halt_reg = 0x3b68,
.clkr = {
.enable_reg = 0x3b68,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "fd_core_clk",
.parent_names = (const char *[]){ "fd_core_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch fd_core_uar_clk = {
.halt_reg = 0x3b6c,
.clkr = {
.enable_reg = 0x3b6c,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "fd_core_uar_clk",
.parent_names = (const char *[]){ "fd_core_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch fd_ahb_clk = {
.halt_reg = 0x3ba74,
.clkr = {
.enable_reg = 0x3ba74,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "fd_ahb_clk",
.parent_names = (const char *[]){ "ahb_clk_src" },
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_hw *mmcc_msm8996_hws[] = {
&gpll0_div.hw,
};
static struct gdsc mmagic_bimc_gdsc = {
.gdscr = 0x529c,
.pd = {
.name = "mmagic_bimc",
},
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc mmagic_video_gdsc = {
.gdscr = 0x119c,
.gds_hw_ctrl = 0x120c,
.pd = {
.name = "mmagic_video",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = VOTABLE,
};
static struct gdsc mmagic_mdss_gdsc = {
.gdscr = 0x247c,
.gds_hw_ctrl = 0x2480,
.pd = {
.name = "mmagic_mdss",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = VOTABLE,
};
static struct gdsc mmagic_camss_gdsc = {
.gdscr = 0x3c4c,
.gds_hw_ctrl = 0x3c50,
.pd = {
.name = "mmagic_camss",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = VOTABLE,
};
static struct gdsc venus_gdsc = {
.gdscr = 0x1024,
.cxcs = (unsigned int []){ 0x1028, 0x1034, 0x1038 },
.cxc_count = 3,
.pd = {
.name = "venus",
},
.parent = &mmagic_video_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc venus_core0_gdsc = {
.gdscr = 0x1040,
.cxcs = (unsigned int []){ 0x1048 },
.cxc_count = 1,
.pd = {
.name = "venus_core0",
},
.parent = &venus_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
.flags = HW_CTRL,
};
static struct gdsc venus_core1_gdsc = {
.gdscr = 0x1044,
.cxcs = (unsigned int []){ 0x104c },
.cxc_count = 1,
.pd = {
.name = "venus_core1",
},
.parent = &venus_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
.flags = HW_CTRL,
};
static struct gdsc camss_gdsc = {
.gdscr = 0x34a0,
.cxcs = (unsigned int []){ 0x36bc, 0x36c4 },
.cxc_count = 2,
.pd = {
.name = "camss",
},
.parent = &mmagic_camss_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc vfe0_gdsc = {
.gdscr = 0x3664,
.cxcs = (unsigned int []){ 0x36a8 },
.cxc_count = 1,
.pd = {
.name = "vfe0",
},
.parent = &camss_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc vfe1_gdsc = {
.gdscr = 0x3674,
.cxcs = (unsigned int []){ 0x36ac },
.cxc_count = 1,
.pd = {
.name = "vfe1",
},
.parent = &camss_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc jpeg_gdsc = {
.gdscr = 0x35a4,
.cxcs = (unsigned int []){ 0x35a8, 0x35b0, 0x35c0, 0x35b8 },
.cxc_count = 4,
.pd = {
.name = "jpeg",
},
.parent = &camss_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc cpp_gdsc = {
.gdscr = 0x36d4,
.cxcs = (unsigned int []){ 0x36b0 },
.cxc_count = 1,
.pd = {
.name = "cpp",
},
.parent = &camss_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc fd_gdsc = {
.gdscr = 0x3b64,
.cxcs = (unsigned int []){ 0x3b68, 0x3b6c },
.cxc_count = 2,
.pd = {
.name = "fd",
},
.parent = &camss_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc mdss_gdsc = {
.gdscr = 0x2304,
.cxcs = (unsigned int []){ 0x2310, 0x231c },
.cxc_count = 2,
.pd = {
.name = "mdss",
},
.parent = &mmagic_mdss_gdsc.pd,
.pwrsts = PWRSTS_OFF_ON,
};
static struct gdsc gpu_gdsc = {
.gdscr = 0x4034,
.gds_hw_ctrl = 0x4038,
.pd = {
.name = "gpu",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = VOTABLE,
};
static struct gdsc gpu_gx_gdsc = {
.gdscr = 0x4024,
.clamp_io_ctrl = 0x4300,
.cxcs = (unsigned int []){ 0x4028 },
.cxc_count = 1,
.pd = {
.name = "gpu_gx",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = CLAMP_IO,
};
static struct clk_regmap *mmcc_msm8996_clocks[] = {
[MMPLL0_EARLY] = &mmpll0_early.clkr,
[MMPLL0_PLL] = &mmpll0.clkr,
[MMPLL1_EARLY] = &mmpll1_early.clkr,
[MMPLL1_PLL] = &mmpll1.clkr,
[MMPLL2_EARLY] = &mmpll2_early.clkr,
[MMPLL2_PLL] = &mmpll2.clkr,
[MMPLL3_EARLY] = &mmpll3_early.clkr,
[MMPLL3_PLL] = &mmpll3.clkr,
[MMPLL4_EARLY] = &mmpll4_early.clkr,
[MMPLL4_PLL] = &mmpll4.clkr,
[MMPLL5_EARLY] = &mmpll5_early.clkr,
[MMPLL5_PLL] = &mmpll5.clkr,
[MMPLL8_EARLY] = &mmpll8_early.clkr,
[MMPLL8_PLL] = &mmpll8.clkr,
[MMPLL9_EARLY] = &mmpll9_early.clkr,
[MMPLL9_PLL] = &mmpll9.clkr,
[AHB_CLK_SRC] = &ahb_clk_src.clkr,
[AXI_CLK_SRC] = &axi_clk_src.clkr,
[MAXI_CLK_SRC] = &maxi_clk_src.clkr,
[GFX3D_CLK_SRC] = &gfx3d_clk_src.clkr,
[RBBMTIMER_CLK_SRC] = &rbbmtimer_clk_src.clkr,
[ISENSE_CLK_SRC] = &isense_clk_src.clkr,
[RBCPR_CLK_SRC] = &rbcpr_clk_src.clkr,
[VIDEO_CORE_CLK_SRC] = &video_core_clk_src.clkr,
[VIDEO_SUBCORE0_CLK_SRC] = &video_subcore0_clk_src.clkr,
[VIDEO_SUBCORE1_CLK_SRC] = &video_subcore1_clk_src.clkr,
[PCLK0_CLK_SRC] = &pclk0_clk_src.clkr,
[PCLK1_CLK_SRC] = &pclk1_clk_src.clkr,
[MDP_CLK_SRC] = &mdp_clk_src.clkr,
[EXTPCLK_CLK_SRC] = &extpclk_clk_src.clkr,
[VSYNC_CLK_SRC] = &vsync_clk_src.clkr,
[HDMI_CLK_SRC] = &hdmi_clk_src.clkr,
[BYTE0_CLK_SRC] = &byte0_clk_src.clkr,
[BYTE1_CLK_SRC] = &byte1_clk_src.clkr,
[ESC0_CLK_SRC] = &esc0_clk_src.clkr,
[ESC1_CLK_SRC] = &esc1_clk_src.clkr,
[CAMSS_GP0_CLK_SRC] = &camss_gp0_clk_src.clkr,
[CAMSS_GP1_CLK_SRC] = &camss_gp1_clk_src.clkr,
[MCLK0_CLK_SRC] = &mclk0_clk_src.clkr,
[MCLK1_CLK_SRC] = &mclk1_clk_src.clkr,
[MCLK2_CLK_SRC] = &mclk2_clk_src.clkr,
[MCLK3_CLK_SRC] = &mclk3_clk_src.clkr,
[CCI_CLK_SRC] = &cci_clk_src.clkr,
[CSI0PHYTIMER_CLK_SRC] = &csi0phytimer_clk_src.clkr,
[CSI1PHYTIMER_CLK_SRC] = &csi1phytimer_clk_src.clkr,
[CSI2PHYTIMER_CLK_SRC] = &csi2phytimer_clk_src.clkr,
[CSIPHY0_3P_CLK_SRC] = &csiphy0_3p_clk_src.clkr,
[CSIPHY1_3P_CLK_SRC] = &csiphy1_3p_clk_src.clkr,
[CSIPHY2_3P_CLK_SRC] = &csiphy2_3p_clk_src.clkr,
[JPEG0_CLK_SRC] = &jpeg0_clk_src.clkr,
[JPEG2_CLK_SRC] = &jpeg2_clk_src.clkr,
[JPEG_DMA_CLK_SRC] = &jpeg_dma_clk_src.clkr,
[VFE0_CLK_SRC] = &vfe0_clk_src.clkr,
[VFE1_CLK_SRC] = &vfe1_clk_src.clkr,
[CPP_CLK_SRC] = &cpp_clk_src.clkr,
[CSI0_CLK_SRC] = &csi0_clk_src.clkr,
[CSI1_CLK_SRC] = &csi1_clk_src.clkr,
[CSI2_CLK_SRC] = &csi2_clk_src.clkr,
[CSI3_CLK_SRC] = &csi3_clk_src.clkr,
[FD_CORE_CLK_SRC] = &fd_core_clk_src.clkr,
[MMSS_MMAGIC_AHB_CLK] = &mmss_mmagic_ahb_clk.clkr,
[MMSS_MMAGIC_CFG_AHB_CLK] = &mmss_mmagic_cfg_ahb_clk.clkr,
[MMSS_MISC_AHB_CLK] = &mmss_misc_ahb_clk.clkr,
[MMSS_MISC_CXO_CLK] = &mmss_misc_cxo_clk.clkr,
[MMSS_MMAGIC_MAXI_CLK] = &mmss_mmagic_maxi_clk.clkr,
[MMAGIC_CAMSS_AXI_CLK] = &mmagic_camss_axi_clk.clkr,
[MMAGIC_CAMSS_NOC_CFG_AHB_CLK] = &mmagic_camss_noc_cfg_ahb_clk.clkr,
[SMMU_VFE_AHB_CLK] = &smmu_vfe_ahb_clk.clkr,
[SMMU_VFE_AXI_CLK] = &smmu_vfe_axi_clk.clkr,
[SMMU_CPP_AHB_CLK] = &smmu_cpp_ahb_clk.clkr,
[SMMU_CPP_AXI_CLK] = &smmu_cpp_axi_clk.clkr,
[SMMU_JPEG_AHB_CLK] = &smmu_jpeg_ahb_clk.clkr,
[SMMU_JPEG_AXI_CLK] = &smmu_jpeg_axi_clk.clkr,
[MMAGIC_MDSS_AXI_CLK] = &mmagic_mdss_axi_clk.clkr,
[MMAGIC_MDSS_NOC_CFG_AHB_CLK] = &mmagic_mdss_noc_cfg_ahb_clk.clkr,
[SMMU_ROT_AHB_CLK] = &smmu_rot_ahb_clk.clkr,
[SMMU_ROT_AXI_CLK] = &smmu_rot_axi_clk.clkr,
[SMMU_MDP_AHB_CLK] = &smmu_mdp_ahb_clk.clkr,
[SMMU_MDP_AXI_CLK] = &smmu_mdp_axi_clk.clkr,
[MMAGIC_VIDEO_AXI_CLK] = &mmagic_video_axi_clk.clkr,
[MMAGIC_VIDEO_NOC_CFG_AHB_CLK] = &mmagic_video_noc_cfg_ahb_clk.clkr,
[SMMU_VIDEO_AHB_CLK] = &smmu_video_ahb_clk.clkr,
[SMMU_VIDEO_AXI_CLK] = &smmu_video_axi_clk.clkr,
[MMAGIC_BIMC_NOC_CFG_AHB_CLK] = &mmagic_bimc_noc_cfg_ahb_clk.clkr,
[GPU_GX_GFX3D_CLK] = &gpu_gx_gfx3d_clk.clkr,
[GPU_GX_RBBMTIMER_CLK] = &gpu_gx_rbbmtimer_clk.clkr,
[GPU_AHB_CLK] = &gpu_ahb_clk.clkr,
[GPU_AON_ISENSE_CLK] = &gpu_aon_isense_clk.clkr,
[VMEM_MAXI_CLK] = &vmem_maxi_clk.clkr,
[VMEM_AHB_CLK] = &vmem_ahb_clk.clkr,
[MMSS_RBCPR_CLK] = &mmss_rbcpr_clk.clkr,
[MMSS_RBCPR_AHB_CLK] = &mmss_rbcpr_ahb_clk.clkr,
[VIDEO_CORE_CLK] = &video_core_clk.clkr,
[VIDEO_AXI_CLK] = &video_axi_clk.clkr,
[VIDEO_MAXI_CLK] = &video_maxi_clk.clkr,
[VIDEO_AHB_CLK] = &video_ahb_clk.clkr,
[VIDEO_SUBCORE0_CLK] = &video_subcore0_clk.clkr,
[VIDEO_SUBCORE1_CLK] = &video_subcore1_clk.clkr,
[MDSS_AHB_CLK] = &mdss_ahb_clk.clkr,
[MDSS_HDMI_AHB_CLK] = &mdss_hdmi_ahb_clk.clkr,
[MDSS_AXI_CLK] = &mdss_axi_clk.clkr,
[MDSS_PCLK0_CLK] = &mdss_pclk0_clk.clkr,
[MDSS_PCLK1_CLK] = &mdss_pclk1_clk.clkr,
[MDSS_MDP_CLK] = &mdss_mdp_clk.clkr,
[MDSS_EXTPCLK_CLK] = &mdss_extpclk_clk.clkr,
[MDSS_VSYNC_CLK] = &mdss_vsync_clk.clkr,
[MDSS_HDMI_CLK] = &mdss_hdmi_clk.clkr,
[MDSS_BYTE0_CLK] = &mdss_byte0_clk.clkr,
[MDSS_BYTE1_CLK] = &mdss_byte1_clk.clkr,
[MDSS_ESC0_CLK] = &mdss_esc0_clk.clkr,
[MDSS_ESC1_CLK] = &mdss_esc1_clk.clkr,
[CAMSS_TOP_AHB_CLK] = &camss_top_ahb_clk.clkr,
[CAMSS_AHB_CLK] = &camss_ahb_clk.clkr,
[CAMSS_MICRO_AHB_CLK] = &camss_micro_ahb_clk.clkr,
[CAMSS_GP0_CLK] = &camss_gp0_clk.clkr,
[CAMSS_GP1_CLK] = &camss_gp1_clk.clkr,
[CAMSS_MCLK0_CLK] = &camss_mclk0_clk.clkr,
[CAMSS_MCLK1_CLK] = &camss_mclk1_clk.clkr,
[CAMSS_MCLK2_CLK] = &camss_mclk2_clk.clkr,
[CAMSS_MCLK3_CLK] = &camss_mclk3_clk.clkr,
[CAMSS_CCI_CLK] = &camss_cci_clk.clkr,
[CAMSS_CCI_AHB_CLK] = &camss_cci_ahb_clk.clkr,
[CAMSS_CSI0PHYTIMER_CLK] = &camss_csi0phytimer_clk.clkr,
[CAMSS_CSI1PHYTIMER_CLK] = &camss_csi1phytimer_clk.clkr,
[CAMSS_CSI2PHYTIMER_CLK] = &camss_csi2phytimer_clk.clkr,
[CAMSS_CSIPHY0_3P_CLK] = &camss_csiphy0_3p_clk.clkr,
[CAMSS_CSIPHY1_3P_CLK] = &camss_csiphy1_3p_clk.clkr,
[CAMSS_CSIPHY2_3P_CLK] = &camss_csiphy2_3p_clk.clkr,
[CAMSS_JPEG0_CLK] = &camss_jpeg0_clk.clkr,
[CAMSS_JPEG2_CLK] = &camss_jpeg2_clk.clkr,
[CAMSS_JPEG_DMA_CLK] = &camss_jpeg_dma_clk.clkr,
[CAMSS_JPEG_AHB_CLK] = &camss_jpeg_ahb_clk.clkr,
[CAMSS_JPEG_AXI_CLK] = &camss_jpeg_axi_clk.clkr,
[CAMSS_VFE_AHB_CLK] = &camss_vfe_ahb_clk.clkr,
[CAMSS_VFE_AXI_CLK] = &camss_vfe_axi_clk.clkr,
[CAMSS_VFE0_CLK] = &camss_vfe0_clk.clkr,
[CAMSS_VFE0_STREAM_CLK] = &camss_vfe0_stream_clk.clkr,
[CAMSS_VFE0_AHB_CLK] = &camss_vfe0_ahb_clk.clkr,
[CAMSS_VFE1_CLK] = &camss_vfe1_clk.clkr,
[CAMSS_VFE1_STREAM_CLK] = &camss_vfe1_stream_clk.clkr,
[CAMSS_VFE1_AHB_CLK] = &camss_vfe1_ahb_clk.clkr,
[CAMSS_CSI_VFE0_CLK] = &camss_csi_vfe0_clk.clkr,
[CAMSS_CSI_VFE1_CLK] = &camss_csi_vfe1_clk.clkr,
[CAMSS_CPP_VBIF_AHB_CLK] = &camss_cpp_vbif_ahb_clk.clkr,
[CAMSS_CPP_AXI_CLK] = &camss_cpp_axi_clk.clkr,
[CAMSS_CPP_CLK] = &camss_cpp_clk.clkr,
[CAMSS_CPP_AHB_CLK] = &camss_cpp_ahb_clk.clkr,
[CAMSS_CSI0_CLK] = &camss_csi0_clk.clkr,
[CAMSS_CSI0_AHB_CLK] = &camss_csi0_ahb_clk.clkr,
[CAMSS_CSI0PHY_CLK] = &camss_csi0phy_clk.clkr,
[CAMSS_CSI0RDI_CLK] = &camss_csi0rdi_clk.clkr,
[CAMSS_CSI0PIX_CLK] = &camss_csi0pix_clk.clkr,
[CAMSS_CSI1_CLK] = &camss_csi1_clk.clkr,
[CAMSS_CSI1_AHB_CLK] = &camss_csi1_ahb_clk.clkr,
[CAMSS_CSI1PHY_CLK] = &camss_csi1phy_clk.clkr,
[CAMSS_CSI1RDI_CLK] = &camss_csi1rdi_clk.clkr,
[CAMSS_CSI1PIX_CLK] = &camss_csi1pix_clk.clkr,
[CAMSS_CSI2_CLK] = &camss_csi2_clk.clkr,
[CAMSS_CSI2_AHB_CLK] = &camss_csi2_ahb_clk.clkr,
[CAMSS_CSI2PHY_CLK] = &camss_csi2phy_clk.clkr,
[CAMSS_CSI2RDI_CLK] = &camss_csi2rdi_clk.clkr,
[CAMSS_CSI2PIX_CLK] = &camss_csi2pix_clk.clkr,
[CAMSS_CSI3_CLK] = &camss_csi3_clk.clkr,
[CAMSS_CSI3_AHB_CLK] = &camss_csi3_ahb_clk.clkr,
[CAMSS_CSI3PHY_CLK] = &camss_csi3phy_clk.clkr,
[CAMSS_CSI3RDI_CLK] = &camss_csi3rdi_clk.clkr,
[CAMSS_CSI3PIX_CLK] = &camss_csi3pix_clk.clkr,
[CAMSS_ISPIF_AHB_CLK] = &camss_ispif_ahb_clk.clkr,
[FD_CORE_CLK] = &fd_core_clk.clkr,
[FD_CORE_UAR_CLK] = &fd_core_uar_clk.clkr,
[FD_AHB_CLK] = &fd_ahb_clk.clkr,
};
static struct gdsc *mmcc_msm8996_gdscs[] = {
[MMAGIC_BIMC_GDSC] = &mmagic_bimc_gdsc,
[MMAGIC_VIDEO_GDSC] = &mmagic_video_gdsc,
[MMAGIC_MDSS_GDSC] = &mmagic_mdss_gdsc,
[MMAGIC_CAMSS_GDSC] = &mmagic_camss_gdsc,
[VENUS_GDSC] = &venus_gdsc,
[VENUS_CORE0_GDSC] = &venus_core0_gdsc,
[VENUS_CORE1_GDSC] = &venus_core1_gdsc,
[CAMSS_GDSC] = &camss_gdsc,
[VFE0_GDSC] = &vfe0_gdsc,
[VFE1_GDSC] = &vfe1_gdsc,
[JPEG_GDSC] = &jpeg_gdsc,
[CPP_GDSC] = &cpp_gdsc,
[FD_GDSC] = &fd_gdsc,
[MDSS_GDSC] = &mdss_gdsc,
[GPU_GDSC] = &gpu_gdsc,
[GPU_GX_GDSC] = &gpu_gx_gdsc,
};
static const struct qcom_reset_map mmcc_msm8996_resets[] = {
[MMAGICAHB_BCR] = { 0x5020 },
[MMAGIC_CFG_BCR] = { 0x5050 },
[MISC_BCR] = { 0x5010 },
[BTO_BCR] = { 0x5030 },
[MMAGICAXI_BCR] = { 0x5060 },
[MMAGICMAXI_BCR] = { 0x5070 },
[DSA_BCR] = { 0x50a0 },
[MMAGIC_CAMSS_BCR] = { 0x3c40 },
[THROTTLE_CAMSS_BCR] = { 0x3c30 },
[SMMU_VFE_BCR] = { 0x3c00 },
[SMMU_CPP_BCR] = { 0x3c10 },
[SMMU_JPEG_BCR] = { 0x3c20 },
[MMAGIC_MDSS_BCR] = { 0x2470 },
[THROTTLE_MDSS_BCR] = { 0x2460 },
[SMMU_ROT_BCR] = { 0x2440 },
[SMMU_MDP_BCR] = { 0x2450 },
[MMAGIC_VIDEO_BCR] = { 0x1190 },
[THROTTLE_VIDEO_BCR] = { 0x1180 },
[SMMU_VIDEO_BCR] = { 0x1170 },
[MMAGIC_BIMC_BCR] = { 0x5290 },
[GPU_GX_BCR] = { 0x4020 },
[GPU_BCR] = { 0x4030 },
[GPU_AON_BCR] = { 0x4040 },
[VMEM_BCR] = { 0x1200 },
[MMSS_RBCPR_BCR] = { 0x4080 },
[VIDEO_BCR] = { 0x1020 },
[MDSS_BCR] = { 0x2300 },
[CAMSS_TOP_BCR] = { 0x3480 },
[CAMSS_AHB_BCR] = { 0x3488 },
[CAMSS_MICRO_BCR] = { 0x3490 },
[CAMSS_CCI_BCR] = { 0x3340 },
[CAMSS_PHY0_BCR] = { 0x3020 },
[CAMSS_PHY1_BCR] = { 0x3050 },
[CAMSS_PHY2_BCR] = { 0x3080 },
[CAMSS_CSIPHY0_3P_BCR] = { 0x3230 },
[CAMSS_CSIPHY1_3P_BCR] = { 0x3250 },
[CAMSS_CSIPHY2_3P_BCR] = { 0x3270 },
[CAMSS_JPEG_BCR] = { 0x35a0 },
[CAMSS_VFE_BCR] = { 0x36a0 },
[CAMSS_VFE0_BCR] = { 0x3660 },
[CAMSS_VFE1_BCR] = { 0x3670 },
[CAMSS_CSI_VFE0_BCR] = { 0x3700 },
[CAMSS_CSI_VFE1_BCR] = { 0x3710 },
[CAMSS_CPP_TOP_BCR] = { 0x36c0 },
[CAMSS_CPP_BCR] = { 0x36d0 },
[CAMSS_CSI0_BCR] = { 0x30b0 },
[CAMSS_CSI0RDI_BCR] = { 0x30d0 },
[CAMSS_CSI0PIX_BCR] = { 0x30e0 },
[CAMSS_CSI1_BCR] = { 0x3120 },
[CAMSS_CSI1RDI_BCR] = { 0x3140 },
[CAMSS_CSI1PIX_BCR] = { 0x3150 },
[CAMSS_CSI2_BCR] = { 0x3180 },
[CAMSS_CSI2RDI_BCR] = { 0x31a0 },
[CAMSS_CSI2PIX_BCR] = { 0x31b0 },
[CAMSS_CSI3_BCR] = { 0x31e0 },
[CAMSS_CSI3RDI_BCR] = { 0x3200 },
[CAMSS_CSI3PIX_BCR] = { 0x3210 },
[CAMSS_ISPIF_BCR] = { 0x3220 },
[FD_BCR] = { 0x3b60 },
[MMSS_SPDM_RM_BCR] = { 0x300 },
};
static const struct regmap_config mmcc_msm8996_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.max_register = 0xb008,
.fast_io = true,
};
static const struct qcom_cc_desc mmcc_msm8996_desc = {
.config = &mmcc_msm8996_regmap_config,
.clks = mmcc_msm8996_clocks,
.num_clks = ARRAY_SIZE(mmcc_msm8996_clocks),
.resets = mmcc_msm8996_resets,
.num_resets = ARRAY_SIZE(mmcc_msm8996_resets),
.gdscs = mmcc_msm8996_gdscs,
.num_gdscs = ARRAY_SIZE(mmcc_msm8996_gdscs),
};
static const struct of_device_id mmcc_msm8996_match_table[] = {
{ .compatible = "qcom,mmcc-msm8996" },
{ }
};
MODULE_DEVICE_TABLE(of, mmcc_msm8996_match_table);
static int mmcc_msm8996_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
int i, ret;
struct regmap *regmap;
regmap = qcom_cc_map(pdev, &mmcc_msm8996_desc);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
/* Disable the AHB DCD */
regmap_update_bits(regmap, 0x50d8, BIT(31), 0);
/* Disable the NoC FSM for mmss_mmagic_cfg_ahb_clk */
regmap_update_bits(regmap, 0x5054, BIT(15), 0);
for (i = 0; i < ARRAY_SIZE(mmcc_msm8996_hws); i++) {
ret = devm_clk_hw_register(dev, mmcc_msm8996_hws[i]);
if (ret)
return ret;
}
return qcom_cc_really_probe(pdev, &mmcc_msm8996_desc, regmap);
}
static struct platform_driver mmcc_msm8996_driver = {
.probe = mmcc_msm8996_probe,
.driver = {
.name = "mmcc-msm8996",
.of_match_table = mmcc_msm8996_match_table,
},
};
module_platform_driver(mmcc_msm8996_driver);
MODULE_DESCRIPTION("QCOM MMCC MSM8996 Driver");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:mmcc-msm8996");
|
133999.c | /*
* Copyright (c) 2018 Qualcomm Technologies, Inc.
* All Rights Reserved.
*/
// Copyright (c) 2018 Qualcomm Technologies, Inc.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below)
// provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// Neither the name of Qualcomm Technologies, Inc. nor the names of its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
#include <string.h>
#include "qsCommon.h"
#include "qsHost.h"
#include "qsCallback.h"
#include "idlist.h"
#include "qapi_ble.h"
#include "qapi_ble_trds_common.h"
#include "qapi_ble_trds_host_cb.h"
#include "qapi_ble_btapityp_common.h"
#include "qapi_ble_bttypes_common.h"
#include "qapi_ble_gatt_common.h"
#include "qapi_ble_trdstypes_common.h"
int _qapi_BLE_TRDS_Initialize_Service(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t Service_Flags, qapi_BLE_TRDS_Initialize_Data_t *InitializeData, qapi_BLE_TRDS_Event_Callback_t EventCallback, uint32_t CallbackParameter, uint32_t *ServiceID)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Handle event callback registration. */
uint32_t qsCbParam = 0;
CallbackInfo_t CallbackInfo;
CallbackInfo.TargetID = TargetID;
CallbackInfo.ModuleID = QS_MODULE_BLE;
CallbackInfo.FileID = QAPI_BLE_TRDS_FILE_ID;
CallbackInfo.CallbackID = QAPI_BLE_TRDS_EVENT_CALLBACK_T_CALLBACK_ID;
CallbackInfo.CallbackKey = 0;
CallbackInfo.AppFunction = EventCallback;
CallbackInfo.AppParam = (uint32_t)CallbackParameter;
qsResult = Callback_Register(&qsCbParam, Host_qapi_BLE_TRDS_Event_Callback_t_Handler, &CallbackInfo);
/* Override the callback parameter with the new one. */
CallbackParameter = qsCbParam;
/* Calculate size of packed function arguments. */
qsSize = (12 + CalcPackedSize_qapi_BLE_TRDS_Initialize_Data_t((qapi_BLE_TRDS_Initialize_Data_t *)InitializeData) + (QS_POINTER_HEADER_SIZE * 2));
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_INITIALIZE_SERVICE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&Service_Flags);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&CallbackParameter);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)ServiceID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)InitializeData);
if((qsResult == ssSuccess) && (InitializeData != NULL))
{
qsResult = PackedWrite_qapi_BLE_TRDS_Initialize_Data_t(&qsInputBuffer, (qapi_BLE_TRDS_Initialize_Data_t *)InitializeData);
}
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
if(qsResult == ssSuccess)
qsResult = PackedRead_PointerHeader(&qsOutputBuffer, &qsBufferList, &qsPointerValid);
if((qsResult == ssSuccess) && (qsPointerValid == TRUE))
{
qsResult = PackedRead_32(&qsOutputBuffer, &qsBufferList, (uint32_t *)ServiceID);
}
/* Update the event callback ID. */
if(qsRetVal >= 0)
qsResult = Callback_UpdateKey(qsCbParam, (uintptr_t)qsRetVal);
else
Callback_UnregisterByHandle(qsCbParam);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Initialize_Service(uint32_t BluetoothStackID, uint32_t Service_Flags, qapi_BLE_TRDS_Initialize_Data_t *InitializeData, qapi_BLE_TRDS_Event_Callback_t EventCallback, uint32_t CallbackParameter, uint32_t *ServiceID)
{
return _qapi_BLE_TRDS_Initialize_Service(qsTargetId, BluetoothStackID, Service_Flags, InitializeData, EventCallback, CallbackParameter, ServiceID);
}
int _qapi_BLE_TRDS_Initialize_Service_Handle_Range(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t Service_Flags, qapi_BLE_TRDS_Initialize_Data_t *InitializeData, qapi_BLE_TRDS_Event_Callback_t EventCallback, uint32_t CallbackParameter, uint32_t *ServiceID, qapi_BLE_GATT_Attribute_Handle_Group_t *ServiceHandleRange)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Handle event callback registration. */
uint32_t qsCbParam = 0;
CallbackInfo_t CallbackInfo;
CallbackInfo.TargetID = TargetID;
CallbackInfo.ModuleID = QS_MODULE_BLE;
CallbackInfo.FileID = QAPI_BLE_TRDS_FILE_ID;
CallbackInfo.CallbackID = QAPI_BLE_TRDS_EVENT_CALLBACK_T_CALLBACK_ID;
CallbackInfo.CallbackKey = 0;
CallbackInfo.AppFunction = EventCallback;
CallbackInfo.AppParam = (uint32_t)CallbackParameter;
qsResult = Callback_Register(&qsCbParam, Host_qapi_BLE_TRDS_Event_Callback_t_Handler, &CallbackInfo);
/* Override the callback parameter with the new one. */
CallbackParameter = qsCbParam;
/* Calculate size of packed function arguments. */
qsSize = (12 + CalcPackedSize_qapi_BLE_TRDS_Initialize_Data_t((qapi_BLE_TRDS_Initialize_Data_t *)InitializeData) + CalcPackedSize_qapi_BLE_GATT_Attribute_Handle_Group_t((qapi_BLE_GATT_Attribute_Handle_Group_t *)ServiceHandleRange) + (QS_POINTER_HEADER_SIZE * 3));
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_INITIALIZE_SERVICE_HANDLE_RANGE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&Service_Flags);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&CallbackParameter);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)ServiceID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)InitializeData);
if((qsResult == ssSuccess) && (InitializeData != NULL))
{
qsResult = PackedWrite_qapi_BLE_TRDS_Initialize_Data_t(&qsInputBuffer, (qapi_BLE_TRDS_Initialize_Data_t *)InitializeData);
}
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)ServiceHandleRange);
if((qsResult == ssSuccess) && (ServiceHandleRange != NULL))
{
qsResult = PackedWrite_qapi_BLE_GATT_Attribute_Handle_Group_t(&qsInputBuffer, (qapi_BLE_GATT_Attribute_Handle_Group_t *)ServiceHandleRange);
}
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
if(qsResult == ssSuccess)
qsResult = PackedRead_PointerHeader(&qsOutputBuffer, &qsBufferList, &qsPointerValid);
if((qsResult == ssSuccess) && (qsPointerValid == TRUE))
{
qsResult = PackedRead_32(&qsOutputBuffer, &qsBufferList, (uint32_t *)ServiceID);
}
if(qsResult == ssSuccess)
qsResult = PackedRead_PointerHeader(&qsOutputBuffer, &qsBufferList, &qsPointerValid);
if((qsResult == ssSuccess) && (qsPointerValid == TRUE))
{
qsResult = PackedRead_qapi_BLE_GATT_Attribute_Handle_Group_t(&qsOutputBuffer, &qsBufferList, (qapi_BLE_GATT_Attribute_Handle_Group_t *)ServiceHandleRange);
}
/* Update the event callback ID. */
if(qsRetVal >= 0)
qsResult = Callback_UpdateKey(qsCbParam, (uintptr_t)qsRetVal);
else
Callback_UnregisterByHandle(qsCbParam);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Initialize_Service_Handle_Range(uint32_t BluetoothStackID, uint32_t Service_Flags, qapi_BLE_TRDS_Initialize_Data_t *InitializeData, qapi_BLE_TRDS_Event_Callback_t EventCallback, uint32_t CallbackParameter, uint32_t *ServiceID, qapi_BLE_GATT_Attribute_Handle_Group_t *ServiceHandleRange)
{
return _qapi_BLE_TRDS_Initialize_Service_Handle_Range(qsTargetId, BluetoothStackID, Service_Flags, InitializeData, EventCallback, CallbackParameter, ServiceID, ServiceHandleRange);
}
int _qapi_BLE_TRDS_Cleanup_Service(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t InstanceID)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = 8;
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_CLEANUP_SERVICE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&InstanceID);
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
/* Un-register the callback. */
if(qsRetVal >= 0)
Callback_UnregisterByKey(MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_EVENT_CALLBACK_T_CALLBACK_ID, (uintptr_t)InstanceID);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Cleanup_Service(uint32_t BluetoothStackID, uint32_t InstanceID)
{
return _qapi_BLE_TRDS_Cleanup_Service(qsTargetId, BluetoothStackID, InstanceID);
}
uint32_t _qapi_BLE_TRDS_Query_Number_Attributes(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t InstanceID)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
uint32_t qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = 8;
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_QUERY_NUMBER_ATTRIBUTES_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&InstanceID);
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_32(&qsOutputBuffer, &qsBufferList, (uint32_t *)&qsRetVal);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = 0;
}
}
else
{
qsRetVal = 0;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = 0;
}
}
else
{
qsRetVal = 0;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = 0;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
uint32_t qapi_BLE_TRDS_Query_Number_Attributes(uint32_t BluetoothStackID, uint32_t InstanceID)
{
return _qapi_BLE_TRDS_Query_Number_Attributes(qsTargetId, BluetoothStackID, InstanceID);
}
int _qapi_BLE_TRDS_Write_Control_Point_Request_Response(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t TransactionID, uint8_t ErrorCode)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = 13;
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_WRITE_CONTROL_POINT_REQUEST_RESPONSE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&InstanceID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&TransactionID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_8(&qsInputBuffer, (uint8_t *)&ErrorCode);
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Write_Control_Point_Request_Response(uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t TransactionID, uint8_t ErrorCode)
{
return _qapi_BLE_TRDS_Write_Control_Point_Request_Response(qsTargetId, BluetoothStackID, InstanceID, TransactionID, ErrorCode);
}
int _qapi_BLE_TRDS_Indicate_Control_Point_Response(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t ConnectionID, qapi_BLE_TRDS_Control_Point_Response_Data_t *ResponseData)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = (12 + CalcPackedSize_qapi_BLE_TRDS_Control_Point_Response_Data_t((qapi_BLE_TRDS_Control_Point_Response_Data_t *)ResponseData) + (QS_POINTER_HEADER_SIZE * 1));
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_INDICATE_CONTROL_POINT_RESPONSE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&InstanceID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&ConnectionID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)ResponseData);
if((qsResult == ssSuccess) && (ResponseData != NULL))
{
qsResult = PackedWrite_qapi_BLE_TRDS_Control_Point_Response_Data_t(&qsInputBuffer, (qapi_BLE_TRDS_Control_Point_Response_Data_t *)ResponseData);
}
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Indicate_Control_Point_Response(uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t ConnectionID, qapi_BLE_TRDS_Control_Point_Response_Data_t *ResponseData)
{
return _qapi_BLE_TRDS_Indicate_Control_Point_Response(qsTargetId, BluetoothStackID, InstanceID, ConnectionID, ResponseData);
}
int _qapi_BLE_TRDS_Read_CCCD_Request_Response(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t TransactionID, uint8_t ErrorCode, qapi_BLE_TRDS_CCCD_Type_t Type, uint16_t Configuration)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = 19;
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_READ_CCCD_REQUEST_RESPONSE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&InstanceID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&TransactionID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_8(&qsInputBuffer, (uint8_t *)&ErrorCode);
if(qsResult == ssSuccess)
qsResult = PackedWrite_int(&qsInputBuffer, (int *)&Type);
if(qsResult == ssSuccess)
qsResult = PackedWrite_16(&qsInputBuffer, (uint16_t *)&Configuration);
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Read_CCCD_Request_Response(uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t TransactionID, uint8_t ErrorCode, qapi_BLE_TRDS_CCCD_Type_t Type, uint16_t Configuration)
{
return _qapi_BLE_TRDS_Read_CCCD_Request_Response(qsTargetId, BluetoothStackID, InstanceID, TransactionID, ErrorCode, Type, Configuration);
}
int _qapi_BLE_TRDS_Write_CCCD_Request_Response(uint8_t TargetID, uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t TransactionID, uint8_t ErrorCode, qapi_BLE_TRDS_CCCD_Type_t Type)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = 17;
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_WRITE_CCCD_REQUEST_RESPONSE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BluetoothStackID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&InstanceID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&TransactionID);
if(qsResult == ssSuccess)
qsResult = PackedWrite_8(&qsInputBuffer, (uint8_t *)&ErrorCode);
if(qsResult == ssSuccess)
qsResult = PackedWrite_int(&qsInputBuffer, (int *)&Type);
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Write_CCCD_Request_Response(uint32_t BluetoothStackID, uint32_t InstanceID, uint32_t TransactionID, uint8_t ErrorCode, qapi_BLE_TRDS_CCCD_Type_t Type)
{
return _qapi_BLE_TRDS_Write_CCCD_Request_Response(qsTargetId, BluetoothStackID, InstanceID, TransactionID, ErrorCode, Type);
}
int _qapi_BLE_TRDS_Format_Control_Point_Request(uint8_t TargetID, qapi_BLE_TRDS_Control_Point_Request_Data_t *RequestData, uint32_t BufferLength, uint8_t *Buffer)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = (4 + CalcPackedSize_qapi_BLE_TRDS_Control_Point_Request_Data_t((qapi_BLE_TRDS_Control_Point_Request_Data_t *)RequestData) + (QS_POINTER_HEADER_SIZE * 2));
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_FORMAT_CONTROL_POINT_REQUEST_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BufferLength);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)Buffer);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)RequestData);
if((qsResult == ssSuccess) && (RequestData != NULL))
{
qsResult = PackedWrite_qapi_BLE_TRDS_Control_Point_Request_Data_t(&qsInputBuffer, (qapi_BLE_TRDS_Control_Point_Request_Data_t *)RequestData);
}
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
if(qsResult == ssSuccess)
qsResult = PackedRead_PointerHeader(&qsOutputBuffer, &qsBufferList, &qsPointerValid);
if((qsResult == ssSuccess) && (qsPointerValid == TRUE))
{
qsResult = PackedRead_Array(&qsOutputBuffer, &qsBufferList, (void *)Buffer, sizeof(uint8_t), BufferLength);
}
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Format_Control_Point_Request(qapi_BLE_TRDS_Control_Point_Request_Data_t *RequestData, uint32_t BufferLength, uint8_t *Buffer)
{
return _qapi_BLE_TRDS_Format_Control_Point_Request(qsTargetId, RequestData, BufferLength, Buffer);
}
int _qapi_BLE_TRDS_Decode_Control_Point_Response(uint8_t TargetID, uint32_t ValueLength, uint8_t *Value, qapi_BLE_TRDS_Control_Point_Response_Data_t *ResponseData)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = (4 + (QS_POINTER_HEADER_SIZE * 2));
qsSize = qsSize + ((ValueLength)*(1));
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_DECODE_CONTROL_POINT_RESPONSE_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&ValueLength);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)Value);
if((qsResult == ssSuccess) && (Value != NULL))
{
qsResult = PackedWrite_Array(&qsInputBuffer, (void *)Value, sizeof(uint8_t), ValueLength);
}
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)ResponseData);
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
if(qsResult == ssSuccess)
qsResult = PackedRead_PointerHeader(&qsOutputBuffer, &qsBufferList, &qsPointerValid);
if((qsResult == ssSuccess) && (qsPointerValid == TRUE))
{
qsResult = PackedRead_qapi_BLE_TRDS_Control_Point_Response_Data_t(&qsOutputBuffer, &qsBufferList, (qapi_BLE_TRDS_Control_Point_Response_Data_t *)ResponseData);
}
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Decode_Control_Point_Response(uint32_t ValueLength, uint8_t *Value, qapi_BLE_TRDS_Control_Point_Response_Data_t *ResponseData)
{
return _qapi_BLE_TRDS_Decode_Control_Point_Response(qsTargetId, ValueLength, Value, ResponseData);
}
int _qapi_BLE_TRDS_Format_Transport_Block(uint8_t TargetID, qapi_BLE_TRDS_Transport_Block_Data_t *TransportBlockData, uint32_t BufferLength, uint8_t *Buffer)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = (4 + CalcPackedSize_qapi_BLE_TRDS_Transport_Block_Data_t((qapi_BLE_TRDS_Transport_Block_Data_t *)TransportBlockData) + (QS_POINTER_HEADER_SIZE * 2));
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_FORMAT_TRANSPORT_BLOCK_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&BufferLength);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)Buffer);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)TransportBlockData);
if((qsResult == ssSuccess) && (TransportBlockData != NULL))
{
qsResult = PackedWrite_qapi_BLE_TRDS_Transport_Block_Data_t(&qsInputBuffer, (qapi_BLE_TRDS_Transport_Block_Data_t *)TransportBlockData);
}
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
if(qsResult == ssSuccess)
qsResult = PackedRead_PointerHeader(&qsOutputBuffer, &qsBufferList, &qsPointerValid);
if((qsResult == ssSuccess) && (qsPointerValid == TRUE))
{
qsResult = PackedRead_Array(&qsOutputBuffer, &qsBufferList, (void *)Buffer, sizeof(uint8_t), BufferLength);
}
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Format_Transport_Block(qapi_BLE_TRDS_Transport_Block_Data_t *TransportBlockData, uint32_t BufferLength, uint8_t *Buffer)
{
return _qapi_BLE_TRDS_Format_Transport_Block(qsTargetId, TransportBlockData, BufferLength, Buffer);
}
int _qapi_BLE_TRDS_Decode_Transport_Block(uint8_t TargetID, uint32_t RemainingLength, uint8_t *Buffer, qapi_BLE_TRDS_Transport_Block_Data_t *TransportBlockData)
{
PackedBuffer_t qsInputBuffer = { NULL, 0, 0, 0, NULL, NULL };
PackedBuffer_t qsOutputBuffer = { NULL, 0, 0, 0, NULL, NULL };
BufferListEntry_t *qsBufferList = NULL;
SerStatus_t qsResult = ssSuccess;
uint32_t qsIndex = 0;
uint16_t qsSize = 0;
Boolean_t qsPointerValid = FALSE;
UNUSED(qsIndex);
UNUSED(qsPointerValid);
/* Return value. */
int qsRetVal = 0;
/* Calculate size of packed function arguments. */
qsSize = (4 + (QS_POINTER_HEADER_SIZE * 2));
qsSize = qsSize + ((RemainingLength)*(1));
if(AllocatePackedBuffer(TargetID, QS_PACKET_E, MODULE_BLE, QAPI_BLE_TRDS_FILE_ID, QAPI_BLE_TRDS_DECODE_TRANSPORT_BLOCK_FUNCTION_ID, &qsInputBuffer, qsSize))
{
/* Write arguments packed. */
if(qsResult == ssSuccess)
qsResult = PackedWrite_32(&qsInputBuffer, (uint32_t *)&RemainingLength);
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)Buffer);
if((qsResult == ssSuccess) && (Buffer != NULL))
{
qsResult = PackedWrite_Array(&qsInputBuffer, (void *)Buffer, sizeof(uint8_t), RemainingLength);
}
if(qsResult == ssSuccess)
qsResult = PackedWrite_PointerHeader(&qsInputBuffer, (void *)TransportBlockData);
if(qsResult == ssSuccess)
{
/* Send the command. */
if(SendCommand(&qsInputBuffer, &qsOutputBuffer) == ssSuccess)
{
if(qsOutputBuffer.Start != NULL)
{
/* Unpack returned values. */
if(qsResult == ssSuccess)
qsResult = PackedRead_int(&qsOutputBuffer, &qsBufferList, (int *)&qsRetVal);
if(qsResult == ssSuccess)
qsResult = PackedRead_PointerHeader(&qsOutputBuffer, &qsBufferList, &qsPointerValid);
if((qsResult == ssSuccess) && (qsPointerValid == TRUE))
{
qsResult = PackedRead_qapi_BLE_TRDS_Transport_Block_Data_t(&qsOutputBuffer, &qsBufferList, (qapi_BLE_TRDS_Transport_Block_Data_t *)TransportBlockData);
}
/* Set the return value to error if necessary. */
if(qsResult != ssSuccess)
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the output buffer. */
FreePackedBuffer(&qsOutputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_INTERNAL_ERROR;
}
/* Free the input buffer. */
FreePackedBuffer(&qsInputBuffer);
}
else
{
qsRetVal = QAPI_BLE_BTPS_ERROR_MEMORY_ALLOCATION_ERROR;
}
FreeBufferList(&qsBufferList);
return(qsRetVal);
}
int qapi_BLE_TRDS_Decode_Transport_Block(uint32_t RemainingLength, uint8_t *Buffer, qapi_BLE_TRDS_Transport_Block_Data_t *TransportBlockData)
{
return _qapi_BLE_TRDS_Decode_Transport_Block(qsTargetId, RemainingLength, Buffer, TransportBlockData);
}
|
655758.c | /*
* Copyright (c) 2017 SUSE LLC.
* 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 <vnet/sctp/sctp.h>
#include <vnet/sctp/sctp_debug.h>
sctp_main_t sctp_main;
static u32
sctp_connection_bind (u32 session_index, transport_endpoint_t * tep)
{
sctp_main_t *tm = &sctp_main;
sctp_connection_t *listener;
void *iface_ip;
pool_get (tm->listener_pool, listener);
clib_memset (listener, 0, sizeof (*listener));
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].subconn_idx =
SCTP_PRIMARY_PATH_IDX;
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].c_c_index =
listener - tm->listener_pool;
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.lcl_port = tep->port;
/* If we are provided a sw_if_index, bind using one of its IPs */
if (ip_is_zero (&tep->ip, 1) && tep->sw_if_index != ENDPOINT_INVALID_INDEX)
{
if ((iface_ip = ip_interface_get_first_ip (tep->sw_if_index,
tep->is_ip4)))
ip_set (&tep->ip, iface_ip, tep->is_ip4);
}
ip_copy (&listener->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.lcl_ip,
&tep->ip, tep->is_ip4);
u32 mtu = tep->is_ip4 ? vnet_sw_interface_get_mtu (vnet_get_main (),
tep->sw_if_index,
VNET_MTU_IP4) :
vnet_sw_interface_get_mtu (vnet_get_main (), tep->sw_if_index,
VNET_MTU_IP6);
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].PMTU = mtu;
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.is_ip4 = tep->is_ip4;
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.proto =
TRANSPORT_PROTO_SCTP;
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].c_s_index = session_index;
listener->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.fib_index =
tep->fib_index;
listener->state = SCTP_STATE_CLOSED;
sctp_connection_timers_init (listener);
return listener->sub_conn[SCTP_PRIMARY_PATH_IDX].c_c_index;
}
u32
sctp_session_bind (u32 session_index, transport_endpoint_t * tep)
{
return sctp_connection_bind (session_index, tep);
}
static void
sctp_connection_unbind (u32 listener_index)
{
sctp_main_t *tm = vnet_get_sctp_main ();
sctp_connection_t *sctp_conn;
sctp_conn = pool_elt_at_index (tm->listener_pool, listener_index);
/* Poison the entry */
if (CLIB_DEBUG > 0)
clib_memset (sctp_conn, 0xFA, sizeof (*sctp_conn));
pool_put_index (tm->listener_pool, listener_index);
}
u32
sctp_session_unbind (u32 listener_index)
{
sctp_connection_unbind (listener_index);
return 0;
}
void
sctp_punt_unknown (vlib_main_t * vm, u8 is_ip4, u8 is_add)
{
sctp_main_t *tm = &sctp_main;
if (is_ip4)
tm->punt_unknown4 = is_add;
else
tm->punt_unknown6 = is_add;
}
static int
sctp_alloc_custom_local_endpoint (sctp_main_t * tm, ip46_address_t * lcl_addr,
u16 * lcl_port, u8 is_ip4)
{
int index, port;
if (is_ip4)
{
index = tm->last_v4_address_rotor++;
if (tm->last_v4_address_rotor >= vec_len (tm->ip4_src_addresses))
tm->last_v4_address_rotor = 0;
lcl_addr->ip4.as_u32 = tm->ip4_src_addresses[index].as_u32;
}
else
{
index = tm->last_v6_address_rotor++;
if (tm->last_v6_address_rotor >= vec_len (tm->ip6_src_addresses))
tm->last_v6_address_rotor = 0;
clib_memcpy (&lcl_addr->ip6, &tm->ip6_src_addresses[index],
sizeof (ip6_address_t));
}
port = transport_alloc_local_port (TRANSPORT_PROTO_SCTP, lcl_addr);
if (port < 1)
{
clib_warning ("Failed to allocate src port");
return -1;
}
*lcl_port = port;
return 0;
}
/**
* Initialize all connection timers as invalid
*/
void
sctp_connection_timers_init (sctp_connection_t * sctp_conn)
{
int i, j;
/* Set all to invalid */
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
sctp_conn->sub_conn[i].RTO = SCTP_RTO_INIT;
for (j = 0; j < SCTP_N_TIMERS; j++)
{
sctp_conn->sub_conn[i].timers[j] = SCTP_TIMER_HANDLE_INVALID;
}
}
}
/**
* Stop all connection timers
*/
void
sctp_connection_timers_reset (sctp_connection_t * sctp_conn)
{
int i, j;
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
for (j = 0; j < SCTP_N_TIMERS; j++)
sctp_timer_reset (sctp_conn, i, j);
}
}
const char *sctp_fsm_states[] = {
#define _(sym, str) str,
foreach_sctp_fsm_state
#undef _
};
u8 *
format_sctp_state (u8 * s, va_list * args)
{
u32 state = va_arg (*args, u32);
if (state < SCTP_N_STATES)
s = format (s, "%s", sctp_fsm_states[state]);
else
s = format (s, "UNKNOWN (%d (0x%x))", state, state);
return s;
}
u8 *
format_sctp_connection_id (u8 * s, va_list * args)
{
sctp_connection_t *sctp_conn = va_arg (*args, sctp_connection_t *);
if (!sctp_conn)
return s;
u8 i;
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
if (sctp_conn->sub_conn[i].connection.is_ip4)
{
s = format (s, "%U[#%d][%s] %U:%d->%U:%d",
s,
sctp_conn->sub_conn[i].connection.thread_index,
"T",
format_ip4_address,
&sctp_conn->sub_conn[i].connection.lcl_ip.ip4,
clib_net_to_host_u16 (sctp_conn->sub_conn[i].
connection.lcl_port),
format_ip4_address,
&sctp_conn->sub_conn[i].connection.rmt_ip.ip4,
clib_net_to_host_u16 (sctp_conn->sub_conn[i].
connection.rmt_port));
}
else
{
s = format (s, "%U[#%d][%s] %U:%d->%U:%d",
s,
sctp_conn->sub_conn[i].connection.thread_index,
"T",
format_ip6_address,
&sctp_conn->sub_conn[i].connection.lcl_ip.ip6,
clib_net_to_host_u16 (sctp_conn->sub_conn[i].
connection.lcl_port),
format_ip6_address,
&sctp_conn->sub_conn[i].connection.rmt_ip.ip6,
clib_net_to_host_u16 (sctp_conn->sub_conn[i].
connection.rmt_port));
}
}
return s;
}
u8 *
format_sctp_connection (u8 * s, va_list * args)
{
sctp_connection_t *sctp_conn = va_arg (*args, sctp_connection_t *);
u32 verbose = va_arg (*args, u32);
if (!sctp_conn)
return s;
s = format (s, "%-50U", format_sctp_connection_id, sctp_conn);
if (verbose)
{
s = format (s, "%-15U", format_sctp_state, sctp_conn->state);
}
return s;
}
/**
* Initialize connection send variables.
*/
void
sctp_init_snd_vars (sctp_connection_t * sctp_conn)
{
u32 time_now;
/*
* We use the time to randomize iss and for setting up the initial
* timestamp. Make sure it's updated otherwise syn and ack in the
* handshake may make it look as if time has flown in the opposite
* direction for us.
*/
sctp_set_time_now (vlib_get_thread_index ());
time_now = sctp_time_now ();
sctp_conn->local_initial_tsn = random_u32 (&time_now);
sctp_conn->last_unacked_tsn = sctp_conn->local_initial_tsn;
sctp_conn->next_tsn = sctp_conn->local_initial_tsn + 1;
sctp_conn->remote_initial_tsn = 0x0;
sctp_conn->last_rcvd_tsn = sctp_conn->remote_initial_tsn;
}
always_inline sctp_connection_t *
sctp_sub_connection_add (u8 thread_index)
{
sctp_main_t *tm = vnet_get_sctp_main ();
sctp_connection_t *sctp_conn = tm->connections[thread_index];
u8 subconn_idx = sctp_next_avail_subconn (sctp_conn);
ASSERT (subconn_idx < MAX_SCTP_CONNECTIONS);
sctp_conn->sub_conn[subconn_idx].connection.c_index =
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.c_index;
sctp_conn->sub_conn[subconn_idx].connection.thread_index = thread_index;
sctp_conn->sub_conn[subconn_idx].subconn_idx = subconn_idx;
return sctp_conn;
}
u8
sctp_sub_connection_add_ip4 (vlib_main_t * vm,
ip4_address_t * lcl_addr,
ip4_address_t * rmt_addr)
{
sctp_connection_t *sctp_conn = sctp_sub_connection_add (vm->thread_index);
u8 subconn_idx = sctp_next_avail_subconn (sctp_conn);
if (subconn_idx == MAX_SCTP_CONNECTIONS)
return SCTP_ERROR_MAX_CONNECTIONS;
clib_memcpy (&sctp_conn->sub_conn[subconn_idx].connection.lcl_ip,
&lcl_addr, sizeof (lcl_addr));
clib_memcpy (&sctp_conn->sub_conn[subconn_idx].connection.rmt_ip,
&rmt_addr, sizeof (rmt_addr));
sctp_conn->forming_association_changed = 1;
return SCTP_ERROR_NONE;
}
u8
sctp_sub_connection_del_ip4 (ip4_address_t * lcl_addr,
ip4_address_t * rmt_addr)
{
sctp_main_t *sctp_main = vnet_get_sctp_main ();
u32 thread_idx = vlib_get_thread_index ();
u8 i;
ASSERT (thread_idx == 0);
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
sctp_connection_t *sctp_conn = sctp_main->connections[thread_idx];
sctp_sub_connection_t *sub_conn =
&sctp_main->connections[thread_idx]->sub_conn[i];
ip46_address_t *lcl_ip =
&sctp_main->connections[thread_idx]->sub_conn[i].connection.lcl_ip;
ip46_address_t *rmt_ip =
&sctp_main->connections[thread_idx]->sub_conn[i].connection.rmt_ip;
if (!sub_conn->connection.is_ip4)
continue;
if (lcl_ip->ip4.as_u32 == lcl_addr->as_u32 &&
rmt_ip->ip4.as_u32 == rmt_addr->as_u32)
{
sub_conn->state = SCTP_SUBCONN_STATE_DOWN;
sctp_conn->forming_association_changed = 1;
break;
}
}
return SCTP_ERROR_NONE;
}
u8
sctp_sub_connection_add_ip6 (vlib_main_t * vm,
ip6_address_t * lcl_addr,
ip6_address_t * rmt_addr)
{
sctp_connection_t *sctp_conn = sctp_sub_connection_add (vm->thread_index);
u8 subconn_idx = sctp_next_avail_subconn (sctp_conn);
if (subconn_idx == MAX_SCTP_CONNECTIONS)
return SCTP_ERROR_MAX_CONNECTIONS;
clib_memcpy (&sctp_conn->sub_conn[subconn_idx].connection.lcl_ip,
&lcl_addr, sizeof (lcl_addr));
clib_memcpy (&sctp_conn->sub_conn[subconn_idx].connection.rmt_ip,
&rmt_addr, sizeof (rmt_addr));
sctp_conn->forming_association_changed = 1;
return SCTP_ERROR_NONE;
}
u8
sctp_sub_connection_del_ip6 (ip6_address_t * lcl_addr,
ip6_address_t * rmt_addr)
{
sctp_main_t *sctp_main = vnet_get_sctp_main ();
u32 thread_idx = vlib_get_thread_index ();
u8 i;
ASSERT (thread_idx == 0);
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
sctp_connection_t *sctp_conn = sctp_main->connections[thread_idx];
sctp_sub_connection_t *sub_conn =
&sctp_main->connections[thread_idx]->sub_conn[i];
ip46_address_t *lcl_ip =
&sctp_main->connections[thread_idx]->sub_conn[i].connection.lcl_ip;
ip46_address_t *rmt_ip =
&sctp_main->connections[thread_idx]->sub_conn[i].connection.rmt_ip;
if (!sub_conn->connection.is_ip4)
continue;
if ((lcl_ip->ip6.as_u64[0] == lcl_addr->as_u64[0]
&& lcl_ip->ip6.as_u64[1] == lcl_addr->as_u64[1])
&& (rmt_ip->ip6.as_u64[0] == rmt_addr->as_u64[0]
&& rmt_ip->ip6.as_u64[1] == rmt_addr->as_u64[1]))
{
sub_conn->state = SCTP_SUBCONN_STATE_DOWN;
sctp_conn->forming_association_changed = 1;
break;
}
}
return SCTP_ERROR_NONE;
}
u8
sctp_configure (sctp_user_configuration_t config)
{
sctp_main_t *sctp_main = vnet_get_sctp_main ();
u32 thread_idx = vlib_get_thread_index ();
sctp_main->connections[thread_idx]->conn_config.never_delay_sack =
config.never_delay_sack;
sctp_main->connections[thread_idx]->conn_config.never_bundle =
config.never_bundle;
return 0;
}
sctp_connection_t *
sctp_connection_new (u8 thread_index)
{
sctp_main_t *sctp_main = vnet_get_sctp_main ();
sctp_connection_t *sctp_conn;
pool_get (sctp_main->connections[thread_index], sctp_conn);
clib_memset (sctp_conn, 0, sizeof (*sctp_conn));
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].subconn_idx =
SCTP_PRIMARY_PATH_IDX;
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].c_c_index =
sctp_conn - sctp_main->connections[thread_index];
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].c_thread_index = thread_index;
sctp_conn->local_tag = 0;
return sctp_conn;
}
sctp_connection_t *
sctp_half_open_connection_new (u8 thread_index)
{
sctp_main_t *tm = vnet_get_sctp_main ();
sctp_connection_t *sctp_conn = 0;
ASSERT (vlib_get_thread_index () == 0);
pool_get (tm->half_open_connections, sctp_conn);
clib_memset (sctp_conn, 0, sizeof (*sctp_conn));
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].c_c_index =
sctp_conn - tm->half_open_connections;
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].subconn_idx =
SCTP_PRIMARY_PATH_IDX;
return sctp_conn;
}
static inline int
sctp_connection_open (transport_endpoint_cfg_t * rmt)
{
sctp_main_t *tm = vnet_get_sctp_main ();
sctp_connection_t *sctp_conn;
ip46_address_t lcl_addr;
u16 lcl_port;
uword thread_id;
int rv;
u8 idx = SCTP_PRIMARY_PATH_IDX;
/*
* Allocate local endpoint
*/
if ((rmt->is_ip4 && vec_len (tm->ip4_src_addresses))
|| (!rmt->is_ip4 && vec_len (tm->ip6_src_addresses)))
rv = sctp_alloc_custom_local_endpoint (tm, &lcl_addr, &lcl_port,
rmt->is_ip4);
else
rv = transport_alloc_local_endpoint (TRANSPORT_PROTO_SCTP,
rmt, &lcl_addr, &lcl_port);
if (rv)
return -1;
/*
* Create connection and send INIT CHUNK
*/
thread_id = vlib_get_thread_index ();
ASSERT (thread_id == 0);
clib_spinlock_lock_if_init (&tm->half_open_lock);
sctp_conn = sctp_half_open_connection_new (thread_id);
u32 mtu = rmt->is_ip4 ? vnet_sw_interface_get_mtu (vnet_get_main (),
rmt->peer.sw_if_index,
VNET_MTU_IP4) :
vnet_sw_interface_get_mtu (vnet_get_main (), rmt->peer.sw_if_index,
VNET_MTU_IP6);
sctp_conn->sub_conn[idx].PMTU = mtu;
transport_connection_t *trans_conn = &sctp_conn->sub_conn[idx].connection;
ip_copy (&trans_conn->rmt_ip, &rmt->ip, rmt->is_ip4);
ip_copy (&trans_conn->lcl_ip, &lcl_addr, rmt->is_ip4);
sctp_conn->sub_conn[idx].subconn_idx = idx;
trans_conn->rmt_port = rmt->port;
trans_conn->lcl_port = clib_host_to_net_u16 (lcl_port);
trans_conn->is_ip4 = rmt->is_ip4;
trans_conn->proto = TRANSPORT_PROTO_SCTP;
trans_conn->fib_index = rmt->fib_index;
sctp_connection_timers_init (sctp_conn);
/* The other connection vars will be initialized after INIT_ACK chunk received */
sctp_init_snd_vars (sctp_conn);
sctp_send_init (sctp_conn);
clib_spinlock_unlock_if_init (&tm->half_open_lock);
return sctp_conn->sub_conn[idx].connection.c_index;
}
/**
* Cleans up connection state.
*
* No notifications.
*/
void
sctp_connection_cleanup (sctp_connection_t * sctp_conn)
{
sctp_main_t *tm = &sctp_main;
u8 i;
/* Cleanup local endpoint if this was an active connect */
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
transport_endpoint_cleanup (TRANSPORT_PROTO_SCTP,
&sctp_conn->sub_conn[i].connection.lcl_ip,
sctp_conn->sub_conn[i].connection.lcl_port);
int thread_index =
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.thread_index;
/* Make sure all timers are cleared */
sctp_connection_timers_reset (sctp_conn);
/* Poison the entry */
if (CLIB_DEBUG > 0)
clib_memset (sctp_conn, 0xFA, sizeof (*sctp_conn));
pool_put (tm->connections[thread_index], sctp_conn);
}
int
sctp_session_open (transport_endpoint_cfg_t * tep)
{
return sctp_connection_open (tep);
}
u16
sctp_check_outstanding_data_chunks (sctp_connection_t * sctp_conn)
{
u8 i;
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
if (sctp_conn->sub_conn[i].state == SCTP_SUBCONN_STATE_DOWN)
continue;
if (sctp_conn->sub_conn[i].is_retransmitting == 1 ||
sctp_conn->sub_conn[i].enqueue_state != SCTP_ERROR_ENQUEUED)
{
SCTP_DBG_OUTPUT
("Connection %u has still DATA to be enqueued inboud / outboud",
sctp_conn->sub_conn[i].connection.c_index);
return 1;
}
}
return 0; /* Indicates no more data to be read/sent */
}
void
sctp_connection_close (sctp_connection_t * sctp_conn)
{
SCTP_DBG ("Closing connection %u...",
sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].connection.c_index);
sctp_conn->state = SCTP_STATE_SHUTDOWN_PENDING;
sctp_send_shutdown (sctp_conn);
}
void
sctp_session_close (u32 conn_index, u32 thread_index)
{
ASSERT (thread_index == 0);
sctp_connection_t *sctp_conn =
sctp_connection_get (conn_index, thread_index);
if (sctp_conn != NULL)
sctp_connection_close (sctp_conn);
}
void
sctp_session_cleanup (u32 conn_index, u32 thread_index)
{
sctp_connection_t *sctp_conn =
sctp_connection_get (conn_index, thread_index);
if (sctp_conn != NULL)
{
sctp_connection_timers_reset (sctp_conn);
/* Wait for the session tx events to clear */
sctp_conn->state = SCTP_STATE_CLOSED;
}
}
/**
* Compute maximum segment size for session layer.
*/
u16
sctp_session_send_mss (transport_connection_t * trans_conn)
{
sctp_connection_t *sctp_conn =
sctp_get_connection_from_transport (trans_conn);
if (sctp_conn == NULL)
{
SCTP_DBG ("sctp_conn == NULL");
return 0;
}
update_cwnd (sctp_conn);
update_smallest_pmtu_idx (sctp_conn);
u8 idx = sctp_data_subconn_select (sctp_conn);
return sctp_conn->sub_conn[idx].cwnd;
}
u16
sctp_snd_space (sctp_connection_t * sctp_conn)
{
/* RFC 4096 Section 6.1; point (A) */
if (sctp_conn->peer_rwnd == 0)
return 0;
u8 idx = sctp_data_subconn_select (sctp_conn);
u32 available_wnd =
clib_min (sctp_conn->peer_rwnd, sctp_conn->sub_conn[idx].cwnd);
int flight_size = (int) (sctp_conn->next_tsn - sctp_conn->last_unacked_tsn);
if (available_wnd <= flight_size)
return 0;
/* Finally, let's subtract the DATA chunk headers overhead */
return available_wnd -
flight_size -
sizeof (sctp_payload_data_chunk_t) - sizeof (sctp_full_hdr_t);
}
/**
* Compute TX window session is allowed to fill.
*/
u32
sctp_session_send_space (transport_connection_t * trans_conn)
{
sctp_connection_t *sctp_conn =
sctp_get_connection_from_transport (trans_conn);
return sctp_snd_space (sctp_conn);
}
transport_connection_t *
sctp_session_get_transport (u32 conn_index, u32 thread_index)
{
sctp_connection_t *sctp_conn =
sctp_connection_get (conn_index, thread_index);
if (PREDICT_TRUE (sctp_conn != NULL))
return &sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].connection;
return NULL;
}
transport_connection_t *
sctp_session_get_listener (u32 listener_index)
{
sctp_main_t *tm = vnet_get_sctp_main ();
sctp_connection_t *sctp_conn;
sctp_conn = pool_elt_at_index (tm->listener_pool, listener_index);
return &sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].connection;
}
u8 *
format_sctp_session (u8 * s, va_list * args)
{
u32 tci = va_arg (*args, u32);
u32 thread_index = va_arg (*args, u32);
u32 verbose = va_arg (*args, u32);
sctp_connection_t *tc;
tc = sctp_connection_get (tci, thread_index);
if (tc)
s = format (s, "%U", format_sctp_connection, tc, verbose);
else
s = format (s, "empty\n");
return s;
}
u8 *
format_sctp_listener_session (u8 * s, va_list * args)
{
u32 tci = va_arg (*args, u32);
sctp_connection_t *tc = sctp_listener_get (tci);
return format (s, "%U", format_sctp_connection_id, tc);
}
void
sctp_expired_timers_cb (u32 conn_index, u32 timer_id)
{
sctp_connection_t *sctp_conn;
SCTP_DBG ("%s expired", sctp_timer_to_string (timer_id));
sctp_conn = sctp_connection_get (conn_index, vlib_get_thread_index ());
/* note: the connection may have already disappeared */
if (PREDICT_FALSE (sctp_conn == 0))
return;
if (sctp_conn->sub_conn[conn_index].unacknowledged_hb >
SCTP_PATH_MAX_RETRANS)
{
// The remote-peer is considered to be unreachable hence shutting down
u8 i, total_subs_down = 1;
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
if (sctp_conn->sub_conn[i].state == SCTP_SUBCONN_STATE_DOWN)
continue;
u32 now = sctp_time_now ();
if (now > (sctp_conn->sub_conn[i].last_seen + SCTP_HB_INTERVAL))
{
total_subs_down += 1;
sctp_conn->sub_conn[i].state = SCTP_SUBCONN_STATE_DOWN;
}
}
if (total_subs_down == MAX_SCTP_CONNECTIONS)
{
/* Start cleanup. App wasn't notified yet so use delete notify as
* opposed to delete to cleanup session layer state. */
stream_session_delete_notify (&sctp_conn->sub_conn
[SCTP_PRIMARY_PATH_IDX].connection);
sctp_connection_timers_reset (sctp_conn);
sctp_connection_cleanup (sctp_conn);
}
return;
}
switch (timer_id)
{
case SCTP_TIMER_T1_INIT:
sctp_send_init (sctp_conn);
break;
case SCTP_TIMER_T1_COOKIE:
sctp_send_cookie_echo (sctp_conn);
break;
case SCTP_TIMER_T2_SHUTDOWN:
sctp_send_shutdown (sctp_conn);
break;
case SCTP_TIMER_T3_RXTX:
sctp_timer_reset (sctp_conn, conn_index, timer_id);
sctp_conn->flags |= SCTP_CONN_RECOVERY;
sctp_data_retransmit (sctp_conn);
break;
case SCTP_TIMER_T4_HEARTBEAT:
sctp_timer_reset (sctp_conn, conn_index, timer_id);
goto heartbeat;
}
return;
heartbeat:
sctp_send_heartbeat (sctp_conn);
}
static void
sctp_expired_timers_dispatch (u32 * expired_timers)
{
int i;
u32 connection_index, timer_id;
for (i = 0; i < vec_len (expired_timers); i++)
{
/* Get session index and timer id */
connection_index = expired_timers[i] & 0x0FFFFFFF;
timer_id = expired_timers[i] >> 28;
SCTP_DBG ("Expired timer ID: %u", timer_id);
/* Handle expiration */
sctp_expired_timers_cb (connection_index, timer_id);
}
}
void
sctp_initialize_timer_wheels (sctp_main_t * tm)
{
tw_timer_wheel_16t_2w_512sl_t *tw;
/* *INDENT-OFF* */
foreach_vlib_main (({
tw = &tm->timer_wheels[ii];
tw_timer_wheel_init_16t_2w_512sl (tw, sctp_expired_timers_dispatch,
100e-3 /* timer period 100ms */ , ~0);
tw->last_run_time = vlib_time_now (this_vlib_main);
}));
/* *INDENT-ON* */
}
clib_error_t *
sctp_main_enable (vlib_main_t * vm)
{
sctp_main_t *tm = vnet_get_sctp_main ();
vlib_thread_main_t *vtm = vlib_get_thread_main ();
clib_error_t *error = 0;
u32 num_threads;
int thread;
sctp_connection_t *sctp_conn __attribute__ ((unused));
u32 preallocated_connections_per_thread;
if ((error = vlib_call_init_function (vm, ip_main_init)))
return error;
if ((error = vlib_call_init_function (vm, ip4_lookup_init)))
return error;
if ((error = vlib_call_init_function (vm, ip6_lookup_init)))
return error;
/*
* Registrations
*/
ip4_register_protocol (IP_PROTOCOL_SCTP, sctp4_input_node.index);
ip6_register_protocol (IP_PROTOCOL_SCTP, sctp6_input_node.index);
/*
* Initialize data structures
*/
num_threads = 1 /* main thread */ + vtm->n_threads;
vec_validate (tm->connections, num_threads - 1);
/*
* Preallocate connections. Assume that thread 0 won't
* use preallocated threads when running multi-core
*/
if (num_threads == 1)
{
thread = 0;
preallocated_connections_per_thread = tm->preallocated_connections;
}
else
{
thread = 1;
preallocated_connections_per_thread =
tm->preallocated_connections / (num_threads - 1);
}
for (; thread < num_threads; thread++)
{
if (preallocated_connections_per_thread)
pool_init_fixed (tm->connections[thread],
preallocated_connections_per_thread);
}
/* Initialize per worker thread tx buffers (used for control messages) */
vec_validate (tm->tx_buffers, num_threads - 1);
/* Initialize timer wheels */
vec_validate (tm->timer_wheels, num_threads - 1);
sctp_initialize_timer_wheels (tm);
/* Initialize clocks per tick for SCTP timestamp. Used to compute
* monotonically increasing timestamps. */
tm->tstamp_ticks_per_clock = vm->clib_time.seconds_per_clock
/ SCTP_TSTAMP_RESOLUTION;
if (num_threads > 1)
{
clib_spinlock_init (&tm->half_open_lock);
}
vec_validate (tm->tx_frames[0], num_threads - 1);
vec_validate (tm->tx_frames[1], num_threads - 1);
vec_validate (tm->ip_lookup_tx_frames[0], num_threads - 1);
vec_validate (tm->ip_lookup_tx_frames[1], num_threads - 1);
tm->bytes_per_buffer = vlib_buffer_free_list_buffer_size
(vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
vec_validate (tm->time_now, num_threads - 1);
return error;
}
clib_error_t *
sctp_enable_disable (vlib_main_t * vm, u8 is_en)
{
if (is_en)
{
if (sctp_main.is_enabled)
return 0;
return sctp_main_enable (vm);
}
else
{
sctp_main.is_enabled = 0;
}
return 0;
}
transport_connection_t *
sctp_half_open_session_get_transport (u32 conn_index)
{
sctp_connection_t *sctp_conn = sctp_half_open_connection_get (conn_index);
return &sctp_conn->sub_conn[SCTP_PRIMARY_PATH_IDX].connection;
}
u8 *
format_sctp_half_open (u8 * s, va_list * args)
{
u32 tci = va_arg (*args, u32);
sctp_connection_t *sctp_conn = sctp_half_open_connection_get (tci);
return format (s, "%U", format_sctp_connection_id, sctp_conn);
}
void
sctp_update_time (f64 now, u8 thread_index)
{
sctp_set_time_now (thread_index);
tw_timer_expire_timers_16t_2w_512sl (&sctp_main.timer_wheels[thread_index],
now);
sctp_flush_frames_to_output (thread_index);
}
/* *INDENT OFF* */
const static transport_proto_vft_t sctp_proto = {
.enable = sctp_enable_disable,
.bind = sctp_session_bind,
.unbind = sctp_session_unbind,
.open = sctp_session_open,
.close = sctp_session_close,
.cleanup = sctp_session_cleanup,
.push_header = sctp_push_header,
.send_mss = sctp_session_send_mss,
.send_space = sctp_session_send_space,
.update_time = sctp_update_time,
.get_connection = sctp_session_get_transport,
.get_listener = sctp_session_get_listener,
.get_half_open = sctp_half_open_session_get_transport,
.format_connection = format_sctp_session,
.format_listener = format_sctp_listener_session,
.format_half_open = format_sctp_half_open,
.tx_type = TRANSPORT_TX_DEQUEUE,
.service_type = TRANSPORT_SERVICE_VC,
};
/* *INDENT ON* */
clib_error_t *
sctp_init (vlib_main_t * vm)
{
sctp_main_t *tm = vnet_get_sctp_main ();
ip_main_t *im = &ip_main;
ip_protocol_info_t *pi;
/* Session layer, and by implication SCTP, are disabled by default */
tm->is_enabled = 0;
/* Register with IP for header parsing */
pi = ip_get_protocol_info (im, IP_PROTOCOL_SCTP);
if (pi == 0)
return clib_error_return (0, "SCTP protocol info AWOL");
pi->format_header = format_sctp_header;
pi->unformat_pg_edit = unformat_pg_sctp_header;
/* Register as transport with session layer */
transport_register_protocol (TRANSPORT_PROTO_SCTP, &sctp_proto,
FIB_PROTOCOL_IP4, sctp4_output_node.index);
transport_register_protocol (TRANSPORT_PROTO_SCTP, &sctp_proto,
FIB_PROTOCOL_IP6, sctp6_output_node.index);
sctp_api_reference ();
return 0;
}
VLIB_INIT_FUNCTION (sctp_init);
static clib_error_t *
show_sctp_punt_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd_arg)
{
sctp_main_t *tm = &sctp_main;
if (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
return clib_error_return (0, "unknown input `%U'", format_unformat_error,
input);
vlib_cli_output (vm, "IPv4 UDP punt: %s",
tm->punt_unknown4 ? "enabled" : "disabled");
vlib_cli_output (vm, "IPv6 UDP punt: %s",
tm->punt_unknown6 ? "enabled" : "disabled");
return 0;
}
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (show_tcp_punt_command, static) =
{
.path = "show sctp punt",
.short_help = "show sctp punt",
.function = show_sctp_punt_fn,
};
/* *INDENT-ON* */
/*
* fd.io coding-style-patch-verification: ON
*
* Local Variables:
* eval: (c-set-style "gnu")
* End:
*/
|
784461.c | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54c.c
Label Definition File: CWE134_Uncontrolled_Format_String.label.xml
Template File: sources-sinks-54c.tmpl.c
*/
/*
* @description
* CWE: 134 Uncontrolled Format String
* BadSource: connect_socket Read data using a connect socket (client side)
* GoodSource: Copy a fixed string into data
* Sinks: printf
* GoodSink: printf with "%s" as the first argument and data as the second
* BadSink : printf with only data as an argument
* Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different source files
*
* */
#include "std_testcase.h"
#ifdef _WIN32
# include <winsock2.h>
# include <windows.h>
# include <direct.h>
# pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
# define CLOSE_SOCKET closesocket
# define PATH_SZ 100
#else /* NOT _WIN32 */
# define INVALID_SOCKET -1
# define SOCKET_ERROR -1
# define CLOSE_SOCKET close
# define SOCKET int
# define PATH_SZ PATH_MAX
#endif
#define TCP_PORT 27015
#ifndef OMITBAD
/* bad function declaration */
void CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54d_bad_sink(char * data);
void CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54c_bad_sink(char * data)
{
CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54d_bad_sink(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54d_goodG2B_sink(char * data);
void CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54c_goodG2B_sink(char * data)
{
CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54d_goodG2B_sink(data);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54d_goodB2G_sink(char * data);
void CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54c_goodB2G_sink(char * data)
{
CWE134_Uncontrolled_Format_String__char_connect_socket_printf_54d_goodB2G_sink(data);
}
#endif /* OMITGOOD */
|
94105.c | /*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/curve/editcurve_paint.c
* \ingroup edcurve
*/
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_mempool.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_curve.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "curve_intern.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#define USE_SPLINE_FIT
#ifdef USE_SPLINE_FIT
#include "curve_fit_nd.h"
#endif
/* Distance between input samples */
#define STROKE_SAMPLE_DIST_MIN_PX 1
#define STROKE_SAMPLE_DIST_MAX_PX 3
/* Distance between start/end points to consider cyclic */
#define STROKE_CYCLIC_DIST_PX 8
/* -------------------------------------------------------------------- */
/** \name Depth Utilities
* \{ */
static float depth_read_zbuf(const ViewContext *vc, int x, int y)
{
ViewDepths *vd = vc->rv3d->depths;
if (vd && vd->depths && x > 0 && y > 0 && x < vd->w && y < vd->h)
return vd->depths[y * vd->w + x];
else
return -1.0f;
}
static bool depth_unproject(
const ARegion *ar, const bglMats *mats,
const int mval[2], const double depth,
float r_location_world[3])
{
double p[3];
if (gluUnProject(
(double)ar->winrct.xmin + mval[0] + 0.5,
(double)ar->winrct.ymin + mval[1] + 0.5,
depth, mats->modelview, mats->projection, (const GLint *)mats->viewport,
&p[0], &p[1], &p[2]))
{
copy_v3fl_v3db(r_location_world, p);
return true;
}
return false;
}
static bool depth_read_normal(
const ViewContext *vc, const bglMats *mats, const int mval[2],
float r_normal[3])
{
/* pixels surrounding */
bool depths_valid[9] = {false};
float coords[9][3] = {{0}};
ARegion *ar = vc->ar;
const ViewDepths *depths = vc->rv3d->depths;
for (int x = 0, i = 0; x < 2; x++) {
for (int y = 0; y < 2; y++) {
const int mval_ofs[2] = {mval[0] + (x - 1), mval[1] + (y - 1)};
const double depth = (double)depth_read_zbuf(vc, mval_ofs[0], mval_ofs[1]);
if ((depth > depths->depth_range[0]) && (depth < depths->depth_range[1])) {
if (depth_unproject(ar, mats, mval_ofs, depth, coords[i])) {
depths_valid[i] = true;
}
}
i++;
}
}
const int edges[2][6][2] = {
/* x edges */
{{0, 1}, {1, 2},
{3, 4}, {4, 5},
{6, 7}, {7, 8}},
/* y edges */
{{0, 3}, {3, 6},
{1, 4}, {4, 7},
{2, 5}, {5, 8}},
};
float cross[2][3] = {{0.0f}};
for (int i = 0; i < 6; i++) {
for (int axis = 0; axis < 2; axis++) {
if (depths_valid[edges[axis][i][0]] && depths_valid[edges[axis][i][1]]) {
float delta[3];
sub_v3_v3v3(delta, coords[edges[axis][i][0]], coords[edges[axis][i][1]]);
add_v3_v3(cross[axis], delta);
}
}
}
cross_v3_v3v3(r_normal, cross[0], cross[1]);
if (normalize_v3(r_normal) != 0.0f) {
return true;
}
else {
return false;
}
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name StrokeElem / #RNA_OperatorStrokeElement Conversion Functions
* \{ */
struct StrokeElem {
float mval[2];
float location_world[3];
float location_local[3];
/* surface normal, may be zero'd */
float normal_world[3];
float normal_local[3];
float pressure;
};
struct CurveDrawData {
short init_event_type;
short curve_type;
/* projecting 2D into 3D space */
struct {
/* use a plane or project to the surface */
bool use_plane;
float plane[4];
/* use 'rv3d->depths', note that this will become 'damaged' while drawing, but thats OK. */
bool use_depth;
/* offset projection by this value */
bool use_offset;
float offset[3]; /* worldspace */
float surface_offset;
bool use_surface_offset_absolute;
} project;
/* cursor sampling */
struct {
/* use substeps, needed for nicely interpolating depth */
bool use_substeps;
} sample;
struct {
float min, max, range;
} radius;
struct {
float mouse[2];
/* used incase we can't calculate the depth */
float location_world[3];
float location_world_valid[3];
const struct StrokeElem *selem;
} prev;
ViewContext vc;
bglMats mats;
enum {
CURVE_DRAW_IDLE = 0,
CURVE_DRAW_PAINTING = 1,
} state;
/* StrokeElem */
BLI_mempool *stroke_elem_pool;
void *draw_handle_view;
};
static float stroke_elem_radius_from_pressure(const struct CurveDrawData *cdd, const float pressure)
{
const Curve *cu = cdd->vc.obedit->data;
return ((pressure * cdd->radius.range) + cdd->radius.min) * cu->ext2;
}
static float stroke_elem_radius(const struct CurveDrawData *cdd, const struct StrokeElem *selem)
{
return stroke_elem_radius_from_pressure(cdd, selem->pressure);
}
static void stroke_elem_pressure_set(const struct CurveDrawData *cdd, struct StrokeElem *selem, float pressure)
{
if ((cdd->project.surface_offset != 0.0f) &&
!cdd->project.use_surface_offset_absolute &&
!is_zero_v3(selem->normal_local))
{
const float adjust = stroke_elem_radius_from_pressure(cdd, pressure) -
stroke_elem_radius_from_pressure(cdd, selem->pressure);
madd_v3_v3fl(selem->location_local, selem->normal_local, adjust);
mul_v3_m4v3(selem->location_world, cdd->vc.obedit->obmat, selem->location_local);
}
selem->pressure = pressure;
}
static void stroke_elem_interp(
struct StrokeElem *selem_out,
const struct StrokeElem *selem_a, const struct StrokeElem *selem_b, float t)
{
interp_v2_v2v2(selem_out->mval, selem_a->mval, selem_b->mval, t);
interp_v3_v3v3(selem_out->location_world, selem_a->location_world, selem_b->location_world, t);
interp_v3_v3v3(selem_out->location_local, selem_a->location_local, selem_b->location_local, t);
selem_out->pressure = interpf(selem_a->pressure, selem_b->pressure, t);
}
/**
* Sets the depth from #StrokeElem.mval
*/
static bool stroke_elem_project(
const struct CurveDrawData *cdd,
const int mval_i[2], const float mval_fl[2],
float surface_offset, const float radius,
float r_location_world[3], float r_normal_world[3])
{
View3D *v3d = cdd->vc.v3d;
ARegion *ar = cdd->vc.ar;
RegionView3D *rv3d = cdd->vc.rv3d;
bool is_location_world_set = false;
/* project to 'location_world' */
if (cdd->project.use_plane) {
/* get the view vector to 'location' */
float ray_origin[3], ray_direction[3];
ED_view3d_win_to_ray(cdd->vc.ar, v3d, mval_fl, ray_origin, ray_direction, false);
float lambda;
if (isect_ray_plane_v3(ray_origin, ray_direction, cdd->project.plane, &lambda, true)) {
madd_v3_v3v3fl(r_location_world, ray_origin, ray_direction, lambda);
if (r_normal_world) {
zero_v3(r_normal_world);
}
is_location_world_set = true;
}
}
else {
const ViewDepths *depths = rv3d->depths;
if (depths &&
((unsigned int)mval_i[0] < depths->w) &&
((unsigned int)mval_i[1] < depths->h))
{
const double depth = (double)depth_read_zbuf(&cdd->vc, mval_i[0], mval_i[1]);
if ((depth > depths->depth_range[0]) && (depth < depths->depth_range[1])) {
if (depth_unproject(ar, &cdd->mats, mval_i, depth, r_location_world)) {
is_location_world_set = true;
if (r_normal_world) {
zero_v3(r_normal_world);
}
if (surface_offset != 0.0f) {
const float offset = cdd->project.use_surface_offset_absolute ? 1.0f : radius;
float normal[3];
if (depth_read_normal(&cdd->vc, &cdd->mats, mval_i, normal)) {
madd_v3_v3fl(r_location_world, normal, offset * surface_offset);
if (r_normal_world) {
copy_v3_v3(r_normal_world, normal);
}
}
}
}
}
}
}
if (is_location_world_set) {
if (cdd->project.use_offset) {
add_v3_v3(r_location_world, cdd->project.offset);
}
}
return is_location_world_set;
}
static bool stroke_elem_project_fallback(
const struct CurveDrawData *cdd,
const int mval_i[2], const float mval_fl[2],
const float surface_offset, const float radius,
const float location_fallback_depth[3],
float r_location_world[3], float r_location_local[3],
float r_normal_world[3], float r_normal_local[3])
{
bool is_depth_found = stroke_elem_project(
cdd, mval_i, mval_fl,
surface_offset, radius,
r_location_world, r_normal_world);
if (is_depth_found == false) {
ED_view3d_win_to_3d(cdd->vc.v3d, cdd->vc.ar, location_fallback_depth, mval_fl, r_location_world);
zero_v3(r_normal_local);
}
mul_v3_m4v3(r_location_local, cdd->vc.obedit->imat, r_location_world);
if (!is_zero_v3(r_normal_world)) {
copy_v3_v3(r_normal_local, r_normal_world);
mul_transposed_mat3_m4_v3(cdd->vc.obedit->obmat, r_normal_local);
normalize_v3(r_normal_local);
}
else {
zero_v3(r_normal_local);
}
return is_depth_found;
}
/**
* \note #StrokeElem.mval & #StrokeElem.pressure must be set first.
*/
static bool stroke_elem_project_fallback_elem(
const struct CurveDrawData *cdd,
const float location_fallback_depth[3],
struct StrokeElem *selem)
{
const int mval_i[2] = {UNPACK2(selem->mval)};
const float radius = stroke_elem_radius(cdd, selem);
return stroke_elem_project_fallback(
cdd, mval_i, selem->mval,
cdd->project.surface_offset, radius,
location_fallback_depth,
selem->location_world, selem->location_local,
selem->normal_world, selem->normal_local);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Operator/Stroke Conversion
* \{ */
static void curve_draw_stroke_to_operator_elem(
wmOperator *op, const struct StrokeElem *selem)
{
PointerRNA itemptr;
RNA_collection_add(op->ptr, "stroke", &itemptr);
RNA_float_set_array(&itemptr, "mouse", selem->mval);
RNA_float_set_array(&itemptr, "location", selem->location_world);
RNA_float_set(&itemptr, "pressure", selem->pressure);
}
static void curve_draw_stroke_from_operator_elem(
wmOperator *op, PointerRNA *itemptr)
{
struct CurveDrawData *cdd = op->customdata;
struct StrokeElem *selem = BLI_mempool_calloc(cdd->stroke_elem_pool);
RNA_float_get_array(itemptr, "mouse", selem->mval);
RNA_float_get_array(itemptr, "location", selem->location_world);
mul_v3_m4v3(selem->location_local, cdd->vc.obedit->imat, selem->location_world);
selem->pressure = RNA_float_get(itemptr, "pressure");
}
static void curve_draw_stroke_to_operator(wmOperator *op)
{
struct CurveDrawData *cdd = op->customdata;
BLI_mempool_iter iter;
const struct StrokeElem *selem;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter)) {
curve_draw_stroke_to_operator_elem(op, selem);
}
}
static void curve_draw_stroke_from_operator(wmOperator *op)
{
RNA_BEGIN (op->ptr, itemptr, "stroke")
{
curve_draw_stroke_from_operator_elem(op, &itemptr);
}
RNA_END;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Operator Callbacks & Helpers
* \{ */
static void curve_draw_stroke_3d(const struct bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg)
{
wmOperator *op = arg;
struct CurveDrawData *cdd = op->customdata;
const int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool);
if (stroke_len == 0) {
return;
}
View3D *v3d = cdd->vc.v3d;
Object *obedit = cdd->vc.obedit;
Curve *cu = obedit->data;
UI_ThemeColor(TH_WIRE);
if (cu->ext2 > 0.0f) {
GLUquadricObj *qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
BLI_mempool_iter iter;
const struct StrokeElem *selem;
const float location_zero[3] = {0};
const float *location_prev = location_zero;
/* scale to edit-mode space */
glPushMatrix();
glMultMatrixf(obedit->obmat);
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter)) {
glTranslatef(
selem->location_local[0] - location_prev[0],
selem->location_local[1] - location_prev[1],
selem->location_local[2] - location_prev[2]);
location_prev = selem->location_local;
const float radius = stroke_elem_radius(cdd, selem);
gluSphere(qobj, radius, 12, 8);
location_prev = selem->location_local;
}
glPopMatrix();
gluDeleteQuadric(qobj);
}
if (stroke_len > 1) {
float (*coord_array)[3] = MEM_mallocN(sizeof(*coord_array) * stroke_len, __func__);
{
BLI_mempool_iter iter;
const struct StrokeElem *selem;
int i;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
for (selem = BLI_mempool_iterstep(&iter), i = 0; selem; selem = BLI_mempool_iterstep(&iter), i++) {
copy_v3_v3(coord_array[i], selem->location_world);
}
}
{
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, coord_array);
cpack(0x0);
glLineWidth(3.0f);
glDrawArrays(GL_LINE_STRIP, 0, stroke_len);
if (v3d->zbuf)
glDisable(GL_DEPTH_TEST);
cpack(0xffffffff);
glLineWidth(1.0f);
glDrawArrays(GL_LINE_STRIP, 0, stroke_len);
if (v3d->zbuf)
glEnable(GL_DEPTH_TEST);
glDisableClientState(GL_VERTEX_ARRAY);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
}
MEM_freeN(coord_array);
}
}
static void curve_draw_event_add(wmOperator *op, const wmEvent *event)
{
struct CurveDrawData *cdd = op->customdata;
Object *obedit = cdd->vc.obedit;
invert_m4_m4(obedit->imat, obedit->obmat);
struct StrokeElem *selem = BLI_mempool_calloc(cdd->stroke_elem_pool);
ARRAY_SET_ITEMS(selem->mval, event->mval[0], event->mval[1]);
/* handle pressure sensitivity (which is supplied by tablets) */
if (event->tablet_data) {
const wmTabletData *wmtab = event->tablet_data;
selem->pressure = wmtab->Pressure;
}
else {
selem->pressure = 1.0f;
}
bool is_depth_found = stroke_elem_project_fallback_elem(
cdd, cdd->prev.location_world_valid, selem);
if (is_depth_found) {
/* use the depth if a fallback wasn't used */
copy_v3_v3(cdd->prev.location_world_valid, selem->location_world);
}
copy_v3_v3(cdd->prev.location_world, selem->location_world);
float len_sq = len_squared_v2v2(cdd->prev.mouse, selem->mval);
copy_v2_v2(cdd->prev.mouse, selem->mval);
if (cdd->sample.use_substeps && cdd->prev.selem) {
const struct StrokeElem selem_target = *selem;
struct StrokeElem *selem_new_last = selem;
if (len_sq >= SQUARE(STROKE_SAMPLE_DIST_MAX_PX)) {
int n = (int)ceil(sqrt((double)len_sq)) / STROKE_SAMPLE_DIST_MAX_PX ;
for (int i = 1; i < n; i++) {
struct StrokeElem *selem_new = selem_new_last;
stroke_elem_interp(selem_new, cdd->prev.selem, &selem_target, (float)i / n);
const bool is_depth_found_substep = stroke_elem_project_fallback_elem(
cdd, cdd->prev.location_world_valid, selem_new);
if (is_depth_found == false) {
if (is_depth_found_substep) {
copy_v3_v3(cdd->prev.location_world_valid, selem_new->location_world);
}
}
selem_new_last = BLI_mempool_calloc(cdd->stroke_elem_pool);
}
}
selem = selem_new_last;
*selem_new_last = selem_target;
}
cdd->prev.selem = selem;
ED_region_tag_redraw(cdd->vc.ar);
}
static void curve_draw_event_add_first(wmOperator *op, const wmEvent *event)
{
struct CurveDrawData *cdd = op->customdata;
const CurvePaintSettings *cps = &cdd->vc.scene->toolsettings->curve_paint_settings;
/* add first point */
curve_draw_event_add(op, event);
if ((cps->depth_mode == CURVE_PAINT_PROJECT_SURFACE) && cdd->project.use_depth &&
(cps->flag & CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS))
{
RegionView3D *rv3d = cdd->vc.rv3d;
cdd->project.use_depth = false;
cdd->project.use_plane = true;
float normal[3] = {0.0f};
if (ELEM(cps->surface_plane,
CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW,
CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE))
{
if (depth_read_normal(&cdd->vc, &cdd->mats, event->mval, normal)) {
if (cps->surface_plane == CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW) {
float cross_a[3], cross_b[3];
cross_v3_v3v3(cross_a, rv3d->viewinv[2], normal);
cross_v3_v3v3(cross_b, normal, cross_a);
copy_v3_v3(normal, cross_b);
}
}
}
/* CURVE_PAINT_SURFACE_PLANE_VIEW or fallback */
if (is_zero_v3(normal)) {
copy_v3_v3(normal, rv3d->viewinv[2]);
}
normalize_v3_v3(cdd->project.plane, normal);
cdd->project.plane[3] = -dot_v3v3(cdd->project.plane, cdd->prev.location_world_valid);
/* Special case for when we only have offset applied on the first-hit,
* the remaining stroke must be offset too. */
if (cdd->project.surface_offset != 0.0f) {
const float mval_fl[2] = {UNPACK2(event->mval)};
float location_no_offset[3];
if (stroke_elem_project(
cdd, event->mval, mval_fl, 0.0f, 0.0f,
location_no_offset, NULL))
{
sub_v3_v3v3(cdd->project.offset, cdd->prev.location_world_valid, location_no_offset);
if (!is_zero_v3(cdd->project.offset)) {
cdd->project.use_offset = true;
}
}
}
/* end special case */
}
cdd->init_event_type = event->type;
cdd->state = CURVE_DRAW_PAINTING;
}
static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke)
{
BLI_assert(op->customdata == NULL);
struct CurveDrawData *cdd = MEM_callocN(sizeof(*cdd), __func__);
if (is_invoke) {
view3d_set_viewcontext(C, &cdd->vc);
if (ELEM(NULL, cdd->vc.ar, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) {
MEM_freeN(cdd);
BKE_report(op->reports, RPT_ERROR, "Unable to access 3D viewport");
return false;
}
}
else {
cdd->vc.scene = CTX_data_scene(C);
cdd->vc.obedit = CTX_data_edit_object(C);
}
op->customdata = cdd;
const CurvePaintSettings *cps = &cdd->vc.scene->toolsettings->curve_paint_settings;
cdd->curve_type = cps->curve_type;
cdd->radius.min = cps->radius_min;
cdd->radius.max = cps->radius_max;
cdd->radius.range = cps->radius_max - cps->radius_min;
cdd->project.surface_offset = cps->surface_offset;
cdd->project.use_surface_offset_absolute = (cps->flag & CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS) != 0;
cdd->stroke_elem_pool = BLI_mempool_create(
sizeof(struct StrokeElem), 0, 512, BLI_MEMPOOL_ALLOW_ITER);
return true;
}
static void curve_draw_exit(wmOperator *op)
{
struct CurveDrawData *cdd = op->customdata;
if (cdd) {
if (cdd->draw_handle_view) {
ED_region_draw_cb_exit(cdd->vc.ar->type, cdd->draw_handle_view);
WM_cursor_modal_restore(cdd->vc.win);
}
if (cdd->stroke_elem_pool) {
BLI_mempool_destroy(cdd->stroke_elem_pool);
}
MEM_freeN(cdd);
op->customdata = NULL;
}
}
/**
* Initialize values before calling 'exec' (when running interactively).
*/
static void curve_draw_exec_precalc(wmOperator *op)
{
struct CurveDrawData *cdd = op->customdata;
const CurvePaintSettings *cps = &cdd->vc.scene->toolsettings->curve_paint_settings;
PropertyRNA *prop;
prop = RNA_struct_find_property(op->ptr, "fit_method");
if (!RNA_property_is_set(op->ptr, prop)) {
RNA_property_enum_set(op->ptr, prop, cps->fit_method);
}
prop = RNA_struct_find_property(op->ptr, "corner_angle");
if (!RNA_property_is_set(op->ptr, prop)) {
const float corner_angle = (cps->flag & CURVE_PAINT_FLAG_CORNERS_DETECT) ? cps->corner_angle : (float)M_PI;
RNA_property_float_set(op->ptr, prop, corner_angle);
}
prop = RNA_struct_find_property(op->ptr, "error_threshold");
if (!RNA_property_is_set(op->ptr, prop)) {
/* error isnt set so we'll have to calculate it from the pixel values */
BLI_mempool_iter iter;
const struct StrokeElem *selem, *selem_prev;
float len_3d = 0.0f, len_2d = 0.0f;
float scale_px; /* pixel to local space scale */
int i = 0;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
selem_prev = BLI_mempool_iterstep(&iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter), i++) {
len_3d += len_v3v3(selem->location_local, selem_prev->location_local);
len_2d += len_v2v2(selem->mval, selem_prev->mval);
selem_prev = selem;
}
scale_px = ((len_3d > 0.0f) && (len_2d > 0.0f)) ? (len_3d / len_2d) : 0.0f;
float error_threshold = (cps->error_threshold * U.pixelsize) * scale_px;
RNA_property_float_set(op->ptr, prop, error_threshold);
}
prop = RNA_struct_find_property(op->ptr, "use_cyclic");
if (!RNA_property_is_set(op->ptr, prop)) {
bool use_cyclic = false;
if (BLI_mempool_count(cdd->stroke_elem_pool) > 2) {
BLI_mempool_iter iter;
const struct StrokeElem *selem, *selem_first, *selem_last;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
selem_first = BLI_mempool_iterstep(&iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter)) {
selem_last = selem;
}
if (len_squared_v2v2(
selem_first->mval,
selem_last->mval) <= SQUARE(STROKE_CYCLIC_DIST_PX * U.pixelsize))
{
use_cyclic = true;
}
}
RNA_property_boolean_set(op->ptr, prop, use_cyclic);
}
if ((cps->radius_taper_start != 0.0f) ||
(cps->radius_taper_end != 0.0f))
{
/* note, we could try to de-duplicate the length calculations above */
const int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool);
BLI_mempool_iter iter;
struct StrokeElem *selem, *selem_prev;
float *lengths = MEM_mallocN(sizeof(float) * stroke_len, __func__);
struct StrokeElem **selem_array = MEM_mallocN(sizeof(*selem_array) * stroke_len, __func__);
lengths[0] = 0.0f;
float len_3d = 0.0f;
int i = 1;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
selem_prev = BLI_mempool_iterstep(&iter);
selem_array[0] = selem_prev;
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter), i++) {
const float len_3d_segment = len_v3v3(selem->location_local, selem_prev->location_local);
len_3d += len_3d_segment;
lengths[i] = len_3d;
selem_array[i] = selem;
selem_prev = selem;
}
if (cps->radius_taper_start != 0.0f) {
const float len_taper_max = cps->radius_taper_start * len_3d;
for (i = 0; i < stroke_len && lengths[i] < len_taper_max; i++) {
const float pressure_new = selem_array[i]->pressure * (lengths[i] / len_taper_max);
stroke_elem_pressure_set(cdd, selem_array[i], pressure_new);
}
}
if (cps->radius_taper_end != 0.0f) {
const float len_taper_max = cps->radius_taper_end * len_3d;
const float len_taper_min = len_3d - len_taper_max;
for (i = stroke_len - 1; i > 0 && lengths[i] > len_taper_min; i--) {
const float pressure_new = selem_array[i]->pressure * ((len_3d - lengths[i]) / len_taper_max);
stroke_elem_pressure_set(cdd, selem_array[i], pressure_new);
}
}
MEM_freeN(lengths);
MEM_freeN(selem_array);
}
}
static int curve_draw_exec(bContext *C, wmOperator *op)
{
if (op->customdata == NULL) {
if (!curve_draw_init(C, op, false)) {
return OPERATOR_CANCELLED;
}
}
struct CurveDrawData *cdd = op->customdata;
const CurvePaintSettings *cps = &cdd->vc.scene->toolsettings->curve_paint_settings;
Object *obedit = cdd->vc.scene->obedit;
Curve *cu = obedit->data;
ListBase *nurblist = object_editcurve_get(obedit);
int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool);
const bool is_3d = (cu->flag & CU_3D) != 0;
invert_m4_m4(obedit->imat, obedit->obmat);
if (BLI_mempool_count(cdd->stroke_elem_pool) == 0) {
curve_draw_stroke_from_operator(op);
stroke_len = BLI_mempool_count(cdd->stroke_elem_pool);
}
ED_curve_deselect_all(cu->editnurb);
const float radius_min = cps->radius_min;
const float radius_max = cps->radius_max;
const float radius_range = cps->radius_max - cps->radius_min;
Nurb *nu = MEM_callocN(sizeof(Nurb), __func__);
nu->pntsv = 1;
nu->resolu = cu->resolu;
nu->resolv = cu->resolv;
nu->flag |= CU_SMOOTH;
const bool use_pressure_radius =
(cps->flag & CURVE_PAINT_FLAG_PRESSURE_RADIUS) ||
((cps->radius_taper_start != 0.0f) ||
(cps->radius_taper_end != 0.0f));
if (cdd->curve_type == CU_BEZIER) {
nu->type = CU_BEZIER;
#ifdef USE_SPLINE_FIT
/* Allow to interpolate multiple channels */
int dims = 3;
struct {
int radius;
} coords_indices;
coords_indices.radius = use_pressure_radius ? dims++ : -1;
float *coords = MEM_mallocN(sizeof(*coords) * stroke_len * dims, __func__);
float *cubic_spline = NULL;
unsigned int cubic_spline_len = 0;
/* error in object local space */
const int fit_method = RNA_enum_get(op->ptr, "fit_method");
const float error_threshold = RNA_float_get(op->ptr, "error_threshold");
const float corner_angle = RNA_float_get(op->ptr, "corner_angle");
const bool use_cyclic = RNA_boolean_get(op->ptr, "use_cyclic");
{
BLI_mempool_iter iter;
const struct StrokeElem *selem;
float *co = coords;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter), co += dims) {
copy_v3_v3(co, selem->location_local);
if (coords_indices.radius != -1) {
co[coords_indices.radius] = selem->pressure;
}
/* remove doubles */
if ((co != coords) && UNLIKELY(memcmp(co, co - dims, sizeof(float) * dims) == 0)) {
co -= dims;
stroke_len--;
}
}
}
unsigned int *corners = NULL;
unsigned int corners_len = 0;
if ((fit_method == CURVE_PAINT_FIT_METHOD_SPLIT) && (corner_angle < (float)M_PI)) {
/* this could be configurable... */
const float corner_radius_min = error_threshold / 8;
const float corner_radius_max = error_threshold * 2;
const unsigned int samples_max = 16;
curve_fit_corners_detect_fl(
coords, stroke_len, dims,
corner_radius_min, corner_radius_max,
samples_max, corner_angle,
&corners, &corners_len);
}
unsigned int *corners_index = NULL;
unsigned int corners_index_len = 0;
unsigned int calc_flag = CURVE_FIT_CALC_HIGH_QUALIY;
if ((stroke_len > 2) && use_cyclic) {
calc_flag |= CURVE_FIT_CALC_CYCLIC;
}
int result;
if (fit_method == CURVE_PAINT_FIT_METHOD_REFIT) {
result = curve_fit_cubic_to_points_refit_fl(
coords, stroke_len, dims, error_threshold, calc_flag,
NULL, 0, corner_angle,
&cubic_spline, &cubic_spline_len,
NULL,
&corners_index, &corners_index_len);
}
else {
result = curve_fit_cubic_to_points_fl(
coords, stroke_len, dims, error_threshold, calc_flag,
corners, corners_len,
&cubic_spline, &cubic_spline_len,
NULL,
&corners_index, &corners_index_len);
}
MEM_freeN(coords);
if (corners) {
free(corners);
}
if (result == 0) {
nu->pntsu = cubic_spline_len;
nu->bezt = MEM_callocN(sizeof(BezTriple) * nu->pntsu, __func__);
float *co = cubic_spline;
BezTriple *bezt = nu->bezt;
for (int j = 0; j < cubic_spline_len; j++, bezt++, co += (dims * 3)) {
const float *handle_l = co + (dims * 0);
const float *pt = co + (dims * 1);
const float *handle_r = co + (dims * 2);
copy_v3_v3(bezt->vec[0], handle_l);
copy_v3_v3(bezt->vec[1], pt);
copy_v3_v3(bezt->vec[2], handle_r);
if (coords_indices.radius != -1) {
bezt->radius = (pt[coords_indices.radius] * cdd->radius.range) + cdd->radius.min;
}
else {
bezt->radius = radius_max;
}
bezt->h1 = bezt->h2 = HD_ALIGN; /* will set to free in second pass */
bezt->f1 = bezt->f2 = bezt->f3 = SELECT;
}
if (corners_index) {
/* ignore the first and last */
unsigned int i_start = 0, i_end = corners_index_len;
if ((corners_index_len >= 2) &&
(calc_flag & CURVE_FIT_CALC_CYCLIC) == 0)
{
i_start += 1;
i_end -= 1;
}
for (unsigned int i = i_start; i < i_end; i++) {
bezt = &nu->bezt[corners_index[i]];
bezt->h1 = bezt->h2 = HD_FREE;
}
}
if (calc_flag & CURVE_FIT_CALC_CYCLIC) {
nu->flagu |= CU_NURB_CYCLIC;
}
}
if (corners_index) {
free(corners_index);
}
if (cubic_spline) {
free(cubic_spline);
}
#else
nu->pntsu = stroke_len;
nu->bezt = MEM_callocN(nu->pntsu * sizeof(BezTriple), __func__);
BezTriple *bezt = nu->bezt;
{
BLI_mempool_iter iter;
const struct StrokeElem *selem;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter)) {
copy_v3_v3(bezt->vec[1], selem->location_local);
if (!is_3d) {
bezt->vec[1][2] = 0.0f;
}
if (use_pressure_radius) {
bezt->radius = selem->pressure;
}
else {
bezt->radius = radius_max;
}
bezt->h1 = bezt->h2 = HD_AUTO;
bezt->f1 |= SELECT;
bezt->f2 |= SELECT;
bezt->f3 |= SELECT;
bezt++;
}
}
#endif
BKE_nurb_handles_calc(nu);
}
else { /* CU_POLY */
BLI_mempool_iter iter;
const struct StrokeElem *selem;
nu->pntsu = stroke_len;
nu->type = CU_POLY;
nu->bp = MEM_callocN(nu->pntsu * sizeof(BPoint), __func__);
BPoint *bp = nu->bp;
BLI_mempool_iternew(cdd->stroke_elem_pool, &iter);
for (selem = BLI_mempool_iterstep(&iter); selem; selem = BLI_mempool_iterstep(&iter)) {
copy_v3_v3(bp->vec, selem->location_local);
if (!is_3d) {
bp->vec[2] = 0.0f;
}
if (use_pressure_radius) {
bp->radius = (selem->pressure * radius_range) + radius_min;
}
else {
bp->radius = cps->radius_max;
}
bp->f1 = SELECT;
bp->vec[3] = 1.0f;
bp++;
}
BKE_nurb_knot_calc_u(nu);
}
BLI_addtail(nurblist, nu);
BKE_curve_nurb_active_set(cu, nu);
cu->actvert = nu->pntsu - 1;
WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
DAG_id_tag_update(obedit->data, 0);
curve_draw_exit(op);
return OPERATOR_FINISHED;
}
static int curve_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
if (RNA_struct_property_is_set(op->ptr, "stroke")) {
return curve_draw_exec(C, op);
}
if (!curve_draw_init(C, op, true)) {
return OPERATOR_CANCELLED;
}
struct CurveDrawData *cdd = op->customdata;
const CurvePaintSettings *cps = &cdd->vc.scene->toolsettings->curve_paint_settings;
const bool is_modal = RNA_boolean_get(op->ptr, "wait_for_input");
/* fallback (incase we can't find the depth on first test) */
{
const float mval_fl[2] = {UNPACK2(event->mval)};
float center[3];
negate_v3_v3(center, cdd->vc.rv3d->ofs);
ED_view3d_win_to_3d(cdd->vc.v3d, cdd->vc.ar, center, mval_fl, cdd->prev.location_world);
copy_v3_v3(cdd->prev.location_world_valid, cdd->prev.location_world);
}
cdd->draw_handle_view = ED_region_draw_cb_activate(
cdd->vc.ar->type, curve_draw_stroke_3d, op, REGION_DRAW_POST_VIEW);
WM_cursor_modal_set(cdd->vc.win, BC_PAINTBRUSHCURSOR);
{
View3D *v3d = cdd->vc.v3d;
RegionView3D *rv3d = cdd->vc.rv3d;
Object *obedit = cdd->vc.obedit;
Curve *cu = obedit->data;
const float *plane_no = NULL;
const float *plane_co = NULL;
if ((cu->flag & CU_3D) == 0) {
/* 2D overrides other options */
plane_co = obedit->obmat[3];
plane_no = obedit->obmat[2];
cdd->project.use_plane = true;
}
else {
if ((cps->depth_mode == CURVE_PAINT_PROJECT_SURFACE) &&
(v3d->drawtype > OB_WIRE))
{
view3d_get_transformation(cdd->vc.ar, cdd->vc.rv3d, NULL, &cdd->mats);
/* needed or else the draw matrix can be incorrect */
view3d_operator_needs_opengl(C);
ED_view3d_autodist_init(cdd->vc.scene, cdd->vc.ar, cdd->vc.v3d, 0);
if (cdd->vc.rv3d->depths) {
cdd->vc.rv3d->depths->damaged = true;
}
ED_view3d_depth_update(cdd->vc.ar);
if (cdd->vc.rv3d->depths != NULL) {
cdd->project.use_depth = true;
}
else {
BKE_report(op->reports, RPT_WARNING, "Unable to access depth buffer, using view plane");
cdd->project.use_depth = false;
}
}
/* use view plane (when set or as fallback when surface can't be found) */
if (cdd->project.use_depth == false) {
plane_co = ED_view3d_cursor3d_get(cdd->vc.scene, v3d);
plane_no = rv3d->viewinv[2];
cdd->project.use_plane = true;
}
if (cdd->project.use_depth && (cdd->curve_type != CU_POLY)) {
cdd->sample.use_substeps = true;
}
}
if (cdd->project.use_plane) {
normalize_v3_v3(cdd->project.plane, plane_no);
cdd->project.plane[3] = -dot_v3v3(cdd->project.plane, plane_co);
}
}
if (is_modal == false) {
curve_draw_event_add_first(op, event);
}
/* add temp handler */
WM_event_add_modal_handler(C, op);
return OPERATOR_RUNNING_MODAL;
}
static void curve_draw_cancel(bContext *UNUSED(C), wmOperator *op)
{
curve_draw_exit(op);
}
/* Modal event handling of frame changing */
static int curve_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
int ret = OPERATOR_RUNNING_MODAL;
struct CurveDrawData *cdd = op->customdata;
UNUSED_VARS(C, op);
if (event->type == cdd->init_event_type) {
if (event->val == KM_RELEASE) {
ED_region_tag_redraw(cdd->vc.ar);
curve_draw_exec_precalc(op);
curve_draw_stroke_to_operator(op);
curve_draw_exec(C, op);
return OPERATOR_FINISHED;
}
}
else if (ELEM(event->type, ESCKEY, RIGHTMOUSE)) {
ED_region_tag_redraw(cdd->vc.ar);
curve_draw_cancel(C, op);
return OPERATOR_CANCELLED;
}
else if (ELEM(event->type, LEFTMOUSE)) {
if (event->val == KM_PRESS) {
curve_draw_event_add_first(op, event);
}
}
else if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
if (cdd->state == CURVE_DRAW_PAINTING) {
const float mval_fl[2] = {UNPACK2(event->mval)};
if (len_squared_v2v2(mval_fl, cdd->prev.mouse) > SQUARE(STROKE_SAMPLE_DIST_MIN_PX)) {
curve_draw_event_add(op, event);
}
}
}
return ret;
}
void CURVE_OT_draw(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Draw Curve";
ot->idname = "CURVE_OT_draw";
ot->description = "Draw a freehand spline";
/* api callbacks */
ot->exec = curve_draw_exec;
ot->invoke = curve_draw_invoke;
ot->cancel = curve_draw_cancel;
ot->modal = curve_draw_modal;
ot->poll = ED_operator_editcurve;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
PropertyRNA *prop;
prop = RNA_def_float_distance(
ot->srna, "error_threshold", 0.0f, 0.0f, 10.0f, "Error",
"Error distance threshold (in object units)",
0.0001f, 10.0f);
RNA_def_property_ui_range(prop, 0.0, 10, 1, 4);
RNA_def_enum(ot->srna, "fit_method", rna_enum_curve_fit_method_items, CURVE_PAINT_FIT_METHOD_REFIT,
"Fit Method", "");
prop = RNA_def_float_distance(
ot->srna, "corner_angle", DEG2RADF(70.0f), 0.0f, M_PI, "Corner Angle", "", 0.0f, M_PI);
RNA_def_property_subtype(prop, PROP_ANGLE);
prop = RNA_def_boolean(ot->srna, "use_cyclic", true, "Cyclic", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
/** \} */
|
445942.c | /****************************************************************************
* boards/arm/samv7/same70-qmtech/src/sam_boot_image.c
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/boardctl.h>
#include <nuttx/irq.h>
#include <nuttx/cache.h>
#include "nvic.h"
#include "arm_arch.h"
#include "barriers.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/* This structure represents the first two entries on NVIC vector table */
struct arm_vector_table
{
uint32_t spr; /* Stack pointer on reset */
uint32_t reset; /* Pointer to reset exception handler */
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static void cleanup_arm_nvic(void);
#ifdef CONFIG_ARMV7M_SYSTICK
static void systick_disable(void);
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: cleanup_arm_nvic
*
* Description:
* Acknowledge and disable all interrupts in NVIC
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void cleanup_arm_nvic(void)
{
int i;
/* Allow any pending interrupts to be recognized */
ARM_ISB();
cpsid();
/* Disable all interrupts */
for (i = 0; i < SAM_IRQ_NIRQS; i += 32)
{
putreg32(0xffffffff, NVIC_IRQ_CLEAR(i));
}
/* Clear all pending interrupts */
for (i = 0; i < SAM_IRQ_NIRQS; i += 32)
{
putreg32(0xffffffff, NVIC_IRQ_CLRPEND(i));
}
}
#ifdef CONFIG_ARMV7M_SYSTICK
/****************************************************************************
* Name: systick_disable
*
* Description:
* Disable the SysTick system timer
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void systick_disable(void)
{
putreg32(0, NVIC_SYSTICK_CTRL);
putreg32(NVIC_SYSTICK_RELOAD_MASK, NVIC_SYSTICK_RELOAD);
putreg32(0, NVIC_SYSTICK_CURRENT);
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_boot_image
*
* Description:
* This entry point is called by bootloader to jump to application image.
*
****************************************************************************/
int board_boot_image(FAR const char *path, uint32_t hdr_size)
{
static struct arm_vector_table vt;
int fd;
ssize_t bytes;
fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd < 0)
{
syslog(LOG_ERR, "Failed to open %s with: %d", path, fd);
return fd;
}
bytes = pread(fd, &vt, sizeof(vt), hdr_size);
if (bytes != sizeof(vt))
{
syslog(LOG_ERR, "Failed to read ARM vector table: %d", bytes);
return bytes < 0 ? bytes : -1;
}
#ifdef CONFIG_ARMV7M_SYSTICK
systick_disable();
#endif
cleanup_arm_nvic();
#ifdef CONFIG_ARMV7M_DCACHE
up_disable_dcache();
#endif
#ifdef CONFIG_ARMV7M_ICACHE
up_disable_icache();
#endif
#ifdef CONFIG_ARM_MPU
mpu_control(false, false, false);
#endif
/* Set main and process stack pointers */
__asm__ __volatile__("\tmsr msp, %0\n" : : "r" (vt.spr));
setcontrol(0x00);
ARM_ISB();
((void (*)(void))vt.reset)();
return 0;
}
|
144297.c | /*
* FreeBSD install - a package for the installation and maintainance
* of non-core utilities.
*
* 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.
*
* Jordan K. Hubbard
* 18 July 1993
*
* Miscellaneous string utilities.
*
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/usr.sbin/pkg_install/lib/str.c,v 1.15 2003/05/26 17:12:22 lioux Exp $");
#include "lib.h"
char *
strconcat(const char *s1, const char *s2)
{
static char tmp[FILENAME_MAX];
tmp[0] = '\0';
strncpy(tmp, s1 ? s1 : s2, FILENAME_MAX); /* XXX: what if both are NULL? */
if (s1 && s2)
strncat(tmp, s2, FILENAME_MAX - strlen(tmp));
return tmp;
}
/* Get a string parameter as a file spec or as a "contents follow -" spec */
char *
get_dash_string(char **str)
{
char *s = *str;
if (*s == '-')
*str = copy_string_adds_newline(s + 1);
else
*str = fileGetContents(s);
return *str;
}
/* Rather Obvious */
char *
copy_string(const char *str)
{
return (str ? strdup(str) : NULL);
}
/* Rather Obvious but adds a trailing \n newline */
char *
copy_string_adds_newline(const char *str)
{
if (str == NULL) {
return (NULL);
} else {
char *copy;
size_t line_length;
line_length = strlen(str) + 2;
if ((copy = malloc(line_length)) == NULL)
return (NULL);
memcpy(copy, str, line_length - 2);
copy[line_length - 2] = '\n'; /* Adds trailing \n */
copy[line_length - 1] = '\0';
return (copy);
}
}
/* Return TRUE if 'str' ends in suffix 'suff' */
Boolean
suffix(const char *str, const char *suff)
{
char *idx;
Boolean ret = FALSE;
idx = strrchr(str, '.');
if (idx && !strcmp(idx + 1, suff))
ret = TRUE;
return ret;
}
/* Assuming str has a suffix, brutally murder it! */
void
nuke_suffix(char *str)
{
char *idx;
idx = strrchr(str, '.');
if (idx)
*idx = '\0'; /* Yow! Don't try this on a const! */
}
/* Lowercase a whole string */
void
str_lowercase(char *str)
{
while (*str) {
*str = tolower(*str);
++str;
}
}
char *
get_string(char *str, int max, FILE *fp)
{
int len;
if (!str)
return NULL;
str[0] = '\0';
while (fgets(str, max, fp)) {
len = strlen(str);
while (len && isspace(str[len - 1]))
str[--len] = '\0';
if (len)
return str;
}
return NULL;
}
|
323783.c | /**
* @file
* AutoIP Automatic LinkLocal IP Configuration
*
* This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform
* with RFC 3927.
*
* @defgroup autoip AUTOIP
* @ingroup ip4
* AUTOIP related functions
* USAGE:
*
* define @ref LWIP_AUTOIP 1 in your lwipopts.h
* Options:
* AUTOIP_TMR_INTERVAL msecs,
* I recommend a value of 100. The value must divide 1000 with a remainder almost 0.
* Possible values are 1000, 500, 333, 250, 200, 166, 142, 125, 111, 100 ....
*
* Without DHCP:
* - Call autoip_start() after netif_add().
*
* With DHCP:
* - define @ref LWIP_DHCP_AUTOIP_COOP 1 in your lwipopts.h.
* - Configure your DHCP Client.
*
* @see netifapi_autoip
*/
/*
*
* Copyright (c) 2007 Dominik Spies <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* Author: Dominik Spies <[email protected]>
*/
#include "lwip/opt.h"
#if LWIP_IPV4 && LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */
#include "lwip/mem.h"
/* #include "lwip/udp.h" */
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/autoip.h"
#include "lwip/etharp.h"
#include "lwip/prot/autoip.h"
#include <string.h>
/** Pseudo random macro based on netif informations.
* You could use "rand()" from the C Library if you define LWIP_AUTOIP_RAND in lwipopts.h */
#ifndef LWIP_AUTOIP_RAND
#define LWIP_AUTOIP_RAND(netif) ( (((u32_t)((netif->hwaddr[5]) & 0xff) << 24) | \
((u32_t)((netif->hwaddr[3]) & 0xff) << 16) | \
((u32_t)((netif->hwaddr[2]) & 0xff) << 8) | \
((u32_t)((netif->hwaddr[4]) & 0xff))) + \
(netif_autoip_data(netif)? netif_autoip_data(netif)->tried_llipaddr : 0))
#endif /* LWIP_AUTOIP_RAND */
/**
* Macro that generates the initial IP address to be tried by AUTOIP.
* If you want to override this, define it to something else in lwipopts.h.
*/
#ifndef LWIP_AUTOIP_CREATE_SEED_ADDR
#define LWIP_AUTOIP_CREATE_SEED_ADDR(netif) \
lwip_htonl(AUTOIP_RANGE_START + ((u32_t)(((u8_t)(netif->hwaddr[4])) | \
((u32_t)((u8_t)(netif->hwaddr[5]))) << 8)))
#endif /* LWIP_AUTOIP_CREATE_SEED_ADDR */
/* static functions */
static err_t autoip_arp_announce(struct netif *netif);
static void autoip_start_probing(struct netif *netif);
/**
* @ingroup autoip
* Set a statically allocated struct autoip to work with.
* Using this prevents autoip_start to allocate it using mem_malloc.
*
* @param netif the netif for which to set the struct autoip
* @param autoip (uninitialised) autoip struct allocated by the application
*/
void
autoip_set_struct(struct netif *netif, struct autoip *autoip)
{
LWIP_ASSERT_CORE_LOCKED();
LWIP_ASSERT("netif != NULL", netif != NULL);
LWIP_ASSERT("autoip != NULL", autoip != NULL);
LWIP_ASSERT("netif already has a struct autoip set",
netif_autoip_data(netif) == NULL);
/* clear data structure */
memset(autoip, 0, sizeof(struct autoip));
/* autoip->state = AUTOIP_STATE_OFF; */
netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, autoip);
}
/** Restart AutoIP client and check the next address (conflict detected)
*
* @param netif The netif under AutoIP control
*/
static void
autoip_restart(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
autoip->tried_llipaddr++;
autoip_start(netif);
}
/**
* Handle a IP address conflict after an ARP conflict detection
*/
static void
autoip_handle_arp_conflict(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
/* RFC3927, 2.5 "Conflict Detection and Defense" allows two options where
a) means retreat on the first conflict and
b) allows to keep an already configured address when having only one
conflict in 10 seconds
We use option b) since it helps to improve the chance that one of the two
conflicting hosts may be able to retain its address. */
if (autoip->lastconflict > 0) {
/* retreat, there was a conflicting ARP in the last DEFEND_INTERVAL seconds */
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("autoip_handle_arp_conflict(): we are defending, but in DEFEND_INTERVAL, retreating\n"));
/* Active TCP sessions are aborted when removing the ip addresss */
autoip_restart(netif);
} else {
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("autoip_handle_arp_conflict(): we are defend, send ARP Announce\n"));
autoip_arp_announce(netif);
autoip->lastconflict = DEFEND_INTERVAL * AUTOIP_TICKS_PER_SECOND;
}
}
/**
* Create an IP-Address out of range 169.254.1.0 to 169.254.254.255
*
* @param netif network interface on which create the IP-Address
* @param ipaddr ip address to initialize
*/
static void
autoip_create_addr(struct netif *netif, ip4_addr_t *ipaddr)
{
struct autoip *autoip = netif_autoip_data(netif);
/* Here we create an IP-Address out of range 169.254.1.0 to 169.254.254.255
* compliant to RFC 3927 Section 2.1
* We have 254 * 256 possibilities */
u32_t addr = lwip_ntohl(LWIP_AUTOIP_CREATE_SEED_ADDR(netif));
addr += autoip->tried_llipaddr;
addr = AUTOIP_NET | (addr & 0xffff);
/* Now, 169.254.0.0 <= addr <= 169.254.255.255 */
if (addr < AUTOIP_RANGE_START) {
addr += AUTOIP_RANGE_END - AUTOIP_RANGE_START + 1;
}
if (addr > AUTOIP_RANGE_END) {
addr -= AUTOIP_RANGE_END - AUTOIP_RANGE_START + 1;
}
LWIP_ASSERT("AUTOIP address not in range", (addr >= AUTOIP_RANGE_START) &&
(addr <= AUTOIP_RANGE_END));
ip4_addr_set_u32(ipaddr, lwip_htonl(addr));
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("autoip_create_addr(): tried_llipaddr=%"U16_F", %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
(u16_t)(autoip->tried_llipaddr), ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr),
ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr)));
}
/**
* Sends an ARP probe from a network interface
*
* @param netif network interface used to send the probe
*/
static err_t
autoip_arp_probe(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
/* this works because netif->ip_addr is ANY */
return etharp_request(netif, &autoip->llipaddr);
}
/**
* Sends an ARP announce from a network interface
*
* @param netif network interface used to send the announce
*/
static err_t
autoip_arp_announce(struct netif *netif)
{
return etharp_gratuitous(netif);
}
/**
* Configure interface for use with current LL IP-Address
*
* @param netif network interface to configure with current LL IP-Address
*/
static err_t
autoip_bind(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
ip4_addr_t sn_mask, gw_addr;
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE,
("autoip_bind(netif=%p) %c%c%"U16_F" %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
(void *)netif, netif->name[0], netif->name[1], (u16_t)netif->num,
ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr),
ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr)));
IP4_ADDR(&sn_mask, 255, 255, 0, 0);
IP4_ADDR(&gw_addr, 0, 0, 0, 0);
netif_set_addr(netif, &autoip->llipaddr, &sn_mask, &gw_addr);
/* interface is used by routing now that an address is set */
return ERR_OK;
}
/**
* @ingroup autoip
* Start AutoIP client
*
* @param netif network interface on which start the AutoIP client
*/
err_t
autoip_start(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
err_t result = ERR_OK;
LWIP_ASSERT_CORE_LOCKED();
LWIP_ERROR("netif is not up, old style port?", netif_is_up(netif), return ERR_ARG;);
/* Set IP-Address, Netmask and Gateway to 0 to make sure that
* ARP Packets are formed correctly
*/
netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("autoip_start(netif=%p) %c%c%"U16_F"\n", (void *)netif, netif->name[0],
netif->name[1], (u16_t)netif->num));
if (autoip == NULL) {
/* no AutoIP client attached yet? */
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE,
("autoip_start(): starting new AUTOIP client\n"));
autoip = (struct autoip *)mem_calloc(1, sizeof(struct autoip));
if (autoip == NULL) {
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE,
("autoip_start(): could not allocate autoip\n"));
return ERR_MEM;
}
autoip->is_allocated = 1;
/* store this AutoIP client in the netif */
netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, autoip);
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_start(): allocated autoip"));
} else {
autoip->state = AUTOIP_STATE_OFF;
autoip->ttw = 0;
autoip->sent_num = 0;
ip4_addr_set_zero(&autoip->llipaddr);
autoip->lastconflict = 0;
}
autoip_create_addr(netif, &(autoip->llipaddr));
autoip_start_probing(netif);
return result;
}
static void
autoip_start_probing(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
autoip->state = AUTOIP_STATE_PROBING;
autoip->sent_num = 0;
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("autoip_start_probing(): changing state to PROBING: %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr),
ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr)));
/* time to wait to first probe, this is randomly
* chosen out of 0 to PROBE_WAIT seconds.
* compliant to RFC 3927 Section 2.2.1
*/
autoip->ttw = (u16_t)(LWIP_AUTOIP_RAND(netif) % (PROBE_WAIT * AUTOIP_TICKS_PER_SECOND));
/*
* if we tried more then MAX_CONFLICTS we must limit our rate for
* acquiring and probing address
* compliant to RFC 3927 Section 2.2.1
*/
if (autoip->tried_llipaddr >= MAX_CONFLICTS) {
autoip->ttw = RATE_LIMIT_INTERVAL * AUTOIP_TICKS_PER_SECOND;
}
}
/**
* Handle a possible change in the network configuration.
*
* If there is an AutoIP address configured, take the interface down
* and begin probing with the same address.
*/
void
autoip_network_changed(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
if (autoip && (autoip->state != AUTOIP_STATE_OFF)) {
autoip_start_probing(netif);
}
}
/**
* @ingroup autoip
* Stop AutoIP client
*
* @param netif network interface on which stop the AutoIP client
*/
err_t
autoip_stop(struct netif *netif)
{
struct autoip *autoip = netif_autoip_data(netif);
LWIP_ASSERT_CORE_LOCKED();
if (autoip != NULL) {
autoip->state = AUTOIP_STATE_OFF;
/* If autoip is dynamically allocated in start, free autoip structure and reset autoip index in netif */
if (autoip->is_allocated != 0) {
/* Reset the auto IP index and then free autoip structure */
netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, NULL);
mem_free(autoip);
autoip = NULL;
} else {
autoip->tried_llipaddr = 0;
}
if (ip4_addr_islinklocal(netif_ip4_addr(netif))) {
netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
}
}
return ERR_OK;
}
/**
* Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds
*/
void
autoip_tmr(void)
{
struct netif *netif;
/* loop through netif's */
NETIF_FOREACH(netif) {
struct autoip *autoip = netif_autoip_data(netif);
/* only act on AutoIP configured interfaces */
if (autoip != NULL) {
if (autoip->lastconflict > 0) {
autoip->lastconflict--;
}
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE,
("autoip_tmr() AutoIP-State: %"U16_F", ttw=%"U16_F"\n",
(u16_t)(autoip->state), autoip->ttw));
if (autoip->ttw > 0) {
autoip->ttw--;
}
switch (autoip->state) {
case AUTOIP_STATE_PROBING:
if (autoip->ttw == 0) {
if (autoip->sent_num >= PROBE_NUM) {
/* Switch to ANNOUNCING: now we can bind to an IP address and use it */
autoip->state = AUTOIP_STATE_ANNOUNCING;
autoip_bind(netif);
/* autoip_bind() calls netif_set_addr(): this triggers a gratuitous ARP
which counts as an announcement */
autoip->sent_num = 1;
autoip->ttw = ANNOUNCE_WAIT * AUTOIP_TICKS_PER_SECOND;
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("autoip_tmr(): changing state to ANNOUNCING: %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr),
ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr)));
} else {
autoip_arp_probe(netif);
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_tmr() PROBING Sent Probe\n"));
autoip->sent_num++;
if (autoip->sent_num == PROBE_NUM) {
/* calculate time to wait to for announce */
autoip->ttw = ANNOUNCE_WAIT * AUTOIP_TICKS_PER_SECOND;
} else {
/* calculate time to wait to next probe */
autoip->ttw = (u16_t)((LWIP_AUTOIP_RAND(netif) %
((PROBE_MAX - PROBE_MIN) * AUTOIP_TICKS_PER_SECOND) ) +
PROBE_MIN * AUTOIP_TICKS_PER_SECOND);
}
}
}
break;
case AUTOIP_STATE_ANNOUNCING:
if (autoip->ttw == 0) {
autoip_arp_announce(netif);
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_tmr() ANNOUNCING Sent Announce\n"));
autoip->ttw = ANNOUNCE_INTERVAL * AUTOIP_TICKS_PER_SECOND;
autoip->sent_num++;
if (autoip->sent_num >= ANNOUNCE_NUM) {
autoip->state = AUTOIP_STATE_BOUND;
autoip->sent_num = 0;
autoip->ttw = 0;
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("autoip_tmr(): changing state to BOUND: %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr),
ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr)));
}
}
break;
default:
/* nothing to do in other states */
break;
}
}
}
}
/**
* Handles every incoming ARP Packet, called by etharp_input().
*
* @param netif network interface to use for autoip processing
* @param hdr Incoming ARP packet
*/
void
autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr)
{
struct autoip *autoip = netif_autoip_data(netif);
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_arp_reply()\n"));
if ((autoip != NULL) && (autoip->state != AUTOIP_STATE_OFF)) {
/* when ip.src == llipaddr && hw.src != netif->hwaddr
*
* when probing ip.dst == llipaddr && hw.src != netif->hwaddr
* we have a conflict and must solve it
*/
ip4_addr_t sipaddr, dipaddr;
struct eth_addr netifaddr;
SMEMCPY(netifaddr.addr, netif->hwaddr, ETH_HWADDR_LEN);
/* Copy struct ip4_addr_wordaligned to aligned ip4_addr, to support compilers without
* structure packing (not using structure copy which breaks strict-aliasing rules).
*/
IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&sipaddr, &hdr->sipaddr);
IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&dipaddr, &hdr->dipaddr);
if (autoip->state == AUTOIP_STATE_PROBING) {
/* RFC 3927 Section 2.2.1:
* from beginning to after ANNOUNCE_WAIT
* seconds we have a conflict if
* ip.src == llipaddr OR
* ip.dst == llipaddr && hw.src != own hwaddr
*/
if ((ip4_addr_cmp(&sipaddr, &autoip->llipaddr)) ||
(ip4_addr_isany_val(sipaddr) &&
ip4_addr_cmp(&dipaddr, &autoip->llipaddr) &&
!eth_addr_cmp(&netifaddr, &hdr->shwaddr))) {
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING,
("autoip_arp_reply(): Probe Conflict detected\n"));
autoip_restart(netif);
}
} else {
/* RFC 3927 Section 2.5:
* in any state we have a conflict if
* ip.src == llipaddr && hw.src != own hwaddr
*/
if (ip4_addr_cmp(&sipaddr, &autoip->llipaddr) &&
!eth_addr_cmp(&netifaddr, &hdr->shwaddr)) {
LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING,
("autoip_arp_reply(): Conflicting ARP-Packet detected\n"));
autoip_handle_arp_conflict(netif);
}
}
}
}
/** check if AutoIP supplied netif->ip_addr
*
* @param netif the netif to check
* @return 1 if AutoIP supplied netif->ip_addr (state BOUND or ANNOUNCING),
* 0 otherwise
*/
u8_t
autoip_supplied_address(const struct netif *netif)
{
if ((netif != NULL) && (netif_autoip_data(netif) != NULL)) {
struct autoip *autoip = netif_autoip_data(netif);
return (autoip->state == AUTOIP_STATE_BOUND) || (autoip->state == AUTOIP_STATE_ANNOUNCING);
}
return 0;
}
u8_t
autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr)
{
struct autoip *autoip = netif_autoip_data(netif);
return (autoip != NULL) && ip4_addr_cmp(addr, &(autoip->llipaddr));
}
#endif /* LWIP_IPV4 && LWIP_AUTOIP */
|
764127.c | /*
* Dynamic Adaptive Streaming over HTTP demux
* Copyright (c) 2017 [email protected] based on HLS demux
* Copyright (c) 2017 Steven Liu
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libxml/parser.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavutil/parseutils.h"
#include "internal.h"
#include "avio_internal.h"
#include "dash.h"
#define INITIAL_BUFFER_SIZE 32768
#define MAX_MANIFEST_SIZE 50 * 1024
#define DEFAULT_MANIFEST_SIZE 8 * 1024
struct fragment {
int64_t url_offset;
int64_t size;
char *url;
};
/*
* reference to : ISO_IEC_23009-1-DASH-2012
* Section: 5.3.9.6.2
* Table: Table 17 — Semantics of SegmentTimeline element
* */
struct timeline {
/* starttime: Element or Attribute Name
* specifies the MPD start time, in @timescale units,
* the first Segment in the series starts relative to the beginning of the Period.
* The value of this attribute must be equal to or greater than the sum of the previous S
* element earliest presentation time and the sum of the contiguous Segment durations.
* If the value of the attribute is greater than what is expressed by the previous S element,
* it expresses discontinuities in the timeline.
* If not present then the value shall be assumed to be zero for the first S element
* and for the subsequent S elements, the value shall be assumed to be the sum of
* the previous S element's earliest presentation time and contiguous duration
* (i.e. previous S@starttime + @duration * (@repeat + 1)).
* */
int64_t starttime;
/* repeat: Element or Attribute Name
* specifies the repeat count of the number of following contiguous Segments with
* the same duration expressed by the value of @duration. This value is zero-based
* (e.g. a value of three means four Segments in the contiguous series).
* */
int64_t repeat;
/* duration: Element or Attribute Name
* specifies the Segment duration, in units of the value of the @timescale.
* */
int64_t duration;
};
/*
* Each playlist has its own demuxer. If it is currently active,
* it has an opened AVIOContext too, and potentially an AVPacket
* containing the next packet from this stream.
*/
struct representation {
char *url_template;
AVIOContext pb;
AVIOContext *input;
AVFormatContext *parent;
AVFormatContext *ctx;
AVPacket pkt;
int rep_idx;
int rep_count;
int stream_index;
enum AVMediaType type;
char id[20];
char *lang;
int bandwidth;
AVRational framerate;
AVStream *assoc_stream; /* demuxer stream associated with this representation */
int n_fragments;
struct fragment **fragments; /* VOD list of fragment for profile */
int n_timelines;
struct timeline **timelines;
int64_t first_seq_no;
int64_t last_seq_no;
int64_t start_number; /* used in case when we have dynamic list of segment to know which segments are new one*/
int64_t fragment_duration;
int64_t fragment_timescale;
int64_t presentation_timeoffset;
int64_t cur_seq_no;
int64_t cur_seg_offset;
int64_t cur_seg_size;
struct fragment *cur_seg;
/* Currently active Media Initialization Section */
struct fragment *init_section;
uint8_t *init_sec_buf;
uint32_t init_sec_buf_size;
uint32_t init_sec_data_len;
uint32_t init_sec_buf_read_offset;
int64_t cur_timestamp;
int is_restart_needed;
};
typedef struct DASHContext {
const AVClass *class;
char *base_url;
int n_videos;
struct representation **videos;
int n_audios;
struct representation **audios;
int n_subtitles;
struct representation **subtitles;
/* MediaPresentationDescription Attribute */
uint64_t media_presentation_duration;
uint64_t suggested_presentation_delay;
uint64_t availability_start_time;
uint64_t availability_end_time;
uint64_t publish_time;
uint64_t minimum_update_period;
uint64_t time_shift_buffer_depth;
uint64_t min_buffer_time;
/* Period Attribute */
uint64_t period_duration;
uint64_t period_start;
/* AdaptationSet Attribute */
char *adaptionset_lang;
int is_live;
AVIOInterruptCB *interrupt_callback;
char *allowed_extensions;
AVDictionary *avio_opts;
int max_url_size;
/* Flags for init section*/
int is_init_section_common_video;
int is_init_section_common_audio;
} DASHContext;
static int ishttp(char *url)
{
const char *proto_name = avio_find_protocol_name(url);
return av_strstart(proto_name, "http", NULL);
}
static int aligned(int val)
{
return ((val + 0x3F) >> 6) << 6;
}
static uint64_t get_current_time_in_sec(void)
{
return av_gettime() / 1000000;
}
static uint64_t get_utc_date_time_insec(AVFormatContext *s, const char *datetime)
{
struct tm timeinfo;
int year = 0;
int month = 0;
int day = 0;
int hour = 0;
int minute = 0;
int ret = 0;
float second = 0.0;
/* ISO-8601 date parser */
if (!datetime)
return 0;
ret = sscanf(datetime, "%d-%d-%dT%d:%d:%fZ", &year, &month, &day, &hour, &minute, &second);
/* year, month, day, hour, minute, second 6 arguments */
if (ret != 6) {
av_log(s, AV_LOG_WARNING, "get_utc_date_time_insec get a wrong time format\n");
}
timeinfo.tm_year = year - 1900;
timeinfo.tm_mon = month - 1;
timeinfo.tm_mday = day;
timeinfo.tm_hour = hour;
timeinfo.tm_min = minute;
timeinfo.tm_sec = (int)second;
return av_timegm(&timeinfo);
}
static uint32_t get_duration_insec(AVFormatContext *s, const char *duration)
{
/* ISO-8601 duration parser */
uint32_t days = 0;
uint32_t hours = 0;
uint32_t mins = 0;
uint32_t secs = 0;
int size = 0;
float value = 0;
char type = '\0';
const char *ptr = duration;
while (*ptr) {
if (*ptr == 'P' || *ptr == 'T') {
ptr++;
continue;
}
if (sscanf(ptr, "%f%c%n", &value, &type, &size) != 2) {
av_log(s, AV_LOG_WARNING, "get_duration_insec get a wrong time format\n");
return 0; /* parser error */
}
switch (type) {
case 'D':
days = (uint32_t)value;
break;
case 'H':
hours = (uint32_t)value;
break;
case 'M':
mins = (uint32_t)value;
break;
case 'S':
secs = (uint32_t)value;
break;
default:
// handle invalid type
break;
}
ptr += size;
}
return ((days * 24 + hours) * 60 + mins) * 60 + secs;
}
static int64_t get_segment_start_time_based_on_timeline(struct representation *pls, int64_t cur_seq_no)
{
int64_t start_time = 0;
int64_t i = 0;
int64_t j = 0;
int64_t num = 0;
if (pls->n_timelines) {
for (i = 0; i < pls->n_timelines; i++) {
if (pls->timelines[i]->starttime > 0) {
start_time = pls->timelines[i]->starttime;
}
if (num == cur_seq_no)
goto finish;
start_time += pls->timelines[i]->duration;
if (pls->timelines[i]->repeat == -1) {
start_time = pls->timelines[i]->duration * cur_seq_no;
goto finish;
}
for (j = 0; j < pls->timelines[i]->repeat; j++) {
num++;
if (num == cur_seq_no)
goto finish;
start_time += pls->timelines[i]->duration;
}
num++;
}
}
finish:
return start_time;
}
static int64_t calc_next_seg_no_from_timelines(struct representation *pls, int64_t cur_time)
{
int64_t i = 0;
int64_t j = 0;
int64_t num = 0;
int64_t start_time = 0;
for (i = 0; i < pls->n_timelines; i++) {
if (pls->timelines[i]->starttime > 0) {
start_time = pls->timelines[i]->starttime;
}
if (start_time > cur_time)
goto finish;
start_time += pls->timelines[i]->duration;
for (j = 0; j < pls->timelines[i]->repeat; j++) {
num++;
if (start_time > cur_time)
goto finish;
start_time += pls->timelines[i]->duration;
}
num++;
}
return -1;
finish:
return num;
}
static void free_fragment(struct fragment **seg)
{
if (!(*seg)) {
return;
}
av_freep(&(*seg)->url);
av_freep(seg);
}
static void free_fragment_list(struct representation *pls)
{
int i;
for (i = 0; i < pls->n_fragments; i++) {
free_fragment(&pls->fragments[i]);
}
av_freep(&pls->fragments);
pls->n_fragments = 0;
}
static void free_timelines_list(struct representation *pls)
{
int i;
for (i = 0; i < pls->n_timelines; i++) {
av_freep(&pls->timelines[i]);
}
av_freep(&pls->timelines);
pls->n_timelines = 0;
}
static void free_representation(struct representation *pls)
{
free_fragment_list(pls);
free_timelines_list(pls);
free_fragment(&pls->cur_seg);
free_fragment(&pls->init_section);
av_freep(&pls->init_sec_buf);
av_freep(&pls->pb.buffer);
ff_format_io_close(pls->parent, &pls->input);
if (pls->ctx) {
pls->ctx->pb = NULL;
avformat_close_input(&pls->ctx);
}
av_freep(&pls->url_template);
av_freep(&pls);
}
static void free_video_list(DASHContext *c)
{
int i;
for (i = 0; i < c->n_videos; i++) {
struct representation *pls = c->videos[i];
free_representation(pls);
}
av_freep(&c->videos);
c->n_videos = 0;
}
static void free_audio_list(DASHContext *c)
{
int i;
for (i = 0; i < c->n_audios; i++) {
struct representation *pls = c->audios[i];
free_representation(pls);
}
av_freep(&c->audios);
c->n_audios = 0;
}
static void free_subtitle_list(DASHContext *c)
{
int i;
for (i = 0; i < c->n_subtitles; i++) {
struct representation *pls = c->subtitles[i];
free_representation(pls);
}
av_freep(&c->subtitles);
c->n_subtitles = 0;
}
static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
AVDictionary *opts, AVDictionary *opts2, int *is_http)
{
DASHContext *c = s->priv_data;
AVDictionary *tmp = NULL;
const char *proto_name = NULL;
int ret;
av_dict_copy(&tmp, opts, 0);
av_dict_copy(&tmp, opts2, 0);
if (av_strstart(url, "crypto", NULL)) {
if (url[6] == '+' || url[6] == ':')
proto_name = avio_find_protocol_name(url + 7);
}
if (!proto_name)
proto_name = avio_find_protocol_name(url);
if (!proto_name)
return AVERROR_INVALIDDATA;
// only http(s) & file are allowed
if (av_strstart(proto_name, "file", NULL)) {
if (strcmp(c->allowed_extensions, "ALL") && !av_match_ext(url, c->allowed_extensions)) {
av_log(s, AV_LOG_ERROR,
"Filename extension of \'%s\' is not a common multimedia extension, blocked for security reasons.\n"
"If you wish to override this adjust allowed_extensions, you can set it to \'ALL\' to allow all\n",
url);
return AVERROR_INVALIDDATA;
}
} else if (av_strstart(proto_name, "http", NULL)) {
;
} else
return AVERROR_INVALIDDATA;
if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
;
else if (av_strstart(url, "crypto", NULL) && !strncmp(proto_name, url + 7, strlen(proto_name)) && url[7 + strlen(proto_name)] == ':')
;
else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5))
return AVERROR_INVALIDDATA;
av_freep(pb);
ret = avio_open2(pb, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp);
if (ret >= 0) {
// update cookies on http response with setcookies.
char *new_cookies = NULL;
if (!(s->flags & AVFMT_FLAG_CUSTOM_IO))
av_opt_get(*pb, "cookies", AV_OPT_SEARCH_CHILDREN, (uint8_t**)&new_cookies);
if (new_cookies) {
av_dict_set(&opts, "cookies", new_cookies, AV_DICT_DONT_STRDUP_VAL);
}
}
av_dict_free(&tmp);
if (is_http)
*is_http = av_strstart(proto_name, "http", NULL);
return ret;
}
static char *get_content_url(xmlNodePtr *baseurl_nodes,
int n_baseurl_nodes,
int max_url_size,
char *rep_id_val,
char *rep_bandwidth_val,
char *val)
{
int i;
char *text;
char *url = NULL;
char *tmp_str = av_mallocz(max_url_size);
char *tmp_str_2 = av_mallocz(max_url_size);
if (!tmp_str || !tmp_str_2) {
return NULL;
}
for (i = 0; i < n_baseurl_nodes; ++i) {
if (baseurl_nodes[i] &&
baseurl_nodes[i]->children &&
baseurl_nodes[i]->children->type == XML_TEXT_NODE) {
text = xmlNodeGetContent(baseurl_nodes[i]->children);
if (text) {
memset(tmp_str, 0, max_url_size);
memset(tmp_str_2, 0, max_url_size);
ff_make_absolute_url(tmp_str_2, max_url_size, tmp_str, text);
av_strlcpy(tmp_str, tmp_str_2, max_url_size);
xmlFree(text);
}
}
}
if (val)
ff_make_absolute_url(tmp_str, max_url_size, tmp_str, val);
if (rep_id_val) {
url = av_strireplace(tmp_str, "$RepresentationID$", (const char*)rep_id_val);
if (!url) {
goto end;
}
av_strlcpy(tmp_str, url, max_url_size);
}
if (rep_bandwidth_val && tmp_str[0] != '\0') {
// free any previously assigned url before reassigning
av_free(url);
url = av_strireplace(tmp_str, "$Bandwidth$", (const char*)rep_bandwidth_val);
if (!url) {
goto end;
}
}
end:
av_free(tmp_str);
av_free(tmp_str_2);
return url;
}
static char *get_val_from_nodes_tab(xmlNodePtr *nodes, const int n_nodes, const char *attrname)
{
int i;
char *val;
for (i = 0; i < n_nodes; ++i) {
if (nodes[i]) {
val = xmlGetProp(nodes[i], attrname);
if (val)
return val;
}
}
return NULL;
}
static xmlNodePtr find_child_node_by_name(xmlNodePtr rootnode, const char *nodename)
{
xmlNodePtr node = rootnode;
if (!node) {
return NULL;
}
node = xmlFirstElementChild(node);
while (node) {
if (!av_strcasecmp(node->name, nodename)) {
return node;
}
node = xmlNextElementSibling(node);
}
return NULL;
}
static enum AVMediaType get_content_type(xmlNodePtr node)
{
enum AVMediaType type = AVMEDIA_TYPE_UNKNOWN;
int i = 0;
const char *attr;
char *val = NULL;
if (node) {
for (i = 0; i < 2; i++) {
attr = i ? "mimeType" : "contentType";
val = xmlGetProp(node, attr);
if (val) {
if (av_stristr((const char *)val, "video")) {
type = AVMEDIA_TYPE_VIDEO;
} else if (av_stristr((const char *)val, "audio")) {
type = AVMEDIA_TYPE_AUDIO;
} else if (av_stristr((const char *)val, "text")) {
type = AVMEDIA_TYPE_SUBTITLE;
}
xmlFree(val);
}
}
}
return type;
}
static struct fragment * get_Fragment(char *range)
{
struct fragment * seg = av_mallocz(sizeof(struct fragment));
if (!seg)
return NULL;
seg->size = -1;
if (range) {
char *str_end_offset;
char *str_offset = av_strtok(range, "-", &str_end_offset);
seg->url_offset = strtoll(str_offset, NULL, 10);
seg->size = strtoll(str_end_offset, NULL, 10) - seg->url_offset + 1;
}
return seg;
}
static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representation *rep,
xmlNodePtr fragmenturl_node,
xmlNodePtr *baseurl_nodes,
char *rep_id_val,
char *rep_bandwidth_val)
{
DASHContext *c = s->priv_data;
char *initialization_val = NULL;
char *media_val = NULL;
char *range_val = NULL;
int max_url_size = c ? c->max_url_size: MAX_URL_SIZE;
if (!av_strcasecmp(fragmenturl_node->name, (const char *)"Initialization")) {
initialization_val = xmlGetProp(fragmenturl_node, "sourceURL");
range_val = xmlGetProp(fragmenturl_node, "range");
if (initialization_val || range_val) {
rep->init_section = get_Fragment(range_val);
if (!rep->init_section) {
xmlFree(initialization_val);
xmlFree(range_val);
return AVERROR(ENOMEM);
}
rep->init_section->url = get_content_url(baseurl_nodes, 4,
max_url_size,
rep_id_val,
rep_bandwidth_val,
initialization_val);
if (!rep->init_section->url) {
av_free(rep->init_section);
xmlFree(initialization_val);
xmlFree(range_val);
return AVERROR(ENOMEM);
}
xmlFree(initialization_val);
xmlFree(range_val);
}
} else if (!av_strcasecmp(fragmenturl_node->name, (const char *)"SegmentURL")) {
media_val = xmlGetProp(fragmenturl_node, "media");
range_val = xmlGetProp(fragmenturl_node, "mediaRange");
if (media_val || range_val) {
struct fragment *seg = get_Fragment(range_val);
if (!seg) {
xmlFree(media_val);
xmlFree(range_val);
return AVERROR(ENOMEM);
}
seg->url = get_content_url(baseurl_nodes, 4,
max_url_size,
rep_id_val,
rep_bandwidth_val,
media_val);
if (!seg->url) {
av_free(seg);
xmlFree(media_val);
xmlFree(range_val);
return AVERROR(ENOMEM);
}
dynarray_add(&rep->fragments, &rep->n_fragments, seg);
xmlFree(media_val);
xmlFree(range_val);
}
}
return 0;
}
static int parse_manifest_segmenttimeline(AVFormatContext *s, struct representation *rep,
xmlNodePtr fragment_timeline_node)
{
xmlAttrPtr attr = NULL;
char *val = NULL;
if (!av_strcasecmp(fragment_timeline_node->name, (const char *)"S")) {
struct timeline *tml = av_mallocz(sizeof(struct timeline));
if (!tml) {
return AVERROR(ENOMEM);
}
attr = fragment_timeline_node->properties;
while (attr) {
val = xmlGetProp(fragment_timeline_node, attr->name);
if (!val) {
av_log(s, AV_LOG_WARNING, "parse_manifest_segmenttimeline attr->name = %s val is NULL\n", attr->name);
continue;
}
if (!av_strcasecmp(attr->name, (const char *)"t")) {
tml->starttime = (int64_t)strtoll(val, NULL, 10);
} else if (!av_strcasecmp(attr->name, (const char *)"r")) {
tml->repeat =(int64_t) strtoll(val, NULL, 10);
} else if (!av_strcasecmp(attr->name, (const char *)"d")) {
tml->duration = (int64_t)strtoll(val, NULL, 10);
}
attr = attr->next;
xmlFree(val);
}
dynarray_add(&rep->timelines, &rep->n_timelines, tml);
}
return 0;
}
static int resolve_content_path(AVFormatContext *s, const char *url, int *max_url_size, xmlNodePtr *baseurl_nodes, int n_baseurl_nodes)
{
char *tmp_str = NULL;
char *path = NULL;
char *mpdName = NULL;
xmlNodePtr node = NULL;
char *baseurl = NULL;
char *root_url = NULL;
char *text = NULL;
char *tmp = NULL;
int isRootHttp = 0;
char token ='/';
int start = 0;
int rootId = 0;
int updated = 0;
int size = 0;
int i;
int tmp_max_url_size = strlen(url);
for (i = n_baseurl_nodes-1; i >= 0 ; i--) {
text = xmlNodeGetContent(baseurl_nodes[i]);
if (!text)
continue;
tmp_max_url_size += strlen(text);
if (ishttp(text)) {
xmlFree(text);
break;
}
xmlFree(text);
}
tmp_max_url_size = aligned(tmp_max_url_size);
text = av_mallocz(tmp_max_url_size);
if (!text) {
updated = AVERROR(ENOMEM);
goto end;
}
av_strlcpy(text, url, strlen(url)+1);
tmp = text;
while (mpdName = av_strtok(tmp, "/", &tmp)) {
size = strlen(mpdName);
}
av_free(text);
path = av_mallocz(tmp_max_url_size);
tmp_str = av_mallocz(tmp_max_url_size);
if (!tmp_str || !path) {
updated = AVERROR(ENOMEM);
goto end;
}
av_strlcpy (path, url, strlen(url) - size + 1);
for (rootId = n_baseurl_nodes - 1; rootId > 0; rootId --) {
if (!(node = baseurl_nodes[rootId])) {
continue;
}
text = xmlNodeGetContent(node);
if (ishttp(text)) {
xmlFree(text);
break;
}
xmlFree(text);
}
node = baseurl_nodes[rootId];
baseurl = xmlNodeGetContent(node);
root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path;
if (node) {
xmlNodeSetContent(node, root_url);
updated = 1;
}
size = strlen(root_url);
isRootHttp = ishttp(root_url);
if (root_url[size - 1] != token) {
av_strlcat(root_url, "/", size + 2);
size += 2;
}
for (i = 0; i < n_baseurl_nodes; ++i) {
if (i == rootId) {
continue;
}
text = xmlNodeGetContent(baseurl_nodes[i]);
if (text && !av_strstart(text, "/", NULL)) {
memset(tmp_str, 0, strlen(tmp_str));
if (!ishttp(text) && isRootHttp) {
av_strlcpy(tmp_str, root_url, size + 1);
}
start = (text[0] == token);
if (start && av_stristr(tmp_str, text)) {
char *p = tmp_str;
if (!av_strncasecmp(tmp_str, "http://", 7)) {
p += 7;
} else if (!av_strncasecmp(tmp_str, "https://", 8)) {
p += 8;
}
p = strchr(p, '/');
memset(p + 1, 0, strlen(p));
}
av_strlcat(tmp_str, text + start, tmp_max_url_size);
xmlNodeSetContent(baseurl_nodes[i], tmp_str);
updated = 1;
xmlFree(text);
}
}
end:
if (tmp_max_url_size > *max_url_size) {
*max_url_size = tmp_max_url_size;
}
av_free(path);
av_free(tmp_str);
xmlFree(baseurl);
return updated;
}
static int parse_manifest_representation(AVFormatContext *s, const char *url,
xmlNodePtr node,
xmlNodePtr adaptionset_node,
xmlNodePtr mpd_baseurl_node,
xmlNodePtr period_baseurl_node,
xmlNodePtr period_segmenttemplate_node,
xmlNodePtr period_segmentlist_node,
xmlNodePtr fragment_template_node,
xmlNodePtr content_component_node,
xmlNodePtr adaptionset_baseurl_node,
xmlNodePtr adaptionset_segmentlist_node,
xmlNodePtr adaptionset_supplementalproperty_node)
{
int32_t ret = 0;
int32_t subtitle_rep_idx = 0;
int32_t audio_rep_idx = 0;
int32_t video_rep_idx = 0;
DASHContext *c = s->priv_data;
struct representation *rep = NULL;
struct fragment *seg = NULL;
xmlNodePtr representation_segmenttemplate_node = NULL;
xmlNodePtr representation_baseurl_node = NULL;
xmlNodePtr representation_segmentlist_node = NULL;
xmlNodePtr segmentlists_tab[3];
xmlNodePtr fragment_timeline_node = NULL;
xmlNodePtr fragment_templates_tab[5];
char *duration_val = NULL;
char *presentation_timeoffset_val = NULL;
char *startnumber_val = NULL;
char *timescale_val = NULL;
char *initialization_val = NULL;
char *media_val = NULL;
char *val = NULL;
xmlNodePtr baseurl_nodes[4];
xmlNodePtr representation_node = node;
char *rep_id_val = xmlGetProp(representation_node, "id");
char *rep_bandwidth_val = xmlGetProp(representation_node, "bandwidth");
char *rep_framerate_val = xmlGetProp(representation_node, "frameRate");
enum AVMediaType type = AVMEDIA_TYPE_UNKNOWN;
// try get information from representation
if (type == AVMEDIA_TYPE_UNKNOWN)
type = get_content_type(representation_node);
// try get information from contentComponen
if (type == AVMEDIA_TYPE_UNKNOWN)
type = get_content_type(content_component_node);
// try get information from adaption set
if (type == AVMEDIA_TYPE_UNKNOWN)
type = get_content_type(adaptionset_node);
if (type == AVMEDIA_TYPE_UNKNOWN) {
av_log(s, AV_LOG_VERBOSE, "Parsing '%s' - skipp not supported representation type\n", url);
} else if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO || type == AVMEDIA_TYPE_SUBTITLE) {
// convert selected representation to our internal struct
rep = av_mallocz(sizeof(struct representation));
if (!rep) {
ret = AVERROR(ENOMEM);
goto end;
}
if (c->adaptionset_lang) {
rep->lang = av_strdup(c->adaptionset_lang);
if (!rep->lang) {
av_log(s, AV_LOG_ERROR, "alloc language memory failure\n");
av_freep(&rep);
ret = AVERROR(ENOMEM);
goto end;
}
}
rep->parent = s;
representation_segmenttemplate_node = find_child_node_by_name(representation_node, "SegmentTemplate");
representation_baseurl_node = find_child_node_by_name(representation_node, "BaseURL");
representation_segmentlist_node = find_child_node_by_name(representation_node, "SegmentList");
baseurl_nodes[0] = mpd_baseurl_node;
baseurl_nodes[1] = period_baseurl_node;
baseurl_nodes[2] = adaptionset_baseurl_node;
baseurl_nodes[3] = representation_baseurl_node;
ret = resolve_content_path(s, url, &c->max_url_size, baseurl_nodes, 4);
c->max_url_size = aligned(c->max_url_size
+ (rep_id_val ? strlen(rep_id_val) : 0)
+ (rep_bandwidth_val ? strlen(rep_bandwidth_val) : 0));
if (ret == AVERROR(ENOMEM) || ret == 0) {
goto end;
}
if (representation_segmenttemplate_node || fragment_template_node || period_segmenttemplate_node) {
fragment_timeline_node = NULL;
fragment_templates_tab[0] = representation_segmenttemplate_node;
fragment_templates_tab[1] = adaptionset_segmentlist_node;
fragment_templates_tab[2] = fragment_template_node;
fragment_templates_tab[3] = period_segmenttemplate_node;
fragment_templates_tab[4] = period_segmentlist_node;
presentation_timeoffset_val = get_val_from_nodes_tab(fragment_templates_tab, 4, "presentationTimeOffset");
duration_val = get_val_from_nodes_tab(fragment_templates_tab, 4, "duration");
startnumber_val = get_val_from_nodes_tab(fragment_templates_tab, 4, "startNumber");
timescale_val = get_val_from_nodes_tab(fragment_templates_tab, 4, "timescale");
initialization_val = get_val_from_nodes_tab(fragment_templates_tab, 4, "initialization");
media_val = get_val_from_nodes_tab(fragment_templates_tab, 4, "media");
if (initialization_val) {
rep->init_section = av_mallocz(sizeof(struct fragment));
if (!rep->init_section) {
av_free(rep);
ret = AVERROR(ENOMEM);
goto end;
}
c->max_url_size = aligned(c->max_url_size + strlen(initialization_val));
rep->init_section->url = get_content_url(baseurl_nodes, 4, c->max_url_size, rep_id_val, rep_bandwidth_val, initialization_val);
if (!rep->init_section->url) {
av_free(rep->init_section);
av_free(rep);
ret = AVERROR(ENOMEM);
goto end;
}
rep->init_section->size = -1;
xmlFree(initialization_val);
}
if (media_val) {
c->max_url_size = aligned(c->max_url_size + strlen(media_val));
rep->url_template = get_content_url(baseurl_nodes, 4, c->max_url_size, rep_id_val, rep_bandwidth_val, media_val);
xmlFree(media_val);
}
if (presentation_timeoffset_val) {
rep->presentation_timeoffset = (int64_t) strtoll(presentation_timeoffset_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->presentation_timeoffset = [%"PRId64"]\n", rep->presentation_timeoffset);
xmlFree(presentation_timeoffset_val);
}
if (duration_val) {
rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->fragment_duration = [%"PRId64"]\n", rep->fragment_duration);
xmlFree(duration_val);
}
if (timescale_val) {
rep->fragment_timescale = (int64_t) strtoll(timescale_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->fragment_timescale = [%"PRId64"]\n", rep->fragment_timescale);
xmlFree(timescale_val);
}
if (startnumber_val) {
rep->start_number = rep->first_seq_no = (int64_t) strtoll(startnumber_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->first_seq_no = [%"PRId64"]\n", rep->first_seq_no);
xmlFree(startnumber_val);
}
if (adaptionset_supplementalproperty_node) {
if (!av_strcasecmp(xmlGetProp(adaptionset_supplementalproperty_node,"schemeIdUri"), "http://dashif.org/guidelines/last-segment-number")) {
val = xmlGetProp(adaptionset_supplementalproperty_node,"value");
if (!val) {
av_log(s, AV_LOG_ERROR, "Missing value attribute in adaptionset_supplementalproperty_node\n");
} else {
rep->last_seq_no =(int64_t) strtoll(val, NULL, 10) - 1;
xmlFree(val);
}
}
}
fragment_timeline_node = find_child_node_by_name(representation_segmenttemplate_node, "SegmentTimeline");
if (!fragment_timeline_node)
fragment_timeline_node = find_child_node_by_name(fragment_template_node, "SegmentTimeline");
if (!fragment_timeline_node)
fragment_timeline_node = find_child_node_by_name(adaptionset_segmentlist_node, "SegmentTimeline");
if (!fragment_timeline_node)
fragment_timeline_node = find_child_node_by_name(period_segmentlist_node, "SegmentTimeline");
if (fragment_timeline_node) {
fragment_timeline_node = xmlFirstElementChild(fragment_timeline_node);
while (fragment_timeline_node) {
ret = parse_manifest_segmenttimeline(s, rep, fragment_timeline_node);
if (ret < 0) {
return ret;
}
fragment_timeline_node = xmlNextElementSibling(fragment_timeline_node);
}
}
} else if (representation_baseurl_node && !representation_segmentlist_node) {
seg = av_mallocz(sizeof(struct fragment));
if (!seg) {
ret = AVERROR(ENOMEM);
goto end;
}
seg->url = get_content_url(baseurl_nodes, 4, c->max_url_size, rep_id_val, rep_bandwidth_val, NULL);
if (!seg->url) {
av_free(seg);
ret = AVERROR(ENOMEM);
goto end;
}
seg->size = -1;
dynarray_add(&rep->fragments, &rep->n_fragments, seg);
} else if (representation_segmentlist_node) {
// TODO: https://www.brendanlong.com/the-structure-of-an-mpeg-dash-mpd.html
// http://www-itec.uni-klu.ac.at/dash/ddash/mpdGenerator.php?fragmentlength=15&type=full
xmlNodePtr fragmenturl_node = NULL;
segmentlists_tab[0] = representation_segmentlist_node;
segmentlists_tab[1] = adaptionset_segmentlist_node;
segmentlists_tab[2] = period_segmentlist_node;
duration_val = get_val_from_nodes_tab(segmentlists_tab, 3, "duration");
timescale_val = get_val_from_nodes_tab(segmentlists_tab, 3, "timescale");
startnumber_val = get_val_from_nodes_tab(segmentlists_tab, 3, "startNumber");
if (duration_val) {
rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->fragment_duration = [%"PRId64"]\n", rep->fragment_duration);
xmlFree(duration_val);
}
if (timescale_val) {
rep->fragment_timescale = (int64_t) strtoll(timescale_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->fragment_timescale = [%"PRId64"]\n", rep->fragment_timescale);
xmlFree(timescale_val);
}
if (startnumber_val) {
rep->start_number = rep->first_seq_no = (int64_t) strtoll(startnumber_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->first_seq_no = [%"PRId64"]\n", rep->first_seq_no);
xmlFree(startnumber_val);
}
fragmenturl_node = xmlFirstElementChild(representation_segmentlist_node);
while (fragmenturl_node) {
ret = parse_manifest_segmenturlnode(s, rep, fragmenturl_node,
baseurl_nodes,
rep_id_val,
rep_bandwidth_val);
if (ret < 0) {
return ret;
}
fragmenturl_node = xmlNextElementSibling(fragmenturl_node);
}
fragment_timeline_node = find_child_node_by_name(representation_segmenttemplate_node, "SegmentTimeline");
if (!fragment_timeline_node)
fragment_timeline_node = find_child_node_by_name(fragment_template_node, "SegmentTimeline");
if (!fragment_timeline_node)
fragment_timeline_node = find_child_node_by_name(adaptionset_segmentlist_node, "SegmentTimeline");
if (!fragment_timeline_node)
fragment_timeline_node = find_child_node_by_name(period_segmentlist_node, "SegmentTimeline");
if (fragment_timeline_node) {
fragment_timeline_node = xmlFirstElementChild(fragment_timeline_node);
while (fragment_timeline_node) {
ret = parse_manifest_segmenttimeline(s, rep, fragment_timeline_node);
if (ret < 0) {
return ret;
}
fragment_timeline_node = xmlNextElementSibling(fragment_timeline_node);
}
}
} else {
free_representation(rep);
rep = NULL;
av_log(s, AV_LOG_ERROR, "Unknown format of Representation node id[%s] \n", (const char *)rep_id_val);
}
if (rep) {
if (rep->fragment_duration > 0 && !rep->fragment_timescale)
rep->fragment_timescale = 1;
rep->bandwidth = rep_bandwidth_val ? atoi(rep_bandwidth_val) : 0;
strncpy(rep->id, rep_id_val ? rep_id_val : "", sizeof(rep->id));
rep->framerate = av_make_q(0, 0);
if (type == AVMEDIA_TYPE_VIDEO && rep_framerate_val) {
ret = av_parse_video_rate(&rep->framerate, rep_framerate_val);
if (ret < 0)
av_log(s, AV_LOG_VERBOSE, "Ignoring invalid frame rate '%s'\n", rep_framerate_val);
}
switch (type) {
case AVMEDIA_TYPE_VIDEO:
rep->rep_idx = video_rep_idx;
dynarray_add(&c->videos, &c->n_videos, rep);
break;
case AVMEDIA_TYPE_AUDIO:
rep->rep_idx = audio_rep_idx;
dynarray_add(&c->audios, &c->n_audios, rep);
break;
case AVMEDIA_TYPE_SUBTITLE:
rep->rep_idx = subtitle_rep_idx;
dynarray_add(&c->subtitles, &c->n_subtitles, rep);
break;
default:
av_log(s, AV_LOG_WARNING, "Unsupported the stream type %d\n", type);
break;
}
}
}
video_rep_idx += type == AVMEDIA_TYPE_VIDEO;
audio_rep_idx += type == AVMEDIA_TYPE_AUDIO;
subtitle_rep_idx += type == AVMEDIA_TYPE_SUBTITLE;
end:
if (rep_id_val)
xmlFree(rep_id_val);
if (rep_bandwidth_val)
xmlFree(rep_bandwidth_val);
if (rep_framerate_val)
xmlFree(rep_framerate_val);
return ret;
}
static int parse_manifest_adaptationset_attr(AVFormatContext *s, xmlNodePtr adaptionset_node)
{
DASHContext *c = s->priv_data;
if (!adaptionset_node) {
av_log(s, AV_LOG_WARNING, "Cannot get AdaptionSet\n");
return AVERROR(EINVAL);
}
c->adaptionset_lang = xmlGetProp(adaptionset_node, "lang");
return 0;
}
static int parse_manifest_adaptationset(AVFormatContext *s, const char *url,
xmlNodePtr adaptionset_node,
xmlNodePtr mpd_baseurl_node,
xmlNodePtr period_baseurl_node,
xmlNodePtr period_segmenttemplate_node,
xmlNodePtr period_segmentlist_node)
{
int ret = 0;
DASHContext *c = s->priv_data;
xmlNodePtr fragment_template_node = NULL;
xmlNodePtr content_component_node = NULL;
xmlNodePtr adaptionset_baseurl_node = NULL;
xmlNodePtr adaptionset_segmentlist_node = NULL;
xmlNodePtr adaptionset_supplementalproperty_node = NULL;
xmlNodePtr node = NULL;
ret = parse_manifest_adaptationset_attr(s, adaptionset_node);
if (ret < 0)
return ret;
node = xmlFirstElementChild(adaptionset_node);
while (node) {
if (!av_strcasecmp(node->name, (const char *)"SegmentTemplate")) {
fragment_template_node = node;
} else if (!av_strcasecmp(node->name, (const char *)"ContentComponent")) {
content_component_node = node;
} else if (!av_strcasecmp(node->name, (const char *)"BaseURL")) {
adaptionset_baseurl_node = node;
} else if (!av_strcasecmp(node->name, (const char *)"SegmentList")) {
adaptionset_segmentlist_node = node;
} else if (!av_strcasecmp(node->name, (const char *)"SupplementalProperty")) {
adaptionset_supplementalproperty_node = node;
} else if (!av_strcasecmp(node->name, (const char *)"Representation")) {
ret = parse_manifest_representation(s, url, node,
adaptionset_node,
mpd_baseurl_node,
period_baseurl_node,
period_segmenttemplate_node,
period_segmentlist_node,
fragment_template_node,
content_component_node,
adaptionset_baseurl_node,
adaptionset_segmentlist_node,
adaptionset_supplementalproperty_node);
if (ret < 0)
goto err;
}
node = xmlNextElementSibling(node);
}
err:
av_freep(&c->adaptionset_lang);
return ret;
}
static int parse_programinformation(AVFormatContext *s, xmlNodePtr node)
{
xmlChar *val = NULL;
node = xmlFirstElementChild(node);
while (node) {
if (!av_strcasecmp(node->name, "Title")) {
val = xmlNodeGetContent(node);
if (val) {
av_dict_set(&s->metadata, "Title", val, 0);
}
} else if (!av_strcasecmp(node->name, "Source")) {
val = xmlNodeGetContent(node);
if (val) {
av_dict_set(&s->metadata, "Source", val, 0);
}
} else if (!av_strcasecmp(node->name, "Copyright")) {
val = xmlNodeGetContent(node);
if (val) {
av_dict_set(&s->metadata, "Copyright", val, 0);
}
}
node = xmlNextElementSibling(node);
xmlFree(val);
val = NULL;
}
return 0;
}
static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
{
DASHContext *c = s->priv_data;
int ret = 0;
int close_in = 0;
uint8_t *new_url = NULL;
int64_t filesize = 0;
AVBPrint buf;
AVDictionary *opts = NULL;
xmlDoc *doc = NULL;
xmlNodePtr root_element = NULL;
xmlNodePtr node = NULL;
xmlNodePtr period_node = NULL;
xmlNodePtr tmp_node = NULL;
xmlNodePtr mpd_baseurl_node = NULL;
xmlNodePtr period_baseurl_node = NULL;
xmlNodePtr period_segmenttemplate_node = NULL;
xmlNodePtr period_segmentlist_node = NULL;
xmlNodePtr adaptionset_node = NULL;
xmlAttrPtr attr = NULL;
char *val = NULL;
uint32_t period_duration_sec = 0;
uint32_t period_start_sec = 0;
if (!in) {
close_in = 1;
av_dict_copy(&opts, c->avio_opts, 0);
ret = avio_open2(&in, url, AVIO_FLAG_READ, c->interrupt_callback, &opts);
av_dict_free(&opts);
if (ret < 0)
return ret;
}
if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, &new_url) >= 0) {
c->base_url = av_strdup(new_url);
} else {
c->base_url = av_strdup(url);
}
filesize = avio_size(in);
if (filesize > MAX_MANIFEST_SIZE) {
av_log(s, AV_LOG_ERROR, "Manifest too large: %"PRId64"\n", filesize);
return AVERROR_INVALIDDATA;
}
av_bprint_init(&buf, (filesize > 0) ? filesize + 1 : DEFAULT_MANIFEST_SIZE, AV_BPRINT_SIZE_UNLIMITED);
if ((ret = avio_read_to_bprint(in, &buf, MAX_MANIFEST_SIZE)) < 0 ||
!avio_feof(in) ||
(filesize = buf.len) == 0) {
av_log(s, AV_LOG_ERROR, "Unable to read to manifest '%s'\n", url);
if (ret == 0)
ret = AVERROR_INVALIDDATA;
} else {
LIBXML_TEST_VERSION
doc = xmlReadMemory(buf.str, filesize, c->base_url, NULL, 0);
root_element = xmlDocGetRootElement(doc);
node = root_element;
if (!node) {
ret = AVERROR_INVALIDDATA;
av_log(s, AV_LOG_ERROR, "Unable to parse '%s' - missing root node\n", url);
goto cleanup;
}
if (node->type != XML_ELEMENT_NODE ||
av_strcasecmp(node->name, (const char *)"MPD")) {
ret = AVERROR_INVALIDDATA;
av_log(s, AV_LOG_ERROR, "Unable to parse '%s' - wrong root node name[%s] type[%d]\n", url, node->name, (int)node->type);
goto cleanup;
}
val = xmlGetProp(node, "type");
if (!val) {
av_log(s, AV_LOG_ERROR, "Unable to parse '%s' - missing type attrib\n", url);
ret = AVERROR_INVALIDDATA;
goto cleanup;
}
if (!av_strcasecmp(val, (const char *)"dynamic"))
c->is_live = 1;
xmlFree(val);
attr = node->properties;
while (attr) {
val = xmlGetProp(node, attr->name);
if (!av_strcasecmp(attr->name, (const char *)"availabilityStartTime")) {
c->availability_start_time = get_utc_date_time_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->availability_start_time = [%"PRId64"]\n", c->availability_start_time);
} else if (!av_strcasecmp(attr->name, (const char *)"availabilityEndTime")) {
c->availability_end_time = get_utc_date_time_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->availability_end_time = [%"PRId64"]\n", c->availability_end_time);
} else if (!av_strcasecmp(attr->name, (const char *)"publishTime")) {
c->publish_time = get_utc_date_time_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->publish_time = [%"PRId64"]\n", c->publish_time);
} else if (!av_strcasecmp(attr->name, (const char *)"minimumUpdatePeriod")) {
c->minimum_update_period = get_duration_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->minimum_update_period = [%"PRId64"]\n", c->minimum_update_period);
} else if (!av_strcasecmp(attr->name, (const char *)"timeShiftBufferDepth")) {
c->time_shift_buffer_depth = get_duration_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->time_shift_buffer_depth = [%"PRId64"]\n", c->time_shift_buffer_depth);
} else if (!av_strcasecmp(attr->name, (const char *)"minBufferTime")) {
c->min_buffer_time = get_duration_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->min_buffer_time = [%"PRId64"]\n", c->min_buffer_time);
} else if (!av_strcasecmp(attr->name, (const char *)"suggestedPresentationDelay")) {
c->suggested_presentation_delay = get_duration_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->suggested_presentation_delay = [%"PRId64"]\n", c->suggested_presentation_delay);
} else if (!av_strcasecmp(attr->name, (const char *)"mediaPresentationDuration")) {
c->media_presentation_duration = get_duration_insec(s, (const char *)val);
av_log(s, AV_LOG_TRACE, "c->media_presentation_duration = [%"PRId64"]\n", c->media_presentation_duration);
}
attr = attr->next;
xmlFree(val);
}
tmp_node = find_child_node_by_name(node, "BaseURL");
if (tmp_node) {
mpd_baseurl_node = xmlCopyNode(tmp_node,1);
} else {
mpd_baseurl_node = xmlNewNode(NULL, "BaseURL");
}
// at now we can handle only one period, with the longest duration
node = xmlFirstElementChild(node);
while (node) {
if (!av_strcasecmp(node->name, (const char *)"Period")) {
period_duration_sec = 0;
period_start_sec = 0;
attr = node->properties;
while (attr) {
val = xmlGetProp(node, attr->name);
if (!av_strcasecmp(attr->name, (const char *)"duration")) {
period_duration_sec = get_duration_insec(s, (const char *)val);
} else if (!av_strcasecmp(attr->name, (const char *)"start")) {
period_start_sec = get_duration_insec(s, (const char *)val);
}
attr = attr->next;
xmlFree(val);
}
if ((period_duration_sec) >= (c->period_duration)) {
period_node = node;
c->period_duration = period_duration_sec;
c->period_start = period_start_sec;
if (c->period_start > 0)
c->media_presentation_duration = c->period_duration;
}
} else if (!av_strcasecmp(node->name, "ProgramInformation")) {
parse_programinformation(s, node);
}
node = xmlNextElementSibling(node);
}
if (!period_node) {
av_log(s, AV_LOG_ERROR, "Unable to parse '%s' - missing Period node\n", url);
ret = AVERROR_INVALIDDATA;
goto cleanup;
}
adaptionset_node = xmlFirstElementChild(period_node);
while (adaptionset_node) {
if (!av_strcasecmp(adaptionset_node->name, (const char *)"BaseURL")) {
period_baseurl_node = adaptionset_node;
} else if (!av_strcasecmp(adaptionset_node->name, (const char *)"SegmentTemplate")) {
period_segmenttemplate_node = adaptionset_node;
} else if (!av_strcasecmp(adaptionset_node->name, (const char *)"SegmentList")) {
period_segmentlist_node = adaptionset_node;
} else if (!av_strcasecmp(adaptionset_node->name, (const char *)"AdaptationSet")) {
parse_manifest_adaptationset(s, url, adaptionset_node, mpd_baseurl_node, period_baseurl_node, period_segmenttemplate_node, period_segmentlist_node);
}
adaptionset_node = xmlNextElementSibling(adaptionset_node);
}
cleanup:
/*free the document */
xmlFreeDoc(doc);
xmlCleanupParser();
xmlFreeNode(mpd_baseurl_node);
}
av_free(new_url);
av_bprint_finalize(&buf, NULL);
if (close_in) {
avio_close(in);
}
return ret;
}
static int64_t calc_cur_seg_no(AVFormatContext *s, struct representation *pls)
{
DASHContext *c = s->priv_data;
int64_t num = 0;
int64_t start_time_offset = 0;
if (c->is_live) {
if (pls->n_fragments) {
av_log(s, AV_LOG_TRACE, "in n_fragments mode\n");
num = pls->first_seq_no;
} else if (pls->n_timelines) {
av_log(s, AV_LOG_TRACE, "in n_timelines mode\n");
start_time_offset = get_segment_start_time_based_on_timeline(pls, 0xFFFFFFFF) - 60 * pls->fragment_timescale; // 60 seconds before end
num = calc_next_seg_no_from_timelines(pls, start_time_offset);
if (num == -1)
num = pls->first_seq_no;
else
num += pls->first_seq_no;
} else if (pls->fragment_duration){
av_log(s, AV_LOG_TRACE, "in fragment_duration mode fragment_timescale = %"PRId64", presentation_timeoffset = %"PRId64"\n", pls->fragment_timescale, pls->presentation_timeoffset);
if (pls->presentation_timeoffset) {
num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time) * pls->fragment_timescale)-pls->presentation_timeoffset) / pls->fragment_duration - c->min_buffer_time;
} else if (c->publish_time > 0 && !c->availability_start_time) {
if (c->min_buffer_time) {
num = pls->first_seq_no + (((c->publish_time + pls->fragment_duration) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration - c->min_buffer_time;
} else {
num = pls->first_seq_no + (((c->publish_time - c->time_shift_buffer_depth + pls->fragment_duration) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration;
}
} else {
num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration;
}
}
} else {
num = pls->first_seq_no;
}
return num;
}
static int64_t calc_min_seg_no(AVFormatContext *s, struct representation *pls)
{
DASHContext *c = s->priv_data;
int64_t num = 0;
if (c->is_live && pls->fragment_duration) {
av_log(s, AV_LOG_TRACE, "in live mode\n");
num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time) - c->time_shift_buffer_depth) * pls->fragment_timescale) / pls->fragment_duration;
} else {
num = pls->first_seq_no;
}
return num;
}
static int64_t calc_max_seg_no(struct representation *pls, DASHContext *c)
{
int64_t num = 0;
if (pls->n_fragments) {
num = pls->first_seq_no + pls->n_fragments - 1;
} else if (pls->n_timelines) {
int i = 0;
num = pls->first_seq_no + pls->n_timelines - 1;
for (i = 0; i < pls->n_timelines; i++) {
if (pls->timelines[i]->repeat == -1) {
int length_of_each_segment = pls->timelines[i]->duration / pls->fragment_timescale;
num = c->period_duration / length_of_each_segment;
} else {
num += pls->timelines[i]->repeat;
}
}
} else if (c->is_live && pls->fragment_duration) {
num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time)) * pls->fragment_timescale) / pls->fragment_duration;
} else if (pls->fragment_duration) {
num = pls->first_seq_no + (c->media_presentation_duration * pls->fragment_timescale) / pls->fragment_duration;
}
return num;
}
static void move_timelines(struct representation *rep_src, struct representation *rep_dest, DASHContext *c)
{
if (rep_dest && rep_src ) {
free_timelines_list(rep_dest);
rep_dest->timelines = rep_src->timelines;
rep_dest->n_timelines = rep_src->n_timelines;
rep_dest->first_seq_no = rep_src->first_seq_no;
rep_dest->last_seq_no = calc_max_seg_no(rep_dest, c);
rep_src->timelines = NULL;
rep_src->n_timelines = 0;
rep_dest->cur_seq_no = rep_src->cur_seq_no;
}
}
static void move_segments(struct representation *rep_src, struct representation *rep_dest, DASHContext *c)
{
if (rep_dest && rep_src ) {
free_fragment_list(rep_dest);
if (rep_src->start_number > (rep_dest->start_number + rep_dest->n_fragments))
rep_dest->cur_seq_no = 0;
else
rep_dest->cur_seq_no += rep_src->start_number - rep_dest->start_number;
rep_dest->fragments = rep_src->fragments;
rep_dest->n_fragments = rep_src->n_fragments;
rep_dest->parent = rep_src->parent;
rep_dest->last_seq_no = calc_max_seg_no(rep_dest, c);
rep_src->fragments = NULL;
rep_src->n_fragments = 0;
}
}
static int refresh_manifest(AVFormatContext *s)
{
int ret = 0, i;
DASHContext *c = s->priv_data;
// save current context
int n_videos = c->n_videos;
struct representation **videos = c->videos;
int n_audios = c->n_audios;
struct representation **audios = c->audios;
int n_subtitles = c->n_subtitles;
struct representation **subtitles = c->subtitles;
char *base_url = c->base_url;
c->base_url = NULL;
c->n_videos = 0;
c->videos = NULL;
c->n_audios = 0;
c->audios = NULL;
c->n_subtitles = 0;
c->subtitles = NULL;
ret = parse_manifest(s, s->url, NULL);
if (ret)
goto finish;
if (c->n_videos != n_videos) {
av_log(c, AV_LOG_ERROR,
"new manifest has mismatched no. of video representations, %d -> %d\n",
n_videos, c->n_videos);
return AVERROR_INVALIDDATA;
}
if (c->n_audios != n_audios) {
av_log(c, AV_LOG_ERROR,
"new manifest has mismatched no. of audio representations, %d -> %d\n",
n_audios, c->n_audios);
return AVERROR_INVALIDDATA;
}
if (c->n_subtitles != n_subtitles) {
av_log(c, AV_LOG_ERROR,
"new manifest has mismatched no. of subtitles representations, %d -> %d\n",
n_subtitles, c->n_subtitles);
return AVERROR_INVALIDDATA;
}
for (i = 0; i < n_videos; i++) {
struct representation *cur_video = videos[i];
struct representation *ccur_video = c->videos[i];
if (cur_video->timelines) {
// calc current time
int64_t currentTime = get_segment_start_time_based_on_timeline(cur_video, cur_video->cur_seq_no) / cur_video->fragment_timescale;
// update segments
ccur_video->cur_seq_no = calc_next_seg_no_from_timelines(ccur_video, currentTime * cur_video->fragment_timescale - 1);
if (ccur_video->cur_seq_no >= 0) {
move_timelines(ccur_video, cur_video, c);
}
}
if (cur_video->fragments) {
move_segments(ccur_video, cur_video, c);
}
}
for (i = 0; i < n_audios; i++) {
struct representation *cur_audio = audios[i];
struct representation *ccur_audio = c->audios[i];
if (cur_audio->timelines) {
// calc current time
int64_t currentTime = get_segment_start_time_based_on_timeline(cur_audio, cur_audio->cur_seq_no) / cur_audio->fragment_timescale;
// update segments
ccur_audio->cur_seq_no = calc_next_seg_no_from_timelines(ccur_audio, currentTime * cur_audio->fragment_timescale - 1);
if (ccur_audio->cur_seq_no >= 0) {
move_timelines(ccur_audio, cur_audio, c);
}
}
if (cur_audio->fragments) {
move_segments(ccur_audio, cur_audio, c);
}
}
finish:
// restore context
if (c->base_url)
av_free(base_url);
else
c->base_url = base_url;
if (c->subtitles)
free_subtitle_list(c);
if (c->audios)
free_audio_list(c);
if (c->videos)
free_video_list(c);
c->n_subtitles = n_subtitles;
c->subtitles = subtitles;
c->n_audios = n_audios;
c->audios = audios;
c->n_videos = n_videos;
c->videos = videos;
return ret;
}
static struct fragment *get_current_fragment(struct representation *pls)
{
int64_t min_seq_no = 0;
int64_t max_seq_no = 0;
struct fragment *seg = NULL;
struct fragment *seg_ptr = NULL;
DASHContext *c = pls->parent->priv_data;
while (( !ff_check_interrupt(c->interrupt_callback)&& pls->n_fragments > 0)) {
if (pls->cur_seq_no < pls->n_fragments) {
seg_ptr = pls->fragments[pls->cur_seq_no];
seg = av_mallocz(sizeof(struct fragment));
if (!seg) {
return NULL;
}
seg->url = av_strdup(seg_ptr->url);
if (!seg->url) {
av_free(seg);
return NULL;
}
seg->size = seg_ptr->size;
seg->url_offset = seg_ptr->url_offset;
return seg;
} else if (c->is_live) {
refresh_manifest(pls->parent);
} else {
break;
}
}
if (c->is_live) {
min_seq_no = calc_min_seg_no(pls->parent, pls);
max_seq_no = calc_max_seg_no(pls, c);
if (pls->timelines || pls->fragments) {
refresh_manifest(pls->parent);
}
if (pls->cur_seq_no <= min_seq_no) {
av_log(pls->parent, AV_LOG_VERBOSE, "old fragment: cur[%"PRId64"] min[%"PRId64"] max[%"PRId64"], playlist %d\n", (int64_t)pls->cur_seq_no, min_seq_no, max_seq_no, (int)pls->rep_idx);
pls->cur_seq_no = calc_cur_seg_no(pls->parent, pls);
} else if (pls->cur_seq_no > max_seq_no) {
av_log(pls->parent, AV_LOG_VERBOSE, "new fragment: min[%"PRId64"] max[%"PRId64"], playlist %d\n", min_seq_no, max_seq_no, (int)pls->rep_idx);
}
seg = av_mallocz(sizeof(struct fragment));
if (!seg) {
return NULL;
}
} else if (pls->cur_seq_no <= pls->last_seq_no) {
seg = av_mallocz(sizeof(struct fragment));
if (!seg) {
return NULL;
}
}
if (seg) {
char *tmpfilename= av_mallocz(c->max_url_size);
if (!tmpfilename) {
return NULL;
}
ff_dash_fill_tmpl_params(tmpfilename, c->max_url_size, pls->url_template, 0, pls->cur_seq_no, 0, get_segment_start_time_based_on_timeline(pls, pls->cur_seq_no));
seg->url = av_strireplace(pls->url_template, pls->url_template, tmpfilename);
if (!seg->url) {
av_log(pls->parent, AV_LOG_WARNING, "Unable to resolve template url '%s', try to use origin template\n", pls->url_template);
seg->url = av_strdup(pls->url_template);
if (!seg->url) {
av_log(pls->parent, AV_LOG_ERROR, "Cannot resolve template url '%s'\n", pls->url_template);
av_free(tmpfilename);
return NULL;
}
}
av_free(tmpfilename);
seg->size = -1;
}
return seg;
}
static int read_from_url(struct representation *pls, struct fragment *seg,
uint8_t *buf, int buf_size)
{
int ret;
/* limit read if the fragment was only a part of a file */
if (seg->size >= 0)
buf_size = FFMIN(buf_size, pls->cur_seg_size - pls->cur_seg_offset);
ret = avio_read(pls->input, buf, buf_size);
if (ret > 0)
pls->cur_seg_offset += ret;
return ret;
}
static int open_input(DASHContext *c, struct representation *pls, struct fragment *seg)
{
AVDictionary *opts = NULL;
char *url = NULL;
int ret = 0;
url = av_mallocz(c->max_url_size);
if (!url) {
ret = AVERROR(ENOMEM);
goto cleanup;
}
if (seg->size >= 0) {
/* try to restrict the HTTP request to the part we want
* (if this is in fact a HTTP request) */
av_dict_set_int(&opts, "offset", seg->url_offset, 0);
av_dict_set_int(&opts, "end_offset", seg->url_offset + seg->size, 0);
}
ff_make_absolute_url(url, c->max_url_size, c->base_url, seg->url);
av_log(pls->parent, AV_LOG_VERBOSE, "DASH request for url '%s', offset %"PRId64", playlist %d\n",
url, seg->url_offset, pls->rep_idx);
ret = open_url(pls->parent, &pls->input, url, c->avio_opts, opts, NULL);
cleanup:
av_free(url);
av_dict_free(&opts);
pls->cur_seg_offset = 0;
pls->cur_seg_size = seg->size;
return ret;
}
static int update_init_section(struct representation *pls)
{
static const int max_init_section_size = 1024 * 1024;
DASHContext *c = pls->parent->priv_data;
int64_t sec_size;
int64_t urlsize;
int ret;
if (!pls->init_section || pls->init_sec_buf)
return 0;
ret = open_input(c, pls, pls->init_section);
if (ret < 0) {
av_log(pls->parent, AV_LOG_WARNING,
"Failed to open an initialization section in playlist %d\n",
pls->rep_idx);
return ret;
}
if (pls->init_section->size >= 0)
sec_size = pls->init_section->size;
else if ((urlsize = avio_size(pls->input)) >= 0)
sec_size = urlsize;
else
sec_size = max_init_section_size;
av_log(pls->parent, AV_LOG_DEBUG,
"Downloading an initialization section of size %"PRId64"\n",
sec_size);
sec_size = FFMIN(sec_size, max_init_section_size);
av_fast_malloc(&pls->init_sec_buf, &pls->init_sec_buf_size, sec_size);
ret = read_from_url(pls, pls->init_section, pls->init_sec_buf,
pls->init_sec_buf_size);
ff_format_io_close(pls->parent, &pls->input);
if (ret < 0)
return ret;
pls->init_sec_data_len = ret;
pls->init_sec_buf_read_offset = 0;
return 0;
}
static int64_t seek_data(void *opaque, int64_t offset, int whence)
{
struct representation *v = opaque;
if (v->n_fragments && !v->init_sec_data_len) {
return avio_seek(v->input, offset, whence);
}
return AVERROR(ENOSYS);
}
static int read_data(void *opaque, uint8_t *buf, int buf_size)
{
int ret = 0;
struct representation *v = opaque;
DASHContext *c = v->parent->priv_data;
restart:
if (!v->input) {
free_fragment(&v->cur_seg);
v->cur_seg = get_current_fragment(v);
if (!v->cur_seg) {
ret = AVERROR_EOF;
goto end;
}
/* load/update Media Initialization Section, if any */
ret = update_init_section(v);
if (ret)
goto end;
ret = open_input(c, v, v->cur_seg);
if (ret < 0) {
if (ff_check_interrupt(c->interrupt_callback)) {
ret = AVERROR_EXIT;
goto end;
}
av_log(v->parent, AV_LOG_WARNING, "Failed to open fragment of playlist %d\n", v->rep_idx);
v->cur_seq_no++;
goto restart;
}
}
if (v->init_sec_buf_read_offset < v->init_sec_data_len) {
/* Push init section out first before first actual fragment */
int copy_size = FFMIN(v->init_sec_data_len - v->init_sec_buf_read_offset, buf_size);
memcpy(buf, v->init_sec_buf, copy_size);
v->init_sec_buf_read_offset += copy_size;
ret = copy_size;
goto end;
}
/* check the v->cur_seg, if it is null, get current and double check if the new v->cur_seg*/
if (!v->cur_seg) {
v->cur_seg = get_current_fragment(v);
}
if (!v->cur_seg) {
ret = AVERROR_EOF;
goto end;
}
ret = read_from_url(v, v->cur_seg, buf, buf_size);
if (ret > 0)
goto end;
if (c->is_live || v->cur_seq_no < v->last_seq_no) {
if (!v->is_restart_needed)
v->cur_seq_no++;
v->is_restart_needed = 1;
}
end:
return ret;
}
static int save_avio_options(AVFormatContext *s)
{
DASHContext *c = s->priv_data;
const char *opts[] = {
"headers", "user_agent", "cookies", "http_proxy", "referer", "rw_timeout", "icy", NULL };
const char **opt = opts;
uint8_t *buf = NULL;
int ret = 0;
while (*opt) {
if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) {
if (buf[0] != '\0') {
ret = av_dict_set(&c->avio_opts, *opt, buf, AV_DICT_DONT_STRDUP_VAL);
if (ret < 0) {
av_freep(&buf);
return ret;
}
} else {
av_freep(&buf);
}
}
opt++;
}
return ret;
}
static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url,
int flags, AVDictionary **opts)
{
av_log(s, AV_LOG_ERROR,
"A DASH playlist item '%s' referred to an external file '%s'. "
"Opening this file was forbidden for security reasons\n",
s->url, url);
return AVERROR(EPERM);
}
static void close_demux_for_component(struct representation *pls)
{
/* note: the internal buffer could have changed */
av_freep(&pls->pb.buffer);
memset(&pls->pb, 0x00, sizeof(AVIOContext));
pls->ctx->pb = NULL;
avformat_close_input(&pls->ctx);
pls->ctx = NULL;
}
static int reopen_demux_for_component(AVFormatContext *s, struct representation *pls)
{
DASHContext *c = s->priv_data;
ff_const59 AVInputFormat *in_fmt = NULL;
AVDictionary *in_fmt_opts = NULL;
uint8_t *avio_ctx_buffer = NULL;
int ret = 0, i;
if (pls->ctx) {
close_demux_for_component(pls);
}
if (ff_check_interrupt(&s->interrupt_callback)) {
ret = AVERROR_EXIT;
goto fail;
}
if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
goto fail;
}
avio_ctx_buffer = av_malloc(INITIAL_BUFFER_SIZE);
if (!avio_ctx_buffer ) {
ret = AVERROR(ENOMEM);
avformat_free_context(pls->ctx);
pls->ctx = NULL;
goto fail;
}
if (c->is_live) {
ffio_init_context(&pls->pb, avio_ctx_buffer , INITIAL_BUFFER_SIZE, 0, pls, read_data, NULL, NULL);
} else {
ffio_init_context(&pls->pb, avio_ctx_buffer , INITIAL_BUFFER_SIZE, 0, pls, read_data, NULL, seek_data);
}
pls->pb.seekable = 0;
if ((ret = ff_copy_whiteblacklists(pls->ctx, s)) < 0)
goto fail;
pls->ctx->flags = AVFMT_FLAG_CUSTOM_IO;
pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4;
pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? s->max_analyze_duration : 4 * AV_TIME_BASE;
ret = av_probe_input_buffer(&pls->pb, &in_fmt, "", NULL, 0, 0);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Error when loading first fragment, playlist %d\n", (int)pls->rep_idx);
avformat_free_context(pls->ctx);
pls->ctx = NULL;
goto fail;
}
pls->ctx->pb = &pls->pb;
pls->ctx->io_open = nested_io_open;
// provide additional information from mpd if available
ret = avformat_open_input(&pls->ctx, "", in_fmt, &in_fmt_opts); //pls->init_section->url
av_dict_free(&in_fmt_opts);
if (ret < 0)
goto fail;
if (pls->n_fragments) {
#if FF_API_R_FRAME_RATE
if (pls->framerate.den) {
for (i = 0; i < pls->ctx->nb_streams; i++)
pls->ctx->streams[i]->r_frame_rate = pls->framerate;
}
#endif
ret = avformat_find_stream_info(pls->ctx, NULL);
if (ret < 0)
goto fail;
}
fail:
return ret;
}
static int open_demux_for_component(AVFormatContext *s, struct representation *pls)
{
int ret = 0;
int i;
pls->parent = s;
pls->cur_seq_no = calc_cur_seg_no(s, pls);
if (!pls->last_seq_no) {
pls->last_seq_no = calc_max_seg_no(pls, s->priv_data);
}
ret = reopen_demux_for_component(s, pls);
if (ret < 0) {
goto fail;
}
for (i = 0; i < pls->ctx->nb_streams; i++) {
AVStream *st = avformat_new_stream(s, NULL);
AVStream *ist = pls->ctx->streams[i];
if (!st) {
ret = AVERROR(ENOMEM);
goto fail;
}
st->id = i;
avcodec_parameters_copy(st->codecpar, ist->codecpar);
avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
}
return 0;
fail:
return ret;
}
static int is_common_init_section_exist(struct representation **pls, int n_pls)
{
struct fragment *first_init_section = pls[0]->init_section;
char *url =NULL;
int64_t url_offset = -1;
int64_t size = -1;
int i = 0;
if (first_init_section == NULL || n_pls == 0)
return 0;
url = first_init_section->url;
url_offset = first_init_section->url_offset;
size = pls[0]->init_section->size;
for (i=0;i<n_pls;i++) {
if (av_strcasecmp(pls[i]->init_section->url,url) || pls[i]->init_section->url_offset != url_offset || pls[i]->init_section->size != size) {
return 0;
}
}
return 1;
}
static int copy_init_section(struct representation *rep_dest, struct representation *rep_src)
{
rep_dest->init_sec_buf = av_mallocz(rep_src->init_sec_buf_size);
if (!rep_dest->init_sec_buf) {
av_log(rep_dest->ctx, AV_LOG_WARNING, "Cannot alloc memory for init_sec_buf\n");
return AVERROR(ENOMEM);
}
memcpy(rep_dest->init_sec_buf, rep_src->init_sec_buf, rep_src->init_sec_data_len);
rep_dest->init_sec_buf_size = rep_src->init_sec_buf_size;
rep_dest->init_sec_data_len = rep_src->init_sec_data_len;
rep_dest->cur_timestamp = rep_src->cur_timestamp;
return 0;
}
static int dash_read_header(AVFormatContext *s)
{
DASHContext *c = s->priv_data;
struct representation *rep;
int ret = 0;
int stream_index = 0;
int i;
c->interrupt_callback = &s->interrupt_callback;
if ((ret = save_avio_options(s)) < 0)
goto fail;
if ((ret = parse_manifest(s, s->url, s->pb)) < 0)
goto fail;
/* If this isn't a live stream, fill the total duration of the
* stream. */
if (!c->is_live) {
s->duration = (int64_t) c->media_presentation_duration * AV_TIME_BASE;
} else {
av_dict_set(&c->avio_opts, "seekable", "0", 0);
}
if(c->n_videos)
c->is_init_section_common_video = is_common_init_section_exist(c->videos, c->n_videos);
/* Open the demuxer for video and audio components if available */
for (i = 0; i < c->n_videos; i++) {
rep = c->videos[i];
if (i > 0 && c->is_init_section_common_video) {
ret = copy_init_section(rep, c->videos[0]);
if (ret < 0)
goto fail;
}
ret = open_demux_for_component(s, rep);
if (ret)
goto fail;
rep->stream_index = stream_index;
++stream_index;
}
if(c->n_audios)
c->is_init_section_common_audio = is_common_init_section_exist(c->audios, c->n_audios);
for (i = 0; i < c->n_audios; i++) {
rep = c->audios[i];
if (i > 0 && c->is_init_section_common_audio) {
ret = copy_init_section(rep, c->audios[0]);
if (ret < 0)
goto fail;
}
ret = open_demux_for_component(s, rep);
if (ret)
goto fail;
rep->stream_index = stream_index;
++stream_index;
}
if (c->n_subtitles)
c->is_init_section_common_audio = is_common_init_section_exist(c->subtitles, c->n_subtitles);
for (i = 0; i < c->n_subtitles; i++) {
rep = c->subtitles[i];
if (i > 0 && c->is_init_section_common_audio) {
ret = copy_init_section(rep, c->subtitles[0]);
if (ret < 0)
goto fail;
}
ret = open_demux_for_component(s, rep);
if (ret)
goto fail;
rep->stream_index = stream_index;
++stream_index;
}
if (!stream_index) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
/* Create a program */
if (!ret) {
AVProgram *program;
program = av_new_program(s, 0);
if (!program) {
goto fail;
}
for (i = 0; i < c->n_videos; i++) {
rep = c->videos[i];
av_program_add_stream_index(s, 0, rep->stream_index);
rep->assoc_stream = s->streams[rep->stream_index];
if (rep->bandwidth > 0)
av_dict_set_int(&rep->assoc_stream->metadata, "variant_bitrate", rep->bandwidth, 0);
if (rep->id[0])
av_dict_set(&rep->assoc_stream->metadata, "id", rep->id, 0);
}
for (i = 0; i < c->n_audios; i++) {
rep = c->audios[i];
av_program_add_stream_index(s, 0, rep->stream_index);
rep->assoc_stream = s->streams[rep->stream_index];
if (rep->bandwidth > 0)
av_dict_set_int(&rep->assoc_stream->metadata, "variant_bitrate", rep->bandwidth, 0);
if (rep->id[0])
av_dict_set(&rep->assoc_stream->metadata, "id", rep->id, 0);
if (rep->lang) {
av_dict_set(&rep->assoc_stream->metadata, "language", rep->lang, 0);
av_freep(&rep->lang);
}
}
for (i = 0; i < c->n_subtitles; i++) {
rep = c->subtitles[i];
av_program_add_stream_index(s, 0, rep->stream_index);
rep->assoc_stream = s->streams[rep->stream_index];
if (rep->id[0])
av_dict_set(&rep->assoc_stream->metadata, "id", rep->id, 0);
if (rep->lang) {
av_dict_set(&rep->assoc_stream->metadata, "language", rep->lang, 0);
av_freep(&rep->lang);
}
}
}
return 0;
fail:
return ret;
}
static void recheck_discard_flags(AVFormatContext *s, struct representation **p, int n)
{
int i, j;
for (i = 0; i < n; i++) {
struct representation *pls = p[i];
int needed = !pls->assoc_stream || pls->assoc_stream->discard < AVDISCARD_ALL;
if (needed && !pls->ctx) {
pls->cur_seg_offset = 0;
pls->init_sec_buf_read_offset = 0;
/* Catch up */
for (j = 0; j < n; j++) {
pls->cur_seq_no = FFMAX(pls->cur_seq_no, p[j]->cur_seq_no);
}
reopen_demux_for_component(s, pls);
av_log(s, AV_LOG_INFO, "Now receiving stream_index %d\n", pls->stream_index);
} else if (!needed && pls->ctx) {
close_demux_for_component(pls);
ff_format_io_close(pls->parent, &pls->input);
av_log(s, AV_LOG_INFO, "No longer receiving stream_index %d\n", pls->stream_index);
}
}
}
static int dash_read_packet(AVFormatContext *s, AVPacket *pkt)
{
DASHContext *c = s->priv_data;
int ret = 0, i;
int64_t mints = 0;
struct representation *cur = NULL;
struct representation *rep = NULL;
recheck_discard_flags(s, c->videos, c->n_videos);
recheck_discard_flags(s, c->audios, c->n_audios);
recheck_discard_flags(s, c->subtitles, c->n_subtitles);
for (i = 0; i < c->n_videos; i++) {
rep = c->videos[i];
if (!rep->ctx)
continue;
if (!cur || rep->cur_timestamp < mints) {
cur = rep;
mints = rep->cur_timestamp;
}
}
for (i = 0; i < c->n_audios; i++) {
rep = c->audios[i];
if (!rep->ctx)
continue;
if (!cur || rep->cur_timestamp < mints) {
cur = rep;
mints = rep->cur_timestamp;
}
}
for (i = 0; i < c->n_subtitles; i++) {
rep = c->subtitles[i];
if (!rep->ctx)
continue;
if (!cur || rep->cur_timestamp < mints) {
cur = rep;
mints = rep->cur_timestamp;
}
}
if (!cur) {
return AVERROR_INVALIDDATA;
}
while (!ff_check_interrupt(c->interrupt_callback) && !ret) {
ret = av_read_frame(cur->ctx, pkt);
if (ret >= 0) {
/* If we got a packet, return it */
cur->cur_timestamp = av_rescale(pkt->pts, (int64_t)cur->ctx->streams[0]->time_base.num * 90000, cur->ctx->streams[0]->time_base.den);
pkt->stream_index = cur->stream_index;
return 0;
}
if (cur->is_restart_needed) {
cur->cur_seg_offset = 0;
cur->init_sec_buf_read_offset = 0;
ff_format_io_close(cur->parent, &cur->input);
ret = reopen_demux_for_component(s, cur);
cur->is_restart_needed = 0;
}
}
return AVERROR_EOF;
}
static int dash_close(AVFormatContext *s)
{
DASHContext *c = s->priv_data;
free_audio_list(c);
free_video_list(c);
av_dict_free(&c->avio_opts);
av_freep(&c->base_url);
return 0;
}
static int dash_seek(AVFormatContext *s, struct representation *pls, int64_t seek_pos_msec, int flags, int dry_run)
{
int ret = 0;
int i = 0;
int j = 0;
int64_t duration = 0;
av_log(pls->parent, AV_LOG_VERBOSE, "DASH seek pos[%"PRId64"ms], playlist %d%s\n",
seek_pos_msec, pls->rep_idx, dry_run ? " (dry)" : "");
// single fragment mode
if (pls->n_fragments == 1) {
pls->cur_timestamp = 0;
pls->cur_seg_offset = 0;
if (dry_run)
return 0;
ff_read_frame_flush(pls->ctx);
return av_seek_frame(pls->ctx, -1, seek_pos_msec * 1000, flags);
}
ff_format_io_close(pls->parent, &pls->input);
// find the nearest fragment
if (pls->n_timelines > 0 && pls->fragment_timescale > 0) {
int64_t num = pls->first_seq_no;
av_log(pls->parent, AV_LOG_VERBOSE, "dash_seek with SegmentTimeline start n_timelines[%d] "
"last_seq_no[%"PRId64"], playlist %d.\n",
(int)pls->n_timelines, (int64_t)pls->last_seq_no, (int)pls->rep_idx);
for (i = 0; i < pls->n_timelines; i++) {
if (pls->timelines[i]->starttime > 0) {
duration = pls->timelines[i]->starttime;
}
duration += pls->timelines[i]->duration;
if (seek_pos_msec < ((duration * 1000) / pls->fragment_timescale)) {
goto set_seq_num;
}
for (j = 0; j < pls->timelines[i]->repeat; j++) {
duration += pls->timelines[i]->duration;
num++;
if (seek_pos_msec < ((duration * 1000) / pls->fragment_timescale)) {
goto set_seq_num;
}
}
num++;
}
set_seq_num:
pls->cur_seq_no = num > pls->last_seq_no ? pls->last_seq_no : num;
av_log(pls->parent, AV_LOG_VERBOSE, "dash_seek with SegmentTimeline end cur_seq_no[%"PRId64"], playlist %d.\n",
(int64_t)pls->cur_seq_no, (int)pls->rep_idx);
} else if (pls->fragment_duration > 0) {
pls->cur_seq_no = pls->first_seq_no + ((seek_pos_msec * pls->fragment_timescale) / pls->fragment_duration) / 1000;
} else {
av_log(pls->parent, AV_LOG_ERROR, "dash_seek missing timeline or fragment_duration\n");
pls->cur_seq_no = pls->first_seq_no;
}
pls->cur_timestamp = 0;
pls->cur_seg_offset = 0;
pls->init_sec_buf_read_offset = 0;
ret = dry_run ? 0 : reopen_demux_for_component(s, pls);
return ret;
}
static int dash_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
int ret = 0, i;
DASHContext *c = s->priv_data;
int64_t seek_pos_msec = av_rescale_rnd(timestamp, 1000,
s->streams[stream_index]->time_base.den,
flags & AVSEEK_FLAG_BACKWARD ?
AV_ROUND_DOWN : AV_ROUND_UP);
if ((flags & AVSEEK_FLAG_BYTE) || c->is_live)
return AVERROR(ENOSYS);
/* Seek in discarded streams with dry_run=1 to avoid reopening them */
for (i = 0; i < c->n_videos; i++) {
if (!ret)
ret = dash_seek(s, c->videos[i], seek_pos_msec, flags, !c->videos[i]->ctx);
}
for (i = 0; i < c->n_audios; i++) {
if (!ret)
ret = dash_seek(s, c->audios[i], seek_pos_msec, flags, !c->audios[i]->ctx);
}
for (i = 0; i < c->n_subtitles; i++) {
if (!ret)
ret = dash_seek(s, c->subtitles[i], seek_pos_msec, flags, !c->subtitles[i]->ctx);
}
return ret;
}
static int dash_probe(const AVProbeData *p)
{
if (!av_stristr(p->buf, "<MPD"))
return 0;
if (av_stristr(p->buf, "dash:profile:isoff-on-demand:2011") ||
av_stristr(p->buf, "dash:profile:isoff-live:2011") ||
av_stristr(p->buf, "dash:profile:isoff-live:2012") ||
av_stristr(p->buf, "dash:profile:isoff-main:2011") ||
av_stristr(p->buf, "3GPP:PSS:profile:DASH1")) {
return AVPROBE_SCORE_MAX;
}
if (av_stristr(p->buf, "dash:profile")) {
return AVPROBE_SCORE_MAX;
}
return 0;
}
#define OFFSET(x) offsetof(DASHContext, x)
#define FLAGS AV_OPT_FLAG_DECODING_PARAM
static const AVOption dash_options[] = {
{"allowed_extensions", "List of file extensions that dash is allowed to access",
OFFSET(allowed_extensions), AV_OPT_TYPE_STRING,
{.str = "aac,m4a,m4s,m4v,mov,mp4,webm,ts"},
INT_MIN, INT_MAX, FLAGS},
{NULL}
};
static const AVClass dash_class = {
.class_name = "dash",
.item_name = av_default_item_name,
.option = dash_options,
.version = LIBAVUTIL_VERSION_INT,
};
AVInputFormat ff_dash_demuxer = {
.name = "dash",
.long_name = NULL_IF_CONFIG_SMALL("Dynamic Adaptive Streaming over HTTP"),
.priv_class = &dash_class,
.priv_data_size = sizeof(DASHContext),
.read_probe = dash_probe,
.read_header = dash_read_header,
.read_packet = dash_read_packet,
.read_close = dash_close,
.read_seek = dash_read_seek,
.flags = AVFMT_NO_BYTE_SEEK,
};
|
743661.c | #include <stdio.h>
#include <time.h>
void Timer(double time);
int main(void) {
Timer(10);
return 0;
}
void Timer(double time) {
double count = 0;
double pre = (double) clock();
double current;
while (count < time) {
current = (double) clock();
count += (current - pre) / CLOCKS_PER_SEC;
pre = current;
}
printf("Time is %.6f\n", time);
printf("Count is %.6f\n", count);
}
|
877685.c | /* $Source: bitbucket.org:berkeleylab/gasnet.git/tests/testlarge.c $
* Description: GASNet bulk (EVENT_DEFER) get/put performance test
* measures the ping-pong average round-trip time and
* average flood throughput of GASNet gets and puts
* over varying payload size and synchronization mechanisms
* Copyright 2002, Jaein Jeong and Dan Bonachea <[email protected]>
* Terms of use are as specified in license.txt
*/
/************************************************************
testlarge.c:
measures the bandwidth of get and put
for large messages with payload size (512 .. limit bytes)
also measures the barrier time.
*************************************************************/
#include <gasnetex.h>
#if GASNET_HAVE_MK_CLASS_CUDA_UVA
#include <gasnet_mk.h>
#endif
int numprocs;
size_t maxsz = 0;
#ifndef TEST_SEGSZ
#define TEST_SEGSZ_EXPR ((numprocs==1?2:1)*(uintptr_t)alignup(maxsz,PAGESZ))
#endif
#include "test.h"
#define GASNET_HEADNODE 0
#define PRINT_LATENCY 0
#define PRINT_THROUGHPUT 1
static gex_Client_t myclient;
static gex_EP_t myep;
static gex_TM_t myteam;
static gex_Segment_t mysegment;
typedef struct {
size_t datasize;
int iters;
uint64_t time;
double max_throughput;
} stat_struct_t;
gex_AM_Entry_t handler_table[2];
int insegment = 1;
int myproc;
int peerproc = -1;
int iamsender = 0;
int unitsMB = 0;
int doputs = 1;
int dogets = 1;
size_t min_payload;
size_t max_payload;
size_t max_step = 0;
char *tgtmem;
void *msgbuf;
#define init_stat \
GASNETT_TRACE_SETSOURCELINE(__FILE__,__LINE__), _init_stat
#define update_stat \
GASNETT_TRACE_SETSOURCELINE(__FILE__,__LINE__), _update_stat
#define print_stat \
GASNETT_TRACE_SETSOURCELINE(__FILE__,__LINE__), _print_stat
void _init_stat(stat_struct_t *st, size_t sz)
{
st->iters = 0;
st->datasize = sz;
st->time = 0;
}
void _update_stat(stat_struct_t *st, uint64_t temptime, int iters)
{
st->iters += iters;
st->time += temptime;
}
void _print_stat(int myproc, stat_struct_t *st, const char *name, int operation)
{
switch (operation) {
case PRINT_LATENCY:
printf("%c: %3i - %10li byte : %7i iters,"
" latency %12i us total, %9.3f us ave. (%s)\n",
TEST_SECTION_NAME(),
myproc, (long) st->datasize, st->iters, (int) st->time,
((double)st->time) / st->iters,
name);
fflush(stdout);
break;
case PRINT_THROUGHPUT:
printf((unitsMB ? "%c: %3i - %10li byte : %7i iters, throughput %11.6f MB/sec (%s)\n":
"%c: %3i - %10li byte : %7i iters, throughput %11.3f KB/sec (%s)\n"),
TEST_SECTION_NAME(),
myproc, (long) st->datasize, st->iters,
((int)st->time == 0 ? 0.0 :
(1000000.0 * st->datasize * st->iters /
(unitsMB?(1024.0*1024.0):1024.0)) / ((int)st->time)),
name);
fflush(stdout);
break;
default:
break;
}
}
// Double payload at each iter, subject to max_step
// but include max_payload which may not otherwise be visited
#define ADVANCE(sz) do { \
size_t step = MIN(max_step, sz); \
if (!sz) { \
sz = 1; \
} else if (sz < max_payload && sz+step > max_payload) { \
sz = max_payload; \
} else { \
sz += step; \
} \
} while (0)
void bulk_test(int iters) {GASNET_BEGIN_FUNCTION();
int i;
int64_t begin, end;
stat_struct_t stget, stput;
size_t payload;
for (payload = min_payload; payload <= max_payload && payload > 0; ) {
init_stat(&stput, payload);
BARRIER();
if (iamsender && doputs) {
/* measure the throughput of sending a message */
begin = TIME();
for (i = 0; i < iters; i++) {
gex_RMA_PutBlocking(myteam, peerproc, tgtmem, msgbuf, payload, 0);
}
end = TIME();
update_stat(&stput, (end - begin), iters);
}
BARRIER();
if (iamsender && doputs) {
print_stat(myproc, &stput, "PutBlocking throughput", PRINT_THROUGHPUT);
}
init_stat(&stget, payload);
if (iamsender && dogets) {
/* measure the throughput of receiving a message */
begin = TIME();
for (i = 0; i < iters; i++) {
gex_RMA_GetBlocking(myteam, msgbuf, peerproc, tgtmem, payload, 0);
}
end = TIME();
update_stat(&stget, (end - begin), iters);
}
BARRIER();
if (iamsender && dogets) {
print_stat(myproc, &stget, "GetBlocking throughput", PRINT_THROUGHPUT);
}
ADVANCE(payload);
}
}
void bulk_test_nbi(int iters) {GASNET_BEGIN_FUNCTION();
int i;
int64_t begin, end;
stat_struct_t stget, stput;
size_t payload;
for (payload = min_payload; payload <= max_payload && payload > 0; ) {
init_stat(&stput, payload);
BARRIER();
if (iamsender && doputs) {
/* measure the throughput of sending a message */
begin = TIME();
for (i = 0; i < iters; i++) {
gex_RMA_PutNBI(myteam, peerproc, tgtmem, msgbuf, payload, GEX_EVENT_DEFER, 0);
}
gex_NBI_Wait(GEX_EC_PUT,0);
end = TIME();
update_stat(&stput, (end - begin), iters);
}
BARRIER();
if (iamsender && doputs) {
print_stat(myproc, &stput, "PutNBI+DEFER throughput", PRINT_THROUGHPUT);
}
init_stat(&stget, payload);
if (iamsender && dogets) {
/* measure the throughput of receiving a message */
begin = TIME();
for (i = 0; i < iters; i++) {
gex_RMA_GetNBI(myteam, msgbuf, peerproc, tgtmem, payload, 0);
}
gex_NBI_Wait(GEX_EC_GET,0);
end = TIME();
update_stat(&stget, (end - begin), iters);
}
BARRIER();
if (iamsender && dogets) {
print_stat(myproc, &stget, "GetNBI throughput", PRINT_THROUGHPUT);
}
ADVANCE(payload);
}
}
void bulk_test_nb(int iters) {GASNET_BEGIN_FUNCTION();
int i;
int64_t begin, end;
stat_struct_t stget, stput;
gex_Event_t *events;
size_t payload;
events = (gex_Event_t *) test_malloc(sizeof(gex_Event_t) * iters);
for (payload = min_payload; payload <= max_payload && payload > 0; ) {
init_stat(&stput, payload);
BARRIER();
if (iamsender && doputs) {
/* measure the throughput of sending a message */
begin = TIME();
for (i = 0; i < iters; i++) {
events[i] = gex_RMA_PutNB(myteam, peerproc, tgtmem, msgbuf, payload, GEX_EVENT_DEFER, 0);
}
gex_Event_WaitAll(events, iters, 0);
end = TIME();
update_stat(&stput, (end - begin), iters);
}
BARRIER();
if (iamsender && doputs) {
print_stat(myproc, &stput, "PutNB+DEFER throughput", PRINT_THROUGHPUT);
}
init_stat(&stget, payload);
if (iamsender && dogets) {
/* measure the throughput of receiving a message */
begin = TIME();
for (i = 0; i < iters; i++) {
events[i] = gex_RMA_GetNB(myteam, msgbuf, peerproc, tgtmem, payload, 0);
}
gex_Event_WaitAll(events, iters, 0);
end = TIME();
update_stat(&stget, (end - begin), iters);
}
BARRIER();
if (iamsender && dogets) {
print_stat(myproc, &stget, "GetNB throughput", PRINT_THROUGHPUT);
}
ADVANCE(payload);
}
test_free(events);
}
int main(int argc, char **argv)
{
int iters = 0;
int arg;
void *myseg;
void *alloc = NULL;
int firstlastmode = 0;
int fullduplexmode = 0;
int crossmachinemode = 0;
int skipwarmup = 0;
int use_cuda_uva = 0;
int help = 0;
/* call startup */
GASNET_Safe(gex_Client_Init(&myclient, &myep, &myteam, "testlarge", &argc, &argv, 0));
/* parse arguments */
arg = 1;
while (argc > arg) {
if (!strcmp(argv[arg], "-in")) {
insegment = 1;
++arg;
} else if (!strcmp(argv[arg], "-out")) {
insegment = 0;
++arg;
} else if (!strcmp(argv[arg], "-f")) {
firstlastmode = 1;
++arg;
} else if (!strcmp(argv[arg], "-c")) {
crossmachinemode = 1;
++arg;
} else if (!strcmp(argv[arg], "-a")) {
fullduplexmode = 1;
++arg;
} else if (!strcmp(argv[arg], "-m")) {
unitsMB = 1;
++arg;
} else if (!strcmp(argv[arg], "-p")) {
dogets = 0; doputs = 1;
++arg;
} else if (!strcmp(argv[arg], "-g")) {
dogets = 1; doputs = 0;
++arg;
} else if (!strcmp(argv[arg], "-s")) {
skipwarmup = 1;
++arg;
} else if (!strcmp(argv[arg], "-max-step")) {
++arg;
if (argc > arg) { max_step = atoi(argv[arg]); arg++; }
else help = 1;
#if GASNET_HAVE_MK_CLASS_CUDA_UVA
// UNDOCUMENTED
} else if (!strcmp(argv[arg], "-cuda-uva")) {
use_cuda_uva = 1;
++arg;
#endif
} else if (argv[arg][0] == '-') {
help = 1;
++arg;
} else break;
}
if (argc > arg) { iters = atoi(argv[arg]); arg++; }
if (!iters) iters = 1000;
if (argc > arg) { maxsz = gasnett_parse_int(argv[arg], 1); arg++; }
if (!maxsz) maxsz = 2*1024*1024; /* 2 MB default */
if (argc > arg) { TEST_SECTION_PARSE(argv[arg]); arg++; }
if (!max_step) max_step = maxsz;
/* get SPMD info (needed for segment size) */
myproc = gex_TM_QueryRank(myteam);
numprocs = gex_TM_QuerySize(myteam);
#ifdef GASNET_SEGMENT_EVERYTHING
if (maxsz > TEST_SEGSZ) { ERR("maxsz must be <= %"PRIuPTR" on GASNET_SEGMENT_EVERYTHING",(uintptr_t)TEST_SEGSZ); gasnet_exit(1); }
#endif
GASNET_Safe(gex_Segment_Attach(&mysegment, myteam, TEST_SEGSZ_REQUEST));
test_init("testlarge",1, "[options] (iters) (maxsz) (test_sections)\n"
" The '-in' or '-out' option selects whether the initiator-side\n"
" memory is in the GASNet segment or not (default is 'in').\n"
" The -p/-g option selects puts only or gets only (default is both).\n"
" The -s option skips warm-up iterations\n"
" The -m option enables MB/sec units for bandwidth output (MB=2^20 bytes).\n"
" The -a option enables full-duplex mode, where all nodes send.\n"
" The -c option enables cross-machine pairing, default is nearest neighbor.\n"
" The -f option enables 'first/last' mode, where the first/last\n"
" nodes communicate with each other, while all other nodes sit idle.\n"
" The '-max-step N' option selects the maximum step between transfer sizes,\n"
" which by default advance by doubling until maxsz is reached.");
if (help || argc > arg) test_usage();
min_payload = 16;
max_payload = maxsz;
if (max_payload < min_payload) {
ERR("maxsz (%"PRIuPTR") must be >= %"PRIuPTR"\n",(uintptr_t)max_payload,(uintptr_t)min_payload);
test_usage();
}
if (!firstlastmode) {
/* Only allow 1 or even number for numprocs */
if (numprocs > 1 && numprocs % 2 != 0) {
MSG0("WARNING: This test requires a unary or even number of nodes. Test skipped.\n");
gasnet_exit(0); /* exit 0 to prevent false negatives in test harnesses for smp-conduit */
}
}
/* Setting peer thread rank */
if (firstlastmode) {
peerproc = (myproc == 0 ? numprocs-1 : 0);
iamsender = (fullduplexmode ? myproc == 0 || myproc == numprocs-1 : myproc == 0);
} else if (numprocs == 1) {
peerproc = 0;
iamsender = 1;
} else if (crossmachinemode) {
if (myproc < numprocs / 2) {
peerproc = myproc + numprocs/2;
iamsender = 1;
} else {
peerproc = myproc - numprocs/2;
iamsender = fullduplexmode;
}
} else {
peerproc = (myproc % 2) ? (myproc - 1) : (myproc + 1);
iamsender = (fullduplexmode || myproc % 2 == 0);
}
myseg = TEST_SEG(myproc);
tgtmem = (numprocs > 1) ? TEST_SEG(peerproc)
: (void*)(alignup(maxsz,PAGESZ) + (uintptr_t)myseg);
#if GASNET_HAVE_MK_CLASS_CUDA_UVA
gex_EP_t gpu_ep;
gex_MK_t kind;
if (use_cuda_uva) {
MSG0("***NOTICE***: Using EXPERIMENTAL support for CUDA UVA remote memory");
test_static_assert(GASNET_MAXEPS >= 2);
gex_MK_Create_args_t args;
args.gex_flags = 0;
args.gex_class = GEX_MK_CLASS_CUDA_UVA;
args.gex_args.gex_class_cuda_uva.gex_CUdevice = 0;
gex_Segment_t d_segment = GEX_SEGMENT_INVALID;
GASNET_Safe( gex_MK_Create(&kind, myclient, &args, 0) );
GASNET_Safe( gex_Segment_Create(&d_segment, myclient, NULL, TEST_SEGSZ_REQUEST, kind, 0) );
GASNET_Safe( gex_EP_Create(&gpu_ep, myclient, GEX_EP_CAPABILITY_RMA, 0) );
gex_EP_BindSegment(gpu_ep, d_segment, 0);
gex_EP_PublishBoundSegment(myteam, &gpu_ep, 1, 0);
// The "trick" to diverting RMA operation to the remote GPU memory
myteam = gex_TM_Pair(myep, gex_EP_QueryIndex(gpu_ep));
gex_Event_Wait( gex_EP_QueryBoundSegmentNB(myteam, peerproc, (void**)&tgtmem, NULL, NULL, 0) );
}
#endif
if (insegment) {
msgbuf = (void *) myseg;
} else {
alloc = (void *) test_calloc(maxsz+PAGESZ,1); /* calloc prevents valgrind warnings */
msgbuf = (void *) alignup(((uintptr_t)alloc), PAGESZ); /* ensure page alignment of base */
}
assert(((uintptr_t)msgbuf) % PAGESZ == 0);
if (myproc == 0)
MSG("Running %i iterations of %s%s%sbulk put/get with local addresses %sside the segment for sizes: %"PRIuPTR"...%"PRIuPTR"\n",
iters,
(firstlastmode ? "first/last " : ""),
(fullduplexmode ? "full-duplex ": ""),
(crossmachinemode ? "cross-machine ": ""),
insegment ? "in" : "out",
(uintptr_t)min_payload, (uintptr_t)max_payload);
BARRIER();
if (iamsender && !skipwarmup) { /* pay some warm-up costs */
int i;
int warm_iters = MIN(iters, 32767); /* avoid hitting 65535-handle limit */
gex_Event_t *h = test_malloc(2*sizeof(gex_Event_t)*warm_iters);
for (i = 0; i < warm_iters; i++) {
gex_RMA_PutBlocking(myteam, peerproc, tgtmem, msgbuf, 8, 0);
gex_RMA_GetBlocking(myteam, msgbuf, peerproc, tgtmem, 8, 0);
gex_RMA_PutNBI(myteam, peerproc, tgtmem, msgbuf, 8, GEX_EVENT_DEFER, 0);
gex_RMA_GetNBI(myteam, msgbuf, peerproc, tgtmem, 8, 0);
h[i] = gex_RMA_PutNB(myteam, peerproc, tgtmem, msgbuf, 8, GEX_EVENT_DEFER, 0);
h[i+warm_iters] = gex_RMA_GetNB(myteam, msgbuf, peerproc, tgtmem, 8, 0);
}
gex_RMA_PutBlocking(myteam, peerproc, tgtmem, msgbuf, max_payload, 0);
gex_RMA_GetBlocking(myteam, msgbuf, peerproc, tgtmem, max_payload, 0);
gex_Event_WaitAll(h, warm_iters*2, 0);
gex_NBI_Wait(GEX_EC_ALL,0);
test_free(h);
}
BARRIER();
if (TEST_SECTION_BEGIN_ENABLED()) bulk_test(iters);
if (TEST_SECTION_BEGIN_ENABLED()) bulk_test_nbi(iters);
if (TEST_SECTION_BEGIN_ENABLED()) bulk_test_nb(iters);
BARRIER();
if (alloc) test_free(alloc);
gasnet_exit(0);
return 0;
}
/* ------------------------------------------------------------------------------------ */
|
74443.c | /*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "/home/user/openairinterface5g/openair2/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-14.7.0.asn1"
* `asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D /home/user/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/RRC_Rel14`
*/
#include "RF-Parameters.h"
asn_TYPE_member_t asn_MBR_RF_Parameters_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RF_Parameters, supportedBandListEUTRA),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_SupportedBandListEUTRA,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"supportedBandListEUTRA"
},
};
static const ber_tlv_tag_t asn_DEF_RF_Parameters_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_RF_Parameters_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* supportedBandListEUTRA */
};
asn_SEQUENCE_specifics_t asn_SPC_RF_Parameters_specs_1 = {
sizeof(struct RF_Parameters),
offsetof(struct RF_Parameters, _asn_ctx),
asn_MAP_RF_Parameters_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_RF_Parameters = {
"RF-Parameters",
"RF-Parameters",
&asn_OP_SEQUENCE,
asn_DEF_RF_Parameters_tags_1,
sizeof(asn_DEF_RF_Parameters_tags_1)
/sizeof(asn_DEF_RF_Parameters_tags_1[0]), /* 1 */
asn_DEF_RF_Parameters_tags_1, /* Same as above */
sizeof(asn_DEF_RF_Parameters_tags_1)
/sizeof(asn_DEF_RF_Parameters_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_RF_Parameters_1,
1, /* Elements count */
&asn_SPC_RF_Parameters_specs_1 /* Additional specs */
};
|
839809.c | /** @file
Definition for Device Path Tool.
Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "UefiDevicePathLib.h"
//
// Utility Name
//
#define UTILITY_NAME "DevicePath"
//
// Utility version information
//
#define UTILITY_MAJOR_VERSION 0
#define UTILITY_MINOR_VERSION 1
EFI_GUID gEfiDebugPortProtocolGuid = DEVICE_PATH_MESSAGING_DEBUGPORT;
EFI_GUID gEfiPcAnsiGuid = EFI_PC_ANSI_GUID;
EFI_GUID gEfiVT100Guid = EFI_VT_100_GUID;
EFI_GUID gEfiVT100PlusGuid = EFI_VT_100_PLUS_GUID;
EFI_GUID gEfiVTUTF8Guid = EFI_VT_UTF8_GUID;
EFI_GUID gEfiUartDevicePathGuid = EFI_UART_DEVICE_PATH_GUID;
EFI_GUID gEfiSasDevicePathGuid = EFI_SAS_DEVICE_PATH_GUID;
EFI_GUID gEfiVirtualDiskGuid = EFI_VIRTUAL_DISK_GUID;
EFI_GUID gEfiVirtualCdGuid = EFI_VIRTUAL_CD_GUID;
EFI_GUID gEfiPersistentVirtualDiskGuid = EFI_PERSISTENT_VIRTUAL_DISK_GUID;
EFI_GUID gEfiPersistentVirtualCdGuid = EFI_PERSISTENT_VIRTUAL_CD_GUID;
STATIC
VOID
Version (
VOID
)
/*++
Routine Description:
Displays the standard utility information to SDTOUT
Arguments:
None
Returns:
None
--*/
{
fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
}
STATIC
VOID
Usage (
VOID
)
/*++
Routine Description:
Displays the utility usage syntax to STDOUT
Arguments:
None
Returns:
None
--*/
{
//
// Summary usage
//
fprintf (stdout, "\nUsage: %s [options]\n\n", UTILITY_NAME);
//
// Copyright declaration
//
fprintf (stdout, "Copyright (c) 2017, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
//
fprintf (stdout, "Options:\n");
fprintf (stdout, " DevicePathString Device Path string is specified, no space character.\n"
" Example: \"PciRoot(0)/Pci(0,0)\"\n");
fprintf (stdout, " --version Show program's version number and exit.\n");
fprintf (stdout, " -h, --help Show this help message and exit.\n");
}
STATIC
VOID
PrintMem (
CONST VOID *Buffer,
UINTN Count
)
{
CONST UINT8 *Bytes;
UINTN Idx;
Bytes = Buffer;
for (Idx = 0; Idx < Count; Idx++) {
printf("0x%02x ", Bytes[Idx]);
}
}
VOID
Ascii2UnicodeString (
CHAR8 *String,
CHAR16 *UniString
)
/*++
Routine Description:
Write ascii string as unicode string format to FILE
Arguments:
String - Pointer to string that is written to FILE.
UniString - Pointer to unicode string
Returns:
NULL
--*/
{
while (*String != '\0') {
*(UniString++) = (CHAR16) *(String++);
}
//
// End the UniString with a NULL.
//
*UniString = '\0';
}
int main(int argc, CHAR8 *argv[])
{
CHAR8 * Str;
CHAR16* Str16;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
if (argc == 1) {
Error (NULL, 0, 1001, "Missing options", "No input options specified.");
Usage ();
return STATUS_ERROR;
}
if ((stricmp (argv[1], "-h") == 0) || (stricmp (argv[1], "--help") == 0)) {
Version ();
Usage ();
return STATUS_SUCCESS;
}
if (stricmp (argv[1], "--version") == 0) {
Version ();
return STATUS_SUCCESS;
}
Str = argv[1];
if (Str == NULL) {
fprintf(stderr, "Invalid option value, Device Path can't be NULL");
return STATUS_ERROR;
}
Str16 = (CHAR16 *)malloc(1024);
if (Str16 == NULL) {
fprintf(stderr, "Resource, memory cannot be allocated");
return STATUS_ERROR;
}
Ascii2UnicodeString(Str, Str16);
DevicePath = UefiDevicePathLibConvertTextToDevicePath(Str16);
if (DevicePath == NULL) {
fprintf(stderr, "Convert fail, Cannot convert text to a device path");
free(Str16);
return STATUS_ERROR;
}
while (!((DevicePath->Type == END_DEVICE_PATH_TYPE) && (DevicePath->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)) )
{
PrintMem (DevicePath, DevicePath->Length[0] | DevicePath->Length[1] << 8);
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)((UINT8 *)DevicePath + (DevicePath->Length[0] | DevicePath->Length[1] << 8));
}
PrintMem (DevicePath, DevicePath->Length[0] | DevicePath->Length[1] << 8);
putchar('\n');
free(Str16);
return STATUS_SUCCESS;
}
|
503433.c | /* $OpenBSD$ */
/*
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <regex.h>
#include <signal.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "tmux.h"
/*
* Each window is attached to a number of panes, each of which is a pty. This
* file contains code to handle them.
*
* A pane has two buffers attached, these are filled and emptied by the main
* server poll loop. Output data is received from pty's in screen format,
* translated and returned as a series of escape sequences and strings via
* input_parse (in input.c). Input data is received as key codes and written
* directly via input_key.
*
* Each pane also has a "virtual" screen (screen.c) which contains the current
* state and is redisplayed when the window is reattached to a client.
*
* Windows are stored directly on a global array and wrapped in any number of
* winlink structs to be linked onto local session RB trees. A reference count
* is maintained and a window removed from the global list and destroyed when
* it reaches zero.
*/
/* Global window list. */
struct windows windows;
/* Global panes tree. */
struct window_pane_tree all_window_panes;
static u_int next_window_pane_id;
static u_int next_window_id;
static u_int next_active_point;
struct window_pane_input_data {
struct cmdq_item *item;
u_int wp;
};
static struct window_pane *window_pane_create(struct window *, u_int, u_int,
u_int);
static void window_pane_destroy(struct window_pane *);
RB_GENERATE(windows, window, entry, window_cmp);
RB_GENERATE(winlinks, winlink, entry, winlink_cmp);
RB_GENERATE(window_pane_tree, window_pane, tree_entry, window_pane_cmp);
int
window_cmp(struct window *w1, struct window *w2)
{
return (w1->id - w2->id);
}
int
winlink_cmp(struct winlink *wl1, struct winlink *wl2)
{
return (wl1->idx - wl2->idx);
}
int
window_pane_cmp(struct window_pane *wp1, struct window_pane *wp2)
{
return (wp1->id - wp2->id);
}
struct winlink *
winlink_find_by_window(struct winlinks *wwl, struct window *w)
{
struct winlink *wl;
RB_FOREACH(wl, winlinks, wwl) {
if (wl->window == w)
return (wl);
}
return (NULL);
}
struct winlink *
winlink_find_by_index(struct winlinks *wwl, int idx)
{
struct winlink wl;
if (idx < 0)
fatalx("bad index");
wl.idx = idx;
return (RB_FIND(winlinks, wwl, &wl));
}
struct winlink *
winlink_find_by_window_id(struct winlinks *wwl, u_int id)
{
struct winlink *wl;
RB_FOREACH(wl, winlinks, wwl) {
if (wl->window->id == id)
return (wl);
}
return (NULL);
}
static int
winlink_next_index(struct winlinks *wwl, int idx)
{
int i;
i = idx;
do {
if (winlink_find_by_index(wwl, i) == NULL)
return (i);
if (i == INT_MAX)
i = 0;
else
i++;
} while (i != idx);
return (-1);
}
u_int
winlink_count(struct winlinks *wwl)
{
struct winlink *wl;
u_int n;
n = 0;
RB_FOREACH(wl, winlinks, wwl)
n++;
return (n);
}
struct winlink *
winlink_add(struct winlinks *wwl, int idx)
{
struct winlink *wl;
if (idx < 0) {
if ((idx = winlink_next_index(wwl, -idx - 1)) == -1)
return (NULL);
} else if (winlink_find_by_index(wwl, idx) != NULL)
return (NULL);
wl = xcalloc(1, sizeof *wl);
wl->idx = idx;
RB_INSERT(winlinks, wwl, wl);
return (wl);
}
void
winlink_set_window(struct winlink *wl, struct window *w)
{
if (wl->window != NULL) {
TAILQ_REMOVE(&wl->window->winlinks, wl, wentry);
window_remove_ref(wl->window, __func__);
}
TAILQ_INSERT_TAIL(&w->winlinks, wl, wentry);
wl->window = w;
window_add_ref(w, __func__);
}
void
winlink_remove(struct winlinks *wwl, struct winlink *wl)
{
struct window *w = wl->window;
if (w != NULL) {
TAILQ_REMOVE(&w->winlinks, wl, wentry);
window_remove_ref(w, __func__);
}
RB_REMOVE(winlinks, wwl, wl);
free(wl);
}
struct winlink *
winlink_next(struct winlink *wl)
{
return (RB_NEXT(winlinks, wwl, wl));
}
struct winlink *
winlink_previous(struct winlink *wl)
{
return (RB_PREV(winlinks, wwl, wl));
}
struct winlink *
winlink_next_by_number(struct winlink *wl, struct session *s, int n)
{
for (; n > 0; n--) {
if ((wl = RB_NEXT(winlinks, wwl, wl)) == NULL)
wl = RB_MIN(winlinks, &s->windows);
}
return (wl);
}
struct winlink *
winlink_previous_by_number(struct winlink *wl, struct session *s, int n)
{
for (; n > 0; n--) {
if ((wl = RB_PREV(winlinks, wwl, wl)) == NULL)
wl = RB_MAX(winlinks, &s->windows);
}
return (wl);
}
void
winlink_stack_push(struct winlink_stack *stack, struct winlink *wl)
{
if (wl == NULL)
return;
winlink_stack_remove(stack, wl);
TAILQ_INSERT_HEAD(stack, wl, sentry);
}
void
winlink_stack_remove(struct winlink_stack *stack, struct winlink *wl)
{
struct winlink *wl2;
if (wl == NULL)
return;
TAILQ_FOREACH(wl2, stack, sentry) {
if (wl2 == wl) {
TAILQ_REMOVE(stack, wl, sentry);
return;
}
}
}
struct window *
window_find_by_id_str(const char *s)
{
const char *errstr;
u_int id;
if (*s != '@')
return (NULL);
id = strtonum(s + 1, 0, UINT_MAX, &errstr);
if (errstr != NULL)
return (NULL);
return (window_find_by_id(id));
}
struct window *
window_find_by_id(u_int id)
{
struct window w;
w.id = id;
return (RB_FIND(windows, &windows, &w));
}
void
window_update_activity(struct window *w)
{
gettimeofday(&w->activity_time, NULL);
alerts_queue(w, WINDOW_ACTIVITY);
}
struct window *
window_create(u_int sx, u_int sy, u_int xpixel, u_int ypixel)
{
struct window *w;
if (xpixel == 0)
xpixel = DEFAULT_XPIXEL;
if (ypixel == 0)
ypixel = DEFAULT_YPIXEL;
w = xcalloc(1, sizeof *w);
w->name = xstrdup("");
w->flags = 0;
TAILQ_INIT(&w->panes);
w->active = NULL;
w->lastlayout = -1;
w->layout_root = NULL;
w->sx = sx;
w->sy = sy;
w->xpixel = xpixel;
w->ypixel = ypixel;
w->options = options_create(global_w_options);
w->references = 0;
TAILQ_INIT(&w->winlinks);
w->id = next_window_id++;
RB_INSERT(windows, &windows, w);
window_update_activity(w);
log_debug("%s: @%u create %ux%u (%ux%u)", __func__, w->id, sx, sy,
w->xpixel, w->ypixel);
return (w);
}
static void
window_destroy(struct window *w)
{
log_debug("window @%u destroyed (%d references)", w->id, w->references);
RB_REMOVE(windows, &windows, w);
if (w->layout_root != NULL)
layout_free_cell(w->layout_root);
if (w->saved_layout_root != NULL)
layout_free_cell(w->saved_layout_root);
free(w->old_layout);
window_destroy_panes(w);
if (event_initialized(&w->name_event))
evtimer_del(&w->name_event);
if (event_initialized(&w->alerts_timer))
evtimer_del(&w->alerts_timer);
if (event_initialized(&w->offset_timer))
event_del(&w->offset_timer);
options_free(w->options);
free(w->name);
free(w);
}
int
window_pane_destroy_ready(struct window_pane *wp)
{
int n;
if (wp->pipe_fd != -1) {
if (EVBUFFER_LENGTH(wp->pipe_event->output) != 0)
return (0);
if (ioctl(wp->fd, FIONREAD, &n) != -1 && n > 0)
return (0);
}
if (~wp->flags & PANE_EXITED)
return (0);
return (1);
}
void
window_add_ref(struct window *w, const char *from)
{
w->references++;
log_debug("%s: @%u %s, now %d", __func__, w->id, from, w->references);
}
void
window_remove_ref(struct window *w, const char *from)
{
w->references--;
log_debug("%s: @%u %s, now %d", __func__, w->id, from, w->references);
if (w->references == 0)
window_destroy(w);
}
void
window_set_name(struct window *w, const char *new_name)
{
free(w->name);
utf8_stravis(&w->name, new_name, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
notify_window("window-renamed", w);
}
void
window_resize(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
{
if (xpixel == 0)
xpixel = DEFAULT_XPIXEL;
if (ypixel == 0)
ypixel = DEFAULT_YPIXEL;
log_debug("%s: @%u resize %ux%u (%ux%u)", __func__, w->id, sx, sy,
xpixel == -1 ? w->xpixel : (u_int)xpixel,
ypixel == -1 ? w->ypixel : (u_int)ypixel);
w->sx = sx;
w->sy = sy;
if (xpixel != -1)
w->xpixel = xpixel;
if (ypixel != -1)
w->ypixel = ypixel;
}
void
window_pane_send_resize(struct window_pane *wp, int yadjust)
{
struct window *w = wp->window;
struct winsize ws;
u_int sy = wp->sy + yadjust;
if (wp->fd == -1)
return;
log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, wp->sx, sy);
memset(&ws, 0, sizeof ws);
ws.ws_col = wp->sx;
ws.ws_row = sy;
ws.ws_xpixel = w->xpixel * ws.ws_col;
ws.ws_ypixel = w->ypixel * ws.ws_row;
if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
#ifdef __sun
/*
* Some versions of Solaris apparently can return an error when
* resizing; don't know why this happens, can't reproduce on
* other platforms and ignoring it doesn't seem to cause any
* issues.
*/
if (errno != EINVAL && errno != ENXIO)
#endif
fatal("ioctl failed");
}
int
window_has_pane(struct window *w, struct window_pane *wp)
{
struct window_pane *wp1;
TAILQ_FOREACH(wp1, &w->panes, entry) {
if (wp1 == wp)
return (1);
}
return (0);
}
int
window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
{
log_debug("%s: pane %%%u", __func__, wp->id);
if (wp == w->active)
return (0);
w->last = w->active;
w->active = wp;
w->active->active_point = next_active_point++;
w->active->flags |= PANE_CHANGED;
tty_update_window_offset(w);
if (notify)
notify_window("window-pane-changed", w);
return (1);
}
void
window_redraw_active_switch(struct window *w, struct window_pane *wp)
{
struct grid_cell *gc1, *gc2;
int c1, c2;
if (wp == w->active)
return;
for (;;) {
/*
* If the active and inactive styles or palettes are different,
* need to redraw the panes.
*/
gc1 = &wp->cached_gc;
gc2 = &wp->cached_active_gc;
if (!grid_cells_look_equal(gc1, gc2))
wp->flags |= PANE_REDRAW;
else {
c1 = window_pane_get_palette(wp, gc1->fg);
c2 = window_pane_get_palette(wp, gc2->fg);
if (c1 != c2)
wp->flags |= PANE_REDRAW;
else {
c1 = window_pane_get_palette(wp, gc1->bg);
c2 = window_pane_get_palette(wp, gc2->bg);
if (c1 != c2)
wp->flags |= PANE_REDRAW;
}
}
if (wp == w->active)
break;
wp = w->active;
}
}
struct window_pane *
window_get_active_at(struct window *w, u_int x, u_int y)
{
struct window_pane *wp;
TAILQ_FOREACH(wp, &w->panes, entry) {
if (!window_pane_visible(wp))
continue;
if (x < wp->xoff || x > wp->xoff + wp->sx)
continue;
if (y < wp->yoff || y > wp->yoff + wp->sy)
continue;
return (wp);
}
return (NULL);
}
struct window_pane *
window_find_string(struct window *w, const char *s)
{
u_int x, y, top = 0, bottom = w->sy - 1;
int status;
x = w->sx / 2;
y = w->sy / 2;
status = options_get_number(w->options, "pane-border-status");
if (status == PANE_STATUS_TOP)
top++;
else if (status == PANE_STATUS_BOTTOM)
bottom--;
if (strcasecmp(s, "top") == 0)
y = top;
else if (strcasecmp(s, "bottom") == 0)
y = bottom;
else if (strcasecmp(s, "left") == 0)
x = 0;
else if (strcasecmp(s, "right") == 0)
x = w->sx - 1;
else if (strcasecmp(s, "top-left") == 0) {
x = 0;
y = top;
} else if (strcasecmp(s, "top-right") == 0) {
x = w->sx - 1;
y = top;
} else if (strcasecmp(s, "bottom-left") == 0) {
x = 0;
y = bottom;
} else if (strcasecmp(s, "bottom-right") == 0) {
x = w->sx - 1;
y = bottom;
} else
return (NULL);
return (window_get_active_at(w, x, y));
}
int
window_zoom(struct window_pane *wp)
{
struct window *w = wp->window;
struct window_pane *wp1;
if (w->flags & WINDOW_ZOOMED)
return (-1);
if (window_count_panes(w) == 1)
return (-1);
if (w->active != wp)
window_set_active_pane(w, wp, 1);
TAILQ_FOREACH(wp1, &w->panes, entry) {
wp1->saved_layout_cell = wp1->layout_cell;
wp1->layout_cell = NULL;
}
w->saved_layout_root = w->layout_root;
layout_init(w, wp);
w->flags |= WINDOW_ZOOMED;
notify_window("window-layout-changed", w);
return (0);
}
int
window_unzoom(struct window *w)
{
struct window_pane *wp;
if (!(w->flags & WINDOW_ZOOMED))
return (-1);
w->flags &= ~WINDOW_ZOOMED;
layout_free(w);
w->layout_root = w->saved_layout_root;
w->saved_layout_root = NULL;
TAILQ_FOREACH(wp, &w->panes, entry) {
wp->layout_cell = wp->saved_layout_cell;
wp->saved_layout_cell = NULL;
}
layout_fix_panes(w, NULL);
notify_window("window-layout-changed", w);
return (0);
}
int
window_push_zoom(struct window *w, int always, int flag)
{
log_debug("%s: @%u %d", __func__, w->id,
flag && (w->flags & WINDOW_ZOOMED));
if (flag && (always || (w->flags & WINDOW_ZOOMED)))
w->flags |= WINDOW_WASZOOMED;
else
w->flags &= ~WINDOW_WASZOOMED;
return (window_unzoom(w) == 0);
}
int
window_pop_zoom(struct window *w)
{
log_debug("%s: @%u %d", __func__, w->id,
!!(w->flags & WINDOW_WASZOOMED));
if (w->flags & WINDOW_WASZOOMED)
return (window_zoom(w->active) == 0);
return (0);
}
struct window_pane *
window_add_pane(struct window *w, struct window_pane *other, u_int hlimit,
int flags)
{
struct window_pane *wp;
if (other == NULL)
other = w->active;
wp = window_pane_create(w, w->sx, w->sy, hlimit);
if (TAILQ_EMPTY(&w->panes)) {
log_debug("%s: @%u at start", __func__, w->id);
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
} else if (flags & SPAWN_BEFORE) {
log_debug("%s: @%u before %%%u", __func__, w->id, wp->id);
if (flags & SPAWN_FULLSIZE)
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
else
TAILQ_INSERT_BEFORE(other, wp, entry);
} else {
log_debug("%s: @%u after %%%u", __func__, w->id, wp->id);
if (flags & SPAWN_FULLSIZE)
TAILQ_INSERT_TAIL(&w->panes, wp, entry);
else
TAILQ_INSERT_AFTER(&w->panes, other, wp, entry);
}
return (wp);
}
void
window_lost_pane(struct window *w, struct window_pane *wp)
{
log_debug("%s: @%u pane %%%u", __func__, w->id, wp->id);
if (wp == marked_pane.wp)
server_clear_marked();
if (wp == w->active) {
w->active = w->last;
w->last = NULL;
if (w->active == NULL) {
w->active = TAILQ_PREV(wp, window_panes, entry);
if (w->active == NULL)
w->active = TAILQ_NEXT(wp, entry);
}
if (w->active != NULL) {
w->active->flags |= PANE_CHANGED;
notify_window("window-pane-changed", w);
}
} else if (wp == w->last)
w->last = NULL;
}
void
window_remove_pane(struct window *w, struct window_pane *wp)
{
window_lost_pane(w, wp);
TAILQ_REMOVE(&w->panes, wp, entry);
window_pane_destroy(wp);
}
struct window_pane *
window_pane_at_index(struct window *w, u_int idx)
{
struct window_pane *wp;
u_int n;
n = options_get_number(w->options, "pane-base-index");
TAILQ_FOREACH(wp, &w->panes, entry) {
if (n == idx)
return (wp);
n++;
}
return (NULL);
}
struct window_pane *
window_pane_next_by_number(struct window *w, struct window_pane *wp, u_int n)
{
for (; n > 0; n--) {
if ((wp = TAILQ_NEXT(wp, entry)) == NULL)
wp = TAILQ_FIRST(&w->panes);
}
return (wp);
}
struct window_pane *
window_pane_previous_by_number(struct window *w, struct window_pane *wp,
u_int n)
{
for (; n > 0; n--) {
if ((wp = TAILQ_PREV(wp, window_panes, entry)) == NULL)
wp = TAILQ_LAST(&w->panes, window_panes);
}
return (wp);
}
int
window_pane_index(struct window_pane *wp, u_int *i)
{
struct window_pane *wq;
struct window *w = wp->window;
*i = options_get_number(w->options, "pane-base-index");
TAILQ_FOREACH(wq, &w->panes, entry) {
if (wp == wq) {
return (0);
}
(*i)++;
}
return (-1);
}
u_int
window_count_panes(struct window *w)
{
struct window_pane *wp;
u_int n;
n = 0;
TAILQ_FOREACH(wp, &w->panes, entry)
n++;
return (n);
}
void
window_destroy_panes(struct window *w)
{
struct window_pane *wp;
while (!TAILQ_EMPTY(&w->panes)) {
wp = TAILQ_FIRST(&w->panes);
TAILQ_REMOVE(&w->panes, wp, entry);
window_pane_destroy(wp);
}
}
const char *
window_printable_flags(struct winlink *wl, int escape)
{
struct session *s = wl->session;
static char flags[32];
int pos;
pos = 0;
if (wl->flags & WINLINK_ACTIVITY) {
flags[pos++] = '#';
if (escape)
flags[pos++] = '#';
}
if (wl->flags & WINLINK_BELL)
flags[pos++] = '!';
if (wl->flags & WINLINK_SILENCE)
flags[pos++] = '~';
if (wl == s->curw)
flags[pos++] = '*';
if (wl == TAILQ_FIRST(&s->lastw))
flags[pos++] = '-';
if (server_check_marked() && wl == marked_pane.wl)
flags[pos++] = 'M';
if (wl->window->flags & WINDOW_ZOOMED)
flags[pos++] = 'Z';
flags[pos] = '\0';
return (flags);
}
struct window_pane *
window_pane_find_by_id_str(const char *s)
{
const char *errstr;
u_int id;
if (*s != '%')
return (NULL);
id = strtonum(s + 1, 0, UINT_MAX, &errstr);
if (errstr != NULL)
return (NULL);
return (window_pane_find_by_id(id));
}
struct window_pane *
window_pane_find_by_id(u_int id)
{
struct window_pane wp;
wp.id = id;
return (RB_FIND(window_pane_tree, &all_window_panes, &wp));
}
static struct window_pane *
window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
{
struct window_pane *wp;
char host[HOST_NAME_MAX + 1];
wp = xcalloc(1, sizeof *wp);
wp->window = w;
wp->options = options_create(w->options);
wp->flags = PANE_STYLECHANGED;
wp->id = next_window_pane_id++;
RB_INSERT(window_pane_tree, &all_window_panes, wp);
wp->argc = 0;
wp->argv = NULL;
wp->shell = NULL;
wp->cwd = NULL;
wp->fd = -1;
wp->event = NULL;
wp->fg = 8;
wp->bg = 8;
TAILQ_INIT(&wp->modes);
wp->layout_cell = NULL;
wp->xoff = 0;
wp->yoff = 0;
wp->sx = wp->osx = sx;
wp->sy = wp->osx = sy;
wp->pipe_fd = -1;
wp->pipe_event = NULL;
screen_init(&wp->base, sx, sy, hlimit);
wp->screen = &wp->base;
screen_init(&wp->status_screen, 1, 1, 0);
if (gethostname(host, sizeof host) == 0)
screen_set_title(&wp->base, host);
return (wp);
}
static void
window_pane_destroy(struct window_pane *wp)
{
window_pane_reset_mode_all(wp);
free(wp->searchstr);
if (wp->fd != -1) {
#ifdef HAVE_UTEMPTER
utempter_remove_record(wp->fd);
#endif
bufferevent_free(wp->event);
close(wp->fd);
}
if (wp->ictx != NULL)
input_free(wp->ictx);
screen_free(&wp->status_screen);
screen_free(&wp->base);
if (wp->pipe_fd != -1) {
bufferevent_free(wp->pipe_event);
close(wp->pipe_fd);
}
if (event_initialized(&wp->resize_timer))
event_del(&wp->resize_timer);
RB_REMOVE(window_pane_tree, &all_window_panes, wp);
options_free(wp->options);
free((void *)wp->cwd);
free(wp->shell);
cmd_free_argv(wp->argc, wp->argv);
free(wp->palette);
free(wp);
}
static void
window_pane_read_callback(__unused struct bufferevent *bufev, void *data)
{
struct window_pane *wp = data;
struct evbuffer *evb = wp->event->input;
struct window_pane_offset *wpo = &wp->pipe_offset;
size_t size = EVBUFFER_LENGTH(evb);
char *new_data;
size_t new_size;
struct client *c;
if (wp->pipe_fd != -1) {
new_data = window_pane_get_new_data(wp, wpo, &new_size);
if (new_size > 0) {
bufferevent_write(wp->pipe_event, new_data, new_size);
window_pane_update_used_data(wp, wpo, new_size);
}
}
log_debug("%%%u has %zu bytes", wp->id, size);
TAILQ_FOREACH(c, &clients, entry) {
if (c->session != NULL && (c->flags & CLIENT_CONTROL))
control_write_output(c, wp);
}
input_parse_pane(wp);
bufferevent_disable(wp->event, EV_READ);
}
static void
window_pane_error_callback(__unused struct bufferevent *bufev,
__unused short what, void *data)
{
struct window_pane *wp = data;
log_debug("%%%u error", wp->id);
wp->flags |= PANE_EXITED;
if (window_pane_destroy_ready(wp))
server_destroy_pane(wp, 1);
}
void
window_pane_set_event(struct window_pane *wp)
{
setblocking(wp->fd, 0);
wp->event = bufferevent_new(wp->fd, window_pane_read_callback,
NULL, window_pane_error_callback, wp);
wp->ictx = input_init(wp, wp->event);
bufferevent_enable(wp->event, EV_READ|EV_WRITE);
}
void
window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
{
struct window_mode_entry *wme;
if (sx == wp->sx && sy == wp->sy)
return;
wp->sx = sx;
wp->sy = sy;
log_debug("%s: %%%u resize %ux%u", __func__, wp->id, sx, sy);
screen_resize(&wp->base, sx, sy, wp->base.saved_grid == NULL);
wme = TAILQ_FIRST(&wp->modes);
if (wme != NULL && wme->mode->resize != NULL)
wme->mode->resize(wme, sx, sy);
wp->flags |= (PANE_RESIZE|PANE_RESIZED);
}
void
window_pane_set_palette(struct window_pane *wp, u_int n, int colour)
{
if (n > 0xff)
return;
if (wp->palette == NULL)
wp->palette = xcalloc(0x100, sizeof *wp->palette);
wp->palette[n] = colour;
wp->flags |= PANE_REDRAW;
}
void
window_pane_unset_palette(struct window_pane *wp, u_int n)
{
if (n > 0xff || wp->palette == NULL)
return;
wp->palette[n] = 0;
wp->flags |= PANE_REDRAW;
}
void
window_pane_reset_palette(struct window_pane *wp)
{
if (wp->palette == NULL)
return;
free(wp->palette);
wp->palette = NULL;
wp->flags |= PANE_REDRAW;
}
int
window_pane_get_palette(struct window_pane *wp, int c)
{
int new;
if (wp == NULL || wp->palette == NULL)
return (-1);
new = -1;
if (c < 8)
new = wp->palette[c];
else if (c >= 90 && c <= 97)
new = wp->palette[8 + c - 90];
else if (c & COLOUR_FLAG_256)
new = wp->palette[c & ~COLOUR_FLAG_256];
if (new == 0)
return (-1);
return (new);
}
int
window_pane_set_mode(struct window_pane *wp, struct window_pane *swp,
const struct window_mode *mode, struct cmd_find_state *fs,
struct args *args)
{
struct window_mode_entry *wme;
if (!TAILQ_EMPTY(&wp->modes) && TAILQ_FIRST(&wp->modes)->mode == mode)
return (1);
TAILQ_FOREACH(wme, &wp->modes, entry) {
if (wme->mode == mode)
break;
}
if (wme != NULL) {
TAILQ_REMOVE(&wp->modes, wme, entry);
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
} else {
wme = xcalloc(1, sizeof *wme);
wme->wp = wp;
wme->swp = swp;
wme->mode = mode;
wme->prefix = 1;
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
wme->screen = wme->mode->init(wme, fs, args);
}
wp->screen = wme->screen;
wp->flags |= (PANE_REDRAW|PANE_CHANGED);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
notify_pane("pane-mode-changed", wp);
return (0);
}
void
window_pane_reset_mode(struct window_pane *wp)
{
struct window_mode_entry *wme, *next;
if (TAILQ_EMPTY(&wp->modes))
return;
wme = TAILQ_FIRST(&wp->modes);
TAILQ_REMOVE(&wp->modes, wme, entry);
wme->mode->free(wme);
free(wme);
next = TAILQ_FIRST(&wp->modes);
if (next == NULL) {
log_debug("%s: no next mode", __func__);
wp->screen = &wp->base;
} else {
log_debug("%s: next mode is %s", __func__, next->mode->name);
wp->screen = next->screen;
if (next->mode->resize != NULL)
next->mode->resize(next, wp->sx, wp->sy);
}
wp->flags |= (PANE_REDRAW|PANE_CHANGED);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
notify_pane("pane-mode-changed", wp);
}
void
window_pane_reset_mode_all(struct window_pane *wp)
{
while (!TAILQ_EMPTY(&wp->modes))
window_pane_reset_mode(wp);
}
static void
window_pane_copy_key(struct window_pane *wp, key_code key)
{
struct window_pane *loop;
TAILQ_FOREACH(loop, &wp->window->panes, entry) {
if (loop != wp &&
TAILQ_EMPTY(&loop->modes) &&
loop->fd != -1 &&
(~loop->flags & PANE_INPUTOFF) &&
window_pane_visible(loop) &&
options_get_number(loop->options, "synchronize-panes"))
input_key_pane(loop, key, NULL);
}
}
int
window_pane_key(struct window_pane *wp, struct client *c, struct session *s,
struct winlink *wl, key_code key, struct mouse_event *m)
{
struct window_mode_entry *wme;
if (KEYC_IS_MOUSE(key) && m == NULL)
return (-1);
wme = TAILQ_FIRST(&wp->modes);
if (wme != NULL) {
if (wme->mode->key != NULL && c != NULL) {
key &= ~KEYC_MASK_FLAGS;
wme->mode->key(wme, c, s, wl, key, m);
}
return (0);
}
if (wp->fd == -1 || wp->flags & PANE_INPUTOFF)
return (0);
if (input_key_pane(wp, key, m) != 0)
return (-1);
if (KEYC_IS_MOUSE(key))
return (0);
if (options_get_number(wp->options, "synchronize-panes"))
window_pane_copy_key(wp, key);
return (0);
}
int
window_pane_visible(struct window_pane *wp)
{
if (~wp->window->flags & WINDOW_ZOOMED)
return (1);
return (wp == wp->window->active);
}
u_int
window_pane_search(struct window_pane *wp, const char *term, int regex,
int ignore)
{
struct screen *s = &wp->base;
regex_t r;
char *new = NULL, *line;
u_int i;
int flags = 0, found;
size_t n;
if (!regex) {
if (ignore)
flags |= FNM_CASEFOLD;
xasprintf(&new, "*%s*", term);
} else {
if (ignore)
flags |= REG_ICASE;
if (regcomp(&r, term, flags|REG_EXTENDED) != 0)
return (0);
}
for (i = 0; i < screen_size_y(s); i++) {
line = grid_view_string_cells(s->grid, 0, i, screen_size_x(s));
for (n = strlen(line); n > 0; n--) {
if (!isspace((u_char)line[n - 1]))
break;
line[n - 1] = '\0';
}
log_debug("%s: %s", __func__, line);
if (!regex)
found = (fnmatch(new, line, flags) == 0);
else
found = (regexec(&r, line, 0, NULL, 0) == 0);
free(line);
if (found)
break;
}
if (!regex)
free(new);
else
regfree(&r);
if (i == screen_size_y(s))
return (0);
return (i + 1);
}
/* Get MRU pane from a list. */
static struct window_pane *
window_pane_choose_best(struct window_pane **list, u_int size)
{
struct window_pane *next, *best;
u_int i;
if (size == 0)
return (NULL);
best = list[0];
for (i = 1; i < size; i++) {
next = list[i];
if (next->active_point > best->active_point)
best = next;
}
return (best);
}
/*
* Find the pane directly above another. We build a list of those adjacent to
* top edge and then choose the best.
*/
struct window_pane *
window_pane_find_up(struct window_pane *wp)
{
struct window *w;
struct window_pane *next, *best, **list;
u_int edge, left, right, end, size;
int status, found;
if (wp == NULL)
return (NULL);
w = wp->window;
status = options_get_number(w->options, "pane-border-status");
list = NULL;
size = 0;
edge = wp->yoff;
if (status == PANE_STATUS_TOP) {
if (edge == 1)
edge = w->sy + 1;
} else if (status == PANE_STATUS_BOTTOM) {
if (edge == 0)
edge = w->sy;
} else {
if (edge == 0)
edge = w->sy + 1;
}
left = wp->xoff;
right = wp->xoff + wp->sx;
TAILQ_FOREACH(next, &w->panes, entry) {
if (next == wp)
continue;
if (next->yoff + next->sy + 1 != edge)
continue;
end = next->xoff + next->sx - 1;
found = 0;
if (next->xoff < left && end > right)
found = 1;
else if (next->xoff >= left && next->xoff <= right)
found = 1;
else if (end >= left && end <= right)
found = 1;
if (!found)
continue;
list = xreallocarray(list, size + 1, sizeof *list);
list[size++] = next;
}
best = window_pane_choose_best(list, size);
free(list);
return (best);
}
/* Find the pane directly below another. */
struct window_pane *
window_pane_find_down(struct window_pane *wp)
{
struct window *w;
struct window_pane *next, *best, **list;
u_int edge, left, right, end, size;
int status, found;
if (wp == NULL)
return (NULL);
w = wp->window;
status = options_get_number(w->options, "pane-border-status");
list = NULL;
size = 0;
edge = wp->yoff + wp->sy + 1;
if (status == PANE_STATUS_TOP) {
if (edge >= w->sy)
edge = 1;
} else if (status == PANE_STATUS_BOTTOM) {
if (edge >= w->sy - 1)
edge = 0;
} else {
if (edge >= w->sy)
edge = 0;
}
left = wp->xoff;
right = wp->xoff + wp->sx;
TAILQ_FOREACH(next, &w->panes, entry) {
if (next == wp)
continue;
if (next->yoff != edge)
continue;
end = next->xoff + next->sx - 1;
found = 0;
if (next->xoff < left && end > right)
found = 1;
else if (next->xoff >= left && next->xoff <= right)
found = 1;
else if (end >= left && end <= right)
found = 1;
if (!found)
continue;
list = xreallocarray(list, size + 1, sizeof *list);
list[size++] = next;
}
best = window_pane_choose_best(list, size);
free(list);
return (best);
}
/* Find the pane directly to the left of another. */
struct window_pane *
window_pane_find_left(struct window_pane *wp)
{
struct window *w;
struct window_pane *next, *best, **list;
u_int edge, top, bottom, end, size;
int found;
if (wp == NULL)
return (NULL);
w = wp->window;
list = NULL;
size = 0;
edge = wp->xoff;
if (edge == 0)
edge = w->sx + 1;
top = wp->yoff;
bottom = wp->yoff + wp->sy;
TAILQ_FOREACH(next, &w->panes, entry) {
if (next == wp)
continue;
if (next->xoff + next->sx + 1 != edge)
continue;
end = next->yoff + next->sy - 1;
found = 0;
if (next->yoff < top && end > bottom)
found = 1;
else if (next->yoff >= top && next->yoff <= bottom)
found = 1;
else if (end >= top && end <= bottom)
found = 1;
if (!found)
continue;
list = xreallocarray(list, size + 1, sizeof *list);
list[size++] = next;
}
best = window_pane_choose_best(list, size);
free(list);
return (best);
}
/* Find the pane directly to the right of another. */
struct window_pane *
window_pane_find_right(struct window_pane *wp)
{
struct window *w;
struct window_pane *next, *best, **list;
u_int edge, top, bottom, end, size;
int found;
if (wp == NULL)
return (NULL);
w = wp->window;
list = NULL;
size = 0;
edge = wp->xoff + wp->sx + 1;
if (edge >= w->sx)
edge = 0;
top = wp->yoff;
bottom = wp->yoff + wp->sy;
TAILQ_FOREACH(next, &w->panes, entry) {
if (next == wp)
continue;
if (next->xoff != edge)
continue;
end = next->yoff + next->sy - 1;
found = 0;
if (next->yoff < top && end > bottom)
found = 1;
else if (next->yoff >= top && next->yoff <= bottom)
found = 1;
else if (end >= top && end <= bottom)
found = 1;
if (!found)
continue;
list = xreallocarray(list, size + 1, sizeof *list);
list[size++] = next;
}
best = window_pane_choose_best(list, size);
free(list);
return (best);
}
/* Clear alert flags for a winlink */
void
winlink_clear_flags(struct winlink *wl)
{
struct winlink *loop;
wl->window->flags &= ~WINDOW_ALERTFLAGS;
TAILQ_FOREACH(loop, &wl->window->winlinks, wentry) {
if ((loop->flags & WINLINK_ALERTFLAGS) != 0) {
loop->flags &= ~WINLINK_ALERTFLAGS;
server_status_session(loop->session);
}
}
}
/* Shuffle window indexes up. */
int
winlink_shuffle_up(struct session *s, struct winlink *wl, int before)
{
int idx, last;
if (wl == NULL)
return (-1);
if (before)
idx = wl->idx;
else
idx = wl->idx + 1;
/* Find the next free index. */
for (last = idx; last < INT_MAX; last++) {
if (winlink_find_by_index(&s->windows, last) == NULL)
break;
}
if (last == INT_MAX)
return (-1);
/* Move everything from last - 1 to idx up a bit. */
for (; last > idx; last--) {
wl = winlink_find_by_index(&s->windows, last - 1);
RB_REMOVE(winlinks, &s->windows, wl);
wl->idx++;
RB_INSERT(winlinks, &s->windows, wl);
}
return (idx);
}
static void
window_pane_input_callback(struct client *c, __unused const char *path,
int error, int closed, struct evbuffer *buffer, void *data)
{
struct window_pane_input_data *cdata = data;
struct window_pane *wp;
u_char *buf = EVBUFFER_DATA(buffer);
size_t len = EVBUFFER_LENGTH(buffer);
wp = window_pane_find_by_id(cdata->wp);
if (wp == NULL || closed || error != 0 || c->flags & CLIENT_DEAD) {
if (wp == NULL)
c->flags |= CLIENT_EXIT;
evbuffer_drain(buffer, len);
cmdq_continue(cdata->item);
server_client_unref(c);
free(cdata);
return;
}
input_parse_buffer(wp, buf, len);
evbuffer_drain(buffer, len);
}
int
window_pane_start_input(struct window_pane *wp, struct cmdq_item *item,
char **cause)
{
struct client *c = cmdq_get_client(item);
struct window_pane_input_data *cdata;
if (~wp->flags & PANE_EMPTY) {
*cause = xstrdup("pane is not empty");
return (-1);
}
cdata = xmalloc(sizeof *cdata);
cdata->item = item;
cdata->wp = wp->id;
c->references++;
file_read(c, "-", window_pane_input_callback, cdata);
return (0);
}
void *
window_pane_get_new_data(struct window_pane *wp,
struct window_pane_offset *wpo, size_t *size)
{
size_t used = wpo->used - wp->base_offset;
*size = EVBUFFER_LENGTH(wp->event->input) - used;
return (EVBUFFER_DATA(wp->event->input) + used);
}
void
window_pane_update_used_data(struct window_pane *wp,
struct window_pane_offset *wpo, size_t size)
{
size_t used = wpo->used - wp->base_offset;
if (size > EVBUFFER_LENGTH(wp->event->input) - used)
size = EVBUFFER_LENGTH(wp->event->input) - used;
wpo->used += size;
}
|
524375.c | /**
* @file lv_gpu_stm32_dma2d.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_gpu_stm32_dma2d.h"
#include "../lv_core/lv_refr.h"
#if LV_USE_GPU_STM32_DMA2D
#include LV_GPU_DMA2D_CMSIS_INCLUDE
/*********************
* DEFINES
*********************/
#if LV_COLOR_16_SWAP
// TODO: F7 has red blue swap bit in control register for all layers and output
#error "Can't use DMA2D with LV_COLOR_16_SWAP 1"
#endif
#if LV_COLOR_DEPTH == 8
#error "Can't use DMA2D with LV_COLOR_DEPTH == 8"
#endif
#if LV_COLOR_DEPTH == 16
#define LV_DMA2D_COLOR_FORMAT LV_DMA2D_RGB565
#elif LV_COLOR_DEPTH == 32
#define LV_DMA2D_COLOR_FORMAT LV_DMA2D_ARGB8888
#else
/*Can't use GPU with other formats*/
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void invalidate_cache(void);
static void dma2d_wait(void);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Turn on the peripheral and set output color mode, this only needs to be done once
*/
void lv_gpu_stm32_dma2d_init(void)
{
/* Enable DMA2D clock */
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN;
/* Delay after setting peripheral clock */
volatile uint32_t temp = RCC->AHB1ENR;
/* set output colour mode */
DMA2D->OPFCCR = LV_DMA2D_COLOR_FORMAT;
}
/**
* Fill an area in the buffer with a color
* @param buf a buffer which should be filled
* @param buf_w width of the buffer in pixels
* @param color fill color
* @param fill_w width to fill in pixels (<= buf_w)
* @param fill_h height to fill in pixels
* @note `buf_w - fill_w` is offset to the next line after fill
*/
void lv_gpu_stm32_dma2d_fill(lv_color_t * buf, lv_coord_t buf_w, lv_color_t color, lv_coord_t fill_w, lv_coord_t fill_h)
{
invalidate_cache();
DMA2D->CR = 0x30000;
DMA2D->OMAR = (uint32_t)buf;
/* as input color mode is same as output we don't need to convert here do we? */
DMA2D->OCOLR = color.full;
DMA2D->OOR = buf_w - fill_w;
DMA2D->NLR = (fill_w << DMA2D_NLR_PL_Pos) | (fill_h << DMA2D_NLR_NL_Pos);
/* start transfer */
DMA2D->CR |= DMA2D_CR_START_Msk;
dma2d_wait();
}
/**
* Fill an area in the buffer with a color but take into account a mask which describes the opacity of each pixel
* @param buf a buffer which should be filled using a mask
* @param buf_w width of the buffer in pixels
* @param color fill color
* @param mask 0..255 values describing the opacity of the corresponding pixel. It's width is `fill_w`
* @param opa overall opacity. 255 in `mask` should mean this opacity.
* @param fill_w width to fill in pixels (<= buf_w)
* @param fill_h height to fill in pixels
* @note `buf_w - fill_w` is offset to the next line after fill
*/
void lv_gpu_stm32_dma2d_fill_mask(lv_color_t * buf, lv_coord_t buf_w, lv_color_t color, const lv_opa_t * mask,
lv_opa_t opa, lv_coord_t fill_w, lv_coord_t fill_h)
{
#if 0
invalidate_cache();
/* Configure the DMA2D Mode, Color Mode and line output offset */
hdma2d.Init.Mode = DMA2D_M2M_BLEND;
hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
hdma2d.Init.OutputOffset = buf_w - fill_w;
/* Configure the foreground -> The character */
lv_color32_t c32;
c32.full = lv_color_to32(color);
c32.ch.alpha = opa;
hdma2d.LayerCfg[1].AlphaMode = DMA2D_COMBINE_ALPHA;
hdma2d.LayerCfg[1].InputAlpha = c32.full;
hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_A8;
hdma2d.LayerCfg[1].InputOffset = 0;
/* Configure the background -> Display buffer */
hdma2d.LayerCfg[0].AlphaMode = DMA2D_NO_MODIF_ALPHA;
hdma2d.LayerCfg[0].InputAlpha = 0x00;
hdma2d.LayerCfg[0].InputColorMode = DMA2D_INPUT_FORMAT;
hdma2d.LayerCfg[0].InputOffset = buf_w - fill_w;
/* DMA2D Initialization */
HAL_DMA2D_Init(&hdma2d);
HAL_DMA2D_ConfigLayer(&hdma2d, 0);
HAL_DMA2D_ConfigLayer(&hdma2d, 1);
HAL_DMA2D_BlendingStart(&hdma2d, (uint32_t) mask, (uint32_t) buf, (uint32_t)buf, fill_w, fill_h);
dma2d_wait();
#endif
}
/**
* Copy a map (typically RGB image) to a buffer
* @param buf a buffer where map should be copied
* @param buf_w width of the buffer in pixels
* @param map an "image" to copy
* @param map_w width of the map in pixels
* @param copy_w width of the area to copy in pixels (<= buf_w)
* @param copy_h height of the area to copy in pixels
* @note `map_w - fill_w` is offset to the next line after copy
*/
void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_t * map, lv_coord_t map_w,
lv_coord_t copy_w, lv_coord_t copy_h)
{
invalidate_cache();
DMA2D->CR = 0;
/* copy output colour mode, this register controls both input and output colour format */
DMA2D->FGPFCCR = LV_DMA2D_COLOR_FORMAT;
DMA2D->FGMAR = (uint32_t)map;
DMA2D->FGOR = map_w - copy_w;
DMA2D->OMAR = (uint32_t)buf;
DMA2D->OOR = buf_w - copy_w;
DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos);
/* start transfer */
DMA2D->CR |= DMA2D_CR_START_Msk;
dma2d_wait();
}
/**
* Blend a map (e.g. ARGB image or RGB image with opacity) to a buffer
* @param buf a buffer where `map` should be copied
* @param buf_w width of the buffer in pixels
* @param map an "image" to copy
* @param opa opacity of `map`
* @param map_w width of the map in pixels
* @param copy_w width of the area to copy in pixels (<= buf_w)
* @param copy_h height of the area to copy in pixels
* @note `map_w - fill_w` is offset to the next line after copy
*/
void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color_t * map, lv_opa_t opa,
lv_coord_t map_w, lv_coord_t copy_w, lv_coord_t copy_h)
{
invalidate_cache();
DMA2D->CR = 0x20000;
DMA2D->BGPFCCR = LV_DMA2D_COLOR_FORMAT;
DMA2D->BGMAR = (uint32_t)buf;
DMA2D->BGOR = buf_w - copy_w;
DMA2D->FGPFCCR = (uint32_t)LV_DMA2D_COLOR_FORMAT
/* alpha mode 2, replace with foreground * alpha value */
| (2 << DMA2D_FGPFCCR_AM_Pos)
/* alpha value */
| (opa << DMA2D_FGPFCCR_ALPHA_Pos);
DMA2D->FGMAR = (uint32_t)map;
DMA2D->FGOR = map_w - copy_w;
DMA2D->OMAR = (uint32_t)buf;
DMA2D->OOR = buf_w - copy_w;
DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos);
/* start transfer */
DMA2D->CR |= DMA2D_CR_START_Msk;
dma2d_wait();
}
/**********************
* STATIC FUNCTIONS
**********************/
static void invalidate_cache(void)
{
#if __DCACHE_PRESENT
if(SCB->CCR & (uint32_t)SCB_CCR_DC_Msk) {
SCB_CleanInvalidateDCache();
}
#endif
}
static void dma2d_wait(void)
{
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
while(DMA2D->CR & DMA2D_CR_START_Msk) {
if(disp->driver.wait_cb) disp->driver.wait_cb(&disp->driver);
}
}
#endif
|
53305.c | /*
* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#define pr_fmt(fmt) "msmclock: %s: " fmt, __func__
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/io.h>
#include <linux/mutex.h>
#include <linux/regulator/consumer.h>
#include <linux/of.h>
#include <linux/hashtable.h>
#include <linux/clk/msm-clk-provider.h>
#include <soc/qcom/msm-clock-controller.h>
#include <soc/qcom/clock-rpm.h>
/* Protects list operations */
static DEFINE_MUTEX(msmclk_lock);
static LIST_HEAD(msmclk_parser_list);
static u32 msmclk_debug;
struct hitem {
struct hlist_node list;
phandle key;
void *ptr;
};
int of_property_count_phandles(struct device_node *np, char *propname)
{
const __be32 *phandle;
int size;
phandle = of_get_property(np, propname, &size);
return phandle ? (size / sizeof(*phandle)) : -EINVAL;
}
EXPORT_SYMBOL(of_property_count_phandles);
int of_property_read_phandle_index(struct device_node *np, char *propname,
int index, phandle *p)
{
const __be32 *phandle;
int size;
phandle = of_get_property(np, propname, &size);
if ((!phandle) || (size < sizeof(*phandle) * (index + 1)))
return -EINVAL;
*p = be32_to_cpup(phandle + index);
return 0;
}
EXPORT_SYMBOL(of_property_read_phandle_index);
static int generic_vdd_parse_regulators(struct device *dev,
struct clk_vdd_class *vdd, struct device_node *np)
{
int num_regulators, i, rc;
char *name = "qcom,regulators";
num_regulators = of_property_count_phandles(np, name);
if (num_regulators <= 0) {
dt_prop_err(np, name, "missing dt property\n");
return -EINVAL;
}
vdd->regulator = devm_kzalloc(dev,
sizeof(*vdd->regulator) * num_regulators,
GFP_KERNEL);
if (!vdd->regulator) {
dt_err(np, "memory alloc failure\n");
return -ENOMEM;
}
for (i = 0; i < num_regulators; i++) {
phandle p;
rc = of_property_read_phandle_index(np, name, i, &p);
if (rc) {
dt_prop_err(np, name, "unable to read phandle\n");
return rc;
}
vdd->regulator[i] = msmclk_parse_phandle(dev, p);
if (IS_ERR(vdd->regulator[i])) {
dt_prop_err(np, name, "hashtable lookup failed\n");
return PTR_ERR(vdd->regulator[i]);
}
}
vdd->num_regulators = num_regulators;
return 0;
}
static int generic_vdd_parse_levels(struct device *dev,
struct clk_vdd_class *vdd, struct device_node *np)
{
int len, rc;
char *name = "qcom,uV-levels";
if (!of_find_property(np, name, &len)) {
dt_prop_err(np, name, "missing dt property\n");
return -EINVAL;
}
len /= sizeof(u32);
if (len % vdd->num_regulators) {
dt_err(np, "mismatch beween qcom,uV-levels and qcom,regulators dt properties\n");
return -EINVAL;
}
vdd->num_levels = len / vdd->num_regulators;
vdd->vdd_uv = devm_kzalloc(dev, len * sizeof(*vdd->vdd_uv),
GFP_KERNEL);
vdd->level_votes = devm_kzalloc(dev,
vdd->num_levels * sizeof(*vdd->level_votes),
GFP_KERNEL);
if (!vdd->vdd_uv || !vdd->level_votes) {
dt_err(np, "memory alloc failure\n");
return -ENOMEM;
}
rc = of_property_read_u32_array(np, name, vdd->vdd_uv,
vdd->num_levels * vdd->num_regulators);
if (rc) {
dt_prop_err(np, name, "unable to read u32 array\n");
return -EINVAL;
}
/* Optional Property */
name = "qcom,uA-levels";
if (!of_find_property(np, name, &len))
return 0;
len /= sizeof(u32);
if (len / vdd->num_regulators != vdd->num_levels) {
dt_err(np, "size of qcom,uA-levels and qcom,uV-levels must match\n");
return -EINVAL;
}
vdd->vdd_ua = devm_kzalloc(dev, len * sizeof(*vdd->vdd_ua),
GFP_KERNEL);
if (!vdd->vdd_ua) {
dt_err(np, "memory alloc failure\n");
return -ENOMEM;
}
rc = of_property_read_u32_array(np, name, vdd->vdd_ua,
vdd->num_levels * vdd->num_regulators);
if (rc) {
dt_prop_err(np, name, "unable to read u32 array\n");
return -EINVAL;
}
return 0;
}
static void *simple_vdd_class_dt_parser(struct device *dev,
struct device_node *np)
{
struct clk_vdd_class *vdd;
int rc = 0;
vdd = devm_kzalloc(dev, sizeof(*vdd), GFP_KERNEL);
if (!vdd) {
dev_err(dev, "memory alloc failure\n");
return ERR_PTR(-ENOMEM);
}
mutex_init(&vdd->lock);
vdd->class_name = np->name;
rc = generic_vdd_parse_regulators(dev, vdd, np);
rc |= generic_vdd_parse_levels(dev, vdd, np);
if (rc) {
dt_err(np, "unable to read vdd_class\n");
return ERR_PTR(rc);
}
return vdd;
}
MSMCLK_PARSER(simple_vdd_class_dt_parser, "qcom,simple-vdd-class", 0);
static int generic_clk_parse_parents(struct device *dev, struct clk *c,
struct device_node *np)
{
int rc;
phandle p;
char *name = "qcom,parent";
/* This property is optional */
if (!of_find_property(np, name, NULL))
return 0;
rc = of_property_read_phandle_index(np, name, 0, &p);
if (rc) {
dt_prop_err(np, name, "unable to read phandle\n");
return rc;
}
c->parent = msmclk_parse_phandle(dev, p);
if (IS_ERR(c->parent)) {
dt_prop_err(np, name, "hashtable lookup failed\n");
return PTR_ERR(c->parent);
}
return 0;
}
static int generic_clk_parse_vdd(struct device *dev, struct clk *c,
struct device_node *np)
{
phandle p;
int rc;
char *name = "qcom,supply-group";
/* This property is optional */
if (!of_find_property(np, name, NULL))
return 0;
rc = of_property_read_phandle_index(np, name, 0, &p);
if (rc) {
dt_prop_err(np, name, "unable to read phandle\n");
return rc;
}
c->vdd_class = msmclk_parse_phandle(dev, p);
if (IS_ERR(c->vdd_class)) {
dt_prop_err(np, name, "hashtable lookup failed\n");
return PTR_ERR(c->vdd_class);
}
return 0;
}
static int generic_clk_parse_flags(struct device *dev, struct clk *c,
struct device_node *np)
{
int rc;
char *name = "qcom,clk-flags";
/* This property is optional */
if (!of_find_property(np, name, NULL))
return 0;
rc = of_property_read_u32(np, name, &c->flags);
if (rc) {
dt_prop_err(np, name, "unable to read u32\n");
return rc;
}
return 0;
}
static int generic_clk_parse_fmax(struct device *dev, struct clk *c,
struct device_node *np)
{
u32 prop_len, i;
int rc;
char *name = "qcom,clk-fmax";
/* This property is optional */
if (!of_find_property(np, name, &prop_len))
return 0;
if (!c->vdd_class) {
dt_err(np, "both qcom,clk-fmax and qcom,supply-group must be defined\n");
return -EINVAL;
}
prop_len /= sizeof(u32);
if (prop_len % 2) {
dt_prop_err(np, name, "bad length\n");
return -EINVAL;
}
/* Value at proplen - 2 is the index of the last entry in fmax array */
rc = of_property_read_u32_index(np, name, prop_len - 2, &c->num_fmax);
c->num_fmax += 1;
if (rc) {
dt_prop_err(np, name, "unable to read u32\n");
return rc;
}
c->fmax = devm_kzalloc(dev, sizeof(*c->fmax) * c->num_fmax, GFP_KERNEL);
if (!c->fmax) {
dev_err(dev, "memory alloc failure\n");
return -ENOMEM;
}
for (i = 0; i < prop_len; i += 2) {
u32 level, value;
rc = of_property_read_u32_index(np, name, i, &level);
if (rc) {
dt_prop_err(np, name, "unable to read u32\n");
return rc;
}
rc = of_property_read_u32_index(np, name, i + 1, &value);
if (rc) {
dt_prop_err(np, name, "unable to read u32\n");
return rc;
}
if (level >= c->num_fmax) {
dt_prop_err(np, name, "must be sorted\n");
return -EINVAL;
}
c->fmax[level] = value;
}
return 0;
}
static int generic_clk_add_lookup_tbl_entry(struct device *dev, struct clk *c)
{
struct msmclk_data *drv = dev_get_drvdata(dev);
struct clk_lookup *cl;
if (drv->clk_tbl_size >= drv->max_clk_tbl_size) {
dev_err(dev, "child node count should be > clock_count?\n");
return -EINVAL;
}
cl = drv->clk_tbl + drv->clk_tbl_size;
cl->clk = c;
drv->clk_tbl_size++;
return 0;
}
static int generic_clk_parse_depends(struct device *dev, struct clk *c,
struct device_node *np)
{
phandle p;
int rc;
char *name = "qcom,depends";
/* This property is optional */
if (!of_find_property(np, name, NULL))
return 0;
rc = of_property_read_phandle_index(np, name, 0, &p);
if (rc) {
dt_prop_err(np, name, "unable to read phandle\n");
return rc;
}
c->depends = msmclk_parse_phandle(dev, p);
if (IS_ERR(c->depends)) {
dt_prop_err(np, name, "hashtable lookup failed\n");
return PTR_ERR(c->depends);
}
return 0;
}
static int generic_clk_parse_init_config(struct device *dev, struct clk *c,
struct device_node *np)
{
int rc;
u32 temp;
char *name = "qcom,config-rate";
/* This property is optional */
if (!of_find_property(np, name, NULL))
return 0;
rc = of_property_read_u32(np, name, &temp);
if (rc) {
dt_prop_err(np, name, "unable to read u32\n");
return rc;
}
c->init_rate = temp;
name = "qcom,always-on";
c->always_on = of_property_read_bool(np, name);
return rc;
}
void *msmclk_generic_clk_init(struct device *dev, struct device_node *np,
struct clk *c)
{
int rc;
/* CLK_INIT macro */
spin_lock_init(&c->lock);
mutex_init(&c->prepare_lock);
INIT_LIST_HEAD(&c->children);
INIT_LIST_HEAD(&c->siblings);
INIT_LIST_HEAD(&c->list);
c->dbg_name = np->name;
rc = generic_clk_add_lookup_tbl_entry(dev, c);
rc |= generic_clk_parse_flags(dev, c, np);
rc |= generic_clk_parse_parents(dev, c, np);
rc |= generic_clk_parse_vdd(dev, c, np);
rc |= generic_clk_parse_fmax(dev, c, np);
rc |= generic_clk_parse_depends(dev, c, np);
rc |= generic_clk_parse_init_config(dev, c, np);
if (rc) {
dt_err(np, "unable to read clk\n");
return ERR_PTR(-EINVAL);
}
return c;
}
static struct msmclk_parser *msmclk_parser_lookup(struct device_node *np)
{
struct msmclk_parser *item;
list_for_each_entry(item, &msmclk_parser_list, list) {
if (of_device_is_compatible(np, item->compatible))
return item;
}
return NULL;
}
void msmclk_parser_register(struct msmclk_parser *item)
{
mutex_lock(&msmclk_lock);
list_add(&item->list, &msmclk_parser_list);
mutex_unlock(&msmclk_lock);
}
static int msmclk_htable_add(struct device *dev, void *result, phandle key);
void *msmclk_parse_dt_node(struct device *dev, struct device_node *np)
{
struct msmclk_parser *parser;
phandle key;
void *result;
int rc;
key = np->phandle;
result = msmclk_lookup_phandle(dev, key);
if (!result)
return ERR_PTR(-EINVAL);
if (!of_device_is_available(np)) {
dt_err(np, "node is disabled\n");
return ERR_PTR(-EINVAL);
}
parser = msmclk_parser_lookup(np);
if (IS_ERR(parser)) {
dt_err(np, "no parser found\n");
return ERR_PTR(-EINVAL);
}
/* This may return -EPROBE_DEFER */
result = parser->parsedt(dev, np);
if (IS_ERR(result)) {
dt_err(np, "parsedt failed");
return result;
}
rc = msmclk_htable_add(dev, result, key);
if (rc)
return ERR_PTR(rc);
return result;
}
void *msmclk_parse_phandle(struct device *dev, phandle key)
{
struct hitem *item;
struct device_node *np;
struct msmclk_data *drv = dev_get_drvdata(dev);
/*
* the default phandle value is 0. Since hashtable keys must
* be unique, reject the default value.
*/
if (!key)
return ERR_PTR(-EINVAL);
hash_for_each_possible(drv->htable, item, list, key) {
if (item->key == key)
return item->ptr;
}
np = of_find_node_by_phandle(key);
if (!np)
return ERR_PTR(-EINVAL);
return msmclk_parse_dt_node(dev, np);
}
EXPORT_SYMBOL(msmclk_parse_phandle);
void *msmclk_lookup_phandle(struct device *dev, phandle key)
{
struct hitem *item;
struct msmclk_data *drv = dev_get_drvdata(dev);
hash_for_each_possible(drv->htable, item, list, key) {
if (item->key == key)
return item->ptr;
}
return ERR_PTR(-EINVAL);
}
EXPORT_SYMBOL(msmclk_lookup_phandle);
static int msmclk_htable_add(struct device *dev, void *data, phandle key)
{
struct hitem *item;
struct msmclk_data *drv = dev_get_drvdata(dev);
/*
* If there are no phandle references to a node, key == 0. However, if
* there is a second node like this, both will have key == 0. This
* violates the requirement that hashtable keys be unique. Skip it.
*/
if (!key)
return 0;
if (!IS_ERR(msmclk_lookup_phandle(dev, key))) {
struct device_node *np = of_find_node_by_phandle(key);
dev_err(dev, "attempt to add duplicate entry for %s\n",
np ? np->name : "NULL");
return -EINVAL;
}
item = devm_kzalloc(dev, sizeof(*item), GFP_KERNEL);
if (!item) {
dev_err(dev, "memory alloc failure\n");
return -ENOMEM;
}
INIT_HLIST_NODE(&item->list);
item->key = key;
item->ptr = data;
hash_add(drv->htable, &item->list, key);
return 0;
}
/*
* Currently, regulators are the only elements capable of probe deferral.
* Check them first to handle probe deferal efficiently.
*/
static int get_ext_regulators(struct device *dev)
{
int num_strings, i, rc;
struct device_node *np;
void *item;
char *name = "qcom,regulator-names";
np = dev->of_node;
/* This property is optional */
num_strings = of_property_count_strings(np, name);
if (num_strings <= 0)
return 0;
for (i = 0; i < num_strings; i++) {
const char *str;
char buf[50];
phandle key;
rc = of_property_read_string_index(np, name, i, &str);
if (rc) {
dt_prop_err(np, name, "unable to read string\n");
return rc;
}
item = devm_regulator_get(dev, str);
if (IS_ERR(item)) {
dev_err(dev, "Failed to get regulator: %s\n", str);
return PTR_ERR(item);
}
snprintf(buf, ARRAY_SIZE(buf), "%s-supply", str);
rc = of_property_read_phandle_index(np, buf, 0, &key);
if (rc) {
dt_prop_err(np, buf, "unable to read phandle\n");
return rc;
}
rc = msmclk_htable_add(dev, item, key);
if (rc)
return rc;
}
return 0;
}
static struct clk *msmclk_clk_get(struct of_phandle_args *clkspec, void *data)
{
phandle key;
struct clk *c = ERR_PTR(-ENOENT);
key = clkspec->args[0];
c = msmclk_lookup_phandle(data, key);
if (!IS_ERR(c) && !(c->flags & CLKFLAG_INIT_DONE))
return ERR_PTR(-EPROBE_DEFER);
return c;
}
static void *regulator_dt_parser(struct device *dev, struct device_node *np)
{
dt_err(np, "regulators should be handled in probe()");
return ERR_PTR(-EINVAL);
}
MSMCLK_PARSER(regulator_dt_parser, "qcom,rpm-smd-regulator", 0);
static void *msmclk_dt_parser(struct device *dev, struct device_node *np)
{
dt_err(np, "calling into other clock controllers isn't allowed");
return ERR_PTR(-EINVAL);
}
MSMCLK_PARSER(msmclk_dt_parser, "qcom,msm-clock-controller", 0);
static struct msmclk_data *msmclk_drv_init(struct device *dev)
{
struct msmclk_data *drv;
size_t size;
drv = devm_kzalloc(dev, sizeof(*drv), GFP_KERNEL);
if (!drv) {
dev_err(dev, "memory alloc failure\n");
return ERR_PTR(-ENOMEM);
}
dev_set_drvdata(dev, drv);
drv->dev = dev;
INIT_LIST_HEAD(&drv->list);
/* This overestimates size */
drv->max_clk_tbl_size = of_get_child_count(dev->of_node);
size = sizeof(*drv->clk_tbl) * drv->max_clk_tbl_size;
drv->clk_tbl = devm_kzalloc(dev, size, GFP_KERNEL);
if (!drv->clk_tbl) {
dev_err(dev, "memory alloc failure clock table size %zu\n",
size);
return ERR_PTR(-ENOMEM);
}
hash_init(drv->htable);
return drv;
}
static int msmclk_probe(struct platform_device *pdev)
{
struct resource *res;
struct device *dev;
struct msmclk_data *drv;
struct device_node *child;
void *result;
int rc = 0;
dev = &pdev->dev;
drv = msmclk_drv_init(dev);
if (IS_ERR(drv))
return PTR_ERR(drv);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cc-base");
if (!res) {
dt_err(dev->of_node, "missing cc-base\n");
return -EINVAL;
}
drv->base = devm_ioremap(dev, res->start, resource_size(res));
if (!drv->base) {
dev_err(dev, "ioremap failed for drv->base\n");
return -ENOMEM;
}
rc = msmclk_htable_add(dev, drv, dev->of_node->phandle);
if (rc)
return rc;
rc = enable_rpm_scaling();
if (rc)
return rc;
rc = get_ext_regulators(dev);
if (rc)
return rc;
/*
* Returning -EPROBE_DEFER here is inefficient due to
* destroying work 'unnecessarily'
*/
for_each_available_child_of_node(dev->of_node, child) {
result = msmclk_parse_dt_node(dev, child);
if (!IS_ERR(result))
continue;
if (!msmclk_debug)
return PTR_ERR(result);
/*
* Parse and report all errors instead of immediately
* exiting. Return the first error code.
*/
if (!rc)
rc = PTR_ERR(result);
}
if (rc)
return rc;
rc = of_clk_add_provider(dev->of_node, msmclk_clk_get, dev);
if (rc) {
dev_err(dev, "of_clk_add_provider failed\n");
return rc;
}
/*
* can't fail after registering clocks, because users may have
* gotten clock references. Failing would delete the memory.
*/
WARN_ON(msm_clock_register(drv->clk_tbl, drv->clk_tbl_size));
dev_info(dev, "registered clocks\n");
return 0;
}
static struct of_device_id msmclk_match_table[] = {
{.compatible = "qcom,msm-clock-controller"},
{}
};
static struct platform_driver msmclk_driver = {
.probe = msmclk_probe,
.driver = {
.name = "msm-clock-controller",
.of_match_table = msmclk_match_table,
.owner = THIS_MODULE,
},
};
static bool initialized;
int __init msmclk_init(void)
{
int rc;
if (initialized)
return 0;
rc = platform_driver_register(&msmclk_driver);
if (rc)
return rc;
initialized = true;
return rc;
}
arch_initcall(msmclk_init);
|
604898.c | #include "file.h"
#include <string.h>
SrcFile_T* init_srcfile(List_T* lines, const char* path)
{
SrcFile_T* file = calloc(1, sizeof(SrcFile_T));
file->lines = lines;
file->path = path;
file->num_lines = file->lines->size;
file->short_path = NULL;
file->file_no = 0;
return file;
}
void free_srcfile(SrcFile_T* file)
{
for(size_t i = 0; i < file->num_lines; i++)
free(file->lines->items[i]);
if(file->short_path)
free(file->short_path);
free_list(file->lines);
free(file);
}
char* get_line(SrcFile_T* file, u32 line)
{
if(line >= file->num_lines)
return NULL;
return file->lines->items[line];
}
u32 get_line_len(SrcFile_T* file, u32 line)
{
if(line >= file->num_lines)
return 0;
return strlen((char*) file->lines->items[line]);
}
char get_char(SrcFile_T* file, u32 line, u32 i)
{
if(line >= file->num_lines || i >= get_line_len(file, line))
return -1;
return ((char*) file->lines->items[line])[i];
} |
183097.c | /*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <[email protected]> |
| Mike Jackson <[email protected]> |
| Steven Lawrance <[email protected]> |
| Harrie Hazewinkel <[email protected]> |
| Johann Hanne <[email protected]> |
| Boris Lytockin <[email protected]> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "main/php_network.h"
#include "ext/standard/info.h"
#include "php_snmp.h"
#include "zend_exceptions.h"
#if HAVE_SPL
#include "ext/spl/spl_exceptions.h"
#endif
#if HAVE_SNMP
#include <sys/types.h>
#ifdef PHP_WIN32
#include <winsock2.h>
#include <errno.h>
#include <process.h>
#include "win32/time.h"
#elif defined(NETWARE)
#ifdef USE_WINSOCK
#include <novsock2.h>
#else
#include <sys/socket.h>
#endif
#include <errno.h>
#include <sys/timeval.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifndef _OSD_POSIX
#include <sys/errno.h>
#else
#include <errno.h> /* BS2000/OSD uses <errno.h>, not <sys/errno.h> */
#endif
#include <netdb.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef __P
#ifdef __GNUC__
#define __P(args) args
#else
#define __P(args) ()
#endif
#endif
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
/* For net-snmp prior to 5.4 */
#ifndef HAVE_SHUTDOWN_SNMP_LOGGING
extern netsnmp_log_handler *logh_head;
#define shutdown_snmp_logging() \
{ \
snmp_disable_log(); \
while(NULL != logh_head) \
netsnmp_remove_loghandler( logh_head ); \
}
#endif
#define SNMP_VALUE_LIBRARY (0 << 0)
#define SNMP_VALUE_PLAIN (1 << 0)
#define SNMP_VALUE_OBJECT (1 << 1)
typedef struct snmp_session php_snmp_session;
#define PHP_SNMP_SESSION_RES_NAME "SNMP session"
#define PHP_SNMP_ADD_PROPERTIES(a, b) \
{ \
int i = 0; \
while (b[i].name != NULL) { \
php_snmp_add_property((a), (b)[i].name, (b)[i].name_length, \
(php_snmp_read_t)(b)[i].read_func, (php_snmp_write_t)(b)[i].write_func); \
i++; \
} \
}
#define PHP_SNMP_ERRNO_NOERROR 0
#define PHP_SNMP_ERRNO_GENERIC (1 << 1)
#define PHP_SNMP_ERRNO_TIMEOUT (1 << 2)
#define PHP_SNMP_ERRNO_ERROR_IN_REPLY (1 << 3)
#define PHP_SNMP_ERRNO_OID_NOT_INCREASING (1 << 4)
#define PHP_SNMP_ERRNO_OID_PARSING_ERROR (1 << 5)
#define PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES (1 << 6)
#define PHP_SNMP_ERRNO_ANY ( \
PHP_SNMP_ERRNO_GENERIC | \
PHP_SNMP_ERRNO_TIMEOUT | \
PHP_SNMP_ERRNO_ERROR_IN_REPLY | \
PHP_SNMP_ERRNO_OID_NOT_INCREASING | \
PHP_SNMP_ERRNO_OID_PARSING_ERROR | \
PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES | \
PHP_SNMP_ERRNO_NOERROR \
)
ZEND_DECLARE_MODULE_GLOBALS(snmp)
static PHP_GINIT_FUNCTION(snmp);
/* constant - can be shared among threads */
static oid objid_mib[] = {1, 3, 6, 1, 2, 1};
static int le_snmp_session;
/* Handlers */
static zend_object_handlers php_snmp_object_handlers;
/* Class entries */
zend_class_entry *php_snmp_ce;
zend_class_entry *php_snmp_exception_ce;
/* Class object properties */
static HashTable php_snmp_properties;
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpget, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpgetnext, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpwalk, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmprealwalk, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpset, 0, 0, 5)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_get_quick_print, 0, 0, 1)
ZEND_ARG_INFO(0, d)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_quick_print, 0, 0, 1)
ZEND_ARG_INFO(0, quick_print)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_enum_print, 0, 0, 1)
ZEND_ARG_INFO(0, enum_print)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_oid_output_format, 0, 0, 1)
ZEND_ARG_INFO(0, oid_format)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_get, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_getnext, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_walk, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_real_walk, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_set, 0, 0, 5)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_get, 0, 0, 8)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, sec_name)
ZEND_ARG_INFO(0, sec_level)
ZEND_ARG_INFO(0, auth_protocol)
ZEND_ARG_INFO(0, auth_passphrase)
ZEND_ARG_INFO(0, priv_protocol)
ZEND_ARG_INFO(0, priv_passphrase)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_getnext, 0, 0, 8)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, sec_name)
ZEND_ARG_INFO(0, sec_level)
ZEND_ARG_INFO(0, auth_protocol)
ZEND_ARG_INFO(0, auth_passphrase)
ZEND_ARG_INFO(0, priv_protocol)
ZEND_ARG_INFO(0, priv_passphrase)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_walk, 0, 0, 8)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, sec_name)
ZEND_ARG_INFO(0, sec_level)
ZEND_ARG_INFO(0, auth_protocol)
ZEND_ARG_INFO(0, auth_passphrase)
ZEND_ARG_INFO(0, priv_protocol)
ZEND_ARG_INFO(0, priv_passphrase)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_real_walk, 0, 0, 8)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, sec_name)
ZEND_ARG_INFO(0, sec_level)
ZEND_ARG_INFO(0, auth_protocol)
ZEND_ARG_INFO(0, auth_passphrase)
ZEND_ARG_INFO(0, priv_protocol)
ZEND_ARG_INFO(0, priv_passphrase)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_set, 0, 0, 10)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, sec_name)
ZEND_ARG_INFO(0, sec_level)
ZEND_ARG_INFO(0, auth_protocol)
ZEND_ARG_INFO(0, auth_passphrase)
ZEND_ARG_INFO(0, priv_protocol)
ZEND_ARG_INFO(0, priv_passphrase)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_valueretrieval, 0, 0, 1)
ZEND_ARG_INFO(0, method)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_snmp_get_valueretrieval, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_read_mib, 0, 0, 1)
ZEND_ARG_INFO(0, filename)
ZEND_END_ARG_INFO()
/* OO arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_create, 0, 0, 3)
ZEND_ARG_INFO(0, version)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, community)
ZEND_ARG_INFO(0, timeout)
ZEND_ARG_INFO(0, retries)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_snmp_void, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_setSecurity, 0, 0, 8)
ZEND_ARG_INFO(0, session)
ZEND_ARG_INFO(0, sec_level)
ZEND_ARG_INFO(0, auth_protocol)
ZEND_ARG_INFO(0, auth_passphrase)
ZEND_ARG_INFO(0, priv_protocol)
ZEND_ARG_INFO(0, priv_passphrase)
ZEND_ARG_INFO(0, contextName)
ZEND_ARG_INFO(0, contextEngineID)
ZEND_ARG_INFO(0, )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_get, 0, 0, 1)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, use_orignames)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_walk, 0, 0, 4)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, suffix_keys)
ZEND_ARG_INFO(0, max_repetitions)
ZEND_ARG_INFO(0, non_repeaters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set, 0, 0, 3)
ZEND_ARG_INFO(0, object_id)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_class_set_quick_print, 0, 0, 1)
ZEND_ARG_INFO(0, quick_print)
ZEND_END_ARG_INFO()
/* }}} */
struct objid_query {
int count;
int offset;
int step;
zend_long non_repeaters;
zend_long max_repetitions;
int valueretrieval;
int array_output;
int oid_increasing_check;
snmpobjarg *vars;
};
/* {{{ snmp_functions[]
*/
const zend_function_entry snmp_functions[] = {
PHP_FE(snmpget, arginfo_snmpget)
PHP_FE(snmpgetnext, arginfo_snmpgetnext)
PHP_FE(snmpwalk, arginfo_snmpwalk)
PHP_FE(snmprealwalk, arginfo_snmprealwalk)
PHP_FALIAS(snmpwalkoid, snmprealwalk, arginfo_snmprealwalk)
PHP_FE(snmpset, arginfo_snmpset)
PHP_FE(snmp_get_quick_print, arginfo_snmp_get_quick_print)
PHP_FE(snmp_set_quick_print, arginfo_snmp_set_quick_print)
PHP_FE(snmp_set_enum_print, arginfo_snmp_set_enum_print)
PHP_FE(snmp_set_oid_output_format, arginfo_snmp_set_oid_output_format)
PHP_FALIAS(snmp_set_oid_numeric_print, snmp_set_oid_output_format, arginfo_snmp_set_oid_output_format)
PHP_FE(snmp2_get, arginfo_snmp2_get)
PHP_FE(snmp2_getnext, arginfo_snmp2_getnext)
PHP_FE(snmp2_walk, arginfo_snmp2_walk)
PHP_FE(snmp2_real_walk, arginfo_snmp2_real_walk)
PHP_FE(snmp2_set, arginfo_snmp2_set)
PHP_FE(snmp3_get, arginfo_snmp3_get)
PHP_FE(snmp3_getnext, arginfo_snmp3_getnext)
PHP_FE(snmp3_walk, arginfo_snmp3_walk)
PHP_FE(snmp3_real_walk, arginfo_snmp3_real_walk)
PHP_FE(snmp3_set, arginfo_snmp3_set)
PHP_FE(snmp_set_valueretrieval, arginfo_snmp_set_valueretrieval)
PHP_FE(snmp_get_valueretrieval, arginfo_snmp_get_valueretrieval)
PHP_FE(snmp_read_mib, arginfo_snmp_read_mib)
PHP_FE_END
};
/* }}} */
/* query an agent with GET method */
#define SNMP_CMD_GET (1<<0)
/* query an agent with GETNEXT method */
#define SNMP_CMD_GETNEXT (1<<1)
/* query an agent with SET method */
#define SNMP_CMD_SET (1<<2)
/* walk the mib */
#define SNMP_CMD_WALK (1<<3)
/* force values-only output */
#define SNMP_NUMERIC_KEYS (1<<7)
/* use user-supplied OID names for keys in array output mode in GET method */
#define SNMP_ORIGINAL_NAMES_AS_KEYS (1<<8)
/* use OID suffix (`index') for keys in array output mode in WALK method */
#define SNMP_USE_SUFFIX_AS_KEYS (1<<9)
#ifdef COMPILE_DL_SNMP
ZEND_GET_MODULE(snmp)
#endif
/* THREAD_LS snmp_module php_snmp_module; - may need one of these at some point */
/* {{{ PHP_GINIT_FUNCTION
*/
static PHP_GINIT_FUNCTION(snmp)
{
snmp_globals->valueretrieval = SNMP_VALUE_LIBRARY;
}
/* }}} */
#define PHP_SNMP_SESSION_FREE(a) { \
if ((*session)->a) { \
efree((*session)->a); \
(*session)->a = NULL; \
} \
}
static void netsnmp_session_free(php_snmp_session **session) /* {{{ */
{
if (*session) {
PHP_SNMP_SESSION_FREE(peername);
PHP_SNMP_SESSION_FREE(community);
PHP_SNMP_SESSION_FREE(securityName);
PHP_SNMP_SESSION_FREE(contextEngineID);
efree(*session);
*session = NULL;
}
}
/* }}} */
static void php_snmp_session_destructor(zend_resource *rsrc) /* {{{ */
{
php_snmp_session *session = (php_snmp_session *)rsrc->ptr;
netsnmp_session_free(&session);
}
/* }}} */
static void php_snmp_object_free_storage(zend_object *object) /* {{{ */
{
php_snmp_object *intern = php_snmp_fetch_object(object);
if (!intern) {
return;
}
netsnmp_session_free(&(intern->session));
zend_object_std_dtor(&intern->zo);
}
/* }}} */
static zend_object *php_snmp_object_new(zend_class_entry *class_type) /* {{{ */
{
php_snmp_object *intern;
/* Allocate memory for it */
intern = ecalloc(1, sizeof(php_snmp_object) + sizeof(zval) * (class_type->default_properties_count - 1));
zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &php_snmp_object_handlers;
return &intern->zo;
}
/* }}} */
/* {{{ php_snmp_error
*
* Record last SNMP-related error in object
*
*/
static void php_snmp_error(zval *object, const char *docref, int type, const char *format, ...)
{
va_list args;
php_snmp_object *snmp_object = NULL;
if (object) {
snmp_object = Z_SNMP_P(object);
if (type == PHP_SNMP_ERRNO_NOERROR) {
memset(snmp_object->snmp_errstr, 0, sizeof(snmp_object->snmp_errstr));
} else {
va_start(args, format);
vsnprintf(snmp_object->snmp_errstr, sizeof(snmp_object->snmp_errstr) - 1, format, args);
va_end(args);
}
snmp_object->snmp_errno = type;
}
if (type == PHP_SNMP_ERRNO_NOERROR) {
return;
}
if (object && (snmp_object->exceptions_enabled & type)) {
zend_throw_exception_ex(php_snmp_exception_ce, type, snmp_object->snmp_errstr);
} else {
va_start(args, format);
php_verror(docref, "", E_WARNING, format, args);
va_end(args);
}
}
/* }}} */
/* {{{ php_snmp_getvalue
*
* SNMP value to zval converter
*
*/
static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval, int valueretrieval)
{
zval val;
char sbuf[512];
char *buf = &(sbuf[0]);
char *dbuf = (char *)NULL;
int buflen = sizeof(sbuf) - 1;
int val_len = vars->val_len;
/* use emalloc() for large values, use static array otherwize */
/* There is no way to know the size of buffer snprint_value() needs in order to print a value there.
* So we are forced to probe it
*/
while ((valueretrieval & SNMP_VALUE_PLAIN) == 0) {
*buf = '\0';
if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) {
if (val_len > 512*1024) {
php_error_docref(NULL, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?");
break;
}
/* buffer is not long enough to hold full output, double it */
val_len *= 2;
} else {
break;
}
if (buf == dbuf) {
dbuf = (char *)erealloc(dbuf, val_len + 1);
} else {
dbuf = (char *)emalloc(val_len + 1);
}
if (!dbuf) {
php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
buf = &(sbuf[0]);
buflen = sizeof(sbuf) - 1;
break;
}
buf = dbuf;
buflen = val_len;
}
if((valueretrieval & SNMP_VALUE_PLAIN) && val_len > buflen){
if ((dbuf = (char *)emalloc(val_len + 1))) {
buf = dbuf;
buflen = val_len;
} else {
php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
}
}
if (valueretrieval & SNMP_VALUE_PLAIN) {
*buf = 0;
switch (vars->type) {
case ASN_BIT_STR: /* 0x03, asn1.h */
ZVAL_STRINGL(&val, (char *)vars->val.bitstring, vars->val_len);
break;
case ASN_OCTET_STR: /* 0x04, asn1.h */
case ASN_OPAQUE: /* 0x44, snmp_impl.h */
ZVAL_STRINGL(&val, (char *)vars->val.string, vars->val_len);
break;
case ASN_NULL: /* 0x05, asn1.h */
ZVAL_NULL(&val);
break;
case ASN_OBJECT_ID: /* 0x06, asn1.h */
snprint_objid(buf, buflen, vars->val.objid, vars->val_len / sizeof(oid));
ZVAL_STRING(&val, buf);
break;
case ASN_IPADDRESS: /* 0x40, snmp_impl.h */
snprintf(buf, buflen, "%d.%d.%d.%d",
(vars->val.string)[0], (vars->val.string)[1],
(vars->val.string)[2], (vars->val.string)[3]);
buf[buflen]=0;
ZVAL_STRING(&val, buf);
break;
case ASN_COUNTER: /* 0x41, snmp_impl.h */
case ASN_GAUGE: /* 0x42, snmp_impl.h */
/* ASN_UNSIGNED is the same as ASN_GAUGE */
case ASN_TIMETICKS: /* 0x43, snmp_impl.h */
case ASN_UINTEGER: /* 0x47, snmp_impl.h */
snprintf(buf, buflen, "%lu", *vars->val.integer);
buf[buflen]=0;
ZVAL_STRING(&val, buf);
break;
case ASN_INTEGER: /* 0x02, asn1.h */
snprintf(buf, buflen, "%ld", *vars->val.integer);
buf[buflen]=0;
ZVAL_STRING(&val, buf);
break;
#if defined(NETSNMP_WITH_OPAQUE_SPECIAL_TYPES) || defined(OPAQUE_SPECIAL_TYPES)
case ASN_OPAQUE_FLOAT: /* 0x78, asn1.h */
snprintf(buf, buflen, "%f", *vars->val.floatVal);
ZVAL_STRING(&val, buf);
break;
case ASN_OPAQUE_DOUBLE: /* 0x79, asn1.h */
snprintf(buf, buflen, "%Lf", *vars->val.doubleVal);
ZVAL_STRING(&val, buf);
break;
case ASN_OPAQUE_I64: /* 0x80, asn1.h */
printI64(buf, vars->val.counter64);
ZVAL_STRING(&val, buf);
break;
case ASN_OPAQUE_U64: /* 0x81, asn1.h */
#endif
case ASN_COUNTER64: /* 0x46, snmp_impl.h */
printU64(buf, vars->val.counter64);
ZVAL_STRING(&val, buf);
break;
default:
ZVAL_STRING(&val, "Unknown value type");
php_error_docref(NULL, E_WARNING, "Unknown value type: %u", vars->type);
break;
}
} else /* use Net-SNMP value translation */ {
/* we have desired string in buffer, just use it */
ZVAL_STRING(&val, buf);
}
if (valueretrieval & SNMP_VALUE_OBJECT) {
object_init(snmpval);
add_property_long(snmpval, "type", vars->type);
add_property_zval(snmpval, "value", &val);
} else {
ZVAL_COPY(snmpval, &val);
}
zval_ptr_dtor(&val);
if (dbuf){ /* malloc was used to store value */
efree(dbuf);
}
}
/* }}} */
/* {{{ php_snmp_internal
*
* SNMP object fetcher/setter for all SNMP versions
*
*/
static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
struct snmp_session *session,
struct objid_query *objid_query)
{
struct snmp_session *ss;
struct snmp_pdu *pdu=NULL, *response;
struct variable_list *vars;
oid root[MAX_NAME_LEN];
size_t rootlen = 0;
int status, count, found;
char buf[2048];
char buf2[2048];
int keepwalking=1;
char *err;
zval snmpval;
int snmp_errno;
/* we start with retval=FALSE. If any actual data is acquired, retval will be set to appropriate type */
RETVAL_FALSE;
/* reset errno and errstr */
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_NOERROR, "");
if (st & SNMP_CMD_WALK) { /* remember root OID */
memmove((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * sizeof(oid));
rootlen = objid_query->vars[0].name_length;
objid_query->offset = objid_query->count;
}
if ((ss = snmp_open(session)) == NULL) {
snmp_error(session, NULL, NULL, &err);
php_error_docref(NULL, E_WARNING, "Could not open snmp connection: %s", err);
free(err);
RETVAL_FALSE;
return;
}
if ((st & SNMP_CMD_SET) && objid_query->count > objid_query->step) {
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES, "Can not fit all OIDs for SET query into one packet, using multiple queries");
}
while (keepwalking) {
keepwalking = 0;
if (st & SNMP_CMD_WALK) {
if (session->version == SNMP_VERSION_1) {
pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
} else {
pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
pdu->non_repeaters = objid_query->non_repeaters;
pdu->max_repetitions = objid_query->max_repetitions;
}
snmp_add_null_var(pdu, objid_query->vars[0].name, objid_query->vars[0].name_length);
} else {
if (st & SNMP_CMD_GET) {
pdu = snmp_pdu_create(SNMP_MSG_GET);
} else if (st & SNMP_CMD_GETNEXT) {
pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
} else if (st & SNMP_CMD_SET) {
pdu = snmp_pdu_create(SNMP_MSG_SET);
} else {
snmp_close(ss);
php_error_docref(NULL, E_ERROR, "Unknown SNMP command (internals)");
RETVAL_FALSE;
return;
}
for (count = 0; objid_query->offset < objid_query->count && count < objid_query->step; objid_query->offset++, count++){
if (st & SNMP_CMD_SET) {
if ((snmp_errno = snmp_add_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value))) {
snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length);
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Could not add variable: OID='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value, snmp_api_errstring(snmp_errno));
snmp_free_pdu(pdu);
snmp_close(ss);
RETVAL_FALSE;
return;
}
} else {
snmp_add_null_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length);
}
}
if(pdu->variables == NULL){
snmp_free_pdu(pdu);
snmp_close(ss);
RETVAL_FALSE;
return;
}
}
retry:
status = snmp_synch_response(ss, pdu, &response);
if (status == STAT_SUCCESS) {
if (response->errstat == SNMP_ERR_NOERROR) {
if (st & SNMP_CMD_SET) {
if (objid_query->offset < objid_query->count) { /* we have unprocessed OIDs */
keepwalking = 1;
continue;
}
snmp_free_pdu(response);
snmp_close(ss);
RETVAL_TRUE;
return;
}
for (vars = response->variables; vars; vars = vars->next_variable) {
/* do not output errors as values */
if ( vars->type == SNMP_ENDOFMIBVIEW ||
vars->type == SNMP_NOSUCHOBJECT ||
vars->type == SNMP_NOSUCHINSTANCE ) {
if ((st & SNMP_CMD_WALK) && Z_TYPE_P(return_value) == IS_ARRAY) {
break;
}
snprint_objid(buf, sizeof(buf), vars->name, vars->name_length);
snprint_value(buf2, sizeof(buf2), vars->name, vars->name_length, vars);
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2);
continue;
}
if ((st & SNMP_CMD_WALK) &&
(vars->name_length < rootlen || memcmp(root, vars->name, rootlen * sizeof(oid)))) { /* not part of this subtree */
if (Z_TYPE_P(return_value) == IS_ARRAY) { /* some records are fetched already, shut down further lookup */
keepwalking = 0;
} else {
/* first fetched OID is out of subtree, fallback to GET query */
st |= SNMP_CMD_GET;
st ^= SNMP_CMD_WALK;
objid_query->offset = 0;
keepwalking = 1;
}
break;
}
ZVAL_NULL(&snmpval);
php_snmp_getvalue(vars, &snmpval, objid_query->valueretrieval);
if (objid_query->array_output) {
if (Z_TYPE_P(return_value) == IS_TRUE || Z_TYPE_P(return_value) == IS_FALSE) {
array_init(return_value);
}
if (st & SNMP_NUMERIC_KEYS) {
add_next_index_zval(return_value, &snmpval);
} else if (st & SNMP_ORIGINAL_NAMES_AS_KEYS && st & SNMP_CMD_GET) {
found = 0;
for (count = 0; count < objid_query->count; count++) {
if (objid_query->vars[count].name_length == vars->name_length && snmp_oid_compare(objid_query->vars[count].name, objid_query->vars[count].name_length, vars->name, vars->name_length) == 0) {
found = 1;
objid_query->vars[count].name_length = 0; /* mark this name as used */
break;
}
}
if (found) {
add_assoc_zval(return_value, objid_query->vars[count].oid, &snmpval);
} else {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
php_error_docref(NULL, E_WARNING, "Could not find original OID name for '%s'", buf2);
}
} else if (st & SNMP_USE_SUFFIX_AS_KEYS && st & SNMP_CMD_WALK) {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
if (rootlen <= vars->name_length && snmp_oid_compare(root, rootlen, vars->name, rootlen) == 0) {
buf2[0] = '\0';
count = rootlen;
while(count < vars->name_length){
sprintf(buf, "%lu.", vars->name[count]);
strcat(buf2, buf);
count++;
}
buf2[strlen(buf2) - 1] = '\0'; /* remove trailing '.' */
}
add_assoc_zval(return_value, buf2, &snmpval);
} else {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
add_assoc_zval(return_value, buf2, &snmpval);
}
} else {
ZVAL_COPY_VALUE(return_value, &snmpval);
break;
}
/* OID increase check */
if (st & SNMP_CMD_WALK) {
if (objid_query->oid_increasing_check == TRUE && snmp_oid_compare(objid_query->vars[0].name, objid_query->vars[0].name_length, vars->name, vars->name_length) >= 0) {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2);
keepwalking = 0;
} else {
memmove((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid));
objid_query->vars[0].name_length = vars->name_length;
keepwalking = 1;
}
}
}
if (objid_query->offset < objid_query->count) { /* we have unprocessed OIDs */
keepwalking = 1;
}
} else {
if (st & SNMP_CMD_WALK && response->errstat == SNMP_ERR_TOOBIG && objid_query->max_repetitions > 1) { /* Answer will not fit into single packet */
objid_query->max_repetitions /= 2;
snmp_free_pdu(response);
keepwalking = 1;
continue;
}
if (!(st & SNMP_CMD_WALK) || response->errstat != SNMP_ERR_NOSUCHNAME || Z_TYPE_P(return_value) == IS_TRUE || Z_TYPE_P(return_value) == IS_FALSE) {
for (count=1, vars = response->variables;
vars && count != response->errindex;
vars = vars->next_variable, count++);
if (st & (SNMP_CMD_GET | SNMP_CMD_GETNEXT) && response->errstat == SNMP_ERR_TOOBIG && objid_query->step > 1) { /* Answer will not fit into single packet */
objid_query->offset = ((objid_query->offset > objid_query->step) ? (objid_query->offset - objid_query->step) : 0 );
objid_query->step /= 2;
snmp_free_pdu(response);
keepwalking = 1;
continue;
}
if (vars) {
snprint_objid(buf, sizeof(buf), vars->name, vars->name_length);
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, snmp_errstring(response->errstat));
} else {
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at %u object_id: %s", response->errindex, snmp_errstring(response->errstat));
}
if (st & (SNMP_CMD_GET | SNMP_CMD_GETNEXT)) { /* cut out bogus OID and retry */
if ((pdu = snmp_fix_pdu(response, ((st & SNMP_CMD_GET) ? SNMP_MSG_GET : SNMP_MSG_GETNEXT) )) != NULL) {
snmp_free_pdu(response);
goto retry;
}
}
snmp_free_pdu(response);
snmp_close(ss);
if (objid_query->array_output) {
zval_ptr_dtor(return_value);
}
RETVAL_FALSE;
return;
}
}
} else if (status == STAT_TIMEOUT) {
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_TIMEOUT, "No response from %s", session->peername);
if (objid_query->array_output) {
zval_ptr_dtor(return_value);
}
snmp_close(ss);
RETVAL_FALSE;
return;
} else { /* status == STAT_ERROR */
snmp_error(ss, NULL, NULL, &err);
php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_GENERIC, "Fatal error: %s", err);
free(err);
if (objid_query->array_output) {
zval_ptr_dtor(return_value);
}
snmp_close(ss);
RETVAL_FALSE;
return;
}
if (response) {
snmp_free_pdu(response);
}
} /* keepwalking */
snmp_close(ss);
}
/* }}} */
/* {{{ php_snmp_parse_oid
*
* OID parser (and type, value for SNMP_SET command)
*/
static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value)
{
char *pptr;
HashPosition pos_oid, pos_type, pos_value;
zval *tmp_oid, *tmp_type, *tmp_value;
if (Z_TYPE_P(oid) != IS_ARRAY) {
/*
if (Z_ISREF_PP(oid)) {
SEPARATE_ZVAL(oid);
}
*/
convert_to_string_ex(oid);
} else if (Z_TYPE_P(oid) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(oid), &pos_oid);
}
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) != IS_ARRAY) {
/*
if (Z_ISREF_PP(type)) {
SEPARATE_ZVAL(type);
}
*/
convert_to_string_ex(type);
} else if (Z_TYPE_P(type) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(type), &pos_type);
}
if (Z_TYPE_P(value) != IS_ARRAY) {
/*
if (Z_ISREF_PP(value)) {
SEPARATE_ZVAL(value);
}
*/
convert_to_string_ex(value);
} else if (Z_TYPE_P(value) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(value), &pos_value);
}
}
objid_query->count = 0;
objid_query->array_output = ((st & SNMP_CMD_WALK) ? TRUE : FALSE);
if (Z_TYPE_P(oid) == IS_STRING) {
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg));
if (objid_query->vars == NULL) {
php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid: %s", strerror(errno));
efree(objid_query->vars);
return FALSE;
}
objid_query->vars[objid_query->count].oid = Z_STRVAL_P(oid);
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) == IS_STRING && Z_TYPE_P(value) == IS_STRING) {
if (Z_STRLEN_P(type) != 1) {
php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %u", Z_STRVAL_P(type), Z_STRLEN_P(type));
efree(objid_query->vars);
return FALSE;
}
pptr = Z_STRVAL_P(type);
objid_query->vars[objid_query->count].type = *pptr;
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
} else {
php_error_docref(NULL, E_WARNING, "Single objid and multiple type or values are not supported");
efree(objid_query->vars);
return FALSE;
}
}
objid_query->count++;
} else if (Z_TYPE_P(oid) == IS_ARRAY) { /* we got objid array */
if (zend_hash_num_elements(Z_ARRVAL_P(oid)) == 0) {
php_error_docref(NULL, E_WARNING, "Got empty OID array");
return FALSE;
}
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg) * zend_hash_num_elements(Z_ARRVAL_P(oid)));
if (objid_query->vars == NULL) {
php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno));
efree(objid_query->vars);
return FALSE;
}
objid_query->array_output = ( (st & SNMP_CMD_SET) ? FALSE : TRUE );
for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(oid), &pos_oid);
(tmp_oid = zend_hash_get_current_data_ex(Z_ARRVAL_P(oid), &pos_oid)) != NULL;
zend_hash_move_forward_ex(Z_ARRVAL_P(oid), &pos_oid) ) {
convert_to_string_ex(tmp_oid);
objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid);
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) == IS_STRING) {
pptr = Z_STRVAL_P(type);
objid_query->vars[objid_query->count].type = *pptr;
} else if (Z_TYPE_P(type) == IS_ARRAY) {
if ((tmp_type = zend_hash_get_current_data_ex(Z_ARRVAL_P(type), &pos_type)) != NULL) {
convert_to_string_ex(tmp_type);
if (Z_STRLEN_P(tmp_type) != 1) {
php_error_docref(NULL, E_WARNING, "'%s': bogus type '%s', should be single char, got %u", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type));
efree(objid_query->vars);
return FALSE;
}
pptr = Z_STRVAL_P(tmp_type);
objid_query->vars[objid_query->count].type = *pptr;
zend_hash_move_forward_ex(Z_ARRVAL_P(type), &pos_type);
} else {
php_error_docref(NULL, E_WARNING, "'%s': no type set", Z_STRVAL_P(tmp_oid));
efree(objid_query->vars);
return FALSE;
}
}
if (Z_TYPE_P(value) == IS_STRING) {
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
} else if (Z_TYPE_P(value) == IS_ARRAY) {
if ((tmp_value = zend_hash_get_current_data_ex(Z_ARRVAL_P(value), &pos_value)) != NULL) {
convert_to_string_ex(tmp_value);
objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value);
zend_hash_move_forward_ex(Z_ARRVAL_P(value), &pos_value);
} else {
php_error_docref(NULL, E_WARNING, "'%s': no value set", Z_STRVAL_P(tmp_oid));
efree(objid_query->vars);
return FALSE;
}
}
}
objid_query->count++;
}
}
/* now parse all OIDs */
if (st & SNMP_CMD_WALK) {
if (objid_query->count > 1) {
php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Multi OID walks are not supported!");
efree(objid_query->vars);
return FALSE;
}
objid_query->vars[0].name_length = MAX_NAME_LEN;
if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error */
if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].name_length))) {
php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid);
efree(objid_query->vars);
return FALSE;
}
} else {
memmove((char *)objid_query->vars[0].name, (char *)objid_mib, sizeof(objid_mib));
objid_query->vars[0].name_length = sizeof(objid_mib) / sizeof(oid);
}
} else {
for (objid_query->offset = 0; objid_query->offset < objid_query->count; objid_query->offset++) {
objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN;
if (!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset].name, &(objid_query->vars[objid_query->offset].name_length))) {
php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset].oid);
efree(objid_query->vars);
return FALSE;
}
}
}
objid_query->offset = 0;
objid_query->step = objid_query->count;
return (objid_query->count > 0);
}
/* }}} */
/* {{{ netsnmp_session_init
allocates memory for session and session->peername, caller should free it manually using netsnmp_session_free() and efree()
*/
static int netsnmp_session_init(php_snmp_session **session_p, int version, char *hostname, char *community, int timeout, int retries)
{
php_snmp_session *session;
char *pptr, *host_ptr;
int force_ipv6 = FALSE;
int n;
struct sockaddr **psal;
struct sockaddr **res;
*session_p = (php_snmp_session *)emalloc(sizeof(php_snmp_session));
session = *session_p;
if (session == NULL) {
php_error_docref(NULL, E_WARNING, "emalloc() failed allocating session");
return (-1);
}
memset(session, 0, sizeof(php_snmp_session));
snmp_sess_init(session);
session->version = version;
session->remote_port = SNMP_PORT;
session->peername = emalloc(MAX_NAME_LEN);
if (session->peername == NULL) {
php_error_docref(NULL, E_WARNING, "emalloc() failed while copying hostname");
return (-1);
}
/* we copy original hostname for further processing */
strlcpy(session->peername, hostname, MAX_NAME_LEN);
host_ptr = session->peername;
/* Reading the hostname and its optional non-default port number */
if (*host_ptr == '[') { /* IPv6 address */
force_ipv6 = TRUE;
host_ptr++;
if ((pptr = strchr(host_ptr, ']'))) {
if (pptr[1] == ':') {
session->remote_port = atoi(pptr + 2);
}
*pptr = '\0';
} else {
php_error_docref(NULL, E_WARNING, "malformed IPv6 address, closing square bracket missing");
return (-1);
}
} else { /* IPv4 address */
if ((pptr = strchr(host_ptr, ':'))) {
session->remote_port = atoi(pptr + 1);
*pptr = '\0';
}
}
/* since Net-SNMP library requires 'udp6:' prefix for all IPv6 addresses (in FQDN form too) we need to
perform possible name resolution before running any SNMP queries */
if ((n = php_network_getaddresses(host_ptr, SOCK_DGRAM, &psal, NULL)) == 0) { /* some resolver error */
/* warnings sent, bailing out */
return (-1);
}
/* we have everything we need in psal, flush peername and fill it properly */
*(session->peername) = '\0';
res = psal;
while (n-- > 0) {
pptr = session->peername;
#if HAVE_GETADDRINFO && HAVE_IPV6 && HAVE_INET_NTOP
if (force_ipv6 && (*res)->sa_family != AF_INET6) {
res++;
continue;
}
if ((*res)->sa_family == AF_INET6) {
strcpy(session->peername, "udp6:[");
pptr = session->peername + strlen(session->peername);
inet_ntop((*res)->sa_family, &(((struct sockaddr_in6*)(*res))->sin6_addr), pptr, MAX_NAME_LEN);
strcat(pptr, "]");
} else if ((*res)->sa_family == AF_INET) {
inet_ntop((*res)->sa_family, &(((struct sockaddr_in*)(*res))->sin_addr), pptr, MAX_NAME_LEN);
} else {
res++;
continue;
}
#else
if ((*res)->sa_family != AF_INET) {
res++;
continue;
}
strcat(pptr, inet_ntoa(((struct sockaddr_in*)(*res))->sin_addr));
#endif
break;
}
if (strlen(session->peername) == 0) {
php_error_docref(NULL, E_WARNING, "Unknown failure while resolving '%s'", hostname);
return (-1);
}
/* XXX FIXME
There should be check for non-empty session->peername!
*/
/* put back non-standard SNMP port */
if (session->remote_port != SNMP_PORT) {
pptr = session->peername + strlen(session->peername);
sprintf(pptr, ":%d", session->remote_port);
}
php_network_freeaddresses(psal);
if (version == SNMP_VERSION_3) {
/* Setting the security name. */
session->securityName = estrdup(community);
session->securityNameLen = strlen(session->securityName);
} else {
session->authenticator = NULL;
session->community = (u_char *)estrdup(community);
session->community_len = strlen(community);
}
session->retries = retries;
session->timeout = timeout;
return (0);
}
/* }}} */
/* {{{ int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
Set the security level in the snmpv3 session */
static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
{
if (!strcasecmp(level, "noAuthNoPriv") || !strcasecmp(level, "nanp")) {
s->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
} else if (!strcasecmp(level, "authNoPriv") || !strcasecmp(level, "anp")) {
s->securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
} else if (!strcasecmp(level, "authPriv") || !strcasecmp(level, "ap")) {
s->securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
} else {
return (-1);
}
return (0);
}
/* }}} */
/* {{{ int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
Set the authentication protocol in the snmpv3 session */
static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
{
if (!strcasecmp(prot, "MD5")) {
s->securityAuthProto = usmHMACMD5AuthProtocol;
s->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
} else if (!strcasecmp(prot, "SHA")) {
s->securityAuthProto = usmHMACSHA1AuthProtocol;
s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
} else {
php_error_docref(NULL, E_WARNING, "Unknown authentication protocol '%s'", prot);
return (-1);
}
return (0);
}
/* }}} */
/* {{{ int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
Set the security protocol in the snmpv3 session */
static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
{
if (!strcasecmp(prot, "DES")) {
s->securityPrivProto = usmDESPrivProtocol;
s->securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
#ifdef HAVE_AES
} else if (!strcasecmp(prot, "AES128") || !strcasecmp(prot, "AES")) {
s->securityPrivProto = usmAESPrivProtocol;
s->securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
#endif
} else {
php_error_docref(NULL, E_WARNING, "Unknown security protocol '%s'", prot);
return (-1);
}
return (0);
}
/* }}} */
/* {{{ int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
Make key from pass phrase in the snmpv3 session */
static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
{
int snmp_errno;
s->securityAuthKeyLen = USM_AUTH_KU_LEN;
if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
(u_char *) pass, strlen(pass),
s->securityAuthKey, &(s->securityAuthKeyLen)))) {
php_error_docref(NULL, E_WARNING, "Error generating a key for authentication pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
return (-1);
}
return (0);
}
/* }}} */
/* {{{ int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass)
Make key from pass phrase in the snmpv3 session */
static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass)
{
int snmp_errno;
s->securityPrivKeyLen = USM_PRIV_KU_LEN;
if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
(u_char *)pass, strlen(pass),
s->securityPrivKey, &(s->securityPrivKeyLen)))) {
php_error_docref(NULL, E_WARNING, "Error generating a key for privacy pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
return (-2);
}
return (0);
}
/* }}} */
/* {{{ in netsnmp_session_set_contextEngineID(struct snmp_session *s, u_char * contextEngineID)
Set context Engine Id in the snmpv3 session */
static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * contextEngineID)
{
size_t ebuf_len = 32, eout_len = 0;
u_char *ebuf = (u_char *) emalloc(ebuf_len);
if (ebuf == NULL) {
php_error_docref(NULL, E_WARNING, "malloc failure setting contextEngineID");
return (-1);
}
if (!snmp_hex_to_binary(&ebuf, &ebuf_len, &eout_len, 1, contextEngineID)) {
php_error_docref(NULL, E_WARNING, "Bad engine ID value '%s'", contextEngineID);
efree(ebuf);
return (-1);
}
if (s->contextEngineID) {
efree(s->contextEngineID);
}
s->contextEngineID = ebuf;
s->contextEngineIDLen = eout_len;
return (0);
}
/* }}} */
/* {{{ php_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID)
Set all snmpv3-related security options */
static int netsnmp_session_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID)
{
/* Setting the security level. */
if (netsnmp_session_set_sec_level(session, sec_level)) {
php_error_docref(NULL, E_WARNING, "Invalid security level '%s'", sec_level);
return (-1);
}
if (session->securityLevel == SNMP_SEC_LEVEL_AUTHNOPRIV || session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
/* Setting the authentication protocol. */
if (netsnmp_session_set_auth_protocol(session, auth_protocol)) {
/* Warning message sent already, just bail out */
return (-1);
}
/* Setting the authentication passphrase. */
if (netsnmp_session_gen_auth_key(session, auth_passphrase)) {
/* Warning message sent already, just bail out */
return (-1);
}
if (session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
/* Setting the security protocol. */
if (netsnmp_session_set_sec_protocol(session, priv_protocol)) {
/* Warning message sent already, just bail out */
return (-1);
}
/* Setting the security protocol passphrase. */
if (netsnmp_session_gen_sec_key(session, priv_passphrase)) {
/* Warning message sent already, just bail out */
return (-1);
}
}
}
/* Setting contextName if specified */
if (contextName) {
session->contextName = contextName;
session->contextNameLen = strlen(contextName);
}
/* Setting contextEngineIS if specified */
if (contextEngineID && strlen(contextEngineID) && netsnmp_session_set_contextEngineID(session, contextEngineID)) {
/* Warning message sent already, just bail out */
return (-1);
}
return (0);
}
/* }}} */
/* {{{ php_snmp
*
* Generic SNMP handler for all versions.
* This function makes use of the internal SNMP object fetcher.
* Used both in old (non-OO) and OO API
*
*/
static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
{
zval *oid, *value, *type;
char *a1, *a2, *a3, *a4, *a5, *a6, *a7;
size_t a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len;
zend_bool use_orignames = 0, suffix_keys = 0;
zend_long timeout = SNMP_DEFAULT_TIMEOUT;
zend_long retries = SNMP_DEFAULT_RETRIES;
int argc = ZEND_NUM_ARGS();
struct objid_query objid_query;
php_snmp_session *session;
int session_less_mode = (getThis() == NULL);
php_snmp_object *snmp_object;
php_snmp_object glob_snmp_object;
objid_query.max_repetitions = -1;
objid_query.non_repeaters = 0;
objid_query.valueretrieval = SNMP_G(valueretrieval);
objid_query.oid_increasing_check = TRUE;
if (session_less_mode) {
if (version == SNMP_VERSION_3) {
if (st & SNMP_CMD_SET) {
if (zend_parse_parameters(argc, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
} else {
/* SNMP_CMD_GET
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
if (zend_parse_parameters(argc, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
}
} else {
if (st & SNMP_CMD_SET) {
if (zend_parse_parameters(argc, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
} else {
/* SNMP_CMD_GET
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
if (zend_parse_parameters(argc, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
}
}
} else {
if (st & SNMP_CMD_SET) {
if (zend_parse_parameters(argc, "zzz", &oid, &type, &value) == FAILURE) {
RETURN_FALSE;
}
} else if (st & SNMP_CMD_WALK) {
if (zend_parse_parameters(argc, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) {
RETURN_FALSE;
}
if (suffix_keys) {
st |= SNMP_USE_SUFFIX_AS_KEYS;
}
} else if (st & SNMP_CMD_GET) {
if (zend_parse_parameters(argc, "z|b", &oid, &use_orignames) == FAILURE) {
RETURN_FALSE;
}
if (use_orignames) {
st |= SNMP_ORIGINAL_NAMES_AS_KEYS;
}
} else {
/* SNMP_CMD_GETNEXT
*/
if (zend_parse_parameters(argc, "z", &oid) == FAILURE) {
RETURN_FALSE;
}
}
}
if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value)) {
RETURN_FALSE;
}
if (session_less_mode) {
if (netsnmp_session_init(&session, version, a1, a2, timeout, retries)) {
efree(objid_query.vars);
netsnmp_session_free(&session);
RETURN_FALSE;
}
if (version == SNMP_VERSION_3 && netsnmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL)) {
efree(objid_query.vars);
netsnmp_session_free(&session);
/* Warning message sent already, just bail out */
RETURN_FALSE;
}
} else {
zval *object = getThis();
snmp_object = Z_SNMP_P(object);
session = snmp_object->session;
if (!session) {
php_error_docref(NULL, E_WARNING, "Invalid or uninitialized SNMP object");
efree(objid_query.vars);
RETURN_FALSE;
}
if (snmp_object->max_oids > 0) {
objid_query.step = snmp_object->max_oids;
if (objid_query.max_repetitions < 0) { /* unspecified in function call, use session-wise */
objid_query.max_repetitions = snmp_object->max_oids;
}
}
objid_query.oid_increasing_check = snmp_object->oid_increasing_check;
objid_query.valueretrieval = snmp_object->valueretrieval;
glob_snmp_object.enum_print = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM);
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM, snmp_object->enum_print);
glob_snmp_object.quick_print = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT);
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT, snmp_object->quick_print);
glob_snmp_object.oid_output_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, snmp_object->oid_output_format);
}
if (objid_query.max_repetitions < 0) {
objid_query.max_repetitions = 20; /* provide correct default value */
}
php_snmp_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, st, session, &objid_query);
efree(objid_query.vars);
if (session_less_mode) {
netsnmp_session_free(&session);
} else {
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM, glob_snmp_object.enum_print);
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT, glob_snmp_object.quick_print);
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, glob_snmp_object.oid_output_format);
}
}
/* }}} */
/* {{{ proto mixed snmpget(string host, string community, mixed object_id [, int timeout [, int retries]])
Fetch a SNMP object */
PHP_FUNCTION(snmpget)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, SNMP_VERSION_1);
}
/* }}} */
/* {{{ proto mixed snmpgetnext(string host, string community, mixed object_id [, int timeout [, int retries]])
Fetch a SNMP object */
PHP_FUNCTION(snmpgetnext)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, SNMP_VERSION_1);
}
/* }}} */
/* {{{ proto mixed snmpwalk(string host, string community, mixed object_id [, int timeout [, int retries]])
Return all objects under the specified object id */
PHP_FUNCTION(snmpwalk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, (SNMP_CMD_WALK | SNMP_NUMERIC_KEYS), SNMP_VERSION_1);
}
/* }}} */
/* {{{ proto mixed snmprealwalk(string host, string community, mixed object_id [, int timeout [, int retries]])
Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmprealwalk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_1);
}
/* }}} */
/* {{{ proto bool snmpset(string host, string community, mixed object_id, mixed type, mixed value [, int timeout [, int retries]])
Set the value of a SNMP object */
PHP_FUNCTION(snmpset)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET, SNMP_VERSION_1);
}
/* }}} */
/* {{{ proto bool snmp_get_quick_print(void)
Return the current status of quick_print */
PHP_FUNCTION(snmp_get_quick_print)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_BOOL(netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT));
}
/* }}} */
/* {{{ proto bool snmp_set_quick_print(int quick_print)
Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmp_set_quick_print)
{
zend_long a1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT, (int)a1);
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool snmp_set_enum_print(int enum_print)
Return all values that are enums with their enum value instead of the raw integer */
PHP_FUNCTION(snmp_set_enum_print)
{
zend_long a1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM, (int) a1);
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool snmp_set_oid_output_format(int oid_format)
Set the OID output format. */
PHP_FUNCTION(snmp_set_oid_output_format)
{
zend_long a1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
switch((int) a1) {
case NETSNMP_OID_OUTPUT_SUFFIX:
case NETSNMP_OID_OUTPUT_MODULE:
case NETSNMP_OID_OUTPUT_FULL:
case NETSNMP_OID_OUTPUT_NUMERIC:
case NETSNMP_OID_OUTPUT_UCD:
case NETSNMP_OID_OUTPUT_NONE:
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, a1);
RETURN_TRUE;
break;
default:
php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%d'", (int) a1);
RETURN_FALSE;
break;
}
}
/* }}} */
/* {{{ proto mixed snmp2_get(string host, string community, mixed object_id [, int timeout [, int retries]])
Fetch a SNMP object */
PHP_FUNCTION(snmp2_get)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, SNMP_VERSION_2c);
}
/* }}} */
/* {{{ proto mixed snmp2_getnext(string host, string community, mixed object_id [, int timeout [, int retries]])
Fetch a SNMP object */
PHP_FUNCTION(snmp2_getnext)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, SNMP_VERSION_2c);
}
/* }}} */
/* {{{ proto mixed snmp2_walk(string host, string community, mixed object_id [, int timeout [, int retries]])
Return all objects under the specified object id */
PHP_FUNCTION(snmp2_walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, (SNMP_CMD_WALK | SNMP_NUMERIC_KEYS), SNMP_VERSION_2c);
}
/* }}} */
/* {{{ proto mixed snmp2_real_walk(string host, string community, mixed object_id [, int timeout [, int retries]])
Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmp2_real_walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_2c);
}
/* }}} */
/* {{{ proto bool snmp2_set(string host, string community, mixed object_id, mixed type, mixed value [, int timeout [, int retries]])
Set the value of a SNMP object */
PHP_FUNCTION(snmp2_set)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET, SNMP_VERSION_2c);
}
/* }}} */
/* {{{ proto mixed snmp3_get(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, mixed object_id [, int timeout [, int retries]])
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_get)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, SNMP_VERSION_3);
}
/* }}} */
/* {{{ proto mixed snmp3_getnext(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, mixed object_id [, int timeout [, int retries]])
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_getnext)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, SNMP_VERSION_3);
}
/* }}} */
/* {{{ proto mixed snmp3_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, mixed object_id [, int timeout [, int retries]])
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, (SNMP_CMD_WALK | SNMP_NUMERIC_KEYS), SNMP_VERSION_3);
}
/* }}} */
/* {{{ proto mixed snmp3_real_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, mixed object_id [, int timeout [, int retries]])
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_real_walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_3);
}
/* }}} */
/* {{{ proto bool snmp3_set(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, mixed object_id, mixed type, mixed value [, int timeout [, int retries]])
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_set)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET, SNMP_VERSION_3);
}
/* }}} */
/* {{{ proto bool snmp_set_valueretrieval(int method)
Specify the method how the SNMP values will be returned */
PHP_FUNCTION(snmp_set_valueretrieval)
{
zend_long method;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) {
RETURN_FALSE;
}
if (method >= 0 && method <= (SNMP_VALUE_LIBRARY|SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT)) {
SNMP_G(valueretrieval) = method;
RETURN_TRUE;
} else {
php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method);
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto int snmp_get_valueretrieval()
Return the method how the SNMP values will be returned */
PHP_FUNCTION(snmp_get_valueretrieval)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_FALSE;
}
RETURN_LONG(SNMP_G(valueretrieval));
}
/* }}} */
/* {{{ proto bool snmp_read_mib(string filename)
Reads and parses a MIB file into the active MIB tree. */
PHP_FUNCTION(snmp_read_mib)
{
char *filename;
size_t filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
if (!read_mib(filename)) {
char *error = strerror(errno);
php_error_docref(NULL, E_WARNING, "Error while reading MIB file '%s': %s", filename, error);
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
/* {{{ proto SNMP SNMP::__construct(int version, string hostname, string community|securityName [, long timeout [, long retries]])
Creates a new SNMP session to specified host. */
PHP_METHOD(snmp, __construct)
{
php_snmp_object *snmp_object;
zval *object = getThis();
char *a1, *a2;
size_t a1_len, a2_len;
zend_long timeout = SNMP_DEFAULT_TIMEOUT;
zend_long retries = SNMP_DEFAULT_RETRIES;
zend_long version = SNMP_DEFAULT_VERSION;
int argc = ZEND_NUM_ARGS();
zend_error_handling error_handling;
snmp_object = Z_SNMP_P(object);
zend_replace_error_handling(EH_THROW, NULL, &error_handling);
if (zend_parse_parameters(argc, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) {
zend_restore_error_handling(&error_handling);
return;
}
zend_restore_error_handling(&error_handling);
switch(version) {
case SNMP_VERSION_1:
case SNMP_VERSION_2c:
case SNMP_VERSION_3:
break;
default:
zend_throw_exception(zend_exception_get_default(), "Unknown SNMP protocol version", 0);
return;
}
/* handle re-open of snmp session */
if (snmp_object->session) {
netsnmp_session_free(&(snmp_object->session));
}
if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries)) {
return;
}
snmp_object->max_oids = 0;
snmp_object->valueretrieval = SNMP_G(valueretrieval);
snmp_object->enum_print = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM);
snmp_object->oid_output_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
snmp_object->quick_print = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT);
snmp_object->oid_increasing_check = TRUE;
snmp_object->exceptions_enabled = 0;
}
/* }}} */
/* {{{ proto bool SNMP::close()
Close SNMP session */
PHP_METHOD(snmp, close)
{
php_snmp_object *snmp_object;
zval *object = getThis();
snmp_object = Z_SNMP_P(object);
if (zend_parse_parameters_none() == FAILURE) {
RETURN_FALSE;
}
netsnmp_session_free(&(snmp_object->session));
RETURN_TRUE;
}
/* }}} */
/* {{{ proto mixed SNMP::get(mixed object_id [, bool preserve_keys])
Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */
PHP_METHOD(snmp, get)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, (-1));
}
/* }}} */
/* {{{ proto mixed SNMP::getnext(mixed object_id)
Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */
PHP_METHOD(snmp, getnext)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, (-1));
}
/* }}} */
/* {{{ proto mixed SNMP::walk(mixed object_id [, bool $suffix_as_key = FALSE [, int $max_repetitions [, int $non_repeaters]])
Return all objects including their respective object id within the specified one as array of oid->value pairs */
PHP_METHOD(snmp, walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, (-1));
}
/* }}} */
/* {{{ proto bool SNMP::set(mixed object_id, mixed type, mixed value)
Set the value of a SNMP object */
PHP_METHOD(snmp, set)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET, (-1));
}
/* }}} */
/* {{{ proto bool SNMP::setSecurity(string sec_level, [ string auth_protocol, string auth_passphrase [, string priv_protocol, string priv_passphrase [, string contextName [, string contextEngineID]]]])
Set SNMPv3 security-related session parameters */
PHP_METHOD(snmp, setSecurity)
{
php_snmp_object *snmp_object;
zval *object = getThis();
char *a1 = "", *a2 = "", *a3 = "", *a4 = "", *a5 = "", *a6 = "", *a7 = "";
size_t a1_len = 0, a2_len = 0, a3_len = 0, a4_len = 0, a5_len = 0, a6_len = 0, a7_len = 0;
int argc = ZEND_NUM_ARGS();
snmp_object = Z_SNMP_P(object);
if (zend_parse_parameters(argc, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len) == FAILURE) {
RETURN_FALSE;
}
if (netsnmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7)) {
/* Warning message sent already, just bail out */
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
/* {{{ proto long SNMP::getErrno()
Get last error code number */
PHP_METHOD(snmp, getErrno)
{
php_snmp_object *snmp_object;
zval *object = getThis();
snmp_object = Z_SNMP_P(object);
RETVAL_LONG(snmp_object->snmp_errno);
return;
}
/* }}} */
/* {{{ proto long SNMP::getError()
Get last error message */
PHP_METHOD(snmp, getError)
{
php_snmp_object *snmp_object;
zval *object = getThis();
snmp_object = Z_SNMP_P(object);
RETURN_STRING(snmp_object->snmp_errstr);
}
/* }}} */
/* {{{ */
void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, php_snmp_read_t read_func, php_snmp_write_t write_func)
{
php_snmp_prop_handler p;
p.name = (char*) name;
p.name_length = name_length;
p.read_func = (read_func) ? read_func : NULL;
p.write_func = (write_func) ? write_func : NULL;
zend_hash_str_add_mem(h, (char *)name, name_length, &p, sizeof(php_snmp_prop_handler));
}
/* }}} */
/* {{{ php_snmp_read_property(zval *object, zval *member, int type[, const zend_literal *key])
Generic object property reader */
zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
zval tmp_member;
zval *retval;
php_snmp_object *obj;
php_snmp_prop_handler *hnd;
int ret;
obj = Z_SNMP_P(object);
if (Z_TYPE_P(member) != IS_STRING) {
ZVAL_COPY(&tmp_member, member);
convert_to_string(&tmp_member);
member = &tmp_member;
}
hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member));
if (hnd && hnd->read_func) {
ret = hnd->read_func(obj, rv);
if (ret == SUCCESS) {
retval = rv;
} else {
retval = &EG(uninitialized_zval);
}
} else {
zend_object_handlers * std_hnd = zend_get_std_object_handlers();
retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
zval_ptr_dtor(member);
}
return retval;
}
/* }}} */
/* {{{ php_snmp_write_property(zval *object, zval *member, zval *value[, const zend_literal *key])
Generic object property writer */
void php_snmp_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
zval tmp_member;
php_snmp_object *obj;
php_snmp_prop_handler *hnd;
if (Z_TYPE_P(member) != IS_STRING) {
ZVAL_COPY(&tmp_member, member);
convert_to_string(&tmp_member);
member = &tmp_member;
}
obj = Z_SNMP_P(object);
hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member));
if (hnd && hnd->write_func) {
hnd->write_func(obj, value);
/*
if (!PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) {
Z_ADDREF_P(value);
zval_ptr_dtor(&value);
}
*/
} else {
zend_object_handlers * std_hnd = zend_get_std_object_handlers();
std_hnd->write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
zval_ptr_dtor(member);
}
}
/* }}} */
/* {{{ php_snmp_has_property(zval *object, zval *member, int has_set_exists[, const zend_literal *key])
Generic object property checker */
static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot)
{
zval rv;
php_snmp_prop_handler *hnd;
int ret = 0;
if ((hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member))) != NULL) {
switch (has_set_exists) {
case 2:
ret = 1;
break;
case 0: {
zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
ret = Z_TYPE_P(value) != IS_NULL? 1 : 0;
zval_ptr_dtor(value);
}
break;
}
default: {
zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
convert_to_boolean(value);
ret = Z_TYPE_P(value) == IS_TRUE? 1:0;
}
break;
}
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
ret = std_hnd->has_property(object, member, has_set_exists, cache_slot);
}
return ret;
}
/* }}} */
/* {{{ php_snmp_get_properties(zval *object)
Returns all object properties. Injects SNMP properties into object on first call */
static HashTable *php_snmp_get_properties(zval *object)
{
php_snmp_object *obj;
php_snmp_prop_handler *hnd;
HashTable *props;
zval rv;
zend_string *key;
zend_ulong num_key;
obj = Z_SNMP_P(object);
props = zend_std_get_properties(object);
ZEND_HASH_FOREACH_KEY_PTR(&php_snmp_properties, num_key, key, hnd) {
if (!hnd->read_func || hnd->read_func(obj, &rv) != SUCCESS) {
ZVAL_NULL(&rv);
}
zend_hash_update(props, key, &rv);
} ZEND_HASH_FOREACH_END();
return obj->zo.properties;
}
/* }}} */
/* {{{ */
static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval)
{
zval val;
array_init(retval);
if (snmp_object->session == NULL) {
return SUCCESS;
}
ZVAL_STRINGL(&val, snmp_object->session->peername, strlen(snmp_object->session->peername));
add_assoc_zval(retval, "hostname", &val);
ZVAL_LONG(&val, snmp_object->session->remote_port);
add_assoc_zval(retval, "port", &val);
ZVAL_LONG(&val, snmp_object->session->timeout);
add_assoc_zval(retval, "timeout", &val);
ZVAL_LONG(&val, snmp_object->session->retries);
add_assoc_zval(retval, "retries", &val);
return SUCCESS;
}
/* }}} */
/* {{{ */
static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval)
{
if (snmp_object->max_oids > 0) {
ZVAL_LONG(retval, snmp_object->max_oids);
} else {
ZVAL_NULL(retval);
}
return SUCCESS;
}
/* }}} */
#define PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(name) \
static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \
{ \
ZVAL_BOOL(retval, snmp_object->name); \
return SUCCESS; \
}
PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(oid_increasing_check)
PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(quick_print)
PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(enum_print)
#define PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(name) \
static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \
{ \
ZVAL_LONG(retval, snmp_object->name); \
return SUCCESS; \
}
PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(valueretrieval)
PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(oid_output_format)
PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(exceptions_enabled)
/* {{{ */
static int php_snmp_write_info(php_snmp_object *snmp_object, zval *newval)
{
php_error_docref(NULL, E_WARNING, "info property is read-only");
return FAILURE;
}
/* }}} */
/* {{{ */
static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
if (Z_TYPE_P(newval) == IS_NULL) {
snmp_object->max_oids = 0;
return ret;
}
if (Z_TYPE_P(newval) != IS_LONG) {
ztmp = *newval;
zval_copy_ctor(&ztmp);
convert_to_long(&ztmp);
newval = &ztmp;
}
if (Z_LVAL_P(newval) > 0) {
snmp_object->max_oids = Z_LVAL_P(newval);
} else {
php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval));
}
if (newval == &ztmp) {
zval_dtor(newval);
}
return ret;
}
/* }}} */
/* {{{ */
static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
if (Z_TYPE_P(newval) != IS_LONG) {
ztmp = *newval;
zval_copy_ctor(&ztmp);
convert_to_long(&ztmp);
newval = &ztmp;
}
if (Z_LVAL_P(newval) >= 0 && Z_LVAL_P(newval) <= (SNMP_VALUE_LIBRARY|SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT)) {
snmp_object->valueretrieval = Z_LVAL_P(newval);
} else {
php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval));
ret = FAILURE;
}
if (newval == &ztmp) {
zval_dtor(newval);
}
return ret;
}
/* }}} */
#define PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(name) \
static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval) \
{ \
zval ztmp; \
ZVAL_COPY(&ztmp, newval); \
convert_to_boolean(&ztmp); \
newval = &ztmp; \
\
snmp_object->name = Z_TYPE_P(newval) == IS_TRUE? 1 : 0; \
\
return SUCCESS; \
}
PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(quick_print)
PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(enum_print)
PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(oid_increasing_check)
/* {{{ */
static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
if (Z_TYPE_P(newval) != IS_LONG) {
ZVAL_COPY(&ztmp, newval);
convert_to_long(&ztmp);
newval = &ztmp;
}
switch(Z_LVAL_P(newval)) {
case NETSNMP_OID_OUTPUT_SUFFIX:
case NETSNMP_OID_OUTPUT_MODULE:
case NETSNMP_OID_OUTPUT_FULL:
case NETSNMP_OID_OUTPUT_NUMERIC:
case NETSNMP_OID_OUTPUT_UCD:
case NETSNMP_OID_OUTPUT_NONE:
snmp_object->oid_output_format = Z_LVAL_P(newval);
break;
default:
php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval));
ret = FAILURE;
break;
}
if (newval == &ztmp) {
zval_ptr_dtor(newval);
}
return ret;
}
/* }}} */
/* {{{ */
static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
if (Z_TYPE_P(newval) != IS_LONG) {
ZVAL_COPY(&ztmp, newval);
convert_to_long(&ztmp);
newval = &ztmp;
}
snmp_object->exceptions_enabled = Z_LVAL_P(newval);
if (newval == &ztmp) {
zval_ptr_dtor(newval);
}
return ret;
}
/* }}} */
static void free_php_snmp_properties(zval *el) /* {{{ */
{
pefree(Z_PTR_P(el), 1);
}
/* }}} */
/* {{{ php_snmp_class_methods[] */
static zend_function_entry php_snmp_class_methods[] = {
PHP_ME(snmp, __construct, arginfo_snmp_create, ZEND_ACC_PUBLIC)
PHP_ME(snmp, close, arginfo_snmp_void, ZEND_ACC_PUBLIC)
PHP_ME(snmp, setSecurity, arginfo_snmp_setSecurity, ZEND_ACC_PUBLIC)
PHP_ME(snmp, get, arginfo_snmp_get, ZEND_ACC_PUBLIC)
PHP_ME(snmp, getnext, arginfo_snmp_get, ZEND_ACC_PUBLIC)
PHP_ME(snmp, walk, arginfo_snmp_walk, ZEND_ACC_PUBLIC)
PHP_ME(snmp, set, arginfo_snmp_set, ZEND_ACC_PUBLIC)
PHP_ME(snmp, getErrno, arginfo_snmp_void, ZEND_ACC_PUBLIC)
PHP_ME(snmp, getError, arginfo_snmp_void, ZEND_ACC_PUBLIC)
PHP_FE_END
};
#define PHP_SNMP_PROPERTY_ENTRY_RECORD(name) \
{ "" #name "", sizeof("" #name "") - 1, php_snmp_read_##name, php_snmp_write_##name }
const php_snmp_prop_handler php_snmp_property_entries[] = {
PHP_SNMP_PROPERTY_ENTRY_RECORD(info),
PHP_SNMP_PROPERTY_ENTRY_RECORD(max_oids),
PHP_SNMP_PROPERTY_ENTRY_RECORD(valueretrieval),
PHP_SNMP_PROPERTY_ENTRY_RECORD(quick_print),
PHP_SNMP_PROPERTY_ENTRY_RECORD(enum_print),
PHP_SNMP_PROPERTY_ENTRY_RECORD(oid_output_format),
PHP_SNMP_PROPERTY_ENTRY_RECORD(oid_increasing_check),
PHP_SNMP_PROPERTY_ENTRY_RECORD(exceptions_enabled),
{ NULL, 0, NULL, NULL}
};
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(snmp)
{
netsnmp_log_handler *logh;
zend_class_entry ce, cex;
le_snmp_session = zend_register_list_destructors_ex(php_snmp_session_destructor, NULL, PHP_SNMP_SESSION_RES_NAME, module_number);
init_snmp("snmpapp");
#ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE
/* Prevent update of the snmpapp.conf file */
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);
#endif
/* Disable logging, use exit status'es and related variabled to detect errors */
shutdown_snmp_logging();
logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_NONE, LOG_ERR);
if (logh) {
logh->pri_max = LOG_ERR;
}
memcpy(&php_snmp_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_snmp_object_handlers.read_property = php_snmp_read_property;
php_snmp_object_handlers.write_property = php_snmp_write_property;
php_snmp_object_handlers.has_property = php_snmp_has_property;
php_snmp_object_handlers.get_properties = php_snmp_get_properties;
/* Register SNMP Class */
INIT_CLASS_ENTRY(ce, "SNMP", php_snmp_class_methods);
ce.create_object = php_snmp_object_new;
php_snmp_object_handlers.offset = XtOffsetOf(php_snmp_object, zo);
php_snmp_object_handlers.clone_obj = NULL;
php_snmp_object_handlers.free_obj = php_snmp_object_free_storage;
php_snmp_ce = zend_register_internal_class(&ce);
/* Register SNMP Class properties */
zend_hash_init(&php_snmp_properties, 0, NULL, free_php_snmp_properties, 1);
PHP_SNMP_ADD_PROPERTIES(&php_snmp_properties, php_snmp_property_entries);
REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_SUFFIX", NETSNMP_OID_OUTPUT_SUFFIX, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_MODULE", NETSNMP_OID_OUTPUT_MODULE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_FULL", NETSNMP_OID_OUTPUT_FULL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_NUMERIC", NETSNMP_OID_OUTPUT_NUMERIC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_UCD", NETSNMP_OID_OUTPUT_UCD, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_NONE", NETSNMP_OID_OUTPUT_NONE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_VALUE_LIBRARY", SNMP_VALUE_LIBRARY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_VALUE_PLAIN", SNMP_VALUE_PLAIN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_VALUE_OBJECT", SNMP_VALUE_OBJECT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_BIT_STR", ASN_BIT_STR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OCTET_STR", ASN_OCTET_STR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OPAQUE", ASN_OPAQUE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_NULL", ASN_NULL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_OBJECT_ID", ASN_OBJECT_ID, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_IPADDRESS", ASN_IPADDRESS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_COUNTER", ASN_GAUGE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_UNSIGNED", ASN_UNSIGNED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_TIMETICKS", ASN_TIMETICKS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_UINTEGER", ASN_UINTEGER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_INTEGER", ASN_INTEGER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SNMP_COUNTER64", ASN_COUNTER64, CONST_CS | CONST_PERSISTENT);
REGISTER_SNMP_CLASS_CONST_LONG("VERSION_1", SNMP_VERSION_1);
REGISTER_SNMP_CLASS_CONST_LONG("VERSION_2c", SNMP_VERSION_2c);
REGISTER_SNMP_CLASS_CONST_LONG("VERSION_2C", SNMP_VERSION_2c);
REGISTER_SNMP_CLASS_CONST_LONG("VERSION_3", SNMP_VERSION_3);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_NOERROR", PHP_SNMP_ERRNO_NOERROR);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_ANY", PHP_SNMP_ERRNO_ANY);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_GENERIC", PHP_SNMP_ERRNO_GENERIC);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_TIMEOUT", PHP_SNMP_ERRNO_TIMEOUT);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_ERROR_IN_REPLY", PHP_SNMP_ERRNO_ERROR_IN_REPLY);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_OID_NOT_INCREASING", PHP_SNMP_ERRNO_OID_NOT_INCREASING);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_OID_PARSING_ERROR", PHP_SNMP_ERRNO_OID_PARSING_ERROR);
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_MULTIPLE_SET_QUERIES", PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES);
/* Register SNMPException class */
INIT_CLASS_ENTRY(cex, "SNMPException", NULL);
#ifdef HAVE_SPL
php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
#else
php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default());
#endif
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(snmp)
{
snmp_shutdown("snmpapp");
zend_hash_destroy(&php_snmp_properties);
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(snmp)
{
php_info_print_table_start();
php_info_print_table_row(2, "NET-SNMP Support", "enabled");
php_info_print_table_row(2, "NET-SNMP Version", netsnmp_get_version());
php_info_print_table_row(2, "PHP SNMP Version", PHP_SNMP_VERSION);
php_info_print_table_end();
}
/* }}} */
/* {{{ snmp_module_deps[]
*/
#if ZEND_MODULE_API_NO >= 20050922
static const zend_module_dep snmp_module_deps[] = {
#ifdef HAVE_SPL
ZEND_MOD_REQUIRED("spl")
#endif
ZEND_MOD_END
};
#endif
/* }}} */
/* {{{ snmp_module_entry
*/
zend_module_entry snmp_module_entry = {
#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX,
NULL,
snmp_module_deps,
#else
STANDARD_MODULE_HEADER,
#endif
"snmp",
snmp_functions,
PHP_MINIT(snmp),
PHP_MSHUTDOWN(snmp),
NULL,
NULL,
PHP_MINFO(snmp),
PHP_SNMP_VERSION,
PHP_MODULE_GLOBALS(snmp),
PHP_GINIT(snmp),
NULL,
NULL,
STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
|
162659.c | /**
*******************************************************************************
* @file CubeMon.cpp
* @author Jean
* @brief prepare data for STM32CubeMonitor
* @version
*******************************************************************************
* Modified :
* Created : 9 juil. 2020
*******************************************************************************
* @note
*******************************************************************************
*/
#include "main.h"
#undef NR_VAR_GLO_
#include "CubeMon.h"
/*
* @brief Prepare or collect global data for/from STM32CubeMonitoer
* @param read(0) from STM32CubeMon /write(1) to STM32CubeMon
* @retval none
*/
void yCopy2CubeMonitor(uint8_t rw){
if (rw == 1) { //write data to Node-RED
// ymx_VRx_Raw = (uint32_t) adcbuf[0];
// ymx_VRy_Raw = (uint32_t) adcbuf[1];
ymx_VRx_PV = VRx.PV;
ymx_VRx_Raw = VRx.Raw;
ymx_VRx_Ri = VRx.Ri;
ymx_VRx_Ro = VRx.Ro;
ymx_VRx_trim = VRx.Trim;
ymx_VRy_PV = VRy.PV;
ymx_VRy_Raw = VRy.Raw;
ymx_VRy_Ri = VRy.Ri;
ymx_VRy_Ro = VRy.Ro;
ymx_VRy_trim = VRy.Trim;
//ymx_VRy_HystP = VRy.PVmemo + VRy.Hysteresis;
//ymx_VRy_HystM = VRy.PVmemo - VRy.Hysteresis;
//ymx_MotD = Moteur_D; //!!! ne fonctionne qu'avec des var glo
} else { //read data from Node-red
//VRy.m_Ri = ymx_VRy_Ri;
//VRx.Coef_Filtre = ymx_Coef;
//VRx.UnMoinsCoef = 1.0 - ymx_Coef;
//VRy.Coef_Filtre = ymx_Coef;
//VRy.UnMoinsCoef = 1.0 - ymx_Coef;
}
}
/* That's all folks */
|
481599.c | /**
******************************************************************************
* File Name : main.c
* Description : Main program body
******************************************************************************
*
* COPYRIGHT(c) 2016 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
extern void MW_TIM1Hadler(void);
extern void MW_TIM2Hadler(void);
void MW_wait(uint32_t wait);
void GPIOInit(void);
int main(void){
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/*Initialize printf*/
flush();
GPIOInit();
/* Initialize all configured peripherals */
MW_USARTInit(USART2ID);
xdev_out(MW_USART2Transmit);
//MW_SetI2CClockSpeed(40000);
// MW_I2CInit(I2C1ID);
uint8_t decoy[4] = {19,98,5,6};
MW_SetTIMPrescaler(TIM1ID,10000);
MW_SetTIMPeriod(TIM1ID,1800);
MW_SetTIMClockDivision(TIM1ID,TIM_CLOCKDIVISION_DIV4);
MW_TIMInit(TIM1ID);
MW_EnableTIMHandle(TIM1ID);
MW_TIMStart(TIM1ID);
MW_SetIWDGPrescaler(IWDG_PRESCALER_16);
MW_SetIWDGReload(4095);
MW_IWDGInit();
while (1) {
if(MW_GPIORead(GPIOCID,GPIO_PIN_13))
{
MW_IWDGClr();//ウォッチドッグのカウンターを再セット
}
else
MW_GPIOWrite(GPIOAID,GPIO_PIN_5,1);//nucleoのLED点灯
}
}
void MW_TIM1Hadler(void)
{
// MW_GPIOToggle(GPIOAID,GPIO_PIN_5);
}
void MW_TIM2Hadler(void)
{
}
void MW_wait(uint32_t wait)
{
uint32_t i,i2;
for(i2=0;i2<wait;i2++)
{
for(i=0;i<1000;i++)
{
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
}
}
}
/** System Clock Configuration
*/
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInit;
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
// Error_Handler();
}
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
{
// Error_Handler();
}
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
// Error_Handler();
}
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
/* SysTick_IRQn interrupt configuration */
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
void GPIOInit(void)
{
ENABLECLKGPIOA();
ENABLECLKGPIOB();
ENABLECLKGPIOC();
ENABLECLKGPIOD();
/*Configure GPIO pin : PC13 */
MW_SetGPIOPin(GPIO_PIN_13);
MW_SetGPIOMode(GPIO_MODE_INPUT);
MW_SetGPIOPull(GPIO_NOPULL);
MW_GPIOInit(GPIOCID);
/*Configure GPIO pin : PA5 */
MW_SetGPIOPin(GPIO_PIN_5);
MW_SetGPIOMode(GPIO_MODE_OUTPUT_PP);
MW_SetGPIOSpeed(GPIO_SPEED_FREQ_LOW);
MW_GPIOInit(GPIOAID);
/*Configure GPIO pin : PC4 */
MW_SetGPIOPin(GPIO_PIN_4);
MW_SetGPIOMode(GPIO_MODE_IT_RISING);
MW_SetGPIOPull(GPIO_NOPULL);
MW_GPIOInit(GPIOCID);
/*Configure GPIO pin Output Level */
MW_GPIOWrite(GPIOAID,GPIO_PIN_5,0);
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
620105.c | /******************************************************************************/
/* plugins.c -- Functions dealing with plugins
*
* Copyright 2012-2017 AOL Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this Software 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 "moloch.h"
#include <inttypes.h>
#include <errno.h>
#include "gmodule.h"
/******************************************************************************/
extern MolochConfig_t config;
uint32_t pluginsCbs = 0;
/******************************************************************************/
typedef struct moloch_plugin {
struct moloch_plugin *p_next, *p_prev;
char *name;
uint32_t p_hash;
short p_bucket;
short p_count;
int num;
MolochPluginIpFunc ipFunc;
MolochPluginUdpFunc udpFunc;
MolochPluginTcpFunc tcpFunc;
MolochPluginSaveFunc preSaveFunc;
MolochPluginSaveFunc saveFunc;
MolochPluginNewFunc newFunc;
MolochPluginExitFunc exitFunc;
MolochPluginReloadFunc reloadFunc;
MolochPluginOutstandingFunc outstandingFunc;
MolochPluginHttpFunc on_message_begin;
MolochPluginHttpDataFunc on_url;
MolochPluginHttpDataFunc on_header_field;
MolochPluginHttpDataFunc on_header_field_raw;
MolochPluginHttpDataFunc on_header_value;
MolochPluginHttpFunc on_headers_complete;
MolochPluginHttpDataFunc on_body;
MolochPluginHttpFunc on_message_complete;
MolochPluginSMTPHeaderFunc smtp_on_header;
MolochPluginSMTPFunc smtp_on_header_complete;
} MolochPlugin_t;
HASH_VAR(p_, plugins, MolochPlugin_t, 11);
/******************************************************************************/
void moloch_plugins_init()
{
HASH_INIT(p_, plugins, moloch_string_hash, moloch_string_cmp);
}
/******************************************************************************/
void moloch_plugins_load(char **plugins) {
if (!config.pluginsDir)
return;
if (!plugins)
return;
if (!g_module_supported ()) {
LOG("ERROR - glib compiled without module support");
return;
}
moloch_add_can_quit((MolochCanQuitFunc)moloch_plugins_outstanding, "plugin outstanding");
int i;
for (i = 0; plugins[i]; i++) {
const char *name = plugins[i];
int d;
GModule *plugin = 0;
gchar *path;
for (d = 0; config.pluginsDir[d]; d++) {
path = g_build_filename (config.pluginsDir[d], name, NULL);
if (!g_file_test(path, G_FILE_TEST_EXISTS)) {
g_free (path);
continue;
}
plugin = g_module_open (path, 0); /*G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);*/
if (!plugin) {
LOG("ERROR - Couldn't load plugin %s from '%s'\n%s", name, path, g_module_error());
g_free (path);
continue;
}
break;
}
if (!plugin) {
LOG("WARNING - plugin '%s' not found", name);
continue;
}
MolochPluginInitFunc plugin_init;
if (!g_module_symbol(plugin, "moloch_plugin_init", (gpointer *)(char*)&plugin_init) || plugin_init == NULL) {
LOG("ERROR - Module %s doesn't have a moloch_plugin_init", name);
continue;
}
plugin_init();
if (config.debug)
LOG("Loaded %s", path);
g_free (path);
}
}
/******************************************************************************/
int moloch_plugins_register_internal(const char * name,
gboolean storeData,
size_t sessionsize,
int apiversion)
{
MolochPlugin_t *plugin;
if (sizeof(MolochSession_t) != sessionsize) {
LOGEXIT("Plugin '%s' built with different version of moloch.h", name);
}
if (MOLOCH_API_VERSION != apiversion) {
LOGEXIT("Plugin '%s' built with different version of moloch.h", name);
}
HASH_FIND(p_, plugins, name, plugin);
if (plugin) {
LOGEXIT("Plugin %s is already registered", name);
}
plugin = MOLOCH_TYPE_ALLOC0(MolochPlugin_t);
plugin->name = strdup(name);
if (storeData) {
plugin->num = config.numPlugins++;
} else {
plugin->num = -1;
}
HASH_ADD(p_, plugins, name, plugin);
return plugin->num;
}
/******************************************************************************/
void moloch_plugins_set_cb(const char * name,
MolochPluginIpFunc ipFunc,
MolochPluginUdpFunc udpFunc,
MolochPluginTcpFunc tcpFunc,
MolochPluginSaveFunc preSaveFunc,
MolochPluginSaveFunc saveFunc,
MolochPluginNewFunc newFunc,
MolochPluginExitFunc exitFunc,
MolochPluginReloadFunc reloadFunc)
{
MolochPlugin_t *plugin;
HASH_FIND(p_, plugins, name, plugin);
if (!plugin) {
LOG("Can't find plugin with name %s", name);
return;
}
plugin->ipFunc = ipFunc;
if (ipFunc)
pluginsCbs |= MOLOCH_PLUGIN_IP;
plugin->udpFunc = udpFunc;
if (udpFunc)
pluginsCbs |= MOLOCH_PLUGIN_UDP;
plugin->tcpFunc = tcpFunc;
if (tcpFunc)
pluginsCbs |= MOLOCH_PLUGIN_TCP;
plugin->preSaveFunc = preSaveFunc;
if (preSaveFunc)
pluginsCbs |= MOLOCH_PLUGIN_PRE_SAVE;
plugin->saveFunc = saveFunc;
if (saveFunc)
pluginsCbs |= MOLOCH_PLUGIN_SAVE;
plugin->newFunc = newFunc;
if (newFunc)
pluginsCbs |= MOLOCH_PLUGIN_NEW;
plugin->exitFunc = exitFunc;
if (exitFunc)
pluginsCbs |= MOLOCH_PLUGIN_EXIT;
plugin->reloadFunc = reloadFunc;
if (reloadFunc)
pluginsCbs |= MOLOCH_PLUGIN_RELOAD;
}
/******************************************************************************/
void moloch_plugins_set_http_cb(const char * name,
MolochPluginHttpFunc on_message_begin,
MolochPluginHttpDataFunc on_url,
MolochPluginHttpDataFunc on_header_field,
MolochPluginHttpDataFunc on_header_value,
MolochPluginHttpFunc on_headers_complete,
MolochPluginHttpDataFunc on_body,
MolochPluginHttpFunc on_message_complete)
{
moloch_plugins_set_http_ext_cb(name,
on_message_begin,
on_url,
on_header_field,
NULL,
on_header_value,
on_headers_complete,
on_body,
on_message_complete);
}
/******************************************************************************/
void moloch_plugins_set_http_ext_cb(const char * name,
MolochPluginHttpFunc on_message_begin,
MolochPluginHttpDataFunc on_url,
MolochPluginHttpDataFunc on_header_field,
MolochPluginHttpDataFunc on_header_field_raw,
MolochPluginHttpDataFunc on_header_value,
MolochPluginHttpFunc on_headers_complete,
MolochPluginHttpDataFunc on_body,
MolochPluginHttpFunc on_message_complete)
{
MolochPlugin_t *plugin;
HASH_FIND(p_, plugins, name, plugin);
if (!plugin) {
LOG("Can't find plugin with name %s", name);
return;
}
plugin->on_message_begin = on_message_begin;
if (on_message_begin)
pluginsCbs |= MOLOCH_PLUGIN_HP_OMB;
plugin->on_url = on_url;
if (on_url)
pluginsCbs |= MOLOCH_PLUGIN_HP_OU;
plugin->on_header_field = on_header_field;
if (on_header_field)
pluginsCbs |= MOLOCH_PLUGIN_HP_OHF;
plugin->on_header_field_raw = on_header_field_raw;
if (on_header_field)
pluginsCbs |= MOLOCH_PLUGIN_HP_OHFR;
plugin->on_header_value = on_header_value;
if (on_header_value)
pluginsCbs |= MOLOCH_PLUGIN_HP_OHV;
plugin->on_headers_complete = on_headers_complete;
if (on_headers_complete)
pluginsCbs |= MOLOCH_PLUGIN_HP_OHC;
plugin->on_body = on_body;
if (on_body)
pluginsCbs |= MOLOCH_PLUGIN_HP_OB;
plugin->on_message_complete = on_message_complete;
if (on_message_complete)
pluginsCbs |= MOLOCH_PLUGIN_HP_OMC;
}
/******************************************************************************/
void moloch_plugins_set_smtp_cb(const char * name,
MolochPluginSMTPHeaderFunc on_header,
MolochPluginSMTPFunc on_header_complete)
{
MolochPlugin_t *plugin;
HASH_FIND(p_, plugins, name, plugin);
if (!plugin) {
LOG("Can't find plugin with name %s", name);
return;
}
plugin->smtp_on_header = on_header;
if (on_header)
pluginsCbs |= MOLOCH_PLUGIN_SMTP_OH;
plugin->smtp_on_header_complete = on_header_complete;
if (on_header_complete)
pluginsCbs |= MOLOCH_PLUGIN_SMTP_OHC;
}
/******************************************************************************/
void moloch_plugins_set_outstanding_cb(const char * name,
MolochPluginOutstandingFunc outstandingFunc)
{
MolochPlugin_t *plugin;
HASH_FIND(p_, plugins, name, plugin);
if (!plugin) {
LOG("Can't find plugin with name %s", name);
return;
}
plugin->outstandingFunc = outstandingFunc;
}
/******************************************************************************/
void moloch_plugins_cb_pre_save(MolochSession_t *session, int final)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->preSaveFunc)
plugin->preSaveFunc(session, final);
);
}
/******************************************************************************/
void moloch_plugins_cb_save(MolochSession_t *session, int final)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->saveFunc)
plugin->saveFunc(session, final);
);
}
/******************************************************************************/
void moloch_plugins_cb_new(MolochSession_t *session)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->newFunc)
plugin->newFunc(session);
);
}
/******************************************************************************/
void moloch_plugins_cb_tcp(MolochSession_t *session, const unsigned char *data, int len, int which)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->tcpFunc)
plugin->tcpFunc(session, data, len, which);
);
}
/******************************************************************************/
void moloch_plugins_cb_udp(MolochSession_t *session, const unsigned char *data, int len, int which)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->udpFunc)
plugin->udpFunc(session, data, len, which);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_omb(MolochSession_t *session, http_parser *parser)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_message_begin)
plugin->on_message_begin(session, parser);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_ou(MolochSession_t *session, http_parser *parser, const char *at, size_t length)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_url)
plugin->on_url(session, parser, at, length);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_ohf(MolochSession_t *session, http_parser *parser, const char *at, size_t length)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_header_field)
plugin->on_header_field(session, parser, at, length);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_ohfr(MolochSession_t *session, http_parser *parser, const char *at, size_t length)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_header_field_raw)
plugin->on_header_field_raw(session, parser, at, length);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_ohv(MolochSession_t *session, http_parser *parser, const char *at, size_t length)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_header_value)
plugin->on_header_value(session, parser, at, length);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_ohc(MolochSession_t *session, http_parser *parser)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_headers_complete)
plugin->on_headers_complete(session, parser);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_ob(MolochSession_t *session, http_parser *parser, const char *at, size_t length)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_body)
plugin->on_body(session, parser, at, length);
);
}
/******************************************************************************/
void moloch_plugins_cb_hp_omc(MolochSession_t *session, http_parser *parser)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->on_message_complete)
plugin->on_message_complete(session, parser);
);
}
/******************************************************************************/
void moloch_plugins_cb_smtp_oh(MolochSession_t *session, const char *field, size_t field_len, const char *value, size_t value_len)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->smtp_on_header)
plugin->smtp_on_header(session, field, field_len, value, value_len);
);
}
/******************************************************************************/
void moloch_plugins_cb_smtp_ohc(MolochSession_t *session)
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->smtp_on_header_complete)
plugin->smtp_on_header_complete(session);
);
}
/******************************************************************************/
void moloch_plugins_exit()
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->exitFunc)
plugin->exitFunc();
);
HASH_FORALL_POP_HEAD(p_, plugins, plugin,
free(plugin->name);
MOLOCH_TYPE_FREE(MolochPlugin_t, plugin);
);
}
/******************************************************************************/
void moloch_plugins_reload()
{
MolochPlugin_t *plugin;
HASH_FORALL(p_, plugins, plugin,
if (plugin->reloadFunc)
plugin->reloadFunc();
);
}
/******************************************************************************/
uint32_t moloch_plugins_outstanding()
{
MolochPlugin_t *plugin;
uint32_t outstanding = 0;
HASH_FORALL(p_, plugins, plugin,
if (plugin->outstandingFunc)
outstanding += plugin->outstandingFunc();
);
return outstanding;
}
|
108148.c | /*******************************************************************************
* (c) 2018, 2019 Zondax GmbH
*
* 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 <jsmn.h>
#include <zxmacros.h>
#include <common/parser_common.h>
#include "json_parser.h"
#define EQUALS(_P, _Q, _LEN) (MEMCMP( (const void*) PIC(_P), (const void*) PIC(_Q), (_LEN))==0)
parser_error_t json_parse(parsed_json_t *parsed_json, const char *buffer, uint16_t bufferLen) {
jsmn_parser parser;
jsmn_init(&parser);
MEMZERO(parsed_json, sizeof(parsed_json_t));
parsed_json->buffer = buffer;
parsed_json->bufferLen = bufferLen;
int32_t num_tokens = jsmn_parse(
&parser,
parsed_json->buffer,
parsed_json->bufferLen,
parsed_json->tokens,
MAX_NUMBER_OF_TOKENS);
if (num_tokens < 0) {
switch (num_tokens) {
case JSMN_ERROR_NOMEM:
return parser_json_too_many_tokens;
case JSMN_ERROR_INVAL:
return parser_unexpected_characters;
case JSMN_ERROR_PART:
return parser_json_incomplete_json;
default:
return parser_json_unexpected_error;
}
}
parsed_json->numberOfTokens = 0;
parsed_json->isValid = 0;
// Parsing error
if (num_tokens <= 0) {
return parser_json_zero_tokens;
}
// We cannot support if number of tokens exceeds the limit
if (num_tokens > MAX_NUMBER_OF_TOKENS) {
return parser_json_too_many_tokens;
}
parsed_json->numberOfTokens = num_tokens;
parsed_json->isValid = true;
return parser_ok;
}
parser_error_t array_get_element_count(const parsed_json_t *json,
uint16_t array_token_index,
uint16_t *number_elements) {
*number_elements = 0;
if (array_token_index < 0 || array_token_index > json->numberOfTokens) {
return parser_no_data;
}
jsmntok_t array_token = json->tokens[array_token_index];
uint16_t token_index = array_token_index;
uint16_t prev_element_end = array_token.start;
while (true) {
token_index++;
if (token_index >= json->numberOfTokens) {
break;
}
jsmntok_t current_token = json->tokens[token_index];
if (current_token.start > array_token.end) {
break;
}
if (current_token.start <= prev_element_end) {
continue;
}
prev_element_end = current_token.end;
(*number_elements)++;
}
return parser_ok;
}
parser_error_t array_get_nth_element(const parsed_json_t *json,
uint16_t array_token_index,
uint16_t element_index,
uint16_t *token_index) {
if (array_token_index < 0 || array_token_index > json->numberOfTokens) {
return parser_no_data;
}
jsmntok_t array_token = json->tokens[array_token_index];
*token_index = array_token_index;
uint16_t element_count = 0;
uint16_t prev_element_end = array_token.start;
while (true) {
(*token_index)++;
if (*token_index >= json->numberOfTokens) {
break;
}
jsmntok_t current_token = json->tokens[*token_index];
if (current_token.start > array_token.end) {
break;
}
if (current_token.start <= prev_element_end) {
continue;
}
prev_element_end = current_token.end;
if (element_count == element_index) {
return parser_ok;
}
element_count++;
}
return parser_no_data;
}
parser_error_t object_get_element_count(const parsed_json_t *json,
uint16_t object_token_index,
uint16_t *element_count) {
*element_count = 0;
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}
jsmntok_t object_token = json->tokens[object_token_index];
uint16_t token_index = object_token_index;
uint16_t prev_element_end = object_token.start;
token_index++;
while (true) {
if (token_index >= json->numberOfTokens) {
break;
}
jsmntok_t key_token = json->tokens[token_index++];
jsmntok_t value_token = json->tokens[token_index];
if (key_token.start > object_token.end) {
break;
}
if (key_token.start <= prev_element_end) {
continue;
}
prev_element_end = value_token.end;
(*element_count)++;
}
return parser_ok;
}
parser_error_t object_get_nth_key(const parsed_json_t *json,
uint16_t object_token_index,
uint16_t object_element_index,
uint16_t *token_index) {
*token_index = object_token_index;
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}
jsmntok_t object_token = json->tokens[object_token_index];
uint16_t element_count = 0;
uint16_t prev_element_end = object_token.start;
(*token_index)++;
while (true) {
if (*token_index >= json->numberOfTokens) {
break;
}
jsmntok_t key_token = json->tokens[(*token_index)++];
jsmntok_t value_token = json->tokens[*token_index];
if (key_token.start > object_token.end) {
break;
}
if (key_token.start <= prev_element_end) {
continue;
}
prev_element_end = value_token.end;
if (element_count == object_element_index) {
(*token_index)--;
return parser_ok;
}
element_count++;
}
return parser_no_data;
}
parser_error_t object_get_nth_value(const parsed_json_t *json,
uint16_t object_token_index,
uint16_t object_element_index,
uint16_t *key_index) {
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}
CHECK_PARSER_ERR(object_get_nth_key(json, object_token_index, object_element_index, key_index))
(*key_index)++;
return parser_ok;
}
parser_error_t object_get_value(const parsed_json_t *json,
uint16_t object_token_index,
const char *key_name,
uint16_t *token_index) {
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}
const jsmntok_t object_token = json->tokens[object_token_index];
*token_index = object_token_index;
int prev_element_end = object_token.start;
(*token_index)++;
while (*token_index < json->numberOfTokens) {
const jsmntok_t key_token = json->tokens[*token_index];
(*token_index)++;
const jsmntok_t value_token = json->tokens[*token_index];
if (key_token.start > object_token.end) {
break;
}
if (key_token.start <= prev_element_end) {
continue;
}
prev_element_end = value_token.end;
if (((uint16_t) strlen(key_name)) == (key_token.end - key_token.start)) {
if (EQUALS(key_name,
json->buffer + key_token.start,
key_token.end - key_token.start)) {
return parser_ok;
}
}
}
return parser_no_data;
}
|
607643.c | /*
* Copyright (C)2005-2017 Haxe Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "vm.h"
#include "neko_mod.h"
#include "objtable.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#ifdef NEKO_POSIX
# include <sys/types.h>
# include <sys/mman.h>
# define USE_MMAP
#endif
#define tmp_alloc(size) malloc(size)
#define tmp_free(ptr) free(ptr)
#ifdef NEKO_MAC
#define STACK_ALIGN
#endif
#if defined(NEKO_WINDOWS) && defined(_DEBUG_XX)
#define STACK_ALIGN
#define STACK_ALIGN_DEBUG
#endif
#define TAG_MASK ((1<<NEKO_TAG_BITS)-1)
#ifdef NEKO_JIT_ENABLE
#define PARAMETER_TABLE
#include "opcodes.h"
extern field id_add, id_radd, id_sub, id_rsub, id_mult, id_rmult, id_div, id_rdiv, id_mod, id_rmod;
extern field id_get, id_set;
extern int neko_stack_expand( int_val *sp, int_val *csp, neko_vm *vm );
extern value neko_append_int( neko_vm *vm, value str, int x, bool way );
extern value neko_append_strings( value s1, value s2 );
extern value neko_alloc_module_function( void *m, int_val pos, int nargs );
extern void neko_process_trap( neko_vm *vm );
extern void neko_setup_trap( neko_vm *vm );
extern value NEKO_TYPEOF[];
typedef union {
void *p;
unsigned char *b;
unsigned int *w;
char *c;
int *i;
} jit_buffer;
typedef struct _jlist {
int pos;
int target;
struct _jlist *next;
} jlist;
typedef struct {
jit_buffer buf;
void *baseptr;
neko_module *module;
int curpc;
int size;
int *pos;
int debug_wait;
jlist *jumps;
jlist *traps;
} jit_ctx;
enum Special {
VThis,
VEnv,
VModule,
VVm,
VSpMax,
VTrap,
};
#define MODE_CALLBACK 1
#define MODE_PC_CUR 0
#define MODE_PC_ARG 2
enum PushInfosMode {
CALLBACK,
PC_CUR,
PC_ARG
};
enum CallMode {
NORMAL,
THIS_CALL,
TAIL_CALL,
};
enum Operation {
OP_ADD,
OP_SUB,
OP_MUL,
OP_DIV,
OP_MOD,
OP_LAST,
OP_GET,
OP_SET
};
enum IOperation {
IOP_SHL,
IOP_SHR,
IOP_USHR,
IOP_AND,
IOP_OR,
IOP_XOR,
IOP_LAST
};
#define Eax 0
#define Ebx 3
#define Ecx 1
#define Edx 2
#define Esp 4
#define Ebp 5
#define Esi 6
#define Edi 7
#define ACC Eax
#define SP Edi
#define CSP Esi
#define VM Ebx
#define TMP Ecx
#define TMP2 Edx
#define B(bv) *buf.b++ = bv
#define W(wv) *buf.w++ = wv
#define Mult1 0
#define Mult2 1
#define Mult4 2
#define Mult8 3
#define JAlways 0
#define JLt 0x82
#define JGte 0x83
#define JEq 0x84
#define JNeq 0x85
#define JLte 0x86
#define JGt 0x87
#define JSignLt 0x8C
#define JSignGte 0x8D
#define JSignLte 0x8E
#define JSignGt 0x8F
#define JOverflow 0x80
#define JCarry 0x82
#define ERROR { tmp_free(ctx->pos); tmp_free(ctx->baseptr); failure("JIT error"); }
#define CONST(v) ((int)(int_val)(v))
#define PATCH_JUMP(local) if( local != NULL ) { \
int delta = (int)((int_val)buf.p - ((int_val)local + 1)); \
if( sizeof(*local) == sizeof(int) ) \
*local = delta - 3; \
else { \
if( delta > 127 || delta < -127 ) \
ERROR; \
*local = (char)delta; \
} \
} \
#define FIELD(n) ((n) * 4)
#define VMFIELD(f) ((int)(int_val)&((neko_vm*)0)->f)
#define FUNFIELD(f) ((int)(int_val)&((vfunction*)0)->f)
#define POS() ((int)((int_val)ctx->buf.p - (int_val)ctx->baseptr))
#define GET_PC() CONST(ctx->module->code + ctx->curpc)
#define INIT_BUFFER register jit_buffer buf = ctx->buf
#define END_BUFFER ctx->buf = buf
#define MOD_RM(mod,reg,rm) B((mod << 6) | (reg << 3) | rm)
#define SIB MOD_RM
#define IS_SBYTE(c) ( (c) >= -128 && (c) < 128 )
#define OP_RM(op,mod,reg,rm) { B(op); MOD_RM(mod,reg,rm); }
#define OP_ADDR(op,addr,reg,rm) { B(op); \
MOD_RM(((addr) == 0 && reg != Ebp)?0:(IS_SBYTE(addr)?1:2),rm,reg); \
if( reg == Esp ) B(0x24); \
if( (addr) == 0 && reg != Ebp ) {} \
else if IS_SBYTE(addr) B(addr); \
else W(addr); }
// OPCODES :
// _r : register
// _c : constant
// _b : 8-bit constant
// _a : [constant]
// _i : [reg]
// _p : [reg + constant:idx]
// _x : [reg + reg:idx * mult]
#define XRet() B(0xC3)
#define XMov_rr(dst,src) OP_RM(0x8B,3,dst,src)
#define XMov_rc(dst,cst) B(0xB8+(dst)); W(cst)
#define XMov_rp(dst,reg,idx) OP_ADDR(0x8B,idx,reg,dst)
#define XMov_ra(dst,addr) OP_RM(0x8B,0,dst,5); W(addr)
#define XMov_rx(dst,r,idx,mult) OP_RM(0x8B,0,dst,4); SIB(Mult##mult,idx,r)
#define XMov_pr(dst,idx,src) OP_ADDR(0x89,idx,dst,src)
#define XMov_pc(dst,idx,c) OP_ADDR(0xC7,idx,dst,0); W(c)
#define XMov_ar(addr,reg) B(0x3E); if( reg == Eax ) { B(0xA3); } else { OP_RM(0x89,0,reg,5); }; W(addr)
#define XMov_xr(r,idx,mult,src) OP_RM(0x89,0,src,4); SIB(Mult##mult,idx,r)
#define XCall_r(r) OP_RM(0xFF,3,2,r)
#define XCall_m_debug(v) { \
int *l; \
XMov_rr(TMP,Ebp); \
XSub_rr(TMP,Esp); \
XAnd_rc(TMP,15); \
XCmp_rc(TMP,0); \
XJump(JEq,l); \
XShr_rc(TMP,2); \
XPush_r(TMP); \
XPush_c(CONST(__LINE__)); \
XMov_rc(TMP,CONST(debug_method_call)); \
XCall_r(TMP); \
PATCH_JUMP(l); \
XMov_rc(TMP,CONST(v)); \
XCall_r(TMP); \
}
#define XCall_m_real(v) XMov_rc(TMP,CONST(v)); XCall_r(TMP);
#ifdef STACK_ALIGN_DEBUG
# define XCall_m XCall_m_debug
#else
# define XCall_m XCall_m_real
#endif
#define XCall_d(delta) B(0xE8); W(delta)
#define XPush_r(r) B(0x50+(r))
#define XPush_c(cst) B(0x68); W(cst)
#define XPush_p(reg,idx) OP_ADDR(0xFF,idx,reg,6)
#define XAdd_rc(reg,cst) if IS_SBYTE(cst) { OP_RM(0x83,3,0,reg); B(cst); } else { OP_RM(0x81,3,0,reg); W(cst); }
#define XAdd_rr(dst,src) OP_RM(0x03,3,dst,src)
#define XSub_rc(reg,cst) if IS_SBYTE(cst) { OP_RM(0x83,3,5,reg); B(cst); } else { OP_RM(0x81,3,5,reg); W(cst); }
#define XSub_rr(dst,src) OP_RM(0x2B,3,dst,src)
#define XCmp_rr(r1,r2) OP_RM(0x3B,3,r1,r2)
#define XCmp_rc(reg,cst) if( reg == Eax ) { B(0x3D); } else { OP_RM(0x81,3,7,reg); }; W(cst)
#define XCmp_rb(reg,byte) OP_RM(0x83,3,7,reg); B(byte)
#define XJump(how,local) if( (how) == JAlways ) { B(0xE9); } else { B(0x0F); B(how); }; local = buf.i; W(0)
#define XJump_near(local) B(0xEB); local = buf.c; B(0)
#define XJump_r(reg) OP_RM(0xFF,3,4,reg)
#define XPop_r(reg) B(0x58 + (reg))
#define XTest_rc(r,cst) if( r == Eax ) { B(0xA9); W(cst); } else { B(0xF7); MOD_RM(3,0,r); W(cst); }
#define XTest_rr(r,src) B(0x85); MOD_RM(3,r,src)
#define XAnd_rc(r,cst) if( r == Eax ) { B(0x25); W(cst); } else { B(0x81); MOD_RM(3,4,r); W(cst); }
#define XAnd_rr(r,src) B(0x23); MOD_RM(3,r,src)
#define XOr_rc(r,cst) if( r == Eax ) { B(0x0D); W(cst); } else { B(0x81); MOD_RM(3,1,r); W(cst); }
#define XOr_rr(r,src) B(0x0B); MOD_RM(3,r,src)
#define XXor_rc(r,cst) if( r == Eax ) { B(0x35); W(cst); } else { B(0x81); MOD_RM(3,6,r); W(cst); }
#define XXor_rr(r,src) B(0x33); MOD_RM(3,r,src)
#define shift_r(r,spec) B(0xD3); MOD_RM(3,spec,r);
#define shift_c(r,n,spec) if( (n) == 1 ) { B(0xD1); MOD_RM(3,spec,r); } else { B(0xC1); MOD_RM(3,spec,r); B(n); }
#define XShl_rr(r,src) if( src != Ecx ) ERROR; shift_r(r,4)
#define XShl_rc(r,n) shift_c(r,n,4)
#define XShr_rr(r,src) if( src != Ecx ) ERROR; shift_r(r,7)
#define XShr_rc(r,n) shift_c(r,n,7)
#define XUShr_rr(r,src) if( src != Ecx ) ERROR; shift_r(r,5)
#define XUShr_rc(r,n) shift_c(r,n,5)
#define XIMul_rr(dst,src) B(0x0F); B(0xAF); MOD_RM(3,dst,src)
#define XIDiv_r(r) B(0xF7); MOD_RM(3,7,r)
#define XCdq() B(0x99);
// FPU
#define XFAddp() B(0xDE); B(0xC1)
#define XFSubp() B(0xDE); B(0xE9)
#define XFMulp() B(0xDE); B(0xC9)
#define XFDivp() B(0xDE); B(0xF9)
#define XFStp_i(r) B(0xDD); MOD_RM(0,3,r); if( r == Esp ) B(0x24)
#define XFLd_i(r) B(0xDD); MOD_RM(0,0,r); if( r == Esp ) B(0x24)
#define XFILd_i(r) B(0xDB); MOD_RM(0,0,r); if( r == Esp ) B(0x24)
#define is_int(r,flag,local) { XTest_rc(r,1); XJump((flag)?JNeq:JEq,local); }
#ifdef STACK_ALIGN
# define stack_pad(n) stack_push(Esp,n)
# define stack_pop_pad(n,n2) stack_pop(Esp,((n) + (n2)))
#else
# define stack_pad(n)
# define stack_pop_pad(n,n2) stack_pop(Esp,(n))
#endif
#define stack_push(r,n) \
if( (n) != 0 ) { \
if( (r) == CSP ) { \
XAdd_rc(r,(n) * 4); \
} else { \
XSub_rc(r,(n) * 4); \
} \
}
#define stack_pop(r,n) \
if( (n) != 0 ) { \
if( (r) == CSP ) { \
XSub_rc(r,(n) * 4); \
} else { \
XAdd_rc(r,(n) * 4); \
} \
}
#define begin_call() { XMov_pr(VM,VMFIELD(sp),SP); XMov_pr(VM,VMFIELD(csp),CSP); }
#define end_call() { XMov_rp(SP,VM,VMFIELD(sp)); XMov_rp(CSP,VM,VMFIELD(csp)); }
#define label(code) { XMov_rc(TMP2,CONST(code)); XCall_r(TMP2); }
#define todo(str) { int *loop; XMov_rc(TMP2,CONST(str)); XJump(JAlways,loop); *loop = -5; }
#define pop(n) if( (n) != 0 ) { \
int i = (n); \
while( i-- > 0 ) { \
XMov_pc(SP,FIELD(i),0); \
} \
stack_pop(SP,n); \
}
#define pop_loop(n) { \
char *start; \
int *loop; \
XMov_rc(TMP,n); \
start = buf.c; \
XMov_pc(SP,FIELD(0),0); \
stack_pop(SP,1); \
XSub_rc(TMP,1); \
XCmp_rc(TMP,0); \
XJump(JNeq,loop); \
*loop = (int)(start - buf.c); \
}
#ifdef STACK_ALIGN
# define PAD_OPT(x) (x)
#else
# define PAD_OPT(x) 0
#endif
#define runtime_error(msg_id,in_label) { \
if( in_label ) { stack_pad(2); } else { stack_pad(1); } \
XPush_c(CONST(strings[msg_id])); \
if( in_label ) { \
XMov_rp(TMP2,Esp,FIELD(2+PAD_OPT(2))); \
XPush_r(TMP2); \
} else { \
XPush_c(GET_PC()); \
} \
label(code->runtime_error); \
}
#define get_var_r(reg,v) { \
switch( v ) { \
case VThis: \
XMov_rp(reg,VM,VMFIELD(vthis)); \
break; \
case VEnv: \
XMov_rp(reg,VM,VMFIELD(env)); \
break; \
case VModule: \
XMov_rp(reg,VM,VMFIELD(jit_val)); \
break; \
case VVm: \
XMov_rr(reg,VM); \
break; \
case VSpMax: \
XMov_rp(reg,VM,VMFIELD(spmax)); \
break; \
case VTrap: \
XMov_rp(reg,VM,VMFIELD(trap)); \
break; \
default: \
ERROR; \
break; \
} \
}
#define get_var_p(reg,idx,v) { \
switch( v ) { \
case VThis: \
XMov_rp(TMP,VM,VMFIELD(vthis)); \
XMov_pr(reg,idx,TMP); \
break; \
case VEnv: \
XMov_rp(TMP,VM,VMFIELD(env)); \
XMov_pr(reg,idx,TMP); \
break; \
case VModule: \
XMov_rp(TMP,VM,VMFIELD(jit_val)); \
XMov_pr(reg,idx,TMP); \
break; \
case VVm: \
XMov_pr(reg,idx,VM); \
break; \
case VSpMax: \
XMov_rp(TMP,VM,VMFIELD(spmax)); \
XMov_pr(reg,idx,TMP); \
break; \
case VTrap: \
XMov_rp(TMP,VM,VMFIELD(trap)); \
XMov_pr(reg,idx,TMP); \
break; \
default: \
ERROR; \
break; \
} \
}
#define set_var_r(v,reg) { \
switch( v ) { \
case VThis: \
XMov_pr(VM,VMFIELD(vthis),reg); \
break; \
case VEnv: \
XMov_pr(VM,VMFIELD(env),reg); \
break; \
case VTrap: \
XMov_pr(VM,VMFIELD(trap),reg); \
break; \
case VModule: \
XMov_pr(VM,VMFIELD(jit_val),reg); \
break; \
default: \
ERROR; \
break; \
} \
}
#define set_var_p(v,reg,idx) { \
switch( v ) { \
case VThis: \
XMov_rp(TMP,reg,idx); \
XMov_pr(VM,VMFIELD(vthis),TMP); \
break; \
case VEnv: \
XMov_rp(TMP,reg,idx); \
XMov_pr(VM,VMFIELD(env),TMP); \
break; \
case VTrap: \
XMov_rp(TMP,reg,idx); \
XMov_pr(VM,VMFIELD(trap),TMP); \
break; \
case VModule: \
XMov_rp(TMP,reg,idx); \
XMov_pr(VM,VMFIELD(jit_val),TMP); \
break; \
default: \
ERROR; \
break; \
} \
}
#define jump(how,targ) { \
jlist *j = (jlist*)alloc(sizeof(jlist)); \
void *jcode; \
j->target = (int)((int_val*)(int_val)(targ) - ctx->module->code); \
j->next = ctx->jumps; \
ctx->jumps = j; \
XJump(how,jcode); \
j->pos = (int)((int_val)jcode - (int_val)ctx->baseptr); \
}
#define setup_before_call(mode,is_callb) { \
push_infos(is_callb?CALLBACK:PC_ARG); \
if( !is_callb ) { XPush_r(ACC); } \
if( mode == THIS_CALL ) { \
set_var_p(VThis,SP,FIELD(0)); \
pop(1); \
} \
set_var_p(VEnv,ACC,FUNFIELD(env)); \
}
#define restore_after_call(nargs,pad) { \
int *jok; \
XCmp_rc(ACC,0); \
XJump(JNeq,jok); \
XMov_rp(ACC,Esp,FIELD(nargs+PAD_OPT(pad))); \
XMov_rp(ACC,ACC,FUNFIELD(module)); \
stack_pad(-1); \
XPush_r(ACC); \
XCall_m(val_throw); \
PATCH_JUMP(jok); \
stack_pop_pad(1+nargs,pad); \
pop_infos(); \
}
#define NARGS (CALL_MAX_ARGS + 1)
#define MAX_ENV 8
typedef struct {
char *boot;
char *stack_expand;
char *runtime_error;
char *call_normal_jit[NARGS];
char *call_this_jit[NARGS];
char *call_tail_jit[NARGS];
char *call_normal_prim[NARGS];
char *call_this_prim[NARGS];
char *call_tail_prim[NARGS];
char *call_normal_fun[NARGS];
char *call_this_fun[NARGS];
char *call_tail_fun[NARGS];
char *make_env[MAX_ENV];
char *make_env_n;
char *oo_get;
char *oo_set;
char *handle_trap;
char *invalid_access;
} jit_code;
char *jit_boot_seq = NULL;
char *jit_handle_trap = NULL;
static jit_code *code;
static value *strings;
static const char *cstrings[] = {
"Stack overflow", // 0
"Reading Outside Env", // 1
"Writing Outside Env", // 2
"Invalid call", // 3
"Invalid array access", // 4
"Invalid field access", // 5
"Invalid environment", // 6
"Invalid operation (%)", // 7
"$apply", // 8
"Invalid End Trap", // 9
"$hash", // 10
};
#define DEFINE_PROC(p,arg) ctx->buf = buf; jit_##p(ctx,arg); buf = ctx->buf
#define push_infos(arg) DEFINE_PROC(push_infos,arg)
#define test(arg) DEFINE_PROC(test,arg)
#define call(mode,nargs) ctx->buf = buf; jit_call(ctx,mode,nargs); buf = ctx->buf
#define number_op(arg) DEFINE_PROC(number_op,arg)
#define array_access(p) DEFINE_PROC(array_access,p)
#define int_op(arg) DEFINE_PROC(int_op,arg)
#define best_int() DEFINE_PROC(best_int,0)
#ifdef STACK_ALIGN_DEBUG
#include <stdlib.h>
static void debug_method_call( int line, int stack ) {
printf("Stack align error line %d (%d)\n" , line ,stack);
exit(-1);
}
#endif
#ifdef NEKO_JIT_DEBUG
static void val_print_2( value v ) {
val_print(alloc_string(" "));
val_print(v);
}
static void val_print_3( value v ) {
val_print_2(v);
val_print(alloc_string("\n"));
}
#endif
static jit_ctx *jit_init_context( void *ptr, int size ) {
jit_ctx *c = (jit_ctx*)alloc(sizeof(jit_ctx));
c->size = size;
c->baseptr = ptr;
c->buf.p = ptr;
c->pos = NULL;
c->curpc = 0;
c->debug_wait = 0;
c->jumps = NULL;
c->traps = NULL;
return c;
}
static void jit_finalize_context( jit_ctx *ctx ) {
jlist *l;
int nbytes = POS();
if( nbytes == 0 || nbytes > ctx->size )
*(int*)0xAABBCC = 0;
l = ctx->jumps;
while( l != NULL ) {
*(int*)((char*)ctx->baseptr + l->pos) = ctx->pos[l->target] - (l->pos + 4);
l = l->next;
}
l = ctx->traps;
while( l != NULL ) {
*(int*)((char*)ctx->baseptr + l->pos) = ctx->pos[l->target] + (int)(int_val)ctx->baseptr;
l = l->next;
}
}
static void jit_push_infos( jit_ctx *ctx, enum PushInfosMode callb ) {
INIT_BUFFER;
stack_push(CSP,4);
if( callb == CALLBACK ) {
XMov_pc(CSP,FIELD(-3),CONST(callback_return));
get_var_p(CSP,FIELD(-2),VEnv);
get_var_p(CSP,FIELD(-1),VThis);
XMov_pc(CSP,FIELD(0),0);
} else {
if( callb == PC_CUR ) {
XMov_pc(CSP,FIELD(-3),GET_PC());
} else { // PC_ARG : on the stack
XMov_rp(TMP2,Esp,FIELD(1));
XMov_pr(CSP,FIELD(-3),TMP2);
}
get_var_p(CSP,FIELD(-2),VEnv);
get_var_p(CSP,FIELD(-1),VThis);
get_var_p(CSP,FIELD(0),VModule)
}
END_BUFFER;
}
static void jit_best_int( jit_ctx *ctx, int _ ) {
int *wrap;
char *jend;
INIT_BUFFER;
XMov_rr(TMP,ACC);
XShl_rc(ACC,1);
XJump(JOverflow,wrap);
XOr_rc(ACC,1);
XJump_near(jend);
PATCH_JUMP(wrap);
XPush_r(TMP);
XCall_m(alloc_int32);
stack_pop(Esp,1);
PATCH_JUMP(jend);
END_BUFFER;
}
#define pop_infos() { \
set_var_p(VModule,CSP,FIELD(0)); \
set_var_p(VThis,CSP,FIELD(-1)); \
set_var_p(VEnv,CSP,FIELD(-2)); \
XMov_pc(CSP,FIELD(0),0); \
XMov_pc(CSP,FIELD(-1),0); \
XMov_pc(CSP,FIELD(-2),0); \
XMov_pc(CSP,FIELD(-3),0); \
stack_pop(CSP,4); \
}
static void jit_boot( jit_ctx *ctx, void *_ ) {
INIT_BUFFER;
XPush_r(Ebp);
XPush_r(Ebx);
XPush_r(Esi);
# ifdef STACK_ALIGN_DEBUG
XMov_rr(Ebp,Esp); // ALIGNED STACK
# endif
XPush_r(Edi);
XMov_rp(VM,Esp,FIELD(5));
get_var_r(TMP,VModule);
XPush_r(TMP);
set_var_p(VModule,Esp,FIELD(9));
XMov_rp(TMP,Esp,FIELD(7));
XMov_rp(ACC,Esp,FIELD(8));
end_call();
XCall_r(TMP);
begin_call();
XPop_r(TMP);
set_var_r(VModule,TMP);
XPop_r(Edi);
XPop_r(Esi);
XPop_r(Ebx);
XPop_r(Ebp);
XRet();
END_BUFFER;
}
static void jit_trap( jit_ctx *ctx, int n ) {
INIT_BUFFER;
XMov_rp(VM,Esp,FIELD(1));
get_var_r(Ebp,VThis);
// restore vm
stack_pad(3);
XPush_r(VM);
XCall_m(neko_process_trap);
stack_pop_pad(1,3);
// restore registers
end_call();
XMov_rr(ACC,Ebp);
XMov_rp(Ebp,VM,VMFIELD(start)+FIELD(1));
XMov_rp(Esp,VM,VMFIELD(start)+FIELD(2));
XMov_rp(TMP2,VM,VMFIELD(start)+FIELD(3));
// restore vm jmp_buf
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start)+FIELD(3),TMP);
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start)+FIELD(2),TMP);
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start)+FIELD(1),TMP);
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start),TMP);
XPush_r(TMP2);
XRet();
END_BUFFER;
}
static void jit_stack_expand( jit_ctx *ctx, int _ ) {
int *jresize, *jdone;
int max = MAX_STACK_PER_FUNCTION;
INIT_BUFFER;
stack_push(CSP,max);
XCmp_rr(SP,CSP);
XJump(JLt,jresize);
stack_pop(CSP,max);
XRet();
PATCH_JUMP(jresize);
stack_pop(CSP,max);
XPush_r(ACC);
XPush_r(VM);
XPush_r(CSP);
XPush_r(SP);
XCall_m(neko_stack_expand);
XCmp_rb(ACC,0);
XJump(JNeq,jdone);
stack_pad(-1);
XPush_c(CONST(strings[0])); // Stack overflow
XCall_m(val_throw);
PATCH_JUMP(jdone);
XMov_rp(ACC,Esp,FIELD(3));
end_call();
stack_pop(Esp,4);
XRet();
END_BUFFER;
}
static void jit_runtime_error( jit_ctx *ctx, void *unused ) {
INIT_BUFFER;
push_infos(PC_ARG); // pc
begin_call();
XMov_rp(TMP,Esp,FIELD(2)); // msg on stack
XPush_r(TMP);
XCall_m(val_throw);
END_BUFFER;
}
static void jit_invalid_access( jit_ctx *ctx, int _ ) {
INIT_BUFFER;
int *jnext;
// if( val_field_name(f) == val_null ) RuntimeError("Invalid field access")
stack_pad(1);
XMov_rp(TMP,Esp,FIELD(2)); // field
XPush_r(TMP);
XCall_m(val_field_name);
stack_pop_pad(1,1);
XCmp_rc(ACC,CONST(val_null));
XJump(JNeq,jnext);
runtime_error(5,true);
// else {
// b = alloc_buffer("Invalid field access : ");
PATCH_JUMP(jnext);
XPush_r(ACC);
XPush_c(CONST("Invalid field access : "));
XCall_m(alloc_buffer);
stack_pop(Esp,1);
// val_buffer(b,v);
XPush_r(ACC);
XCall_m(val_buffer);
// buffer_to_string(b);
XCall_m(buffer_to_string);
stack_pop(Esp,2);
push_infos(PC_ARG); // pc
begin_call();
XPush_r(ACC);
XCall_m(val_throw);
END_BUFFER;
}
static void jit_test( jit_ctx *ctx, int how ) {
INIT_BUFFER;
int *jnot1, *jnot2;
char *jend;
// call val_compare(sp[0],acc)
XPush_r(ACC);
XMov_rp(TMP,SP,FIELD(0));
XPush_r(TMP);
begin_call();
XCall_m(val_compare);
end_call();
stack_pop(Esp,2);
pop(1);
// test ok and != invalid_comparison
XCmp_rc(ACC,0);
XJump(how,jnot1);
XCmp_rc(ACC,invalid_comparison);
XJump(JEq,jnot2);
XMov_rc(ACC,CONST(val_true));
XJump_near(jend);
PATCH_JUMP(jnot1);
PATCH_JUMP(jnot2);
XMov_rc(ACC,CONST(val_false));
PATCH_JUMP(jend);
END_BUFFER;
}
static void jit_call( jit_ctx *ctx, int mode, int nargs ) {
INIT_BUFFER;
int *jerr, *jother, *jerr2;
char *jend1, *jend2, *jend3;
// if( is_int ) : error
is_int(ACC,1,jerr);
// if( type == jit )
XMov_rp(TMP,ACC,FUNFIELD(t));
XCmp_rb(TMP,VAL_JITFUN);
XJump(JNeq,jother);
XPush_c(GET_PC());
switch( mode ) {
case NORMAL: label(code->call_normal_jit[nargs]); break;
case THIS_CALL: label(code->call_this_jit[nargs]); break;
case TAIL_CALL: label(code->call_tail_jit[nargs]); break;
}
if( mode == TAIL_CALL )
jend1 = NULL;
else {
XJump_near(jend1);
}
// else if( type == prim )
PATCH_JUMP(jother);
XCmp_rb(TMP,VAL_PRIMITIVE);
XJump(JNeq,jother);
XPush_c(GET_PC());
switch( mode ) {
case NORMAL: label(code->call_normal_prim[nargs]); break;
case THIS_CALL: label(code->call_this_prim[nargs]); break;
case TAIL_CALL: label(code->call_tail_prim[nargs]); break;
}
XJump_near(jend2);
// else if( type == function )
PATCH_JUMP(jother);
XCmp_rb(TMP,VAL_FUNCTION);
XJump(JNeq,jerr2);
XPush_c(GET_PC());
switch( mode ) {
case NORMAL: label(code->call_normal_fun[nargs]); break;
case THIS_CALL: label(code->call_this_fun[nargs]); break;
case TAIL_CALL: label(code->call_tail_fun[nargs]); break;
}
XJump_near(jend3);
// else error
PATCH_JUMP(jerr);
PATCH_JUMP(jerr2);
runtime_error(3,false); // Invalid call
// end
PATCH_JUMP(jend1);
PATCH_JUMP(jend2);
PATCH_JUMP(jend3);
stack_pop(Esp,1); // pushed pc
END_BUFFER;
}
static void jit_call_jit( jit_ctx *ctx, int nargs, int mode ) {
INIT_BUFFER;
int *jerr;
// check arg count
XMov_rp(TMP,ACC,FUNFIELD(nargs));
XCmp_rb(TMP,nargs);
XJump(JNeq,jerr);
if( mode == TAIL_CALL ) {
// pop PC and EIP from the stack
stack_pop(Esp,2);
set_var_p(VModule,ACC,FUNFIELD(module));
set_var_p(VEnv,ACC,FUNFIELD(env));
XMov_rp(TMP,ACC,FUNFIELD(addr));
XJump_r(TMP);
} else {
push_infos(PC_ARG);
set_var_p(VModule,ACC,FUNFIELD(module));
set_var_p(VEnv,ACC,FUNFIELD(env));
if( mode == THIS_CALL ) {
set_var_p(VThis,SP,FIELD(0));
pop(1);
}
XMov_rp(TMP,ACC,FUNFIELD(addr));
stack_pad(1);
XCall_r(TMP);
stack_pad(-1);
pop_infos();
XRet();
}
PATCH_JUMP(jerr);
runtime_error(3,true); // Invalid call
END_BUFFER;
}
static void jit_call_prim( jit_ctx *ctx, int nargs, int mode ) {
INIT_BUFFER;
int *jvararg, *jerr;
int i;
# ifdef STACK_ALIGN
int pad_size = 4 - ((2+nargs)%4);
# endif
// check arg count
XMov_rp(TMP,ACC,FUNFIELD(nargs));
XCmp_rb(TMP,nargs);
XJump(JNeq,jvararg);
// push args from VMSP to PROCSP
setup_before_call(mode,false);
stack_pad(pad_size);
for(i=0;i<nargs;i++) {
XPush_p(SP,FIELD(i));
}
# ifndef NEKO_JIT_DEBUG
pop(nargs);
# endif
// call C primitive
XMov_rp(TMP,ACC,FUNFIELD(addr));
begin_call();
XCall_r(TMP);
end_call();
restore_after_call(nargs,pad_size);
# ifdef NEKO_JIT_DEBUG
pop(nargs);
# endif
XRet();
// else if( args == VAR_ARGS )
PATCH_JUMP(jvararg);
XCmp_rb(TMP,VAR_ARGS);
XJump(JNeq,jerr);
// push args from VMSP to PROCSP
setup_before_call(mode,false);
stack_pad(3);
for(i=0;i<nargs;i++) {
XPush_p(SP,FIELD(i));
}
pop(nargs);
// push arg ptr and arg count
XMov_rr(TMP,Esp);
XPush_c(nargs);
XPush_r(TMP);
// call C primitive
XMov_rp(TMP,ACC,FUNFIELD(addr));
begin_call();
XCall_r(TMP);
end_call();
restore_after_call(2 + nargs,3);
XRet();
// error
PATCH_JUMP(jerr);
runtime_error(3,true); // Invalid call
END_BUFFER;
}
static void jit_call_fun( jit_ctx *ctx, int nargs, int mode ) {
INIT_BUFFER;
int *jerr;
// check arg count
XMov_rp(TMP,ACC,FUNFIELD(nargs));
XCmp_rb(TMP,nargs);
XJump(JNeq,jerr);
// C call : neko_interp(vm,m,acc,pc)
setup_before_call(mode,true);
stack_push(Esp,4);
XMov_rp(TMP,ACC,FUNFIELD(addr));
XMov_pr(Esp,FIELD(3),TMP);
XMov_pr(Esp,FIELD(2),ACC);
get_var_p(Esp,FIELD(1),VModule);
get_var_p(Esp,FIELD(0),VVm);
begin_call();
XCall_m(neko_interp);
end_call();
stack_pop(Esp,4);
XRet();
PATCH_JUMP(jerr);
runtime_error(3,true); // Invalid call
END_BUFFER;
}
#define jit_call_jit_normal(ctx,i) jit_call_jit(ctx,i,NORMAL)
#define jit_call_jit_tail(ctx,i) jit_call_jit(ctx,i,TAIL_CALL)
#define jit_call_jit_this(ctx,i) jit_call_jit(ctx,i,THIS_CALL)
#define jit_call_prim_normal(ctx,i) jit_call_prim(ctx,i,NORMAL)
#define jit_call_prim_tail(ctx,i) jit_call_prim(ctx,i,TAIL_CALL)
#define jit_call_prim_this(ctx,i) jit_call_prim(ctx,i,THIS_CALL)
#define jit_call_fun_normal(ctx,i) jit_call_fun(ctx,i,NORMAL)
#define jit_call_fun_tail(ctx,i) jit_call_fun(ctx,i,TAIL_CALL)
#define jit_call_fun_this(ctx,i) jit_call_fun(ctx,i,THIS_CALL)
// ------------------- INTERP EMULATION
#define STACK_EXPAND if( !neko_stack_expand(vm->sp,vm->csp,vm) ) val_throw(alloc_string("Stack Overflow"))
#define ERASE 0
#define ACC_BACKUP
#define ACC_RESTORE
#define PushInfos() \
if( vm->csp + 4 >= vm->sp ) STACK_EXPAND; \
*++vm->csp = (int_val)pc; \
*++vm->csp = (int_val)vm->env; \
*++vm->csp = (int_val)vm->vthis; \
*++vm->csp = (int_val)vm->jit_val;
#define PopInfos(restpc) \
vm->jit_val = (void*)*vm->csp; \
*vm->csp-- = ERASE; \
vm->vthis = (value)*vm->csp; \
*vm->csp-- = ERASE; \
vm->env = (value)*vm->csp; \
*vm->csp-- = ERASE; \
if( restpc ) pc = (int)*vm->csp; \
*vm->csp-- = ERASE;
#define BeginCall()
#define EndCall()
#define RuntimeError(err) { PushInfos(); BeginCall(); val_throw(alloc_string(err)); }
#define ObjectOpGen(obj,param,id,err) { \
value _o = (value)obj; \
value _arg = (value)param; \
value _f = val_field(_o,id); \
if( _f == val_null ) { \
err; \
} else { \
PushInfos(); \
BeginCall(); \
acc = (int_val)val_callEx(_o,_f,&_arg,1,NULL); \
EndCall(); \
PopInfos(false); \
} \
}
#define ObjectOp(obj,param,id) ObjectOpGen(obj,param,id,RuntimeError("Unsupported operation"))
#define OpError(op) RuntimeError("Invalid operation (" op ")")
static int_val generic_add( neko_vm *vm, int_val acc, int_val sp, int pc ) {
if( acc & 1 ) {
if( val_tag(sp) == VAL_FLOAT )
acc = (int_val)alloc_float(val_float(sp) + val_int(acc));
else if( val_tag(sp) == VAL_INT32 )
acc = (int_val)alloc_best_int(val_int32(sp) + val_int(acc));
else if( val_short_tag(sp) == VAL_STRING )
acc = (int_val)neko_append_int(vm,(value)sp,val_int(acc),true);
else if( val_tag(sp) == VAL_OBJECT )
ObjectOp(sp,acc,id_add)
else
OpError("+");
} else if( sp & 1 ) {
if( val_tag(acc) == VAL_FLOAT )
acc = (int_val)alloc_float(val_int(sp) + val_float(acc));
else if( val_tag(acc) == VAL_INT32 )
acc = (int_val)alloc_best_int(val_int(sp) + val_int32(acc));
else if( val_short_tag(acc) == VAL_STRING )
acc = (int_val)neko_append_int(vm,(value)acc,val_int(sp),false);
else if( val_tag(acc) == VAL_OBJECT )
ObjectOp(acc,sp,id_radd)
else
OpError("+");
} else if( val_tag(acc) == VAL_FLOAT ) {
if( val_tag(sp) == VAL_FLOAT )
acc = (int_val)alloc_float(val_float(sp) + val_float(acc));
else if( val_tag(sp) == VAL_INT32 )
acc = (int_val)alloc_float(val_int32(sp) + val_float(acc));
else
goto add_next;
} else if( val_tag(acc) == VAL_INT32 ) {
if( val_tag(sp) == VAL_INT32 )
acc = (int_val)alloc_best_int(val_int32(sp) + val_int32(acc));
else if( val_tag(sp) == VAL_FLOAT )
acc = (int_val)alloc_float(val_float(sp) + val_int32(acc));
else
goto add_next;
} else {
add_next:
if( val_tag(sp) == VAL_OBJECT )
ObjectOpGen(sp,acc,id_add,goto add_2)
else {
add_2:
if( val_tag(acc) == VAL_OBJECT )
ObjectOpGen(acc,sp,id_radd,goto add_3)
else {
add_3:
if( val_short_tag(acc) == VAL_STRING || val_short_tag(sp) == VAL_STRING ) {
ACC_BACKUP
buffer b = alloc_buffer(NULL);
BeginCall();
val_buffer(b,(value)sp);
ACC_RESTORE;
val_buffer(b,(value)acc);
EndCall();
acc = (int_val)buffer_to_string(b);
} else
OpError("+");
}
}
}
return acc;
}
#define NumberOp(op,fop,id_op,id_rop) \
if( acc & 1 ) { \
if( val_tag(sp) == VAL_FLOAT ) \
acc = (int_val)alloc_float(fop(val_float(sp),val_int(acc))); \
else if( val_tag(sp) == VAL_INT32 ) \
acc = (int_val)alloc_best_int(val_int32(sp) op val_int(acc)); \
else if( val_tag(sp) == VAL_OBJECT ) \
ObjectOp(sp,acc,id_op) \
else \
OpError(#op); \
} else if( sp & 1 ) { \
if( val_tag(acc) == VAL_FLOAT ) \
acc = (int_val)alloc_float(fop(val_int(sp),val_float(acc))); \
else if( val_tag(acc) == VAL_INT32 ) \
acc = (int_val)alloc_best_int(val_int(sp) op val_int32(acc)); \
else if( val_tag(acc) == VAL_OBJECT ) \
ObjectOp(acc,sp,id_rop) \
else \
OpError(#op); \
} else if( val_tag(acc) == VAL_FLOAT ) { \
if( val_tag(sp) == VAL_FLOAT ) \
acc = (int_val)alloc_float(fop(val_float(sp),val_float(acc))); \
else if( val_tag(sp) == VAL_INT32 ) \
acc = (int_val)alloc_float(fop(val_int32(sp),val_float(acc))); \
else \
goto id_op##_next; \
} else if( val_tag(acc) == VAL_INT32 ) {\
if( val_tag(sp) == VAL_INT32 ) \
acc = (int_val)alloc_best_int(val_int32(sp) op val_int32(acc)); \
else if( val_tag(sp) == VAL_FLOAT ) \
acc = (int_val)alloc_float(fop(val_float(sp),val_int32(acc))); \
else \
goto id_op##_next; \
} else { \
id_op##_next: \
if( val_tag(sp) == VAL_OBJECT ) \
ObjectOpGen(sp,acc,id_op,goto id_op##_next2) \
else { \
id_op##_next2: \
if( val_tag(acc) == VAL_OBJECT ) \
ObjectOp(acc,sp,id_rop) \
else \
OpError(#op); \
} \
}
#define SUB(x,y) ((x) - (y))
#define MULT(x,y) ((x) * (y))
#define DIV(x,y) ((x) / (y))
#define GENERIC_OP(id,op,fop) \
static int_val generic_##id( neko_vm *vm, int_val acc, int_val sp, int pc ) { \
NumberOp(op,fop,id_##id,id_r##id); \
return acc; \
}
GENERIC_OP(sub,-,SUB);
GENERIC_OP(mult,*,MULT);
static int_val generic_div( neko_vm *vm, int_val acc, int_val sp, int pc ) {
if( val_is_number(acc) && val_is_number(sp) )
acc = (int_val)alloc_float( ((tfloat)val_number(sp)) / val_number(acc) );
else if( val_is_object(sp) )
ObjectOpGen(sp,acc,id_div,goto div_next)
else {
div_next:
if( val_is_object(acc) )
ObjectOp(acc,sp,id_rdiv)
else
OpError("/");
}
return acc;
}
static int_val generic_mod( neko_vm *vm, int_val acc, int_val sp, int pc ) {
if( (acc == 1 || (val_is_int32(acc) && val_int32(acc)==0)) && val_is_any_int(sp) )
OpError("%");
NumberOp(%,fmod,id_mod,id_rmod);
return acc;
}
#define GENERIC_IOP(id,op) \
static int_val generic_##id( neko_vm *vm, int_val acc, int_val sp, int pc ) { \
if( val_is_any_int(acc) && val_is_any_int(sp) ) \
acc = (int_val)alloc_best_int(val_any_int(sp) op val_any_int(acc)); \
else \
OpError(#op); \
return acc; \
}
GENERIC_IOP(shl,<<);
GENERIC_IOP(shr,>>);
GENERIC_IOP(or,|);
GENERIC_IOP(and,&);
GENERIC_IOP(xor,^);
static int_val generic_ushr( neko_vm *vm, int_val acc, int_val sp, int pc ) {
if( val_is_any_int(acc) && val_is_any_int(sp) )
acc = (int_val)alloc_best_int( ((unsigned int)val_any_int(sp)) >> val_any_int(acc));
else
OpError(">>>");
return acc;
}
// --------------------------------------------
// we only inline operations for (int,int) and (float,float)
// other cases are handled by a single generic_op primitive
// through a small jit_generic_* wrapper
static void jit_number_op( jit_ctx *ctx, enum Operation op ) {
INIT_BUFFER;
int *jnot_int, *jnot_int2, *jint, *jnot_float1, *jnot_float2, *jmod0;
char *jend, *jend2, *jdiv = NULL;
// tmp = acc
XMov_rr(TMP,ACC);
// acc = *sp
XMov_rp(ACC,SP,FIELD(0));
// is_int(acc) && is_int(sp)
is_int(ACC,false,jnot_int);
is_int(TMP,false,jnot_int2);
XShr_rc(ACC,1);
XShr_rc(TMP,1);
switch( op ) {
case OP_ADD:
XAdd_rr(ACC,TMP);
break;
case OP_SUB:
XSub_rr(ACC,TMP);
break;
case OP_MUL:
XIMul_rr(ACC,TMP);
break;
case OP_MOD:
XCmp_rc(TMP,0);
XJump(JNeq,jmod0);
runtime_error(7,false);
PATCH_JUMP(jmod0);
XCdq();
XIDiv_r(TMP);
XMov_rr(ACC,Edx);
break;
case OP_DIV:
XPush_r(ACC);
XFILd_i(Esp);
XPush_r(TMP);
XFILd_i(Esp);
stack_pop(Esp,2);
XJump_near(jdiv);
break;
default:
ERROR;
break;
}
best_int();
XJump_near(jend);
// is_float(acc) && is_float(sp)
PATCH_JUMP(jnot_int);
XMov_rp(TMP2,ACC,FIELD(0));
XCmp_rb(TMP2,VAL_FLOAT);
XJump(JNeq,jnot_float1);
is_int(TMP,true,jint);
XMov_rp(TMP2,TMP,FIELD(0));
XCmp_rb(TMP2,VAL_FLOAT);
XJump(JNeq,jnot_float2);
// load floats
XAdd_rc(ACC,4);
XFLd_i(ACC);
XAdd_rc(TMP,4);
XFLd_i(TMP);
switch( op ) {
case OP_ADD:
XFAddp();
break;
case OP_SUB:
XFSubp();
break;
case OP_DIV:
PATCH_JUMP(jdiv);
XFDivp();
break;
case OP_MUL:
XFMulp();
break;
case OP_MOD:
stack_push(Esp,2);
XFStp_i(Esp);
stack_push(Esp,2);
XFStp_i(Esp);
XCall_m(fmod);
stack_pop(Esp,2);
break;
default:
ERROR;
break;
}
if( op != OP_MOD ) {
stack_push(Esp,2);
}
XFStp_i(Esp);
XCall_m(alloc_float);
stack_pop(Esp,2);
XJump_near(jend2);
// else...
PATCH_JUMP(jint);
PATCH_JUMP(jnot_float1);
PATCH_JUMP(jnot_float2);
PATCH_JUMP(jnot_int2);
begin_call();
XPush_c(GET_PC());
XPush_r(ACC);
XPush_r(TMP);
XPush_r(VM);
switch( op ) {
case OP_ADD:
XCall_m(generic_add);
break;
case OP_SUB:
XCall_m(generic_sub);
break;
case OP_DIV:
XCall_m(generic_div);
break;
case OP_MUL:
XCall_m(generic_mult);
break;
case OP_MOD:
XCall_m(generic_mod);
break;
case OP_GET:
case OP_SET:
case OP_LAST:
// not used here
break;
}
stack_pop(Esp,4);
end_call();
PATCH_JUMP(jend);
PATCH_JUMP(jend2);
pop(1);
END_BUFFER;
}
static void jit_int_op( jit_ctx *ctx, enum IOperation op ) {
INIT_BUFFER;
int *jerr1, *jerr2;
char *jend;
XMov_rr(TMP,ACC);
XMov_rp(ACC,SP,FIELD(0));
is_int(ACC,false,jerr1);
is_int(TMP,false,jerr2);
XShr_rc(TMP,1);
XShr_rc(ACC,1);
switch( op ) {
case IOP_SHL:
XShl_rr(ACC,TMP);
break;
case IOP_SHR:
XShr_rr(ACC,TMP);
break;
case IOP_USHR:
XUShr_rr(ACC,TMP);
break;
case IOP_AND:
XAnd_rr(ACC,TMP);
break;
case IOP_OR:
XOr_rr(ACC,TMP);
break;
case IOP_XOR:
XXor_rr(ACC,TMP);
break;
default:
ERROR;
}
best_int();
XJump_near(jend);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
begin_call();
XPush_c(GET_PC());
XPush_r(ACC); // acc and tmp are reversed in jit_number_op
XPush_r(TMP); //
XPush_r(VM);
switch( op ) {
case IOP_SHL:
XCall_m(generic_shl);
break;
case IOP_SHR:
XCall_m(generic_shr);
break;
case IOP_USHR:
XCall_m(generic_ushr);
break;
case IOP_AND:
XCall_m(generic_and);
break;
case IOP_OR:
XCall_m(generic_or);
break;
case IOP_XOR:
XCall_m(generic_xor);
break;
case IOP_LAST:
// nothing
break;
}
stack_pop(Esp,4);
end_call();
PATCH_JUMP(jend);
pop(1);
END_BUFFER;
}
static void jit_array_access( jit_ctx *ctx, int n ) {
INIT_BUFFER;
int *jerr1, *jerr2;
char *jend1, *jend2 = NULL, *jend3;
int *jnot_array, *jbounds = NULL;
is_int(ACC,true,jerr1);
XMov_rp(TMP,ACC,0);
XMov_rr(TMP2,TMP);
XAnd_rc(TMP2,TAG_MASK);
XCmp_rb(TMP2,VAL_ARRAY);
XJump(JNeq,jnot_array);
if( n > 0 ) {
XUShr_rc(TMP,NEKO_TAG_BITS);
XCmp_rc(TMP,n);
XJump(JLte,jbounds);
}
XMov_rp(ACC,ACC,FIELD(n + 1));
XJump_near(jend1);
if( n > 0 ) {
PATCH_JUMP(jbounds);
XMov_rc(ACC,CONST(val_null));
XJump_near(jend2);
}
PATCH_JUMP(jnot_array);
XCmp_rb(TMP2,VAL_OBJECT);
XJump(JNeq,jerr2);
XPush_c(GET_PC());
XMov_rr(TMP,ACC);
XMov_rc(ACC,CONST(alloc_int(n)));
label(code->oo_get);
stack_pop(Esp,1);
XJump_near(jend3);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
runtime_error(4,false);
PATCH_JUMP(jend1);
PATCH_JUMP(jend2);
PATCH_JUMP(jend3);
END_BUFFER;
}
static void jit_make_env( jit_ctx *ctx, int esize ) {
INIT_BUFFER;
int *jerr1, *jerr2, *jok;
int i;
if( esize == -1 ) {
XMov_rr(TMP2,TMP); // store esize
}
// check type t_function or t_jit
is_int(ACC,true,jerr1);
XMov_rp(TMP,ACC,FUNFIELD(t));
XCmp_rb(TMP,VAL_JITFUN);
XJump(JEq,jok);
XCmp_rb(TMP,VAL_FUNCTION);
XJump(JNeq,jerr2);
PATCH_JUMP(jok);
// prepare args for alloc_module_function
XPush_r(TMP); // acc->type
stack_push(Esp,1); // empty cell
stack_pad(2);
XMov_rp(TMP,ACC,FUNFIELD(nargs));
XPush_r(TMP);
XMov_rp(TMP,ACC,FUNFIELD(addr));
XPush_r(TMP);
XMov_rp(TMP,ACC,FUNFIELD(module));
XPush_r(TMP);
// call alloc_array(n)
stack_pad(3);
if( esize == -1 ) {
XPush_r(TMP2);
} else {
XPush_c(esize);
}
XCall_m(alloc_array);
if( esize == -1 ) {
char *start;
int *loop;
XPop_r(TMP2);
stack_pad(-3);
// fill array
start = buf.c;
XMov_rp(TMP,SP,FIELD(0));
XMov_xr(ACC,TMP2,4,TMP);
XMov_pc(SP,FIELD(0),0);
stack_pop(SP,1);
XSub_rc(TMP2,1);
XCmp_rc(TMP2,0);
XJump(JNeq,loop);
*loop = (int)(start - buf.c);
} else {
stack_pop_pad(1,3);
// fill array
for(i=0;i<esize;i++) {
XMov_rp(TMP,SP,FIELD(i));
XMov_pr(ACC,FIELD(esize-i),TMP);
}
pop(esize);
}
// call alloc_module_function
XMov_pr(Esp,FIELD(3),ACC); // save acc
XCall_m(neko_alloc_module_function);
XMov_rp(TMP,Esp,FIELD(3)); // restore acc
XMov_rp(TMP2,Esp,FIELD(4)); // restore type
stack_pop_pad(5,2);
XMov_pr(ACC,FUNFIELD(t),TMP2);
XMov_pr(ACC,FUNFIELD(env),TMP);
XRet();
// errors
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
runtime_error(6,true); // Invalid environment
END_BUFFER;
}
#define REG_ACC ((op == OP_ADD)?ACC:TMP)
#define REG_TMP ((op == OP_ADD)?TMP:ACC)
static void jit_object_op_gen( jit_ctx *ctx, enum Operation op, int right ) {
int *next;
field f;
int is_opset;
INIT_BUFFER;
f = 0;
is_opset = 0;
switch( op ) {
case OP_ADD:
f = (right ? id_radd : id_add);
break;
case OP_SUB:
f = (right ? id_rsub : id_sub);
break;
case OP_MUL:
f = (right ? id_rmult : id_mult);
break;
case OP_DIV:
f = (right ? id_rdiv : id_div);
break;
case OP_MOD:
f = (right ? id_rmod : id_mod);
break;
case OP_GET:
f = id_get;
break;
case OP_SET:
f = id_set;
is_opset = 1;
break;
default:
ERROR;
}
// prepare args
XPush_r(right?REG_TMP:REG_ACC);
if( is_opset ) {
XMov_rp(TMP2,Esp,FIELD(3));
XPush_r(TMP2);
}
XMov_rr(TMP2,Esp);
XPush_c(0);
XPush_c(is_opset?2:1);
XPush_r(TMP2);
XPush_r(right?REG_ACC:REG_TMP);
XPush_c(f);
XPush_r(right?REG_ACC:REG_TMP);
XCall_m(val_field);
stack_pop(Esp,2);
XCmp_rc(ACC,CONST(val_null));
XJump(JNeq,next);
stack_pop(Esp,is_opset?6:5);
runtime_error(11,true); // Unsupported operation
PATCH_JUMP(next);
XPop_r(TMP);
XPush_r(ACC);
XPush_r(TMP);
begin_call();
XCall_m(val_callEx);
end_call();
stack_pop(Esp,is_opset?7:6);
XRet();
END_BUFFER;
}
static void jit_object_get( jit_ctx *ctx, int _ ) {
jit_object_op_gen(ctx,OP_GET,true);
}
static void jit_object_set( jit_ctx *ctx, int _ ) {
jit_object_op_gen(ctx,OP_SET,true);
}
static void jit_opcode( jit_ctx *ctx, enum OPCODE op, int p ) {
INIT_BUFFER;
int i;
int *jok;
switch( op ) {
case AccNull:
XMov_rc(ACC,CONST(val_null));
break;
case AccTrue:
XMov_rc(ACC,CONST(val_true));
break;
case AccFalse:
XMov_rc(ACC,CONST(val_false));
break;
case AccThis:
get_var_r(ACC,VThis);
break;
case AccInt:
XMov_rc(ACC,CONST(p));
break;
case AccInt32:
XPush_c(p);
XCall_m(alloc_int32);
stack_pop(Esp,1);
break;
case AccStack:
XMov_rp(ACC,SP,FIELD(p));
break;
case AccStack0:
XMov_rp(ACC,SP,FIELD(0));
break;
case AccStack1:
XMov_rp(ACC,SP,FIELD(1));
break;
case AccBuiltin:
XMov_rc(ACC,CONST(p));
break;
case AccGlobal:
XMov_ra(ACC,CONST(p));
break;
case AccEnv:
get_var_r(TMP,VEnv);
XMov_rp(TMP2,TMP,FIELD(0));
XCmp_rc(TMP2,(p << NEKO_TAG_BITS) | VAL_ARRAY);
XJump(JGt,jok);
runtime_error(1,false); // Reading Outside Env
PATCH_JUMP(jok);
XMov_rp(ACC,TMP,FIELD(p + 1)); // acc = val_array_ptr(env)[p]
break;
case AccArray: {
int *jerr1, *jerr2, *jerr3, *jerr4, *jnot_array, *jbounds;
char *jend1, *jend2, *jend3, *jend4;
// check array & int
XMov_rp(TMP,SP,FIELD(0));
pop(1);
is_int(TMP,true,jerr1);
XMov_rp(TMP2,TMP,FIELD(0));
XAnd_rc(TMP2,TAG_MASK);
XCmp_rb(TMP2,VAL_ARRAY);
XJump(JNeq,jnot_array);
is_int(ACC,false,jerr2);
// check bounds & access array
XShr_rc(ACC,1);
XMov_rp(TMP2,TMP,FIELD(0));
XUShr_rc(TMP2,NEKO_TAG_BITS);
XCmp_rr(ACC,TMP2);
XJump(JGte,jbounds);
XAdd_rc(ACC,1); // acc = val_array_ptr(tmp)[acc]
XMov_rx(ACC,TMP,ACC,4);
XJump_near(jend1);
// outside bounds
PATCH_JUMP(jbounds);
XMov_rc(ACC,CONST(val_null));
XJump_near(jend2);
// check object
PATCH_JUMP(jnot_array);
XCmp_rb(TMP2,VAL_OBJECT);
XJump(JNeq,jerr3);
XPush_c(GET_PC());
label(code->oo_get);
stack_pop(Esp,1);
XJump_near(jend3);
// check int32 index (with array)
PATCH_JUMP(jerr2);
XMov_rp(TMP2,ACC,FIELD(0));
XCmp_rb(TMP2,VAL_INT32);
XJump(JNeq,jerr4);
XMov_rc(ACC,CONST(val_null));
XJump_near(jend4);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr3);
PATCH_JUMP(jerr4);
runtime_error(4,false); // Invalid array access
PATCH_JUMP(jend1);
PATCH_JUMP(jend2);
PATCH_JUMP(jend3);
PATCH_JUMP(jend4);
break;
}
case AccIndex:
array_access(p);
break;
case AccIndex0:
array_access(0);
break;
case AccIndex1:
array_access(1);
break;
case AccField: {
int *jerr1, *jerr2, *jend1, *loop, *no_resolver;
char *jend2, *jend3, *start;
is_int(ACC,true,jerr1);
XMov_rp(TMP,ACC,FIELD(0));
XCmp_rb(TMP,VAL_OBJECT);
XJump(JNeq,jerr2);
XPush_r(ACC);
XPush_r(VM);
stack_pad(1);
XMov_rr(VM,ACC);
XPush_c(p);
start = buf.c;
XMov_rr(TMP,VM);
XAdd_rc(TMP,FIELD(1));
XPush_r(TMP);
XCall_m(otable_find);
XCmp_rc(ACC,0);
XJump(JNeq,jend1);
stack_pop(Esp,1);
XMov_rp(VM,VM,FIELD(3)); // acc = acc->proto
XCmp_rc(VM,0);
XJump(JNeq,loop);
*loop = (int)(start - buf.c);
stack_pop_pad(1,1);
XPop_r(VM);
XPop_r(ACC);
XMov_rp(TMP,VM,VMFIELD(resolver));
XCmp_rc(TMP,0);
XJump(JEq,no_resolver);
XPush_c(CONST(alloc_int(p)));
XPush_r(ACC);
XPush_r(TMP);
begin_call();
XCall_m(val_call2);
end_call();
stack_pop(Esp,3);
XJump_near(jend3);
PATCH_JUMP(no_resolver);
XMov_rc(ACC,CONST(val_null));
XJump_near(jend2);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
XPush_c(p);
XPush_c(GET_PC());
label(code->invalid_access);
PATCH_JUMP(jend1);
stack_pop_pad(2,2);
XPop_r(VM);
stack_pop(Esp,1);
XMov_rp(ACC,ACC,FIELD(0));
PATCH_JUMP(jend2);
PATCH_JUMP(jend3);
break;
}
case SetStack:
XMov_pr(SP,FIELD(p),ACC);
break;
case SetGlobal:
XMov_ar(CONST(p),ACC);
break;
case SetEnv:
get_var_r(TMP,VEnv);
XMov_rp(TMP2,TMP,FIELD(0));
XCmp_rc(TMP2,(p << NEKO_TAG_BITS) | VAL_ARRAY);
XJump(JGt,jok);
runtime_error(2,false); // Writing Outside Env
PATCH_JUMP(jok);
XMov_pr(TMP,FIELD(p+1),ACC); // val_array_ptr(env)[p] = acc
break;
case SetThis:
set_var_r(VThis,ACC);
break;
case SetField: {
int *jerr1, *jerr2;
char *jend;
XMov_rp(TMP,SP,FIELD(0));
is_int(TMP,true,jerr1);
XMov_rp(TMP2,TMP,FIELD(0));
XCmp_rb(TMP2,VAL_OBJECT);
XJump(JNeq,jerr2);
// call otable_replace(table,field,acc)
stack_pad(2);
XPush_r(ACC);
XPush_c(p);
XAdd_rc(TMP,FIELD(1));
XPush_r(TMP);
XCall_m(otable_replace);
stack_pop(Esp,3);
XMov_rp(ACC,Esp,FIELD(-1));
stack_pad(-2);
XJump_near(jend);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
runtime_error(5,false);
PATCH_JUMP(jend);
pop(1);
break;
}
case SetArray: {
int *jerr1, *jerr2, *jerr3, *jnot_array, *jend1, *jend4;
char *jend2, *jend3;
XMov_rp(TMP,SP,FIELD(0)); // sp[0] : array/object
is_int(TMP,true,jerr1);
XMov_rp(TMP2,TMP,FIELD(0));
XAnd_rc(TMP2,TAG_MASK);
XCmp_rb(TMP2,VAL_ARRAY);
XJump(JNeq,jnot_array);
XMov_rp(TMP2,SP,FIELD(1)); // sp[1] : index
is_int(TMP2,false,jerr2);
XMov_rp(TMP,TMP,FIELD(0)); // tmp = tmp->type
XShr_rc(TMP2,1);
XUShr_rc(TMP,NEKO_TAG_BITS);
XCmp_rr(TMP2,TMP);
XJump(JGte,jend1);
XMov_rp(TMP,SP,FIELD(0));
XAdd_rc(TMP2,1);
XMov_xr(TMP,TMP2,4,ACC);
XJump_near(jend2);
PATCH_JUMP(jnot_array);
XCmp_rb(TMP2,VAL_OBJECT);
XJump(JNeq,jerr3);
XMov_rp(TMP2,SP,FIELD(1)); // index
XPush_r(TMP2);
XPush_c(GET_PC());
label(code->oo_set);
stack_pop(Esp,2);
XJump_near(jend3);
// check int32 index (with array)
PATCH_JUMP(jerr2);
XMov_rp(TMP2,TMP2,FIELD(0));
XCmp_rb(TMP2,VAL_INT32);
XJump(JEq,jend4);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr3);
runtime_error(4,false);
PATCH_JUMP(jend1);
PATCH_JUMP(jend2);
PATCH_JUMP(jend3);
PATCH_JUMP(jend4);
pop(2);
break;
}
case SetIndex: {
int *jerr1, *jerr2, *jnot_array, *jend1;
char *jend2, *jend3;
XMov_rp(TMP,SP,FIELD(0)); // sp[0] : array / object
pop(1);
is_int(TMP,true,jerr1);
XMov_rp(TMP2,TMP,FIELD(0));
XAnd_rc(TMP2,TAG_MASK);
XCmp_rb(TMP2,VAL_ARRAY);
XJump(JNeq,jnot_array);
XMov_rp(TMP2,TMP,FIELD(0));
XCmp_rc(TMP2,(p << NEKO_TAG_BITS) | VAL_ARRAY); // fake header
XJump(JLte,jend1);
XMov_pr(TMP,FIELD(p + 1),ACC);
XJump_near(jend2);
PATCH_JUMP(jnot_array);
XCmp_rb(TMP2,VAL_OBJECT);
XJump(JNeq,jerr2);
XPush_c(CONST(alloc_int(p)));
XPush_c(GET_PC());
label(code->oo_set);
stack_pop(Esp,2);
XJump_near(jend3);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
runtime_error(4,false);
PATCH_JUMP(jend1);
PATCH_JUMP(jend2);
PATCH_JUMP(jend3);
break;
}
case Push:
stack_push(SP,1);
XMov_pr(SP,FIELD(0),ACC);
break;
case Pop:
if( p > 10 ) {
pop_loop(p);
} else {
pop(p);
}
break;
case Jump:
jump(JAlways,p);
break;
case JumpIf:
XCmp_rc(ACC,CONST(val_true));
jump(JEq,p);
break;
case JumpIfNot:
XCmp_rc(ACC,CONST(val_true));
jump(JNeq,p);
break;
case Neq: {
int *jnot1, *jnot2;
char *jend;
// call val_compare(sp[0],acc)
XPush_r(ACC);
XMov_rp(TMP,SP,FIELD(0));
XPush_r(TMP);
begin_call();
XCall_m(val_compare);
end_call();
stack_pop(Esp,2);
pop(1);
// test if ok and != invalid_comparison
XCmp_rc(ACC,0);
XJump(JNeq,jnot1);
XCmp_rc(ACC,invalid_comparison);
XJump(JEq,jnot2);
XMov_rc(ACC,CONST(val_false));
XJump_near(jend);
PATCH_JUMP(jnot1);
PATCH_JUMP(jnot2);
XMov_rc(ACC,CONST(val_true));
PATCH_JUMP(jend);
break;
}
case Eq:
test(JNeq);
break;
case Gt:
test(JSignLte);
break;
case Gte:
test(JSignLt);
break;
case Lt:
test(JSignGte);
break;
case Lte:
test(JSignGt);
break;
case Bool:
case Not: {
int *jfalse1, *jfalse2, *jfalse3;
char *jend;
XCmp_rc(ACC,CONST(val_false));
XJump(JEq,jfalse1);
XCmp_rc(ACC,CONST(val_null));
XJump(JEq,jfalse2);
XCmp_rc(ACC,CONST(alloc_int(0)));
XJump(JEq,jfalse3);
XMov_rc(ACC,CONST((op == Bool)?val_true:val_false));
XJump_near(jend);
PATCH_JUMP(jfalse1);
PATCH_JUMP(jfalse2);
PATCH_JUMP(jfalse3);
XMov_rc(ACC,CONST((op == Bool)?val_false:val_true));
PATCH_JUMP(jend);
break;
}
case IsNull: {
int *jnext;
char *jend;
XCmp_rc(ACC,CONST(val_null));
XJump(JNeq,jnext);
XMov_rc(ACC,CONST(val_true));
XJump_near(jend);
PATCH_JUMP(jnext);
XMov_rc(ACC,CONST(val_false));
PATCH_JUMP(jend);
break;
}
case IsNotNull: {
int *jnext;
char *jend;
XCmp_rc(ACC,CONST(val_null));
XJump(JNeq,jnext);
XMov_rc(ACC,CONST(val_false));
XJump_near(jend);
PATCH_JUMP(jnext);
XMov_rc(ACC,CONST(val_true));
PATCH_JUMP(jend);
break;
}
case Call:
call(NORMAL,p);
break;
case ObjCall:
call(THIS_CALL,p);
break;
case TailCall:
{
int stack = (p >> 3);
int nargs = (p & 7);
int i = nargs;
while( i > 0 ) {
i--;
XMov_rp(TMP,SP,FIELD(i));
XMov_pr(SP,FIELD(stack - nargs + i),TMP);
}
if( stack - nargs > 10 ) {
pop_loop(stack - nargs);
} else {
pop(stack - nargs);
}
call(TAIL_CALL,nargs);
// in case we return from a Primitive
XRet();
}
break;
case Ret:
if( p > 10 ) {
pop_loop(p);
} else {
pop(p);
}
XRet();
break;
case Add:
number_op(OP_ADD);
break;
case Sub:
number_op(OP_SUB);
break;
case Div:
number_op(OP_DIV);
break;
case Mult:
number_op(OP_MUL);
break;
case Mod:
number_op(OP_MOD);
break;
case Shl:
int_op(IOP_SHL);
break;
case Shr:
int_op(IOP_SHR);
break;
case UShr:
int_op(IOP_USHR);
break;
case And:
int_op(IOP_AND);
break;
case Or:
int_op(IOP_OR);
break;
case Xor:
int_op(IOP_XOR);
break;
case New:
XPush_r(ACC);
XCall_m(alloc_object);
stack_pop(Esp,1);
break;
case MakeArray:
stack_pad(3);
XPush_r(ACC);
XPush_c(p + 1);
XCall_m(alloc_array);
XMov_rp(TMP,Esp,FIELD(1)); // tmp = saved acc
XMov_pr(ACC,FIELD(1),TMP); // val_array_ptr(acc)[0] = tmp
stack_pop_pad(2,3);
if( p < 6 ) {
i = 0;
while( p > 0 ) {
p--;
i++;
XMov_rp(TMP,SP,FIELD(p));
XMov_pr(ACC,FIELD(i + 1),TMP);
XMov_pc(SP,FIELD(p),0);
}
stack_pop(SP,i);
} else {
char *start;
int *loop;
XMov_rc(TMP2,(p+1));
start = buf.c;
XMov_rp(TMP,SP,FIELD(0));
XMov_pc(SP,FIELD(0),0);
XMov_xr(ACC,TMP2,4,TMP);
stack_pop(SP,1);
XSub_rc(TMP2,1);
XCmp_rc(TMP2,1);
XJump(JNeq,loop);
*loop = (int)(start - buf.c);
}
break;
case MakeArray2:
stack_pad(3);
XPush_r(ACC);
XPush_c(p + 1);
XCall_m(alloc_array);
XMov_rp(TMP,Esp,FIELD(1)); // tmp = saved acc
XMov_pr(ACC,FIELD(p+1),TMP); // val_array_ptr(acc)[p] = tmp
stack_pop_pad(2,3);
if( p < 6 ) {
i = 0;
while( p > 0 ) {
p--;
i++;
XMov_rp(TMP,SP,FIELD(p));
XMov_pr(ACC,FIELD(i),TMP);
XMov_pc(SP,FIELD(p),0);
}
stack_pop(SP,i);
} else {
char *start;
int *loop;
XMov_rc(TMP2,p);
start = buf.c;
XMov_rp(TMP,SP,FIELD(0));
XMov_pc(SP,FIELD(0),0);
XMov_xr(ACC,TMP2,4,TMP);
stack_pop(SP,1);
XSub_rc(TMP2,1);
XCmp_rc(TMP2,0);
XJump(JNeq,loop);
*loop = (int)(start - buf.c);
}
break;
case MakeEnv:
XPush_c(GET_PC());
if( p >= MAX_ENV ) {
XMov_rc(TMP,p);
label(code->make_env_n);
} else {
label(code->make_env[p]);
}
stack_pop(Esp,1);
break;
case Last:
XRet();
break;
case Apply: {
int *jerr1, *jerr2, *jnext, *jcall1, *jcall2, *jdone;
char *jend, *start;
is_int(ACC,true,jerr1);
XMov_rp(TMP,ACC,FIELD(0));
XAnd_rc(TMP,TAG_MASK);
XCmp_rb(TMP,VAL_FUNCTION);
XJump(JNeq,jerr2);
XMov_rp(TMP,ACC,FUNFIELD(nargs));
// what do we do depending of the number of args ?
XCmp_rb(TMP,p);
XJump(JSignGt,jnext);
XJump(JEq,jcall1);
XCmp_rb(TMP,VAR_ARGS);
XJump(JEq,jcall2);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
runtime_error(8,false); // $apply
// build the apply
PATCH_JUMP(jnext);
XPush_r(ACC);
XPush_r(TMP);
XAdd_rc(TMP,1);
XPush_r(TMP);
XCall_m(alloc_array);
stack_pop(Esp,1);
XPop_r(TMP);
XPop_r(TMP2);
// fill the env array
XMov_pr(ACC,FIELD(1),TMP2); // env[0] = f
i = p;
while( i-- > 0 ) {
// env[*pc-i] = sp[i]
XMov_rp(TMP2,SP,FIELD(i));
XMov_pr(ACC,FIELD(1+p-i),TMP2);
}
pop(p);
// fargs = fargs - *pc
XSub_rc(TMP,p);
// prepare stack for alloc_apply
XPush_r(ACC);
XPush_r(TMP);
// fill the env array with null's
XAdd_rc(ACC,(2+p) * 4 );
start = buf.c;
XCmp_rb(TMP,0);
XJump(JEq,jdone);
XMov_pc(ACC,FIELD(0),CONST(val_null));
XAdd_rc(ACC,4);
XSub_rc(TMP,1);
// jump back to "start"
{
char *back;
XJump_near(back);
*back = (char)(start - (back + 1));
}
// call alloc_apply
PATCH_JUMP(jdone);
XCall_m(neko_alloc_apply);
stack_pop(Esp,2);
XJump_near(jend);
// direct call
PATCH_JUMP(jcall1);
PATCH_JUMP(jcall2);
call(NORMAL,p);
PATCH_JUMP(jend);
break;
}
case Trap: {
// save some vm->start on the stack
XMov_rp(TMP,VM,VMFIELD(start));
XPush_r(TMP);
XMov_rp(TMP,VM,VMFIELD(start)+FIELD(1));
XPush_r(TMP);
XMov_rp(TMP,VM,VMFIELD(start)+FIELD(2));
XPush_r(TMP);
XMov_rp(TMP,VM,VMFIELD(start)+FIELD(3));
XPush_r(TMP);
// save magic, ebp , esp and ret_pc
XMov_pc(VM,VMFIELD(start),CONST(jit_handle_trap));
XMov_pr(VM,VMFIELD(start)+FIELD(1),Ebp);
XMov_pr(VM,VMFIELD(start)+FIELD(2),Esp);
XMov_pc(VM,VMFIELD(start)+FIELD(3),-1);
{
jlist *t = (jlist*)alloc(sizeof(jlist));
ctx->buf = buf;
t->pos = POS() - 4;
t->target = (int)((int_val*)(int_val)p - ctx->module->code);
t->next = ctx->traps;
ctx->traps = t;
}
// neko_setup_trap(vm)
XPush_r(ACC);
stack_pad(3);
XPush_r(VM);
begin_call();
XCall_m(neko_setup_trap);
end_call();
stack_pop(Esp,1);
stack_pad(-3);
XPop_r(ACC);
break;
}
case EndTrap: {
// check spmax - trap = sp
get_var_r(TMP,VSpMax);
get_var_r(TMP2,VTrap);
XShl_rc(TMP2,2);
XSub_rr(TMP,TMP2);
XCmp_rr(TMP,SP);
XJump(JEq,jok);
runtime_error(9,false); // Invalid End Trap
PATCH_JUMP(jok);
// restore VM jmp_buf
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start)+FIELD(3),TMP);
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start)+FIELD(2),TMP);
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start)+FIELD(1),TMP);
XPop_r(TMP);
XMov_pr(VM,VMFIELD(start),TMP);
// trap = val_int(sp[5])
XMov_rp(TMP,SP,FIELD(5));
XShr_rc(TMP,1);
set_var_r(VTrap,TMP);
pop(6);
break;
}
case TypeOf: {
int *jnot_int;
char *jend;
is_int(ACC,false,jnot_int);
XMov_rc(ACC,CONST(alloc_int(1))); // t_int != VAL_INT
XJump_near(jend);
PATCH_JUMP(jnot_int);
XMov_rp(TMP,ACC,FIELD(0));
XAnd_rc(TMP,TAG_MASK);
XMov_rc(TMP2,CONST(NEKO_TYPEOF));
XMov_rx(ACC,TMP2,TMP,4);
PATCH_JUMP(jend);
break;
}
case Compare: {
int *jint;
char *jend;
// val_compare(sp[0],acc)
XPush_r(ACC);
XMov_rp(TMP,SP,FIELD(0));
XPush_r(TMP);
begin_call();
XCall_m(val_compare);
end_call();
stack_pop(Esp,2);
XCmp_rc(ACC,invalid_comparison);
XJump(JNeq,jint);
XMov_rc(ACC,CONST(val_null));
XJump_near(jend);
PATCH_JUMP(jint);
XShl_rc(ACC,1);
XOr_rc(ACC,1);
PATCH_JUMP(jend);
pop(1);
break;
}
case PhysCompare: {
int *jeq, *jlow;
char *jend1, *jend2;
XMov_rp(TMP,SP,FIELD(0));
pop(1);
XCmp_rr(ACC,TMP);
XJump(JEq,jeq);
XJump(JSignLt,jlow);
XMov_rc(ACC,CONST(alloc_int(-1)));
XJump_near(jend1);
PATCH_JUMP(jlow);
XMov_rc(ACC,CONST(alloc_int(1)));
XJump_near(jend2);
PATCH_JUMP(jeq);
XMov_rc(ACC,CONST(alloc_int(0)));
PATCH_JUMP(jend1);
PATCH_JUMP(jend2);
break;
}
case Hash: {
int *jerr1, *jerr2;
char *jend;
is_int(ACC,true,jerr1);
XMov_rp(TMP,ACC,FIELD(0));
XAnd_rc(TMP,TAG_MASK);
XCmp_rb(TMP,VAL_STRING);
XJump(JNeq,jerr2);
begin_call();
XAdd_rc(ACC,4); // val_string(acc)
XPush_r(ACC);
XCall_m(val_id);
stack_pop(Esp,1);
XShl_rc(ACC,1);
XOr_rc(ACC,1);
XJump_near(jend);
PATCH_JUMP(jerr1);
PATCH_JUMP(jerr2);
runtime_error(10,false); // $hash
PATCH_JUMP(jend);
break;
}
case JumpTable: {
int njumps = p / 2;
int *jok1, *jok2;
char *jnext1, *jnext2;
is_int(ACC,true,jok1);
XMov_rc(TMP2,njumps);
XJump_near(jnext1);
PATCH_JUMP(jok1);
XCmp_rc(ACC,p);
XJump(JLt,jok2);
XMov_rc(TMP2,njumps);
XJump_near(jnext2);
PATCH_JUMP(jok2);
XMov_rr(TMP2,ACC);
XShr_rc(TMP2,1);
PATCH_JUMP(jnext1);
PATCH_JUMP(jnext2);
get_var_r(TMP,VModule);
// tmp = jit + tmp2 * 5
XMov_rp(TMP,TMP,FIELD(0)); // m->jit
XAdd_rr(TMP,TMP2);
XShl_rc(TMP2,2);
XAdd_rr(TMP,TMP2);
ctx->debug_wait = njumps;
ctx->buf = buf;
{
int add_size = 6;
int small_add_size = 3;
int jump_rsize = 2;
int delta = POS() + add_size + jump_rsize;
if( IS_SBYTE(delta) )
delta += small_add_size - add_size;
XAdd_rc(TMP,delta);
XJump_r(TMP);
}
break;
}
case Loop:
// nothing
break;
default:
ERROR;
}
END_BUFFER;
}
#if defined(STACK_ALIGN_DEBUG) || defined(NEKO_JIT_DEBUG)
# define MAX_OP_SIZE 1000
# define MAX_BUF_SIZE 1000
#else
# define MAX_OP_SIZE 298 // Apply(4) + label(stack_expand)
# define MAX_BUF_SIZE 500
#endif
#define FILL_BUFFER(f,param,ptr) \
{ \
jit_ctx *ctx; \
char *buf = alloc_private(MAX_BUF_SIZE); \
int size; \
ctx = jit_init_context(buf,MAX_BUF_SIZE); \
f(ctx,param); \
size = POS(); \
buf = alloc_jit_mem(size); \
code->ptr = buf; \
memcpy(buf,ctx->baseptr,size); \
ctx->buf.p = buf + size; \
ctx->baseptr = buf; \
jit_finalize_context(ctx); \
}
#ifdef USE_MMAP
static void free_jit_mem( void *_p ) {
int *p = (int*)_p - 1;
munmap(p,*p);
}
static void free_jit_abstract( value v ) {
free_jit_mem(val_data(v));
}
static char *alloc_jit_mem( int size ) {
int *p;
// add space for size
size += sizeof(int);
// round to next page
size += (4096 - size%4096);
p = (int*)mmap(NULL,size,PROT_READ|PROT_WRITE|PROT_EXEC,(MAP_PRIVATE|MAP_ANON),-1,0);
if( p == (int*)-1 ) {
buffer b = alloc_buffer("Failed to allocate JIT memory ");
val_buffer(b,alloc_int(size>>10));
val_buffer(b,alloc_string("KB"));
val_throw(buffer_to_string(b));
}
*p = size;
return (char*)(p + 1);
}
#else
# define alloc_jit_mem alloc_private
#endif
void neko_init_jit() {
int nstrings = sizeof(cstrings) / sizeof(const char *);
int i;
strings = alloc_root(nstrings);
for(i=0;i<nstrings;i++)
strings[i] = alloc_string(cstrings[i]);
code = (jit_code*)alloc_root(sizeof(jit_code) / sizeof(char*));
FILL_BUFFER(jit_boot,NULL,boot);
FILL_BUFFER(jit_trap,0,handle_trap);
FILL_BUFFER(jit_stack_expand,0,stack_expand);
FILL_BUFFER(jit_runtime_error,0,runtime_error);
FILL_BUFFER(jit_invalid_access,0,invalid_access);
FILL_BUFFER(jit_object_get,0,oo_get);
FILL_BUFFER(jit_object_set,0,oo_set);
for(i=0;i<NARGS;i++) {
FILL_BUFFER(jit_call_jit_normal,i,call_normal_jit[i]);
FILL_BUFFER(jit_call_jit_this,i,call_this_jit[i]);
FILL_BUFFER(jit_call_jit_tail,i,call_tail_jit[i]);
FILL_BUFFER(jit_call_prim_normal,i,call_normal_prim[i]);
FILL_BUFFER(jit_call_prim_this,i,call_this_prim[i]);
FILL_BUFFER(jit_call_prim_tail,i,call_tail_prim[i]);
FILL_BUFFER(jit_call_fun_normal,i,call_normal_fun[i]);
FILL_BUFFER(jit_call_fun_this,i,call_this_fun[i]);
FILL_BUFFER(jit_call_fun_tail,i,call_tail_fun[i]);
}
FILL_BUFFER(jit_make_env,-1,make_env_n);
for(i=0;i<MAX_ENV;i++) {
FILL_BUFFER(jit_make_env,i,make_env[i]);
}
jit_boot_seq = code->boot;
jit_handle_trap = code->handle_trap;
}
void neko_free_jit() {
# ifdef USE_MMAP
int i;
for(i=0;i<sizeof(code)/sizeof(char*);i++)
free_jit_mem(((char**)code)[i]);
# endif
free_root((value*)code);
free_root(strings);
code = NULL;
strings = NULL;
jit_boot_seq = NULL;
}
int neko_can_jit() {
return 1;
}
static unsigned int next_function( neko_module *m, unsigned int k, int_val *faddr ) {
while( k < m->nglobals && !val_is_function(m->globals[k]) )
k++;
if( k == m->nglobals ) {
*faddr = -1;
return 0;
}
*faddr = (int_val*)((vfunction*)m->globals[k])->addr - m->code;
return k;
}
void neko_module_jit( neko_module *m ) {
unsigned int i = 0;
int_val faddr;
unsigned int fcursor = next_function(m,0,&faddr);
jit_ctx *ctx = jit_init_context(NULL,0);
ctx->pos = (int*)tmp_alloc(sizeof(int)*(m->codesize + 1));
ctx->module = m;
while( i <= m->codesize ) {
enum OPCODE op = m->code[i];
int curpos = POS();
ctx->pos[i] = curpos;
ctx->curpc = i + 2;
// resize buffer
if( curpos + MAX_OP_SIZE > ctx->size ) {
int nsize = ctx->size ? (ctx->size * 4) / 3 : ((m->codesize + 1) * 20);
char *buf2;
if( nsize - curpos < MAX_OP_SIZE ) nsize = curpos + MAX_OP_SIZE;
buf2 = tmp_alloc(nsize);
memcpy(buf2,ctx->baseptr,curpos);
tmp_free(ctx->baseptr);
ctx->baseptr = buf2;
ctx->buf.p = buf2 + curpos;
ctx->size = nsize;
}
// begin of function : check stack overflow
if( faddr == i ) {
INIT_BUFFER;
label(code->stack_expand);
END_BUFFER;
fcursor = next_function(m,fcursor+1,&faddr);
}
// --------- debug ---------
# ifdef NEKO_JIT_DEBUG
if( ctx->debug_wait )
ctx->debug_wait--;
else {
INIT_BUFFER;
XPush_r(ACC);
// val_print(acc)
XPush_r(ACC);
XCall_m_real(val_print);
stack_pop(Esp,1);
// val_print(pc_pos)
XPush_c(CONST(alloc_int(i)));
XCall_m_real(val_print_2);
stack_pop(Esp,1);
// val_print(alloc_int(spmax - sp))
get_var_r(TMP,VSpMax);
XSub_rr(TMP,SP);
XShr_rc(TMP,1);
XOr_rc(TMP,1);
XPush_r(TMP);
XCall_m_real(val_print_2);
stack_pop(Esp,1);
// val_print(alloc_int(csp - spmin))
XMov_rp(TMP2,VM,VMFIELD(spmin));
XMov_rr(TMP,CSP);
XSub_rr(TMP,TMP2);
XShr_rc(TMP,1);
XOr_rc(TMP,1);
XPush_r(TMP);
XCall_m_real(val_print_3);
stack_pop(Esp,1);
XPop_r(ACC);
END_BUFFER;
}
# endif
i++;
jit_opcode(ctx,op,(int)m->code[i]);
# ifdef _DEBUG
{
int bytes = POS() - curpos;
if( bytes > MAX_OP_SIZE )
ERROR;
}
# endif
i += parameter_table[op];
}
// FINALIZE
{
int csize = POS();
char *rbuf = alloc_jit_mem(csize);
memcpy(rbuf,ctx->baseptr,csize);
tmp_free(ctx->baseptr);
ctx->baseptr = rbuf;
ctx->buf.p = rbuf + csize;
ctx->size = csize;
# ifdef USE_MMAP
m->jit_gc = alloc_abstract(NULL,rbuf);
val_gc(m->jit_gc,free_jit_abstract);
# endif
# ifdef NEKO_JIT_DEBUG
printf("Jit size = %d ( x%.1f )\n",csize,csize * 1.0 / ((m->codesize + 1) * 4));
# endif
jit_finalize_context(ctx);
}
// UPDATE GLOBALS
{
for(i=0;i<m->nglobals;i++) {
vfunction *f = (vfunction*)m->globals[i];
if( !val_is_int(f) && val_tag(f) == VAL_FUNCTION && f->module == m ) {
int pc = (int)((int_val*)f->addr - m->code);
f->t = VAL_JITFUN;
f->addr = (char*)ctx->baseptr + ctx->pos[pc];
}
}
}
m->jit = ctx->baseptr;
tmp_free(ctx->pos);
}
#else // NEKO_JIT_ENABLE
char *jit_boot_seq = NULL;
char *jit_handle_trap = (char*)&jit_boot_seq;
void neko_init_jit() {
}
void neko_free_jit() {
}
int neko_can_jit() {
return 0;
}
void neko_module_jit( neko_module *m ) {
}
#endif
/* ************************************************************************ */
|
447411.c | #include "operations.h"
#include "aes.h"
#include "controlbits.h"
#include "randombytes.h"
#include "crypto_hash.h"
#include "encrypt.h"
#include "encrypt_streaming.h"
#include "decrypt.h"
#include "params.h"
#include "sk_gen.h"
#include "pk_gen.h"
#include "util.h"
#include "operations.h"
#include <stdint.h>
#include <string.h>
int crypto_kem_enc(
unsigned char *c,
unsigned char *key,
const unsigned char *pk
)
{
unsigned char two_e[ 1 + SYS_N/8 ] = {2};
unsigned char *e = two_e + 1;
unsigned char one_ec[ 1 + SYS_N/8 + (SYND_BYTES + 32) ] = {1};
//
encrypt(c, pk, e);
crypto_hash_32b(c + SYND_BYTES, two_e, sizeof(two_e));
memcpy(one_ec + 1, e, SYS_N/8);
memcpy(one_ec + 1 + SYS_N/8, c, SYND_BYTES + 32);
crypto_hash_32b(key, one_ec, sizeof(one_ec));
return 0;
}
/*
* c: syndrome, SYND_BYTES or SYS_T*GFBITS/8 bytes long
* e: error vector \in F_2^n, meaning SYS_N/8 bytes long
*/
int crypto_kem_enc_col_start(unsigned char *c, unsigned char *e)
{
encrypt_init(c, e);
return 0;
}
int crypto_kem_enc_col_update(unsigned char *c, unsigned char *e, unsigned char *col, unsigned int col_nr)
{
encrypt_8cols(c, col, col_nr, e);
return 0;
}
int crypto_kem_enc_col_finish(unsigned char *c, unsigned char *key, unsigned char *e)
{
unsigned char two_e[ 1 + SYS_N/8 ] = {2};
// unsigned char *e = two_e + 1;
memcpy(two_e + 1, e, SYS_N/8);
unsigned char one_ec[ 1 + SYS_N/8 + (SYND_BYTES + 32) ] = {1};
// encrypt was here
crypto_hash_32b(c + SYND_BYTES, two_e, sizeof(two_e));
memcpy(one_ec + 1, e, SYS_N/8);
memcpy(one_ec + 1 + SYS_N/8, c, SYND_BYTES + 32);
crypto_hash_32b(key, one_ec, sizeof(one_ec));
return 0;
}
int crypto_kem_dec(
unsigned char *key,
const unsigned char *c,
const unsigned char *sk,
gf *L
)
{
int i;
unsigned char ret_confirm = 0;
unsigned char ret_decrypt = 0;
uint16_t m;
unsigned char conf[32];
unsigned char two_e[ 1 + SYS_N/8 ] = {2};
unsigned char *e = two_e + 1;
unsigned char preimage[ 1 + SYS_N/8 + (SYND_BYTES + 32) ];
unsigned char *x = preimage;
//
ret_decrypt = decrypt(e, sk + SYS_N/8, c, L);
crypto_hash_32b(conf, two_e, sizeof(two_e));
for (i = 0; i < 32; i++) ret_confirm |= conf[i] ^ c[SYND_BYTES + i];
m = ret_decrypt | ret_confirm;
m -= 1;
m >>= 8;
*x++ = (~m & 0) | (m & 1);
for (i = 0; i < SYS_N/8; i++) *x++ = (~m & sk[i]) | (m & e[i]);
for (i = 0; i < SYND_BYTES + 32; i++) *x++ = c[i];
crypto_hash_32b(key, preimage, sizeof(preimage));
return 0;
}
//int crypto_kem_keypair
// (
// unsigned char *pk,
// unsigned char *sk
// )
//{
// int i;
// unsigned char seed[ 32 ];
// unsigned char r[ SYS_T*2 + (1 << GFBITS)*sizeof(uint32_t) + SYS_N/8 + 32 ];
// unsigned char nonce[ 16 ] = {0};
// unsigned char *rp;
//
// gf f[ SYS_T ]; // element in GF(2^mt)
// gf irr[ SYS_T ]; // Goppa polynomial
// uint32_t perm[ 1 << GFBITS ]; // random permutation
//
// randombytes(seed, sizeof(seed));
// aes256ctx ctx256;
//
// while (1)
// {
// rp = r;
// aes256_keyexp(&ctx256, seed);
// aes256_ctr(r, sizeof(r), nonce, &ctx256);
// memcpy(seed, &r[ sizeof(r)-32 ], 32);
//
// for (i = 0; i < SYS_T; i++) f[i] = load2(rp + i*2); rp += sizeof(f);
// if (genpoly_gen(irr, f)) continue;
//
// for (i = 0; i < (1 << GFBITS); i++) perm[i] = load4(rp + i*4); rp += sizeof(perm);
// if (perm_check(perm)) continue;
//
// memcpy(sk, rp, SYS_N/8);
// controlbits(sk + SYS_N/8 + IRR_BYTES, perm);
//
// break;
// }
//
// return 0;
//}
/*
* compute support elements L
*/
static int gen_L(uint32_t * perm, gf *L)
{
int i;
uint64_t buf[ 1 << GFBITS ];
for (i = 0; i < (1 << GFBITS); i++)
{
buf[i] = perm[i];
buf[i] <<= 31;
buf[i] |= i;
}
sort_63b(1 << GFBITS, buf);
for (i = 0; i < (1 << GFBITS); i++) perm[i] = buf[i] & GFMASK;
for (i = 0; i < SYS_N; i++) L[i] = bitrev(perm[i]);
return 0;
}
/*
* Generate only the extended private key (inv_mat, g, L).
* inv_mat corresponds to the matrix "S" in the paper
* Classic McEliece Implementation with Low Memory Footprint
*/
int crypto_kem_keypair_sk_only(unsigned char *sk, unsigned char *inv_mat, gf *g, gf *L)
{
int i;
unsigned char seed[ 32 ];
unsigned char r[ SYS_T*2 + (1 << GFBITS)*sizeof(uint32_t) + SYS_N/8 + 32 ];
unsigned char nonce[ 16 ] = {0};
unsigned char *rp;
gf f[ SYS_T ]; // element in GF(2^mt)
gf irr[ SYS_T ]; // Goppa polynomial
uint32_t perm[ 1 << GFBITS ]; // random permutation
randombytes(seed, sizeof(seed));
aes256ctx ctx256;
while (1)
{
rp = r;
aes256_keyexp(&ctx256, seed);
aes256_ctr(r, sizeof(r), nonce, &ctx256);
memcpy(seed, &r[ sizeof(r)-32 ], 32);
for (i = 0; i < SYS_T; i++) f[i] = load2(rp + i*2); rp += sizeof(f);
if (genpoly_gen(irr, f)) continue;
for (i = 0; i < (1 << GFBITS); i++) perm[i] = load4(rp + i*4); rp += sizeof(perm);
if (perm_check(perm)) continue;
gen_L(perm, L);
for (i = 0; i < SYS_T; i++) store2(sk + SYS_N/8 + i*2, irr[i]);
if (sk_inv_gen(sk + SYS_N/8, inv_mat, g, L)) continue;
memcpy(sk, rp, SYS_N/8);
//controlbits(sk + SYS_N/8 + IRR_BYTES, perm); /* not needed */
break;
}
return 0;
} |
161882.c | /********************************************************************
* BenchIT - Performance Measurement for Scientific Applications
* Contact: [email protected]
*
* $Id: kernel_main.c 1 2009-09-11 12:26:19Z william $
* $URL: svn+ssh://[email protected]/svn-base/benchit-root/BenchITv6/kernel/numerical/FFT_3D/C/OpenMP/SCSL/complex_double_npo2/kernel_main.c $
* For license details see COPYING in the package base directory
*******************************************************************/
/* Kernel: 3D Fast Fourier Transform, Non-Powers of 2,
* double precision, complex data, SCSL
* (C language), OpenMP version
*******************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <interface.h>
#include <fft.h>
#include <omp.h>
int functionCount;
int valuesPerFunction;
void initData_ip(mydata_t* mdpv,int problemSize)
{
int i;
for (i = 0; i < problemSize * problemSize * problemSize; i++)
{
mdpv->inout[2*i] = 0.0;
mdpv->inout[2*i+1] = 0.0;
}
}
void initData_oop(mydata_t* mdpv,int problemSize)
{
int i;
for (i = 0; i < problemSize * problemSize * problemSize; i++)
{
mdpv->in[2*i] = 1.1/(i+1);
mdpv->in[2*i+1] = 1.2/(i+1);
mdpv->out[2*i] = 0.0;
mdpv->out[2*i+1] = 0.0;
}
}
/* Reads the environment variables used by this kernel. */
void evaluate_environment(mydata_t* pmydata)
{
char* p = 0;
myinttype nMeasurements;
int i;
p = getenv("BENCHIT_KERNEL_PROBLEMSIZES");
if (p != NULL) {
nMeasurements = 1;
while (p) {
p = strstr(p, ",");
if (p) {
p++;
nMeasurements++;
}
}
pmydata->problemSizes = (myinttype *)malloc(sizeof(myinttype) * nMeasurements);
p = getenv("BENCHIT_KERNEL_PROBLEMSIZES");
pmydata->problemSizes[0] = atof(p);
for (i = 1; i < nMeasurements; i++) {
p = strstr(p, ",") + 1;
pmydata->problemSizes[i] = atof(p);
}
}
else {
pmydata->problemSizes = NULL;
}
pmydata->min = pmydata->problemSizes[0];
pmydata->max = pmydata->problemSizes[nMeasurements-1];
pmydata->steps = nMeasurements;
}
void bi_getinfo(bi_info* infostruct)
{
mydata_t* penv;
penv = (mydata_t*)malloc(sizeof(mydata_t));
/* get environment variables for the kernel */
evaluate_environment(penv);
infostruct->codesequence = bi_strdup("zzfft()");
infostruct->kerneldescription = bi_strdup("3D Fast Fourier Transform, Non-Powers of 2, double precision, complex data, SCSL (C), OpenMP version");
infostruct->xaxistext = bi_strdup("Problem Size");
infostruct->num_measurements = penv->steps;
infostruct->num_processes = 1;
infostruct->num_threads_per_process = 0;
infostruct->kernel_execs_mpi1 = 0;
infostruct->kernel_execs_mpi2 = 0;
infostruct->kernel_execs_pvm = 0;
infostruct->kernel_execs_omp = 1;
infostruct->kernel_execs_pthreads = 0;
functionCount = 2; /* in place, out of place */
valuesPerFunction = 1; /* FLOPS (calculated) */
infostruct->numfunctions = functionCount * valuesPerFunction;
/* allocating memory for y axis texts and properties */
allocYAxis(infostruct);
/* setting up y axis texts and properties */
infostruct->yaxistexts[0] = bi_strdup("FLOPS");
infostruct->selected_result[0] = SELECT_RESULT_HIGHEST;
infostruct->base_yaxis[0] = 0;
infostruct->legendtexts[0] = bi_strdup("FLOPS in place");
infostruct->yaxistexts[1] = bi_strdup("FLOPS");
infostruct->selected_result[1] = SELECT_RESULT_HIGHEST;
infostruct->base_yaxis[1] = 0;
infostruct->legendtexts[1] = bi_strdup("FLOPS out of place");
/* this kernel needs a logarithmic x-axis */
infostruct->base_xaxis = 2.0;
/* free all used space */
if (penv)free(penv);
}
void* bi_init(int problemSizemax)
{
mydata_t* pmydata;
pmydata = (mydata_t*)malloc(sizeof(mydata_t));
if (pmydata == 0) {
fprintf(stderr, "Allocation of structure mydata_t failed\n"); fflush(stderr); exit(127);
}
else {
evaluate_environment(pmydata);
problemSizemax = (int)pmydata->max;
}
return (void*)pmydata;
}
int bi_entry(void * mdpv, int iproblemSize, double * dresults)
{
/* dstart, dend: the start and end time of the measurement */
/* dtime: the time for a single measurement in seconds */
double dstart = 0.0, dend = 0.0, dtime = 0.0, dinit = 0.0;
/* flops stores the calculated FLOPS */
double flops = 0.0;
/* ii is used for loop iterations */
myinttype ii, jj, imyproblemSize, numberOfRuns;
/* cast void* pointer */
mydata_t* pmydata = (mydata_t*)mdpv;
int invalid = 0;
int status, isys[1];
isys[0] = 1;
/* calculate real problemSize */
imyproblemSize = (int)(pmydata->problemSizes[iproblemSize - 1]);
/* store the value for the x axis in results[0] */
dresults[0] = (double)imyproblemSize;
/*** in place run ***/
/* malloc */
pmydata->table = (double*)malloc(sizeof(double) * 3 * (2 * imyproblemSize + 256));
pmydata->work = (double*)malloc(sizeof(double) * (2 * imyproblemSize));
pmydata->inout = (double*)malloc(sizeof(double) * imyproblemSize * imyproblemSize * imyproblemSize * 2);
/* create FFT plan */
status = zzfft3d(0, imyproblemSize, imyproblemSize, imyproblemSize, 1.0, NULL, imyproblemSize, imyproblemSize, NULL, imyproblemSize, imyproblemSize, pmydata->table, NULL, isys);
/* init stuff */
initData_ip(pmydata, imyproblemSize);
numberOfRuns = 1;
dstart = bi_gettime();
/* fft calculation */
status = zzfft3d(-1, imyproblemSize, imyproblemSize, imyproblemSize, 1.0, (scsl_zomplex*)pmydata->inout, imyproblemSize, imyproblemSize, (scsl_zomplex*)pmydata->inout, imyproblemSize, imyproblemSize, pmydata->table, pmydata->work, isys);
dend = bi_gettime();
/* calculate the used time*/
dtime = dend - dstart;
dtime -= dTimerOverhead;
/* loop calculation if accuracy is insufficient */
while (dtime < 100 * dTimerGranularity) {
numberOfRuns = numberOfRuns * 2;
dstart = bi_gettime();
for (jj = 0; jj < numberOfRuns; jj++) {
/* fft calculation */
status = zzfft3d(-1, imyproblemSize, imyproblemSize, imyproblemSize, 1.0, (scsl_zomplex*)pmydata->inout, imyproblemSize, imyproblemSize, (scsl_zomplex*)pmydata->inout, imyproblemSize, imyproblemSize, pmydata->table, pmydata->work, isys);
}
dend = bi_gettime();
dtime = dend - dstart;
dtime -= dTimerOverhead;
}
/* check for overflows */
for (ii = 0; ii < imyproblemSize * imyproblemSize * imyproblemSize; ii++) {
if (isnan(pmydata->inout[2 * ii]) || isnan(pmydata->inout[2 * ii + 1])) invalid = 1;
if (isinf(pmydata->inout[2 * ii]) || isinf(pmydata->inout[2 * ii + 1])) invalid = 1;
}
/* if loop was necessary */
if (numberOfRuns > 1) dtime = dtime / numberOfRuns;
/* calculate the used FLOPS */
flops = (double)(5.0 * imyproblemSize * imyproblemSize * imyproblemSize * (log2(1.0 * imyproblemSize * imyproblemSize * imyproblemSize)) / dtime);
/* store the FLOPS in results[1] */
if (invalid == 1) dresults[1] = INVALID_MEASUREMENT;
else dresults[1] = flops;
status = zzfftf(imyproblemSize, pmydata->table);
/* free data */
free(pmydata->table);
free(pmydata->work);
free(pmydata->inout);
/*** out of place run ***/
/* malloc */
pmydata->table = (double*)malloc(sizeof(double) * 3 * (2 * imyproblemSize + 256));
pmydata->work = (double*)malloc(sizeof(double) * (2 * imyproblemSize));
pmydata->in = (double*)malloc(sizeof(double) * imyproblemSize * imyproblemSize * imyproblemSize * 2);
pmydata->out = (double*)malloc(sizeof(double) * imyproblemSize * imyproblemSize * imyproblemSize * 2);
/* create FFT plan */
status = zzfft3d(0, imyproblemSize, imyproblemSize, imyproblemSize, 1.0, NULL, imyproblemSize, imyproblemSize, NULL, imyproblemSize, imyproblemSize, pmydata->table, NULL, isys);
/* init stuff */
initData_oop(pmydata, imyproblemSize);
numberOfRuns = 1;
dstart = bi_gettime();
/* fft calculation */
status = zzfft3d(-1, imyproblemSize, imyproblemSize, imyproblemSize, 1.0, (scsl_zomplex*)pmydata->in, imyproblemSize, imyproblemSize, (scsl_zomplex*)pmydata->out, imyproblemSize, imyproblemSize, pmydata->table, pmydata->work, isys);
dend = bi_gettime();
/* calculate the used time*/
dtime = dend - dstart;
dtime -= dTimerOverhead;
/* loop calculation if accuracy is insufficient */
while (dtime < 100 * dTimerGranularity) {
numberOfRuns = numberOfRuns * 2;
dstart = bi_gettime();
for (ii = 0; ii < numberOfRuns; ii++) {
/* fft calculation */
status = zzfft3d(-1, imyproblemSize, imyproblemSize, imyproblemSize, 1.0, (scsl_zomplex*)pmydata->in, imyproblemSize, imyproblemSize, (scsl_zomplex*)pmydata->out, imyproblemSize, imyproblemSize, pmydata->table, pmydata->work, isys);
}
dend = bi_gettime();
/* calculate the used time*/
dtime = dend - dstart;
dtime -= dTimerOverhead;
}
/* if loop was necessary */
if (numberOfRuns > 1) dtime = dtime / numberOfRuns;
/* check for overflows */
for (ii = 0; ii < imyproblemSize * imyproblemSize * imyproblemSize; ii++) {
if (isnan(pmydata->out[2 * ii]) || isnan(pmydata->out[2 * ii + 1])) invalid = 1;
if (isinf(pmydata->out[2 * ii]) || isinf(pmydata->out[2 * ii + 1])) invalid = 1;
}
/* calculate the used FLOPS */
flops = (double)(5.0 * imyproblemSize * imyproblemSize * imyproblemSize * (log2(1.0 * imyproblemSize * imyproblemSize * imyproblemSize)) / dtime);
/* store the FLOPS in results[2] */
if (invalid == 1) dresults[2] = INVALID_MEASUREMENT;
else dresults[2] = flops;
status = zzfftf(imyproblemSize, pmydata->table);
/* free data */
free(pmydata->table);
free(pmydata->work);
free(pmydata->in);
free(pmydata->out);
return 0;
}
void bi_cleanup(void* mdpv)
{
mydata_t* pmydata = (mydata_t*)mdpv;
if (pmydata) {
free(pmydata->problemSizes);
free(pmydata);
}
return;
}
|
460357.c | /*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "S1AP-IEs"
* found in "S1AP-IEs.asn"
* `asn1c -D ./output -pdu=auto`
*/
#include "S1ap-SerialNumber.h"
int
S1ap_SerialNumber_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if(st->size > 0) {
/* Size in bits */
size = 8 * st->size - (st->bits_unused & 0x07);
} else {
size = 0;
}
if((size == 16)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
/*
* This type is implemented using BIT_STRING,
* so here we adjust the DEF accordingly.
*/
static asn_oer_constraints_t asn_OER_type_S1ap_SerialNumber_constr_1 CC_NOTUSED = {
{ 0, 0 },
16 /* (SIZE(16..16)) */};
static asn_per_constraints_t asn_PER_type_S1ap_SerialNumber_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 0, 0, 16, 16 } /* (SIZE(16..16)) */,
0, 0 /* No PER value map */
};
static const ber_tlv_tag_t asn_DEF_S1ap_SerialNumber_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
};
asn_TYPE_descriptor_t asn_DEF_S1ap_SerialNumber = {
"S1ap-SerialNumber",
"S1ap-SerialNumber",
&asn_OP_BIT_STRING,
asn_DEF_S1ap_SerialNumber_tags_1,
sizeof(asn_DEF_S1ap_SerialNumber_tags_1)
/sizeof(asn_DEF_S1ap_SerialNumber_tags_1[0]), /* 1 */
asn_DEF_S1ap_SerialNumber_tags_1, /* Same as above */
sizeof(asn_DEF_S1ap_SerialNumber_tags_1)
/sizeof(asn_DEF_S1ap_SerialNumber_tags_1[0]), /* 1 */
{ &asn_OER_type_S1ap_SerialNumber_constr_1, &asn_PER_type_S1ap_SerialNumber_constr_1, S1ap_SerialNumber_constraint },
0, 0, /* No members */
&asn_SPC_BIT_STRING_specs /* Additional specs */
};
|
39414.c | /*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : usb0_function_userdef.c
* $Rev: 1116 $
* $Date:: 2014-07-09 16:29:19 +0900#$
* Device(s) : RZ/A1H
* Tool-Chain :
* OS : None
* H/W Platform :
* Description : RZ/A1H R7S72100 USB Sample Program
* Operation :
* Limitations :
*******************************************************************************/
/*******************************************************************************
Includes <System Includes> , "Project Includes"
*******************************************************************************/
#include <stdio.h>
#include "r_typedefs.h"
#include "iodefine.h"
#include "devdrv_usb_function_api.h"
#include "usb0_function_dmacdrv.h" /* common DMAC driver for USB */
/*******************************************************************************
Typedef definitions
*******************************************************************************/
/*******************************************************************************
Macro definitions
*******************************************************************************/
#define DUMMY_ACCESS OSTM0CNT
/* #define CACHE_WRITEBACK */
/*******************************************************************************
Imported global variables and functions (from other files)
*******************************************************************************/
extern int32_t io_cwb(unsigned long start, unsigned long end);
/*******************************************************************************
Exported global variables and functions (to be accessed by other files)
*******************************************************************************/
static void usb0_function_enable_dmac0(uint32_t src, uint32_t dst, uint32_t count,
uint32_t size, uint32_t dir, uint32_t fifo, uint16_t dfacc);
static void usb0_function_enable_dmac1(uint32_t src, uint32_t dst, uint32_t count,
uint32_t size, uint32_t dir, uint32_t fifo, uint16_t dfacc);
static void Userdef_USB_usb0_function_delay_10us_2(void);
/*******************************************************************************
Private global variables and functions
*******************************************************************************/
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_d0fifo_dmaintid
* Description : get D0FIFO DMA Interrupt ID
* Arguments : none
* Return Value : D0FIFO DMA Interrupt ID
*******************************************************************************/
IRQn_Type Userdef_USB_usb0_function_d0fifo_dmaintid (void)
{
#if 0
return DMAINT1_IRQn;
#else
return 0xFFFF;
#endif
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_d1fifo_dmaintid
* Description : get D1FIFO DMA Interrupt ID
* Arguments : none
* Return Value : D1FIFO DMA Interrupt ID
*******************************************************************************/
IRQn_Type Userdef_USB_usb0_function_d1fifo_dmaintid (void)
{
#if 0
return DMAINT1_IRQn;
#else
return 0xFFFF;
#endif
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_attach
* Description : Wait for the software of 1ms.
* : Alter this function according to the user's system.
* Arguments : none
* Return Value : none
*******************************************************************************/
void Userdef_USB_usb0_function_attach (void)
{
#if(1) /* Mbed */
#else
printf("\n");
printf("channel 0 attach device\n");
printf("\n");
#endif
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_detach
* Description : Wait for the software of 1ms.
* : Alter this function according to the user's system.
* Arguments : none
* Return Value : none
*******************************************************************************/
void Userdef_USB_usb0_function_detach (void)
{
#if(1) /* Mbed */
#else
printf("\n");
printf("channel 0 detach device\n");
printf("\n");
#endif
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_delay_1ms
* Description : Wait for the software of 1ms.
* : Alter this function according to the user's system.
* Arguments : none
* Return Value : none
*******************************************************************************/
void Userdef_USB_usb0_function_delay_1ms (void)
{
volatile int i;
volatile unsigned long tmp;
/*
* Wait 1ms (Please change for your MCU).
*/
for (i = 0; i < 1440; ++i)
{
tmp = DUMMY_ACCESS;
}
#if(1) /* mbed */
(void)tmp;
#endif
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_delay_xms
* Description : Wait for the software in the period of time specified by the
* : argument.
* : Alter this function according to the user's system.
* Arguments : uint32_t msec ; Wait Time (msec)
* Return Value : none
*******************************************************************************/
void Userdef_USB_usb0_function_delay_xms (uint32_t msec)
{
volatile unsigned short i;
for (i = 0; i < msec; ++i)
{
Userdef_USB_usb0_function_delay_1ms();
}
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_delay_10us
* Description : Waits for software for the period specified by the argument.
* : Alter this function according to the user's system.
* Arguments : uint32_t usec ; Wait Time(x 10usec)
* Return Value : none
*******************************************************************************/
void Userdef_USB_usb0_function_delay_10us (uint32_t usec)
{
#if(1) /* mbed */
volatile uint32_t i;
#else
volatile int i;
#endif
/* Wait 10us (Please change for your MCU) */
for (i = 0; i < usec; ++i)
{
Userdef_USB_usb0_function_delay_10us_2();
}
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_delay_10us_2
* Description : Waits for software for the period specified by the argument.
* : Alter this function according to the user's system.
* Arguments : none
* Return Value : none
*******************************************************************************/
static void Userdef_USB_usb0_function_delay_10us_2 (void)
{
volatile int i;
volatile unsigned long tmp;
/* Wait 1us (Please change for your MCU) */
for (i = 0; i < 14; ++i)
{
tmp = DUMMY_ACCESS;
}
#if(1) /* mbed */
(void)tmp;
#endif
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_delay_500ns
* Description : Wait for software for 500ns.
* : Alter this function according to the user's system.
* Arguments : none
* Return Value : none
*******************************************************************************/
void Userdef_USB_usb0_function_delay_500ns (void)
{
#if(1) /* mbed */
#else
volatile int i;
#endif
volatile unsigned long tmp;
/* Wait 500ns (Please change for your MCU) */
/* Wait 500ns I clock 266MHz */
tmp = DUMMY_ACCESS;
#if(1) /* mbed */
(void)tmp;
#endif
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_start_dma
* Description : Enables DMA transfer on the information specified by the argument.
* : Set DMAC register by this function to enable DMA transfer.
* : After executing this function, USB module is set to start DMA
* : transfer. DMA transfer should not wait for DMA transfer complete.
* Arguments : USB_FUNCTION_DMA_t *dma : DMA parameter
* : typedef struct{
* : uint32_t fifo; FIFO for using
* : uint32_t buffer; Start address of transfer source/destination
* : uint32_t bytes; Transfer size(Byte)
* : uint32_t dir; Transfer direction(0:Buffer->FIFO, 1:FIFO->Buffer)
* : uint32_t size; DMA transfer size
* : } USB_FUNCTION_DMA_t;
* : uint16_t dfacc ; 0 : cycle steal mode
* : 1 : 16byte continuous mode
* : 2 : 32byte continuous mode
* Return Value : none
*******************************************************************************/
void Userdef_USB_usb0_function_start_dma (USB_FUNCTION_DMA_t * dma, uint16_t dfacc)
{
uint32_t trncount;
uint32_t src;
uint32_t dst;
uint32_t size;
uint32_t dir;
#ifdef CACHE_WRITEBACK
uint32_t ptr;
#endif
trncount = dma->bytes;
dir = dma->dir;
if (dir == USB_FUNCTION_FIFO2BUF)
{
/* DxFIFO determination */
dst = dma->buffer;
#ifndef __USB_FUNCTION_DF_ACC_ENABLE__
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
src = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
src = (uint32_t)(&USB200.D1FIFO.UINT32);
}
size = dma->size;
if (size == 0)
{
src += 3; /* byte access */
}
else if (size == 1)
{
src += 2; /* short access */
}
else
{
/* Do Nothing */
}
#else
size = dma->size;
if (size == 2)
{
/* 32bit access */
if (dfacc == 2)
{
/* 32byte access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
src = (uint32_t)(&USB200.D0FIFOB0);
}
else
{
src = (uint32_t)(&USB200.D1FIFOB0);
}
}
else if (dfacc == 1)
{
/* 16byte access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
src = (uint32_t)(&USB200.D0FIFOB0);
}
else
{
src = (uint32_t)(&USB200.D1FIFOB0);
}
}
else
{
/* normal access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
src = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
src = (uint32_t)(&USB200.D1FIFO.UINT32);
}
}
}
else if (size == 1)
{
/* 16bit access */
dfacc = 0; /* force normal access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
src = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
src = (uint32_t)(&USB200.D1FIFO.UINT32);
}
src += 2; /* short access */
}
else
{
/* 8bit access */
dfacc = 0; /* force normal access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
src = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
src = (uint32_t)(&USB200.D1FIFO.UINT32);
}
src += 3; /* byte access */
}
#endif
}
else
{
/* DxFIFO determination */
src = dma->buffer;
#ifndef __USB_FUNCTION_DF_ACC_ENABLE__
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
dst = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
dst = (uint32_t)(&USB200.D1FIFO.UINT32);
}
size = dma->size;
if (size == 0)
{
dst += 3; /* byte access */
}
else if (size == 1)
{
dst += 2; /* short access */
}
else
{
/* Do Nothing */
}
#else
size = dma->size;
if (size == 2)
{
/* 32bit access */
if (dfacc == 2)
{
/* 32byte access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
dst = (uint32_t)(&USB200.D0FIFOB0);
}
else
{
dst = (uint32_t)(&USB200.D1FIFOB0);
}
}
else if (dfacc == 1)
{
/* 16byte access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
dst = (uint32_t)(&USB200.D0FIFOB0);
}
else
{
dst = (uint32_t)(&USB200.D1FIFOB0);
}
}
else
{
/* normal access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
dst = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
dst = (uint32_t)(&USB200.D1FIFO.UINT32);
}
}
}
else if (size == 1)
{
/* 16bit access */
dfacc = 0; /* force normal access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
dst = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
dst = (uint32_t)(&USB200.D1FIFO.UINT32);
}
dst += 2; /* short access */
}
else
{
/* 8bit access */
dfacc = 0; /* force normal access */
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
dst = (uint32_t)(&USB200.D0FIFO.UINT32);
}
else
{
dst = (uint32_t)(&USB200.D1FIFO.UINT32);
}
dst += 3; /* byte access */
}
#endif
}
#ifdef CACHE_WRITEBACK
ptr = (uint32_t)dma->buffer;
if ((ptr & 0x20000000ul) == 0)
{
io_cwb((uint32_t)ptr, (uint32_t)(ptr) + trncount);
}
#endif
if (dma->fifo == USB_FUNCTION_D0FIFO_DMA)
{
usb0_function_enable_dmac0(src, dst, trncount, size, dir, dma->fifo, dfacc);
}
else
{
usb0_function_enable_dmac1(src, dst, trncount, size, dir, dma->fifo, dfacc);
}
}
/*******************************************************************************
* Function Name: usb0_function_enable_dmac0
* Description : Enables DMA transfer on the information specified by the argument.
* Arguments : uint32_t src : src address
* : uint32_t dst : dst address
* : uint32_t count : transfer byte
* : uint32_t size : transfer size
* : uint32_t dir : direction
* : uint32_t fifo : FIFO(D0FIFO or D1FIFO)
* : uint16_t dfacc : 0 : normal access
* : : 1 : 16byte access
* : : 2 : 32byte access
* Return Value : none
*******************************************************************************/
static void usb0_function_enable_dmac0 (uint32_t src, uint32_t dst, uint32_t count,
uint32_t size, uint32_t dir, uint32_t fifo, uint16_t dfacc)
{
dmac_transinfo_t trans_info;
uint32_t request_factor = 0;
int32_t ret;
/* ==== Variable setting for DMAC initialization ==== */
trans_info.src_addr = (uint32_t)src; /* Start address of transfer source */
trans_info.dst_addr = (uint32_t)dst; /* Start address of transfer destination */
trans_info.count = (uint32_t)count; /* Total byte count to be transferred */
#ifndef __USB_FUNCTION_DF_ACC_ENABLE__
if (size == 0)
{
trans_info.src_size = DMAC_TRANS_SIZE_8; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_8; /* Transfer destination transfer size */
}
else if (size == 1)
{
trans_info.src_size = DMAC_TRANS_SIZE_16; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_16; /* Transfer destination transfer size */
}
else if (size == 2)
{
trans_info.src_size = DMAC_TRANS_SIZE_32; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_32; /* Transfer destination transfer size */
}
else
{
#if(1) /* Mbed */
#else
printf("size error!!\n");
#endif
}
#else
if (dfacc == 2)
{
/* 32byte access */
trans_info.src_size = DMAC_TRANS_SIZE_256; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_256; /* Transfer destination transfer size */
}
else if (dfacc == 1)
{
/* 16byte access */
trans_info.src_size = DMAC_TRANS_SIZE_128; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_128; /* Transfer destination transfer size */
}
else
{
/* normal access */
if (size == 0)
{
trans_info.src_size = DMAC_TRANS_SIZE_8; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_8; /* Transfer destination transfer size */
}
else if (size == 1)
{
trans_info.src_size = DMAC_TRANS_SIZE_16; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_16; /* Transfer destination transfer size */
}
else if (size == 2)
{
trans_info.src_size = DMAC_TRANS_SIZE_32; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_32; /* Transfer destination transfer size */
}
else
{
#if(1) /* Mbed */
#else
printf("size error!!\n");
#endif
}
}
#endif
if (dir == USB_FUNCTION_FIFO2BUF)
{
request_factor =DMAC_REQ_USB0_DMA0_RX; /* USB_0 channel 0 receive FIFO full */
trans_info.saddr_dir = DMAC_TRANS_ADR_NO_INC; /* Count direction of transfer source address */
trans_info.daddr_dir = DMAC_TRANS_ADR_INC; /* Count direction of transfer destination address */
}
else if (dir == USB_FUNCTION_BUF2FIFO)
{
request_factor =DMAC_REQ_USB0_DMA0_TX; /* USB_0 channel 0 receive FIFO empty */
trans_info.saddr_dir = DMAC_TRANS_ADR_INC; /* Count direction of transfer source address */
trans_info.daddr_dir = DMAC_TRANS_ADR_NO_INC; /* Count direction of transfer destination address */
}
else
{
/* Do Nothing */
}
/* ==== DMAC initialization ==== */
usb0_function_DMAC1_PeriReqInit((const dmac_transinfo_t *)&trans_info,
DMAC_MODE_REGISTER,
DMAC_SAMPLE_SINGLE,
request_factor,
0); /* Don't care DMAC_REQ_REQD is setting in
usb0_function_DMAC1_PeriReqInit() */
/* ==== DMAC startup ==== */
ret = usb0_function_DMAC1_Open(DMAC_REQ_MODE_PERI);
if (ret != 0)
{
#if(1) /* Mbed */
#else
printf("DMAC1 Open error!!\n");
#endif
}
return;
}
/*******************************************************************************
* Function Name: usb0_function_enable_dmac1
* Description : Enables DMA transfer on the information specified by the argument.
* Arguments : uint32_t src : src address
* : uint32_t dst : dst address
* : uint32_t count : transfer byte
* : uint32_t size : transfer size
* : uint32_t dir : direction
* : uint32_t fifo : FIFO(D0FIFO or D1FIFO)
* : uint16_t dfacc : 0 : normal access
* : : 1 : 16byte access
* : : 2 : 32byte access
* Return Value : none
*******************************************************************************/
static void usb0_function_enable_dmac1 (uint32_t src, uint32_t dst, uint32_t count,
uint32_t size, uint32_t dir, uint32_t fifo, uint16_t dfacc)
{
dmac_transinfo_t trans_info;
uint32_t request_factor = 0;
int32_t ret;
/* ==== Variable setting for DMAC initialization ==== */
trans_info.src_addr = (uint32_t)src; /* Start address of transfer source */
trans_info.dst_addr = (uint32_t)dst; /* Start address of transfer destination */
trans_info.count = (uint32_t)count; /* Total byte count to be transferred */
#ifndef __USB_FUNCTION_DF_ACC_ENABLE__
if (size == 0)
{
trans_info.src_size = DMAC_TRANS_SIZE_8; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_8; /* Transfer destination transfer size */
}
else if (size == 1)
{
trans_info.src_size = DMAC_TRANS_SIZE_16; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_16; /* Transfer destination transfer size */
}
else if (size == 2)
{
trans_info.src_size = DMAC_TRANS_SIZE_32; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_32; /* Transfer destination transfer size */
}
else
{
#if(1) /* Mbed */
#else
printf("size error!!\n");
#endif
}
#else
if (dfacc == 2)
{
/* 32byte access */
trans_info.src_size = DMAC_TRANS_SIZE_256; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_256; /* Transfer destination transfer size */
}
else if (dfacc == 1)
{
/* 16byte access */
trans_info.src_size = DMAC_TRANS_SIZE_128; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_128; /* Transfer destination transfer size */
}
else
{
/* normal access */
if (size == 0)
{
trans_info.src_size = DMAC_TRANS_SIZE_8; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_8; /* Transfer destination transfer size */
}
else if (size == 1)
{
trans_info.src_size = DMAC_TRANS_SIZE_16; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_16; /* Transfer destination transfer size */
}
else if (size == 2)
{
trans_info.src_size = DMAC_TRANS_SIZE_32; /* Transfer source transfer size */
trans_info.dst_size = DMAC_TRANS_SIZE_32; /* Transfer destination transfer size */
}
else
{
#if(1) /* Mbed */
#else
printf("size error!!\n");
#endif
}
}
#endif
if (dir == USB_FUNCTION_FIFO2BUF)
{
request_factor =DMAC_REQ_USB0_DMA1_RX; /* USB_0 channel 0 receive FIFO full */
trans_info.saddr_dir = DMAC_TRANS_ADR_NO_INC; /* Count direction of transfer source address */
trans_info.daddr_dir = DMAC_TRANS_ADR_INC; /* Count direction of transfer destination address */
}
else if (dir == USB_FUNCTION_BUF2FIFO)
{
request_factor =DMAC_REQ_USB0_DMA1_TX; /* USB_0 channel 0 receive FIFO empty */
trans_info.saddr_dir = DMAC_TRANS_ADR_INC; /* Count direction of transfer source address */
trans_info.daddr_dir = DMAC_TRANS_ADR_NO_INC; /* Count direction of transfer destination address */
}
else
{
/* Do Nothing */
}
/* ==== DMAC initialization ==== */
usb0_function_DMAC2_PeriReqInit((const dmac_transinfo_t *)&trans_info,
DMAC_MODE_REGISTER,
DMAC_SAMPLE_SINGLE,
request_factor,
0); /* Don't care DMAC_REQ_REQD is setting in
usb0_function_DMAC1_PeriReqInit() */
/* ==== DMAC startup ==== */
ret = usb0_function_DMAC2_Open(DMAC_REQ_MODE_PERI);
if (ret != 0)
{
#if(1) /* Mbed */
#else
printf("DMAC2 Open error!!\n");
#endif
}
return;
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_stop_dma0
* Description : Disables DMA transfer.
* : This function should be executed to DMAC executed at the time
* : of specification of D0_FIF0_DMA in dma->fifo.
* Arguments : none
* Return Value : uint32_t return Transfer Counter register(DMATCRn) value
* : regarding to the bus width.
*******************************************************************************/
uint32_t Userdef_USB_usb0_function_stop_dma0 (void)
{
uint32_t remain;
/* ==== DMAC release ==== */
usb0_function_DMAC1_Close(&remain);
return remain;
}
/*******************************************************************************
* Function Name: Userdef_USB_usb0_function_stop_dma1
* Description : Disables DMA transfer.
* : This function should be executed to DMAC executed at the time
* : of specification of D1_FIF0_DMA in dma->fifo.
* Arguments : none
* Return Value : uint32_t return Transfer Counter register(DMATCRn) value
* : regarding to the bus width.
*******************************************************************************/
uint32_t Userdef_USB_usb0_function_stop_dma1 (void)
{
uint32_t remain;
/* ==== DMAC release ==== */
usb0_function_DMAC2_Close(&remain);
return remain;
}
/* End of File */
|
266429.c | //+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1996.
//
// File: ras.c
//
// Contents:
//
// Classes:
//
// Functions:
//
// History: 2-09-96 RichardW Created
//
//----------------------------------------------------------------------------
#include "msgina.h"
#include <wchar.h>
#include <wincrypt.h>
#include <sclogon.h>
#include <raserror.h>
#define NP_Nbf 0x1
#define NP_Ipx 0x2
#define NP_Ip 0x4
HANDLE hRasApi ;
VOID WINAPI
MyRasCallback(
IN DWORD_PTR dwCallbackId,
IN DWORD dwEventCode,
IN LPWSTR pszEntry,
IN LPVOID pEventArgs )
/* RasPhonebookDlg callback. 'DwCallbackId' is the ID provided in
** parameters to RasPhonebookDlg. 'DwEventCode' indicates the
** RASPBDEVENT_* event that has occurred. 'PszEntry' is the name of the
** entry on which the event occurred. 'PEventArgs' is the event-specific
** parameter block passed to us during RasPhonebookDlg callback.
*/
{
RASNOUSERW* pInfo;
PGLOBALS pGlobals;
DebugLog((DEB_TRACE, "RasCallback: %#x, %#x, %ws, %#x\n",
dwCallbackId, dwEventCode, pszEntry, pEventArgs ));
/* Fill in information about the not yet logged on user.
*/
pInfo = (RASNOUSERW* )pEventArgs;
pGlobals = (PGLOBALS) dwCallbackId;
if (dwEventCode == RASPBDEVENT_NoUserEdit)
{
if (pInfo->szUserName[0])
{
wcscpy( pGlobals->UserName, pInfo->szUserName );
}
if (pInfo->szPassword[0])
{
wcscpy( pGlobals->Password, pInfo->szPassword );
RtlInitUnicodeString( &pGlobals->PasswordString, pGlobals->Password );
pGlobals->Seed = 0;
HidePassword( &pGlobals->Seed, &pGlobals->PasswordString );
}
}
else if (dwEventCode == RASPBDEVENT_NoUser)
{
ZeroMemory( pInfo, sizeof( RASNOUSERW ) );
pInfo->dwTimeoutMs = 2 * 60 * 1000;
pInfo->dwSize = sizeof( RASNOUSERW );
wcsncpy( pInfo->szUserName, pGlobals->UserName, UNLEN );
wcsncpy( pInfo->szDomain, pGlobals->Domain, DNLEN );
RevealPassword( &pGlobals->PasswordString );
wcsncpy( pInfo->szPassword, pGlobals->Password, PWLEN );
HidePassword( &pGlobals->Seed, &pGlobals->PasswordString );
}
if( pGlobals->SmartCardLogon
&& (NULL != pInfo))
{
pInfo->dwFlags |= RASNOUSER_SmartCard;
}
}
DWORD
GetRasDialOutProtocols(
void )
/* Returns a bit field containing NP_<protocol> flags for the installed
** PPP protocols. The term "installed" here includes enabling in RAS
** Setup.
*/
{
//
// Since after the connections checkin, RAS is always installed
// and there is no way to uninstall it, all we need to check here
// is if there are protocols installed that can be used by RAS to
// dial out. By default any protocol installed is available for RAS
// to dial out on. This can be overridden from the phonebook entry.
//
static const TCHAR c_szRegKeyIp[] =
TEXT("SYSTEM\\CurrentControlSet\\Services\\Tcpip");
static const TCHAR c_szRegKeyIpx[] =
TEXT("SYSTEM\\CurrentControlSet\\Services\\NwlnkIpx");
static const TCHAR c_szRegKeyNbf[] =
TEXT("SYSTEM\\CurrentControlSet\\Services\\Nbf");
struct PROTOCOL_INFO
{
DWORD dwFlag;
LPCTSTR pszRegkey;
};
static const struct PROTOCOL_INFO c_aProtocolInfo[] =
{
{
NP_Ip,
c_szRegKeyIp,
},
{
NP_Ipx,
c_szRegKeyIpx,
},
{
NP_Nbf,
c_szRegKeyNbf,
},
};
DWORD dwfInstalledProtocols = 0;
DWORD dwNumProtocols = sizeof(c_aProtocolInfo)/sizeof(c_aProtocolInfo[0]);
DWORD i;
HKEY hkey;
DebugLog(( DEB_TRACE, "GetRasDialOutProtocols...\n" ));
for(i = 0; i < dwNumProtocols; i++)
{
if(0 == RegOpenKey(HKEY_LOCAL_MACHINE,
c_aProtocolInfo[i].pszRegkey,
&hkey))
{
dwfInstalledProtocols |= c_aProtocolInfo[i].dwFlag;
RegCloseKey(hkey);
}
}
DebugLog(( DEB_TRACE, "GetRasDialOutProtocols: dwfInstalledProtocols=0x%x\n",
dwfInstalledProtocols));
return dwfInstalledProtocols;
}
BOOL
PopupRasPhonebookDlg(
IN HWND hwndOwner,
IN PGLOBALS pGlobals,
OUT BOOL* pfTimedOut
)
/* Popup the RAS common phonebook dialog to let user establish connection.
** 'HwndOwner' is the window to own the RAS dialog or NULL if none. '*PfTimedOut' is
** set TRUE if the dialog timed out, false otherwise.
**
** Returns true if user made a connection, false if not, i.e. an error
** occurred, RAS is not installed or user could not or chose not to
** connect.
*/
{
BOOL fConnected;
RASPBDLG info;
DWORD Protocols;
PUCHAR pvScData = NULL;
struct EAPINFO
{
DWORD dwSizeofEapInfo;
PBYTE pbEapInfo;
DWORD dwSizeofPINInfo;
PBYTE pbPINInfo;
};
struct EAPINFO eapinfo;
struct EAPINFO *pEapInfo = NULL;
*pfTimedOut = FALSE;
Protocols = GetRasDialOutProtocols();
if (Protocols == 0)
{
return( FALSE );
}
if(pGlobals->SmartCardLogon)
{
PULONG pulScData;
struct FLAT_UNICODE_STRING
{
USHORT Length;
USHORT MaximumLength;
BYTE abdata[1];
};
struct FLAT_UNICODE_STRING *pFlatUnicodeString;
PWLX_SC_NOTIFICATION_INFO ScInfo = NULL ;
//
// Get the set of strings indicating the reader and CSP
// to be used for the smart card. We will pass this info
// down to RAS.
//
pWlxFuncs->WlxGetOption( pGlobals->hGlobalWlx,
WLX_OPTION_SMART_CARD_INFO,
(ULONG_PTR *) &ScInfo);
if ( !ScInfo )
{
return FALSE;
}
//
// Validate the SC info against some common user
// errors
//
if ( ( ScInfo->pszReader ) &&
( ScInfo->pszCard == NULL ) )
{
//
// The card could not be read. Might not be
// inserted correctly.
//
LocalFree(ScInfo);
return FALSE;
}
if ( ( ScInfo->pszReader ) &&
( ScInfo->pszCryptoProvider == NULL ) )
{
//
// Got a card, but the CSP for it could not be
// found.
//
LocalFree(ScInfo);
return FALSE;
}
pvScData = ScBuildLogonInfo(ScInfo->pszCard,
ScInfo->pszReader,
ScInfo->pszContainer,
ScInfo->pszCryptoProvider );
LocalFree(ScInfo);
if ( ! pvScData )
{
return FALSE ;
}
pulScData = (PULONG) pvScData;
ZeroMemory(&eapinfo, sizeof(struct EAPINFO));
eapinfo.dwSizeofEapInfo = *pulScData;
eapinfo.pbEapInfo = (BYTE *) pvScData;
eapinfo.dwSizeofPINInfo = sizeof(UNICODE_STRING) +
(sizeof(TCHAR) *
(1 + lstrlen(pGlobals->PasswordString.Buffer)));
//
// Flatten out the unicode string.
//
pFlatUnicodeString = LocalAlloc(LPTR, eapinfo.dwSizeofPINInfo);
if(NULL == pFlatUnicodeString)
{
if(NULL != pvScData)
{
LocalFree(pvScData);
}
return (FALSE);
}
pFlatUnicodeString->Length = pGlobals->PasswordString.Length;
pFlatUnicodeString->MaximumLength = pGlobals->PasswordString.MaximumLength;
lstrcpy((LPTSTR) pFlatUnicodeString->abdata,
(LPTSTR) pGlobals->PasswordString.Buffer);
eapinfo.pbPINInfo = (BYTE *) pFlatUnicodeString;
pEapInfo = &eapinfo;
}
ZeroMemory( &info, sizeof(info) );
info.dwSize = sizeof(info);
info.hwndOwner = hwndOwner;
info.dwFlags = RASPBDFLAG_NoUser;
info.pCallback = MyRasCallback;
info.dwCallbackId = (ULONG_PTR) pGlobals;
info.reserved2 = (ULONG_PTR) pEapInfo;
fConnected = RasPhonebookDlg( NULL, NULL, &info );
if (info.dwError == STATUS_TIMEOUT)
*pfTimedOut = TRUE;
if( (pEapInfo)
&& (pEapInfo->pbPINInfo))
{
LocalFree(pEapInfo->pbPINInfo);
}
if(NULL != pvScData)
{
LocalFree(pvScData);
}
return fConnected;
}
BOOL
IsRASServiceRunning()
{
BOOL bRet = FALSE; // assume the service is not running
SC_HANDLE hServiceMgr;
hServiceMgr = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
if (hServiceMgr != NULL)
{
SC_HANDLE hService = OpenService(hServiceMgr, TEXT("RASMAN"), SERVICE_QUERY_STATUS);
if (hService != NULL)
{
SERVICE_STATUS status;
if (QueryServiceStatus(hService, &status) &&
(status.dwCurrentState == SERVICE_RUNNING))
{
// the RAS service is running
bRet = TRUE;
}
CloseServiceHandle(hService);
}
CloseServiceHandle(hServiceMgr);
}
return bRet;
}
// we need to treat RAS connections made by the system luid as created by the user.
// this allows us to "do the right thing" when a connection is made from the C-A-D dialog
// before any user is logged in
__inline BOOL IsEqualOrSystemLuid(PLUID pLuid, PLUID pUserLuid)
{
BOOL bRet = FALSE;
static LUID luidSystem = SYSTEM_LUID;
if (RtlEqualLuid(pLuid, pUserLuid) || RtlEqualLuid(pLuid, &luidSystem))
{
// return true if pLuid matches the users luid or the system luid
bRet = TRUE;
}
return bRet;
}
BOOL
HangupRasConnections(
PGLOBALS pGlobals
)
{
DWORD dwError;
RASCONN rasconn;
RASCONN* prc;
DWORD cbSize;
DWORD cConnections;
HLOCAL pBuffToFree = NULL;
if (!IsRASServiceRunning())
{
return TRUE;
}
prc = &rasconn;
prc->dwSize = sizeof(RASCONN);
cbSize = sizeof(RASCONN);
dwError = RasEnumConnections(prc, &cbSize, &cConnections);
if (dwError == ERROR_BUFFER_TOO_SMALL)
{
pBuffToFree = LocalAlloc(LPTR, cbSize);
prc = (RASCONN*)pBuffToFree;
if (prc)
{
prc->dwSize = sizeof(RASCONN);
dwError = RasEnumConnections(prc, &cbSize, &cConnections);
}
}
if (dwError == ERROR_SUCCESS)
{
UINT i;
for (i = 0; i < cConnections; i++)
{
if (IsEqualOrSystemLuid(&prc[i].luid, &pGlobals->LogonId))
{
RasHangUp(prc[i].hrasconn);
}
}
}
if (pBuffToFree)
{
LocalFree(pBuffToFree);
}
return (dwError == ERROR_SUCCESS);
}
|
569322.c | /**
* \file main-sdl2.c
* \brief Angband SDL2 port
*
* Copyright (c) 1997 Ben Harrison and others
*
* This work is free software; you can redistribute it and/or modify it
* under the terms of either:
*
* a) the GNU General Public License as published by the Free Software
* Foundation, version 2, or
*
* b) the "Angband licence":
* This software may be copied and distributed for educational, research,
* and not for profit purposes provided that this copyright and statement
* are included in all such copies. Other copyrights may also apply.
*/
#include "angband.h"
#ifdef USE_SDL2
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_ttf.h"
#include "init.h"
#include "ui-term.h"
#include "buildid.h"
#include "ui-display.h"
#include "ui-command.h"
#include "player-calcs.h"
#include "ui-output.h"
#include "game-world.h"
#include "ui-input.h"
#include "ui-prefs.h"
#include "grafmode.h"
#include "ui-game.h"
#include "ui-map.h"
#include "parser.h"
#define MAX_SUBWINDOWS \
ANGBAND_TERM_MAX
/* that should be plenty... */
#define MAX_WINDOWS 4
#define MAX_FONTS 128
#define MAX_BUTTONS 32
#define INIT_SDL_FLAGS \
(SDL_INIT_VIDEO)
#define INIT_IMG_FLAGS \
(IMG_INIT_PNG)
/* this is the main term screen, where all the action takes place */
#define MAIN_SUBWINDOW 0
/* for symmetry with main subwindow */
#define MAIN_WINDOW 0
/* size of the keypress queue (term->key_queue) */
#define SUBWINDOW_KEYQ_SIZE(subwindow_ptr) \
((subwindow_ptr)->index == MAIN_SUBWINDOW ? 1024 : 32)
#define DEFAULT_ATTR_BLANK \
COLOUR_WHITE
#define DEFAULT_CHAR_BLANK ' '
#define DEFAULT_DISPLAY 0
#define DEFAULT_CONFIG_FILE "sdl2init.txt"
#define DEFAULT_CONFIG_FILE_DIR \
ANGBAND_DIR_USER
#define DEFAULT_ALPHA_FULL 0xFF
#define ALPHA_PERCENT(p) \
(DEFAULT_ALPHA_FULL * (p) / 100)
#define DEFAULT_ALPHA_LOW \
ALPHA_PERCENT(80)
/* for "Alpha" button; in percents */
#define DEFAULT_ALPHA_STEP 10
#define DEFAULT_ALPHA_LOWEST 0
#define DEFAULT_WALLPAPER "att-128.png"
#define DEFAULT_WALLPAPER_DIR \
ANGBAND_DIR_ICONS
#define DEFAULT_WINDOW_ICON "att-32.png"
#define DEFAULT_WINDOW_ICON_DIR \
ANGBAND_DIR_ICONS
#define DEFAULT_ABOUT_ICON "att-128.png"
#define DEFAULT_ABOUT_ICON_DIR \
ANGBAND_DIR_ICONS
#define DEFAULT_FONT_HINTING \
TTF_HINTING_LIGHT
/* border of subwindows, in pixels */
#define DEFAULT_BORDER 8
#define DEFAULT_XTRA_BORDER \
(DEFAULT_BORDER * 2)
#define DEFAULT_VISIBLE_BORDER 2
#define DEFAULT_FONT_SIZE 0
/* XXX hack: the widest character present in a font
* for determining font advance (width) */
#define GLYPH_FOR_ADVANCE 'W'
#define GLYPH_PADDING 1
#define DEFAULT_VECTOR_FONT_SIZE 12
#define DEFAULT_FONT "10x20x.fon"
#define DEFAULT_FONT_W \
(10 + 2 * GLYPH_PADDING)
#define DEFAULT_FONT_H \
(20 + 2 * GLYPH_PADDING)
#define DEFAULT_STATUS_BAR_FONT "8x13x.fon"
#define DEFAULT_STATUS_BAR_FONT_W \
(8 + 2 * GLYPH_PADDING)
#define DEFAULT_STATUS_BAR_FONT_H \
(13 + 2 * GLYPH_PADDING)
#define MAX_VECTOR_FONT_SIZE 24
#define MIN_VECTOR_FONT_SIZE 4
#define DEFAULT_BUTTON_BORDER 8
#define DEFAULT_LINE_HEIGHT(h) ((h) * 150 / 100)
#define DEFAULT_MENU_LINE_HEIGHT(h) ((h) * 200 / 100)
#define DEFAULT_MENU_LINE_WIDTH(w) \
((w) + DEFAULT_BUTTON_BORDER + DEFAULT_XTRA_BORDER)
/* update period in window delays (160 milliseconds, assuming 60 fps) */
#define DEFAULT_IDLE_UPDATE_PERIOD 10
#define DEFAULT_WINDOW_BG_COLOR \
COLOUR_L_DARK
#define DEFAULT_SUBWINDOW_BG_COLOR \
COLOUR_DARK
#define DEFAULT_SUBWINDOW_CURSOR_COLOR \
COLOUR_YELLOW
#define DEFAULT_STATUS_BAR_BG_COLOR \
COLOUR_DARK
#define DEFAULT_SHADE_COLOR \
COLOUR_SHADE
#define DEFAULT_SUBWINDOW_BORDER_COLOR \
COLOUR_SHADE
#define DEFAULT_STATUS_BAR_BUTTON_ACTIVE_COLOR \
COLOUR_WHITE
#define DEFAULT_STATUS_BAR_BUTTON_INACTIVE_COLOR \
COLOUR_L_DARK
#define DEFAULT_MENU_FG_ACTIVE_COLOR \
COLOUR_WHITE
#define DEFAULT_MENU_FG_INACTIVE_COLOR \
COLOUR_WHITE
#define DEFAULT_MENU_BG_ACTIVE_COLOR \
COLOUR_SHADE
#define DEFAULT_MENU_BG_INACTIVE_COLOR \
COLOUR_DARK
#define DEFAULT_MENU_TOGGLE_FG_ACTIVE_COLOR \
COLOUR_WHITE
#define DEFAULT_MENU_TOGGLE_FG_INACTIVE_COLOR \
COLOUR_L_DARK
#define DEFAULT_MENU_PANEL_OUTLINE_COLOR \
COLOUR_SHADE
#define DEFAULT_ERROR_COLOR \
COLOUR_RED
#define DEFAULT_ABOUT_BG_COLOR \
COLOUR_SHADE
#define DEFAULT_ABOUT_BORDER_OUTER_COLOR \
COLOUR_L_DARK
#define DEFAULT_ABOUT_BORDER_INNER_COLOR \
COLOUR_WHITE
#define DEFAULT_ABOUT_TEXT_COLOR \
COLOUR_WHITE
/* shockbolt's tiles are 64x64; dungeon is 198 tiles long;
* 64 * 198 is 12672 which is bigger than any possible texture! */
#define REASONABLE_MAP_TILE_WIDTH 16
#define REASONABLE_MAP_TILE_HEIGHT 16
/* angband needs at least 80x24 main term, else severe bugs happen */
#define MIN_COLS_MAIN 80
#define MIN_ROWS_MAIN 24
/* some reasonable values - we dont want the player to resize
* the term into nothing! */
#define MIN_COLS_OTHER 12
#define MIN_ROWS_OTHER 3
#define MIN_TILE_WIDTH 1
#define MAX_TILE_WIDTH 9
#define MIN_TILE_HEIGHT 1
#define MAX_TILE_HEIGHT 9
/* some random numbers */
#define DEFAULT_WINDOW_MINIMUM_W 198
#define DEFAULT_WINDOW_MINIMUM_H 66
#define DEFAULT_SNAP_RANGE \
DEFAULT_FONT_W
#define CHECK_BUTTON_GROUP_TYPE(button, button_group, data_type) \
do { \
assert((button)->info.group == (button_group)); \
assert((button)->info.type == (data_type)); \
} while (0)
enum wallpaper_mode {
/* so that we won't forget to actually set wallpaper */
WALLPAPER_INVALID = 0,
WALLPAPER_DONT_SHOW,
WALLPAPER_TILED,
WALLPAPER_CENTERED,
WALLPAPER_SCALED
};
enum button_data_type {
BUTTON_DATA_INVALID = 0,
BUTTON_DATA_NONE,
BUTTON_DATA_IVAL,
BUTTON_DATA_UVAL,
BUTTON_DATA_SUBVAL,
BUTTON_DATA_FONTVAL,
BUTTON_DATA_TERMVAL,
BUTTON_DATA_ALPHAVAL
};
enum button_group {
BUTTON_GROUP_INVALID = 0,
BUTTON_GROUP_NONE,
BUTTON_GROUP_MOVESIZE,
BUTTON_GROUP_SUBWINDOWS,
BUTTON_GROUP_MENU
};
enum button_movesize {
BUTTON_MOVESIZE_INVALID = 0,
BUTTON_MOVESIZE_MOVING,
BUTTON_MOVESIZE_SIZING
};
enum button_tile_scale {
BUTTON_TILE_SIZE_INVALID = 0,
BUTTON_TILE_SIZE_WIDTH,
BUTTON_TILE_SIZE_HEIGHT
};
enum button_caption_position {
CAPTION_POSITION_INVALID = 0,
CAPTION_POSITION_CENTER,
CAPTION_POSITION_LEFT,
CAPTION_POSITION_RIGHT
};
enum font_type {
FONT_TYPE_INVALID = 0,
FONT_TYPE_RASTER,
FONT_TYPE_VECTOR
};
struct ttf {
TTF_Font *handle;
/* this is not a real rect for glyphs;
* x and y are offsets to add to coords of where glyph/string should be rendered;
* f and h are glyph metrics but include glyph padding
* (for calculating rows/cols, mostly) */
SDL_Rect glyph;
};
/* the array of ascii chars was generated by this perl script:
* my $ascii = join '', map /\p{Print}/ ? $_ : ' ', map chr, 0 .. 127;
* for (my $i = 0; $i < length($ascii); $i += 40) {
* my $s = substr $ascii, $i, 40;
* $s =~ s#\\#\\\\#g;
* $s =~ s#"#\\"#g;
* print qq(\t"$s"\n);
* }
*/
static const char g_ascii_codepoints_for_cache[] =
" !\"#$%&'"
"()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO"
"PQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvw"
"xyz{|}~ ";
/* Simple font cache. Only for ascii (which is like 99.99% (?) of what the game
* displays, anyway) */
#define ASCII_CACHE_SIZE \
(N_ELEMENTS(g_ascii_codepoints_for_cache) - 1)
struct font_cache {
SDL_Texture *texture;
/* it wastes some space... so what? */
SDL_Rect rects[ASCII_CACHE_SIZE];
};
/* 0 is also a valid codepoint, of course... that's just for finding bugs */
#define IS_CACHED_ASCII_CODEPOINT(c) \
((c) > 0 && (c) < ASCII_CACHE_SIZE)
struct font {
struct ttf ttf;
char *name;
char *path;
int size;
/* index of font in g_font_info array */
size_t index;
struct font_cache cache;
};
struct subwindow_border {
bool visible;
bool error;
SDL_Color color;
int width;
};
struct subwindow_config {
char *font_name;
int font_size;
};
struct window_config {
int renderer_flags;
int renderer_index;
int window_flags;
char *wallpaper_path;
char *font_name;
int font_size;
};
/* struct subwindow is representation of angband's term */
struct subwindow {
bool inited;
bool loaded;
bool linked;
bool visible;
struct subwindow_config *config;
/* top in z-order */
bool top;
bool always_top;
unsigned index;
int rows;
int cols;
/* struct ttf also has this information; these members are
* just for convinience */
int font_width;
int font_height;
/* coordinates of full rect are relative to coordinates of window
* (basically, full rect is texture) */
SDL_Rect full_rect;
/* coordinates of inner rect are relative to that of full rect */
SDL_Rect inner_rect;
/* for use when resizing term */
SDL_Rect sizing_rect;
/* a one pixel texture, mostly for displaying something when
* the player is resizing term */
SDL_Texture *aux_texture;
/* background color */
SDL_Color color;
struct subwindow_border borders;
SDL_Texture *texture;
struct font *font;
struct window *window;
struct term *term;
};
struct button;
struct button_bank {
struct button *buttons;
size_t size;
size_t number;
};
struct menu_panel {
SDL_Rect rect;
struct button_bank button_bank;
struct menu_panel *next;
};
typedef bool (*button_click)(struct window *window,
struct button *button);
typedef void (*button_render)(const struct window *window,
struct button *button);
typedef bool (*button_event)(struct window *window,
struct button *button, const SDL_Event *event);
typedef void (*button_menu)(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel);
struct fontval {
struct subwindow *subwindow;
/* index of font in g_font_info array */
size_t index;
bool size_ok;
};
struct termval {
struct subwindow *subwindow;
u32b value;
};
struct alphaval {
struct subwindow *subwindow;
int real_value;
int show_value;
};
struct button_info {
enum button_data_type type;
union {
int ival;
unsigned uval;
struct subwindow *subval;
struct fontval fontval;
struct termval termval;
struct alphaval alphaval;
} data;
enum button_group group;
};
struct menu_elem {
const char *caption;
struct button_info info;
button_render on_render;
button_menu on_menu;
};
struct button_callbacks {
/* this function should render the button;
* otherwise, the button will be invisible */
button_render on_render;
/* optional custom event handler */
button_event on_event;
/* if there is no custon handler,
* this function should do something when button is clicked
* otherwise, the button will be useless */
button_click on_click;
/* for use only with menu; only custom events */
button_menu on_menu;
};
struct button {
/* selected means the user pointed at button and pressed
* mouse button (but not released yet) */
bool selected;
/* highlighted means the user pointed at button but
* not clicking yet */
bool highlighted;
char *caption;
SDL_Rect full_rect;
SDL_Rect inner_rect;
struct button_info info;
struct button_callbacks callbacks;
};
struct status_bar {
struct font *font;
struct button_bank button_bank;
struct menu_panel *menu_panel;
struct window *window;
SDL_Rect full_rect;
SDL_Rect inner_rect;
SDL_Color color;
SDL_Texture *texture;
bool in_menu;
};
struct graphics {
SDL_Texture *texture;
int id;
int tile_pixel_w;
int tile_pixel_h;
int overdraw_row;
int overdraw_max;
};
/* thats for dragging terms */
struct move_state {
bool active;
bool moving;
int originx;
int originy;
struct subwindow *subwindow;
};
/* thats for resizing terms */
struct size_state {
bool active;
bool sizing;
int originx;
int originy;
bool left;
bool top;
struct subwindow *subwindow;
};
struct wallpaper {
int w;
int h;
SDL_Texture *texture;
enum wallpaper_mode mode;
};
/* struct window is a real window on screen, it has one or more
* subwindows (terms) in it */
struct window {
bool inited;
bool loaded;
/* id is SDL's id, for use with events */
Uint32 id;
/* and this is our id, mostly for debugging */
unsigned index;
struct window_config *config;
/* toggles visibility of cursor */
bool cursor;
/* does window have mouse focus? */
bool focus;
/* window has changed and must be redrawn */
bool dirty;
/* limiter for frames */
Uint32 next_redraw;
/* from display mode */
int delay;
/* as reported by SDL_GetWindowFlags() */
Uint32 flags;
/* position and size of window as it is on display */
SDL_Rect full_rect;
/* size of window without status bar, basically */
SDL_Rect inner_rect;
SDL_Color color;
/* for making terms transparent while moving or sizing them */
Uint8 alpha;
SDL_Window *window;
SDL_Renderer *renderer;
int pixelformat;
struct wallpaper wallpaper;
struct move_state move_state;
struct size_state size_state;
struct status_bar status_bar;
struct graphics graphics;
struct subwindow *subwindows[MAX_SUBWINDOWS];
};
struct font_info {
char *name;
char *path;
int size;
size_t index;
enum font_type type;
bool loaded;
};
/* there are also global arrays of subwindows and windows
* those are at the end of the file */
const char help_sdl2[] = "SDL2 frontend";
static SDL_Color g_colors[MAX_COLORS];
static struct font_info g_font_info[MAX_FONTS];
/* Forward declarations */
static void init_globals(void);
static void free_globals(void);
static bool read_config_file(void);
static void dump_config_file(void);
static void init_colors(void);
static void start_windows(void);
static void start_window(struct window *window);
static void load_font(struct font *font);
static bool reload_font(struct subwindow *subwindow,
const struct font_info *info);
static void free_font(struct font *font);
static const struct font_info *find_font_info(const char *name);
static void get_string_metrics(struct font *font, const char *str, int *w, int *h);
static struct window *get_new_window(unsigned index);
static void wipe_window(struct window *window, int display);
/* create default config for spawning a window via gui */
static void wipe_window_aux_config(struct window *window);
static void adjust_window_geometry(struct window *window);
static void free_window(struct window *window);
static struct window *get_window_by_id(Uint32 id);
static struct window *get_window_direct(unsigned index);
static bool has_visible_subwindow(const struct window *window, unsigned index);
static void resize_window(struct window *window, int w, int h);
static struct subwindow *get_new_subwindow(unsigned index);
static void load_subwindow(struct window *window, struct subwindow *subwindow);
static bool is_subwindow_loaded(unsigned index);
static struct subwindow *transfer_subwindow(struct window *window, unsigned index);
static struct subwindow *get_subwindow_by_xy(const struct window *window, int x, int y);
static struct subwindow *get_subwindow_by_index(const struct window *window,
unsigned index, bool visible);
static struct subwindow *get_subwindow_direct(unsigned index);
/* this function loads new subwindow if it's not already loaded */
static struct subwindow *make_subwindow(struct window *window, unsigned index);
static void sort_to_top(struct window *window);
static void bring_to_top(struct window *window, struct subwindow *subwindow);
static void render_borders(struct subwindow *subwindow);
static SDL_Texture *load_image(const struct window *window, const char *path);
static void reload_all_graphics(graphics_mode *mode);
static void free_graphics(struct graphics *graphics);
static void load_terms(void);
static void load_term(struct subwindow *subwindow);
static void clear_pw_flag(struct subwindow *subwindow);
static bool adjust_subwindow_geometry(const struct window *window,
struct subwindow *subwindow);
static bool is_ok_col_row(const struct subwindow *subwindow,
const SDL_Rect *rect, int cell_w, int cell_h);
static void resize_rect(SDL_Rect *rect,
int left, int top, int right, int bottom);
static bool is_point_in_rect(int x, int y, const SDL_Rect *rect);
static bool is_close_to(int a, int b, unsigned range);
static bool is_over_status_bar(const struct status_bar *status_bar, int x, int y);
static void make_button_bank(struct button_bank *bank);
static void free_button_bank(struct button_bank *button_bank);
static void free_menu_panel(struct menu_panel *menu_panel);
static struct menu_panel *get_menu_panel_by_xy(struct menu_panel *menu_panel,
int x, int y);
static void refresh_angband_terms(void);
static void handle_quit(void);
static void wait_anykey(void);
/* Functions */
static void render_clear(const struct window *window,
SDL_Texture *texture, const SDL_Color *color)
{
SDL_SetRenderTarget(window->renderer, texture);
SDL_SetRenderDrawColor(window->renderer,
color->r, color->g, color->b, color->a);
SDL_RenderClear(window->renderer);
}
static void render_wallpaper_tiled(const struct window *window)
{
SDL_SetRenderTarget(window->renderer, NULL);
SDL_Rect rect = {0, 0, window->wallpaper.w, window->wallpaper.h};
for (rect.y = window->inner_rect.y;
rect.y < window->inner_rect.h;
rect.y += rect.h)
{
for (rect.x = window->inner_rect.x;
rect.x < window->inner_rect.w;
rect.x += rect.w)
{
SDL_RenderCopy(window->renderer, window->wallpaper.texture, NULL, &rect);
}
}
}
static void render_wallpaper_scaled(const struct window *window)
{
SDL_SetRenderTarget(window->renderer, NULL);
SDL_RenderCopy(window->renderer, window->wallpaper.texture, NULL, NULL);
}
static void render_wallpaper_centered(const struct window *window)
{
SDL_Rect rect;
rect.w = window->wallpaper.w;
rect.h = window->wallpaper.h;
rect.x = window->inner_rect.x + (window->inner_rect.w - rect.w) / 2;
rect.y = window->inner_rect.y + (window->inner_rect.h - rect.h) / 2;
SDL_SetRenderTarget(window->renderer, NULL);
SDL_RenderCopy(window->renderer, window->wallpaper.texture, NULL, &rect);
}
static void render_background(const struct window *window)
{
render_clear(window, NULL, &window->color);
switch (window->wallpaper.mode) {
case WALLPAPER_DONT_SHOW:
return;
case WALLPAPER_TILED:
render_wallpaper_tiled(window);
return;
case WALLPAPER_CENTERED:
render_wallpaper_centered(window);
return;
case WALLPAPER_SCALED:
render_wallpaper_scaled(window);
return;
default:
quit_fmt("bad wallpaper mode %d in window %u",
window->wallpaper.mode, window->index);
break;
}
}
static void render_all(const struct window *window)
{
render_background(window);
SDL_RenderCopy(window->renderer,
window->status_bar.texture, NULL, &window->status_bar.full_rect);
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL && subwindow->visible) {
SDL_RenderCopy(window->renderer,
subwindow->texture,
NULL, &subwindow->full_rect);
}
}
}
static void render_status_bar(const struct window *window)
{
render_clear(window, window->status_bar.texture, &window->status_bar.color);
for (size_t i = 0; i < window->status_bar.button_bank.number; i++) {
struct button *button = &window->status_bar.button_bank.buttons[i];
if (button->callbacks.on_render != NULL) {
button->callbacks.on_render(window, button);
}
}
}
static void render_outline_rect(const struct window *window,
SDL_Texture *texture, const SDL_Rect *rect, const SDL_Color *color)
{
SDL_SetRenderTarget(window->renderer, texture);
SDL_SetRenderDrawColor(window->renderer,
color->r, color->g, color->b, color->a);
SDL_RenderDrawRect(window->renderer, rect);
}
static void render_outline_rect_width(const struct window *window,
SDL_Texture *texture, const SDL_Rect *rect, const SDL_Color *color, int width)
{
SDL_Rect dst = *rect;
for (int i = 0; i < width; i++) {
render_outline_rect(window, texture, &dst, color);
resize_rect(&dst, 1, 1, -1, -1);
}
}
static void render_fill_rect(const struct window *window,
SDL_Texture *texture, const SDL_Rect *rect, const SDL_Color *color)
{
SDL_SetRenderTarget(window->renderer, texture);
SDL_SetRenderDrawColor(window->renderer,
color->r, color->g, color->b, color->a);
SDL_RenderFillRect(window->renderer, rect);
}
static void render_window_in_menu(const struct window *window)
{
render_background(window);
SDL_SetRenderTarget(window->renderer, NULL);
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL && subwindow->visible) {
if (subwindow->sizing_rect.w > 0 && subwindow->sizing_rect.h > 0) {
SDL_SetRenderTarget(window->renderer, subwindow->aux_texture);
/* in case subwindow's color changed */
render_fill_rect(window,
subwindow->aux_texture, NULL, &subwindow->color);
SDL_SetRenderTarget(window->renderer, NULL);
SDL_RenderCopy(window->renderer,
subwindow->aux_texture, NULL, &subwindow->sizing_rect);
}
SDL_RenderCopy(window->renderer,
subwindow->texture,
NULL, &subwindow->full_rect);
}
}
/* render it last to allow the menu to draw over subwindows */
render_status_bar(window);
SDL_SetRenderTarget(window->renderer, NULL);
SDL_RenderCopy(window->renderer,
window->status_bar.texture, NULL, &window->status_bar.full_rect);
}
static void set_subwindow_alpha(struct subwindow *subwindow, int alpha)
{
SDL_SetTextureAlphaMod(subwindow->texture, alpha);
SDL_SetTextureAlphaMod(subwindow->aux_texture, alpha);
}
static void set_subwindows_alpha(const struct window *window, int alpha)
{
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL) {
set_subwindow_alpha(subwindow, alpha);
}
}
}
/* this function allows to perform special things that are not
* needed while playing the game, like moving terms */
static void redraw_window_in_menu(struct window *window)
{
set_subwindows_alpha(window, window->alpha);
render_window_in_menu(window);
SDL_RenderPresent(window->renderer);
window->next_redraw = SDL_GetTicks() + window->delay;
}
/* this function is mostly used while normally playing the game */
static void redraw_window(struct window *window)
{
if (window->status_bar.in_menu) {
/* we called (perhaps via refresh_angband_terms()) Term_fresh() in menu */
redraw_window_in_menu(window);
return;
}
/* XXX XXX dont forget to prerender status bar in loader! */
render_all(window);
SDL_RenderPresent(window->renderer);
window->next_redraw = SDL_GetTicks() + window->delay;
}
static void try_redraw_window(struct window *window)
{
if (window->next_redraw < SDL_GetTicks()) {
redraw_window(window);
}
}
static void redraw_all_windows(bool dirty)
{
for (unsigned i = 0; i < MAX_WINDOWS; i++) {
struct window *window = get_window_direct(i);
if (window != NULL && (dirty ? window->dirty : true)) {
render_status_bar(window);
redraw_window(window);
window->dirty = false;
}
}
}
static void render_utf8_string(const struct window *window,
const struct font *font, SDL_Texture *dst_texture,
SDL_Color fg, SDL_Rect rect, const char *utf8_string)
{
SDL_Surface *surface = TTF_RenderUTF8_Blended(font->ttf.handle, utf8_string, fg);
SDL_Texture *src_texture = SDL_CreateTextureFromSurface(window->renderer, surface);
SDL_FreeSurface(surface);
rect.x += font->ttf.glyph.x;
rect.y += font->ttf.glyph.y;
SDL_SetRenderTarget(window->renderer, dst_texture);
SDL_RenderCopy(window->renderer, src_texture, NULL, &rect);
SDL_DestroyTexture(src_texture);
}
/* this function is typically called in a loop, so for efficiency it doesnt
* SetRenderTarget; caller must do it (but it does SetTextureColorMod) */
static void render_glyph_mono(const struct window *window,
const struct font *font, SDL_Texture *dst_texture,
int x, int y, const SDL_Color *fg, uint32_t codepoint)
{
if (codepoint == DEFAULT_CHAR_BLANK) {
return;
}
SDL_Rect dst = {
x + font->ttf.glyph.x,
y + font->ttf.glyph.y,
0, 0
};
if (IS_CACHED_ASCII_CODEPOINT(codepoint)) {
dst.w = font->cache.rects[codepoint].w;
dst.h = font->cache.rects[codepoint].h;
SDL_SetTextureColorMod(font->cache.texture, fg->r, fg->g, fg->b);
SDL_RenderCopy(window->renderer,
font->cache.texture, &font->cache.rects[codepoint], &dst);
} else {
SDL_Surface *surface = TTF_RenderGlyph_Blended(font->ttf.handle,
(Uint16) codepoint, *fg);
if (surface == NULL) {
return;
}
SDL_Rect src = {
0, 0,
MIN(surface->w, font->ttf.glyph.w - font->ttf.glyph.x),
MIN(surface->h, font->ttf.glyph.h - font->ttf.glyph.y)
};
dst.w = src.w;
dst.h = src.h;
SDL_Texture *texture = SDL_CreateTextureFromSurface(window->renderer, surface);
assert(texture != NULL);
SDL_RenderCopy(window->renderer, texture, &src, &dst);
SDL_FreeSurface(surface);
SDL_DestroyTexture(texture);
}
}
static void render_cursor(struct subwindow *subwindow,
int col, int row, bool big)
{
if (!subwindow->window->cursor) {
return;
}
SDL_Color color = g_colors[DEFAULT_SUBWINDOW_CURSOR_COLOR];
SDL_Rect rect = {
subwindow->inner_rect.x + subwindow->font_width * col,
subwindow->inner_rect.y + subwindow->font_height * row,
subwindow->font_width * (big ? tile_width : 1),
subwindow->font_height * (big ? tile_height : 1)
};
render_outline_rect(subwindow->window, subwindow->texture,
&rect, &color);
}
static void render_grid_cell_text(const struct subwindow *subwindow,
SDL_Texture *texture, int x, int y)
{
struct grid_data grid_data;
int a;
int ta;
wchar_t c;
wchar_t tc;
map_info(y, x, &grid_data);
grid_data_as_text(&grid_data, &a, &c, &ta, &tc);
/* apparently either the same as a or obscured by a */
(void) tc;
SDL_Color fg = g_colors[a % MAX_COLORS];
SDL_Color bg;
switch (ta / MAX_COLORS) {
case BG_BLACK:
bg = subwindow->color;
break;
case BG_SAME:
bg = fg;
break;
case BG_DARK:
bg = g_colors[DEFAULT_SHADE_COLOR];
break;
default:
/* debugging */
bg = g_colors[DEFAULT_ERROR_COLOR];
}
SDL_Rect rect = {
x * subwindow->font_width,
y * subwindow->font_height,
subwindow->font_width,
subwindow->font_height
};
render_fill_rect(subwindow->window, texture, &rect, &bg);
render_glyph_mono(subwindow->window,
subwindow->font, texture, rect.x, rect.y, &fg, (uint32_t) c);
}
/* does not SetRenderTarget */
static void render_tile_rect_scaled(const struct subwindow *subwindow,
int col, int row, SDL_Rect dst, int a, int c)
{
struct graphics *graphics = &subwindow->window->graphics;
SDL_Rect src = {0, 0, graphics->tile_pixel_w, graphics->tile_pixel_h};
int src_row = a & 0x7f;
int src_col = c & 0x7f;
src.x = src_col * src.w;
src.y = src_row * src.h;
if (graphics->overdraw_row != 0
&& src_row >= graphics->overdraw_row
&& src_row <= graphics->overdraw_max)
{
src.y -= src.h;
dst.y -= dst.h;
dst.h *= 2;
src.h *= 2;
}
SDL_RenderCopy(subwindow->window->renderer,
graphics->texture, &src, &dst);
}
static void render_tile_font_scaled(const struct subwindow *subwindow,
int col, int row, int a, int c, bool fill)
{
struct graphics *graphics = &subwindow->window->graphics;
SDL_Rect dst = {
subwindow->inner_rect.x + col * subwindow->font_width,
subwindow->inner_rect.y + row * subwindow->font_height,
subwindow->font_width * tile_width,
subwindow->font_height * tile_height
};
if (fill) {
render_fill_rect(subwindow->window, subwindow->texture, &dst, &subwindow->color);
}
SDL_Rect src = {0, 0, graphics->tile_pixel_w, graphics->tile_pixel_h};
SDL_SetRenderTarget(subwindow->window->renderer, subwindow->texture);
int src_row = a & 0x7f;
int src_col = c & 0x7f;
src.x = src_col * src.w;
src.y = src_row * src.h;
if (graphics->overdraw_row != 0
&& row > 2
&& src_row >= graphics->overdraw_row
&& src_row <= graphics->overdraw_max)
{
src.y -= src.h;
dst.y -= dst.h;
dst.h *= 2;
src.h *= 2;
SDL_RenderCopy(subwindow->window->renderer,
graphics->texture, &src, &dst);
Term_mark(col, row - tile_height);
Term_mark(col, row);
} else {
SDL_RenderCopy(subwindow->window->renderer,
graphics->texture, &src, &dst);
}
}
static void render_grid_cell_tile(const struct subwindow *subwindow,
SDL_Texture *texture, SDL_Rect tile, int x, int y)
{
struct grid_data grid_data;
int a;
int ta;
wchar_t c;
wchar_t tc;
map_info(y, x, &grid_data);
grid_data_as_text(&grid_data, &a, &c, &ta, &tc);
SDL_SetRenderTarget(subwindow->window->renderer, texture);
render_tile_rect_scaled(subwindow, x, y, tile, ta, tc);
if (a == ta && c == tc) {
return;
}
render_tile_rect_scaled(subwindow, x, y, tile, a, c);
}
static void clear_all_borders(struct window *window)
{
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL) {
subwindow->borders.error = false;
render_borders(subwindow);
}
}
}
static void render_borders(struct subwindow *subwindow)
{
SDL_Rect rect = {0};
SDL_QueryTexture(subwindow->texture, NULL, NULL, &rect.w, &rect.h);
SDL_Color *color;
if (!subwindow->borders.error) {
if (subwindow->borders.visible) {
color = &subwindow->borders.color;
} else {
color = &subwindow->color;
}
} else {
color = &g_colors[DEFAULT_ERROR_COLOR];
}
render_outline_rect_width(subwindow->window,
subwindow->texture, &rect, color,
subwindow->borders.width);
}
static SDL_Texture *make_subwindow_texture(const struct window *window, int w, int h)
{
SDL_Texture *texture = SDL_CreateTexture(window->renderer,
window->pixelformat, SDL_TEXTUREACCESS_TARGET, w, h);
if (texture == NULL) {
quit_fmt("cant create texture for subwindow in window %u: %s",
window->index, SDL_GetError());
}
if (SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND) != 0) {
SDL_DestroyTexture(texture);
quit_fmt("cant set blend mode for texture in window %u: %s",
window->index, SDL_GetError());
}
return texture;
}
static void render_menu_panel(const struct window *window, struct menu_panel *menu_panel)
{
if (menu_panel == NULL) {
return;
}
for (size_t i = 0; i < menu_panel->button_bank.number; i++) {
struct button *button = &menu_panel->button_bank.buttons[i];
assert(button->callbacks.on_render != NULL);
button->callbacks.on_render(window, button);
}
render_outline_rect(window,
NULL, &menu_panel->rect, &g_colors[DEFAULT_MENU_PANEL_OUTLINE_COLOR]);
/* recurse */
render_menu_panel(window, menu_panel->next);
}
static SDL_Rect get_button_caption_rect(const struct button *button)
{
SDL_Rect rect = {
button->full_rect.x + button->inner_rect.x,
button->full_rect.y + button->inner_rect.y,
button->inner_rect.w,
button->inner_rect.h
};
return rect;
}
static void render_button_menu(const struct window *window,
struct button *button, const SDL_Color *fg, const SDL_Color *bg)
{
SDL_Rect rect = get_button_caption_rect(button);
render_fill_rect(window,
NULL, &button->full_rect, bg);
render_utf8_string(window, window->status_bar.font, NULL,
*fg, rect, button->caption);
}
static void render_button_menu_toggle(const struct window *window,
struct button *button, bool active)
{
SDL_Color *bg;
SDL_Color *fg;
if (active) {
fg = &g_colors[DEFAULT_MENU_TOGGLE_FG_ACTIVE_COLOR];
} else {
fg = &g_colors[DEFAULT_MENU_TOGGLE_FG_INACTIVE_COLOR];
}
if (button->highlighted) {
bg = &g_colors[DEFAULT_MENU_BG_ACTIVE_COLOR];
} else {
bg = &g_colors[DEFAULT_MENU_BG_INACTIVE_COLOR];
}
render_button_menu(window, button, fg, bg);
}
static void render_button_menu_simple(const struct window *window, struct button *button)
{
SDL_Color *fg;
SDL_Color *bg;
if (button->highlighted) {
fg = &g_colors[DEFAULT_MENU_FG_ACTIVE_COLOR];
bg = &g_colors[DEFAULT_MENU_BG_ACTIVE_COLOR];
} else {
fg = &g_colors[DEFAULT_MENU_FG_INACTIVE_COLOR];
bg = &g_colors[DEFAULT_MENU_BG_INACTIVE_COLOR];
}
render_button_menu(window, button, fg, bg);
}
static void render_button_menu_cursor(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
render_button_menu_toggle(window, button, window->cursor);
}
static void render_button_menu_pw(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_TERMVAL);
struct subwindow *subwindow = button->info.data.termval.subwindow;
u32b value = button->info.data.termval.value;
assert(subwindow->index != MAIN_SUBWINDOW);
assert(subwindow->index < N_ELEMENTS(window_flag));
render_button_menu_toggle(window,
button,
(window_flag[subwindow->index] & value) == value);
}
static void render_button_menu_terms(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (button->highlighted) {
/* draw a border around subwindow, so that it would be easy to see
* which subwindow corresponds to that button */
struct subwindow *subwindow = button->info.data.subval;
int outline_width = (subwindow->full_rect.w - subwindow->inner_rect.w) / 2
- subwindow->borders.width;
SDL_Rect outline_rect = subwindow->full_rect;
resize_rect(&outline_rect,
subwindow->borders.width, subwindow->borders.width,
-subwindow->borders.width, -subwindow->borders.width);
render_outline_rect_width(window,
NULL,
&outline_rect,
&g_colors[DEFAULT_SUBWINDOW_BORDER_COLOR],
outline_width);
}
render_button_menu_simple(window, button);
}
static void render_button_menu_borders(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
struct subwindow *subwindow = button->info.data.subval;
render_button_menu_toggle(window, button, subwindow->borders.visible);
}
static void render_button_menu_alpha(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_ALPHAVAL);
struct subwindow *subwindow = button->info.data.alphaval.subwindow;
int alpha = button->info.data.alphaval.real_value;
SDL_Color fg;
SDL_Color *bg;
if (is_close_to(alpha, subwindow->color.a, DEFAULT_ALPHA_STEP / 2)) {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_ACTIVE_COLOR];
} else {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_INACTIVE_COLOR];
}
if (button->highlighted) {
bg = &g_colors[DEFAULT_MENU_BG_ACTIVE_COLOR];
} else {
bg = &g_colors[DEFAULT_MENU_BG_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
render_fill_rect(window,
NULL, &button->full_rect, bg);
render_utf8_string(window, window->status_bar.font, NULL,
fg, rect, format(button->caption, button->info.data.alphaval.show_value));
}
static void render_button_menu_top(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
struct subwindow *subwindow = button->info.data.subval;
render_button_menu_toggle(window, button, subwindow->always_top);
}
static void render_button_menu_tile_size(const struct window *window,
struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_IVAL);
assert(button->info.data.ival == BUTTON_TILE_SIZE_WIDTH
|| button->info.data.ival == BUTTON_TILE_SIZE_HEIGHT);
SDL_Color fg;
SDL_Color *bg;
if (window->graphics.id != GRAPHICS_NONE) {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_ACTIVE_COLOR];
} else {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_INACTIVE_COLOR];
}
if (button->highlighted) {
bg = &g_colors[DEFAULT_MENU_BG_ACTIVE_COLOR];
} else {
bg = &g_colors[DEFAULT_MENU_BG_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
int scale = 0;
if (button->info.data.ival == BUTTON_TILE_SIZE_WIDTH) {
scale = tile_width;
} else if (button->info.data.ival == BUTTON_TILE_SIZE_HEIGHT) {
scale = tile_height;
}
render_fill_rect(window,
NULL, &button->full_rect, bg);
render_utf8_string(window, window->status_bar.font, NULL,
fg, rect, format(button->caption, scale));
}
static void render_button_menu_tile_set(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_IVAL);
render_button_menu_toggle(window,
button, button->info.data.ival == current_graphics_mode->grafID);
}
static void render_button_menu_font_size(const struct window *window,
struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_FONTVAL);
SDL_Color fg;
SDL_Color *bg;
struct fontval fontval = button->info.data.fontval;
if (!button->info.data.fontval.size_ok) {
fg = g_colors[DEFAULT_ERROR_COLOR];
} else if (g_font_info[fontval.index].type == FONT_TYPE_VECTOR) {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_ACTIVE_COLOR];
} else {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_INACTIVE_COLOR];
}
if (button->highlighted) {
bg = &g_colors[DEFAULT_MENU_BG_ACTIVE_COLOR];
} else {
bg = &g_colors[DEFAULT_MENU_BG_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
render_fill_rect(window,
NULL, &button->full_rect, bg);
render_utf8_string(window, window->status_bar.font, NULL,
fg, rect, format(button->caption, fontval.subwindow->font->size));
}
static void render_button_menu_font_name(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_FONTVAL);
SDL_Color fg;
SDL_Color *bg;
struct subwindow *subwindow = button->info.data.fontval.subwindow;
size_t index = button->info.data.fontval.index;
if (!button->info.data.fontval.size_ok) {
fg = g_colors[DEFAULT_ERROR_COLOR];
} else if (subwindow->font->index == index) {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_ACTIVE_COLOR];
} else {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_INACTIVE_COLOR];
}
if (button->highlighted) {
bg = &g_colors[DEFAULT_MENU_BG_ACTIVE_COLOR];
} else {
bg = &g_colors[DEFAULT_MENU_BG_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
render_fill_rect(window,
NULL, &button->full_rect, bg);
render_utf8_string(window, window->status_bar.font, NULL,
fg, rect, button->caption);
}
static void render_button_menu_window(const struct window *window,
struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_UVAL);
struct window *w = get_window_direct(button->info.data.uval);
SDL_Color fg;
SDL_Color *bg;
if (w != NULL) {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_ACTIVE_COLOR];
} else {
fg = g_colors[DEFAULT_MENU_TOGGLE_FG_INACTIVE_COLOR];
}
if (button->highlighted) {
bg = &g_colors[DEFAULT_MENU_BG_ACTIVE_COLOR];
} else {
bg = &g_colors[DEFAULT_MENU_BG_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
render_fill_rect(window, NULL, &button->full_rect, bg);
render_utf8_string(window, window->status_bar.font, NULL,
fg, rect, format(button->caption, button->info.data.uval));
}
static void render_button_menu_fullscreen(const struct window *window,
struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_NONE);
render_button_menu_toggle(window, button,
window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP);
}
/* the menu proper is rendered via this callback, used by the "Menu" button */
static void render_menu_button(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_NONE);
SDL_Color color;
if (button->highlighted) {
color = g_colors[DEFAULT_STATUS_BAR_BUTTON_ACTIVE_COLOR];
} else {
color = g_colors[DEFAULT_STATUS_BAR_BUTTON_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
render_utf8_string(window, window->status_bar.font, window->status_bar.texture,
color, rect, button->caption);
if (button->highlighted) {
render_menu_panel(window, window->status_bar.menu_panel);
}
}
static void render_button_subwindows(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_SUBWINDOWS, BUTTON_DATA_UVAL);
SDL_Color color;
if (has_visible_subwindow(window, button->info.data.uval)
|| button->highlighted) {
color = g_colors[DEFAULT_STATUS_BAR_BUTTON_ACTIVE_COLOR];
} else {
color = g_colors[DEFAULT_STATUS_BAR_BUTTON_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
render_utf8_string(window, window->status_bar.font, window->status_bar.texture,
color, rect, button->caption);
}
static void render_button_movesize(const struct window *window, struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MOVESIZE, BUTTON_DATA_IVAL);
bool active = false;
switch (button->info.data.ival) {
case BUTTON_MOVESIZE_MOVING:
active = window->move_state.active;
break;
case BUTTON_MOVESIZE_SIZING:
active = window->size_state.active;
break;
default:
quit_fmt("button '%s' has wrong ival %d",
button->caption, button->info.data.ival);
break;
}
SDL_Color color;
if (active || button->highlighted) {
color = g_colors[DEFAULT_STATUS_BAR_BUTTON_ACTIVE_COLOR];
} else {
color = g_colors[DEFAULT_STATUS_BAR_BUTTON_INACTIVE_COLOR];
}
SDL_Rect rect = get_button_caption_rect(button);
render_utf8_string(window, window->status_bar.font, window->status_bar.texture,
color, rect, button->caption);
}
static void show_about(const struct window *window)
{
const char *about_text[] = {
buildid,
"See http://www.rephial.org",
"Visit our forum at http://angband.oook.cz/forum"
};
struct { SDL_Rect rect; const char *text; } elems[N_ELEMENTS(about_text)];
for (size_t i = 0; i < N_ELEMENTS(elems); i++) {
elems[i].text = about_text[i];
}
char path[4096];
path_build(path, sizeof(path), DEFAULT_ABOUT_ICON_DIR, DEFAULT_ABOUT_ICON);
SDL_Texture *texture = load_image(window, path);
SDL_Rect texture_rect = {0};
SDL_QueryTexture(texture, NULL, NULL, &texture_rect.w, &texture_rect.h);
SDL_Rect total = {
0, 0,
2 * DEFAULT_XTRA_BORDER + texture_rect.w,
/* the default icon just looks better without bottom border */
DEFAULT_XTRA_BORDER + texture_rect.h
};
for (size_t i = 0; i < N_ELEMENTS(elems); i++) {
int w;
int h;
get_string_metrics(window->status_bar.font,
elems[i].text, &w, &h);
elems[i].rect.h = h;
elems[i].rect.w = w;
elems[i].rect.y = total.h + (DEFAULT_LINE_HEIGHT(h) - h) / 2;
total.w = MAX(w + 2 * DEFAULT_XTRA_BORDER, total.w);
total.h += DEFAULT_LINE_HEIGHT(h);
}
total.h += DEFAULT_XTRA_BORDER;
total.x = window->full_rect.w / 2 - total.w / 2;
total.y = window->full_rect.h / 2 - total.h / 2;
render_window_in_menu(window);
render_fill_rect(window, NULL, &total, &g_colors[DEFAULT_ABOUT_BG_COLOR]);
render_outline_rect_width(window, NULL, &total,
&g_colors[DEFAULT_ABOUT_BORDER_OUTER_COLOR], DEFAULT_VISIBLE_BORDER);
resize_rect(&total,
DEFAULT_VISIBLE_BORDER, DEFAULT_VISIBLE_BORDER,
-DEFAULT_VISIBLE_BORDER, -DEFAULT_VISIBLE_BORDER);
render_outline_rect_width(window, NULL, &total,
&g_colors[DEFAULT_ABOUT_BORDER_INNER_COLOR], DEFAULT_VISIBLE_BORDER);
for (size_t i = 0; i < N_ELEMENTS(elems); i++) {
/* center the string in total rect */
elems[i].rect.x = total.x + (total.w - elems[i].rect.w) / 2;
/* make the y coord of string absolute (was relative to total rect) */
elems[i].rect.y += total.y;
render_utf8_string(window, window->status_bar.font,
NULL, g_colors[DEFAULT_ABOUT_TEXT_COLOR],
elems[i].rect, elems[i].text);
}
texture_rect.x = total.x + (total.w - texture_rect.w) / 2;
texture_rect.y = total.y + DEFAULT_XTRA_BORDER;
SDL_SetRenderTarget(window->renderer, NULL);
SDL_RenderCopy(window->renderer, texture, NULL, &texture_rect);
SDL_RenderPresent(window->renderer);
wait_anykey();
SDL_DestroyTexture(texture);
}
static void signal_move_state(struct window *window)
{
assert(!window->size_state.active);
bool was_active = window->move_state.active;
if (was_active) {
window->move_state.active = false;
window->move_state.moving = false;
window->move_state.subwindow = NULL;
} else {
window->move_state.active = true;
}
SDL_SetWindowGrab(window->window,
was_active ? SDL_FALSE : SDL_TRUE);
window->alpha = was_active ? DEFAULT_ALPHA_FULL : DEFAULT_ALPHA_LOW;
}
static void signal_size_state(struct window *window)
{
assert(!window->move_state.active);
bool was_active = window->size_state.active;
if (was_active) {
window->size_state.active = false;
window->size_state.sizing = false;
if (window->size_state.subwindow != NULL) {
memset(&window->size_state.subwindow->sizing_rect,
0, sizeof(window->size_state.subwindow->sizing_rect));
window->size_state.subwindow = NULL;
}
} else {
window->size_state.active = true;
}
SDL_SetWindowGrab(window->window,
was_active ? SDL_FALSE : SDL_TRUE);
window->alpha = was_active ? DEFAULT_ALPHA_FULL : DEFAULT_ALPHA_LOW;
}
static bool do_button_movesize(struct window *window,
struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MOVESIZE, BUTTON_DATA_IVAL);
switch (button->info.data.ival) {
case BUTTON_MOVESIZE_MOVING:
if (window->size_state.active) {
/* toggle size button */
signal_size_state(window);
}
signal_move_state(window);
break;
case BUTTON_MOVESIZE_SIZING:
if (window->move_state.active) {
/* toggle move button */
signal_move_state(window);
}
signal_size_state(window);
break;
}
return true;
}
static void push_button(struct button_bank *bank, struct font *font,
const char *caption, struct button_info info, struct button_callbacks callbacks,
const SDL_Rect *rect, enum button_caption_position position)
{
assert(bank->number < bank->size);
struct button *button = &bank->buttons[bank->number];
int w;
int h;
get_string_metrics(font, caption, &w, &h);
int x = 0;
switch (position) {
case CAPTION_POSITION_CENTER:
x = (rect->w - w) / 2;
break;
case CAPTION_POSITION_LEFT:
x = DEFAULT_BUTTON_BORDER;
break;
case CAPTION_POSITION_RIGHT:
x = rect->w - DEFAULT_BUTTON_BORDER - w;
break;
default:
quit_fmt("bad caption position %d in button '%s'",
position, button->caption);
break;
}
button->inner_rect.x = x;
button->inner_rect.y = (rect->h - h) / 2;
button->inner_rect.w = w;
button->inner_rect.h = h;
button->full_rect = *rect;
assert(button->full_rect.w >= button->inner_rect.w
&& button->full_rect.h >= button->inner_rect.h);
button->caption = string_make(caption);
button->callbacks = callbacks;
button->info = info;
button->highlighted = false;
button->selected = false;
bank->number++;
}
static struct menu_panel *new_menu_panel(void)
{
struct menu_panel *menu = mem_zalloc(sizeof(*menu));
make_button_bank(&menu->button_bank);
menu->next = NULL;
return menu;
}
/* if caption of some button is NULL, the button is not included in menu (skipped) */
static struct menu_panel *make_menu_panel(const struct button *origin,
struct font *font, size_t n_elems, struct menu_elem *elems)
{
int maxlen = 0;
for (size_t i = 0; i < n_elems; i++) {
if (elems[i].caption == NULL) {
continue;
}
int w;
get_string_metrics(font, elems[i].caption, &w, NULL);
maxlen = MAX(maxlen, w);
}
struct menu_panel *menu_panel = new_menu_panel();
if (menu_panel == NULL) {
return NULL;
}
SDL_Rect rect = {
origin->full_rect.x + origin->full_rect.w,
origin->full_rect.y,
DEFAULT_MENU_LINE_WIDTH(maxlen),
DEFAULT_MENU_LINE_HEIGHT(font->ttf.glyph.h)
};
menu_panel->rect = rect;
menu_panel->rect.h = 0;
for (size_t i = 0; i < n_elems; i++) {
if (elems[i].caption == NULL) {
continue;
}
struct button_callbacks callbacks = {
elems[i].on_render, NULL, NULL, elems[i].on_menu
};
push_button(&menu_panel->button_bank,
font,
elems[i].caption,
elems[i].info,
callbacks,
&rect,
CAPTION_POSITION_LEFT);
rect.y += rect.h;
menu_panel->rect.h += rect.h;
}
return menu_panel;
}
static void load_next_menu_panel(const struct window *window,
struct menu_panel *menu_panel, const struct button *origin,
size_t n_elems, struct menu_elem *elems)
{
assert(menu_panel->next == NULL);
menu_panel->next = make_menu_panel(origin,
window->status_bar.font, n_elems, elems);
}
static void do_menu_cleanup(struct button *button,
struct menu_panel *menu_panel, const SDL_Event *event)
{
switch (event->type) {
case SDL_MOUSEMOTION: /* fallthru */
case SDL_MOUSEBUTTONDOWN: /* fallthru */
case SDL_MOUSEBUTTONUP:
if (menu_panel->next != NULL) {
free_menu_panel(menu_panel->next);
menu_panel->next = NULL;
}
break;
default:
quit_fmt("non mouse event %d for button '%s'",
event->type, button->caption);
break;
}
}
static bool select_menu_button(struct button *button,
struct menu_panel *menu_panel, const SDL_Event *event)
{
if (button->selected) {
return false;
} else {
do_menu_cleanup(button, menu_panel, event);
button->selected = true;
return true;
}
}
static bool click_menu_button(struct button *button,
struct menu_panel *menu_panel, const SDL_Event *event)
{
/* any event on that button removes the existing panel submenus
* (and clickable buttons should not have their own submenus) */
do_menu_cleanup(button, menu_panel, event);
switch (event->type) {
case SDL_MOUSEBUTTONDOWN:
button->selected = true;
return false;
case SDL_MOUSEBUTTONUP:
if (button->selected) {
button->selected = false;
/* click the button */
return true;
} else {
return false;
}
default:
return false;
}
}
static void handle_menu_cursor(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
window->cursor = !window->cursor;
}
static void handle_menu_window(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_UVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
struct window *other = get_window_direct(button->info.data.uval);
if (other == NULL) {
other = get_new_window(button->info.data.uval);
assert(other != NULL);
wipe_window_aux_config(other);
start_window(other);
}
}
static void handle_menu_windows(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_NONE);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct menu_elem elems[MAX_WINDOWS];
for (unsigned i = 0; i < MAX_WINDOWS; i++) {
elems[i].caption = "Window-%u";
elems[i].info.type = BUTTON_DATA_UVAL;
elems[i].info.data.uval = i;
elems[i].info.group = BUTTON_GROUP_MENU;
elems[i].on_render = render_button_menu_window;
elems[i].on_menu = handle_menu_window;
}
load_next_menu_panel(window, menu_panel, button, N_ELEMENTS(elems), elems);
}
static void handle_menu_fullscreen(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_NONE);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
if (window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) {
SDL_SetWindowFullscreen(window->window, 0);
SDL_SetWindowMinimumSize(window->window,
DEFAULT_WINDOW_MINIMUM_W, DEFAULT_WINDOW_MINIMUM_H);
} else {
SDL_SetWindowFullscreen(window->window, SDL_WINDOW_FULLSCREEN_DESKTOP);
}
window->flags = SDL_GetWindowFlags(window->window);
}
static void handle_menu_about(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_NONE);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
show_about(window);
}
static void handle_menu_quit(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_NONE);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
handle_quit();
}
static void handle_menu_tile_set(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_IVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
graphics_mode *mode = get_graphics_mode(button->info.data.ival);
assert(mode != NULL);
reload_all_graphics(mode);
refresh_angband_terms();
}
static void handle_menu_tile_size(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_IVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
if (window->graphics.id == GRAPHICS_NONE) {
return;
}
int increment =
(event->button.x - button->full_rect.x < button->full_rect.w / 2) ? -1 : +1;
if (button->info.data.ival == BUTTON_TILE_SIZE_WIDTH) {
tile_width += increment;
if (tile_width < MIN_TILE_WIDTH) {
tile_width = MAX_TILE_WIDTH;
} else if (tile_width > MAX_TILE_WIDTH) {
tile_width = MIN_TILE_WIDTH;
}
} else if (button->info.data.ival == BUTTON_TILE_SIZE_HEIGHT) {
tile_height += increment;
if (tile_height < MIN_TILE_HEIGHT) {
tile_height = MAX_TILE_HEIGHT;
} else if (tile_height > MAX_TILE_HEIGHT) {
tile_height = MIN_TILE_HEIGHT;
}
} else {
quit_fmt("bad ival in button '%s'", button->caption);
}
refresh_angband_terms();
}
static void handle_menu_tile_sizes(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct menu_elem elems[] = {
{
"< Tile width %d >",
{
BUTTON_DATA_IVAL,
{.ival = BUTTON_TILE_SIZE_WIDTH},
BUTTON_GROUP_MENU
},
render_button_menu_tile_size,
handle_menu_tile_size
},
{
"< Tile height %d >",
{
BUTTON_DATA_IVAL,
{.ival = BUTTON_TILE_SIZE_HEIGHT},
BUTTON_GROUP_MENU
},
render_button_menu_tile_size,
handle_menu_tile_size
}
};
load_next_menu_panel(window, menu_panel, button, N_ELEMENTS(elems), elems);
}
static void handle_menu_tile_sets(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
size_t num_elems = 0;
graphics_mode *mode = graphics_modes;
while (mode != NULL) {
num_elems++;
mode = mode->pNext;
}
struct menu_elem elems[num_elems];
mode = graphics_modes;
for (size_t i = 0; i < num_elems; i++) {
elems[i].caption = mode->menuname;
elems[i].info.type = BUTTON_DATA_IVAL;
elems[i].info.data.ival = mode->grafID;
elems[i].info.group = BUTTON_GROUP_MENU;
elems[i].on_render = render_button_menu_tile_set;
elems[i].on_menu = handle_menu_tile_set;
mode = mode->pNext;
}
load_next_menu_panel(window, menu_panel, button, num_elems, elems);
}
static void handle_menu_tiles(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct button_info info = {
BUTTON_DATA_SUBVAL, {.subval = button->info.data.subval}, BUTTON_GROUP_MENU
};
struct menu_elem elems[] = {
{"Set", info, render_button_menu_simple, handle_menu_tile_sets},
{"Size", info, render_button_menu_simple, handle_menu_tile_sizes}
};
load_next_menu_panel(window, menu_panel, button, N_ELEMENTS(elems), elems);
}
static void handle_menu_pw(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_TERMVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
u32b new_flags[N_ELEMENTS(window_flag)];
assert(sizeof(new_flags) == sizeof(window_flag));
memcpy(new_flags, window_flag, sizeof(new_flags));
struct subwindow *subwindow = button->info.data.termval.subwindow;
assert(subwindow->index != MAIN_SUBWINDOW);
assert(subwindow->index < N_ELEMENTS(window_flag));
uint32_t value = button->info.data.termval.value;
new_flags[subwindow->index] = value;
subwindows_set_flags(new_flags, N_ELEMENTS(new_flags));
refresh_angband_terms();
}
static void handle_menu_font_name(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_FONTVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
assert(button->info.data.fontval.index < N_ELEMENTS(g_font_info));
unsigned index = button->info.data.fontval.index;
struct subwindow *subwindow = button->info.data.fontval.subwindow;
const struct font_info *font_info = &g_font_info[index];
assert(font_info->loaded);
if (subwindow->font->index == index) {
/* already loaded */
return;
}
if (reload_font(subwindow, font_info)) {
button->info.data.fontval.size_ok = true;
} else {
button->info.data.fontval.size_ok = false;
}
}
static void handle_menu_font_size(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_FONTVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
if (!button->info.data.fontval.size_ok) {
return;
}
unsigned index = button->info.data.fontval.index;
assert(index < N_ELEMENTS(g_font_info));
struct font_info *info = &g_font_info[index];
if (info->type == FONT_TYPE_RASTER) {
return;
}
struct subwindow *subwindow = button->info.data.fontval.subwindow;
int size = subwindow->font->size;
int increment =
(event->button.x - button->full_rect.x < button->full_rect.w / 2) ? -1 : +1;
for (size_t i = 0; i < MAX_VECTOR_FONT_SIZE - MIN_VECTOR_FONT_SIZE; i++) {
size += increment;
if (size > MAX_VECTOR_FONT_SIZE) {
size = MIN_VECTOR_FONT_SIZE;
} else if (size < MIN_VECTOR_FONT_SIZE) {
size = MAX_VECTOR_FONT_SIZE;
}
info->size = size;
if (reload_font(subwindow, info)) {
return;
}
}
button->info.data.fontval.size_ok = false;
}
static void handle_menu_font_sizes(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct subwindow *subwindow = button->info.data.subval;
struct button_info info = {
BUTTON_DATA_FONTVAL,
{.fontval =
{.subwindow = subwindow,.index = subwindow->font->index, .size_ok = true}},
BUTTON_GROUP_MENU
};
struct menu_elem elems[] = {
{"< %2d points >", info, render_button_menu_font_size, handle_menu_font_size}
};
load_next_menu_panel(window, menu_panel, button, N_ELEMENTS(elems), elems);
}
static void handle_menu_font_names(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct menu_elem elems[N_ELEMENTS(g_font_info)];
size_t num_elems = 0;
for (size_t i = 0; i < N_ELEMENTS(g_font_info); i++) {
if (g_font_info[i].loaded) {
elems[num_elems].caption = g_font_info[i].name;
elems[num_elems].info.type = BUTTON_DATA_FONTVAL;
elems[num_elems].info.data.fontval.subwindow = button->info.data.subval;
elems[num_elems].info.data.fontval.size_ok = true;
elems[num_elems].info.data.fontval.index = i;
elems[num_elems].info.group = BUTTON_GROUP_MENU;
elems[num_elems].on_render = render_button_menu_font_name;
elems[num_elems].on_menu = handle_menu_font_name;
num_elems++;
}
}
load_next_menu_panel(window, menu_panel, button, num_elems, elems);
}
static void handle_menu_purpose(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
struct subwindow *subwindow = button->info.data.subval;
assert(subwindow->index != MAIN_SUBWINDOW);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct menu_elem elems[N_ELEMENTS(window_flag_desc)];
size_t num_elems = 0;
while (num_elems < N_ELEMENTS(elems)
&& window_flag_desc[num_elems] != NULL)
{
elems[num_elems].caption = window_flag_desc[num_elems];
elems[num_elems].info.group = BUTTON_GROUP_MENU;
elems[num_elems].info.data.termval.subwindow = subwindow;
elems[num_elems].info.data.termval.value = 1L << num_elems;
elems[num_elems].info.type = BUTTON_DATA_TERMVAL;
elems[num_elems].on_render = render_button_menu_pw;
elems[num_elems].on_menu = handle_menu_pw;
num_elems++;
}
load_next_menu_panel(window, menu_panel, button, num_elems, elems);
}
static void handle_menu_font(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct button_info info = {
BUTTON_DATA_SUBVAL, {.subval = button->info.data.subval}, BUTTON_GROUP_MENU
};
struct menu_elem elems[] = {
{"Name", info, render_button_menu_simple, handle_menu_font_names},
{"Size", info, render_button_menu_simple, handle_menu_font_sizes}
};
load_next_menu_panel(window, menu_panel, button, N_ELEMENTS(elems), elems);
}
static void handle_menu_borders(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
struct subwindow *subwindow = button->info.data.subval;
subwindow->borders.visible = !subwindow->borders.visible;
render_borders(subwindow);
}
static void handle_menu_subwindow_alpha(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_ALPHAVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
struct subwindow *subwindow = button->info.data.alphaval.subwindow;
subwindow->color.a = button->info.data.alphaval.real_value;
render_clear(subwindow->window, subwindow->texture, &subwindow->color);
render_borders(subwindow);
refresh_angband_terms();
}
static void handle_menu_alpha(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct subwindow *subwindow = button->info.data.subval;
struct menu_elem elems[(100 - DEFAULT_ALPHA_LOWEST) / DEFAULT_ALPHA_STEP +
1 + ((100 - DEFAULT_ALPHA_LOWEST) % DEFAULT_ALPHA_STEP == 0 ? 0 : 1)];
for (size_t i = 0; i < N_ELEMENTS(elems); i++) {
int alpha = ALPHA_PERCENT(DEFAULT_ALPHA_LOWEST + i * DEFAULT_ALPHA_STEP);
elems[i].caption = " %3d%% ";
elems[i].info.type = BUTTON_DATA_ALPHAVAL;
elems[i].info.data.alphaval.subwindow = subwindow;
elems[i].info.data.alphaval.real_value = alpha;
elems[i].info.data.alphaval.show_value = i * DEFAULT_ALPHA_STEP;
elems[i].info.group = BUTTON_GROUP_MENU;
elems[i].on_render = render_button_menu_alpha;
elems[i].on_menu = handle_menu_subwindow_alpha;
}
elems[N_ELEMENTS(elems) - 1].info.data.alphaval.real_value =
DEFAULT_ALPHA_FULL;
load_next_menu_panel(window, menu_panel, button, N_ELEMENTS(elems), elems);
}
static void handle_menu_top(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!click_menu_button(button, menu_panel, event)) {
return;
}
struct subwindow *subwindow = button->info.data.subval;
subwindow->always_top = !subwindow->always_top;
sort_to_top(subwindow->window);
}
static void handle_menu_terms(struct window *window,
struct button *button, const SDL_Event *event,
struct menu_panel *menu_panel)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_SUBVAL);
if (!select_menu_button(button, menu_panel, event)) {
return;
}
struct subwindow *subwindow = button->info.data.subval;
struct button_info info = {
BUTTON_DATA_SUBVAL, {.subval = subwindow}, BUTTON_GROUP_MENU
};
struct menu_elem elems[] = {
{
"Font", info, render_button_menu_simple, handle_menu_font
},
{
subwindow->index == MAIN_SUBWINDOW ? "Tiles" : NULL,
info, render_button_menu_simple, handle_menu_tiles
},
{
subwindow->index == MAIN_SUBWINDOW ? NULL: "Purpose",
info, render_button_menu_simple, handle_menu_purpose
},
{
subwindow->index == MAIN_SUBWINDOW ? NULL : "Alpha",
info, render_button_menu_simple, handle_menu_alpha
},
{
"Borders", info, render_button_menu_borders, handle_menu_borders
},
{
subwindow->index == MAIN_SUBWINDOW ? "Cursor" : NULL,
info, render_button_menu_cursor, handle_menu_cursor
},
{
"Top", info, render_button_menu_top, handle_menu_top
}
};
load_next_menu_panel(window, menu_panel, button, N_ELEMENTS(elems), elems);
}
static void load_main_menu_panel(struct status_bar *status_bar)
{
assert(N_ELEMENTS(angband_term_name) == MAX_SUBWINDOWS);
struct menu_elem term_elems[N_ELEMENTS(angband_term_name)];
size_t n_terms = 0;
for (size_t i = 0; i < N_ELEMENTS(angband_term_name); i++) {
struct subwindow *subwindow =
get_subwindow_by_index(status_bar->window, i, true);
if (subwindow == NULL) {
continue;
}
term_elems[n_terms].caption = angband_term_name[i];
term_elems[n_terms].info.type = BUTTON_DATA_SUBVAL;
term_elems[n_terms].info.data.subval = subwindow;
term_elems[n_terms].info.group = BUTTON_GROUP_MENU;
term_elems[n_terms].on_render = render_button_menu_terms;
term_elems[n_terms].on_menu = handle_menu_terms;
n_terms++;
}
struct button_info info = {BUTTON_DATA_NONE, {0}, BUTTON_GROUP_MENU};
struct menu_elem other_elems[] = {
{
"Fullscreen",
info, render_button_menu_fullscreen, handle_menu_fullscreen
},
{
status_bar->window->index == MAIN_WINDOW ? "Windows" : NULL,
info, render_button_menu_simple, handle_menu_windows
},
{
"About",
info, render_button_menu_simple, handle_menu_about
},
{
"Quit",
info, render_button_menu_simple, handle_menu_quit
}
};
struct menu_elem elems[N_ELEMENTS(term_elems) + N_ELEMENTS(other_elems)];
memcpy(elems, term_elems, n_terms * sizeof(term_elems[0]));
memcpy(elems + n_terms, other_elems, sizeof(other_elems));
struct button dummy = {0};
dummy.full_rect.x = status_bar->full_rect.x;
dummy.full_rect.y = status_bar->full_rect.y + status_bar->full_rect.h;
status_bar->menu_panel = make_menu_panel(&dummy, status_bar->font,
n_terms + N_ELEMENTS(other_elems), elems);
}
static void unselect_menu_buttons(struct menu_panel *menu_panel)
{
if (menu_panel == NULL) {
return;
}
for (size_t i = 0; i < menu_panel->button_bank.number; i++) {
menu_panel->button_bank.buttons[i].selected = false;
menu_panel->button_bank.buttons[i].highlighted = false;
}
unselect_menu_buttons(menu_panel->next);
}
static bool handle_menu_button_mousemotion(struct window *window,
const SDL_Event *event)
{
assert(event->type == SDL_MOUSEMOTION);
bool handled = false;
struct menu_panel *menu_panel = get_menu_panel_by_xy(window->status_bar.menu_panel,
event->motion.x, event->motion.y);
if (menu_panel == NULL) {
return handled;
}
for (size_t i = 0; i < menu_panel->button_bank.number; i++) {
struct button *button = &menu_panel->button_bank.buttons[i];
if (is_point_in_rect(event->motion.x, event->motion.y,
&button->full_rect))
{
/* note that the buttons themselves set "selected" */
button->highlighted = true;
assert(button->callbacks.on_menu != NULL);
button->callbacks.on_menu(window, button, event, menu_panel);
handled = true;
} else {
button->highlighted = false;
/* but we do unset selected */
button->selected = false;
}
}
unselect_menu_buttons(menu_panel->next);
return handled;
}
static bool handle_menu_button_click(struct window *window,
const SDL_Event *event)
{
assert(event->type == SDL_MOUSEBUTTONDOWN
|| event->type == SDL_MOUSEBUTTONUP);
bool handled = false;
struct menu_panel *menu_panel = get_menu_panel_by_xy(window->status_bar.menu_panel,
event->button.x, event->button.y);
if (menu_panel == NULL) {
return handled;
}
for (size_t i = 0; i < menu_panel->button_bank.number; i++) {
struct button *button = &menu_panel->button_bank.buttons[i];
if (is_point_in_rect(event->motion.x, event->motion.y,
&button->full_rect))
{
assert(button->callbacks.on_menu != NULL);
button->callbacks.on_menu(window, button, event, menu_panel);
handled = true;
}
}
return handled;
}
static bool handle_menu_event(struct window *window, const SDL_Event *event)
{
switch (event->type) {
case SDL_MOUSEMOTION:
return handle_menu_button_mousemotion(window, event);
case SDL_MOUSEBUTTONDOWN: /* fallthru */
case SDL_MOUSEBUTTONUP:
return handle_menu_button_click(window, event);
default:
return false;
}
}
static bool is_menu_button_mouse_click(const struct button *button,
const SDL_Event *event)
{
if ((event->type == SDL_MOUSEBUTTONDOWN || event->type == SDL_MOUSEBUTTONUP)
&& is_point_in_rect(event->button.x, event->button.y, &button->full_rect))
{
return true;
}
return false;
}
static bool handle_menu_button(struct window *window,
struct button *button, const SDL_Event *event)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_MENU, BUTTON_DATA_NONE);
switch (event->type) {
case SDL_MOUSEMOTION:
if (is_point_in_rect(event->motion.x, event->motion.y, &button->full_rect)) {
/* create menu on mouseover */
if (window->status_bar.menu_panel == NULL) {
load_main_menu_panel(&window->status_bar);
}
button->highlighted = true;
return true;
} else if (handle_menu_event(window, event)) {
return true;
} else if (button->highlighted) {
/* the menu sticks around so that it is not horrible to use */
return true;
}
return false;
default:
if (handle_menu_event(window, event)) {
return true;
} else if (is_menu_button_mouse_click(button, event)) {
/* menu button just eats mouse clicks */
return true;
}
if (window->status_bar.menu_panel != NULL) {
free_menu_panel(window->status_bar.menu_panel);
window->status_bar.menu_panel = NULL;
}
button->highlighted = false;
return false;
}
}
static bool do_button(struct window *window,
struct button *button, const SDL_Event *event)
{
switch (event->type) {
case SDL_MOUSEBUTTONDOWN:
if (is_point_in_rect(event->button.x, event->button.y, &button->full_rect)) {
button->selected = true;
return true;
}
break;
case SDL_MOUSEBUTTONUP:
if (is_point_in_rect(event->button.x, event->button.y, &button->full_rect)
&& button->selected)
{
assert(button->callbacks.on_click != NULL);
button->callbacks.on_click(window, button);
button->selected = false;
return true;
}
break;
case SDL_MOUSEMOTION:
if (is_point_in_rect(event->button.x, event->button.y, &button->full_rect)) {
button->highlighted = true;
return true;
}
break;
}
button->highlighted = false;
button->selected = false;
return false;
}
static bool is_close_to(int a, int b, unsigned range)
{
if (a > 0 && b > 0) {
return (unsigned) ABS(a - b) < range;
} else if (a < 0 && b < 0) {
return (unsigned) ABS(ABS(a) - ABS(b)) < range;
} else {
return (unsigned) (ABS(a) + ABS(b)) < range;
}
}
static bool is_point_in_rect(int x, int y, const SDL_Rect *rect)
{
return x >= rect->x && x < rect->x + rect->w
&& y >= rect->y && y < rect->y + rect->h;
}
static bool is_rect_in_rect(const SDL_Rect *small, const SDL_Rect *big)
{
return small->x >= big->x
&& small->x + small->w <= big->x + big->w
&& small->y >= big->y
&& small->y + small->h <= big->y + big->h;
}
static void fit_rect_in_rect_by_hw(SDL_Rect *small, const SDL_Rect *big)
{
if (small->x < big->x) {
small->w -= big->x - small->x;
small->x = big->x;
}
if (small->x + small->w > big->x + big->w) {
small->w = big->x + big->w - small->x;
}
if (small->y < big->y) {
small->h -= big->y - small->y;
small->y = big->y;
}
if (small->y + small->h > big->y + big->h) {
small->h = big->y + big->h - small->y;
}
}
static void fit_rect_in_rect_by_xy(SDL_Rect *small, const SDL_Rect *big)
{
if (small->x < big->x) {
small->x = big->x;
}
if (small->y < big->y) {
small->y = big->y;
}
if (small->x + small->w > big->x + big->w) {
small->x = MAX(big->x, big->x + big->w - small->w);
}
if (small->y + small->h > big->y + big->h) {
small->y = MAX(big->y, big->y + big->h - small->h);
}
}
static void fit_rect_in_rect_proportional(SDL_Rect *small, const SDL_Rect *big)
{
if (small->x < big->x) {
small->x = big->x;
}
if (small->y < big->y) {
small->y = big->y;
}
if (small->w > big->w) {
small->h = small->h * big->w / small->w;
small->w = big->w;
}
if (small->h > big->h) {
small->w = small->w * big->h / small->h;
small->h = big->h;
}
}
static void resize_rect(SDL_Rect *rect,
int left, int top, int right, int bottom)
{
if (rect->w - left + right <= 0
|| rect->h - top + bottom <= 0)
{
return;
}
rect->x += left;
rect->w -= left;
rect->y += top;
rect->h -= top;
rect->w += right;
rect->h += bottom;
}
/* tries to snap to other term in such a way so that their
* (visible) borders overlap */
static void try_snap(struct window *window,
struct subwindow *subwindow, SDL_Rect *rect)
{
for (size_t i = N_ELEMENTS(window->subwindows); i > 0; i--) {
struct subwindow *other = window->subwindows[i - 1];
if (other == NULL
|| !other->visible
|| other->index == subwindow->index)
{
continue;
}
int ox = other->full_rect.x;
int oy = other->full_rect.y;
int ow = other->full_rect.w;
int oh = other->full_rect.h;
if (oy < rect->y + rect->h && rect->y < oy + oh) {
if (is_close_to(rect->x, ox + ow, DEFAULT_SNAP_RANGE)) {
rect->x = ox + ow - DEFAULT_VISIBLE_BORDER;
}
if (is_close_to(rect->x + rect->w, ox, DEFAULT_SNAP_RANGE)) {
rect->x = ox - rect->w + DEFAULT_VISIBLE_BORDER;
}
}
if (ox < rect->x + rect->w && rect->x < ox + ow) {
if (is_close_to(rect->y, oy + oh, DEFAULT_SNAP_RANGE)) {
rect->y = oy + oh - DEFAULT_VISIBLE_BORDER;
}
if (is_close_to(rect->y + rect->h, oy, DEFAULT_SNAP_RANGE)) {
rect->y = oy - rect->h + DEFAULT_VISIBLE_BORDER;
}
}
}
}
static void start_moving(struct window *window,
struct subwindow *subwindow, const SDL_MouseButtonEvent *mouse)
{
assert(!window->size_state.active);
bring_to_top(window, subwindow);
window->move_state.originx = mouse->x;
window->move_state.originy = mouse->y;
window->move_state.subwindow = subwindow;
window->move_state.moving = true;
}
static void start_sizing(struct window *window,
struct subwindow *subwindow, const SDL_MouseButtonEvent *mouse)
{
assert(!window->move_state.active);
bring_to_top(window, subwindow);
subwindow->sizing_rect = subwindow->full_rect;
int x = mouse->x - (subwindow->full_rect.x + subwindow->full_rect.w / 2);
int y = mouse->y - (subwindow->full_rect.y + subwindow->full_rect.h / 2);
window->size_state.left = x < 0 ? true : false;
window->size_state.top = y < 0 ? true : false;
window->size_state.originx = mouse->x;
window->size_state.originy = mouse->y;
window->size_state.subwindow = subwindow;
window->size_state.sizing = true;
}
static bool handle_menu_mousebuttondown(struct window *window,
const SDL_MouseButtonEvent *mouse)
{
if (window->move_state.active || window->size_state.active) {
struct subwindow *subwindow = get_subwindow_by_xy(window, mouse->x, mouse->y);
if (subwindow != NULL
&& is_rect_in_rect(&subwindow->full_rect, &window->inner_rect))
{
if (window->move_state.active && !window->move_state.moving) {
start_moving(window, subwindow, mouse);
} else if (window->size_state.active && !window->size_state.sizing) {
start_sizing(window, subwindow, mouse);
}
}
return true;
} else if (is_over_status_bar(&window->status_bar, mouse->x, mouse->y)) {
return true;
} else {
return false;
}
}
static void handle_window_closed(const SDL_WindowEvent *event)
{
struct window *window = get_window_by_id(event->windowID);
assert(window != NULL);
if (window->index == MAIN_WINDOW) {
handle_quit();
} else {
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL) {
clear_pw_flag(subwindow);
}
}
free_window(window);
}
}
static void handle_window_focus(const SDL_WindowEvent *event)
{
assert(event->event == SDL_WINDOWEVENT_FOCUS_GAINED
|| event->event == SDL_WINDOWEVENT_FOCUS_LOST);
struct window *window = get_window_by_id(event->windowID);
if (window == NULL) {
/* when window is closed, it sends FOCUS_LOST event */
assert(event->event == SDL_WINDOWEVENT_FOCUS_LOST);
return;
}
switch (event->event) {
case SDL_WINDOWEVENT_FOCUS_GAINED:
window->focus = true;
break;
case SDL_WINDOWEVENT_FOCUS_LOST:
window->focus = false;
break;
}
}
static void handle_last_resize_event(int num_events, const SDL_Event *events)
{
assert(num_events > 0);
for (int i = num_events - 1; i >= 0; i--) {
if (events[i].window.event == SDL_WINDOWEVENT_RESIZED) {
const SDL_WindowEvent event = events[i].window;
struct window *window = get_window_by_id(event.windowID);
assert(window != NULL);
resize_window(window, event.data1, event.data2);
return;
}
}
}
static void handle_windowevent(const SDL_WindowEvent *event)
{
SDL_Event events[128];
events[0].window = *event;
int num_events = 1 + SDL_PeepEvents(events + 1, (int) N_ELEMENTS(events) - 1,
SDL_GETEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT);
bool resize = false;
for (int i = 0; i < num_events; i++) {
switch (events[i].window.event) {
case SDL_WINDOWEVENT_RESIZED:
/* just for efficiency */
resize = true;
break;
case SDL_WINDOWEVENT_CLOSE:
handle_window_closed(&events[i].window);
break;
case SDL_WINDOWEVENT_FOCUS_GAINED: /* fallthru */
case SDL_WINDOWEVENT_FOCUS_LOST:
handle_window_focus(&events[i].window);
break;
}
}
if (resize) {
handle_last_resize_event(num_events, events);
}
redraw_all_windows(false);
}
static void resize_subwindow(struct subwindow *subwindow)
{
SDL_DestroyTexture(subwindow->texture);
subwindow->full_rect = subwindow->sizing_rect;
if (!adjust_subwindow_geometry(subwindow->window, subwindow)) {
quit_fmt("bad_geometry of subwindow %u in window %u",
subwindow->index, subwindow->window->index);
}
subwindow->texture = make_subwindow_texture(subwindow->window,
subwindow->full_rect.w, subwindow->full_rect.h);
render_clear(subwindow->window, subwindow->texture, &subwindow->color);
render_borders(subwindow);
term *old = Term;
Term_activate(subwindow->term);
Term_resize(subwindow->cols, subwindow->rows);
/* XXX if we don't redraw the term, resizing in birth screen is buggy */
Term_redraw();
Term_activate(old);
refresh_angband_terms();
}
static void do_sizing(struct window *window, int x, int y)
{
struct size_state *size_state = &window->size_state;
assert(size_state->subwindow != NULL);
SDL_Rect rect = size_state->subwindow->sizing_rect;
int newx = x - size_state->originx;
int newy = y - size_state->originy;
int left = size_state->left ? newx : 0;
int top = size_state->top ? newy : 0;
int right = size_state->left ? 0 : newx;
int bottom = size_state->top ? 0 : newy;
resize_rect(&rect, left, top, right, bottom);
fit_rect_in_rect_by_hw(&rect, &window->inner_rect);
if (is_ok_col_row(size_state->subwindow,
&rect,
size_state->subwindow->font_width,
size_state->subwindow->font_height))
{
size_state->subwindow->sizing_rect = rect;
}
size_state->originx = x;
size_state->originy = y;
}
static void do_moving(struct window *window, int x, int y)
{
struct move_state *move_state = &window->move_state;
assert(move_state->subwindow != NULL);
SDL_Rect *rect = &move_state->subwindow->full_rect;
rect->x += x - move_state->originx;
rect->y += y - move_state->originy;
try_snap(window, move_state->subwindow, rect);
fit_rect_in_rect_by_xy(rect, &window->inner_rect);
move_state->originx = x;
move_state->originy = y;
}
static bool handle_menu_mousebuttonup(struct window *window,
const SDL_MouseButtonEvent *mouse)
{
if (window->move_state.active && window->move_state.moving) {
window->move_state.moving = false;
} else if (window->size_state.active && window->size_state.sizing) {
window->size_state.sizing = false;
if (window->size_state.subwindow != NULL) {
resize_subwindow(window->size_state.subwindow);
}
}
if (window->move_state.active
|| window->size_state.active
|| is_over_status_bar(&window->status_bar, mouse->x, mouse->y))
{
return true;
} else {
return false;
}
}
static bool handle_menu_mousemotion(struct window *window,
const SDL_MouseMotionEvent *mouse)
{
if (window->move_state.moving) {
do_moving(window, mouse->x, mouse->y);
return true;
} else if (window->size_state.sizing) {
do_sizing(window, mouse->x, mouse->y);
return true;
} else if (window->move_state.active || window->size_state.active) {
return true;
} else if (is_over_status_bar(&window->status_bar, mouse->x, mouse->y)) {
return true;
}
return false;
}
static bool handle_menu_keyboard(struct window *window, const SDL_Event *event)
{
if (window->move_state.active || window->size_state.active) {
return true;
}
SDL_Event key = *event;
/* the user pressed a key; probably wants to play? */
SDL_PushEvent(&key);
return false;
}
static bool handle_status_bar_buttons(struct window *window,
const SDL_Event *event)
{
bool handled = false;
for (size_t i = 0; i < window->status_bar.button_bank.number; i++) {
struct button *button = &window->status_bar.button_bank.buttons[i];
if (button->callbacks.on_event != NULL) {
handled |= button->callbacks.on_event(window, button, event);
} else {
handled |= do_button(window, button, event);
}
}
return handled;
}
static void redraw_status_bar_buttons(struct window *window)
{
SDL_Event shutdown = {.type = SDL_USEREVENT};
(void) handle_status_bar_buttons(window, &shutdown);
}
static bool handle_menu_windowevent(struct window *window,
const SDL_WindowEvent *event)
{
if (window->move_state.active) {
signal_move_state(window);
} else if (window->size_state.active) {
signal_size_state(window);
}
redraw_status_bar_buttons(window);
handle_windowevent(event);
return false;
}
static bool is_event_windowid_ok(const struct window *window, const SDL_Event *event)
{
switch (event->type) {
case SDL_KEYDOWN: /* fallthru */
case SDL_KEYUP:
return event->key.windowID == window->id;
case SDL_TEXTINPUT:
return event->text.windowID == window->id;
case SDL_MOUSEMOTION:
return event->motion.windowID == window->id;
case SDL_MOUSEBUTTONDOWN: /* fallthru */
case SDL_MOUSEBUTTONUP:
return event->button.windowID == window->id;
default:
return true;
}
}
/* returns true for events that should be processed by buttons */
static bool is_ok_button_event(const struct window *window, const SDL_Event *event)
{
switch (event->type) {
case SDL_KEYDOWN: /* fallthru */
case SDL_KEYUP: /* fallthru */
case SDL_TEXTINPUT: /* fallthru */
return is_event_windowid_ok(window, event);
case SDL_MOUSEMOTION: /* fallthru */
case SDL_MOUSEBUTTONDOWN: /* fallthru */
case SDL_MOUSEBUTTONUP:
return window->focus && is_event_windowid_ok(window, event);
case SDL_USEREVENT:
return true;
default:
return false;
}
}
static bool handle_status_bar_events(struct window *window,
const SDL_Event *event)
{
if (!is_event_windowid_ok(window, event)) {
/* just in case */
if (window->move_state.active) {
signal_move_state(window);
} else if (window->size_state.active) {
signal_size_state(window);
}
return false;
}
switch (event->type) {
case SDL_MOUSEMOTION:
return handle_menu_mousemotion(window, &event->motion);
case SDL_MOUSEBUTTONDOWN:
return handle_menu_mousebuttondown(window, &event->button);
case SDL_MOUSEBUTTONUP:
return handle_menu_mousebuttonup(window, &event->button);
case SDL_KEYDOWN: /* fallthru */
case SDL_KEYUP: /* fallthru */
case SDL_TEXTEDITING: /* fallthru */
case SDL_TEXTINPUT:
return handle_menu_keyboard(window, event);
case SDL_WINDOWEVENT:
return handle_menu_windowevent(window, &event->window);
case SDL_QUIT:
handle_quit();
return false;
default:
return false;
}
}
static void do_status_bar_loop(struct window *window)
{
window->status_bar.in_menu = true;
bool keep_going = true;
while (keep_going) {
SDL_Delay(window->delay);
SDL_Event event;
SDL_WaitEvent(&event);
bool handled = false;
if (is_ok_button_event(window, &event)
&& !window->move_state.moving
&& !window->size_state.sizing)
{
handled = handle_status_bar_buttons(window, &event);
}
if (event.type == SDL_MOUSEMOTION) {
/* annoying mousemotion spam! */
SDL_FlushEvent(SDL_MOUSEMOTION);
}
if (!handled) {
/* so the user didnt click on a button */
keep_going = handle_status_bar_events(window, &event);
}
redraw_window(window);
}
window->status_bar.in_menu = false;
}
static bool has_visible_subwindow(const struct window *window, unsigned index)
{
return get_subwindow_by_index(window, index, true) != NULL;
}
static bool handle_mousemotion(const SDL_MouseMotionEvent *mouse)
{
struct window *window = get_window_by_id(mouse->windowID);
if (is_over_status_bar(&window->status_bar, mouse->x, mouse->y)) {
do_status_bar_loop(window);
}
/* dont need other mousemotion events */
SDL_FlushEvent(SDL_MOUSEMOTION);
return false;
}
/* x and y are relative to window */
static bool get_colrow_from_xy(const struct subwindow *subwindow,
int x, int y, int *col, int *row)
{
SDL_Rect rect = {
subwindow->full_rect.x + subwindow->inner_rect.x,
subwindow->full_rect.y + subwindow->inner_rect.y,
subwindow->inner_rect.w,
subwindow->inner_rect.h
};
if (!is_point_in_rect(x, y, &rect)) {
return false;
}
*col = (x - rect.x) / subwindow->font_width;
*row = (y - rect.y) / subwindow->font_height;
return true;
}
static byte translate_key_mods(Uint16 mods)
{
#define TRANSLATE_K_MOD(m, k) ((m) & mods ? (k) : 0)
byte angband_mods =
TRANSLATE_K_MOD(KMOD_SHIFT, KC_MOD_SHIFT)
| TRANSLATE_K_MOD(KMOD_CTRL, KC_MOD_CONTROL)
| TRANSLATE_K_MOD(KMOD_ALT, KC_MOD_ALT)
| TRANSLATE_K_MOD(KMOD_GUI, KC_MOD_META);
#undef TRANSLATE_K_MOD
return angband_mods;
}
static bool handle_mousebuttondown(const SDL_MouseButtonEvent *mouse)
{
struct window *window = get_window_by_id(mouse->windowID);
assert(window != NULL);
struct subwindow *subwindow = get_subwindow_by_xy(window, mouse->x, mouse->y);
if (subwindow == NULL) {
/* not an error, the user clicked in some random place */
return false;
} else if (!subwindow->top) {
bring_to_top(window, subwindow);
redraw_window(window);
return false;
}
/* terms that are not main do not react to events, and main term
* lives in main window */
if (window->index != MAIN_WINDOW) {
return false;
}
/* all magic numbers are from ui-term.c and ui-context.c :) */
int button;
switch (mouse->button) {
case SDL_BUTTON_LEFT:
button = 1;
break;
case SDL_BUTTON_RIGHT:
button = 2;
break;
default:
/* XXX other buttons? */
return false;
}
int col;
int row;
if (!get_colrow_from_xy(subwindow, mouse->x, mouse->y, &col, &row)) {
return false;
}
byte mods = translate_key_mods(SDL_GetModState());
/* apparently mouse buttons dont get this */
mods &= ~KC_MOD_META;
button |= mods << 4;
term *old = Term;
Term_activate(subwindow->term);
Term_mousepress(col, row, button);
Term_activate(old);
return true;
}
static bool handle_keydown(const SDL_KeyboardEvent *key)
{
byte mods = translate_key_mods(key->keysym.mod);
keycode_t ch = 0;
if (!(key->keysym.mod & KMOD_NUM)
|| (key->keysym.mod & KMOD_NUM
&& key->keysym.mod & KMOD_SHIFT))
{
switch (key->keysym.sym) {
/* keypad keys without numlock */
case SDLK_KP_0: ch = '0'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_1: ch = '1'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_2: ch = '2'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_3: ch = '3'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_4: ch = '4'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_5: ch = '5'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_6: ch = '6'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_7: ch = '7'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_8: ch = '8'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_9: ch = '9'; mods |= KC_MOD_KEYPAD; break;
}
}
switch (key->keysym.sym) {
case SDLK_KP_MULTIPLY: ch = '*'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_PERIOD: ch = '.'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_DIVIDE: ch = '/'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_EQUALS: ch = '='; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_MINUS: ch = '-'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_PLUS: ch = '+'; mods |= KC_MOD_KEYPAD; break;
case SDLK_KP_ENTER: ch = KC_ENTER; mods |= KC_MOD_KEYPAD; break;
/* arrow keys */
case SDLK_UP: ch = ARROW_UP; break;
case SDLK_DOWN: ch = ARROW_DOWN; break;
case SDLK_LEFT: ch = ARROW_LEFT; break;
case SDLK_RIGHT: ch = ARROW_RIGHT; break;
/* text editing keys */
case SDLK_BACKSPACE: ch = KC_BACKSPACE; break;
case SDLK_PAGEDOWN: ch = KC_PGDOWN; break;
case SDLK_PAGEUP: ch = KC_PGUP; break;
case SDLK_INSERT: ch = KC_INSERT; break;
case SDLK_DELETE: ch = KC_DELETE; break;
case SDLK_RETURN: ch = KC_ENTER; break;
case SDLK_ESCAPE: ch = ESCAPE; break;
case SDLK_HOME: ch = KC_HOME; break;
case SDLK_END: ch = KC_END; break;
case SDLK_TAB: ch = KC_TAB; break;
/* function keys */
case SDLK_F1: ch = KC_F1; break;
case SDLK_F2: ch = KC_F2; break;
case SDLK_F3: ch = KC_F3; break;
case SDLK_F4: ch = KC_F4; break;
case SDLK_F5: ch = KC_F5; break;
case SDLK_F6: ch = KC_F6; break;
case SDLK_F7: ch = KC_F7; break;
case SDLK_F8: ch = KC_F8; break;
case SDLK_F9: ch = KC_F9; break;
case SDLK_F10: ch = KC_F10; break;
case SDLK_F11: ch = KC_F11; break;
case SDLK_F12: ch = KC_F12; break;
case SDLK_F13: ch = KC_F13; break;
case SDLK_F14: ch = KC_F14; break;
case SDLK_F15: ch = KC_F15; break;
}
if (mods & KC_MOD_CONTROL) {
switch (key->keysym.sym) {
case SDLK_0: ch = '0'; break;
case SDLK_1: ch = '1'; break;
case SDLK_2: ch = '2'; break;
case SDLK_3: ch = '3'; break;
case SDLK_4: ch = '4'; break;
case SDLK_5: ch = '5'; break;
case SDLK_6: ch = '6'; break;
case SDLK_7: ch = '7'; break;
case SDLK_8: ch = '8'; break;
case SDLK_9: ch = '9'; break;
case SDLK_a: ch = 'a'; break;
case SDLK_b: ch = 'b'; break;
case SDLK_c: ch = 'c'; break;
case SDLK_d: ch = 'd'; break;
case SDLK_e: ch = 'e'; break;
case SDLK_f: ch = 'f'; break;
case SDLK_g: ch = 'g'; break;
case SDLK_h: ch = 'h'; break;
case SDLK_i: ch = 'i'; break;
case SDLK_j: ch = 'j'; break;
case SDLK_k: ch = 'k'; break;
case SDLK_l: ch = 'l'; break;
case SDLK_m: ch = 'm'; break;
case SDLK_n: ch = 'n'; break;
case SDLK_o: ch = 'o'; break;
case SDLK_p: ch = 'p'; break;
case SDLK_q: ch = 'q'; break;
case SDLK_r: ch = 'r'; break;
case SDLK_s: ch = 's'; break;
case SDLK_t: ch = 't'; break;
case SDLK_u: ch = 'u'; break;
case SDLK_v: ch = 'v'; break;
case SDLK_w: ch = 'w'; break;
case SDLK_x: ch = 'x'; break;
case SDLK_y: ch = 'y'; break;
case SDLK_z: ch = 'z'; break;
}
}
if (ch) {
if (mods & KC_MOD_CONTROL && !(mods & KC_MOD_KEYPAD)) {
ch = KTRL(ch);
if (!MODS_INCLUDE_CONTROL(ch)) {
mods &= ~KC_MOD_CONTROL;
}
}
Term_keypress(ch, mods);
return true;
} else {
return false;
}
}
static keycode_t utf8_to_codepoint(const char *utf8_string)
{
/* hex == binary
* 0x00 == 00000000
* 0x80 == 10000000
* 0xc0 == 11000000
* 0xe0 == 11100000
* 0xf0 == 11110000
* 0xf8 == 11111000
* 0x3f == 00111111
* 0x1f == 00011111
* 0x0f == 00001111
* 0x07 == 00000111 */
keycode_t key = 0;
#define IS_UTF8_INFO(mask, result) (((unsigned char) utf8_string[0] & (mask)) == (result))
#define EXTRACT_UTF8_INFO(pos, mask, shift) (((unsigned char) utf8_string[(pos)] & (mask)) << (shift))
/* 6 is the number of information bits in a utf8 continuation byte (10xxxxxx) */
if (IS_UTF8_INFO(0x80, 0)) {
key = utf8_string[0];
} else if (IS_UTF8_INFO(0xe0, 0xc0)) {
key = EXTRACT_UTF8_INFO(0, 0x1f, 6)
| EXTRACT_UTF8_INFO(1, 0x3f, 0);
} else if (IS_UTF8_INFO(0xf0, 0xe0)) {
key = EXTRACT_UTF8_INFO(0, 0x0f, 12)
| EXTRACT_UTF8_INFO(1, 0x3f, 6)
| EXTRACT_UTF8_INFO(2, 0x3f, 0);
} else if (IS_UTF8_INFO(0xf8, 0xf0)) {
key = EXTRACT_UTF8_INFO(0, 0x07, 18)
| EXTRACT_UTF8_INFO(1, 0x3f, 12)
| EXTRACT_UTF8_INFO(2, 0x3f, 6)
| EXTRACT_UTF8_INFO(3, 0x3f, 0);
}
#undef IS_UTF8_INFO
#undef EXTRACT_UTF8_INFO
return key;
}
static bool handle_text_input(const SDL_TextInputEvent *input)
{
keycode_t ch = utf8_to_codepoint(input->text);
if (ch == 0) {
return false;
}
byte mods = translate_key_mods(SDL_GetModState());
if (mods & KC_MOD_SHIFT) {
switch (ch) {
/* maybe the player pressed key on keypad? */
case '0': /* fallthru */
case '1': /* fallthru */
case '2': /* fallthru */
case '3': /* fallthru */
case '4': /* fallthru */
case '5': /* fallthru */
case '6': /* fallthru */
case '7': /* fallthru */
case '8': /* fallthru */
case '9':
return false;
}
}
if (!MODS_INCLUDE_SHIFT(ch)) {
mods &= ~KC_MOD_SHIFT;
}
Term_keypress(ch, mods);
return true;
}
static void wait_anykey(void)
{
SDL_Event event;
SDL_EventType expected = SDL_USEREVENT;
while (true) {
SDL_WaitEvent(&event);
if (event.type == expected) {
return;
}
switch (event.type) {
case SDL_KEYDOWN:
expected = SDL_KEYUP;
break;;
case SDL_MOUSEBUTTONDOWN:
expected = SDL_MOUSEBUTTONUP;
break;
case SDL_MOUSEMOTION:
SDL_FlushEvent(SDL_MOUSEMOTION);
break;
case SDL_QUIT:
handle_quit();
break;
case SDL_WINDOWEVENT:
handle_windowevent(&event.window);
return;
}
}
}
static void handle_quit(void)
{
/* XXX copied from main-sdl.c */
if (character_generated && inkey_flag) {
/* no idea what that does :) */
msg_flag = false;
save_game();
}
quit(NULL);
}
static bool get_event(void)
{
SDL_Event event;
if (!SDL_PollEvent(&event)) {
return false;
}
switch (event.type) {
case SDL_KEYDOWN:
return handle_keydown(&event.key);
case SDL_TEXTINPUT:
return handle_text_input(&event.text);
case SDL_MOUSEMOTION:
return handle_mousemotion(&event.motion);
case SDL_MOUSEBUTTONDOWN:
return handle_mousebuttondown(&event.button);
case SDL_WINDOWEVENT:
handle_windowevent(&event.window);
return false;
case SDL_QUIT:
handle_quit();
return false;
default:
return false;
}
}
static void refresh_angband_terms(void)
{
if (!character_dungeon) {
return;
}
term *old = Term;
Term_activate(term_screen);
/* XXX XXX this is basically do_cmd_redraw(), just without EVENT_FLUSH_INPUT */
{
/* XXX XXX this works for refreshing monster's attrs */
event_signal_point(EVENT_MAP, -1, -1);
Term_flush();
verify_panel();
player->upkeep->notice |= (PN_COMBINE);
player->upkeep->update |= (PU_TORCH | PU_INVEN);
player->upkeep->update |= (PU_BONUS | PU_HP | PU_SPELLS);
player->upkeep->update |= (PU_UPDATE_VIEW | PU_MONSTERS);
player->upkeep->redraw |= (PR_BASIC | PR_EXTRA | PR_MAP | PR_INVEN |
PR_EQUIP | PR_MESSAGE | PR_MONSTER |
PR_OBJECT | PR_MONLIST | PR_ITEMLIST);
Term_clear();
handle_stuff(player);
move_cursor_relative(player->px, player->py);
for (size_t i = 0; i < ANGBAND_TERM_MAX; i++) {
if (angband_term[i] == NULL) {
continue;
}
Term_activate(angband_term[i]);
Term_redraw();
}
}
Term_activate(old);
redraw_all_windows(false);
}
static errr term_xtra_event(int v)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
redraw_all_windows(true);
if (v) {
while (true) {
for (int i = 0; i < DEFAULT_IDLE_UPDATE_PERIOD; i++) {
if (get_event()) {
return 0;
}
SDL_Delay(subwindow->window->delay);
}
idle_update();
}
} else {
(void) get_event();
}
return 0;
}
static errr term_xtra_flush(void)
{
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_WINDOWEVENT:
handle_windowevent(&event.window);
break;
}
}
return 0;
}
static errr term_xtra_clear(void)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
render_fill_rect(subwindow->window,
subwindow->texture, &subwindow->inner_rect, &subwindow->color);
subwindow->window->dirty = true;
return 0;
}
static errr term_xtra_fresh(void)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
if (!subwindow->window->status_bar.in_menu) {
try_redraw_window(subwindow->window);
}
return 0;
}
static errr term_xtra_delay(int v)
{
if (v > 0) {
term_xtra_event(0);
SDL_Delay(v);
}
return 0;
}
static errr term_xtra_react(void)
{
init_colors();
return 0;
}
static errr term_xtra_hook(int n, int v)
{
switch (n) {
case TERM_XTRA_EVENT:
return term_xtra_event(v);
case TERM_XTRA_DELAY:
return term_xtra_delay(v);
case TERM_XTRA_FLUSH:
return term_xtra_flush();
case TERM_XTRA_CLEAR:
return term_xtra_clear();
case TERM_XTRA_FRESH:
return term_xtra_fresh();
case TERM_XTRA_REACT:
return term_xtra_react();
default:
return 0;
}
}
static errr term_curs_hook(int col, int row)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
render_cursor(subwindow, col, row, false);
subwindow->window->dirty = true;
return 0;
}
static errr term_bigcurs_hook(int col, int row)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
render_cursor(subwindow, col, row, true);
subwindow->window->dirty = true;
return 0;
}
static errr term_wipe_hook(int col, int row, int n)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
SDL_Rect rect = {
subwindow->inner_rect.x + col * subwindow->font_width,
subwindow->inner_rect.y + row * subwindow->font_height,
n * subwindow->font_width,
subwindow->font_height
};
render_fill_rect(subwindow->window, subwindow->texture, &rect, &subwindow->color);
subwindow->window->dirty = true;
return 0;
}
static errr term_text_hook(int col, int row, int n, int a, const wchar_t *s)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
SDL_Color fg = g_colors[a % MAX_COLORS];
SDL_Color bg;
switch (a / MAX_COLORS) {
case BG_BLACK:
bg = subwindow->color;
break;
case BG_SAME:
bg = fg;
break;
case BG_DARK:
bg = g_colors[DEFAULT_SHADE_COLOR];
break;
default:
/* debugging */
bg = g_colors[DEFAULT_ERROR_COLOR];
break;
}
bg.a = subwindow->color.a;
SDL_Rect rect = {
subwindow->inner_rect.x + col * subwindow->font_width,
subwindow->inner_rect.y + row * subwindow->font_height,
n * subwindow->font_width,
subwindow->font_height
};
render_fill_rect(subwindow->window, subwindow->texture, &rect, &bg);
rect.w = subwindow->font_width;
for (int i = 0; i < n; i++) {
render_glyph_mono(subwindow->window,
subwindow->font, subwindow->texture,
rect.x, rect.y, &fg, (uint32_t) s[i]);
rect.x += subwindow->font_width;
}
subwindow->window->dirty = true;
return 0;
}
static errr term_pict_hook(int col, int row, int n,
const int *ap, const wchar_t *cp, const int *tap, const int *tcp)
{
struct subwindow *subwindow = Term->data;
assert(subwindow != NULL);
assert(subwindow->window->graphics.texture != NULL);
for (int i = 0; i < n; i++) {
render_tile_font_scaled(subwindow, col + i, row, tap[i], tcp[i], true);
if (tap[i] == ap[i] && tcp[i] == cp[i]) {
continue;
}
render_tile_font_scaled(subwindow, col + i, row, ap[i], cp[i], false);
}
subwindow->window->dirty = true;
return 0;
}
static void term_view_map_shared(struct subwindow *subwindow,
SDL_Texture *map, int w, int h)
{
render_all(subwindow->window);
SDL_Rect dst = {
0, 0,
w + 2 * DEFAULT_VISIBLE_BORDER,
h + 2 * DEFAULT_VISIBLE_BORDER
};
SDL_Rect full = {
0, 0,
subwindow->window->full_rect.w,
subwindow->window->full_rect.h
};
fit_rect_in_rect_proportional(&dst, &full);
dst.x = (subwindow->window->full_rect.w - dst.w) / 2;
dst.y = (subwindow->window->full_rect.h - dst.h) / 2;
resize_rect(&dst,
DEFAULT_VISIBLE_BORDER, DEFAULT_VISIBLE_BORDER,
-DEFAULT_VISIBLE_BORDER, -DEFAULT_VISIBLE_BORDER);
render_all(subwindow->window);
SDL_SetRenderTarget(subwindow->window->renderer, NULL);
SDL_RenderCopy(subwindow->window->renderer, map, NULL, &dst);
/* render borders around the whole map */
resize_rect(&dst,
-DEFAULT_VISIBLE_BORDER, -DEFAULT_VISIBLE_BORDER,
DEFAULT_VISIBLE_BORDER, DEFAULT_VISIBLE_BORDER);
render_outline_rect_width(subwindow->window,
NULL, &dst, &subwindow->borders.color, DEFAULT_VISIBLE_BORDER);
SDL_RenderPresent(subwindow->window->renderer);
wait_anykey();
}
static void term_view_map_tile(struct subwindow *subwindow)
{
assert(subwindow->window->graphics.id != GRAPHICS_NONE);
SDL_Rect tile = {
0, 0, REASONABLE_MAP_TILE_WIDTH, REASONABLE_MAP_TILE_HEIGHT
};
SDL_Rect source = {
0, 0,
subwindow->window->graphics.tile_pixel_w,
subwindow->window->graphics.tile_pixel_h
};
fit_rect_in_rect_proportional(&tile, &source);
int w = tile.w * cave->width;
int h = tile.h * cave->height;
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1");
SDL_Texture *map = make_subwindow_texture(subwindow->window, w, h);
assert(map != NULL);
render_clear(subwindow->window, map, &subwindow->color);
for (int y = 0; y < cave->height; y++) {
tile.y = y * tile.w;
for (int x = 0; x < cave->width; x++) {
tile.x = x * tile.h;
render_grid_cell_tile(subwindow, map, tile, x, y);
}
}
SDL_Rect cursor = {player->px * tile.w, player->py * tile.h, tile.w, tile.h};
/* render cursor around player */
render_outline_rect_width(subwindow->window,
map, &cursor, &g_colors[DEFAULT_SUBWINDOW_CURSOR_COLOR],
/* XXX some arbitrary values that look ok at the moment */
MIN(MIN(tile.w / 4, tile.h / 4),
DEFAULT_VISIBLE_BORDER));
term_view_map_shared(subwindow, map, w, h);
SDL_DestroyTexture(map);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0");
}
static void term_view_map_text(struct subwindow *subwindow)
{
int w = subwindow->font_width * cave->width;
int h = subwindow->font_height * cave->height;
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1");
SDL_Texture *map = make_subwindow_texture(subwindow->window, w, h);
assert(map != NULL);
render_clear(subwindow->window, map, &subwindow->color);
for (int y = 0; y < cave->height; y++) {
for (int x = 0; x < cave->width; x++) {
render_grid_cell_text(subwindow, map, x, y);
}
}
SDL_Rect cursor = {
player->px * subwindow->font_width,
player->py * subwindow->font_height,
subwindow->font_width,
subwindow->font_height
};
/* render cursor around player */
render_outline_rect_width(subwindow->window,
map, &cursor, &g_colors[DEFAULT_SUBWINDOW_CURSOR_COLOR],
/* XXX some arbitrary values that look reasonable at the moment */
MIN(MIN(subwindow->font_width / 4,
subwindow->font_height / 4),
DEFAULT_VISIBLE_BORDER));
term_view_map_shared(subwindow, map, w, h);
SDL_DestroyTexture(map);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0");
}
static void term_view_map_hook(term *term)
{
struct subwindow *subwindow = term->data;
if (subwindow->window->graphics.id == GRAPHICS_NONE) {
term_view_map_text(subwindow);
} else {
term_view_map_tile(subwindow);
}
}
static SDL_Texture *load_image(const struct window *window, const char *path)
{
SDL_Surface *surface = IMG_Load(path);
if (surface == NULL) {
quit_fmt("cant load image '%s': %s", path, IMG_GetError());
}
SDL_Texture *texture = SDL_CreateTextureFromSurface(window->renderer, surface);
if (texture == NULL) {
quit_fmt("cant create texture from image '%s': %s", path, SDL_GetError());
}
SDL_FreeSurface(surface);
return texture;
}
static void load_wallpaper(struct window *window, const char *path)
{
if (window->wallpaper.mode == WALLPAPER_DONT_SHOW) {
return;
}
if (window->wallpaper.mode == WALLPAPER_INVALID) {
quit_fmt("invalid wallpaper mode in window %u", window->index);
}
SDL_Texture *wallpaper = load_image(window, path);
assert(wallpaper != NULL);
if (window->wallpaper.mode == WALLPAPER_TILED) {
int w;
int h;
SDL_QueryTexture(wallpaper, NULL, NULL, &w, &h);
SDL_Rect dst = {0, 0, w, h};
/* make wallpaper 1/4 to 1/2 of the window's width and height
* that would be 4 to 16 calls to RenderCopy in wallpaper rendering function */
while (w < window->inner_rect.w / 4) {
w *= 2;
}
while (h < window->inner_rect.h / 4) {
h *= 2;
}
window->wallpaper.texture = make_subwindow_texture(window, w, h);
window->wallpaper.w = w;
window->wallpaper.h = h;
SDL_Color color = {0};
render_clear(window, window->wallpaper.texture, &color);
for (dst.y = 0; dst.y < h; dst.y += dst.h) {
for (dst.x = 0; dst.x < w; dst.x += dst.w) {
SDL_RenderCopy(window->renderer, wallpaper, NULL, &dst);
}
}
SDL_DestroyTexture(wallpaper);
} else {
SDL_QueryTexture(wallpaper, NULL, NULL,
&window->wallpaper.w, &window->wallpaper.h);
window->wallpaper.texture = wallpaper;
}
}
static void load_default_wallpaper(struct window *window)
{
if (window->wallpaper.mode == WALLPAPER_DONT_SHOW) {
return;
}
char path[4096];
path_build(path, sizeof(path), DEFAULT_WALLPAPER_DIR, DEFAULT_WALLPAPER);
load_wallpaper(window, path);
}
static void load_default_window_icon(const struct window *window)
{
char path[4096];
path_build(path, sizeof(path), DEFAULT_WINDOW_ICON_DIR, DEFAULT_WINDOW_ICON);
SDL_Surface *surface = IMG_Load(path);
assert(surface != NULL);
SDL_SetWindowIcon(window->window, surface);
SDL_FreeSurface(surface);
}
static void load_graphics(struct window *window, graphics_mode *mode)
{
assert(window->graphics.texture == NULL);
current_graphics_mode = mode;
use_graphics = mode->grafID;
if (use_graphics == GRAPHICS_NONE) {
tile_width = 1;
tile_height = 1;
} else {
char path[4096];
path_build(path, sizeof(path), mode->path, mode->file);
if (!file_exists(path)) {
quit_fmt("cant load graphcis: file '%s' doesnt exist", path);
}
window->graphics.texture = load_image(window, path);
assert(window->graphics.texture != NULL);
window->graphics.tile_pixel_w = mode->cell_width;
window->graphics.tile_pixel_h = mode->cell_height;
window->graphics.overdraw_row = mode->overdrawRow;
window->graphics.overdraw_max = mode->overdrawMax;
}
if (character_dungeon) {
reset_visuals(true);
}
window->graphics.id = mode->grafID;
}
static void reload_all_graphics(graphics_mode *mode)
{
if (mode == NULL) {
return;
}
for (size_t i = 0; i < MAX_WINDOWS; i++) {
struct window *window = get_window_direct(i);
if (window == NULL) {
continue;
}
free_graphics(&window->graphics);
memset(&window->graphics, 0, sizeof(window->graphics));
window->graphics.texture = NULL;
load_graphics(window, mode);
}
}
static const struct font_info *find_font_info(const char *name)
{
for (size_t i = 0; i < N_ELEMENTS(g_font_info); i++) {
if (g_font_info[i].loaded && streq(g_font_info[i].name, name)) {
return &g_font_info[i];
}
}
return NULL;
}
static void make_font_cache(const struct window *window, struct font *font)
{
font->cache.texture = make_subwindow_texture(window,
(int) ASCII_CACHE_SIZE * font->ttf.glyph.w, font->ttf.glyph.h);
assert(font->cache.texture != NULL);
/* fill texture with white transparent pixels */
SDL_Color white = {0xFF, 0xFF, 0xFF, 0};
render_clear(window, font->cache.texture, &white);
/* restore the alpha; we will render glyphs in white */
white.a = 0xFF;
/* y remains the same during the loop below; other values of rect change */
SDL_Rect rect = {0};
for (size_t i = 0; i < ASCII_CACHE_SIZE; i++) {
SDL_Surface *surface = TTF_RenderGlyph_Blended(font->ttf.handle,
(Uint16) g_ascii_codepoints_for_cache[i], white);
if (surface == NULL) {
quit_fmt("cant render surface for cache in font '%s': %s",
font->name, TTF_GetError());
}
SDL_Texture *texture = SDL_CreateTextureFromSurface(window->renderer, surface);
if (texture == NULL) {
quit_fmt("cant create texture for cache in font '%s': %s",
font->name, SDL_GetError());
}
SDL_FreeSurface(surface);
SDL_QueryTexture(texture, NULL, NULL, &rect.w, &rect.h);
rect.w = MIN(rect.w, font->ttf.glyph.w - font->ttf.glyph.x);
rect.h = MIN(rect.h, font->ttf.glyph.h - font->ttf.glyph.y);
SDL_RenderCopy(window->renderer, texture, NULL, &rect);
font->cache.rects[i] = rect;
rect.x += font->ttf.glyph.w;
SDL_DestroyTexture(texture);
}
}
static struct font *make_font(const struct window *window,
const char *name, int size)
{
const struct font_info *info = find_font_info(name);
if (info == NULL) {
return NULL;
}
struct font *font = mem_zalloc(sizeof(*font));
font->index = info->index;
font->path = string_make(info->path);
font->name = string_make(info->name);
font->size = size;
font->cache.texture = NULL;
load_font(font);
make_font_cache(window, font);
return font;
}
static bool reload_font(struct subwindow *subwindow,
const struct font_info *info)
{
struct font *new_font = make_font(subwindow->window, info->name, info->size);
if (new_font == NULL) {
return false;
}
subwindow->sizing_rect = subwindow->full_rect;
if (!is_ok_col_row(subwindow,
&subwindow->sizing_rect, new_font->ttf.glyph.w, new_font->ttf.glyph.h))
{
int min_cols = subwindow->index == MAIN_SUBWINDOW ? MIN_COLS_MAIN : MIN_COLS_OTHER;
int min_rows = subwindow->index == MAIN_SUBWINDOW ? MIN_ROWS_MAIN : MIN_ROWS_OTHER;
subwindow->sizing_rect.w = min_cols * new_font->ttf.glyph.w + 2 * DEFAULT_BORDER;
subwindow->sizing_rect.h = min_rows * new_font->ttf.glyph.h + 2 * DEFAULT_BORDER;
}
if (subwindow->sizing_rect.w > subwindow->window->inner_rect.w
|| subwindow->sizing_rect.h > subwindow->window->inner_rect.h)
{
free_font(new_font);
memset(&subwindow->sizing_rect, 0, sizeof(subwindow->sizing_rect));
return false;
}
fit_rect_in_rect_by_xy(&subwindow->sizing_rect, &subwindow->window->inner_rect);
free_font(subwindow->font);
subwindow->font = new_font;
resize_subwindow(subwindow);
return true;
}
static void load_font(struct font *font)
{
assert(font != NULL);
assert(font->path != NULL);
font->ttf.handle = TTF_OpenFont(font->path, font->size);
if (font->ttf.handle == NULL) {
quit_fmt("cant open font '%s': %s", font->path, TTF_GetError());
}
font->ttf.glyph.h = TTF_FontHeight(font->ttf.handle);
font->ttf.glyph.h += 2 * GLYPH_PADDING;
if (TTF_GlyphMetrics(font->ttf.handle, GLYPH_FOR_ADVANCE,
NULL, NULL, NULL, NULL, &font->ttf.glyph.w) != 0)
{
quit_fmt("cant query glyph metrics for font '%s': %s",
font->path, TTF_GetError());
}
font->ttf.glyph.w += 2 * GLYPH_PADDING;
font->ttf.glyph.x = GLYPH_PADDING;
font->ttf.glyph.y = GLYPH_PADDING;
TTF_SetFontHinting(font->ttf.handle, DEFAULT_FONT_HINTING);
}
static void free_font(struct font *font)
{
if (font->name != NULL) {
mem_free(font->name);
}
if (font->path != NULL) {
mem_free(font->path);
}
if (font->ttf.handle != NULL) {
TTF_CloseFont(font->ttf.handle);
}
if (font->cache.texture != NULL) {
SDL_DestroyTexture(font->cache.texture);
}
mem_free(font);
}
static bool is_ok_col_row(const struct subwindow *subwindow,
const SDL_Rect *rect, int cell_w, int cell_h)
{
const int min_col =
subwindow->index == MAIN_SUBWINDOW ? MIN_COLS_MAIN : MIN_COLS_OTHER;
const int min_row =
subwindow->index == MAIN_SUBWINDOW ? MIN_ROWS_MAIN : MIN_ROWS_OTHER;
if ((rect->w - DEFAULT_BORDER * 2) / cell_w < min_col) {
return false;
}
if ((rect->h - DEFAULT_BORDER * 2) / cell_h < min_row) {
return false;
}
return true;
}
static bool adjust_subwindow_geometry(const struct window *window,
struct subwindow *subwindow)
{
if (!subwindow->loaded && subwindow->config == NULL) {
/* lets center it then */
subwindow->full_rect.x = MAX(window->inner_rect.x,
(window->inner_rect.w - subwindow->full_rect.w) / 2);
subwindow->full_rect.y = MAX(window->inner_rect.y,
(window->inner_rect.h - subwindow->full_rect.h) / 2);
}
/* coordinates of inner rect are relative to that of outer rect
* (really, they are relative to subwindow's texture */
subwindow->inner_rect.x = 0;
subwindow->inner_rect.y = 0;
subwindow->inner_rect.w = subwindow->full_rect.w;
subwindow->inner_rect.h = subwindow->full_rect.h;
memset(&subwindow->sizing_rect, 0, sizeof(subwindow->sizing_rect));
resize_rect(&subwindow->inner_rect,
DEFAULT_BORDER, DEFAULT_BORDER,
-DEFAULT_BORDER, -DEFAULT_BORDER);
subwindow->borders.width = DEFAULT_VISIBLE_BORDER;
subwindow->font_width = subwindow->font->ttf.glyph.w;
subwindow->font_height = subwindow->font->ttf.glyph.h;
subwindow->cols = subwindow->inner_rect.w / subwindow->font_width;
subwindow->rows = subwindow->inner_rect.h / subwindow->font_height;
subwindow->inner_rect.w = subwindow->cols * subwindow->font_width;
subwindow->inner_rect.h = subwindow->rows * subwindow->font_height;
subwindow->inner_rect.x =
(subwindow->full_rect.w - subwindow->inner_rect.w) / 2;
subwindow->inner_rect.y =
(subwindow->full_rect.h - subwindow->inner_rect.h) / 2;
if (!is_ok_col_row(subwindow,
&subwindow->full_rect, subwindow->font_width, subwindow->font_height))
{
return false;
}
if (!is_rect_in_rect(&subwindow->full_rect, &window->inner_rect)) {
subwindow->borders.error = true;
}
return true;
}
static void sort_to_top_aux(struct window *window,
size_t *next, struct subwindow **subwindows, bool top, bool always_top)
{
assert(*next < N_ELEMENTS(window->subwindows));
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
if (window->subwindows[i] == NULL
|| window->subwindows[i]->top != top
|| window->subwindows[i]->always_top != always_top)
{
continue;
}
subwindows[(*next)++] = window->subwindows[i];
}
}
static void sort_to_top(struct window *window)
{
struct subwindow *tmp[N_ELEMENTS(window->subwindows)] = {NULL};
assert(sizeof(window->subwindows) == sizeof(tmp));
size_t current = 0;
/* and that's how we sort here :) */
sort_to_top_aux(window, ¤t, tmp, false, false);
sort_to_top_aux(window, ¤t, tmp, true, false);
sort_to_top_aux(window, ¤t, tmp, false, true);
sort_to_top_aux(window, ¤t, tmp, true, true);
memcpy(window->subwindows, tmp, sizeof(window->subwindows));
}
static void bring_to_top(struct window *window, struct subwindow *subwindow)
{
assert(subwindow->window == window);
bool found_subwindow_in_window = false;
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
if (window->subwindows[i] != NULL) {
window->subwindows[i]->top = false;
if (window->subwindows[i] == subwindow) {
found_subwindow_in_window = true;
}
}
}
assert(found_subwindow_in_window);
subwindow->top = true;
sort_to_top(window);
}
static void adjust_status_bar_geometry(struct window *window)
{
struct status_bar *status_bar = &window->status_bar;
status_bar->full_rect.x = 0;
status_bar->full_rect.y = 0;
status_bar->full_rect.w = window->full_rect.w;
status_bar->full_rect.h = DEFAULT_LINE_HEIGHT(status_bar->font->ttf.glyph.h);
status_bar->inner_rect = status_bar->full_rect;
int border = (status_bar->full_rect.h - status_bar->font->ttf.glyph.h) / 2;
resize_rect(&status_bar->inner_rect,
border, border, -border, -border);
}
static struct subwindow *get_subwindow_by_index(const struct window *window,
unsigned index, bool visible)
{
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL
&& (visible ? subwindow->visible : true)
&& subwindow->index == index)
{
return subwindow;
}
}
return NULL;
}
static struct subwindow *get_subwindow_by_xy(const struct window *window, int x, int y)
{
/* checking subwindows in z order */
for (size_t i = N_ELEMENTS(window->subwindows); i > 0; i--) {
struct subwindow *subwindow = window->subwindows[i - 1];
if (subwindow != NULL && subwindow->visible) {
if (is_point_in_rect(x, y, &subwindow->full_rect)) {
return subwindow;
}
}
}
return NULL;
}
static struct menu_panel *get_menu_panel_by_xy(struct menu_panel *menu_panel,
int x, int y)
{
while (menu_panel != NULL) {
if (is_point_in_rect(x, y, &menu_panel->rect)) {
return menu_panel;
}
menu_panel = menu_panel->next;
}
return NULL;
}
static bool is_over_status_bar(const struct status_bar *status_bar, int x, int y)
{
return is_point_in_rect(x, y, &status_bar->full_rect);
}
static void make_button_bank(struct button_bank *bank)
{
bank->buttons = mem_zalloc(sizeof(*bank->buttons) * MAX_BUTTONS);
bank->size = MAX_BUTTONS;
bank->number = 0;
}
static bool do_button_open_subwindow(struct window *window,
struct button *button)
{
CHECK_BUTTON_GROUP_TYPE(button, BUTTON_GROUP_SUBWINDOWS, BUTTON_DATA_UVAL);
unsigned index = button->info.data.uval;
struct subwindow *subwindow = NULL;
subwindow = get_subwindow_by_index(window, index, false);
if (subwindow != NULL) {
subwindow->visible = !subwindow->visible;
if (subwindow->visible) {
bring_to_top(window, subwindow);
}
} else if (is_subwindow_loaded(index)) {
subwindow = transfer_subwindow(window, index);
subwindow->visible = true;
bring_to_top(window, subwindow);
refresh_angband_terms();
} else {
subwindow = make_subwindow(window, index);
assert(subwindow != NULL);
bring_to_top(window, subwindow);
refresh_angband_terms();
}
redraw_all_windows(false);
return true;
}
static bool do_nothing_button(struct window *window,
struct button *button)
{
(void) window;
(void) button;
return true;
}
static void close_status_bar_menu(struct status_bar *status_bar)
{
if (status_bar->menu_panel != NULL) {
free_menu_panel(status_bar->menu_panel);
status_bar->menu_panel = NULL;
}
}
static void make_default_status_buttons(struct status_bar *status_bar)
{
SDL_Rect rect;
struct button_info info;
struct button_callbacks callbacks;
#define PUSH_BUTTON_LEFT_TO_RIGHT(cap) \
get_string_metrics(status_bar->font, (cap), &rect.w, NULL); \
rect.w += DEFAULT_BUTTON_BORDER * 2; \
push_button(&status_bar->button_bank, status_bar->font, \
(cap), info, callbacks, &rect, CAPTION_POSITION_CENTER); \
rect.x += rect.w; \
rect.x = status_bar->full_rect.x;
rect.y = status_bar->full_rect.y;
rect.w = 0;
rect.h = status_bar->full_rect.h;
callbacks.on_render = render_menu_button;
callbacks.on_event = handle_menu_button;
callbacks.on_click = NULL;
callbacks.on_menu = NULL;
info.type = BUTTON_DATA_NONE;
info.group = BUTTON_GROUP_MENU;
PUSH_BUTTON_LEFT_TO_RIGHT("Menu");
callbacks.on_render = render_button_subwindows;
callbacks.on_event = NULL;
info.type = BUTTON_DATA_UVAL;
info.group = BUTTON_GROUP_SUBWINDOWS;
if (status_bar->window->index == MAIN_WINDOW) {
callbacks.on_click = do_nothing_button;
info.data.uval = MAIN_SUBWINDOW;
/* the main term is called Angband in game options */
PUSH_BUTTON_LEFT_TO_RIGHT("A");
}
callbacks.on_click = do_button_open_subwindow;
for (unsigned i = 1; i < N_ELEMENTS(status_bar->window->subwindows); i++) {
info.data.uval = i;
PUSH_BUTTON_LEFT_TO_RIGHT(format("%d", i));
}
#undef PUSH_BUTTON_LEFT_TO_RIGHT
#define PUSH_BUTTON_RIGHT_TO_LEFT(cap) \
get_string_metrics(status_bar->font, (cap), &rect.w, NULL); \
rect.w += DEFAULT_BUTTON_BORDER * 2; \
rect.x -= rect.w; \
push_button(&status_bar->button_bank, status_bar->font, \
(cap), info, callbacks, &rect, CAPTION_POSITION_CENTER); \
rect.x = status_bar->full_rect.x + status_bar->full_rect.w;
rect.y = status_bar->full_rect.y;
rect.w = 0;
rect.h = status_bar->full_rect.h;
callbacks.on_render = render_button_movesize;
callbacks.on_click = do_button_movesize;
callbacks.on_event = NULL;
callbacks.on_menu = NULL;
info.type = BUTTON_DATA_IVAL;
info.group = BUTTON_GROUP_MOVESIZE;
info.data.ival = BUTTON_MOVESIZE_MOVING;
PUSH_BUTTON_RIGHT_TO_LEFT("Move");
info.data.ival = BUTTON_MOVESIZE_SIZING;
PUSH_BUTTON_RIGHT_TO_LEFT("Size");
#undef PUSH_BUTTON_RIGHT_TO_LEFT
}
static void reload_status_bar(struct status_bar *status_bar)
{
close_status_bar_menu(status_bar);
SDL_DestroyTexture(status_bar->texture);
status_bar->texture = make_subwindow_texture(status_bar->window,
status_bar->full_rect.w, status_bar->full_rect.h);
assert(status_bar->texture != NULL);
free_button_bank(&status_bar->button_bank);
make_button_bank(&status_bar->button_bank);
make_default_status_buttons(status_bar);
render_status_bar(status_bar->window);
}
static void load_status_bar(struct window *window)
{
if (window->status_bar.font == NULL) {
if (window->config != NULL) {
window->status_bar.font = make_font(window,
window->config->font_name,
window->config->font_size);
} else {
window->status_bar.font = make_font(window, DEFAULT_STATUS_BAR_FONT, 0);
}
assert(window->status_bar.font != NULL);
} else {
quit_fmt("font '%s' already loaded in status bar in window %u",
window->status_bar.font->name, window->index);
}
adjust_status_bar_geometry(window);
window->status_bar.texture = make_subwindow_texture(window,
window->status_bar.full_rect.w, window->status_bar.full_rect.h);
/* let's try renderer */
if (SDL_SetRenderDrawColor(window->renderer,
window->status_bar.color.r, window->status_bar.color.g,
window->status_bar.color.b, window->status_bar.color.a) != 0) {
quit_fmt("cant set render color for status bar in window %u: %s",
window->index, SDL_GetError());
}
/* well, renderer seems to work */
if (SDL_SetRenderTarget(window->renderer, window->status_bar.texture) != 0) {
quit_fmt("cant set status bar texture as target in window %u: %s",
window->index, SDL_GetError());
}
/* does it render? */
if (SDL_RenderClear(window->renderer) != 0) {
quit_fmt("cant clear status bar texture in window %u: %s",
window->index, SDL_GetError());
}
/* well, it probably works */
window->status_bar.window = window;
}
static void fit_subwindow_in_window(const struct window *window,
struct subwindow *subwindow)
{
fit_rect_in_rect_by_xy(&subwindow->full_rect, &window->inner_rect);
if (!is_rect_in_rect(&subwindow->full_rect, &window->inner_rect)) {
subwindow->borders.error = true;
render_borders(subwindow);
}
}
static void resize_window(struct window *window, int w, int h)
{
if (window->full_rect.w == w
&& window->full_rect.h == h)
{
return;
}
window->full_rect.w = w;
window->full_rect.h = h;
adjust_status_bar_geometry(window);
adjust_window_geometry(window);
clear_all_borders(window);
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL) {
fit_subwindow_in_window(window, subwindow);
}
}
reload_status_bar(&window->status_bar);
redraw_window(window);
}
static void adjust_window_geometry(struct window *window)
{
window->inner_rect.x = 0;
window->inner_rect.y = 0;
window->inner_rect.w = window->full_rect.w;
window->inner_rect.h = window->full_rect.h;
resize_rect(&window->inner_rect,
0, window->status_bar.full_rect.h, 0, 0);
if (window->inner_rect.w <= 0
|| window->inner_rect.h <= 0) {
quit_fmt("window %u is too small (%dx%d)",
window->index, window->inner_rect.w, window->inner_rect.h);
}
}
static void set_window_delay(struct window *window)
{
assert(window->window != NULL);
int display = SDL_GetWindowDisplayIndex(window->window);
if (display < 0) {
quit_fmt("cant get display of window %u: %s",
window->index, SDL_GetError());
}
SDL_DisplayMode mode;
if (SDL_GetCurrentDisplayMode(display, &mode) != 0)
{
/* lets just guess; 60 fps is standard */
mode.refresh_rate = 60;
}
/* delay in milliseconds; refresh rate in hz */
window->delay = 1000 / mode.refresh_rate;
}
/* initialize miscellaneous things in window */
static void load_window(struct window *window)
{
load_status_bar(window);
adjust_window_geometry(window);
make_button_bank(&window->status_bar.button_bank);
make_default_status_buttons(&window->status_bar);
set_window_delay(window);
if (window->wallpaper.mode != WALLPAPER_DONT_SHOW) {
if (window->config == NULL) {
load_default_wallpaper(window);
} else {
load_wallpaper(window, window->config->wallpaper_path);
}
}
load_default_window_icon(window);
if (window->graphics.id != GRAPHICS_NONE) {
load_graphics(window, get_graphics_mode(window->graphics.id));
}
render_clear(window, NULL, &window->color);
render_status_bar(window);
window->loaded = true;
}
static bool choose_pixelformat(struct window *window,
const struct SDL_RendererInfo *info)
{
#define TRY_SET_WINDOW_PIXELFORMAT(format) \
case SDL_PIXELFORMAT_ ##format: window->pixelformat = SDL_PIXELFORMAT_ ##format;
for (size_t i = 0; i < info->num_texture_formats; i++) {
switch (info->texture_formats[i]) {
TRY_SET_WINDOW_PIXELFORMAT(ARGB8888); return true;
TRY_SET_WINDOW_PIXELFORMAT(RGBA8888); return true;
TRY_SET_WINDOW_PIXELFORMAT(ABGR8888); return true;
TRY_SET_WINDOW_PIXELFORMAT(BGRA8888); return true;
}
}
#undef TRY_SET_WINDOW_PIXELFORMAT
return false;
}
static void start_window(struct window *window)
{
assert(!window->loaded);
if (window->config == NULL) {
window->window = SDL_CreateWindow(VERSION_NAME,
window->full_rect.x, window->full_rect.y,
window->full_rect.w, window->full_rect.h,
SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_RESIZABLE);
} else {
window->window = SDL_CreateWindow(VERSION_NAME,
window->full_rect.x, window->full_rect.y,
window->full_rect.w, window->full_rect.h,
window->config->window_flags);
}
assert(window->window != NULL);
if (window->config == NULL) {
window->renderer = SDL_CreateRenderer(window->window,
-1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
} else {
/* this is necessary for subwindows to have their own textures */
window->config->renderer_flags |= SDL_RENDERER_TARGETTEXTURE;
window->renderer = SDL_CreateRenderer(window->window,
-1, window->config->renderer_flags);
}
if (window->renderer == NULL) {
quit_fmt("cant create renderer for window %u: %s",
window->index, SDL_GetError());
}
SDL_RendererInfo info;
if (SDL_GetRendererInfo(window->renderer, &info) != 0) {
quit_fmt("cant query renderer in window %u", window->index);
}
if (!choose_pixelformat(window, &info)) {
quit_fmt("cant choose pixelformat for window %u", window->index);
}
load_window(window);
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
if (window->subwindows[i] != NULL) {
load_subwindow(window, window->subwindows[i]);
window->subwindows[i]->visible = true;
}
}
SDL_SetWindowMinimumSize(window->window,
DEFAULT_WINDOW_MINIMUM_W, DEFAULT_WINDOW_MINIMUM_H);
window->flags = SDL_GetWindowFlags(window->window);
window->id = SDL_GetWindowID(window->window);
}
static void wipe_window_aux_config(struct window *window)
{
window->config = mem_zalloc(sizeof(*window->config));
assert(window->config != NULL);
const struct window *main_window = get_window_direct(MAIN_WINDOW);
assert(main_window != NULL);
SDL_RendererInfo rinfo;
if (SDL_GetRendererInfo(main_window->renderer, &rinfo) != 0) {
quit_fmt("cant get renderer info for main window: %s", SDL_GetError());
}
window->config->renderer_flags = rinfo.flags;
window->config->renderer_index = -1;
window->config->window_flags= SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
if (main_window->config == NULL) {
char path[4096];
path_build(path, sizeof(path), DEFAULT_WALLPAPER_DIR, DEFAULT_WALLPAPER);
window->config->wallpaper_path = string_make(path);
window->config->font_name = string_make(DEFAULT_STATUS_BAR_FONT);
} else {
window->config->wallpaper_path = string_make(main_window->config->wallpaper_path);
window->config->font_name = string_make(main_window->config->font_name);
window->config->font_size = main_window->config->font_size;
}
int display = SDL_GetWindowDisplayIndex(main_window->window);
if (display < 0) {
quit_fmt("cant get display from main window: %s", SDL_GetError());
}
/* center it on the screen */
SDL_DisplayMode mode;
SDL_GetCurrentDisplayMode(display, &mode);
window->full_rect.w = mode.w / 2;
window->full_rect.h = mode.h / 2;
window->full_rect.x = mode.w / 4;
window->full_rect.y = mode.h / 4;
if (current_graphics_mode != NULL) {
window->graphics.id = current_graphics_mode->grafID;
}
}
/* initialize window with suitable hardcoded defaults */
static void wipe_window(struct window *window, int display)
{
unsigned index = window->index;
memset(window, 0, sizeof(*window));
window->index = index;
for (size_t j = 0; j < N_ELEMENTS(window->subwindows); j++) {
window->subwindows[j] = NULL;
}
SDL_DisplayMode mode;
if (SDL_GetCurrentDisplayMode(display, &mode) != 0) {
quit_fmt("cant get display mode for window %u: %s",
window->index, SDL_GetError());
}
window->pixelformat = SDL_PIXELFORMAT_UNKNOWN;
window->full_rect.w = mode.w;
window->full_rect.h = mode.h;
window->color = g_colors[DEFAULT_WINDOW_BG_COLOR];
window->alpha = DEFAULT_ALPHA_FULL;
window->status_bar.font = NULL;
window->wallpaper.texture = NULL;
window->wallpaper.mode = WALLPAPER_TILED;
window->status_bar.font = NULL;
window->status_bar.color = g_colors[DEFAULT_STATUS_BAR_BG_COLOR];
window->status_bar.button_bank.buttons = NULL;
window->status_bar.menu_panel = NULL;
window->status_bar.in_menu = false;
window->cursor = true;
window->graphics.texture = NULL;
window->graphics.id = GRAPHICS_NONE;
window->dirty = true;
window->config = NULL;
window->inited = true;
}
static void dump_subwindow(const struct subwindow *subwindow, ang_file *config)
{
#define DUMP_SUBWINDOW(sym, fmt, ...) \
file_putf(config, "subwindow-" sym ":%u:" fmt "\n", subwindow->index, __VA_ARGS__)
DUMP_SUBWINDOW("window", "%u", subwindow->window->index);
DUMP_SUBWINDOW("full-rect", "%d:%d:%d:%d",
subwindow->full_rect.x, subwindow->full_rect.y,
subwindow->full_rect.w, subwindow->full_rect.h);
DUMP_SUBWINDOW("font", "%d:%s",
subwindow->font->size, subwindow->font->name);
DUMP_SUBWINDOW("borders", "%s",
subwindow->borders.visible ? "true" : "false");
DUMP_SUBWINDOW("top", "%s:%s",
subwindow->top ? "true" : "false",
subwindow->always_top ? "true" : "false");
DUMP_SUBWINDOW("alpha", "%u", subwindow->color.a);
#undef DUMP_SUBWINDOW
file_put(config, "\n");
}
static void dump_window(const struct window *window, ang_file *config)
{
#define DUMP_WINDOW(sym, fmt, ...) \
file_putf(config, "window-" sym ":%u:" fmt "\n", window->index, __VA_ARGS__)
DUMP_WINDOW("display", "%d", SDL_GetWindowDisplayIndex(window->window));
int x;
int y;
SDL_GetWindowPosition(window->window, &x, &y);
DUMP_WINDOW("full-rect", "%d:%d:%d:%d",
x, y, window->full_rect.w, window->full_rect.h);
DUMP_WINDOW("fullscreen", "%s",
(window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) ? "true" : "false");
SDL_RendererInfo rinfo;
SDL_GetRendererInfo(window->renderer, &rinfo);
DUMP_WINDOW("renderer", "%s",
(rinfo.flags & SDL_RENDERER_ACCELERATED) ? "hardware" : "software");
if (window->config) {
DUMP_WINDOW("wallpaper-path", "%s", window->config->wallpaper_path);
} else {
DUMP_WINDOW("wallpaper-path", "%s", "default");
}
DUMP_WINDOW("wallpaper-mode", "%s",
window->wallpaper.mode == WALLPAPER_DONT_SHOW ? "none" :
window->wallpaper.mode == WALLPAPER_TILED ? "tiled" :
window->wallpaper.mode == WALLPAPER_CENTERED ? "centered" :
window->wallpaper.mode == WALLPAPER_SCALED ? "scaled" :
"ERROR");
DUMP_WINDOW("status-bar-font", "%d:%s",
window->status_bar.font->size, window->status_bar.font->name);
DUMP_WINDOW("graphics-id", "%d", window->graphics.id);
DUMP_WINDOW("tile-scale", "width:%d", tile_width);
DUMP_WINDOW("tile-scale", "height:%d", tile_height);
DUMP_WINDOW("cursor", "%s", window->cursor ? "true" : "false");
#undef DUMP_WINDOW
file_put(config, "\n");
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL && subwindow->visible) {
dump_subwindow(subwindow, config);
}
}
}
static void detach_subwindow_from_window(struct window *window,
struct subwindow *subwindow)
{
assert(subwindow->window == window);
size_t i = 0;
while (i < N_ELEMENTS(window->subwindows) && window->subwindows[i] != subwindow) {
i++;
}
assert(i < N_ELEMENTS(window->subwindows));
window->subwindows[i] = NULL;
}
static void attach_subwindow_to_window(struct window *window,
struct subwindow *subwindow)
{
assert(subwindow->window == window);
size_t i = 0;
while (i < N_ELEMENTS(window->subwindows) && window->subwindows[i] != NULL) {
i++;
}
assert(i < N_ELEMENTS(window->subwindows));
window->subwindows[i] = subwindow;
}
static struct subwindow *make_subwindow(struct window *window, unsigned index)
{
struct subwindow *subwindow = get_new_subwindow(index);
assert(subwindow != NULL);
load_subwindow(window, subwindow);
attach_subwindow_to_window(window, subwindow);
load_term(subwindow);
return subwindow;
}
static struct subwindow *transfer_subwindow(struct window *window, unsigned index)
{
struct subwindow *subwindow = get_subwindow_direct(index);
assert(subwindow != NULL);
assert(subwindow->inited);
assert(subwindow->loaded);
detach_subwindow_from_window(subwindow->window, subwindow);
subwindow->window = window;
attach_subwindow_to_window(window, subwindow);
SDL_DestroyTexture(subwindow->texture);
subwindow->texture = make_subwindow_texture(window,
subwindow->full_rect.w, subwindow->full_rect.h);
assert(subwindow->texture != NULL);
SDL_DestroyTexture(subwindow->aux_texture);
subwindow->aux_texture = make_subwindow_texture(window, 1, 1);
assert(subwindow->aux_texture != NULL);
struct font *new_font = make_font(subwindow->window,
subwindow->font->name, subwindow->font->size);
assert(new_font != NULL);
free_font(subwindow->font);
subwindow->font = new_font;
render_clear(window, subwindow->texture, &subwindow->color);
subwindow->borders.error = false;
render_borders(subwindow);
fit_subwindow_in_window(window, subwindow);
return subwindow;
}
static void load_subwindow(struct window *window, struct subwindow *subwindow)
{
assert(window->loaded);
assert(!subwindow->loaded);
if (subwindow->font == NULL) {
if (subwindow->config != NULL) {
subwindow->font = make_font(window,
subwindow->config->font_name, subwindow->config->font_size);
} else {
subwindow->font = make_font(window, DEFAULT_FONT, 0);
}
assert(subwindow->font != NULL);
}
if (!adjust_subwindow_geometry(window, subwindow)) {
quit_fmt("cant adjust geometry of subwindow %u in window %u",
subwindow->index, window->index);
}
subwindow->texture = make_subwindow_texture(window,
subwindow->full_rect.w, subwindow->full_rect.h);
assert(subwindow->texture != NULL);
/* just a pixel for sizing rect */
subwindow->aux_texture = make_subwindow_texture(window, 1, 1);
assert(subwindow->aux_texture != NULL);
/* same testing sequence as for status bar */
if (SDL_SetRenderDrawColor(window->renderer,
subwindow->color.r, subwindow->color.g,
subwindow->color.b, subwindow->color.a) != 0)
{
quit_fmt("cant set draw color for subwindow %u window %u: %s",
subwindow->index, window->index, SDL_GetError());
}
if (SDL_SetRenderTarget(window->renderer, subwindow->texture) != 0) {
quit_fmt("cant set subwindow %u as render target in window %u: %s",
subwindow->index, window->index, SDL_GetError());
}
if (SDL_RenderClear(window->renderer) != 0) {
quit_fmt("cant clear texture in subwindow %u window %u: %s",
subwindow->index, window->index, SDL_GetError());
}
subwindow->window = window;
subwindow->loaded = true;
render_borders(subwindow);
}
static void clear_pw_flag(struct subwindow *subwindow)
{
assert(subwindow->index < N_ELEMENTS(angband_term));
u32b new_flags[N_ELEMENTS(window_flag)];
assert(sizeof(new_flags) == sizeof(window_flag));
memcpy(new_flags, window_flag, sizeof(new_flags));
assert(subwindow->index < N_ELEMENTS(new_flags));
new_flags[subwindow->index] = 0;
subwindows_set_flags(new_flags, N_ELEMENTS(new_flags));
}
static void unload_term(struct subwindow *subwindow)
{
if (!subwindow->linked) {
return;
}
term_nuke(subwindow->term);
mem_free(subwindow->term);
angband_term[subwindow->index] = NULL;
subwindow->term = NULL;
subwindow->linked = false;
}
static void link_term(struct subwindow *subwindow)
{
assert(subwindow->term != NULL);
assert(subwindow->index < N_ELEMENTS(angband_term));
assert(angband_term[subwindow->index] == NULL);
subwindow->term->higher_pict = true;
subwindow->term->soft_cursor = true;
subwindow->term->complex_input = true;
subwindow->term->never_frosh = true;
subwindow->term->attr_blank = DEFAULT_ATTR_BLANK;
subwindow->term->char_blank = DEFAULT_CHAR_BLANK;
subwindow->term->xtra_hook = term_xtra_hook;
subwindow->term->curs_hook = term_curs_hook;
subwindow->term->bigcurs_hook = term_bigcurs_hook;
subwindow->term->wipe_hook = term_wipe_hook;
subwindow->term->text_hook = term_text_hook;
subwindow->term->pict_hook = term_pict_hook;
subwindow->term->view_map_hook = term_view_map_hook;
subwindow->term->data = subwindow;
angband_term[subwindow->index] = subwindow->term;
}
static void load_term(struct subwindow *subwindow)
{
assert(!subwindow->linked);
subwindow->term = mem_zalloc(sizeof(*subwindow->term));
term_init(subwindow->term,
subwindow->cols, subwindow->rows,
SUBWINDOW_KEYQ_SIZE(subwindow));
link_term(subwindow);
term *old = Term;
Term_activate(subwindow->term);
Term_redraw();
Term_activate(old);
subwindow->linked = true;
}
/* initialize subwindow with suitable hardcoded defaults */
static bool wipe_subwindow(struct subwindow *subwindow)
{
unsigned index = subwindow->index;
memset(subwindow, 0, sizeof(*subwindow));
subwindow->index = index;
/* XXX 80x24 is essential for main */
subwindow->full_rect.w = MIN_COLS_MAIN * DEFAULT_FONT_W + DEFAULT_BORDER * 2;
subwindow->full_rect.h = MIN_ROWS_MAIN * DEFAULT_FONT_H + DEFAULT_BORDER * 2;
if (subwindow->index != MAIN_SUBWINDOW) {
subwindow->full_rect.w /= 2;
subwindow->full_rect.h /= 2;
}
subwindow->cols = MIN_COLS_MAIN;
subwindow->rows = MIN_ROWS_MAIN;
subwindow->color = g_colors[DEFAULT_SUBWINDOW_BG_COLOR];
subwindow->borders.color = g_colors[DEFAULT_SUBWINDOW_BORDER_COLOR];
subwindow->borders.visible = true;
subwindow->texture = NULL;
subwindow->aux_texture = NULL;
subwindow->window = NULL;
subwindow->font = NULL;
subwindow->term = NULL;
subwindow->config = NULL;
subwindow->inited = true;
subwindow->visible = true;
return true;
}
static void get_string_metrics(struct font *font, const char *str, int *w, int *h)
{
assert(font != NULL);
assert(font->ttf.handle != NULL);
if (TTF_SizeUTF8(font->ttf.handle, str, w, h) != 0) {
quit_fmt("cant get string metrics for string '%s': %s", str, TTF_GetError());
}
}
static int sort_cb_font_info(const void *infoa, const void *infob)
{
int typea = ((struct font_info *) infoa)->type;
int typeb = ((struct font_info *) infob)->type;
const char *namea = ((struct font_info *) infoa)->name;
const char *nameb = ((struct font_info *) infob)->name;
if (typea != typeb) {
/* raster (angband's .fon) fonts go last */
return typea == FONT_TYPE_RASTER ? 1 : -1;
} else if (typea == FONT_TYPE_VECTOR && typeb == FONT_TYPE_VECTOR) {
/* vector (.ttf, etc) fonts go in alphabetical order */
return strcmp(namea, nameb);
} else {
/* otherwise, we'll sort them numbers-wise (6x12x.fon before 6x13x.fon) */
int wa = 0;
int ha = 0;
char facea[4 + 1] = {0};
int wb = 0;
int hb = 0;
char faceb[4 + 1] = {0};
sscanf(namea, "%dx%d%4[^.]", &wa, &ha, facea);
sscanf(nameb, "%dx%d%4[^.]", &wb, &hb, faceb);
if (wa < wb) {
return -1;
} else if (wa > wb) {
return 1;
} else if (ha < hb) {
return -1;
} else if (ha > hb) {
return 1;
} else {
return strcmp(facea, faceb);
}
}
}
static bool is_font_file(const char *path)
{
bool is_font = false;
TTF_Font *font = TTF_OpenFont(path, 1);
if (font != NULL) {
if (TTF_FontFaceIsFixedWidth(font)) {
is_font = true;
}
TTF_CloseFont(font);
}
return is_font;
}
static void free_menu_panel(struct menu_panel *menu_panel)
{
while (menu_panel) {
struct menu_panel *next = menu_panel->next;
free_button_bank(&menu_panel->button_bank);
mem_free(menu_panel);
menu_panel = next;
}
}
static void free_button_bank(struct button_bank *button_bank)
{
for (size_t i = 0; i < button_bank->number; i++) {
mem_free(button_bank->buttons[i].caption);
}
mem_free(button_bank->buttons);
button_bank->buttons = NULL;
button_bank->number = 0;
button_bank->size = 0;
}
static void free_status_bar(struct status_bar *status_bar)
{
if (status_bar->menu_panel != NULL) {
free_menu_panel(status_bar->menu_panel);
status_bar->menu_panel = NULL;
}
if (status_bar->button_bank.buttons != NULL) {
free_button_bank(&status_bar->button_bank);
}
if (status_bar->texture != NULL) {
SDL_DestroyTexture(status_bar->texture);
status_bar->texture = NULL;
}
free_font(status_bar->font);
status_bar->font = NULL;
}
static void free_font_info(struct font_info *font_info)
{
if (font_info->name != NULL) {
mem_free(font_info->name);
font_info->name = NULL;
}
if (font_info->path != NULL) {
mem_free(font_info->path);
font_info->path = NULL;
}
font_info->loaded = false;
}
static void free_window_config(struct window_config *config)
{
if (config->wallpaper_path != NULL) {
mem_free(config->wallpaper_path);
}
if (config->font_name != NULL) {
mem_free(config->font_name);
}
mem_free(config);
}
static void free_graphics(struct graphics *graphics)
{
if (graphics->texture != NULL) {
SDL_DestroyTexture(graphics->texture);
graphics->texture = NULL;
}
}
static void free_subwindow_config(struct subwindow_config *config)
{
if (config->font_name != NULL) {
mem_free(config->font_name);
}
mem_free(config);
}
static void free_subwindow(struct subwindow *subwindow)
{
assert(subwindow->loaded);
free_font(subwindow->font);
subwindow->font = NULL;
if (subwindow->texture != NULL) {
SDL_DestroyTexture(subwindow->texture);
subwindow->texture = NULL;
}
if (subwindow->aux_texture != NULL) {
SDL_DestroyTexture(subwindow->aux_texture);
subwindow->aux_texture = NULL;
}
if (subwindow->term != NULL) {
unload_term(subwindow);
}
if (subwindow->config != NULL) {
free_subwindow_config(subwindow->config);
subwindow->config = NULL;
}
subwindow->window = NULL;
subwindow->loaded = false;
subwindow->inited = false;
}
static void free_window(struct window *window)
{
assert(window->loaded);
for (size_t i = 0; i < N_ELEMENTS(window->subwindows); i++) {
struct subwindow *subwindow = window->subwindows[i];
if (subwindow != NULL) {
free_subwindow(subwindow);
window->subwindows[i] = NULL;
}
}
free_status_bar(&window->status_bar);
if (window->wallpaper.texture != NULL) {
SDL_DestroyTexture(window->wallpaper.texture);
window->wallpaper.texture = NULL;
}
free_graphics(&window->graphics);
if (window->renderer != NULL) {
SDL_DestroyRenderer(window->renderer);
window->renderer = NULL;
}
if (window->window != NULL) {
SDL_DestroyWindow(window->window);
window->window = NULL;
}
if (window->config != NULL) {
free_window_config(window->config);
window->config = NULL;
}
window->loaded = false;
window->inited = false;
}
static void init_colors(void)
{
assert(N_ELEMENTS(g_colors) == N_ELEMENTS(angband_color_table));
for (size_t i = 0; i < N_ELEMENTS(g_colors); i++) {
g_colors[i].r = angband_color_table[i][1];
g_colors[i].g = angband_color_table[i][2];
g_colors[i].b = angband_color_table[i][3];
g_colors[i].a = DEFAULT_ALPHA_FULL;
}
}
static void init_font_info(const char *directory)
{
/* well maybe it will get ability to be reinitialized at some point */
for (size_t i = 0; i < N_ELEMENTS(g_font_info); i++) {
g_font_info[i].name = NULL;
g_font_info[i].path = NULL;
g_font_info[i].loaded = false;
}
ang_dir *dir = my_dopen(directory);
assert(dir != NULL);
char name[1024];
char path[4096];
size_t i = 0;
while (i < N_ELEMENTS(g_font_info) && my_dread(dir, name, sizeof(name))) {
path_build(path, sizeof(path), directory, name);
if (is_font_file(path)) {
g_font_info[i].name = string_make(name);
g_font_info[i].path = string_make(path);
g_font_info[i].loaded = true;
if (suffix(path, ".fon")) {
g_font_info[i].type = FONT_TYPE_RASTER;
g_font_info[i].size = 0;
} else {
g_font_info[i].type = FONT_TYPE_VECTOR;
g_font_info[i].size = DEFAULT_VECTOR_FONT_SIZE;
}
i++;
}
}
assert(i > 0);
sort(g_font_info, i, sizeof(g_font_info[0]), sort_cb_font_info);
for (size_t j = 0; j < i; j++) {
g_font_info[j].index = j;
}
my_dclose(dir);
}
static void create_defaults(void)
{
struct window *window = get_new_window(MAIN_WINDOW);
assert(window != NULL);
struct subwindow *subwindow = get_new_subwindow(MAIN_SUBWINDOW);
assert(subwindow != NULL);
assert(MAIN_SUBWINDOW < N_ELEMENTS(window->subwindows));
window->subwindows[MAIN_SUBWINDOW] = subwindow;
}
static void quit_systems(void)
{
SDL_StopTextInput();
TTF_Quit();
IMG_Quit();
SDL_Quit();
}
static void quit_hook(const char *s)
{
dump_config_file();
free_globals();
quit_systems();
}
static void init_systems(void)
{
if (SDL_Init(INIT_SDL_FLAGS) != 0) {
quit_fmt("SDL_Init: %s", SDL_GetError());
}
if (IMG_Init(INIT_IMG_FLAGS) != INIT_IMG_FLAGS) {
quit_fmt("IMG_Init: %s", IMG_GetError());
SDL_Quit();
}
if (TTF_Init() != 0) {
quit_fmt("TTF_Init: %s", TTF_GetError());
}
/* On (some?) Macs the touchpad sends both mouse events and touch events;
* the latter interfere badly with the working of the status bar */
SDL_EventState(SDL_FINGERMOTION, SDL_DISABLE);
SDL_EventState(SDL_FINGERDOWN, SDL_DISABLE);
SDL_EventState(SDL_FINGERUP, SDL_DISABLE);
SDL_StartTextInput();
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
}
int init_sdl2(int argc, char **argv)
{
init_systems();
init_globals();
if (!init_graphics_modes()) {
quit_systems();
return 1;
}
if (!read_config_file()) {
create_defaults();
}
start_windows();
load_terms();
quit_aux = quit_hook;
return 0;
}
/* these arrays contain windows and terms that the ui operates on */
static struct subwindow g_subwindows[MAX_SUBWINDOWS];
static struct window g_windows[MAX_WINDOWS];
/* the string ANGBAND_DIR_USER is freed before calling quit_hook(),
* so we need to save the path to config file here */
static char g_config_file[4096];
static void init_globals(void)
{
for (size_t i = 0; i < N_ELEMENTS(g_subwindows); i++) {
g_subwindows[i].index = i;
}
for (size_t i = 0; i < N_ELEMENTS(g_windows); i++) {
g_windows[i].index = i;
}
init_font_info(ANGBAND_DIR_FONTS);
init_colors();
path_build(g_config_file, sizeof(g_config_file),
DEFAULT_CONFIG_FILE_DIR, DEFAULT_CONFIG_FILE);
}
static bool is_subwindow_loaded(unsigned index)
{
const struct subwindow *subwindow = get_subwindow_direct(index);
assert(subwindow != NULL);
return subwindow->loaded;
}
static struct subwindow *get_subwindow_direct(unsigned index)
{
size_t i;
if (index < N_ELEMENTS(g_subwindows)
&& g_subwindows[index].index == index)
{
i = index;
} else {
for (i = 0; i < N_ELEMENTS(g_subwindows); i++) {
if (g_subwindows[i].index == index) {
break;
}
}
if (i == N_ELEMENTS(g_subwindows)) {
return NULL;
}
}
return &g_subwindows[i];
}
static struct subwindow *get_new_subwindow(unsigned index)
{
struct subwindow *subwindow = get_subwindow_direct(index);
assert(subwindow != NULL);
assert(!subwindow->inited);
assert(!subwindow->loaded);
assert(!subwindow->linked);
if (!wipe_subwindow(subwindow)) {
return NULL;
}
return subwindow;
}
static struct window *get_new_window(unsigned index)
{
assert(index < N_ELEMENTS(g_windows));
assert(g_windows[index].index == index);
struct window *window = &g_windows[index];
assert(!window->inited);
assert(!window->loaded);
wipe_window(window, DEFAULT_DISPLAY);
return window;
}
static struct window *get_window_direct(unsigned index)
{
assert(index < N_ELEMENTS(g_windows));
if (g_windows[index].loaded) {
assert(g_windows[index].index == index);
return &g_windows[index];
}
return NULL;
}
static struct window *get_window_by_id(Uint32 id)
{
for (size_t i = 0; i < N_ELEMENTS(g_windows); i++) {
if (g_windows[i].loaded && g_windows[i].id == id) {
return &g_windows[i];
}
}
return NULL;
}
static void free_globals(void)
{
for (size_t i = 0; i < N_ELEMENTS(g_font_info); i++) {
free_font_info(&g_font_info[i]);
}
for (size_t i = 0; i < N_ELEMENTS(g_windows); i++) {
if (g_windows[i].loaded) {
free_window(&g_windows[i]);
}
}
for (size_t i = 0; i < N_ELEMENTS(g_subwindows); i++) {
assert(!g_subwindows[i].inited);
assert(!g_subwindows[i].loaded);
assert(!g_subwindows[i].linked);
}
}
static void start_windows(void)
{
for (size_t i = N_ELEMENTS(g_windows); i > 0; i--) {
if (g_windows[i - 1].inited) {
start_window(&g_windows[i - 1]);
}
}
}
static void load_terms(void)
{
for (size_t i = 0; i < N_ELEMENTS(g_subwindows); i++) {
if (g_subwindows[i].loaded) {
load_term(&g_subwindows[i]);
}
}
Term_activate(term_screen);
}
/* Config file stuff */
static void dump_config_file(void)
{
ang_file *config = file_open(g_config_file, MODE_WRITE, FTYPE_TEXT);
assert(config != NULL);
for (size_t i = 0; i < N_ELEMENTS(g_windows); i++) {
if (g_windows[i].loaded) {
dump_window(&g_windows[i], config);
}
}
file_close(config);
}
/* XXX more bad style :) */
#define GET_WINDOW_FROM_INDEX \
if (parser_getuint(parser, "index") >= N_ELEMENTS(g_windows)) { \
return PARSE_ERROR_OUT_OF_BOUNDS; \
} \
struct window *window = &g_windows[parser_getuint(parser, "index")]; \
#define WINDOW_INIT_OK \
if (!window->inited) { \
return PARSE_ERROR_MISSING_RECORD_HEADER; \
}
#define GET_SUBWINDOW_FROM_INDEX \
if (parser_getuint(parser, "index") >= N_ELEMENTS(g_subwindows)) { \
return PARSE_ERROR_OUT_OF_BOUNDS; \
} \
struct subwindow *subwindow = &g_subwindows[parser_getuint(parser, "index")]; \
#define SUBWINDOW_INIT_OK \
if (!subwindow->inited) { \
return PARSE_ERROR_MISSING_RECORD_HEADER; \
}
static enum parser_error config_window_display(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
int display = parser_getint(parser, "display");
if (display < 0 || display > SDL_GetNumVideoDisplays()) {
return PARSE_ERROR_OUT_OF_BOUNDS;
}
wipe_window(window, display);
window->config = mem_zalloc(sizeof(*window->config));
window->config->window_flags = SDL_WINDOW_RESIZABLE;
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_fullscreen(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
const char *mode = parser_getsym(parser, "fullscreen");
if (streq(mode, "true")) {
window->config->window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
} else if (streq(mode, "false")) {
;
} else {
return PARSE_ERROR_INVALID_VALUE;
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_rect(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
window->full_rect.x = parser_getint(parser, "x");
window->full_rect.y = parser_getint(parser, "y");
window->full_rect.w = parser_getint(parser, "w");
window->full_rect.h = parser_getint(parser, "h");
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_renderer(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
const char *type = parser_getsym(parser, "type");
if (streq(type, "hardware")) {
window->config->renderer_flags = SDL_RENDERER_ACCELERATED;
} else if (streq(type, "software")) {
window->config->renderer_flags = SDL_RENDERER_SOFTWARE;
} else {
return PARSE_ERROR_INVALID_VALUE;
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_wallpaper_path(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
const char *path = parser_getstr(parser, "path");
if (streq(path, "default")) {
char buf[4096];
path_build(buf, sizeof(buf), DEFAULT_WALLPAPER_DIR, DEFAULT_WALLPAPER);
window->config->wallpaper_path = string_make(buf);
} else {
window->config->wallpaper_path = string_make(path);
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_wallpaper_mode(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
const char *mode = parser_getstr(parser, "mode");
if (streq(mode, "none")) {
window->wallpaper.mode = WALLPAPER_DONT_SHOW;
} else if (streq(mode, "tiled")) {
window->wallpaper.mode = WALLPAPER_TILED;
} else if (streq(mode, "centered")) {
window->wallpaper.mode = WALLPAPER_CENTERED;
} else if (streq(mode, "scaled")) {
window->wallpaper.mode = WALLPAPER_SCALED;
} else {
return PARSE_ERROR_INVALID_VALUE;
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_font(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
const char *name = parser_getstr(parser, "name");
int size = parser_getint(parser, "size");
if (find_font_info(name) == NULL) {
return PARSE_ERROR_INVALID_VALUE;
}
window->config->font_name = string_make(name);
window->config->font_size = size;
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_graphics(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
int id = parser_getint(parser, "id");
if (get_graphics_mode(id) == NULL) {
return PARSE_ERROR_INVALID_VALUE;
}
window->graphics.id = id;
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_tile_scale(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
if (window->graphics.id != GRAPHICS_NONE) {
if (streq(parser_getsym(parser, "which"), "height")) {
tile_height = parser_getint(parser, "scale");
} else if (streq(parser_getsym(parser, "which"), "width")) {
tile_width = parser_getint(parser, "scale");
} else {
return PARSE_ERROR_INVALID_OPTION;
}
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_window_cursor(struct parser *parser)
{
GET_WINDOW_FROM_INDEX;
WINDOW_INIT_OK;
const char *cursor = parser_getsym(parser, "cursor");
if (streq(cursor, "true")) {
window->cursor = true;
} else if (streq(cursor, "false")) {
window->cursor = false;
} else {
return PARSE_ERROR_INVALID_OPTION;
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_subwindow_window(struct parser *parser)
{
GET_SUBWINDOW_FROM_INDEX;
unsigned windex = parser_getuint(parser, "windex");
if (windex >= N_ELEMENTS(g_windows)) {
return PARSE_ERROR_OUT_OF_BOUNDS;
}
struct window *window = &g_windows[windex];
if (!window->inited) {
return PARSE_ERROR_NON_SEQUENTIAL_RECORDS;
}
if (!wipe_subwindow(subwindow)) {
return PARSE_ERROR_GENERIC;
}
subwindow->config = mem_zalloc(sizeof(*subwindow->config));
subwindow->window = window;
attach_subwindow_to_window(window, subwindow);
return PARSE_ERROR_NONE;
}
static enum parser_error config_subwindow_rect(struct parser *parser)
{
GET_SUBWINDOW_FROM_INDEX;
SUBWINDOW_INIT_OK;
subwindow->full_rect.x = parser_getint(parser, "x");
subwindow->full_rect.y = parser_getint(parser, "y");
subwindow->full_rect.w = parser_getint(parser, "w");
subwindow->full_rect.h = parser_getint(parser, "h");
return PARSE_ERROR_NONE;
}
static enum parser_error config_subwindow_font(struct parser *parser)
{
GET_SUBWINDOW_FROM_INDEX;
SUBWINDOW_INIT_OK;
const char *name = parser_getstr(parser, "name");
int size = parser_getint(parser, "size");
if (find_font_info(name) == NULL) {
/* TODO maybe its not really an error? the font file was
* probably just deleted and now the ui wont event start... */
return PARSE_ERROR_INVALID_VALUE;
}
subwindow->config->font_name = string_make(name);
subwindow->config->font_size = size;
return PARSE_ERROR_NONE;
}
static enum parser_error config_subwindow_borders(struct parser *parser)
{
GET_SUBWINDOW_FROM_INDEX;
SUBWINDOW_INIT_OK;
const char *borders = parser_getsym(parser, "borders");
if (streq(borders, "true")) {
subwindow->borders.visible = true;
} else if (streq(borders, "false")) {
subwindow->borders.visible = false;
} else {
return PARSE_ERROR_INVALID_VALUE;
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_subwindow_top(struct parser *parser)
{
GET_SUBWINDOW_FROM_INDEX;
SUBWINDOW_INIT_OK;
const char *top = parser_getsym(parser, "top");
if (streq(top, "true")) {
subwindow->top = true;
} else if (streq(top, "false")) {
subwindow->top = false;
} else {
return PARSE_ERROR_INVALID_VALUE;
}
const char *always = parser_getsym(parser, "always");
if (streq(always, "true")) {
subwindow->always_top = true;
} else if (streq(always, "false")) {
subwindow->always_top = false;
} else {
return PARSE_ERROR_INVALID_VALUE;
}
return PARSE_ERROR_NONE;
}
static enum parser_error config_subwindow_alpha(struct parser *parser)
{
GET_SUBWINDOW_FROM_INDEX;
SUBWINDOW_INIT_OK;
int alpha = parser_getint(parser, "alpha");
if (alpha < 0 || alpha > DEFAULT_ALPHA_FULL) {
return PARSE_ERROR_INVALID_VALUE;
}
subwindow->color.a = alpha;
return PARSE_ERROR_NONE;
}
#undef GET_WINDOW_FROM_INDEX
#undef WINDOW_INIT_OK
#undef GET_SUBWINDOW_FROM_INDEX
#undef SUBWINDOW_INIT_OK
static struct parser *init_parse_config(void)
{
struct parser *parser = parser_new();
parser_reg(parser, "window-display uint index int display",
config_window_display);
parser_reg(parser, "window-fullscreen uint index sym fullscreen",
config_window_fullscreen);
parser_reg(parser, "window-full-rect uint index int x int y int w int h",
config_window_rect);
parser_reg(parser, "window-renderer uint index sym type",
config_window_renderer);
parser_reg(parser, "window-wallpaper-path uint index str path",
config_window_wallpaper_path);
parser_reg(parser, "window-wallpaper-mode uint index str mode",
config_window_wallpaper_mode);
parser_reg(parser, "window-status-bar-font uint index int size str name",
config_window_font);
parser_reg(parser, "window-graphics-id uint index int id",
config_window_graphics);
parser_reg(parser, "window-tile-scale uint index sym which int scale",
config_window_tile_scale);
parser_reg(parser, "window-cursor uint index sym cursor",
config_window_cursor);
parser_reg(parser, "subwindow-window uint index uint windex",
config_subwindow_window);
parser_reg(parser, "subwindow-full-rect uint index int x int y int w int h",
config_subwindow_rect);
parser_reg(parser, "subwindow-font uint index int size str name",
config_subwindow_font);
parser_reg(parser, "subwindow-borders uint index sym borders",
config_subwindow_borders);
parser_reg(parser, "subwindow-top uint index sym top sym always",
config_subwindow_top);
parser_reg(parser, "subwindow-alpha uint index int alpha",
config_subwindow_alpha);
return parser;
}
static void print_error(const char *name, struct parser *parser)
{
struct parser_state state;
parser_getstate(parser, &state);
fprintf(stderr, "parse error in %s line %d column %d: %s: %s\n",
name,
state.line,
state.col,
state.msg,
parser_error_str[state.error]);
}
static bool read_config_file(void)
{
ang_file *config = file_open(g_config_file, MODE_READ, FTYPE_TEXT);
if (config == NULL) {
/* not an error, its ok for a config file to not exist */
return false;
}
char line[1024];
struct parser *parser = init_parse_config();
errr error = 0;
while (file_getl(config, line, sizeof(line))) {
error = parser_parse(parser, line);
if (error != PARSE_ERROR_NONE) {
print_error(g_config_file, parser);
break;
}
}
parser_destroy(parser);
file_close(config);
return error == PARSE_ERROR_NONE;
}
#endif /* USE_SDL2 */
|
729170.c | // dllmain.cpp : Define o ponto de entrada para o aplicativo DLL.
#include "main.h"
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
main();
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
void main()
{
MessageBoxA(NULL, "Hello, World!", "Hello, World!", MB_OK | MB_ICONINFORMATION);
} |
786932.c | /*
* HID driver for some a4tech "special" devices
*
* Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2005 Vojtech Pavlik <[email protected]>
* Copyright (c) 2005 Michael Haboustak <[email protected]> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*/
#include <linux/device.h>
#include <linux/input.h>
#include <linux/hid.h>
#include <linux/module.h>
#include "hid-ids.h"
#define A4_2WHEEL_MOUSE_HACK_7 0x01
#define A4_2WHEEL_MOUSE_HACK_B8 0x02
struct a4tech_sc {
unsigned long quirks;
unsigned int hw_wheel;
__s32 delayed_value;
};
static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
struct a4tech_sc *a4 = hid_get_drvdata(hdev);
if (usage->type == EV_REL && usage->code == REL_WHEEL)
set_bit(REL_HWHEEL, *bit);
if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007)
return -1;
return 0;
}
static int a4_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
struct a4tech_sc *a4 = hid_get_drvdata(hdev);
struct input_dev *input;
if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput ||
!usage->type)
return 0;
input = field->hidinput->input;
if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8) {
if (usage->type == EV_REL && usage->code == REL_WHEEL) {
a4->delayed_value = value;
return 1;
}
if (usage->hid == 0x000100b8) {
input_event(input, EV_REL, value ? REL_HWHEEL :
REL_WHEEL, a4->delayed_value);
return 1;
}
}
if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007) {
a4->hw_wheel = !!value;
return 1;
}
if (usage->code == REL_WHEEL && a4->hw_wheel) {
input_event(input, usage->type, REL_HWHEEL, value);
return 1;
}
return 0;
}
static int a4_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
struct a4tech_sc *a4;
int ret;
a4 = kzalloc(sizeof(*a4), GFP_KERNEL);
if (a4 == NULL) {
dev_err(&hdev->dev, "can't alloc device descriptor\n");
ret = -ENOMEM;
goto err_free;
}
a4->quirks = id->driver_data;
hid_set_drvdata(hdev, a4);
ret = hid_parse(hdev);
if (ret) {
dev_err(&hdev->dev, "parse failed\n");
goto err_free;
}
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
if (ret) {
dev_err(&hdev->dev, "hw start failed\n");
goto err_free;
}
return 0;
err_free:
kfree(a4);
return ret;
}
static void a4_remove(struct hid_device *hdev)
{
struct a4tech_sc *a4 = hid_get_drvdata(hdev);
hid_hw_stop(hdev);
kfree(a4);
}
static const struct hid_device_id a4_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU),
.driver_data = A4_2WHEEL_MOUSE_HACK_7 },
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D),
.driver_data = A4_2WHEEL_MOUSE_HACK_B8 },
{ }
};
MODULE_DEVICE_TABLE(hid, a4_devices);
static struct hid_driver a4_driver = {
.name = "a4tech",
.id_table = a4_devices,
.input_mapped = a4_input_mapped,
.event = a4_event,
.probe = a4_probe,
.remove = a4_remove,
};
static int __init a4_init(void)
{
return hid_register_driver(&a4_driver);
}
static void __exit a4_exit(void)
{
hid_unregister_driver(&a4_driver);
}
module_init(a4_init);
module_exit(a4_exit);
MODULE_LICENSE("GPL");
|
446799.c | /* vi: set sw=4 ts=4: */
/*
* Copyright 2003, Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
* Based on specification from
* http://www.opengroup.org/onlinepubs/007904975/utilities/uuencode.html
*
* Bugs: the spec doesn't mention anything about "`\n`\n" prior to the
* "end" line
*/
//config:config UUDECODE
//config: bool "uudecode (5.8 kb)"
//config: default y
//config: help
//config: uudecode is used to decode a uuencoded file.
//applet:IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_UUDECODE) += uudecode.o
//usage:#define uudecode_trivial_usage
//usage: "[-o OUTFILE] [INFILE]"
//usage:#define uudecode_full_usage "\n\n"
//usage: "Uudecode a file\n"
//usage: "Finds OUTFILE in uuencoded source unless -o is given"
//usage:
//usage:#define uudecode_example_usage
//usage: "$ uudecode -o busybox busybox.uu\n"
//usage: "$ ls -l busybox\n"
//usage: "-rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox\n"
#include "libbb.h"
#if ENABLE_UUDECODE
static void FAST_FUNC read_stduu(FILE *src_stream, FILE *dst_stream, int flags UNUSED_PARAM)
{
char *line;
for (;;) {
int encoded_len, str_len;
char *line_ptr, *dst;
size_t line_len;
line_len = 64 * 1024;
line = xmalloc_fgets_str_len(src_stream, "\n", &line_len);
if (!line)
break;
/* Handle both Unix and MSDOS text.
* Note: space should not be trimmed, some encoders use it instead of "`"
* for padding of last incomplete 4-char block.
*/
str_len = line_len;
while (--str_len >= 0
&& (line[str_len] == '\n' || line[str_len] == '\r')
) {
line[str_len] = '\0';
}
if (strcmp(line, "end") == 0) {
return; /* the only non-error exit */
}
line_ptr = line;
while (*line_ptr) {
*line_ptr = (*line_ptr - 0x20) & 0x3f;
line_ptr++;
}
str_len = line_ptr - line;
encoded_len = line[0] * 4 / 3;
/* Check that line is not too short. (we tolerate
* overly _long_ line to accommodate possible extra "`").
* Empty line case is also caught here. */
if (str_len <= encoded_len) {
break; /* go to bb_error_msg_and_die("short file"); */
}
if (encoded_len <= 0) {
/* Ignore the "`\n" line, why is it even in the encode file ? */
free(line);
continue;
}
if (encoded_len > 60) {
bb_error_msg_and_die("line too long");
}
dst = line;
line_ptr = line + 1;
do {
/* Merge four 6 bit chars to three 8 bit chars */
*dst++ = line_ptr[0] << 2 | line_ptr[1] >> 4;
encoded_len--;
if (encoded_len == 0) {
break;
}
*dst++ = line_ptr[1] << 4 | line_ptr[2] >> 2;
encoded_len--;
if (encoded_len == 0) {
break;
}
*dst++ = line_ptr[2] << 6 | line_ptr[3];
line_ptr += 4;
encoded_len -= 2;
} while (encoded_len > 0);
fwrite(line, 1, dst - line, dst_stream);
free(line);
}
bb_error_msg_and_die("short file");
}
#endif
#if ENABLE_UUDECODE
int uudecode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int uudecode_main(int argc UNUSED_PARAM, char **argv)
{
FILE *src_stream;
char *outname = NULL;
char *line;
getopt32(argv, "^" "o:" "\0" "?1"/* 1 arg max*/, &outname);
argv += optind;
if (!argv[0])
*--argv = (char*)"-";
src_stream = xfopen_stdin(argv[0]);
/* Search for the start of the encoding */
while ((line = xmalloc_fgetline(src_stream)) != NULL) {
void FAST_FUNC (*decode_fn_ptr)(FILE *src, FILE *dst, int flags);
char *line_ptr;
FILE *dst_stream;
int mode;
if (is_prefixed_with(line, "begin-base64 ")) {
line_ptr = line + 13;
decode_fn_ptr = read_base64;
} else if (is_prefixed_with(line, "begin ")) {
line_ptr = line + 6;
decode_fn_ptr = read_stduu;
} else {
free(line);
continue;
}
/* begin line found. decode and exit */
mode = bb_strtou(line_ptr, NULL, 8);
if (outname == NULL) {
outname = strchr(line_ptr, ' ');
if (!outname)
break;
outname++;
trim(outname); /* remove trailing space (and '\r' for DOS text) */
if (!outname[0])
break;
}
dst_stream = stdout;
if (NOT_LONE_DASH(outname)) {
dst_stream = xfopen_for_write(outname);
fchmod(fileno(dst_stream), mode & (S_IRWXU | S_IRWXG | S_IRWXO));
}
free(line);
decode_fn_ptr(src_stream, dst_stream, /*flags:*/ BASE64_FLAG_UU_STOP + BASE64_FLAG_NO_STOP_CHAR);
/* fclose_if_not_stdin(src_stream); - redundant */
return EXIT_SUCCESS;
}
bb_error_msg_and_die("no 'begin' line");
}
#endif
//applet:IF_BASE64(APPLET(base64, BB_DIR_BIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_BASE64) += uudecode.o
//config:config BASE64
//config: bool "base64 (4.9 kb)"
//config: default y
//config: help
//config: Base64 encode and decode
//usage:#define base64_trivial_usage
//usage: "[-d] [FILE]"
//usage:#define base64_full_usage "\n\n"
//usage: "Base64 encode or decode FILE to standard output"
//usage: "\n -d Decode data"
////usage: "\n -w COL Wrap lines at COL (default 76, 0 disables)"
////usage: "\n -i When decoding, ignore non-alphabet characters"
#if ENABLE_BASE64
int base64_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int base64_main(int argc UNUSED_PARAM, char **argv)
{
FILE *src_stream;
unsigned opts;
opts = getopt32(argv, "^" "d" "\0" "?1"/* 1 arg max*/);
argv += optind;
if (!argv[0])
*--argv = (char*)"-";
src_stream = xfopen_stdin(argv[0]);
if (opts) {
read_base64(src_stream, stdout, /*flags:*/ (char)EOF);
} else {
enum {
SRC_BUF_SIZE = 76/4*3, /* This *MUST* be a multiple of 3 */
DST_BUF_SIZE = 4 * ((SRC_BUF_SIZE + 2) / 3),
};
char src_buf[SRC_BUF_SIZE];
char dst_buf[DST_BUF_SIZE + 1];
int src_fd = fileno(src_stream);
while (1) {
size_t size = full_read(src_fd, src_buf, SRC_BUF_SIZE);
if (!size)
break;
if ((ssize_t)size < 0)
bb_perror_msg_and_die(bb_msg_read_error);
/* Encode the buffer we just read in */
bb_uuencode(dst_buf, src_buf, size, bb_uuenc_tbl_base64);
xwrite(STDOUT_FILENO, dst_buf, 4 * ((size + 2) / 3));
bb_putchar('\n');
fflush(stdout);
}
}
fflush_stdout_and_exit(EXIT_SUCCESS);
}
#endif
/* Test script.
Put this into an empty dir with busybox binary, an run.
#!/bin/sh
test -x busybox || { echo "No ./busybox?"; exit; }
ln -sf busybox uudecode
ln -sf busybox uuencode
>A_null
echo -n A >A
echo -n AB >AB
echo -n ABC >ABC
echo -n ABCD >ABCD
echo -n ABCDE >ABCDE
echo -n ABCDEF >ABCDEF
cat busybox >A_bbox
for f in A*; do
echo uuencode $f
./uuencode $f <$f >u_$f
./uuencode -m $f <$f >m_$f
done
mkdir unpk_u unpk_m 2>/dev/null
for f in u_*; do
./uudecode <$f -o unpk_u/${f:2}
diff -a ${f:2} unpk_u/${f:2} >/dev/null 2>&1
echo uudecode $f: $?
done
for f in m_*; do
./uudecode <$f -o unpk_m/${f:2}
diff -a ${f:2} unpk_m/${f:2} >/dev/null 2>&1
echo uudecode $f: $?
done
*/
|
349092.c |
enum {
RDCURRENT_HANDLE,
__RDCURRENT_MAX
};
static const struct blobmsg_policy policy_rdcurrent[__RDCURRENT_MAX] = {
[RDCURRENT_HANDLE] = { .name = "handle", .type = BLOBMSG_TYPE_INT32 },
};
static int focas_rdcurrent(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method,
struct blob_attr *msg)
{
struct blob_attr *tb[__RDCURRENT_MAX];
unsigned short handle = 0;
short ret = 0;
short data;
memset(&data, 0, sizeof(data));
blobmsg_parse(policy_rdcurrent, __RDCURRENT_MAX, tb, blob_data(msg), blob_len(msg));
if (!tb[RDCURRENT_HANDLE])
return UBUS_STATUS_INVALID_ARGUMENT;
handle = blobmsg_get_u32(tb[RDCURRENT_HANDLE]);
ret = cnc_rdcurrent(handle, &data);
CHECK_FOCAS_RET(ret);
blob_buf_init(&b, 0);
blobmsg_add_u32(&b, "rc", ret);
blobmsg_add_u32(&b, "data", data.data);
ubus_send_reply(ctx, req, b.head);
return 0;
}
|
408915.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat1.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: esuguimo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/17 01:46:43 by esuguimo #+# #+# */
/* Updated: 2019/10/17 12:36:50 by esuguimo ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strcat(char *dest, char *src)
{
int i;
int j;
i = 0;
j = 0;
while (dest[i])
++i;
while (src[j])
{
dest[i] = src[j];
++i;
++j;
}
dest[i] = 0;
return (dest);
}
|
915269.c | /* Taxonomy Classification: 0000300602130000000111 */
/*
* WRITE/READ 0 write
* WHICH BOUND 0 upper
* DATA TYPE 0 char
* MEMORY LOCATION 0 stack
* SCOPE 3 inter-file/inter-proc
* CONTAINER 0 no
* POINTER 0 no
* INDEX COMPLEXITY 6 N/A
* ADDRESS COMPLEXITY 0 constant
* LENGTH COMPLEXITY 2 constant
* ADDRESS ALIAS 1 yes, one level
* INDEX ALIAS 3 N/A
* LOCAL CONTROL FLOW 0 none
* SECONDARY CONTROL FLOW 0 none
* LOOP STRUCTURE 0 no
* LOOP COMPLEXITY 0 N/A
* ASYNCHRONY 0 no
* TAINT 0 no
* RUNTIME ENV. DEPENDENCE 0 no
* MAGNITUDE 1 1 byte
* CONTINUOUS/DISCRETE 1 continuous
* SIGNEDNESS 1 yes
*/
/*
Copyright 2005 Massachusetts Institute of Technology
All rights reserved.
Redistribution and use of software 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 set of conditions and the disclaimer below.
- Redistributions in binary form must reproduce the copyright notice, this
set of conditions, and the disclaimer below in the documentation and/or
other materials provided with the distribution.
- Neither the name of the Massachusetts Institute of Technology 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".
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.
*/
#include <string.h>
int main(int argc, char *argv[])
{
char src[11];
char buf[10];
memset(src, 'A', 11);
src[11 - 1] = '\0';
/* BAD */
memcpy(buf, src, -1);
return 0;
}
|
320958.c | #include "rmutil/util.h"
#include "spec.h"
#include "util/logging.h"
#include "util/misc.h"
#include "rmutil/vector.h"
#include "trie/trie_type.h"
#include <math.h>
#include <ctype.h>
#include <assert.h>
#include "rmalloc.h"
#include "config.h"
#include "cursor.h"
#include "tag_index.h"
#include "redis_index.h"
#include "indexer.h"
#include "alias.h"
void (*IndexSpec_OnCreate)(const IndexSpec *) = NULL;
const char *(*IndexAlias_GetUserTableName)(RedisModuleCtx *, const char *) = NULL;
RedisModuleType *IndexSpecType;
uint64_t spec_unique_ids = 0;
static const FieldSpec *getFieldCommon(const IndexSpec *spec, const char *name, size_t len,
int useCase) {
for (size_t i = 0; i < spec->numFields; i++) {
if (len != strlen(spec->fields[i].name)) {
continue;
}
const FieldSpec *fs = spec->fields + i;
if (useCase) {
if (!strncmp(fs->name, name, len)) {
return fs;
}
} else {
if (!strncasecmp(fs->name, name, len)) {
return fs;
}
}
}
return NULL;
}
/*
* Get a field spec by field name. Case insensitive!
* Return the field spec if found, NULL if not
*/
const FieldSpec *IndexSpec_GetField(const IndexSpec *spec, const char *name, size_t len) {
return getFieldCommon(spec, name, len, 0);
};
const FieldSpec *IndexSpec_GetFieldCase(const IndexSpec *spec, const char *name, size_t n) {
return getFieldCommon(spec, name, n, 1);
}
t_fieldMask IndexSpec_GetFieldBit(IndexSpec *spec, const char *name, size_t len) {
const FieldSpec *sp = IndexSpec_GetField(spec, name, len);
if (!sp || !FIELD_IS(sp, INDEXFLD_T_FULLTEXT) || !FieldSpec_IsIndexable(sp)) return 0;
return FIELD_BIT(sp);
}
int IndexSpec_CheckPhoneticEnabled(const IndexSpec *sp, t_fieldMask fm) {
if (!(sp->flags & Index_HasPhonetic)) {
return 0;
}
if (fm == 0 || fm == (t_fieldMask)-1) {
// No fields -- implicit phonetic match!
return 1;
}
for (size_t ii = 0; ii < sp->numFields; ++ii) {
if (fm & ((t_fieldMask)1 << ii)) {
const FieldSpec *fs = sp->fields + ii;
if (FIELD_IS(fs, INDEXFLD_T_FULLTEXT) && (FieldSpec_IsPhonetics(fs))) {
return 1;
}
}
}
return 0;
}
int IndexSpec_GetFieldSortingIndex(IndexSpec *sp, const char *name, size_t len) {
if (!sp->sortables) return -1;
return RSSortingTable_GetFieldIdx(sp->sortables, name);
}
const char *GetFieldNameByBit(const IndexSpec *sp, t_fieldMask id) {
for (int i = 0; i < sp->numFields; i++) {
if (FIELD_BIT(&sp->fields[i]) == id && FIELD_IS(&sp->fields[i], INDEXFLD_T_FULLTEXT) &&
FieldSpec_IsIndexable(&sp->fields[i])) {
return sp->fields[i].name;
}
}
return NULL;
}
/*
* Parse an index spec from redis command arguments.
* Returns REDISMODULE_ERR if there's a parsing error.
* The command only receives the relevant part of argv.
*
* The format currently is FT.CREATE {index} [NOOFFSETS] [NOFIELDS] [NOFREQS]
SCHEMA {field} [TEXT [WEIGHT {weight}]] | [NUMERIC]
*/
IndexSpec *IndexSpec_ParseRedisArgs(RedisModuleCtx *ctx, RedisModuleString *name,
RedisModuleString **argv, int argc, QueryError *status) {
const char *args[argc];
for (int i = 0; i < argc; i++) {
args[i] = RedisModule_StringPtrLen(argv[i], NULL);
}
IndexSpec *ret = IndexSpec_Parse(RedisModule_StringPtrLen(name, NULL), args, argc, status);
return ret;
}
FieldSpec **getFieldsByType(IndexSpec *spec, FieldType type) {
#define FIELDS_ARRAY_CAP 2
FieldSpec **fields = array_new(FieldSpec *, FIELDS_ARRAY_CAP);
for (int i = 0; i < spec->numFields; ++i) {
if (FIELD_IS(spec->fields + i, type)) {
fields = array_append(fields, &(spec->fields[i]));
}
}
return fields;
}
/* Check if Redis is currently loading from RDB. Our thread starts before RDB loading is finished */
int isRdbLoading(RedisModuleCtx *ctx) {
long long isLoading = 0;
RMUtilInfo *info = RMUtil_GetRedisInfo(ctx);
if (!info) {
return 0;
}
if (!RMUtilInfo_GetInt(info, "loading", &isLoading)) {
isLoading = 0;
}
RMUtilRedisInfo_Free(info);
return isLoading == 1;
}
IndexSpec *IndexSpec_CreateNew(RedisModuleCtx *ctx, RedisModuleString **argv, int argc,
QueryError *status) {
IndexSpec *sp = IndexSpec_ParseRedisArgs(ctx, argv[1], &argv[2], argc - 2, status);
if (sp == NULL) {
return NULL;
}
RedisModuleString *keyString = RedisModule_CreateStringPrintf(ctx, INDEX_SPEC_KEY_FMT, sp->name);
RedisModuleKey *k = RedisModule_OpenKey(ctx, keyString, REDISMODULE_READ | REDISMODULE_WRITE);
RedisModule_FreeString(ctx, keyString);
// check that the key is empty
if (k == NULL || (RedisModule_KeyType(k) != REDISMODULE_KEYTYPE_EMPTY)) {
if (RedisModule_ModuleTypeGetType(k) != IndexSpecType) {
QueryError_SetCode(status, QUERY_EREDISKEYTYPE);
} else {
QueryError_SetCode(status, QUERY_EINDEXEXISTS);
}
IndexSpec_Free(sp);
if (k) {
RedisModule_CloseKey(k);
}
return NULL;
}
sp->uniqueId = spec_unique_ids++;
// Start the garbage collector
IndexSpec_StartGC(ctx, sp, GC_DEFAULT_HZ);
CursorList_AddSpec(&RSCursors, sp->name, RSCURSORS_DEFAULT_CAPACITY);
// set the value in redis
RedisModule_ModuleTypeSetValue(k, IndexSpecType, sp);
if (sp->flags & Index_Temporary) {
RedisModule_SetExpire(k, sp->timeout * 1000);
}
// Create the indexer
sp->indexer = NewIndexer(sp);
if (IndexSpec_OnCreate) {
IndexSpec_OnCreate(sp);
}
RedisModule_CloseKey(k);
return sp;
}
char *strtolower(char *str) {
char *p = str;
while (*p) {
*p = tolower(*p);
p++;
}
return str;
}
static bool checkPhoneticAlgorithmAndLang(const char *matcher) {
if (strlen(matcher) != 5) {
return false;
}
if (matcher[0] != 'd' || matcher[1] != 'm' || matcher[2] != ':') {
return false;
}
#define LANGUAGES_SIZE 4
char *languages[] = {"en", "pt", "fr", "es"};
bool langauge_found = false;
for (int i = 0; i < LANGUAGES_SIZE; ++i) {
if (matcher[3] == languages[i][0] && matcher[4] == languages[i][1]) {
langauge_found = true;
}
}
return langauge_found;
}
static int parseTextField(FieldSpec *sp, ArgsCursor *ac, QueryError *status) {
int rc;
// this is a text field
// init default weight and type
while (!AC_IsAtEnd(ac)) {
if (AC_AdvanceIfMatch(ac, SPEC_NOSTEM_STR)) {
sp->options |= FieldSpec_NoStemming;
continue;
} else if (AC_AdvanceIfMatch(ac, SPEC_WEIGHT_STR)) {
double d;
if ((rc = AC_GetDouble(ac, &d, 0)) != AC_OK) {
QERR_MKBADARGS_AC(status, "weight", rc);
return 0;
}
sp->ftWeight = d;
continue;
} else if (AC_AdvanceIfMatch(ac, SPEC_PHONETIC_STR)) {
if (AC_IsAtEnd(ac)) {
QueryError_SetError(status, QUERY_EPARSEARGS, SPEC_PHONETIC_STR " requires an argument");
return 0;
}
const char *matcher = AC_GetStringNC(ac, NULL);
// try and parse the matcher
// currently we just make sure algorithm is double metaphone (dm)
// and language is one of the following : English (en), French (fr), Portuguese (pt) and
// Spanish (es)
// in the future we will support more algorithms and more languages
if (!checkPhoneticAlgorithmAndLang(matcher)) {
QueryError_SetError(
status, QUERY_EINVAL,
"Matcher Format: <2 chars algorithm>:<2 chars language>. Support algorithms: "
"double metaphone (dm). Supported languages: English (en), French (fr), "
"Portuguese (pt) and Spanish (es)");
return 0;
}
sp->options |= FieldSpec_Phonetics;
continue;
} else {
break;
}
}
return 1;
}
void FieldSpec_Initialize(FieldSpec *sp, FieldType types) {
sp->types |= types;
if (FIELD_IS(sp, INDEXFLD_T_TAG)) {
sp->tagFlags = TAG_FIELD_DEFAULT_FLAGS;
sp->tagSep = TAG_FIELD_DEFAULT_SEP;
}
}
/* Parse a field definition from argv, at *offset. We advance offset as we progress.
* Returns 1 on successful parse, 0 otherwise */
static int parseFieldSpec(ArgsCursor *ac, FieldSpec *sp, QueryError *status) {
if (AC_IsAtEnd(ac)) {
QueryError_SetErrorFmt(status, QUERY_EPARSEARGS, "Field `%s` does not have a type", sp->name);
return 0;
}
if (AC_AdvanceIfMatch(ac, SPEC_TEXT_STR)) {
FieldSpec_Initialize(sp, INDEXFLD_T_FULLTEXT);
if (!parseTextField(sp, ac, status)) {
goto error;
}
} else if (AC_AdvanceIfMatch(ac, NUMERIC_STR)) {
FieldSpec_Initialize(sp, INDEXFLD_T_NUMERIC);
} else if (AC_AdvanceIfMatch(ac, GEO_STR)) { // geo field
FieldSpec_Initialize(sp, INDEXFLD_T_GEO);
} else if (AC_AdvanceIfMatch(ac, SPEC_TAG_STR)) { // tag field
FieldSpec_Initialize(sp, INDEXFLD_T_TAG);
if (AC_AdvanceIfMatch(ac, SPEC_SEPARATOR_STR)) {
if (AC_IsAtEnd(ac)) {
QueryError_SetError(status, QUERY_EPARSEARGS, SPEC_SEPARATOR_STR " requires an argument");
goto error;
}
const char *sep = AC_GetStringNC(ac, NULL);
if (strlen(sep) != 1) {
QueryError_SetErrorFmt(status, QUERY_EPARSEARGS,
"Tag separator must be a single character. Got `%s`", sep);
goto error;
}
sp->tagSep = *sep;
}
} else { // not numeric and not text - nothing more supported currently
QueryError_SetErrorFmt(status, QUERY_EPARSEARGS, "Invalid field type for field `%s`", sp->name);
goto error;
}
while (!AC_IsAtEnd(ac)) {
if (AC_AdvanceIfMatch(ac, SPEC_SORTABLE_STR)) {
FieldSpec_SetSortable(sp);
continue;
} else if (AC_AdvanceIfMatch(ac, SPEC_NOINDEX_STR)) {
sp->options |= FieldSpec_NotIndexable;
continue;
} else {
break;
}
}
return 1;
error:
if (!QueryError_HasError(status)) {
QueryError_SetErrorFmt(status, QUERY_EPARSEARGS, "Could not parse schema for field `%s`",
sp->name);
}
FieldSpec_Cleanup(sp);
return 0;
}
int IndexSpec_CreateTextId(const IndexSpec *sp) {
int maxId = -1;
for (size_t ii = 0; ii < sp->numFields; ++ii) {
const FieldSpec *fs = sp->fields + ii;
if (FIELD_IS(fs, INDEXFLD_T_FULLTEXT)) {
if (fs->ftId == (t_fieldId)-1) {
// ignore
continue;
}
maxId = MAX(fs->ftId, maxId);
}
}
if (maxId + 1 >= SPEC_MAX_FIELD_ID) {
return -1;
}
return maxId + 1;
}
/**
* Add fields to an existing (or newly created) index. If the addition fails,
*/
static int IndexSpec_AddFieldsInternal(IndexSpec *sp, ArgsCursor *ac, QueryError *status,
int isNew) {
if (sp->spcache) {
IndexSpecCache_Decref(sp->spcache);
sp->spcache = NULL;
}
const size_t prevNumFields = sp->numFields;
const size_t prevSortLen = sp->sortables->len;
FieldSpec *fs = NULL;
while (!AC_IsAtEnd(ac)) {
size_t nfieldName = 0;
const char *fieldName = AC_GetStringNC(ac, &nfieldName);
if (IndexSpec_GetField(sp, fieldName, nfieldName)) {
QueryError_SetError(status, QUERY_EINVAL, "Duplicate field in schema");
goto reset;
}
fs = IndexSpec_CreateField(sp, fieldName);
if (!parseFieldSpec(ac, fs, status)) {
goto reset;
}
if (FIELD_IS(fs, INDEXFLD_T_FULLTEXT) && FieldSpec_IsIndexable(fs)) {
int textId = IndexSpec_CreateTextId(sp);
if (textId < 0) {
QueryError_SetError(status, QUERY_ELIMIT, "Too many TEXT fields in schema");
goto reset;
}
// If we need to store field flags and we have over 32 fields, we need to switch to wide
// schema encoding
if (textId >= SPEC_WIDEFIELD_THRESHOLD && (sp->flags & Index_StoreFieldFlags)) {
if (isNew) {
sp->flags |= Index_WideSchema;
} else if ((sp->flags & Index_WideSchema) == 0) {
QueryError_SetError(
status, QUERY_ELIMIT,
"Cannot add more fields. Declare index with wide fields to allow adding "
"unlimited fields");
goto reset;
}
}
fs->ftId = textId;
}
if (FieldSpec_IsSortable(fs)) {
if (fs->options & FieldSpec_Dynamic) {
QueryError_SetError(status, QUERY_EBADOPTION, "Cannot set dynamic field to sortable");
goto reset;
}
fs->sortIdx = RSSortingTable_Add(sp->sortables, fs->name, fieldTypeToValueType(fs->types));
} else {
fs->sortIdx = -1;
}
if (FieldSpec_IsPhonetics(fs)) {
sp->flags |= Index_HasPhonetic;
}
fs = NULL;
}
return 1;
reset:
// If the current field spec exists, but was not added (i.e. we got an error)
// and reached this block, then free it
if (fs) {
// if we have a field spec it means that we increased the number of fields, so we need to
// decreas it.
--sp->numFields;
FieldSpec_Cleanup(fs);
}
for (size_t ii = prevNumFields; ii < sp->numFields; ++ii) {
FieldSpec_Cleanup(&sp->fields[ii]);
}
sp->numFields = prevNumFields;
sp->sortables->len = prevSortLen;
return 0;
}
int IndexSpec_AddFields(IndexSpec *sp, ArgsCursor *ac, QueryError *status) {
return IndexSpec_AddFieldsInternal(sp, ac, status, 0);
}
/* The format currently is FT.CREATE {index} [NOOFFSETS] [NOFIELDS]
SCHEMA {field} [TEXT [WEIGHT {weight}]] | [NUMERIC]
*/
IndexSpec *IndexSpec_Parse(const char *name, const char **argv, int argc, QueryError *status) {
IndexSpec *spec = NewIndexSpec(name);
ArgsCursor ac = {0};
ArgsCursor acStopwords = {0};
ArgsCursor_InitCString(&ac, argv, argc);
long long timeout = -1;
int dummy;
ACArgSpec argopts[] = {
{AC_MKUNFLAG(SPEC_NOOFFSETS_STR, &spec->flags,
Index_StoreTermOffsets | Index_StoreByteOffsets)},
{AC_MKUNFLAG(SPEC_NOHL_STR, &spec->flags, Index_StoreByteOffsets)},
{AC_MKUNFLAG(SPEC_NOFIELDS_STR, &spec->flags, Index_StoreFieldFlags)},
{AC_MKUNFLAG(SPEC_NOFREQS_STR, &spec->flags, Index_StoreFreqs)},
{AC_MKBITFLAG(SPEC_SCHEMA_EXPANDABLE_STR, &spec->flags, Index_WideSchema)},
// For compatibility
{.name = "NOSCOREIDX", .target = &dummy, .type = AC_ARGTYPE_BOOLFLAG},
{.name = SPEC_TEMPORARY_STR, .target = &timeout, .type = AC_ARGTYPE_LLONG},
{.name = SPEC_STOPWORDS_STR, .target = &acStopwords, .type = AC_ARGTYPE_SUBARGS},
{.name = NULL}};
ACArgSpec *errarg = NULL;
int rc = AC_ParseArgSpec(&ac, argopts, &errarg);
if (rc != AC_OK) {
if (rc != AC_ERR_ENOENT) {
QERR_MKBADARGS_AC(status, errarg->name, rc);
goto failure;
}
}
if (timeout != -1) {
spec->flags |= Index_Temporary;
}
spec->timeout = timeout;
if (AC_IsInitialized(&acStopwords)) {
spec->stopwords = NewStopWordListCStr((const char **)acStopwords.objs, acStopwords.argc);
spec->flags |= Index_HasCustomStopwords;
} else {
spec->stopwords = DefaultStopWordList();
}
if (!AC_AdvanceIfMatch(&ac, SPEC_SCHEMA_STR)) {
if (AC_NumRemaining(&ac)) {
const char *badarg = AC_GetStringNC(&ac, NULL);
QueryError_SetErrorFmt(status, QUERY_EPARSEARGS, "Unknown argument `%s`", badarg);
} else {
QueryError_SetError(status, QUERY_EPARSEARGS, "No schema found");
}
goto failure;
}
if (!IndexSpec_AddFieldsInternal(spec, &ac, status, 1)) {
goto failure;
}
return spec;
failure: // on failure free the spec fields array and return an error
IndexSpec_Free(spec);
return NULL;
}
/* Initialize some index stats that might be useful for scoring functions */
void IndexSpec_GetStats(IndexSpec *sp, RSIndexStats *stats) {
stats->numDocs = sp->stats.numDocuments;
stats->numTerms = sp->stats.numTerms;
stats->avgDocLen =
stats->numDocs ? (double)sp->stats.numRecords / (double)sp->stats.numDocuments : 0;
}
int IndexSpec_AddTerm(IndexSpec *sp, const char *term, size_t len) {
int isNew = Trie_InsertStringBuffer(sp->terms, (char *)term, len, 1, 1, NULL);
if (isNew) {
sp->stats.numTerms++;
sp->stats.termsSize += len;
}
return isNew;
}
IndexSpecCache *IndexSpec_GetSpecCache(const IndexSpec *spec) {
if (!spec->spcache) {
((IndexSpec *)spec)->spcache = IndexSpec_BuildSpecCache(spec);
}
spec->spcache->refcount++;
return spec->spcache;
}
IndexSpecCache *IndexSpec_BuildSpecCache(const IndexSpec *spec) {
IndexSpecCache *ret = calloc(1, sizeof(*ret));
ret->nfields = spec->numFields;
ret->fields = malloc(sizeof(*ret->fields) * ret->nfields);
ret->refcount = 1;
for (size_t ii = 0; ii < spec->numFields; ++ii) {
ret->fields[ii] = spec->fields[ii];
ret->fields[ii].name = strdup(ret->fields[ii].name);
}
return ret;
}
void IndexSpecCache_Decref(IndexSpecCache *c) {
if (--c->refcount) {
return;
}
for (size_t ii = 0; ii < c->nfields; ++ii) {
free(c->fields[ii].name);
}
free(c->fields);
free(c);
}
/// given an array of random weights, return the a weighted random selection, as the index in the
/// array
size_t weightedRandom(double weights[], size_t len) {
double totalWeight = 0;
for (size_t i = 0; i < len; i++) {
totalWeight += weights[i];
}
double selection = totalWeight * ((double)rand() / (double)(RAND_MAX));
totalWeight = 0;
for (size_t i = 0; i < len; i++) {
if (selection >= totalWeight && selection <= (totalWeight + weights[i])) {
return i;
}
totalWeight += weights[i];
}
// fallback
return 0;
}
/* Get a random term from the index spec using weighted random. Weighted random is done by
* sampling N terms from the index and then doing weighted random on them. A sample size of 10-20
* should be enough. Returns NULL if the index is empty */
char *IndexSpec_GetRandomTerm(IndexSpec *sp, size_t sampleSize) {
if (sampleSize > sp->terms->size) {
sampleSize = sp->terms->size;
}
if (!sampleSize) return NULL;
char *samples[sampleSize];
double weights[sampleSize];
for (int i = 0; i < sampleSize; i++) {
char *ret = NULL;
t_len len = 0;
double d = 0;
if (!Trie_RandomKey(sp->terms, &ret, &len, &d) || len == 0) {
return NULL;
}
samples[i] = ret;
weights[i] = d;
}
size_t selection = weightedRandom(weights, sampleSize);
for (int i = 0; i < sampleSize; i++) {
if (i != selection) {
free(samples[i]);
}
}
// printf("Selected %s --> %f\n", samples[selection], weights[selection]);
return samples[selection];
}
void IndexSpec_FreeWithKey(IndexSpec *sp, RedisModuleCtx *ctx) {
RedisModuleString *s = RedisModule_CreateStringPrintf(ctx, INDEX_SPEC_KEY_FMT, sp->name);
RedisModuleKey *kk = RedisModule_OpenKey(ctx, s, REDISMODULE_WRITE);
RedisModule_FreeString(ctx, s);
if (kk == NULL || RedisModule_KeyType(kk) != REDISMODULE_KEYTYPE_MODULE ||
RedisModule_ModuleTypeGetType(kk) != IndexSpecType) {
if (kk != NULL) {
RedisModule_CloseKey(kk);
}
IndexSpec_Free(sp);
return;
}
assert(RedisModule_ModuleTypeGetValue(kk) == sp);
RedisModule_DeleteKey(kk);
RedisModule_CloseKey(kk);
}
static void IndexSpec_FreeInternals(IndexSpec *spec) {
if (spec->indexer) {
Indexer_Free(spec->indexer);
}
if (spec->gc) {
GCContext_Stop(spec->gc);
}
if (spec->terms) {
TrieType_Free(spec->terms);
}
DocTable_Free(&spec->docs);
Cursors_PurgeWithName(&RSCursors, spec->name);
CursorList_RemoveSpec(&RSCursors, spec->name);
rm_free(spec->name);
if (spec->sortables) {
SortingTable_Free(spec->sortables);
spec->sortables = NULL;
}
if (spec->stopwords) {
StopWordList_Unref(spec->stopwords);
spec->stopwords = NULL;
}
if (spec->smap) {
SynonymMap_Free(spec->smap);
}
if (spec->spcache) {
IndexSpecCache_Decref(spec->spcache);
spec->spcache = NULL;
}
if (spec->indexStrs) {
for (size_t ii = 0; ii < spec->numFields; ++ii) {
IndexSpecFmtStrings *fmts = spec->indexStrs + ii;
for (size_t jj = 0; jj < INDEXFLD_NUM_TYPES; ++jj) {
if (fmts->types[jj]) {
RedisModule_FreeString(spec->strCtx, fmts->types[jj]);
}
}
}
rm_free(spec->indexStrs);
}
if (spec->strCtx) {
RedisModule_FreeThreadSafeContext(spec->strCtx);
}
if (spec->fields != NULL) {
for (size_t i = 0; i < spec->numFields; i++) {
rm_free(spec->fields[i].name);
}
rm_free(spec->fields);
}
IndexSpec_ClearAliases(spec);
rm_free(spec);
}
static void IndexSpec_FreeAsync(void *data) {
IndexSpec *spec = data;
RedisModuleCtx *threadCtx = RedisModule_GetThreadSafeContext(NULL);
RedisSearchCtx sctx = SEARCH_CTX_STATIC(threadCtx, spec);
RedisModule_AutoMemory(threadCtx);
RedisModule_ThreadSafeContextLock(threadCtx);
Redis_DropIndex(&sctx, true, false);
IndexSpec_FreeInternals(spec);
RedisModule_ThreadSafeContextUnlock(threadCtx);
RedisModule_FreeThreadSafeContext(threadCtx);
}
static struct thpool_ *cleanPool = NULL;
void IndexSpec_Free(void *ctx) {
IndexSpec *spec = ctx;
if (spec->flags & Index_Temporary) {
if (!cleanPool) {
cleanPool = thpool_init(1);
}
thpool_add_work(cleanPool, IndexSpec_FreeAsync, ctx);
return;
}
IndexSpec_FreeInternals(spec);
}
void IndexSpec_FreeSync(IndexSpec *spec) {
// todo:
// mark I think we only need IndexSpec_FreeInternals, this is called only from the
// LLAPI and there is no need to drop keys cause its out of the key space.
// Let me know what you think
// Need a context for this:
RedisModuleCtx *ctx = RedisModule_GetThreadSafeContext(NULL);
RedisSearchCtx sctx = SEARCH_CTX_STATIC(ctx, spec);
RedisModule_AutoMemory(ctx);
Redis_DropIndex(&sctx, 0, 1);
IndexSpec_FreeInternals(spec);
RedisModule_FreeThreadSafeContext(ctx);
}
IndexSpec *IndexSpec_LoadEx(RedisModuleCtx *ctx, IndexLoadOptions *options) {
IndexSpec *ret = NULL;
int modeflags = REDISMODULE_READ | REDISMODULE_WRITE;
if (options->flags & INDEXSPEC_LOAD_WRITEABLE) {
modeflags |= REDISMODULE_WRITE;
}
RedisModuleString *formatted;
int isKeynameOwner = 0;
const char *ixname = NULL;
if (options->flags & INDEXSPEC_LOAD_KEY_FORMATTED) {
formatted = options->name.rstring;
} else {
isKeynameOwner = 1;
if (options->flags & INDEXSPEC_LOAD_KEY_RSTRING) {
ixname = RedisModule_StringPtrLen(options->name.rstring, NULL);
} else {
ixname = options->name.cstring;
}
formatted = RedisModule_CreateStringPrintf(ctx, INDEX_SPEC_KEY_FMT, ixname);
}
options->keyp = RedisModule_OpenKey(ctx, formatted, modeflags);
// we do not allow empty indexes when loading an existing index
if (options->keyp == NULL || RedisModule_KeyType(options->keyp) == REDISMODULE_KEYTYPE_EMPTY) {
if (options->keyp) {
RedisModule_CloseKey(options->keyp);
options->keyp = NULL;
}
if ((options->flags & INDEXSPEC_LOAD_NOALIAS) || ixname == NULL) {
goto done; // doesn't exist.
}
IndexSpec *aliasTarget = ret = IndexAlias_Get(ixname);
if (aliasTarget && (options->flags & INDEXSPEC_LOAD_KEYLESS) == 0) {
if (isKeynameOwner) {
RedisModule_FreeString(ctx, formatted);
}
formatted = RedisModule_CreateStringPrintf(ctx, INDEX_SPEC_KEY_FMT, ret->name);
isKeynameOwner = 1;
options->keyp = RedisModule_OpenKey(ctx, formatted, modeflags);
}
} else {
if (RedisModule_ModuleTypeGetType(options->keyp) != IndexSpecType) {
goto done;
}
ret = RedisModule_ModuleTypeGetValue(options->keyp);
}
if (!ret) {
goto done;
}
if (ret->flags & Index_Temporary) {
mstime_t exp = ret->timeout * 1000;
if (modeflags & REDISMODULE_WRITE) {
RedisModule_SetExpire(options->keyp, exp);
} else {
RedisModuleKey *temp = RedisModule_OpenKey(ctx, formatted, REDISMODULE_WRITE);
RedisModule_SetExpire(temp, ret->timeout * 1000);
RedisModule_CloseKey(temp);
}
}
done:
if (isKeynameOwner) {
RedisModule_FreeString(ctx, formatted);
}
if ((options->flags & INDEXSPEC_LOAD_KEYLESS) && options->keyp) {
RedisModule_CloseKey(options->keyp);
options->keyp = NULL;
}
return ret;
}
/* Load the spec from the saved version */
IndexSpec *IndexSpec_Load(RedisModuleCtx *ctx, const char *name, int openWrite) {
IndexLoadOptions lopts = {.flags = openWrite ? INDEXSPEC_LOAD_WRITEABLE : 0,
.name = {.cstring = name}};
lopts.flags |= INDEXSPEC_LOAD_KEYLESS;
return IndexSpec_LoadEx(ctx, &lopts);
}
RedisModuleString *IndexSpec_GetFormattedKey(IndexSpec *sp, const FieldSpec *fs,
FieldType forType) {
if (!sp->indexStrs) {
sp->indexStrs = rm_calloc(SPEC_MAX_FIELDS, sizeof(*sp->indexStrs));
sp->strCtx = RedisModule_GetThreadSafeContext(NULL);
}
size_t typeix = INDEXTYPE_TO_POS(forType);
RedisModuleString *ret = sp->indexStrs[fs->index].types[typeix];
if (!ret) {
RedisSearchCtx sctx = {.redisCtx = sp->strCtx, .spec = sp};
switch (forType) {
case INDEXFLD_T_NUMERIC:
ret = fmtRedisNumericIndexKey(&sctx, fs->name);
break;
case INDEXFLD_T_TAG:
ret = TagIndex_FormatName(&sctx, fs->name);
break;
case INDEXFLD_T_GEO:
ret = RedisModule_CreateStringPrintf(sp->strCtx, GEOINDEX_KEY_FMT, sp->name, fs->name);
break;
case INDEXFLD_T_FULLTEXT: // Text fields don't get a per-field index
default:
ret = NULL;
abort();
break;
}
}
if (!ret) {
return NULL;
}
sp->indexStrs[fs->index].types[typeix] = ret;
return ret;
}
RedisModuleString *IndexSpec_GetFormattedKeyByName(IndexSpec *sp, const char *s,
FieldType forType) {
const FieldSpec *fs = IndexSpec_GetField(sp, s, strlen(s));
if (!fs) {
return NULL;
}
return IndexSpec_GetFormattedKey(sp, fs, forType);
}
t_fieldMask IndexSpec_ParseFieldMask(IndexSpec *sp, RedisModuleString **argv, int argc) {
t_fieldMask ret = 0;
for (int i = 0; i < argc; i++) {
size_t len;
const char *p = RedisModule_StringPtrLen(argv[i], &len);
ret |= IndexSpec_GetFieldBit(sp, p, len);
}
return ret;
}
void IndexSpec_InitializeSynonym(IndexSpec *sp) {
if (!sp->smap) {
sp->smap = SynonymMap_New(false);
sp->flags |= Index_HasSmap;
}
}
int IndexSpec_ParseStopWords(IndexSpec *sp, RedisModuleString **strs, size_t len) {
// if the index already has custom stopwords, let us free them first
if (sp->stopwords) {
StopWordList_Unref(sp->stopwords);
sp->stopwords = NULL;
}
sp->stopwords = NewStopWordList(strs, len);
// on failure we revert to the default stopwords list
if (sp->stopwords == NULL) {
sp->stopwords = DefaultStopWordList();
sp->flags &= ~Index_HasCustomStopwords;
return 0;
} else {
sp->flags |= Index_HasCustomStopwords;
}
return 1;
}
int IndexSpec_IsStopWord(IndexSpec *sp, const char *term, size_t len) {
if (!sp->stopwords) {
return 0;
}
return StopWordList_Contains(sp->stopwords, term, len);
}
IndexSpec *NewIndexSpec(const char *name) {
IndexSpec *sp = rm_calloc(1, sizeof(IndexSpec));
sp->fields = rm_calloc(sizeof(FieldSpec), SPEC_MAX_FIELDS);
sp->sortables = NewSortingTable();
sp->flags = INDEX_DEFAULT_FLAGS;
sp->name = rm_strdup(name);
sp->docs = DocTable_New(100);
sp->stopwords = DefaultStopWordList();
sp->terms = NewTrie();
sp->keysDict = NULL;
sp->minPrefix = RSGlobalConfig.minTermPrefix;
sp->maxPrefixExpansions = RSGlobalConfig.maxPrefixExpansions;
sp->getValue = NULL;
sp->getValueCtx = NULL;
memset(&sp->stats, 0, sizeof(sp->stats));
return sp;
}
FieldSpec *IndexSpec_CreateField(IndexSpec *sp, const char *name) {
sp->fields = rm_realloc(sp->fields, sizeof(*sp->fields) * (sp->numFields + 1));
FieldSpec *fs = sp->fields + sp->numFields;
memset(fs, 0, sizeof(*fs));
fs->index = sp->numFields++;
fs->name = rm_strdup(name);
fs->ftId = (t_fieldId)-1;
fs->ftWeight = 1.0;
fs->sortIdx = -1;
fs->tagFlags = TAG_FIELD_DEFAULT_FLAGS;
fs->tagFlags = TAG_FIELD_DEFAULT_SEP;
return fs;
}
void IndexSpec_StartGCFromSpec(IndexSpec *sp, float initialHZ, uint32_t gcPolicy) {
sp->gc = GCContext_CreateGCFromSpec(sp, initialHZ, sp->uniqueId, gcPolicy);
GCContext_Start(sp->gc);
}
/* Start the garbage collection loop on the index spec. The GC removes garbage data left on the
* index after removing documents */
void IndexSpec_StartGC(RedisModuleCtx *ctx, IndexSpec *sp, float initialHZ) {
assert(!sp->gc);
// we will not create a gc thread on temporary index
if (RSGlobalConfig.enableGC && !(sp->flags & Index_Temporary)) {
RedisModuleString *keyName = RedisModule_CreateString(ctx, sp->name, strlen(sp->name));
RedisModule_RetainString(ctx, keyName);
sp->gc = GCContext_CreateGC(keyName, initialHZ, sp->uniqueId);
GCContext_Start(sp->gc);
RedisModule_Log(ctx, "verbose", "Starting GC for index %s", sp->name);
}
}
// given a field mask with one bit lit, it returns its offset
int bit(t_fieldMask id) {
for (int i = 0; i < sizeof(t_fieldMask) * 8; i++) {
if (((id >> i) & 1) == 1) {
return i;
}
}
return 0;
}
// Backwards compat version of load for rdbs with version < 8
static void FieldSpec_RdbLoadCompat8(RedisModuleIO *rdb, FieldSpec *f, int encver) {
f->name = RedisModule_LoadStringBuffer(rdb, NULL);
// the old versions encoded the bit id of the field directly
// we convert that to a power of 2
if (encver < INDEX_MIN_WIDESCHEMA_VERSION) {
f->ftId = bit(RedisModule_LoadUnsigned(rdb));
} else {
// the new version encodes just the power of 2 of the bit
f->ftId = RedisModule_LoadUnsigned(rdb);
}
f->types = RedisModule_LoadUnsigned(rdb);
f->ftWeight = RedisModule_LoadDouble(rdb);
f->tagFlags = TAG_FIELD_DEFAULT_FLAGS;
f->tagSep = TAG_FIELD_DEFAULT_SEP;
if (encver >= 4) {
f->options = RedisModule_LoadUnsigned(rdb);
f->sortIdx = RedisModule_LoadSigned(rdb);
}
}
static void FieldSpec_RdbSave(RedisModuleIO *rdb, FieldSpec *f) {
RedisModule_SaveStringBuffer(rdb, f->name, strlen(f->name) + 1);
RedisModule_SaveUnsigned(rdb, f->types);
RedisModule_SaveUnsigned(rdb, f->options);
RedisModule_SaveSigned(rdb, f->sortIdx);
// Save text specific options
if (FIELD_IS(f, INDEXFLD_T_FULLTEXT) || (f->options & FieldSpec_Dynamic)) {
RedisModule_SaveUnsigned(rdb, f->ftId);
RedisModule_SaveDouble(rdb, f->ftWeight);
}
if (FIELD_IS(f, INDEXFLD_T_TAG) || (f->options & FieldSpec_Dynamic)) {
RedisModule_SaveUnsigned(rdb, f->tagFlags);
RedisModule_SaveStringBuffer(rdb, &f->tagSep, 1);
}
}
static const FieldType fieldTypeMap[] = {[IDXFLD_LEGACY_FULLTEXT] = INDEXFLD_T_FULLTEXT,
[IDXFLD_LEGACY_NUMERIC] = INDEXFLD_T_NUMERIC,
[IDXFLD_LEGACY_GEO] = INDEXFLD_T_GEO,
[IDXFLD_LEGACY_TAG] = INDEXFLD_T_TAG};
static void FieldSpec_RdbLoad(RedisModuleIO *rdb, FieldSpec *f, int encver) {
// Fall back to legacy encoding if needed
if (encver < INDEX_MIN_TAGFIELD_VERSION) {
return FieldSpec_RdbLoadCompat8(rdb, f, encver);
}
f->name = RedisModule_LoadStringBuffer(rdb, NULL);
f->types = RedisModule_LoadUnsigned(rdb);
f->options = RedisModule_LoadUnsigned(rdb);
f->sortIdx = RedisModule_LoadSigned(rdb);
if (encver < INDEX_MIN_MULTITYPE_VERSION) {
assert(f->types <= IDXFLD_LEGACY_MAX);
f->types = fieldTypeMap[f->types];
}
// Load text specific options
if (FIELD_IS(f, INDEXFLD_T_FULLTEXT) || (f->options & FieldSpec_Dynamic)) {
f->ftId = RedisModule_LoadUnsigned(rdb);
f->ftWeight = RedisModule_LoadDouble(rdb);
}
// Load tag specific options
if (FIELD_IS(f, INDEXFLD_T_TAG) || (f->options & FieldSpec_Dynamic)) {
f->tagFlags = RedisModule_LoadUnsigned(rdb);
// Load the separator
size_t l;
char *s = RedisModule_LoadStringBuffer(rdb, &l);
assert(l == 1);
f->tagSep = *s;
rm_free(s);
}
}
static void IndexStats_RdbLoad(RedisModuleIO *rdb, IndexStats *stats) {
stats->numDocuments = RedisModule_LoadUnsigned(rdb);
stats->numTerms = RedisModule_LoadUnsigned(rdb);
stats->numRecords = RedisModule_LoadUnsigned(rdb);
stats->invertedSize = RedisModule_LoadUnsigned(rdb);
stats->invertedCap = RedisModule_LoadUnsigned(rdb);
stats->skipIndexesSize = RedisModule_LoadUnsigned(rdb);
stats->scoreIndexesSize = RedisModule_LoadUnsigned(rdb);
stats->offsetVecsSize = RedisModule_LoadUnsigned(rdb);
stats->offsetVecRecords = RedisModule_LoadUnsigned(rdb);
stats->termsSize = RedisModule_LoadUnsigned(rdb);
}
static void IndexStats_RdbSave(RedisModuleIO *rdb, IndexStats *stats) {
RedisModule_SaveUnsigned(rdb, stats->numDocuments);
RedisModule_SaveUnsigned(rdb, stats->numTerms);
RedisModule_SaveUnsigned(rdb, stats->numRecords);
RedisModule_SaveUnsigned(rdb, stats->invertedSize);
RedisModule_SaveUnsigned(rdb, stats->invertedCap);
RedisModule_SaveUnsigned(rdb, stats->skipIndexesSize);
RedisModule_SaveUnsigned(rdb, stats->scoreIndexesSize);
RedisModule_SaveUnsigned(rdb, stats->offsetVecsSize);
RedisModule_SaveUnsigned(rdb, stats->offsetVecRecords);
RedisModule_SaveUnsigned(rdb, stats->termsSize);
}
void *IndexSpec_RdbLoad(RedisModuleIO *rdb, int encver) {
if (encver < INDEX_MIN_COMPAT_VERSION) {
return NULL;
}
RedisModuleCtx *ctx = RedisModule_GetContextFromIO(rdb);
IndexSpec *sp = rm_calloc(1, sizeof(IndexSpec));
sp->sortables = NewSortingTable();
sp->terms = NULL;
sp->docs = DocTable_New(1000);
sp->name = RedisModule_LoadStringBuffer(rdb, NULL);
sp->flags = (IndexFlags)RedisModule_LoadUnsigned(rdb);
sp->keysDict = NULL;
sp->maxPrefixExpansions = RSGlobalConfig.maxPrefixExpansions;
sp->minPrefix = RSGlobalConfig.minTermPrefix;
if (encver < INDEX_MIN_NOFREQ_VERSION) {
sp->flags |= Index_StoreFreqs;
}
sp->numFields = RedisModule_LoadUnsigned(rdb);
sp->fields = rm_calloc(sp->numFields, sizeof(FieldSpec));
int maxSortIdx = -1;
for (int i = 0; i < sp->numFields; i++) {
FieldSpec *fs = sp->fields + i;
FieldSpec_RdbLoad(rdb, sp->fields + i, encver);
sp->fields[i].index = i;
if (FieldSpec_IsSortable(fs)) {
assert(fs->sortIdx < RS_SORTABLES_MAX);
sp->sortables->fields[fs->sortIdx].name = fs->name;
sp->sortables->fields[fs->sortIdx].type = fieldTypeToValueType(fs->types);
sp->sortables->len = MAX(sp->sortables->len, fs->sortIdx + 1);
}
}
IndexStats_RdbLoad(rdb, &sp->stats);
DocTable_RdbLoad(&sp->docs, rdb, encver);
/* For version 3 or up - load the generic trie */
if (encver >= 3) {
sp->terms = TrieType_GenericLoad(rdb, 0);
} else {
sp->terms = NewTrie();
}
if (sp->flags & Index_HasCustomStopwords) {
sp->stopwords = StopWordList_RdbLoad(rdb, encver);
} else {
sp->stopwords = DefaultStopWordList();
}
sp->uniqueId = spec_unique_ids++;
IndexSpec_StartGC(ctx, sp, GC_DEFAULT_HZ);
RedisModuleString *specKey = RedisModule_CreateStringPrintf(ctx, INDEX_SPEC_KEY_FMT, sp->name);
CursorList_AddSpec(&RSCursors, sp->name, RSCURSORS_DEFAULT_CAPACITY);
RedisModule_FreeString(ctx, specKey);
sp->smap = NULL;
if (sp->flags & Index_HasSmap) {
sp->smap = SynonymMap_RdbLoad(rdb, encver);
}
if (IndexSpec_OnCreate) {
IndexSpec_OnCreate(sp);
}
if (encver < INDEX_MIN_EXPIRE_VERSION) {
sp->timeout = -1;
} else {
sp->timeout = RedisModule_LoadUnsigned(rdb);
}
if (encver >= INDEX_MIN_ALIAS_VERSION) {
size_t narr = RedisModule_LoadUnsigned(rdb);
for (size_t ii = 0; ii < narr; ++ii) {
QueryError status;
size_t dummy;
char *s = RedisModule_LoadStringBuffer(rdb, &dummy);
int rc = IndexAlias_Add(s, sp, 0, &status);
assert(rc == REDISMODULE_OK);
}
}
sp->indexer = NewIndexer(sp);
return sp;
}
void IndexSpec_RdbSave(RedisModuleIO *rdb, void *value) {
IndexSpec *sp = value;
// we save the name plus the null terminator
RedisModule_SaveStringBuffer(rdb, sp->name, strlen(sp->name) + 1);
RedisModule_SaveUnsigned(rdb, (uint)sp->flags);
RedisModule_SaveUnsigned(rdb, sp->numFields);
for (int i = 0; i < sp->numFields; i++) {
FieldSpec_RdbSave(rdb, &sp->fields[i]);
}
IndexStats_RdbSave(rdb, &sp->stats);
DocTable_RdbSave(&sp->docs, rdb);
// save trie of terms
TrieType_GenericSave(rdb, sp->terms, 0);
// If we have custom stopwords, save them
if (sp->flags & Index_HasCustomStopwords) {
StopWordList_RdbSave(rdb, sp->stopwords);
}
if (sp->flags & Index_HasSmap) {
SynonymMap_RdbSave(rdb, sp->smap);
}
RedisModule_SaveUnsigned(rdb, sp->timeout);
if (sp->aliases) {
RedisModule_SaveUnsigned(rdb, array_len(sp->aliases));
for (size_t ii = 0; ii < array_len(sp->aliases); ++ii) {
RedisModule_SaveStringBuffer(rdb, sp->aliases[ii], strlen(sp->aliases[ii]) + 1);
}
} else {
RedisModule_SaveUnsigned(rdb, 0);
}
}
void IndexSpec_Digest(RedisModuleDigest *digest, void *value) {
}
int IndexSpec_RegisterType(RedisModuleCtx *ctx) {
RedisModuleTypeMethods tm = {.version = REDISMODULE_TYPE_METHOD_VERSION,
.rdb_load = IndexSpec_RdbLoad,
.rdb_save = IndexSpec_RdbSave,
.aof_rewrite = GenericAofRewrite_DisabledHandler,
.free = IndexSpec_Free};
IndexSpecType = RedisModule_CreateDataType(ctx, "ft_index0", INDEX_CURRENT_VERSION, &tm);
if (IndexSpecType == NULL) {
RedisModule_Log(ctx, "error", "Could not create index spec type");
return REDISMODULE_ERR;
}
return REDISMODULE_OK;
} |
480611.c | /*
Bacula(R) - The Network Backup Solution
Copyright (C) 2000-2017 Kern Sibbald
The original author of Bacula is Kern Sibbald, with contributions
from many others, a complete list can be found in the file AUTHORS.
You may use this file and others of this release according to the
license defined in the LICENSE file, which includes the Affero General
Public License, v3.0 ("AGPLv3") and some additional permissions and
terms pursuant to its AGPLv3 Section 7.
This notice must be preserved when any source code is
conveyed and/or propagated.
Bacula(R) is a registered trademark of Kern Sibbald.
*/
/*
*
* ansi_label.c routines to handle ANSI (and perhaps one day IBM)
* tape labels.
*
* Kern Sibbald, MMV
*/
#include "bacula.h" /* pull in global headers */
#include "stored.h" /* pull in Storage Deamon headers */
/* Imported functions */
void ascii_to_ebcdic(char *dst, char *src, int count);
void ebcdic_to_ascii(char *dst, char *src, int count);
/* Forward referenced functions */
static char *ansi_date(time_t td, char *buf);
static bool same_label_names(char *bacula_name, char *ansi_name);
/*
* We read an ANSI label and compare the Volume name. We require
* a VOL1 record of 80 characters followed by a HDR1 record containing
* BACULA.DATA in the filename field. We then read up to 3 more
* header records (they are not required) and an EOF, at which
* point, all is good.
*
* Returns:
* VOL_OK Volume name OK
* VOL_NO_LABEL No ANSI label on Volume
* VOL_IO_ERROR I/O error on read
* VOL_NAME_ERROR Wrong name in VOL1 record
* VOL_LABEL_ERROR Probably an ANSI label, but something wrong
*
*/
int read_ansi_ibm_label(DCR *dcr)
{
DEVICE * volatile dev = dcr->dev;
JCR *jcr = dcr->jcr;
char label[80]; /* tape label */
int stat, i;
char *VolName = dcr->VolumeName;
bool ok = false;
/*
* Read VOL1, HDR1, HDR2 labels, but ignore the data
* If tape read the following EOF mark, on disk do
* not read.
*/
Dmsg0(100, "Read ansi label.\n");
if (!dev->is_tape()) {
return VOL_OK;
}
dev->label_type = B_BACULA_LABEL; /* assume Bacula label */
/* Read a maximum of 5 records VOL1, HDR1, ... HDR4 */
for (i=0; i < 6; i++) {
do {
stat = dev->read(label, sizeof(label));
} while (stat == -1 && errno == EINTR);
if (stat < 0) {
berrno be;
dev->clrerror(-1);
Dmsg1(100, "Read device got: ERR=%s\n", be.bstrerror());
Mmsg2(jcr->errmsg, _("Read error on device %s in ANSI label. ERR=%s\n"),
dev->dev_name, be.bstrerror());
Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
dev->VolCatInfo.VolCatErrors++;
return VOL_IO_ERROR;
}
if (stat == 0) {
if (dev->at_eof()) {
dev->set_eot(); /* second eof, set eot bit */
Dmsg0(100, "EOM on ANSI label\n");
Mmsg0(jcr->errmsg, _("Insane! End of tape while reading ANSI label.\n"));
return VOL_LABEL_ERROR; /* at EOM this shouldn't happen */
} else {
dev->set_ateof(); /* set eof state */
}
}
switch (i) {
case 0: /* Want VOL1 label */
if (stat == 80) {
if (strncmp("VOL1", label, 4) == 0) {
ok = true;
dev->label_type = B_ANSI_LABEL;
Dmsg0(100, "Got ANSI VOL1 label\n");
} else {
/* Try EBCDIC */
ebcdic_to_ascii(label, label, sizeof(label));
if (strncmp("VOL1", label, 4) == 0) {
ok = true;;
dev->label_type = B_IBM_LABEL;
Dmsg0(100, "Found IBM label.\n");
Dmsg0(100, "Got IBM VOL1 label\n");
}
}
}
if (!ok) {
Dmsg0(100, "No VOL1 label\n");
Mmsg0(jcr->errmsg, _("No VOL1 label while reading ANSI/IBM label.\n"));
return VOL_NO_LABEL; /* No ANSI label */
}
/* Compare Volume Names allow special wild card */
if (VolName && *VolName && *VolName != '*') {
if (!same_label_names(VolName, &label[4])) {
char *p = &label[4];
char *q;
free_volume(dev);
/* Store new Volume name */
q = dev->VolHdr.VolumeName;
for (int i=0; *p != ' ' && i < 6; i++) {
*q++ = *p++;
}
*q = 0;
Dmsg0(100, "Call reserve_volume\n");
/* ***FIXME*** why is this reserve_volume() needed???? KES */
reserve_volume(dcr, dev->VolHdr.VolumeName);
dev = dcr->dev; /* may have changed in reserve_volume */
Dmsg2(100, "Wanted ANSI Vol %s got %6s\n", VolName, dev->VolHdr.VolumeName);
Mmsg2(jcr->errmsg, _("Wanted ANSI Volume \"%s\" got \"%s\"\n"), VolName, dev->VolHdr.VolumeName);
return VOL_NAME_ERROR;
}
}
break;
case 1:
if (dev->label_type == B_IBM_LABEL) {
ebcdic_to_ascii(label, label, sizeof(label));
}
if (stat != 80 || strncmp("HDR1", label, 4) != 0) {
Dmsg0(100, "No HDR1 label\n");
Mmsg0(jcr->errmsg, _("No HDR1 label while reading ANSI label.\n"));
return VOL_LABEL_ERROR;
}
if (strncmp("BACULA.DATA", &label[4], 11) != 0) {
Dmsg1(100, "HD1 not Bacula label. Wanted BACULA.DATA got %11s\n",
&label[4]);
Mmsg1(jcr->errmsg, _("ANSI/IBM Volume \"%s\" does not belong to Bacula.\n"),
dev->VolHdr.VolumeName);
return VOL_NAME_ERROR; /* Not a Bacula label */
}
Dmsg0(100, "Got HDR1 label\n");
break;
case 2:
if (dev->label_type == B_IBM_LABEL) {
ebcdic_to_ascii(label, label, sizeof(label));
}
if (stat != 80 || strncmp("HDR2", label, 4) != 0) {
Dmsg0(100, "No HDR2 label\n");
Mmsg0(jcr->errmsg, _("No HDR2 label while reading ANSI/IBM label.\n"));
return VOL_LABEL_ERROR;
}
Dmsg0(100, "Got ANSI HDR2 label\n");
break;
default:
if (stat == 0) {
Dmsg0(100, "ANSI label OK\n");
return VOL_OK;
}
if (dev->label_type == B_IBM_LABEL) {
ebcdic_to_ascii(label, label, sizeof(label));
}
if (stat != 80 || strncmp("HDR", label, 3) != 0) {
Dmsg0(100, "Unknown or bad ANSI/IBM label record.\n");
Mmsg0(jcr->errmsg, _("Unknown or bad ANSI/IBM label record.\n"));
return VOL_LABEL_ERROR;
}
Dmsg0(100, "Got HDR label\n");
break;
}
}
Dmsg0(100, "Too many records in ANSI/IBM label.\n");
Mmsg0(jcr->errmsg, _("Too many records in while reading ANSI/IBM label.\n"));
return VOL_LABEL_ERROR;
}
/*
* ANSI/IBM VOL1 label
* 80 characters blank filled
* Pos count Function What Bacula puts
* 0-3 4 "VOL1" VOL1
* 4-9 6 Volume name Volume name
* 10-10 1 Access code
* 11-36 26 Unused
*
* ANSI
* 37-50 14 Owner
* 51-78 28 reserved
* 79 1 ANSI level 3
*
* IBM
* 37-40 4 reserved
* 41-50 10 Owner
* 51-79 29 reserved
*
*
* ANSI/IBM HDR1 label
* 80 characters blank filled
* Pos count Function What Bacula puts
* 0-3 4 "HDR1" HDR1
* 4-20 17 File name BACULA.DATA
* 21-26 6 Volume name Volume name
* 27-30 4 Vol seq num 0001
* 31-34 4 file num 0001
* 35-38 4 Generation 0001
* 39-40 2 Gen version 00
* 41-46 6 Create date bYYDDD yesterday
* 47-52 6 Expire date bYYDDD today
* 53-53 1 Access
* 54-59 6 Block count 000000
* 60-72 13 Software name Bacula
* 73-79 7 Reserved
* ANSI/IBM HDR2 label
* 80 characters blank filled
* Pos count Function What Bacula puts
* 0-3 4 "HDR2" HDR2
* 4-4 1 Record format D (V if IBM) => variable
* 5-9 5 Block length 32000
* 10-14 5 Rec length 32000
* 15-15 1 Density
* 16-16 1 Continued
* 17-33 17 Job
* 34-35 2 Recording
* 36-36 1 cr/lf ctl
* 37-37 1 reserved
* 38-38 1 Blocked flag
* 39-49 11 reserved
* 50-51 2 offset
* 52-79 28 reserved
*/
static const char *labels[] = {"HDR", "EOF", "EOV"};
/*
* Write an ANSI or IBM 80 character tape label
* Type determines whether we are writing HDR, EOF, or EOV labels
* Assume we are positioned to write the labels
* Returns: true of OK
* false if error
*/
bool write_ansi_ibm_labels(DCR *dcr, int type, const char *VolName)
{
DEVICE *dev = dcr->dev;
JCR *jcr = dcr->jcr;
char ansi_volname[7]; /* 6 char + \0 */
char label[80]; /* tape label */
char date[20]; /* ansi date buffer */
time_t now;
int len, stat, label_type;
/*
* If the Device requires a specific label type use it,
* otherwise, use the type requested by the Director
*/
if (dcr->device->label_type != B_BACULA_LABEL) {
label_type = dcr->device->label_type; /* force label type */
} else {
label_type = dcr->VolCatInfo.LabelType; /* accept Dir type */
}
switch (label_type) {
case B_BACULA_LABEL:
return true;
case B_ANSI_LABEL:
case B_IBM_LABEL:
ser_declare;
Dmsg1(100, "Write ANSI label type=%d\n", label_type);
len = strlen(VolName);
if (len > 6) {
Jmsg1(jcr, M_FATAL, 0, _("ANSI Volume label name \"%s\" longer than 6 chars.\n"),
VolName);
return false;
}
/* ANSI labels have 6 characters, and are padded with spaces
* 'vol1\0' => 'vol1 \0'
*/
strcpy(ansi_volname, VolName);
for(int i=len; i < 6; i++) {
ansi_volname[i]=' ';
}
ansi_volname[6]='\0'; /* only for debug */
if (type == ANSI_VOL_LABEL) {
ser_begin(label, sizeof(label));
ser_bytes("VOL1", 4);
ser_bytes(ansi_volname, 6);
/* Write VOL1 label */
if (label_type == B_IBM_LABEL) {
ascii_to_ebcdic(label, label, sizeof(label));
} else {
label[79] = '3'; /* ANSI label flag */
}
stat = dev->write(label, sizeof(label));
if (stat != sizeof(label)) {
berrno be;
Jmsg3(jcr, M_FATAL, 0, _("Could not write ANSI VOL1 label. Wanted size=%d got=%d ERR=%s\n"),
sizeof(label), stat, be.bstrerror());
return false;
}
}
/* Now construct HDR1 label */
memset(label, ' ', sizeof(label));
ser_begin(label, sizeof(label));
ser_bytes(labels[type], 3);
ser_bytes("1", 1);
ser_bytes("BACULA.DATA", 11); /* Filename field */
ser_begin(&label[21], sizeof(label)-21); /* fileset field */
ser_bytes(ansi_volname, 6); /* write Vol Ser No. */
ser_begin(&label[27], sizeof(label)-27);
ser_bytes("00010001000100", 14); /* File section, File seq no, Generation no */
now = time(NULL);
ser_bytes(ansi_date(now, date), 6); /* current date */
ser_bytes(ansi_date(now - 24 * 3600, date), 6); /* created yesterday */
ser_bytes(" 000000Bacula ", 27);
/* Write HDR1 label */
if (label_type == B_IBM_LABEL) {
ascii_to_ebcdic(label, label, sizeof(label));
}
/*
* This could come at the end of a tape, ignore
* EOT errors.
*/
stat = dev->write(label, sizeof(label));
if (stat != sizeof(label)) {
berrno be;
if (stat == -1) {
dev->clrerror(-1);
if (dev->dev_errno == 0) {
dev->dev_errno = ENOSPC; /* out of space */
}
if (dev->dev_errno != ENOSPC) {
Jmsg1(jcr, M_FATAL, 0, _("Could not write ANSI HDR1 label. ERR=%s\n"),
be.bstrerror());
return false;
}
} else {
Jmsg(jcr, M_FATAL, 0, _("Could not write ANSI HDR1 label.\n"));
return false;
}
}
/* Now construct HDR2 label */
memset(label, ' ', sizeof(label));
ser_begin(label, sizeof(label));
ser_bytes(labels[type], 3);
ser_bytes("2D3200032000", 12);
/* Write HDR2 label */
if (label_type == B_IBM_LABEL) {
label[4] = 'V';
ascii_to_ebcdic(label, label, sizeof(label));
}
stat = dev->write(label, sizeof(label));
if (stat != sizeof(label)) {
berrno be;
if (stat == -1) {
dev->clrerror(-1);
if (dev->dev_errno == 0) {
dev->dev_errno = ENOSPC; /* out of space */
}
if (dev->dev_errno != ENOSPC) {
Jmsg1(jcr, M_FATAL, 0, _("Could not write ANSI HDR1 label. ERR=%s\n"),
be.bstrerror());
return false;
}
dev->weof(NULL, 1);
return true;
} else {
Jmsg(jcr, M_FATAL, 0, _("Could not write ANSI HDR1 label.\n"));
return false;
}
}
if (!dev->weof(NULL, 1)) {
Jmsg(jcr, M_FATAL, 0, _("Error writing EOF to tape. ERR=%s"), dev->errmsg);
return false;
}
return true;
default:
Jmsg0(jcr, M_ABORT, 0, _("write_ansi_ibm_label called for non-ANSI/IBM type\n"));
return false; /* should not get here */
}
}
/* Check a Bacula Volume name against an ANSI Volume name */
static bool same_label_names(char *bacula_name, char *ansi_name)
{
char *a = ansi_name;
char *b = bacula_name;
/* Six characters max */
for (int i=0; i < 6; i++) {
if (*a == *b) {
a++;
b++;
continue;
}
/* ANSI labels are blank filled, Bacula's are zero terminated */
if (*a == ' ' && *b == 0) {
return true;
}
return false;
}
/* Reached 6 characters */
b++;
if (*b == 0) {
return true;
}
return false;
}
/*
* ANSI date
* ' 'YYDDD
*/
static char *ansi_date(time_t td, char *buf)
{
struct tm *tm;
if (td == 0) {
td = time(NULL);
}
tm = gmtime(&td);
bsnprintf(buf, 10, " %05d ", 1000 * (tm->tm_year + 1900 - 2000) + tm->tm_yday);
return buf;
}
|
Subsets and Splits