summaryrefslogtreecommitdiffstats
path: root/src/s_struct.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/s_struct.h')
-rw-r--r--src/s_struct.h84
1 files changed, 48 insertions, 36 deletions
diff --git a/src/s_struct.h b/src/s_struct.h
index 15505d5..871b0f4 100644
--- a/src/s_struct.h
+++ b/src/s_struct.h
@@ -14,9 +14,25 @@
#define S_STRUCT_H
#include <stdint.h>
+#include <limits.h>
#include "d_define.h"
+typedef struct s_lvars
+{
+ char *name;
+ char *val;
+ struct s_lvars *next;
+} t_lvars;
+
+typedef struct s_lalias
+{
+ char *name;
+ char *val;
+ size_t id;
+ struct s_lalias *next;
+} t_lalias;
+
/*
** redir(int8_t) index
** -------------------
@@ -26,27 +42,20 @@
** 0: means no redirection
*/
-typedef struct s_lvars
-{
- char *name;
- char *val;
- struct s_lvars *next;
-} t_lvars;
-
-typedef struct s_com
+typedef struct s_com
{
- char *bin;
- char **argv;
- int8_t redir;
- int32_t rdrfd;
- char *rdrpath;
- char **env_fork;
-} t_com;
+ char **argv;
+ char **env_fork;
+ char *rdrpath;
+ char *bin;
+ int32_t rdrfd;
+ int8_t redir;
+} t_com;
-struct s_lpipes
+struct s_lpipes
{
- struct s_com *com;
- struct s_lpipes *next;
+ struct s_com *com;
+ struct s_lpipes *next;
};
/*
@@ -57,26 +66,29 @@ struct s_lpipes
** 2: ||
*/
-typedef struct s_line
+typedef struct s_line_block
{
- uint8_t nextif;
- struct s_com *com;
- struct s_lpipes *pipes;
- struct s_line *next;
-} t_line;
+ char *lblock;
+ uint8_t nextif;
+ struct s_line_block *next;
+} t_line_block;
-typedef struct s_msh
+typedef struct s_msh
{
- char **envp;
- char ps[4][1024];
- uint8_t ret;
- char *shname;
- char **bu_ref;
- char *cwd;
- char env_fork_tmp[128][1024];
- uint8_t (*bu_ptr[FT_BUILTINS_COUNT])(char **, struct s_msh*);
- struct s_line *curr;
- struct s_lvars *vars;
-} t_msh;
+ struct s_line_block *curr;
+ struct s_com *com;
+ struct s_lpipes *pipes;
+ struct s_lvars *vars;
+ struct s_lalias *alias;
+ char **envp;
+ char ps[4][1024];
+ char env_fork_tmp[128][4096];
+ char sqb_ref[FT_ID_SQB_COUNT][4];
+ char *shname;
+ char *cwd;
+ int32_t fd;
+ uint8_t (*bu_ptr[FT_BUILTINS_COUNT])(char **, struct s_msh*);
+ uint8_t ret;
+} t_msh;
#endif