1 #ifndef MTOOLS_NAMECLASH_H
2 #define MTOOLS_NAMECLASH_H
4 /* Copyright 1996-1998,2000-2002,2008,2009 Alain Knaff.
5 * This file is part of mtools.
7 * Mtools is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * Mtools is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Mtools. If not, see <http://www.gnu.org/licenses/>.
23 typedef enum clash_action {
29 NAMEMATCH_PRENAME, /* renaming of primary name */
36 /* clash handling structure */
37 typedef struct ClashHandling_t {
38 clash_action action[2];
39 clash_action namematch_default[2];
41 int nowarn; /* Don't ask, just do default action if name collision*/
44 /* unsigned int dot; */
46 unsigned char *dosname;
51 int source; /* to prevent the source from overwriting itself */
52 int source_entry; /* to account for the space freed up by the original
54 void (*name_converter)(doscp_t *cp,
55 const char *filename, int verbose,
56 int *mangled, dos_name_t *ans);
60 typedef int (write_data_callback)(dos_name_t *,char *, void *, struct direntry_t *);
62 int mwrite_one(Stream_t *Dir,
64 const char *shortname,
65 write_data_callback *cb,
69 int handle_clash_options(ClashHandling_t *ch, char c);
70 void init_clash_handling(ClashHandling_t *ch);
71 Stream_t *createDir(Stream_t *Dir, const char *filename, ClashHandling_t *ch,
72 unsigned char attr, time_t mtime);