LexLeo 0.0.0-dev+f8e5087-dirty
Technical documentation
Loading...
Searching...
No Matches
cli.c
Go to the documentation of this file.
1// src/cli/src/cli.c
2
3// ----------------------------------------------------------------------------
4// ----------------------------- PLACEHOLDER FILE -----------------------------
5// ----------------------------------------------------------------------------
6
7/* Resolved log_path and write it in standard output stream */
8
10
11#include "cli.h"
12
13#define CLI_LOG_PATH_BUFFER_SIZE 1024
14
16
17#include "osal/mem/osal_mem.h"
18
19int cli_run() {
20
21 const osal_stdio_ops_t *stdio_ops = osal_stdio_default_ops();
22 OSAL_STDIO *out = stdio_ops->stdout();
23
24 char buf[CLI_LOG_PATH_BUFFER_SIZE] = { 0 };
26 if (ok) {
27 (void)stdio_ops->write("log_path resolved with: ", 1, 24, out);
28 (void)stdio_ops->write(buf, 1, osal_strlen(buf), out);
29 (void)stdio_ops->write("\n", 1, 1, out);
30 (void)stdio_ops->flush(out);
31 }
32
33 return 0;
34}
35//<here> upgrade cli_resolve_default_log_path() so that it first tries to
36// read an explicit log_path from the application configuration, and falls
37// back to the platform-default path only when no valid configured path is
38// provided
39// so do osal_file before
int cli_run()
Definition cli.c:19
#define CLI_LOG_PATH_BUFFER_SIZE
Definition cli.c:13
bool cli_resolve_default_log_path(char *buf, size_t buf_size)
size_t osal_strlen(const char *s)
Definition osal_mem.c:35
const osal_stdio_ops_t * osal_stdio_default_ops(void)
Definition osal_stdio.c:79
size_t(* write)(const void *ptr, size_t size, size_t nmemb, OSAL_STDIO *stdio)
OSAL_STDIO *(* stdout)(void)
int(* flush)(OSAL_STDIO *stdio)