133965Sjdp/*- 233965Sjdp * Copyright (c) 1992, 1993 333965Sjdp * The Regents of the University of California. All rights reserved. 433965Sjdp * 589857Sobrien * This code is derived from software contributed to Berkeley by 689857Sobrien * Christos Zoulas of Cornell University. 789857Sobrien * 889857Sobrien * Redistribution and use in source and binary forms, with or without 989857Sobrien * modification, are permitted provided that the following conditions 1089857Sobrien * are met: 1189857Sobrien * 1. Redistributions of source code must retain the above copyright 1289857Sobrien * notice, this list of conditions and the following disclaimer. 1389857Sobrien * 2. Redistributions in binary form must reproduce the above copyright 1489857Sobrien * notice, this list of conditions and the following disclaimer in the 1589857Sobrien * documentation and/or other materials provided with the distribution. 1633965Sjdp * 3. Neither the name of the University nor the names of its contributors 1733965Sjdp * may be used to endorse or promote products derived from this software 18218822Sdim * without specific prior written permission. 1933965Sjdp * 2033965Sjdp * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2133965Sjdp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22218822Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23218822Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24218822Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25218822Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26218822Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27218822Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28218822Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29218822Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30218822Sdim * SUCH DAMAGE. 31218822Sdim * 32218822Sdim * @(#)search.h 8.1 (Berkeley) 6/4/93 33218822Sdim * $NetBSD: search.h,v 1.8 2003/10/18 23:27:36 christos Exp $ 3433965Sjdp * $FreeBSD: releng/10.3/lib/libedit/search.h 148834 2005-08-07 20:55:59Z stefanf $ 35218822Sdim */ 3633965Sjdp 37218822Sdim/* 38218822Sdim * el.search.h: Line and history searching utilities 39218822Sdim */ 40218822Sdim#ifndef _h_el_search 41218822Sdim#define _h_el_search 42218822Sdim 43218822Sdim#include "histedit.h" 4433965Sjdp 4533965Sjdptypedef struct el_search_t { 4633965Sjdp char *patbuf; /* The pattern buffer */ 4733965Sjdp size_t patlen; /* Length of the pattern buffer */ 4833965Sjdp int patdir; /* Direction of the last search */ 4933965Sjdp int chadir; /* Character search direction */ 5033965Sjdp char chacha; /* Character we are looking for */ 5133965Sjdp char chatflg; /* 0 if f, 1 if t */ 5233965Sjdp} el_search_t; 5333965Sjdp 54218822Sdim 5533965Sjdpprotected int el_match(const char *, const char *); 5633965Sjdpprotected int search_init(EditLine *); 5733965Sjdpprotected void search_end(EditLine *); 58218822Sdimprotected int c_hmatch(EditLine *, const char *); 5933965Sjdpprotected void c_setpat(EditLine *); 6033965Sjdpprotected el_action_t ce_inc_search(EditLine *, int); 61218822Sdimprotected el_action_t cv_search(EditLine *, int); 6233965Sjdpprotected el_action_t ce_search_line(EditLine *, int); 6333965Sjdpprotected el_action_t cv_repeat_srch(EditLine *, int); 6433965Sjdpprotected el_action_t cv_csearch(EditLine *, int, int, int, int); 6533965Sjdp 6633965Sjdp#endif /* _h_el_search */ 6733965Sjdp