Skip to content

Commit

Permalink
Moved include statements to the header files
Browse files Browse the repository at this point in the history
  • Loading branch information
skelly committed Sep 10, 2024
1 parent 8f9b6ef commit 7f45ace
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
9 changes: 0 additions & 9 deletions src/client/http.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#include "http.h"
#include "sock.h"
#include <assert.h>
#include <fcntl.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <time.h>

const char *CONTENT_LENGTH_HEADER = "Content-Length: ";
const char *GET_REQ_TEMPLATE =
Expand Down
2 changes: 2 additions & 0 deletions src/client/http.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef HTTP_H
#define HTTP_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

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

Expand Down
3 changes: 0 additions & 3 deletions src/client/sock.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#include "sock.h"
#include <netdb.h>
#include <stdlib.h>

/* Wrapper for getaddrinfo, handles error */
int h_getaddrinfo(const char *ip, const char *port, struct addrinfo *hints,
struct addrinfo **ainfo) {
Expand Down
6 changes: 3 additions & 3 deletions src/client/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

#include <arpa/inet.h>
#include <netdb.h>
#include <sys/socket.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

#include <sys/socket.h>
#include <unistd.h>

int create_sock_and_conn(struct addrinfo *res);
void setup_hints(struct addrinfo *hints);
Expand Down

0 comments on commit 7f45ace

Please sign in to comment.