You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.4 KiB

#pragma once
2 years ago
#define DEBUG 1
2 years ago
#include <arpa/inet.h>
#include <dirent.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
2 years ago
#include <sys/wait.h>
#include <stdio.h>
#include <unistd.h>
2 years ago
#include <algorithm>
2 years ago
#include <cctype>
#include <cerrno>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iterator>
#include <sstream>
#include <string>
2 years ago
#include <map>
#include <vector>
2 years ago
using std::cout;
using std::strerror;
using std::string;
typedef struct ip_port_s {
2 years ago
int fd;
2 years ago
string ip;
2 years ago
int port;
} ip_port_t;
2 years ago
2 years ago
class JSONNode;
class Env;
class Server;
class Route;
2 years ago
class Master;
class Client;
2 years ago
typedef std::map<string, JSONNode *> JSONObject;
typedef std::vector<JSONNode *> JSONList;
typedef std::vector<string> vec_string;
2 years ago
// tools
2 years ago
void *ft_memset(void *b, int c, size_t len);
bool isAPort(string str);
2 years ago
vec_string split(string str, string delim);
2 years ago
ip_port_t get_ip_port_t(string listen);
ip_port_t get_ip_port_t(string ip, int port);
string getMime(string path);
string read_file(string path);
2 years ago
// debug
2 years ago
void debug_block(string name, string content);
2 years ago
2 years ago
#include "Client.hpp"
#include "Master.hpp"
2 years ago
#include "Nodes.hpp"
#include "Token.hpp"
#include "Parser.hpp"
#include "Route.hpp"
#include "Server.hpp"
#include "Env.hpp"