args_8h_source.tex 5.2 KB

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