1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #ifndef NEDIT_SEARCH_H_INCLUDED
28 #define NEDIT_SEARCH_H_INCLUDED
29
30 #include "nedit.h"
31
32 #include <X11/Intrinsic.h>
33 #include <X11/X.h>
34
35 enum SearchDirection {
SEARCH_FORWARD,
SEARCH_BACKWARD};
36
37 void CreateFindDlog(Widget parent, WindowInfo *window);
38 void CreateReplaceDlog(Widget parent, WindowInfo *window);
39 void CreateReplaceMultiFileDlog(WindowInfo *window);
40 void DoFindReplaceDlog(WindowInfo *window,
int direction,
int keepDialogs,
41 int searchType, Time time);
42 void DoReplaceMultiFileDlog(WindowInfo *window);
43 void UpdateReplaceActionButtons(WindowInfo* window);
44 void DoFindDlog(WindowInfo *window,
int direction,
int keepDialogs,
45 int searchType, Time time);
46 int SearchAndSelect(WindowInfo *window,
int direction,
const char *searchString,
47 int searchType,
int searchWrap);
48 int SearchAndSelectSame(WindowInfo *window,
int direction,
int searchWrap);
49 int SearchAndSelectIncremental(WindowInfo *window,
int direction,
50 const char *searchString,
int searchType,
int searchWrap,
int continued);
51 void SearchForSelected(WindowInfo *window,
int direction,
int searchType,
52 int searchWrap, Time time);
53 int SearchAndReplace(WindowInfo *window,
int direction,
const char *searchString,
54 const char *replaceString,
int searchType,
int searchWrap);
55 int ReplaceAndSearch(WindowInfo *window,
int direction,
const char *searchString,
56 const char *replaceString,
int searchType,
int searchWrap);
57 int ReplaceFindSame(WindowInfo *window,
int direction,
int searchWrap);
58 int ReplaceSame(WindowInfo *window,
int direction,
int searchWrap);
59 int ReplaceAll(WindowInfo *window,
const char *searchString,
const char *replaceString,
60 int searchType);
61 void ReplaceInSelection(
const WindowInfo* window,
const char* searchString,
62 const char* replaceString,
int searchType);
63 int SearchWindow(WindowInfo *window,
int direction,
const char *searchString,
64 int searchType,
int searchWrap,
int beginPos,
int *startPos,
int *endPos,
65 int *extentBW,
int* extentFW);
66 int SearchString(
const char *string,
const char *searchString,
int direction,
67 int searchType,
int wrap,
int beginPos,
int *startPos,
int *endPos,
68 int *searchExtentBW,
int*searchExtentFW,
const char *delimiters);
69 char *ReplaceAllInString(
const char *inString,
const char *searchString,
70 const char *replaceString,
int searchType,
int *copyStart,
71 int *copyEnd,
int *replacementLength,
const char *delimiters);
72 void BeginISearch(WindowInfo *window,
int direction);
73 void EndISearch(WindowInfo *window);
74 void SetISearchTextCallbacks(WindowInfo *window);
75 void FlashMatching(WindowInfo *window, Widget textW);
76 void SelectToMatchingCharacter(WindowInfo *window);
77 void GotoMatchingCharacter(WindowInfo *window);
78 void RemoveFromMultiReplaceDialog(WindowInfo *window);
79 Boolean WindowCanBeClosed(WindowInfo *window);
80 void WriteSearchHistory(
void);
81 void ReadSearchHistory(
void);
82
83 void ChangeCase(
const char *in,
char *out,
int makeUpper,
int *in_len,
int *out_len);
84 void UpCaseString(
char *outString,
const char *inString);
85 void DownCaseString(
char *outString,
const char *inString);
86
87
88
89
90
91
92
93
94
95 enum SearchType {
96 SEARCH_LITERAL,
SEARCH_CASE_SENSE,
SEARCH_REGEX,
97 SEARCH_LITERAL_WORD,
SEARCH_CASE_SENSE_WORD,
SEARCH_REGEX_NOCASE,
98 N_SEARCH_TYPES };
99
100 #ifdef REPLACE_SCOPE
101
102 enum ReplaceScope {
REPL_SCOPE_WIN,
REPL_SCOPE_SEL,
REPL_SCOPE_MULTI };
103
104
105
106
107 enum ReplaceAllDefaultScope {
REPL_DEF_SCOPE_WINDOW,
108 REPL_DEF_SCOPE_SELECTION,
109 REPL_DEF_SCOPE_SMART };
110 #endif
111
112
113
114
115
116
117 const char *SearchTypeArg(
int searchType,
const char * defaultRV);
118
119
120
121
122
123
124
125 int StringToSearchType(
const char * string,
int *searchType);
126
127
128
129
130 extern int NHist;
131
132 #endif
133