2021-08-03 01:37:06 -04:00
|
|
|
/* search.h -- */
|
|
|
|
|
2013-05-20 01:16:08 -04:00
|
|
|
#ifndef _SEARCH_H_
|
|
|
|
#define _SEARCH_H_
|
|
|
|
|
2013-09-23 08:28:31 -04:00
|
|
|
#define MAGIC 1 /* include regular expression matching? */
|
2013-09-23 07:31:29 -04:00
|
|
|
|
|
|
|
#include "line.h"
|
2013-05-20 01:16:08 -04:00
|
|
|
|
2014-06-02 03:16:18 -04:00
|
|
|
typedef char spat_t[ 128] ; /* search pattern type */
|
|
|
|
#define NPAT sizeof( spat_t) /* # of bytes, pattern */
|
|
|
|
|
2013-09-27 02:53:04 -04:00
|
|
|
extern unsigned int matchlen ;
|
|
|
|
extern char *patmatch ;
|
|
|
|
|
2014-06-02 03:16:18 -04:00
|
|
|
extern spat_t pat ; /* Search pattern */
|
|
|
|
extern spat_t tap ; /* Reversed pattern array. */
|
|
|
|
extern spat_t rpat ; /* replacement pattern */
|
2013-09-29 01:26:48 -04:00
|
|
|
|
2013-09-26 07:16:28 -04:00
|
|
|
/*
|
|
|
|
* PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for
|
|
|
|
* the scan routines.
|
|
|
|
*/
|
|
|
|
#define PTBEG 0 /* Leave the point at the beginning on search */
|
|
|
|
#define PTEND 1 /* Leave the point at the end on search */
|
|
|
|
#define FORWARD 0 /* forward direction */
|
|
|
|
#define REVERSE 1 /* backwards direction */
|
|
|
|
|
|
|
|
int scanner( const char *patrn, int direct, int beg_or_end) ;
|
|
|
|
|
2021-08-03 01:37:06 -04:00
|
|
|
/* Bindable functions */
|
|
|
|
BINDABLE( forwsearch) ;
|
|
|
|
BINDABLE( forwhunt) ;
|
|
|
|
BINDABLE( backsearch) ;
|
|
|
|
BINDABLE( backhunt) ;
|
|
|
|
BINDABLE( sreplace) ;
|
|
|
|
BINDABLE( qreplace) ;
|
|
|
|
|
2013-05-20 01:16:08 -04:00
|
|
|
int eq( unsigned char bc, unsigned char pc) ;
|
|
|
|
void savematch( void) ;
|
|
|
|
void rvstrcpy( char *rvstr, char *str) ;
|
|
|
|
int delins( int dlength, char *instr, int use_meta) ;
|
|
|
|
int expandp( char *srcstr, char *deststr, int maxlength) ;
|
2021-08-03 01:37:06 -04:00
|
|
|
int boundary( line_p curline, int curoff, int dir) ;
|
2013-09-23 07:31:29 -04:00
|
|
|
|
2015-03-25 22:15:50 -04:00
|
|
|
void setprompt( char *tpat, unsigned tpat_size, char *prompt, char *apat) ;
|
|
|
|
|
2013-09-23 07:31:29 -04:00
|
|
|
#if MAGIC
|
2013-05-20 01:16:08 -04:00
|
|
|
void mcclear( void) ;
|
|
|
|
void rmcclear( void) ;
|
2013-09-23 07:31:29 -04:00
|
|
|
#endif
|
2013-05-20 01:16:08 -04:00
|
|
|
|
|
|
|
#endif
|
2021-08-03 01:37:06 -04:00
|
|
|
|
|
|
|
/* end of search.h */
|