-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse.c
33 lines (30 loc) · 1.22 KB
/
parse.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parse.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alischyn <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/22 17:21:40 by alischyn #+# #+# */
/* Updated: 2017/03/23 17:38:36 by alischyn ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
const char *parse(t_fmt *fmt, const char *f, va_list ap)
{
const char *old;
BZERO(fmt, sizeof(t_fmt));
while (true)
{
old = f;
f = parse_flags(fmt, f);
f = parse_width(fmt, f, ap);
f = parse_precision(fmt, f, ap);
f = parse_mod(fmt, f);
if (old == f)
break ;
}
if (*f != '\0')
fmt->type = *(f++);
return (f);
}