xref: /plan9/sys/src/ape/cmd/patch/backupfile.h (revision 0b459c2cb92b7c9d88818e9a2f72e678e5bc4553)
1 /* backupfile.h -- declarations for making Emacs style backup file names
2    Copyright (C) 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2, or (at your option)
7    any later version.
8 
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License
15    along with this program; see the file COPYING.
16    If not, write to the Free Software Foundation,
17    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18 
19 /* When to make backup files. */
20 enum backup_type
21 {
22   /* Never make backups. */
23   none,
24 
25   /* Make simple backups of every file. */
26   simple,
27 
28   /* Make numbered backups of files that already have numbered backups,
29      and simple backups of the others. */
30   numbered_existing,
31 
32   /* Make numbered backups of every file. */
33   numbered
34 };
35 
36 extern enum backup_type backup_type;
37 extern char const *simple_backup_suffix;
38 
39 #ifndef __BACKUPFILE_P
40 # if defined __STDC__ || __GNUC__
41 #  define __BACKUPFILE_P(args) args
42 # else
43 #  define __BACKUPFILE_P(args) ()
44 # endif
45 #endif
46 
47 char *base_name __BACKUPFILE_P ((char const *));
48 char *find_backup_file_name __BACKUPFILE_P ((char const *));
49 enum backup_type get_version __BACKUPFILE_P ((char const *));
50 void addext __BACKUPFILE_P ((char *, char const *, int));
51