SearchP.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  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:
  27. *
  28. * ORIGINS: 27
  29. *
  30. *
  31. * (C) COPYRIGHT International Business Machines Corp. 1990,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 _SearchP_h
  38. #define _SearchP_h
  39. /************************ SearchP.h ********************************
  40. * $XConsortium: SearchP.h /main/9 1996/10/12 16:10:00 cde-ibm $
  41. * June 1990.
  42. * Private header file for DtSearch/AusText used by
  43. * both build tools and search engine.
  44. * Derived from original IBM fuzzy.h.
  45. *
  46. * Hierarchies of DtSearch/AusText Search*.h #includes:
  47. * Search.h is Dt/Aus public header, defines _XOPEN_SOURCE.
  48. * SearchP.h is private Dt/Aus, includes Search.h.
  49. * semantic.h is private Aus only, defines _ALL_SOURCE,
  50. * includes SearchP.h.
  51. * (Should be specified in place of SearchP.h).
  52. * SearchE.h is private engine header Dt/Aus. Invokes either
  53. * SearchP.h or semantic.h depending on whether DTSEARCH defined.
  54. * Only one of the above should be specified. They should always
  55. * be first include to get the _SOURCE defines right.
  56. * DTSEARCH should be defined on compiler cmd line.
  57. *
  58. * $Log$
  59. * Revision 2.11 1996/04/10 19:44:43 miker
  60. * AusText 2.1.13, DtSearch 0.5. Documentation cleanup.
  61. *
  62. * Revision 2.10 1996/03/13 22:35:14 miker
  63. * Added UCHAR definition. Changed char to UCHAR several places.
  64. *
  65. * Revision 2.9 1996/03/05 16:48:56 miker
  66. * Add COMMENT_CHARS from lang.c.
  67. *
  68. * Revision 2.8 1996/03/05 15:58:57 miker
  69. * Replace vewords with yacc-based boolean search.
  70. *
  71. * Revision 2.7 1996/02/01 16:26:06 miker
  72. * AUSAPI_VERSION 2.1.11, DtSearch 0.3:
  73. * Changed parsers to use character reading cofunctions.
  74. *
  75. * Revision 2.6 1995/12/27 15:51:36 miker
  76. * Version 2.1.10: First GA release of AusBuild.
  77. *
  78. * Revision 2.5 1995/12/07 23:24:38 miker
  79. * Version 2.1.9e: Freezing AusBuild version with
  80. * everything except multiple source files dialog box.
  81. *
  82. * Revision 2.4 1995/10/25 22:29:29 miker
  83. * Added prolog.
  84. *
  85. * Revision 2.3 1995/10/19 19:07:42 miker
  86. * Changed AUSAPI_VERSION to 2.1.9 (but not yet released).
  87. *
  88. * Revision 2.2 1995/10/03 21:36:13 miker
  89. * Added 'const' to strdup prototype for greater portability.
  90. *
  91. * Revision 2.1 1995/09/22 22:39:41 miker
  92. * Freeze DtSearch 0.1, AusText 2.1.8
  93. *
  94. * Revision 1.3 1995/09/19 21:38:59 miker
  95. * Removed debugging #defines.
  96. */
  97. #include "Search.h" /* the "public" header file */
  98. #include <Dt/MsgCatP.h> /* for nl_catd below and all cat...() funcs */
  99. #include <sys/types.h>
  100. #include <netinet/in.h>
  101. #define AUSAPI_VERSION "2.1.13"
  102. /* Format: "v.r.m", where v,r,m are integer substrings
  103. * meaning version, revision, and mod respectively.
  104. * Complete new version austomatically sets revision=1, mod=0.
  105. * New revision within a version just sets mod=0.
  106. * When mod=0, full string may be abbreviated to "v.r".
  107. * Full string will contain no whitespace.
  108. * AUSAPI_VERSION is compared to current versions of database
  109. * schemas and client/server protocols by ausapi_init().
  110. * By convention, AusText programs display AUSAPI_VERSION
  111. * at the top of the main gui window and in usage statements.
  112. */
  113. #define SCHEMA_VERSION "2.0"
  114. /* Identifies when schema last changed.
  115. * Same format as AUSAPI_VERSION, except only "v.r" substring used.
  116. * To ensure compatibility, database programs must have v.r integers
  117. * within the range between SCHEMA_VERSION and AUSAPI_VERSION.
  118. * The 3rd integer, the 'mod' number, never matters.
  119. */
  120. #define PROTOCOL_VERSION "2.1"
  121. /* Identifies when protocol between ui and engine/ausapi
  122. * last changed. Typical changes would be changes to major
  123. * structures like usrblk, dblk, and socblk, or changes to
  124. * the arguments for either ausapi or Opera_Engine calls.
  125. * Only meaningful for client/server systems.
  126. * Same format as AUSAPI_VERSION, except only "v.r" substring used.
  127. * To ensure compatibility, clients must have v.r integers
  128. * within the range between PROTOCOL_VERSION and AUSAPI_VERSION
  129. * of the engine. The 3rd integer, the 'mod' number, never matters.
  130. */
  131. /*------------- #define Compiler and related #defines ------------------
  132. * #define TURBO_COMPILER...
  133. * #define PS2AIX_COMPILER...
  134. * #define AIX370_COMPILER...
  135. * #define HP_COMPILER...
  136. * #define _AIX...
  137. * ... define one of the above at top of Search.h to provide
  138. * structures and functions that are compiler dependent.
  139. * Since the compiler definition must precede all other headers,
  140. * the #include for Search.h must be the first statement of all source
  141. * files.
  142. *
  143. * UCHAR corrects for compilers whose default char is signed.
  144. */
  145. #define UCHAR unsigned char
  146. #ifdef TURBO_COMPILER
  147. #define LINT_ARGS /* establishes strong prototyping in vista */
  148. #define ANSI /* allow multiple databases in vista */
  149. #else
  150. #define SINGLE_USER /* eliminate vista lockmgr */
  151. #define UNIX /* used in vista.h and elsewhere */
  152. #endif
  153. /*----------------------- AUSTEXT.H ---------------------
  154. * DBMS record/key structure and constant declarations.
  155. * These represent the database schema formerly in austext.h
  156. * and derived from austext.sch.
  157. */
  158. typedef struct or_dbrec {
  159. DtSrUINT32 or_dbflags;
  160. DtSrUINT32 or_dbuflags;
  161. DtSrINT32 or_reccount;
  162. DtSrINT32 or_maxdba;
  163. DtSrINT32 or_availd99;
  164. DtSrINT32 or_unavaild99;
  165. DtSrINT32 or_hufid;
  166. DtSrINT32 or_dbsecmask;
  167. char or_version[8];
  168. char or_dbfill[50];
  169. DtSrINT16 or_dbotype;
  170. DtSrINT16 or_compflags;
  171. DtSrINT16 or_dbaccess;
  172. DtSrINT16 or_minwordsz;
  173. DtSrINT16 or_maxwordsz;
  174. DtSrINT16 or_recslots;
  175. DtSrINT16 or_fzkeysz;
  176. DtSrINT16 or_abstrsz;
  177. DtSrINT16 or_language;
  178. } DBREC;
  179. struct or_dbmiscrec {
  180. DtSrINT16 or_dbmisctype;
  181. char or_dbmisc[1][106];
  182. };
  183. struct or_objrec {
  184. DtSrUINT32 or_objflags;
  185. DtSrUINT32 or_objuflags;
  186. DtSrINT32 or_objsize;
  187. DtSrINT32 or_objdate;
  188. DtSrINT32 or_objsecmask;
  189. char or_objkey[32];
  190. char or_objfill[34];
  191. DtSrINT16 or_objaccess;
  192. DtSrINT16 or_objtype;
  193. DtSrINT16 or_objcost;
  194. DtSrINT16 or_objhdroffset;
  195. DtSrINT16 or_objeureka;
  196. };
  197. struct or_miscrec {
  198. DtSrINT16 or_misctype;
  199. char or_misc[1][105];
  200. };
  201. struct or_blobrec {
  202. DtSrINT16 or_bloblen;
  203. char or_blob[234][1];
  204. };
  205. struct or_swordrec {
  206. char or_swordkey[16];
  207. DtSrINT32 or_swoffset;
  208. DtSrINT32 or_swfree;
  209. DtSrINT32 or_swaddrs;
  210. };
  211. struct or_lwordrec {
  212. char or_lwordkey[40];
  213. DtSrINT32 or_lwoffset;
  214. DtSrINT32 or_lwfree;
  215. DtSrINT32 or_lwaddrs;
  216. };
  217. struct or_hwordrec {
  218. char or_hwordkey[134];
  219. DtSrINT32 or_hwoffset;
  220. DtSrINT32 or_hwfree;
  221. DtSrINT32 or_hwaddrs;
  222. };
  223. /* File Id Constants */
  224. #define OR_D00 0
  225. #define OR_D01 1
  226. #define OR_D21 2
  227. #define OR_D22 3
  228. #define OR_D23 4
  229. #define OR_K00 5
  230. #define OR_K01 6
  231. #define OR_K21 7
  232. #define OR_K22 8
  233. #define OR_K23 9
  234. /* Record Name Constants */
  235. #define OR_DBREC 10000
  236. #define OR_DBMISCREC 10001
  237. #define OR_OBJREC 10002
  238. #define OR_MISCREC 10003
  239. #define OR_BLOBREC 10004
  240. #define OR_SWORDREC 10005
  241. #define OR_LWORDREC 10006
  242. #define OR_HWORDREC 10007
  243. /* Field Name Constants */
  244. #define OR_DBFLAGS 0L
  245. #define OR_DBUFLAGS 1L
  246. #define OR_RECCOUNT 2L
  247. #define OR_MAXDBA 3L
  248. #define OR_AVAILD99 4L
  249. #define OR_UNAVAILD99 5L
  250. #define OR_HUFID 6L
  251. #define OR_DBSECMASK 7L
  252. #define OR_VERSION 8L
  253. #define OR_DBFILL 9L
  254. #define OR_DBOTYPE 10L
  255. #define OR_COMPFLAGS 11L
  256. #define OR_DBACCESS 12L
  257. #define OR_MINWORDSZ 13L
  258. #define OR_MAXWORDSZ 14L
  259. #define OR_RECSLOTS 15L
  260. #define OR_FZKEYSZ 16L
  261. #define OR_ABSTRSZ 17L
  262. #define OR_LANGUAGE 18L
  263. #define OR_DBMISCTYPE 1000L
  264. #define OR_DBMISC 1001L
  265. #define OR_OBJFLAGS 2000L
  266. #define OR_OBJUFLAGS 2001L
  267. #define OR_OBJSIZE 2002L
  268. #define OR_OBJDATE 2003L
  269. #define OR_OBJSECMASK 2004L
  270. #define OR_OBJKEY 2005L
  271. #define OR_OBJFILL 2006L
  272. #define OR_OBJACCESS 2007L
  273. #define OR_OBJTYPE 2008L
  274. #define OR_OBJCOST 2009L
  275. #define OR_OBJHDROFFSET 2010L
  276. #define OR_OBJEUREKA 2011L
  277. #define OR_MISCTYPE 3000L
  278. #define OR_MISC 3001L
  279. #define OR_BLOBLEN 4000L
  280. #define OR_BLOB 4001L
  281. #define OR_SWORDKEY 5000L
  282. #define OR_SWOFFSET 5001L
  283. #define OR_SWFREE 5002L
  284. #define OR_SWADDRS 5003L
  285. #define OR_LWORDKEY 6000L
  286. #define OR_LWOFFSET 6001L
  287. #define OR_LWFREE 6002L
  288. #define OR_LWADDRS 6003L
  289. #define OR_HWORDKEY 7000L
  290. #define OR_HWOFFSET 7001L
  291. #define OR_HWFREE 7002L
  292. #define OR_HWADDRS 7003L
  293. /* Set Name Constants */
  294. #define OR_DB_MISCS 20000
  295. #define OR_OBJ_BLOBS 20001
  296. #define OR_OBJ_MISCS 20002
  297. /*----------------------- end AUSTEXT.H ---------------------*/
  298. /*------------- DMACROS.H -------------------
  299. * The following were formerly in dmacros.h.
  300. * They provide macro enhancements to the
  301. * DBMS function prototypes in vista.h.
  302. * Each DBMS function is coded in a macro which includes
  303. * a location string (usually module name + line number).
  304. * The location string is printed whenever there is
  305. * a user or system failure.
  306. * Warning: These should not be coded naked within 'if-else' statements
  307. * because the 'if' in the macros will interfere with the outside else.
  308. */
  309. #define CMSTAT(s,a,b) if(d_cmstat(a,b) < S_OKAY) vista_abort(s)
  310. #define CMTYPE(s,a,b,c) if(d_cmtype(a,b,c) < S_OKAY) vista_abort(s)
  311. #define CONNECT(s,a,b) if(d_connect(a,b) < S_OKAY) vista_abort(s)
  312. #define COSTAT(s,a,b) if(d_costat(a,b) < S_OKAY) vista_abort(s)
  313. #define COTYPE(s,a,b,c) if(d_cotype(a,b,c) < S_OKAY) vista_abort(s)
  314. #define CRGET(s,a,b) if(d_crget(a,b) < S_OKAY) vista_abort(s)
  315. #define CRREAD(s,a,b,c) if(d_crread(a,b,c) < S_OKAY) vista_abort(s)
  316. #define CRSET(s,a,b) if(d_crset(a,b) < S_OKAY) vista_abort(s)
  317. #define CRSTAT(s,a) if(d_crstat(a) < S_OKAY) vista_abort(s)
  318. #define CRTYPE(s,a,b) if(d_crtype(a,b) < S_OKAY) vista_abort(s)
  319. #define CRWRITE(s,a,b,c) if(d_crwrite(a,b,c) < S_OKAY) vista_abort(s)
  320. #define CSMGET(s,a,b,c) if(d_csmget(a,b,c) < S_OKAY) vista_abort(s)
  321. #define CSMREAD(s,a,b,c,d) if(d_csmread(a,b,c,d) < S_OKAY) vista_abort(s)
  322. #define CSMSET(s,a,b,c) if(d_csmset(a,b,c) < S_OKAY) vista_abort(s)
  323. #define CSMWRITE(s,a,b,c,d) if(d_csmwrite(a,b,c,d) < S_OKAY) vista_abort(s)
  324. #define CSOGET(s,a,b,c) if(d_csoget(a,b,c) < S_OKAY) vista_abort(s)
  325. #define CSOREAD(s,a,b,c,d) if(d_csoread(a,b,c,d) < S_OKAY) vista_abort(s)
  326. #define CSOSET(s,a,b,c) if(d_csoset(a,b,c) < S_OKAY) vista_abort(s)
  327. #define CSOWRITE(s,a,b,c,d) if(d_csowrite(a,b,c,d) < S_OKAY) vista_abort(s)
  328. #define CSSTAT(s,a,b) if(d_csstat(a,b) < S_OKAY) vista_abort(s)
  329. #define CTBPATH(s,a) if(d_ctbpath(a) < S_OKAY) vista_abort(s)
  330. #define CTSCM(s,a,b,c) if(d_ctscm(a,b,c) < S_OKAY) vista_abort(s)
  331. #define CTSCO(s,a,b,c) if(d_ctsco(a,b,c) < S_OKAY) vista_abort(s)
  332. #define CTSCR(s,a,b) if(d_ctscr(a,b) < S_OKAY) vista_abort(s)
  333. #define DBDPATH(s,a) if(d_dbdpath(a) < S_OKAY) vista_abort(s)
  334. #define DBFPATH(s,a) if(d_dbfpath(a) < S_OKAY) vista_abort(s)
  335. #define DBLOG(s,a) if(d_dblog(a) < S_OKAY) vista_abort(s)
  336. #define DBTAF(s,a) if(d_dbtaf(a) < S_OKAY) vista_abort(s)
  337. #define DBUSERID(s,a) if(d_dbuserid(a) < S_OKAY) vista_abort(s)
  338. #define DECODE_DBA(s,a,b,c) if(d_decode_dba(a,b,c) < S_OKAY) vista_abort(s)
  339. #define DELETE(s,a) if(d_delete(a) < S_OKAY) vista_abort(s)
  340. #define DESTROY(s,a) if(d_desoy(a) < S_OKAY) vista_abort(s)
  341. #define DISCON(s,a,b) if(d_discon(a,b) < S_OKAY) vista_abort(s)
  342. #define DISDEL(s,a) if(d_disdel(a) < S_OKAY) vista_abort(s)
  343. #define ENCODE_DBA(s,a,b,c) if(d_encode_dba(a,b,c) < S_OKAY) vista_abort(s)
  344. #define FILLNEW(s,a,b,c) if(d_fillnew(a,b,c) < S_OKAY) vista_abort(s)
  345. #define FINDCO(s,a,b) if(d_findco(a,b) < S_OKAY) vista_abort(s)
  346. #define FINDFM(s,a,b) if(d_findfm(a,b) < S_OKAY) vista_abort(s)
  347. #define FINDLM(s,a,b) if(d_findlm(a,b) < S_OKAY) vista_abort(s)
  348. #define FINDNM(s,a,b) if(d_findnm(a,b) < S_OKAY) vista_abort(s)
  349. #define FINDPM(s,a,b) if(d_findpm(a,b) < S_OKAY) vista_abort(s)
  350. #define FREEALL(s) if(d_freeall() < S_OKAY) vista_abort(s)
  351. #define GTSCM(s,a,b,c) if(d_gtscm(a,b,c) < S_OKAY) vista_abort(s)
  352. #define GTSCO(s,a,b,c) if(d_gtsco(a,b,c) < S_OKAY) vista_abort(s)
  353. #define GTSCR(s,a,b) if(d_gtscr(a,b) < S_OKAY) vista_abort(s)
  354. #define GTSCS(s,a,b,c) if(d_gtscs(a,b,c) < S_OKAY) vista_abort(s)
  355. #define INITFILE(s,a,b) if(d_initfile(a,b) < S_OKAY) vista_abort(s)
  356. #define INITIALIZE(s,a) if(d_initialize(a) < S_OKAY) vista_abort(s)
  357. #define ISMEMBER(s,a,b) if(d_ismember(a,b) < S_OKAY) vista_abort(s)
  358. #define ISOWNER(s,a,b) if(d_isowner(a,b) < S_OKAY) vista_abort(s)
  359. #define KEYDEL(s,a,b) if(d_keydel(a,b) < S_OKAY) vista_abort(s)
  360. #define KEYEXIST(s,a,b) if(d_keyexist(a,b) < S_OKAY) vista_abort(s)
  361. #define KEYFIND(s,a,b,c) if(d_keyfind(a,b,c) < S_OKAY) vista_abort(s)
  362. #define KEYFREE(s,a,b) if(d_keyfree(a,b) < S_OKAY) vista_abort(s)
  363. #define KEYFRST(s,a,b) if(d_keyfrst(a,b) < S_OKAY) vista_abort(s)
  364. #define KEYLAST(s,a,b) if(d_keylast(a,b) < S_OKAY) vista_abort(s)
  365. #define KEYLOCK(s,a,b,c) if(d_keylock(a,b,c) < S_OKAY) vista_abort(s)
  366. #define KEYLSTAT(s,a,b,c) if(d_keylstat(a,b,c) < S_OKAY) vista_abort(s)
  367. #define KEYNEXT(s,a,b) if(d_keynext(a,b) < S_OKAY) vista_abort(s)
  368. #define KEYPREV(s,a,b) if(d_keyprev(a,b) < S_OKAY) vista_abort(s)
  369. #define KEYREAD(s,a) if(d_keyread(a) < S_OKAY) vista_abort(s)
  370. #define KEYSTORE(s,a,b) if(d_keystore(a,b) < S_OKAY) vista_abort(s)
  371. #define LOCK(s,a,b,c) if(d_lock(a,b,c) < S_OKAY) vista_abort(s)
  372. #define MAKENEW(s,a,b) if(d_makenew(a,b) < S_OKAY) vista_abort(s)
  373. #define MAPCHAR(s,a,b,c,d) if(d_mapchar(a,b,c,d) < S_OKAY) vista_abort(s)
  374. #define MEMBERS(s,a,b,c) if(d_members(a,b,c) < S_OKAY) vista_abort(s)
  375. #define OFF_OPT(s,a) if(d_off_opt(a) < S_OKAY) vista_abort(s)
  376. #define ON_OPT(s,a) if(d_on_opt(a) < S_OKAY) vista_abort(s)
  377. #define OPEN(s,a,b) if(d_open(a,b) < S_OKAY) vista_abort(s)
  378. #define RDCURR(s,a,b) if(d_rdcurr(a,b) < S_OKAY) vista_abort(s)
  379. #define RECFREE(s,a,b) if(d_recfree(a,b) < S_OKAY) vista_abort(s)
  380. #define RECFRST(s,a,b) if(d_recfrst(a,b) < S_OKAY) vista_abort(s)
  381. #define RECLAST(s,a,b) if(d_reclast(a,b) < S_OKAY) vista_abort(s)
  382. #define RECLOCK(s,a,b,c) if(d_reclock(a,b,c) < S_OKAY) vista_abort(s)
  383. #define RECLSTAT(s,a,b,c) if(d_reclstat(a,b,c) < S_OKAY) vista_abort(s)
  384. #define RECNEXT(s,a) if(d_recnext(a) < S_OKAY) vista_abort(s)
  385. #define RECOVER(s,a) if(d_recover(a) < S_OKAY) vista_abort(s)
  386. #define RECPREV(s,a) if(d_recprev(a) < S_OKAY) vista_abort(s)
  387. #define RECREAD(s,a,b) if(d_recread(a,b) < S_OKAY) vista_abort(s)
  388. #define RECSET(s,a,b) if(d_recset(a,b) < S_OKAY) vista_abort(s)
  389. #define RECSTAT(s,a,b,c) if(d_recstat(a,b,c) < S_OKAY) vista_abort(s)
  390. #define RECWRITE(s,a,b) if(d_recwrite(a,b) < S_OKAY) vista_abort(s)
  391. #define RENFILE(s,a,b,c) if(d_renfile(a,b,c) < S_OKAY) vista_abort(s)
  392. #define RLBCLR(s,a) if(d_rlbclr(a) < S_OKAY) vista_abort(s)
  393. #define RLBSET(s,a) if(d_rlbset(a) < S_OKAY) vista_abort(s)
  394. #define RLBTST(s,a) if(d_rlbtst(a) < S_OKAY) vista_abort(s)
  395. #define SETDB(s,a) if(d_setdb(a) < S_OKAY) vista_abort(s)
  396. #define SETFILES(s,a) if(d_setfiles(a) < S_OKAY) vista_abort(s)
  397. #define SETFREE(s,a,b) if(d_setfree(a,b) < S_OKAY) vista_abort(s)
  398. #define SETLOCK(s,a,b,c) if(d_setlock(a,b,c) < S_OKAY) vista_abort(s)
  399. #define SETLSTAT(s,a,b,c) if(d_setlstat(a,b,c) < S_OKAY) vista_abort(s)
  400. #define SETMM(s,a,b,c) if(d_setmm(a,b,c) < S_OKAY) vista_abort(s)
  401. #define SETMO(s,a,b,c) if(d_setmo(a,b,c) < S_OKAY) vista_abort(s)
  402. #define SETMR(s,a,b) if(d_setmr(a,b) < S_OKAY) vista_abort(s)
  403. #define SETOM(s,a,b,c) if(d_setom(a,b,c) < S_OKAY) vista_abort(s)
  404. #define SETOO(s,a,b,c) if(d_setoo(a,b,c) < S_OKAY) vista_abort(s)
  405. #define SETOR(s,a,b) if(d_setor(a,b) < S_OKAY) vista_abort(s)
  406. #define SETPAGES(s,a,b) if(d_setpages(a,b) < S_OKAY) vista_abort(s)
  407. #define SETRM(s,a,b) if(d_setrm(a,b) < S_OKAY) vista_abort(s)
  408. #define SETRO(s,a,b) if(d_setro(a,b) < S_OKAY) vista_abort(s)
  409. #define STSCM(s,a,b,c) if(d_stscm(a,b,c) < S_OKAY) vista_abort(s)
  410. #define STSCO(s,a,b,c) if(d_stsco(a,b,c) < S_OKAY) vista_abort(s)
  411. #define STSCR(s,a,b) if(d_stscr(a,b) < S_OKAY) vista_abort(s)
  412. #define STSCS(s,a,b,c) if(d_stscs(a,b,c) < S_OKAY) vista_abort(s)
  413. #define TIMEOUT(s,a) if(d_timeout(a) < S_OKAY) vista_abort(s)
  414. #define TRABORT(s) if(d_trabort() < S_OKAY) vista_abort(s)
  415. #define TRBEGIN(s,a) if(d_trbegin(a) < S_OKAY) vista_abort(s)
  416. #define TREND(s) if(d_trend() < S_OKAY) vista_abort(s)
  417. #define UTSCM(s,a,b,c) if(d_utscm(a,b,c) < S_OKAY) vista_abort(s)
  418. #define UTSCO(s,a,b,c) if(d_utsco(a,b,c) < S_OKAY) vista_abort(s)
  419. #define UTSCR(s,a,b) if(d_utscr(a,b) < S_OKAY) vista_abort(s)
  420. #define UTSCS(s,a,b,c) if(d_utscs(a,b,c) < S_OKAY) vista_abort(s)
  421. #define WRCURR(s,a) if(d_wrcurr(a) < S_OKAY) vista_abort(s)
  422. /*------------- end DMACROS.H -------------------*/
  423. /*------------- COMPILER DEPENDENT CONSTANTS -------------------*/
  424. #ifdef TURBO_COMPILER
  425. #define FNAME_NULL "nul"
  426. #define LOCAL_SLASH 92 /* ascii back slash char (\) */
  427. #endif
  428. #ifdef UNIX
  429. #define FNAME_NULL "/dev/null"
  430. #define LOCAL_SLASH 47 /* ascii forward slash char (/) */
  431. #endif
  432. /*------------ COMPILER INDEPENDENT CONSTANTS -------------------*/
  433. #define CACHE_SIZE 64 /* used in vista d_setpages() function */
  434. #define COMMENT_CHARS "#*$!\n" /* identify comment lines in AusText files */
  435. #define CTRL_Z 26
  436. #define DIT_FINDSTR 1L /* DITTO.flags: retained aft FINDSTR srch */
  437. #define DIT_STOP 2L /* DITTO.flags: node where user pushed stop */
  438. #define END_RETAIN_PAGE 11 /* VT = marks end of RETAIN page */
  439. /***#define END_RETAIN_REC '\f'****/
  440. #define EXT_CHARTYPE ".chr" /* user definable wildcards (from LOADCHR) */
  441. #define EXT_CANDI ".can" /* candidate dictionary words format */
  442. #define EXT_CONFIG ".ocf" /* standard opera configuration file */
  443. #define EXT_DTBS ".d99" /* inverted index file for dbase addrs */
  444. #define EXT_FZKEY ".fzk" /* output of all opera text anal pgms */
  445. #define EXT_HANDEL ".han" /* standard handel profile file format */
  446. #define EXT_HUFFCODE ".huf" /* huffman encode tree (from HUFFCODE) */
  447. #define EXT_HDECODE ".c" /* huffman decode tree (from HUFFCODE) */
  448. #define EXT_INCLIST ".inc" /* "include" list file name extension */
  449. #define EXT_LIST ".lst" /* standard wordlist format: 1 word/line */
  450. #define EXT_SCHEMA ".sch" /* vista database schema format */
  451. #define EXT_STOPLIST ".stp" /* standard stop list format */
  452. #define EXT_SURVEY ".sur" /* standard survey file format */
  453. #define EXT_TEMP ".tmp" /* any kind of temporary file */
  454. #define EXT_TEXT ".txt" /* freeform ascii text format */
  455. #define EXT_USRNOTES ".not" /* user notes flatfile format */
  456. #define ETXDELIM "\f\n" /* default end-of-text (ETX) delim str */
  457. #define FNAME_AUDIT "opaudit.lst"
  458. #define FNAME_AUSCAT "austools.cat" /* Austools msgs catalog */
  459. #define FNAME_AUSTEXT_TUTORIAL "austext.tut"
  460. #define FNAME_CONFIRM_LIST "todscrd.lst" /* Shankar/Tomita files */
  461. #define FNAME_DISCARD_DATA "shdscrd.lst" /* OEF_discard */
  462. #define FNAME_DTSRCAT "dtsearch" /* DtSearch msgs catalog */
  463. #define FNAME_HUFFCODE_TAB "ophuf.huf" /* huffman encode table */
  464. #define FNAME_MUIRES "mui.res" /* motif class resources file */
  465. #define FNAME_NOTES_BAC "usrnotes.not"
  466. #define FNAME_NOTES_SEM "usrnotes.sem"
  467. #define FNAME_ORIGSTOP "orig.stp"
  468. #define FNAME_README "readme.txt"
  469. #define FNAME_SITECONFIG "dtsearch.ocf"
  470. #define FNAME_SITENEWS "sitenews.txt"
  471. #define MINWIDTH_TOKEN 2 /* default smallest word/stem allowed */
  472. #define MAX_BMHTAB 256 /* max alphabet size in bmstrstr tables */
  473. #define MAX_ETXDELIM 100 /* max size of ETX delim string */
  474. #define MAX_KTCOUNT 64 /* max number of keytypes */
  475. #define MAXWIDTH_LWORD 40 /* = sizeof(or_lwordrec.or_lwordkey) */
  476. #define MAXWIDTH_SWORD 16 /* = sizeof(or_swordrec.or_swordkey) */
  477. #define NULLDATESTR "0/0/0~0:0"
  478. #define NUM_HOLES 256 /* array size for defragmentation */
  479. #define OBJDATESTR "%02d/%02d/%02d~%02d:%02d"
  480. #define PRODNAME "DtSearch"
  481. #define PWDMASKSZ 20
  482. #define SCREEN_WIDTH 80 /* max len text line in online OPERA pgms */
  483. #define STEM_CH 15 /* Ctrl-O stemmed word prefix character */
  484. /*--------------- BYTE SWAP DECLARATIONS ------------
  485. * The default database record format is the data ordering
  486. * for big endian machines (most significant byte first),
  487. * also known as "network" order. For non big_endian platforms,
  488. * all compiles should include the BYTE_SWAP define.
  489. * SWABDIR is direction of io to indicate correct byte swap function.
  490. * HTON is host to network, internal memory to external database file.
  491. * NTOH is network to host, file to memory.
  492. * Actual host_to_network functions defined in <netinit/in.h>
  493. * which is not yet standardized.
  494. */
  495. /* JET - Update 12/21/2021 - no need to define (or not) BYTE_SWAP
  496. * anymore as we can determine that via autotools (for the code).
  497. * Elsewhere, we can just use the systems hto*()/nto*() routines
  498. * regardless.
  499. */
  500. typedef enum {HTON=1, NTOH} SWABDIR;
  501. extern void swab_dbrec (struct or_dbrec *rec, SWABDIR direction);
  502. extern void swab_objrec (struct or_objrec *rec, SWABDIR direction);
  503. #define HTONL(x) x = htonl(x)
  504. #define HTONS(x) x = htons(x)
  505. #define NTOHL(x) x = ntohl(x)
  506. #define NTOHS(x) x = ntohs(x)
  507. /*--------------- TESKEY PARSE CHARACTER TYPES ------------
  508. * Used in langmap.c for linguistic parsing modules.
  509. * Low order byte reserved for uppercase image of character
  510. * as locale independent replacement for toupper() and strupr().
  511. */
  512. #define CONCORDABLE 0x4000 /* alpha, numeric: inside word */
  513. #define OPT_CONCORD 0x2000 /* "./-": maybe inside word, maybe outside */
  514. #define NON_CONCORD 0x1000 /* space, punctuation, etc: outside word */
  515. #define VOWEL 0x0800 /* concordable subtype: aeiou */
  516. #define CONSONANT 0x0400 /* concordable subtype: all alpha - vowels */
  517. #define NUMERAL 0x0200 /* concordable subtype: 0-9 */
  518. #define WHITESPACE 0x0100 /* locale indep replacement for isspace() */
  519. /*--------------- SCHEMA CONSTANTS ----------------
  520. * Associated with fields in database schema (austext.h)
  521. * and in DITTO structures.
  522. * Values 20000 - 29999 reserved for custom user applic in all cardinal ints.
  523. * ORA_ retrieval access location cardinal integers in or_access.
  524. * ORC_ compression id bit switches in or_compflags.
  525. * ORD_ bit switches in or_dbflags.
  526. * (ORO_ bit switches in or_objflags
  527. * renamed to DtSrFlxxx and moved to Search.h)
  528. * ORM_ type cardinal integers in or_misctype.
  529. * (ORT_ object type (or_objtype, or_dbotype, DITTO)
  530. * renamed to DtSrObj... and moved to Search.h)
  531. * (ORL_ language id cardinal integers in or_language
  532. * renamed to DtSrLa... and moved to Search.h)
  533. */
  534. #define ORA_VARIES 0 /* object accessibility unspec at curr lvl */
  535. #define ORA_NOTAVAIL 1 /* obj not directly accessible from engine */
  536. #define ORA_BLOB 2 /* obj stored in blob recs */
  537. #define ORA_REFBLOB 3 /* svr ref (filename of object) in blob */
  538. #define ORA_REFKEY 4 /* svr ref in or_objkey */
  539. #define ORA_REFHUGEKEY 5 /* svr ref in 'huge' key (misc) rec */
  540. #define ORA_REFABSTR 6 /* svr ref in abstract (misc rec) */
  541. #define ORA_CREFBLOB 13 /* clt ref (filename of object) in blob */
  542. #define ORA_CREFKEY 14 /* clt ref in or_objkey */
  543. #define ORA_CREFABSTR 16 /* clt ref in abstract (misc rec) */
  544. #define ORC_COMPBLOB (1<<0) /* blobs are compressed */
  545. #define ORC_COMPABSTR (1<<1) /* abstracts are compressed */
  546. #define ORD_XWORDS (1L<<0) /* inverted index includes exact words */
  547. #define ORD_XSTEMS (1L<<1) /* inverted index includes word stems */
  548. #define ORD_USEHUGEKEYS (1L<<4) /* all direct user access via huge keys */
  549. #define ORD_NOMARKDEL (1L<<8) /* permanently disables mark-for-deletion */
  550. #define ORD_NONOTES (1L<<9) /* permanently disables user notes */
  551. #define ORD_WIDECHAR (1L<<10) /* text is multibyte or wide chars */
  552. #define ORO_DELETE (1L<<0) /* obj is marked for deletion */
  553. #define ORO_OLDNOTES (1L<<1) /* obj has old style usernotes in misc rec */
  554. #define ORM_FZKABS 1 /* fzkey[fzkeysz] + abstract[abstrsz] */
  555. #define ORM_HUGEKEY 2 /* optional 'huge' key */
  556. #define ORM_OLDNOTES 3 /* old style user notes */
  557. #define ORM_KEYTYPE 4 /* database keytype rec (KEYTYPE struct) */
  558. /*------------------------- MACROS ---------------------------*/
  559. /* (Use offsetof() in stddef.h to replace my old OFFSET macro) */
  560. #define NULLORSTR(str) ((str)?str:CATGETS(dtsearch_catd,1,1,"<null>"))
  561. #define NUMARRAY(arr) ((sizeof(arr) / sizeof(arr[0])))
  562. /****************************************/
  563. /* */
  564. /* LLIST */
  565. /* */
  566. /****************************************/
  567. typedef struct llist_tag {
  568. struct llist_tag *link;
  569. void *data;
  570. } LLIST;
  571. /****************************************/
  572. /* */
  573. /* FREE_SPACE_STR */
  574. /* */
  575. /****************************************/
  576. /* 'holes' structure used for dynamic defragmentation */
  577. typedef struct holes_str {
  578. DtSrINT32 hole_size;
  579. DtSrINT32 offset;
  580. } FREE_SPACE_STR;
  581. /****************************************/
  582. /* */
  583. /* FILE_HEADER */
  584. /* */
  585. /****************************************/
  586. /* 'holes' structure used for dynamic defragmentation */
  587. typedef struct fl_head {
  588. DtSrINT32 hole_count [2];
  589. FREE_SPACE_STR hole_array [2] [NUM_HOLES];
  590. } FILE_HEADER;
  591. /****************************************/
  592. /* */
  593. /* CMPLL, sort_llist, compare_llist */
  594. /* */
  595. /****************************************/
  596. /* Generic LLIST structure typically used for 'lines' of text,
  597. * as in ausapi.msglist and usrblk.msgs, and binary blobs.
  598. * See structure typedef below for blob list structure.
  599. * LLISTs can be sorted by calling sort_llist().
  600. * The compare function is stored in global pointer 'compare_llist'
  601. * prior to calling the sort function.
  602. */
  603. typedef int (*CMPLL) (LLIST *left, LLIST *right);
  604. /****************************************/
  605. /* */
  606. /* READCFP */
  607. /* */
  608. /****************************************/
  609. /* Pointer to a function that takes a void
  610. * pointer and returns a C char (1 octet).
  611. * Used by linguistic parsers as a character reading cofunction.
  612. * When parser is reading from a file stream as in dtsrindex,
  613. * usual cofunction is readchar_ftext(). When parser is reading
  614. * from a text string as in queries, the usual cofunction
  615. * is readchar_string() which just accesses next char in string.
  616. */
  617. typedef UCHAR (*READCFP) (void *);
  618. /********************************************************/
  619. /* */
  620. /* WORDTREE */
  621. /* */
  622. /********************************************************/
  623. /* A generic structure for creating binary trees of words
  624. * from stoplists, include-lists, etc.
  625. */
  626. typedef struct _bintree_tag {
  627. struct _bintree_tag *rlink; /* ptr to right node */
  628. struct _bintree_tag *llink; /* ptr to left node */
  629. int len; /* length of word */
  630. void *word;
  631. } WORDTREE;
  632. /************************************************/
  633. /* */
  634. /* PARG */
  635. /* */
  636. /************************************************/
  637. /* Single argument for first parser call for a text block */
  638. typedef struct {
  639. void *dblk; /* dblk is (DBLK *) */
  640. FILE *ftext; /* Text file being parsed in dtsrindex */
  641. void *string; /* Query or other string being parsed */
  642. void *etxdelim; /* End of text (ETX) delimiter string */
  643. long *offsetp; /* where parser stores word offset */
  644. long flags;
  645. #define PA_INDEXING 0x0001 /* parse for indexing purposes (dtsrindex) */
  646. #define PA_HILITING 0x0002 /* parse for hiliting purposes */
  647. #define PA_MSGS 0x0004 /* explain parse failures with msgs */
  648. void *extra; /* reserved for generic use by parsers */
  649. } PARG;
  650. /********************************************************/
  651. /* */
  652. /* DBLK */
  653. /* */
  654. /********************************************************/
  655. /* One element of a linked list of universal information
  656. * about all databases accessible,
  657. * to an online search engine instance, chained off of
  658. * the global OE_dblist. It is also used individually
  659. * by offline build tools to store database data.
  660. * It contains pointers to linguistic processors and data structures,
  661. * data derived from the site configuration file,
  662. * data derived and used by the DBMS,
  663. * and some fields reflecting recommended initial user choices.
  664. * Changes here should also be reflected in initblks.c,
  665. * austext.sch, initausd.c, and in oeinit.c.
  666. */
  667. typedef struct dblk_tag
  668. {
  669. struct dblk_tag *link; /* ptr to next dblk in list */
  670. char name [11]; /* 1 - 8 char dictionary name */
  671. char is_selected; /* bool: initial gui selection status */
  672. char *label; /* database description/label string for UI */
  673. long flags;
  674. char *path; /* where to find all database files */
  675. FILE *syofile; /* symptom offset (ranges) d97 file */
  676. FILE *syifile; /* symptom index d98 file */
  677. void *ranges; /* contents of syofile read into ram */
  678. FILE *iifile; /* inverted words index d99 file */
  679. time_t iimtime; /* last time d99 was modified */
  680. int vistano; /* vista database number */
  681. int ktcount; /* number of nodes in keytypes array */
  682. DtSrKeytype *keytypes; /* record types in this database */
  683. DBREC dbrec; /* copy of database's dbrec record */
  684. void *zblk; /* used only for semantic processing */
  685. /*----- Huffman Compression -----*/
  686. time_t hufid; /* tree identification atom */
  687. int hufroot; /* index to inverted tree root (array bottom) */
  688. int *huftree; /* beginning of huffman tree array */
  689. /*----- Language Fields -----*/
  690. char *fname_stp; /* name of stoplist file */
  691. char *fname_inc; /* name of include-list file */
  692. char *fname_sfx; /* name of suffixes file */
  693. int *charmap; /* parse/stem table for char set */
  694. WORDTREE *stoplist; /* root of stoplist tree */
  695. WORDTREE *inclist; /* root of include-list tree */
  696. char *(*lstrupr) (char *string, struct dblk_tag *dblk);
  697. char *(*parser) (PARG *parg);
  698. void *parse_extra; /* eg additional word trees */
  699. char *(*stemmer) (char *wordin, struct dblk_tag *dblk);
  700. long stem_flags; /* stemmer options */
  701. void *stem_extra; /* eg suffix tables */
  702. void *lang_extra; /* additional language dependent data */
  703. long lang_flags; /* language dependent switches */
  704. #define LF_DUP_STP 0x0001 /* duplicate stop list */
  705. #define LF_DUP_INC 0x0002 /* duplicate include list */
  706. #define LF_DUP_SFX 0x0004 /* duplicate suffixes list */
  707. /*----- User Search Parameters -----*/
  708. int maxhits; /* max # hits to be returned from searches */
  709. void *resuser; /* reserved for private use by users */
  710. } DBLK;
  711. /*------------------------- GLOBALS -------------------------*/
  712. /* DtSearchExit (austext_exit) and DtSearchExitUser (austext_exit_user)
  713. * are in ausexit.c too but are "public" in DtSearch (defined in Search.h).
  714. */
  715. extern char *aa_argv0; /* globals.c */
  716. extern int aa_maxhits; /* aajoint.c */
  717. extern FILE *aa_stderr; /* globals.c */
  718. extern int ascii_charmap[]; /* langmap.c */
  719. extern LLIST *ausapi_msglist; /* globals.c */
  720. extern void (*austext_exit_first) (int); /* ausexit.c */
  721. extern void (*austext_exit_dbms) (int); /* ausexit.c */
  722. extern void (*austext_exit_comm) (int); /* ausexit.c */
  723. extern void (*austext_exit_endwin) (int); /* ausexit.c */
  724. extern void (*austext_exit_mem) (int); /* ausexit.c */
  725. extern void (*austext_exit_last) (int); /* ausexit.c */
  726. extern void (*austext_exit_user) (int); /* ausexit.c */
  727. extern nl_catd austools_catd; /* globals.c */
  728. extern CMPLL compare_llist;
  729. extern nl_catd dtsearch_catd; /* globals.c */
  730. extern unsigned long
  731. duprec_hashsize; /* isduprec.c */
  732. extern int latin_charmap[]; /* langmap.c */
  733. /*------------------------ FUNCTION PROTOTYPES ------------------------*/
  734. extern void add_free_space(FREE_SPACE_STR *del_rec, FILE_HEADER *flh);
  735. extern void append_ext (char *buffer, int buflen,
  736. char *fname, char *fext);
  737. extern int austext_dopen (
  738. char *dbname,
  739. char *dbpath,
  740. char *d2xpath,
  741. int cache_size,
  742. DBREC *bufptr);
  743. extern void *austext_malloc (size_t size, char *location, void *ignored);
  744. extern char *bmhcore (
  745. UCHAR *text,
  746. size_t txtlen,
  747. UCHAR *pattern,
  748. size_t patlen,
  749. size_t *bmhtable);
  750. extern void bmhtable_build (
  751. UCHAR *pattern,
  752. size_t patlen,
  753. size_t *bmhtable);
  754. extern char *bmstrstr (
  755. UCHAR *text,
  756. size_t txtlen,
  757. UCHAR *pattern,
  758. size_t patlen);
  759. extern int clean_wrap (char *string, int linelen);
  760. extern LLIST *cutnode_llist (LLIST *node, LLIST **llistp);
  761. extern void (*dberr_exit)(int exitcode); /* defaults to exit() */
  762. extern void delete_whitespace (char *linebuf);
  763. extern void discard_to_ETX (PARG *parg);
  764. extern int endstroke (int c);
  765. extern void put_new_word(struct or_hwordrec *recbuf, int vistano);
  766. extern FREE_SPACE_STR
  767. *find_free_space (DtSrINT32 req_size, FILE_HEADER *flh);
  768. extern void free_llist (LLIST **llhead);
  769. extern int fread_d99_header (FILE_HEADER *flh, FILE *fp);
  770. extern int fwrite_d99_header (FILE_HEADER *flh, FILE *fp);
  771. extern char *get_email_addr (void);
  772. extern char *getnews (char *fname, int use_copyr);
  773. extern void hc_decode (UCHAR *input_bitstring, UCHAR *output_charbuf,
  774. int outbuf_size, time_t encode_id);
  775. extern int hc_encode (struct or_blobrec *targ, UCHAR *src,
  776. int srclen, int force_flush);
  777. extern void init_header (FILE *fp, FILE_HEADER *flh);
  778. extern int is_compatible_version (char *callers_vers, char *local_vers);
  779. extern int is_concordable (char *word, int *charmap);
  780. extern int is_duprec (char *recid);
  781. extern int is_objdatestr (char *string, DtSrObjdate *objdptr);
  782. extern int is_objdatetm (struct tm *objdatetm);
  783. extern void join_llists (LLIST **mainlist, LLIST **sublist);
  784. extern char *jpn_parser (PARG *parg);
  785. extern int load_custom_language (DBLK *dblk, DBLK *dblist);
  786. extern int load_jpn_language (DBLK *dblk, DBLK *dblist);
  787. extern int load_language (DBLK *dblk, DBLK *dblist);
  788. extern int load_wordtree (
  789. WORDTREE **treetop,
  790. DBLK *dblk,
  791. char *fname,
  792. int do_teskey_test);
  793. extern char *null_stemmer (char *word, DBLK *dblk);
  794. extern char *null_lstrupr (char *string, DBLK *dblk);
  795. extern char *objdate2fzkstr (DtSrObjdate objdate);
  796. extern struct tm
  797. *objdate2tm (DtSrObjdate objdate);
  798. extern int objdate_in_range (DtSrObjdate recdate,
  799. DtSrObjdate date1, DtSrObjdate date2);
  800. extern int offline_kbhit (void);
  801. extern int open_dblk (DBLK **dblist, int numpages, int debugging);
  802. extern LLIST *pop_llist (LLIST **llistp);
  803. extern void print_dbrec (char *dbname, struct or_dbrec *dbrec);
  804. extern int quit_escape(void);
  805. extern UCHAR readchar_ftext (PARG *parg);
  806. extern UCHAR readchar_string (UCHAR *string);
  807. extern char *remove_spaces (char *string);
  808. extern void replace_ext (char *buffer, int buflen,
  809. char *fname, char *fext);
  810. extern LLIST *sort_llist (LLIST *list_header);
  811. extern char *teskey_parser (PARG *parg);
  812. extern DtSrObjdate
  813. tm2objdate (struct tm *tmptr);
  814. #if !defined(__linux__)
  815. #ifndef _ALL_SOURCE
  816. extern char *strdup (const char *s);
  817. #endif
  818. #endif
  819. extern void toggle_insert (void);
  820. extern void unload_custom_language (DBLK *dblk);
  821. extern void unload_language (DBLK *dblk);
  822. extern void vista_abort (char *location);
  823. extern char *vista_msg (char *location);
  824. /************************ SearchP.h ********************************/
  825. #endif /* _SearchP_h */