/* sft.c : atari-st spezifische routinen * * R. Henze 05.10.90 * last edit: 08.07.91 * */ #define aux 1 #define con 2 #define exit_com() /*dummy*/ /* ------------------------------- */ unsigned char conin() { int c; int i; c = bios(2,2); i = c>>16; if (i>0x3a && i<0x68) /* function keys, incl cntrl-fnct. */ c = (c>>16) | 0x00000080; else c = c & 0x000000ff; return ((unsigned char)c); } /* ------------------------------- */ void conout(c) unsigned char c; { Bconout(con,(int)c); } /* ------------------------------- */ #define noparity 0x00 #define oddparity 0x08 #define evenparity 0x18 #define dbits8 0x03 #define dbits7 0x02 #define sbits1 0x00 #define sbits2 0x04 void init_com(baud) int baud; { int par; int dbits; ser_stat = 0; cbuf_ful = 0; } /* ------------------------------- */ int receive_com(chr) unsigned char *chr; { int flag; if(Bconstat(aux)!=0) *chr = (unsigned char)Bconin(aux); flag = 1; else flag = 0; return(flag); } /* ------------------------------- */ int send_com(chr) unsigned char chr; { Bconout(aux,chr); ser_stat = 0; cbuf_ful = 0; return(1); } /* ------------------------------- */ /* int stat_com() { ser_stat = Bconstat(aux); return(ser_stat); } */ /* ------------------------------- */ int out_open(line) unsigned char *line; { int i; i = open(line,O_RAW | O_WRONLY | O_CREAT,S_IWRITE); if (i == -1) quit("outputfile open error"); return(i); } /* ------------------------------- */ int in_open(line) unsigned char *line; { int i; i = open(line,O_RAW | O_RDONLY, S_IREAD); if (i == -1) quit("inputfile open error"); return(i); } /* ------------------------------------------------------------------------ */ /* ----- file date and time ----------------------------------------------- */ /* ------------------------------------------------------------------------ */ #define g_tsec(p) ((unsigned char)((p) & 0x0000001fL)) #define g_min(p) ((unsigned char)(((p) & 0x000007e0L)>>5)) #define g_hour(p) ((unsigned char)(((p) & 0x0000f800L)>>11)) #define g_day(p) ((unsigned char)(((p) & 0x001f0000L)>>16)) #define g_mon(p) ((unsigned char)(((p) & 0x01e00000L)>>21)) #define g_year(p) ((unsigned char)(((p) & 0xfe000000L)>>25)) #define s_tsec(c) ((long)(c)) #define s_min(c) (((long)(c))<<5) #define s_hour(c) (((long)(c))<<11) #define s_day(c) (((long)(c))<<16) #define s_mon(c) (((long)(c))<<21) #define s_year(c) (((long)(c))<<25) unsigned char btsec; unsigned char bmin; unsigned char bhour; unsigned char bday; unsigned char bmon; unsigned char byear; long filetime; unsigned char ib; void getftimdat() { filetime = s_tsec(get_com()); filetime = filetime | s_min(get_com()); filetime = filetime | s_hour(get_com()); filetime = filetime | s_day(get_com()); filetime = filetime | s_mon(get_com()); filetime = filetime | s_year(get_com()); } /* ------------------------------------------------------------------------ */ void putftimdat() { put_com(g_tsec(filetime)); put_com(g_min(filetime)); put_com(g_hour(filetime)); put_com(g_day(filetime)); put_com(g_mon(filetime)); put_com(g_year(filetime)); } /* ------------------------------------------------------------------------ */ void setfiletime(fh); int fh; { /*filetime = getft(fh);*/ /*funktionniert nicht!*/ ; } /* ------------------------------------------------------------------------ */ void getfiletime(fh); int fh; { /*chgft(fh,filetime);*/ /*funktionniert nicht!*/ ; } /* ------------------------------------------------------------------------ */ /* end of file sftata.i */