(Temporarily) set "animate" to "none" by default (broken feature).
[gf1.git] / gamelog.h
blob0a3a4cf22a6ef93222ef203b6c4b5aa9b7d694dd
1 /*
2 ** $Id$
3 */
4 /*
5 ** Copyright (C) 1998 Kurt Van den Branden
6 **
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.
11 **
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.
16 **
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., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef _GAMELOG_H_
23 #define _GAMELOG_H_ 1
25 #include "linklist.h"
26 #include "xmlite.h"
28 typedef struct {
29 char * gametype;
30 char * whitename;
31 char * blackname;
32 listheader * moves;
33 } gamelog;
35 typedef struct {
36 int type; /* LOGMOVE, LOGREMGIPF, LOGREMROW */
37 char start[3]; /* from , , startpos */
38 char end[3]; /* endmove, , endpos */
39 char player; /* piece , owner , owner */
40 listheader * plist; /* , pos , pieces */
41 } logitem;
43 #define LOGMOVE 1
44 #define LOGREMGIPF 2
45 #define LOGREMROW 3
47 #define loglength(log) lllength (log->moves)
48 #define logitemnr(log,nr) (logitem *) llitembynr (log->moves, nr)
49 #define logitem_type(logitem) logitem->type
50 #define logitem_start(logitem) logitem->start
51 #define logitem_end(logitem) logitem->end
52 #define logitem_player(logitem) logitem->player
53 #define logitem_plist(logitem) logitem->plist
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
59 gamelog * newlog (const char * type, const char * wname, const char * bname);
60 void deletelog (gamelog * log);
61 int addtolog (gamelog * log, int type, char * data);
62 int logtofile (gamelog * log, FILE * fp);
63 xmlite_entity * logtoxml (gamelog * log);
64 gamelog * logfromxml (xmlite_entity * root);
65 gamelog * logfromfile (FILE * fp);
66 listheader * logtobrowser (gamelog * log);
67 int remlastmove (gamelog * log);
69 #ifdef __cplusplus
71 #endif
73 #endif