[libc-commits] [libc] [libc][docs] Add net/if.h documentation by to referring POSIX standard (PR #122406)
via libc-commits
libc-commits at lists.llvm.org
Thu Jan 9 18:09:22 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Prashanth (StarOne01)
<details>
<summary>Changes</summary>
This pull request introduces the following changes to the project:
1. **Documentation Update**:
- Added a new YAML file `if.yaml` under `net` to document network interface functions and macros.
- The `if.yaml` file includes the following functions and macros:
- Functions:
- `if_freenameindex`
- `if_indextoname`
- `if_nameindex`
- `if_nametoindex`
- Macros:
- `IF_NAMESIZE`
2. **CMake Configuration Update**:
- Updated the `CMakeLists.txt` file to create the necessary directory for the `net` headers.
- Included the `net/if` documentation in the Sphinx build configuration.
3. **Index Update**:
- Updated the `index.rst` file to include a reference to the newly added `net/if` documentation.
**Purpose**:
- This pull request adds documentation for network interface functions and macros, ensuring they are included in the project's documentation.
- Updates the CMake configuration to support the new documentation.
**Testing**:
- Verified that the new YAML file is correctly referenced in the `index.rst`.
- Ensured that the documentation builds without errors and includes the new network interface documentation.
---
Full diff: https://github.com/llvm/llvm-project/pull/122406.diff
3 Files Affected:
- (modified) libc/docs/CMakeLists.txt (+2)
- (modified) libc/docs/headers/index.rst (+1)
- (added) libc/utils/docgen/net/if.yaml (+13)
``````````diff
diff --git a/libc/docs/CMakeLists.txt b/libc/docs/CMakeLists.txt
index 5a3f8275bb932e..a21d8e563626c5 100644
--- a/libc/docs/CMakeLists.txt
+++ b/libc/docs/CMakeLists.txt
@@ -19,6 +19,7 @@ if (SPHINX_FOUND)
file(MAKE_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/headers/arpa/"
"${CMAKE_CURRENT_BINARY_DIR}/headers/sys/"
+ "${CMAKE_CURRENT_BINARY_DIR}/headers/net/"
)
# Change sphinx to build from $build_dir/libc/docs/ rather than
@@ -40,6 +41,7 @@ if (SPHINX_FOUND)
float
inttypes
locale
+ net/if
setjmp
signal
stdbit
diff --git a/libc/docs/headers/index.rst b/libc/docs/headers/index.rst
index 07ab6dd9b26742..b78ae86e968d9a 100644
--- a/libc/docs/headers/index.rst
+++ b/libc/docs/headers/index.rst
@@ -14,6 +14,7 @@ Implementation Status
inttypes
locale
math/index.rst
+ net/if
search
setjmp
signal
diff --git a/libc/utils/docgen/net/if.yaml b/libc/utils/docgen/net/if.yaml
new file mode 100644
index 00000000000000..085d27b2bb94fa
--- /dev/null
+++ b/libc/utils/docgen/net/if.yaml
@@ -0,0 +1,13 @@
+functions:
+ if_freenameindex:
+ in-latest-posix: ''
+ if_indextoname:
+ in-latest-posix: ''
+ if_nameindex:
+ in-latest-posix: ''
+ if_nametoindex:
+ in-latest-posix: ''
+
+macros:
+ IF_NAMESIZE:
+ in-latest-posix: ''
\ No newline at end of file
``````````
</details>
https://github.com/llvm/llvm-project/pull/122406
More information about the libc-commits
mailing list