SearchE.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*
  24. * COMPONENT_NAME: austext
  25. *
  26. * FUNCTIONS: none
  27. *
  28. * ORIGINS: 27
  29. *
  30. *
  31. * (C) COPYRIGHT International Business Machines Corp. 1991,1995
  32. * All Rights Reserved
  33. * Licensed Materials - Property of IBM
  34. * US Government Users Restricted Rights - Use, duplication or
  35. * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  36. */
  37. #ifndef _SearchE_h
  38. #define _SearchE_h
  39. /***************************** SearchE.h ******************************
  40. * $XConsortium: SearchE.h /main/5 1996/08/12 13:16:47 cde-ibm $
  41. * August 1991.
  42. * Header file for online DtSearch Engine (OE.C etc).
  43. * SearchE.h was formerly called oe.h (Opera Engine).
  44. * The old OE engine is pretty much invisible now, having
  45. * been surrounded by the ausapi/DtSearch interface.
  46. *
  47. * The main data structure for passing and receiving arguments
  48. * between the callers and the engine is USRBLK which is
  49. * the only argument in the Opera_Engine() call.
  50. * The actual input and output arguments in the USRBLK for each
  51. * function are described below with the function description.
  52. *
  53. * All OE_functions pass a return code
  54. * to the caller. OE_OK = successful completion,
  55. * anything else may be partial completion/success or failure.
  56. * Return code mnemonics are also defined below.
  57. *
  58. * $Log$
  59. * Revision 2.7 1996/03/20 19:11:21 miker
  60. * Changed prototype of hilite_cleartext().
  61. *
  62. * Revision 2.6 1996/03/13 22:34:53 miker
  63. * Changed char to UCHAR several places.
  64. *
  65. * Revision 2.5 1996/03/05 19:17:50 miker
  66. * oe_unblob no longer converts to uppercase.
  67. *
  68. * Revision 2.4 1996/03/05 15:54:06 miker
  69. * Minor changes to support yacc-based boolean search.
  70. *
  71. * Revision 2.3 1996/02/01 16:14:38 miker
  72. * Obsoleted requests OE_DITTO2KWIC, OE_VALIDATE_PWD, OE_CHANGE_PWD,
  73. * OE_FINDSTR_REC, OE_FINDSTR_HITL, OE_ASSIST, OE_KILL.
  74. * Restored OE_PING as the official "null" function.
  75. * Added USRDBG_HILITE and USRDBG_PARSE.
  76. * Replaced STRKIND, OE_kind_of_stems, and oe_stems_to_hitwords
  77. * with hilite_cleartext. Deleted oe_ditto2kwic, oe_findstr_hitl.
  78. * Deleted usrblk.kwiclen.
  79. *
  80. * Revision 2.2 1995/10/25 22:35:45 miker
  81. * Added prolog.
  82. *
  83. * Revision 2.1 1995/09/22 22:39:39 miker
  84. * Freeze DtSearch 0.1, AusText 2.1.8
  85. *
  86. * Revision 1.1 1995/08/31 20:42:33 miker
  87. * Initial revision
  88. *
  89. * The DtSearch return codes wrap around the OE return codes.
  90. */
  91. #include "SearchP.h"
  92. #define AUDIT_FORMAT "UID=%-8s TIME=%s ELAP=%-3ld DB=%-8s HITS=%-5ld "
  93. #define AUDIT_WHOWHEN "UID=%-8s TIME=%s"
  94. #define DISCARD_FORMAT "%s\t\"%s\"\t%s\t%s\n"
  95. #define HARDCOPY_SCRIPT "opprt.bat"
  96. #define MAX_HITWCOUNT 200 /* max number hitwords that can be hilited */
  97. #define WORDS_HITLIMIT 300000L
  98. /*-------------------- Request Codes ------------------------
  99. * All Engine requests, in addition to input below, require valid
  100. * usrblk.userid
  101. * usrblk.request.
  102. * All Engine requests, in addition to output below,
  103. * may return ausapi_msglist.
  104. * There is no zero request code.
  105. * See list of return codes for the ones that are marked 'common retncodes'.
  106. */
  107. #define OE_INITIALIZE 1
  108. /* does lotsa stuff--see the function.
  109. * input:
  110. * .query = AUSAPI_VERSION of UI code
  111. * .dblist = data from user config file
  112. * .dblk = data from user config file
  113. * output:
  114. * .dblist = modified after load of site config file
  115. * .dblk = modified after load of site config file
  116. * .retncode = OE_OK, OE_NOTAVAIL, OE_ABORT
  117. */
  118. #define OE_TEXT2FZKEY 2
  119. /* converts problem description text to fzkey.
  120. * input:
  121. * .query = problem description text
  122. * .dblk = desired database and db parameters
  123. * output:
  124. * .fzkey = inference from query text analysis
  125. * .retncode = common retncodes + OE_BAD_QUERY
  126. */
  127. #define OE_SRCH_FZKEY 3
  128. /* Converts fzkey to hitlist of dba's.
  129. * Not available for databases without semantic dictionaries.
  130. * input:
  131. * .fzkey = database search vector
  132. * .dblk = desired database and db parameters
  133. * output:
  134. * .workproc = function to be called until !OE_SEARCHING
  135. * .dittolist = hitlist sorted by proximity
  136. * .dittocount = # of nodes on dittolist
  137. * .retncode = common retncodes + OE_SEARCHING, OE_NOTAVAIL,
  138. * OE_USER_STOP, OE_SYSTEM_STOP, OE_BAD_QUERY
  139. */
  140. #define OE_SRCH_STEMS 4
  141. /* converts string of wordstems and booleans to
  142. * hitlist of dba's and stems array.
  143. * input:
  144. * .query = text string of wordstems and booleans
  145. * .dblk = desired database and db parameters
  146. * output:
  147. * .fzkey = (value undefined)
  148. * .workproc = function to be called until !OE_SEARCHING
  149. * .dittolist = hitlist
  150. * .dittocount = # of nodes on dittolist
  151. * .stems = array of stems for hiliting in text of hits
  152. * .stemcount = size of 'stems' array
  153. * .retncode = common retncodes + OE_BAD_QUERY, OE_SEARCHING,
  154. * OE_NOTAVAIL, OE_USER_STOP
  155. */
  156. #define OE_SRCH_WORDS 5
  157. /* converts string of exact words and booleans to
  158. * hitlist of dba's and stems array.
  159. * input:
  160. * .query = text string of exact words and booleans
  161. * .dblk = desired database and db parameters
  162. * output:
  163. * .fzkey = (value undefined)
  164. * .workproc = function to be called until !OE_SEARCHING
  165. * .dittolist = hitlist
  166. * .dittocount = # of nodes on dittolist
  167. * .stems = array of words for hiliting in text of hits
  168. * .stemcount = size of 'stems' array
  169. * .retncode = common retncodes + OE_BAD_QUERY, OE_SEARCHING,
  170. * OE_NOTAVAIL, OE_USER_STOP
  171. */
  172. #define OE_STOP_SRCH 6
  173. /* sets global switch to cancel search work procedure.
  174. * workproc actually cancels itself after reading switch.
  175. * input: .request = OE_STOP_SEARCH
  176. * output: .retncode = 'common retncodes' only
  177. */
  178. #define OE_APPEND_NOTES 7
  179. /* appends user's notes to record at current dba.
  180. * input:
  181. * .query = freeform text of append
  182. * .dba = address of record to append
  183. * .dblk = desired database and db parameters
  184. * output:
  185. * .retncode = common retncodes + OE_TIMEOUT, OE_DISABLED
  186. */
  187. #define OE_GETREC 8
  188. /* retrieves record, cleartext, and notes for specified dba.
  189. * Clears hitwords array, does not use or change stems array.
  190. * input:
  191. * .dba = address of record to retrieve
  192. * .dblk = desired database and db parameters
  193. * output:
  194. * .objrec = austext record itself, as is from vista
  195. * .cleartext = NULL or uncompressed text string
  196. * .clearlen = 0 or size of cleartext
  197. * .hitwords = array pointer cleared to NULL
  198. * .hitwcount = size of hitwords array set to 0
  199. * .notes = NULL, or list of notes records, as is
  200. * .retncode = common retncodes + OE_NOTAVAIL
  201. */
  202. #define OE_GETREC_STEMS 9
  203. /* retrieves record, cleartext, notes, and hitwords
  204. * array for specified dba and stems (from OE_SRCH_STEMS).
  205. * If no text in repository, equivalent to OE_GETREC.
  206. * input:
  207. * .dba = address of record to retrieve
  208. * .stems = array of word stems to hilite
  209. * .stemcount = size of stems array
  210. * .dblk = desired database and db parameters
  211. * output:
  212. * .objrec = austext record itself, as is from vista
  213. * .cleartext = NULL or uncompressed text string
  214. * .clearlen = 0 or size of cleartext
  215. * .hitwords = NULL or array of words in cleartext to hilite
  216. * .hitwcount = 0 or size of hitwords array
  217. * .notes = NULL, or list of notes records, as is
  218. * .retncode = common retncodes + OE_NOTAVAIL
  219. */
  220. #define OE_GETREC_WORDS 10
  221. /* retrieves record, cleartext, notes, and hitwords
  222. * array for specified dba and stems array (from OE_SRCH_WORDS).
  223. * If no text in repository, equivalent to OE_GETREC.
  224. * input:
  225. * .dba = address of record to retrieve
  226. * .stems = array of exact words to hilite
  227. * .stemcount = size of stems array
  228. * .dblk = desired database and db parameters
  229. * output:
  230. * .objrec = austext record itself, as is from vista
  231. * .cleartext = NULL or uncompressed text string
  232. * .clearlen = 0 or size of cleartext
  233. * .hitwords = NULL or array of words in cleartext to hilite
  234. * .hitwcount = 0 or size of hitwords array
  235. * .notes = NULL, or list of notes records, as is
  236. * .retncode = common retncodes + OE_NOTAVAIL
  237. */
  238. #define OE_NEXT_DBA 11
  239. /* advances dba to next valid b-tree address. Wraps if necessary.
  240. * input:
  241. * .dba = current address of record
  242. * .dblk = desired database and db parameters
  243. * output:
  244. * .dba = address of next record in b-tree
  245. * .retncode = common retncodes + OE_WRAPPED
  246. */
  247. #define OE_PREV_DBA 12
  248. /* retreats dba to previous valid b-tree address.
  249. * Wraps if necessary.
  250. * input:
  251. * .dba = current address of record
  252. * .dblk = desired database and db parameters
  253. * output:
  254. * .dba = address of previous record in b-tree
  255. * .retncode = common retncodes + OE_WRAPPED
  256. */
  257. #define OE_RECKEY2DBA 13
  258. /* converts an austext record key into a dba. Wraps if not found.
  259. * input:
  260. * .query = desired record key
  261. * .dblk = desired database and db parameters
  262. * output:
  263. * .dba = address of record found,
  264. * or next avail address if not found
  265. * .retncode = common retncodes + OE_WRAPPED
  266. */
  267. #define OE_MARK_DELETION 14
  268. /* writes record id to an external file for
  269. * possible later deletion by external program.
  270. * input:
  271. * .query = record key to be marked for deletion
  272. * .dblk = database where record is located
  273. * output:
  274. * .retncode = common retncodes + OE_NOTAVAIL, OE_DISABLED
  275. */
  276. #define OE_GETREC_DIC 15
  277. /* THIS FUNCTION IS NO LONGER SUPPORTED.
  278. * IF RECEIVED BY ENGINE, IT IS TREATED EXACTLY AS OE_GETREC.
  279. * Retrieves record, cleartext, notes, and hitwords
  280. * array for specified dba. Hitwords are not derived from the
  281. * stems array; they are all the cleartext words that are in
  282. * the dictionary. (Compare to OE_GETREC_WORDS and OE_GETREC_STEMS).
  283. * If no text in repository, equivalent to OE_GETREC.
  284. * input:
  285. * .dba = address of record to retrieve
  286. * .dblk = desired database and db parameters
  287. * output:
  288. * .objrec = austext record itself, as is from vista
  289. * .cleartext = NULL or uncompressed text string
  290. * .clearlen = 0 or size of cleartext
  291. * .hitwords = NULL or array of words in cleartext to hilite
  292. * .hitwcount = 0 or size of hitwords array
  293. * .notes = NULL, or list of notes records, as is
  294. * .retncode = common retncodes + OE_NOTAVAIL
  295. */
  296. #define OE_DITTO2KWIC 16
  297. #define OE_VALIDATE_PWD 17
  298. #define OE_CHANGE_PWD 18
  299. /* (These functions are obsolete) */
  300. #define OE_DELETE_RECID 19
  301. /* Deletes header record, all text, user notes,
  302. * and word/stems references for specified record.
  303. * Currently can only be called from offline program
  304. * when all online austext users have been logged off.
  305. * THIS FUNCTION IS <<<VERY>>> SLOW (about 15 min on large dbase)!
  306. * input:
  307. * .query = desired record key
  308. * .dblk = desired database and db parameters
  309. * output:
  310. * .dba = address of record deleted
  311. * THIS ADDRESS IS NO LONGER VALID!
  312. * .dbatab = (undefined)
  313. * .dbacount = 1
  314. * .retncode = common retncodes + OE_NOTAVAIL
  315. */
  316. #define OE_DELETE_BATCH 20
  317. /* Deletes header records, all text, user notes,
  318. * and word/stems references for all records in a
  319. * datbase address table. Currently can only be called
  320. * from offline program when all online austext users
  321. * have been logged off. This function is the preferred
  322. * deletion method because it is faster than deleting
  323. * single records at a time. Addresses not found are ignored.
  324. * input:
  325. * .dblk = desired database and db parameters
  326. * .dbatab = table of valid addresses to be deleted
  327. * .dbacount = number of addresses on the table
  328. * output:
  329. * .retncode = common retncodes only
  330. */
  331. #define OE_ASSIST 21
  332. #define OE_FINDSTR_REC 22
  333. #define OE_FINDSTR_HITL 23
  334. /* (These functions are obsolete) */
  335. #define OE_SRCH_STATISTICAL 24
  336. /* Converts string of natural language text to
  337. * hitlist of dba's and stems array. Uses stems only,
  338. * no booleans, all words are ORed together. Hitlist sorted
  339. * based on statistics of included word stems.
  340. * input:
  341. * .query = natural language text string
  342. * .dblk = desired database and db parameters
  343. * output:
  344. * .stems = array of stems for hiliting in text of hits
  345. * .stemcount = size of 'stems' array (up to max allowed)
  346. * .workproc = function to be called until !OE_SEARCHING
  347. * .dittolist = hitlist
  348. * .dittocount = # of nodes on dittolist
  349. * .retncode = common retncodes + OE_BAD_QUERY, OE_SEARCHING,
  350. * OE_NOTAVAIL, OE_USER_STOP
  351. */
  352. #define OE_HILITE_STEMS 25
  353. /* Creates a hitwords array for hiliting using the text
  354. * in cleartext (however it may have been obtained),
  355. * and the stems array from the last search.
  356. * input:
  357. * .cleartext = text to be hilited
  358. * .clearlen = size of cleartext
  359. * .stems = array of words or stems to hilite
  360. * .stemcount = size of stems array
  361. * .search_type = 'W', 'P' or 'S', indicating type of
  362. * search that generated stems array.
  363. * output:
  364. * .hitwords = array of words in cleartext to hilite
  365. * .hitwcount = size of hitwords array
  366. * .retncode = common retncodes + OE_NOTAVAIL, OE_BAD_QUERY
  367. */
  368. #define OE_GET_EXPIRE 26
  369. /* Returns in 'dba' field the expiration date of OE as a timestamp.
  370. * Zero means no expiration date. Overlays previous value in dba.
  371. * input: .request = OE_GET_EXPIRE
  372. * output: .dba = unix timestamp of expiration date or 0
  373. * .retncode = common retncodes only
  374. */
  375. #define OE_KILL 9997
  376. #define OE_PING 9998
  377. #define OE_SHUTDOWN 9999
  378. /* (These functions are obsolete) */
  379. /*-------------------- Return Codes ------------------------
  380. * The return codes marked 'common retncodes' are OE_OK, OE_NOOP, OE_REINIT,
  381. * and OE_ABORT, and can be returned by almost all functions.
  382. * OE_BAD_QUERY will be returned for any unknown function request.
  383. * There is no zero return code.
  384. */
  385. #define OE_OK 1 /* normal successful completion */
  386. #define OE_REINIT 2 /* request canceled: OE reinitialized
  387. * databases so UI's dba's may be bad */
  388. #define OE_SEARCHING 3 /* keep calling workproc */
  389. #define OE_BAD_DBLK 4
  390. #define OE_BAD_REQUEST 5 /* invalid request field */
  391. #define OE_BAD_QUERY 6 /* invalid query or other input fld */
  392. #define OE_NOTAVAIL 7 /* no record, hits, function disabled */
  393. #define OE_TIMEOUT 8
  394. #define OE_WRAPPED 9 /* got next item instead of reqstd item */
  395. #define OE_SYSTEM_STOP 10 /* error: search canceled by OE */
  396. #define OE_BAD_PASSWD 11 /* invalid password */
  397. #define OE_BAD_HITLIST 12 /* invalid hitlist */
  398. #define OE_DISABLED 13 /* requested function disabled at this site */
  399. #define OE_USER_STOP 14 /* search canceled by user */
  400. #define OE_BAD_COMM 15 /* request canceled by comm layer */
  401. #define OE_NOOP 888 /* No Operation, nothing done */
  402. #define OE_ABORT 999 /* fatal OE error, OE permanently disabled */
  403. /****************************************/
  404. /* */
  405. /* OEFTAB */
  406. /* */
  407. /****************************************/
  408. /* Table used in load_ocf() oe_uninitialize() to allow overriding default
  409. * locations of various files. Complete discussion in .ocf documentation.
  410. */
  411. typedef struct
  412. {
  413. char *id; /* keyword identifier */
  414. char **OEFptr; /* addr of variable to change */
  415. char previously_specified; /* bool ensures only one spec */
  416. } OEFTAB;
  417. /****************************************/
  418. /* */
  419. /* USRBLK */
  420. /* */
  421. /****************************************/
  422. typedef struct
  423. {
  424. char userid [10]; /* 1 - 8 alphanumeric char */
  425. int search_type; /* single char = curr search type.
  426. * 'T' = Semantic Text search
  427. * 'W' = Exact Words search
  428. * 'S' = Stems search
  429. * 'Z' = Fzkey search
  430. * 'N' = Navigator string (unpacked fzk) srch
  431. * 'P' = Statistical (Probabilistic) search
  432. */
  433. long flags; /* bit switches... */
  434. #define USR_BIT_1 0x0001L /* (reserved) */
  435. #define USR_NO_ITERATE 0x0002L /* override iterations in workprocs */
  436. #define USR_STOPSRCH 0x0004L /* the "stop" button, cancels workproc */
  437. #define USR_MAXMIN 0x0008L /* symdif() algorithm = fuzzy max min */
  438. #define USR_OBJDATES 0x0010L /* restrict hitlists to objdate ranges */
  439. #define USR_KWIC_ABSTR 0x0020L /* retn KeyWord In Context for abstract */
  440. #define USR_NO_INFOMSGS 0x0040L /* do not retn information-only msgs to UI */
  441. #define USR_MAXHITS_MSG 0x0080L /* show # hits each keytype if sum > maxhits */
  442. #define USR_SORT_WHITL 0x0100L /* sort word/stem hitlists by semantics */
  443. long debug; /* Nonproduction bit switches */
  444. #define USRDBG_RARE 0x0001L /* 1 Misc initialzatn trace msgs */
  445. #define USRDBG_SRCHCMPL 0x0002L /* 2 trace ui search_completed functions */
  446. #define USRDBG_RETRVL 0x0004L /* 4 trace record retrieval funcs */
  447. #define USRDBG_ITERATE 0x0008L /* 8 forces iteration on all iterable cmds */
  448. #define USRDBG_UTIL 0x0010L /* 16 trace misc utility functions */
  449. #define USRDBG_MEDPRMPT 0x0020L /* 32 Prints prompt of medley sockets cmds */
  450. #define USRDBG_HITLIST 0x0040L /* 64 print hitlists after searches */
  451. #define USRDBG_SYMP 0x0080L /* 128 trace symptom search funcs */
  452. #define USRDBG_DELETE 0x0100L /* 256 trace record deletion functions */
  453. #define USRDBG_RPC 0x0200L /* 512 trace RPC communications funcs */
  454. #define USRDBG_VERBOSE 0x0400L /* 1024 verbose debugging: iterative details */
  455. #define USRDBG_HILITE 0x0800L /* 2048 trace hiliting functions */
  456. #define USRDBG_PARSE 0x1000L /* 4096 trace linguistic parse/stem funcs */
  457. #define USRDBG_BOOL 0x2000L /* 8192 trace boolean parse funcs */
  458. int request;
  459. int retncode;
  460. char *query; /* input data for text searches */
  461. DtSrObjdate objdate1; /* only retn hit objects >= (after) date1 */
  462. DtSrObjdate objdate2; /* only retn hit objects <= (before) date2 */
  463. DB_ADDR dba; /* for direct dba reads */
  464. DB_ADDR *dbatab; /* array of dba's for batch deletes */
  465. int dbacount; /* # of dba's in dbatab */
  466. void (*workproc) (void);
  467. /* (1) If single tasking (iterative), OE places ptr to work
  468. procedure. (2) If multitasking (no iterations), UI places
  469. ptr of func to call when OE's spawned subtask is done. */
  470. DBLK *dblist; /* linked list of all databases */
  471. DBLK *dblk; /* users curr database selection */
  472. DtSrResult *dittolist; /* hitlist retnd from various searches */
  473. long dittocount; /* # of items on hitlist */
  474. int stemcount; /* # of wordstems in 'stems' array */
  475. char stems [DtSrMAX_STEMCOUNT] [DtSrMAXWIDTH_HWORD];
  476. /* for hiliting words in text records */
  477. struct or_objrec objrec; /* austext record buffer */
  478. char *abstrbuf; /* buf to hold abstracts */
  479. int abstrbufsz; /* maximum abstract size all databases */
  480. char *cleartext; /* decompressed austext record text */
  481. long clearlen; /* size of cleartext in bytes */
  482. LLIST *notes; /* uncompressed, right out of vista */
  483. DtSrHitword *hitwords; /* array of hit words inside cleartext */
  484. long hitwcount; /* number of elements in hitwords array */
  485. } USRBLK;
  486. /****************************************/
  487. /* */
  488. /* SAVEUSR */
  489. /* */
  490. /****************************************/
  491. /* The following data is saved between calls of the workprocs.
  492. * In a future msg passing protocol where there may be multiple UIs
  493. * per OE, this data would be maintained in a list of structures,
  494. * one for each currently active search (UI only passes user id name
  495. * in iterative calls, OE searches list to match curr status).
  496. * But for now, this will have to do.
  497. */
  498. typedef struct
  499. {
  500. time_t start_time;
  501. int iterations;
  502. int vistano;
  503. DtSrResult *dittolist;
  504. long dittocount;
  505. int stemcount;
  506. char stems [DtSrMAX_STEMCOUNT] [DtSrMAXWIDTH_HWORD];
  507. char ktchars [MAX_KTCOUNT + 2];
  508. char *lastqry;
  509. long ktsum [MAX_KTCOUNT + 1];
  510. } SAVEUSR;
  511. /*--------------- GLOBALS in oe.c, loadocf.c -------------------*/
  512. extern char **ausapi_dbnamesv;
  513. extern int ausapi_dbnamesc;
  514. extern USRBLK usrblk;
  515. extern char *global_memory_ptr;
  516. extern OEFTAB oef_table[];
  517. extern SAVEUSR saveusr; /* (only one for now) */
  518. extern int shm_id;
  519. extern int OE_bmhtab_strlen [DtSrMAX_STEMCOUNT];
  520. extern size_t OE_bmhtables [DtSrMAX_STEMCOUNT] [MAX_BMHTAB];
  521. extern int OE_dbn;
  522. extern int OE_enable_markdel;
  523. extern int OE_enable_usernotes;
  524. extern time_t *OE_expiration;
  525. extern int OE_fastdecode;
  526. extern char *OE_fileio;
  527. extern long OE_flags;
  528. #define OE_AUDIT 1L /* enables audit file logging */
  529. #define OE_INITOK (1L<<1) /* ensures first reqst was INITIALIZE */
  530. #define OE_PERMERR (1L<<2) /* disables engine on fatal errors */
  531. #define OE_NO_ITERATE (1L<<3) /* override iterations in workprocs */
  532. extern char *OE_inittab_dir; /* local dir of server daemon */
  533. extern long OE_objsize;
  534. extern char *OE_prodname;
  535. extern int OE_search_type;
  536. extern char *OE_server_dir; /* local dir of server daemon */
  537. extern char *OE_sitecnfg_fname;
  538. extern time_t OE_sitecnfg_mtime;
  539. extern int OE_uppercase_keys;
  540. extern long OE_words_hitlimit;
  541. /* Global pointers to formerly hardcoded path/file names.
  542. * The comment names the #define constant under which the
  543. * filename is/was specified in either fuzzy.h or oe.h.
  544. */
  545. extern char *OEF_audit; /* FNAME_AUDIT */
  546. extern char *OEF_discard; /* FNAME_DISCARD_DATA */
  547. extern char *OEF_news; /* FNAME_SITENEWS */
  548. extern char *OEF_notesnot; /* FNAME_NOTES_BAC */
  549. extern char *OEF_notessem; /* FNAME_NOTES_SEM */
  550. extern char *OEF_readme; /* FNAME_README */
  551. /*---------------- FUNCTION PROTOTYPES ----------------------*/
  552. extern char *calloe_getrec (char *dbname, DB_ADDR dba,
  553. LLIST **global_msglist);
  554. extern long calloe_hilite (char *cleartext, DtSrHitword *hitwords,
  555. LLIST **global_msglist);
  556. extern DtSrResult
  557. *calloe_search (char *qry, char *dbname,
  558. int search_type, LLIST **global_msglist);
  559. extern int call_output_script (char *shellcmd, char *text);
  560. extern void clear_hitwords (void);
  561. extern void clear_usrblk_record (void);
  562. extern void dummy_workproc (void);
  563. extern char *ensure_end_slash (char *charbuf);
  564. extern void fasthuf (UCHAR *input_bitstring, UCHAR *output_charbuf,
  565. int outbuf_size, time_t encode_id);
  566. extern char *get_hitlist_text (int maxlen);
  567. extern long hilite_cleartext (int parse_type, char *stems, int stemcount);
  568. extern int load_ocf (void);
  569. extern char *nowstring (time_t *now);
  570. extern void oe_initialize (void);
  571. extern int oe_unblob (LLIST *bloblist);
  572. extern void oe_write_audit_rec (long numhits);
  573. extern void Opera_Engine (void);
  574. extern void print_dittolist (DtSrResult *dittolist, char *label);
  575. extern void print_stems (int stemcount, void *stems, char *locstr);
  576. extern void print_usrblk_record (char *label);
  577. extern void release_shm_mem (void);
  578. extern char *retncode_str (int num);
  579. extern void symptom_search (void);
  580. extern int ve_append_notes (void);
  581. extern void ve_browse_dba (int direction);
  582. extern LLIST *ve_getblobs (DtSrINT32 dba, int vistano);
  583. extern int ve_getrec_dba (LLIST **bloblist);
  584. extern int ve_initialize (void);
  585. extern void ve_ditto (void);
  586. extern DtSrINT32 ve_reckey2dba (void);
  587. extern void ve_statistical (void);
  588. extern void ve_stem_search (void);
  589. extern void ve_word_search (void);
  590. extern void ve_shutdown (void);
  591. /***************************** SearchE.h ******************************/
  592. #endif /* _SearchE_h */