Blame


1 d947271f 2019-02-08 stsp /* $OpenBSD: rcsutil.h,v 1.15 2016/07/04 01:39:12 millert Exp $ */
2 d947271f 2019-02-08 stsp /*
3 d947271f 2019-02-08 stsp * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
4 d947271f 2019-02-08 stsp * All rights reserved.
5 d947271f 2019-02-08 stsp *
6 d947271f 2019-02-08 stsp * Redistribution and use in source and binary forms, with or without
7 d947271f 2019-02-08 stsp * modification, are permitted provided that the following conditions
8 d947271f 2019-02-08 stsp * are met:
9 d947271f 2019-02-08 stsp *
10 d947271f 2019-02-08 stsp * 1. Redistributions of source code must retain the above copyright
11 d947271f 2019-02-08 stsp * notice, this list of conditions and the following disclaimer.
12 d947271f 2019-02-08 stsp * 2. The name of the author may not be used to endorse or promote products
13 d947271f 2019-02-08 stsp * derived from this software without specific prior written permission.
14 d947271f 2019-02-08 stsp *
15 d947271f 2019-02-08 stsp * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
16 d947271f 2019-02-08 stsp * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17 d947271f 2019-02-08 stsp * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
18 d947271f 2019-02-08 stsp * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 d947271f 2019-02-08 stsp * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 d947271f 2019-02-08 stsp * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 d947271f 2019-02-08 stsp * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 d947271f 2019-02-08 stsp * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 d947271f 2019-02-08 stsp * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 d947271f 2019-02-08 stsp * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 d947271f 2019-02-08 stsp */
26 d947271f 2019-02-08 stsp
27 d947271f 2019-02-08 stsp #ifndef RCSUTIL_H
28 d947271f 2019-02-08 stsp #define RCSUTIL_H
29 d947271f 2019-02-08 stsp
30 d947271f 2019-02-08 stsp struct rcs_line {
31 d947271f 2019-02-08 stsp u_char *l_line;
32 d947271f 2019-02-08 stsp int l_lineno;
33 d947271f 2019-02-08 stsp size_t l_len;
34 d947271f 2019-02-08 stsp TAILQ_ENTRY(rcs_line) l_list;
35 d947271f 2019-02-08 stsp };
36 d947271f 2019-02-08 stsp
37 d947271f 2019-02-08 stsp TAILQ_HEAD(tqh, rcs_line);
38 d947271f 2019-02-08 stsp
39 d947271f 2019-02-08 stsp struct rcs_lines {
40 d947271f 2019-02-08 stsp int l_nblines;
41 d947271f 2019-02-08 stsp struct tqh l_lines;
42 d947271f 2019-02-08 stsp };
43 d947271f 2019-02-08 stsp
44 d947271f 2019-02-08 stsp /* rcsutil.c */
45 d947271f 2019-02-08 stsp BUF *rcs_patchfile(u_char *, size_t, u_char *, size_t,
46 d947271f 2019-02-08 stsp int (*p)(struct rcs_lines *,struct rcs_lines *));
47 d947271f 2019-02-08 stsp struct rcs_lines *rcs_splitlines(u_char *, size_t);
48 d947271f 2019-02-08 stsp void rcs_freelines(struct rcs_lines *);
49 d947271f 2019-02-08 stsp
50 d947271f 2019-02-08 stsp #endif /* RCSUTIL_H */