15 #include "../fileio_type.h" 
   16 #include "../strings_type.h" 
   62 typedef void ChunkSaveLoadProc();
 
   63 typedef void AutolengthProc(
void *arg);
 
   96 #define SL_MAX_VERSION UINT16_MAX 
  134   SLE_VAR_I16   =  3 << 4,
 
  135   SLE_VAR_U16   =  4 << 4,
 
  136   SLE_VAR_I32   =  5 << 4,
 
  137   SLE_VAR_U32   =  6 << 4,
 
  138   SLE_VAR_I64   =  7 << 4,
 
  139   SLE_VAR_U64   =  8 << 4,
 
  149   SLE_VAR_CHAR = SLE_VAR_I8,
 
  154   SLE_BOOL         = SLE_FILE_I8  | SLE_VAR_BL,
 
  155   SLE_INT8         = SLE_FILE_I8  | SLE_VAR_I8,
 
  156   SLE_UINT8        = SLE_FILE_U8  | SLE_VAR_U8,
 
  157   SLE_INT16        = SLE_FILE_I16 | SLE_VAR_I16,
 
  158   SLE_UINT16       = SLE_FILE_U16 | SLE_VAR_U16,
 
  159   SLE_INT32        = SLE_FILE_I32 | SLE_VAR_I32,
 
  160   SLE_UINT32       = SLE_FILE_U32 | SLE_VAR_U32,
 
  161   SLE_INT64        = SLE_FILE_I64 | SLE_VAR_I64,
 
  162   SLE_UINT64       = SLE_FILE_U64 | SLE_VAR_U64,
 
  163   SLE_CHAR         = SLE_FILE_I8  | SLE_VAR_CHAR,
 
  172   SLE_UINT  = SLE_UINT32,
 
  174   SLE_STRB  = SLE_STRINGBUF,
 
  175   SLE_STRBQ = SLE_STRINGBQUOTE,
 
  177   SLE_STRQ  = SLE_STRINGQUOTE,
 
  189 typedef uint32 VarType;
 
  236 #define SLE_GENERAL(cmd, base, variable, type, length, from, to) {false, cmd, type, length, from, to, (void*)cpp_offsetof(base, variable), cpp_sizeof(base, variable)} 
  246 #define SLE_CONDVAR(base, variable, type, from, to) SLE_GENERAL(SL_VAR, base, variable, type, 0, from, to) 
  256 #define SLE_CONDREF(base, variable, type, from, to) SLE_GENERAL(SL_REF, base, variable, type, 0, from, to) 
  267 #define SLE_CONDARR(base, variable, type, length, from, to) SLE_GENERAL(SL_ARR, base, variable, type, length, from, to) 
  278 #define SLE_CONDSTR(base, variable, type, length, from, to) SLE_GENERAL(SL_STR, base, variable, type, length, from, to) 
  288 #define SLE_CONDLST(base, variable, type, from, to) SLE_GENERAL(SL_LST, base, variable, type, 0, from, to) 
  296 #define SLE_VAR(base, variable, type) SLE_CONDVAR(base, variable, type, 0, SL_MAX_VERSION) 
  304 #define SLE_REF(base, variable, type) SLE_CONDREF(base, variable, type, 0, SL_MAX_VERSION) 
  313 #define SLE_ARR(base, variable, type, length) SLE_CONDARR(base, variable, type, length, 0, SL_MAX_VERSION) 
  322 #define SLE_STR(base, variable, type, length) SLE_CONDSTR(base, variable, type, length, 0, SL_MAX_VERSION) 
  330 #define SLE_LST(base, variable, type) SLE_CONDLST(base, variable, type, 0, SL_MAX_VERSION) 
  336 #define SLE_NULL(length) SLE_CONDNULL(length, 0, SL_MAX_VERSION) 
  344 #define SLE_CONDNULL(length, from, to) SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL | SLF_NOT_IN_CONFIG, length, from, to) 
  347 #define SLE_WRITEBYTE(base, variable, value) SLE_GENERAL(SL_WRITEBYTE, base, variable, 0, 0, value, value) 
  349 #define SLE_VEH_INCLUDE() {false, SL_VEH_INCLUDE, 0, 0, 0, SL_MAX_VERSION, NULL, 0} 
  350 #define SLE_ST_INCLUDE() {false, SL_ST_INCLUDE, 0, 0, 0, SL_MAX_VERSION, NULL, 0} 
  353 #define SLE_END() {false, SL_END, 0, 0, 0, 0, NULL, 0} 
  364 #define SLEG_GENERAL(cmd, variable, type, length, from, to) {true, cmd, type, length, from, to, (void*)&variable, sizeof(variable)} 
  373 #define SLEG_CONDVAR(variable, type, from, to) SLEG_GENERAL(SL_VAR, variable, type, 0, from, to) 
  382 #define SLEG_CONDREF(variable, type, from, to) SLEG_GENERAL(SL_REF, variable, type, 0, from, to) 
  392 #define SLEG_CONDARR(variable, type, length, from, to) SLEG_GENERAL(SL_ARR, variable, type, length, from, to) 
  402 #define SLEG_CONDSTR(variable, type, length, from, to) SLEG_GENERAL(SL_STR, variable, type, length, from, to) 
  411 #define SLEG_CONDLST(variable, type, from, to) SLEG_GENERAL(SL_LST, variable, type, 0, from, to) 
  418 #define SLEG_VAR(variable, type) SLEG_CONDVAR(variable, type, 0, SL_MAX_VERSION) 
  425 #define SLEG_REF(variable, type) SLEG_CONDREF(variable, type, 0, SL_MAX_VERSION) 
  432 #define SLEG_ARR(variable, type) SLEG_CONDARR(variable, type, lengthof(variable), 0, SL_MAX_VERSION) 
  439 #define SLEG_STR(variable, type) SLEG_CONDSTR(variable, type, lengthof(variable), 0, SL_MAX_VERSION) 
  446 #define SLEG_LST(variable, type) SLEG_CONDLST(variable, type, 0, SL_MAX_VERSION) 
  454 #define SLEG_CONDNULL(length, from, to) {true, SL_ARR, SLE_FILE_U8 | SLE_VAR_NULL | SLF_NOT_IN_CONFIG, length, from, to, (void*)NULL} 
  457 #define SLEG_END() {true, SL_END, 0, 0, 0, 0, NULL, 0} 
  469   return _sl_version < major || (minor > 0 && _sl_version == major && _sl_minor_version < minor);
 
  482   if (SAVEGAME_VERSION < version_from || SAVEGAME_VERSION > version_to) 
return false;
 
  527   return const_cast<byte *
>((
const byte*)(sld->
global ? NULL : 
object) + (ptrdiff_t)sld->
address);
 
  530 int64 
ReadValue(
const void *ptr, VarType conv);
 
  531 void WriteValue(
void *ptr, VarType conv, int64 val);
 
  533 void SlSetArrayIndex(uint index);
 
  539 size_t SlCalcObjMemberLength(
const void *
object, 
const SaveLoad *sld);
 
  546 void SlArray(
void *array, 
size_t length, VarType conv);
 
  548 bool SlObjectMember(
void *
object, 
const SaveLoad *sld);