#define MSWINDOWS_DLL
#ifdef MSWINDOWS_DLL
#ifdef __cplusplus
#define EXPORT extern "C"  __declspec(dllexport)
#define STDCALL
#else
#define EXPORT  __declspec(dllexport)
#define STDCALL
#endif
#else
#define EXPORT extern "C"
#define STDCALL
#endif


//#define MSWINDOWS_VB_DLL
#ifdef MSWINDOWS_VB_DLL

#ifdef __cplusplus
#define EXPORT extern "C"  
#define STDCALL _stdcall
#else
#define EXPORT 
#define STDCALL _stdcall
#endif
#else
#define STDCALL
#define EXPORT extern "C"
#endif







EXPORT  int STDCALL InetSql_ExecSql(char *cmdstring);
EXPORT long  STDCALL  InetSql_CurrentQueryRowCount(void);
EXPORT unsigned long   STDCALL  InetSql_GetRunTimeQueryItems(void);
EXPORT unsigned long  STDCALL  InetSql_StartInternetSql(char *dbhomedir,char *serverip,char * serverport);
EXPORT long   STDCALL InetSql_StopInternetSql( unsigned long startid);

EXPORT long STDCALL  InetSql_LoadSqlScript(char *scriptfilename,
				 char *logfilename ,
				 int stopinerror,
				 int stoplog,
				 int stopdisplay,
				 long displayfunc,
				 long userfunc);
EXPORT void STDCALL  InetSql_EnableSingleStepSqlScript(void);
EXPORT void STDCALL  InetSql_DisableSingleStepSqlScript(void);
EXPORT void STDCALL  InetSql_StartSqlScript(void);
EXPORT void STDCALL  InetSql_StopSqlScript(void);
EXPORT void STDCALL  InetSql_QuitSqlScript(void);
EXPORT long  STDCALL  InetSql_GetRunTimeQueryCount(void);
EXPORT long   STDCALL InetSql_GetRunTimeQueryRowLength(void);
EXPORT long   STDCALL InetSql_GetQueryItemsCount(unsigned long itemlist);
 

EXPORT char *  STDCALL  InetSql_AllTrim(char *buf);
EXPORT char *  STDCALL  InetSql_Ltrim(char *buf);
EXPORT char *  STDCALL  InetSql_Rtrim(char *buf);


EXPORT unsigned long  STDCALL  InetSql_GetQueryResultObject(void);

EXPORT long  STDCALL  InetSql_GetQueryResultCount( unsigned long qry);
EXPORT long STDCALL   InetSql_GetQueryResultRowLength(unsigned long qry);
EXPORT unsigned long  STDCALL   InetSql_GetQueryResultRow(unsigned long qry,long rowno);
EXPORT unsigned long  STDCALL    InetSql_GetQueryResultItems(unsigned long qry);

EXPORT void  STDCALL  InetSql_FreeQueryResultObject(unsigned long *);
EXPORT void  STDCALL  InetSql_FreeCurrentQueryResultObject(void);

EXPORT char   STDCALL   InetSql_CopyItemString(unsigned long qitemlist,char * fieldname,char *buffer);
EXPORT char     STDCALL InetSql_GetItem(unsigned long qitemlist,char *fieldname,char  *buffer);
EXPORT char   *  STDCALL  InetSql_GetItemString(unsigned long qitemlist,char *fieldname);
EXPORT long      STDCALL InetSql_GetItemInt(unsigned long qitemlist,char *fieldname);
EXPORT double  STDCALL  InetSql_GetItemDouble(unsigned long qitemlist,char *fieldname);

EXPORT char  STDCALL   InetSql_CopyItemStringByFieldNo(unsigned long qitemlist,int fieldno,char *buffer);
EXPORT char  STDCALL    InetSql_GetItemByFieldNo(unsigned long qitemlist,int fieldno,char  *buffer);
EXPORT char   * STDCALL  InetSql_GetItemStringByFieldNo(unsigned long qitemlist,int fieldno);
EXPORT long    STDCALL  InetSql_GetItemIntByFieldNo(unsigned long qitemlist,int fieldno);
EXPORT double STDCALL   InetSql_GetItemDoubleByFieldNo(unsigned long qitemlist,int fieldno);


EXPORT char *  STDCALL InetSql_GetItemNameByFieldNo(unsigned long rec,int itemno);
EXPORT char   STDCALL  InetSql_GetItemTypeByFieldNo(unsigned long rec,int itemno);
EXPORT long   STDCALL  InetSql_GetItemLengthByFieldNo(unsigned long rec,int itemno);
EXPORT long   STDCALL  InetSql_GetItemDecPosByFieldNo(unsigned long rec,int itemno);

EXPORT char   STDCALL  InetSql_GetItemType(unsigned long rec,char *fieldname);
EXPORT long  STDCALL   InetSql_GetItemLength(unsigned long rec,char *fieldname);
EXPORT long   STDCALL  InetSql_GetItemDecPos(unsigned long rec,char *fieldname);
EXPORT long    STDCALL InetSql_GetItemNo(unsigned long rec,char *fieldname);
EXPORT  void  STDCALL  InetSql_InstallQueryFunction(long  queryfunction );


 
EXPORT int  STDCALL  InetSql_ThisYear(void);
EXPORT int  STDCALL  InetSql_ThisDay(void);
EXPORT int  STDCALL  InetSql_ThisWeek(void);
EXPORT int STDCALL   InetSql_ThisCentury(void);
EXPORT int   STDCALL InetSql_ThisMonth(void);
EXPORT char * STDCALL  InetSql_GetSystemDateUS(char *string);
EXPORT char * STDCALL  InetSql_GetSystemDateEnglish(char *string);
EXPORT int  STDCALL  InetSql_EscapeSingleQuote(char *in,char *out);
EXPORT void  STDCALL  InetSql_NoNetworkMode(void);
EXPORT void  STDCALL  InetSql_NetworkMode(void);
EXPORT void STDCALL InetSql_DisableMessage(void);
EXPORT void STDCALL InetSql_EnableMessage(void);
EXPORT int   STDCALL InetSql_InitNetwork(void);
EXPORT void STDCALL   InetSql_SetServerIP(long ipaddr);
EXPORT void   STDCALL InetSql_SetServerPort(int port);
EXPORT long   STDCALL  InetSql_GetServerIP(void);
EXPORT long   STDCALL InetSql_GetServerPort(void);
EXPORT char *   STDCALL InetSql_GetHomeDir(void);
EXPORT int  STDCALL  InetSql_SetHomeDir(char *buf);


EXPORT unsigned long  STDCALL InetSql_GetQueryRow(unsigned long qry,long rowno);
EXPORT unsigned long  STDCALL InetSql_GetQueryItems(unsigned long qry);
EXPORT unsigned long STDCALL  InetSql_GetCursorRow(unsigned long qry,long rowno);
EXPORT unsigned long STDCALL  InetSql_GetCursorItems(unsigned long qry);
EXPORT int STDCALL InetSql_MoveRow(unsigned long qry ,long from,long to);
EXPORT  int STDCALL InetSql_SwapRow(unsigned long qry, long from,long to);
EXPORT int STDCALL  InetSql_SendDeleteCursorMessageToServer(unsigned long qryobject);
EXPORT unsigned long  STDCALL InetSql_GetCursorRowFromServer(long qry,long i);

#if 0
CURSOR GetQueryCursor(void);
void ReleaseCursor(CURSOR *cursor);
long GetCursorRowCount(CURSOR cursor);
long GetCursorRowLength(CURSOR cursor);
CURSORROW  GetCursorRow(CURSOR cursor,long rowno);
int GetCursorField(CURSORROW cursor_row,char *fieldname,char *value);
int SetCursorField(CURSORROW cursor_row,char *fieldname,char *value);
void ReleaseCursor(void);
char GetCursorFieldType(CURSORROW cursor_row,char *fieldname);
long GetCursorFieldLength(CURSORROW cursor_row,char *fieldname);
long GetCursorFieldDecPos(CURSORROW cursor_row,char *fieldname);
long GetCursorFieldNumber(CURSORROW cursor_row,char *fieldname);
#endif





 