tgrekov-ft_printf
HIVE printf Feb 2024
Loading...
Searching...
No Matches
percent.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* percent.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2023/11/01 11:36:38 by tgrekov #+# #+# */
9/* Updated: 2024/02/13 07:56:54 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
20#include <stdarg.h>
21#include <unistd.h>
22#include "../sequence.h"
23#include "../../utils/internal_types.h"
24
25int process_char(t_sequence seq, int *fd, int total);
26
35void pre_percent(va_list args, t_sequence *seq)
36{
37 (void) args;
38 seq->data = (t_ubiggest) '%';
39 seq->total_len = 1;
40 seq->process = process_char;
41}
void pre_percent(va_list args, t_sequence *seq)
Preprocess the percent specifier by setting s_sequence::data to %, s_sequence::total_len to 1,...
Definition percent.c:35
int process_char(t_sequence seq, int *fd, int total)
Processes the character specifier by writing a character. (Wow)
Definition char.c:33
unsigned long long t_ubiggest
Convenience typedef for largest unsigned type I need to handle.
Holds information regarding the current format specifier sequence.
Definition sequence.h:49
int(* process)(struct s_sequence, int *, int)
Function to use for processing this sequence's value.
Definition sequence.h:56
t_ubiggest data
Retrieved variable argument.
Definition sequence.h:53
int total_len
Total number of characters after padding.
Definition sequence.h:54