minishell
Minishell Project for École 42
|
Functions for managing the environment linked list and its nodes. More...
#include "minishell.h"
Functions | |
t_environ_node * | add_back_environ_node (t_environ_list *environ, t_environ_node *node) |
Adds an node to the end of an environment variables linked list. | |
t_environ_node * | create_environ_node (char *var) |
Creates an node for an environment variable linked list. | |
t_environ_node * | get_node (t_environ_list *environ, char *key) |
Find an node by the key from an environment variables linked list. | |
Functions for managing the environment linked list and its nodes.
t_environ_node * add_back_environ_node | ( | t_environ_list * | environ, |
t_environ_node * | node | ||
) |
Adds an node to the end of an environment variables linked list.
Adds a given node to the end of an environment variable linked list. The linked list's size is incremented accordingly.
[in,out] | environ | A pointer to the environment variables linked list. |
[in] | node | A pointer to the node to be added. |
t_environ_node * create_environ_node | ( | char * | var | ) |
Creates an node for an environment variable linked list.
Creates and initializes an node using the provided parameter string. The string is typically in the format "KEY=VALUE", where KEY is the variable name and VALUE is its value ("duhh").
[in] | var | The string representing the environment variable in the "KEY=VALUE" format. |
t_environ_node * get_node | ( | t_environ_list * | environ, |
char * | key | ||
) |
Find an node by the key from an environment variables linked list.
Searches for an node with a specific key, given as parameter, in the environment variables linked list, given as parameter. Returns the matching node.
[in] | environ | A pointer to the environment linked list. |
[in] | key | The KEY ov the environment variable to search for. |