home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / python / pytexdoc / ext / source / !Python / Monty / c / unixstuff < prev   
Encoding:
Text File  |  1996-08-06  |  729 b   |  42 lines

  1. /* Fudge unix isatty and fileno for RISCOS */
  2.  
  3. #include "h.unixstuff"
  4. #include <math.h>
  5. #include "h.osfile"
  6.  
  7. int fileno(FILE *f)
  8. { return (int)f;
  9. }
  10.  
  11. int isatty(int fn)
  12. { return (fn==fileno(stdin));
  13. }
  14.  
  15. bits unixtime(bits ld,bits ex)
  16. { ld&=0xFF;
  17.   ld-=51;
  18.   if(ex<1855548004U) ld--;
  19.   ex-=1855548004U;
  20.   return ex/100+42949672*ld+(95*ld)/100;
  21. }
  22.  
  23. long PyOS_GetLastModificationTime(char *name)
  24. { int obj;
  25.   bits la,ea,ftype;
  26.   if(xosfile_read_stamped_no_path(name,&obj,&la,&ea,0,0,&ftype)) return -1;
  27.   if(obj!=osfile_IS_FILE) return -1;
  28.   if(ftype==osfile_TYPE_UNTYPED) return -1;
  29.   return (long)unixtime(la,ea);
  30. }
  31.  
  32. int unlink(char *fname)
  33. { remove(fname);
  34.   return 0;
  35. }
  36.  
  37. double hypot(double x,double y)
  38. { return sqrt(x*x+y*y);
  39. }
  40.  
  41.  
  42.