Skip to content
Snippets Groups Projects
Select Git revision
  • 22aaec41b283dd9cb6d3b9b05f346e6ec14f44ff
  • master default
  • dbck-q-n-d-link
  • foutput-text_stat-override
  • generations
  • text-stat-sha256
  • use-nettle
  • import-nettle
  • refactor-cached_get_text
  • refactor-cached_get_text-part-2
  • add-text_store
  • introduce-generation_position
  • remove-reclamation
  • dbfile-temp-filenames
  • sstrdup
  • dbfile_open_read-check-magic
  • adns_dist
  • liboop_dist
  • search
  • isc
  • dbdbckmultiplechoice
  • last.cvs.revision
  • 2.1.2
  • 2.1.1
  • 2.1.0
  • adns_1_0
  • liboop_0_9
  • 2.0.7
  • search_bp
  • 2.0.6
  • 2.0.5
  • isc_1_01
  • Protocol-A-10.4
  • 2.0.4
  • 2.0.3
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • isc_1_00
  • isc_merge_1999_05_01
  • isc_merge_1999_04_21
41 results

dbck.c

Blame
  • dbck.c 24.38 KiB
    /*
     * dbck.c - A simple database checker and corrector.
     *
     * Author: Per Cederqvist.
     */
    
    #include <stdarg.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    #include <kom-types.h>
    #include <config.h>
    #include "cache.h"
    #include "log.h"
    #include "lyskomd.h"
    #include "misc-parser.h"
    #include "smalloc.h"
    #include <debug.h>
    #include "dbck-cache.h"
    
    char datafilename[1024];   /* Full pathname to the database file */
    char backupfilename[1024]; /* Full pathname to the backup file */
    char textfilename[1024];
    char textbackupfilename[1024]; /* unshrinked text-file. */
    static const char *dbase_dir = NULL;     /* Directory where database resides */
    
    #define TEXTBACKUPFILE_NAME "db/backup-texts"
    
    int vflag=0;			/* Verbose - list statistics also. */
    int iflag=0;			/* Interactive - prompt user and repair. */
    int rflag=0;			/* Repair simple error without confirmation. */
    int gflag=0;			/* Garbage collect text-file. */
    	
    int modifications = 0;
    
    typedef struct {
        int	created_confs;
    } Person_scratchpad;
    
    static const Person_scratchpad   EMPTY_PERSON_SCRATCHPAD = { 0 };
    
    #include "limits.h"
    
    static Person_scratchpad *person_scratchpad[MAX_CONF];
    
    #ifdef DEBUG
    int	buglevel = 0;
    #endif
    
    extern void
    log (const char * format, ...)
    {
        va_list AP;
    
        va_start(AP, format);
    
        vfprintf(stdout, format, AP);
    
        va_end(AP);
    }
    
    extern void
    restart_kom (const char * format, ...)
    {
        va_list AP;
    
        va_start(AP, format);
    
        vfprintf(stdout, format, AP);