Commit b8d1083f authored by Seblu's avatar Seblu
Browse files

general improvment

parent cd0809ca
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -22,8 +22,12 @@ bin_PROGRAMS=42sh
		src/builtin/builtin_alias.c		\
		src/builtin/builtin_cd.c		\
		src/builtin/builtin_echo.c		\
		src/builtin/builtin_exec.c		\
		src/builtin/builtin_exit.c		\
		src/builtin/builtin_export.c		\
		src/builtin/builtin_unalias.c		\
		src/builtin/builtin_unset.c		\
		src/builtin/builtin_set.c		\
		src/builtin/builtin_shopt.c		\
		src/common/basename.c			\
		src/common/constant.h			\
@@ -39,14 +43,18 @@ bin_PROGRAMS=42sh
		src/exec/exec.h				\
		src/exec/exec_and.c			\
		src/exec/exec_bang.c			\
		src/exec/exec_case.c			\
		src/exec/exec_cmd.c			\
		src/exec/exec_for.c			\
		src/exec/exec_funcdec.c			\
		src/exec/exec_node.c			\
		src/exec/exec_or.c			\
		src/exec/exec_if.c			\
		src/exec/exec_pipe.c			\
		src/exec/exec_red.c			\
		src/exec/exec_sep.c			\
		src/exec/exec_sepand.c			\
		src/exec/exec_subshell.c		\
		src/exec/exec_while.c			\
		src/parser/getline.c			\
		src/parser/getline.h			\
+1 −3
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ AC_FUNC_CLOSEDIR_VOID
AC_FUNC_REALLOC
AC_FUNC_FORK
AC_FUNC_STAT
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([malloc.h])
@@ -69,13 +68,13 @@ AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([atexit])
AC_CHECK_FUNCS([putenv])
AC_CHECK_FUNCS([strtoul])
AC_CHECK_FUNCS([strerror])

AC_TYPE_PID_T
AC_TYPE_SIZE_T

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

AC_HEADER_STDBOOL
AC_STRUCT_TM

@@ -120,7 +119,6 @@ AC_ARG_WITH([efence],
  ]
)


AC_SUBST([CFLAGS])
AC_SUBST([LDFLAGS])

+4 −4
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
** Login   <seblu@epita.fr>
**
** Started on  Sun Jul 30 04:40:03 2006 Seblu
** Last update Thu Nov 16 17:01:11 2006 seblu
** Last update Fri Nov 17 14:17:02 2006 seblu
*/

#ifndef AST_H_
@@ -104,9 +104,9 @@ typedef struct cmd_node

/*
** Binary ast node
** Generic node, it's a contener !
** T_PIPE, T_SEP* , T_AND, T_OR : binary operator
** T_BANG : unary operator
** Generic node, it's a contener for:
** T_PIPE, T_SEP, T_SEPAND , T_AND, T_OR : binary operator
** T_BANG, T_SUBSHELL : unary operator
*/
typedef struct		bin_node
{
+7 −5
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@
** Login   <seblu@epita.fr>
**
** Started on  Tue Apr 11 00:22:44 2006 Seblu
** Last update Thu Nov 16 18:59:29 2006 seblu
** Last update Fri Nov 17 13:12:22 2006 seblu
*/

#include <string.h>
#include <assert.h>
#include "builtin.h"

enum { BUILTIN_COUNT = 10 };
enum { BUILTIN_COUNT = 12 };

struct		builtin_table
{
@@ -29,9 +29,11 @@ static struct builtin_table builtin_table[BUILTIN_COUNT] =
    {"alias", builtin_alias},
    {"unalias", builtin_unalias},
    {"source", NULL}, //builtin_source},
    {"set", NULL}, //builtin_set},
    {"unset", NULL}, //builtin_unset},
    {"export", NULL}, //builtin_export}
    {".", NULL}, //builtin_source},
    {"set", builtin_set},
    {"unset", builtin_unset},
    {"export", builtin_export},
    {"exec", builtin_exec}
  };

int		is_a_builtin(const char *name)
+22 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
** Login   <seblu@epita.fr>
**
** Started on  Sun Nov 12 16:46:24 2006 Seblu
** Last update Thu Nov 16 17:49:13 2006 seblu
** Last update Fri Nov 17 13:01:45 2006 seblu
*/

#ifndef BUILTIN_H_
@@ -67,12 +67,31 @@ int builtin_shopt(char *argv[]);
*/
int		builtin_exit(char *argv[]);

/*!
** Set or show aliases.
**
** @param argv argument vector
**
** @return 0 on succes, or 1 if no alias found
*/
int		builtin_alias(char *argv[]);

/*!
** Unset one or more aliases
**
** @param argv argument vector
**
** @return 0 on success, or 1 if no alias found
*/
int		builtin_unalias(char *argv[]);


int		builtin_source(char *argv[]);
int		builtin_set(char *argv[]);
int		builtin_unset(char *argv[]);
int		builtin_exec(char *argv[]);
int		builtin_export(char *argv[]);

int		builtin_alias(char *argv[]);
int		builtin_unalias(char *argv[]);


/*
Loading