You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 rivejä
897 B

  1. #ifndef JIFFY_H
  2. #define JIFFY_H
  3. #include "erl_nif.h"
  4. typedef struct {
  5. ERL_NIF_TERM atom_ok;
  6. ERL_NIF_TERM atom_error;
  7. ERL_NIF_TERM atom_null;
  8. ERL_NIF_TERM atom_true;
  9. ERL_NIF_TERM atom_false;
  10. ERL_NIF_TERM atom_bignum;
  11. ERL_NIF_TERM ref_object;
  12. ERL_NIF_TERM ref_array;
  13. } jiffy_st;
  14. ERL_NIF_TERM make_atom(ErlNifEnv* env, const char* name);
  15. ERL_NIF_TERM make_ok(jiffy_st* st, ErlNifEnv* env, ERL_NIF_TERM data);
  16. ERL_NIF_TERM make_error(jiffy_st* st, ErlNifEnv* env, const char* error);
  17. ERL_NIF_TERM decode(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
  18. ERL_NIF_TERM encode(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
  19. int int_from_hex(const unsigned char* p);
  20. int int_to_hex(int val, char* p);
  21. int utf8_len(int c);
  22. int utf8_from_pair(int hi, int lo);
  23. int utf8_to_binary(int c, unsigned char* buf);
  24. #endif // Included JIFFY_H