This commit is contained in:
2023-11-29 14:03:49 +01:00
parent a536943d5c
commit ba26a2e64b
2 changed files with 45 additions and 10 deletions

View File

@@ -1,19 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* irc.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* By: vvaas <vvaas@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/24 10:40:01 by maldavid #+# #+# */
/* Updated: 2023/11/24 10:40:29 by maldavid ### ########.fr */
/* Created: 2023/11/29 13:24:01 by vvaas #+# #+# */
/* Updated: 2023/11/29 13:45:51 by vvaas ### ########.fr */
/* */
/* ************************************************************************** */
int main(int ac, char** av)
{
(void)ac;
(void)av;
#ifndef IRC_H
# define IRC_H
return 0;
}
# include <iostream>
# include <string>
# include <sys/socket.h>
# include <netinet/in.h>
#endif

34
srcs/main.cpp Normal file
View File

@@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vvaas <vvaas@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/24 10:40:01 by maldavid #+# #+# */
/* Updated: 2023/11/29 14:03:14 by vvaas ### ########.fr */
/* */
/* ************************************************************************** */
#include "../includes/irc.hpp"
unsigned long get_port(char *port)
{
if (!port)
return (0);
return (std::atoi(port));
}
int main(int argc, char** argv)
{
int s_socket;
struct sockaddr_in s_data;
s_data.sin_family = AF_INET;
s_data.sin_addr.s_addr = INADDR_ANY;
s_data.sin_port = get_port(argv[1]);
if (argc != 3)
return (1);
(void)argv;
return 0;
}