1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/**
* Author: Sumit Bose <sbose@redhat.com>
*
* Copyright (C) 2008 Red Hat
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; version 2 only
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; see the file COPYING.LGPL. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#include <mcheck.h>
#include "helpers.h"
#include "util.h"
#include "xml_helper.h"
#include "ipaaction.h"
#include "output_handler.h"
int my_mallinfo () {
struct mallinfo info = mallinfo();
printf ("arena: %d\n", info.arena);
return 0;
}
int main(int argc, char **argv)
{
char *xslt_file_name;
char *ipa_policy_type;
char *policy_file_name;
mtrace();
if (argc != 2) {
DEBUG(0,
("missing or to many arguments, I expect a single filename!\n"));
exit(1);
}
policy_file_name=strdup(argv[1]);
validate_policy(policy_file_name, &ipa_policy_type, &xslt_file_name);
if ( strncmp( ipa_policy_type, "ipaaction", 9)==0) {
handle_ipaaction(policy_file_name);
} else {
find_output_handler(policy_file_name, xslt_file_name);
find_output_handler(policy_file_name, xslt_file_name);
free(xslt_file_name);
}
free(ipa_policy_type);
free(policy_file_name);
xmlCleanupParser();
printf("xmlMemUsed: %d\n",xmlMemUsed());
muntrace();
return 0;
}
|