fmt.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. struct syl
  2. { int op;
  3. int p1;
  4. union { int i[2]; char *s;} p2;
  5. };
  6. #define RET1 1
  7. #define REVERT 2
  8. #define GOTO 3
  9. #define X 4
  10. #define SLASH 5
  11. #define STACK 6
  12. #define I 7
  13. #define ED 8
  14. #define NED 9
  15. #define IM 10
  16. #define APOS 11
  17. #define H 12
  18. #define TL 13
  19. #define TR 14
  20. #define T 15
  21. #define COLON 16
  22. #define S 17
  23. #define SP 18
  24. #define SS 19
  25. #define P 20
  26. #define BN 21
  27. #define BZ 22
  28. #define F 23
  29. #define E 24
  30. #define EE 25
  31. #define D 26
  32. #define G 27
  33. #define GE 28
  34. #define L 29
  35. #define A 30
  36. #define AW 31
  37. #define O 32
  38. #define NONL 33
  39. #define OM 34
  40. #define Z 35
  41. #define ZM 36
  42. typedef union
  43. { real pf;
  44. doublereal pd;
  45. } ufloat;
  46. typedef union
  47. { short is;
  48. #ifndef KR_headers
  49. signed
  50. #endif
  51. char ic;
  52. integer il;
  53. #ifdef Allow_TYQUAD
  54. longint ili;
  55. #endif
  56. } Uint;
  57. #ifdef KR_headers
  58. extern int (*f__doed)(),(*f__doned)();
  59. extern int (*f__dorevert)();
  60. extern int rd_ed(),rd_ned();
  61. extern int w_ed(),w_ned();
  62. extern int signbit_f2c();
  63. extern char *f__fmtbuf;
  64. #else
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #define Cextern extern "C"
  68. #else
  69. #define Cextern extern
  70. #endif
  71. extern const char *f__fmtbuf;
  72. extern int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*);
  73. extern int (*f__dorevert)(void);
  74. extern void fmt_bg(void);
  75. extern int pars_f(const char*);
  76. extern int rd_ed(struct syl*, char*, ftnlen),rd_ned(struct syl*);
  77. extern int signbit_f2c(double*);
  78. extern int w_ed(struct syl*, char*, ftnlen),w_ned(struct syl*);
  79. extern int wrt_E(ufloat*, int, int, int, ftnlen);
  80. extern int wrt_F(ufloat*, int, int, ftnlen);
  81. extern int wrt_L(Uint*, int, ftnlen);
  82. #endif
  83. extern int f__pc,f__parenlvl,f__revloc;
  84. extern flag f__cblank,f__cplus,f__workdone, f__nonl;
  85. extern int f__scale;
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89. #define GET(x) if((x=(*f__getn)())<0) return(x)
  90. #define VAL(x) (x!='\n'?x:' ')
  91. #define PUT(x) (*f__putn)(x)
  92. #undef TYQUAD
  93. #ifndef Allow_TYQUAD
  94. #undef longint
  95. #define longint long
  96. #else
  97. #define TYQUAD 14
  98. #endif
  99. #ifdef KR_headers
  100. extern char *f__icvt();
  101. #else
  102. Cextern char *f__icvt(longint, int*, int*, int);
  103. #endif