commit f0c48054a0202333bbc3b696cef4d02e8eb3abb8
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Feb 28 16:26:49 2012 -0500
cpychecker: add more docurl metadata
docs/cpychecker.rst | 42 ++++++++++++++++++------------------------
libcpychecker/refcounts.py | 22 ++++++++++++++++++++--
2 files changed, 38 insertions(+), 26 deletions(-)
---
diff --git a/docs/cpychecker.rst b/docs/cpychecker.rst
index 5dcd699..013dffa 100644
--- a/docs/cpychecker.rst
+++ b/docs/cpychecker.rst
@@ -599,17 +599,13 @@ function. This brings with it some shortcomings:
Only a subset of the CPython API has been modelled so far. The functions
known to the checker are:
-`PyArg_Parse`,
-`_PyArg_Parse_SizeT`,
-`PyArg_ParseTuple`,
-`_PyArg_ParseTuple_SizeT`,
-`PyArg_ParseTupleAndKeywords`,
-`_PyArg_ParseTupleAndKeywords_SizeT`,
+`PyArg_Parse and _PyArg_Parse_SizeT
<
http://docs.python.org/c-api/arg.html#PyArg_Parse>`_,
+`PyArg_ParseTuple and _PyArg_ParseTuple_SizeT
<
http://docs.python.org/c-api/arg.html#PyArg_ParseTuple>`_,
+`PyArg_ParseTupleAndKeywords and _PyArg_ParseTupleAndKeywords_SizeT
<
http://docs.python.org/c-api/arg.html#PyArg_ParseTupleAndKeywords>`_,
`PyArg_UnpackTuple <
http://docs.python.org/c-api/arg.html#PyArg_UnpackTuple>`_,
`Py_AtExit <
http://docs.python.org/c-api/sys.html#Py_AtExit>`_,
-`PyBool_FromLong`,
-`Py_BuildValue <
http://docs.python.org/c-api/arg.html#Py_BuildValue>`_,
-`_Py_BuildValue_SizeT <
http://docs.python.org/c-api/arg.html#Py_BuildValue>`_,
+`PyBool_FromLong <
http://docs.python.org/c-api/bool.html#PyBool_FromLong>`_,
+`Py_BuildValue and _Py_BuildValue_SizeT
<
http://docs.python.org/c-api/arg.html#Py_BuildValue>`_,
`PyCallable_Check <
http://docs.python.org/c-api/object.html#PyCallable_Check>`_,
`PyCapsule_GetPointer
<
http://docs.python.org/c-api/capsule.html#PyCapsule_GetPointer>`_,
`PyCObject_AsVoidPtr
<
http://docs.python.org/c-api/cobject.html#PyCObject_AsVoidPtr>`_,
@@ -617,22 +613,22 @@ known to the checker are:
`PyCObject_FromVoidPtrAndDesc
<
http://docs.python.org/c-api/cobject.html#PyCObject_FromVoidPtrAndDesc>`_,
`PyCode_New <
http://docs.python.org/c-api/code.html#PyCode_New>`_,
`PyDict_GetItem <
http://docs.python.org/c-api/dict.html#PyDict_GetItem>`_,
-`PyDict_GetItemString`,
-`PyDict_New`,
+`PyDict_GetItemString
<
http://docs.python.org/c-api/dict.html#PyDict_GetItemString>`_,
+`PyDict_New <
http://docs.python.org/c-api/dict.html#PyDict_New>`_,
`PyDict_SetItem <
http://docs.python.org/c-api/dict.html#PyDict_SetItem>`_,
`PyDict_SetItemString
<
http://docs.python.org/c-api/dict.html#PyDict_SetItemString>`_,
`PyDict_Size <
http://docs.python.org/c-api/dict.html#PyDict_Size>`_,
-`PyErr_Format`,
+`PyErr_Format <
http://docs.python.org/c-api/exceptions.html#PyErr_Format>`_,
`PyErr_NewException
<
http://docs.python.org/c-api/exceptions.html#PyErr_NewException>`_,
-`PyErr_NoMemory`,
+`PyErr_NoMemory <
http://docs.python.org/c-api/exceptions.html#PyErr_NoMemory>`_,
`PyErr_Occurred <
http://docs.python.org/c-api/exceptions.html#PyErr_Occurred>`_,
-`PyErr_Print`,
-`PyErr_PrintEx`,
+`PyErr_Print <
http://docs.python.org/c-api/exceptions.html#PyErr_Print>`_,
+`PyErr_PrintEx <
http://docs.python.org/c-api/exceptions.html#PyErr_PrintEx>`_,
`PyErr_SetFromErrno
<
http://docs.python.org/c-api/exceptions.html#PyErr_SetFromErrno>`_,
`PyErr_SetFromErrnoWithFilename
<
http://docs.python.org/c-api/exceptions.html#PyErr_SetFromErrnoWithFilena...,
`PyErr_SetNone <
http://docs.python.org/c-api/exceptions.html#PyErr_SetNone>`_,
`PyErr_SetObject <
http://docs.python.org/c-api/exceptions.html#PyErr_SetObject>`_,
-`PyErr_SetString`,
+`PyErr_SetString <
http://docs.python.org/c-api/exceptions.html#PyErr_SetString>`_,
`PyErr_WarnEx <
http://docs.python.org/c-api/exceptions.html#PyErr_WarnEx>`_,
`PyEval_CallMethod`,
`PyEval_CallObjectWithKeywords`,
@@ -653,13 +649,13 @@ known to the checker are:
`Py_Initialize <
http://docs.python.org/c-api/init.html#Py_Initialize>`_,
`Py_InitModule4_64`,
`PyInt_AsLong <
http://docs.python.org/c-api/int.html#PyInt_AsLong>`_,
-`PyInt_FromLong`,
+`PyInt_FromLong <
http://docs.python.org/c-api/int.html#PyInt_FromLong>`_,
`PyList_Append <
http://docs.python.org/c-api/list.html#PyList_Append>`_,
`PyList_GetItem <
http://docs.python.org/c-api/list.html#PyList_GetItem>`_,
-`PyList_New`,
+`PyList_New <
http://docs.python.org/c-api/list.html#PyList_New>`_,
`PyList_SetItem <
http://docs.python.org/c-api/list.html#PyList_SetItem>`_,
`PyList_Size <
http://docs.python.org/c-api/list.html#PyList_Size>`_,
-`PyLong_FromLong`,
+`PyLong_FromLong <
http://docs.python.org/c-api/long.html#PyLong_FromLong>`_,
`PyLong_FromLongLong
<
http://docs.python.org/c-api/long.html#PyLong_FromLongLong>`_,
`PyLong_FromString <
http://docs.python.org/c-api/long.html#PyLong_FromString>`_,
`PyLong_FromVoidPtr <
http://docs.python.org/c-api/long.html#PyLong_FromVoidPtr>`_,
@@ -674,11 +670,9 @@ known to the checker are:
`PyNumber_Remainer
<
http://docs.python.org/c-api/number.html#PyNumber_Remainder>`_,
`PyObject_AsFileDescriptor
<
http://docs.python.org/c-api/object.html#PyObject_AsFileDescriptor>`_,
`PyObject_Call <
http://docs.python.org/c-api/object.html#PyObject_Call>`_,
-`PyObject_CallFunction
<
http://docs.python.org/c-api/object.html#PyObject_CallFunction>`_,
-`_PyObject_CallFunction_SizeT
<
http://docs.python.org/c-api/object.html#PyObject_CallFunction>`_,
+`PyObject_CallFunction and _PyObject_CallFunction_SizeT
<
http://docs.python.org/c-api/object.html#PyObject_CallFunction>`_,
`PyObject_CallFunctionObjArgs
<
http://docs.python.org/c-api/object.html#PyObject_CallFunctionObjArgs>`_,
-`PyObject_CallMethod
<
http://docs.python.org/c-api/object.html#PyObject_CallMethod>`_,
-`_PyObject_CallMethod_SizeT`,
+`PyObject_CallMethod and _PyObject_CallMethod_SizeT
<
http://docs.python.org/c-api/object.html#PyObject_CallMethod>`_,
`PyObject_CallMethodObjArgs
<
http://docs.python.org/c-api/object.html#PyObject_CallMethodObjArgs>`_,
`PyObject_CallObject
<
http://docs.python.org/c-api/object.html#PyObject_CallObject>`_,
`PyObject_GetAttr <
http://docs.python.org/c-api/object.html#PyObject_GetAttr>`_,
@@ -692,7 +686,7 @@ known to the checker are:
`PyObject_Repr <
http://docs.python.org/c-api/object.html#PyObject_Repr>`_,
`PyObject_SetAttr <
http://docs.python.org/c-api/object.html#PyObject_SetAttr>`_,
`PyObject_SetAttrString
<
http://docs.python.org/c-api/object.html#PyObject_SetAttrString>`_,
-`PyObject_Str`,
+`PyObject_Str <
http://docs.python.org/c-api/object.html#PyObject_Str>`_,
`PyOS_snprintf <
http://docs.python.org/c-api/conversion.html#PyOS_snprintf>`_,
`PyRun_SimpleFileExFlags
<
http://docs.python.org/c-api/veryhigh.html#PyRun_SimpleFileExFlags>`_,
`PyRun_SimpleStringFlags
<
http://docs.python.org/c-api/veryhigh.html#PyRun_SimpleStringFlags>`_,
diff --git a/libcpychecker/refcounts.py b/libcpychecker/refcounts.py
index 7fbd1ea..1318ad8 100644
--- a/libcpychecker/refcounts.py
+++ b/libcpychecker/refcounts.py
@@ -887,6 +887,7 @@ class CPython(Facet):
def impl_PyArg_Parse(self, stmt, v_args, v_fmt, *v_varargs):
fnmeta = FnMeta(name='PyArg_Parse',
+
docurl='http://docs.python.org/c-api/arg.html#PyArg_Parse';,
declared_in='modsupport.h',
prototype='PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char
*, ...);',)
# Also, with #ifdef PY_SSIZE_T_CLEAN
@@ -896,6 +897,7 @@ class CPython(Facet):
def impl__PyArg_Parse_SizeT(self, stmt, v_args, v_fmt, *v_varargs):
fnmeta = FnMeta(name='_PyArg_Parse_SizeT',
+
docurl='http://docs.python.org/c-api/arg.html#PyArg_Parse';,
declared_in='modsupport.h',
prototype='PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char
*, ...);',)
# Also, with #ifdef PY_SSIZE_T_CLEAN
@@ -905,6 +907,7 @@ class CPython(Facet):
def impl_PyArg_ParseTuple(self, stmt, v_args, v_fmt, *v_varargs):
fnmeta = FnMeta(name='PyArg_ParseTuple',
+
docurl='http://docs.python.org/c-api/arg.html#PyArg_ParseTuple';,
declared_in='modsupport.h',
prototype='PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const
char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);',)
# Also, with #ifdef PY_SSIZE_T_CLEAN
@@ -915,6 +918,7 @@ class CPython(Facet):
def impl__PyArg_ParseTuple_SizeT(self, stmt, v_args, v_fmt, *v_varargs):
fnmeta = FnMeta(name='_PyArg_ParseTuple_SizeT',
+
docurl='http://docs.python.org/c-api/arg.html#PyArg_ParseTuple';,
declared_in='modsupport.h',
prototype='PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const
char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);',)
# Also, with #ifdef PY_SSIZE_T_CLEAN
@@ -926,6 +930,7 @@ class CPython(Facet):
def impl_PyArg_ParseTupleAndKeywords(self, stmt, v_args, v_kwargs,
v_fmt, v_keywords, *v_varargs):
fnmeta = FnMeta(name='PyArg_ParseTupleAndKeywords',
+
docurl='http://docs.python.org/c-api/arg.html#PyArg_ParseTupleAndKeyw...;,
declared_in='modsupport.h',
prototype=('PyAPI_FUNC(int)
PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,\n'
' const
char *, char **, ...);'),)
@@ -939,6 +944,7 @@ class CPython(Facet):
def impl__PyArg_ParseTupleAndKeywords_SizeT(self, stmt, v_args, v_kwargs,
v_fmt, v_keywords, *v_varargs):
fnmeta = FnMeta(name='_PyArg_ParseTupleAndKeywords_SizeT',
+
docurl='http://docs.python.org/c-api/arg.html#PyArg_ParseTupleAndKeyw...;,
declared_in='modsupport.h',
prototype=('PyAPI_FUNC(int)
PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,\n'
' const
char *, char **, ...);'),)
@@ -1028,6 +1034,7 @@ class CPython(Facet):
########################################################################
def impl_PyBool_FromLong(self, stmt, v_long):
fnmeta = FnMeta(name='PyBool_FromLong',
+
docurl='http://docs.python.org/c-api/bool.html#PyBool_FromLong';,
declared_in='boolobject.h',
prototype='PyAPI_FUNC(PyObject *)
PyBool_FromLong(long);',
defined_in='Objects/boolobject.c',
@@ -1295,6 +1302,7 @@ class CPython(Facet):
def impl_PyDict_GetItemString(self, stmt, v_dp, v_key):
fnmeta = FnMeta(name='PyDict_GetItemString',
+
docurl='http://docs.python.org/c-api/dict.html#PyDict_GetItemString';,
declared_in='dictobject.h',
prototype='PyAPI_FUNC(PyObject *)
PyDict_GetItemString(PyObject *dp, const char *key);',
defined_in='Objects/dictobject.c',
@@ -1322,7 +1330,8 @@ class CPython(Facet):
#t_memoryexc]
def impl_PyDict_New(self, stmt):
- fnmeta = FnMeta(name='PyDict_New')
+ fnmeta = FnMeta(name='PyDict_New',
+
docurl='http://docs.python.org/c-api/dict.html#PyDict_New')
r_newobj, t_success, t_failure = self.object_ctor(stmt,
'PyDictObject',
'PyDict_Type')
@@ -1407,6 +1416,7 @@ class CPython(Facet):
########################################################################
def impl_PyErr_Format(self, stmt, v_exc, v_fmt, *v_args):
fnmeta = FnMeta(name='PyErr_Format',
+
docurl='http://docs.python.org/c-api/exceptions.html#PyErr_Format';,
declared_in='pyerrors.h',
prototype='PyAPI_FUNC(void) PyErr_SetString(PyObject *, const
char *);',
defined_in='Python/errors.c',
@@ -1433,6 +1443,7 @@ class CPython(Facet):
def impl_PyErr_NoMemory(self, stmt):
fnmeta = FnMeta(name='PyErr_NoMemory',
+
docurl='http://docs.python.org/c-api/exceptions.html#PyErr_NoMemory';,
declared_in='pyerrors.h',
prototype='PyAPI_FUNC(PyObject *)
PyErr_NoMemory(void);',
defined_in='Python/errors.c',
@@ -1458,6 +1469,7 @@ class CPython(Facet):
def impl_PyErr_Print(self, stmt):
fnmeta = FnMeta(name='PyErr_Print',
+
docurl='http://docs.python.org/c-api/exceptions.html#PyErr_Print';,
declared_in='pythonrun.h',
prototype='PyAPI_FUNC(void) PyErr_Print(void);',
defined_in='Python/pythonrun.c',)
@@ -1469,6 +1481,7 @@ class CPython(Facet):
def impl_PyErr_PrintEx(self, stmt, v_int):
fnmeta = FnMeta(name='PyErr_PrintEx',
+
docurl='http://docs.python.org/c-api/exceptions.html#PyErr_PrintEx';,
declared_in='pythonrun.h',
prototype='PyAPI_FUNC(void) PyErr_PrintEx(int);',
defined_in='Python/pythonrun.c',)
@@ -1538,6 +1551,7 @@ class CPython(Facet):
def impl_PyErr_SetString(self, stmt, v_exc, v_string):
fnmeta = FnMeta(name='PyErr_SetString',
+
docurl='http://docs.python.org/c-api/exceptions.html#PyErr_SetString';,
declared_in='pyerrors.h',
prototype='PyAPI_FUNC(void) PyErr_SetString(PyObject *, const
char *);',
defined_in='Python/errors.c',)
@@ -1819,6 +1833,7 @@ class CPython(Facet):
def impl_PyInt_FromLong(self, stmt, v_ival):
fnmeta = FnMeta(name='PyInt_FromLong',
+
docurl='http://docs.python.org/c-api/int.html#PyInt_FromLong';,
declared_in='intobject.h',
prototype='PyAPI_FUNC(PyObject *)
PyInt_FromLong(long);',
defined_in='Objects/intobject.c')
@@ -1923,6 +1938,7 @@ class CPython(Facet):
def impl_PyList_New(self, stmt, v_len):
fnmeta = FnMeta(name='PyList_New',
+
docurl='http://docs.python.org/c-api/list.html#PyList_New';,
prototype='PyObject* PyList_New(Py_ssize_t len)',
notes='Returns a new reference, or raises MemoryError')
@@ -2016,7 +2032,8 @@ class CPython(Facet):
# PyLong_*
########################################################################
def impl_PyLong_FromLong(self, stmt, v_long):
- fnmeta = FnMeta(name='PyLong_FromLong')
+ fnmeta = FnMeta(name='PyLong_FromLong',
+
docurl='http://docs.python.org/c-api/long.html#PyLong_FromLong')
r_newobj, t_success, t_failure = self.object_ctor(stmt,
'PyLongObject',
'PyLong_Type')
@@ -2623,6 +2640,7 @@ class CPython(Facet):
def impl_PyObject_Str(self, stmt, v_o):
fnmeta = FnMeta(name='PyObject_Str',
+
docurl='http://docs.python.org/c-api/object.html#PyObject_Str';,
declared_in='object.h')
# PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *);
# also with: