MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_protocol/samples/http/header/main.c:218–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218int main(int argc, char* argv[])
219{
220 int ch, max = 10;
221 char filepath[256], action[64];
222
223 if (0)
224 acl_mem_slice_init(8, 1024, 100000,
225 ACL_SLICE_FLAG_GC2 |
226 ACL_SLICE_FLAG_RTGC_OFF |
227 ACL_SLICE_FLAG_LP64_ALIGN);
228
229 filepath[0] = 0;
230 action[0] = 0;
231
232 while ((ch = getopt(argc, argv, "hn:f:a:")) > 0)
233 {
234 switch (ch)
235 {
236 case 'h':
237 usage(argv[0]);
238 return 0;
239 case 'n':
240 max = atoi(optarg);
241 if (max <= 0)
242 max = 10;
243 break;
244 case 'f':
245 snprintf(filepath, sizeof(filepath), "%s", optarg);
246 break;
247 case 'a':
248 snprintf(action, sizeof(action), "%s", optarg);
249 break;
250 default:
251 break;
252 }
253 }
254
255 if (filepath[0] == 0)
256 {
257 usage(argv[0]);
258 return 0;
259 }
260
261 if (1)
262 {
263 acl_pthread_t tid;
264 acl_pthread_attr_t attr;
265
266 acl_pthread_attr_init(&attr);
267 acl_pthread_create(&tid, &attr, test_thread, NULL);
268 acl_pthread_join(tid, NULL);
269 }
270 printf("last error: %s\r\n", acl_last_serror());
271 if (strcasecmp(action, "parse") == 0)
272 return header_parse(filepath, max);
273 else if (strcasecmp(action, "read") == 0)
274 return header_read(filepath, max);
275 else if (strcasecmp(action, "http") == 0)

Callers

nothing calls this directly

Calls 10

acl_mem_slice_initFunction · 0.85
acl_pthread_attr_initFunction · 0.85
acl_pthread_createFunction · 0.85
acl_pthread_joinFunction · 0.85
acl_last_serrorFunction · 0.85
header_parseFunction · 0.85
header_readFunction · 0.85
header_httpFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…