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

Annotation of src/usr.bin/cvs/util.h, Revision 1.4

1.4     ! pat         1: /*     $OpenBSD: util.h,v 1.3 2006/03/17 13:40:41 niallo Exp $ */
1.1       niallo      2: /*
                      3:  * Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org>
                      4:  * All rights reserved.
                      5:  *
                      6:  * Redistribution and use in source and binary forms, with or without
                      7:  * modification, are permitted provided that the following conditions
                      8:  * are met:
                      9:  *
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. The name of the author may not be used to endorse or promote products
                     13:  *    derived from this software without specific prior written permission.
                     14:  *
                     15:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
                     16:  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
                     17:  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
                     18:  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
                     19:  * EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
                     20:  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
                     21:  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
                     22:  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
                     23:  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
                     24:  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     25:  */
                     26:
                     27: #ifndef UTIL_H
                     28: #define UTIL_H
                     29:
                     30: #if !defined(RCSPROG)
                     31:
                     32:
                     33: int      cvs_readrepo(const char *, char *, size_t);
                     34: void     cvs_modetostr(mode_t, char *, size_t);
                     35: void     cvs_strtomode(const char *, mode_t *);
                     36: void     cvs_splitpath(const char *, char *, size_t, char **);
                     37: int      cvs_mkadmin(const char *, const char *, const char *, char *,
                     38:                char *, int);
                     39: int      cvs_cksum(const char *, char *, size_t);
                     40: int      cvs_exec(int, char **, int []);
                     41: int      cvs_getargv(const char *, char **, int);
                     42: int      cvs_chdir(const char *, int);
                     43: int      cvs_rename(const char *, const char *);
                     44: int      cvs_unlink(const char *);
                     45: int      cvs_rmdir(const char *);
                     46: int      cvs_create_dir(const char *, int, char *, char *);
                     47: char    *cvs_rcs_getpath(CVSFILE *, char *, size_t);
                     48: char   **cvs_makeargv(const char *, int *);
                     49: void     cvs_freeargv(char **, int);
                     50: void     cvs_write_tagfile(char *, char *, int);
                     51: void     cvs_parse_tagfile(char **, char **, int *);
                     52: size_t   cvs_path_cat(const char *, const char *, char *, size_t);
1.3       niallo     53: time_t   cvs_hack_time(time_t, int);
1.1       niallo     54:
                     55: #endif /* !RCSPROG */
                     56:
                     57:
                     58: struct cvs_line {
                     59:        char                    *l_line;
                     60:        int                      l_lineno;
                     61:        TAILQ_ENTRY(cvs_line)    l_list;
                     62: };
                     63:
                     64: TAILQ_HEAD(cvs_tqh, cvs_line);
                     65:
                     66: struct cvs_lines {
                     67:        int             l_nblines;
                     68:        char            *l_data;
                     69:        struct cvs_tqh  l_lines;
                     70: };
                     71:
1.4     ! pat        72: struct cvs_argvector {
        !            73:        char *str;
        !            74:        char **argv;
        !            75: };
1.1       niallo     76:
                     77: BUF                    *cvs_patchfile(const char *, const char *,
                     78:                            int (*p)(struct cvs_lines *, struct cvs_lines *));
                     79: struct cvs_lines       *cvs_splitlines(const char *);
                     80: void                   cvs_freelines(struct cvs_lines *);
                     81: int                    cvs_yesno(void);
1.4     ! pat        82: struct cvs_argvector   *cvs_strsplit(char *, const char *);
        !            83:
        !            84: void                   cvs_argv_destroy(struct cvs_argvector *);
1.1       niallo     85:
1.2       xsa        86: #endif /* UTIL_H */