Skip to content

Commit 7cfbc01

Browse files
committed
Add documentation section descriptions
Add DOC: statements to the header files to have each header file start its own section in the API documentation. Signed-off-by: Hannes Reinecke <[email protected]>
1 parent 7da9570 commit 7cfbc01

10 files changed

Lines changed: 106 additions & 0 deletions

File tree

doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Welcome to libnvme's documentation!
1010
:maxdepth: 2
1111
:caption: Contents:
1212

13+
index
14+
libnvme
1315

1416

1517
Indices and tables

doc/libnvme.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.. _filters.h:
2+
3+
**filters.h**
4+
5+
6+
libnvme directory filter
7+
18
.. c:function:: int nvme_namespace_filter (const struct dirent *d)
29
310
@@ -76,6 +83,13 @@
7683
``struct dirent ***namespaces``
7784
7885
86+
.. _ioctl.h:
87+
88+
**ioctl.h**
89+
90+
91+
Linux NVMe ioctl interface functions
92+
7993
8094
8195
.. c:type:: struct nvme_passthru_cmd
@@ -6105,6 +6119,13 @@ The nvme command status if a response was received (see
61056119
:c:type:`enum nvme_status_field <nvme_status_field>`) or -1 with errno set otherwise.
61066120
61076121
6122+
.. _linux.h:
6123+
6124+
**linux.h**
6125+
6126+
6127+
linux-specific utility functions
6128+
61086129
.. c:function:: int nvme_fw_download_seq (int fd, __u32 size, __u32 xfer, __u32 offset, void *buf)
61096130
61106131
@@ -6437,6 +6458,13 @@ If key generation was successful the function returns 0 or
64376458
-1 with errno set otherwise.
64386459
64396460
6461+
.. _log.h:
6462+
6463+
**log.h**
6464+
6465+
6466+
logging functions
6467+
64406468
.. c:function:: void nvme_init_logging (nvme_root_t r, int lvl, bool log_pid, bool log_tstamp)
64416469
64426470
initialize logging
@@ -6460,6 +6488,13 @@ If key generation was successful the function returns 0 or
64606488
Sets the default logging variables for the library.
64616489
64626490
6491+
.. _tree.h:
6492+
6493+
**tree.h**
6494+
6495+
6496+
libnvme tree object interface
6497+
64636498
.. c:function:: nvme_root_t nvme_create_root (FILE *fp, int log_level)
64646499
64656500
Initialize root object
@@ -8424,6 +8459,13 @@ string with the contents of **attr**
84248459
nvme_ns_t object or NULL if not found.
84258460
84268461
8462+
.. _types.h:
8463+
8464+
**types.h**
8465+
8466+
8467+
NVMe standard definitions
8468+
84278469
.. c:function:: NVME_GET (value, name)
84288470
84298471
extract field from complex value
@@ -17488,6 +17530,13 @@ See :c:type:`enum nvme_status_field <nvme_status_field>`
1748817530
``NVME_ZNS_ZRAS_REPORT_OFFLINE``
1748917531
1749017532
17533+
.. _fabrics.h:
17534+
17535+
**fabrics.h**
17536+
17537+
17538+
Fabrics-specific definitions.
17539+
1749117540
1749217541
1749317542
.. c:type:: struct nvme_fabrics_config
@@ -17872,6 +17921,13 @@ Pointer to the new controller
1787217921
Maximum length of string
1787317922
1787417923
17924+
.. _util.h:
17925+
17926+
**util.h**
17927+
17928+
17929+
libnvme utility functions
17930+
1787517931
1787617932
1787717933
.. c:type:: enum nvme_connect_err

src/nvme/fabrics.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
#include <stdint.h>
1414
#include "tree.h"
1515

16+
/**
17+
* DOC: fabrics.h
18+
*
19+
* Fabrics-specific definitions.
20+
*/
21+
1622
/* default to 600 seconds of reconnect attempts before giving up */
1723
#define NVMF_DEF_CTRL_LOSS_TMO 600
1824

src/nvme/filters.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
#include <dirent.h>
1313
#include "tree.h"
1414

15+
/**
16+
* DOC: filters.h
17+
*
18+
* libnvme directory filter
19+
*/
20+
1521
/**
1622
* nvme_namespace_filter() -
1723
* @d:

src/nvme/ioctl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
#ifndef _LINUX_NVME_IOCTL_H
2525
#define _LINUX_NVME_IOCTL_H
2626

27+
/**
28+
* DOC: ioctl.h
29+
*
30+
* Linux NVMe ioctl interface functions
31+
*/
32+
2733
/* '0' is interpreted by the kernel to mean 'apply the default timeout' */
2834
#define NVME_DEFAULT_IOCTL_TIMEOUT 0
2935

src/nvme/linux.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
#include "types.h"
1515

16+
/**
17+
* DOC: linux.h
18+
*
19+
* linux-specific utility functions
20+
*/
21+
1622
/**
1723
* nvme_fw_download_seq() -
1824
* @fd: File descriptor of nvme device

src/nvme/log.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
# define DEFAULT_LOGLEVEL LOG_NOTICE
1616
#endif
1717

18+
/**
19+
* DOC: log.h
20+
*
21+
* logging functions
22+
*/
23+
1824
/**
1925
* nvme_init_logging() - initialize logging
2026
* @r: nvme_root_t context

src/nvme/tree.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
#include "ioctl.h"
2222
#include "util.h"
2323

24+
/**
25+
* DOC: tree.h
26+
*
27+
* libnvme tree object interface
28+
*/
29+
2430
typedef struct nvme_ns *nvme_ns_t;
2531
typedef struct nvme_path *nvme_path_t;
2632
typedef struct nvme_ctrl *nvme_ctrl_t;

src/nvme/types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515

1616
#include <linux/types.h>
1717

18+
/**
19+
* DOC: types.h
20+
*
21+
* NVMe standard definitions
22+
*/
23+
1824
/**
1925
* NVME_GET() - extract field from complex value
2026
* @value: The original value of a complex field

src/nvme/util.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111

1212
#include "types.h"
1313

14+
/**
15+
* DOC: util.h
16+
*
17+
* libnvme utility functions
18+
*/
19+
1420
/**
1521
* enum nvme_connect_err - nvme connect error codes
1622
* @ENVME_CONNECT_RESOLVE: failed to resolve host

0 commit comments

Comments
 (0)