rl_foreach_segment. STMicroelectronics STxP70
விளம்பரம்
விளம்பரம்
Relocatable loader library UM1237
rl_foreach_segment
Definition:
Iterate over all the segments of loaded module and call the supplied function
typedef rl_segment_info_t_ rl_segment_info_t; typedef int rl_segment_func_t (
rl_handle_t *handle,
rl_segment_info_t *seg_info,
void *cookie); int rl_foreach_segment(
rl_handle_t *handle,
rl_segment_func_t *callback_fn,
void *callback_cookie);
Arguments:
Returns:
Description:
handle callback_fn
The handle for the module.
The user specified callback function.
callback_cookie
The argument to pass to the function.
Returns 0 for success, -1 for failure.
The rl_foreach_segment() function iterates over all the segments of the loaded module handle and calls back the user supplied function. For each segment, the function callback_fn is called with the following parameters.
handle
The handle passed to the function.
seg_info
The segment information pointer filled with the current segment information.
cookie
The argument passed to the function.
The segment information returned in seg_info is a pointer to the following structure: typedef unsigned int rl_segment_flag_t; struct rl_segment_info_t_ {
const char *seg_addr;
unsigned int seg_size;
rl_segment_flag_t seg_flags;
};
The user callback function must return 0 on success or -1 on error.
In the case where the callback function returns an error, the rl_foreach_segment()
function returns -1 and the error code returned by rl_errno
is set to RL_ERR_SEGMENTF. Otherwise the function returns 0.
152/166 8027948 Rev 15
பதிவிறக்கு
விளம்பரம்