aboutsummaryrefslogtreecommitdiff
path: root/src/io/ft_printf/internals/extract.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-18 16:39:52 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-18 16:39:52 +0200
commitdd0c485ac4975b7dd6d2e230213be1da50d0a065 (patch)
tree5fbd967f8b95c72fbb696bb089c2cc349d28b61f /src/io/ft_printf/internals/extract.c
parent3c3f1115f6e9a9b914e2dcbd796501ca7ce85342 (diff)
downloadlibft-dd0c485ac4975b7dd6d2e230213be1da50d0a065.tar.gz
libft-dd0c485ac4975b7dd6d2e230213be1da50d0a065.tar.bz2
libft-dd0c485ac4975b7dd6d2e230213be1da50d0a065.zip
Removing unnecessary stuffmalloc
Diffstat (limited to 'src/io/ft_printf/internals/extract.c')
-rw-r--r--src/io/ft_printf/internals/extract.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/src/io/ft_printf/internals/extract.c b/src/io/ft_printf/internals/extract.c
deleted file mode 100644
index c56a777..0000000
--- a/src/io/ft_printf/internals/extract.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* extract.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/29 00:10:36 by cacharle #+# #+# */
-/* Updated: 2019/11/10 10:33:33 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-const char *extract_flags(t_pformat *pformat, const char *fmt)
-{
- if (*fmt == '\0')
- return (fmt);
- while (ft_strchr(FLAGS_STR, *fmt) != NULL)
- {
- if (*fmt == '0')
- pformat->flags |= FLAG_ZERO;
- if (*fmt == '-')
- pformat->flags |= FLAG_MINUS;
- if (*fmt == '+')
- pformat->flags |= FLAG_SIGNED;
- if (*fmt == ' ')
- pformat->flags |= FLAG_SPACE;
- if (*fmt == '#')
- pformat->flags |= FLAG_ALTERNATE;
- if (*fmt == '\'')
- ;
- fmt++;
- }
- if (pformat->flags & FLAG_SIGNED)
- pformat->flags &= ~FLAG_SPACE;
- return (fmt);
-}
-
-const char *extract_width(t_pformat *pformat, const char *fmt)
-{
- if (*fmt == '\0')
- return (fmt);
- if (*fmt == '*')
- {
- pformat->flags |= FLAG_WIDTH_WILDCARD;
- fmt++;
- }
- if (!ft_isdigit(*fmt))
- return (fmt);
- pformat->width = ft_atoi(fmt);
- while (*fmt && ft_isdigit(*fmt))
- fmt++;
- if (pformat->flags & FLAG_WIDTH_WILDCARD)
- pformat->flags |= FLAG_WIDTH_OVERWRITE;
- return (fmt);
-}
-
-const char *extract_precision(t_pformat *pformat, const char *fmt)
-{
- if (*fmt == '\0' || *fmt != '.')
- return (fmt);
- fmt++;
- if (*fmt == '*')
- {
- pformat->flags |= FLAG_PRECISION_WILDCARD;
- fmt++;
- }
- pformat->precision = ft_atoi(fmt);
- while (*fmt && ft_isdigit(*fmt))
- fmt++;
- return (fmt);
-}
-
-const char *extract_length_modifier(t_pformat *pformat, const char *fmt)
-{
- if (fmt[0] && fmt[0] == 'l')
- {
- if (fmt[1] && fmt[1] == 'l')
- {
- pformat->flags |= FLAG_LONG_LONG;
- return (fmt + 2);
- }
- pformat->flags |= FLAG_LONG;
- return (fmt + 1);
- }
- if (fmt[0] && fmt[0] == 'h')
- {
- if (fmt[1] && fmt[1] == 'h')
- {
- pformat->flags |= FLAG_SHORT_SHORT;
- return (fmt + 2);
- }
- pformat->flags |= FLAG_SHORT;
- return (fmt + 1);
- }
- return (fmt);
-}