-
Notifications
You must be signed in to change notification settings - Fork 10
chl_next_arg
it4e edited this page Mar 21, 2016
·
3 revisions
<chl/chl.h>
chl_next_arg, CHL next argument
char * chl_next_arg(char * args);
The chl_next_arg function is used to get the next argument associated with the calling CHL function.
- args: on first call, the char * args variable passed to the calling CHL function. Then on further calls, NULL.
A char pointer to the next argument, or 0 if function has reached last argument.
main.c
#include <chl/chl.h>
#include <stdio.h>
void print(char * args) {
char * arg;
if((arg = chl_next_arg(args)))
fputs(arg, stdout);
while((arg = chl_next_arg(NULL))
fputs(arg, stdout);
}
int main() {
chl_func_append("print", print);
chl_func("print", "'Hello', 'world'");
}
Output: Helloworld