diff options
-rw-r--r-- | engines/sci/engine/savegame.cfsml | 2 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 1418 | ||||
-rw-r--r-- | engines/sci/module.mk | 2 |
3 files changed, 711 insertions, 711 deletions
diff --git a/engines/sci/engine/savegame.cfsml b/engines/sci/engine/savegame.cfsml index 4c18fb1131..b2c521f545 100644 --- a/engines/sci/engine/savegame.cfsml +++ b/engines/sci/engine/savegame.cfsml @@ -88,7 +88,7 @@ write_sci_version(FILE *fh, sci_version_t *foo) int read_sci_version(FILE *fh, sci_version_t *foo, const char *lastval, int *line, int *hiteof) { - return version_parse(lastval, foo); + return version_parse((char *)lastval, foo); } void diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 920018e394..570ee27699 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -64,7 +64,7 @@ write_reg_t(FILE *fh, reg_t *foo) } int -read_reg_t(FILE *fh, reg_t *foo, char *lastval, int *line, int *hiteof) +read_reg_t(FILE *fh, reg_t *foo, const char *lastval, int *line, int *hiteof) { int segment, offset; @@ -86,9 +86,9 @@ write_sci_version(FILE *fh, sci_version_t *foo) } int -read_sci_version(FILE *fh, sci_version_t *foo, char *lastval, int *line, int *hiteof) +read_sci_version(FILE *fh, sci_version_t *foo, const char *lastval, int *line, int *hiteof) { - return version_parse(lastval, foo); + return version_parse((char *)lastval, foo); } void @@ -101,10 +101,10 @@ write_PTN(FILE *fh, parse_tree_node_t *foo) } int -read_PTN(FILE *fh, parse_tree_node_t *foo, char *lastval, int *line, int *hiteof) +read_PTN(FILE *fh, parse_tree_node_t *foo, const char *lastval, int *line, int *hiteof) { if (lastval[0] == 'L') { - char *c = lastval + 1; + const char *c = lastval + 1; char *strend; while (*c && isspace(*c)) @@ -119,7 +119,7 @@ read_PTN(FILE *fh, parse_tree_node_t *foo, char *lastval, int *line, int *hiteof return 0; } else if (lastval[0] == 'B') { - char *c = lastval + 1; + const char *c = lastval + 1; char *strend; while (*c && isspace(*c)) ++c; @@ -153,37 +153,37 @@ read_PTN(FILE *fh, parse_tree_node_t *foo, char *lastval, int *line, int *hiteof void write_menubar_tp(FILE *fh, menubar_t **foo); int -read_menubar_tp(FILE *fh, menubar_t **foo, char *lastval, int *line, int *hiteof); +read_menubar_tp(FILE *fh, menubar_t **foo, const char *lastval, int *line, int *hiteof); void write_mem_obj_tp(FILE *fh, mem_obj_t **foo); int -read_mem_obj_tp(FILE *fh, mem_obj_t **foo, char *lastval, int *line, int *hiteof); +read_mem_obj_tp(FILE *fh, mem_obj_t **foo, const char *lastval, int *line, int *hiteof); void write_int_hash_map_tp(FILE *fh, int_hash_map_t **foo); int -read_int_hash_map_tp(FILE *fh, int_hash_map_t **foo, char *lastval, int *line, int *hiteof); +read_int_hash_map_tp(FILE *fh, int_hash_map_t **foo, const char *lastval, int *line, int *hiteof); void write_songlib_t(FILE *fh, songlib_t *foo); int -read_songlib_t(FILE *fh, songlib_t *foo, char *lastval, int *line, int *hiteof); +read_songlib_t(FILE *fh, songlib_t *foo, const char *lastval, int *line, int *hiteof); void write_int_hash_map_node_tp(FILE *fh, int_hash_map_node_t **foo); int -read_int_hash_map_node_tp(FILE *fh, int_hash_map_node_t **foo, char *lastval, int *line, int *hiteof); +read_int_hash_map_node_tp(FILE *fh, int_hash_map_node_t **foo, const char *lastval, int *line, int *hiteof); int -read_song_tp(FILE *fh, song_t **foo, char *lastval, int *line, int *hiteof); +read_song_tp(FILE *fh, song_t **foo, const char *lastval, int *line, int *hiteof); typedef mem_obj_t *mem_obj_ptr; /* Auto-generated CFSML declaration and function block */ -#line 796 "savegame.cfsml" +#line 797 "savegame.cfsml" #define CFSML_SUCCESS 0 #define CFSML_FAILURE 1 @@ -206,7 +206,7 @@ typedef mem_obj_t *mem_obj_ptr; #endif static void -_cfsml_error(char *fmt, ...) +_cfsml_error(const char *fmt, ...) { va_list argp; @@ -225,8 +225,8 @@ static struct _cfsml_pointer_refstruct { static struct _cfsml_pointer_refstruct **_cfsml_pointer_references_current = &_cfsml_pointer_references; -static char *_cfsml_last_value_retreived = NULL; -static char *_cfsml_last_identifier_retreived = NULL; +static char *_cfsml_last_value_retrieved = NULL; +static char *_cfsml_last_identifier_retrieved = NULL; static void _cfsml_free_pointer_references_recursively(struct _cfsml_pointer_refstruct *refs, int free_pointers) @@ -285,9 +285,9 @@ static void _cfsml_register_pointer(void *ptr) static char * -_cfsml_mangle_string(char *s) +_cfsml_mangle_string(const char *s) { - char *source = s; + const char *source = s; char c; char *target = (char *) sci_malloc(1 + strlen(s) * 2); /* We will probably need less than that */ char *writer = target; @@ -309,14 +309,15 @@ _cfsml_mangle_string(char *s) static char * -_cfsml_unmangle_string(char *s) +_cfsml_unmangle_string(const char *s, unsigned int length) { char *target = (char *) sci_malloc(1 + strlen(s)); char *writer = target; - char *source = s; + const char *source = s; + const char *end = s + length; char c; - while ((c = *source++) && (c > 31)) { + while ((source != end) && (c = *source++) && (c > 31)) { if (c == '\\') { /* Escaped character? */ c = *source++; if ((c != '\\') && (c != '"')) /* Un-escape 0-31 only */ @@ -339,9 +340,9 @@ _cfsml_get_identifier(FILE *fd, int *line, int *hiteof, int *assignment) int done = 0; char *retval = (char *) sci_malloc(mem); - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } while (isspace(c = fgetc(fd)) && (c != EOF)); @@ -398,9 +399,9 @@ _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" +#line 323 "savegame.cfsml" - return _cfsml_last_identifier_retreived = retval; + return _cfsml_last_identifier_retrieved = retval; } @@ -412,9 +413,9 @@ _cfsml_get_value(FILE *fd, int *line, int *hiteof) int pos = 0; char *retval = (char *) sci_malloc(mem); - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } while (((c = fgetc(fd)) != EOF) && (c != '\n')) { @@ -446,217 +447,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)); +#line 380 "savegame.cfsml" + return (_cfsml_last_value_retrieved = (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" +#line 432 "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); +_cfsml_read_synonym_t(FILE *fh, synonym_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_sfx_state_t(FILE *fh, sfx_state_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_clone_entry_t(FILE *fh, clone_entry_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_object_t(FILE *fh, object_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_string(FILE *fh, char ** save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_menubar_t(FILE *fh, menubar_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_size_t(FILE *fh, size_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_list_entry_t(FILE *fh, list_entry_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_gint16(FILE *fh, gint16* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_song_t(FILE *fh, song_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_menu_item_t(FILE *fh, menu_item_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_node_entry_t(FILE *fh, node_entry_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_seg_id_t(FILE *fh, seg_id_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_dynmem_t(FILE *fh, dynmem_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_local_variables_t(FILE *fh, local_variables_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_state_t(FILE *fh, state_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_node_table_t(FILE *fh, node_table_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_sys_strings_t(FILE *fh, sys_strings_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_byte(FILE *fh, byte* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_node_t(FILE *fh, node_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_list_table_t(FILE *fh, list_table_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_class_t(FILE *fh, class_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_song_handle_t(FILE *fh, song_handle_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_int(FILE *fh, int* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_menu_t(FILE *fh, menu_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_long(FILE *fh, long* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_clone_table_t(FILE *fh, clone_table_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_clone_t(FILE *fh, clone_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_list_t(FILE *fh, list_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_sys_string_t(FILE *fh, sys_string_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_script_t(FILE *fh, script_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 431 "savegame.cfsml" +#line 432 "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); +_cfsml_read_seg_manager_t(FILE *fh, seg_manager_t* save_struc, const char *lastval, int *line, int *hiteof); -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_synonym_t(FILE *fh, synonym_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "replaceant = "); _cfsml_write_int(fh, (int*) &(save_struc->replaceant)); @@ -667,13 +668,13 @@ _cfsml_write_synonym_t(FILE *fh, synonym_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_synonym_t(FILE *fh, synonym_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_synonym_t(FILE *fh, synonym_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -682,7 +683,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -705,20 +706,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "replaceant")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("synonym_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -728,13 +729,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_sfx_state_t(FILE *fh, sfx_state_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "songlib = "); write_songlib_t(fh, (songlib_t*) &(save_struc->songlib)); @@ -742,13 +743,13 @@ _cfsml_write_sfx_state_t(FILE *fh, sfx_state_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_sfx_state_t(FILE *fh, sfx_state_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_sfx_state_t(FILE *fh, sfx_state_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -757,7 +758,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -780,13 +781,13 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "songlib")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("sfx_state_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -796,13 +797,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_clone_entry_t(FILE *fh, clone_entry_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "next_free = "); _cfsml_write_int(fh, (int*) &(save_struc->next_free)); @@ -813,13 +814,13 @@ _cfsml_write_clone_entry_t(FILE *fh, clone_entry_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_clone_entry_t(FILE *fh, clone_entry_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_clone_entry_t(FILE *fh, clone_entry_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -828,7 +829,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -851,20 +852,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "next_free")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("clone_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -874,13 +875,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_object_t(FILE *fh, object_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "flags = "); _cfsml_write_int(fh, (int*) &(save_struc->flags)); @@ -901,7 +902,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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_reg_t(fh, &(save_struc->variables[i])); @@ -912,13 +913,13 @@ _cfsml_write_object_t(FILE *fh, object_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_object_t(FILE *fh, object_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_object_t(FILE *fh, object_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -927,7 +928,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -950,47 +951,47 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "flags")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -1007,11 +1008,11 @@ int min, max, i; } else save_struc->variables = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1028,7 +1029,7 @@ int min, max, i; } while (!done); save_struc->variables_nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("object_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1038,43 +1039,42 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_string(FILE *fh, char ** save_struc) { -#line 454 "savegame.cfsml" +#line 455 "savegame.cfsml" if (!(*save_struc)) fprintf(fh, "\\null\\"); else { - char *token = _cfsml_mangle_string((char *) *save_struc); + char *token = _cfsml_mangle_string((const char *) *save_struc); fprintf(fh, "\"%s\"", token); free(token); } } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_string(FILE *fh, char ** save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_string(FILE *fh, char ** save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 577 "savegame.cfsml" +#line 578 "savegame.cfsml" if (strcmp(lastval, "\\null\\")) { /* null pointer? */ + unsigned int length = strlen(lastval); if (*lastval == '"') { /* Quoted string? */ - int seeker = strlen(lastval); + while (lastval[length] != '"') + --length; - while (lastval[seeker] != '"') - --seeker; - - if (!seeker) { /* No matching double-quotes? */ + if (!length) { /* No matching double-quotes? */ _cfsml_error("Unbalanced quotes at line %d\n", *line); return CFSML_FAILURE; } - lastval[seeker] = 0; /* Terminate string at closing quotes... */ lastval++; /* ...and skip the opening quotes locally */ + length--; } - *save_struc = _cfsml_unmangle_string(lastval); + *save_struc = _cfsml_unmangle_string(lastval, length); _cfsml_register_pointer(*save_struc); return CFSML_SUCCESS; } else { @@ -1083,19 +1083,19 @@ _cfsml_read_string(FILE *fh, char ** save_struc, char *lastval, int *line, int * } } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_menubar_t(FILE *fh, menubar_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_menu_t(fh, &(save_struc->menus[i])); @@ -1106,13 +1106,13 @@ _cfsml_write_menubar_t(FILE *fh, menubar_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_menubar_t(FILE *fh, menubar_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_menubar_t(FILE *fh, menubar_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1121,7 +1121,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -1144,12 +1144,12 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "menus")) { -#line 663 "savegame.cfsml" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -1166,11 +1166,11 @@ int min, max, i; } else save_struc->menus = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1187,7 +1187,7 @@ int min, max, i; } while (!done); save_struc->menus_nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("menubar_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1197,19 +1197,19 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_size_t(FILE *fh, size_t* save_struc) { fprintf(fh, "%li", (long) *save_struc); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_size_t(FILE *fh, size_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_size_t(FILE *fh, size_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 564 "savegame.cfsml" +#line 565 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -1223,13 +1223,13 @@ _cfsml_read_size_t(FILE *fh, size_t* save_struc, char *lastval, int *line, int * return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_list_entry_t(FILE *fh, list_entry_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "next_free = "); _cfsml_write_int(fh, (int*) &(save_struc->next_free)); @@ -1240,13 +1240,13 @@ _cfsml_write_list_entry_t(FILE *fh, list_entry_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_list_entry_t(FILE *fh, list_entry_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_list_entry_t(FILE *fh, list_entry_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1255,7 +1255,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -1278,20 +1278,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "next_free")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("list_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1301,20 +1301,20 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "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" +#line 465 "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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_int_hash_map_node_tp(fh, &(save_struc->nodes[i])); @@ -1325,13 +1325,13 @@ _cfsml_write_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_int_hash_map_t(FILE *fh, int_hash_map_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1340,7 +1340,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -1363,25 +1363,25 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "base_value")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 664 "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" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1397,7 +1397,7 @@ int min, max, i; } else done = 1; } while (!done); } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("int_hash_map_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1407,19 +1407,19 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_gint16(FILE *fh, gint16* save_struc) { fprintf(fh, "%li", (long) *save_struc); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_gint16(FILE *fh, gint16* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_gint16(FILE *fh, gint16* save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 564 "savegame.cfsml" +#line 565 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -1433,13 +1433,13 @@ _cfsml_read_gint16(FILE *fh, gint16* save_struc, char *lastval, int *line, int * return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_song_t(FILE *fh, song_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "handle = "); _cfsml_write_song_handle_t(fh, (song_handle_t*) &(save_struc->handle)); @@ -1468,13 +1468,13 @@ _cfsml_write_song_t(FILE *fh, song_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_song_t(FILE *fh, song_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_song_t(FILE *fh, song_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1483,7 +1483,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -1506,62 +1506,62 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "handle")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("song_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1571,13 +1571,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_menu_item_t(FILE *fh, menu_item_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "type = "); _cfsml_write_int(fh, (int*) &(save_struc->type)); @@ -1593,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_byte(fh, &(save_struc->said[i])); @@ -1625,13 +1625,13 @@ _cfsml_write_menu_item_t(FILE *fh, menu_item_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_menu_item_t(FILE *fh, menu_item_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_menu_item_t(FILE *fh, menu_item_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1640,7 +1640,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -1663,46 +1663,46 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "type")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -1719,55 +1719,55 @@ int min, max, i; } while (!done); } else if (!strcmp(token, "said_pos")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("menu_item_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1777,13 +1777,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_node_entry_t(FILE *fh, node_entry_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "next_free = "); _cfsml_write_int(fh, (int*) &(save_struc->next_free)); @@ -1794,13 +1794,13 @@ _cfsml_write_node_entry_t(FILE *fh, node_entry_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_node_entry_t(FILE *fh, node_entry_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_node_entry_t(FILE *fh, node_entry_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1809,7 +1809,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -1832,20 +1832,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "next_free")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("node_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -1855,19 +1855,19 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "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" +#line 539 "savegame.cfsml" static int -_cfsml_read_seg_id_t(FILE *fh, seg_id_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_seg_id_t(FILE *fh, seg_id_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 564 "savegame.cfsml" +#line 565 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -1881,13 +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" +#line 445 "savegame.cfsml" static void _cfsml_write_dynmem_t(FILE *fh, dynmem_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "size = "); _cfsml_write_int(fh, (int*) &(save_struc->size)); @@ -1899,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_byte(fh, &(save_struc->buf[i])); @@ -1910,13 +1910,13 @@ _cfsml_write_dynmem_t(FILE *fh, dynmem_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_dynmem_t(FILE *fh, dynmem_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_dynmem_t(FILE *fh, dynmem_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -1925,7 +1925,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -1948,26 +1948,26 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "size")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -1984,11 +1984,11 @@ int min, max, i; } else save_struc->buf = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2005,7 +2005,7 @@ int min, max, i; } while (!done); save_struc->size = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("dynmem_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2015,13 +2015,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_local_variables_t(FILE *fh, local_variables_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "script_id = "); _cfsml_write_int(fh, (int*) &(save_struc->script_id)); @@ -2033,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_reg_t(fh, &(save_struc->locals[i])); @@ -2044,13 +2044,13 @@ _cfsml_write_local_variables_t(FILE *fh, local_variables_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_local_variables_t(FILE *fh, local_variables_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_local_variables_t(FILE *fh, local_variables_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2059,7 +2059,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -2082,26 +2082,26 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "script_id")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2118,11 +2118,11 @@ int min, max, i; } else save_struc->locals = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2139,7 +2139,7 @@ int min, max, i; } while (!done); save_struc->nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("local_variables_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2149,13 +2149,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_state_t(FILE *fh, state_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "savegame_version = "); _cfsml_write_int(fh, (int*) &(save_struc->savegame_version)); @@ -2185,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_class_t(fh, &(save_struc->classtable[i])); @@ -2199,13 +2199,13 @@ _cfsml_write_state_t(FILE *fh, state_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_state_t(FILE *fh, state_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_state_t(FILE *fh, state_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2214,7 +2214,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -2237,68 +2237,68 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "savegame_version")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2315,11 +2315,11 @@ int min, max, i; } else save_struc->classtable = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2337,13 +2337,13 @@ int min, max, i; save_struc->classtable_size = max ; /* Set array size accordingly */ } else if (!strcmp(token, "sound")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("state_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2353,13 +2353,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_node_table_t(FILE *fh, node_table_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "entries_nr = "); _cfsml_write_int(fh, (int*) &(save_struc->entries_nr)); @@ -2377,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_node_entry_t(fh, &(save_struc->table[i])); @@ -2388,13 +2388,13 @@ _cfsml_write_node_table_t(FILE *fh, node_table_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_node_table_t(FILE *fh, node_table_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_node_table_t(FILE *fh, node_table_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2403,7 +2403,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -2426,40 +2426,40 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "entries_nr")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2476,11 +2476,11 @@ int min, max, i; } else save_struc->table = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2497,7 +2497,7 @@ int min, max, i; } while (!done); save_struc->entries_nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("node_table_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2507,17 +2507,17 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_sys_strings_t(FILE *fh, sys_strings_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "strings = "); min = max = SYS_STRINGS_MAX; -#line 490 "savegame.cfsml" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_sys_string_t(fh, &(save_struc->strings[i])); @@ -2528,13 +2528,13 @@ _cfsml_write_sys_strings_t(FILE *fh, sys_strings_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_sys_strings_t(FILE *fh, sys_strings_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_sys_strings_t(FILE *fh, sys_strings_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2543,7 +2543,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -2566,18 +2566,18 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "strings")) { -#line 663 "savegame.cfsml" +#line 664 "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" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2593,7 +2593,7 @@ int min, max, i; } else done = 1; } while (!done); } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("sys_strings_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2603,19 +2603,19 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_byte(FILE *fh, byte* save_struc) { fprintf(fh, "%li", (long) *save_struc); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_byte(FILE *fh, byte* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_byte(FILE *fh, byte* save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 564 "savegame.cfsml" +#line 565 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -2629,13 +2629,13 @@ _cfsml_read_byte(FILE *fh, byte* save_struc, char *lastval, int *line, int *hite return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_node_t(FILE *fh, node_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "pred = "); write_reg_t(fh, (reg_t*) &(save_struc->pred)); @@ -2652,13 +2652,13 @@ _cfsml_write_node_t(FILE *fh, node_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_node_t(FILE *fh, node_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_node_t(FILE *fh, node_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2667,7 +2667,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -2690,34 +2690,34 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "pred")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("node_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2727,13 +2727,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_list_table_t(FILE *fh, list_table_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "entries_nr = "); _cfsml_write_int(fh, (int*) &(save_struc->entries_nr)); @@ -2751,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_list_entry_t(fh, &(save_struc->table[i])); @@ -2762,13 +2762,13 @@ _cfsml_write_list_table_t(FILE *fh, list_table_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_list_table_t(FILE *fh, list_table_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_list_table_t(FILE *fh, list_table_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2777,7 +2777,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -2800,40 +2800,40 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "entries_nr")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -2850,11 +2850,11 @@ int min, max, i; } else save_struc->table = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -2871,7 +2871,7 @@ int min, max, i; } while (!done); save_struc->entries_nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("list_table_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2881,13 +2881,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_class_t(FILE *fh, class_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "script = "); _cfsml_write_int(fh, (int*) &(save_struc->script)); @@ -2898,13 +2898,13 @@ _cfsml_write_class_t(FILE *fh, class_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_class_t(FILE *fh, class_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_class_t(FILE *fh, class_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -2913,7 +2913,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -2936,20 +2936,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "script")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("class_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -2959,19 +2959,19 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "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" +#line 539 "savegame.cfsml" static int -_cfsml_read_song_handle_t(FILE *fh, song_handle_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_song_handle_t(FILE *fh, song_handle_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 564 "savegame.cfsml" +#line 565 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -2985,19 +2985,19 @@ _cfsml_read_song_handle_t(FILE *fh, song_handle_t* save_struc, char *lastval, in return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_int(FILE *fh, int* save_struc) { fprintf(fh, "%li", (long) *save_struc); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_int(FILE *fh, int* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_int(FILE *fh, int* save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 564 "savegame.cfsml" +#line 565 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -3011,13 +3011,13 @@ _cfsml_read_int(FILE *fh, int* save_struc, char *lastval, int *line, int *hiteof return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_menu_t(FILE *fh, menu_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "title = "); _cfsml_write_string(fh, (char **) &(save_struc->title)); @@ -3032,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_menu_item_t(fh, &(save_struc->items[i])); @@ -3043,13 +3043,13 @@ _cfsml_write_menu_t(FILE *fh, menu_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_menu_t(FILE *fh, menu_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_menu_t(FILE *fh, menu_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3058,7 +3058,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -3081,33 +3081,33 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "title")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3124,11 +3124,11 @@ int min, max, i; } else save_struc->items = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3145,7 +3145,7 @@ int min, max, i; } while (!done); save_struc->items_nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("menu_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3155,19 +3155,19 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_long(FILE *fh, long* save_struc) { fprintf(fh, "%li", (long) *save_struc); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_long(FILE *fh, long* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_long(FILE *fh, long* save_struc, const char *lastval, int *line, int *hiteof) { char *token; -#line 564 "savegame.cfsml" +#line 565 "savegame.cfsml" *save_struc = strtol(lastval, &token, 0); if ( (*save_struc == 0) && (token == lastval) ) { @@ -3181,13 +3181,13 @@ _cfsml_read_long(FILE *fh, long* save_struc, char *lastval, int *line, int *hite return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_clone_table_t(FILE *fh, clone_table_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "entries_nr = "); _cfsml_write_int(fh, (int*) &(save_struc->entries_nr)); @@ -3205,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_clone_entry_t(fh, &(save_struc->table[i])); @@ -3216,13 +3216,13 @@ _cfsml_write_clone_table_t(FILE *fh, clone_table_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_clone_table_t(FILE *fh, clone_table_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_clone_table_t(FILE *fh, clone_table_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3231,7 +3231,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -3254,40 +3254,40 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "entries_nr")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3304,11 +3304,11 @@ int min, max, i; } else save_struc->table = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3325,7 +3325,7 @@ int min, max, i; } while (!done); save_struc->entries_nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("clone_table_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3335,13 +3335,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_clone_t(FILE *fh, clone_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "flags = "); _cfsml_write_int(fh, (int*) &(save_struc->flags)); @@ -3362,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_reg_t(fh, &(save_struc->variables[i])); @@ -3373,13 +3373,13 @@ _cfsml_write_clone_t(FILE *fh, clone_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_clone_t(FILE *fh, clone_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_clone_t(FILE *fh, clone_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3388,7 +3388,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -3411,47 +3411,47 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "flags")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3468,11 +3468,11 @@ int min, max, i; } else save_struc->variables = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3489,7 +3489,7 @@ int min, max, i; } while (!done); save_struc->variables_nr = max ; /* Set array size accordingly */ } else -#line 758 "savegame.cfsml" +#line 759 "savegame.cfsml" { _cfsml_error("clone_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3499,13 +3499,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_list_t(FILE *fh, list_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "first = "); write_reg_t(fh, (reg_t*) &(save_struc->first)); @@ -3516,13 +3516,13 @@ _cfsml_write_list_t(FILE *fh, list_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_list_t(FILE *fh, list_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_list_t(FILE *fh, list_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3531,7 +3531,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -3554,20 +3554,20 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "first")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("list_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3577,13 +3577,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_sys_string_t(FILE *fh, sys_string_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "name = "); _cfsml_write_string(fh, (char **) &(save_struc->name)); @@ -3597,13 +3597,13 @@ _cfsml_write_sys_string_t(FILE *fh, sys_string_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_sys_string_t(FILE *fh, sys_string_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_sys_string_t(FILE *fh, sys_string_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3612,7 +3612,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -3635,27 +3635,27 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "name")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("sys_string_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3665,13 +3665,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_script_t(FILE *fh, script_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "savegame.cfsml" fprintf(fh, "{\n"); fprintf(fh, "nr = "); _cfsml_write_int(fh, (int*) &(save_struc->nr)); @@ -3707,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { _cfsml_write_object_t(fh, &(save_struc->objects[i])); @@ -3727,13 +3727,13 @@ _cfsml_write_script_t(FILE *fh, script_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_script_t(FILE *fh, script_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_script_t(FILE *fh, script_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3742,7 +3742,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -3765,82 +3765,82 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "nr")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -3857,11 +3857,11 @@ int min, max, i; } else save_struc->objects = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -3879,27 +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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("script_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -3909,13 +3909,13 @@ int min, max, i; return CFSML_SUCCESS; } -#line 444 "savegame.cfsml" +#line 445 "savegame.cfsml" static void _cfsml_write_seg_manager_t(FILE *fh, seg_manager_t* save_struc) { int min, max, i; -#line 464 "savegame.cfsml" +#line 465 "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)); @@ -3924,7 +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" +#line 491 "savegame.cfsml" fprintf(fh, "[%d][\n", max); for (i = 0; i < min; i++) { write_mem_obj_tp(fh, &(save_struc->heap[i])); @@ -3962,13 +3962,13 @@ _cfsml_write_seg_manager_t(FILE *fh, seg_manager_t* save_struc) fprintf(fh, "}"); } -#line 538 "savegame.cfsml" +#line 539 "savegame.cfsml" static int -_cfsml_read_seg_manager_t(FILE *fh, seg_manager_t* save_struc, char *lastval, int *line, int *hiteof) +_cfsml_read_seg_manager_t(FILE *fh, seg_manager_t* save_struc, const char *lastval, int *line, int *hiteof) { char *token; int min, max, i; -#line 599 "savegame.cfsml" +#line 600 "savegame.cfsml" int assignment, closed, done; if (strcmp(lastval, "{")) { @@ -3977,7 +3977,7 @@ int min, max, i; }; closed = 0; do { - char *value; + const char *value; token = _cfsml_get_identifier(fh, line, hiteof, &assignment); if (!token) { @@ -4000,19 +4000,19 @@ int min, max, i; return CFSML_FAILURE; } if (!strcmp(token, "id_seg_map")) { -#line 749 "savegame.cfsml" +#line 750 "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" +#line 664 "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" +#line 674 "savegame.cfsml" /* Prepare to restore dynamic array */ max = strtol(value + 1, NULL, 0); if (max < 0) { @@ -4029,11 +4029,11 @@ int min, max, i; } else save_struc->heap = NULL; -#line 699 "savegame.cfsml" +#line 700 "savegame.cfsml" done = i = 0; do { if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) { -#line 707 "savegame.cfsml" +#line 708 "savegame.cfsml" _cfsml_error("Token expected at line %d\n", *line); return 1; } @@ -4051,69 +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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 750 "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" +#line 759 "savegame.cfsml" { _cfsml_error("seg_manager_t: Assignment to invalid identifier '%s' in line %d\n", token, *line); return CFSML_FAILURE; @@ -4141,7 +4141,7 @@ write_songlib_t(FILE *fh, songlib_t *songlib) while (seeker) { seeker->restore_time = seeker->it->get_timepos(seeker->it); -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_song_t(fh, seeker); fprintf(fh, "\n"); @@ -4154,7 +4154,7 @@ write_songlib_t(FILE *fh, songlib_t *songlib) } int -read_songlib_t(FILE *fh, songlib_t *songlib, char *lastval, int *line, int *hiteof) +read_songlib_t(FILE *fh, songlib_t *songlib, const char *lastval, int *line, int *hiteof) { int songcount; int i; @@ -4170,25 +4170,25 @@ 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 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; -#line 839 "savegame.cfsml" - char *_cfsml_inp = lastval; -#line 847 "savegame.cfsml" +#line 840 "savegame.cfsml" + const char *_cfsml_inp = lastval; +#line 848 "savegame.cfsml" _cfsml_error = read_song_tp(fh, &newsong, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4203,7 +4203,7 @@ read_songlib_t(FILE *fh, songlib_t *songlib, char *lastval, int *line, int *hite struct { int type; - char *name; + const char *name; } mem_obj_string_names[] = { {MEM_OBJ_INVALID, "INVALID"}, {MEM_OBJ_SCRIPT, "SCRIPT"}, @@ -4217,7 +4217,7 @@ struct { {MEM_OBJ_DYNMEM,"DYNMEM"}}; int -mem_obj_string_to_enum(char *str) +mem_obj_string_to_enum(const char *str) { int i; @@ -4234,7 +4234,7 @@ static int bucket_length; void write_int_hash_map_tp(FILE *fh, int_hash_map_t **foo) { -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_int_hash_map_t(fh, *foo); fprintf(fh, "\n"); @@ -4245,7 +4245,7 @@ write_int_hash_map_tp(FILE *fh, int_hash_map_t **foo) void write_song_tp(FILE *fh, song_t **foo) { -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_song_t(fh, *foo); fprintf(fh, "\n"); @@ -4257,32 +4257,32 @@ song_iterator_t * build_iterator(state_t *s, int song_nr, int type, songit_id_t id); int -read_song_tp(FILE *fh, song_t **foo, char *lastval, int *line, int *hiteof) +read_song_tp(FILE *fh, song_t **foo, const char *lastval, int *line, int *hiteof) { char *token; int assignment; *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 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; -#line 839 "savegame.cfsml" - char *_cfsml_inp = token; -#line 847 "savegame.cfsml" +#line 840 "savegame.cfsml" + const char *_cfsml_inp = token; +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_song_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4293,29 +4293,29 @@ read_song_tp(FILE *fh, song_t **foo, char *lastval, int *line, int *hiteof) return 0; } int -read_int_hash_map_tp(FILE *fh, int_hash_map_t **foo, char *lastval, int *line, int *hiteof) +read_int_hash_map_tp(FILE *fh, int_hash_map_t **foo, const char *lastval, int *line, int *hiteof) { *foo = (int_hash_map_t*)malloc(sizeof(int_hash_map_t)); /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; -#line 839 "savegame.cfsml" - char *_cfsml_inp = lastval; -#line 847 "savegame.cfsml" +#line 840 "savegame.cfsml" + const char *_cfsml_inp = lastval; +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_int_hash_map_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4335,7 +4335,7 @@ 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" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ write_int_hash_map_node_tp(fh, &((*foo)->next)); fprintf(fh, "\n"); @@ -4347,7 +4347,7 @@ write_int_hash_map_node_tp(FILE *fh, int_hash_map_node_t **foo) } int -read_int_hash_map_node_tp(FILE *fh, int_hash_map_node_t **foo, char *lastval, int *line, int *hiteof) +read_int_hash_map_node_tp(FILE *fh, int_hash_map_node_t **foo, const char *lastval, int *line, int *hiteof) { static char buffer[80]; @@ -4394,7 +4394,7 @@ write_menubar_tp(FILE *fh, menubar_t **foo) { if (*foo) { -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_menubar_t(fh, (*foo)); fprintf(fh, "\n"); @@ -4408,7 +4408,7 @@ write_menubar_tp(FILE *fh, menubar_t **foo) int -read_menubar_tp(FILE *fh, menubar_t **foo, char *lastval, int *line, int *hiteof) +read_menubar_tp(FILE *fh, menubar_t **foo, const char *lastval, int *line, int *hiteof) { if (lastval[0] == '\\') { @@ -4417,25 +4417,25 @@ 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 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; -#line 839 "savegame.cfsml" - char *_cfsml_inp = lastval; -#line 847 "savegame.cfsml" +#line 840 "savegame.cfsml" + const char *_cfsml_inp = lastval; +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_menubar_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4449,7 +4449,7 @@ 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" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_int(fh, &foo->segmgr_id); fprintf(fh, "\n"); @@ -4458,7 +4458,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) switch (foo->type) { case MEM_OBJ_SCRIPT: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_script_t(fh, &foo->data.script); fprintf(fh, "\n"); @@ -4466,7 +4466,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) #line 612 "savegame.cfsml" break; case MEM_OBJ_CLONES: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_clone_table_t(fh, &foo->data.clones); fprintf(fh, "\n"); @@ -4474,7 +4474,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) #line 615 "savegame.cfsml" break; case MEM_OBJ_LOCALS: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_local_variables_t(fh, &foo->data.locals); fprintf(fh, "\n"); @@ -4482,7 +4482,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) #line 618 "savegame.cfsml" break; case MEM_OBJ_SYS_STRINGS: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_sys_strings_t(fh, &foo->data.sys_strings); fprintf(fh, "\n"); @@ -4490,7 +4490,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) #line 621 "savegame.cfsml" break; case MEM_OBJ_STACK: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_int(fh, &foo->data.stack.nr); fprintf(fh, "\n"); @@ -4500,7 +4500,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) case MEM_OBJ_HUNK: break; case MEM_OBJ_LISTS: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_list_table_t(fh, &foo->data.lists); fprintf(fh, "\n"); @@ -4508,7 +4508,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) #line 629 "savegame.cfsml" break; case MEM_OBJ_NODES: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_node_table_t(fh, &foo->data.nodes); fprintf(fh, "\n"); @@ -4516,7 +4516,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) #line 632 "savegame.cfsml" break; case MEM_OBJ_DYNMEM: -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_dynmem_t(fh, &foo->data.dynmem); fprintf(fh, "\n"); @@ -4527,7 +4527,7 @@ write_mem_obj_t(FILE *fh, mem_obj_t *foo) } int -read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) +read_mem_obj_t(FILE *fh, mem_obj_t *foo, const char *lastval, int *line, int *hiteof) { char buffer[80]; foo->type = mem_obj_string_to_enum(lastval); @@ -4538,26 +4538,26 @@ 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 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_int(fh, &foo->segmgr_id, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4566,26 +4566,26 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) { case MEM_OBJ_SCRIPT: /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_script_t(fh, &foo->data.script, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4593,26 +4593,26 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) break; case MEM_OBJ_CLONES: /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_clone_table_t(fh, &foo->data.clones, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4620,26 +4620,26 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) break; case MEM_OBJ_LOCALS: /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_local_variables_t(fh, &foo->data.locals, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4647,26 +4647,26 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) break; case MEM_OBJ_SYS_STRINGS: /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_sys_strings_t(fh, &foo->data.sys_strings, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4674,26 +4674,26 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) break; case MEM_OBJ_LISTS: /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_list_table_t(fh, &foo->data.lists, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4701,26 +4701,26 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) break; case MEM_OBJ_NODES: /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_node_table_t(fh, &foo->data.nodes, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4728,26 +4728,26 @@ read_mem_obj_t(FILE *fh, mem_obj_t *foo, char *lastval, int *line, int *hiteof) break; case MEM_OBJ_STACK: /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_int(fh, &foo->data.stack.nr, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4759,26 +4759,26 @@ 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 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(*line), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_dynmem_t(fh, &foo->data.dynmem, _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4794,7 +4794,7 @@ write_mem_obj_tp(FILE *fh, mem_obj_t **foo) { if (*foo) { -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ write_mem_obj_t(fh, (*foo)); fprintf(fh, "\n"); @@ -4807,7 +4807,7 @@ write_mem_obj_tp(FILE *fh, mem_obj_t **foo) } int -read_mem_obj_tp(FILE *fh, mem_obj_t **foo, char *lastval, int *line, int *hiteof) +read_mem_obj_tp(FILE *fh, mem_obj_t **foo, const char *lastval, int *line, int *hiteof) { if (lastval[0] == '\\') { @@ -4815,25 +4815,25 @@ 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 824 "savegame.cfsml" { -#line 834 "savegame.cfsml" +#line 835 "savegame.cfsml" int _cfsml_eof = 0, _cfsml_error; int dummy; -#line 839 "savegame.cfsml" - char *_cfsml_inp = lastval; -#line 847 "savegame.cfsml" +#line 840 "savegame.cfsml" + const char *_cfsml_inp = lastval; +#line 848 "savegame.cfsml" _cfsml_error = read_mem_obj_t(fh, (*foo), _cfsml_inp, &(*line), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" *hiteof = _cfsml_error; -#line 859 "savegame.cfsml" - if (_cfsml_last_value_retreived) { - free(_cfsml_last_value_retreived); - _cfsml_last_value_retreived = NULL; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ @@ -4904,7 +4904,7 @@ gamestate_save(state_t *s, char *dirname) s->game_time = time(NULL) - s->game_start_time.tv_sec; SCI_MEMTEST; -#line 877 "savegame.cfsml" +#line 878 "savegame.cfsml" /* Auto-generated CFSML data writer code */ _cfsml_write_state_t(fh, s); fprintf(fh, "\n"); @@ -5253,32 +5253,32 @@ gamestate_restore(state_t *s, char *dirname) retval->sound_volume = s->sound_volume; /* Auto-generated CFSML data reader code */ -#line 823 "savegame.cfsml" +#line 824 "savegame.cfsml" { -#line 826 "savegame.cfsml" +#line 827 "savegame.cfsml" int _cfsml_line_ctr = 0; -#line 831 "savegame.cfsml" +#line 832 "savegame.cfsml" struct _cfsml_pointer_refstruct **_cfsml_myptrrefptr = _cfsml_get_current_refpointer(); -#line 834 "savegame.cfsml" +#line 835 "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 843 "savegame.cfsml" + const char *_cfsml_inp = _cfsml_get_identifier(fh, &(_cfsml_line_ctr), &_cfsml_eof, &dummy); -#line 847 "savegame.cfsml" +#line 848 "savegame.cfsml" _cfsml_error = _cfsml_read_state_t(fh, retval, _cfsml_inp, &(_cfsml_line_ctr), &_cfsml_eof); -#line 852 "savegame.cfsml" +#line 853 "savegame.cfsml" read_eof = _cfsml_error; -#line 856 "savegame.cfsml" +#line 857 "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; +#line 860 "savegame.cfsml" + if (_cfsml_last_value_retrieved) { + free(_cfsml_last_value_retrieved); + _cfsml_last_value_retrieved = NULL; } - if (_cfsml_last_identifier_retreived) { - free(_cfsml_last_identifier_retreived); - _cfsml_last_identifier_retreived = NULL; + if (_cfsml_last_identifier_retrieved) { + free(_cfsml_last_identifier_retrieved); + _cfsml_last_identifier_retrieved = NULL; } } /* End of auto-generated CFSML data reader code */ diff --git a/engines/sci/module.mk b/engines/sci/module.mk index 46e4c14a1b..c90f0011dd 100644 --- a/engines/sci/module.mk +++ b/engines/sci/module.mk @@ -96,7 +96,7 @@ CXXFLAGS += -Wno-variadic-macros CPPFLAGS += -DSCUMMVM # Generate savegame.cpp -$(srcdir)/engines/sci/engine/savegame.c: $(srcdir)/engines/sci/engine/savegame.cfsml +$(srcdir)/engines/sci/engine/savegame.cpp: $(srcdir)/engines/sci/engine/savegame.cfsml cat $< | perl $(srcdir)/engines/sci/engine/cfsml.pl -f savegame.cfsml > $@ # This module can be built as a plugin |