[BACK]Return to filesys.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / rdist

Annotation of src/usr.bin/rdist/filesys.h, Revision 1.1

1.1     ! millert     1: /*     $OpenBSD: filesys.h,v 1.4 1998/06/26 21:20:49 millert Exp $     */
        !             2:
        !             3: /*
        !             4:  * Copyright (c) 1983 Regents of the University of California.
        !             5:  * All rights reserved.
        !             6:  *
        !             7:  * Redistribution and use in source and binary forms, with or without
        !             8:  * modification, are permitted provided that the following conditions
        !             9:  * are met:
        !            10:  * 1. Redistributions of source code must retain the above copyright
        !            11:  *    notice, this list of conditions and the following disclaimer.
        !            12:  * 2. Redistributions in binary form must reproduce the above copyright
        !            13:  *    notice, this list of conditions and the following disclaimer in the
        !            14:  *    documentation and/or other materials provided with the distribution.
        !            15:  * 3. All advertising materials mentioning features or use of this software
        !            16:  *    must display the following acknowledgement:
        !            17:  *     This product includes software developed by the University of
        !            18:  *     California, Berkeley and its contributors.
        !            19:  * 4. Neither the name of the University nor the names of its contributors
        !            20:  *    may be used to endorse or promote products derived from this software
        !            21:  *    without specific prior written permission.
        !            22:  *
        !            23:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
        !            24:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            25:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            26:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
        !            27:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            28:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            29:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            30:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            31:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            32:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            33:  * SUCH DAMAGE.
        !            34:  */
        !            35:
        !            36: /*
        !            37:  * $From: filesys.h,v 1.2 1999/08/04 15:57:31 christos Exp $
        !            38:  * @(#)filesys.h
        !            39:  */
        !            40:
        !            41: #ifndef __filesys_h__
        !            42: #define __filesys_h__
        !            43:
        !            44: /*
        !            45:  * File System information
        !            46:  */
        !            47:
        !            48: /*
        !            49:  * Mount information
        !            50:  */
        !            51: #if FSI_TYPE == FSI_GETMNT
        !            52: #      include <sys/types.h>
        !            53: #      include <sys/param.h>
        !            54: #      include <sys/mount.h>
        !            55: #      define MOUNTED_FILE             "<none>"
        !            56: #endif
        !            57:
        !            58: #if FSI_TYPE == FSI_GETFSSTAT
        !            59: #      include <sys/types.h>
        !            60: #      include <sys/mount.h>
        !            61: #      define MOUNTED_FILE             "<none>"
        !            62: #endif
        !            63:
        !            64: #if FSI_TYPE == FSI_MNTCTL
        !            65: #      include <sys/mntctl.h>
        !            66: #      define MOUNTED_FILE             "<none>"
        !            67: #endif
        !            68:
        !            69: #if FSI_TYPE == FSI_GETMNTENT
        !            70: #      include <mntent.h>
        !            71: #      define  MOUNTED_FILE            MOUNTED
        !            72: #endif
        !            73:
        !            74: #if FSI_TYPE == FSI_GETMNTENT2
        !            75: #if     defined(MNTTAB_H)
        !            76: #       include MNTTAB_H
        !            77: #endif /* MNTTAB_H */
        !            78: #if     defined(MNTENT_H)
        !            79: #       include MNTENT_H
        !            80: #endif /* MNTENT_H */
        !            81: #      define  MOUNTED_FILE            MNTTAB
        !            82: #endif /* FSI_GETMNTENT2 */
        !            83:
        !            84: #if    !defined(MOUNTED_FILE) && defined(MNT_MNTTAB)   /* HPUX */
        !            85: #      define MOUNTED_FILE             MNT_MNTTAB
        !            86: #endif /* MNT_MNTTAB */
        !            87:
        !            88: /*
        !            89:  * NCR OS defines bcopy and bzero
        !            90:  */
        !            91: #if defined(NCR)
        !            92: #undef bcopy
        !            93: #undef bzero
        !            94: #endif /* NCR */
        !            95:
        !            96: /*
        !            97:  * Stat Filesystem
        !            98:  */
        !            99: #if    defined(STATFS_TYPE)
        !           100: #  if defined(ultrix)
        !           101:        typedef struct fs_data          statfs_t;
        !           102: #      define f_bavail                 fd_req.bfreen
        !           103: #      define f_bsize                  fd_req.bsize
        !           104: #      define f_ffree                  fd_req.gfree
        !           105: #  elif defined(_AIX) || STATFS_TYPE == STATFS_SYSV
        !           106: #      include <sys/statfs.h>
        !           107:        typedef struct statfs           statfs_t;
        !           108: #      define f_bavail                 f_bfree
        !           109: #  elif defined(SVR4)
        !           110: #      include <sys/statvfs.h>
        !           111:        typedef struct statvfs          statfs_t;
        !           112: #      define statfs(mp,sb)            statvfs(mp,sb)
        !           113: #  elif STATFS_TYPE == STATFS_44BSD || STATFS_TYPE == STATFS_OSF1
        !           114:        typedef struct statfs           statfs_t;
        !           115: #  else
        !           116: #      include <sys/vfs.h>
        !           117:        typedef struct statfs           statfs_t;
        !           118: #  endif
        !           119: #endif /* STATFS_TYPE */
        !           120:
        !           121: /*
        !           122:  * Mount Entry definetions
        !           123:  */
        !           124: #ifndef METYPE_OTHER
        !           125: #define METYPE_OTHER                   "other"
        !           126: #endif
        !           127: #ifndef METYPE_NFS
        !           128: #define METYPE_NFS                     "nfs"
        !           129: #endif
        !           130: #ifndef MEFLAG_READONLY
        !           131: #define MEFLAG_READONLY                        0x01
        !           132: #endif
        !           133: #ifndef MEFLAG_IGNORE
        !           134: #define MEFLAG_IGNORE                  0x02
        !           135: #endif
        !           136:
        !           137: /*
        !           138:  * Our internal mount entry type
        !           139:  */
        !           140: struct _mntent {
        !           141:        char                           *me_path;        /* Mounted path */
        !           142:        char                           *me_type;        /* Type of mount */
        !           143:        int                             me_flags;       /* Mount flags */
        !           144: };
        !           145: typedef struct _mntent mntent_t;
        !           146:
        !           147: /*
        !           148:  * Internal mount information type
        !           149:  */
        !           150: struct mntinfo {
        !           151:        mntent_t                        *mi_mnt;
        !           152:        struct stat                     *mi_statb;
        !           153:        struct mntinfo                  *mi_nxt;
        !           154: };
        !           155:
        !           156: /*
        !           157:  * Declarations
        !           158:  */
        !           159: FILE          *setmountent(const char *, const char *);
        !           160: mntent_t       *getmountent(FILE *);
        !           161: mntent_t       *newmountent(const mntent_t *);
        !           162: void           endmountent(FILE *);
        !           163:
        !           164: #endif /* __filesys_h__ */