home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.sbin / amd / fsinfo / fsinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-12  |  5.1 KB  |  160 lines

  1. /*
  2.  * Copyright (c) 1989 Jan-Simon Pendry
  3.  * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  4.  * Copyright (c) 1989 The Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * This code is derived from software contributed to Berkeley by
  8.  * Jan-Simon Pendry at Imperial College, London.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  * 3. All advertising materials mentioning features or use of this software
  19.  *    must display the following acknowledgement:
  20.  *    This product includes software developed by the University of
  21.  *    California, Berkeley and its contributors.
  22.  * 4. Neither the name of the University nor the names of its contributors
  23.  *    may be used to endorse or promote products derived from this software
  24.  *    without specific prior written permission.
  25.  *
  26.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  27.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  30.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  32.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  33.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  34.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  35.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  36.  * SUCH DAMAGE.
  37.  *
  38.  *    @(#)fsinfo.h    5.3 (Berkeley) 5/12/91
  39.  *
  40.  * $Id: fsinfo.h,v 5.2.1.5 91/05/07 22:19:15 jsp Alpha $
  41.  *
  42.  */
  43.  
  44. /*
  45.  * Get this in now so that OS_HDR can use it
  46.  */
  47. #ifdef __STDC__
  48. #define    P(x) x
  49. #define    P_void void
  50. #define Const const
  51. #else
  52. #define P(x) ()
  53. #define P_void /* as nothing */
  54. #define Const /* as nothing */
  55. #endif /* __STDC__ */
  56.  
  57. #ifdef __GNUC__
  58. #define INLINE /* __inline */
  59. #else
  60. #define    INLINE
  61. #endif /* __GNUC__ */
  62.  
  63. /*
  64.  * Pick up target dependent definitions
  65.  */
  66. #include "os-defaults.h"
  67. #include OS_HDR
  68.  
  69. #ifdef VOIDP
  70. typedef void *voidp;
  71. #else
  72. typedef char *voidp;
  73. #endif /* VOIDP */
  74.  
  75. #include <stdio.h>
  76. #include <sys/types.h>
  77. #include <sys/param.h>
  78.  
  79. /*
  80.  * Bogosity to deal with ether { ... }
  81.  */
  82. #include <sys/socket.h>
  83. #include <netinet/in.h>
  84. #include <net/if.h>
  85. #include <netinet/if_ether.h>
  86.  
  87. #include "fsi_data.h"
  88.  
  89. extern char* strchr P((Const char*, int)); /* C */
  90. extern char* strrchr P((Const char*, int)); /* C */
  91. extern char *strdup P((char*)); /* C */
  92. extern void fatal();
  93. extern void warning();
  94. extern void error();
  95. extern void analyze_automounts P((qelem*));
  96. extern void analyze_hosts P((qelem*));
  97. extern void compute_automount_point P((char*, host*, char*));
  98. extern automount *new_automount P((char*));
  99. extern auto_tree *new_auto_tree P((char*, qelem*));
  100. extern host *new_host P((void));
  101. extern disk_fs *new_disk_fs P((void));
  102. extern void set_disk_fs P((disk_fs*, int, char*));
  103. extern ether_if *new_ether_if P((void));
  104. extern mount *new_mount P((void));
  105. extern void set_mount P((mount*, int, char*));
  106. extern fsmount *new_fsmount P((void));
  107. extern void set_fsmount P((fsmount*, int, char*));
  108. extern qelem *new_que P((void));
  109. extern void init_que P((qelem*));
  110. extern void ins_que P((qelem*, qelem*));
  111. extern void rem_que P((qelem*));
  112. extern dict *new_dict P((void));
  113. extern dict_ent *dict_locate P((dict*, char*));
  114. extern void dict_add P((dict*, char*, char*));
  115. extern int dict_iter P((dict*, int (*)()));
  116. extern void info_hdr();
  117. extern void gen_hdr();
  118. extern FILE *pref_open();
  119. extern int pref_close();
  120. extern ioloc *current_location();
  121.  
  122. extern char *disk_fs_strings[];
  123. extern char *mount_strings[];
  124. extern char *fsmount_strings[];
  125. extern char *host_strings[];
  126. extern char *ether_if_strings[];
  127. extern char *autodir;
  128. extern char *progname;
  129. extern char hostname[];
  130. extern char *username;
  131. extern char **g_argv;
  132. extern char *fstab_pref;
  133. extern char *exportfs_pref;
  134. extern char *mount_pref;
  135. extern char *dumpset_pref;
  136. extern char *bootparams_pref;
  137. extern char idvbuf[];
  138.  
  139. extern int file_io_errors;
  140. extern int parse_errors;
  141. extern int errors;
  142. extern int verbose;
  143.  
  144. extern dict *dict_of_hosts;
  145. extern dict *dict_of_volnames;
  146.  
  147. extern char *xcalloc();
  148. extern char *xmalloc();
  149. #define    ALLOC(x)    ((struct x *) xcalloc(1, sizeof(struct x)))
  150. #define    STREQ(s,t)    (*(s) == *(t) && strcmp((s)+1,(t)+1) == 0)
  151. #define    ISSET(m,b)    ((m) & (1<<(b)))
  152. #define    BITSET(m,b)    ((m) |= (1<<(b)))
  153.  
  154. #define    FIRST(ty, q)    ((ty *) ((q)->q_forw))
  155. #define    LAST(ty, q)    ((ty *) ((q)->q_back))
  156. #define    NEXT(ty, q)    ((ty *) (((qelem *) q)->q_forw))
  157. #define    HEAD(ty, q)    ((ty *) q)
  158. #define    ITER(v, ty, q) \
  159.     for ((v) = FIRST(ty,(q)); (v) != HEAD(ty,(q)); (v) = NEXT(ty,(v)))
  160.