#ifndef NEDIT_SEARCH_H_INCLUDED
#define NEDIT_SEARCH_H_INCLUDED
#include "nedit.h"
#include <X11/Intrinsic.h>
#include <X11/X.h>
enum SearchDirection {
SEARCH_FORWARD,
SEARCH_BACKWARD};
void CreateFindDlog(Widget parent, WindowInfo *window);
void CreateReplaceDlog(Widget parent, WindowInfo *window);
void CreateReplaceMultiFileDlog(WindowInfo *window);
void DoFindReplaceDlog(WindowInfo *window,
int direction,
int keepDialogs,
int searchType, Time time);
void DoReplaceMultiFileDlog(WindowInfo *window);
void UpdateReplaceActionButtons(WindowInfo* window);
void DoFindDlog(WindowInfo *window,
int direction,
int keepDialogs,
int searchType, Time time);
int SearchAndSelect(WindowInfo *window,
int direction,
const char *searchString,
int searchType,
int searchWrap);
int SearchAndSelectSame(WindowInfo *window,
int direction,
int searchWrap);
int SearchAndSelectIncremental(WindowInfo *window,
int direction,
const char *searchString,
int searchType,
int searchWrap,
int continued);
void SearchForSelected(WindowInfo *window,
int direction,
int searchType,
int searchWrap, Time time);
int SearchAndReplace(WindowInfo *window,
int direction,
const char *searchString,
const char *replaceString,
int searchType,
int searchWrap);
int ReplaceAndSearch(WindowInfo *window,
int direction,
const char *searchString,
const char *replaceString,
int searchType,
int searchWrap);
int ReplaceFindSame(WindowInfo *window,
int direction,
int searchWrap);
int ReplaceSame(WindowInfo *window,
int direction,
int searchWrap);
int ReplaceAll(WindowInfo *window,
const char *searchString,
const char *replaceString,
int searchType);
void ReplaceInSelection(
const WindowInfo* window,
const char* searchString,
const char* replaceString,
int searchType);
int SearchWindow(WindowInfo *window,
int direction,
const char *searchString,
int searchType,
int searchWrap,
int beginPos,
int *startPos,
int *endPos,
int *extentBW,
int* extentFW);
int SearchString(
const char *string,
const char *searchString,
int direction,
int searchType,
int wrap,
int beginPos,
int *startPos,
int *endPos,
int *searchExtentBW,
int*searchExtentFW,
const char *delimiters);
char *ReplaceAllInString(
const char *inString,
const char *searchString,
const char *replaceString,
int searchType,
int *copyStart,
int *copyEnd,
int *replacementLength,
const char *delimiters);
void BeginISearch(WindowInfo *window,
int direction);
void EndISearch(WindowInfo *window);
void SetISearchTextCallbacks(WindowInfo *window);
void FlashMatching(WindowInfo *window, Widget textW);
void SelectToMatchingCharacter(WindowInfo *window);
void GotoMatchingCharacter(WindowInfo *window);
void RemoveFromMultiReplaceDialog(WindowInfo *window);
Boolean WindowCanBeClosed(WindowInfo *window);
void WriteSearchHistory(
void);
void ReadSearchHistory(
void);
void ChangeCase(
const char *in,
char *out,
int makeUpper,
int *in_len,
int *out_len);
void UpCaseString(
char *outString,
const char *inString);
void DownCaseString(
char *outString,
const char *inString);
enum SearchType {
SEARCH_LITERAL,
SEARCH_CASE_SENSE,
SEARCH_REGEX,
SEARCH_LITERAL_WORD,
SEARCH_CASE_SENSE_WORD,
SEARCH_REGEX_NOCASE,
N_SEARCH_TYPES };
#ifdef REPLACE_SCOPE
enum ReplaceScope {
REPL_SCOPE_WIN,
REPL_SCOPE_SEL,
REPL_SCOPE_MULTI };
enum ReplaceAllDefaultScope {
REPL_DEF_SCOPE_WINDOW,
REPL_DEF_SCOPE_SELECTION,
REPL_DEF_SCOPE_SMART };
#endif
const char *SearchTypeArg(
int searchType,
const char * defaultRV);
int StringToSearchType(
const char * string,
int *searchType);
extern int NHist;
#endif