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