Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gnulib-local / lib / backupfile.h
1 /* backupfile.h -- declarations for making Emacs style backup file names
2    Copyright (C) 1990-1992, 1997-1999, 2001-2003, 2015 Free Software
3    Foundation, Inc.
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17
18 #ifndef BACKUPFILE_H_
19 # define BACKUPFILE_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25
26 /* When to make backup files. */
27 enum backup_type
28 {
29   /* Never make backups. */
30   none,
31
32   /* Make simple backups of every file. */
33   simple,
34
35   /* Make numbered backups of files that already have numbered backups,
36      and simple backups of the others. */
37   numbered_existing,
38
39   /* Make numbered backups of every file. */
40   numbered
41 };
42
43 # define VALID_BACKUP_TYPE(Type)        \
44   ((Type) == none                       \
45    || (Type) == simple                  \
46    || (Type) == numbered_existing       \
47    || (Type) == numbered)
48
49 extern DLL_VARIABLE char const *simple_backup_suffix;
50
51 extern char *find_backup_file_name (char const *file,
52                                     enum backup_type backup_type);
53 extern enum backup_type get_version (char const *context, char const *arg);
54 extern enum backup_type xget_version (char const *context, char const *arg);
55 extern void addext (char *filename, char const *ext, char e);
56
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif /* ! BACKUPFILE_H_ */