Lines Matching refs:index

6 static inline bool index_out_of_range(zend_long index, zend_long max)  in index_out_of_range()  argument
8 if (index < 0 || index >= max) { in index_out_of_range()
9 INDEX_OUT_OF_RANGE(index, max); in index_out_of_range()
104 void ds_vector_remove(ds_vector_t *vector, zend_long index, zval *return_value) in ds_vector_remove() argument
106 if (index_out_of_range(index, vector->size)) { in ds_vector_remove()
110 if (index == vector->size - 1) { in ds_vector_remove()
114 zval *pos = vector->buffer + index; in ds_vector_remove()
124 memmove(pos, pos + 1, sizeof(zval) * (vector->size - index)); in ds_vector_remove()
131 zval *ds_vector_get(ds_vector_t *vector, zend_long index) in ds_vector_get() argument
133 if (index_out_of_range(index, vector->size)) { in ds_vector_get()
137 return vector->buffer + index; in ds_vector_get()
170 void ds_vector_set(ds_vector_t *vector, zend_long index, zval *value) in ds_vector_set() argument
172 if ( ! index_out_of_range(index, vector->size)) { in ds_vector_set()
173 zval *ptr = vector->buffer + index; in ds_vector_set()
215 zend_long index = ds_vector_find_index(vector, value); in ds_vector_find() local
217 if (index >= 0) { in ds_vector_find()
218 ZVAL_LONG(return_value, index); in ds_vector_find()
248 void ds_vector_insert_va(ds_vector_t *vector, zend_long index, VA_PARAMS) in ds_vector_insert_va() argument
250 if ( ! index_out_of_range(index, vector->size + 1) && argc > 0) { in ds_vector_insert_va()
259 dst = vector->buffer + index; in ds_vector_insert_va()
261 len = vector->size - index; in ds_vector_insert_va()
264 memmove(end, dst, (vector->size - index) * sizeof(zval)); in ds_vector_insert_va()
275 void ds_vector_insert(ds_vector_t *vector, zend_long index, zval *value) in ds_vector_insert() argument
277 ds_vector_insert_va(vector, index, 1, value); in ds_vector_insert()
351 bool ds_vector_isset(ds_vector_t *vector, zend_long index, int check_empty) in ds_vector_isset() argument
353 if (index < 0 || index >= vector->size) { in ds_vector_isset()
357 return ds_zval_isset(vector->buffer + index, check_empty); in ds_vector_isset()
360 bool ds_vector_index_exists(ds_vector_t *vector, zend_long index) in ds_vector_index_exists() argument
362 return index >= 0 && index < vector->size; in ds_vector_index_exists()
677 ds_vector_t *ds_vector_slice(ds_vector_t *vector, zend_long index, zend_long length) in ds_vector_slice() argument
679 ds_normalize_slice_args(&index, &length, vector->size); in ds_vector_slice()
688 zval *src = vector->buffer + index; in ds_vector_slice()
689 zval *end = vector->buffer + index + length; in ds_vector_slice()