Mercurial > cpython-lru_cache-weakref
annotate Python/getmtime.c @ 41769:b29d71d43c80
Add functions PyUnicode_Append() and PyUnicode_AppendAndDel() that mirror
PyString_Concat() and PyString_ConcatAndDel() (the name PyUnicode_Concat()
was already taken).
Change PyObject_Repr() to always return a unicode object.
Update all repr implementations to return unicode objects.
Add a function PyObject_ReprStr8() that calls PyObject_Repr() and converts
the result to an 8bit string.
Use PyObject_ReprStr8() where using PyObject_Repr() can't be done
straightforward.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Fri, 18 May 2007 17:15:44 +0000 |
| parents | f731859e9b3b |
| children |
| rev | line source |
|---|---|
| 1449 | 1 |
| 2 /* Subroutine to get the last modification time of a file */ | |
| 3 | |
| 4 /* (A separate file because this may be OS dependent) */ | |
| 5 | |
|
13226
12437deb0680
Trent Mick <trentm@activestate.com>:
Fred Drake <fdrake@acm.org>
parents:
6243
diff
changeset
|
6 #include "Python.h" |
|
18835
2dea40e40d9d
Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.
Martin v. Löwis <martin@v.loewis.de>
parents:
15978
diff
changeset
|
7 #include "pyconfig.h" |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1449
diff
changeset
|
8 |
|
37879
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
9 #ifdef __cplusplus |
|
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
10 extern "C" { |
|
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
11 #endif |
|
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
12 |
|
13226
12437deb0680
Trent Mick <trentm@activestate.com>:
Fred Drake <fdrake@acm.org>
parents:
6243
diff
changeset
|
13 time_t |
|
13658
f79434ee41fa
Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents:
13267
diff
changeset
|
14 PyOS_GetLastModificationTime(char *path, FILE *fp) |
| 1449 | 15 { |
| 16 struct stat st; | |
|
6243
4279f4eb210a
First part of package support.
Guido van Rossum <guido@python.org>
parents:
5440
diff
changeset
|
17 if (fstat(fileno(fp), &st) != 0) |
| 1449 | 18 return -1; |
| 19 else | |
| 20 return st.st_mtime; | |
| 21 } | |
|
37879
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
22 |
|
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
23 #ifdef __cplusplus |
|
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
24 } |
|
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
25 #endif |
|
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
18835
diff
changeset
|
26 |
