bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 1 | /* file.h - Additional file attributes |
| 2 | |
| 3 | Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch> |
| 4 | |
| 5 | This program is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by |
| 7 | the Free Software Foundation, either version 3 of the License, or |
| 8 | (at your option) any later version. |
| 9 | |
| 10 | This program is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | On Debian systems, the complete text of the GNU General Public License |
| 19 | can be found in /usr/share/common-licenses/GPL-3 file. |
| 20 | */ |
| 21 | |
| 22 | #ifndef _FILE_H |
| 23 | #define _FILE_H |
| 24 | |
| 25 | typedef enum { fdt_none, fdt_drop, fdt_undelete } FD_TYPE; |
| 26 | |
| 27 | typedef struct _fptr { |
| 28 | char name[MSDOS_NAME]; |
| 29 | FD_TYPE type; |
| 30 | struct _fptr *first; /* first entry */ |
| 31 | struct _fptr *next; /* next file in directory */ |
| 32 | } FDSC; |
| 33 | |
| 34 | extern FDSC *fp_root; |
| 35 | |
| 36 | char *file_name(unsigned char *fixed); |
| 37 | |
| 38 | /* Returns a pointer to a pretty-printed representation of a fixed MS-DOS file |
| 39 | name. */ |
| 40 | |
| 41 | int file_cvt(unsigned char *name, unsigned char *fixed); |
| 42 | |
| 43 | /* Converts a pretty-printed file name to the fixed MS-DOS format. Returns a |
| 44 | non-zero integer on success, zero on failure. */ |
| 45 | |
| 46 | void file_add(char *path, FD_TYPE type); |
| 47 | |
| 48 | /* Define special attributes for a path. TYPE can be either FDT_DROP or |
| 49 | FDT_UNDELETE. */ |
| 50 | |
| 51 | FDSC **file_cd(FDSC ** curr, char *fixed); |
| 52 | |
| 53 | /* Returns a pointer to the directory descriptor of the subdirectory FIXED of |
| 54 | CURR, or NULL if no such subdirectory exists. */ |
| 55 | |
| 56 | FD_TYPE file_type(FDSC ** curr, char *fixed); |
| 57 | |
| 58 | /* Returns the attribute of the file FIXED in directory CURR or FDT_NONE if no |
| 59 | such file exists or if CURR is NULL. */ |
| 60 | |
| 61 | void file_modify(FDSC ** curr, char *fixed); |
| 62 | |
| 63 | /* Performs the necessary operation on the entry of CURR that is named FIXED. */ |
| 64 | |
| 65 | void file_unused(void); |
| 66 | |
| 67 | /* Displays warnings for all unused file attributes. */ |
| 68 | |
| 69 | #endif |