annotate Python/getmtime.c @ 13658:f79434ee41fa legacy-trunk

Mass ANSIfication of function definitions. Doesn't cover all 'extern' declarations yet, those come later.
author Thomas Wouters <thomas@python.org>
date Sat, 22 Jul 2000 18:47:25 +0000
parents 4ce255495da3
children 6f6f965c5e2d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 /***********************************************************
13255
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 13226
diff changeset
2 Copyright (c) 2000, BeOpen.com.
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 13226
diff changeset
3 Copyright (c) 1995-2000, Corporation for National Research Initiatives.
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 13226
diff changeset
4 Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 13226
diff changeset
5 All rights reserved.
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
13255
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 13226
diff changeset
7 See the file "Misc/COPYRIGHT" for information on usage and
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 13226
diff changeset
8 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 ******************************************************************/
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 /* Subroutine to get the last modification time of a file */
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
12
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 /* (A separate file because this may be OS dependent) */
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
14
13226
12437deb0680 Trent Mick <trentm@activestate.com>:
Fred Drake <fdrake@acm.org>
parents: 6243
diff changeset
15 #include "Python.h"
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1449
diff changeset
16 #include "config.h"
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1449
diff changeset
17
6243
4279f4eb210a First part of package support.
Guido van Rossum <guido@python.org>
parents: 5440
diff changeset
18 #include <stdio.h>
13267
4ce255495da3 Jack Jansen, Mac patch:
Guido van Rossum <guido@python.org>
parents: 13256
diff changeset
19 #ifndef DONT_HAVE_SYS_TYPES_H
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 #include <sys/types.h>
13267
4ce255495da3 Jack Jansen, Mac patch:
Guido van Rossum <guido@python.org>
parents: 13256
diff changeset
21 #endif
4ce255495da3 Jack Jansen, Mac patch:
Guido van Rossum <guido@python.org>
parents: 13256
diff changeset
22 #ifndef DONT_HAVE_SYS_STAT_H
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 #include <sys/stat.h>
13267
4ce255495da3 Jack Jansen, Mac patch:
Guido van Rossum <guido@python.org>
parents: 13256
diff changeset
24 #elif defined(HAVE_STAT_H)
4ce255495da3 Jack Jansen, Mac patch:
Guido van Rossum <guido@python.org>
parents: 13256
diff changeset
25 #include <stat.h>
4ce255495da3 Jack Jansen, Mac patch:
Guido van Rossum <guido@python.org>
parents: 13256
diff changeset
26 #endif
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
27
13226
12437deb0680 Trent Mick <trentm@activestate.com>:
Fred Drake <fdrake@acm.org>
parents: 6243
diff changeset
28 time_t
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13267
diff changeset
29 PyOS_GetLastModificationTime(char *path, FILE *fp)
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 {
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 struct stat st;
6243
4279f4eb210a First part of package support.
Guido van Rossum <guido@python.org>
parents: 5440
diff changeset
32 if (fstat(fileno(fp), &st) != 0)
1449
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 return -1;
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 else
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 return st.st_mtime;
ae93ec4dd556 New files.
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 }