Go to the source code of this file.
|
| struct | s_rules |
| | Structure holding format specifier rules for printf-like formatting. More...
|
| |
|
| void | rules_parse (t_rules *rules, const char **const fstring) |
| | Parses format specifiers from a format string.
|
| |
| bool | rules_apply (t_buff *buff, t_rules *rules) |
| | Applies formatting rules to a buffer.
|
| |
| bool | append (t_buff *buff, t_rules *rules, va_list *args) |
| | Appends formatted argument to buffer based on rules.
|
| |
| bool | append_char (t_buff *buff, char c) |
| | Appends a character to the buffer.
|
| |
| bool | append_int (t_buff *buff, int nb) |
| | Appends an integer to the buffer as a string.
|
| |
| bool | append_uint (t_buff *buff, unsigned int nb) |
| | Appends an unsigned integer to the buffer as a string.
|
| |
| bool | append_hex (t_buff *buff, unsigned long nb, bool uppercase) |
| | Appends a number in hexadecimal format to the buffer.
|
| |
| bool | append_ptr (t_buff *buff, unsigned long nb) |
| | Appends a pointer address to the buffer.
|
| |
◆ t_rules
◆ append()
Appends formatted argument to buffer based on rules.
- Parameters
-
| buff | Pointer to the buffer. |
| rules | Pointer to the formatting rules. |
| args | Pointer to the variable argument list. |
- Returns
- true on success, false on failure.
◆ append_char()
| bool append_char |
( |
t_buff * |
buff, |
|
|
char |
c |
|
) |
| |
Appends a character to the buffer.
- Parameters
-
| buff | Pointer to the buffer. |
| c | Character to append. |
- Returns
- true on success, false on failure.
◆ append_hex()
| bool append_hex |
( |
t_buff * |
buff, |
|
|
unsigned long |
nb, |
|
|
bool |
uppercase |
|
) |
| |
Appends a number in hexadecimal format to the buffer.
- Parameters
-
| buff | Pointer to the buffer. |
| nb | Number to convert. |
| uppercase | Use uppercase letters if true. |
- Returns
- true on success, false on failure.
◆ append_int()
| bool append_int |
( |
t_buff * |
buff, |
|
|
int |
nb |
|
) |
| |
Appends an integer to the buffer as a string.
- Parameters
-
| buff | Pointer to the buffer. |
| nb | Integer to append. |
- Returns
- true on success, false on failure.
◆ append_ptr()
| bool append_ptr |
( |
t_buff * |
buff, |
|
|
unsigned long |
nb |
|
) |
| |
Appends a pointer address to the buffer.
- Parameters
-
| buff | Pointer to the buffer. |
| nb | Pointer value as unsigned long. |
- Returns
- true on success, false on failure.
◆ append_uint()
| bool append_uint |
( |
t_buff * |
buff, |
|
|
unsigned int |
nb |
|
) |
| |
Appends an unsigned integer to the buffer as a string.
- Parameters
-
| buff | Pointer to the buffer. |
| nb | Unsigned integer to append. |
- Returns
- true on success, false on failure.
◆ rules_apply()
Applies formatting rules to a buffer.
- Parameters
-
| buff | Pointer to the buffer. |
| rules | Pointer to the rules structure. |
- Returns
- true on success, false on failure.
◆ rules_parse()
| void rules_parse |
( |
t_rules * |
rules, |
|
|
const char **const |
fstring |
|
) |
| |
Parses format specifiers from a format string.
- Parameters
-
| rules | Pointer to the rules structure to populate. |
| fstring | Pointer to format string pointer (advanced by parsing). |