Skip to content

Commit 78e097f

Browse files
Cryolitiaanakryiko
authored andcommitted
libbpf: Add documentation to version and error API functions
Add documentation for the following API functions: - libbpf_major_version() - libbpf_minor_version() - libbpf_version_string() - libbpf_strerror() Signed-off-by: Cryolitia PukNgae <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 2693227 commit 78e097f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tools/lib/bpf/libbpf.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,25 @@
2424
extern "C" {
2525
#endif
2626

27+
/**
28+
* @brief **libbpf_major_version()** provides the major version of libbpf.
29+
* @return An integer, the major version number
30+
*/
2731
LIBBPF_API __u32 libbpf_major_version(void);
32+
33+
/**
34+
* @brief **libbpf_minor_version()** provides the minor version of libbpf.
35+
* @return An integer, the minor version number
36+
*/
2837
LIBBPF_API __u32 libbpf_minor_version(void);
38+
39+
/**
40+
* @brief **libbpf_version_string()** provides the version of libbpf in a
41+
* human-readable form, e.g., "v1.7".
42+
* @return Pointer to a static string containing the version
43+
*
44+
* The format is *not* a part of a stable API and may change in the future.
45+
*/
2946
LIBBPF_API const char *libbpf_version_string(void);
3047

3148
enum libbpf_errno {
@@ -49,6 +66,14 @@ enum libbpf_errno {
4966
__LIBBPF_ERRNO__END,
5067
};
5168

69+
/**
70+
* @brief **libbpf_strerror()** converts the provided error code into a
71+
* human-readable string.
72+
* @param err The error code to convert
73+
* @param buf Pointer to a buffer where the error message will be stored
74+
* @param size The number of bytes in the buffer
75+
* @return 0, on success; negative error code, otherwise
76+
*/
5277
LIBBPF_API int libbpf_strerror(int err, char *buf, size_t size);
5378

5479
/**

0 commit comments

Comments
 (0)