Browse Source

doc: update fragment API docs

William Pitcock 1 year ago
parent
commit
5c7c9127bc
1 changed files with 18 additions and 5 deletions
  1. 18
    5
      doc/libpkgconf-fragment.rst

+ 18
- 5
doc/libpkgconf-fragment.rst View File

@@ -36,6 +36,16 @@ which is composable, mergeable and reorderable.
36 36
    :param bool is_private: Whether the fragment list is a `private` fragment list (static linking).
37 37
    :return: nothing
38 38
 
39
+.. c:function:: void pkgconf_fragment_copy_list(const pkgconf_client_t *client, pkgconf_list_t *list, const pkgconf_list_t *base)
40
+
41
+   Copies a `fragment list` to another `fragment list`, possibly removing a previous copy of the fragments
42
+   in a process known as `mergeback`.
43
+
44
+   :param pkgconf_client_t* client: The pkgconf client being accessed.
45
+   :param pkgconf_list_t* list: The list the fragments are being added to.
46
+   :param pkgconf_list_t* base: The list the fragments are being copied from.
47
+   :return: nothing
48
+
39 49
 .. c:function:: void pkgconf_fragment_filter(const pkgconf_client_t *client, pkgconf_list_t *dest, pkgconf_list_t *src, pkgconf_fragment_filter_func_t filter_func)
40 50
 
41 51
    Copies a `fragment list` to another `fragment list` which match a user-specified filtering function.
@@ -47,23 +57,25 @@ which is composable, mergeable and reorderable.
47 57
    :param void* data: Optional data to pass to the filter function.
48 58
    :return: nothing
49 59
 
50
-.. c:function:: size_t pkgconf_fragment_render_len(const pkgconf_list_t *list)
60
+.. c:function:: size_t pkgconf_fragment_render_len(const pkgconf_list_t *list, bool escape, const pkgconf_fragment_render_ops_t *ops)
51 61
 
52 62
    Calculates the required memory to store a `fragment list` when rendered as a string.
53 63
 
54 64
    :param pkgconf_list_t* list: The `fragment list` being rendered.
55
-   :param bool escape: Whether or not to escape special shell characters.
65
+   :param bool escape: Whether or not to escape special shell characters (deprecated).
66
+   :param pkgconf_fragment_render_ops_t* ops: An optional ops structure to use for custom renderers, else ``NULL``.
56 67
    :return: the amount of bytes required to represent the `fragment list` when rendered
57 68
    :rtype: size_t
58 69
 
59
-.. c:function:: void pkgconf_fragment_render_buf(const pkgconf_list_t *list, char *buf, size_t buflen)
70
+.. c:function:: void pkgconf_fragment_render_buf(const pkgconf_list_t *list, char *buf, size_t buflen, bool escape, const pkgconf_fragment_render_ops_t *ops)
60 71
 
61 72
    Renders a `fragment list` into a buffer.
62 73
 
63 74
    :param pkgconf_list_t* list: The `fragment list` being rendered.
64 75
    :param char* buf: The buffer to render the fragment list into.
65 76
    :param size_t buflen: The length of the buffer.
66
-   :param bool escape: Whether or not to escape special shell characters.
77
+   :param bool escape: Whether or not to escape special shell characters (deprecated).
78
+   :param pkgconf_fragment_render_ops_t* ops: An optional ops structure to use for custom renderers, else ``NULL``.
67 79
    :return: nothing
68 80
 
69 81
 .. c:function:: char *pkgconf_fragment_render(const pkgconf_list_t *list)
@@ -71,7 +83,8 @@ which is composable, mergeable and reorderable.
71 83
    Allocate memory and render a `fragment list` into it.
72 84
 
73 85
    :param pkgconf_list_t* list: The `fragment list` being rendered.
74
-   :param bool escape: Whether or not to escape special shell characters.
86
+   :param bool escape: Whether or not to escape special shell characters (deprecated).
87
+   :param pkgconf_fragment_render_ops_t* ops: An optional ops structure to use for custom renderers, else ``NULL``.
75 88
    :return: An allocated string containing the rendered `fragment list`.
76 89
    :rtype: char *
77 90