home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / common.zip / CMNDEFS.H < prev    next >
C/C++ Source or Header  |  1995-02-08  |  20KB  |  553 lines

  1. #ifndef CMNDEFS_INCLUDED
  2. #define CMNDEFS_INCLUDED
  3.  
  4. #pragma pack(1)
  5.  
  6. #define CMNLIB_MAJVER            1
  7. #define CMNLIB_MINVER            7
  8. #define CMNLIB_REVVER            0
  9.  
  10. #define QH_ERROR                 (USHORT)0
  11. #define QH_HCCCONNECT            (USHORT)1
  12. #define QH_HCFSEARCH             (USHORT)2
  13. #define QH_HCLLIST               (USHORT)3
  14. #define QH_HCMMEM                (USHORT)4
  15. #define QH_HCOOBJECT             (USHORT)5
  16. #define QH_HCSSET                (USHORT)6
  17. #define QH_HCSSIGNAL             (USHORT)7
  18. #define QH_HCSPLAYGROUND         (USHORT)8
  19. #define QH_HCSSPRITE             (USHORT)9
  20.  
  21. #ifdef INCL_CMNBUF
  22. //-------------------------------------------------------------------------
  23. // Buffer routines
  24. //-------------------------------------------------------------------------
  25. #endif
  26.  
  27. #ifdef INCL_CMNCOM
  28. //-------------------------------------------------------------------------
  29. // Communication routines
  30. //-------------------------------------------------------------------------
  31.  
  32. typedef LONG COMERROR;
  33.  
  34. #define COM_ERR_NOERROR          (COMERROR)0
  35. #define COM_ERR_ERROR            (COMERROR)-1
  36. #define COM_ERR_NOTIMPLEMENTED   (COMERROR)-2
  37. #define COM_ERR_NOMEMORY         (COMERROR)1
  38. #define COM_ERR_INITFAILED       (COMERROR)2
  39. #define COM_ERR_BADHANDLE        (COMERROR)3
  40. #define COM_ERR_BADARGUMENT      (COMERROR)4
  41. #define COM_ERR_NOCONNECTION     (COMERROR)5
  42. #define COM_ERR_NOTSERVER        (COMERROR)6
  43. #define COM_ERR_TIMEOUT          (COMERROR)7
  44. #define COM_ERR_READFAILED       (COMERROR)8
  45. #define COM_ERR_WRITEFAILED      (COMERROR)9
  46. #define COM_ERR_BADDATA          (COMERROR)10
  47. #define COM_ERR_BADACK           (COMERROR)11
  48. #define COM_ERR_NONEFREE         (COMERROR)12
  49. #define COM_ERR_BADCONTROL       (COMERROR)13
  50. #define COM_ERR_BUFFERTOOLARGE   (COMERROR)14
  51. #define COM_ERR_CC_CLOSE         (COMERROR)32
  52. #define COM_ERR_CC_RESET         (COMERROR)33
  53.  
  54. #define MAX_REMOTENAME           256
  55. #define MAX_CONNECTNAME          256
  56.  
  57. #define CCI_TYPE_CLIENT          (USHORT)0x0001
  58. #define CCI_TYPE_SERVER          (USHORT)0x0002
  59. #define CCI_TYPE_SERVERCONNECT   (USHORT)0x0004
  60. #define CCI_TYPE_CLIENTSERVER    ((CCI_TYPE_CLIENT)|(CCI_TYPE_SERVER))
  61. #define CCI_ATTR_NOACKS          (USHORT)0x0008
  62.  
  63. //-------------------------------------------------------------------------
  64. // CCI_ATTR_NOTIMEOUT is used for the lTimeout field of the CCOPENINFO
  65. // structure (CmnComOpenConnection) and the CCCONNECTINFO structure
  66. // (CmnSetHandleInfo)
  67. //-------------------------------------------------------------------------
  68. #define CCI_ATTR_NOTIMEOUT       (USHORT)0
  69.  
  70. typedef struct _CCOPENINFO {
  71.    CHAR achMachine[MAX_CONNECTNAME+1];
  72.    CHAR achConnect[MAX_CONNECTNAME+1];
  73.    USHORT usAttr;
  74.    LONG lTimeout;
  75. } CCOPENINFO, FAR *PCCOPENINFO;
  76.  
  77. typedef struct _CCCONNECTINFO {
  78.    CHAR achConnect[MAX_CONNECTNAME+1];
  79.    USHORT usAttr;
  80.    ULONG ulSzData;
  81.    LONG lTimeout;
  82. } CCCONNECTINFO, FAR *PCCCONNECTINFO;
  83.  
  84. #define CSC_CLOSE                0x00000001L
  85. #define CSC_RESET                0x00000002L
  86.  
  87. typedef LHANDLE HCCCONNECT;
  88. typedef HCCCONNECT FAR *PHCCCONNECT;
  89. #endif
  90.  
  91. #ifdef INCL_CMNDBG
  92. //-------------------------------------------------------------------------
  93. // Debugging routines
  94. //-------------------------------------------------------------------------
  95.  
  96. #define DWT_TYPE_NAME            (USHORT)0
  97. #define DWT_TYPE_FILE            (USHORT)1
  98.  
  99. #define DWT_ERROR                (SHORT)-1
  100. #endif
  101.  
  102. #ifdef INCL_CMNFIL
  103. //-------------------------------------------------------------------------
  104. // File routines
  105. //-------------------------------------------------------------------------
  106.  
  107. //-------------------------------------------------------------------------
  108. // Note that the FCS_ATTR_* constants are equal to the FILE_* constants
  109. // (defined in <bsedos.h>) shifted left 1 bit, with the exception of
  110. // FCS_ATTR_NORMAL, which is 1.
  111. //
  112. // This allows us to specify, for example, that we want read-only files
  113. // but *not* normal files.  This makes the underlying code a bit more
  114. // complex, but not so complex that the extra effort outweighs the
  115. // advantages gained.
  116. //-------------------------------------------------------------------------
  117. #define FCS_ATTR_NORMAL          0x00000001L
  118. #define FCS_ATTR_READONLY        0x00000002L
  119. #define FCS_ATTR_HIDDEN          0x00000004L
  120. #define FCS_ATTR_SYSTEM          0x00000008L
  121. #define FCS_ATTR_DIRECTORY       0x00000020L
  122. #define FCS_ATTR_ARCHIVED        0x00000040L
  123.  
  124. #define FCS_ATTR_AND             0x00000000L
  125. #define FCS_ATTR_OR              0x01000000L
  126.  
  127. #define FSF_NOFILES              0xFFFFFFFFL
  128. #define FSF_ERROR                0xFFFFFFFEL
  129.  
  130. #define FEA_TYPE                 (PCHAR)0xFFFFFFF0L
  131. #define FEA_KEYPHRASES           (PCHAR)0xFFFFFFF1L
  132. #define FEA_SUBJECT              (PCHAR)0xFFFFFFF2L
  133. #define FEA_COMMENTS             (PCHAR)0xFFFFFFF3L
  134. #define FEA_HISTORY              (PCHAR)0xFFFFFFF4L
  135. #define FEA_VERSION              (PCHAR)0xFFFFFFF5L
  136. #define FEA_ICON                 (PCHAR)0xFFFFFFF6L
  137. #define FEA_ASSOCTABLE           (PCHAR)0xFFFFFFF7L
  138. #define FEA_HPFSNAME             (PCHAR)0xFFFFFFF8L
  139.  
  140. typedef LHANDLE HCFSEARCH;
  141. typedef HCFSEARCH FAR *PHCFSEARCH;
  142.  
  143. //-------------------------------------------------------------------------
  144. // FCD_TYPE_*   - CmnFilCopyDiskette() notification types
  145. //-------------------------------------------------------------------------
  146. #define FCD_TYPE_PROGRESS        0L
  147. #define FCD_TYPE_MESSAGE         1L
  148. #define FCD_TYPE_ERROR           2L
  149.  
  150. //-------------------------------------------------------------------------
  151. // FCD_MSG_*    - CmnFilCopyDiskette() messages
  152. //-------------------------------------------------------------------------
  153. #define FCD_MSG_WANTSRCDISK      0L
  154. #define FCD_MSG_WANTDESTDISK     1L
  155. #define FCD_MSG_WANTFORMATDISK   2L
  156. #define FCD_MSG_BEGINREAD        3L
  157. #define FCD_MSG_ENDREAD          4L
  158. #define FCD_MSG_BEGINWRITE       5L
  159. #define FCD_MSG_ENDWRITE         6L
  160. #define FCD_MSG_BEGINFORMAT      7L
  161. #define FCD_MSG_ENDFORMAT        8L
  162. #define FCD_MSG_BEGINVERIFY      9L
  163. #define FCD_MSG_ENDVERIFY        10L
  164. #define FCD_MSG_VALIDATESRCDISK  11L
  165. #define FCD_MSG_WRITEPROTECTED   12L
  166. #define FCD_MSG_SIZEMISMATCH     13L
  167. #define FCD_MSG_UNFORMATTED      14L
  168.  
  169. //-------------------------------------------------------------------------
  170. // FCD_MSG_*    - CmnFilCopyDiskette() errors
  171. //-------------------------------------------------------------------------
  172. #define FCD_ERR_SRCDRVINVALID    0L
  173. #define FCD_ERR_DESTDRVINVALID   1L
  174. #define FCD_ERR_NOMEMORY         2L
  175. #define FCD_ERR_OPENFAILED       3L
  176. #define FCD_ERR_CLOSEFAILED      4L
  177. #define FCD_ERR_READFAILED       5L
  178. #define FCD_ERR_WRITEFAILED      6L
  179. #define FCD_ERR_FORMATFAILED     7L
  180. #define FCD_ERR_VERIFYFAILED     8L
  181. #define FCD_ERR_LOCKFAILED       9L
  182. #define FCD_ERR_UNLOCKFAILED     10L
  183. #define FCD_ERR_ABORTED          99L
  184.  
  185. //-------------------------------------------------------------------------
  186. // PFNDISKIO            - feedback function prototype
  187. //-------------------------------------------------------------------------
  188. typedef BOOL (* EXPENTRY PFNDISKIO)(ULONG,ULONG,PVOID);
  189.  
  190. //-------------------------------------------------------------------------
  191. // CFFI_SECTOR_*        - sector size constants for CmnFilFormatDiskette()
  192. //-------------------------------------------------------------------------
  193. #define CFFI_SECTOR_128B         0
  194. #define CFFI_SECTOR_256B         1
  195. #define CFFI_SECTOR_512B         2
  196. #define CFFI_SECTOR_1024B        3
  197.  
  198. typedef struct _CFFORMATINFO {
  199.    ULONG ulSzStruct;
  200.    ULONG ulNumTracks;
  201.    ULONG ulNumSectors;
  202.    ULONG ulSzSector;
  203. } CFFORMATINFO, *PCFFORMATINFO;
  204.  
  205. //-------------------------------------------------------------------------
  206. // Options for CmnFilCopyDiskette()
  207. //
  208. // FCD_OPT_WANTFORMATTED        - if set, CmnFilCopyDiskette() will fail
  209. //                                if the destination diskette is unformatted.
  210. //-------------------------------------------------------------------------
  211. #define FCD_OPT_WANTFORMATTED    0x00000001L
  212.  
  213. //-------------------------------------------------------------------------
  214. // Options for CmnFilInstallDiskette()
  215. //
  216. // CFID_REQ_CREATE      - initialize the install diskette with a specified
  217. //                        set of licenses allocated to it.
  218. // CFID_REQ_DECREMENT   - decrement the number of licenses.
  219. // CFID_REQ_INCREMENT   - increment the number of licenses.
  220. // CFID_REQ_QUERY       - query the number of licenses left.
  221. //-------------------------------------------------------------------------
  222. #define CFID_REQ_CREATE          1L
  223. #define CFID_REQ_DECREMENT       2L
  224. #define CFID_REQ_INCREMENT       3L
  225. #define CFID_REQ_QUERY           4L
  226.  
  227. #define CFID_ERR_NOERROR         0L
  228. #define CFID_ERR_READFAILED      1L
  229. #define CFID_ERR_WRITEFAILED     2L
  230. #define CFID_ERR_NOTINSTALLDISK  3L
  231. #define CFID_ERR_NOMORELICENSES  4L
  232. #define CFID_ERR_NOTFLOPPY       5L
  233. #define CFID_ERR_DRIVENOTREADY   6L
  234. #define CFID_ERR_BADPARM         99L
  235. #endif                           // #ifdef INCL_CMNFIL
  236.  
  237. #ifdef INCL_CMNLST
  238. //-------------------------------------------------------------------------
  239. // Link-list routines
  240. //-------------------------------------------------------------------------
  241.  
  242. #define LAR_TAIL                 (PFNRECCOMP)0
  243. #define LAR_HEAD                 (PFNRECCOMP)1
  244.  
  245. #define LAUR_ERROR               0
  246. #define LAUR_EXISTS              1
  247. #define LAUR_NOERROR             2
  248.  
  249. #define LQRC_ERROR               -1
  250.  
  251. #define LQR_PREVIOUS             0
  252. #define LQR_NEXT                 1
  253.  
  254. typedef struct _CLLISTINFO {
  255.    USHORT usSzRecord;
  256.    USHORT usNumRecords;
  257.    PVOID pvHead;
  258.    PVOID pvTail;
  259. } CLLISTINFO, FAR *PCLLISTINFO;
  260.  
  261. typedef LHANDLE HCLLIST;
  262. typedef HCLLIST FAR *PHCLLIST;
  263.  
  264. //-------------------------------------------------------------------------
  265. // The function prototypes listed below are defined as follows:
  266. //
  267. // PFNRECCOMP - comparison function
  268. //
  269. // SHORT EXPENTRY pfnRecComp(PVOID pvFirst,PVOID pvSecond,PVOID pvData);
  270. //
  271. // Input:  pvFirst - points to the first record to be compared.
  272. //         pvSecond - points to the second record to be compared.
  273. //         pvData - points to application-defined data, usually passed
  274. //                  into the function which calls this function.
  275. // Returns:  -1 if the first record is "less than" the second, 0 if they are
  276. //           "equal", or 1 if the first record is "greater than" the second.
  277. //
  278. // PFNRECFUNC - record callback function
  279. //
  280. // SHORT EXPENTRY pfnRecFunc(PVOID pvRecord,PVOID pvData);
  281. //
  282. // Input:  pvRecord - points to a record in the list
  283. //         pvData - points to application-defined data, usually passed
  284. //                  into the function which calls this function.
  285. //
  286. // PFNRECMED - median finding function
  287. //
  288. // SHORT EXPENTRY pfnRecMed(HCLLIST hclSubList,PVOID pvBuffer,PVOID pvData);
  289. //
  290. // Input:  hclSubList - handle to the list to find the median for.
  291. //         pvData - points to application-defined data, usually passed
  292. //                  into the function which calls this function.
  293. // Output:  pvBuffer - points to a buffer of the same size as a
  294. //                     single record in the list and should be
  295. //                     initialized by the function to be the median
  296. //                     of the list.  This is passed later to pfnCompare
  297. //                     as the second parameter to find all elements
  298. //                     that are less than and greater than this record.
  299. // Returns:  TRUE if successful, FALSE otherwise.
  300. //-------------------------------------------------------------------------
  301. typedef SHORT (* EXPENTRY PFNRECCOMP)(PVOID,PVOID,PVOID);
  302. typedef VOID (* EXPENTRY PFNRECFUNC)(PVOID,PVOID);
  303. typedef BOOL (* EXPENTRY PFNRECMED)(HCLLIST,PVOID,PVOID);
  304. #endif                           // #ifdef INCL_CMNLST
  305.  
  306. #ifdef INCL_CMNMEM
  307. //-------------------------------------------------------------------------
  308. // Memory allocation routines
  309. //-------------------------------------------------------------------------
  310.  
  311. typedef LONG MEMERROR;
  312.  
  313. #define MEM_ERR_NOERROR          (MEMERROR)0
  314. #define MEM_ERR_ERROR            (MEMERROR)-1
  315. #define MEM_ERR_BADHANDLE        (MEMERROR)1
  316. #define MEM_ERR_NOMEMORY         (MEMERROR)2
  317. #define MEM_ERR_SIZETOOLARGE     (MEMERROR)3
  318. #define MEM_ERR_BADPOINTER       (MEMERROR)4
  319.  
  320. typedef struct _CMMEMINFO {
  321.    USHORT usNumHeaps;
  322.    ULONG ulSzHeap;
  323.    ULONG ulMemUsed;
  324. } CMMEMINFO, FAR *PCMMEMINFO;
  325.  
  326. typedef LHANDLE HCMMEM;
  327. typedef HCMMEM FAR *PHCMMEM;
  328. #endif                           // #ifdef INCL_CMNMEM
  329.  
  330. #ifdef INCL_CMNOBJ
  331. //-------------------------------------------------------------------------
  332. // Object routines
  333. //-------------------------------------------------------------------------
  334.  
  335. typedef LHANDLE HCOOBJECT;
  336. typedef HCOOBJECT FAR *PHCOOBJECT;
  337.  
  338. #define MAX_OBJECTNAME           256
  339.  
  340. typedef struct _COOBJECTINFO {
  341.    HCOOBJECT hcoParent;
  342.    CHAR achName[MAX_OBJECTNAME+1];
  343.    ULONG ulSzData;
  344.    PVOID pvData;
  345.    USHORT usNumChildren;
  346.    ULONG ulReserved;
  347. } COOBJECTINFO, FAR *PCOOBJECTINFO;
  348.  
  349. typedef LONG OBJERROR;
  350.  
  351. #define OBJ_ERR_NOERROR          (OBJERROR)0
  352. #define OBJ_ERR_ERROR            (OBJERROR)-1
  353. #define OBJ_ERR_NOTIMPLEMENTED   (OBJERROR)-2
  354. #define OBJ_ERR_NOMEMORY         (OBJERROR)1
  355. #define OBJ_ERR_BADHANDLE        (OBJERROR)2
  356. #define OBJ_ERR_BADROOTHANDLE    (OBJERROR)3
  357. #define OBJ_ERR_SIZETOOLARGE     (OBJERROR)4
  358. #define OBJ_ERR_BADNAME          (OBJERROR)5
  359. #define OBJ_ERR_NOTROOT          (OBJERROR)6
  360. #define OBJ_ERR_BADARGUMENT      (OBJERROR)7
  361. #define OBJ_ERR_OBJECTCORRUPTED  (OBJERROR)8
  362. #define OBJ_ERR_INITFAILED       (OBJERROR)9
  363. #define OBJ_ERR_NOTFOUND         (OBJERROR)10
  364.  
  365. #define MAXDEPTH_UNLIMITED       (SHORT)-1
  366. #define MAX_SERVERNAME           256
  367.  
  368. typedef struct _COROOTINFO {
  369.    SHORT sMaxDepth;
  370.    CHAR achName[MAX_OBJECTNAME+1];
  371.    CHAR achServer[MAX_SERVERNAME+1];
  372. } COROOTINFO, FAR *PCOROOTINFO;
  373.  
  374. #define OQO_PARENT               (SHORT)-1
  375. #define OQO_FIRSTCHILD           (SHORT)-2
  376. #define OQO_PREVIOUS             (SHORT)-3
  377. #define OQO_NEXT                 (SHORT)-4
  378. #define OQO_ROOT                 (SHORT)-5
  379. #endif                           // #ifdef INCL_CMNOBJ
  380.  
  381. #ifdef INCL_CMNSET
  382. //-------------------------------------------------------------------------
  383. // Set routines
  384. //-------------------------------------------------------------------------
  385.  
  386. #define SFE_SET                  0
  387. #define SFE_CLEAR                1
  388.  
  389. #define SFE_NOTFOUND             -1
  390. #define SFE_ERROR                -2
  391.  
  392. #define SQE_ERROR                -1
  393. #define SQE_SET                  0
  394. #define SQE_CLEAR                1
  395.  
  396. #define SQES_ERROR               -1
  397. #define SQES_EQUAL               0
  398. #define SQES_NOTEQUAL            1
  399.  
  400. typedef LHANDLE HCSSET;
  401. typedef HCSSET FAR *PHCSSET;
  402.  
  403. typedef struct _CSSETINFO {
  404.    ULONG ulMaxElements;
  405.    ULONG ulElementsSet;
  406. } CSSETINFO, FAR *PCSSETINFO;
  407. #endif                           // #ifdef INCL_CMNSET
  408.  
  409. #ifdef INCL_CMNSIG
  410. //-------------------------------------------------------------------------
  411. // Signal routines
  412. //-------------------------------------------------------------------------
  413.  
  414. #define SWS_TIMEOUT_IMMEDIATE    0
  415. #define SWS_TIMEOUT_NEVER        -1
  416.  
  417. #define SWS_RC_ERROR             0
  418. #define SWS_RC_TIMEOUT           1
  419. #define SWS_RC_SIGNALSET         2
  420.  
  421. typedef LHANDLE HCSSIGNAL;
  422. typedef HCSSIGNAL FAR *PHCSSIGNAL;
  423.  
  424. typedef LHANDLE HCSSIGNALLIST;
  425. typedef HCSSIGNALLIST FAR *PHCSSIGNALLIST;
  426. #endif                           // #ifdef INCL_CMNSIG
  427.  
  428. #ifdef INCL_CMNSPR
  429. //-------------------------------------------------------------------------
  430. // Sprite routines
  431. //-------------------------------------------------------------------------
  432.  
  433. #define MAX_SPRITES              64
  434.  
  435. #define MAX_SPRITE_CX            128
  436. #define MAX_SPRITE_CY            128
  437.  
  438. #define SSL_TOP                  -1L
  439. #define SSL_BOTTOM               -2L
  440. #define SSL_UP                   -3L
  441. #define SSL_DOWN                 -4L
  442.  
  443. typedef LONG SPRERROR;
  444.  
  445. #define SPR_ERR_NOERROR          0x00000000L
  446. #define SPR_ERR_ERROR            0xFFFFFFFFL
  447. #define SPR_ERR_BADHANDLE        0x00000001L
  448. #define SPR_ERR_BMPTOOLARGE      0x00000002L
  449. #define SPR_ERR_RESOURCE         0x00000003L
  450. #define SPR_ERR_NOMEMORY         0x00000004L
  451. #define SPR_ERR_HASPLAYGROUND    0x00000005L
  452. #define SPR_ERR_HASNOPLAYGROUND  0x00000006L
  453. #define SPR_ERR_PLAYGROUNDFULL   0x00000007L
  454. #define SPR_ERR_HASBACKGROUND    0x00000008L
  455. #define SPR_ERR_BADLAYER         0x00000009L
  456. #define SPR_ERR_NOTFOUND         0x0000000AL
  457.  
  458. typedef LHANDLE HCSSPRITE;
  459. typedef HCSSPRITE *PHCSSPRITE;
  460.  
  461. typedef LHANDLE HCSPLAYGROUND;
  462. typedef HCSPLAYGROUND *PHCSPLAYGROUND;
  463. #endif                           // #ifdef INCL_CMNSPR
  464.  
  465. #ifdef INCL_CMNSTR
  466. //-------------------------------------------------------------------------
  467. // String routines
  468. //-------------------------------------------------------------------------
  469.  
  470. #define SQWP_ERROR               -1
  471.  
  472. #define SCTN_TYPE_BYTE           0x0000
  473. #define SCTN_TYPE_SHORT          0x0001
  474. #define SCTN_TYPE_LONG           0x0002
  475. #define SCTN_TYPE_FLOAT          0x0003
  476. #define SCTN_TYPE_DOUBLE         0x0004
  477. #define SCTN_ATTR_DECIMAL        0x0000
  478. #define SCTN_ATTR_HEX            0x1000
  479.  
  480. #define SPL_ERR_ERROR            -1
  481.  
  482. #define SPL_TYPE_BYTE            0x0000
  483. #define SPL_TYPE_CHAR            0x0001
  484. #define SPL_TYPE_STRING          0x0002
  485. #define SPL_TYPE_SHORT           0x0003
  486. #define SPL_TYPE_LONG            0x0004
  487. #define SPL_TYPE_FLOAT           0x0005
  488. #define SPL_TYPE_DOUBLE          0x0006
  489. #define SPL_TYPE_RESERVED        0x000F
  490. #define SPL_ATTR_DECIMAL         0x0000
  491. #define SPL_ATTR_HEX             0x1000
  492.  
  493. #define SPL_NOTFOUND             0xFFFF
  494. #define SPL_FOUND                0xFFFE
  495.  
  496. typedef struct _CSLINEDESC {
  497.    USHORT usOffset;              // 0-based offset of the field within
  498.                                  // each line
  499.    USHORT usLength;              // Size of the field
  500.    USHORT usType;                // Field type (SPL_* constant)
  501. } CSLINEDESC, FAR *PCSLINEDESC;
  502.  
  503. #define SPCL_ERR_NOMEMORY        0
  504. #define SPCL_ERR_NOTENOUGHARGS   1
  505. #define SPCL_ERR_BADSWITCH       2
  506. #define SPCL_ERR_SWITCHERROR     3
  507.  
  508. typedef VOID (* EXPENTRY PFNCMDERR)(USHORT,PVOID);
  509. typedef BOOL (* EXPENTRY PFNCMDARG)(USHORT,PCHAR *,USHORT,PVOID);
  510.  
  511. #define SPCL_MAX_SWITCH          8
  512.  
  513. #define SPCL_FLG_CASESENSITIVE   0x0001
  514. #define SPCL_FLG_SUBSTRING       0x0002
  515. #define SPCL_FLG_ARGCONCAT       0x0004
  516.  
  517. typedef struct _CSCMDDESC {
  518.    USHORT usId;
  519.    CHAR achSwitch[SPCL_MAX_SWITCH+1];
  520.    USHORT usNumArgs;
  521.    USHORT usFlags;
  522.    PFNCMDARG pfnCallback;
  523. } CSCMDDESC, FAR *PCSCMDDESC;
  524.  
  525. #define SPS_LEFT                 (USHORT)1
  526. #define SPS_RIGHT                (USHORT)2
  527. #endif                           // #ifdef INCL_CMNSET
  528.  
  529. #ifdef INCL_CMNVIO
  530. //-------------------------------------------------------------------------
  531. // Screen I/O routines
  532. //-------------------------------------------------------------------------
  533. #define VGS_UNREADABLE           0x00000001
  534. #define VGS_REQUIRED             0x00000002
  535.  
  536. #endif                           // #ifdef INCL_CMNVIO
  537.  
  538. #ifdef INCL_CMNWIN
  539. //-------------------------------------------------------------------------
  540. // Windowing routines
  541. //-------------------------------------------------------------------------
  542. typedef struct _CWPOSITION {
  543.    ULONG ulSzStruct;
  544.    SWP swpPosition;              // Current size and position
  545.    USHORT ausExtra[6];           // Minimized position and restored size and
  546.                                  // position
  547. } CWPOSITION, FAR *PCWPOSITION;
  548. #endif                           // #ifdef INCL_CMNWIN
  549.  
  550. #pragma pack()
  551.  
  552. #endif                           // #ifndef CMNDEFS_INCLUDED
  553.