From 2c7187de39b1e731057b47752e3989a954acffb8 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 18 Oct 2005 16:10:18 +0000 Subject: begin implementing BSD-style program blocks --- rfc3195d.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'rfc3195d.c') diff --git a/rfc3195d.c b/rfc3195d.c index aa5da7b5..25662047 100644 --- a/rfc3195d.c +++ b/rfc3195d.c @@ -51,7 +51,7 @@ static char* pPathLogname = "/dev/log3195"; static char *PidFile; static int NoFork = 0; static int Debug = 0; -static int listenPort = 0; +static int listenPort = 601; /* we use a global API object below, because this listener is * not very complex. As such, this hack should not harm anything. @@ -167,8 +167,13 @@ void OnReceive(srAPIObj* pAPI, srSLMGObj* pSLMG) } } - if(Debug) - printf("Msg:%s\n\n", pszRawMsg); + if(Debug) { + static int largest = 0; + int sz = strlen(pszRawMsg); + if(sz > largest) + largest = sz; + printf("Msg(%d/%d):%s\n\n", largest, sz, pszRawMsg); + } } @@ -183,6 +188,8 @@ void doShutdown(int i) srAPIShutdownListener(pAPI); } + +/* on the the real program ;) */ int main(int argc, char* argv[]) { srRetVal iRet; @@ -235,7 +242,6 @@ int main(int argc, char* argv[]) exit(1); } -printf("Setting listen port %d\n", listenPort); if((iRet = srAPISetOption(pAPI, srOPTION_BEEP_LISTENPORT, listenPort)) != SR_RET_OK) { printf("Error %d setting listen port - aborting\n", iRet); -- cgit