Open topic with navigation
|Example: lrs_save_searched_string||Correlating Statements Functions|
Searches for an occurrence of strings in a static or received buffer and saves a portion of the buffer, relative to the string occurrence, to a parameter.
int lrs_save_searched_string ( char* s_desc, char* buf_desc, char* param_name, char* left_boundary, char* right_boundary, int ordinal, int offset, int param_len );
|s_desc||A descriptor identifying a connected socket.|
|buf_desc||A descriptor identifying a buffer.|
|param_name||The name of a parameter to hold the buffer value.|
|left_boundary||A string defining the left boundary of the buffer portion to save. Must begin with a prefix of LB.|
|right_boundary||A string defining the right boundary of the buffer portion to save. Must begin with a prefix of RB.|
|ordinal||The occurrence number of the left_boundary. If you specify a left_boundary, then the ordinal must be greater than 0. Otherwise, set ordinal to -1.|
|offset||The offset (in bytes) relative to the end of the left_boundary where you want to begin saving. to the parameter. If there is no left_boundary, then it is the offset relative to the beginning of the buffer.|
|param_len||The length of the data to be saved to the parameter (in bytes). This is required for cases where there is no right boundary, otherwise its value is -1.|
The lrs_save_searched_string function saves a portion of a buffer to a parameter. This function is used for correlating or linking statements within a script. This function extends the functionality of lrs_save_param.
The first two parameters specify which buffer to use:
|Use a specific buffer from the data file:||Use the last received buffer:|
|The buffer descriptor has the form: "bufxx"||The socket descriptor is not NULL and the buffer descriptor is NULLLRS_LAST_RECEIVED is specified as the buf_desc parameter|
The left_boundary and right_boundary specify which portion of the buffer to save. Specify /BIN after the boundary to specify binary data. For example, "LB/BIN=\\x00\\x01mercury
There are five ways to combine this function's parameters:
Constant offset and length (identical to lrs_save_param).
Left boundary, ordinal and right boundary.
Left boundary, ordinal and length.
Left boundary, ordinal, offset from the left boundary and right boundary.
Left boundary, ordinal, offset from the left boundary and length.
Offset and right boundary.
You cannot use standard parameterization for any arguments in this function.