memory_search_c
status.i4.v = memory_search_c(source.g.v, num_src_vals.i4.v,
search.g.v, num_srch_vals.i4.v,
sizeof_entry.i4.v, match_index.i4.r)
This routine will search a block of memory for a matching pattern.
source source to be searched
num_src_values number of entries in the source (>= 1)
search value to search for
num_srch_values number of entries in the search string (>= 1)
sizeof_entry size of a single entry (in bytes) (>= 1)
match_index returned match index (starts at 0)
(-1 -> no match found)
This function returns status values as follows:
TRUE match found
FALSE match not found
CLIB_INVARG invalid number of entries, size of entry,
or null pointer passed
This function requires the following include files:
cbslib_h, acnet_errors_h
Related functions:
str_find_string_c, memory_check_c, memcmp, memset, memset_word_c,
memset_longword_c, memset_long_long_word_c, memset_float_c,
memset_double_c
C/C++ usage:
int status;
int source[256];
int num_src_vals = 256;
static const int long search[3] = {1, 2, 3};
int num_srch_vals = 3;
int sizeof_entry = sizeof(int);
int match_index;
status = memory_search_c((void *) source,num_src_vals,
(void *) search,num_srch_vals,
sizeof_entry,&match_index);