From 80e8650fee104a1c20422dfd849e85ce45c38760 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Sun, 16 Aug 2009 18:08:35 +0000 Subject: [PATCH] start reformatting and commenting --- src/socket.c | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/src/socket.c b/src/socket.c index dca41d5..535964b 100644 --- a/src/socket.c +++ b/src/socket.c @@ -1,8 +1,34 @@ -/* - * some basic berkley socket stuff....far from beeing complete - */ -#define USE_STRUCT_SCOT_SOCKET - +/*************************************************************************** + * + * socket.c: some basic berkley socket stuff....far from beeing complete + * + * Copyright (C) 2009 Georg Steffers + * This file is part of gameserver + * + * gameserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Author: Georg Steffers (gst), georg@steffers.org + * + * Version: 0.0 + * Created: 16.08.2009 19:59:33 + * Revision: none + * + ***************************************************************************/ + +#define USE_STRUCT_SCOT_SOCKET // set for include behaviour + +/* #### HEADER FILE INCLUDES ######################################### */ #include #include @@ -16,12 +42,16 @@ #include +/* #### MACROS - LOCAL TO THIS SOURCE FILE ######################### */ #define SCOT_SOCKET_NEW_FAIL 0 #define SCOT_SOCKET_LISTEN_FAIL 1 #define SCOT_SOCKET_ACCEPT_FAIL 2 #define SCOT_SOCKET_CONNECT_FAIL 3 #define SCOT_SOCKET_NO_VALID_HOST 4 #define SCOT_SOCKET_AF_NOT_IMPLEMENTED 5 + + +/* #### VARIABLES - LOCAL TO THIS SOURCE FILE ###################### */ const char * scot_socket_errmsg[] = { "[SOCKET]failed to create new socket", @@ -35,13 +65,13 @@ const char * scot_socket_errmsg[] = const char * scot_socket_wrnmsg[] = { "[SOCKET]there was already an existent socket file.\n" - " i removed that file to let the new instance of the program\n" - " work, but notice that there might be another instance of this\n" - " program running, that is unusable hence now." + " i removed that file to let the new instance of the program\n" + " work, but notice that there might be another instance of this\n" + " program running, that is unusable hence now." }; - +/* #### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ################## */ void scot_socket_init (uint16_t major, uint16_t minor) { @@ -66,7 +96,7 @@ scot_socket_fini (void) * actualy i found no good reason to bind a socken if one * dont wants to listen to it too. If i find one i will change this. */ - void +void scot_socket_listen (const struct scot_socket* s) { excenv_t *ee;