You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/storage/api/api.rst
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -805,7 +805,55 @@ These definitions must be defined in the header file :file:`psa/protected_storag
805
805
A caller may delete a `uid` with ``psa_ps_remove(uid)`` without invalidating the iteration context, provided the `uid` does *NOT* match the filter. However, if the `uid` matches the filter then any later call to `psa_ps_iterator_next()` fails with `PSA_ERROR_DATA_CORRUPT`.
806
806
807
807
A caller may call `psa_ps_rename(uid, uid_new)` without invalidating the iteration context, provided the `uid` does *NOT* match the filter, as this is equivalent to calling `psa_ps_remove(uid)`. However, if the `uid` matches the filter then any later call to `psa_ps_iterator_next()` fails with `PSA_ERROR_DATA_CORRUPT`.
808
+
809
+
The following code snippet uses a linked list to store the matching files before iterating over that list and removing them.
810
+
811
+
.. code-block:: c
808
812
813
+
my_context = NULL
814
+
my_filter = 0x1111 0000 0000 0000
815
+
my_length = 0x0020
816
+
my_result = NULL
817
+
// define a linked list
818
+
typedef struct node {
819
+
int val;
820
+
struct node * next;
821
+
} node_t;
822
+
// instantiate the head
823
+
node_t * head = NULL;
824
+
head = (node_t *) malloc(sizeof(node_t));
825
+
// and a current item
826
+
node_t * current = head;
827
+
if psa_ps_iterator_start(my_context, my_filter, my-length, my_result) == PSA_SUCCESS
0 commit comments