diff options
Diffstat (limited to 'src/wydawca.h')
-rw-r--r-- | src/wydawca.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/wydawca.h b/src/wydawca.h index 2307bad..94b7ee3 100644 --- a/src/wydawca.h +++ b/src/wydawca.h @@ -1,160 +1,174 @@ /* wydawca - automatic release submission daemon Copyright (C) 2007, 2008, 2009, 2010 Sergey Poznyakoff This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include <syslog.h> #include <getopt.h> #include <errno.h> #include <string.h> #include <ctype.h> #include <pwd.h> #include <grp.h> #include <signal.h> #include <limits.h> #include <dirent.h> #include <sys/stat.h> #include <sys/socket.h> #include <netinet/in.h> #include <sys/un.h> #include <sys/wait.h> #include <netdb.h> #include <arpa/inet.h> #include <fcntl.h> #include <time.h> #include <sysexits.h> +#include <fnmatch.h> +#include <regex.h> #include <mailutils/types.h> #include <mailutils/url.h> #include <mailutils/errno.h> -#include "error.h" -#include "xalloc.h" -#include "backupfile.h" #include "grecs.h" #include "wordsplit.h" #define SP(s) ((s) ? (s) : "NONE") #define WYDAWCA_EX_AGAIN 1 /* The range of directive versions we accept (major * 100 + minor) */ #define MIN_DIRECTIVE_VERSION 101 #define MAX_DIRECTIVE_VERSION 101 /* Default modes for mkdir and creat commands: rely on the umask value */ #define MKDIR_PERMISSIONS 0777 #define CREAT_PERMISSIONS 0666 #define SUF_SIG ".sig" #define SUF_SIG_LEN (sizeof (SUF_SIG) - 1) #define SUF_DIR ".directive.asc" #define SUF_DIR_LEN (sizeof (SUF_DIR) - 1) #define __cat2__(a,b) a ## b #define __cat3__(a,b,c) a ## b ## c #define NITEMS(a) (sizeof(a)/sizeof((a)[0])) enum dictionary_id { project_uploader_dict, /* Contains names, gpg-keys, emails and real names of the project uploaders */ project_owner_dict, /* Contains names and emails of the project owners */ dictionary_count }; enum dictionary_type { dictionary_none, /* Undefined or no dictionary */ dictionary_sql, /* Use SQL database */ dictionary_builtin, /* Use built-in facilities */ dictionary_external /* Invoke an external program */ }; struct dictionary { enum dictionary_id id; enum dictionary_type type; /* Dictionary type */ char *query; /* Query template */ int parmc; /* Number of entries in paramv */ char **parmv; /* Parameters. The semantics differs depending on type. For SQL: 0 - Identifier of the SQL struct to use; */ int init_passed; /* Initialization count */ char *result; /* Result storage */ size_t result_size; /* Size of result */ unsigned ncol; /* Number of columns per row */ unsigned nrow; /* Number of rows */ void *storage; }; +enum backup_type + { + no_backups, /* Don't make backups */ + simple_backups, /* Make only simple backups */ + numbered_existing_backups,/* Make numbered backups for files that already + have such backups and simple backups for the + rest */ + numbered_backups, /* Make only numbered backups */ + }; + +extern char const *simple_backup_suffix; + +char *find_backup_file_name (char const *, enum backup_type); + + /* Archive types */ enum archive_type { archive_none, /* No archivation requested */ archive_directory, /* Archive by moving files to a separate directory hierarchy */ archive_tar /* Archive by appending to a tar file (tar -r) */ }; struct archive_descr { enum archive_type type; /* Archivation type */ char *name; /* Directory name if type==archive_directory, archive file name if type==archive_tar */ enum backup_type backup_type; /* Requested backup type if type == archive_directory */ }; /* Type of file in a triplet */ enum file_type { file_dist, /* Something to be distributed */ file_signature, /* Detached signature (.sig) */ file_directive, /* Directive (.directive.asc) */ }; #define FILE_TYPE_COUNT (file_directive+1) /* Part of a triplet */ struct file_info { enum file_type type; /* Part type */ char *name; /* File name */ unsigned root_len; /* Length of root part in name */ struct stat sb; }; struct uploader_info { struct uploader_info *next; char *name; char *realname; char *email; char *gpg_key; char *fpr; }; |