diff options
-rw-r--r-- | src/lutris.c | 27 | ||||
-rw-r--r-- | src/lutris.h | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/lutris.c b/src/lutris.c index cc6d8c4..df5feef 100644 --- a/src/lutris.c +++ b/src/lutris.c @@ -11,10 +11,37 @@ static const struct Command lutris_commands[] = { #ifdef DEBUG { .name = "install", .func = lutris_install, .description = "install a lutris script" }, + { .name = "debug", .func = lutris_debug, .description = "" }, #endif { .name = "info", .func = lutris_info, .description = "show information about a lutris script" }, }; +void func() +{ + printf("I got called because $func was found\n"); +} + +COMMAND(lutris, debug) +{ + struct list_t variables[] = { + { .key = "string", .type = value_string, .value.str = "output" }, + { .key = "func", .type = value_function, .value.func = func }, + }; + + char* str = malloc(255); + + strcpy(str, "$string and $func $fun"); + + printf("Input: %s\n", str); + parseVar(&str, variables, ARRAY_LEN(variables)); + printf("Output: %s\n", str); + + + free(str); + + return 0; +} + COMMAND_GROUP_FUNC(lutris) COMMAND(lutris, install) diff --git a/src/lutris.h b/src/lutris.h index bc815c1..643c8ff 100644 --- a/src/lutris.h +++ b/src/lutris.h @@ -139,6 +139,8 @@ struct script_t { #include "command.h" +COMMAND(lutris, debug); + COMMAND_GROUP(lutris); COMMAND(lutris, install); COMMAND(lutris, info); |