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

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* uoct.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/01 06:59:50 by tgrekov #+# #+# */
/* Updated: 2024/02/13 08:21:03 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file uoct.c.

#include <stdarg.h>
#include <unistd.h>
#include "../sequence.h"
#include "../../utils/utils.h"
#include "../../utils/internal_types.h"
#include "utils/handler_utils.h"
Include dependency graph for uoct.c:

Go to the source code of this file.

Functions

static int process_uoct (t_sequence seq, int *fd, int total)
 Process the unsigned octal specifier by printing the number in base 8.
 
void pre_uoct (va_list args, t_sequence *seq)
 Preprocess the unsigned octal specifier by retrieving the argument in the appropriate size, setting the s_sequence::total_len with u_len_base(nbr, 8) 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 0 if s_subspec::force_decimal is set and the retrieved value is non-zero, and setting the s_sequence::process to process_uoct.
 

Function Documentation

◆ pre_uoct()

void pre_uoct ( va_list  args,
t_sequence seq 
)

Preprocess the unsigned octal specifier by retrieving the argument in the appropriate size, setting the s_sequence::total_len with u_len_base(nbr, 8) 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 0 if s_subspec::force_decimal is set and the retrieved value is non-zero, and setting the s_sequence::process to process_uoct.

Parameters
[in,out]args
[in,out]seq

Definition at line 55 of file uoct.c.

References s_sequence::data, s_subspec::force_decimal, s_subspec::lenmod, s_subspec::pad_str, s_subspec::precision, s_sequence::process, process_uoct(), s_sequence::sign, s_sequence::subspec, s_sequence::total_len, u_len_base(), and unsigned_arg().

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

◆ process_uoct()

static int process_uoct ( t_sequence  seq,
int *  fd,
int  total 
)
static

Process the unsigned octal specifier by printing the number in base 8.

Parameters
[in]seq
[in]fd
[in]total(Unused)
Return values
intReturn value of u_print_base

Definition at line 36 of file uoct.c.

References u_print_base().

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