satyr  0.24.15.g3735.dirty
ruby/frame.h
Go to the documentation of this file.
1 /*
2  ruby_frame.h
3 
4  Copyright (C) 2015 ABRT Team
5  Copyright (C) 2015 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_RUBY_FRAME_H
22 #define SATYR_RUBY_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  char *file_name;
46 
47  uint32_t file_line;
48 
49  bool special_function;
50 
51  char *function_name;
52 
53  uint32_t block_level;
54 
55  uint32_t rescue_level;
56 
57  struct sr_ruby_frame *next;
58 };
59 
60 struct sr_ruby_frame *
61 sr_ruby_frame_new(void);
62 
63 void
64 sr_ruby_frame_init(struct sr_ruby_frame *frame);
65 
66 void
67 sr_ruby_frame_free(struct sr_ruby_frame *frame);
68 
69 struct sr_ruby_frame *
70 sr_ruby_frame_dup(struct sr_ruby_frame *frame, bool siblings);
71 
72 int
73 sr_ruby_frame_cmp(struct sr_ruby_frame *frame1, struct sr_ruby_frame *frame2);
74 
75 int
76 sr_ruby_frame_cmp_distance(struct sr_ruby_frame *frame1,
77  struct sr_ruby_frame *frame2);
78 
79 struct sr_ruby_frame *
80 sr_ruby_frame_append(struct sr_ruby_frame *dest,
81  struct sr_ruby_frame *item);
82 
83 struct sr_ruby_frame *
84 sr_ruby_frame_parse(const char **input, struct sr_location *location);
85 
86 char *
87 sr_ruby_frame_to_json(struct sr_ruby_frame *frame);
88 
89 struct sr_ruby_frame *
90 sr_ruby_frame_from_json(struct sr_json_value *root, char **error_message);
91 
92 void
93 sr_ruby_frame_append_to_str(struct sr_ruby_frame *frame, struct sr_strbuf *dest);
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif
A resizable string buffer.
Definition: strbuf.h:38
A location of a parser in the input stream.
Definition: location.h:42