Skip to content
it4e edited this page Mar 21, 2016 · 3 revisions

Name

<chl/chl.h>

chl_next_arg, CHL next argument

Declaration

char * chl_next_arg(char * args);

Description

The chl_next_arg function is used to get the next argument associated with the calling CHL function.

Arguments

  • args: on first call, the char * args variable passed to the calling CHL function. Then on further calls, NULL.

Return value

A char pointer to the next argument, or 0 if function has reached last argument.


Examples

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

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally