summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Bondesson <raek@raek.se>2021-07-17 23:13:36 +0200
committerRasmus Bondesson <raek@raek.se>2021-07-17 23:13:36 +0200
commit291d45385f20389c7d7ec0f6a73218e24468f004 (patch)
tree00d3267f26beac3753237919aee402a8bf7fb159
parenta97bb0699ec8b5bd83d6cda062596b7716613528 (diff)
downloadcffi-291d45385f20389c7d7ec0f6a73218e24468f004.tar.gz
doc: Turn ffi.new() references into links in Overview page
-rw-r--r--doc/source/overview.rst4
-rw-r--r--doc/source/ref.rst2
2 files changed, 4 insertions, 2 deletions
diff --git a/doc/source/overview.rst b/doc/source/overview.rst
index 8f2cdd1..50420ef 100644
--- a/doc/source/overview.rst
+++ b/doc/source/overview.rst
@@ -179,7 +179,7 @@ Struct/Array Example (minimal, in-line)
f.close()
This can be used as a more flexible replacement of the struct_ and
-array_ modules, and replaces ctypes_. You could also call ``ffi.new("pixel_t[600][800]")``
+array_ modules, and replaces ctypes_. You could also call :ref:`ffi.new("pixel_t[600][800]") <new>`
and get a two-dimensional array.
.. _struct: http://docs.python.org/library/struct.html
@@ -582,7 +582,7 @@ Other common arguments to :ref:`set_source() <set_source>` include ``library_dir
``include_dirs``; all these arguments are passed to the standard
distutils/setuptools.
-The ``ffi.new()`` lines allocate C objects. They are filled
+The :ref:`ffi.new() <new>` lines allocate C objects. They are filled
with zeroes initially, unless the optional second argument is used.
If specified, this argument gives an "initializer", like you can use
with C code to initialize global variables.
diff --git a/doc/source/ref.rst b/doc/source/ref.rst
index 9956f1e..05c0f7c 100644
--- a/doc/source/ref.rst
+++ b/doc/source/ref.rst
@@ -30,6 +30,8 @@ ffi.error
confuse it with ``ffi.errno``.)
+.. _new:
+
ffi.new()
+++++++++