home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / util / misc / mcalc / source / mcalc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-18  |  11.0 KB  |  296 lines

  1. /*
  2. Auto:        smake MCalc
  3. */
  4.  
  5.  
  6. /* $Revision Header built automatically *************** (do not edit) ************
  7. **
  8. ** © Copyright by GuntherSoft
  9. **
  10. ** File             : SnakeSYS:CPrgs/MUICalc/MCalc.h
  11. ** Created on       : Saturday, 02.10.93 02:16:34
  12. ** Created by       : Kai Iske
  13. ** Current revision : V1.4
  14. **
  15. **
  16. ** Purpose
  17. ** -------
  18. **   - Header-File for MCalc
  19. **
  20. ** Revision V1.4
  21. ** --------------
  22. ** created on Thursday, 17.03.94 20:09:05  by  Kai Iske.   LogMessage :
  23. **  -*-  changed on Donnerstag, 18.08.94 17:35:24  by  Kai Iske.   LogMessage :
  24. **   - MCalc didn`t even care about Percent calculations
  25. **  -*-  changed on Sonntag, 07.08.94 20:30:27  by  Kai Iske.   LogMessage :
  26. **   - atan() wasn`t definied for some ranges (somehow)
  27. **  -*-  changed on Sonntag, 07.08.94 20:17:13  by  Kai Iske.   LogMessage :
  28. **   - The InputString will be default object now
  29. **  -*-  created on Thursday, 17.03.94 20:09:05  by  Kai Iske.   LogMessage :
  30. **   - Recompiled with Scanner generated by flex 2.4.6
  31. **
  32. ** Revision V1.3
  33. ** --------------
  34. ** created on Friday, 11.02.94 23:34:08  by  Kai Iske.   LogMessage :
  35. **  -*-  changed on Friday, 11.02.94 23:35:32  by  Kai Iske.   LogMessage :
  36. **   - One couldn`t use 1e3 for scientific notation of 1000. You
  37. **     had to write 1.0e3. Changed
  38. **     (Reported by : Henry Norman)
  39. **   - No more error lines will be copied from History
  40. **     (Requested by : Stefan Stuntz)
  41. **  -*-  created on Friday, 11.02.94 23:34:08  by  Kai Iske.   LogMessage :
  42. **   - "Radiant" was wrong. Changed. Why didn`t anybody tell me.
  43. **     (Reported by : Henry Norman)
  44. **   - Chose wrong case for mathematical "e".
  45. **     (Reported by : Henry Norman)
  46. **
  47. ** Revision V1.2
  48. ** --------------
  49. ** created on Tuesday, 19.10.93 23:41:00  by  Kai Iske.   LogMessage :
  50. **  -*-  changed on Wednesday, 08.12.93 23:48:31  by  Kai Iske.   LogMessage :
  51. **   - Default number of history lines increased
  52. **     (Requested by : Stefan Stuntz)
  53. **  -*-  changed on Sunday, 05.12.93 22:30:41  by  Kai Iske.   LogMessage :
  54. **   - No checks were made on the ENTRY argument to an ARexx
  55. **     function
  56. **  -*-  changed on Sunday, 05.12.93 18:13:56  by  Kai Iske.   LogMessage :
  57. **   - For calculations via ARexx one can set the type, size, sign
  58. **     and angle flags seperately, now
  59. **  -*-  changed on Sunday, 05.12.93 17:50:09  by  Kai Iske.   LogMessage :
  60. **   - Improved error handling from within ARexx commands a bit
  61. **  -*-  changed on Sunday, 05.12.93 17:46:35  by  Kai Iske.   LogMessage :
  62. **   - MUIProCalc may output TeX style mathematical expressions
  63. **     when using the ARexx commands. Additionally there is another
  64. **     option to convert expressions to TeX format.
  65. **     (Requested by : Volker Güth)
  66. **  -*-  changed on Sunday, 05.12.93 16:47:59  by  Kai Iske.   LogMessage :
  67. **   - Added more ARexx functions to the default ones
  68. **     (CALC, GETINPUT, GETOUTPUT)
  69. **     (Requested by : Volker Güth)
  70. **  -*-  changed on Sunday, 05.12.93 01:47:36  by  Kai Iske.   LogMessage :
  71. **   - MUIProCalc didn`t handle extremly small values
  72. **     (Reported by : Volker Güth)
  73. **  -*-  changed on Sunday, 05.12.93 01:38:18  by  Kai Iske.   LogMessage :
  74. **   - Default values weren`t set up
  75. **   - ACLR and CLR gadget have got menu entries too, now
  76. **     (Requested by : Volker Güth)
  77. **   - History entries may be copied to clipboard now
  78. **     (Requested by : Volker Güth)
  79. **  -*-  changed on Saturday, 27.11.93 01:01:25  by  Kai Iske.   LogMessage :
  80. **   - Recompiled using SAS 6.50
  81. **  -*-  changed on Wednesday, 20.10.93 00:24:41  by  Kai Iske.   LogMessage :
  82. **   - Bug in ListView display fixed
  83. **  -*-  created on Tuesday, 19.10.93 23:41:00  by  Kai Iske.   LogMessage :
  84. **   - You may now tell MCalc to clear the input string after
  85. **     hitting RETURN or EXEC.
  86. **
  87. ** Revision V1.1
  88. ** --------------
  89. ** created on Tuesday, 12.10.93 01:50:26  by  Kai Iske.   LogMessage :
  90. **  -*-  changed on Sunday, 17.10.93 15:03:10  by  Kai Iske.   LogMessage :
  91. **   - Save and Use gadgets weren`t arranged as proposed
  92. **     by the AUISG. (Reported by: Stefan Stuntz)
  93. **   - Changed layout of Prefs window a bit
  94. **     (Suggested by: Stefan Stuntz)
  95. **  -*-  changed on Friday, 15.10.93 18:39:50  by  Kai Iske.   LogMessage :
  96. **   - NOT operator didn`t behave as expected ;) It was a simple
  97. **     negate... (Reported by : Top on IRC)
  98. **  -*-  changed on Thursday, 14.10.93 18:01:32  by  Kai Iske.   LogMessage :
  99. **   - Hex-Values may be entered using 'C'-Style now (e.g. 0xff)
  100. **  -*-  changed on Thursday, 14.10.93 00:34:55  by  Kai Iske.   LogMessage :
  101. **   - One can use the faktorian '!' behind numbers now, too.
  102. **     (Suggested by : Top on IRC)
  103. **  -*-  changed on Thursday, 14.10.93 00:28:52  by  Kai Iske.   LogMessage :
  104. **   - One could accidentially change the ordering of the
  105. **     functions and input-gadgets groups by using
  106. **     'No Functions' and 'No Input' (reported by: Top on IRC)
  107. **  -*-  created on Tuesday, 12.10.93 01:50:26  by  Kai Iske.   LogMessage :
  108. **   - Order of Input and Ouput gadgets (String + ListView) may be
  109. **     set now, ie. the input string may show up underneith the
  110. **     ListView and vice versa (Requested by Dirk Federlein)
  111. **
  112. ** Revision V1.0
  113. ** --------------
  114. ** created on Saturday, 02.10.93 02:16:34  by  Kai Iske.   LogMessage :
  115. **     --- Initial release ---
  116. **
  117. *********************************************************************************/
  118. #define REVISION "1.4"
  119. #define REVDATE  "18.08.94"
  120. #define REVTIME  "17:35:24"
  121. #define AUTHOR   "Kai Iske"
  122. #define VERNUM   1
  123. #define REVNUM   4
  124.  
  125.  
  126. #ifndef        MCALC_H
  127. #define        MCALC_H
  128.  
  129.  
  130.  
  131. /**********************************************************************/
  132. /*                         Parser-Prototypes                          */
  133. /**********************************************************************/
  134. int        yyparse(void);
  135. int        yyerror(char *s);
  136. ULONG        make_ulong(double OldVal);
  137. double        calc_fak(double Fak);
  138. double        calc_angle(double Value);
  139. BOOL        check_angle(double Value, int Mode);
  140.  
  141.  
  142.  
  143. /**********************************************************************/
  144. /*                         Scanner-Prototypes                         */
  145. /**********************************************************************/
  146. int    yylex(void);
  147. void    yyrestart(FILE *File);
  148. void    count(void);
  149. int    calc_int_value(char *s);
  150. int    calc_hex_value(char *s, int leng);
  151. int    calc_bin_value(char *s);
  152. int    calc_oct_value(char *s);
  153. int    calc_dbl_value(char *s);
  154.  
  155.  
  156.  
  157. /**********************************************************************/
  158. /*                   Error-Codes for Scanner/Parser                   */
  159. /**********************************************************************/
  160. #define    ERR_PARSE    1
  161. #define    ERR_UNKNOWN_CHR    2
  162. #define    ERR_DIVBY0    3
  163. #define    ERR_OVERFLOW    4
  164.  
  165.  
  166.  
  167.  
  168. /**********************************************************************/
  169. /*                      My constant definitions                       */
  170. /**********************************************************************/
  171. #define Pi      ((double) 3.141592653589793)
  172.  
  173.  
  174.  
  175.  
  176. /**********************************************************************/
  177. /*                        Assembler-Prototypes                        */
  178. /**********************************************************************/
  179. ULONG    __asm MyASL(register __d0 ULONG In, register __d1 ULONG Out);
  180. ULONG    __asm MyASR(register __d0 ULONG In, register __d1 ULONG Out);
  181. ULONG    __asm MyLSL(register __d0 ULONG In, register __d1 ULONG Out);
  182. ULONG    __asm MyLSR(register __d0 ULONG In, register __d1 ULONG Out);
  183. ULONG    __asm MyROL(register __d0 ULONG In, register __d1 ULONG Out);
  184. ULONG    __asm MyROR(register __d0 ULONG In, register __d1 ULONG Out);
  185. ULONG    __asm MyXOR(register __d0 ULONG In, register __d1 ULONG Out);
  186. ULONG    __asm MyNAND(register __d0 ULONG In, register __d1 ULONG Out);
  187. ULONG    __asm MyNOR(register __d0 ULONG In, register __d1 ULONG Out);
  188. ULONG    __asm MyNXOR(register __d0 ULONG In, register __d1 ULONG Out);
  189. APTR    __asm DoCreatePool(register __d0 ULONG, register __d1 ULONG, register __d2 ULONG);
  190. void    __asm DoDeletePool(register __a0 APTR);
  191. APTR    __asm AllocVecPool(register __a0 APTR, register __d0 ULONG);
  192. void    __asm FreeVecPool(register __a0 APTR, register __a1 APTR);
  193.  
  194.  
  195.  
  196. /**********************************************************************/
  197. /*                   Structure for ListView display                   */
  198. /**********************************************************************/
  199. struct    ListStruct
  200. {
  201.     char    Input[258];
  202.     char    Output[258];
  203. };
  204.  
  205.  
  206.  
  207.  
  208.  
  209. /**********************************************************************/
  210. /*                         Some nice defines                          */
  211. /**********************************************************************/
  212.  
  213.     // This is our Version string
  214.  
  215. #define    MUIVERS        "$VER:MCalc "REVISION" ("REVDATE")"
  216.  
  217.  
  218.     // These are for Button/Menu IDs
  219.  
  220. #define    ID_QUIT        1            // Quit program
  221. #define    ID_ABOUT    2            // Display About
  222. #define    ID_PREFS    3            // Open Prefs
  223.  
  224. #define    ID_PICKLEFT    4            // Pick left entry from History
  225. #define    ID_PICKRIGHT    5            // Pick right entry from History
  226. #define    ID_CLIPCUTLEFT    6            // Clip left entry to clipboard
  227. #define    ID_CLIPCUTRIGHT    7            // Clip right entry to clipboard
  228.  
  229. #define    ID_DECIMAL    8            // Switch to dec display
  230. #define    ID_HEXDECIMAL    9            // Switch to hex display
  231. #define    ID_OCTAL    10            // Switch to oct display
  232. #define    ID_BINARY    11            // Switch to bin display
  233.  
  234. #define    ID_8BIT        12            // Set 8-Bit Base
  235. #define    ID_16BIT    13            // Set 16-Bit Base
  236. #define    ID_32BIT    14            // Set 32-Bit Base
  237.  
  238. #define    ID_SIGNED    15            // Switch to signed dec ouput
  239. #define    ID_UNSIGNED    16            // Switch to unsigned dec output
  240.  
  241. #define    ID_RAD        17            // Radiant angles
  242. #define    ID_DEG        18            // Degree angles
  243.  
  244. #define    ID_INPUT    19            // Received input from String gadget
  245. #define    ID_LISTVIEW    20            // Double clicked on ListView
  246. #define    ID_EXEC        21            // Translate input
  247. #define    ID_CLEAR    22            // Clear input gadget
  248. #define    ID_ALLCLEAR    23            // Clear input gadget AND memory
  249.  
  250.  
  251.  
  252. #define    ID_PREFS_QUIT    50            // Close Prefs window
  253. #define    ID_PREFS_NEW    51            // New Prefs set
  254.  
  255.  
  256.  
  257.  
  258.  
  259. /**********************************************************************/
  260. /*                    Definitions for Online-Help                     */
  261. /**********************************************************************/
  262. #define    HELPFILE        "PROGDIR:MCalc.guide"
  263. #define    NODE_MAIN        "Main"
  264. #define    NODE_INOUTPUT        "InputOutput"
  265. #define    NODE_FUNCTIONS        "FuncTables"
  266. #define    NODE_INPUTS        "Inputs"
  267. #define    NODE_PREFS        "Prefs"
  268. #define    NODE_LAYOUT        "Layout"
  269. #define    NODE_OUTPUT        "Output"
  270. #define    NODE_HISTORY        "History"
  271. #define    NODE_MISC        "Misc"
  272.  
  273.  
  274. /**********************************************************************/
  275. /*                   Defines for Clipboard support                    */
  276. /**********************************************************************/
  277. #define ID_FTXT    MAKE_ID('F','T','X','T')
  278. #define ID_CHRS    MAKE_ID('C','H','R','S')
  279.  
  280.  
  281. /**********************************************************************/
  282. /*                       Some defines for ARexx                       */
  283. /**********************************************************************/
  284. #define    GET_OUTPUT        1
  285. #define    GET_INPUT        2
  286.  
  287. #define    NORMAL_OUTPUT        1
  288. #define    TEX_OUTPUT        2
  289.  
  290. #define    GET_ACTIVE        -1
  291. #define    GET_TOPMOST        -2
  292. #define    GET_BOTTOMMOST        -3
  293.  
  294. #include    "Protos.h"
  295. #endif
  296.