mirror of
https://github.com/thunderbrewhq/binana.git
synced 2025-12-12 17:52:29 +00:00
chore(binana): add files
This commit is contained in:
commit
aa605d1aef
14 changed files with 305 additions and 0 deletions
29
3.3.5a/include/storm/array.h
Normal file
29
3.3.5a/include/storm/array.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef STORM_ARRAY_H
|
||||
#define STORM_ARRAY_H
|
||||
|
||||
#define STORM_TS_BASE_ARRAY(type) typedef struct TSBaseArray_##type TSBaseArray_##type; \
|
||||
struct TSBaseArray_##type { \
|
||||
void** vtable; \
|
||||
uint32_t m_alloc; \
|
||||
uint32_t m_count; \
|
||||
type* m_data; \
|
||||
};
|
||||
|
||||
#define STORM_TS_FIXED_ARRAY(type) typedef struct TSFixedArray_##type TSFixedArray_##type; \
|
||||
struct TSFixedArray_##type { \
|
||||
void** vtable; \
|
||||
uint32_t m_alloc; \
|
||||
uint32_t m_count; \
|
||||
type* m_data; \
|
||||
};
|
||||
|
||||
#define STORM_TS_GROWABLE_ARRAY(type) typedef struct TSGrowableArray_##type TSGrowableArray_##type; \
|
||||
struct TSGrowableArray_##type { \
|
||||
void** vtable; \
|
||||
uint32_t m_alloc; \
|
||||
uint32_t m_count; \
|
||||
type* m_data; \
|
||||
uint32_t m_chunk; \
|
||||
};
|
||||
|
||||
#endif
|
||||
10
3.3.5a/include/storm/array/uint32_t.h
Normal file
10
3.3.5a/include/storm/array/uint32_t.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef STORM_ARRAY_UINT32_T_H
|
||||
#define STORM_ARRAY_UINT32_T_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "storm/array.h"
|
||||
|
||||
STORM_TS_GROWABLE_ARRAY(uint32_t)
|
||||
|
||||
#endif
|
||||
30
3.3.5a/include/storm/list.h
Normal file
30
3.3.5a/include/storm/list.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef STORM_LIST_H
|
||||
#define STORM_LIST_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// to make an object self referential
|
||||
// forward-declare 'struct Object_type' as 'Object_type'
|
||||
// then define 'struct Object_type'
|
||||
|
||||
// TSLink<T>
|
||||
#define STORM_TS_LINK(T) typedef struct TSLink_##T TSLink_##T; \
|
||||
struct TSLink_##T { \
|
||||
TSLink_##T* m_prevlink; \
|
||||
T* m_next; \
|
||||
};
|
||||
|
||||
// TSLinkedNode<T>
|
||||
#define STORM_TS_LINKED_NODE(T) typedef struct TSLinkedNode_##T TSLinkedNode_##T; \
|
||||
struct TSLinkedNode_##T { \
|
||||
TSLink_##T m_link; \
|
||||
};
|
||||
|
||||
// TSList<T>
|
||||
#define STORM_TS_LIST(T) typedef struct TSList_##T TSList_##T##; \
|
||||
struct TSList_##T { \
|
||||
ptrdiff_t m_linkoffset; \
|
||||
TSLink_##T m_terminator; \
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue