Files
lcdproc/shared/sockets.h
T
mmdolze 66023939a1 Cleanup and documentation updates:
- Remove shared/str.h where not used.
- Remove shared/debug.h from all files as it has been completely replaced
  by shared/report.h (it will be removed later).
- Add more doxygen comments to shared/* and clients/lcdproc/*.
- Include static functions in doxygen output.
2010-02-02 23:20:29 +00:00

46 lines
1.2 KiB
C

/** \file shared/sockets.h
* Socket functions available to server and clients.
*/
#ifndef SOCKETS_H
#define SOCKETS_H
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifndef LCDPORT
# define LCDPORT 13666
#endif
#ifndef SHUT_RDWR
# define SHUT_RDWR 2
#endif
/** Connect to server on host, port */
int sock_connect (char *host, unsigned short int port);
/** Disconnect from server */
int sock_close (int fd);
/** Send printf-like formatted output */
int sock_printf (int fd, const char *format, .../*args*/);
/** Send lines of text */
int sock_send_string (int fd, char *string);
/** Send raw data */
int sock_send (int fd, void *src, size_t size);
/** Receive a line of text */
int sock_recv_string (int fd, char *dest, size_t maxlen);
/** Receive raw data */
int sock_recv (int fd, void *dest, size_t maxlen);
/** Return the error message for the last error occured */
char *sock_geterror(void);
/** Send an already formatted error message to the client */
int sock_send_error(int fd, char* message);
/** Print printf-like formatted output to logfile and send it to the client */
int sock_printf_error(int fd, const char *format, .../*args*/);
#endif