資源簡(jiǎn)介
linux下基于client/server的通用LCD驅(qū)動(dòng)程序,支持很多流行的LCD控制器。
代碼片段和文件信息
/*?\file?clients/lcdexec/lcdexec.c
?*?Main?file?for?\lcdexec?the?program?starter?in?the?LCDproc?suite.
?*/
/*?This?file?is?part?of?lcdexec?an?LCDproc?client.
?*
?*?This?file?is?released?under?the?GNU?General?Public?License.?Refer?to?the
?*?COPYING?file?distributed?with?this?package.
?*
?*?Copyright?(c)?2002?Joris?Robijn
?*???????????????2006-2008?Peter?Marschall
?*/
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?“getopt.h“
#include?“shared/str.h“
#include?“shared/report.h“
#include?“shared/configfile.h“
#include?“shared/sockets.h“
#include?“menu.h“
#if?!defined(SYSCONFDIR)
#?define?SYSCONFDIR “/etc“
#endif
#if?!defined(PIDFILEDIR)
#?define?PIDFILEDIR “/var/run“
#endif
#define?DEFAULT_CONFIGFILE SYSCONFDIR?“/lcdexec.conf“
#define?DEFAULT_PIDFILE PIDFILEDIR?“/lcdexec.pid“
/**?information?about?a?process?started?by?lcdexec?*/
typedef?struct?ProcInfo?{
struct?ProcInfo?*next; /** const?MenuEntry?*cmd; /** pid_t?pid; /** time_t?starttime; /** time_t?endtime; /** int?status; /** int?feedback; /** int?shown; /**}?ProcInfo;
char?*?help_text?=
“l(fā)cdexec?-?LCDproc?client?to?execute?commands?from?the?LCDd?menu\n“
“\n“
“Copyright?(c)?2002?Joris?Robijn?2006-2008?Peter?Marschall.\n“
“This?program?is?released?under?the?terms?of?the?GNU?General?Public?License.\n“
“\n“
“Usage:?lcdexec?[]\n“
“??where??are:\n“
“????-c????????????Specify?configuration?file?[“DEFAULT_CONFIGFILE“]\n“
“????-a?????????DNS?name?or?IP?address?of?the?LCDd?server?[localhost]\n“
“????-p????????????port?of?the?LCDd?server?[13666]\n“
“????-f??????????????????Run?in?foreground\n“
“????-r???????????Set?reporting?level?(0-5)?[2:?errors?and?warnings]\n“
“????-s?<0|1>????????????Report?to?syslog?(1)?or?stderr?(0?default)\n“
“????-h??????????????????Show?this?help\n“;
char?*progname?=?“l(fā)cdexec“;
/*?Variables?set?by?config?*/
#define?UNSET_INT?-1
#define?UNSET_STR?“\01“
char?*configfile?=?NULL;
char?*address?=?NULL;
int?port?=?UNSET_INT;
int?foreground?=?FALSE;
static?int?report_level?=?UNSET_INT;
static?int?report_dest?=?UNSET_INT;
char?*pidfile?=?NULL;
int?pidfile_written?=?FALSE;
char?*displayname?=?NULL;
char?*default_shell?=?NULL;
/*?Other?global?variables?*/
MenuEntry?*main_menu?=?NULL; /**ProcInfo?*proc_queue?=?NULL; /**
int?lcd_wid?=?0; /**int?lcd_hgt?=?0; /**
int?sock?=?-1; /**
評(píng)論
共有 條評(píng)論