Skip to content
Browse files

Declared non-API functions as static

  • Loading branch information...
1 parent ee51ae2 commit b1b83ecee0fc8ed1cc03b3319ee57a83809c6c71 @bsg committed Apr 1, 2012
Showing with 6 additions and 7 deletions.
  1. +1 −1 README
  2. +0 −1 TODO
  3. +5 −5 src/libserv.c
View
2 README
@@ -4,6 +4,6 @@ Copy libserv.c and libserv.h into your source folder and include libserv.h
Windows users, in addition to the above, need to link ws2_32.dll.
-Please see example.c for usage.
+Please see example.c for usage. Documentation coming soon.
IMPORTANT NOTE: This software is not tested thoroughly and should not be used in a serious project.
View
1 TODO
@@ -1 +0,0 @@
-- Add more informative error messages
View
10 src/libserv.c
@@ -46,11 +46,11 @@ SOFTWARE.
typedef int socklen_t;
-inline int read(int fd, char *buffer, int size) {
+static inline int read(int fd, char *buffer, int size) {
return recv(fd, buffer, size, 0);
}
-inline int write(int fd, char *buffer, int size) {
+static inline int write(int fd, char *buffer, int size) {
return send(fd, buffer, size, 0);
}
#endif
@@ -95,7 +95,7 @@ static inline void _error(const char *func, int line, const char *msg) {
#define SOCK_NONBLOCK 1
#endif
-int setnoblock(int fd) {
+static int setnoblock(int fd) {
#ifndef WIN32
int flags;
flags = fcntl(fd, F_GETFL, 0);
@@ -108,7 +108,7 @@ int setnoblock(int fd) {
#endif
}
-int tcp_create_listener(char *hostname, char *port) {
+static int tcp_create_listener(char *hostname, char *port) {
int status, fd;
struct addrinfo hints;
struct addrinfo *servinfo;
@@ -199,7 +199,7 @@ int tcp_close(int fd) {
return close(fd);
}
-int tcp_accept(int fd, char *ip, int *port, int flags) {
+static int tcp_accept(int fd, char *ip, int *port, int flags) {
int fd_new;
struct sockaddr_storage addr;
socklen_t addrlen = sizeof(addr);

0 comments on commit b1b83ec

Please sign in to comment.
Something went wrong with that request. Please try again.