home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / iapp300.zip / INCLUDE / IAPP.H
Text File  |  1995-03-01  |  42KB  |  937 lines

  1. /************************************************************************/
  2. /*                    IApp Header File                                                          */
  3. /************************************************************************/
  4. /* Function        Declarations used by the IApp functions.                        */
  5. /* Author        (c) Copyright Infoline AG 1990-1995                                */
  6. /*                    Schaffhauserstrasse 121                                                */
  7. /*                    CH-8302 Kloten - Switzerland                                        */
  8. /*                    Phone: +41 1 803 07 06 / Fax: +41 1 881 17 55                */
  9. /* Last Update    V3.00 01/Mar/1995 Andy Brunner     Chg: Commercial release    */
  10. /************************************************************************/
  11.  
  12. /*----------------------------------------------------------------------*/
  13. /*                    32Bit Compiler: Definition for 32->16 bit thunking layer    */
  14. /*----------------------------------------------------------------------*/
  15.  
  16. #ifdef    IAPP32
  17.     #define    IAPP_SEG16    _Seg16
  18.     #define    IAPP_API        _Far16 _Pascal
  19.     #define    IAPP_API_C    _Far16 _Cdecl
  20. #endif
  21.  
  22. #ifndef    IAPP32
  23.     #define    IAPP_SEG16
  24.     #define    IAPP_API        far pascal _loadds
  25.     #define    IAPP_API_C    far cdecl _loadds
  26. #endif
  27.  
  28. #define    IAPP_BOOL    USHORT
  29.  
  30. /************************************************************************/
  31. /*                    Base Functions                                                              */ 
  32. /************************************************************************/
  33.  
  34. /*----------------------------------------------------------------------*/
  35. /* IAppAbortProgram                    Abort process with full-screen popup      */
  36. /*----------------------------------------------------------------------*/
  37.  
  38. VOID IAPP_API IAppAbortProgram(    /* No return value                            */
  39.         PSZ        pszMessage);        /* Popup message or NULL                      */
  40.  
  41. /*----------------------------------------------------------------------*/
  42. /* IAppAllocMemory                    Allocate storage from memory pool        */
  43. /*----------------------------------------------------------------------*/
  44.  
  45. IAPP_SEG16 PVOID IAPP_API IAppAllocMemory( /* Pointer to memory            */
  46.         USHORT    usSize,                /* Size of block or 0 for full 64KB        */
  47.         USHORT    usType);                /* Type (0=Private, 1=System-Shared)    */
  48.  
  49. /*----------------------------------------------------------------------*/
  50. /* IAppBeep                                Sound speeker                                    */
  51. /*----------------------------------------------------------------------*/
  52.  
  53. VOID IAPP_API IAppBeep(                /* No return value                            */
  54.         VOID);                            /* No parameters supported                      */
  55.  
  56. /*----------------------------------------------------------------------*/
  57. /* IAppDateConversion                Convert date to various formats               */
  58. /*----------------------------------------------------------------------*/
  59.  
  60. typedef struct _IAPP_DATE
  61. {
  62.     ULONG        ulJulianDay;            /* Returned julian day                        */
  63.     USHORT    usDayOfYear;            /* Returned day of year                        */
  64.     UCHAR        ucDayOfWeek;            /* Returned day of week (0 = Sun)        */
  65. } IAPP_DATE;
  66.  
  67. typedef IAPP_DATE FAR *P_IAPP_DATE;
  68.  
  69. BOOL IAPP_API IAppDateConversion(
  70.         USHORT    usYear,                /* Passed year                                    */
  71.         UCHAR        ucMonth,                /* Passed month                                */
  72.         UCHAR        ucDay,                /* Passed day                                    */
  73.         P_IAPP_DATE    pxDate);            /* Structure with returned data            */
  74.  
  75. /*----------------------------------------------------------------------*/
  76. /* IAppDateFromJulian                Convert date from julian day                   */
  77. /*----------------------------------------------------------------------*/
  78.  
  79. BOOL IAPP_API IAppDateFromJulian( /* TRUE=Success or FALSE=Invalid date    */
  80.         ULONG        ulJulian,            /* Passed julian day                            */
  81.         PUSHORT    pusYear,                /* Returned year                                 */
  82.         PUCHAR    pucMonth,             /* Returned month                                  */
  83.         PUCHAR    pucDay);                /* Returned day                                  */
  84.  
  85. /*----------------------------------------------------------------------*/
  86. /* IAppDateTime                        Format system date and system time           */
  87. /*----------------------------------------------------------------------*/
  88.  
  89. VOID IAPP_API IAppDateTime(        /* No return value                            */
  90.         PUCHAR    pszDate,                /* Date buffer (11 chars) or NULL         */
  91.         PUCHAR    pszTime);            /* Time buffer (9 chars) or NULL             */
  92.  
  93. /*----------------------------------------------------------------------*/
  94. /* IAppDisableBreak                    Disable or enable Ctrl-Break/Ctrl-C        */
  95. /*----------------------------------------------------------------------*/
  96.  
  97. VOID IAPP_API IAppDisableBreak(    /* No return value                            */
  98.         IAPP_BOOL fFlag);                /* TRUE=Disable or FALSE=Enable              */
  99.  
  100. /*----------------------------------------------------------------------*/
  101. /* IAppDisableKill                    Disable or enable process kill            */
  102. /*----------------------------------------------------------------------*/
  103.  
  104. VOID IAPP_API IAppDisableKill(    /* No return value                            */
  105.         IAPP_BOOL fFlag);                /* TRUE=Disable or FALSE=Enable              */
  106.  
  107. /*----------------------------------------------------------------------*/
  108. /* IAppFileClose                        Close file                                        */
  109. /*----------------------------------------------------------------------*/
  110.  
  111. VOID IAPP_API IAppFileClose(        /* No return value                            */
  112.         HFILE        hFile);                /* File handle                                      */
  113.  
  114. /*----------------------------------------------------------------------*/
  115. /* IAppFileCommit                        Flush file buffer(s)                            */
  116. /*----------------------------------------------------------------------*/
  117.  
  118. VOID IAPP_API IAppFileCommit(        /* No return value                            */
  119.         HFILE        hFile);                /* File handle or 0xffff for all files    */
  120.  
  121. /*----------------------------------------------------------------------*/
  122. /* IAppFileDelete                        Delete file                                        */
  123. /*----------------------------------------------------------------------*/
  124.  
  125. VOID IAPP_API IAppFileDelete(        /* No return value                            */
  126.         PUCHAR    pszFileName);        /* File name                                    */
  127.  
  128. /*----------------------------------------------------------------------*/
  129. /* IAppFileInformation                Obtain file information                        */
  130. /*----------------------------------------------------------------------*/
  131.  
  132. typedef struct _IAPP_FILE_INFO
  133. {
  134.     ULONG        ulAllocated;            /* Allocated file size                         */
  135.     ULONG        ulSize;                    /* Used file size                                 */
  136.     USHORT    usAttribute;            /* File attributes                             */
  137.                                     
  138.     struct
  139.     {
  140.         USHORT    usYear;                /* Year of creation                             */
  141.         UCHAR        ucMonth;                /* Month of creation                             */
  142.         UCHAR        ucDay;                 /* Day of creation                             */
  143.         UCHAR        ucHours;                /* Hours of creation                            */
  144.         UCHAR        ucMinutes;            /* Minutes of creation                        */
  145.         UCHAR        ucSeconds;            /* Seconds of creation                        */
  146.     } Create;
  147.  
  148.     struct
  149.     {
  150.         USHORT    usYear;                /* Year of last write                          */
  151.         UCHAR        ucMonth;                /* Month of last write                          */
  152.         UCHAR        ucDay;                /* Day of last write                              */
  153.         UCHAR        ucHours;                /* Hours of last write                          */
  154.         UCHAR        ucMinutes;            /* Minutes of last write                      */
  155.         UCHAR        ucSeconds;            /* Seconds of last write                      */
  156.     } Write;
  157.  
  158.     struct
  159.     {
  160.         USHORT    usYear;                /* Year of last access                          */
  161.         UCHAR        ucMonth;                /* Month of last access                          */
  162.         UCHAR        ucDay;                 /* Day of last access                          */
  163.         UCHAR        ucHours;                /* Hours of last access                           */
  164.         UCHAR        ucMinutes;            /* Minutes of last access                       */
  165.         UCHAR        ucSeconds;            /* Seconds of last access                       */
  166.     } Access;
  167.  
  168. } IAPP_FILE_INFO;
  169.  
  170. typedef IAPP_FILE_INFO FAR *P_IAPP_FILE_INFO;
  171.  
  172. BOOL IAPP_API IAppFileInformation( /* TRUE=Success or FALSE=Not found    */
  173.         PUCHAR    pszFileName,        /* File name                                     */
  174.         P_IAPP_FILE_INFO pInf);        /* File information                            */
  175.  
  176. /*----------------------------------------------------------------------*/
  177. /* IAppFileOpen                        Open file                                        */
  178. /*----------------------------------------------------------------------*/
  179.  
  180. HFILE IAPP_API IAppFileOpen(        /* Handle or -1 if flag = FALSE            */
  181.         PUCHAR    pszFileName,        /* File name                                      */
  182.         UCHAR        cType);                /* (R)ead, (W)rite, (A)ppend, (U)pdate    */
  183.                                             /* or (N) for deny-none read.                */
  184.  
  185. /*----------------------------------------------------------------------*/
  186. /* IAppFileRead                        Read file                                        */
  187. /*----------------------------------------------------------------------*/
  188.  
  189. USHORT IAPP_API IAppFileRead(        /* Length of block read or 0 for EOF    */
  190.         HFILE        hFile,                /* File handle                                     */
  191.         PVOID        bBuffer,                /* Buffer                                         */
  192.         USHORT    usBufferSize);        /* Size of buffer                                 */
  193.  
  194. /*----------------------------------------------------------------------*/
  195. /* IAppFileSearch                        Search file (current dir and DPATH)        */
  196. /*----------------------------------------------------------------------*/
  197.  
  198. BOOL IAPP_API IAppFileSearch(        /* TRUE=Success or FALSE=Not found        */
  199.         PUCHAR    pszFileName,        /* File name                                      */
  200.         PUCHAR    pszFoundPath);        /* Found path (260 characters)            */
  201.  
  202. /*----------------------------------------------------------------------*/
  203. /* IAppFileSetPosition                Set file position                                */
  204. /*----------------------------------------------------------------------*/
  205.  
  206. #define    IAPP_FILE_BEGIN    0L
  207. #define    IAPP_FILE_END      -1L
  208.  
  209. VOID IAPP_API IAppFileSetPosition( /* No return value                            */
  210.         HFILE        hFile,                /* File handle                                      */
  211.         LONG        lPosition);            /* File position                                 */
  212.  
  213. /*----------------------------------------------------------------------*/
  214. /* IAppFileWrite                        Write file                                        */
  215. /*----------------------------------------------------------------------*/
  216.  
  217. VOID IAPP_API IAppFileWrite(        /* No return value                            */
  218.         HFILE        hFile,                /* File handle                                     */
  219.         PVOID        bBuffer,                /* Buffer                                         */
  220.         USHORT    usBufferSize);        /* Size of buffer                                 */
  221.  
  222. /*----------------------------------------------------------------------*/
  223. /* IAppFreeMemory                        Free allocated memory from pool            */
  224. /*----------------------------------------------------------------------*/
  225.  
  226. VOID IAPP_API IAppFreeMemory(        /* No return value                            */
  227.         PVOID        pbMemory);            /* Address address to be freed            */
  228.  
  229. /*----------------------------------------------------------------------*/
  230. /* IAppGetCurrentPath                Get current path information                 */
  231. /*----------------------------------------------------------------------*/
  232.  
  233. PUCHAR IAPP_API IAppGetCurrentPath(    /* Complete path                            */
  234.         PUCHAR    pszPath);            /* Complete path                                */
  235.  
  236. /*----------------------------------------------------------------------*/
  237. /* IAppGetLogicalDrives                Get valid logical drives                     */
  238. /*----------------------------------------------------------------------*/
  239.  
  240. PUCHAR IAPP_API IAppGetLogicalDrives( /* Drive buffer                            */
  241.         PUCHAR    pszDrives);            /* Drive buffer (27 characters)            */
  242.  
  243. /*----------------------------------------------------------------------*/
  244. /* IAppGetMessage                        Retrieve message from message library     */
  245. /*----------------------------------------------------------------------*/
  246.  
  247. IAPP_SEG16 PUCHAR IAPP_API IAppGetMessage(    /* Address of buffer            */
  248.         PUCHAR    pszMsgFile,            /* Message library file                        */
  249.         USHORT    usMessageNmbr,        /* Message number                                */
  250.         PUCHAR    pszBuffer,            /* Message buffer                             */
  251.         USHORT    usBufferSize);        /* Size of message buffer                    */
  252.  
  253. /*----------------------------------------------------------------------*/
  254. /*    IAppGetToken                        Return next token from file                 */
  255. /*----------------------------------------------------------------------*/
  256.  
  257. typedef struct _IAPP_GET_TOKEN
  258. {
  259.     UCHAR        szFileName[257];         /* Input file name                            */
  260.     UCHAR        szErrorMsg[257];        /* Error message or "\0" if EOF            */
  261.     UCHAR        szToken[257];            /* Returned token                                */
  262.     ULONG        ulCurrentLine;            /* Current line number                        */
  263.     IAPP_BOOL fEnableComment;        /* Comment flag                                 */
  264. } IAPP_GET_TOKEN;
  265.  
  266. typedef IAPP_GET_TOKEN FAR *P_IAPP_GET_TOKEN;
  267.  
  268. BOOL IAPP_API IAppGetToken(        /* TRUE=Success or FALSE=EOF or error    */
  269.         P_IAPP_GET_TOKEN pBuf);        /* Token structure                            */
  270.  
  271. /*----------------------------------------------------------------------*/
  272. /* IAppIniClose                        Close application .INI file                */
  273. /*----------------------------------------------------------------------*/
  274.  
  275. VOID IAPP_API IAppIniClose(         /* No return value                            */
  276.         PVOID        hIniFile);            /* Handle of .INI file                        */
  277.  
  278. /*----------------------------------------------------------------------*/
  279. /* IAppIniOpen                            Create or open application .INI            */
  280. /*----------------------------------------------------------------------*/
  281.  
  282. PVOID IAPP_API IAppIniOpen(        /* Handle of .INI file                        */
  283.         HAB        habUser,                /* Existing PM anchor block or NULL        */
  284.         PUCHAR    pszIniFile);        /* File name                                    */
  285.  
  286. /*----------------------------------------------------------------------*/
  287. /* IAppIniRead                            Read from .INI file                            */
  288. /*----------------------------------------------------------------------*/
  289.  
  290. #define    IAPP_USRINI        (PVOID) (-1L)
  291. #define    IAPP_SYSINI        (PVOID) (-2L)
  292.  
  293. ULONG IAPP_API IAppIniRead(         /* Address of buffer                            */
  294.         PVOID        hIniFile,            /* IAPP_SYSINI, IAPP_USRINI or handle    */
  295.         PUCHAR    pszApplName,        /* Application name                            */
  296.         PUCHAR    pszKeyName,            /* Key name                                        */
  297.         PBYTE        pbBuffer,            /* Address of buffer to hold data        */
  298.         ULONG        ulBufferLength);    /* Length of buffer                            */
  299.  
  300. /*----------------------------------------------------------------------*/
  301. /* IAppIniWrite                        Write to .INI file                            */
  302. /*----------------------------------------------------------------------*/
  303.  
  304. VOID IAPP_API IAppIniWrite(        /* No return value                            */
  305.         PVOID        hIniFile,            /* IAPP_SYSINI, IAPP_USRINI or handle    */
  306.         PUCHAR    pszApplName,        /* Application name                            */
  307.         PUCHAR    pszKeyName,            /* Key name or NULL to delete all keys    */
  308.         PBYTE        pbBuffer,            /* Address of buffer                            */
  309.         ULONG        ulBufferLength);    /* Length of buffer                            */
  310.  
  311. /*----------------------------------------------------------------------*/
  312. /* IAppKeyboardFlush                    Flush keyboard buffer                           */
  313. /*----------------------------------------------------------------------*/
  314.  
  315. #define IAPP_KBD_BKSP    0x0008
  316. #define IAPP_KBD_RTAB    0x0009
  317. #define IAPP_KBD_ENTER    0x000d
  318. #define IAPP_KBD_ESC        0x001b
  319.  
  320. #define IAPP_KBD_F1        0xf001
  321. #define IAPP_KBD_F2        0xf002
  322. #define IAPP_KBD_F3        0xf003
  323. #define IAPP_KBD_F4        0xf004
  324. #define IAPP_KBD_F5        0xf005
  325. #define IAPP_KBD_F6        0xf006
  326. #define IAPP_KBD_F7        0xf007
  327. #define IAPP_KBD_F8        0xf008
  328. #define IAPP_KBD_F9        0xf009
  329. #define IAPP_KBD_F10        0xf00a
  330. #define IAPP_KBD_F11        0xf00b
  331. #define IAPP_KBD_F12        0xf00c
  332.  
  333. #define IAPP_KBD_SF1        0xf011
  334. #define IAPP_KBD_SF2        0xf012
  335. #define IAPP_KBD_SF3        0xf013
  336. #define IAPP_KBD_SF4        0xf014
  337. #define IAPP_KBD_SF5        0xf015
  338. #define IAPP_KBD_SF6        0xf016
  339. #define IAPP_KBD_SF7        0xf017
  340. #define IAPP_KBD_SF8        0xf018
  341. #define IAPP_KBD_SF9        0xf019
  342. #define IAPP_KBD_SF10    0xf01a
  343. #define IAPP_KBD_SF11    0xf01b
  344. #define IAPP_KBD_SF12    0xf01c
  345.  
  346. #define IAPP_KBD_AF1        0xf021
  347. #define IAPP_KBD_AF2        0xf022
  348. #define IAPP_KBD_AF3        0xf023
  349. #define IAPP_KBD_AF4        0xf024
  350. #define IAPP_KBD_AF5        0xf025
  351. #define IAPP_KBD_AF6        0xf026
  352. #define IAPP_KBD_AF7        0xf027
  353. #define IAPP_KBD_AF8        0xf028
  354. #define IAPP_KBD_AF9        0xf029
  355. #define IAPP_KBD_AF10    0xf02a
  356. #define IAPP_KBD_AF11    0xf02b
  357. #define IAPP_KBD_AF12    0xf02c
  358.  
  359. #define IAPP_KBD_CENTER    0x0a
  360.  
  361. #define IAPP_KBD_CF1        0xf031
  362. #define IAPP_KBD_CF2        0xf032
  363. #define IAPP_KBD_CF3        0xf033
  364. #define IAPP_KBD_CF4        0xf034
  365. #define IAPP_KBD_CF5        0xf035
  366. #define IAPP_KBD_CF6        0xf036
  367. #define IAPP_KBD_CF7        0xf037
  368. #define IAPP_KBD_CF8        0xf038
  369. #define IAPP_KBD_CF9        0xf039
  370. #define IAPP_KBD_CF10    0xf03a
  371. #define IAPP_KBD_CF11    0xf03b
  372. #define IAPP_KBD_CF12    0xf03c
  373.  
  374. #define IAPP_KBD_HOME    0xf041
  375. #define IAPP_KBD_END        0xf042
  376. #define IAPP_KBD_PGUP    0xf043
  377. #define IAPP_KBD_PGDN    0xf044
  378. #define IAPP_KBD_LEFT    0xf045
  379. #define IAPP_KBD_RIGHT    0xf046
  380. #define IAPP_KBD_UP        0xf047
  381. #define IAPP_KBD_DOWN    0xf048
  382.                                     
  383. #define IAPP_KBD_INS        0xf051
  384. #define IAPP_KBD_DEL        0xf052
  385. #define IAPP_KBD_LTAB    0xf053
  386.  
  387. #define IAPP_KBD_CHOME    0xf060
  388. #define IAPP_KBD_CEND    0xf061
  389. #define IAPP_KBD_CPGUP    0xf062
  390. #define IAPP_KBD_CPGDN    0xf063
  391. #define IAPP_KBD_CLEFT    0xf064
  392. #define IAPP_KBD_CRIGHT    0xf065
  393. #define IAPP_KBD_CUP        0xf066
  394. #define IAPP_KBD_CDOWN    0xf067
  395.  
  396. VOID IAPP_API IAppKeyboardFlush(    /* No return value                            */
  397.         VOID);                              /* No arguments supported                    */
  398.  
  399. /*----------------------------------------------------------------------*/
  400. /* IAppKeyboardRead                    Read character from keyboard                  */
  401. /*----------------------------------------------------------------------*/
  402.  
  403. USHORT IAPP_API IAppKeyboardRead( /* Key value                                    */
  404.         VOID);                              /* No arguments supported                     */
  405.  
  406. /*----------------------------------------------------------------------*/
  407. /* IAppMMFClose                        Close memory mapped file                      */
  408. /*----------------------------------------------------------------------*/
  409.  
  410. typedef VOID FAR *IAPP_MMF;        /* Memory mapped file handle                */
  411.  
  412. VOID IAPP_API IAppMMFClose(        /* No return value                            */
  413.         IAPP_MMF    hHandle);            /* Memory mapped file handle                */
  414.  
  415. /*----------------------------------------------------------------------*/
  416. /* IAppMMFDelete                        Delete memory mapped file                       */
  417. /*----------------------------------------------------------------------*/
  418.  
  419. VOID IAPP_API IAppMMFDelete(        /* No return value                            */
  420.         PUCHAR    pszFileName);        /* Name of memory mapped file                */
  421.  
  422. /*----------------------------------------------------------------------*/
  423. /* IAppMMFOpen                            Open memory mapped file                        */
  424. /*----------------------------------------------------------------------*/
  425.  
  426. IAPP_MMF IAPP_API IAppMMFOpen(    /* File handle                                    */
  427.         PUCHAR    pszFileName,        /* Name of memory mapped file                 */
  428.         UCHAR        ucOpenType);        /* 'W' Write, 'R' Read or 'A' Append     */
  429.  
  430. /*----------------------------------------------------------------------*/
  431. /* IAppMMFRead                            Read memory mapped file                          */
  432. /*----------------------------------------------------------------------*/
  433.  
  434. BOOL IAPP_API IAppMMFRead(            /* TRUE=Success or FALSE=End of file    */
  435.         IAPP_MMF    hHandle,                /* Memory mapped file handle                */
  436.         PBYTE        *pbBuffer,            /* Pointer to buffer                             */
  437.         PUSHORT    pusLength);            /* Length of buffer or 0 if EOF            */
  438.  
  439. /*----------------------------------------------------------------------*/
  440. /* IAppMMFSeek                            Set position in memory mapped file        */
  441. /*----------------------------------------------------------------------*/
  442.  
  443. BOOL IAPP_API IAppMMFSeek(            /* TRUE=Success or FALSE=Wrong Record#    */
  444.         IAPP_MMF    hHandle,                /* Memory mapped file handle                 */
  445.         ULONG        ulRecord);            /* Next record number to read                */
  446.  
  447. /*----------------------------------------------------------------------*/
  448. /* IAppMMFWrite                        Write memory mapped file                        */
  449. /*----------------------------------------------------------------------*/
  450.  
  451. VOID IAPP_API IAppMMFWrite(        /* No return value                            */
  452.         IAPP_MMF    hHandle,                /* Memory mapped file handle                */
  453.         PBYTE        pbBuffer,            /* Buffer to write                             */
  454.         USHORT    usLength);            /* Length of buffer                             */
  455.  
  456. /*----------------------------------------------------------------------*/
  457. /* IAppPrintClose                        Close printer                                       */
  458. /*----------------------------------------------------------------------*/
  459.  
  460. typedef struct _IAPP_PRINT
  461. {
  462.     /*-------------------------------------------------------------------*/
  463.     /*    The following fields must be set before calling IAppPrintOpen.        */
  464.     /*    They must not be altered afterwards. The optional header and         */
  465.     /* footer line(s) may contain tags for date, time or page numbers.    */
  466.     /* Those fields must be formatted according to the C sprintf syntax,    */
  467.     /* e.g. #hu (page), @s (date) or s (time).                                    */
  468.     /*-------------------------------------------------------------------*/
  469.     UCHAR        ucPaperLength;             /* Paper length in number of lines         */
  470.     UCHAR        ucPaperWidth;            /* Paper width in number of characters    */
  471.     UCHAR        ucTopMargin;            /* Top margin in number of lines              */
  472.     UCHAR        ucBottonMargin;        /* Botton margin in number of lines          */
  473.     UCHAR        ucLeftMargin;            /* Left margin in number of characters    */
  474.     UCHAR        ucPreHeaderLine;        /* Character for line before header(s)    */
  475.     UCHAR        szHeader[5][256];        /* 0 to 5 header line(s)                      */
  476.     UCHAR        ucPostHeaderLine;        /* Character for line after header(s)     */
  477.     UCHAR        ucPreFooterLine;        /* Character for line before footer(s)    */
  478.     UCHAR        szFooter[5][256];        /* 0 to 5 footer line(s)                       */
  479.     UCHAR        ucPostFooterLine;        /* Character for line after footer(s)     */
  480.     /*-------------------------------------------------------------------*/
  481.     /*    The following fields must not be set or modified by the caller.    */
  482.     /*    They may be read anytime by the application for reference.            */
  483.     /*-------------------------------------------------------------------*/
  484.     USHORT    usCurrentPage;            /* Current page number                          */
  485.     UCHAR        ucCurrentLine;            /* Current line number                          */
  486.     UCHAR        ucTotalLines;            /* Maximum number of lines per page        */
  487.     UCHAR        ucLinesLeft;            /* Number of lines left on this page    */
  488.     HFILE        hPrinter;                /* Device or file handle                      */
  489.     IAPP_MMF    hMMFile;                    /* Memory mapped file handle                  */
  490.     PUCHAR    pMMFBuffer;                /* Memory mapped file buffer                  */
  491. } IAPP_PRINT;
  492.  
  493. typedef IAPP_PRINT FAR *P_IAPP_PRINT;
  494.  
  495. VOID IAPP_API IAppPrintClose(        /* No return value                            */
  496.         P_IAPP_PRINT xControl,        /* Control structure                              */
  497.         PBYTE        pTermCmd,              /* Termination string (not for MMF)        */
  498.         USHORT    usTermLength);        /* Length of termination string            */
  499.  
  500. /*----------------------------------------------------------------------*/
  501. /* IAppPrintLine                        Print line                                           */
  502. /*----------------------------------------------------------------------*/
  503.  
  504. VOID IAPP_API IAppPrintLine(        /* No return value                            */
  505.         P_IAPP_PRINT xControl,        /* Control structure                            */
  506.         PUCHAR    pszLine);              /* Print line or NULL for empty line    */
  507.  
  508. /*----------------------------------------------------------------------*/
  509. /* IAppPrintNewPage                    Force skip to new page                           */
  510. /*----------------------------------------------------------------------*/
  511.  
  512. VOID IAPP_API IAppPrintNewPage(    /* No return value                            */
  513.         P_IAPP_PRINT xControl);        /* Control structure                            */
  514.  
  515. /*----------------------------------------------------------------------*/
  516. /* IAppPrintOpen                        Open printer                                       */
  517. /*----------------------------------------------------------------------*/
  518.  
  519. VOID IAPP_API IAppPrintOpen(        /* No return value                            */
  520.         P_IAPP_PRINT xControl,        /* Control structure                            */
  521.         PUCHAR    pszName,                  /* Device/file name or "*MMFName"        */
  522.         PBYTE        pInitCmd,              /* Initialization string (not for MMF)    */
  523.         USHORT    usInitLength);        /* Length of initialization string        */
  524.  
  525. /*----------------------------------------------------------------------*/
  526. /* IAppPrintQuery                        Query available printers                      */
  527. /*----------------------------------------------------------------------*/
  528.  
  529. typedef struct _IAPP_PRINT_QUERY
  530. {
  531.     UCHAR        szName[13];             /* Queue or printer name                      */
  532.     UCHAR        szServer[16];            /* Server name if remote queue             */
  533.     UCHAR        szDevice[9];            /* Printer device name                         */
  534.     UCHAR        szDriver[33];            /* Printer driver name                         */
  535.     IAPP_BOOL fDefault;                /* Default printer (TRUE/FALSE)             */
  536. } IAPP_PRINT_QUERY;
  537.  
  538. typedef IAPP_PRINT_QUERY FAR *P_IAPP_PRINT_QUERY;
  539.  
  540. VOID IAPP_API IAppPrintQuery(        /* No return value                            */
  541.         PSZ        pszMMFName);        /* Name of resulting MMF file                */
  542.  
  543. /*----------------------------------------------------------------------*/
  544. /* IAppProtect                            Lock or unlock process resource               */
  545. /*----------------------------------------------------------------------*/
  546.  
  547. VOID IAPP_API IAppProtect(            /* No return value                            */
  548.         IAPP_BOOL fType);                /* TRUE=Lock or FALSE=Unlock                 */
  549.  
  550. /*----------------------------------------------------------------------*/
  551. /* IAppRoundSwiss                        Round value using swiss rounding roule    */
  552. /*----------------------------------------------------------------------*/
  553.  
  554. double IAPP_API IAppRoundSwiss(    /* Rounded value                                */
  555.         double    dValue);                /* Value to be rounded                        */
  556.  
  557. /*----------------------------------------------------------------------*/
  558. /*     IAppRPNCalc                        Calculate RPN calculation expression    */
  559. /*----------------------------------------------------------------------*/
  560.  
  561. BOOL IAPP_API IAppRPNCalc(            /* TRUE=Success or FALSE=Error            */
  562.         PUCHAR    pszCalcString,        /* String to be evaluated/calculated    */
  563.         double    *dResultValue,        /* Resulting value                            */
  564.         PUCHAR    pszErrorMsg);        /* Error message (80 chars) if errors    */
  565.  
  566. /*----------------------------------------------------------------------*/
  567. /* IAppScanEnvironment                Return environment variable string       */
  568. /*----------------------------------------------------------------------*/
  569.  
  570. BOOL IAPP_API IAppScanEnvironment( /* TRUE=Success or FALSE=Not found    */
  571.         PUCHAR    pszEnvVar,            /* Variable to search, e.g. "DPATH"        */
  572.         PUCHAR    *pszEnvStr);         /* Pointer to found string                       */
  573.  
  574. /*----------------------------------------------------------------------*/
  575. /* IAppScreenClear                    Clear part of the screen                       */
  576. /*----------------------------------------------------------------------*/
  577.  
  578. #define IAPP_COLOR_WHITE_ON_BLUE        0x17
  579. #define IAPP_COLOR_WHITE$_ON_BLUE    0x1f
  580. #define IAPP_COLOR_YELLOW_ON_BLUE    0x1e
  581. #define IAPP_COLOR_GREEN$_ON_BLUE    0x1a
  582. #define IAPP_COLOR_RED$_ON_BLUE        0x1c
  583.  
  584. VOID IAPP_API IAppScreenClear(    /* No return value                            */
  585.         USHORT    usRowTop,            /* Top left row position                    */
  586.         USHORT    usColumnTop,        /* Top left column position                */
  587.         USHORT    usRowBottom,        /* Bottom right row position                */
  588.         USHORT    usColumnBottom,    /* Upper left corner                            */
  589.         UCHAR        ucAttribute);        /*    Character attribute                        */
  590.  
  591. /*----------------------------------------------------------------------*/
  592. /* IAppScreenSetCursor                Set cursor position                              */
  593. /*----------------------------------------------------------------------*/
  594.  
  595. VOID IAPP_API IAppScreenSetCursor( /* No return value                            */
  596.         USHORT    usRow,                /* Row position                                */
  597.         USHORT    usColumn);            /* Column position                            */
  598.  
  599. /*----------------------------------------------------------------------*/
  600. /* IAppScreenWrite                    Write string to the screen                     */
  601. /*----------------------------------------------------------------------*/
  602.  
  603. VOID IAPP_API IAppScreenWrite(    /* No return value                            */
  604.         USHORT    usRow,                /* Row position                                */
  605.         USHORT    usColumn,            /* Column position                            */
  606.         PUCHAR    szString,            /* String to write                            */
  607.         UCHAR        ucAttribute);        /*    Character attribute                         */
  608.  
  609. /*----------------------------------------------------------------------*/
  610. /* IAppService                            Perform special IAPP services                  */
  611. /*----------------------------------------------------------------------*/
  612.  
  613. #define IAPP_POPUP_NOWAIT    0x0001    /* Don't wait for ENTER at error        */
  614. #define IAPP_POPUP_WAIT        0x0002    /* Wait for ENTER at error                */
  615. #define IAPP_SQL_ROW_SIZE    0x0003    /* Return ULONG with SQL row size    */
  616. #define IAPP_SQL_DATA_AREA    0x0004    /* Return PVOID to SQL data area        */
  617. #define IAPP_LANG_CODE        0x0005    /* Return PUCHAR to language code    */
  618. #define IAPP_FOPEN_ABORT    0x0006    /* Abort if file open failed            */
  619. #define IAPP_FOPEN_NOABORT    0x0007    /* Return -1 if file open failed        */
  620. #define IAPP_LICENSE_NBR    0x0008    /* Return PUCHAR to license string    */
  621.  
  622. IAPP_SEG16 PVOID IAPP_API IAppService( /* Value according to function    */
  623.         USHORT    usFunction);        /* Function to be performed                 */
  624.  
  625. /*----------------------------------------------------------------------*/
  626. /* IAppStrip                            Strip blanks in string                         */
  627. /*----------------------------------------------------------------------*/
  628.  
  629. IAPP_SEG16 PUCHAR IAPP_API IAppStrip( /* Address of string                     */
  630.         PUCHAR    pszString,            /* String to be stripped                    */
  631.         UCHAR        ucAction);            /* 'L' Leading, 'T' Trailing, 'B' Both    */
  632.  
  633. /*----------------------------------------------------------------------*/
  634. /* IAppThreadCreate                    Create thread                                     */
  635. /*----------------------------------------------------------------------*/
  636.  
  637. typedef struct _IAPP_THREAD
  638. {
  639.     /*-------------------------------------------------------------------*/
  640.     /*    The following fields must not be set or modified by the caller.    */
  641.     /*    They may be read anytime by the application for reference.            */
  642.     /*-------------------------------------------------------------------*/
  643.     HSEM            hsemWait;             /* Wait semaphore                                */
  644.     HSEM            hsemRun;                /* Run semaphore                                */
  645.     IAPP_BOOL    fRunning;            /* TRUE=Running, FALSE=Waiting            */
  646.     PBYTE            pStack;                /* Thread stack                                */
  647.     IAPP_BOOL    fWinCalls;            /* TRUE=WinCalls, FALSE=No WinCalls        */
  648. #ifdef IAPP32
  649.     PVOID            pfnFunction;        /* Function to be executed                    */
  650. #else
  651.     VOID (far pascal *pfnFunction)(); /* Function to be executed              */
  652. #endif
  653.     PVOID            pArgument;            /* Function argument                            */
  654. } IAPP_THREAD;
  655.  
  656. typedef IAPP_THREAD FAR *P_IAPP_THREAD;
  657.  
  658. P_IAPP_THREAD IAPP_API IAppThreadCreate(    /* Return thread structure        */
  659.         IAPP_BOOL fWinCalls);         /* TRUE=WinCalls, FALSE=No WinCalls        */
  660.  
  661. /*----------------------------------------------------------------------*/
  662. /* IAppThreadDestroy                    Destroy thread                                     */
  663. /*----------------------------------------------------------------------*/
  664.  
  665. VOID IAPP_API IAppThreadDestroy(    /* No return value                            */
  666.         P_IAPP_THREAD    xControl);    /* Thread control structure                */
  667.  
  668. /*----------------------------------------------------------------------*/
  669. /* IAppThreadExecute                    Execute thread                                     */
  670. /*----------------------------------------------------------------------*/
  671.  
  672. VOID IAPP_API IAppThreadExecute(    /* No return value                            */
  673.         P_IAPP_THREAD    hHandle,        /* Thread handle                                */
  674.         PFN        pfnFunction,        /* Function to be executed                    */
  675.         PVOID        pArgument);            /* Function argument or NULL                */
  676.  
  677. /*----------------------------------------------------------------------*/
  678. /* IAppTrace                            Write trace record                            */
  679. /*----------------------------------------------------------------------*/
  680.  
  681. VOID IAPP_API_C IAppTrace(
  682.         PUCHAR    pszFunction,    /* Function name                                      */
  683.         IAPP_BOOL fType,            /* TRUE = Call, FALSE = Return or -1 for    */
  684.                                         /* normal (intermediate) call                    */
  685.         PUCHAR    pszFormat,        /* Format string ($i = USHORT, $I = SHORT,*/
  686.                                         /*    $l = ULONG, $L = LONG, $c = UCHAR,        */
  687.                                         /*    $C = CHAR, $s = PUCHAR, $p = PVOID,        */
  688.                                         /* $d = double, $b = hexadecimal)            */
  689.         ...);                            /* Optional parameters                            */
  690.         
  691. /*----------------------------------------------------------------------*/
  692. /* IAppUpperCase                        Fold string to uppercase                     */
  693. /*----------------------------------------------------------------------*/
  694.  
  695. IAPP_SEG16 PUCHAR IAPP_API IAppUpperCase(    /* Address of string                */
  696.         PUCHAR    pszString);            /* String to uppercase                         */
  697.  
  698. /*----------------------------------------------------------------------*/
  699. /* IAppWait                                Wait the specified number of seconds    */
  700. /*----------------------------------------------------------------------*/
  701.  
  702. VOID IAPP_API IAppWait(                /* No return value                            */
  703.         USHORT    usSeconds);            /* Wait time in seconds                        */
  704.  
  705. /*----------------------------------------------------------------------*/
  706. /* IAppWaitMSec                          Wait specified number of Milliseconds    */
  707. /*----------------------------------------------------------------------*/
  708.  
  709. VOID IAPP_API IAppWaitMSec(        /* No return value                            */
  710.         USHORT    usMilliSeconds);    /* Wait time in milliseconds                 */
  711.  
  712. /************************************************************************/
  713. /*                    Dialog Manager Functions                                            */ 
  714. /************************************************************************/
  715.  
  716. /*----------------------------------------------------------------------*/
  717. /* IAppDmCall                            General call to OS/2 Dialog Manager        */
  718. /*----------------------------------------------------------------------*/
  719.  
  720. #define    IAPP_DM_ERROR    30001        /* Returned error (User code or GML)    */
  721. #define    IAPP_DM_ENTER    30002        /* Returned ENTER command                     */
  722. #define    IAPP_DM_CANCEL    30003        /* Returned ESC, ALT-F4 or CANCEL        */
  723. #define    IAPP_DM_EXIT    30004        /* Returned F3 or EXIT                        */
  724. #define    IAPP_DM_FORCE    30005        /* Returned FORCEXIT                            */
  725. #define    IAPP_DM_YES        30011        /* Returned 'Yes' (IAppDmQuestion)        */
  726. #define    IAPP_DM_NO        30012        /* Returned 'No' (IAppDmQuestion)        */
  727.  
  728. BOOL IAPP_API IAppDmCall(            /* TRUE=Success or FALSE=Error            */
  729.         PUCHAR    pszDmCommand,         /* DM service call command string         */
  730.         USHORT    usVarCounter,        /* Size of variable or 0                      */
  731.         PVOID        pbDmVariable,         /* DM variables or NULL                          */
  732.         PUSHORT    pszDmReturn);         /* Returned command or NULL                 */
  733.  
  734. /*----------------------------------------------------------------------*/
  735. /* IAppDmMessage                        Display message thru OS/2 DM                 */
  736. /*----------------------------------------------------------------------*/
  737.  
  738. VOID IAPP_API IAppDmMessage(        /* No return value                            */
  739.         PUCHAR    pszMessage,              /* Message (max. 32767 chars)                */
  740.         IAPP_BOOL fTermFlag);          /* TRUE=Terminate or FALSE=Continue     */
  741.  
  742. /*----------------------------------------------------------------------*/
  743. /* IAppDmQuestion                        Display question thru OS/2 DM                */
  744. /*----------------------------------------------------------------------*/
  745.  
  746. VOID IAPP_API IAppDmQuestion(        /* No return value                            */
  747.         PUCHAR    pszMessage,              /* Message (max. 32767 chars)                */
  748.         PUSHORT    pusDmReturn);        /* Returned command                             */
  749.  
  750. /************************************************************************/
  751. /*                    DB2/2 Functions                                                          */ 
  752. /************************************************************************/
  753.  
  754. /*----------------------------------------------------------------------*/
  755. /* IAppSqlClose                        Close SQL database                                */
  756. /*----------------------------------------------------------------------*/
  757.  
  758. LONG IAPP_API IAppSqlClose(        /* 0 or SQL error code                        */
  759.         VOID);                              /* No arguments supported                    */
  760.  
  761. /*----------------------------------------------------------------------*/
  762. /* IAppSqlCommit                        Execute SQL "COMMIT" statement              */
  763. /*----------------------------------------------------------------------*/
  764.  
  765. LONG IAPP_API IAppSqlCommit(        /* 0 or SQL error code                        */
  766.         VOID);                              /* No arguments supported                    */
  767.  
  768. /*----------------------------------------------------------------------*/
  769. /* IAppSqlExec                            Execute SQL statement                          */
  770. /*----------------------------------------------------------------------*/
  771.  
  772. LONG IAPP_API IAppSqlExec(            /* 0 or SQL error code                        */
  773.         USHORT    usSqlCursor,        /* SQL cursor (1-25 or 0 to close all)    */
  774.         PUCHAR    pszSqlStmt,            /* SQL statement or NULL=Close current    */
  775.         PVOID        pbTableAdr,            /* Result table address or NULL             */
  776.         ULONG        ulTableSize,         /* Number of rows in result table or 0L*/
  777.         PULONG    pulRowsDone);        /* Number or rows processed or NULL        */
  778.  
  779. /*----------------------------------------------------------------------*/
  780. /* IAppSqlExecMMF                        Perform IAppSqlExec into MMF File        */
  781. /*----------------------------------------------------------------------*/
  782.  
  783. LONG IAPP_API IAppSqlExecMMF(        /* 0 or SQL error code                        */
  784.         USHORT    usSqlCursor,        /* SQL cursor (1-25 or 0 to close all)    */
  785.         PUCHAR    pszSqlStmt,            /* SQL statement                                */
  786.         PUCHAR    pszMMFName,            /* Name of memory mapped file                */
  787.         USHORT    usRowSize,            /* Size of each result table row            */
  788.         ULONG        ulMaxRows,             /* Maximum number of rows or 0 for all    */
  789.         PULONG    pulRowsDone);        /* Number or rows processed or NULL        */
  790.  
  791. /*----------------------------------------------------------------------*/
  792. /* IAppSqlMessage                        Retrieve last error message                    */
  793. /*----------------------------------------------------------------------*/
  794.  
  795. IAPP_SEG16 PUCHAR IAPP_API IAppSqlMessage( /* Address of message buffer    */
  796.         PUCHAR    pszBuffer);              /* Message buffer (512 chars)                 */
  797.  
  798. /*----------------------------------------------------------------------*/
  799. /* IAppSqlOpen                            Open SQL database                                  */
  800. /*----------------------------------------------------------------------*/
  801.  
  802. LONG IAPP_API IAppSqlOpen(            /* 0 or SQL error code                        */
  803.         PUCHAR    pszDataBase);        /* Database name                                 */
  804.  
  805. /*----------------------------------------------------------------------*/
  806. /* IAppSqlQuote                        Format SQL string (NULL or 'xxxx')        */
  807. /*----------------------------------------------------------------------*/
  808.  
  809. IAPP_SEG16 PUCHAR IAPP_API IAppSqlQuote( /* Address of return buffer        */
  810.         PUCHAR    pszInput,              /* Input string buffer                        */
  811.         PUCHAR    pszOutput);          /* Output buffer or NULL                    */
  812.  
  813. /*----------------------------------------------------------------------*/
  814. /* IAppSqlRollback                    Execute SQL "ROLLBACK" statement        */
  815. /*----------------------------------------------------------------------*/
  816.  
  817. LONG IAPP_API IAppSqlRollback(    /* 0 or SQL error code                        */
  818.         VOID);                              /* No arguments supported                     */
  819.  
  820. /************************************************************************/
  821. /*                    TCP/IP Socket Functions                                                */ 
  822. /************************************************************************/
  823.  
  824. typedef struct _IAPP_SOCKET
  825. {
  826.     LONG        hSocket;                    /* Socket descriptor                            */
  827.     LONG        lReturnCode;            /* Return code of socket interface        */
  828.     UCHAR        szErrorMessage[256];    /* Formatted message if FALSE returned    */
  829. } IAPP_SOCKET;
  830.  
  831. typedef IAPP_SOCKET FAR *P_IAPP_SOCKET;
  832.  
  833. /*----------------------------------------------------------------------*/
  834. /* IAppSocketClose                     Close the TCP/IP socket                           */
  835. /*----------------------------------------------------------------------*/
  836.  
  837. BOOL IAPP_API IAppSocketClose(     /* TRUE=Success or FALSE=Error            */
  838.         P_IAPP_SOCKET pxControl);    /* Control block                                */
  839.  
  840. /*----------------------------------------------------------------------*/
  841. /* IAppSocketOpen                         Open the TCP/IP socket                           */
  842. /*----------------------------------------------------------------------*/
  843.  
  844. BOOL IAPP_API IAppSocketOpen(        /* TRUE=Success or FALSE=Error            */
  845.         P_IAPP_SOCKET *pxControl,    /* Address of control block pointer        */
  846.         PUCHAR    pszCallName,        /* Calling host name (NULL for server)    */
  847.         PUCHAR    pszServiceName);    /* Service name (defined in SERVICES)    */
  848.  
  849. /*----------------------------------------------------------------------*/
  850. /* IAppSocketRead                        Read from the TCP/IP socket                   */
  851. /*----------------------------------------------------------------------*/
  852.  
  853. BOOL IAPP_API IAppSocketRead(     /* TRUE=Success or FALSE=Error            */
  854.         P_IAPP_SOCKET pxControl,    /* Control block                                */
  855.         PVOID        bBuffer,                /* Buffer address                             */
  856.         PUSHORT    pusBufferSize);    /* Size of buffer read                        */
  857.  
  858. /*----------------------------------------------------------------------*/
  859. /* IAppSocketWrite                    Write to the TCP/IP socket                      */
  860. /*----------------------------------------------------------------------*/
  861.  
  862. BOOL IAPP_API IAppSocketWrite(     /* TRUE=Success or FALSE=Error            */
  863.         P_IAPP_SOCKET pxControl,    /* Control block                                */
  864.         PVOID        bBuffer,                /* Buffer address                             */
  865.         USHORT    usBufferSize);        /* Size of buffer                                 */
  866.  
  867. /************************************************************************/
  868. /*                    CM/2 X.25 Functions                                                       */ 
  869. /************************************************************************/
  870.  
  871. /*----------------------------------------------------------------------*/
  872. /* IAppX25Close                        Close X.25 link                                    */
  873. /*----------------------------------------------------------------------*/
  874.  
  875. typedef struct _IAPP_X25
  876. {
  877.     UCHAR        ucChannelType;             /* X.25 channel type (S=SVC, P=PVC)          */
  878.     UCHAR        szRouteTable[9];        /* X.25 call routing table entry              */
  879.     LONG        lConnectionId;            /* X.25 channel connection identifier     */
  880.     UCHAR        szErrorMsg[256];        /* Formatted message if FALSE returned    */
  881. } IAPP_X25;
  882.  
  883. typedef IAPP_X25 FAR *P_IAPP_X25;
  884.  
  885. BOOL IAPP_API IAppX25Close(        /* TRUE=Success or FALSE=Error            */
  886.         P_IAPP_X25 pxControl);        /* IApp X.25 control block                     */
  887.  
  888. /*----------------------------------------------------------------------*/
  889. /* IAppX25Open                            Open X.25 link                                      */
  890. /*----------------------------------------------------------------------*/
  891.  
  892. BOOL IAPP_API IAppX25Open(            /* TRUE=Success or FALSE=Error            */
  893.         P_IAPP_X25 pxControl,        /* IApp X.25 control block                      */
  894.         PSZ        pszCallAddr,        /* "nnnn" for SVC outgoing CALL (Link)    */
  895.                                             /* "*"    for SVC incoming CALL (Route)*/
  896.                                             /* ""     for PVC channel       (Name)    */
  897.         PSZ        pszName);            /* X.25 SVC link, SVC route or PVC name*/
  898.  
  899. /*----------------------------------------------------------------------*/
  900. /* IAppX25Read                            Read X.25 link                                       */
  901. /*----------------------------------------------------------------------*/
  902.  
  903. BOOL IAPP_API IAppX25Read(            /* TRUE=Success or FALSE=Error            */
  904.         P_IAPP_X25 pxControl,         /* IApp X.25 control block                      */
  905.         PUSHORT    pusLength,             /* Buffer length                                 */
  906.         PVOID        pBuffer);             /* Buffer                                          */
  907.  
  908. /*----------------------------------------------------------------------*/
  909. /* IAppX25Write                        Write X.25 link                                   */
  910. /*----------------------------------------------------------------------*/
  911.  
  912. BOOL IAPP_API IAppX25Write(        /* TRUE=Success or FALSE=Error            */
  913.         P_IAPP_X25 pxControl,        /* IApp X.25 control block                    */
  914.         PUSHORT    pusLength,             /* Buffer length                                */
  915.         PVOID        pBuffer);             /* Buffer                                         */
  916.  
  917. /************************************************************************/
  918. /*                    Compiler Macros                                                           */ 
  919. /************************************************************************/
  920.  
  921. /*----------------------------------------------------------------------*/
  922. /* IAPPDEBUG                            Write data to file                              */
  923. /*----------------------------------------------------------------------*/
  924.  
  925. #define    IAPPDEBUG(f,b,l)            {    \
  926.                                                 HFILE hFile;\
  927.                                                 hFile = IAppFileOpen(f, 'a');\
  928.                                                 IAppFileWrite(hFile, (PVOID) b, l);\
  929.                                                 IAppFileWrite(hFile, "\r\n", 2);\
  930.                                                 IAppFileClose(hFile);\
  931.                                             }
  932.  
  933. /************************************************************************/
  934. /*            End of IAPP                                                                        */
  935. /************************************************************************/
  936.  
  937.