49 /** |
49 /** |
50 * Generic loop statement for lists. |
50 * Generic loop statement for lists. |
51 * |
51 * |
52 * The first argument is the type of the list and its elements (e.g. UcxList). |
52 * The first argument is the type of the list and its elements (e.g. UcxList). |
53 * The structure invariant of the list must be as follows: |
53 * The structure invariant of the list must be as follows: |
54 * |
|
55 * <ul> |
54 * <ul> |
56 * <li>a first (non-<code>NULL</code>) element</li> |
55 * <li>a first (non-<code>NULL</code>) element</li> |
57 * <li>for each element a reference to the <code>next</code> element (the |
56 * <li>for each element a reference to the <code>next</code> element (the |
58 * variable name of the pointer MUST be <code>next</code>)</li> |
57 * variable name of the pointer MUST be <code>next</code>)</li> |
59 * <li>the last element of the list MUST have the <code>next</code> pointer |
58 * <li>the last element of the list MUST have the <code>next</code> pointer |
105 * The signature of the write function shall be compatible to the signature |
104 * The signature of the write function shall be compatible to the signature |
106 * of standard <code>fwrite</code>, though it may use arbitrary data types for |
105 * of standard <code>fwrite</code>, though it may use arbitrary data types for |
107 * source and destination. |
106 * source and destination. |
108 * |
107 * |
109 * The arguments shall contain (in ascending order): a pointer to the source, |
108 * The arguments shall contain (in ascending order): a pointer to the source, |
110 * the length of one element, the element count, a pointer to the destination. |
109 * the length of one element, the element count and a pointer to the |
|
110 * destination. |
111 */ |
111 */ |
112 typedef size_t(*write_func)(const void*, size_t, size_t, void*); |
112 typedef size_t(*write_func)(const void*, size_t, size_t, void*); |
113 |
113 |
114 /** |
114 /** |
115 * Function pointer to a read function. |
115 * Function pointer to a read function. |
117 * The signature of the read function shall be compatible to the signature |
117 * The signature of the read function shall be compatible to the signature |
118 * of standard <code>fread</code>, though it may use arbitrary data types for |
118 * of standard <code>fread</code>, though it may use arbitrary data types for |
119 * source and destination. |
119 * source and destination. |
120 * |
120 * |
121 * The arguments shall contain (in ascending order): a pointer to the |
121 * The arguments shall contain (in ascending order): a pointer to the |
122 * destination, the length of one element, the element count, a pointer to the |
122 * destination, the length of one element, the element count and a pointer to |
123 * source. |
123 * the source. |
124 */ |
124 */ |
125 typedef size_t(*read_func)(void*, size_t, size_t, void*); |
125 typedef size_t(*read_func)(void*, size_t, size_t, void*); |
126 |
126 |
127 #ifdef __cplusplus |
127 #ifdef __cplusplus |
128 } |
128 } |