1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
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.
32 #endif /* __cplusplus */
41 typedef struct _VgCaller
{
42 struct _VgCaller
*next
;
47 typedef struct _VgTool
{
69 typedef struct _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
{
100 unsigned char *linebuf
;
101 unsigned char *lineptr
;
102 unsigned int lineleft
;
107 VgRuleParserRuleCallback rule_cb
;
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
);
125 #endif /* __cplusplus */
127 #endif /* __VG_RULE_H__ */