tgrekov-pipex
HIVE pipex May 2024
Loading...
Searching...
No Matches
parse_subspec.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parse_subspec.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/25 17:52:45 by tgrekov #+# #+# */
/* Updated: 2024/04/26 10:29:42 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file parse_subspec.c.

#include <stdarg.h>
#include "subspec.h"
#include "../utils/utils.h"
#include "../../../../libft.h"
Include dependency graph for parse_subspec.c:

Go to the source code of this file.

Functions

void init_subspec (t_subspec *subspec)
 Sets initial values for a s_subspec that are not always set elsewhere.
 
static void parse_lenmod (const char **format, t_subspec *subspec)
 Parse the length modifier for the sequence.
 
static int subspec_parse_width_or_precision (const char **format, va_list args)
 Parse inline or variable argument width or precision.
 
void parse_subspec (const char **format, t_subspec *subspec, va_list args)
 Parse flags, width, precision, and length.
 

Function Documentation

◆ init_subspec()

void init_subspec ( t_subspec subspec)

Sets initial values for a s_subspec that are not always set elsewhere.

Parameters
[in,out]subspec

Definition at line 31 of file parse_subspec.c.

References s_subspec::force_decimal, s_subspec::forced_sign, s_subspec::left_justify, s_subspec::lenmod, s_subspec::min_width, s_subspec::pad_str, and s_subspec::precision.

Here is the caller graph for this function:

◆ parse_lenmod()

static void parse_lenmod ( const char **  format,
t_subspec subspec 
)
static

Parse the length modifier for the sequence.

Parameters
[in,out]format
[in,out]subspec

Definition at line 48 of file parse_subspec.c.

References s_subspec::lenmod.

Here is the caller graph for this function:

◆ parse_subspec()

void parse_subspec ( const char **  format,
t_subspec subspec,
va_list  args 
)

Parse flags, width, precision, and length.

Parameters
[in,out]format
[in,out]subspec
[in,out]args

Definition at line 99 of file parse_subspec.c.

References s_subspec::force_decimal, s_subspec::forced_sign, ft_isdigit(), ft_strchr(), s_subspec::left_justify, s_subspec::min_width, s_subspec::pad_str, parse_lenmod(), s_subspec::precision, and subspec_parse_width_or_precision().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subspec_parse_width_or_precision()

static int subspec_parse_width_or_precision ( const char **  format,
va_list  args 
)
static

Parse inline or variable argument width or precision.

Parameters
[in,out]format
[in,out]args
Return values
intParsed value for width or precision.

Definition at line 77 of file parse_subspec.c.

References ft_atoi(), and ft_isdigit().

Here is the call graph for this function:
Here is the caller graph for this function: