Commit 03670104 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Purge the XML code

parent c509fa11
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2017, 2018, 2019 Vivien Kraus # Copyright (C) 2017, 2018, 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -49,10 +49,6 @@ deb: ...@@ -49,10 +49,6 @@ deb:
- public - public
expire_in: 1 week expire_in: 1 week
generate:
stage: check
script: "./ci/generate.sh"
pages: pages:
stage: manual stage: manual
script: "./ci/pages.sh" script: "./ci/pages.sh"
......
...@@ -57,9 +57,9 @@ AM_CPPFLAGS += \ ...@@ -57,9 +57,9 @@ AM_CPPFLAGS += \
-DLIBTAROT_VERSION_INFO="\"$(LIBTOOL_CURRENT):$(LIBTOOL_REVISION):$(LIBTOOL_AGE)\"" -DLIBTAROT_VERSION_INFO="\"$(LIBTOOL_CURRENT):$(LIBTOOL_REVISION):$(LIBTOOL_AGE)\""
AM_YFLAGS = -d AM_YFLAGS = -d
AM_CFLAGS += \ AM_CFLAGS += \
$(NETTLE_CFLAGS) $(XML_CFLAGS) $(OPENMP_CFLAGS) $(NETTLE_CFLAGS) $(OPENMP_CFLAGS)
AM_LDADD += \ AM_LDADD += \
$(NETTLE_LIBS) $(XML_LIBS) $(GUILE_LIBS) $(OPENMP_LIBS) \ $(NETTLE_LIBS) $(GUILE_LIBS) $(OPENMP_LIBS) \
$(LIBTHREAD) \ $(LIBTHREAD) \
$(LIB_SETLOCALE) \ $(LIB_SETLOCALE) \
$(LIB_SETLOCALE_NULL) \ $(LIB_SETLOCALE_NULL) \
......
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2018, 2019 Vivien Kraus # Copyright (C) 2018, 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -18,6 +18,4 @@ EXTRA_DIST += \ ...@@ -18,6 +18,4 @@ EXTRA_DIST += \
%reldir%/pages.sh \ %reldir%/pages.sh \
%reldir%/check.sh \ %reldir%/check.sh \
%reldir%/mingw.sh \ %reldir%/mingw.sh \
%reldir%/generate.sh \
%reldir%/generate-seed.sh \
%reldir%/deb.sh %reldir%/deb.sh
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -20,8 +20,6 @@ apt-get install -y \ ...@@ -20,8 +20,6 @@ apt-get install -y \
build-essential \ build-essential \
guile-2.2-dev \ guile-2.2-dev \
libglib2.0-dev \ libglib2.0-dev \
libxml2 \
libxml2-dev \
nettle-dev \ nettle-dev \
pkg-config \ pkg-config \
valgrind valgrind
......
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -22,8 +22,6 @@ apt-get install -y \ ...@@ -22,8 +22,6 @@ apt-get install -y \
libglib2.0-dev \ libglib2.0-dev \
libgtk-3-0 \ libgtk-3-0 \
libgtk-3-dev \ libgtk-3-dev \
libxml2 \
libxml2-dev \
nettle-dev \ nettle-dev \
pkg-config \ pkg-config \
valgrind \ valgrind \
......
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -47,8 +47,6 @@ apt-get install -y \ ...@@ -47,8 +47,6 @@ apt-get install -y \
libglib2.0-dev \ libglib2.0-dev \
libgtk-3-dev \ libgtk-3-dev \
libtool \ libtool \
libxml2 \
libxml2-dev \
libxml2-utils \ libxml2-utils \
make \ make \
nettle-dev \ nettle-dev \
......
#!/bin/sh
# tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus
# 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 3 of the License.
#
# 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
seed="$1"
version=$(cat ../dist/version)
for n_players in 3 4 5
do
>&2 echo "Generating $seed for version $version, $n_players players"
(tarot-deal -n $n_players -s $seed | tarot-mcts --generate -s $seed > $seed-${n_players}p.tarot-t \
&& mv $seed-${n_players}p.tarot-t dataset/generated/mcts/$seed-${n_players}p.tarot \
&& echo "no" > /tmp/all-mcts-${n_players}p-failed) \
|| >&2 echo "It failed."
(tarot-deal -n $n_players -s $seed | tarot-stacking --generate > $seed-${n_players}p.tarot-t \
&& mv $seed-${n_players}p.tarot-t dataset/generated/stacking/$version-$seed-${n_players}p.tarot \
&& echo "no" > /tmp/all-stacking-${n_players}p-failed) \
|| >&2 echo "It failed."
if [ "x$n_players" = "x5" ]
then
>&2 echo "Generating $seed for verision $version, 5 players with call"
(tarot-deal -n 5 -c -s $seed | tarot-mcts --generate -s $seed > $seed-5pc.tarot-t \
&& mv $seed-5pc.tarot-t dataset/generated/mcts/$seed-5pc.tarot \
&& echo "no" > /tmp/all-mcts-5pc-failed) \
|| >&2 echo "It failed."
(tarot-deal -n 5 -c -s $seed | tarot-stacking --generate > $seed-5pc.tarot-t \
&& mv $seed-5pc.tarot-t dataset/generated/stacking/$version-$seed-5pc.tarot \
&& echo "no" > /tmp/all-stacking-5pc-failed) \
|| >&2 echo "It failed."
fi
done
#!/bin/sh
# tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus
# 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 3 of the License.
#
# 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
apt-get update
apt-get upgrade -y
apt-get install -y \
build-essential \
curl \
git \
guile-2.2-dev \
libcairo2-dev \
libgirepository1.0-dev \
libglib2.0-dev \
libgtk-3-dev \
libxml2 \
libxml2-dev \
nettle-dev \
parallel \
pkg-config \
valgrind
VERSION=$(cat dist/version)
cp dist/tarot-$VERSION.tar.gz . || exit 1
tar xf tarot-$VERSION.tar.gz || exit 1
mkdir build || exit 1
cd build/
../tarot-$VERSION/configure \
--enable-silent-rules=yes \
--enable-valgrind=yes \
|| (cat config.log; exit 1)
make -j 16 || exit 1
make install || exit 1
export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
mkdir /root/.ssh || exit 1
echo "$SSH_KEY" > /root/.ssh/id_rsa || exit 1
echo "$SSH_KEY_PUB" > /root/.ssh/id_rsa.pub || exit 1
echo "$SSH_KNOWN_HOSTS" > /root/.ssh/known_hosts || exit 1
chmod go-rwx /root/.ssh/id_rsa || exit 1
git config --global user.email "vivien@planete-kraus.eu" || exit 1
git config --global user.name "Gitlab CI for the tarot package" || exit 1
git clone git@framagit.org:play-tarot/datasets.git dataset/ || exit 1
rm -rf dataset/generated/mcts
mkdir -p dataset/generated/mcts || exit 1
mkdir -p dataset/generated/stacking || exit 1
seq 1 10 | parallel ../tarot-$VERSION/ci/generate-seed.sh {}
for check in /tmp/all-*-*-failed
do
if test "x$(cat $check)" != "xno"
then
echo "Could not generate anything for test '$check'."
exit 1
fi
done
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -26,7 +26,6 @@ dnf install -y \ ...@@ -26,7 +26,6 @@ dnf install -y \
\ \
mingw64-gcc \ mingw64-gcc \
mingw64-nettle \ mingw64-nettle \
mingw64-libxml2 \
mingw64-glib2 \ mingw64-glib2 \
mingw64-cairo \ mingw64-cairo \
mingw64-gtk3 \ mingw64-gtk3 \
......
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -20,8 +20,6 @@ apt-get install -y \ ...@@ -20,8 +20,6 @@ apt-get install -y \
build-essential \ build-essential \
jq \ jq \
libglib2.0-dev \ libglib2.0-dev \
libxml2 \
libxml2-dev \
nettle-dev \ nettle-dev \
pkg-config \ pkg-config \
texinfo \ texinfo \
......
...@@ -124,7 +124,6 @@ AS_IF([test "x$enable_program" != "xno"], [ ...@@ -124,7 +124,6 @@ AS_IF([test "x$enable_program" != "xno"], [
]) ])
]) ])
AX_LIB_NETTLE([yes]) AX_LIB_NETTLE([yes])
PKG_CHECK_MODULES([XML], [libxml-2.0])
AC_ARG_WITH([gobject], AS_HELP_STRING([--without-gobject], [Do not build the GObject bindings])) AC_ARG_WITH([gobject], AS_HELP_STRING([--without-gobject], [Do not build the GObject bindings]))
WITH_GOBJECT="no" WITH_GOBJECT="no"
AS_IF([test "x$with_gobject" != "xno"], [ AS_IF([test "x$with_gobject" != "xno"], [
......
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -17,7 +17,6 @@ check_PROGRAMS += \ ...@@ -17,7 +17,6 @@ check_PROGRAMS += \
%reldir%/basic-initialization \ %reldir%/basic-initialization \
%reldir%/players-and-cards \ %reldir%/players-and-cards \
%reldir%/events \ %reldir%/events \
%reldir%/xml \
%reldir%/petit-sec \ %reldir%/petit-sec \
%reldir%/duplicate-a-posteriori \ %reldir%/duplicate-a-posteriori \
%reldir%/dumb-ai %reldir%/dumb-ai
...@@ -25,7 +24,6 @@ check_PROGRAMS += \ ...@@ -25,7 +24,6 @@ check_PROGRAMS += \
%canon_reldir%_basic_initialization_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_basic_initialization_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_players_and_cards_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_players_and_cards_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_events_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_events_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_xml_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_petit_sec_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_petit_sec_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_duplicate_a_posteriori_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_duplicate_a_posteriori_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_dumb_ai_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_dumb_ai_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
...@@ -15,15 +15,9 @@ ...@@ -15,15 +15,9 @@
dist_man6_MANS += \ dist_man6_MANS += \
%reldir%/tarot.man \ %reldir%/tarot.man \
%reldir%/tarot-status.man \
%reldir%/tarot-deal.man \
%reldir%/tarot-mcts.man \
%reldir%/tarot-perceptron-bootstrap.man %reldir%/tarot-perceptron-bootstrap.man
MAINTAINERCLEANFILES += \ MAINTAINERCLEANFILES += \
$(srcdir)/%reldir%/tarot.man \ $(srcdir)/%reldir%/tarot.man \
$(srcdir)/%reldir%/tarot-status.man \
$(srcdir)/%reldir%/tarot-deal.man \
$(srcdir)/%reldir%/tarot-mcts.man \
$(srcdir)/%reldir%/tarot-perceptron-bootstrap.man $(srcdir)/%reldir%/tarot-perceptron-bootstrap.man
help2man_verbose = $(help2man_verbose_@AM_V@) help2man_verbose = $(help2man_verbose_@AM_V@)
...@@ -34,18 +28,6 @@ $(srcdir)/%reldir%/tarot.man: src/tarot-app/main.vala ...@@ -34,18 +28,6 @@ $(srcdir)/%reldir%/tarot.man: src/tarot-app/main.vala
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot $(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot
$(help2man_verbose) ./pre-inst-env help2man tarot > $(srcdir)/%reldir%/tarot.man $(help2man_verbose) ./pre-inst-env help2man tarot > $(srcdir)/%reldir%/tarot.man
$(srcdir)/%reldir%/tarot-status.man: src/tarot-app/tarot_status.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-status
$(help2man_verbose) ./pre-inst-env help2man tarot-status > $@
$(srcdir)/%reldir%/tarot-deal.man: src/tarot-app/tarot_deal.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-deal
$(help2man_verbose) ./pre-inst-env help2man tarot-deal > $@
$(srcdir)/%reldir%/tarot-mcts.man: src/tarot-app/tarot_mcts.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-mcts
$(help2man_verbose) ./pre-inst-env help2man tarot-mcts > $@
$(srcdir)/%reldir%/tarot-perceptron-bootstrap.man: src/tarot-app/tarot_perceptron_bootstrap.c $(srcdir)/%reldir%/tarot-perceptron-bootstrap.man: src/tarot-app/tarot_perceptron_bootstrap.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-perceptron-bootstrap $(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-perceptron-bootstrap
$(help2man_verbose) ./pre-inst-env help2man tarot-perceptron-bootstrap > $@ $(help2man_verbose) ./pre-inst-env help2man tarot-perceptron-bootstrap > $@
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2017, 2018, 2019 Vivien Kraus # Copyright (C) 2017, 2018, 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -18,7 +18,6 @@ TANGLED = \ ...@@ -18,7 +18,6 @@ TANGLED = \
$(srcdir)/%reldir%/players-and-cards.c \ $(srcdir)/%reldir%/players-and-cards.c \
$(srcdir)/%reldir%/events.c \ $(srcdir)/%reldir%/events.c \
$(srcdir)/%reldir%/petit-sec.c \ $(srcdir)/%reldir%/petit-sec.c \
$(srcdir)/%reldir%/xml.c \
$(srcdir)/%reldir%/duplicate-a-posteriori.c \ $(srcdir)/%reldir%/duplicate-a-posteriori.c \
$(srcdir)/%reldir%/dumb-ai.c \ $(srcdir)/%reldir%/dumb-ai.c \
$(srcdir)/%reldir%/tarot.rng $(srcdir)/%reldir%/tarot.rng
......
...@@ -694,28 +694,6 @@ option. ...@@ -694,28 +694,6 @@ option.
LANG=C tarot --help LANG=C tarot --help
#+END_SRC #+END_SRC
** Additional command-line programs
The tarot distribution provides a few other command-line programs:
- =tarot-status= reads a game from the standard input and prints some
informations about the game. There are three kinds of information,
based on the command-line argument:
- if it is =next=, then print the player ID of the next player, or
fails if the game does not have a player to play,
- if it is =at-end=, then it does not print anything but succeeds if
the game is finished, and fails otherwise,
- if it is =score=, then it prints the score for each player, one
row for each player. It fails if the game is not finished,
- if it is =errors=, then it prints the amount of errors that the
players made;
- =tarot-deal= prints a game which has been dealt for all players,
based on the following options:
- =--n-players=: set the number of players,
- =--call-allowed= / =--no-call-allowed=: the game allows a call or
not,
- =--seed=STRING=: set the random seed for the pseudo-random number
generator;
- =tarot-mcts=: reads a game from the standard input, play the next
move as the MCTS, and print the modified game.
* Programming with libtarot * Programming with libtarot
Libtarot is the library that you can use in your own program. In Libtarot is the library that you can use in your own program. In
order to use it, you may use the =pkg-config= configuration file that order to use it, you may use the =pkg-config= configuration file that
...@@ -1229,7 +1207,6 @@ Release /object/ that has been allocated with the corresponding ...@@ -1229,7 +1207,6 @@ Release /object/ that has been allocated with the corresponding
#+begin_deftypefun #+begin_deftypefun
An enumeration of errror codes for the game API. It has: An enumeration of errror codes for the game API. It has:
- =TAROT_GAME_OK= = 0, if the operation succeeded; - =TAROT_GAME_OK= = 0, if the operation succeeded;
- =TAROT_GAME_INVXML=, when loading from a document that is not an XML document;
- =TAROT_GAME_INVEV=, when adding an invalid or unexpected event; - =TAROT_GAME_INVEV=, when adding an invalid or unexpected event;
- =TAROT_GAME_NA=, when querying game properties that are not set; - =TAROT_GAME_NA=, when querying game properties that are not set;
- =TAROT_GAME_TOOLATE=, when we set a duplicaté option after it would - =TAROT_GAME_TOOLATE=, when we set a duplicaté option after it would
...@@ -1442,7 +1419,7 @@ value set in /alignment/ from the previous call. In most cases you ...@@ -1442,7 +1419,7 @@ value set in /alignment/ from the previous call. In most cases you
should not worry, since the alignment is never stricter than the should not worry, since the alignment is never stricter than the
maximum alignment of =max_align_t=. maximum alignment of =max_align_t=.
#+end_deftypefun #+end_deftypefun
** Loading and saving a game with XML ** XML representation of games
#+index: relax-ng #+index: relax-ng
The XML representation of a game is simply the collection of events The XML representation of a game is simply the collection of events
that constitue it. Here is the Relax-NG schema for the games: that constitue it. Here is the Relax-NG schema for the games:
...@@ -1556,103 +1533,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -1556,103 +1533,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
The validation for game events is volutarily under-specified, because The validation for game events is volutarily under-specified, because
it ultimately needs to understand the game rules. it ultimately needs to understand the game rules.
For instance, the package comes with a sample There are no code to export to xml or import from xml as of yet.
game:
#+include: ../games/example.xml src xml
So if we encode it as a C string, we can parse it and re-print it.
There can be a couple of differences, like how the namespace is
defined, or the indentation, or the handfuls (empty handfuls are added
in the xml output).
#+name: encode-example-game
#+BEGIN_SRC shell :exports none :results output
sed 's/\\/\\\\/g ; s/"/\\"/g ; s/^/"/g ; s/$/"/g' < ../games/example.xml
#+END_SRC
#+BEGIN_SRC C -i :noweb yes :tangle xml.c
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */
#include <tarot.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#ifndef LOCALEDIR
#define LOCALEDIR "/usr/share/locale"
#endif /* NOT LOCALEDIR */
int
main ()
{
static const char *example =
<<encode-example-game()>>;
TarotGame *game;
char *output;
size_t i, len;
size_t n_open_tags = 0;
if (tarot_init (LOCALEDIR) != 0)
{
fprintf (stderr, "Error: could not initialize libtarot.\n");
return EXIT_FAILURE;
}
game = tarot_game_alloc ();
switch (tarot_game_load_from_xml (game, example))
{
case TAROT_GAME_OK:
output = tarot_game_save_to_xml_alloc (game);
printf ("%s\n", output);
len = strlen (output);
for (i = 0; i < len; i++)
{
if (strncmp (output + i, "<", strlen ("<")) == 0)
{
n_open_tags++;
}
}
assert (n_open_tags == 52);
free (output);
break;
case TAROT_GAME_INVXML:
fprintf (stderr, "Error: this is not an XML document.\n");
return EXIT_FAILURE;
break;
case TAROT_GAME_INVEV:
fprintf (stderr, "Error: this is not a valid game.\n");
return EXIT_FAILURE;
break;
case TAROT_GAME_NA:
case TAROT_GAME_TOOLATE:
fprintf (stderr, "Impossible.");
return EXIT_FAILURE;
}
tarot_game_free (game);
tarot_quit ();
return EXIT_SUCCESS;
}
#+END_SRC
#+attr_texinfo: :options {TarotGameError} tarot_game_load_from_xml (TarotGame *@var{game}, const char *@var{input})
#+begin_deftypefun
Erase /game/, and load it from the XML data in utf8-encoded /input/.
#+end_deftypefun
#+attr_texinfo: :options {size_t} tarot_game_save_to_xml (const TarotGame *@var{game}, size_t @var{start}, size_t @var{max}, char *@var{dest})
#+begin_deftypefun
#+texinfo: @deftypefunx {char *} tarot_game_save_to_xml_alloc (const TarotGame *@var{game})
Get the XML document representing /game/ as a string. The =_alloc=
function allocates it with =malloc= (don't forget to call =free=).
The =tarot_game_save_to_xml= function writes it to =dest= (use up to
=max= bytes), trying to put the final NUL character (this is not
possible only if /max/ is 0), and return the number of bytes required
(so you need that value plus one). If /start/ is not 0, then the
representation discards the first /start/ bytes.
#+end_deftypefun
** Describing a game ** Describing a game
#+attr_texinfo: :options {enum} TarotStep #+attr_texinfo: :options {enum} TarotStep
#+begin_deftp #+begin_deftp
......
...@@ -25,10 +25,7 @@ src/tarot-app/gui/widget.vala ...@@ -25,10 +25,7 @@ src/tarot-app/gui/widget.vala
src/tarot-app/gui/card_view.vala src/tarot-app/gui/card_view.vala
src/tarot-app/card_painter.vala src/tarot-app/card_painter.vala
src/tarot-app/card_painter_default.vala src/tarot-app/card_painter_default.vala
src/tarot-app/tarot_status.c
src/tarot-app/tarot_deal.c
src/tarot-app/program_commons.c src/tarot-app/program_commons.c
src/tarot-app/tarot_mcts.c
src/tarot-app/gui/window.ui src/tarot-app/gui/window.ui
src/tarot-app/gui/widget.ui src/tarot-app/gui/widget.ui
src/tarot-app/tarot_perceptron_bootstrap.c src/tarot-app/tarot_perceptron_bootstrap.c
\ No newline at end of file
This diff is collapsed.
...@@ -42,7 +42,6 @@ include %reldir%/counter/Makefile.am ...@@ -42,7 +42,6 @@ include %reldir%/counter/Makefile.am
include %reldir%/layout/Makefile.am include %reldir%/layout/Makefile.am
include %reldir%/mcts/Makefile.am include %reldir%/mcts/Makefile.am
include %reldir%/simulation/Makefile.am include %reldir%/simulation/Makefile.am
include %reldir%/xml/Makefile.am
include %reldir%/features/Makefile.am include %reldir%/features/Makefile.am
include %reldir%/solo/Makefile.am include %reldir%/solo/Makefile.am
include %reldir%/guile/Makefile.am include %reldir%/guile/Makefile.am
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <tarot/game_event.h> #include <tarot/game_event.h>
#include <tarot/game.h> #include <tarot/game.h>
#include <tarot/counter.h> #include <tarot/counter.h>
#include <tarot/xml.h>
#include <tarot/layout.h> #include <tarot/layout.h>
#include <tarot/simulation.h> #include <tarot/simulation.h>
#include <tarot/mcts.h> #include <tarot/mcts.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#define H_TAROT_PRIVATE_INCLUDED #define H_TAROT_PRIVATE_INCLUDED