Commit f8bcc9ae authored by Seblu's avatar Seblu
Browse files

now compile

parent 3cf69bc0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ DISTCLEANFILES=42sh$(EXEEXT)
.PHONY: tar doc re

42sh$(EXEEXT): src/42sh$(EXEEXT)
	cp -f src/42sh$(EXEEXT) .

tar: distcheck

+1 −19
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ case $host_os in
	AC_SUBST([CFLAGS], ['-Wall -Werror -W -ansi -pedantic -D_XOPEN_SOURCE=600'])
	;;
  *linux*)
	AC_SUBST([CFLAGS], ['-Wall -Werror -W -ansi -pedantic -D_XOPEN_SOURCE=600'])
	AC_SUBST([CFLAGS], ['-Wall -Werror -W -std=c99 -pedantic -D_XOPEN_SOURCE=600'])
	;;
  *)
	pl="`uname -s`"
@@ -66,7 +66,6 @@ AC_CHECK_FUNCS([getcwd])
AC_CHECK_FUNCS([setenv])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([get_current_dir_name])
AC_CHECK_FUNCS([atexit])
AC_CHECK_FUNCS([putenv])
AC_CHECK_FUNCS([strtoul])
@@ -106,15 +105,6 @@ AC_ARG_WITH([debug],
  ]
)

AC_ARG_WITH([leaktrack],
  [AS_HELP_STRING([--with-leaktrack], [add a builtin leak track for debug])],
  [
    if test x$withval = xyes; then
      CFLAGS="$CFLAGS -DLEAK_TRACK"
    fi
  ],
)

AC_SUBST([CFLAGS])

# define Autoconf config header
@@ -123,15 +113,7 @@ AC_CONFIG_HEADERS([config.h])
# define Autoconf config files
AC_CONFIG_FILES([
	Makefile
	doc/Makefile
	check/Makefile
	check/leaktrack/Makefile
	src/Makefile
	src/parser/Makefile
	src/evalexpr/Makefile
])

AC_CONFIG_FILES([check/checker_wrapper.sh],
                [chmod a=rx check/checker_wrapper.sh])

AC_OUTPUT
+1 −1
Original line number Diff line number Diff line
SUBDIRS=ast builtin lexer parser
#SUBDIRS=
bin_PROGRAMS=42sh

#42sh_LDADD  = parser/libparse.a ../check/leaktrack/libmem.a evalexpr/libevalexpr.a
+8 −8
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
** Login   <seblu@epita.fr>
**
** Started on  Sun Jul 16 20:03:53 2006 Seblu
** Last update Sun Jul 16 20:12:27 2006 Seblu
** Last update Sun Jul 16 20:18:23 2006 Seblu
*/

#ifndef SHELL_H_
@@ -28,16 +28,16 @@

struct			s_shell
{
  struct s_ast		*ast;
  struct s_var		*vars;
  struct s_func		*funcs;
  struct s_opt		*opt;
  struct s_history	*history;
/*   struct s_ast		*ast; */
/*   struct s_var		*vars; */
/*   struct s_func		*funcs; */
/*   struct s_opt		*opt; */
/*   struct s_history	*history; */
  int			last_status;
};

struct s_shell		*sh_init(void);
void			sh_destroy(struct s_shell *sh);
struct s_shell		*shell_init(void);
void			shell_destroy(struct s_shell *sh);
char			*strmerges(int n, const char *s1, ...);

#endif /* !SHELL_H_ */
+8 −18
Original line number Diff line number Diff line
@@ -5,35 +5,25 @@
** Login   <seblu@epita.fr>
**
** Started on  Fri Apr  7 00:19:04 2006 Seblu
** Last update Sun May 21 15:29:07 2006 Seblu
** Last update Sun Jul 16 20:30:02 2006 Seblu
*/

#include <stdlib.h>
#include "42sh.h"
#include "../var/var.h"
#include "../func/function.h"
#include "../history/history.h"
#include "../opt/opt.h"
#include <assert.h>
#include "shell.h"

#include "mem.h"

/*!
** Destroy 42SH structure.
**
** @param sh structure to destroy
** @note the sh = sh is needed if compile with -DNDEBUG since the assert will
** be suppressed.
**
*/
void			sh_destroy(struct s_42sh *sh)
void			shell_destroy(struct s_shell *sh)
{
  assert(sh);
  if (opt_isset("readline", sh->opt) && sh->history)
  {
    history_save(sh);
    history_delete(&sh->history);
  }
  var_delete(&sh->vars);
  func_clean(&sh->funcs);
  free(sh->opt);
/*   var_delete(&sh->vars); */
/*   func_clean(&sh->funcs); */
/*   free(sh->opt); */
  free(sh);
}
Loading