cytpl.pxd 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. from cpython.string cimport va_list
  2. from libc.stdint cimport uint32_t
  3. cdef extern from 'tpl.h':
  4. ctypedef int tpl_print_fcn(const char *fmt, ...)
  5. ctypedef void *tpl_malloc_fcn(size_t sz)
  6. ctypedef void *tpl_realloc_fcn(void *ptr, size_t sz)
  7. ctypedef void tpl_free_fcn(void *ptr)
  8. ctypedef void tpl_fatal_fcn(const char *fmt, ...)
  9. int TPL_FILE
  10. int TPL_MEM
  11. int TPL_PREALLOCD
  12. int TPL_EXCESS_OK
  13. int TPL_FD
  14. int TPL_UFREE
  15. int TPL_DATAPEEK
  16. int TPL_FXLENS
  17. int TPL_GETSIZE
  18. struct tpl_hook_t:
  19. tpl_print_fcn *oops
  20. tpl_malloc_fcn *malloc
  21. tpl_realloc_fcn *realloc
  22. tpl_free_fcn *free
  23. tpl_fatal_fcn *fatal
  24. size_t gather_max
  25. struct tpl_node:
  26. int type
  27. void *addr
  28. void *data
  29. int num
  30. size_t ser_osz
  31. tpl_node *children
  32. tpl_node *next
  33. tpl_node *prev
  34. tpl_node *parent
  35. struct tpl_bin:
  36. void *addr
  37. uint32_t sz
  38. struct tpl_gather_t:
  39. char *img
  40. int len
  41. ctypedef int tpl_gather_cb(void *img, size_t sz, void *data)
  42. # Protoypes.
  43. tpl_node *tpl_map(char *fmt,...)
  44. void tpl_free(tpl_node *r)
  45. int tpl_pack(tpl_node *r, int i)
  46. int tpl_unpack(tpl_node *r, int i)
  47. int tpl_dump(tpl_node *r, int mode, ...)
  48. int tpl_load(tpl_node *r, int mode, ...)
  49. int tpl_Alen(tpl_node *r, int i)
  50. char* tpl_peek(int mode, ...)
  51. int tpl_gather( int mode, ...)
  52. int tpl_jot(int mode, ...)
  53. tpl_node *tpl_map_va(char *fmt, va_list ap)