add some notes and basic code
This commit is contained in:
11
include/colors.h
Normal file
11
include/colors.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef __COLORS_H__
|
||||
#define __COLORS_H__
|
||||
|
||||
#define RED "\033[31m"
|
||||
#define GREEN "\033[32m"
|
||||
#define YELLOW "\033[33m"
|
||||
#define BLUE "\033[34m"
|
||||
#define BOLD "\033[1m"
|
||||
#define RESET "\033[0m"
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#define GREEN_COLOR "\033[32m"
|
||||
#define RESET_COLOR "\033[0m"
|
||||
#include <stdio.h>
|
||||
|
||||
#endif
|
||||
@@ -1,13 +1,20 @@
|
||||
#ifndef __SERVER_H__
|
||||
#define __SERVER_H__
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define PORT 3030
|
||||
// how many pending connections the queue will hold
|
||||
#define BACKLOG 10
|
||||
|
||||
int start_server(void);
|
||||
|
||||
#endif
|
||||
|
||||
17
include/utils.h
Normal file
17
include/utils.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef __UTILS_H__
|
||||
#define __UTILS_H__
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// Print every IPs of a hostname
|
||||
void print_ips(const char *hostname, const char *port);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user