Skip to content

Commit 0396066

Browse files
committed
Merge pull request #1242 from UncleGrump/docs_API_updates
Docs API updates Updates the documentation restructured text skeleton files with missing functions and other elements that have been documented in source files. Some structs, functions, and types that Doxygen cannot parse correctly now have manually created entries added to the restructured text files. Minor enhancement to the way the downloads and versions menu is displayed. These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents e578283 + a5500df commit 0396066

File tree

5 files changed

+95
-21
lines changed

5 files changed

+95
-21
lines changed

doc/_templates/versions.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
{# Add rst-badge after rst-versions for small badge style. #}
1212
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
1313
<span class="rst-current-version" data-toggle="rst-current-version">
14-
<span class="fa fa-book">AtomVM Docs</span>
15-
v: {{ current_version }}
14+
<span class="fa fa-download"></span><span class="fa fa-book"> AtomVM Docs version:</span>
15+
{{ current_version }}
1616
<span class="fa fa-caret-down"></span>
1717
</span>
1818
<div class="rst-other-versions">
1919
{% if versions|length >= 1 %}
2020
<dl>
21-
<dt>{{ _('Versions') }}</dt>
21+
<dt><span class="fa fa-book">{{ _(' Versions') }}</span></dt>
2222
{% for slug, url in versions %}
2323
{% if slug == current_version %} <strong> {% endif %}
2424
<dd><a href="{{ url }}">{{ slug }}</a></dd>
@@ -28,7 +28,7 @@
2828
{% endif %}
2929
{% if downloads|length >= 1 %}
3030
<dl>
31-
<dt>{{ _('Downloads') }}</dt>
31+
<dt><span class="fa fa-download">{{ _(' Downloads') }}</span></dt>
3232
{% for type, url in downloads %}
3333
<dd><a href="{{ url }}">{{ type }}</a></dd>
3434
{% endfor %}

doc/src/apidocs/libatomvm/data_structures.rst

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Data Structures
1212
---------------------
1313

1414
.. toctree::
15-
:maxdepth: 3
15+
:maxdepth: 4
1616
:caption: Structs
1717

1818
.. doxygenstruct:: AtomsHashTable
@@ -55,24 +55,46 @@ Data Structures
5555
:allow-dot-graphs:
5656
.. doxygenstruct:: Heap
5757
:allow-dot-graphs:
58-
.. doxygenstruct:: HNode
59-
:allow-dot-graphs:
58+
.. Doxygen mangles this structure when parsing atomshashtable.c.
59+
.. c:struct:: HNode
60+
61+
**Public Members**
62+
63+
.. c:var:: struct HNode *next
64+
.. c:var:: AtomString key
65+
.. c:var:: unsigned long value
66+
6067
.. doxygenstruct:: HNodeGroup
6168
:allow-dot-graphs:
6269
.. doxygenstruct:: IFFRecord
6370
:allow-dot-graphs:
6471
.. doxygenstruct:: InMemoryAVMPack
6572
:allow-dot-graphs:
66-
.. doxygenstruct:: Int24
67-
:allow-dot-graphs:
68-
.. doxygenstruct:: Int40
69-
:allow-dot-graphs:
70-
.. doxygenstruct:: Int48
71-
:allow-dot-graphs:
72-
.. doxygenstruct:: Int56
73-
:allow-dot-graphs:
74-
.. doxygenstruct:: kv_pair
75-
:allow-dot-graphs:
73+
.. defined in excluded opcodesswitch.h
74+
.. c:struct:: Int24
75+
76+
.. c:var:: int32_t val24 : 24
77+
78+
.. c:struct:: Int40
79+
80+
.. c:var:: int64_t val40 : 40
81+
82+
.. c:struct:: Int48
83+
84+
.. c:var:: int64_t val48 : 48
85+
86+
.. c:struct:: Int56
87+
88+
.. c:var:: int64_t val56 : 56
89+
90+
.. c:struct:: kv_pair
91+
92+
**Public Members**
93+
94+
.. c:var:: term key
95+
.. c:var:: term value
96+
97+
.. end of opcodesswitch.h structs
7698
.. doxygenstruct:: LineRefOffset
7799
:allow-dot-graphs:
78100
.. doxygenstruct:: ListHead
@@ -116,8 +138,6 @@ Data Structures
116138
:allow-dot-graphs:
117139
.. doxygenstruct:: SyncList
118140
:allow-dot-graphs:
119-
.. doxygenstruct:: TempStack
120-
:allow-dot-graphs:
121141
.. doxygenstruct:: TermSignal
122142
:allow-dot-graphs:
123143
.. doxygenstruct:: TimerList
@@ -164,7 +184,6 @@ Enumerations
164184
.. doxygenenum:: OpenAVMResult
165185
.. doxygenenum:: RefcBinaryFlags
166186
.. doxygenenum:: SocketErrors
167-
.. doxygenenum:: TempStackResult
168187
.. doxygenenum:: TermCompareOpts
169188
.. doxygenenum:: TermCompareResult
170189
.. doxygenenum:: UnicodeConversionResult

doc/src/apidocs/libatomvm/functions.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
:orphan:
66

7+
.. c:namespace:: NULL
78
.. c:namespace:: libAtomVM
89
.. c:namespace-push:: functions
910
@@ -24,13 +25,22 @@ Functions
2425
.. doxygenfunction:: avmpack_find_section_by_name
2526
.. doxygenfunction:: avmpack_fold
2627
.. doxygenfunction:: avmpack_is_valid
28+
.. doxygenfunction:: bitstring_copy_bits
2729
.. doxygenfunction:: bitstring_copy_bits_incomplete_bytes
30+
.. doxygenfunction:: bitstring_insert_utf16
31+
.. doxygenfunction:: bitstring_insert_utf32
32+
.. doxygenfunction:: bitstring_insert_utf8
33+
.. doxygenfunction:: bitstring_match_utf16
34+
.. doxygenfunction:: bitstring_match_utf32
35+
.. doxygenfunction:: bitstring_match_utf8
2836
.. doxygenfunction:: bitstring_utf16_decode
2937
.. doxygenfunction:: bitstring_utf16_encode
38+
.. doxygenfunction:: bitstring_utf16_size
3039
.. doxygenfunction:: bitstring_utf32_decode
3140
.. doxygenfunction:: bitstring_utf32_encode
3241
.. doxygenfunction:: bitstring_utf8_decode
3342
.. doxygenfunction:: bitstring_utf8_encode
43+
.. doxygenfunction:: bitstring_utf8_size
3444
.. doxygenfunction:: context_avail_free_memory
3545
.. doxygenfunction:: context_clean_registers
3646
.. doxygenfunction:: context_destroy
@@ -76,6 +86,21 @@ Functions
7686
.. doxygenfunction:: externalterm_from_binary
7787
.. doxygenfunction:: externalterm_to_binary
7888
.. doxygenfunction:: externalterm_to_term
89+
.. TODO: figure out why Doxgen cant find externalterm_to_term_internal in externalterm.c
90+
.. c:function:: static term externalterm_to_term_internal(const void *external_term, size_t size, Context *ctx, ExternalTermOpts opts, size_t *bytes_read, bool copy)
91+
92+
Copy an external term to internal storage.
93+
94+
:param external_term: buffer containing external term
95+
:param size: size of the external_term
96+
:param ctx: current context in which terms may be stored
97+
:param opts: additional opts, such as ExternalTermToHeapFragment for storing parsed
98+
terms in a heap fragment, otherwise terms are stored in the context heap.
99+
:param bytes_read: the number of bytes read off external_term in order to yield a term
100+
:param copy: whether to copy binary data and atom strings (pass `true`, unless
101+
`external_term` is a const binary and will not be deallocated)
102+
:returns: the parsed term
103+
79104
.. doxygenfunction:: globalcontext_atomstring_from_term
80105
.. doxygenfunction:: globalcontext_demonitor
81106
.. doxygenfunction:: globalcontext_destroy
@@ -96,6 +121,8 @@ Functions
96121
.. doxygenfunction:: globalcontext_maybe_unregister_process_id
97122
.. doxygenfunction:: globalcontext_new
98123
.. doxygenfunction:: globalcontext_process_exists
124+
.. doxygenfunction:: globalcontext_process_task_driver_queues
125+
.. doxygenfunction:: globalcontext_refc_decrement_refcount_from_task
99126
.. doxygenfunction:: globalcontext_register_process
100127
.. doxygenfunction:: globalcontext_send_message
101128
.. doxygenfunction:: globalcontext_send_message_from_task
@@ -118,6 +145,7 @@ Functions
118145
.. doxygenfunction:: mailbox_has_next
119146
.. doxygenfunction:: mailbox_init
120147
.. doxygenfunction:: mailbox_len
148+
.. doxygenfunction:: mailbox_message_create_from_term
121149
.. doxygenfunction:: mailbox_message_dispose
122150
.. doxygenfunction:: mailbox_next
123151
.. doxygenfunction:: mailbox_peek
@@ -136,11 +164,16 @@ Functions
136164
.. doxygenfunction:: memory_copy_term_tree_to_storage
137165
.. doxygenfunction:: memory_destroy_heap
138166
.. doxygenfunction:: memory_destroy_heap_fragment
167+
.. doxygenfunction:: memory_destroy_heap_from_task
168+
.. doxygenfunction:: memory_ensure_free_opt
139169
.. doxygenfunction:: memory_ensure_free_with_roots
170+
.. doxygenfunction:: memory_erl_nif_env_ensure_free
140171
.. doxygenfunction:: memory_estimate_usage
172+
.. doxygenfunction:: memory_heap_alloc
141173
.. doxygenfunction:: memory_heap_append_fragment
142174
.. doxygenfunction:: memory_heap_append_heap
143175
.. doxygenfunction:: memory_heap_fragment_memory_size
176+
.. doxygenfunction:: memory_heap_trim
144177
.. doxygenfunction:: memory_heap_youngest_size
145178
.. doxygenfunction:: memory_heap_memory_size
146179
.. doxygenfunction:: memory_init_heap
@@ -157,6 +190,7 @@ Functions
157190
.. doxygenfunction:: module_new_from_iff_binary
158191
.. doxygenfunction:: module_resolve_function
159192
.. doxygenfunction:: module_search_exported_function
193+
.. doxygenfunction:: otp_socket_lwip_enqueue
160194
.. doxygenfunction:: platform_nifs_get_nif
161195
.. doxygenfunction:: posix_errno_to_term
162196
.. doxygenfunction:: process_listener_handler

doc/src/apidocs/libatomvm/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ libAtomVM
2020
macros
2121

2222
-------------------------
23-
libAtomVM Header Files
23+
libAtomVM source files
2424
-------------------------
2525

2626
.. toctree::

doc/src/apidocs/libatomvm/types.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ Types
2323
.. doxygentypedef:: avm_uint64_t
2424
.. doxygentypedef:: avm_uint_t
2525
.. doxygentypedef:: avmpack_fold_fun
26+
.. from exclided opcodesshwitch.h
27+
.. c:type:: term* dreg_t
28+
29+
.. c:type:: dreg_gc_safe_t
30+
31+
.. c:struct:: _
32+
33+
.. c:var:: term *base
34+
.. c:var:: int index
35+
2636
.. doxygentypedef:: ERL_NIF_TERM
2737
.. doxygentypedef:: ErlNifEvent
2838
.. doxygentypedef:: ErlNifMonitor
@@ -33,4 +43,15 @@ Types
3343
.. doxygentypedef:: ErlNifResourceType
3444
.. doxygentypedef:: event_handler_t
3545
.. doxygentypedef:: EventListener
46+
.. TODO: find out why Doxygen can parse this from mailbox.h
47+
.. c:type:: MailboxMessage MailboxMessage
48+
49+
.. c:struct:: MailboxMessage
50+
51+
.. c:var:: MailboxMessage *next
52+
.. c:union:: _
53+
54+
.. c:var:: enum MessageType type
55+
.. c:var:: term *heap_fragment_end
56+
3657
.. doxygentypedef:: term

0 commit comments

Comments
 (0)