src/cx/array_list.h

changeset 819
5da2ead43077
parent 818
2be8fe3d5a2d
child 831
7970eac1c598
equal deleted inserted replaced
818:2be8fe3d5a2d 819:5da2ead43077
97 * A default stdlib-based array reallocator. 97 * A default stdlib-based array reallocator.
98 */ 98 */
99 extern struct cx_array_reallocator_s *cx_array_default_reallocator; 99 extern struct cx_array_reallocator_s *cx_array_default_reallocator;
100 100
101 /** 101 /**
102 * Return codes for cx_array_copy(). 102 * Return codes for array functions.
103 */ 103 */
104 enum cx_array_copy_result { 104 enum cx_array_result {
105 CX_ARRAY_COPY_SUCCESS, 105 CX_ARRAY_SUCCESS,
106 CX_ARRAY_COPY_REALLOC_NOT_SUPPORTED, 106 CX_ARRAY_REALLOC_NOT_SUPPORTED,
107 CX_ARRAY_COPY_REALLOC_FAILED, 107 CX_ARRAY_REALLOC_FAILED,
108 }; 108 };
109 109
110 /** 110 /**
111 * Copies elements from one array to another. 111 * Copies elements from one array to another.
112 * 112 *
130 * @param elem_count the number of elements to copy 130 * @param elem_count the number of elements to copy
131 * @param reallocator the array re-allocator to use, or \c NULL 131 * @param reallocator the array re-allocator to use, or \c NULL
132 * if re-allocation shall not happen 132 * if re-allocation shall not happen
133 * @return zero on success, non-zero error code on failure 133 * @return zero on success, non-zero error code on failure
134 */ 134 */
135 enum cx_array_copy_result cx_array_copy( 135 enum cx_array_result cx_array_copy(
136 void **target, 136 void **target,
137 size_t *size, 137 size_t *size,
138 size_t *capacity, 138 size_t *capacity,
139 size_t index, 139 size_t index,
140 void const *src, 140 void const *src,

mercurial