home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / slackwar / a / util / util-lin.2 / util-lin / util-linux-2.2 / mount / sundries.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-22  |  2.3 KB  |  91 lines

  1. /*
  2.  * Support function prototypes.  Functions are in sundries.c.
  3.  * sundries.h,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp
  4.  */
  5.  
  6. #include <sys/types.h>
  7. #include <sys/mount.h>
  8. #include <sys/stat.h>
  9. #include <stdio.h>
  10. #include <errno.h>
  11. #include <fcntl.h>
  12. #include <getopt.h>
  13. #include <limits.h>
  14. #include <mntent.h>
  15. #include <signal.h>
  16. #include <stdarg.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <unistd.h>
  20.  
  21. #include "fstab.h"
  22.  
  23.  
  24. #define streq(s, t)    (strcmp ((s), (t)) == 0)
  25.  
  26.  
  27. #define MOUNTED_LOCK    "/etc/mtab~"
  28. #define MOUNTED_TEMP    "/etc/mtab.tmp"
  29. #define _PATH_FSTAB    "/etc/fstab"
  30. #define LOCK_BUSY    3
  31.  
  32. /* File pointer for /etc/mtab.  */
  33. extern FILE *F_mtab;
  34.  
  35. /* File pointer for temp mtab.  */
  36. extern FILE *F_temp;
  37.  
  38. /* String list data structure.  */ 
  39. typedef struct string_list
  40. {
  41.   char *hd;
  42.   struct string_list *tl;
  43. } *string_list;
  44.  
  45. #define car(p) ((p) -> hd)
  46. #define cdr(p) ((p) -> tl)
  47.  
  48. string_list cons (char *a, const string_list);
  49.  
  50. /* Quiet compilation with -Wmissing-prototypes.  */
  51. int main (int argc, char *argv[]);
  52.  
  53. /* From mount_call.c.  */
  54. int mount5 (const char *, const char *, const char *, int, void *);
  55.  
  56. /* Functions in sundries.c that are used in mount.c and umount.c  */ 
  57. void block_signals (int how);
  58. char *canonicalize (const char *path);
  59. char *realpath (const char *path, char *resolved_path);
  60. void close_mtab (void);
  61. void error (const char *fmt, ...);
  62. void lock_mtab (void);
  63. int matching_type (const char *type, string_list types);
  64. void open_mtab (const char *mode);
  65. string_list parse_list (char *strings);
  66. void unlock_mtab (void);
  67. void update_mtab (const char *special, struct mntent *with);
  68. struct mntent *getmntfile (const char *file);
  69. void *xmalloc (size_t size);
  70. char *xstrdup (const char *s);
  71.  
  72. /* Here is some serious cruft.  */
  73. #ifdef __GNUC__
  74. #if defined(__GNUC_MINOR__) && __GNUC__ == 2 && __GNUC_MINOR__ >= 5
  75. void die (int errcode, const char *fmt, ...) __attribute__ ((noreturn));
  76. #else /* GNUC < 2.5 */
  77. void volatile die (int errcode, const char *fmt, ...);
  78. #endif /* GNUC < 2.5 */
  79. #else /* !__GNUC__ */
  80. void die (int errcode, const char *fmt, ...);
  81. #endif /* !__GNUC__ */
  82.  
  83. #ifdef HAVE_NFS
  84. int nfsmount (const char *spec, const char *node, int *flags,
  85.           char **orig_opts, char **opt_args);
  86. #endif
  87.  
  88. #define mount5(special, dir, type, flags, data) \
  89.   mount (special, dir, type, 0xC0ED0000 | (flags), data)
  90.  
  91.