exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
sTables.h File Reference

Functions describing EXI sting tables operations. More...

#include "procTypes.h"
#include "errorHandle.h"

Go to the source code of this file.

Macros

#define DEFAULT_VALUE_ENTRIES_NUMBER   50
 
#define DEFAULT_URI_ENTRIES_NUMBER   4
 
#define DEFAULT_PFX_ENTRIES_NUMBER   1
 
#define DEFAULT_LN_ENTRIES_NUMBER   10
 
#define DEFAULT_VX_ENTRIES_NUMBER   10
 
#define GET_LN_P_URI_QNAME(uriTable, qnameID)   ((uriTable)->uri[(qnameID).uriId].lnTable.ln[(qnameID).lnId])
 
#define GET_LN_URI_QNAME(uriTable, qnameID)   ((uriTable).uri[(qnameID).uriId].lnTable.ln[(qnameID).lnId])
 
#define GET_LN_P_URI_P_QNAME(uriTable, qnameID)   ((uriTable)->uri[(qnameID)->uriId].lnTable.ln[(qnameID)->lnId])
 
#define GET_LN_URI_P_QNAME(uriTable, qnameID)   ((uriTable).uri[(qnameID)->uriId].lnTable.ln[(qnameID)->lnId])
 
#define GET_LN_P_URI_IDS(uriTable, uriId, lnId)   ((uriTable)->uri[uriId].lnTable.ln[lnId])
 
#define GET_LN_URI_IDS(uriTable, uriId, lnId)   ((uriTable).uri[uriId].lnTable.ln[lnId])
 

Functions

errorCode createValueTable (ValueTable *valueTable)
 Creates fresh empty ValueTable (value partition of EXI string table) This operation includes allocation of memory for DEFAULT_VALUE_ENTRIES_NUMBER number of value entries. More...
 
errorCode addUriEntry (UriTable *uriTable, String uriStr, SmallIndex *uriEntryId)
 Add new row into the URI string table. More...
 
errorCode addLnEntry (LnTable *lnTable, String lnStr, Index *lnEntryId)
 Add new row into the Local-Names string table. More...
 
errorCode addValueEntry (EXIStream *strm, String valueStr, QNameID qnameID)
 Add a new row into the Global ValueTable string table and Local value cross string table. More...
 
errorCode addPfxEntry (PfxTable *pfxTable, String pfxStr, SmallIndex *pfxEntryId)
 Add a new entry into the Prefix string table. More...
 
errorCode createUriTableEntry (UriTable *uriTable, const String uri, int createPfx, const String pfx, const String *lnBase, Index lnSize)
 Create an initial string table entry Create an initial string table entry, including URI, prefix and local name partitions. More...
 
errorCode createUriTableEntries (UriTable *uriTable, boolean withSchema)
 Create all string table partitions for a URI table It also inserts the default entries in the table. More...
 
boolean lookupUri (UriTable *uriTable, String uriStr, SmallIndex *uriEntryId)
 Search the URI table for a particular string value Implements full scan. More...
 
boolean lookupLn (LnTable *lnTable, String lnStr, Index *lnEntryId)
 Search the local names table for a particular string value Implements full scan RCC 20120201: Try to optimize? More...
 
boolean lookupPfx (PfxTable *pfxTable, String pfxStr, SmallIndex *pfxEntryId)
 Search the Prefix table for a particular string value Implements full scan. More...
 
boolean lookupValue (ValueTable *valueTable, String valueStr, Index *valueEntryId)
 Search the global Value table for a particular string value Implements full scan when opts->valuePartitionCapacity < DEFAULT_VALUE_ROWS_NUMBER Hash search otherwise. More...
 

Detailed Description

Date
Sep 14, 2010
Author
Rumen Kyusakov
Version
0.5
[Revision] $Id: sTables.h 352 2014-11-25 16:37:24Z kjussakov $

Definition in file sTables.h.

Macro Definition Documentation

#define DEFAULT_LN_ENTRIES_NUMBER   10

Definition at line 26 of file sTables.h.

#define DEFAULT_PFX_ENTRIES_NUMBER   1

Definition at line 25 of file sTables.h.

#define DEFAULT_URI_ENTRIES_NUMBER   4

Definition at line 24 of file sTables.h.

#define DEFAULT_VALUE_ENTRIES_NUMBER   50

Definition at line 23 of file sTables.h.

#define DEFAULT_VX_ENTRIES_NUMBER   10

Definition at line 27 of file sTables.h.

#define GET_LN_P_URI_IDS (   uriTable,
  uriId,
  lnId 
)    ((uriTable)->uri[uriId].lnTable.ln[lnId])

Definition at line 42 of file sTables.h.

#define GET_LN_P_URI_P_QNAME (   uriTable,
  qnameID 
)    ((uriTable)->uri[(qnameID)->uriId].lnTable.ln[(qnameID)->lnId])

Definition at line 36 of file sTables.h.

#define GET_LN_P_URI_QNAME (   uriTable,
  qnameID 
)    ((uriTable)->uri[(qnameID).uriId].lnTable.ln[(qnameID).lnId])

Definition at line 30 of file sTables.h.

#define GET_LN_URI_IDS (   uriTable,
  uriId,
  lnId 
)    ((uriTable).uri[uriId].lnTable.ln[lnId])

Definition at line 45 of file sTables.h.

#define GET_LN_URI_P_QNAME (   uriTable,
  qnameID 
)    ((uriTable).uri[(qnameID)->uriId].lnTable.ln[(qnameID)->lnId])

Definition at line 39 of file sTables.h.

#define GET_LN_URI_QNAME (   uriTable,
  qnameID 
)    ((uriTable).uri[(qnameID).uriId].lnTable.ln[(qnameID).lnId])

Definition at line 33 of file sTables.h.

Function Documentation

errorCode addLnEntry ( LnTable lnTable,
String  lnStr,
Index lnEntryId 
)
Parameters
[out]lnTableLocal Names string table partition
[in]lnStrThe string representing this local name. The String can be allocated on the stack.
[out]lnEntryIdthe ID of the LnEntry added
Returns
Error handling code

Definition at line 182 of file sTables.c.

errorCode addPfxEntry ( PfxTable pfxTable,
String  pfxStr,
SmallIndex pfxEntryId 
)
Parameters
[in,out]pfxTablePrefix string table partition
[in]pfxStrThe string representing this prefix. The String can be allocated on the stack.
[out]pfxEntryIdthe ID of the PfxEntry added
Returns
Error handling code

Definition at line 293 of file sTables.c.

errorCode addUriEntry ( UriTable uriTable,
String  uriStr,
SmallIndex uriEntryId 
)
Parameters
[in,out]uriTableURI string table partition
[in]uriStrThe string representing this URI. The String can be allocated on the stack.
[out]uriEntryIdThe ID of the UriEntry added
Returns
Error handling code

Definition at line 161 of file sTables.c.

errorCode addValueEntry ( EXIStream strm,
String  valueStr,
QNameID  qnameID 
)
Parameters
[in,out]strmEXI stream of bits
[in]valueStrThe string representing this global value. The String can be allocated on the stack.
[in]qnameIDThe URI:ln QNameID
Returns
Error handling code

Definition at line 200 of file sTables.c.

errorCode createUriTableEntries ( UriTable uriTable,
boolean  withSchema 
)

Because the behavior depends on the EXI options of the stream it is important that the options are initialized before calling this function.

Parameters
[in,out]uriTableAn empty UriTable; The memory must be already allocated for it
[in]withSchemaTRUE if there is schema for this stream; FALSE otherwise; Can be retrieved from strm->opts->schemaID != NULL
Returns
Error handling code

Definition at line 332 of file sTables.c.

errorCode createUriTableEntry ( UriTable uriTable,
const String  uri,
int  createPfx,
const String  pfx,
const String lnBase,
Index  lnSize 
)
Parameters
[in,out]uriTableURI string table partition
[in]urinamespace string
[in]createPfxTRUE if prefix table to be created, FALSE otherwise
[in]pfxprefix string
[in]lnBaseCharacter array representing array of local names, or NULL if not present
[in]lnSizeNumber of local names in array at lnBase
Returns
Error handling code

Definition at line 307 of file sTables.c.

errorCode createValueTable ( ValueTable valueTable)
Parameters
[in,out]valueTableValueTable string table partition
Returns
Error handling code

Definition at line 148 of file sTables.c.

boolean lookupLn ( LnTable lnTable,
String  lnStr,
Index lnEntryId 
)
Parameters
[in]lnTableLocal names table to be searched
[in]lnStrThe local name string searched for
[out]lnEntryIdif found, ID of the LnEntry with that string
Returns
FALSE-not found, TRUE found

Definition at line 396 of file sTables.c.

boolean lookupPfx ( PfxTable pfxTable,
String  pfxStr,
SmallIndex pfxEntryId 
)
Parameters
[in]pfxTablePrefix table to be searched
[in]pfxStrThe string searched for
[out]pfxEntryIdif found, ID of the Prefix row with that string
Returns
FALSE-not found, TRUE found

Definition at line 413 of file sTables.c.

boolean lookupUri ( UriTable uriTable,
String  uriStr,
SmallIndex uriEntryId 
)
Parameters
[in]uriTableURI table to be searched
[in]uriStrThe string searched for
[out]uriEntryIdIf found, ID of the UriEntry with that string
Returns
FALSE-not found, TRUE found

Definition at line 378 of file sTables.c.

boolean lookupValue ( ValueTable valueTable,
String  valueStr,
Index valueEntryId 
)
Parameters
[in]valueTableGlobal Value table to be searched
[in]valueStrThe string searched for
[out]valueEntryIdif found, ID of the ValueEntry with that string
Returns
FALSE-not found, TRUE found

Definition at line 454 of file sTables.c.