Functions | |
| ops_boolean_t | ops_limited_read (unsigned char *dest, size_t length, ops_region_t *region, ops_error_t **errors, ops_reader_info_t *rinfo, ops_parse_cb_info_t *cbinfo) |
| Read bytes from a region within the packet. | |
| ops_boolean_t | ops_stacked_limited_read (void *dest, unsigned length, ops_region_t *region, ops_error_t **errors, ops_reader_info_t *rinfo, ops_parse_cb_info_t *cbinfo) |
| Call ops_limited_read on next in stack. | |
| int | ops_parse (ops_parse_info_t *pinfo) |
| Parse packets from an input stream until EOF or error. | |
| int | ops_parse_and_print_errors (ops_parse_info_t *pinfo) |
| Parse packets and print any errors. | |
| void | ops_parse_options (ops_parse_info_t *pinfo, ops_content_tag_t tag, ops_parse_type_t type) |
| Specifies whether one or more signature subpacket types should be returned parsed; or raw; or ignored. | |
| ops_parse_info_t * | ops_parse_info_new (void) |
| Creates a new zero-ed ops_parse_info_t struct. | |
| void | ops_parse_info_delete (ops_parse_info_t *pinfo) |
| Free ops_parse_info_t struct and its contents. | |
| ops_reader_info_t * | ops_parse_get_rinfo (ops_parse_info_t *pinfo) |
| Returns the parse_info's reader_info. | |
| void | ops_parse_cb_set (ops_parse_info_t *pinfo, ops_parse_cb_t *cb, void *arg) |
| Sets the parse_info's callback This is used when adding the first callback in a stack of callbacks. | |
| void | ops_parse_cb_push (ops_parse_info_t *pinfo, ops_parse_cb_t *cb, void *arg) |
| Adds a further callback to a stack of callbacks. | |
| void * | ops_parse_cb_get_arg (ops_parse_cb_info_t *cbinfo) |
| Returns callback's arg. | |
| void * | ops_parse_cb_get_errors (ops_parse_cb_info_t *cbinfo) |
| Returns callback's errors. | |
| ops_parse_cb_return_t | ops_parse_cb (const ops_parser_content_t *content, ops_parse_cb_info_t *cbinfo) |
| Calls the parse_cb_info's callback if present. | |
| ops_parse_cb_return_t | ops_parse_stacked_cb (const ops_parser_content_t *content, ops_parse_cb_info_t *cbinfo) |
| Calls the next callback in the stack. | |
| ops_error_t * | ops_parse_info_get_errors (ops_parse_info_t *pinfo) |
| Returns the parse_info's errors. | |
|
||||||||||||||||||||||||||||
|
Read bytes from a region within the packet. Read length bytes into the buffer pointed to by *dest. Make sure we do not read over the packet boundary. Updates the Packet Tag's ops_ptag_t::length_read. If length would make us read over the packet boundary, or if reading fails, we call the callback with an error. Note that if the region is indeterminate, this can return a short read - check region->last_read for the length. EOF is indicated by a success return and region->last_read == 0 in this case (for a region of known length, EOF is an error). This function makes sure to respect packet boundaries.
|
|
|
Parse packets from an input stream until EOF or error. Setup the necessary parsing configuration in "pinfo" before calling ops_parse(). That information includes :
After returning, pinfo->errors holds any errors encountered while parsing.
ops_parse_cb_t* example_callback(); void example() { int fd=0; ops_parse_info_t *pinfo=NULL; char *filename="pubring.gpg"; // setup pinfo to read from file with example callback fd=ops_setup_file_read(&pinfo, filename, NULL, example_callback, ops_false); // specify how we handle signature subpackets ops_parse_options(pinfo, OPS_PTAG_SS_ALL, OPS_PARSE_PARSED); if (!ops_parse(pinfo)) ops_print_errors(pinfo->errors); ops_teardown_file_read(pinfo,fd); } |
|
|
Parse packets and print any errors.
|
|
||||||||||||
|
Calls the parse_cb_info's callback if present.
|
|
||||||||||||||||
|
Adds a further callback to a stack of callbacks.
|
|
||||||||||||||||
|
Sets the parse_info's callback This is used when adding the first callback in a stack of callbacks.
|
|
|
Returns the parse_info's reader_info.
|
|
|
Free ops_parse_info_t struct and its contents.
|
|
|
Returns the parse_info's errors.
|
|
|
Creates a new zero-ed ops_parse_info_t struct.
|
|
||||||||||||||||
|
Specifies whether one or more signature subpacket types should be returned parsed; or raw; or ignored.
|
|
||||||||||||
|
Calls the next callback in the stack.
|
1.4.6