LexLeo
0.0.0-dev+f8e5087-dirty
Technical documentation
Loading...
Searching...
No Matches
cli_log_path_linux.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-3.0-or-later
2
* Copyright (C) 2026 Sylvain Labopin
3
*/
4
5
#include "
internal/cli_log_path.h
"
6
7
#include "
osal/stdio/osal_stdio.h
"
8
9
#include "
policy/lexleo_cstd_lib.h
"
10
11
bool
cli_resolve_default_log_path
(
char
*buf,
size_t
buf_size)
12
{
13
if
(!buf || buf_size == 0)
14
return
false
;
15
16
const
char
*home = getenv(
"HOME"
);
17
if
(!home || !*home)
18
return
false
;
19
20
int
ret =
21
osal_snprintf
(
22
buf,
23
buf_size,
24
"%s/.local/state/lexleo/lexleo.log"
,
25
home
26
);
27
28
if
(ret < 0 || (
size_t
)ret >= buf_size)
29
return
false
;
30
31
return
true
;
32
}
cli_log_path.h
cli_resolve_default_log_path
bool cli_resolve_default_log_path(char *buf, size_t buf_size)
Definition
cli_log_path_linux.c:11
lexleo_cstd_lib.h
osal_stdio.h
osal_snprintf
int osal_snprintf(char *str, size_t size, const char *fmt,...)
Definition
osal_stdio.c:95
src
cli
src
platform
cli_log_path_linux.c
Generated by
1.9.8