Updated Spanish translation
[anjuta-git-plugin.git] / plugins / valgrind / vgrule.h
blobcddf8307a8ef243df9f3aef314a1c40ae8572eac
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_RULE_H__
25 #define __VG_RULE_H__
27 #include "parser.h"
29 #ifdef __cplusplus
30 extern "C" {
31 #pragma }
32 #endif /* __cplusplus */
35 typedef enum {
36 VG_CALLER_FUNCTION,
37 VG_CALLER_OBJECT,
38 VG_CALLER_LAST
39 } vgcaller_t;
41 typedef struct _VgCaller {
42 struct _VgCaller *next;
43 vgcaller_t type;
44 char *name;
45 } VgCaller;
47 typedef struct _VgTool {
48 struct _VgTool *next;
49 char *name;
50 } VgTool;
52 typedef enum {
53 VG_RULE_ADDR1,
54 VG_RULE_ADDR2,
55 VG_RULE_ADDR4,
56 VG_RULE_ADDR8,
57 VG_RULE_COND,
58 VG_RULE_FREE,
59 VG_RULE_LEAK,
60 VG_RULE_PARAM,
61 VG_RULE_PTHREAD,
62 VG_RULE_VALUE1,
63 VG_RULE_VALUE2,
64 VG_RULE_VALUE4,
65 VG_RULE_VALUE8,
66 VG_RULE_LAST
67 } vgrule_t;
69 typedef struct _VgRule {
70 char *name;
71 VgTool *tools;
72 vgrule_t type;
73 char *syscall;
74 VgCaller *callers;
75 } VgRule;
77 const char *vg_caller_type_to_name (vgcaller_t type);
78 vgcaller_t vg_caller_type_from_name (const char *name);
80 VgCaller *vg_caller_new (vgcaller_t type, const char *name);
81 void vg_caller_free (VgCaller *caller);
83 const char *vg_rule_type_to_name (vgrule_t type);
84 vgrule_t vg_rule_type_from_name (const char *name);
86 int vg_rule_type_from_report (const char *report, vgrule_t *type, char **syscall);
88 VgRule *vg_rule_new (vgrule_t type, const char *name);
89 void vg_rule_add_tool (VgRule *rule, const char *tool);
90 void vg_rule_free (VgRule *rule);
93 typedef struct _VgRuleParser VgRuleParser;
95 typedef void (* VgRuleParserRuleCallback) (VgRuleParser *parser, VgRule *rule, void *user_data);
97 struct _VgRuleParser {
98 Parser parser;
100 unsigned char *linebuf;
101 unsigned char *lineptr;
102 unsigned int lineleft;
104 VgRule *current;
105 VgCaller *tail;
107 VgRuleParserRuleCallback rule_cb;
108 void *user_data;
110 int state;
114 VgRuleParser *vg_rule_parser_new (int fd, VgRuleParserRuleCallback rule_cb, void *user_data);
115 void vg_rule_parser_free (VgRuleParser *parser);
117 int vg_rule_parser_step (VgRuleParser *parser);
118 void vg_rule_parser_flush (VgRuleParser *parser);
120 int vg_suppressions_file_write_header (int fd, const char *summary);
121 int vg_suppressions_file_append_rule (int fd, VgRule *rule);
123 #ifdef __cplusplus
125 #endif /* __cplusplus */
127 #endif /* __VG_RULE_H__ */