X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=include%2Fhfta%2Fhfta_runtime_library.h;h=4a215d7c02fb2b1f546eb2d4de855c30f861d914;hb=HEAD;hp=afcf6829123c2937626ac5dcac92603d56adb0fa;hpb=eb761d89890df8d74532dd4faad118db18fd3b7d;p=com%2Fgs-lite.git diff --git a/include/hfta/hfta_runtime_library.h b/include/hfta/hfta_runtime_library.h index afcf682..4a215d7 100644 --- a/include/hfta/hfta_runtime_library.h +++ b/include/hfta/hfta_runtime_library.h @@ -30,16 +30,19 @@ Copyright 2014 AT&T Intellectual Property // Internal functions +void hfta_vstr_init(vstring * str); gs_retval_t Vstring_Constructor(vstring *, gs_csp_t); gs_retval_t hfta_vstr_length(vstring *); -void hfta_vstr_assign_with_copy_in_tuple(vstring32 *, vstring *, gs_sp_t, int); -void hfta_vstr_assign_with_copy(vstring *, vstring *); +void hfta_vstr_assign_with_copy_in_tuple(vstring32 *, const vstring *, + gs_sp_t, int); +void hfta_vstr_assign_with_copy(vstring *, const vstring *); void hfta_vstr_destroy(vstring *); -void hfta_vstr_replace(vstring *, vstring *); +void hfta_vstr_replace(vstring *, const vstring *); gs_uint32_t hfta_vstr_hashfunc(const vstring *); gs_uint64_t hfta_vstr_long_hashfunc(const vstring *); gs_retval_t hfta_vstr_compare(const vstring *, const vstring *); +gs_retval_t hfta_vstr_equal(const vstring *, const vstring *); gs_retval_t hfta_ipv6_compare(const hfta_ipv6_str &i1, const hfta_ipv6_str &i2); hfta_ipv6_str And_Ipv6(const hfta_ipv6_str &i1, const hfta_ipv6_str &i2); @@ -60,9 +63,13 @@ inline static gs_retval_t str_truncate(vstring * result, vstring *str, gs_uint32 result->reserved=SHALLOW_COPY; return 0; } +gs_retval_t str_suffix(vstring *result, vstring *s, gs_uint32_t n); +gs_retval_t get_list_entry(vstring *result, vstring *s, vstring *sep, gs_uint32_t pos); + gs_retval_t str_exists_substr(vstring * s1, vstring * s2); gs_retval_t str_compare(vstring * s1, vstring * s2); +gs_retval_t str_equal(vstring * s1, vstring * s2); gs_uint32_t str_match_offset(gs_uint32_t offset,vstring *s1,vstring *s2); gs_uint32_t byte_match_offset( gs_uint32_t offset, gs_uint32_t val,vstring *s2); @@ -126,6 +133,28 @@ inline gs_uint32_t str_match_offset( gs_uint32_t offset, struct vstring * s1, st return 1; } +// ------------------------------------------------------- +// map_int_to_string and its support functions, structs + +gs_param_handle_t register_handle_for_int_to_string_map_slot_1(vstring *filename); +gs_retval_t int_to_string_map(vstring *result, gs_int64_t val, gs_param_handle_t handle); +gs_param_handle_t deregister_handle_for_int_to_string_map_slot_1(gs_param_handle_t handle); + +// -------------------------------------------------- +// to_hex_string, for printing a binary string + +gs_retval_t to_hex_string(vstring *result, vstring *val); + +// ------------------------------------------------------ +// sum up unsigned integers expressed as a string with separators, +// e.g. on input '34|45|56' and sep '|', return 135. +// This kind of thing is common in Nokia PCMD data. +// gracefully handle empty entries, e.g. '|8|' should return 8 +gs_int64_t sum_uint_in_list(struct vstring *list, struct vstring *sepchar); + +// -------------------------------------------- +// Convert an string to an integer +gs_int64_t to_llong(vstring *v); #endif