liberipc/test/clientTest.c File Reference

#include <stdio.h>
#include <eripc.h>
#include <eripcclient.h>
#include <eripctoolbar.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>

Go to the source code of this file.

Functions

 main ()


Function Documentation

main (  ) 

Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.

Definition at line 38 of file clientTest.c.

00039 {
00040     erClientChannel_t channel;
00041     char    szBuffer[TB_MAXCHARONLINE];
00042     erIpcCmd_t  cmd;
00043     int     nRet;
00044 
00045     printf("Starting clientTest.\n");
00046 
00047     erIpcStartClient(ER_TEST_CHANNEL, &channel);
00048 
00049     // This test program reads from the keyboard and sends the interactive messages.
00050     while (fgets(szBuffer, TB_MAXCHARONLINE, stdin) != NULL)
00051     {
00052         int     nLen;
00053 
00054         // lineNr++;
00055 
00056         if (szBuffer[0] == '#')
00057         {
00058             // Ignore a comment line;
00059             continue;
00060         }
00061         // Strip the newline
00062         nLen = strlen(szBuffer);
00063         if (nLen > 0)
00064         {
00065             if (szBuffer[nLen - 1] == '\n')
00066             {
00067                 szBuffer[nLen - 1] = '\0';
00068             }
00069         }
00070 
00071         // Ignore empty lines
00072         if (nLen != 0)
00073         {
00074             nRet = tbParseCommand(szBuffer, &cmd);
00075             if ( nRet >= 0 )
00076               {
00077                 erIpcSndCommand(channel, &cmd);
00078               }
00079         }
00080     }
00081 
00082 
00083 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:11:48 2008 by  doxygen 1.5.6