|
satyr 0.43
|
Python frame structure and related algorithms. More...
#include "../report_type.h"#include <json.h>#include <stdbool.h>#include <stdint.h>#include <glib.h>Go to the source code of this file.
Data Structures | |
| struct | sr_python_frame |
Functions | |
| struct sr_python_frame * | sr_python_frame_new (void) |
| void | sr_python_frame_init (struct sr_python_frame *frame) |
| void | sr_python_frame_free (struct sr_python_frame *frame) |
| struct sr_python_frame * | sr_python_frame_dup (struct sr_python_frame *frame, bool siblings) |
| int | sr_python_frame_cmp (struct sr_python_frame *frame1, struct sr_python_frame *frame2) |
| int | sr_python_frame_cmp_distance (struct sr_python_frame *frame1, struct sr_python_frame *frame2) |
| struct sr_python_frame * | sr_python_frame_append (struct sr_python_frame *dest, struct sr_python_frame *item) |
| struct sr_python_frame * | sr_python_frame_parse (const char **input, struct sr_location *location) |
| char * | sr_python_frame_to_json (struct sr_python_frame *frame) |
| struct sr_python_frame * | sr_python_frame_from_json (json_object *root, char **error_message) |
| void | sr_python_frame_append_to_str (struct sr_python_frame *frame, GString *dest) |
Python frame structure and related algorithms.
Definition in file python/frame.h.
| struct sr_python_frame * sr_python_frame_append | ( | struct sr_python_frame * | dest, |
| struct sr_python_frame * | item ) |
Appends 'item' at the end of the list 'dest'.
References sr_python_frame_append().
Referenced by sr_python_frame_append().
| void sr_python_frame_append_to_str | ( | struct sr_python_frame * | frame, |
| GString * | dest ) |
Appends textual representation of the frame to the string buffer dest.
References sr_python_frame_append_to_str().
Referenced by sr_python_frame_append_to_str().
| int sr_python_frame_cmp | ( | struct sr_python_frame * | frame1, |
| struct sr_python_frame * | frame2 ) |
Compares two python frames.
| frame1 | It must be non-NULL pointer. It's not modified by calling this function. |
| frame2 | It must be non-NULL pointer. It's not modified by calling this function. |
References sr_python_frame_cmp().
Referenced by sr_python_frame_cmp().
| int sr_python_frame_cmp_distance | ( | struct sr_python_frame * | frame1, |
| struct sr_python_frame * | frame2 ) |
Compares two python frames.
| frame1 | It must be non-NULL pointer. It's not modified by calling this function. |
| frame2 | It must be non-NULL pointer. It's not modified by calling this function. |
References sr_python_frame_cmp_distance().
Referenced by sr_python_frame_cmp_distance().
| struct sr_python_frame * sr_python_frame_dup | ( | struct sr_python_frame * | frame, |
| bool | siblings ) |
Creates a duplicate of the frame.
| frame | It must be non-NULL pointer. The frame is not modified by calling this function. |
| siblings | Whether to duplicate also siblings referenced by frame->next. If false, frame->next is not duplicated for the new frame, but it is set to NULL. |
References sr_python_frame_dup().
Referenced by sr_python_frame_dup().
| void sr_python_frame_free | ( | struct sr_python_frame * | frame | ) |
Releases the memory held by the frame. The frame siblings are not released.
| frame | If the frame is NULL, no operation is performed. |
References sr_python_frame_free().
Referenced by sr_python_frame_free().
| struct sr_python_frame * sr_python_frame_from_json | ( | json_object * | root, |
| char ** | error_message ) |
Deserializes frame structure from JSON representation.
| root | JSON value to be deserialized. |
| error_message | On error, *error_message will contain the description of the error. |
References sr_python_frame_from_json().
Referenced by sr_python_frame_from_json().
| void sr_python_frame_init | ( | struct sr_python_frame * | frame | ) |
Initializes all members of the frame structure to their default values. No memory is released, members are simply overwritten. This is useful for initializing a frame structure placed on the stack.
References sr_python_frame_init().
Referenced by sr_python_frame_init().
| struct sr_python_frame * sr_python_frame_new | ( | void | ) |
Creates and initializes a new frame structure.
References sr_python_frame_new().
Referenced by sr_python_frame_new().
| struct sr_python_frame * sr_python_frame_parse | ( | const char ** | input, |
| struct sr_location * | location ) |
If the input contains a complete frame, this function parses the frame text, returns it in a structure, and moves the input pointer after the frame. If the input does not contain proper, complete frame, the function does not modify input and returns NULL.
| location | The caller must provide a pointer to an instance of sr_location here. When this function returns NULL, the structure will contain the error line, column, and message. The line and column members of the location are gradually increased as the parser handles the input, so the location should be initialized before calling this function to get reasonable values. |
References sr_python_frame_parse().
Referenced by sr_python_frame_parse().
| char * sr_python_frame_to_json | ( | struct sr_python_frame * | frame | ) |
Returns a textual representation of the frame.
| frame | It must be a non-NULL pointer. It's not modified by calling this function. |
References sr_python_frame_to_json().
Referenced by sr_python_frame_to_json().