ft_ping/parsing/includes/parsing.h

42 lines
1.4 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/23 14:49:37 by rparodi #+# #+# */
/* Updated: 2026/03/30 15:48:05 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "struct.h"
#include <stdbool.h>
#include <stdio.h>
#ifdef BONUS
# define BONUS 1
#endif
#ifndef BONUS
# define BONUS 0
#endif
#define ICMP_PAYLOAD 56
typedef struct s_args {
char short_option;
char *long_option;
char *usage;
char *description;
bool is_mandatory;
} t_args;
extern const t_args _flags[];
size_t args_size();
uint64_t check_num_arguments(char *arg);
void check_flags(int argc, char **argv, t_flags *flags);
void check_target(t_flags *flags, const char *target);
void print_help(const size_t size);
void print_usage(const size_t size);