Updated Spanish translation
[anjuta-git-plugin.git] / plugins / valgrind / vgerror.h
blobb678f42b170ba9b3edab1f0c45c38aa66e2f26bf
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
5 * Copyright 2003 Ximian, Inc. (www.ximian.com)
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.
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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef __VG_ERROR_H__
25 #define __VG_ERROR_H__
27 #include <glib.h>
29 #include <time.h>
31 #include "list.h"
32 #include "parser.h"
34 #ifdef __cplusplus
35 extern "C" {
36 #pragma }
37 #endif /* __cplusplus */
39 typedef enum {
40 VG_WHERE_AT,
41 VG_WHERE_BY,
42 } vgwhere_t;
44 typedef enum {
45 VG_STACK_SOURCE,
46 VG_STACK_OBJECT,
47 } vgstack_t;
49 #define VG_STACK_ADDR_UNKNOWN ((unsigned int) -1)
51 typedef struct _VgError VgError;
52 typedef struct _VgErrorStack VgErrorStack;
53 typedef struct _VgErrorSummary VgErrorSummary;
54 typedef struct _VgErrorParser VgErrorParser;
56 struct _VgErrorStack {
57 struct _VgErrorStack *next; /* next stack frame */
58 struct _VgErrorSummary *summary; /* parent summary */
59 vgwhere_t where; /* "at", "by" */
60 unsigned int addr; /* symbol address */
61 vgstack_t type; /* func/obj */
62 char *symbol; /* symbol name */
63 union {
64 struct {
65 char *filename;
66 size_t lineno;
67 } src;
68 char *object;
69 } info;
72 struct _VgErrorSummary {
73 struct _VgErrorSummary *next;
74 struct _VgErrorStack *frames;
75 struct _VgError *parent;
76 char *report;
79 typedef unsigned long vgthread_t;
81 typedef struct _time_stamp {
82 unsigned int year;
83 unsigned int month;
84 unsigned int day;
85 unsigned int hour;
86 unsigned int min;
87 unsigned int sec;
88 unsigned int msec;
89 } time_stamp_t;
91 struct _VgError {
92 VgErrorSummary *summary; /* first summary is the error, additional summary nodes are just more specifics */
93 time_stamp_t stamp;
94 vgthread_t thread;
95 pid_t pid;
98 typedef void (*VgErrorCallback) (VgErrorParser *parser, VgError *err, void *user_data);
100 struct _VgErrorParser {
101 Parser parser;
103 GHashTable *pid_hash;
104 List errlist;
106 VgErrorCallback error_cb;
107 void *user_data;
110 VgErrorParser *vg_error_parser_new (int fd, VgErrorCallback error_cb, void *user_data);
111 void vg_error_parser_free (VgErrorParser *parser);
113 int vg_error_parser_step (VgErrorParser *parser);
114 void vg_error_parser_flush (VgErrorParser *parser);
116 void vg_error_free (VgError *err);
118 void vg_error_to_string (VgError *err, GString *str);
120 #ifdef _cplusplus
122 #endif /* __cplusplus */
124 #endif /* __VG_ERROR_H__ */