mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
env refactor: split imports over multiple files
This allows for potentially faster recompilation, by not triggering recompilation for all env files if env_manip changes
This commit is contained in:
parent
e445f668b3
commit
dff68d5a8b
5 changed files with 21 additions and 17 deletions
6
src/env/env_convert.c
vendored
6
src/env/env_convert.c
vendored
|
|
@ -6,11 +6,13 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 14:39:57 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 14:45:54 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/19 16:41:08 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "env_convert.h"
|
||||
#include "env.h"
|
||||
#include "env_manip.h"
|
||||
#include "envp.h"
|
||||
#include "libft.h"
|
||||
|
||||
/*
|
||||
|
|
|
|||
8
src/env/env_convert.h
vendored
8
src/env/env_convert.h
vendored
|
|
@ -6,16 +6,16 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 14:38:43 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 14:39:39 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/19 16:42:27 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef ENV_CONVERT_H
|
||||
# define ENV_CONVERT_H
|
||||
|
||||
# include "env_manip.h"
|
||||
struct s_env;
|
||||
|
||||
char **envp_from_env(t_env *env);
|
||||
t_env *env_from_envp(char **envp);
|
||||
char **envp_from_env(struct s_env *env);
|
||||
struct s_env *env_from_envp(char **envp);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
4
src/env/env_manip.c
vendored
4
src/env/env_manip.c
vendored
|
|
@ -6,10 +6,12 @@
|
|||
/* By: jguelen <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/12 18:29:12 by jguelen #+# #+# */
|
||||
/* Updated: 2025/02/19 14:41:06 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/19 16:41:38 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "env.h"
|
||||
#include "env_convert.h"
|
||||
#include "env_manip.h"
|
||||
#include "libft.h"
|
||||
#include "../ft_errno.h"
|
||||
|
|
|
|||
14
src/env/env_manip.h
vendored
14
src/env/env_manip.h
vendored
|
|
@ -6,20 +6,18 @@
|
|||
/* By: jguelen <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/14 13:46:39 by jguelen #+# #+# */
|
||||
/* Updated: 2025/02/19 14:43:49 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/19 16:39:16 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef ENV_MANIP_H
|
||||
# define ENV_MANIP_H
|
||||
|
||||
# include "envp.h"
|
||||
# include "env.h"
|
||||
# include "env_convert.h"
|
||||
struct s_env;
|
||||
|
||||
char *env_get_val(t_env *env, char *key);
|
||||
void env_rm_entry(t_env **env, char *key);
|
||||
t_env *env_set_entry(t_env **env, char *key, char *value);
|
||||
t_env *env_find_node_bykey(t_env *env, char *key);
|
||||
char *env_get_val(struct s_env *env, char *key);
|
||||
void env_rm_entry(struct s_env **env, char *key);
|
||||
struct s_env *env_set_entry(struct s_env **env, char *key, char *value);
|
||||
struct s_env *env_find_node_bykey(struct s_env *env, char *key);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue