diff options
author | Jordi Vilalta Prat | 2009-02-15 08:34:13 +0000 |
---|---|---|
committer | Jordi Vilalta Prat | 2009-02-15 08:34:13 +0000 |
commit | 003317e89d890944fc12e622190aa916aad6418c (patch) | |
tree | 321c42b2dd44c66cf1eaf7f71b19e3fc57944931 /engines/sci/engine | |
parent | 1ef23afe6b0441393b6b43ee136552e887c80707 (diff) | |
download | scummvm-rg350-003317e89d890944fc12e622190aa916aad6418c.tar.gz scummvm-rg350-003317e89d890944fc12e622190aa916aad6418c.tar.bz2 scummvm-rg350-003317e89d890944fc12e622190aa916aad6418c.zip |
SCI: Get rid of the include directory hack (it compiles but it doesn't link yet)
svn-id: r38201
Diffstat (limited to 'engines/sci/engine')
29 files changed, 623 insertions, 122 deletions
diff --git a/engines/sci/engine/game.c b/engines/sci/engine/game.c index a6672326ef..d630b3c963 100644 --- a/engines/sci/engine/game.c +++ b/engines/sci/engine/game.c @@ -39,11 +39,11 @@ # endif #endif -#include <sciresource.h> -#include <engine.h> -#include <versions.h> -#include <kernel.h> -#include "kernel_types.h" +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" +#include "sci/include/versions.h" +#include "sci/include/kernel.h" +#include "sci/engine/kernel_types.h" /* Structures and data from vm.c: */ extern calls_struct_t *send_calls; diff --git a/engines/sci/engine/gc.c b/engines/sci/engine/gc.c index 063c58a076..bdad84d7d4 100644 --- a/engines/sci/engine/gc.c +++ b/engines/sci/engine/gc.c @@ -18,7 +18,7 @@ ***************************************************************************/ -#include "gc.h" +#include "sci/engine/gc.h" #define WORKLIST_CHUNK_SIZE 32 diff --git a/engines/sci/engine/gc.h b/engines/sci/engine/gc.h index b0368ee8c2..4e64c0b424 100644 --- a/engines/sci/engine/gc.h +++ b/engines/sci/engine/gc.h @@ -22,8 +22,8 @@ #ifndef GC_H_ #define GC_H_ -#include <reg_t_hashmap.h> -#include <engine.h> +#include "sci/include/reg_t_hashmap.h" +#include "sci/include/engine.h" reg_t_hash_map_ptr find_all_used_references(state_t *s); diff --git a/engines/sci/engine/grammar.c b/engines/sci/engine/grammar.c index 557c535b77..7daf735b6d 100644 --- a/engines/sci/engine/grammar.c +++ b/engines/sci/engine/grammar.c @@ -23,9 +23,9 @@ ** that grammar, writing an appropriate node tree if successful. */ -#include <resource.h> -#include <vocabulary.h> -#include <console.h> +#include "sci/include/resource.h" +#include "sci/include/vocabulary.h" +#include "sci/include/console.h" #include <stdarg.h> #include <string.h> diff --git a/engines/sci/engine/heap.c b/engines/sci/engine/heap.c index cb5cacaffd..4b2314ace7 100644 --- a/engines/sci/engine/heap.c +++ b/engines/sci/engine/heap.c @@ -2,9 +2,9 @@ #include <stdlib.h> #include <stdio.h> -#include <engine.h> -#include <console.h> -#include "heap.h" +#include "sci/include/engine.h" +#include "sci/include/console.h" +#include "sci/engine/heap.h" #define assert_in_range(pos) assert(pos>=1000 && pos<=0xffff) diff --git a/engines/sci/engine/heap.h b/engines/sci/engine/heap.h index afd2db5c58..8c1f0dd3f4 100644 --- a/engines/sci/engine/heap.h +++ b/engines/sci/engine/heap.h @@ -28,7 +28,7 @@ #ifndef _SCI_HEAP_H #define _SCI_HEAP_H -#include <resource.h> +#include "sci/include/resource.h" #define SCI_HEAP_SIZE 0x10000 diff --git a/engines/sci/engine/kernel.c b/engines/sci/engine/kernel.c index df3690f467..e0092bfb69 100644 --- a/engines/sci/engine/kernel.c +++ b/engines/sci/engine/kernel.c @@ -25,15 +25,15 @@ ***************************************************************************/ -#include "gc.h" -#include <sciresource.h> -#include <engine.h> +#include "sci/engine/gc.h" +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" #ifdef _WIN32 # include <windows.h> #endif /* _WIN32 */ -#include <gfx_operations.h> -#include "kernel_types.h" +#include "sci/include/gfx_operations.h" +#include "sci/engine/kernel_types.h" /* New kernel functions */ diff --git a/engines/sci/engine/kernel_types.h b/engines/sci/engine/kernel_types.h index 0ac56bcf6a..f13e793457 100644 --- a/engines/sci/engine/kernel_types.h +++ b/engines/sci/engine/kernel_types.h @@ -28,7 +28,7 @@ #ifndef _FREESCI_KERNEL_TYPES_H_ #define _FREESCI_KERNEL_TYPES_H_ -#include "vm_types.h" +#include "sci/include/vm_types.h" #define KSIG_TERMINATOR 0 diff --git a/engines/sci/engine/kevent.c b/engines/sci/engine/kevent.c index 9054aded41..3b6df771e7 100644 --- a/engines/sci/engine/kevent.c +++ b/engines/sci/engine/kevent.c @@ -25,7 +25,7 @@ ***************************************************************************/ -#include <engine.h> +#include "sci/include/engine.h" int stop_on_event; diff --git a/engines/sci/engine/kfile.c b/engines/sci/engine/kfile.c index c4f6c63ac2..90d0b86ed9 100644 --- a/engines/sci/engine/kfile.c +++ b/engines/sci/engine/kfile.c @@ -25,7 +25,7 @@ ***************************************************************************/ -#include <engine.h> +#include "sci/include/engine.h" #ifdef _WIN32 # ifndef PATH_MAX diff --git a/engines/sci/engine/kgraphics.c b/engines/sci/engine/kgraphics.c index 2f15877ac8..963d2362b5 100644 --- a/engines/sci/engine/kgraphics.c +++ b/engines/sci/engine/kgraphics.c @@ -25,11 +25,11 @@ ***************************************************************************/ -#include <sciresource.h> -#include <engine.h> -#include <gfx_widgets.h> -#include "sci_graphics.h" -#include <sci_widgets.h> +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" +#include "sci/include/gfx_widgets.h" +#include "sci/engine/sci_graphics.h" +#include "sci/include/sci_widgets.h" #undef DEBUG_LSRECT diff --git a/engines/sci/engine/klists.c b/engines/sci/engine/klists.c index 7637ddd403..96b527d812 100644 --- a/engines/sci/engine/klists.c +++ b/engines/sci/engine/klists.c @@ -25,7 +25,7 @@ ***************************************************************************/ -#include <engine.h> +#include "sci/include/engine.h" #ifdef LOOKUP_NODE # undef LOOKUP_NODE diff --git a/engines/sci/engine/kmath.c b/engines/sci/engine/kmath.c index 94480ab3bd..4c8ebb8ec5 100644 --- a/engines/sci/engine/kmath.c +++ b/engines/sci/engine/kmath.c @@ -25,7 +25,7 @@ ***************************************************************************/ -#include <engine.h> +#include "sci/include/engine.h" reg_t diff --git a/engines/sci/engine/kmenu.c b/engines/sci/engine/kmenu.c index 4530d5c34f..bd676213f4 100644 --- a/engines/sci/engine/kmenu.c +++ b/engines/sci/engine/kmenu.c @@ -25,9 +25,9 @@ ***************************************************************************/ -#include <sciresource.h> -#include <engine.h> -#include <sci_widgets.h> +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" +#include "sci/include/sci_widgets.h" reg_t diff --git a/engines/sci/engine/kmovement.c b/engines/sci/engine/kmovement.c index 5f7d1a7281..1234a9028a 100644 --- a/engines/sci/engine/kmovement.c +++ b/engines/sci/engine/kmovement.c @@ -25,8 +25,8 @@ ***************************************************************************/ -#include <sciresource.h> -#include <engine.h> +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" /* Compute "velocity" vector (xStep,yStep)=(vx,vy) for a jump from (0,0) to (dx,dy), with gravity gy. diff --git a/engines/sci/engine/kpathing.c b/engines/sci/engine/kpathing.c index aab4986462..8560ea29b3 100644 --- a/engines/sci/engine/kpathing.c +++ b/engines/sci/engine/kpathing.c @@ -31,9 +31,9 @@ #include <math.h> -#include <engine.h> -#include <aatree.h> -#include <list.h> +#include "sci/include/engine.h" +#include "sci/include/aatree.h" +#include "sci/include/list.h" #define POLY_LAST_POINT 0x7777 #define POLY_POINT_SIZE 4 diff --git a/engines/sci/engine/kscripts.c b/engines/sci/engine/kscripts.c index 1fd7fd9a85..02517365c8 100644 --- a/engines/sci/engine/kscripts.c +++ b/engines/sci/engine/kscripts.c @@ -25,9 +25,9 @@ ***************************************************************************/ -#include <sciresource.h> -#include <engine.h> -#include "kernel_types.h" +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" +#include "sci/engine/kernel_types.h" reg_t read_selector(state_t *s, reg_t object, selector_t selector_id, const char *file, int line) diff --git a/engines/sci/engine/ksound.c b/engines/sci/engine/ksound.c index e95f219e4b..6a2cbeec32 100644 --- a/engines/sci/engine/ksound.c +++ b/engines/sci/engine/ksound.c @@ -25,8 +25,8 @@ ***************************************************************************/ -#include <engine.h> -#include <sfx_player.h> +#include "sci/include/engine.h" +#include "sci/include/sfx_player.h" #define _K_SCI0_SOUND_INIT_HANDLE 0 #define _K_SCI0_SOUND_PLAY_HANDLE 1 diff --git a/engines/sci/engine/kstring.c b/engines/sci/engine/kstring.c index c4b5426329..b8e4ec3b74 100644 --- a/engines/sci/engine/kstring.c +++ b/engines/sci/engine/kstring.c @@ -26,9 +26,9 @@ ***************************************************************************/ /* String and parser handling */ -#include <sciresource.h> -#include <engine.h> -#include "message.h" +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" +#include "sci/engine/message.h" #define CHECK_OVERFLOW1(pt, size, rv) \ if (((pt) - (str_base)) + (size) > maxsize) { \ diff --git a/engines/sci/engine/message.c b/engines/sci/engine/message.c index 97171a9763..bf4657a96e 100644 --- a/engines/sci/engine/message.c +++ b/engines/sci/engine/message.c @@ -25,7 +25,7 @@ ***************************************************************************/ -#include "message.h" +#include "sci/engine/message.h" static int get_talker_trivial(index_record_cursor_t *cursor) diff --git a/engines/sci/engine/message.h b/engines/sci/engine/message.h index 7618e55429..6613ff6d0b 100644 --- a/engines/sci/engine/message.h +++ b/engines/sci/engine/message.h @@ -25,7 +25,7 @@ ***************************************************************************/ -#include <sciresource.h> +#include "sci/include/sciresource.h" typedef struct { diff --git a/engines/sci/engine/said.c b/engines/sci/engine/said.c index 2e90920add..5296fc4b51 100644 --- a/engines/sci/engine/said.c +++ b/engines/sci/engine/said.c @@ -104,10 +104,10 @@ /* Copy the first part of user declarations. */ -#line 28 "said.y" +#line 28 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" -#include <engine.h> +#include "sci/include/engine.h" #define SAID_BRANCH_NULL 0 @@ -228,7 +228,7 @@ typedef int YYSTYPE; /* Line 216 of yacc.c. */ -#line 232 "said.c" +#line 232 "y.tab.c" #ifdef short # undef short @@ -1472,178 +1472,178 @@ yyreduce: switch (yyn) { case 2: -#line 139 "said.y" +#line 139 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_top_branch(said_attach_branch((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]))); } break; case 3: -#line 141 "said.y" +#line 141 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_top_branch(said_attach_branch((yyvsp[(1) - (3)]), said_attach_branch((yyvsp[(2) - (3)]), (yyvsp[(3) - (3)])))); } break; case 4: -#line 143 "said.y" +#line 143 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_top_branch(said_attach_branch((yyvsp[(1) - (4)]), said_attach_branch((yyvsp[(2) - (4)]), said_attach_branch((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]))))); } break; case 5: -#line 148 "said.y" +#line 148 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = SAID_BRANCH_NULL; } break; case 6: -#line 150 "said.y" +#line 150 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_paren(said_value(0x14b, said_value(0xf900, said_terminal(0xf900))), SAID_BRANCH_NULL); } break; case 7: -#line 156 "said.y" +#line 156 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = SAID_BRANCH_NULL; } break; case 8: -#line 158 "said.y" +#line 158 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_paren(said_value(0x141, said_value(0x149, (yyvsp[(1) - (1)]))), SAID_BRANCH_NULL); } break; case 9: -#line 164 "said.y" +#line 164 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x142, 0x14a, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL); } break; case 10: -#line 166 "said.y" +#line 166 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x152, 0x142, said_aug_branch(0x142, 0x14a, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); } break; case 11: -#line 168 "said.y" +#line 168 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = SAID_BRANCH_NULL; } break; case 12: -#line 174 "said.y" +#line 174 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x143, 0x14a, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL); } break; case 13: -#line 176 "said.y" +#line 176 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x152, 0x143, said_aug_branch(0x143, 0x14a, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); } break; case 14: -#line 178 "said.y" +#line 178 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = SAID_BRANCH_NULL; } break; case 15: -#line 184 "said.y" +#line 184 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_paren(said_value(0x141, said_value(0x153, said_terminal((yyvsp[(1) - (1)])))), SAID_BRANCH_NULL); } break; case 16: -#line 189 "said.y" +#line 189 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x141, 0x14f, (yyvsp[(1) - (1)]), SAID_BRANCH_NULL); } break; case 17: -#line 191 "said.y" +#line 191 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x141, 0x14f, said_aug_branch(0x152, 0x14c, said_aug_branch(0x141, 0x14f, (yyvsp[(2) - (3)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL), SAID_BRANCH_NULL); } break; case 18: -#line 196 "said.y" +#line 196 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 19: -#line 198 "said.y" +#line 198 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = (yyvsp[(1) - (3)]); } break; case 20: -#line 200 "said.y" +#line 200 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_attach_branch((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); } break; case 21: -#line 202 "said.y" +#line 202 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_attach_branch((yyvsp[(1) - (4)]), (yyvsp[(3) - (4)])); } break; case 22: -#line 204 "said.y" +#line 204 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_attach_branch((yyvsp[(1) - (5)]), (yyvsp[(3) - (5)])); } break; case 23: -#line 210 "said.y" +#line 210 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_attach_branch((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } break; case 24: -#line 212 "said.y" +#line 212 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 25: -#line 214 "said.y" +#line 214 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 26: -#line 220 "said.y" +#line 220 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 27: -#line 222 "said.y" +#line 222 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x152, 0x144, (yyvsp[(2) - (3)]), SAID_BRANCH_NULL); } break; case 28: -#line 224 "said.y" +#line 224 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_attach_branch((yyvsp[(1) - (4)]), said_aug_branch(0x152, 0x144, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL)); } break; case 29: -#line 230 "said.y" +#line 230 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)])); } break; case 30: -#line 232 "said.y" +#line 232 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x144, 0x14f, said_aug_branch(0x141, 0x144, (yyvsp[(2) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); } break; case 31: -#line 234 "said.y" +#line 234 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL); } break; case 32: -#line 236 "said.y" +#line 236 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x152, 0x144, said_aug_branch(0x144, 0x14f, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); } break; case 33: -#line 242 "said.y" +#line 242 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x141, 0x144, said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (3)]), SAID_BRANCH_NULL), (yyvsp[(3) - (3)])); } break; case 34: -#line 244 "said.y" +#line 244 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x141, 0x144, said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); } break; case 35: -#line 246 "said.y" +#line 246 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" { (yyval) = said_aug_branch(0x141, 0x14c, (yyvsp[(2) - (4)]), SAID_BRANCH_NULL); } break; /* Line 1267 of yacc.c. */ -#line 1647 "said.c" +#line 1647 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1857,7 +1857,7 @@ yyreturn: } -#line 251 "said.y" +#line 251 "../../full-svn/scummvm/trunk/engines/sci/engine/said.y" diff --git a/engines/sci/engine/said.y b/engines/sci/engine/said.y index fdef2360ae..e2a39d6b34 100644 --- a/engines/sci/engine/said.y +++ b/engines/sci/engine/said.y @@ -27,7 +27,7 @@ %{ -#include <engine.h> +#include "sci/include/engine.h" #define SAID_BRANCH_NULL 0 diff --git a/engines/sci/engine/savegame.c b/engines/sci/engine/savegame.c index 0537fcacd5..94011f3277 100644 --- a/engines/sci/engine/savegame.c +++ b/engines/sci/engine/savegame.c @@ -30,12 +30,12 @@ ** savegame.cfsml. If this doesn't solve your problem, contact the maintainer. */ -#include <sci_memory.h> -#include <gfx_operations.h> -#include <sfx_engine.h> -#include <engine.h> +#include "sci/include/sci_memory.h" +#include "sci/include/gfx_operations.h" +#include "sci/include/sfx_engine.h" +#include "sci/include/engine.h" #include <assert.h> -#include "heap.h" +#include "sci/engine/heap.h" #ifdef _MSC_VER #include <direct.h> @@ -183,9 +183,11 @@ typedef mem_obj_t *mem_obj_ptr; /* Auto-generated CFSML declaration and function block */ +#line 796 "savegame.cfsml" #define CFSML_SUCCESS 0 #define CFSML_FAILURE 1 +#line 102 "savegame.cfsml" #include <stdarg.h> /* We need va_lists */ #include <sci_memory.h> @@ -396,6 +398,7 @@ _cfsml_get_identifier(FILE *fd, int *line, int *hiteof, int *assignment) retval = (char *) sci_realloc(retval, mem += 1); retval[pos] = 0; /* Terminate string */ +#line 322 "savegame.cfsml" return _cfsml_last_identifier_retreived = retval; } @@ -443,181 +446,217 @@ _cfsml_get_value(FILE *fd, int *line, int *hiteof) retval = (char *) sci_realloc(retval, mem += 1); retval[pos] = 0; /* Terminate string */ +#line 379 "savegame.cfsml" return (_cfsml_last_value_retreived = (char *) sci_realloc(retval, strlen(retval) + 1)); /* Re-allocate; this value might be used for quite some while (if we are ** restoring a string) */ } +#line 431 "savegame.cfsml" static void _cfsml_write_synonym_t(FILE *fh, synonym_t* save_struc); static int _cfsml_read_synonym_t(FILE *fh, synonym_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_sfx_state_t(FILE *fh, sfx_state_t* save_struc); static int _cfsml_read_sfx_state_t(FILE *fh, sfx_state_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_clone_entry_t(FILE *fh, clone_entry_t* save_struc); static int _cfsml_read_clone_entry_t(FILE *fh, clone_entry_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_object_t(FILE *fh, object_t* save_struc); static int _cfsml_read_object_t(FILE *fh, object_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_string(FILE *fh, char ** save_struc); static int _cfsml_read_string(FILE *fh, char ** save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_menubar_t(FILE *fh, menubar_t* save_struc); static int _cfsml_read_menubar_t(FILE *fh, menubar_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_size_t(FILE *fh, size_t* save_struc); static int _cfsml_read_size_t(FILE *fh, size_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_list_entry_t(FILE *fh, list_entry_t* save_struc); static int _cfsml_read_list_entry_t(FILE *fh, list_entry_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc); static int _cfsml_read_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_gint16(FILE *fh, gint16* save_struc); static int _cfsml_read_gint16(FILE *fh, gint16* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_song_t(FILE *fh, song_t* save_struc); static int _cfsml_read_song_t(FILE *fh, song_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_menu_item_t(FILE *fh, menu_item_t* save_struc); static int _cfsml_read_menu_item_t(FILE *fh, menu_item_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_node_entry_t(FILE *fh, node_entry_t* save_struc); static int _cfsml_read_node_entry_t(FILE *fh, node_entry_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_seg_id_t(FILE *fh, seg_id_t* save_struc); static int _cfsml_read_seg_id_t(FILE *fh, seg_id_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_dynmem_t(FILE *fh, dynmem_t* save_struc); static int _cfsml_read_dynmem_t(FILE *fh, dynmem_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_local_variables_t(FILE *fh, local_variables_t* save_struc); static int _cfsml_read_local_variables_t(FILE *fh, local_variables_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_state_t(FILE *fh, state_t* save_struc); static int _cfsml_read_state_t(FILE *fh, state_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_node_table_t(FILE *fh, node_table_t* save_struc); static int _cfsml_read_node_table_t(FILE *fh, node_table_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_sys_strings_t(FILE *fh, sys_strings_t* save_struc); static int _cfsml_read_sys_strings_t(FILE *fh, sys_strings_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_byte(FILE *fh, byte* save_struc); static int _cfsml_read_byte(FILE *fh, byte* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_node_t(FILE *fh, node_t* save_struc); static int _cfsml_read_node_t(FILE *fh, node_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_list_table_t(FILE *fh, list_table_t* save_struc); static int _cfsml_read_list_table_t(FILE *fh, list_table_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_class_t(FILE *fh, class_t* save_struc); static int _cfsml_read_class_t(FILE *fh, class_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_song_handle_t(FILE *fh, song_handle_t* save_struc); static int _cfsml_read_song_handle_t(FILE *fh, song_handle_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_int(FILE *fh, int* save_struc); static int _cfsml_read_int(FILE *fh, int* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_menu_t(FILE *fh, menu_t* save_struc); static int _cfsml_read_menu_t(FILE *fh, menu_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_long(FILE *fh, long* save_struc); static int _cfsml_read_long(FILE *fh, long* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_clone_table_t(FILE *fh, clone_table_t* save_struc); static int _cfsml_read_clone_table_t(FILE *fh, clone_table_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_clone_t(FILE *fh, clone_t* save_struc); static int _cfsml_read_clone_t(FILE *fh, clone_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_list_t(FILE *fh, list_t* save_struc); static int _cfsml_read_list_t(FILE *fh, list_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_sys_string_t(FILE *fh, sys_string_t* save_struc); static int _cfsml_read_sys_string_t(FILE *fh, sys_string_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_script_t(FILE *fh, script_t* save_struc); static int _cfsml_read_script_t(FILE *fh, script_t* save_struc, char *lastval, int *line, int *hiteof); +#line 431 "savegame.cfsml" static void _cfsml_write_seg_manager_t(FILE *fh, seg_manager_t* save_struc); static int _cfsml_read_seg_manager_t(FILE *fh, seg_manager_t* save_struc, char *lastval, int *line, int *hiteof); +#line 444 "savegame.cfsml" static void _cfsml_write_synonym_t(FILE *fh, synonym_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "replaceant = "); _cfsml_write_int(fh, (int*) &(save_struc->replaceant)); @@ -628,11 +667,13 @@ _cfsml_write_synonym_t(FILE *fh, synonym_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_synonym_t(FILE *fh, synonym_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -664,17 +705,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "replaceant")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->replaceant), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for replaceant at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "replacement")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->replacement), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for replacement at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("synonym_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -684,11 +728,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_sfx_state_t(FILE *fh, sfx_state_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "songlib = "); write_songlib_t(fh, (songlib_t*) &(save_struc->songlib)); @@ -696,11 +742,13 @@ _cfsml_write_sfx_state_t(FILE *fh, sfx_state_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_sfx_state_t(FILE *fh, sfx_state_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -732,11 +780,13 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "songlib")) { +#line 749 "savegame.cfsml" if (read_songlib_t(fh, (songlib_t*) &(save_struc->songlib), value, line, hiteof)) { _cfsml_error("Token expected by read_songlib_t() for songlib at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("sfx_state_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -746,11 +796,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_clone_entry_t(FILE *fh, clone_entry_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "next_free = "); _cfsml_write_int(fh, (int*) &(save_struc->next_free)); @@ -761,11 +813,13 @@ _cfsml_write_clone_entry_t(FILE *fh, clone_entry_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_clone_entry_t(FILE *fh, clone_entry_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -797,17 +851,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "next_free")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->next_free), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for next_free at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "entry")) { +#line 749 "savegame.cfsml" if (_cfsml_read_clone_t(fh, (clone_t*) &(save_struc->entry), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_clone_t() for entry at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("clone_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -817,11 +874,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_object_t(FILE *fh, object_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "flags = "); _cfsml_write_int(fh, (int*) &(save_struc->flags)); @@ -842,6 +901,7 @@ _cfsml_write_object_t(FILE *fh, object_t* save_struc) min = max = save_struc->variables_nr; if (!save_struc->variables) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_reg_t(fh, &(save_struc->variables[i])); @@ -852,11 +912,13 @@ _cfsml_write_object_t(FILE *fh, object_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_object_t(FILE *fh, object_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -888,40 +950,47 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "flags")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->flags), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for flags at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "pos")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->pos), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for pos at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "variables_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->variables_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for variables_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "variable_names_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->variable_names_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for variable_names_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "methods_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->methods_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for methods_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "variables")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -938,9 +1007,11 @@ int min, max, i; } else save_struc->variables = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -957,6 +1028,7 @@ int min, max, i; } while (!done); save_struc->variables_nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("object_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -966,9 +1038,11 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_string(FILE *fh, char ** save_struc) { +#line 454 "savegame.cfsml" if (!(*save_struc)) fprintf(fh, "\\null\\"); else { @@ -978,10 +1052,12 @@ _cfsml_write_string(FILE *fh, char ** save_struc) } } +#line 538 "savegame.cfsml" static int _cfsml_read_string(FILE *fh, char ** save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 577 "savegame.cfsml" if (strcmp(lastval, "\\null\\")) { /* null pointer? */ if (*lastval == '"') { /* Quoted string? */ @@ -1007,16 +1083,19 @@ _cfsml_read_string(FILE *fh, char ** save_struc, char *lastval, int *line, int * } } +#line 444 "savegame.cfsml" static void _cfsml_write_menubar_t(FILE *fh, menubar_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "menus = "); min = max = save_struc->menus_nr; if (!save_struc->menus) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_menu_t(fh, &(save_struc->menus[i])); @@ -1027,11 +1106,13 @@ _cfsml_write_menubar_t(FILE *fh, menubar_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_menubar_t(FILE *fh, menubar_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1063,10 +1144,12 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "menus")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -1083,9 +1166,11 @@ int min, max, i; } else save_struc->menus = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1102,6 +1187,7 @@ int min, max, i; } while (!done); save_struc->menus_nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("menubar_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1111,16 +1197,19 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_size_t(FILE *fh, size_t* save_struc) { fprintf(fh, "%li", (long) *save_struc); } +#line 538 "savegame.cfsml" static int _cfsml_read_size_t(FILE *fh, size_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 564 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -1134,11 +1223,13 @@ _cfsml_read_size_t(FILE *fh, size_t* save_struc, char *lastval, int *line, int * return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_list_entry_t(FILE *fh, list_entry_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "next_free = "); _cfsml_write_int(fh, (int*) &(save_struc->next_free)); @@ -1149,11 +1240,13 @@ _cfsml_write_list_entry_t(FILE *fh, list_entry_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_list_entry_t(FILE *fh, list_entry_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1185,17 +1278,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "next_free")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->next_free), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for next_free at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "entry")) { +#line 749 "savegame.cfsml" if (_cfsml_read_list_t(fh, (list_t*) &(save_struc->entry), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_list_t() for entry at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("list_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1205,17 +1301,20 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "base_value = "); _cfsml_write_int(fh, (int*) &(save_struc->base_value)); fprintf(fh, "\n"); fprintf(fh, "nodes = "); min = max = DCS_INT_HASH_MAX+1; +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_int_hash_map_node_tp(fh, &(save_struc->nodes[i])); @@ -1226,11 +1325,13 @@ _cfsml_write_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1262,21 +1363,25 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "base_value")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->base_value), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for base_value at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "nodes")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } /* Prepare to restore static array */ max = DCS_INT_HASH_MAX+1; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1292,6 +1397,7 @@ int min, max, i; } else done = 1; } while (!done); } else +#line 758 "savegame.cfsml" { _cfsml_error("int_hash_map_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1301,16 +1407,19 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_gint16(FILE *fh, gint16* save_struc) { fprintf(fh, "%li", (long) *save_struc); } +#line 538 "savegame.cfsml" static int _cfsml_read_gint16(FILE *fh, gint16* save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 564 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -1324,11 +1433,13 @@ _cfsml_read_gint16(FILE *fh, gint16* save_struc, char *lastval, int *line, int * return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_song_t(FILE *fh, song_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "handle = "); _cfsml_write_song_handle_t(fh, (song_handle_t*) &(save_struc->handle)); @@ -1357,11 +1468,13 @@ _cfsml_write_song_t(FILE *fh, song_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_song_t(FILE *fh, song_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1393,53 +1506,62 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "handle")) { +#line 749 "savegame.cfsml" if (_cfsml_read_song_handle_t(fh, (song_handle_t*) &(save_struc->handle), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_song_handle_t() for handle at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "resource_num")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->resource_num), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for resource_num at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "priority")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->priority), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for priority at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "status")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->status), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for status at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "restore_behavior")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->restore_behavior), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for restore_behavior at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "restore_time")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->restore_time), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for restore_time at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "loops")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->loops), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for loops at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "hold")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->hold), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for hold at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("song_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1449,11 +1571,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_menu_item_t(FILE *fh, menu_item_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "type = "); _cfsml_write_int(fh, (int*) &(save_struc->type)); @@ -1469,6 +1593,7 @@ _cfsml_write_menu_item_t(FILE *fh, menu_item_t* save_struc) fprintf(fh, "\n"); fprintf(fh, "said = "); min = max = MENU_SAID_SPEC_SIZE; +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_byte(fh, &(save_struc->said[i])); @@ -1500,11 +1625,13 @@ _cfsml_write_menu_item_t(FILE *fh, menu_item_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_menu_item_t(FILE *fh, menu_item_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1536,39 +1663,46 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "type")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->type), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for type at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "keytext")) { +#line 749 "savegame.cfsml" if (_cfsml_read_string(fh, (char **) &(save_struc->keytext), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_string() for keytext at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "keytext_size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->keytext_size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for keytext_size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "flags")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->flags), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for flags at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "said")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } /* Prepare to restore static array */ max = MENU_SAID_SPEC_SIZE; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1585,47 +1719,55 @@ int min, max, i; } while (!done); } else if (!strcmp(token, "said_pos")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->said_pos), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for said_pos at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "text")) { +#line 749 "savegame.cfsml" if (_cfsml_read_string(fh, (char **) &(save_struc->text), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_string() for text at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "text_pos")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->text_pos), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for text_pos at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "modifiers")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->modifiers), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for modifiers at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "key")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->key), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for key at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "enabled")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->enabled), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for enabled at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "tag")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->tag), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for tag at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("menu_item_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1635,11 +1777,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_node_entry_t(FILE *fh, node_entry_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "next_free = "); _cfsml_write_int(fh, (int*) &(save_struc->next_free)); @@ -1650,11 +1794,13 @@ _cfsml_write_node_entry_t(FILE *fh, node_entry_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_node_entry_t(FILE *fh, node_entry_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1686,17 +1832,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "next_free")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->next_free), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for next_free at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "entry")) { +#line 749 "savegame.cfsml" if (_cfsml_read_node_t(fh, (node_t*) &(save_struc->entry), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_node_t() for entry at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("node_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1706,16 +1855,19 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_seg_id_t(FILE *fh, seg_id_t* save_struc) { fprintf(fh, "%li", (long) *save_struc); } +#line 538 "savegame.cfsml" static int _cfsml_read_seg_id_t(FILE *fh, seg_id_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 564 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -1729,11 +1881,13 @@ _cfsml_read_seg_id_t(FILE *fh, seg_id_t* save_struc, char *lastval, int *line, i return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_dynmem_t(FILE *fh, dynmem_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "size = "); _cfsml_write_int(fh, (int*) &(save_struc->size)); @@ -1745,6 +1899,7 @@ _cfsml_write_dynmem_t(FILE *fh, dynmem_t* save_struc) min = max = save_struc->size; if (!save_struc->buf) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_byte(fh, &(save_struc->buf[i])); @@ -1755,11 +1910,13 @@ _cfsml_write_dynmem_t(FILE *fh, dynmem_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_dynmem_t(FILE *fh, dynmem_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1791,22 +1948,26 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "description")) { +#line 749 "savegame.cfsml" if (_cfsml_read_string(fh, (char **) &(save_struc->description), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_string() for description at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "buf")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -1823,9 +1984,11 @@ int min, max, i; } else save_struc->buf = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1842,6 +2005,7 @@ int min, max, i; } while (!done); save_struc->size = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("dynmem_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1851,11 +2015,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_local_variables_t(FILE *fh, local_variables_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "script_id = "); _cfsml_write_int(fh, (int*) &(save_struc->script_id)); @@ -1867,6 +2033,7 @@ _cfsml_write_local_variables_t(FILE *fh, local_variables_t* save_struc) min = max = save_struc->nr; if (!save_struc->locals) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_reg_t(fh, &(save_struc->locals[i])); @@ -1877,11 +2044,13 @@ _cfsml_write_local_variables_t(FILE *fh, local_variables_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_local_variables_t(FILE *fh, local_variables_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1913,22 +2082,26 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "script_id")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->script_id), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for script_id at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "locals")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -1945,9 +2118,11 @@ int min, max, i; } else save_struc->locals = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1964,6 +2139,7 @@ int min, max, i; } while (!done); save_struc->nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("local_variables_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1973,11 +2149,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_state_t(FILE *fh, state_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "savegame_version = "); _cfsml_write_int(fh, (int*) &(save_struc->savegame_version)); @@ -2007,6 +2185,7 @@ _cfsml_write_state_t(FILE *fh, state_t* save_struc) min = max = save_struc->classtable_size; if (!save_struc->classtable) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_class_t(fh, &(save_struc->classtable[i])); @@ -2020,11 +2199,13 @@ _cfsml_write_state_t(FILE *fh, state_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_state_t(FILE *fh, state_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2056,58 +2237,68 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "savegame_version")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->savegame_version), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for savegame_version at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "game_version")) { +#line 749 "savegame.cfsml" if (_cfsml_read_string(fh, (char **) &(save_struc->game_version), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_string() for game_version at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "version")) { +#line 749 "savegame.cfsml" if (read_sci_version(fh, (sci_version_t*) &(save_struc->version), value, line, hiteof)) { _cfsml_error("Token expected by read_sci_version() for version at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "menubar")) { +#line 749 "savegame.cfsml" if (read_menubar_tp(fh, (menubar_t **) &(save_struc->menubar), value, line, hiteof)) { _cfsml_error("Token expected by read_menubar_tp() for menubar at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "status_bar_foreground")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->status_bar_foreground), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for status_bar_foreground at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "status_bar_background")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->status_bar_background), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for status_bar_background at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "seg_manager")) { +#line 749 "savegame.cfsml" if (_cfsml_read_seg_manager_t(fh, (seg_manager_t*) &(save_struc->seg_manager), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_seg_manager_t() for seg_manager at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "classtable_size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->classtable_size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for classtable_size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "classtable")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2124,9 +2315,11 @@ int min, max, i; } else save_struc->classtable = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2144,11 +2337,13 @@ int min, max, i; save_struc->classtable_size = max ; /* Set array size accordingly */ } else if (!strcmp(token, "sound")) { +#line 749 "savegame.cfsml" if (_cfsml_read_sfx_state_t(fh, (sfx_state_t*) &(save_struc->sound), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_sfx_state_t() for sound at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("state_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2158,11 +2353,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_node_table_t(FILE *fh, node_table_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "entries_nr = "); _cfsml_write_int(fh, (int*) &(save_struc->entries_nr)); @@ -2180,6 +2377,7 @@ _cfsml_write_node_table_t(FILE *fh, node_table_t* save_struc) min = max = save_struc->entries_nr; if (!save_struc->table) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_node_entry_t(fh, &(save_struc->table[i])); @@ -2190,11 +2388,13 @@ _cfsml_write_node_table_t(FILE *fh, node_table_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_node_table_t(FILE *fh, node_table_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2226,34 +2426,40 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "entries_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->entries_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for entries_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "first_free")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->first_free), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for first_free at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "entries_used")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->entries_used), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for entries_used at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "max_entry")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->max_entry), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for max_entry at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "table")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2270,9 +2476,11 @@ int min, max, i; } else save_struc->table = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2289,6 +2497,7 @@ int min, max, i; } while (!done); save_struc->entries_nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("node_table_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2298,14 +2507,17 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_sys_strings_t(FILE *fh, sys_strings_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "strings = "); min = max = SYS_STRINGS_MAX; +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_sys_string_t(fh, &(save_struc->strings[i])); @@ -2316,11 +2528,13 @@ _cfsml_write_sys_strings_t(FILE *fh, sys_strings_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_sys_strings_t(FILE *fh, sys_strings_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2352,15 +2566,18 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "strings")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } /* Prepare to restore static array */ max = SYS_STRINGS_MAX; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2376,6 +2593,7 @@ int min, max, i; } else done = 1; } while (!done); } else +#line 758 "savegame.cfsml" { _cfsml_error("sys_strings_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2385,16 +2603,19 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_byte(FILE *fh, byte* save_struc) { fprintf(fh, "%li", (long) *save_struc); } +#line 538 "savegame.cfsml" static int _cfsml_read_byte(FILE *fh, byte* save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 564 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -2408,11 +2629,13 @@ _cfsml_read_byte(FILE *fh, byte* save_struc, char *lastval, int *line, int *hite return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_node_t(FILE *fh, node_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "pred = "); write_reg_t(fh, (reg_t*) &(save_struc->pred)); @@ -2429,11 +2652,13 @@ _cfsml_write_node_t(FILE *fh, node_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_node_t(FILE *fh, node_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2465,29 +2690,34 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "pred")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->pred), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for pred at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "succ")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->succ), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for succ at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "key")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->key), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for key at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "value")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->value), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for value at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("node_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2497,11 +2727,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_list_table_t(FILE *fh, list_table_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "entries_nr = "); _cfsml_write_int(fh, (int*) &(save_struc->entries_nr)); @@ -2519,6 +2751,7 @@ _cfsml_write_list_table_t(FILE *fh, list_table_t* save_struc) min = max = save_struc->entries_nr; if (!save_struc->table) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_list_entry_t(fh, &(save_struc->table[i])); @@ -2529,11 +2762,13 @@ _cfsml_write_list_table_t(FILE *fh, list_table_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_list_table_t(FILE *fh, list_table_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2565,34 +2800,40 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "entries_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->entries_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for entries_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "first_free")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->first_free), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for first_free at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "entries_used")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->entries_used), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for entries_used at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "max_entry")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->max_entry), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for max_entry at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "table")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2609,9 +2850,11 @@ int min, max, i; } else save_struc->table = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2628,6 +2871,7 @@ int min, max, i; } while (!done); save_struc->entries_nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("list_table_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2637,11 +2881,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_class_t(FILE *fh, class_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "script = "); _cfsml_write_int(fh, (int*) &(save_struc->script)); @@ -2652,11 +2898,13 @@ _cfsml_write_class_t(FILE *fh, class_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_class_t(FILE *fh, class_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2688,17 +2936,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "script")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->script), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for script at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "reg")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->reg), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for reg at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("class_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2708,16 +2959,19 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_song_handle_t(FILE *fh, song_handle_t* save_struc) { fprintf(fh, "%li", (long) *save_struc); } +#line 538 "savegame.cfsml" static int _cfsml_read_song_handle_t(FILE *fh, song_handle_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 564 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -2731,16 +2985,19 @@ _cfsml_read_song_handle_t(FILE *fh, song_handle_t* save_struc, char *lastval, in return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_int(FILE *fh, int* save_struc) { fprintf(fh, "%li", (long) *save_struc); } +#line 538 "savegame.cfsml" static int _cfsml_read_int(FILE *fh, int* save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 564 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -2754,11 +3011,13 @@ _cfsml_read_int(FILE *fh, int* save_struc, char *lastval, int *line, int *hiteof return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_menu_t(FILE *fh, menu_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "title = "); _cfsml_write_string(fh, (char **) &(save_struc->title)); @@ -2773,6 +3032,7 @@ _cfsml_write_menu_t(FILE *fh, menu_t* save_struc) min = max = save_struc->items_nr; if (!save_struc->items) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_menu_item_t(fh, &(save_struc->items[i])); @@ -2783,11 +3043,13 @@ _cfsml_write_menu_t(FILE *fh, menu_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_menu_t(FILE *fh, menu_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2819,28 +3081,33 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "title")) { +#line 749 "savegame.cfsml" if (_cfsml_read_string(fh, (char **) &(save_struc->title), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_string() for title at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "title_width")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->title_width), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for title_width at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "width")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->width), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for width at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "items")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2857,9 +3124,11 @@ int min, max, i; } else save_struc->items = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2876,6 +3145,7 @@ int min, max, i; } while (!done); save_struc->items_nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("menu_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2885,16 +3155,19 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_long(FILE *fh, long* save_struc) { fprintf(fh, "%li", (long) *save_struc); } +#line 538 "savegame.cfsml" static int _cfsml_read_long(FILE *fh, long* save_struc, char *lastval, int *line, int *hiteof) { char *token; +#line 564 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -2908,11 +3181,13 @@ _cfsml_read_long(FILE *fh, long* save_struc, char *lastval, int *line, int *hite return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_clone_table_t(FILE *fh, clone_table_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "entries_nr = "); _cfsml_write_int(fh, (int*) &(save_struc->entries_nr)); @@ -2930,6 +3205,7 @@ _cfsml_write_clone_table_t(FILE *fh, clone_table_t* save_struc) min = max = save_struc->entries_nr; if (!save_struc->table) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_clone_entry_t(fh, &(save_struc->table[i])); @@ -2940,11 +3216,13 @@ _cfsml_write_clone_table_t(FILE *fh, clone_table_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_clone_table_t(FILE *fh, clone_table_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2976,34 +3254,40 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "entries_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->entries_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for entries_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "first_free")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->first_free), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for first_free at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "entries_used")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->entries_used), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for entries_used at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "max_entry")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->max_entry), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for max_entry at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "table")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3020,9 +3304,11 @@ int min, max, i; } else save_struc->table = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3039,6 +3325,7 @@ int min, max, i; } while (!done); save_struc->entries_nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("clone_table_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3048,11 +3335,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_clone_t(FILE *fh, clone_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "flags = "); _cfsml_write_int(fh, (int*) &(save_struc->flags)); @@ -3073,6 +3362,7 @@ _cfsml_write_clone_t(FILE *fh, clone_t* save_struc) min = max = save_struc->variables_nr; if (!save_struc->variables) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_reg_t(fh, &(save_struc->variables[i])); @@ -3083,11 +3373,13 @@ _cfsml_write_clone_t(FILE *fh, clone_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_clone_t(FILE *fh, clone_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3119,40 +3411,47 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "flags")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->flags), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for flags at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "pos")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->pos), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for pos at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "variables_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->variables_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for variables_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "variable_names_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->variable_names_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for variable_names_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "methods_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->methods_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for methods_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "variables")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3169,9 +3468,11 @@ int min, max, i; } else save_struc->variables = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3188,6 +3489,7 @@ int min, max, i; } while (!done); save_struc->variables_nr = max ; /* Set array size accordingly */ } else +#line 758 "savegame.cfsml" { _cfsml_error("clone_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3197,11 +3499,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_list_t(FILE *fh, list_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "first = "); write_reg_t(fh, (reg_t*) &(save_struc->first)); @@ -3212,11 +3516,13 @@ _cfsml_write_list_t(FILE *fh, list_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_list_t(FILE *fh, list_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3248,17 +3554,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "first")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->first), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for first at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "last")) { +#line 749 "savegame.cfsml" if (read_reg_t(fh, (reg_t*) &(save_struc->last), value, line, hiteof)) { _cfsml_error("Token expected by read_reg_t() for last at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("list_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3268,11 +3577,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_sys_string_t(FILE *fh, sys_string_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "name = "); _cfsml_write_string(fh, (char **) &(save_struc->name)); @@ -3286,11 +3597,13 @@ _cfsml_write_sys_string_t(FILE *fh, sys_string_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_sys_string_t(FILE *fh, sys_string_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3322,23 +3635,27 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "name")) { +#line 749 "savegame.cfsml" if (_cfsml_read_string(fh, (char **) &(save_struc->name), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_string() for name at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "max_size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->max_size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for max_size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "value")) { +#line 749 "savegame.cfsml" if (_cfsml_read_string(fh, (char **) &(save_struc->value), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_string() for value at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("sys_string_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3348,11 +3665,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_script_t(FILE *fh, script_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "nr = "); _cfsml_write_int(fh, (int*) &(save_struc->nr)); @@ -3388,6 +3707,7 @@ _cfsml_write_script_t(FILE *fh, script_t* save_struc) min = max = save_struc->objects_allocated; if (!save_struc->objects) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_object_t(fh, &(save_struc->objects[i])); @@ -3407,11 +3727,13 @@ _cfsml_write_script_t(FILE *fh, script_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_script_t(FILE *fh, script_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3443,70 +3765,82 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "buf_size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_size_t(fh, (size_t*) &(save_struc->buf_size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_size_t() for buf_size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "script_size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_size_t(fh, (size_t*) &(save_struc->script_size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_size_t() for script_size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "heap_size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_size_t(fh, (size_t*) &(save_struc->heap_size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_size_t() for heap_size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "obj_indices")) { +#line 749 "savegame.cfsml" if (read_int_hash_map_tp(fh, (int_hash_map_t **) &(save_struc->obj_indices), value, line, hiteof)) { _cfsml_error("Token expected by read_int_hash_map_tp() for obj_indices at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "exports_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->exports_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for exports_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "synonyms_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->synonyms_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for synonyms_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "lockers")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->lockers), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for lockers at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "objects_allocated")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->objects_allocated), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for objects_allocated at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "objects_nr")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->objects_nr), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for objects_nr at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "objects")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3523,9 +3857,11 @@ int min, max, i; } else save_struc->objects = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3543,23 +3879,27 @@ int min, max, i; save_struc->objects_allocated = max ; /* Set array size accordingly */ } else if (!strcmp(token, "locals_offset")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->locals_offset), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for locals_offset at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "locals_segment")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->locals_segment), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for locals_segment at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "marked_as_deleted")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->marked_as_deleted), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for marked_as_deleted at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("script_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3569,11 +3909,13 @@ int min, max, i; return CFSML_SUCCESS; } +#line 444 "savegame.cfsml" static void _cfsml_write_seg_manager_t(FILE *fh, seg_manager_t* save_struc) { int min, max, i; +#line 464 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "id_seg_map = "); write_int_hash_map_tp(fh, (int_hash_map_t **) &(save_struc->id_seg_map)); @@ -3582,6 +3924,7 @@ _cfsml_write_seg_manager_t(FILE *fh, seg_manager_t* save_struc) min = max = save_struc->heap_size; if (!save_struc->heap) min = max = 0; /* Don't write if it points to NULL */ +#line 490 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_mem_obj_tp(fh, &(save_struc->heap[i])); @@ -3619,11 +3962,13 @@ _cfsml_write_seg_manager_t(FILE *fh, seg_manager_t* save_struc) fprintf(fh, "}"); } +#line 538 "savegame.cfsml" static int _cfsml_read_seg_manager_t(FILE *fh, seg_manager_t* save_struc, char *lastval, int *line, int *hiteof) { char *token; int min, max, i; +#line 599 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3655,16 +4000,19 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "id_seg_map")) { +#line 749 "savegame.cfsml" if (read_int_hash_map_tp(fh, (int_hash_map_t **) &(save_struc->id_seg_map), value, line, hiteof)) { _cfsml_error("Token expected by read_int_hash_map_tp() for id_seg_map at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "heap")) { +#line 663 "savegame.cfsml" if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) { _cfsml_error("Opening brackets expected at line %d\n", *line); return CFSML_FAILURE; } +#line 673 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3681,9 +4029,11 @@ int min, max, i; } else save_struc->heap = NULL; +#line 699 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { +#line 707 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3701,59 +4051,69 @@ int min, max, i; save_struc->heap_size = max ; /* Set array size accordingly */ } else if (!strcmp(token, "heap_size")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->heap_size), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for heap_size at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "reserved_id")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->reserved_id), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for reserved_id at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "exports_wide")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->exports_wide), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for exports_wide at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "sci1_1")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->sci1_1), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for sci1_1 at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "gc_mark_bits")) { +#line 749 "savegame.cfsml" if (_cfsml_read_int(fh, (int*) &(save_struc->gc_mark_bits), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_int() for gc_mark_bits at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "mem_allocated")) { +#line 749 "savegame.cfsml" if (_cfsml_read_size_t(fh, (size_t*) &(save_struc->mem_allocated), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_size_t() for mem_allocated at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "clones_seg_id")) { +#line 749 "savegame.cfsml" if (_cfsml_read_seg_id_t(fh, (seg_id_t*) &(save_struc->clones_seg_id), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_seg_id_t() for clones_seg_id at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "lists_seg_id")) { +#line 749 "savegame.cfsml" if (_cfsml_read_seg_id_t(fh, (seg_id_t*) &(save_struc->lists_seg_id), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_seg_id_t() for lists_seg_id at line %d\n", *line); return CFSML_FAILURE; } } else if (!strcmp(token, "nodes_seg_id")) { +#line 749 "savegame.cfsml" if (_cfsml_read_seg_id_t(fh, (seg_id_t*) &(save_struc->nodes_seg_id), value, line, hiteof)) { _cfsml_error("Token expected by _cfsml_read_seg_id_t() for nodes_seg_id at line %d\n", *line); return CFSML_FAILURE; } } else +#line 758 "savegame.cfsml" { _cfsml_error("seg_manager_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3766,6 +4126,7 @@ int min, max, i; /* Auto-generated CFSML declaration and function block ends here */ /* Auto-generation performed by cfsml.pl 0.8.2 */ +#line 402 "savegame.cfsml" void write_songlib_t(FILE *fh, songlib_t *songlib) @@ -3780,10 +4141,12 @@ write_songlib_t(FILE *fh, songlib_t *songlib) while (seeker) { seeker->restore_time = seeker->it->get_timepos(seeker->it); +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_song_t(fh, seeker); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 417 "savegame.cfsml" seeker = seeker->next; } fprintf(fh, "]\n"); @@ -3807,12 +4170,18 @@ read_songlib_t(FILE *fh, songlib_t *songlib, char *lastval, int *line, int *hite for (i = 0; i < songcount; i++) { /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 839 "savegame.cfsml" char *_cfsml_inp = lastval; +#line 847 "savegame.cfsml" _cfsml_error = read_song_tp(fh, &newsong, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -3823,6 +4192,7 @@ read_songlib_t(FILE *fh, songlib_t *songlib, char *lastval, int *line, int *hite } } /* End of auto-generated CFSML data reader code */ +#line 440 "savegame.cfsml" song_lib_add(*songlib, newsong); } fscanf(fh, "]\n"); @@ -3864,19 +4234,23 @@ static int bucket_length; void write_int_hash_map_tp(FILE *fh, int_hash_map_t **foo) { +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_int_hash_map_t(fh, *foo); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 482 "savegame.cfsml" } void write_song_tp(FILE *fh, song_t **foo) { +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_song_t(fh, *foo); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 488 "savegame.cfsml" } song_iterator_t * @@ -3890,12 +4264,18 @@ read_song_tp(FILE *fh, song_t **foo, char *lastval, int *line, int *hiteof) *foo = (song_t*) malloc(sizeof(song_t)); token = _cfsml_get_identifier(fh, line, hiteof, &assignment); /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 839 "savegame.cfsml" char *_cfsml_inp = token; +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_song_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -3906,6 +4286,7 @@ read_song_tp(FILE *fh, song_t **foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 501 "savegame.cfsml" (*foo)->delay = 0; (*foo)->it = NULL; (*foo)->next_playing = (*foo)->next_stopping = (*foo)->next = NULL; @@ -3916,12 +4297,18 @@ read_int_hash_map_tp(FILE *fh, int_hash_map_t **foo, char *lastval, int *line, i { *foo = (int_hash_map_t*)malloc(sizeof(int_hash_map_t)); /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 839 "savegame.cfsml" char *_cfsml_inp = lastval; +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_int_hash_map_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -3932,6 +4319,7 @@ read_int_hash_map_tp(FILE *fh, int_hash_map_t **foo, char *lastval, int *line, i } } /* End of auto-generated CFSML data reader code */ +#line 511 "savegame.cfsml" (*foo)->holes = NULL; return 0; } @@ -3947,10 +4335,12 @@ write_int_hash_map_node_tp(FILE *fh, int_hash_map_node_t **foo) fprintf(fh,"[\n%d=>%d\n", (*foo)->name, (*foo)->value); if ((*foo)->next) { +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ write_int_hash_map_node_tp(fh, &((*foo)->next)); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 527 "savegame.cfsml" } else fputc('L', fh); fputs("]", fh); } @@ -4004,10 +4394,12 @@ write_menubar_tp(FILE *fh, menubar_t **foo) { if (*foo) { +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_menubar_t(fh, (*foo)); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 581 "savegame.cfsml" } else { /* Nothing to write */ fputs("\\null\\", fh); @@ -4025,12 +4417,18 @@ read_menubar_tp(FILE *fh, menubar_t **foo, char *lastval, int *line, int *hiteof *foo = (menubar_t *) sci_malloc(sizeof(menubar_t)); /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 839 "savegame.cfsml" char *_cfsml_inp = lastval; +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_menubar_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4041,6 +4439,7 @@ read_menubar_tp(FILE *fh, menubar_t **foo, char *lastval, int *line, int *hiteof } } /* End of auto-generated CFSML data reader code */ +#line 598 "savegame.cfsml" } return *hiteof; @@ -4050,61 +4449,79 @@ void write_mem_obj_t(FILE *fh, mem_obj_t *foo) { fprintf(fh, "%s\n", mem_obj_string_names[foo->type].name); +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_int(fh, &foo->segmgr_id); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 608 "savegame.cfsml" switch (foo->type) { case MEM_OBJ_SCRIPT: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_script_t(fh, &foo->data.script); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 612 "savegame.cfsml" break; case MEM_OBJ_CLONES: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_clone_table_t(fh, &foo->data.clones); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 615 "savegame.cfsml" break; case MEM_OBJ_LOCALS: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_local_variables_t(fh, &foo->data.locals); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 618 "savegame.cfsml" break; case MEM_OBJ_SYS_STRINGS: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_sys_strings_t(fh, &foo->data.sys_strings); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 621 "savegame.cfsml" break; case MEM_OBJ_STACK: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_int(fh, &foo->data.stack.nr); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 624 "savegame.cfsml" break; case MEM_OBJ_HUNK: break; case MEM_OBJ_LISTS: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_list_table_t(fh, &foo->data.lists); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 629 "savegame.cfsml" break; case MEM_OBJ_NODES: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_node_table_t(fh, &foo->data.nodes); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 632 "savegame.cfsml" break; case MEM_OBJ_DYNMEM: +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_dynmem_t(fh, &foo->data.dynmem); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 635 "savegame.cfsml" break; } } @@ -4121,13 +4538,19 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_int(fh, &foo->segmgr_id, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4138,17 +4561,24 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 651 "savegame.cfsml" switch (foo->type) { case MEM_OBJ_SCRIPT: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_script_t(fh, &foo->data.script, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4159,16 +4589,23 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 655 "savegame.cfsml" break; case MEM_OBJ_CLONES: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_clone_table_t(fh, &foo->data.clones, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4179,16 +4616,23 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 658 "savegame.cfsml" break; case MEM_OBJ_LOCALS: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_local_variables_t(fh, &foo->data.locals, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4199,16 +4643,23 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 661 "savegame.cfsml" break; case MEM_OBJ_SYS_STRINGS: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_sys_strings_t(fh, &foo->data.sys_strings, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4219,16 +4670,23 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 664 "savegame.cfsml" break; case MEM_OBJ_LISTS: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_list_table_t(fh, &foo->data.lists, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4239,16 +4697,23 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 667 "savegame.cfsml" break; case MEM_OBJ_NODES: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_node_table_t(fh, &foo->data.nodes, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4259,16 +4724,23 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 670 "savegame.cfsml" break; case MEM_OBJ_STACK: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_int(fh, &foo->data.stack.nr, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4279,6 +4751,7 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 673 "savegame.cfsml" foo->data.stack.entries = (reg_t *)sci_calloc(foo->data.stack.nr, sizeof(reg_t)); break; case MEM_OBJ_HUNK: @@ -4286,13 +4759,19 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) break; case MEM_OBJ_DYNMEM: /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_dynmem_t(fh, &foo->data.dynmem, _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4303,6 +4782,7 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) } } /* End of auto-generated CFSML data reader code */ +#line 680 "savegame.cfsml" break; } @@ -4314,10 +4794,12 @@ write_mem_obj_tp(FILE *fh, mem_obj_t **foo) { if (*foo) { +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ write_mem_obj_t(fh, (*foo)); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 692 "savegame.cfsml" } else { /* Nothing to write */ fputs("\\null\\", fh); @@ -4333,12 +4815,18 @@ read_mem_obj_tp(FILE *fh, mem_obj_t **foo, char *lastval, int *line, int *hiteof } else { *foo = (mem_obj_t *) sci_malloc(sizeof(mem_obj_t)); /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 839 "savegame.cfsml" char *_cfsml_inp = lastval; +#line 847 "savegame.cfsml" _cfsml_error = read_mem_obj_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); +#line 852 "savegame.cfsml" *hiteof = _cfsml_error; +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4349,6 +4837,7 @@ read_mem_obj_tp(FILE *fh, mem_obj_t **foo, char *lastval, int *line, int *hiteof } } /* End of auto-generated CFSML data reader code */ +#line 707 "savegame.cfsml" return *hiteof; } return 0; @@ -4415,10 +4904,12 @@ gamestate_save(state_t *s, char *dirname) s->game_time = time(NULL) - s->game_start_time.tv_sec; SCI_MEMTEST; +#line 877 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_state_t(fh, s); fprintf(fh, "\n"); /* End of auto-generated CFSML data writer code */ +#line 774 "savegame.cfsml" SCI_MEMTEST; fclose(fh); @@ -4762,16 +5253,25 @@ gamestate_restore(state_t *s, char *dirname) retval->sound_volume = s->sound_volume; /* Auto-generated CFSML data reader code */ +#line 823 "savegame.cfsml" { +#line 826 "savegame.cfsml" int _cfsml_line_ctr = 0; +#line 831 "savegame.cfsml" struct _cfsml_pointer_refstruct **_cfsml_myptrrefptr = _cfsml_get_current_refpointer(); +#line 834 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; +#line 842 "savegame.cfsml" char *_cfsml_inp = _cfsml_get_identifier(fh, &(_cfsml_line_ctr), &_cfsml_eof, &dummy); +#line 847 "savegame.cfsml" _cfsml_error = _cfsml_read_state_t(fh, retval, _cfsml_inp, &(_cfsml_line_ctr), &_cfsml_eof); +#line 852 "savegame.cfsml" read_eof = _cfsml_error; +#line 856 "savegame.cfsml" _cfsml_free_pointer_references(_cfsml_myptrrefptr, _cfsml_error); +#line 859 "savegame.cfsml" if (_cfsml_last_value_retreived) { free(_cfsml_last_value_retreived); _cfsml_last_value_retreived = NULL; @@ -4782,6 +5282,7 @@ gamestate_restore(state_t *s, char *dirname) } } /* End of auto-generated CFSML data reader code */ +#line 1117 "savegame.cfsml" fclose(fh); diff --git a/engines/sci/engine/savegame.cfsml b/engines/sci/engine/savegame.cfsml index 57abbfb862..5b3abafb13 100644 --- a/engines/sci/engine/savegame.cfsml +++ b/engines/sci/engine/savegame.cfsml @@ -30,12 +30,12 @@ ** savegame.cfsml. If this doesn't solve your problem, contact the maintainer. */ -#include <sci_memory.h> -#include <gfx_operations.h> -#include <sfx_engine.h> -#include <engine.h> +#include "sci/include/sci_memory.h" +#include "sci/include/gfx_operations.h" +#include "sci/include/sfx_engine.h" +#include "sci/include/engine.h" #include <assert.h> -#include "heap.h" +#include "sci/engine/heap.h" #ifdef _MSC_VER #include <direct.h> diff --git a/engines/sci/engine/scriptdebug.c b/engines/sci/engine/scriptdebug.c index 1a4b53e342..a3e31e3b7c 100644 --- a/engines/sci/engine/scriptdebug.c +++ b/engines/sci/engine/scriptdebug.c @@ -25,16 +25,16 @@ ***************************************************************************/ /* Script debugger functionality. Absolutely not threadsafe. */ -#include "gc.h" -#include <sciresource.h> -#include <engine.h> -#include <console.h> -#include <kdebug.h> -#include <vocabulary.h> -#include "kernel_types.h" -#include <sci_midi.h> -#include <sci_widgets.h> -#include <reg_t_hashmap.h> +#include "sci/engine/gc.h" +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" +#include "sci/include/console.h" +#include "sci/include/kdebug.h" +#include "sci/include/vocabulary.h" +#include "sci/engine/kernel_types.h" +#include "sci/include/sci_midi.h" +#include "sci/include/sci_widgets.h" +#include "sci/include/reg_t_hashmap.h" #ifdef _WIN32 # include <win32/sci_win32.h> diff --git a/engines/sci/engine/seg_manager.c b/engines/sci/engine/seg_manager.c index 8bc6187a22..c20461e682 100644 --- a/engines/sci/engine/seg_manager.c +++ b/engines/sci/engine/seg_manager.c @@ -25,10 +25,10 @@ ***************************************************************************/ -#include <seg_manager.h> -#include <sciresource.h> -#include <versions.h> -#include <engine.h> +#include "sci/include/seg_manager.h" +#include "sci/include/sciresource.h" +#include "sci/include/versions.h" +#include "sci/include/engine.h" /*#define GC_DEBUG*/ /* Debug garbage collection */ diff --git a/engines/sci/engine/sys_strings.c b/engines/sci/engine/sys_strings.c index 945d79343c..5aeb1a64c0 100644 --- a/engines/sci/engine/sys_strings.c +++ b/engines/sci/engine/sys_strings.c @@ -25,9 +25,9 @@ ***************************************************************************/ -#include <sys_strings.h> +#include "sci/include/sys_strings.h" #include <stdio.h> -#include <sci_memory.h> +#include "sci/include/sci_memory.h" void sys_string_acquire(sys_strings_t *strings, int index, const char *name, int max_len) diff --git a/engines/sci/engine/vm.c b/engines/sci/engine/vm.c index d628e80e7a..d2831fbd69 100644 --- a/engines/sci/engine/vm.c +++ b/engines/sci/engine/vm.c @@ -25,14 +25,14 @@ ***************************************************************************/ -#include <sciresource.h> -#include <engine.h> -#include <versions.h> -#include <kdebug.h> -#include "kernel_types.h" -#include <seg_manager.h> -#include "gc.h" -#include <sfx_player.h> +#include "sci/include/sciresource.h" +#include "sci/include/engine.h" +#include "sci/include/versions.h" +#include "sci/include/kdebug.h" +#include "sci/engine/kernel_types.h" +#include "sci/include/seg_manager.h" +#include "sci/engine/gc.h" +#include "sci/include/sfx_player.h" #ifdef HAVE_SETJMP_H #include <setjmp.h> |