liberipc/include/eripcsetup.h File Reference

liberipc - specifics to IPC with setup application More...

#include "eripcclient.h"

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  eCcSt { ccStGotoPage = 0, ccStUndefined }

Functions

int stParseCommand (char *szCommand, erIpcCmd_t *pCmd)
int stGotoPage (erClientChannel_t channel, int page)


Detailed Description

liberipc - specifics to IPC with setup application

<File description>="">

Definition in file eripcsetup.h.


Enumeration Type Documentation

enum eCcSt

Enumerator:
ccStGotoPage 
ccStUndefined 

Definition at line 41 of file eripcsetup.h.

00041              {
00042     ccStGotoPage = 0,
00043     ccStUndefined
00044 } eCcSt;


Function Documentation

int stGotoPage ( erClientChannel_t  channel,
int  page 
)

Go to page 'page' of the current document displayed in the viewer 'uaID'

Parameters:
channel,: Opaque datastructure that contains info on communication channel
page,: page number
Returns:
A value of 0 signals success
Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.

Definition at line 39 of file eripcsetup.c.

00040 {
00041     erIpcCmd_t cmd;
00042 
00043     strcpy(cmd.name, "stGotoPage");
00044     cmd.cc = (int) ccStGotoPage;
00045     cmd.nArg = 1;
00046     sprintf(cmd.arg[0], "%d", page);
00047 
00048     return erIpcSndCommand(channel, &cmd);
00049 }

Here is the call graph for this function:

int stParseCommand ( char *  szCommand,
erIpcCmd_t pCmd 
)

Definition at line 55 of file eripcsetup.c.

00056 {
00057     int     i;
00058     char   *pChar;
00059     char    szToken[TB_MAXCHARONLINE];
00060     int     nReqArgs = 0;
00061 
00062     pCmd->cc = (int) ccStUndefined;
00063     for (i = 0; i < TB_N_ARG; i++)
00064     {
00065         strcpy(pCmd->arg[i], "");
00066     }
00067 
00068     // Parse Command
00069     pChar = szCommand;
00070     i = 0;
00071     while (*pChar != '\0')
00072     {
00073         szToken[i] = '\0';
00074         if (*pChar == ',')
00075         {
00076             pChar++;
00077             break;
00078         }
00079         szToken[i] = *pChar++;
00080         i++;
00081         szToken[i] = '\0';
00082     }
00083 
00084     // We have found the command Token. Figure out what the command is.
00085 
00086     // TODO: stop doing this hardcoded, rely on a smart datastructure instead.
00087 
00088     if (!strcmp(szToken, "stGotoPage") || !strcmp(szToken, "0"))
00089     {
00090         strcpy(pCmd->name, szToken);
00091         pCmd->cc = (int) ccStGotoPage;
00092         nReqArgs = 1;
00093         pCmd->nArg = 1;
00094     }
00095     else
00096     {
00097         strcpy(pCmd->name, "Undefined");
00098         pCmd->cc = (int) ccStUndefined;
00099         fprintf(stderr, "%s: Command %s \n", __FUNCTION__, szToken);
00100         fprintf(stderr, "Error parsing (%s). Command undefined\n", szCommand);
00101         pCmd->nArg = -1;
00102         return -1;
00103     }
00104 
00105     if (nReqArgs > 0)
00106     {
00107         erIpcGetArgs(pChar, pCmd, nReqArgs);
00108     }
00109     return 0;
00110 }

Here is the call graph for this function:


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