Parse an object read from PPS
#include <sys/pps.h> extern pps_status_t ppsparse(char **ppsdata, const char * const *objnames, const char * const *attrnames, pps_attrib_t *info, int parse_flags);
libpps
The function ppsparse() provides a lower-level alternative to the pps_decoder_*() functions (which themselves use pps_parse()). Except in special circumstances, it's better to use the pps_decoder_*() functions than to use ppsparse().
The function ppsparse() parses the next line of a buffer of PPS data. This buffer must be terminated by a null ("\0") in C or hexadecimal 0x00).
The first time you call this function after reading PPS data, you should set ppsdata to reference the start of the buffer with the data. As it parses each line of data, ppsparse():
When it successfully completes parsing a line, ppsparse() returns the type of line parsed or end of data in the pps_status_t data structure.
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
During parsing, separators (":" and "\n") in the input string may be changed to null characters.