build: Merge submodules into repo
This commit is contained in:
parent
540a30f719
commit
4c64279f90
422 changed files with 106715 additions and 8 deletions
120
src/minarch/libretro-common/include/array/rbuf.h
Normal file
120
src/minarch/libretro-common/include/array/rbuf.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/* Copyright (C) 2010-2020 The RetroArch team
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
* The following license statement only applies to this file (rbuf.h).
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*
|
||||
* 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 __LIBRETRO_SDK_ARRAY_RBUF_H__
|
||||
#define __LIBRETRO_SDK_ARRAY_RBUF_H__
|
||||
|
||||
/*
|
||||
* This file implements stretchy buffers as invented (?) by Sean Barrett.
|
||||
* Based on the implementation from the public domain Bitwise project
|
||||
* by Per Vognsen - https://github.com/pervognsen/bitwise
|
||||
*
|
||||
* It's a super simple type safe dynamic array for C with no need
|
||||
* to predeclare any type or anything.
|
||||
* The first time an element is added, memory for 16 elements are allocated.
|
||||
* Then every time length is about to exceed capacity, capacity is doubled.
|
||||
*
|
||||
* Be careful not to supply modifying statements to the macro arguments.
|
||||
* Something like RBUF_REMOVE(buf, i--); would have unintended results.
|
||||
*
|
||||
* Sample usage:
|
||||
*
|
||||
* mytype_t* buf = NULL;
|
||||
* RBUF_PUSH(buf, some_element);
|
||||
* RBUF_PUSH(buf, other_element);
|
||||
* -- now RBUF_LEN(buf) == 2, buf[0] == some_element, buf[1] == other_element
|
||||
*
|
||||
* -- Free allocated memory:
|
||||
* RBUF_FREE(buf);
|
||||
* -- now buf == NULL, RBUF_LEN(buf) == 0, RBUF_CAP(buf) == 0
|
||||
*
|
||||
* -- Explicitly increase allocated memory and set capacity:
|
||||
* RBUF_FIT(buf, 100);
|
||||
* -- now RBUF_LEN(buf) == 0, RBUF_CAP(buf) == 100
|
||||
*
|
||||
* -- Resize buffer (does not initialize or zero memory!)
|
||||
* RBUF_RESIZE(buf, 200);
|
||||
* -- now RBUF_LEN(buf) == 200, RBUF_CAP(buf) == 200
|
||||
*
|
||||
* -- To handle running out of memory:
|
||||
* bool ran_out_of_memory = !RBUF_TRYFIT(buf, 1000);
|
||||
* -- before RESIZE or PUSH. When out of memory, buf will stay unmodified.
|
||||
*/
|
||||
|
||||
#include <retro_math.h> /* for MAX */
|
||||
#include <stdlib.h> /* for malloc, realloc */
|
||||
|
||||
#define RBUF__HDR(b) (((struct rbuf__hdr *)(b))-1)
|
||||
|
||||
#define RBUF_LEN(b) ((b) ? RBUF__HDR(b)->len : 0)
|
||||
#define RBUF_CAP(b) ((b) ? RBUF__HDR(b)->cap : 0)
|
||||
#define RBUF_END(b) ((b) + RBUF_LEN(b))
|
||||
#define RBUF_SIZEOF(b) ((b) ? RBUF_LEN(b)*sizeof(*b) : 0)
|
||||
|
||||
#define RBUF_FREE(b) ((b) ? (free(RBUF__HDR(b)), (b) = NULL) : 0)
|
||||
#define RBUF_FIT(b, n) ((size_t)(n) <= RBUF_CAP(b) ? 0 : (*(void**)(&(b)) = rbuf__grow((b), (n), sizeof(*(b)))))
|
||||
#define RBUF_PUSH(b, val) (RBUF_FIT((b), 1 + RBUF_LEN(b)), (b)[RBUF__HDR(b)->len++] = (val))
|
||||
#define RBUF_POP(b) (b)[--RBUF__HDR(b)->len]
|
||||
#define RBUF_RESIZE(b, sz) (RBUF_FIT((b), (sz)), ((b) ? RBUF__HDR(b)->len = (sz) : 0))
|
||||
#define RBUF_CLEAR(b) ((b) ? RBUF__HDR(b)->len = 0 : 0)
|
||||
#define RBUF_TRYFIT(b, n) (RBUF_FIT((b), (n)), (((b) && RBUF_CAP(b) >= (size_t)(n)) || !(n)))
|
||||
#define RBUF_REMOVE(b, idx) memmove((b) + (idx), (b) + (idx) + 1, (--RBUF__HDR(b)->len - (idx)) * sizeof(*(b)))
|
||||
|
||||
struct rbuf__hdr
|
||||
{
|
||||
size_t len;
|
||||
size_t cap;
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__((__unused__))
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4505) //unreferenced local function has been removed
|
||||
#endif
|
||||
static void *rbuf__grow(void *buf,
|
||||
size_t new_len, size_t elem_size)
|
||||
{
|
||||
struct rbuf__hdr *new_hdr;
|
||||
size_t new_cap = MAX(2 * RBUF_CAP(buf), MAX(new_len, 16));
|
||||
size_t new_size = sizeof(struct rbuf__hdr) + new_cap*elem_size;
|
||||
if (buf)
|
||||
{
|
||||
new_hdr = (struct rbuf__hdr *)realloc(RBUF__HDR(buf), new_size);
|
||||
if (!new_hdr)
|
||||
return buf; /* out of memory, return unchanged */
|
||||
}
|
||||
else
|
||||
{
|
||||
new_hdr = (struct rbuf__hdr *)malloc(new_size);
|
||||
if (!new_hdr)
|
||||
return NULL; /* out of memory */
|
||||
new_hdr->len = 0;
|
||||
}
|
||||
new_hdr->cap = new_cap;
|
||||
return new_hdr + 1;
|
||||
}
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
285
src/minarch/libretro-common/include/array/rhmap.h
Normal file
285
src/minarch/libretro-common/include/array/rhmap.h
Normal file
|
|
@ -0,0 +1,285 @@
|
|||
/* Copyright (C) 2010-2020 The RetroArch team
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
* The following license statement only applies to this file (rhmap.h).
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*
|
||||
* 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 __LIBRETRO_SDK_ARRAY_RHMAP_H__
|
||||
#define __LIBRETRO_SDK_ARRAY_RHMAP_H__
|
||||
|
||||
/*
|
||||
* This file implements a hash map with 32-bit keys.
|
||||
* Based on the implementation from the public domain Bitwise project
|
||||
* by Per Vognsen - https://github.com/pervognsen/bitwise
|
||||
*
|
||||
* It's a super simple type safe hash map for C with no need
|
||||
* to predeclare any type or anything.
|
||||
* Will always allocate memory for twice the amount of max elements
|
||||
* so larger structs should be stored as pointers or indices to an array.
|
||||
* Can be used in C++ with POD types (without any constructor/destructor).
|
||||
*
|
||||
* Be careful not to supply modifying statements to the macro arguments.
|
||||
* Something like RHMAP_FIT(map, i++); would have unintended results.
|
||||
*
|
||||
* Sample usage:
|
||||
*
|
||||
* -- Set 2 elements with string keys and mytype_t values:
|
||||
* mytype_t* map = NULL;
|
||||
* RHMAP_SET_STR(map, "foo", foo_element);
|
||||
* RHMAP_SET_STR(map, "bar", bar_element);
|
||||
* -- now RHMAP_LEN(map) == 2, RHMAP_GET_STR(map, "foo") == foo_element
|
||||
*
|
||||
* -- Check if keys exist:
|
||||
* bool has_foo = RHMAP_HAS_STR(map, "foo");
|
||||
* bool has_baz = RHMAP_HAS_STR(map, "baz");
|
||||
* -- now has_foo == true, has_baz == false
|
||||
*
|
||||
* -- Removing a key:
|
||||
* bool removed = RHMAP_DEL_STR(map, "bar");
|
||||
* bool removed_again = RHMAP_DEL_STR(map, "bar");
|
||||
* -- now RHMAP_LEN(map) == 1, removed == true, removed_again == false
|
||||
*
|
||||
* -- Add/modify via pointer:
|
||||
* mytype_t* p_elem = RHMAP_PTR_STR(map, "qux");
|
||||
* p_elem->a = 123;
|
||||
* -- New keys initially have memory uninitialized
|
||||
* -- Pointers can get invalidated when a key is added/removed
|
||||
*
|
||||
* -- Looking up the index for a given key:
|
||||
* ptrdiff_t idx_foo = RHMAP_IDX_STR(map, "foo");
|
||||
* ptrdiff_t idx_invalid = RHMAP_IDX_STR(map, "invalid");
|
||||
* -- now idx_foo >= 0, idx_invalid == -1, map[idx_foo] == foo_element
|
||||
* -- Indices can change when a key is added/removed
|
||||
*
|
||||
* -- Clear all elements (keep memory allocated):
|
||||
* RHMAP_CLEAR(map);
|
||||
* -- now RHMAP_LEN(map) == 0, RHMAP_CAP(map) == 16
|
||||
*
|
||||
* -- Reserve memory for at least N elements:
|
||||
* RHMAP_FIT(map, 30);
|
||||
* -- now RHMAP_LEN(map) == 0, RHMAP_CAP(map) == 64
|
||||
*
|
||||
* -- Add elements with custom hash keys:
|
||||
* RHMAP_SET(map, my_uint32_hash(key1), some_element);
|
||||
* RHMAP_SET(map, my_uint32_hash(key2), other_element);
|
||||
* -- now RHMAP_LEN(map) == 2, _GET/_HAS/_DEL/_PTR/_IDX also exist
|
||||
*
|
||||
* -- Iterate elements (random order, order can change on insert):
|
||||
* for (size_t i = 0, cap = RHMAP_CAP(map); i != cap, i++)
|
||||
* if (RHMAP_KEY(map, i))
|
||||
* ------ here map[i] is the value of key RHMAP_KEY(map, i)
|
||||
*
|
||||
* -- Set a custom null value (is zeroed by default):
|
||||
* RHMAP_SETNULLVAL(map, map_null);
|
||||
* -- now RHMAP_GET_STR(map, "invalid") == map_null
|
||||
*
|
||||
* -- Free allocated memory:
|
||||
* RHMAP_FREE(map);
|
||||
* -- now map == NULL, RHMAP_LEN(map) == 0, RHMAP_CAP(map) == 0
|
||||
*
|
||||
* -- To handle running out of memory:
|
||||
* bool ran_out_of_memory = !RHMAP_TRYFIT(map, 1000);
|
||||
* -- before setting an element (with SET, PTR or NULLVAL).
|
||||
* -- When out of memory, map will stay unmodified.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h> /* for malloc, realloc */
|
||||
#include <string.h> /* for memcpy, memset */
|
||||
#include <stddef.h> /* for ptrdiff_t, size_t */
|
||||
#include <stdint.h> /* for uint32_t */
|
||||
|
||||
#define RHMAP_LEN(b) ((b) ? RHMAP__HDR(b)->len : 0)
|
||||
#define RHMAP_MAX(b) ((b) ? RHMAP__HDR(b)->maxlen : 0)
|
||||
#define RHMAP_CAP(b) ((b) ? RHMAP__HDR(b)->maxlen + 1 : 0)
|
||||
#define RHMAP_KEY(b, idx) (RHMAP__HDR(b)->keys[idx])
|
||||
#define RHMAP_KEY_STR(b, idx) (RHMAP__HDR(b)->key_strs[idx])
|
||||
#define RHMAP_SETNULLVAL(b, val) (RHMAP__FIT1(b), b[-1] = (val))
|
||||
#define RHMAP_CLEAR(b) ((b) ? (memset(RHMAP__HDR(b)->keys, 0, RHMAP_CAP(b) * sizeof(uint32_t)), RHMAP__HDR(b)->len = 0) : 0)
|
||||
#define RHMAP_FREE(b) ((b) ? (rhmap__free(RHMAP__HDR(b)), (b) = NULL) : 0)
|
||||
#define RHMAP_FIT(b, n) ((!(n) || ((b) && (size_t)(n) * 2 <= RHMAP_MAX(b))) ? 0 : RHMAP__GROW(b, n))
|
||||
#define RHMAP_TRYFIT(b, n) (RHMAP_FIT((b), (n)), (!(n) || ((b) && (size_t)(n) * 2 <= RHMAP_MAX(b))))
|
||||
|
||||
#define RHMAP_SET(b, key, val) RHMAP_SET_FULL(b, key, NULL, val)
|
||||
#define RHMAP_GET(b, key) RHMAP_GET_FULL(b, key, NULL)
|
||||
#define RHMAP_HAS(b, key) RHMAP_HAS_FULL(b, key, NULL)
|
||||
#define RHMAP_DEL(b, key) RHMAP_DEL_FULL(b, key, NULL)
|
||||
#define RHMAP_PTR(b, key) RHMAP_PTR_FULL(b, key, NULL)
|
||||
#define RHMAP_IDX(b, key) RHMAP_IDX_FULL(b, key, NULL)
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define RHMAP__UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
#define RHMAP__UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4505) //unreferenced local function has been removed
|
||||
#endif
|
||||
|
||||
#define RHMAP_SET_FULL(b, key, str, val) (RHMAP__FIT1(b), b[rhmap__idx(RHMAP__HDR(b), (key), (str), 1, 0)] = (val))
|
||||
#define RHMAP_GET_FULL(b, key, str) (RHMAP__FIT1(b), b[rhmap__idx(RHMAP__HDR(b), (key), (str), 0, 0)])
|
||||
#define RHMAP_HAS_FULL(b, key, str) ((b) ? rhmap__idx(RHMAP__HDR(b), (key), (str), 0, 0) != -1 : 0)
|
||||
#define RHMAP_DEL_FULL(b, key, str) ((b) ? rhmap__idx(RHMAP__HDR(b), (key), (str), 0, sizeof(*(b))) != -1 : 0)
|
||||
#define RHMAP_PTR_FULL(b, key, str) (RHMAP__FIT1(b), &b[rhmap__idx(RHMAP__HDR(b), (key), (str), 1, 0)])
|
||||
#define RHMAP_IDX_FULL(b, key, str) ((b) ? rhmap__idx(RHMAP__HDR(b), (key), (str), 0, 0) : -1)
|
||||
|
||||
#define RHMAP_SET_STR(b, string_key, val) RHMAP_SET_FULL(b, rhmap_hash_string(string_key), string_key, val)
|
||||
#define RHMAP_GET_STR(b, string_key) RHMAP_GET_FULL(b, rhmap_hash_string(string_key), string_key)
|
||||
#define RHMAP_HAS_STR(b, string_key) RHMAP_HAS_FULL(b, rhmap_hash_string(string_key), string_key)
|
||||
#define RHMAP_DEL_STR(b, string_key) RHMAP_DEL_FULL(b, rhmap_hash_string(string_key), string_key)
|
||||
#define RHMAP_PTR_STR(b, string_key) RHMAP_PTR_FULL(b, rhmap_hash_string(string_key), string_key)
|
||||
#define RHMAP_IDX_STR(b, string_key) RHMAP_IDX_FULL(b, rhmap_hash_string(string_key), string_key)
|
||||
|
||||
RHMAP__UNUSED static uint32_t rhmap_hash_string(const char* str)
|
||||
{
|
||||
unsigned char c;
|
||||
uint32_t hash = (uint32_t)0x811c9dc5;
|
||||
while ((c = (unsigned char)*(str++)) != '\0')
|
||||
hash = ((hash * (uint32_t)0x01000193) ^ (uint32_t)c);
|
||||
return (hash ? hash : 1);
|
||||
}
|
||||
|
||||
struct rhmap__hdr { size_t len, maxlen; uint32_t *keys; char** key_strs; };
|
||||
#define RHMAP__HDR(b) (((struct rhmap__hdr *)&(b)[-1])-1)
|
||||
#define RHMAP__GROW(b, n) (*(void**)(&(b)) = rhmap__grow((void*)(b), sizeof(*(b)), (size_t)(n)))
|
||||
#define RHMAP__FIT1(b) ((b) && RHMAP_LEN(b) * 2 <= RHMAP_MAX(b) ? 0 : RHMAP__GROW(b, 0))
|
||||
|
||||
RHMAP__UNUSED static void* rhmap__grow(void* old_ptr, size_t elem_size, size_t reserve)
|
||||
{
|
||||
struct rhmap__hdr *old_hdr = (old_ptr ? ((struct rhmap__hdr *)((char*)old_ptr-elem_size))-1 : NULL);
|
||||
struct rhmap__hdr *new_hdr;
|
||||
char *new_vals;
|
||||
size_t new_max = (old_ptr ? old_hdr->maxlen * 2 + 1 : 15);
|
||||
for (; new_max / 2 <= reserve; new_max = new_max * 2 + 1)
|
||||
if (new_max == (size_t)-1)
|
||||
return old_ptr; /* overflow */
|
||||
|
||||
new_hdr = (struct rhmap__hdr *)malloc(sizeof(struct rhmap__hdr) + (new_max + 2) * elem_size);
|
||||
if (!new_hdr)
|
||||
return old_ptr; /* out of memory */
|
||||
|
||||
new_hdr->maxlen = new_max;
|
||||
new_hdr->keys = (uint32_t *)calloc(new_max + 1, sizeof(uint32_t));
|
||||
if (!new_hdr->keys)
|
||||
{
|
||||
/* out of memory */
|
||||
free(new_hdr);
|
||||
return old_ptr;
|
||||
}
|
||||
new_hdr->key_strs = (char**)calloc(new_max + 1, sizeof(char*));
|
||||
if (!new_hdr->key_strs)
|
||||
{
|
||||
/* out of memory */
|
||||
free(new_hdr->keys);
|
||||
free(new_hdr);
|
||||
return old_ptr;
|
||||
}
|
||||
|
||||
new_vals = ((char*)(new_hdr + 1)) + elem_size;
|
||||
if (old_ptr)
|
||||
{
|
||||
size_t i;
|
||||
char* old_vals = ((char*)(old_hdr + 1)) + elem_size;
|
||||
for (i = 0; i <= old_hdr->maxlen; i++)
|
||||
{
|
||||
uint32_t key, j;
|
||||
if (!old_hdr->keys[i])
|
||||
continue;
|
||||
for (key = old_hdr->keys[i], j = key;; j++)
|
||||
{
|
||||
if (!new_hdr->keys[j &= new_hdr->maxlen])
|
||||
{
|
||||
new_hdr->keys[j] = key;
|
||||
new_hdr->key_strs[j] = old_hdr->key_strs[i];
|
||||
memcpy(new_vals + j * elem_size, old_vals + i * elem_size, elem_size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
memcpy(new_vals - elem_size, old_vals - elem_size, elem_size);
|
||||
new_hdr->len = old_hdr->len;
|
||||
free(old_hdr->keys);
|
||||
free(old_hdr->key_strs);
|
||||
free(old_hdr);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(new_vals - elem_size, 0, elem_size);
|
||||
new_hdr->len = 0;
|
||||
}
|
||||
return new_vals;
|
||||
}
|
||||
|
||||
RHMAP__UNUSED static ptrdiff_t rhmap__idx(struct rhmap__hdr* hdr, uint32_t key, const char * str, int add, size_t del)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
if (!key)
|
||||
return (ptrdiff_t)-1;
|
||||
|
||||
for (i = key;; i++)
|
||||
{
|
||||
if (hdr->keys[i &= hdr->maxlen] == key && (!hdr->key_strs[i] || !str || !strcmp(hdr->key_strs[i], str)))
|
||||
{
|
||||
if (del)
|
||||
{
|
||||
hdr->len--;
|
||||
hdr->keys[i] = 0;
|
||||
free(hdr->key_strs[i]);
|
||||
hdr->key_strs[i] = NULL;
|
||||
while ((key = hdr->keys[i = (i + 1) & hdr->maxlen]) != 0)
|
||||
{
|
||||
if ((key = (uint32_t)rhmap__idx(hdr, key, hdr->key_strs[i], 1, 0)) == i) continue;
|
||||
hdr->len--;
|
||||
hdr->keys[i] = 0;
|
||||
free(hdr->key_strs[i]);
|
||||
hdr->key_strs[i] = NULL;
|
||||
memcpy(((char*)(hdr + 1)) + (key + 1) * del,
|
||||
((char*)(hdr + 1)) + (i + 1) * del, del);
|
||||
}
|
||||
}
|
||||
return (ptrdiff_t)i;
|
||||
}
|
||||
if (!hdr->keys[i])
|
||||
{
|
||||
if (add) { hdr->len++; hdr->keys[i] = key; if (str) hdr->key_strs[i] = strdup(str); return (ptrdiff_t)i; }
|
||||
return (ptrdiff_t)-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RHMAP__UNUSED static void rhmap__free(struct rhmap__hdr* hdr)
|
||||
{
|
||||
size_t i;
|
||||
for (i=0;i<hdr->maxlen+1;i++)
|
||||
{
|
||||
free(hdr->key_strs[i]);
|
||||
}
|
||||
free(hdr->key_strs);
|
||||
free(hdr->keys);
|
||||
free(hdr);
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue