Relocatable loader library
rl_unload
Definition:
Arguments:
UM1237
The following example illustrates how the rl_load_file() function may be implemented using the rl_load_stream() function:
/* User implementation of the callback function that read from a file. */
static int rl_stream_read(FILE *file, char *buffer, int length)
{
int nbytes;
nbytes = fread(buffer, 1, length, file);
}
return nbytes;
...
{
/* Loads the module from a file.*/
FILE *file;
int status;
file = fopen(f_name, "rb");
if (file == NULL) { /*... error... */ }
status = rl_load_stream(handle, (rl_stream_func_t
*)rl_stream_read, file);
if (status == -1) { /*... error... */ }
fclose(file);
}
...
Unload a previously loaded relocatable module
int rl_unload(
rl_handle_t *handle);
Returns:
Description:
handle
The handle for the module.
Returns 0 for success, -1 for failure.
The rl_unload() function unloads a previously loaded relocatable module. It finalizes, unlinks, and frees allocated memory for the loaded module. This function calls the action callback functions for RL_ACTION_UNLOAD before unloading and after having executed finalization code in the module.
The return value is 0 if the unloading is successful, otherwise the return value is -1 and the error code returned by rl_errno() is set accordingly.
150/166 8027948 Rev 15