math builtin

This commit is contained in:
Antoine Riard 2017-03-14 23:06:26 +01:00
commit de5f4b2a46
7 changed files with 15 additions and 11 deletions

View file

@ -3,9 +3,10 @@
/* ::: :::::::: */ /* ::: :::::::: */
/* builtin.h :+: :+: :+: */ /* builtin.h :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/13 17:21:56 by jhalford #+# #+# */ /* Created: 2017/03/14 22:59:57 by jhalford #+# #+# */
/* Updated: 2017/03/14 22:59:57 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/07 15:48:24 by jhalford #+# #+# */ /* Created: 2017/03/07 15:48:24 by jhalford #+# #+# */
/* Updated: 2017/03/13 23:35:37 by jhalford ### ########.fr */ /* Updated: 2017/03/14 22:34:53 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/07 14:53:31 by jhalford #+# #+# */ /* Created: 2017/03/07 14:53:31 by jhalford #+# #+# */
/* Updated: 2017/03/14 21:48:36 by jhalford ### ########.fr */ /* Updated: 2017/03/14 22:34:06 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */ /* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */
/* Updated: 2017/03/13 23:10:42 by jhalford ### ########.fr */ /* Updated: 2017/03/14 22:34:22 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/15 14:19:48 by gwojda #+# #+# */ /* Created: 2016/12/15 14:19:48 by gwojda #+# #+# */
/* Updated: 2017/03/14 21:34:46 by jhalford ### ########.fr */ /* Updated: 2017/03/14 22:19:43 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,7 +15,10 @@
int readline(int fd, int prompt, char **input) int readline(int fd, int prompt, char **input)
{ {
if (!SH_IS_INTERACTIVE(data_singleton()->opts)) if (!SH_IS_INTERACTIVE(data_singleton()->opts))
{
DG("GNL on fd=%i", fd);
return (get_next_line(fd, input) == 0); return (get_next_line(fd, input) == 0);
}
readline_init(prompt); readline_init(prompt);
*input = ft_read_stdin(); *input = ft_read_stdin();
if (STR) if (STR)

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */ /* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
/* Updated: 2017/03/14 22:51:29 by ariard ### ########.fr */ /* Updated: 2017/03/14 23:06:10 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,13 +6,13 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */ /* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */
/* Updated: 2017/03/14 21:50:11 by jhalford ### ########.fr */ /* Updated: 2017/03/14 22:21:28 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "minishell.h" #include "minishell.h"
static t_cliopts shell_opts[] = static t_cliopts g_opts[] =
{ {
{'c', NULL, SH_OPTS_LC, SH_OPTS_JOBC | SH_INTERACTIVE, NULL}, {'c', NULL, SH_OPTS_LC, SH_OPTS_JOBC | SH_INTERACTIVE, NULL},
{-1, "no-jobcontrol", 0, SH_OPTS_JOBC, NULL}, {-1, "no-jobcontrol", 0, SH_OPTS_JOBC, NULL},
@ -61,7 +61,7 @@ int shell_init(int ac, char **av)
} }
else else
DG("non interactive"); DG("non interactive");
if (cliopts_get(av, shell_opts, data)) if (cliopts_get(av, g_opts, data))
return (ft_perror()); return (ft_perror());
if (SH_IS_INTERACTIVE(data->opts)) if (SH_IS_INTERACTIVE(data->opts))
interactive_settings(); interactive_settings();