MiniDevil
As beautiful as a shell
Export helpers. More...
Include dependency graph for export_ops.c:Export helpers.
Definition in file export_ops.c.
Functions | |
| void | export_no_value (t_env **env, char *key) |
| Export a variable with no value (export KEY) More... | |
| void | export_assign (t_env **env, char *arg) |
| Export a variable with a value (export KEY=value) More... | |
| static char * | get_append_value (t_env *env, char *key, char *append_str) |
| Build the new value for an append operation. More... | |
| void | export_append (t_env **env, char *arg) |
| Export a variable with append (export KEY+=value) More... | |
| void export_no_value | ( | t_env ** | env, |
| char * | key | ||
| ) |
Export a variable with no value (export KEY)
| env | Pointer to env list head |
| key | Variable name to export |
Definition at line 26 of file export_ops.c.
References add_env_node(), t_env::key, t_env::next, and t_env::value.
Referenced by export_one().
Here is the call graph for this function:
Here is the caller graph for this function:| void export_assign | ( | t_env ** | env, |
| char * | arg | ||
| ) |
Export a variable with a value (export KEY=value)
Split the argument at = to extract key and value then call set_env_value() to create or update the variable
| env | Pointer to env list head |
| arg | Full argument string containing = somewhere |
Definition at line 55 of file export_ops.c.
References set_env_value().
Referenced by export_one().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Build the new value for an append operation.
If the variable already exists, concatenates old value with append_str(), and if not then duplicates append_str as the new value
| env | Environment list for looking up existing value |
| key | Variable name |
| append_str | String to append |
Definition at line 82 of file export_ops.c.
References append_str(), and get_env_value().
Referenced by export_append().
Here is the call graph for this function:
Here is the caller graph for this function:| void export_append | ( | t_env ** | env, |
| char * | arg | ||
| ) |
Export a variable with append (export KEY+=value)
Splits at += and builds the appended value using get_append_value() then calls set_env_value() to update the variable
| env | Pointer to env list head |
| arg | Full arg string containing "+=" |
Definition at line 104 of file export_ops.c.
References get_append_value(), and set_env_value().
Referenced by export_one().
Here is the call graph for this function:
Here is the caller graph for this function: