aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Burwell <bburwell1@gmail.com>2013-05-01 18:54:35 -0400
committerBen Burwell <bburwell1@gmail.com>2013-05-01 18:54:35 -0400
commitc112d966e58b3b6c314cc2b87d0891d946aa235a (patch)
treec0ab393428b63a283b2fc0e24ae66b1b2848b987
parenta08e54f9a39177c48fe797e3f60ffadd17ae380d (diff)
Adds comments
-rw-r--r--loading.h5
-rw-r--r--localchat.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/loading.h b/loading.h
index a9d7701..29662d8 100644
--- a/loading.h
+++ b/loading.h
@@ -7,10 +7,15 @@
void *rrf(void * arg) {
+ // wait predetermined interval
sleep(RR);
+
+ // print lyrics
printf("\n Never gonna give you up \n");
printf(" Never gonna let you down \n");
printf(" Never gonna run around and desert you. \n");
+
+ // display prompt
printf("%s ", prompt);
fflush(stdout);
diff --git a/localchat.c b/localchat.c
index 83bab38..ad0ba17 100644
--- a/localchat.c
+++ b/localchat.c
@@ -37,22 +37,27 @@
struct peer peers[MAX_NUM_PEERS];
int num_peers_in_table = 0;
pthread_mutex_t peer_table_lock;
-
+
+// my flags
char my_ip[64];
char in_chat[4] = "N";
const char * username;
-
+
+// command line vars
char command[256];
char prompt[16] = ">";
+// client socket
int client_s;
char in_buf[GLOBAL_MSG_LENGTH];
char out_buf[GLOBAL_MSG_LENGTH];
struct sockaddr_in client_addr;
+// for accepting connections pending user approval
int accepted_client;
struct sockaddr_in accepted_addr;
+// indicates whether needs to respond to a request
int respond_to_chat_request = 0;
// include functions