2022-10-26 14:02:14 +08:00
|
|
|
/* SPDX-License-Identifier: MIT-0 */
|
2021-10-01 18:44:33 +08:00
|
|
|
|
2020-03-24 03:36:41 +08:00
|
|
|
#include <stdio.h>
|
2021-08-30 22:16:30 +08:00
|
|
|
#include <stdlib.h>
|
2024-04-03 03:22:36 +08:00
|
|
|
#include <systemd/sd-path.h>
|
2020-03-24 03:36:41 +08:00
|
|
|
|
|
|
|
int main(void) {
|
2021-08-30 22:16:30 +08:00
|
|
|
int r;
|
2020-03-24 03:36:41 +08:00
|
|
|
char *t;
|
|
|
|
|
2021-08-30 22:16:30 +08:00
|
|
|
r = sd_path_lookup(SD_PATH_USER_DOCUMENTS, NULL, &t);
|
|
|
|
if (r < 0)
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
2020-03-24 03:36:41 +08:00
|
|
|
printf("~/Documents: %s\n", t);
|
2021-08-30 22:16:30 +08:00
|
|
|
free(t);
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
2020-03-24 03:36:41 +08:00
|
|
|
}
|