Skip to content

Commit 528bb78

Browse files
authored
Merge pull request #22 from lil-skelly/fix-headers
Moved include statements to the header files
2 parents dfcd350 + 7f45ace commit 528bb78

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

src/client/http.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
#include "http.h"
22
#include "sock.h"
3-
#include <assert.h>
4-
#include <fcntl.h>
5-
#include <netdb.h>
6-
#include <stdio.h>
7-
#include <stdlib.h>
8-
#include <string.h>
9-
#include <sys/file.h>
10-
#include <sys/socket.h>
11-
#include <time.h>
123

134
const char *CONTENT_LENGTH_HEADER = "Content-Length: ";
145
const char *GET_REQ_TEMPLATE =

src/client/http.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#ifndef HTTP_H
22
#define HTTP_H
33

4+
#include <stdio.h>
45
#include <stdlib.h>
6+
#include <string.h>
57

68
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
79

src/client/sock.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#include "sock.h"
2-
#include <netdb.h>
3-
#include <stdlib.h>
4-
52
/* Wrapper for getaddrinfo, handles error */
63
int h_getaddrinfo(const char *ip, const char *port, struct addrinfo *hints,
74
struct addrinfo **ainfo) {

src/client/sock.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
#include <arpa/inet.h>
55
#include <netdb.h>
6-
#include <sys/socket.h>
76
#include <stdio.h>
8-
#include <unistd.h>
7+
#include <stdlib.h>
98
#include <string.h>
10-
9+
#include <sys/socket.h>
10+
#include <unistd.h>
1111

1212
int create_sock_and_conn(struct addrinfo *res);
1313
void setup_hints(struct addrinfo *hints);

0 commit comments

Comments
 (0)