\hypertarget{args_8h_source}{}\doxysection{args.\+h} \label{args_8h_source}\index{include/toolbox/args.h@{include/toolbox/args.h}} \begin{DoxyCode}{0} \DoxyCodeLine{1 \textcolor{preprocessor}{\#ifndef TOOLBOX\_ARGS\_H}} \DoxyCodeLine{2 \textcolor{preprocessor}{\#define TOOLBOX\_ARGS\_H}} \DoxyCodeLine{3 } \DoxyCodeLine{4 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{5 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{6 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{7 } \DoxyCodeLine{8 \textcolor{preprocessor}{\#ifdef TOOLBOX\_TYPEDEF}} \DoxyCodeLine{9 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structargs}{args}} args\_st;} \DoxyCodeLine{10 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{11 } \DoxyCodeLine{12 \textcolor{preprocessor}{\#define MAX\_NUM\_OF\_OPTIONS 1024}} \DoxyCodeLine{13 } \DoxyCodeLine{14 \textcolor{keyword}{struct }\mbox{\hyperlink{structargs__op}{args\_op}} \{} \DoxyCodeLine{15 \textcolor{keywordtype}{bool} mand;} \DoxyCodeLine{16 \textcolor{keyword}{enum} \{} \DoxyCodeLine{17 TOGGLE,} \DoxyCodeLine{18 STRING,} \DoxyCodeLine{19 INT8, INT16, INT32, INT64,} \DoxyCodeLine{20 FLOAT, DOUBLE} \DoxyCodeLine{21 \} type;} \DoxyCodeLine{22 \textcolor{keywordtype}{char} abv;} \DoxyCodeLine{23 \textcolor{keyword}{const} \textcolor{keywordtype}{void} *ret;} \DoxyCodeLine{24 \textcolor{keyword}{struct }\{} \DoxyCodeLine{25 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{structcstr}{cstr}};} \DoxyCodeLine{26 \textcolor{keywordtype}{size\_t} size;} \DoxyCodeLine{27 \} verb;} \DoxyCodeLine{28 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *desc;} \DoxyCodeLine{29 \};} \DoxyCodeLine{30 } \DoxyCodeLine{31 \textcolor{keyword}{struct }\mbox{\hyperlink{structargs}{args}} \{} \DoxyCodeLine{32 \textcolor{keyword}{const} \textcolor{keywordtype}{int} argc;} \DoxyCodeLine{33 \textcolor{keywordtype}{char} **argv;} \DoxyCodeLine{34 \textcolor{keywordtype}{size\_t} mand\_num;} \DoxyCodeLine{35 \textcolor{keywordtype}{char} prepender;} \DoxyCodeLine{36 \textcolor{keyword}{struct }\{} \DoxyCodeLine{37 \textcolor{keywordtype}{size\_t} size;} \DoxyCodeLine{38 \textcolor{keyword}{struct }\mbox{\hyperlink{structargs__op}{args\_op}} data[MAX\_NUM\_OF\_OPTIONS];} \DoxyCodeLine{39 \} ops;} \DoxyCodeLine{40 \};} \DoxyCodeLine{41 } \DoxyCodeLine{42 \_\_attribute\_\_((\_\_pure\_\_))} \DoxyCodeLine{43 \textcolor{keyword}{struct }\mbox{\hyperlink{structargs}{args}}} \DoxyCodeLine{44 args\_create(int argc, char **argv);} \DoxyCodeLine{45 } \DoxyCodeLine{46 \textcolor{keywordtype}{void}} \DoxyCodeLine{47 args\_set\_toggle(\textcolor{keyword}{struct} \mbox{\hyperlink{structargs}{args}} *self} \DoxyCodeLine{48 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} abreviation, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict verbose} \DoxyCodeLine{49 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict description, \textcolor{keywordtype}{bool} mandatory} \DoxyCodeLine{50 , \textcolor{keywordtype}{bool} *ret);} \DoxyCodeLine{51 } \DoxyCodeLine{52 \textcolor{keywordtype}{void}} \DoxyCodeLine{53 args\_set\_op\_str(\textcolor{keyword}{struct} \mbox{\hyperlink{structargs}{args}} *self} \DoxyCodeLine{54 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} abreviation, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict verbose} \DoxyCodeLine{55 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict description} \DoxyCodeLine{56 , \textcolor{keywordtype}{bool} mandatory, \textcolor{keywordtype}{void} *ret);} \DoxyCodeLine{57 } \DoxyCodeLine{58 \textcolor{keywordtype}{void}} \DoxyCodeLine{59 args\_set\_op\_float(\textcolor{keyword}{struct} \mbox{\hyperlink{structargs}{args}} *self} \DoxyCodeLine{60 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} abreviation, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict verbose} \DoxyCodeLine{61 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict description, \textcolor{keywordtype}{bool} mandatory} \DoxyCodeLine{62 , \textcolor{keywordtype}{bool} is\_double, \textcolor{keywordtype}{void} *ret);} \DoxyCodeLine{63 } \DoxyCodeLine{64 \textcolor{keywordtype}{void}} \DoxyCodeLine{65 args\_set\_op\_int(\textcolor{keyword}{struct} \mbox{\hyperlink{structargs}{args}} *self} \DoxyCodeLine{66 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} abreviation, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict verbose} \DoxyCodeLine{67 , \textcolor{keyword}{const} \textcolor{keywordtype}{char} *restrict description, \textcolor{keywordtype}{bool} mandatory} \DoxyCodeLine{68 , \textcolor{keywordtype}{size\_t} size\_in\_byte, \textcolor{keywordtype}{void} *ret);} \DoxyCodeLine{69 } \DoxyCodeLine{70 \textcolor{keywordtype}{void}} \DoxyCodeLine{71 args\_check(\textcolor{keyword}{struct} \mbox{\hyperlink{structargs}{args}} *self);} \DoxyCodeLine{72 } \DoxyCodeLine{73 \textcolor{preprocessor}{\#endif}} \end{DoxyCode}