Example: lrs_get_static_buffer
In the following example, lrs_get_static_buffer gets a segment of the static buffer received on "socket2", "\xff\xffHost=phobos\r\n". It retrieves six bytes of data at an offset of 7, which is the Host Name.
char *HostName;
HostName = lrs_get_static_buffer ("socket2", "buf2", 7, 6, NULL);
/* The value in HostName is now "phobos" */
To save the contents of a buffer to a parameter for later use, type:
lrs_save_param_ex("socket2", "user", HostName, 0, 6, "ascii", "new_parameter");
lr_output_message("The new parameter = \"%s\"\n", lr_eval_string("< new_parameter >"));
Message from run.c(52):The new parameter = "phobos"