Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
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.
 
 
 
 

35 lines
1.1 KiB

  1. #ifndef _ARRAY_H
  2. #define _ARRAY_H
  3. #include "uint64.h"
  4. #include <errno.h>
  5. typedef struct {
  6. char* p;
  7. int64 allocated; /* in bytes */
  8. uint64 initialized; /* in bytes */
  9. /* p and allocated nonzero: array is allocated */
  10. /* p and allocated zero: array is unallocated */
  11. /* p zero and allocated < 0: array is failed */
  12. } array;
  13. void* array_allocate(array* x,uint64 membersize,int64 pos);
  14. void* array_get(array* x,uint64 membersize,int64 pos);
  15. void* array_start(const array* const x);
  16. int64 array_length(const array* const x,uint64 membersize);
  17. int64 array_bytes(const array* const x);
  18. void array_truncate(array* x,uint64 membersize,int64 len);
  19. void array_trunc(array* x);
  20. void array_reset(array* x);
  21. void array_fail(array* x);
  22. int array_equal(const array* const x,const array* const y);
  23. void array_cat(array* to,const array* const from);
  24. void array_catb(array* to,const char* from,uint64 len);
  25. void array_cats(array* to,const char* from);
  26. void array_cats0(array* to,const char* from);
  27. void array_cat0(array* to);
  28. void array_cate(array* to,const array* const from,int64 pos,int64 stop);
  29. #endif