Skip to content

Commit b66040f

Browse files
committed
flux_conf_create(3): pull in man pages
Problem: there are no man pages for flux_conf_t. Pull them in from flux-core.
1 parent 4e1e1e5 commit b66040f

File tree

3 files changed

+110
-2
lines changed

3 files changed

+110
-2
lines changed

doc/Makefile.am

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ MAN3_FILES_PRIMARY = \
1212
man3/idset_encode.3 \
1313
man3/idset_decode.3 \
1414
man3/idset_add.3 \
15-
man3/idset_alloc.3
15+
man3/idset_alloc.3 \
16+
man3/flux_conf_create.3
1617

1718
MAN3_FILES_SECONDARY = \
1819
man3/hostlist_destroy.3 \
@@ -59,7 +60,13 @@ MAN3_FILES_SECONDARY = \
5960
man3/idset_has_intersection.3 \
6061
man3/idset_clear_all.3 \
6162
man3/idset_free.3 \
62-
man3/idset_free_check.3
63+
man3/idset_free_check.3 \
64+
man3/flux_conf_incref.3 \
65+
man3/flux_conf_decref.3 \
66+
man3/flux_conf_copy.3 \
67+
man3/flux_conf_unpack.3 \
68+
man3/flux_conf_pack.3 \
69+
man3/flux_conf_parse.3
6370

6471
RST_FILES = \
6572
$(MAN3_FILES_PRIMARY:.3=.rst)

doc/man3/flux_conf_create.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
===================
2+
flux_conf_create(3)
3+
===================
4+
5+
.. default-domain:: c
6+
7+
SYNOPSIS
8+
========
9+
10+
.. code-block:: c
11+
12+
#include <flux/conf.h>
13+
14+
flux_conf_t *flux_conf_create (void);
15+
16+
const flux_conf_t *flux_conf_incref (const flux_conf_t *conf);
17+
18+
void flux_conf_decref (const flux_conf_t *conf);
19+
20+
flux_conf_t *flux_conf_copy (const flux_conf_t *conf);
21+
22+
int flux_conf_unpack (const flux_conf_t *conf,
23+
flux_error_t *error,
24+
const char *fmt,
25+
...);
26+
27+
flux_conf_t *flux_conf_pack (const char *fmt, ...);
28+
29+
flux_conf_t *flux_conf_parse (const char *path, flux_error_t *error);
30+
31+
Link with :command:`-lflux-conf`.
32+
33+
DESCRIPTION
34+
===========
35+
36+
Flux configuration is represented by a :type:`flux_conf_t` object.
37+
38+
:func:`flux_conf_create` creates an empty object with a reference
39+
count of one.
40+
41+
:func:`flux_conf_incref` increments the object reference count.
42+
:func:`flux_conf_decref` decrements the object reference count
43+
and destroys it when the count reaches zero.
44+
45+
:func:`flux_conf_copy` duplicates an object.
46+
47+
:func:`flux_conf_unpack` unpacks an object using Jansson
48+
:func:`json_unpack` style arguments.
49+
50+
:func:`flux_conf_pack` creates an object using Jansson
51+
:func:`json_pack` style arguments.
52+
53+
:func:`flux_conf_parse` parse a TOML configuration file at :var:`path`
54+
and creates a config object that contains the result.
55+
56+
ENCODING JSON PAYLOADS
57+
======================
58+
59+
.. include:: common/json_pack.rst
60+
61+
DECODING JSON PAYLOADS
62+
======================
63+
64+
.. include:: common/json_unpack.rst
65+
66+
RETURN VALUE
67+
============
68+
69+
:func:`flux_conf_create`, :func:`flux_conf_copy`, :func:`flux_conf_pack`,
70+
and :func:`flux_conf_incref` return a :type:`flux_conf_t` object on success.
71+
On error, NULL is returned, and :var:`errno` is set.
72+
73+
:func:`flux_conf_unpack` returns 0 on success, or -1 on failure with
74+
:var:`errno` set.
75+
76+
:func:`flux_conf_parse` returns 0 on success. On error, it returns -1,
77+
:var:`errno` set, and if :var:`error` is non-NULL, it is filled with
78+
a human readable error message.
79+
80+
ERRORS
81+
======
82+
83+
EINVAL
84+
Invalid argument.
85+
86+
ENOMEM
87+
Out of memory.
88+
89+
RESOURCES
90+
=========
91+
92+
.. include:: common/resources.rst
93+
94+
TOML: Tom's Oblivious, Minimal Language https://github.com/toml-lang/toml

doc/manpages.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,11 @@
6969
('man3/idset_alloc','idset_alloc', 'Allocate an id from an idset', [author], 3),
7070
('man3/idset_alloc','idset_free', 'Allocate an id from an idset', [author], 3),
7171
('man3/idset_alloc','idset_free_check', 'Allocate an id from an idset', [author], 3),
72+
('man3/flux_conf_create','flux_conf_create', 'create a config object', [author], 3),
73+
('man3/flux_conf_create','flux_conf_incref', 'take reference on config object', [author], 3),
74+
('man3/flux_conf_create','flux_conf_decref', 'drop reference on config object', [author], 3),
75+
('man3/flux_conf_create','flux_conf_copy', 'copy config object', [author], 3),
76+
('man3/flux_conf_create','flux_conf_unpack', 'parse config object', [author], 3),
77+
('man3/flux_conf_create','flux_conf_pack', 'build config object', [author], 3),
78+
('man3/flux_conf_create','flux_conf_parse', 'parse TOML config', [author], 3),
7279
]

0 commit comments

Comments
 (0)