Line data Source code
1 : /* File: data_search_result_list.inl; Copyright and License: see below */ 2 : 3 1 : static inline void data_search_result_list_init ( data_search_result_list_t *this_, 4 : unsigned int max_elements, 5 : data_search_result_t (*elements)[] ) 6 : { 7 1 : universal_array_list_init( (universal_array_list_t*) this_, 8 : max_elements, 9 : (void*)elements, 10 : sizeof(data_search_result_t), 11 : sizeof(data_search_result_t), 12 : (void (*)(void *, const void *)) data_search_result_copy, 13 : NULL, 14 : NULL 15 : ); 16 1 : } 17 : 18 1 : static inline void data_search_result_list_destroy ( data_search_result_list_t *this_ ) 19 : { 20 1 : universal_array_list_destroy( (universal_array_list_t*) this_ ); 21 1 : } 22 : 23 1 : static inline void data_search_result_list_trace ( const data_search_result_list_t *this_ ) 24 : { 25 1 : universal_array_list_trace( (universal_array_list_t*) this_ ); 26 2 : for ( unsigned int idx = 0; idx < data_search_result_list_get_length(this_); idx ++ ) 27 : { 28 1 : data_search_result_trace( data_search_result_list_get_const(this_,idx) ); 29 : } 30 1 : } 31 : 32 1 : static inline bool data_search_result_list_is_empty ( const data_search_result_list_t *this_ ) 33 : { 34 1 : return universal_array_list_is_empty( (universal_array_list_t*) this_ ); 35 : } 36 : 37 1 : static inline u8_error_t data_search_result_list_add ( data_search_result_list_t *this_, const data_search_result_t* element ) 38 : { 39 1 : return universal_array_list_append( (universal_array_list_t*) this_, element ); 40 : } 41 : 42 1 : static inline u8_error_t data_search_result_list_add_all ( data_search_result_list_t *this_, const data_search_result_list_t *that ) 43 : { 44 1 : return universal_array_list_append_all( (universal_array_list_t*) this_, (const universal_array_list_t*) that ); 45 : } 46 : 47 1 : static inline data_search_result_t *data_search_result_list_get_ptr ( data_search_result_list_t *this_, unsigned int index ) 48 : { 49 1 : return (data_search_result_t*) universal_array_list_get_ptr( (universal_array_list_t*) this_, index ); 50 : } 51 : 52 2 : static inline data_search_result_t const *data_search_result_list_get_const ( const data_search_result_list_t *this_, unsigned int index ) 53 : { 54 2 : return (data_search_result_t const*) universal_array_list_get_const( (universal_array_list_t*) this_, index ); 55 : } 56 : 57 1 : static inline void data_search_result_list_clear ( data_search_result_list_t *this_ ) 58 : { 59 1 : universal_array_list_clear( (universal_array_list_t*) this_ ); 60 1 : } 61 : 62 4 : static inline unsigned int data_search_result_list_get_length ( const data_search_result_list_t *this_ ) 63 : { 64 4 : return universal_array_list_get_length( (universal_array_list_t*) this_ ); 65 : } 66 : 67 : 68 : /* 69 : Copyright 2020-2024 Andreas Warnke 70 : 71 : Licensed under the Apache License, Version 2.0 (the "License"); 72 : you may not use this file except in compliance with the License. 73 : You may obtain a copy of the License at 74 : 75 : http://www.apache.org/licenses/LICENSE-2.0 76 : 77 : Unless required by applicable law or agreed to in writing, software 78 : distributed under the License is distributed on an "AS IS" BASIS, 79 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 80 : See the License for the specific language governing permissions and 81 : limitations under the License. 82 : */