satyr  0.26
python/frame.h
Go to the documentation of this file.
1 /*
2  python_frame.h
3 
4  Copyright (C) 2012 ABRT Team
5  Copyright (C) 2012 Red Hat, Inc.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21 #ifndef SATYR_PYTHON_FRAME_H
22 #define SATYR_PYTHON_FRAME_H
23 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include "../report_type.h"
34 #include <stdbool.h>
35 #include <stdint.h>
36 
37 struct sr_location;
38 struct sr_strbuf;
39 struct sr_json_value;
40 
42 {
43  enum sr_report_type type;
44 
45  bool special_file;
46 
47  char *file_name;
48 
49  uint32_t file_line;
50 
51  bool special_function;
52 
53  char *function_name;
54 
55  char *line_contents;
56 
57  struct sr_python_frame *next;
58 };
59 
66 struct sr_python_frame *
68 
75 void
77 
84 void
86 
100 struct sr_python_frame *
102  bool siblings);
103 
117 int
118 sr_python_frame_cmp(struct sr_python_frame *frame1,
119  struct sr_python_frame *frame2);
120 
134 int
136  struct sr_python_frame *frame2);
137 
138 
145 struct sr_python_frame *
147  struct sr_python_frame *item);
148 
165 struct sr_python_frame *
166 sr_python_frame_parse(const char **input,
167  struct sr_location *location);
168 
175 char *
177 
187 struct sr_python_frame *
188 sr_python_frame_from_json(struct sr_json_value *root, char **error_message);
189 
193 void
195  struct sr_strbuf *dest);
196 
197 #ifdef __cplusplus
198 }
199 #endif
200 
201 #endif
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)
void sr_python_frame_free(struct sr_python_frame *frame)
A resizable string buffer.
Definition: strbuf.h:38
struct sr_python_frame * sr_python_frame_new(void)
struct sr_python_frame * sr_python_frame_from_json(struct sr_json_value *root, char **error_message)
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_dup(struct sr_python_frame *frame, bool siblings)
A location of a parser in the input stream.
Definition: location.h:42
void sr_python_frame_init(struct sr_python_frame *frame)
void sr_python_frame_append_to_str(struct sr_python_frame *frame, struct sr_strbuf *dest)
int sr_python_frame_cmp(struct sr_python_frame *frame1, struct sr_python_frame *frame2)