head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2021.09.30.22.01.03;	author agc;	state Exp;
branches;
next	;
commitid	5QRZudtjftD6K1bD;


desc
@@


1.1
log
@Update buffer gap routines to the latest API and functionality - 20210930.

The API has been consolidated around 4 functions:

1. gap_new() - returns a new (opaque) buffer gap structure
2. gap_dispose() - dispose of a previously allocated buffer gap structure
3. gap_exec() - perform operations on the buffer gap which expect an
   integer return value
4. gap_exec_string() - perform operations on the buffer gap which return a byte
   array (typically return buffer contents, or the buffer name)

All of the "verbs" are described in the libgap.3 manual page, found in the
dist directory. The main.c test program, again found in the dist directory,
gives 7 worked examples of how to use the functionality to achieve desired ends,
and there are 7 test input files, along with expected results, which are
provided as a regression test suite - accessible using "make t" from the top
level directory.

The buffer gap routines use a copy of the embedded agcre regexp library to
provide bounded (non-exponential time) results for regexp searching forwards
and backwards - for more information, see the agcre directory at the same level
as this code, or the source code in dist/agcre-embed.[ch].

Also move to a more usual reachover infrastructure
@
text
@PROG=	gap
SRCS+=	gap.c
WARNS=	5
MKMAN=	no

.ifndef PRODUCTION
CPPFLAGS+=	-g -O0
LDFLAGS+=	-g -O0
.endif

.include <bsd.prog.mk>

t: ${PROG}
	@@echo "1. basics"
	./${PROG} < 1.in > 1.out
	diff 1.expected 1.out
	rm -f 1.out
@
