]>
git.proxmox.com Git - wasi-libc.git/blob - libc-bottom-half/headers/public/wasi/libc-environ.h
1 #ifndef __wasi_libc_environ_h
2 #define __wasi_libc_environ_h
4 /// This header file is a WASI-libc-specific interface, and is not needed by
5 /// most programs. Most programs should just use the standard `getenv` and
6 /// related APIs, which take care of all of the details automatically.
12 /// Initialize the global environment variable state. Only needs to be
13 /// called once; most users should call `__wasilibc_ensure_environ` instead.
14 void __wasilibc_initialize_environ(void);
16 /// If `__wasilibc_initialize_environ` has not yet been called, call it.
17 void __wasilibc_ensure_environ(void);
19 /// De-initialize the global environment variable state, so that subsequent
20 /// calls to `__wasilibc_ensure_environ` call `__wasilibc_initialize_environ`.
21 void __wasilibc_deinitialize_environ(void);
23 /// Call `__wasilibc_initialize_environ` only if `environ` and `_environ` are
24 /// referenced in the program.
25 void __wasilibc_maybe_reinitialize_environ_eagerly(void);
27 /// Return the value of the `environ` variable. Using `environ` directly
28 /// requires eager initialization of the environment variables. Using this
29 /// function instead of `environ` allows initialization to happen lazily.
30 char **__wasilibc_get_environ(void);