![]() |
tgrekov-pipex
HIVE pipex May 2024
|
Definition in file int.c.
#include <stdarg.h>#include <unistd.h>#include <stdlib.h>#include "../sequence.h"#include "../../utils/utils.h"#include "../../utils/internal_types.h"Go to the source code of this file.
Functions | |
| int | process_uint (t_sequence seq, int *fd, int total) |
| Processes the unsigned integer specifier by printing the number in base 10. | |
| static t_biggest | signed_arg (va_list args, t_lenmod lenmod) |
| Retrieves the next signed variable argument in the appropriate size dependent on the length modifier. | |
| static t_ubiggest | lltull (t_biggest n) |
| Safely converts a signed integer to an unsigned one. | |
| void | pre_int (va_list args, t_sequence *seq) |
Preprocess the signed integer specifier by retrieving the argument in the appropriate size, setting s_sequence::sign to - if the number was negative, converting it from signed to unsigned, setting the s_sequence::total_len with u_len_base(nbr, 10) and the s_subspec::precision, ensuring that s_subspec::pad_str is set to spaces if the s_subspec::precision is set, setting s_sequence::sign to s_subspec::forced_sign if it was not already set to -, and setting the s_sequence::process to process_uint. | |
|
static |
Safely converts a signed integer to an unsigned one.
| [in] | n |
| t_ubiggest | Converted integer |
Definition at line 64 of file int.c.
References T_BIGGEST_MAX.
| void pre_int | ( | va_list | args, |
| t_sequence * | seq | ||
| ) |
Preprocess the signed integer specifier by retrieving the argument in the appropriate size, setting s_sequence::sign to - if the number was negative, converting it from signed to unsigned, setting the s_sequence::total_len with u_len_base(nbr, 10) and the s_subspec::precision, ensuring that s_subspec::pad_str is set to spaces if the s_subspec::precision is set, setting s_sequence::sign to s_subspec::forced_sign if it was not already set to -, and setting the s_sequence::process to process_uint.
| [in,out] | args | |
| [in,out] | seq |
| int process_uint | ( | t_sequence | seq, |
| int * | fd, | ||
| int | total | ||
| ) |
Processes the unsigned integer specifier by printing the number in base 10.
| [in] | seq | |
| [in] | fd | |
| [in] | total | (Unused) |
| int | Return value of u_print_base |
Definition at line 36 of file uint.c.
References u_print_base().
Retrieves the next signed variable argument in the appropriate size dependent on the length modifier.
For more info on the length modifiers, see ft_printf.c
| [in,out] | args | |
| [in] | lenmod |
| t_biggest | Retrieved value |
Definition at line 39 of file int.c.