libXDGdirs v1.1.2-8-gc53e5c3
An implementation of XDG Base Directory Specification
Loading...
Searching...
No Matches
xdgdirs.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT
2 * Copyright 2020-2024 Jorengarenar
3 */
4
5#ifndef XDGDIRS_H_
6#define XDGDIRS_H_
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <stddef.h>
13
19#define XDGDIRS_VER "1.1.3"
20
22#define XDGBDS_VER "0.8"
23
26 const char* raw;
27 const char** list;
28 size_t size;
29};
30
31typedef const struct xdgDirsList_t xdgDirsList;
32
35
45int xdgDirs_init(void);
46
53void xdgDirs_clear(void);
54
59void xdgDirs_refresh(void);
60
62
65
69
75const char* xdgDataHome(void);
76
82const char* xdgStateHome(void);
83
89const char* xdgConfigHome(void);
90
96const char* xdgCacheHome(void);
97
104const char* xdgRuntimeDir(void);
105
107
111
121
129
131
139const char* xdgCustomVar(const char* custom);
140
142
143#ifdef __cplusplus
144} // extern "C"
145#endif
146
147#endif // XDGDIRS_H_
void xdgDirs_refresh(void)
Read environment variables again.
void xdgDirs_clear(void)
Clear cached data.
int xdgDirs_init(void)
Explicitly read variables before first use.
xdgDirsList * xdgConfigDirs(void)
Value of $XDG_CONFIG_DIRS.
xdgDirsList * xdgDataDirs(void)
Value of $XDG_DATA_DIRS.
const char * xdgRuntimeDir(void)
Value of $XDG_RUNTIME_DIR.
const char * xdgCacheHome(void)
Value of $XDG_CACHE_HOME.
const char * xdgConfigHome(void)
Value of $XDG_CONFIG_HOME.
const char * xdgStateHome(void)
Value of $XDG_STATE_HOME.
const char * xdgDataHome(void)
Value of $XDG_DATA_HOME.
const char * xdgCustomVar(const char *custom)
User definied custom XDG variables.
Container for environment variables which are colon separated lists.
Definition xdgdirs.h:25
const char ** list
Null terminated array containing entries from environment variable.
Definition xdgdirs.h:27
size_t size
Number of entries in environment variable.
Definition xdgdirs.h:28
const char * raw
Raw value of environment variable.
Definition xdgdirs.h:26