Home | History | Annotate | Line # | Download | only in fsinfo
      1      1.1  christos /*	$NetBSD: fsinfo.h,v 1.1.1.3 2015/01/17 16:34:17 christos Exp $	*/
      2      1.1  christos 
      3      1.1  christos /*
      4  1.1.1.3  christos  * Copyright (c) 1997-2014 Erez Zadok
      5      1.1  christos  * Copyright (c) 1989 Jan-Simon Pendry
      6      1.1  christos  * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
      7      1.1  christos  * Copyright (c) 1989 The Regents of the University of California.
      8      1.1  christos  * All rights reserved.
      9      1.1  christos  *
     10      1.1  christos  * This code is derived from software contributed to Berkeley by
     11      1.1  christos  * Jan-Simon Pendry at Imperial College, London.
     12      1.1  christos  *
     13      1.1  christos  * Redistribution and use in source and binary forms, with or without
     14      1.1  christos  * modification, are permitted provided that the following conditions
     15      1.1  christos  * are met:
     16      1.1  christos  * 1. Redistributions of source code must retain the above copyright
     17      1.1  christos  *    notice, this list of conditions and the following disclaimer.
     18      1.1  christos  * 2. Redistributions in binary form must reproduce the above copyright
     19      1.1  christos  *    notice, this list of conditions and the following disclaimer in the
     20      1.1  christos  *    documentation and/or other materials provided with the distribution.
     21  1.1.1.3  christos  * 3. Neither the name of the University nor the names of its contributors
     22      1.1  christos  *    may be used to endorse or promote products derived from this software
     23      1.1  christos  *    without specific prior written permission.
     24      1.1  christos  *
     25      1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     26      1.1  christos  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     27      1.1  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     28      1.1  christos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     29      1.1  christos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     30      1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     31      1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     32      1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     33      1.1  christos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     34      1.1  christos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     35      1.1  christos  * SUCH DAMAGE.
     36      1.1  christos  *
     37      1.1  christos  *
     38      1.1  christos  * File: am-utils/fsinfo/fsinfo.h
     39      1.1  christos  *
     40      1.1  christos  */
     41      1.1  christos 
     42      1.1  christos extern FILE *pref_open(char *pref, char *hn, void (*hdr) (FILE *, char *), char *arg);
     43      1.1  christos extern auto_tree *new_auto_tree(char *, qelem *);
     44      1.1  christos extern automount *new_automount(char *);
     45      1.1  christos extern char **g_argv;
     46      1.1  christos extern char *autodir;
     47      1.1  christos extern char *bootparams_pref;
     48      1.1  christos extern char *disk_fs_strings[];
     49      1.1  christos extern char *dumpset_pref;
     50      1.1  christos extern char *ether_if_strings[];
     51      1.1  christos extern char *exportfs_pref;
     52      1.1  christos extern char *fsmount_strings[];
     53      1.1  christos extern char *fstab_pref;
     54      1.1  christos extern char *host_strings[];
     55      1.1  christos extern char *mount_pref;
     56      1.1  christos extern char *mount_strings[];
     57      1.1  christos extern char *progname;
     58      1.1  christos extern char *username;
     59      1.1  christos extern char *xcalloc(int, int);
     60      1.1  christos extern char hostname[];
     61      1.1  christos extern char idvbuf[];
     62      1.1  christos extern dict *dict_of_hosts;
     63      1.1  christos extern dict *dict_of_volnames;
     64      1.1  christos extern dict *new_dict(void);
     65      1.1  christos extern dict_ent *dict_locate(dict *, char *);
     66      1.1  christos extern disk_fs *new_disk_fs(void);
     67      1.1  christos extern ether_if *new_ether_if(void);
     68      1.1  christos extern fsmount *new_fsmount(void);
     69      1.1  christos extern host *new_host(void);
     70      1.1  christos extern int dict_iter(dict *, int (*)(qelem *));
     71      1.1  christos extern int errors;
     72      1.1  christos extern int file_io_errors;
     73      1.1  christos extern int parse_errors;
     74      1.1  christos extern int pref_close(FILE *fp);
     75      1.1  christos extern int verbose;
     76      1.1  christos extern ioloc *current_location(void);
     77      1.1  christos extern fsi_mount *new_mount(void);
     78      1.1  christos extern qelem *new_que(void);
     79      1.1  christos extern void analyze_automounts(qelem *);
     80      1.1  christos extern void analyze_hosts(qelem *);
     81      1.1  christos extern void compute_automount_point(char *, size_t, host *, char *);
     82      1.1  christos extern void dict_add(dict *, char *, char *);
     83      1.1  christos extern void error(char *fmt, ...)
     84      1.1  christos 	__attribute__((__format__(__printf__, 1, 2)));
     85      1.1  christos extern void fatal(char *fmt, ...)
     86      1.1  christos 	__attribute__((__format__(__printf__, 1, 2)));
     87      1.1  christos extern void gen_hdr(FILE *ef, char *hn);
     88      1.1  christos extern void info_hdr(FILE *ef, char *info);
     89      1.1  christos extern void init_que(qelem *);
     90      1.1  christos extern void ins_que(qelem *, qelem *);
     91      1.1  christos extern void lerror(ioloc *l, char *fmt, ...)
     92      1.1  christos 	__attribute__((__format__(__printf__, 2, 3)));
     93      1.1  christos extern void fsi_log(char *fmt, ...)
     94      1.1  christos 	__attribute__((__format__(__printf__, 1, 2)));
     95      1.1  christos extern void lwarning(ioloc *l, char *fmt, ...)
     96      1.1  christos 	__attribute__((__format__(__printf__, 2, 3)));
     97      1.1  christos extern void rem_que(qelem *);
     98      1.1  christos extern void set_disk_fs(disk_fs *, int, char *);
     99      1.1  christos extern void set_fsmount(fsmount *, int, char *);
    100      1.1  christos extern void set_mount(fsi_mount *, int, char *);
    101      1.1  christos extern void show_area_being_processed(char *area, int n);
    102      1.1  christos extern void show_new(char *msg);
    103      1.1  christos extern void warning(void);
    104      1.1  christos 
    105  1.1.1.3  christos extern int fsi_error(const char *fmt, ...)
    106      1.1  christos 	__attribute__((__format__(__printf__, 1, 2)));
    107      1.1  christos extern void domain_strip(char *otherdom, char *localdom);
    108      1.1  christos /*
    109      1.1  christos  * some systems such as DU-4.x have a different GNU flex in /usr/bin
    110      1.1  christos  * which automatically generates yywrap macros and symbols.  So I must
    111      1.1  christos  * distinguish between them and when yywrap is actually needed.
    112      1.1  christos  */
    113      1.1  christos #ifndef yywrap
    114      1.1  christos extern int yywrap(void);
    115      1.1  christos #endif /* not yywrap */
    116  1.1.1.3  christos extern int fsi_parse(void);
    117      1.1  christos extern int write_atab(qelem *q);
    118      1.1  christos extern int write_bootparams(qelem *q);
    119      1.1  christos extern int write_dumpset(qelem *q);
    120      1.1  christos extern int write_exportfs(qelem *q);
    121      1.1  christos extern int write_fstab(qelem *q);
    122      1.1  christos extern void col_cleanup(int eoj);
    123      1.1  christos extern void set_host(host *hp, int k, char *v);
    124      1.1  christos extern void set_ether_if(ether_if *ep, int k, char *v);
    125  1.1.1.3  christos extern int fsi_lex(void);
    126      1.1  christos 
    127      1.1  christos 
    128      1.1  christos #define	BITSET(m,b)	((m) |= (1<<(b)))
    129      1.1  christos #define	AM_FIRST(ty, q)	((ty *) ((q)->q_forw))
    130      1.1  christos #define	HEAD(ty, q)	((ty *) q)
    131      1.1  christos #define	ISSET(m,b)	((m) & (1<<(b)))
    132      1.1  christos #define	ITER(v, ty, q) 	for ((v) = AM_FIRST(ty,(q)); (v) != HEAD(ty,(q)); (v) = NEXT(ty,(v)))
    133      1.1  christos #define	AM_LAST(ty, q)	((ty *) ((q)->q_back))
    134      1.1  christos #define	NEXT(ty, q)	((ty *) (((qelem *) q)->q_forw))
    135