hpdf_list.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * << Haru Free PDF Library >> -- hpdf_list.h
  3. *
  4. * URL: http://libharu.org
  5. *
  6. * Copyright (c) 1999-2006 Takeshi Kanno <[email protected]>
  7. * Copyright (c) 2007-2009 Antony Dovgal <[email protected]>
  8. *
  9. * Permission to use, copy, modify, distribute and sell this software
  10. * and its documentation for any purpose is hereby granted without fee,
  11. * provided that the above copyright notice appear in all copies and
  12. * that both that copyright notice and this permission notice appear
  13. * in supporting documentation.
  14. * It is provided "as is" without express or implied warranty.
  15. *
  16. */
  17. #ifndef _HPDF_LIST_H
  18. #define _HPDF_LIST_H
  19. #include "hpdf_error.h"
  20. #include "hpdf_mmgr.h"
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. typedef struct _HPDF_List_Rec *HPDF_List;
  25. typedef struct _HPDF_List_Rec {
  26. HPDF_MMgr mmgr;
  27. HPDF_Error error;
  28. HPDF_UINT block_siz;
  29. HPDF_UINT items_per_block;
  30. HPDF_UINT count;
  31. void **obj;
  32. } HPDF_List_Rec;
  33. HPDF_List
  34. HPDF_List_New (HPDF_MMgr mmgr,
  35. HPDF_UINT items_per_block);
  36. void
  37. HPDF_List_Free (HPDF_List list);
  38. HPDF_STATUS
  39. HPDF_List_Add (HPDF_List list,
  40. void *item);
  41. HPDF_STATUS
  42. HPDF_List_Insert (HPDF_List list,
  43. void *target,
  44. void *item);
  45. HPDF_STATUS
  46. HPDF_List_Remove (HPDF_List list,
  47. void *item);
  48. void*
  49. HPDF_List_RemoveByIndex (HPDF_List list,
  50. HPDF_UINT index);
  51. void*
  52. HPDF_List_ItemAt (HPDF_List list,
  53. HPDF_UINT index);
  54. HPDF_INT32
  55. HPDF_List_Find (HPDF_List list,
  56. void *item);
  57. void
  58. HPDF_List_Clear (HPDF_List list);
  59. #ifdef __cplusplus
  60. }
  61. #endif /* __cplusplus */
  62. #endif /* _HPDF_LIST_H */