Files
geef/c_src/geef.h
Carlos Martín Nieto 616a358dc7 Prefer binary realloc to self-managed buffers
Use erlang's allocator and simplify the code by writing into the
buffer we're going to give back anyway.

Also introduce a function to NUL-terminate iolist buffers, which can
avoid memory copying.
2013-05-02 13:16:02 +02:00

36 lines
652 B
C

#ifndef GEEF_H
#define GEEF_H
#include "erl_nif.h"
ERL_NIF_TERM geef_error(ErlNifEnv *env);
ERL_NIF_TERM geef_oom(ErlNifEnv *env);
typedef struct {
ERL_NIF_TERM ok;
ERL_NIF_TERM error;
ERL_NIF_TERM true;
ERL_NIF_TERM false;
ERL_NIF_TERM repository;
ERL_NIF_TERM oid;
ERL_NIF_TERM symbolic;
ERL_NIF_TERM commit;
ERL_NIF_TERM tree;
ERL_NIF_TERM blob;
ERL_NIF_TERM tag;
ERL_NIF_TERM toposort;
ERL_NIF_TERM timesort;
ERL_NIF_TERM reversesort;
ERL_NIF_TERM iterover;
ERL_NIF_TERM enomem;
ERL_NIF_TERM eunknown;
} geef_atoms;
extern geef_atoms atoms;
/** NUL-terminate a binary */
int geef_terminate_binary(ErlNifBinary *bin);
#endif