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
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,12 +70,12 @@ These definitions must be defined in the header file :file:`psa/storage_common.h
70
70
The structure MUST contain all all the state required by the iterator.
71
71
That is, further state MUST NOT be retained by the implementation.
72
72
73
-
The structure is initilaised by the `ps_iterator_start` function.
74
-
It is modified by the `ps_iterator_next` function.
73
+
The structure is initilaised by the `ps_iterator_start()` function.
74
+
It is modified by the `ps_iterator_next()` function.
75
75
76
76
the caller can discard or reuse the iterator object once it has finished using it. This can be before, or after, the iterator has reached the end of the iteration.
77
77
78
-
The header file is only required to define this structure if PSA_STORAGE_SUPPORT_ITERATION is `True`
78
+
The header file is only required to define this structure if PSA_STORAGE_SUPPORT_ITERATION is true.
79
79
80
80
.. typedef:: uint32_t psa_storage_create_flags_t
81
81
@@ -135,7 +135,7 @@ These definitions must be defined in the header file :file:`psa/storage_common.h
135
135
136
136
.. summary::
137
137
A sufficient buffer size for a iterator context, in bytes.
138
-
This macro is only required if PSA_STORAGE_SUPPORT_ITERATION is `True`
138
+
This macro is only required if PSA_STORAGE_SUPPORT_ITERATION is true
139
139
140
140
141
141
.. _ITS-API:
@@ -217,7 +217,7 @@ These definitions must be defined in the header file :file:`psa/internal_trusted
217
217
218
218
* The ``uid`` value must not be zero.
219
219
220
-
* If ``uid`` exists it must not have been created as with `PSA_STORAGE_FLAG_WRITE_ONCE` --- would result in ``PSA_ERROR_NOT_PERMITTED``
220
+
* If ``uid`` exists it must not have been created as with `PSA_STORAGE_FLAG_WRITE_ONCE` --- would result in `PSA_ERROR_NOT_PERMITTED`
221
221
222
222
* The caller must have access all memory from ``p_data`` to ``p_data + data_length``.
223
223
@@ -396,7 +396,7 @@ These definitions must be defined in the header file :file:`psa/protected_storag
396
396
.. param:: size_t data_length
397
397
The size in bytes of the data in ``p_data``.
398
398
If ``data_length == 0`` the implementation will create a zero-length asset associated with the ``uid``.
399
-
While no data can be stored in such an asset, a call to `psa_ps_get_info()` will return ``PSA_SUCCESS``.
399
+
While no data can be stored in such an asset, a call to `psa_ps_get_info()` will return `PSA_SUCCESS`.
@@ -680,13 +680,13 @@ These definitions must be defined in the header file :file:`psa/protected_storag
680
680
681
681
Calling this function with ``data_length == 0`` is permitted. This makes no change to the stored data.
682
682
683
-
This function can overwrite existing data and/or extend it up to the capacity for the ``uid`` specified in `psa_ps_create()` but cannot create gaps.
683
+
This function can overwrite existing data and/or extend it up to the capacity for the ``uid`` specified in ``psa_ps_create()`` but cannot create gaps.
684
684
685
-
This function is optional. Consult the platform documentation to determine if it is implemented or perform a call to `psa_ps_get_support()`. This function must be implemented if `psa_ps_get_support()` returns `PSA_STORAGE_SUPPORT_SET_EXTENDED`.
685
+
This function is optional. Consult the platform documentation to determine if it is implemented or perform a call to ``psa_ps_get_support()``. This function must be implemented if ``psa_ps_get_support()`` returns ``PSA_STORAGE_SUPPORT_SET_EXTENDED``.
686
686
687
687
* The ``uid`` value must not be zero.
688
688
689
-
* If ``uid`` exists it must not have been created as with `PSA_STORAGE_FLAG_WRITE_ONCE` - would result in ``PSA_ERROR_NOT_PERMITTED``
689
+
* If ``uid`` exists it must not have been created as with ``PSA_STORAGE_FLAG_WRITE_ONCE`` - would result in ``PSA_ERROR_NOT_PERMITTED``
690
690
691
691
* ``data_offset <= size``
692
692
@@ -702,7 +702,7 @@ These definitions must be defined in the header file :file:`psa/protected_storag
702
702
703
703
* Data in the ranges 0 to ``data_offset`` is not modified.
704
704
705
-
* If ``data_offset + data_length < size`` then data in the range ``data_offset + data_length`` to ``size`` is not modified.
705
+
* If ``data_offset + data_length < size`` then data in the range ``data_offset + data_length` to `size`` is not modified.
706
706
707
707
708
708
@@ -727,7 +727,7 @@ These definitions must be defined in the header file :file:`psa/protected_storag
727
727
The operation completed successfully.
728
728
729
729
.. retval:: PSA_ERROR_ALREADY_EXISTS
730
-
Storage with the specified ``uid_new`` already exists and ``rename_flags`` is ``PSA_STORAGE_FLAG_NONE``
730
+
Storage with the specified ``uid_new`` already exists and ``rename_flags`` is `PSA_STORAGE_FLAG_NONE`
731
731
732
732
.. retval:: PSA_ERROR_DOES_NOT_EXIST
733
733
Storage with the specified ``uid`` does not exist.
@@ -740,10 +740,10 @@ These definitions must be defined in the header file :file:`psa/protected_storag
740
740
741
741
* ``uid`` is ``0``.
742
742
* ``uid_new`` is ``0``
743
-
* the ``psa_storage_rename_flags_t`` has a value set other than ``PSA_STORAGE_FLAG_REPLACE``
743
+
* the ``psa_storage_rename_flags_t`` has a value set other than `PSA_STORAGE_FLAG_REPLACE`
744
744
745
745
.. retval:: PSA_ERROR_NOT_PERMITTED
746
-
The operation failed because ``uid_new`` exists and was created with ``PSA_STORAGE_FLAG_WRITE_ONCE``.
746
+
The operation failed because ``uid_new`` exists and was created with `PSA_STORAGE_FLAG_WRITE_ONCE`.
747
747
748
748
.. retval:: PSA_ERROR_NOT_SUPPORTED
749
749
The implementation does not support the operation.
@@ -754,7 +754,7 @@ These definitions must be defined in the header file :file:`psa/protected_storag
754
754
755
755
The function renames ``uid`` to ``uid_new`` retaining the storage flags that ``uid`` was created with.
756
756
757
-
If the caller specifies ``PSA_STORAGE_FLAG_REPLACE`` the operation atomically replaces the exisitng contents of ``uid_new`` with those of ``uid``.
757
+
If the caller specifies `PSA_STORAGE_FLAG_REPLACE` the operation atomically replaces the exisitng contents of ```uid_new`` with those of ``uid``.
758
758
759
759
Except in the case of ``PSA_ERROR_STORAGE_FAILURE``, in which case no guarantees can be made, the operation shall either succeed or leave storage unchanged.
760
760
@@ -771,7 +771,7 @@ These definitions must be defined in the header file :file:`psa/protected_storag
771
771
A value used to filter the results included in this iteration.
772
772
773
773
.. param:: int_t filter_length
774
-
A length of the filter to use, this must be a value `0 < filter_lemngth < 63`.
774
+
A length of the filter to use, this must be a value ``0 < filter_lemngth < 63``.
775
775
776
776
.. param:: psa_storage_uid_t *result
777
777
A pointer to the location in which to store ``uid``. On success the contents of this location will be updated with the first matching ``uid``. On error, the contents are undefined.
@@ -788,25 +788,25 @@ These definitions must be defined in the header file :file:`psa/protected_storag
788
788
.. retval:: PSA_ERROR_STORAGE_FAILURE
789
789
The operation failed because the physical storage has failed (Fatal error).
790
790
791
-
The iterator returns those values where the ``filter_length`` bits of the `uid` matches the left most bits in ``filter``.
791
+
The iterator returns those values where the ``filter_length`` bits of the ``uid`` matches the left most bits in ``filter``.
792
792
793
793
The iterator will only returns those ``uid`` that were created by the caller. It MUST not return any ``uid`` created by a different user.
794
794
795
-
An iterator is not required to return uids in any specific order, but MUST return them in a consistent order each time it is called. For example, if an implementation returns entries in numerical order, it should not arbitrarily change to returning them in creation order. However, the caller should not make assumptions as to the order in which entries are returned, except that each uid will be returned only once in each iteration.
795
+
An iterator is not required to return uids in any specific order, but MUST return them in a consistent order each time it is called. For example, if an implementation returns entries in numerical order, it should not arbitrarily change to returning them in creation order. However, the caller should not make assumptions as to the order in which entries are returned, except that each ``uid`` will be returned only once in each iteration.
796
796
797
797
Changes to storage by other users MUST NOT affect any open iterations.
798
798
799
799
A caller may initialize multiple iteration contexts at the same time. Each iteration shall be independent. Calling ``psa_ps_iterator_next()`` on one iterator MUST not effect any other open iteration.
800
800
801
-
An iterator MUST return all data objects whose `uid` matches the filter that are extant when the filter was created, unless these are deleted or renamed before the iteration would return them, or the caller stops before all matching objects have been returned.
801
+
An iterator MUST return all data objects whose ``uid`` matches the filter that are extant when the filter was created, unless these are deleted or renamed before the iteration would return them, or the caller stops before all matching objects have been returned.
802
802
803
-
A caller may delete a `uid` with ``psa_ps_remove(uid)`` without invalidating the iteration context. the iterator MUST never return a `uid` that has been deleted. However, if the caller is multi-threaded it ia possible another thread may delete a `uid`.
803
+
A caller may delete a ``uid`` with `psa_ps_remove(uid)` without invalidating the iteration context. the iterator MUST never return a ``uid`` that has been deleted. However, if the caller is multi-threaded it ia possible another thread may delete a ``uid``.
804
804
805
-
A caller may read the contents of any `uid` with ``psa_ps_get()`` or write with ``psa_ps_set()`` or ``psa_ps_set_extended()`` without invalidating the iteration context.
805
+
A caller may read the contents of any ``uid`` with `psa_ps_get()` or write with `psa_ps_set(` or `psa_ps_set_extended()` without invalidating the iteration context.
806
806
807
-
A caller may create a `uid` with ``psa_ps_set()`` or ``psa_ps_create()`` without invalidating the iteration context. However, the iterator is NOT guaranteed to return the new object, `uid`, the behaviour is dependent on both implementation and identity. In particular, the iterator is not expected to return `uid` if the iteration is already past the point at which it would naturally be returned.
807
+
A caller may create a ``uid`` with `psa_ps_set()` or `psa_ps_create()` without invalidating the iteration context. However, the iterator is NOT guaranteed to return the new object, ``uid``, the behavior is dependent on both implementation and identity. In particular, the iterator is not expected to return ``uid`` if the iteration is already past the point at which it would naturally be returned.
808
808
809
-
A caller may call `psa_ps_rename(uid, uid_new)` without invalidating the iteration context. The iterator must not return `uid`. The iterator is not guaranteed to return `uid_new`, the behaviour is dependent on both implementation and identity.
809
+
A caller may call `psa_ps_rename(uid, uid_new)` without invalidating the iteration context. The iterator must not return ``uid``. The iterator is not guaranteed to return ``uid_new``, the behavior is dependent on both implementation and identity.
810
810
811
811
The following code snippet uses a linked list to store the matching files before iterating over that list and removing them.
812
812
@@ -822,7 +822,7 @@ These definitions must be defined in the header file :file:`psa/protected_storag
822
822
{
823
823
// do something with my_result
824
824
psa_ps_iterator_next(my_context, my_result)
825
-
// we will get an does not exist error when we reach the last item, any other error is a storage fialure
825
+
// we will get an does not exist error when we reach the last item, any other error is a storage failure
826
826
if my_reult <> PSA_ERROR_DOES_NOT_EXIST
827
827
{
828
828
/* deal with storage failure */
@@ -841,7 +841,7 @@ These definitions must be defined in the header file :file:`psa/protected_storag
841
841
Returns the next ``uid`` in this iteration.
842
842
843
843
.. param:: psa_storage_iterator_t* context
844
-
A pointer to a context for this iterator as returned by ``psa_ps_iterator_start()`` or updated by a previous call to ``psa_ps_iterator_next``. The content of the iterator will change on success and is undefined on error.
844
+
A pointer to a context for this iterator as returned by `psa_ps_iterator_start()` or updated by a previous call to `psa_ps_iterator_next()`. The content of the iterator will change on success and is undefined on error.
845
845
846
846
.. param:: psa_storage_uid_t *result
847
847
A pointer to the location in which to store ``uid``. On success the contents of this location will be updated with the next matching ``uid``. On error, the contents are undefined.
@@ -859,14 +859,14 @@ These definitions must be defined in the header file :file:`psa/protected_storag
859
859
The operation failed because the physical storage has failed (Fatal error).
860
860
861
861
.. retval:: PSA_ERROR_DATA_CORRUPT
862
-
The operation failed because the contents of the iteration have changed. That is a `uid` matching the filter has either been created or deleted.
862
+
The operation failed because the contents of the iteration have changed. That is a ``uid`` matching the filter has either been created or deleted.
863
863
864
864
.. retval:: PSA_ERROR_INVALID_ARGUMENT
865
865
The operation failed because either:
866
866
867
867
* The provided context is not valid.
868
868
869
-
* The caller cannot access the memory at ``result``
0 commit comments