aboutsummaryrefslogtreecommitdiff
path: root/ft_printf.c
blob: 27b4734c27595111ca4a64d67b453cb78fddcb76 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include "header.h"

int ft_printf(const char *format, ...)
{
    int print_len;
    /* va_list ap; */
	/* #<{(| va_list ap_start; |)}># */
	/* #<{(| int ap_index; |)}># */
	/* t_list	*format_list; */
	/* char	*str; */
    /*  */
	/* if ((format_list = parse(format)) == NULL) */
	/* 	return (-1); */
	/* #<{(| ap_index = 0; |)}># */
    /* va_start(ap, format); */
    /*  */
	/* #<{(| va_copy(ap_start, ap); |)}># */
    /* print_len = -1; */
    /* while (format[++print_len]) */
    /* { */
    /*     if (format[print_len] == '%') */
        /* { */
			/* if (format_list->data->ap_index != -1) */
			/* { */
			/* 	ap_index = format_list->data->ap_index; */
			/* } */
			/* else */
			/* 	ap_index++; */
			/* printf("\n%d\n", format_list->data->left_adjusted); */
			/* printf("\n%d\n", format_list->data->precision); */
			/* printf("\n%d\n", format_list->data->precision_wildcard); */
			/* printf("\n%d\n", format_list->data->min_field_width); */
	/* 		if ((str = convert_to_str(format_list->content, ap)) == NULL) */
	/* 			return (-1); */
	/* 		ft_putstr(str); */
	/* 		free(str); */
    /*  */
	/* 		print_len += format_list->content->len; */
	/* 		list_pop_front(&format_list); */
    /*     } */
    /*     else */
    /*         write(STDOUT_FILENO, format + print_len, 1); */
    /* } */
    /* va_end(ap); */
	(void)format;
	print_len = 0;
    return (print_len);
}