diff options
| -rw-r--r-- | include/moslib.h | 7 | ||||
| -rw-r--r-- | include/moslib/ds/array.h | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/include/moslib.h b/include/moslib.h index 341db7e..b863678 100644 --- a/include/moslib.h +++ b/include/moslib.h @@ -2,6 +2,13 @@ // Main header file of the library // Contains all other header files +// By default the library doesn't force the use of a prefix +// You can force the use of the "mos" prefix by defining (before including any header): +// +// #define MOS_FORCE_PREFIXES +// +// This way you can, for example, avoid collisions + #include "moslib/ds/array.h" #include "moslib/mem/alloc.h" #include "moslib/tester.h" diff --git a/include/moslib/ds/array.h b/include/moslib/ds/array.h index 92dacbd..8f080a3 100644 --- a/include/moslib/ds/array.h +++ b/include/moslib/ds/array.h @@ -10,6 +10,9 @@ // // Then on the first usage of the array it's gonna be initialized. // You can use arr_set_cap function right after definition to initalize to the specified capacity. +// To set the default init capacity, define (before including the header): +// +// #define MOS_ARR_INIT_CAP <desired_init_cap> // // ---------------------------------------------------------------------------------------------------- // @@ -522,7 +525,7 @@ typedef struct { size_t cap; } MosArrHeader; -#define mos_arr_p_diff(p1, p2) (((char *)(p1) - (char*)(p2)) / sizeof(*(p2))) +#define mos_arr_p_diff(p1, p2) (((char *)(p1) - (char *)(p2)) / sizeof(*(p2))) // Function prototypes for macros extern void mos_arr_append_fn(void *p_arr, size_t el_size, size_t init_cap); |
