file.h 2.2 KB

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