00001
00002
00003
00004
00005 #include <string.h>
00006 #include "machine.h"
00007 #include "stack-def.h"
00008 #include "basout.h"
00009
00010 extern int C2F(xscimore)();
00011 extern int C2F(writewtemore)();
00012 extern int C2F(diary)();
00013 extern int C2F(writelunitstring)();
00014 extern int C2F(xscion)();
00015 extern int C2F(xscistring)();
00016 extern int C2F(readrtechar)();
00017
00018 int C2F(basout)(integer *io,integer *lunit,char *string,long int notused)
00019 {
00020 static integer iflag;
00021 static char ch[1];
00022 static integer ich;
00023
00024 if (*lunit == C2F(iop).wte)
00025 {
00026
00027 C2F(xscion)(&iflag);
00028 *io = 0;
00029 if (C2F(iop).lct[0] == -1) { return 0; }
00030 if (C2F(iop).lct[1] > 0)
00031 {
00032
00033 if (C2F(iop).lct[0] + 3 > C2F(iop).lct[1])
00034 {
00035
00036 C2F(iop).lct[0] = 0;
00037 if (iflag == 0)
00038 {
00039
00040 C2F(writewtemore)();
00041 *(unsigned char *)ch = ' ';
00042 C2F(readrtechar)(ch, 1L);
00043 if (*(unsigned char *)ch != ' ')
00044 {
00045 ich = 1;
00046 }
00047 }
00048 else
00049 {
00050
00051 C2F(xscimore)(&ich);
00052 }
00053 if (ich == 1)
00054 {
00055 C2F(iop).lct[0] = -1;
00056 *io = -1;
00057 return 0;
00058 }
00059 }
00060 else
00061 {
00062 ++C2F(iop).lct[0];
00063 }
00064 }
00065
00066 if (iflag == 0)
00067 {
00068 C2F(writelunitstring)(lunit, string, notused);
00069 }
00070 else
00071 {
00072 C2F(xscistring)(string, ¬used, notused);
00073 }
00074
00075 C2F(diary)(string, ¬used, notused);
00076 }
00077 else
00078 {
00079
00080 if (*lunit == C2F(iop).wio)
00081 {
00082 C2F(diary)(string, ¬used, notused);
00083 }
00084 else
00085 {
00086 C2F(writelunitstring)(lunit, string,notused);
00087 }
00088 }
00089 return 0;
00090 }
00091