GithubHelp home page GithubHelp logo

xml-ada's Introduction

libxml2 interface library for gcc-Ada (GNAT)

What's this?

Ada binding to libxml2.

Prerequisites

GCC >= 5
https://gcc.gnu.org/
libxml2 >= 2.7
http://xmlsoft.org/
headmaster
http://github.com/ytomino/headmaster
yaml-ada (if you use serialization)
http://github.com/ytomino/yaml-ada

Usage

  1. Prepare the translated headers.

    1. Translate the C headers with headmaster.

      $ headmaster --to ada -p -D import-dir xml-ada/source/import.h
      

      However, it may not work well in your environment. The plan B is recommended.

    2. Download them from pre-translated headers page.

  2. Add the source directories of xml-ada and the translated headers to search path for gnatmake.

    $ gnatmake -Ixml-ada/source -Iimport-dir your_main.adb
    

    Or please write .gpr file for your environment.

Build examples

  1. Link the translated headers to examples/import.

    $ mkdir xml-ada/examples/import
    $ ln -s $PWD/import-dir xml-ada/examples/import/$(gcc -dumpmachine)
    

    If this step is omitted, headmaster will be used.

  2. Build them.

    $ make -C xml-ada/examples
    

License

It is dual-licensed under the New BSD License and the MIT License, see below. I recommend the MIT License that is same as libxml2.

license of xml-ada (1)

Copyright 2011-2021 YT. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

license of xml-ada (2)

Copyright (c) 2011-2021 YT

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

license of libxml2

Except where otherwise noted in the source code (e.g. the files hash.c,
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:

 Copyright (C) 1998-2003 Daniel Veillard.  All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Daniel Veillard shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from him.

xml-ada's People

Contributors

ytomino avatar

Watchers

 avatar

xml-ada's Issues

Numerous errors converting C header files.

Under Ubuntu 11.10 Linux I invoked headmaster as directed:

headmaster --to ada -p -D import-dir source/import.h

and it reported numerous errors. This is the start of the list:

/usr/include/x86_64-linux-gnu/bits/predefs.h:27:9: compiler macro be re-defined.
/usr/include/x86_64-linux-gnu/bits/predefs.h:28:9: compiler macro be re-defined.
/usr/include/features.h:326:9: compiler macro be re-defined.
/usr/include/string.h:44:39: ")" was expected.
/usr/include/string.h:44:39: declaration-specifiers was expected.
/usr/include/string.h:45:16: ";" was expected.
/usr/include/string.h:45:33: ";" was expected.
/usr/include/string.h:45:33: declaration-specifiers was expected.
/usr/include/string.h:45:47: ";" was expected.
/usr/include/string.h:45:47: declaration-specifiers was expected.
/usr/include/string.h:45:50: ";" was expected.
/usr/include/string.h:45:50: compound-statement was expected.
/usr/include/string.h:45:50: syntax error.
/usr/include/string.h:49:37: parameter-declaration was expected.
/usr/include/string.h:49:37: ")" was expected.
...

An excerpt from the start of /usr/include/string.h looks like this (line numbers added):

 1  /* Copyright (C) 1991-1993,1995-2004,2007,2009,2010
 2     Free Software Foundation, Inc.
 3     This file is part of the GNU C Library.
 4
 5     The GNU C Library is free software; you can redistribute it and/or
 6     modify it under the terms of the GNU Lesser General Public
 7     License as published by the Free Software Foundation; either
 8     version 2.1 of the License, or (at your option) any later version.
 9
10     The GNU C Library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13     Lesser General Public License for more details.
14
15     You should have received a copy of the GNU Lesser General Public
16     License along with the GNU C Library; if not, write to the Free
17     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18     02111-1307 USA.  */
19
20  /*
21   *      ISO C99 Standard: 7.21 String handling  <string.h>
22   */
23
24  #ifndef _STRING_H
25  #define _STRING_H       1
26
27  #include <features.h>
28
29  __BEGIN_DECLS
30
31  /* Get size_t and NULL from <stddef.h>.  */
32  #define __need_size_t
33  #define __need_NULL
34  #include <stddef.h>
35
36  /* Tell the caller that we provide correct C++ prototypes.  */
37  #if defined __cplusplus && __GNUC_PREREQ (4, 4)
38  # define __CORRECT_ISO_CPP_STRING_H_PROTO
39  #endif
40
41
42  __BEGIN_NAMESPACE_STD
43  /* Copy N bytes of SRC to DEST.  */
44  extern void *memcpy (void *__restrict __dest,
45                       __const void *__restrict __src, size_t __n)
46       __THROW __nonnull ((1, 2));
47  /* Copy N bytes of SRC to DEST, guaranteeing
48     correct behavior for overlapping strings.  */
49  extern void *memmove (void *__dest, __const void *__src, size_t __n)
50       __THROW __nonnull ((1, 2));
51  __END_NAMESPACE_STD
52
53  /* Copy no more than N bytes of SRC to DEST, stopping when C is found.
54     Return the position in DEST one byte past where C was copied,
55     or NULL if C was not found in the first N bytes of SRC.  */
56  #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
57  extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
58                        int __c, size_t __n)
59       __THROW __nonnull ((1, 2));
60  #endif /* SVID.  */

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.