Base: LCDproc 0.5.2
[lcdproc-de200c.git] / server / client.h
blobee3e66311b1bffdcbf522efdee8a61a351e7c23b
1 /*
2 * client.h
3 * This file is part of LCDd, the lcdproc server.
5 * This file is released under the GNU General Public License. Refer to the
6 * COPYING file distributed with this package.
8 * Copyright (c) 1999, William Ferrell, Scott Scriven
9 * 2002, Joris Robijn
11 * Defines all the client data and actions.
14 #include "menu.h"
15 #include "menuitem.h"
16 /* These headers are placed here on purpose ! (circular references) */
18 #ifndef CLIENT_H
19 #define CLIENT_H
21 #include "shared/LL.h"
22 #include <stdio.h>
24 #define CLIENT_NAME_SIZE 256
26 typedef struct Client {
27 char *name;
28 int ack;
29 int sock;
30 int backlight;
31 int heartbeat;
33 /* Messages that the client generated */
34 LinkedList *messages;
36 /* The list of screens */
37 LinkedList *screenlist;
39 /* Maybe it has created a menu */
40 Menu *menu;
42 } Client;
44 #include "screen.h"
46 /* When a new client connects, set up a new client data struct */
47 Client *client_create(int sock);
49 /* Destroys the client data */
50 int client_destroy(Client *c);
52 /* Close the socket */
53 void client_close_sock(Client *c);
55 /* Add message to the client's queue...*/
56 int client_add_message(Client *c, char *message);
58 /* Get message from queue */
59 char *client_get_message(Client *c);
61 /* Find a named screen for the client */
62 Screen *client_find_screen(Client *c, char *id);
64 int client_add_screen(Client *c, Screen *s);
66 int client_remove_screen(Client *c, Screen *s);
68 int client_screen_count(Client *c);
70 #endif