#ifndef BASICS_H
#define BASICS_H
#include "system.h"
#include "reftable-basics.h"
void put_be24(uint8_t *out, uint32_t i);
uint32_t get_be24(uint8_t *in);
void put_be16(uint8_t *out, uint16_t i);
size_t binsearch(size_t sz, int (*f)(size_t k, void *args), void *args);
void free_names(char **a);
char **parse_names(char *buf, int size);
int names_equal(const char **a, const char **b);
size_t names_length(const char **names);
void *reftable_malloc(size_t sz);
void *reftable_realloc(void *p, size_t sz);
void reftable_free(void *p);
void *reftable_calloc(size_t nelem, size_t elsize);
char *reftable_strdup(const char *str);
#define REFTABLE_ALLOC_ARRAY(x, alloc) …
#define REFTABLE_CALLOC_ARRAY(x, alloc) …
#define REFTABLE_REALLOC_ARRAY(x, alloc) …
#define REFTABLE_ALLOC_GROW(x, nr, alloc) …
#define REFTABLE_FREE_AND_NULL(p) …
#ifndef REFTABLE_ALLOW_BANNED_ALLOCATORS
#define REFTABLE_BANNED …
# undef malloc
#define malloc …
# undef realloc
#define realloc …
# undef free
#define free …
# undef calloc
#define calloc …
# undef strdup
#define strdup …
#endif
struct strbuf;
int common_prefix_size(struct strbuf *a, struct strbuf *b);
int hash_size(uint32_t id);
#endif