-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparams.c
More file actions
35 lines (31 loc) · 857 Bytes
/
Copy pathparams.c
File metadata and controls
35 lines (31 loc) · 857 Bytes
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
#include "main.h"
/**
* init_params - Initializes and resetsthe
* fields of the parameters struct and buffer.
* @params: Pointer to the parameters struct to be initialized.
* @ap: The argument pointer (not used in this function).
*
* This function is responsible for resetting
* the values of the parameters struct
* and the buffer to their default states. It clears flags,
* sets default values for
* width and precision, and resets any modifiers.
* The argument pointer 'ap' is not used
* in this function.
*
* Return: void
*/
void init_params(params_t *params, va_list ap)
{
params->unsign = 0;
params->plus_flag = 0;
params->space_flag = 0;
params->hashtag_flag = 0;
params->zero_flag = 0;
params->minus_flag = 0;
params->width = 0;
params->precision = UINT_MAX;
params->h_modifier = 0;
params->l_modifier = 0;
(void)ap;
}