man/path-documents.c
raw| 1 | /* SPDX-License-Identifier: MIT-0 */ |
| 2 | |
| 3 | #include <stdio.h> |
| 4 | #include <stdlib.h> |
| 5 | #include <systemd/sd-path.h> |
| 6 | |
| 7 | int main(void) { |
| 8 | int r; |
| 9 | char *t; |
| 10 | |
| 11 | r = sd_path_lookup(SD_PATH_USER_DOCUMENTS, NULL, &t); |
| 12 | if (r < 0) |
| 13 | return EXIT_FAILURE; |
| 14 | |
| 15 | printf("~/Documents: %s\n", t); |
| 16 | free(t); |
| 17 | |
| 18 | return EXIT_SUCCESS; |
| 19 | } |