satyr 0.42
Loading...
Searching...
No Matches
js/frame.h
Go to the documentation of this file.
1/*
2 js_frame.h
3
4 Copyright (C) 2016 ABRT Team
5 Copyright (C) 2016 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_JS_FRAME_H
22#define SATYR_JS_FRAME_H
23
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "../report_type.h"
34#include <json.h>
35#include <stdbool.h>
36#include <stdint.h>
37#include <glib.h>
38
39struct sr_location;
40
42{
43 enum sr_report_type type;
44
45 char *file_name;
46
47 uint32_t file_line;
48
49 uint32_t line_column;
50
51 char *function_name;
52
53 struct sr_js_frame *next;
54};
55
56struct sr_js_frame *
57sr_js_frame_new(void);
58
59void
60sr_js_frame_init(struct sr_js_frame *frame);
61
62void
63sr_js_frame_free(struct sr_js_frame *frame);
64
65struct sr_js_frame *
66sr_js_frame_dup(struct sr_js_frame *frame, bool siblings);
67
68int
69sr_js_frame_cmp(struct sr_js_frame *frame1, struct sr_js_frame *frame2);
70
71int
72sr_js_frame_cmp_distance(struct sr_js_frame *frame1,
73 struct sr_js_frame *frame2);
74
75struct sr_js_frame *
76sr_js_frame_append(struct sr_js_frame *dest,
77 struct sr_js_frame *item);
78
79struct sr_js_frame *
80sr_js_frame_parse(const char **input, struct sr_location *location);
81
82struct sr_js_frame *
83sr_js_frame_parse_v8(const char **input, struct sr_location *location);
84
85char *
86sr_js_frame_to_json(struct sr_js_frame *frame);
87
88struct sr_js_frame *
89sr_js_frame_from_json(json_object *root, char **error_message);
90
91void
92sr_js_frame_append_to_str(struct sr_js_frame *frame, GString *dest);
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif
A location of a parser in the input stream.
Definition: location.h:43