• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include "libxml.h"
17 #include <libxml/relaxng.h>
18 #include <libxml/xmlerror.h>
19 #include <libxml/valid.h>
20 #include <libxml/xmlschemas.h>
21 #include <libxml/xmlschemastypes.h>
22 #include <string.h>
23 
xmlPosixStrdup(const char * cur)24 static char *xmlPosixStrdup(const char *cur) {
25   return ((char *)xmlCharStrdup(cur));
26 }
27 
main(int argc,char ** argv)28 int main(int argc, char **argv) {
29   if (argc != 2) {
30     return EXIT_FAILURE;
31   }
32   xmlGetWarningsDefaultValue = 0;
33   xmlPedanticParserDefault(0);
34   xmlGcMemSetup(free, malloc, malloc, realloc, xmlPosixStrdup);
35   xmlInitParser();
36   xmlSchemaInitTypes();
37   xmlRelaxNGInitTypes();
38   xmlReadFile(argv[1], NULL, XML_PARSE_OLD10);
39   return EXIT_SUCCESS;
40 }
41