LexLeo
0.0.0-dev+f8e5087-dirty
Technical documentation
Loading...
Searching...
No Matches
cli_log_path_win32.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
*base = getenv(
"LOCALAPPDATA"
);
17
if
(!base || !*base) {
18
base = getenv(
"APPDATA"
);
19
}
20
if
(!base || !*base)
21
return
false
;
22
23
int
ret =
24
osal_snprintf
(
25
buf,
26
buf_size,
27
"%s\\lexleo\\lexleo.log"
,
28
base
29
);
30
31
if
(ret < 0 || (
size_t
)ret >= buf_size)
32
return
false
;
33
34
return
true
;
35
}
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_win32.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_win32.c
Generated by
1.9.8