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. 5 * 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. 10 * 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. 15 * 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/>. 18 */ 19#include "sysincludes.h" 20#include "vfat.h" 21 22typedef struct direntry_t { 23 struct Stream_t *Dir; 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 27 * root)*/ 28 wchar_t name[MAX_VNAMELEN+1]; /* name in its parent directory, or 29 * NULL if root */ 30 int beginSlot; /* begin and end slot, for delete */ 31 int endSlot; 32} direntry_t; 33 34#include "stream.h" 35 36int vfat_lookup(direntry_t *entry, const char *filename, int length, 37 int flags, char *shortname, char *longname); 38 39struct directory *dir_read(direntry_t *entry, int *error); 40 41void initializeDirentry(direntry_t *entry, struct Stream_t *Dir); 42int isNotFound(direntry_t *entry); 43direntry_t *getParent(direntry_t *entry); 44void dir_write(direntry_t *entry); 45void low_level_dir_write(direntry_t *entry); 46int fatFreeWithDirentry(direntry_t *entry); 47int labelit(struct dos_name_t *dosname, 48 char *longname, 49 void *arg0, 50 direntry_t *entry); 51int isSubdirOf(Stream_t *inside, Stream_t *outside); 52char *getPwd(direntry_t *entry); 53void fprintPwd(FILE *f, direntry_t *entry, int escape); 54int write_vfat(Stream_t *, dos_name_t *, char *, int, direntry_t *); 55 56void wipeEntry(struct direntry_t *entry); 57 58void dosnameToDirentry(const struct dos_name_t *n, struct directory *dir); 59 60int lookupForInsert(Stream_t *Dir, 61 direntry_t *direntry, 62 struct dos_name_t *dosname, 63 char *longname, 64 struct scan_state *ssp, 65 int ignore_entry, 66 int source_entry, 67 int pessimisticShortRename, 68 int use_longname); 69#endif 70