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

Name

<chl/chl.h>

chl_get_args, CHL get arguments

Declaration

char chl_get_args(char *(** arguments), char * args);

Description

The chl_get_args function is used to get the arguments [arguments] associated with the calling CHL function.

Arguments

  • arguments: the address of a ** char variable. This is where the arguments will be put. Dynamically allocated.
  • args: the char * args variable passed to the calling CHL function.

Return value

On success: the number of arguments found, 0 if no arguments could be found.


Examples

main.c

#include <chl/chl.h>
#include <stdio.h>

void print(char * args) {
    char ** arguments;
    chl_get_args(&arguments, args);

    fputs(arguments[0], stdout);
    fputs(arguments[1], 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