diff options
author | Martin Hammerschmid <linux@home.pages.at> | 2002-07-21 19:46:06 +0200 |
---|---|---|
committer | Martin Hammerschmid <linux@home.pages.at> | 2002-07-21 19:46:06 +0200 |
commit | b49a01e5a6304aeb0b6ad20c4d74468e7d19ef47 (patch) | |
tree | 95ff43114959fe9d1df1ebda272fc901e9781d65 /sockets.h | |
download | vdr-plugin-lcdproc-release/v0.0.1.tar.gz vdr-plugin-lcdproc-release/v0.0.1.tar.bz2 |
Version 0.0.1v0.0.1release/v0.0.1
Diffstat (limited to 'sockets.h')
-rw-r--r-- | sockets.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/sockets.h b/sockets.h new file mode 100644 index 0000000..86df31f --- /dev/null +++ b/sockets.h @@ -0,0 +1,92 @@ +/******************************** +this file was taken from the +LCDproc source see +http://lcdproc.omnipotent.net/ +for more info. +*********************************/ + +#ifndef SOCKETS_H +#define SOCKETS_H + +#include <stdlib.h> + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifndef LCDPORT +#define LCDPORT 13666 +#endif + +/* + Socket functions available to server and clients... + (ignore the rest of the comments... I was babbling out random ideas) + + 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); +// Send/receive lines of text +int sock_send_string (int fd, char *string); +// Recv gives only one line per call... +int sock_recv_string (int fd, char *dest, size_t maxlen); +// Send/receive raw data +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... + +/***************************************************************** + LCDproc command line interface?: (while running) + + -command + Tells LCDproc to interpret stdin as raw commands to send through + the socket. Input must be formatted as above, in socket interface. + -function f + Runs LCDproc external function f, where f is one of the predefined + functions which can be assigned to keypad keys. (like NEXTMODE, etc) + -key x + Simulates keypad press of key 'x', where 'x' is (A-Z). + -print [time] + Prints stdin on LCD one line at a time, with no line-wrapping (raw), + with [time] frames between updates (lines). + -wrap [time] + Prints stdin as with "-print", but with line wrapping when possible. + -contrast xxx + Sets contrast to xxx (decimal) + -backlight [on/off] + Turns backlight [on/off/auto], or toggles it. + If [off], stays off. + If [on], stays on. + If [auto], LCDproc controls backlight based on load, etc... + -exit + -quit + Duh... :) + +******************************************************************/ + +/***************************************************************** + LCDproc stuff supported in config file (loose approximation): + + Grammar is tcl-style. I.e., "command arg1 arg2 ...". + Spaces are used as argument separators, *until* it thinks it has the final + argument. So, "function thing shell myprogram arg1 arg2 arg3" would be + split into "function", "thing", "shell", and "myprogram arg1 arg2 arg3". + + User-definable functions (use built-in's to create new ones?): + Function mp3NextSong Shell /usr/local/bin/mp3player -next + Function MySequence Sequence cpu mem xload + Function OtherSequence Sequence time cd xload + + Keypad keys can be bound to any _function_: + Key A mp3NextSong + Key B HaltSystem + Key C Menu + Key D Next/+ + Key E OtherSequence + +******************************************************************/ + +#endif |