Skip to content

Commit c46a465

Browse files
committed
hwloc/export.h: improve doc about return values
Refs #578. Signed-off-by: Brice Goglin <[email protected]>
1 parent 3dbc02d commit c46a465

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

include/hwloc/export.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ enum hwloc_topology_export_xml_flags_e {
5555
*
5656
* \p flags is a OR'ed set of ::hwloc_topology_export_xml_flags_e.
5757
*
58-
* \return -1 if a failure occured.
58+
* \return 0 on success, or -1 on error.
5959
*
6060
* \note See also hwloc_topology_set_userdata_export_callback()
6161
* for exporting application-specific object userdata.
@@ -91,7 +91,7 @@ HWLOC_DECLSPEC int hwloc_topology_export_xml(hwloc_topology_t topology, const ch
9191
*
9292
* \p flags is a OR'ed set of ::hwloc_topology_export_xml_flags_e.
9393
*
94-
* \return -1 if a failure occured.
94+
* \return 0 on success, or -1 on error.
9595
*
9696
* \note See also hwloc_topology_set_userdata_export_callback()
9797
* for exporting application-specific object userdata.
@@ -145,13 +145,15 @@ HWLOC_DECLSPEC void hwloc_topology_set_userdata_export_callback(hwloc_topology_t
145145
* that were given to the export callback.
146146
*
147147
* Only printable characters may be exported to XML string attributes.
148-
* If a non-printable character is passed in \p name or \p buffer,
149-
* the function returns -1 with errno set to EINVAL.
150148
*
151149
* If exporting binary data, the application should first encode into
152150
* printable characters only (or use hwloc_export_obj_userdata_base64()).
153151
* It should also take care of portability issues if the export may
154152
* be reimported on a different architecture.
153+
*
154+
* \return 0 on success.
155+
* \return -1 with errno set to \c EINVAL if a non-printable character is
156+
* passed in \p name or \b buffer.
155157
*/
156158
HWLOC_DECLSPEC int hwloc_export_obj_userdata(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length);
157159

@@ -165,8 +167,14 @@ HWLOC_DECLSPEC int hwloc_export_obj_userdata(void *reserved, hwloc_topology_t to
165167
* This function may only be called from within the export() callback passed
166168
* to hwloc_topology_set_userdata_export_callback().
167169
*
170+
* The name must be made of printable characters for export to XML string attributes.
171+
*
168172
* The function does not take care of portability issues if the export
169173
* may be reimported on a different architecture.
174+
*
175+
* \return 0 on success.
176+
* \return -1 with errno set to \c EINVAL if a non-printable character is
177+
* passed in \p name.
170178
*/
171179
HWLOC_DECLSPEC int hwloc_export_obj_userdata_base64(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length);
172180

0 commit comments

Comments
 (0)