/*
Filename   : sys.h
Description: define system reserved const and procedure
*/ 

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//system reserved const

#define true  1
#define false 0

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//system reserved procedure ('extern' mean function body is not implemented in this file)

extern long    Now();           // get current location of input stream
extern long    TotalLength();   // get total length of input stream

extern void    sysFetchValue(String strCurIdent, dynamic& FetchValue, long locat, DWORD param, bool bMoveLocatPointer);  // get value(simple type or struct type) to 'FetchValue' 
                                                                                                                          // for octet type, the parem = len of bytes should be returned
extern void    sysTranChoiceItem(String strCurIdent, dynamic& curItem, long ElemId);                                      // translate struct whose structId=ElemId, and add to 'curItem'(cur ChoiceItem)

extern string  sysGetEnumComment(long value, String strEnumListName, String strMode/* Or/Equal */, String strDefault);  

extern void    sysAbort(String strCurIdent, String strDescription);

//////////////////////////////////////
//string function
extern string  strFormat(OCTET strFormat, ... );        // this function provide formatted output conversion.
extern long    strlen(OCTET& str, bool bEndWithZero);
extern bool    strGetAt(OCTET& str, long nIdx, char& Ch);

//////////////////////////////////////
extern bool    sysSetTitle(UINT1 TitleN, String strTitle);    // set message title information


//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//default virtual procedure, for user to overwrite

//1. For struct's variable item
//
//    type   Translate(String strCurIdent,dynamic& curItem,long nIdxInArr);  // strCurIdent: current VariableNameString ( such as structname.varname, for system trace )
//                                                                           // curItem    : current item to translate, if it's an array variable, curItem mean ThisVariable[nIdxInArr]
//                                                                           // nIdxInArr  : current item's index in ThisVariable
//    string Dump(dynamic& curItem);                                         // for Number, double, octet type 
//    dumpOf enumName (Or/Equal)                                             // only for Number type
//
//   
//2. For integrated struct
//
//    type   Integrate(String strCurIdent);     // strCurIdent: current VariableNameString ( such as structname.varname ) who is typeOf the integrated struct
//    string Dump();                            // for Number, double, octet type



