-
Notifications
You must be signed in to change notification settings - Fork 10
chl_func
it4e edited this page Dec 12, 2016
·
5 revisions
<chl/chl.h>
chl_func, CHL function
char chl_func(char * name, char * args);
The chl_func function is used to call a CHL function with the alias [name] and with the arguments [args].
- name: the alias for the function that will be called.
- args: the arguments that will be passed to the function [name].
1 if function is found, 0 if function is not found.
main.c
#include <chl/chl.h>
#include <stdio.h>
void print(char * args) {
char * arg = chl_next_arg(args);
fputs(arg, stdout);
}
int main() {
chl_func_append("print", print);
chl_func("print", "'Hello'");
}
Output: Hello