Line | |
---|
1 | #ifndef MTOOLS_NAMECLASH_H
|
---|
2 | #define MTOOLS_NAMECLASH_H
|
---|
3 |
|
---|
4 | #include "stream.h"
|
---|
5 |
|
---|
6 | typedef enum clash_action {
|
---|
7 | NAMEMATCH_NONE,
|
---|
8 | NAMEMATCH_AUTORENAME,
|
---|
9 | NAMEMATCH_QUIT,
|
---|
10 | NAMEMATCH_SKIP,
|
---|
11 | NAMEMATCH_RENAME,
|
---|
12 | NAMEMATCH_PRENAME, /* renaming of primary name */
|
---|
13 | NAMEMATCH_OVERWRITE,
|
---|
14 | NAMEMATCH_ERROR,
|
---|
15 | NAMEMATCH_SUCCESS,
|
---|
16 | NAMEMATCH_GREW
|
---|
17 | } clash_action;
|
---|
18 |
|
---|
19 | /* clash handling structure */
|
---|
20 | typedef struct ClashHandling_t {
|
---|
21 | clash_action action[2];
|
---|
22 | clash_action namematch_default[2];
|
---|
23 |
|
---|
24 | int nowarn; /* Don't ask, just do default action if name collision*/
|
---|
25 | int got_slots;
|
---|
26 | int mod_time;
|
---|
27 | /* unsigned int dot; */
|
---|
28 | char *myname;
|
---|
29 | unsigned char *dosname;
|
---|
30 | int single;
|
---|
31 |
|
---|
32 | int use_longname;
|
---|
33 | int ignore_entry;
|
---|
34 | int source; /* to prevent the source from overwriting itself */
|
---|
35 | int source_entry; /* to account for the space freed up by the original
|
---|
36 | * name */
|
---|
37 | char * (*name_converter)(char *filename, int verbose,
|
---|
38 | int *mangled, char *ans);
|
---|
39 | } ClashHandling_t;
|
---|
40 |
|
---|
41 | /* write callback */
|
---|
42 | typedef int (write_data_callback)(char *,char *, void *, struct direntry_t *);
|
---|
43 |
|
---|
44 | int mwrite_one(Stream_t *Dir,
|
---|
45 | const char *argname,
|
---|
46 | const char *shortname,
|
---|
47 | write_data_callback *cb,
|
---|
48 | void *arg,
|
---|
49 | ClashHandling_t *ch);
|
---|
50 |
|
---|
51 | int handle_clash_options(ClashHandling_t *ch, char c);
|
---|
52 | void init_clash_handling(ClashHandling_t *ch);
|
---|
53 | Stream_t *createDir(Stream_t *Dir, const char *filename, ClashHandling_t *ch,
|
---|
54 | unsigned char attr, time_t mtime);
|
---|
55 |
|
---|
56 |
|
---|
57 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.