fix: export builtin and other things *

fix: parse_command: syntaxes like: "hello"'hello'hello
fix: export builtin: "NAME=VALUE" syntax
fix: variables can contain digits
add: variables_nameisvalid()
change: dev/valgrind.sh
This commit is contained in:
mcolonna 2024-07-03 12:10:35 +02:00
parent b0aa3da8ce
commit 6862a1913b
8 changed files with 102 additions and 44 deletions

View file

@ -6,13 +6,16 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/27 13:43:21 by mcolonna #+# #+# */
/* Updated: 2024/06/28 14:22:50 by mcolonna ### ########.fr */
/* Updated: 2024/07/03 11:34:12 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef VARIABLES_H
# define VARIABLES_H
# define SYMBOL_CHARS \
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789"
typedef struct s_variable
{
const char *name;
@ -36,4 +39,7 @@ void variables_unset(t_list *variables, const char *name);
// Get a envp of all exported variables.
char *const *variables_envp(t_list *variables, t_memclass mc);
// Return true if 'name' is a valid variable name.
bool variables_nameisvalid(const char *name);
#endif