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

Annotation of src/usr.bin/cvs/file.h, Revision 1.34

1.34    ! joris       1: /*     $OpenBSD: file.h,v 1.33 2006/01/02 09:42:20 xsa Exp $   */
1.1       jfb         2: /*
1.34    ! joris       3:  * Copyright (c) 2006 Joris Vink <joris@openbsd.org>
1.1       jfb         4:  * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
1.11      tedu        5:  * All rights reserved.
1.1       jfb         6:  *
1.11      tedu        7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
1.1       jfb        10:  *
1.11      tedu       11:  * 1. Redistributions of source code must retain the above copyright
                     12:  *    notice, this list of conditions and the following disclaimer.
1.1       jfb        13:  * 2. The name of the author may not be used to endorse or promote products
1.11      tedu       14:  *    derived from this software without specific prior written permission.
1.1       jfb        15:  *
                     16:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
                     17:  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
                     18:  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
                     19:  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
                     20:  * EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
                     21:  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
                     22:  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
                     23:  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
                     24:  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1.11      tedu       25:  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.1       jfb        26:  */
                     27:
                     28: #ifndef FILE_H
                     29: #define FILE_H
                     30:
1.16      jfb        31: #include "rcs.h"
                     32:
1.34    ! joris      33: struct cvs_file {
        !            34:        char    *file_name;
        !            35:        char    *file_wd;
        !            36:        char    *file_path;
        !            37:        char    *file_rpath;
        !            38:
        !            39:        int      fd;
        !            40:        int      repo_fd;
        !            41:        int      file_type;
        !            42:        int      file_status;
        !            43:        int      file_flags;
        !            44:
        !            45:        RCSFILE         *file_rcs;
        !            46:        struct cvs_ent  *file_ent;
        !            47: };
        !            48:
        !            49: #define FILE_UNKNOWN           0
        !            50: #define FILE_ADDED             1
        !            51: #define FILE_REMOVED           2
        !            52: #define FILE_MODIFIED          3
        !            53: #define FILE_UPTODATE          4
        !            54: #define FILE_LOST              5
        !            55: #define FILE_CHECKOUT          6
        !            56: #define FILE_MERGE             7
        !            57: #define FILE_PATCH             8
        !            58: #define FILE_REMOVE_ENTRY      9
        !            59: #define FILE_CONFLICT          10
        !            60: #define FILE_UNLINK            11
        !            61:
        !            62: #define DIR_CREATE             12
        !            63:
        !            64: struct cvs_filelist {
        !            65:        char    *file_path;
        !            66:        TAILQ_ENTRY(cvs_filelist) flist;
        !            67: };
        !            68:
        !            69: TAILQ_HEAD(cvs_flisthead, cvs_filelist);
        !            70:
        !            71: struct cvs_recursion;
        !            72:
        !            73: #define CVS_DIR                1
        !            74: #define CVS_FILE       2
        !            75:
        !            76: #define CVS_ISDIR(cf)  \
        !            77:        ((cf)->file_type == CVS_DIR)
        !            78:
        !            79: #define CVS_ISFILE(cf) \
        !            80:        ((cf)->file_type == CVS_FILE)
        !            81:
        !            82: TAILQ_HEAD(cvs_flist, cvs_file);
        !            83:
        !            84: struct cvs_ignpat {
        !            85:        char                            ip_pat[MAXNAMLEN];
        !            86:        int                             ip_flags;
        !            87:        TAILQ_ENTRY(cvs_ignpat)         ip_list;
        !            88: };
        !            89:
        !            90: TAILQ_HEAD(ignore_head, cvs_ignpat);
        !            91:
        !            92: void   cvs_file_init(void);
        !            93: void   cvs_file_ignore(const char *, struct ignore_head *);
        !            94: void   cvs_file_classify(struct cvs_file *);
        !            95: void   cvs_file_free(struct cvs_file *);
        !            96: void   cvs_file_run(int, char **, struct cvs_recursion *);
        !            97: void   cvs_file_walklist(struct cvs_flisthead *, struct cvs_recursion *);
        !            98: void   cvs_file_walkdir(struct cvs_file *, struct cvs_recursion *);
        !            99: void   cvs_file_freelist(struct cvs_flisthead *);
        !           100: struct cvs_filelist *cvs_file_get(const char *, struct cvs_flisthead *);
1.1       jfb       101:
1.34    ! joris     102: int    cvs_file_chkign(const char *);
1.1       jfb       103:
1.34    ! joris     104: struct cvs_file *cvs_file_get_cf(const char *, const char *, int, int);
1.1       jfb       105:
1.26      xsa       106: #endif /* FILE_H */