30 if (!node || !node->
key)
32 part = ft_strjoin(node->
key,
"=");
36 result = ft_strjoin(part, node->
value);
38 result = ft_strdup(part);
83 while (current && i < size)
91 current = current->
next;
114 arr = ft_calloc(1,
sizeof(
char *));
120 arr = ft_calloc(size + 1,
sizeof(
char *));
Environment variable management prototypes.
char ** env_to_array(t_env *env)
Convert the env linked list to a NULL terminated string array.
static void free_incomplete_array(char **arr, int count)
Free a partially filled array.
static char * create_env_string(t_env *node)
Convert an env node to a "KEY=value" string.
static int fill_env_array(char **arr, t_env *env, int size)
Fill an array with KEY=value strings.
int env_list_size(t_env *env_list)
Count the number of nodes in the environment list.
Environment variable (doubly linked list)
char * value
Value (NULL if export only)
struct s_env * next
Next node.