annotate RISCOS/Python/getmtime_riscos.c @ 32115:84dfa9a67da1 legacy-trunk

ConfigParser: - don't allow setting options to non-string values; raise TypeError when the value is set, instead of raising an arbitrary exception later (such as when string interpolation is performed) - add tests, documentation (closes SF bug #810843)
author Fred Drake <fdrake@acm.org>
date Tue, 18 May 2004 03:29:52 +0000
parents 2d3cee9f1633
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16941
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 #include <stdio.h>
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
2
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 #define __swi
20652
2d3cee9f1633 SF patch #474590 -- RISC OS support
Guido van Rossum <guido@python.org>
parents: 16941
diff changeset
4 #include "oslib/osfile.h"
16941
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
5
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 long PyOS_GetLastModificationTime(char *path, FILE *fp)
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 {
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 int obj;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 bits load, exec, ftype;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
10
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 if (xosfile_read_stamped_no_path(path, &obj, &load, &exec, 0, 0, &ftype)) return -1;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 if (obj != osfile_IS_FILE) return -1;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 if (ftype == osfile_TYPE_UNTYPED) return -1;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
14
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 load &= 0xFF;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 load -= 51;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 if (exec < 1855548004U) load--;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 exec -= 1855548004U;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 return exec/100+42949672*load+(95*load)/100;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 }