home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Educational / RasMol / Source / rasmol.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-31  |  3.7 KB  |  202 lines

  1. /* rasmol.h
  2.  * RasMol2 Molecular Graphics
  3.  * Roger Sayle, August 1995
  4.  * Version 2.6
  5.  */
  6.  
  7.  
  8. /*===========================*/
  9. /*  User Definable Options!  */
  10. /*===========================*/
  11.  
  12. /* #define IBMPC        */
  13. /* #define APPLEMAC     */
  14. /* #define DIALBOX      */
  15. #define TERMIOS
  16. #define SOCKETS
  17. /* #define MITSHM       */
  18.  
  19. /* #define MMIOLIB      */
  20. /* #define OMLCOMMS     */
  21. /* #define CEXIOLIB     */
  22.  
  23. /* Use Default Depth!   */
  24. /* #define THIRTYTWOBIT */
  25. /* #define SIXTEENBIT */
  26. /* #define EIGHTBIT */
  27. /* #define TWOBIT */
  28.  
  29. /*========================*/
  30. /*  Default User Options! */
  31. /*========================*/
  32.  
  33. #ifdef NEXT
  34. #define View RMView
  35. #endif
  36.  
  37. #ifdef IBMPC
  38. #undef THIRTYTWOBIT
  39. #undef SIXTEENBIT
  40. #endif
  41.  
  42. #ifdef TWOBIT
  43. #define EIGHTBIT
  44. #endif
  45.  
  46. #if !defined(EIGHTBIT) && !defined(THIRTYTWOBIT) && !defined(SIXTEENBIT)
  47. #ifdef NEXT
  48. #define SIXTEENBIT
  49. #else
  50. #define EIGHTBIT
  51. #endif
  52. #endif
  53.  
  54. #ifndef RASMOLDIR
  55. #ifdef IBMPC
  56. #define RASMOLDIR  "C:\\RASWIN\\"
  57. #endif
  58.  
  59. #if !defined(IBMPC) && !defined(APPLEMAC) && !defined(VMS)
  60. #define RASMOLDIR "/usr/local/lib/rasmol/"
  61. #endif
  62. #endif
  63.  
  64. #if !defined(INVERT) && defined(IBMPC)
  65. #define INVERT
  66. #endif
  67.  
  68. #ifndef FUNCPROTO
  69. #if defined(__STDC__) || defined(IBMPC) || defined(APPLEMAC)
  70. #define FUNCPROTO
  71. #endif
  72. #endif
  73.  
  74. /*==============================*/
  75. /*  Application-wide Constants  */
  76. /*==============================*/
  77.  
  78. #ifndef True
  79. #define True  1
  80. #define False 0
  81. #endif
  82.  
  83. #ifndef PI   /* Avoid Linux Warnings! */
  84. #define PI   3.14159265358979323846
  85. #endif
  86.  
  87.  
  88. typedef double Real;
  89. #ifndef APPLEMAC
  90. typedef unsigned char Byte;
  91. #endif
  92.  
  93. #ifdef __STDC__
  94. typedef signed char Char;
  95. #else
  96. typedef char Char;
  97. #endif
  98.  
  99. #ifdef _LONGLONG
  100. typedef unsigned int Card;
  101. typedef int Long;
  102. #else
  103. typedef unsigned long Card;
  104. typedef long Long;
  105. #endif
  106.  
  107. #ifdef EIGHTBIT
  108. typedef Byte Pixel;
  109. #else
  110. #ifdef SIXTEENBIT
  111. typedef unsigned short Pixel;
  112. #else
  113. typedef Long Pixel;
  114. #endif
  115. #endif
  116.  
  117.  
  118.  
  119. #define Rad2Deg      (180.0/PI)
  120. #define Deg2Rad      (PI/180.0)
  121. #define AbsFun(a)    (((a)<0)? -(a) : (a))
  122. #define MinFun(a,b)  (((a)<(b))? (a) : (b) )
  123. #define MaxFun(a,b)  (((a)>(b))? (a) : (b) )
  124.  
  125. #if defined(__STDC__) || defined(IBMPC)  || defined(APPLEMAC) || defined(__sgi)
  126. #define ToUpper(x)   (toupper((x)))
  127. #else
  128. #define ToUpper(x)   (islower((x))?toupper((x)):(x))
  129. #endif
  130.  
  131.  
  132. #if !defined(IBMPC) || defined(_WIN32)
  133. #ifdef APPLEMAC
  134. #define _fmalloc   NewPtrSys
  135. #define _ffree(x)  DisposePtr((Ptr)(x))
  136. #else
  137. #define _fmalloc   malloc
  138. #define _ffree     free
  139. #endif
  140. #define _fstrnicmp strnicmp
  141. #define _fstrcmp   strcmp
  142. #define _fmemset   memset
  143. #define __huge
  144. #define __far
  145. #endif
  146.  
  147.  
  148. #define ItemCount       8
  149. #define AdvPickAtom     0
  150. #define AdvPickNumber   1
  151. #define AdvSelectCount  2
  152. #define AdvName         3
  153. #define AdvIdent        4
  154. #define AdvClass        5
  155. #define AdvImage        6
  156. #define AdvPickCoord    7
  157.  
  158. #ifdef NEXT
  159. extern char *FileNamePtr;
  160. extern char *ScriptNamePtr;
  161. extern int LabelOptFlag;
  162. extern int FileFormat;
  163. extern int ProfCount;
  164. extern int LexState;
  165. extern int LastShade;
  166.  
  167. extern void ras_init(void);
  168. extern void InitTerminal(int socket);
  169. extern void RasMolSignalExit(int i);
  170. extern void RasMolFatalExit(char *msg);
  171. extern void ProfileExecution(void);
  172. extern void RefreshScreen(void);
  173. extern int HandleEvents(int wait);
  174. extern int ReadCharacter(void);
  175. extern int ProcessCommand(void);
  176. extern void LoadInitFile(void);
  177.  
  178. /* Won't link right with static, shouldn't matter anyway (AW)*/
  179. #define static
  180. #endif
  181.  
  182.  
  183. #ifndef RASMOL
  184. #ifdef FUNCPROTO
  185. void WriteChar( int );
  186. void WriteString( char* );
  187. void RasMolFatalExit( char* );
  188. void AdviseUpdate( int );
  189. void RefreshScreen();
  190. void RasMolExit();
  191.  
  192. #else /* non-ANSI C compiler */
  193. void WriteChar();
  194. void WriteString();
  195. void RasMolFatalExit();
  196. void RefreshScreen();
  197. void AdviseUpdate();
  198. void RasMolExit();
  199.  
  200. #endif
  201. #endif
  202.