|
|
1.1 ! root 1: /* ! 2: * sysdt ! 3: * ! 4: * at exit, xl points to a pseudo-scblk containing the date ! 5: */ ! 6: ! 7: #include <time.h> ! 8: #include "osint.h" ! 9: #include "spitblks.h" ! 10: ! 11: extern struct scblk tscblk; ! 12: ! 13: sysdt() ! 14: { ! 15: long tod; ! 16: register struct tm *tm; ! 17: struct tm *localtime(); ! 18: register char *p; ! 19: ! 20: time( &tod ); ! 21: tm = localtime( &tod ); ! 22: ! 23: conv( tscblk.str, tm->tm_mon+1 ); ! 24: tscblk.str[2] = '/'; ! 25: conv( tscblk.str+3, tm->tm_mday ); ! 26: tscblk.str[5] = '/'; ! 27: conv( tscblk.str+6, tm->tm_year ); ! 28: tscblk.str[8] = ' '; ! 29: conv( tscblk.str+9, tm->tm_hour ); ! 30: tscblk.str[11] = '.'; ! 31: conv( tscblk.str+12, tm->tm_min ); ! 32: tscblk.str[14] = '.'; ! 33: conv( tscblk.str+15, tm->tm_sec ); ! 34: tscblk.len = 17; ! 35: SET_XL( &tscblk ); ! 36: return NORMAL_RETURN; ! 37: } ! 38: ! 39: static ! 40: conv (dest, value) ! 41: ! 42: register char *dest; ! 43: register int value; ! 44: ! 45: { ! 46: dest[1] = value % 10 + '0'; ! 47: dest[0] = value / 10 + '0'; ! 48: } ! 49:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.