diff options
Diffstat (limited to 'hicn-light/src/hicn/config/controlCache.c')
-rw-r--r-- | hicn-light/src/hicn/config/controlCache.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/hicn-light/src/hicn/config/controlCache.c b/hicn-light/src/hicn/config/controlCache.c index 1c830c956..b6010fcfd 100644 --- a/hicn-light/src/hicn/config/controlCache.c +++ b/hicn-light/src/hicn/config/controlCache.c @@ -33,9 +33,14 @@ static void _controlCache_Init(CommandParser *parser, CommandOps *ops); static CommandReturn _controlCache_Execute(CommandParser *parser, - CommandOps *ops, PARCList *args); + CommandOps *ops, + PARCList *args, + char *output, + size_t output_size); static CommandReturn _controlCache_HelpExecute(CommandParser *parser, - CommandOps *ops, PARCList *args); + CommandOps *ops, PARCList *args, + char *output, + size_t output_size); static const char *_commandCache = "cache"; static const char *_commandCacheHelp = "help cache"; @@ -54,17 +59,18 @@ CommandOps *controlCache_HelpCreate(ControlState *state) { static CommandReturn _controlCache_HelpExecute(CommandParser *parser, CommandOps *ops, - PARCList *args) { + PARCList *args, + char *output, + size_t output_size) { CommandOps *ops_cache_serve = controlCacheServe_HelpCreate(NULL); CommandOps *ops_cache_store = controlCacheStore_HelpCreate(NULL); CommandOps *ops_cache_clear = controlCacheClear_HelpCreate(NULL); - printf("Available commands:\n"); - printf(" %s\n", ops_cache_serve->command); - printf(" %s\n", ops_cache_store->command); - printf(" %s\n", ops_cache_clear->command); - printf("\n"); - + snprintf(output, output_size, "Available commands:\n" + " %s\n %s\n %s\n\n", + ops_cache_serve->command, + ops_cache_store->command, + ops_cache_clear->command); commandOps_Destroy(&ops_cache_serve); commandOps_Destroy(&ops_cache_store); commandOps_Destroy(&ops_cache_clear); @@ -83,8 +89,11 @@ static void _controlCache_Init(CommandParser *parser, CommandOps *ops) { } static CommandReturn _controlCache_Execute(CommandParser *parser, - CommandOps *ops, PARCList *args) { - return _controlCache_HelpExecute(parser, ops, args); + CommandOps *ops, + PARCList *args, + char *output, + size_t output_size) { + return _controlCache_HelpExecute(parser, ops, args, output, output_size); } // ====================================================================== |