Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

50 строки
1.6 KiB

13 лет назад
11 лет назад
11 лет назад
13 лет назад
11 лет назад
  1. // This file is part of Jiffy released under the MIT license.
  2. // See the LICENSE file for more information.
  3. #ifndef JIFFY_H
  4. #define JIFFY_H
  5. #include "erl_nif.h"
  6. #define MAP_SUPPORT ((ERL_NIF_MAJOR_VERSION == 2 && ERL_NIF_MINOR_VERSION >= 6) || (ERL_NIF_MAJOR_VERSION > 2))
  7. typedef struct {
  8. ERL_NIF_TERM atom_ok;
  9. ERL_NIF_TERM atom_error;
  10. ERL_NIF_TERM atom_null;
  11. ERL_NIF_TERM atom_true;
  12. ERL_NIF_TERM atom_false;
  13. ERL_NIF_TERM atom_bignum;
  14. ERL_NIF_TERM atom_bignum_e;
  15. ERL_NIF_TERM atom_bigdbl;
  16. ERL_NIF_TERM atom_partial;
  17. ERL_NIF_TERM atom_uescape;
  18. ERL_NIF_TERM atom_pretty;
  19. ERL_NIF_TERM atom_force_utf8;
  20. ERL_NIF_TERM atom_map;
  21. ERL_NIF_TERM ref_object;
  22. ERL_NIF_TERM ref_array;
  23. } jiffy_st;
  24. ERL_NIF_TERM make_atom(ErlNifEnv* env, const char* name);
  25. ERL_NIF_TERM make_ok(jiffy_st* st, ErlNifEnv* env, ERL_NIF_TERM data);
  26. ERL_NIF_TERM make_error(jiffy_st* st, ErlNifEnv* env, const char* error);
  27. int maps_enabled(void);
  28. ERL_NIF_TERM decode(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
  29. ERL_NIF_TERM encode(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
  30. int int_from_hex(const unsigned char* p);
  31. int int_to_hex(int val, char* p);
  32. int utf8_len(int c);
  33. int utf8_esc_len(int c);
  34. int utf8_validate(unsigned char* data, size_t size);
  35. int utf8_to_unicode(unsigned char* buf, size_t size);
  36. int unicode_to_utf8(int c, unsigned char* buf);
  37. int unicode_from_pair(int hi, int lo);
  38. int unicode_uescape(int c, char* buf);
  39. int double_to_shortest(char *buf, size_t size, size_t* len, double val);
  40. #endif // Included JIFFY_H