Issue #4817: Remove unused function PyOS_GetLastModificationTime.

This commit is contained in:
Martin v. Löwis 2009-01-03 17:19:26 +00:00
parent 37fc82348c
commit 0fa10b3cd5
17 changed files with 2 additions and 84 deletions

View file

@ -15,13 +15,6 @@ Operating System Utilities
one of the strings ``'<stdin>'`` or ``'???'``. one of the strings ``'<stdin>'`` or ``'???'``.
.. cfunction:: long PyOS_GetLastModificationTime(char *filename)
Return the time of last modification of the file *filename*. The result is
encoded in the same way as the timestamp returned by the standard C library
function :cfunc:`time`.
.. cfunction:: void PyOS_AfterFork() .. cfunction:: void PyOS_AfterFork()
Function to update some internal state after a process fork; this should be Function to update some internal state after a process fork; this should be

View file

@ -841,9 +841,6 @@ PyNumber_Xor:PyObject*::+1:
PyNumber_Xor:PyObject*:o1:0: PyNumber_Xor:PyObject*:o1:0:
PyNumber_Xor:PyObject*:o2:0: PyNumber_Xor:PyObject*:o2:0:
PyOS_GetLastModificationTime:long:::
PyOS_GetLastModificationTime:char*:filename::
PyObject_AsFileDescriptor:int::: PyObject_AsFileDescriptor:int:::
PyObject_AsFileDescriptor:PyObject*:o:0: PyObject_AsFileDescriptor:PyObject*:o:0:

View file

@ -264,7 +264,6 @@ PYTHON_OBJS= \
Python/getargs.o \ Python/getargs.o \
Python/getcompiler.o \ Python/getcompiler.o \
Python/getcopyright.o \ Python/getcopyright.o \
Python/getmtime.o \
Python/getplatform.o \ Python/getplatform.o \
Python/getversion.o \ Python/getversion.o \
Python/graminit.o \ Python/graminit.o \

View file

@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #4817: Remove unused function PyOS_GetLastModificationTime.
- Issue #4075: Use OutputDebugStringW in Py_FatalError. - Issue #4075: Use OutputDebugStringW in Py_FatalError.
- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open - Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open

View file

@ -410,10 +410,6 @@ SOURCE=..\..\Python\getcopyright.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Python\getmtime.c
# End Source File
# Begin Source File
SOURCE=..\..\Python\getopt.c SOURCE=..\..\Python\getopt.c
# End Source File # End Source File
# Begin Source File # Begin Source File

View file

@ -568,9 +568,6 @@
<File <File
RelativePath="..\..\Python\getcopyright.c"> RelativePath="..\..\Python\getcopyright.c">
</File> </File>
<File
RelativePath="..\..\Python\getmtime.c">
</File>
<File <File
RelativePath="..\..\Python\getopt.c"> RelativePath="..\..\Python\getopt.c">
</File> </File>

View file

@ -1686,10 +1686,6 @@
RelativePath="..\..\Python\getcopyright.c" RelativePath="..\..\Python\getcopyright.c"
> >
</File> </File>
<File
RelativePath="..\..\Python\getmtime.c"
>
</File>
<File <File
RelativePath="..\..\Python\getopt.c" RelativePath="..\..\Python\getopt.c"
> >

View file

@ -351,7 +351,6 @@ SRC.PYTHON= $(addprefix $(TOP), \
Python/getargs.c \ Python/getargs.c \
Python/getcompiler.c \ Python/getcompiler.c \
Python/getcopyright.c \ Python/getcopyright.c \
Python/getmtime.c \
Python/getplatform.c \ Python/getplatform.c \
Python/getversion.c \ Python/getversion.c \
Python/graminit.c \ Python/graminit.c \

View file

@ -931,9 +931,6 @@ EXPORTS
; From python27_s.lib(getcopyright) ; From python27_s.lib(getcopyright)
"Py_GetCopyright" "Py_GetCopyright"
; From python27_s.lib(getmtime)
"PyOS_GetLastModificationTime"
; From python27_s.lib(getplatform) ; From python27_s.lib(getplatform)
"Py_GetPlatform" "Py_GetPlatform"

View file

@ -1693,8 +1693,6 @@ getcopyright.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
$(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \ $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
$(PY_INCLUDE)\tupleobject.h $(PY_INCLUDE)\tupleobject.h
getmtime.obj: pyconfig.h
getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \ getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
$(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \ $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \ pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \

View file

@ -1155,8 +1155,6 @@ getcopyright.obj: abstract.h ceval.h classobject.h cobject.h \
pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \ pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
stringobject.h sysmodule.h traceback.h tupleobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
getmtime.obj: pyconfig.h
getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \ getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \ pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
import.h intobject.h intrcheck.h listobject.h longobject.h \ import.h intobject.h intrcheck.h listobject.h longobject.h \

View file

@ -284,7 +284,6 @@ EXPORTS
PyNumber_Xor PyNumber_Xor
PyOS_AfterFork PyOS_AfterFork
PyOS_FiniInterrupts PyOS_FiniInterrupts
PyOS_GetLastModificationTime
PyOS_InitInterrupts PyOS_InitInterrupts
PyOS_InterruptOccurred PyOS_InterruptOccurred
PyOS_Readline PyOS_Readline

View file

@ -1686,10 +1686,6 @@
RelativePath="..\Python\getcopyright.c" RelativePath="..\Python\getcopyright.c"
> >
</File> </File>
<File
RelativePath="..\Python\getmtime.c"
>
</File>
<File <File
RelativePath="..\Python\getopt.c" RelativePath="..\Python\getopt.c"
> >

View file

@ -1,26 +0,0 @@
/* Subroutine to get the last modification time of a file */
/* (A separate file because this may be OS dependent) */
#include "Python.h"
#include "pyconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
time_t
PyOS_GetLastModificationTime(char *path, FILE *fp)
{
struct stat st;
if (fstat(fileno(fp), &st) != 0)
return -1;
else
return st.st_mtime;
}
#ifdef __cplusplus
}
#endif

View file

@ -27,8 +27,6 @@ extern "C" {
typedef unsigned short mode_t; typedef unsigned short mode_t;
#endif #endif
extern time_t PyOS_GetLastModificationTime(char *, FILE *);
/* In getmtime.c */
/* Magic word to reject .pyc files generated by other Python versions. /* Magic word to reject .pyc files generated by other Python versions.
It should change for each incompatible change to the bytecode. It should change for each incompatible change to the bytecode.

View file

@ -135,7 +135,6 @@ OBJECTS_PYTHON =\
OBJECTS_RISCOS = \ OBJECTS_RISCOS = \
@.Python.o.dynload_riscos\ @.Python.o.dynload_riscos\
@.Python.o.getcwd_riscos\ @.Python.o.getcwd_riscos\
@.Python.o.getmtime_riscos\
@.o.unixstuff @.o.unixstuff

View file

@ -1,20 +0,0 @@
#include <stdio.h>
#define __swi
#include "oslib/osfile.h"
long PyOS_GetLastModificationTime(char *path, FILE *fp)
{
int obj;
bits load, exec, ftype;
if (xosfile_read_stamped_no_path(path, &obj, &load, &exec, 0, 0, &ftype)) return -1;
if (obj != osfile_IS_FILE) return -1;
if (ftype == osfile_TYPE_UNTYPED) return -1;
load &= 0xFF;
load -= 51;
if (exec < 1855548004U) load--;
exec -= 1855548004U;
return exec/100+42949672*load+(95*load)/100;
}