as argument introducers. in 0.4-pre10, these were changed
from foo to -foo and this broke many clients. This change
should fix that and be backward/forward compatible.
+ Added a noop function to the protocol. This is useful for writing
shell script clients of LCDproc.
+ Changed the shared sock_send_string function to NOT send the
ending NUL ('\0') byte with the string. This was confusing
in Perl clients which saw NUL's as the first character of
each reply. WARNING: The LCDPROC client depended on this
behavior, your client may too. Use the newline instead.
See the code in clients/lcdproc/main.c (look for "switch(buf[i])")
to see one way to handle this. This should allow new clients
to connect to old servers and vice-versa.
+ Messed with include structure in .c files. It should no longer
be necessary to specify ../.. to get to shared code headers.
Also, since we are using automake, the global config.h can be
found with just #include "config.h" as it's location is included
in a -I to the compilers. As a result "make distcheck" now works.
37 lines
786 B
C
37 lines
786 B
C
#ifndef CLIENTS_H
|
|
#define CLIENTS_H
|
|
|
|
#include "client_data.h"
|
|
#include "shared/LL.h"
|
|
|
|
typedef struct client {
|
|
int sock;
|
|
LL *messages;
|
|
client_data *data;
|
|
|
|
} client;
|
|
|
|
extern LL *clients;
|
|
|
|
// Initialize and kill client list...
|
|
int client_init ();
|
|
int client_shutdown ();
|
|
|
|
// Create and destroy clients....
|
|
client *client_create (int sock);
|
|
int client_destroy (client * c);
|
|
|
|
// Add and remove messages from the client's queue...
|
|
int client_add_message (client * c, char *message);
|
|
char *client_get_message (client * c);
|
|
|
|
// Get and set the client's data...
|
|
// Not used at all yet, and may never be. Oh, well.
|
|
int client_set (client * c, void *data);
|
|
void *client_get (client * c);
|
|
|
|
// Search for a client with a particular filedescriptor...
|
|
client *client_find_sock (int sock);
|
|
|
|
#endif
|