array_8h_source.tex 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. \hypertarget{array_8h_source}{}\doxysection{array.\+h}
  2. \label{array_8h_source}\index{include/toolbox/array.h@{include/toolbox/array.h}}
  3. \begin{DoxyCode}{0}
  4. \DoxyCodeLine{1 \textcolor{preprocessor}{\#ifndef TOOLBOX\_ARRAY\_H}}
  5. \DoxyCodeLine{2 \textcolor{preprocessor}{\#define TOOLBOX\_ARRAY\_H}}
  6. \DoxyCodeLine{3 }
  7. \DoxyCodeLine{4 \textcolor{preprocessor}{\#include "{}toolbox/vptr.h"{}}}
  8. \DoxyCodeLine{5 \textcolor{preprocessor}{\#include "{}toolbox/return\_codes.h"{}}}
  9. \DoxyCodeLine{6 }
  10. \DoxyCodeLine{7 \textcolor{preprocessor}{\#include <stdint.h>}}
  11. \DoxyCodeLine{8 \textcolor{preprocessor}{\#include <stddef.h>}}
  12. \DoxyCodeLine{9 \textcolor{preprocessor}{\#include <string.h>}}
  13. \DoxyCodeLine{10 }
  14. \DoxyCodeLine{11 \textcolor{preprocessor}{\#ifdef TOOLBOX\_TYPEDEF}}
  15. \DoxyCodeLine{12 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structarray}{array}} array\_st;}
  16. \DoxyCodeLine{13 \textcolor{preprocessor}{\#endif}}
  17. \DoxyCodeLine{14 }
  18. \DoxyCodeLine{15 \textcolor{keyword}{struct }\mbox{\hyperlink{structarray}{array}} \{}
  19. \DoxyCodeLine{16 \textcolor{keywordtype}{size\_t} item\_size;}
  20. \DoxyCodeLine{17 \textcolor{keywordtype}{size\_t} size;}
  21. \DoxyCodeLine{18 \textcolor{keywordtype}{size\_t} alloc\_size;}
  22. \DoxyCodeLine{19 \textcolor{keywordtype}{void} **data;}
  23. \DoxyCodeLine{20 \};}
  24. \DoxyCodeLine{21 }
  25. \DoxyCodeLine{33 \_\_attribute\_\_((\_\_pure\_\_))}
  26. \DoxyCodeLine{34 \textcolor{keyword}{struct }\mbox{\hyperlink{structarray}{array}} *}
  27. \DoxyCodeLine{35 array\_create(\textcolor{keywordtype}{size\_t} arr\_size, \textcolor{keywordtype}{size\_t} item\_size);}
  28. \DoxyCodeLine{36 }
  29. \DoxyCodeLine{37 RET\_TYPE}
  30. \DoxyCodeLine{38 array\_clear(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self);}
  31. \DoxyCodeLine{39 }
  32. \DoxyCodeLine{40 RET\_TYPE}
  33. \DoxyCodeLine{41 array\_destroy(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} **self);}
  34. \DoxyCodeLine{42 }
  35. \DoxyCodeLine{43 \_\_attribute\_\_((\_\_pure\_\_))}
  36. \DoxyCodeLine{44 \textcolor{keywordtype}{size\_t}}
  37. \DoxyCodeLine{45 array\_index\_of(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self}
  38. \DoxyCodeLine{46 , \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  39. \DoxyCodeLine{47 }
  40. \DoxyCodeLine{48 \_\_attribute\_\_((\_\_pure\_\_))}
  41. \DoxyCodeLine{49 \_Bool}
  42. \DoxyCodeLine{50 array\_contain(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self}
  43. \DoxyCodeLine{51 , \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  44. \DoxyCodeLine{52 }
  45. \DoxyCodeLine{53 \_\_attribute\_\_((\_\_pure\_\_))}
  46. \DoxyCodeLine{54 \textcolor{keywordtype}{size\_t}}
  47. \DoxyCodeLine{55 array\_count(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  48. \DoxyCodeLine{56 }
  49. \DoxyCodeLine{57 RET\_TYPE}
  50. \DoxyCodeLine{58 array\_set(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} p\_index}
  51. \DoxyCodeLine{59 , \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  52. \DoxyCodeLine{60 }
  53. \DoxyCodeLine{61 RET\_TYPE}
  54. \DoxyCodeLine{62 array\_insert(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} p\_index}
  55. \DoxyCodeLine{63 , \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  56. \DoxyCodeLine{64 }
  57. \DoxyCodeLine{65 RET\_TYPE}
  58. \DoxyCodeLine{66 array\_append(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  59. \DoxyCodeLine{67 }
  60. \DoxyCodeLine{68 RET\_TYPE}
  61. \DoxyCodeLine{69 array\_prepend(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  62. \DoxyCodeLine{70 }
  63. \DoxyCodeLine{71 RET\_TYPE}
  64. \DoxyCodeLine{72 array\_delete(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} p\_index);}
  65. \DoxyCodeLine{73 }
  66. \DoxyCodeLine{74 RET\_TYPE}
  67. \DoxyCodeLine{75 array\_remove(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *item);}
  68. \DoxyCodeLine{76 }
  69. \DoxyCodeLine{77 RET\_TYPE}
  70. \DoxyCodeLine{78 array\_for\_each(\textcolor{keyword}{struct} \mbox{\hyperlink{structarray}{array}} *self, \textcolor{keywordtype}{void} (*for\_each)(\textcolor{keywordtype}{void} *item));}
  71. \DoxyCodeLine{79 }
  72. \DoxyCodeLine{80 \textcolor{preprocessor}{\#endif}}
  73. \end{DoxyCode}