MiniDevil
As beautiful as a shell
Export utilities. More...
Include dependency graph for export_utils.c:Export utilities.
Definition in file export_utils.c.
Functions | |
| static int | count_env (t_env *env) |
| Count the number of nodes in an env list. More... | |
| static t_env ** | env_to_node_array (t_env *env, int count) |
| Convert env linked list to an array of node pointers. More... | |
| static void | sort_env_array (t_env **arr, int count) |
| Sort an array of env node pointers by key in alphabetical order. More... | |
| static void | print_one_export (t_env *var) |
| Print a single env var in "declare -x" format. More... | |
| void | print_sorted_export (t_env *env) |
| Print all env vars sorted in alphabetical order, in declare -x format. More... | |
|
static |
Count the number of nodes in an env list.
| env | Head of the env list |
Definition at line 22 of file export_utils.c.
References t_env::next.
Referenced by print_sorted_export().
Here is the caller graph for this function:Convert env linked list to an array of node pointers.
Doesn't copy the nodes themselves
| env | Head of the env list |
| count | Number of nodes |
Definition at line 44 of file export_utils.c.
References t_env::next.
Referenced by print_sorted_export().
Here is the caller graph for this function:
|
static |
Sort an array of env node pointers by key in alphabetical order.
Uses a bubble sort on the pointer array (doesn't modify the list)
| arr | Array of env node pointers |
| count | Number of elements |
Definition at line 71 of file export_utils.c.
Referenced by print_sorted_export().
Here is the caller graph for this function:
|
static |
Print a single env var in "declare -x" format.
| var | Env node to print |
Definition at line 100 of file export_utils.c.
References t_env::key, and t_env::value.
Referenced by print_sorted_export().
Here is the caller graph for this function:| void print_sorted_export | ( | t_env * | env | ) |
Print all env vars sorted in alphabetical order, in declare -x format.
Used by export with no arguments
| env | Head of the env list |
Definition at line 120 of file export_utils.c.
References count_env(), env_to_node_array(), print_one_export(), and sort_env_array().
Referenced by builtin_export().
Here is the call graph for this function:
Here is the caller graph for this function: