File: env.h

package info (click to toggle)
charliecloud 0.43-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,116 kB
  • sloc: python: 6,021; sh: 4,284; ansic: 3,863; makefile: 598
file content (43 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Copyright © Triad National Security, LLC, and others.

   Environment variable handling. */

#define _GNU_SOURCE
#pragma once

#include "core.h"
#include "misc.h"


/** Types **/

struct env_file {
   char *path;
   char delim;
   bool expand;
};

struct env_var {
   char *name;
   char *value;
};

/** Disallowed functions **/


/** Function prototypes **/

char *cenv_get(struct container *c, const char *name);
void cenv_set(struct container *c, const char *name, const char *value);
void cenv_unset(struct container *c, const char *name);
void cenvs_set(struct container *c, const struct env_var *envs);
void cenvs_unset(struct container *c, const char *glob);
struct env_var *env_file_read(const char *path, int delim);
char *environ_serialize(char **env, size_t *byte_ct);
char **environ_unserialize(char *buf, size_t byte_ct);
struct env_var env_parse(const char *line, const char *path, size_t lineno);
void envs_hook_set_file(struct container *c, void *d);
void envs_hook_set(struct container *c, void *d);
void envs_hook_unset(struct container *c, void *d);
char *getenv_df(const char *name, char *df);
bool getenv_first(char **names, char **name, char **value);