rtEXIStateTable.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007-2009 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00028 #ifndef _RTEXISTATETABLE_H_
00029 #define _RTEXISTATETABLE_H_
00030 
00031 #include "rtexisrc/rtEXIEvent.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 typedef struct {
00038    OSUINT16 eventId;
00039    OSUINT16 stateId;
00040    OSINT16  nextStateIdx;
00041    OSINT16  repStateIdx;
00042    const OSUTF8CHAR* localName;
00043    OSEXIEventType eventType;
00044    OSUINT8 eventCode;
00045    OSUINT8 eventNBits;
00046    OSUINT8 maxEvtCode;
00047    OSUINT32 maxRepeats;
00048 } OSEXIStateTableRecord;
00049 
00050 typedef struct {
00051    const OSEXIStateTableRecord* data;
00052    OSUINT16 rowCount;           /* number of rows in table */
00053    OSUINT16 currEvtId;          /* current event ID */
00054    OSINT16  currIdx;            /* current state index */
00055    OSINT16  pushedIdx;
00056 } OSEXIStateTable;
00057 
00058 /* Special state index constants */
00059 #define OSEXI_XSITYPE_STX       16000
00060 #define OSEXI_XSINIL_STX        16001
00061 
00062 #define IS_XSI_OSEXISTX(stx) \
00063 (stx == OSEXI_XSITYPE_STX || stx == OSEXI_XSINIL_STX)
00064 
00065 /* Null event ID */
00066 #define OSEXINULLEVENTID OSUINT16_MAX
00067 
00076 EXTERNEXI OSEXIStateTable* rtEXINewStateTable (OSCTXT* pctxt, 
00077  const OSEXIStateTableRecord* pStabRecArray, OSUINT16 numStabRecs);
00078 
00095 EXTERNEXI void rtEXIInitStateTableRecord 
00096 (OSEXIStateTableRecord* pRecord, OSUINT16 eventId, OSUINT16 stateId, 
00097  OSINT16 nextStateIdx, OSINT16 repStateIdx, const OSUTF8CHAR* localName, 
00098  OSEXIEventType eventType, OSUINT8 eventCode, OSUINT8 eventNBits, 
00099  OSUINT8 maxEvtCode, OSUINT32 maxRepeats);
00100 
00109 EXTERNEXI OSINT16 rtEXIStateTransition (OSCTXT* pctxt);
00110 
00111 EXTERNEXI OSINT16 rtEXISkipRepeatGroup (OSCTXT* pctxt);
00112 
00113 EXTERNEXI OSINT16 rtEXIStateProcRepeat (OSCTXT* pctxt, OSUINT32* pRepCount);
00114 
00124 EXTERNEXI OSINT16 rtEXILookupEventInState (OSCTXT* pctxt, OSUINT16 eventId);
00125 
00135 EXTERNEXI OSINT16 rtEXILookupEventTypeInState 
00136 (OSCTXT* pctxt, OSEXIEventType eventType);
00137 
00138 #ifdef __cplusplus
00139 }
00140 #endif
00141 
00142 #endif