home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxasyn20.zip / MISCFUNC.H < prev    next >
Text File  |  1994-12-26  |  6KB  |  147 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /*  MODULE         MISCFUNC.H                                                */
  4. /*                                                                           */
  5. /*  VERSION        Version 2.0 - 26th Dec 1994                               */
  6. /*                                                                           */
  7. /*  COPYRIGHT      Copyright (c) 1993, 1994 by Crucial Applications          */
  8. /*                             All rights reserved.                          */
  9. /*                                                                           */
  10. /*  DESCRIPTION    Header file for MISCFUNC.C Miscellaneous Functions        */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13.  
  14. #ifndef MISCFUNC_H_INCLUDED
  15. #define MISCFUNC_H_INCLUDED
  16.  
  17. /*********************************************************************/
  18. /* General definitions                                               */
  19. /*********************************************************************/
  20.  
  21. #define  EOSTR_CH        0x00          /* End of string              */
  22. #define  LINEFEED_CH     0x0A          /* Line feed                  */
  23. #define  FORMFEED_CH     0x0C          /* Form feed                  */
  24. #define  CARRIAGE_CH     0x0D          /* Carriage return            */
  25. #define  EOFILE_CH       0x1A          /* End of file                */
  26. #define  EMPTY_STR       ""            /* Empty string               */
  27. #define  NULL_STR        NULL          /* Null string pointer        */
  28.  
  29. #define  YESNO_OPTIONS   "YyNn"        /* Possible Yes/No values     */
  30. #define  YES_OPTIONS     "Yy"          /* Possible Yes values        */
  31. #define  NO_OPTIONS      "Nn"          /* Possible No values         */
  32.  
  33. /*********************************************************************/
  34. /* Definitions for Str2Num()                                         */
  35. /*********************************************************************/
  36.  
  37. #define  MAX_DIGITS          9         /* maximum digits numeric arg */
  38. #define  MAX_BYTE_DEC        255
  39. #define  MAX_SHORT_DEC       32767
  40. #define  MAX_USHORT_DEC      65535
  41. #define  MAX_LONG_DEC        2147483647
  42. #define  MAX_ULONG_DEC       4294967295
  43. #define  DIGIT_CHARS         "0123456789ABCDEFabcdef"
  44.  
  45. #define  STR2NUM_STR2STR      0
  46. #define  STR2NUM_BIN2BYTE     1
  47. #define  STR2NUM_BIN2SHORT    2
  48. #define  STR2NUM_BIN2USHORT   3
  49. #define  STR2NUM_BIN2LONG     4
  50. #define  STR2NUM_BIN2ULONG    5
  51. #define  STR2NUM_HEX2BYTE     6
  52. #define  STR2NUM_HEX2SHORT    7
  53. #define  STR2NUM_HEX2USHORT   8
  54. #define  STR2NUM_HEX2LONG     9
  55. #define  STR2NUM_HEX2ULONG   10
  56. #define  STR2NUM_OCT2BYTE    11
  57. #define  STR2NUM_OCT2SHORT   12
  58. #define  STR2NUM_OCT2USHORT  13
  59. #define  STR2NUM_OCT2LONG    14
  60. #define  STR2NUM_OCT2ULONG   15
  61. #define  STR2NUM_DEC2BYTE    16
  62. #define  STR2NUM_DEC2SHORT   17
  63. #define  STR2NUM_DEC2USHORT  18
  64. #define  STR2NUM_DEC2LONG    19
  65. #define  STR2NUM_DEC2ULONG   20
  66.  
  67. /*********************************************************************/
  68. /* Definitions for Val2Str()                                         */
  69. /*********************************************************************/
  70.  
  71. #define  VAL2STR_STR2STR      0
  72. #define  VAL2STR_HFILE2DEC    1
  73. #define  VAL2STR_BYTE2DEC     2
  74. #define  VAL2STR_SHORT2DEC    3
  75. #define  VAL2STR_USHORT2DEC   4
  76. #define  VAL2STR_LONG2DEC     5
  77. #define  VAL2STR_ULONG2DEC    6
  78. #define  VAL2STR_BYTE2HEX     7
  79. #define  VAL2STR_SHORT2HEX    8
  80. #define  VAL2STR_USHORT2HEX   9
  81. #define  VAL2STR_LONG2HEX    10
  82. #define  VAL2STR_ULONG2HEX   11
  83.  
  84. /*********************************************************************/
  85. /* Definitions for MsgBox()                                          */
  86. /*********************************************************************/
  87.  
  88. #define MSG_STACK_SIZE        8192
  89. #define MSG_MAX_LENGTH        255
  90. #define MSG_TITLE_LEN         60
  91.  
  92. #define MSG_DEFAULT_TITLE     "A message from RxAsync.Dll by Ian Timms"
  93.  
  94. #define MSG_ICON_STYLES       "NnIiWwQqSs"
  95. #define MSG_BUTTON_STYLES     "VvIiWwQqSsRrAa"
  96.  
  97. #define MSG_RESPONSE_OK       0
  98. #define MSG_RESPONSE_CANCEL   1
  99. #define MSG_RESPONSE_IGNORE   2
  100. #define MSG_RESPONSE_HELP     3
  101.  
  102. #pragma pack(1)                        /* pack on 1 byte boundary    */
  103.  
  104. typedef struct _MYMSG                  /* msg                        */
  105. {
  106.    TID      tidMyMsg;                  /* Thread ID                  */
  107.    HAB      habMyMsg;                  /* Anchor block               */
  108.    HMQ      hmqMyMsg;                  /* Message queue              */
  109.    HWND     hwndMyMsg;                 /* Owned by window            */
  110.    CHAR     szTitle[MSG_TITLE_LEN+1];  /* Message box title          */
  111.    CHAR     chIcon;                    /* Message box icon to use    */
  112.    CHAR     chButtons;                 /* Message box type to use    */
  113.    CHAR     chHelp;                    /* Message box help wanted    */
  114.    USHORT   usNumber;                  /* Message number for help use*/
  115.    CHAR     szText[MSG_MAX_LENGTH+1];  /* Message text itself        */
  116.    USHORT   usReply;                   /* Reply to be returned       */
  117. } MYMSG;
  118. typedef MYMSG *PMYMSG;
  119.  
  120. /*********************************************************************/
  121. /* Prototypes                                                        */
  122. /*********************************************************************/
  123.  
  124. BOOL Str2Num( PSZ NumStr, PVOID pNumber, USHORT NumType );
  125.  
  126. VOID Val2Str( PVOID pValue, PSZ ValStr, USHORT ValType );
  127.  
  128. LONG MyDiffTime( PDATETIME Tnow, PDATETIME Tthen );
  129.  
  130. APIRET SetPriority( ULONG ulClass, LONG lLevel );
  131.  
  132. APIRET MsgBox( PSZ pszTitle, CHAR chIcon, CHAR chButtons, CHAR chHelp, USHORT usNumber, PSZ pszText );
  133.  
  134. VOID MsgBoxThread( PVOID arg );
  135.  
  136. VOID StripNulls( PSZ pszBuffer, PULONG pulLength );
  137.  
  138. VOID ReplaceNulls( PSZ pszBuffer, ULONG ulLength, BYTE bReplace );
  139.  
  140. /*********************************************************************/
  141.  
  142. #endif
  143.  
  144. /*********************************************************************/
  145. /* END MODULE                                                        */
  146. /*********************************************************************/
  147.