Skip to content

Commit

Permalink
btrfs-progs: docs: add path-utils.h API docs
Browse files Browse the repository at this point in the history
[ ci skip ]

Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
kdave committed Sep 17, 2024
1 parent 5d9cebc commit f84e047
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Documentation/dev/dev-internal-apis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----

Expand All @@ -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

0 comments on commit f84e047

Please sign in to comment.