Logo Search packages:      
Sourcecode: hdup version File versions  Download package

hdup.h

/* hdup header file
 *
 * Author: Miek Gieben
 * Date: Wed, 27 feb, 2002
 */

#include<stdio.h>
#include<stdlib.h>
#include<stdarg.h>
#include<unistd.h>
#include<string.h>
/* included to fix Solaris compile warning */
#include<strings.h>

#include<ctype.h>
#include<pwd.h>
#include<time.h>
#include<glob.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<sys/wait.h>

#define PROGNAME    "hdup"
#define VERSION     "1.6.0"
#define TAR         "/bin/tar"
#define MCRYPT      "/usr/bin/mcrypt"
#define MDECRYPT    "/usr/bin/mdecrypt"
#define FIND        "/usr/bin/find"
#define TOUCH         "##TOUCH##"
#define ETCFILE     "/etc/hdup/hdup.conf"
#define DEFAULT_PROTO "/usr/bin/scp"
#define FILELIST    "/filelist"
#define EXCLUDELIST "/excludelist"
#define MUTE        " > /dev/null 2>&1"
#define SPARSE        " --sparse "
#define DATE_DEF    0
#define DATE_ISO    1
#define DATE_US     2
#define DEF_USER    "operator"

#define LOG(arg)  hdup_log arg
#define LOG_(arg) hdup_log_nn arg
#define LOGL(arg) hdup_log_long_nn arg
#define FATAL(arg)      hdup_fatal arg

/* fix warning on Cygwin */
#ifndef MAXPATHLEN 
#define MAXPATHLEN 256
#endif /* not MAXPATHLEN*/

#define OVERVIEW   50
#define MAXDIR     20
#define MAXHOST    10
#define DOTEND     13

#define TAR_NONE   "cpf"
#define TAR_GZIP   "cpfz"
#define TAR_BZIP   "cpfj"

#define DAILY   0
#define WEEKLY  1
#define MONTHLY 2
#define REMOTE  3
#define RESTORE 4

#define LOCK    0
#define UNLOCK  1

#define GIGABYTE 1073741824
#define MEGABYTE 1048576
#define KILOBYTE 1024
#define SECDAY   86400

#define PREV       -1
#define NEXT       1
#define MAXRESTORE 100
#define NONE       0
#define NONE_EXT   ".tar"
#define GZIP       1
#define GZIP_EXT   ".tar.gz"
#define BZIP       2
#define BZIP_EXT   ".tar.bz2"
#define CRYPT      4
#define MCRYPT_EXT ".nc"

/* the number of keywords */
#define KEYWORDS    18
/* the keywords are defined in hdupconf.c  */
#define KEY_BACKUP    0
#define KEY_EXCLUDE   1
#define KEY_REMOTE    2
#define KEY_PROTO_OPT 3
#define KEY_USER      4
#define KEY_COMP      5
#define KEY_PRE       6
#define KEY_POST      7
#define KEY_PROTO     8
#define KEY_INCLUDE   9
#define KEY_DATESPEC  10
#define KEY_ALG         11
#define KEY_KEYFILE   12
#define KEY_REMOVE    13
#define KEY_OVERWRITE 14
#define KEY_SKIP      15
#define KEY_FORCE     16
#define KEY_SPARSE    17

/* holds the %-vars (%h,%a,%s,%e,%u) -1 */
#define SUBS    4

00111 struct option_t {
        char *configpath;
      int specific;
};

00116 struct argument_t {
        int scheme;
        char *host;
        char *date;
        char *extractdir;
        char *extractfile;
};

/* hold all the info about a specific host */
00125 struct host {
        char *name;
        char *path[MAXDIR];
        char *exclude[MAXDIR]; /* holds the exclude globbing! patterns */
      char *include[MAXDIR]; /* holds the include regexp!  patterns */
        char *user;
        char *keypath;
        char *alg;
        char *configpath;
        char *remote_path;
        char *compression;  
        char *date;
      char *datespec;
        char *basename;
        char *dirname_date;
        char *dirname_etc;
        char *filelist;
        char *excludelist;
        char *inclist;
        char *archivename;
        char *prerun;
        char *postrun;
        /* define own options for each proto */
      char *proto;
        char *proto_opt;
        char *remote;
      /* folded in the option from hdup-1.5 */
        int remove;
      int overwrite;
        int skip;
        int force;
      int sparse;
};

extern unsigned int quiet;
extern char *progname;
extern char *scheme[];
extern char *keyword[];
extern char *subvar[];
extern char *dots;
extern char *spaces;
typedef struct host host_t;
typedef struct host * phost_t;

Generated by  Doxygen 1.6.0   Back to index