Compare commits

..

5 commits

4 changed files with 69 additions and 3 deletions

View file

@ -17,7 +17,7 @@
tmux new-session -d -s $SESSION -c "$DIR" -n dev
tmux send-keys -t $SESSION:0 'vim' C-m
tmux split-window -h -p 30 -t $SESSION:0 -c "$DIR"
tmux send-keys -t $SESSION:0.1 'exec zsh' C-m
tmux send-keys -t $SESSION:0.1 'docker-compose up -d && docker exec -it ft_ping_dev bash' C-m
tmux new-window -t $SESSION:1 -n git -c "$DIR"
tmux send-keys -t $SESSION:1 'lazygit' C-m
fi
@ -34,6 +34,8 @@
clang-tools
fastmod
tree
docker
docker-compose
] ++ (if stdenv.isLinux then [ pkgs.valgrind ] else [ ]);
};
});

View file

@ -0,0 +1,38 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/23 14:49:37 by rparodi #+# #+# */
/* Updated: 2026/03/28 15:25:03 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
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();
void print_help(const size_t size);
void print_usage(const size_t size);
uint64_t check_num_arguments(char *arg);

View file

@ -6,7 +6,7 @@
# By: rparodi <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/11/12 11:05:05 by rparodi #+# #+# #
# Updated: 2026/03/24 11:44:52 by rparodi ### ########.fr #
# Updated: 2026/03/28 15:15:58 by rparodi ### ########.fr #
# #
# **************************************************************************** #
@ -16,7 +16,10 @@
MODULE_NAME = parsing
NAME = lib$(MODULE_NAME).a
SRC = sources/parsing.c
SRC = sources/utils.c \
sources/help.c \
sources/usage.c \
sources/parsing.c
CC ?= clang
CFLAGS ?= -Werror -Wextra -Wall

23
sources/ping.c Normal file
View file

@ -0,0 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ping.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/23 14:49:14 by rparodi #+# #+# */
/* Updated: 2026/03/28 12:45:52 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "ping.h"
#include "struct.h"
#include <stdlib.h>
#include <strings.h>
int main(int argc, char *argv[]) {
t_flags flags;
bzero(&flags, sizeof(t_flags));
parsing_args(argc, argv, &flags);
return (EXIT_SUCCESS);
}