From 5b7f6a4a5bbc2fd524054a997a2d6709c9279dd0 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 17 Sep 2024 16:04:19 +0200 Subject: [PATCH] btrfs-progs: docs: add path-utils.h API docs [ ci skip ] Signed-off-by: David Sterba --- Documentation/dev/dev-internal-apis.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/dev/dev-internal-apis.rst b/Documentation/dev/dev-internal-apis.rst index ed4257d1..3ff11543 100644 --- a/Documentation/dev/dev-internal-apis.rst +++ b/Documentation/dev/dev-internal-apis.rst @@ -34,6 +34,17 @@ Printing options is done by `pretty_size_mode` which takes the value and option mode. Default mode is human readable, the macros defining the modes are from `UNITS_*` namespace. +File path handling +------------------ + +Files: :file:`common/path-utils.h` + +The paths on Linux can be at most PATH_MAX, which is 4096 (:command:`getconf`). +For easier handling use a local variable like :code:`char path[PATH_MAX] = { 0 };` +and for concatenation helpers :code:`path_cat_out()` or +:code:`path_cat_out3()` and check the error values for overflows. There are +helpers to check file type :code:`path_is_*()`. + TODO ---- @@ -44,8 +55,6 @@ Undocumented or incomplete APIs: * common/device-utils.h * common/messages.h * common/open-utils.h -* common/path-utils.h * common/sort-utils.h * common/string-table.h -* common/string-table.h * common/task-utils.h