stuff
This commit is contained in:
parent
a5ae25cd9d
commit
ba772aeb91
11 changed files with 56 additions and 14 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
# By: jhalford <jack@crans.org> +#+ +:+ +#+ #
|
# By: jhalford <jack@crans.org> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2017/02/07 16:09:36 by jhalford #+# #+# #
|
# Created: 2017/02/07 16:09:36 by jhalford #+# #+# #
|
||||||
# Updated: 2017/03/08 01:11:01 by ariard ### ########.fr #
|
# Updated: 2017/03/26 15:35:32 by jhalford ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
|
@ -84,6 +84,7 @@ lst/ft_lst_cfree.c\
|
||||||
lst/ft_lst_delif.c\
|
lst/ft_lst_delif.c\
|
||||||
lst/ft_lst_delsub.c\
|
lst/ft_lst_delsub.c\
|
||||||
lst/ft_lst_filter.c\
|
lst/ft_lst_filter.c\
|
||||||
|
lst/ft_lst_filterout.c\
|
||||||
lst/ft_lst_find.c\
|
lst/ft_lst_find.c\
|
||||||
lst/ft_lst_merge.c\
|
lst/ft_lst_merge.c\
|
||||||
lst/ft_lst_order_delsub.c\
|
lst/ft_lst_order_delsub.c\
|
||||||
|
|
@ -207,7 +208,7 @@ all:
|
||||||
$(NAME): $(OBJ_DIR) $(OBJS)
|
$(NAME): $(OBJ_DIR) $(OBJS)
|
||||||
@$(AR) $(NAME) $(OBJS)
|
@$(AR) $(NAME) $(OBJS)
|
||||||
@ranlib $(NAME)
|
@ranlib $(NAME)
|
||||||
@strip -x $(NAME)
|
@#strip -x $(NAME)
|
||||||
@printf "\r\033[48;5;15;38;5;25m✅ MAKE $(NAME)\033[0m\033[K\n"
|
@printf "\r\033[48;5;15;38;5;25m✅ MAKE $(NAME)\033[0m\033[K\n"
|
||||||
|
|
||||||
$(OBJ_DIR)%.o: $(SRC_DIR)%.c | $(OBJ_DIR)
|
$(OBJ_DIR)%.o: $(SRC_DIR)%.c | $(OBJ_DIR)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/14 15:34:21 by jhalford #+# #+# */
|
/* Created: 2017/03/14 15:34:21 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/16 14:19:49 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 15:35:02 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -29,7 +29,6 @@ enum e_errors
|
||||||
E_NOERR,
|
E_NOERR,
|
||||||
E_CO_INV,
|
E_CO_INV,
|
||||||
E_CO_INVL,
|
E_CO_INVL,
|
||||||
E_CO_MULT,
|
|
||||||
E_CO_MISS,
|
E_CO_MISS,
|
||||||
E_CO_MISSL,
|
E_CO_MISSL,
|
||||||
E_MAX,
|
E_MAX,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */
|
/* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/15 20:51:55 by ariard ### ########.fr */
|
/* Updated: 2017/03/26 17:07:15 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -39,6 +39,8 @@
|
||||||
typedef struct s_stos t_stos;
|
typedef struct s_stos t_stos;
|
||||||
typedef struct s_stof t_stof;
|
typedef struct s_stof t_stof;
|
||||||
typedef struct s_itof t_itof;
|
typedef struct s_itof t_itof;
|
||||||
|
typedef long long t_type;
|
||||||
|
typedef long long t_flag;
|
||||||
|
|
||||||
struct s_stos
|
struct s_stos
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/11/07 13:27:46 by jhalford #+# #+# */
|
/* Created: 2016/11/07 13:27:46 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/11 16:18:00 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 17:08:28 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -75,6 +75,11 @@ t_list *ft_lst_find(
|
||||||
t_list *ft_lstpop(t_list **lst);
|
t_list *ft_lstpop(t_list **lst);
|
||||||
void ft_lst_merge(t_list **begin_list1, t_list *begin_list2);
|
void ft_lst_merge(t_list **begin_list1, t_list *begin_list2);
|
||||||
void ft_lst_reverse(t_list **begin_list);
|
void ft_lst_reverse(t_list **begin_list);
|
||||||
|
void ft_lst_filterout(
|
||||||
|
t_list **alst,
|
||||||
|
void *data_ref,
|
||||||
|
int (*cmp)(),
|
||||||
|
void (*del)(void *, size_t));
|
||||||
|
|
||||||
int ft_diff(void *a, void *b);
|
int ft_diff(void *a, void *b);
|
||||||
t_list *ft_id(t_list *a);
|
t_list *ft_id(t_list *a);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/14 20:04:04 by jhalford #+# #+# */
|
/* Created: 2017/03/14 20:04:04 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/26 15:27:26 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 16:37:04 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ static int cliopts_parse_long(
|
||||||
if (map->get)
|
if (map->get)
|
||||||
{
|
{
|
||||||
if (map->arg_required && !(tmp = check_required(av, NULL)))
|
if (map->arg_required && !(tmp = check_required(av, NULL)))
|
||||||
return (ERR_SET(E_CO_MISS, *arg));
|
return (ERR_SET(E_CO_MISSL, arg));
|
||||||
if ((map->get)(tmp, data))
|
if ((map->get)(tmp, data))
|
||||||
return (ERR_SET(E_CO_MISSL, arg));
|
return (ERR_SET(E_CO_MISSL, arg));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/14 16:47:00 by jhalford #+# #+# */
|
/* Created: 2017/03/14 16:47:00 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/15 20:45:41 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 16:36:54 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -17,7 +17,6 @@ char g_error_msglist[E_MAX][ERRMSG_MAX_SIZE] =
|
||||||
"no error",
|
"no error",
|
||||||
"invalid option -%c",
|
"invalid option -%c",
|
||||||
"invalid option --%s",
|
"invalid option --%s",
|
||||||
"option '%c' awaits argument(s): please don't combine",
|
|
||||||
"option '%c': missing argument",
|
"option '%c': missing argument",
|
||||||
"option '%s': missing argument",
|
"option '%s': missing argument",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/11/04 11:09:15 by jhalford #+# #+# */
|
/* Created: 2016/11/04 11:09:15 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/01/12 14:33:28 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 16:55:52 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/11/04 11:09:17 by jhalford #+# #+# */
|
/* Created: 2016/11/04 11:09:17 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/02 17:47:26 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 17:11:27 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
36
libftasm/src/lst/ft_lst_filterout.c
Normal file
36
libftasm/src/lst/ft_lst_filterout.c
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_lst_filterout.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2017/03/26 16:56:02 by jhalford #+# #+# */
|
||||||
|
/* Updated: 2017/03/26 19:10:03 by jhalford ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "libft.h"
|
||||||
|
|
||||||
|
void ft_lst_filterout(
|
||||||
|
t_list **alst,
|
||||||
|
void *data_ref,
|
||||||
|
int (*cmp)(),
|
||||||
|
void (*del)(void *, size_t))
|
||||||
|
{
|
||||||
|
t_list *tmp;
|
||||||
|
t_list **indirect;
|
||||||
|
|
||||||
|
indirect = alst;
|
||||||
|
while (*indirect)
|
||||||
|
{
|
||||||
|
if ((*cmp)((*indirect)->content, data_ref) == 0)
|
||||||
|
{
|
||||||
|
tmp = *indirect;
|
||||||
|
(*indirect) = (*indirect)->next;
|
||||||
|
ft_lstdelone(&tmp, del);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
indirect = &(*indirect)->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/11/04 11:09:25 by jhalford #+# #+# */
|
/* Created: 2016/11/04 11:09:25 by jhalford #+# #+# */
|
||||||
/* Updated: 2016/11/04 12:01:47 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 16:55:33 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/11/04 11:09:30 by jhalford #+# #+# */
|
/* Created: 2016/11/04 11:09:30 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/13 15:31:13 by jhalford ### ########.fr */
|
/* Updated: 2017/03/26 17:13:28 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue