• Per Cederqvist's avatar
    Introduce datafile format version 3. A textstat contains · c1ef8d5b
    Per Cederqvist authored
    "generation" and "reclamation" fields.
    * src/include/kom-types.h (Text_stat): Added fields generation
    and reclamation.
    * src/server/simple-cache.c (cached_get_text): Handle text file
    generation 0 in the old-fashioned way.  Added a #warning about
    other generations.  Check return value of fseek.
    (cached_create_text): Added a #warning about nonzero generations
    of the text file.
    (cached_create_text): Initialize generation and reclamation.
    (save_one_conf): Do a file copy only if the formats of file A and
    B are the same.  Otherwise, parse the object into a temporary
    object and re-serialize it.
    (save_one_pers): Ditto.
    (save_one_text): Ditto.
    (init_cache): Handle data file format 3.
    * src/server/ram-parse.c (fparse_text_stat_3): New static function.
    (fparse_text_stat_2): Set generation and reclamation to 0.
    (fparse_text_stat_0): Ditto.
    (fparse_info): Handle data file format 3.
    (fparse_conference): Ditto.
    (fparse_person): Ditto.
    (fparse_membership): Ditto.
    (fparse_membership_list): Ditto.
    (fparse_text_stat): Ditto.
    (fparse_member): Ditto.
    * src/server/ram-output.c (foutput_info): Handle data file format 3.
    (foutput_text_stat_3): New static function.
    (foutput_person): Ditto.
    (foutput_conference): Ditto.
    (foutput_text_stat): Ditto.
    (foutput_membership): Ditto.
    (foutput_membership_list): Ditto.
    (foutput_member): Ditto.
    (foutput_conf_type): Ditto.
    * src/server/ram-io.c (output_format): Initialize it to 3.
    (dbfile_open_read): Handle data file format 3.
    * src/server/memory.c (copy_text_stat): Handle generation and
    reclamation.
    (init_text_stat): Initialize generation and reclamation.
    * src/server/membership.c (read_ranges_postcondition): Use data
    file format 3 when dumping a membership to stderr.
    * src/server/dbck.c (main): Handle data file format 3.
    * src/server/dbck-cache.c (cached_get_text): Handle text file
    generation 0 in the old-fashioned way.  Added a #warning about
    other generations.
    (cached_flush_text): Flush a generation 0 text file.  Added a
    #warning about other generations.
    (sync_output_header): Handle data file format 3.
    (cache_sync_all): Ditto.
    (init_cache): Ditto.
    * src/server/testsuite/test-l2g.c (main): Use data
    file format 3 when reading an Local2Global structure from stdin,
    or writing it to stdout.
    c1ef8d5b
simple-cache.c 69.5 KB