blob: eaaf356be95122e7bd761beefdf97c8417d22842 [file] [log] [blame]
bigbiff bigbiff9c754052013-01-09 09:09:08 -05001/* file.h - Additional file attributes
2
3 Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
Matt Mower18794c82015-11-11 16:22:45 -06004 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
bigbiff bigbiff9c754052013-01-09 09:09:08 -05005
6 This program 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 This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
18
Matt Mower18794c82015-11-11 16:22:45 -060019 The complete text of the GNU General Public License
bigbiff bigbiff9c754052013-01-09 09:09:08 -050020 can be found in /usr/share/common-licenses/GPL-3 file.
21*/
22
23#ifndef _FILE_H
24#define _FILE_H
25
Matt Mower18794c82015-11-11 16:22:45 -060026#include "msdos_fs.h"
27
bigbiff bigbiff9c754052013-01-09 09:09:08 -050028typedef enum { fdt_none, fdt_drop, fdt_undelete } FD_TYPE;
29
30typedef struct _fptr {
31 char name[MSDOS_NAME];
32 FD_TYPE type;
33 struct _fptr *first; /* first entry */
34 struct _fptr *next; /* next file in directory */
35} FDSC;
36
37extern FDSC *fp_root;
38
39char *file_name(unsigned char *fixed);
40
41/* Returns a pointer to a pretty-printed representation of a fixed MS-DOS file
42 name. */
43
44int file_cvt(unsigned char *name, unsigned char *fixed);
45
46/* Converts a pretty-printed file name to the fixed MS-DOS format. Returns a
47 non-zero integer on success, zero on failure. */
48
49void file_add(char *path, FD_TYPE type);
50
51/* Define special attributes for a path. TYPE can be either FDT_DROP or
52 FDT_UNDELETE. */
53
54FDSC **file_cd(FDSC ** curr, char *fixed);
55
56/* Returns a pointer to the directory descriptor of the subdirectory FIXED of
57 CURR, or NULL if no such subdirectory exists. */
58
59FD_TYPE file_type(FDSC ** curr, char *fixed);
60
61/* Returns the attribute of the file FIXED in directory CURR or FDT_NONE if no
62 such file exists or if CURR is NULL. */
63
64void file_modify(FDSC ** curr, char *fixed);
65
66/* Performs the necessary operation on the entry of CURR that is named FIXED. */
67
68void file_unused(void);
69
70/* Displays warnings for all unused file attributes. */
71
72#endif