Compare commits
5 commits
07b957ea0e
...
9349d485df
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9349d485df | ||
|
|
92f61058d5 | ||
|
|
6bb054c962 | ||
|
|
5b01a859b3 | ||
|
|
61f87e1d33 |
4 changed files with 69 additions and 3 deletions
|
|
@ -17,7 +17,7 @@
|
||||||
tmux new-session -d -s $SESSION -c "$DIR" -n dev
|
tmux new-session -d -s $SESSION -c "$DIR" -n dev
|
||||||
tmux send-keys -t $SESSION:0 'vim' C-m
|
tmux send-keys -t $SESSION:0 'vim' C-m
|
||||||
tmux split-window -h -p 30 -t $SESSION:0 -c "$DIR"
|
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 new-window -t $SESSION:1 -n git -c "$DIR"
|
||||||
tmux send-keys -t $SESSION:1 'lazygit' C-m
|
tmux send-keys -t $SESSION:1 'lazygit' C-m
|
||||||
fi
|
fi
|
||||||
|
|
@ -34,6 +34,8 @@
|
||||||
clang-tools
|
clang-tools
|
||||||
fastmod
|
fastmod
|
||||||
tree
|
tree
|
||||||
|
docker
|
||||||
|
docker-compose
|
||||||
] ++ (if stdenv.isLinux then [ pkgs.valgrind ] else [ ]);
|
] ++ (if stdenv.isLinux then [ pkgs.valgrind ] else [ ]);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
38
parsing/includes/parsing.h
Normal file
38
parsing/includes/parsing.h
Normal 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);
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
# By: rparodi <marvin@42.fr> +#+ +:+ +#+ #
|
# By: rparodi <marvin@42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2023/11/12 11:05:05 by rparodi #+# #+# #
|
# 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
|
MODULE_NAME = parsing
|
||||||
NAME = lib$(MODULE_NAME).a
|
NAME = lib$(MODULE_NAME).a
|
||||||
|
|
||||||
SRC = sources/parsing.c
|
SRC = sources/utils.c \
|
||||||
|
sources/help.c \
|
||||||
|
sources/usage.c \
|
||||||
|
sources/parsing.c
|
||||||
|
|
||||||
CC ?= clang
|
CC ?= clang
|
||||||
CFLAGS ?= -Werror -Wextra -Wall
|
CFLAGS ?= -Werror -Wextra -Wall
|
||||||
|
|
|
||||||
23
sources/ping.c
Normal file
23
sources/ping.c
Normal 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);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue