-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
182 lines (180 loc) · 13.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Vita: Vita</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="v-flaticon-64x64.png"/></td>
<td id="projectalign">
<div id="projectname">Vita
</div>
<div id="projectbrief">A simple library for quick prototyping with modern C.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div><div class="header">
<div class="headertitle"><div class="title">Vita </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md__2_users_2krillos_2_my_files_2dev_2repos_2git_8kirillsaidov_2vita_2_r_e_a_d_m_e"></a> <img src="imgs/v-flaticon.png" alt="" width="64" height="64" align="left" class="inline"/> </p>
<h1><a class="anchor" id="autotoc_md0"></a>
Vita</h1>
<p>A simple and intuitive standard library for your modern C project! Lightweight and no dependencies. <code>Vita</code> strives to provide all common functionality other modern libraries have to ease prototyping with C and simplify the development process.</p>
<h2><a class="anchor" id="autotoc_md1"></a>
Features</h2>
<ul>
<li>containers</li>
<li>string manipulation</li>
<li>path and file handling</li>
<li>logging facility</li>
<li>command line arguments parsing</li>
<li>facilities to work with paths and directories</li>
<li>datetime utility</li>
</ul>
<h3><a class="anchor" id="autotoc_md2"></a>
Arguments parser showcase</h3>
<div class="fragment"><div class="line"><span class="comment">// argopt_showcase.c</span></div>
<div class="line"><span class="preprocessor">#include "<a class="code" href="vita_8h.html">vita/vita.h</a>"</span></div>
<div class="line"> </div>
<div class="line">int32_t main(<span class="keyword">const</span> int32_t argc, <span class="keyword">const</span> <span class="keywordtype">char</span> *argv[]) {</div>
<div class="line"> <span class="keywordtype">char</span> *opt_link = NULL;</div>
<div class="line"> <span class="keywordtype">char</span> *opt_save = strdup(<span class="stringliteral">"~/Desktop"</span>);</div>
<div class="line"> <span class="keywordtype">bool</span> opt_verbose = <span class="keyword">false</span>;</div>
<div class="line"> int32_t opt_quality = 720;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// create options to parse</span></div>
<div class="line"> <a class="code hl_struct" href="struct_vita_arg_opt.html">vt_argopt_t</a> optv[] = {</div>
<div class="line"> <span class="comment">// long short description argument type</span></div>
<div class="line"> { <span class="stringliteral">"--link"</span>, <span class="stringliteral">"-l"</span>, <span class="stringliteral">"url link"</span>, <a class="code hl_define" href="argopt_8h.html#a3b8c79f1705c889e14daebd2d3282bf3">VT_ARGOPT</a>(opt_link), <a class="code hl_enumvalue" href="core_8h.html#a0fb5b6164f80bfc49bf6e947d15cbc53a456a676e96610fd795bcba1963077905">VT_TYPE_CSTR</a> },</div>
<div class="line"> { <span class="stringliteral">"--save"</span>, <span class="stringliteral">"-s"</span>, <span class="stringliteral">"save directory"</span>, <a class="code hl_define" href="argopt_8h.html#a3b8c79f1705c889e14daebd2d3282bf3">VT_ARGOPT</a>(opt_save), <a class="code hl_enumvalue" href="core_8h.html#a0fb5b6164f80bfc49bf6e947d15cbc53a456a676e96610fd795bcba1963077905">VT_TYPE_CSTR</a> },</div>
<div class="line"> { <span class="stringliteral">"--verbose"</span>, <span class="stringliteral">"-v"</span>, <span class="stringliteral">"verbose output"</span>, <a class="code hl_define" href="argopt_8h.html#a3b8c79f1705c889e14daebd2d3282bf3">VT_ARGOPT</a>(opt_verbose), <a class="code hl_enumvalue" href="core_8h.html#a0fb5b6164f80bfc49bf6e947d15cbc53acfca2e382fcdd93e27371cc79252932e">VT_TYPE_BOOL</a> },</div>
<div class="line"> { <span class="stringliteral">"--quality"</span>, <span class="stringliteral">"-q"</span>, <span class="stringliteral">"video quality"</span>, <a class="code hl_define" href="argopt_8h.html#a3b8c79f1705c889e14daebd2d3282bf3">VT_ARGOPT</a>(opt_quality), <a class="code hl_enumvalue" href="core_8h.html#a0fb5b6164f80bfc49bf6e947d15cbc53af08a15e46786adef769cbf982b59e267">VT_TYPE_INT32</a> },</div>
<div class="line"> };</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">size_t</span> optc = <span class="keyword">sizeof</span>(optv)/<span class="keyword">sizeof</span>(<a class="code hl_struct" href="struct_vita_arg_opt.html">vt_argopt_t</a>);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// parse args and opts</span></div>
<div class="line"> <span class="keyword">const</span> int8_t parse_status = <a class="code hl_function" href="argopt_8h.html#a6f49dcb63dab5e5dac49692955bd17c3">vt_argopt_parse</a>(argc, argv, optc, optv, NULL);</div>
<div class="line"> <span class="keywordflow">if</span>(parse_status < 0) {</div>
<div class="line"> printf(<span class="stringliteral">"See 'argopt -h' for more info!\n"</span>);</div>
<div class="line"> <span class="keywordflow">goto</span> cleanup;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// display help manual</span></div>
<div class="line"> <span class="keywordflow">if</span>(parse_status == <a class="code hl_define" href="argopt_8h.html#a1e84d8a80775b0708189e74c417759e4">VT_ARGOPT_PARSE_HELP_WANTED</a>) {</div>
<div class="line"> <a class="code hl_function" href="argopt_8h.html#aa9d5b515ac4547a00dc61f579c965b32">vt_argopt_print_help</a>(</div>
<div class="line"> <span class="stringliteral">"downloader v0.3.0 -- easy video downloader"</span>, <span class="comment">// header</span></div>
<div class="line"> <span class="stringliteral">"Example: downloader --link your_url --save save/dir --verbose"</span>, <span class="comment">// footer</span></div>
<div class="line"> optc, optv</div>
<div class="line"> );</div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// now do your thing</span></div>
<div class="line"> download(opt_link, opt_save, opt_verbose, opt_quality);</div>
<div class="line"> </div>
<div class="line">cleanup:</div>
<div class="line"> free(opt_link);</div>
<div class="line"> free(opt_save);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="ttc" id="aargopt_8h_html_a1e84d8a80775b0708189e74c417759e4"><div class="ttname"><a href="argopt_8h.html#a1e84d8a80775b0708189e74c417759e4">VT_ARGOPT_PARSE_HELP_WANTED</a></div><div class="ttdeci">#define VT_ARGOPT_PARSE_HELP_WANTED</div><div class="ttdef"><b>Definition</b> argopt.h:18</div></div>
<div class="ttc" id="aargopt_8h_html_a3b8c79f1705c889e14daebd2d3282bf3"><div class="ttname"><a href="argopt_8h.html#a3b8c79f1705c889e14daebd2d3282bf3">VT_ARGOPT</a></div><div class="ttdeci">#define VT_ARGOPT(v)</div><div class="ttdef"><b>Definition</b> argopt.h:20</div></div>
<div class="ttc" id="aargopt_8h_html_a6f49dcb63dab5e5dac49692955bd17c3"><div class="ttname"><a href="argopt_8h.html#a6f49dcb63dab5e5dac49692955bd17c3">vt_argopt_parse</a></div><div class="ttdeci">int8_t vt_argopt_parse(const size_t argc, const char **const argv, const size_t optc, vt_argopt_t *const optv, struct VitaBaseAllocatorType *const alloctr)</div></div>
<div class="ttc" id="aargopt_8h_html_aa9d5b515ac4547a00dc61f579c965b32"><div class="ttname"><a href="argopt_8h.html#aa9d5b515ac4547a00dc61f579c965b32">vt_argopt_print_help</a></div><div class="ttdeci">void vt_argopt_print_help(const char *header, const char *footer, const size_t optc, const vt_argopt_t *const optv)</div></div>
<div class="ttc" id="acore_8h_html_a0fb5b6164f80bfc49bf6e947d15cbc53a456a676e96610fd795bcba1963077905"><div class="ttname"><a href="core_8h.html#a0fb5b6164f80bfc49bf6e947d15cbc53a456a676e96610fd795bcba1963077905">VT_TYPE_CSTR</a></div><div class="ttdeci">@ VT_TYPE_CSTR</div><div class="ttdef"><b>Definition</b> core.h:85</div></div>
<div class="ttc" id="acore_8h_html_a0fb5b6164f80bfc49bf6e947d15cbc53acfca2e382fcdd93e27371cc79252932e"><div class="ttname"><a href="core_8h.html#a0fb5b6164f80bfc49bf6e947d15cbc53acfca2e382fcdd93e27371cc79252932e">VT_TYPE_BOOL</a></div><div class="ttdeci">@ VT_TYPE_BOOL</div><div class="ttdef"><b>Definition</b> core.h:83</div></div>
<div class="ttc" id="acore_8h_html_a0fb5b6164f80bfc49bf6e947d15cbc53af08a15e46786adef769cbf982b59e267"><div class="ttname"><a href="core_8h.html#a0fb5b6164f80bfc49bf6e947d15cbc53af08a15e46786adef769cbf982b59e267">VT_TYPE_INT32</a></div><div class="ttdeci">@ VT_TYPE_INT32</div><div class="ttdef"><b>Definition</b> core.h:72</div></div>
<div class="ttc" id="astruct_vita_arg_opt_html"><div class="ttname"><a href="struct_vita_arg_opt.html">VitaArgOpt</a></div><div class="ttdef"><b>Definition</b> argopt.h:23</div></div>
<div class="ttc" id="avita_8h_html"><div class="ttname"><a href="vita_8h.html">vita.h</a></div></div>
</div><!-- fragment --><p>Building and running: </p><div class="fragment"><div class="line">$ gcc argopt_showcase.c -o downloader -lvita -L.</div>
<div class="line">$ ./downloader --link "www.abs.com/video" -s ~/Desktop/media --verbose</div>
<div class="line">==============================================</div>
<div class="line">Downloading video with the following options:</div>
<div class="line"> url: www.abs.com/video</div>
<div class="line"> save: ~/Desktop/media</div>
<div class="line"> verbose: true</div>
<div class="line"> quality: 720</div>
<div class="line">==============================================</div>
<div class="line"> </div>
<div class="line">$ ./downloader -h</div>
<div class="line">downloader v0.3.0 -- easy video downloader</div>
<div class="line">-l --link url link</div>
<div class="line">-s --save save directory</div>
<div class="line">-v --verbose verbose output</div>
<div class="line">-q --quality video quality</div>
<div class="line">-h --help This help information.</div>
<div class="line">Example: downloader --link your_url --save save/dir --verbose</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md3"></a>
More examples</h2>
<p>Check out the <a href="tests/src"><code>tests/src</code></a> directory for usage examples or read more on Vita Wiki.</p>
<h4><a class="anchor" id="autotoc_md4"></a>
Dev-process</h4>
<p>You can also closely follow the development process in Trello <a href="https://trello.com/b/MFeDGO8u/vita">board</a>.</p>
<h2><a class="anchor" id="autotoc_md5"></a>
LICENSE</h2>
<p>All code is licensed under the BSL license. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>