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
@# $NetBSD: Makefile,v 1.4 2013/04/12 20:47:47 agc Exp $

.include <bsd.own.mk>

OS!= uname -s

CPPFLAGS+=	-I${EXTDIST}
CPPFLAGS+=	-DVERIFYONLY=1

LDSTATIC=	-static

.if ${OS} == "FreeBSD"
LDFLAGS+= 	-static
CFLAGS+=	-DVERIFYONLY=1
.endif

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

LIB_GAP_DIR!= cd ${.CURDIR}/../lib && ${PRINTOBJDIR}
LDADD+=         -Wl,-R${LIB_GAP_DIR} -L${LIB_GAP_DIR} -lgap
DPADD+=         ${LIB_GAP_DIR}/libgap.a

USE_FORT?= 	yes

BINDIR=		/usr/bin

PROG=		gap
SRCS+=		main.c
WARNS=		5
#MAN=		ed25519verify.1
MKMAN=		no

EXTDIST=	${.CURDIR}/../dist
.PATH: ${EXTDIST}

.include <bsd.prog.mk>

t: ${PROG}
	@@echo "1. basics"
	./${PROG} < 1.in > 1.out
	diff 1.expected 1.out
	rm -f 1.out
	@@echo "2. changes"
	./${PROG} < 2.in > 2.out
	diff 2.expected 2.out
	rm -f 2.out
	@@echo "3. regex"
	./${PROG} < 3.in > 3.out
	diff 3.expected 3.out
	rm -f 3.out
	@@echo "4. words"
	./${PROG} < 4.in > 4.out
	diff 4.expected 4.out
	rm -f 4.out
	@@echo "5. char searches"
	./${PROG} < 5.in > 5.out
	diff 5.expected 5.out
	rm -f 5.out
	@@echo "6. lines and paras"
	./${PROG} < 6.in > 6.out
	diff 6.expected 6.out
	rm -f 6.out
	@@echo "7. c source file"
	./${PROG} < 7.in > 7.out
	diff 7.expected 7.out
	rm -f 7.out
@
