1 #ifndef MTOOLS_DIRENTRY_H
2 #define MTOOLS_DIRENTRY_H
3 /* Copyright 1998,2000-2002,2005,2008,2009 Alain Knaff.
4 * This file is part of mtools.
6 * Mtools is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * Mtools is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Mtools. If not, see <http://www.gnu.org/licenses/>.
19 #include "sysincludes.h"
22 typedef struct direntry_t {
24 /* struct direntry_t *parent; parent level */
25 int entry; /* slot in parent directory (-3 if root) */
26 struct directory dir; /* descriptor in parent directory (random if
28 wchar_t name[MAX_VNAMELEN+1]; /* name in its parent directory, or
30 int beginSlot; /* begin and end slot, for delete */
36 int vfat_lookup(direntry_t *entry, const char *filename, int length,
37 int flags, char *shortname, char *longname);
39 struct directory *dir_read(direntry_t *entry, int *error);
41 void initializeDirentry(direntry_t *entry, struct Stream_t *Dir);
42 int isNotFound(direntry_t *entry);
43 direntry_t *getParent(direntry_t *entry);
44 void dir_write(direntry_t *entry);
45 void low_level_dir_write(direntry_t *entry);
46 int fatFreeWithDirentry(direntry_t *entry);
47 int labelit(struct dos_name_t *dosname,
51 int isSubdirOf(Stream_t *inside, Stream_t *outside);
52 char *getPwd(direntry_t *entry);
53 void fprintPwd(FILE *f, direntry_t *entry, int escape);
54 int write_vfat(Stream_t *, dos_name_t *, char *, int, direntry_t *);
56 void wipeEntry(struct direntry_t *entry);
58 void dosnameToDirentry(const struct dos_name_t *n, struct directory *dir);
60 int lookupForInsert(Stream_t *Dir,
62 struct dos_name_t *dosname,
64 struct scan_state *ssp,
67 int pessimisticShortRename,