More formatting updates. Reduced whitespace, looks even better.
This commit is contained in:
-15
@@ -112,7 +112,6 @@ LL_node_DestroyData (LL_node * node)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Returns to the beginning of the list...
|
||||
int
|
||||
@@ -186,7 +185,6 @@ LL_Prev (LL * list)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Data manipulation
|
||||
void *
|
||||
@@ -214,7 +212,6 @@ LL_Put (LL * list, void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
LL_node *
|
||||
LL_GetNode (LL * list)
|
||||
@@ -240,7 +237,6 @@ LL_PutNode (LL * list, LL_node * node)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
void *
|
||||
LL_GetFirst (LL * list) // gets data from first node
|
||||
@@ -308,7 +304,6 @@ LL_AddNode (LL * list, void *add) // Adds node AFTER current one
|
||||
|
||||
//LL_dprint(list);
|
||||
|
||||
|
||||
node = malloc (sizeof (LL_node));
|
||||
if (!node)
|
||||
return -1;
|
||||
@@ -408,7 +403,6 @@ LL_DeleteNode (LL * list)
|
||||
LL_dprint (list);
|
||||
#endif
|
||||
|
||||
|
||||
next = list->current->next;
|
||||
prev = list->current->prev;
|
||||
data = list->current->data;
|
||||
@@ -457,7 +451,6 @@ LL_Remove (LL * list, void *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Stack operations
|
||||
int
|
||||
@@ -613,8 +606,6 @@ LL_UnRoll (LL * list) // Roll the other way...
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Add an item to the end of its "priority group"
|
||||
// The list is assumed to be sorted already...
|
||||
@@ -652,8 +643,6 @@ LL_PriorityEnqueue (LL * list, void *add, int compare (void *, void *))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
int
|
||||
LL_SwapNodes (LL_node * one, LL_node * two) // Switch two nodes positions...
|
||||
@@ -694,7 +683,6 @@ LL_SwapNodes (LL_node * one, LL_node * two) // Switch two nodes positions...
|
||||
if (secondnext == one)
|
||||
two->prev = one;
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -755,7 +743,6 @@ LL_Find (LL * list, int compare (void *, void *), void *value)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sorts the list, then rewinds it...
|
||||
//
|
||||
@@ -767,7 +754,6 @@ LL_Sort (LL * list, int compare (void *, void *))
|
||||
LL_node *best, *last; // best match and last node in the list
|
||||
LL_node *current;
|
||||
|
||||
|
||||
if (!list)
|
||||
return -1;
|
||||
if (!compare)
|
||||
@@ -781,7 +767,6 @@ LL_Sort (LL * list, int compare (void *, void *))
|
||||
if (numnodes < 2)
|
||||
return 0;
|
||||
|
||||
|
||||
for (i = numnodes - 1; i > 0; i--) {
|
||||
LL_Rewind (list); // get the first node again
|
||||
best = last; // reset our "best" node
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef LL_H
|
||||
#define LL_H
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
Linked Lists! (Doubly-Linked Lists)
|
||||
*******************************************************************
|
||||
@@ -115,7 +113,6 @@
|
||||
That's about it, for now... Be sure to free the list when you're done!
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
// See LL.c for more detailed descriptions of these functions.
|
||||
|
||||
typedef struct LL_node {
|
||||
@@ -128,8 +125,6 @@ typedef struct LL {
|
||||
LL_node *current;
|
||||
} LL;
|
||||
|
||||
|
||||
|
||||
// Creates a new list...
|
||||
LL *LL_new ();
|
||||
// Destroying lists...
|
||||
@@ -188,7 +183,6 @@ int LL_UnRoll (LL * list); // Roll the other way...
|
||||
|
||||
int LL_PriorityEnqueue (LL * list, void *add, int compare (void *, void *));
|
||||
|
||||
|
||||
int LL_SwapNodes (LL_node * one, LL_node * two); // Switch two nodes positions...
|
||||
int LL_nSwapNodes (int one, int two); // Switch two nodes positions...
|
||||
|
||||
@@ -200,7 +194,6 @@ void *LL_Find (LL * list, int compare (void *, void *), void *value);
|
||||
// Sorts the list...
|
||||
int LL_Sort (LL * list, int compare (void *, void *));
|
||||
|
||||
|
||||
// Debugging...
|
||||
void LL_dprint (LL * list);
|
||||
|
||||
|
||||
@@ -16,21 +16,17 @@
|
||||
#include "debug.h"
|
||||
#include "sockets.h"
|
||||
|
||||
|
||||
/**************************************************
|
||||
LCDproc client sockets code...
|
||||
|
||||
Feel free to use this in your own clients... :)
|
||||
**************************************************/
|
||||
|
||||
|
||||
// Length of longest transmission allowed at once...
|
||||
#define MAXMSG 8192
|
||||
|
||||
|
||||
typedef struct sockaddr_in sockaddr_in;
|
||||
|
||||
|
||||
static int
|
||||
sock_init_sockaddr (sockaddr_in * name, const char *hostname, unsigned short int port)
|
||||
{
|
||||
@@ -57,7 +53,6 @@ sock_connect (char *host, unsigned short int port)
|
||||
int sock;
|
||||
int err = 0;
|
||||
|
||||
|
||||
debug ("sock_connect: Creating socket\n");
|
||||
sock = socket (PF_INET, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
@@ -77,7 +72,6 @@ sock_connect (char *host, unsigned short int port)
|
||||
|
||||
fcntl (sock, F_SETFL, O_NONBLOCK);
|
||||
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#define LCDPORT 13666
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Socket functions available to server and clients...
|
||||
(ignore the rest of the comments... I was babbling out random ideas)
|
||||
@@ -20,7 +18,6 @@
|
||||
This should have stuff to read/write sockets, open/close them, etc...
|
||||
*/
|
||||
|
||||
|
||||
// Client functions...
|
||||
int sock_connect (char *host, unsigned short int port);
|
||||
int sock_close (int fd);
|
||||
@@ -32,7 +29,6 @@ int sock_recv_string (int fd, char *dest, size_t maxlen);
|
||||
int sock_send (int fd, void *src, size_t size);
|
||||
int sock_recv (int fd, void *dest, size_t maxlen);
|
||||
|
||||
|
||||
// Er, ignore the rest of this file. I'll clean it up sometime...
|
||||
|
||||
/*****************************************************************
|
||||
@@ -84,8 +80,6 @@ int sock_recv (int fd, void *dest, size_t maxlen);
|
||||
Key D Next/+
|
||||
Key E OtherSequence
|
||||
|
||||
|
||||
******************************************************************/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user