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:
Khaïs COLIN 2025-02-19 16:39:18 +01:00
parent e445f668b3
commit dff68d5a8b
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
5 changed files with 21 additions and 17 deletions

View file

@ -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"
/*

View file

@ -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
View file

@ -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
View file

@ -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