Libft
Custom implementation of core libc functions with additional utility helpers.
Loading...
Searching...
No Matches
rules_apply.c File Reference
#include "buff_format.h"
#include <stdlib.h>
Include dependency graph for rules_apply.c:

Functions

static bool apply_precision (t_buff *buff, const t_rules *rules)
 Applies precision formatting to the buffer.
 
static bool apply_plus_space (t_buff *buff, const t_rules *rules)
 Applies plus or space sign formatting for positive numbers.
 
static bool apply_hex_prefix (t_buff *buff, const t_rules *rules)
 Applies hexadecimal prefix (0x or 0X) to the buffer.
 
static bool apply_width (t_buff *buff, const t_rules *rules)
 Applies width padding to the buffer.
 
bool rules_apply (t_buff *buff, t_rules *rules)
 Applies formatting rules to a buffer.
 

Function Documentation

◆ apply_hex_prefix()

static bool apply_hex_prefix ( t_buff buff,
const t_rules rules 
)
inlinestatic

Applies hexadecimal prefix (0x or 0X) to the buffer.

Parameters
buffPointer to the buffer.
rulesPointer to the formatting rules.
Returns
true on success, false on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_plus_space()

static bool apply_plus_space ( t_buff buff,
const t_rules rules 
)
inlinestatic

Applies plus or space sign formatting for positive numbers.

Parameters
buffPointer to the buffer.
rPointer to the formatting rules.
Returns
true on success, false on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_precision()

static bool apply_precision ( t_buff buff,
const t_rules rules 
)
inlinestatic

Applies precision formatting to the buffer.

Parameters
buffPointer to the buffer.
rulesPointer to the formatting rules.
Returns
true on success, false on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_width()

static bool apply_width ( t_buff buff,
const t_rules rules 
)
inlinestatic

Applies width padding to the buffer.

Parameters
bPointer to the buffer.
rPointer to the formatting rules.
Returns
true on success, false on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rules_apply()

bool rules_apply ( t_buff buff,
t_rules rules 
)

Applies formatting rules to a buffer.

Parameters
buffPointer to the buffer.
rulesPointer to the rules structure.
Returns
true on success, false on failure.
Here is the call graph for this function:
Here is the caller graph for this function: