home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume44 / typhoon / part08 < prev    next >
Internet Message Format  |  1994-09-17  |  62KB

  1. From: zeppelin@login.dknet.dk (Thomas B. Pedersen)
  2. Newsgroups: comp.sources.misc
  3. Subject: v44i064:  typhoon - Typhoon Relational Database Management System, Part08/09
  4. Date: 17 Sep 1994 21:45:58 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <35g9l6$ojp@sparky.sterling.com>
  9. X-Md4-Signature: d51d04476a538da46c340f1f3a1a68ce
  10.  
  11. Submitted-by: zeppelin@login.dknet.dk (Thomas B. Pedersen)
  12. Posting-number: Volume 44, Issue 64
  13. Archive-name: typhoon/part08
  14. Environment: SCO UNIX, Tandem NonStop UNIX, Sun Solaris, AIX, Linux, OS/2
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  typhoon/examples/demo.ddl typhoon/makefile
  21. #   typhoon/man/d_crread.1 typhoon/man/d_fillnew.1
  22. #   typhoon/man/d_keyfind.1 typhoon/man/d_keyfrst.1
  23. #   typhoon/man/d_keylast.1 typhoon/man/d_keynext.1
  24. #   typhoon/man/d_keyprev.1 typhoon/man/d_open.1
  25. #   typhoon/man/d_recfrst.1 typhoon/man/d_recnext.1
  26. #   typhoon/man/d_recwrite.1 typhoon/man/ddlp.1 typhoon/src/bt_io.c
  27. #   typhoon/src/catalog.h typhoon/src/dos.c typhoon/src/makefile
  28. #   typhoon/src/ty_glob.h typhoon/src/util/export.h
  29. #   typhoon/src/util/import.h typhoon/src/util/makefile
  30. #   typhoon/src/util/util.c typhoon/src/util/util.h
  31. # Wrapped by kent@sparky on Sat Sep 17 21:38:18 1994
  32. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  33. echo If this archive is complete, you will see the following message:
  34. echo '          "shar: End of archive 8 (of 9)."'
  35. if test -f 'typhoon/examples/demo.ddl' -a "${1}" != "-c" ; then 
  36.   echo shar: Will not clobber existing file \"'typhoon/examples/demo.ddl'\"
  37. else
  38.   echo shar: Extracting \"'typhoon/examples/demo.ddl'\" \(1449 characters\)
  39.   sed "s/^X//" >'typhoon/examples/demo.ddl' <<'END_OF_FILE'
  40. X/*
  41. X    demonstration database
  42. X*/
  43. X
  44. Xdatabase demo {
  45. X
  46. X    define NAME_LEN        30
  47. X
  48. X    data file "company.dat"  contains company;
  49. X    key  file "company.ix1"  contains company.id;
  50. X    key  file "company.ix2"  contains company.references;
  51. X    data file "product.dat"  contains product;
  52. X    key  file "product.ix1"  contains product.name;
  53. X
  54. X    data file "fancy.dat"    contains fancy;
  55. X    key  file "fancy.ix1"    contains fancy.fancy_key1;
  56. X    key  file "fancy.ix2"    contains fancy.name;
  57. X    key  file "fancy.ix3"    contains fancy.fancy_key2;
  58. X
  59. X    record company {
  60. X        ulong    id;
  61. X        char    name[NAME_LEN+1];
  62. X        
  63. X        primary key id;
  64. X    }
  65. X
  66. X    record product {
  67. X        ulong    company_id;
  68. X        ushort    descr_len;
  69. X        char    name[NAME_LEN+1];
  70. X        char    description[2000] variable by descr_len;
  71. X
  72. X        primary key name;
  73. X        foreign key company_id references company
  74. X            on update restrict
  75. X            on delete restrict;
  76. X    }
  77. X
  78. X    
  79. X    // This record just shows some of the things that are possible in
  80. X    // a ddl-file.
  81. X
  82. X    record fancy {
  83. X        char        name[20];
  84. X        ulong        number;
  85. X
  86. X        char        key2_is_null;
  87. X        
  88. X        ushort        a_count;
  89. X        struct {
  90. X            char    a[2][20];
  91. X            uchar    type;
  92. X            
  93. X            union controlled by type {
  94. X                char    s[80];            // If type is 0
  95. X                ulong    a;                // If type is 1
  96. X                struct {
  97. X                    int        a;
  98. X                    long    b;
  99. X                } c;                    // If type is 0
  100. X            } u[2];
  101. X
  102. X        } a[10] variable by a_count;
  103. X    
  104. X        primary key fancy_key1 { name, number desc };
  105. X        alternate key name null by name;
  106. X        alternate key fancy_key2 { number desc, name } null by key2_is_null;
  107. X    }
  108. X}
  109. X
  110. X/* end-of-file */
  111. X
  112. END_OF_FILE
  113.   if test 1449 -ne `wc -c <'typhoon/examples/demo.ddl'`; then
  114.     echo shar: \"'typhoon/examples/demo.ddl'\" unpacked with wrong size!
  115.   fi
  116.   # end of 'typhoon/examples/demo.ddl'
  117. fi
  118. if test -f 'typhoon/makefile' -a "${1}" != "-c" ; then 
  119.   echo shar: Will not clobber existing file \"'typhoon/makefile'\"
  120. else
  121.   echo shar: Extracting \"'typhoon/makefile'\" \(1689 characters\)
  122.   sed "s/^X//" >'typhoon/makefile' <<'END_OF_FILE'
  123. X#-----------------------------------------------------------------------------
  124. X# File    : makefile
  125. X# Library : typhoon
  126. X# OS      : UNIX, OS/2, DOS
  127. X# Author  : Thomas B. Pedersen
  128. X#
  129. X# Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  130. X#
  131. X# Permission is hereby granted, without written agreement and without
  132. X#  license or royalty fees, to use, copy, modify, and distribute this
  133. X#  software and its documentation for any purpose, provided that the above
  134. X#  copyright notice and the following two  paragraphs appear (1) in all 
  135. X#  source copies of this software and (2) in accompanying documentation
  136. X#  wherever the programatic interface of this software, or any derivative
  137. X#  of it, is described.
  138. X# 
  139. X# IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  140. X# INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  141. X# THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  142. X# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  143. X#
  144. X# THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  145. X# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  146. X# A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  147. X# BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  148. X# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  149. X#
  150. X# Description:
  151. X#   Makefile for Typhoon Relational Database Management System.
  152. X#
  153. X# $Id: makefile,v 1.1 1994/09/13 21:29:38 tbp Exp $
  154. X#
  155. X# $Log: makefile,v $
  156. X# Revision 1.1  1994/09/13  21:29:38  tbp
  157. X# Added to repository.
  158. X# 
  159. X#
  160. X# ----------------------------------------------------------------------------
  161. X
  162. X
  163. Xall:
  164. X    cd src; make;
  165. X    cd src/util; make;
  166. X
  167. X
  168. X# end-of-file
  169. END_OF_FILE
  170.   if test 1689 -ne `wc -c <'typhoon/makefile'`; then
  171.     echo shar: \"'typhoon/makefile'\" unpacked with wrong size!
  172.   fi
  173.   # end of 'typhoon/makefile'
  174. fi
  175. if test -f 'typhoon/man/d_crread.1' -a "${1}" != "-c" ; then 
  176.   echo shar: Will not clobber existing file \"'typhoon/man/d_crread.1'\"
  177. else
  178.   echo shar: Extracting \"'typhoon/man/d_crread.1'\" \(1280 characters\)
  179.   sed "s/^X//" >'typhoon/man/d_crread.1' <<'END_OF_FILE'
  180. X.de Id
  181. X.ds Rv \\$3
  182. X.ds Dt \\$4
  183. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  184. X..
  185. X.Id $Id: d_crread.1,v 1.1 1994/09/13 21:29:54 tbp Exp $
  186. X.ds r \s-1TYPHOON\s0
  187. X.if n .ds - \%--
  188. X.if t .ds - \(em
  189. X.TH D_CRREAD 1 \*(Dt TYPHOON
  190. X.SH NAME
  191. Xd_crread \- read a field from the current record
  192. X.SH SYNOPSIS
  193. X.B #include <typhoon.h>
  194. X.br
  195. X
  196. X\fBd_crread(ulong \fPfieldid\fB, void *\fPbuf\fB)
  197. X.SH DESCRIPTION
  198. X\fBd_crread\fP copies the contents of the field specified by \fIfieldid\fP
  199. Xinto the buffer \fIbuf\fP. If the field is a variable length field, only
  200. Xthe actual number of bytes in the field is copied.
  201. X.br
  202. X.SH DIAGNOSTICS
  203. XThe status code returned by the function is also stored in the global
  204. Xvariable \fIdb_status\fP.
  205. X.TP
  206. X.B S_OKAY
  207. XOperation successful.
  208. X.TP
  209. X.B S_NOCD
  210. XThere is no current database.
  211. X.TP
  212. X.B S_NOCR
  213. XThere is no current record.
  214. X.TP
  215. X.B S_INVFLD
  216. XThe id is not a valid field.
  217. X.SH CURRENCY CHANGES
  218. XNone.
  219. X.SH EXAMPLE
  220. X/* Get Pedersen's account number */
  221. X.br
  222. X
  223. X#include <typhoon.h>
  224. X.br
  225. X
  226. Xif( d_keyfind(CUSTOMER_NAME, "Pedersen") == S_OKAY )
  227. X.br
  228. X{
  229. X.br
  230. X    unsigned long account;
  231. X.br
  232. X    d_crread(CUSTOMER_ACCOUNT, &account);
  233. X    printf("Account number %lu\\n", account);
  234. X.br
  235. X}
  236. X.SH IDENTIFICATION
  237. XAuthor: Thomas B. Pedersen.
  238. X.br
  239. XCopyright (c) 1994 Thomas B. Pedersen.
  240. X.SH "SEE ALSO"
  241. Xd_recread(1), d_keyread(1)
  242. END_OF_FILE
  243.   if test 1280 -ne `wc -c <'typhoon/man/d_crread.1'`; then
  244.     echo shar: \"'typhoon/man/d_crread.1'\" unpacked with wrong size!
  245.   fi
  246.   # end of 'typhoon/man/d_crread.1'
  247. fi
  248. if test -f 'typhoon/man/d_fillnew.1' -a "${1}" != "-c" ; then 
  249.   echo shar: Will not clobber existing file \"'typhoon/man/d_fillnew.1'\"
  250. else
  251.   echo shar: Extracting \"'typhoon/man/d_fillnew.1'\" \(1650 characters\)
  252.   sed "s/^X//" >'typhoon/man/d_fillnew.1' <<'END_OF_FILE'
  253. X.de Id
  254. X.ds Rv \\$3
  255. X.ds Dt \\$4
  256. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  257. X..
  258. X.Id $Id: d_fillnew.1,v 1.1 1994/09/13 21:29:56 tbp Exp $
  259. X.ds r \s-1TYPHOON\s0
  260. X.if n .ds - \%--
  261. X.if t .ds - \(em
  262. X.TH D_FILLNEW 1 \*(Dt TYPHOON
  263. X.SH NAME
  264. Xd_fillnew \- insert a new record
  265. X.SH SYNOPSIS
  266. X.B #include <typhoon.h>
  267. X.br
  268. X
  269. X\fBd_fillnew(ulong \fPrecid\fB, void *\fPbuf\fB)
  270. X.SH DESCRIPTION
  271. X\fBd_fillnew\fP inserts a new record in a table. \fIrecid\fP specifies the
  272. Xtype of the record stored in \fIbuf\fP. The inserted record retains the 
  273. Xsame database address throughout its life in the database.
  274. X.SH DIAGNOSTICS
  275. XThe status code returned by the function is also stored in the global
  276. Xvariable \fIdb_status\fP.
  277. X.TP
  278. X.B S_OKAY
  279. XThe record was successfully inserted.
  280. X.TP
  281. X.B S_NOCD
  282. XThere is no current database.
  283. X.TP
  284. X.B S_INVREC
  285. XThe record id is not valid.
  286. X.TP
  287. X.B S_DUPLICATE
  288. XOne of the keys in the record would cause duplicates in a unique index.
  289. X\fIdb_subcode\fP contains the id of the conflicting field or key.
  290. X.TP
  291. X.B S_RECSIZE
  292. XA length determinator of a variable length field contained a illegal 
  293. Xvalue. \fIdb_subcode\fP contains the id of the conflicting field.
  294. X.TP
  295. X.B S_FOREIGN
  296. XThe target of a foreign key could not be found. \fIdb_subcode\fP contains
  297. Xthe id of the target table.
  298. X.SH CURRENCY CHANGES
  299. XIf \fBd_fillnew\fP returned \fBS_OKAY\fP the record becomes the current record.
  300. X.SH EXAMPLE
  301. X#include <typhoon.h>
  302. X
  303. Xstruct customer cust;
  304. X.br
  305. Xstrcpy(cust.name, "Pedersen");
  306. X.br
  307. Xcust.account = 10002;
  308. Xif( d_fillnew(CUSTOMER, &cust) != S_OKAY )
  309. X.br
  310. X    /* handle error */
  311. X.SH IDENTIFICATION
  312. XAuthor: Thomas B. Pedersen.
  313. X.br
  314. XCopyright (c) 1994 Thomas B. Pedersen.
  315. X.SH "SEE ALSO"
  316. Xd_recwrite(1)
  317. X
  318. END_OF_FILE
  319.   if test 1650 -ne `wc -c <'typhoon/man/d_fillnew.1'`; then
  320.     echo shar: \"'typhoon/man/d_fillnew.1'\" unpacked with wrong size!
  321.   fi
  322.   # end of 'typhoon/man/d_fillnew.1'
  323. fi
  324. if test -f 'typhoon/man/d_keyfind.1' -a "${1}" != "-c" ; then 
  325.   echo shar: Will not clobber existing file \"'typhoon/man/d_keyfind.1'\"
  326. else
  327.   echo shar: Extracting \"'typhoon/man/d_keyfind.1'\" \(1890 characters\)
  328.   sed "s/^X//" >'typhoon/man/d_keyfind.1' <<'END_OF_FILE'
  329. X.de Id
  330. X.ds Rv \\$3
  331. X.ds Dt \\$4
  332. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  333. X..
  334. X.Id $Id: d_keyfind.1,v 1.1 1994/09/13 21:29:56 tbp Exp $
  335. X.ds r \s-1TYPHOON\s0
  336. X.if n .ds - \%--
  337. X.if t .ds - \(em
  338. X.TH D_KEYFIND 1 \*(Dt TYPHOON
  339. X.SH NAME
  340. Xd_keyfind \- search an index for a specific key value
  341. X.SH SYNOPSIS
  342. X.B #include <typhoon.h>
  343. X.br
  344. X
  345. X\fBd_keyfind(ulong \fPkeyid\fB, void *\fPbuf\fB)
  346. X.SH DESCRIPTION
  347. X\fBd_keyfind\fP is used to lookup a record in a table via one of its
  348. Xindexes. \fIkeyid\fP specifies which index to search and \fIbuf\fP contains
  349. Xthe value to search for. If the index contains more than
  350. Xone occurrence of the key value (only possible for non-unique indexes)
  351. X\fBd_keyfind\fP returns the first one.
  352. X.br
  353. X
  354. XThe id can be either the id of a compound key or a field that is a key
  355. Xby itself.
  356. X.br
  357. X
  358. XIf the key value was not found, \fBd_keyfind\fP returns \fBS_NOTFOUND\fP.
  359. XA subsequent call to \fBd_keynext(1)\fP returns next value in the sorting
  360. Xorder.
  361. X.br
  362. X
  363. XThe actual record is not read from the database until \fBd_recread(1)\fP is
  364. Xcalled.
  365. X.SH DIAGNOSTICS
  366. XThe status code returned by the function is also stored in the global
  367. Xvariable \fIdb_status\fP.
  368. X.TP
  369. X.B S_OKAY
  370. XThe key value was found.
  371. X.TP
  372. X.B S_NOTFOUND
  373. XThe key value was not found.
  374. X.TP
  375. X.B S_NOCD
  376. XThere is no current database.
  377. X.TP
  378. X.B S_INVFLD
  379. XThe id is not a valid field.
  380. X.TP
  381. X.B S_NOTKEY
  382. XThe field id is not a key itself.
  383. X.SH CURRENCY CHANGES
  384. XIf \fBS_OKAY\fP is returned. the record found becomes the current record.
  385. X.SH EXAMPLE
  386. X/* Find the customer called 'Pedersen' */
  387. X.br
  388. X
  389. X#include <typhoon.h>
  390. X.br
  391. X
  392. Xif( d_keyfind(CUSTOMER_NAME, "Pedersen") == S_OKAY )
  393. X.br
  394. X{
  395. X.br
  396. X    struct customer cust;
  397. X.br
  398. X    d_recread(&cust);
  399. X    printf("Account number %lu\\n", cust.account);
  400. X.br
  401. X}
  402. X.SH IDENTIFICATION
  403. XAuthor: Thomas B. Pedersen.
  404. X.br
  405. XCopyright (c) 1994 Thomas B. Pedersen.
  406. X.SH "SEE ALSO"
  407. Xd_keynext(1), d_keyprev(1), d_keyfrst(1), d_keylast(1), d_recread(1).
  408. END_OF_FILE
  409.   if test 1890 -ne `wc -c <'typhoon/man/d_keyfind.1'`; then
  410.     echo shar: \"'typhoon/man/d_keyfind.1'\" unpacked with wrong size!
  411.   fi
  412.   # end of 'typhoon/man/d_keyfind.1'
  413. fi
  414. if test -f 'typhoon/man/d_keyfrst.1' -a "${1}" != "-c" ; then 
  415.   echo shar: Will not clobber existing file \"'typhoon/man/d_keyfrst.1'\"
  416. else
  417.   echo shar: Extracting \"'typhoon/man/d_keyfrst.1'\" \(1599 characters\)
  418.   sed "s/^X//" >'typhoon/man/d_keyfrst.1' <<'END_OF_FILE'
  419. X.de Id
  420. X.ds Rv \\$3
  421. X.ds Dt \\$4
  422. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  423. X..
  424. X.Id $Id: d_keyfrst.1,v 1.1 1994/09/13 21:29:57 tbp Exp $
  425. X.ds r \s-1TYPHOON\s0
  426. X.if n .ds - \%--
  427. X.if t .ds - \(em
  428. X.TH D_KEYFRST 1 \*(Dt TYPHOON
  429. X.SH NAME
  430. Xd_keyfrst \- find the first key value in an index
  431. X.SH SYNOPSIS
  432. X.B #include <typhoon.h>
  433. X.br
  434. X
  435. X\fBd_keyfrst(ulong \fPkeyid\fB)
  436. X.SH DESCRIPTION
  437. X\fBd_keyfrst\fP finds the first key value in the index specified by
  438. X\fIkeyid\fP. If \fBd_keyfrst\fP returns \fBS_NOTFOUND\fP the index is empty.
  439. X.br
  440. X
  441. XThe id can be either the id of a compound key or a field that is a key
  442. Xby itself.
  443. X.br
  444. X
  445. XThe actual record is not read from the database until \fBd_recread(1)\fP is
  446. Xcalled.
  447. X.SH DIAGNOSTICS
  448. XThe status code returned by the function is also stored in the global
  449. Xvariable \fIdb_status\fP.
  450. X.TP
  451. X.B S_OKAY
  452. XThe key value was found.
  453. X.TP
  454. X.B S_NOTFOUND
  455. XThe key value was not found, i.e. the index is empty.
  456. X.TP
  457. X.B S_NOCD
  458. XThere is no current database.
  459. X.TP
  460. X.B S_INVFLD
  461. XThe id is not a valid field.
  462. X.TP
  463. X.B S_NOTKEY
  464. XThe field id is not a key itself.
  465. X.SH CURRENCY CHANGES
  466. XIf \fBS_OKAY\fP is returned, the record found becomes the current record.
  467. X.SH EXAMPLE
  468. X/* Traverse the customers in alphabetical, ascending order */
  469. X
  470. X#include <typhoon.h>
  471. X.br
  472. X
  473. Xd_keyfrst(CUSTOMER_NAME);
  474. X.br
  475. X
  476. Xwhile( db_status == S_OKAY )
  477. X.br
  478. X{
  479. X.br
  480. X    struct customer cust;
  481. X.br
  482. X
  483. X    d_recread(&cust);
  484. X.br
  485. X    printf("%s\\n", cust.name);
  486. X.br
  487. X    d_keynext(CUSTOMER_NAME);
  488. X.br
  489. X}
  490. X.SH IDENTIFICATION
  491. XAuthor: Thomas B. Pedersen.
  492. X.br
  493. XCopyright (c) 1994 Thomas B. Pedersen.
  494. X.SH "SEE ALSO"
  495. Xd_keynext(1), d_keyfind(1), d_keyprev(1), d_keylast(1), d_recread(1).
  496. X
  497. END_OF_FILE
  498.   if test 1599 -ne `wc -c <'typhoon/man/d_keyfrst.1'`; then
  499.     echo shar: \"'typhoon/man/d_keyfrst.1'\" unpacked with wrong size!
  500.   fi
  501.   # end of 'typhoon/man/d_keyfrst.1'
  502. fi
  503. if test -f 'typhoon/man/d_keylast.1' -a "${1}" != "-c" ; then 
  504.   echo shar: Will not clobber existing file \"'typhoon/man/d_keylast.1'\"
  505. else
  506.   echo shar: Extracting \"'typhoon/man/d_keylast.1'\" \(1599 characters\)
  507.   sed "s/^X//" >'typhoon/man/d_keylast.1' <<'END_OF_FILE'
  508. X.de Id
  509. X.ds Rv \\$3
  510. X.ds Dt \\$4
  511. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  512. X..
  513. X.Id $Id: d_keylast.1,v 1.1 1994/09/13 21:29:57 tbp Exp $
  514. X.ds r \s-1TYPHOON\s0
  515. X.if n .ds - \%--
  516. X.if t .ds - \(em
  517. X.TH D_KEYLAST 1 \*(Dt TYPHOON
  518. X.SH NAME
  519. Xd_keylast \- find the last key value in an index
  520. X.SH SYNOPSIS
  521. X.B #include <typhoon.h>
  522. X.br
  523. X
  524. X\fBd_keylast(ulong \fPkeyid\fB)
  525. X.SH DESCRIPTION
  526. X\fBd_keyfrst\fP finds the last key value in the index specified by
  527. X\fIkeyid\fP. If \fBd_keyfrst\fP returns \fBS_NOTFOUND\fP the index is empty.
  528. X.br
  529. X
  530. XThe id can be either the id of a compound key, or a field that is a key
  531. Xby itself.
  532. X.br
  533. X
  534. XThe actual record is not read from the database until \fBd_recread(1)\fP is
  535. Xcalled.
  536. X.SH DIAGNOSTICS
  537. XThe status code returned by the function is also stored in the global
  538. Xvariable \fIdb_status\fP.
  539. X.TP
  540. X.B S_OKAY
  541. XThe key value was found.
  542. X.TP
  543. X.B S_NOTFOUND
  544. XThe key value was not found, i.e. the index is empty.
  545. X.TP
  546. X.B S_NOCD
  547. XThere is no current database.
  548. X.TP
  549. X.B S_INVFLD
  550. XThe id is not a valid field.
  551. X.TP
  552. X.B S_NOTKEY
  553. XThe field id is not a key itself.
  554. X.SH CURRENCY CHANGES
  555. XIf \fBS_OKAY\fP is returned, the record found becomes the current record.
  556. X.SH EXAMPLE
  557. X/* Traverse the customers in alphabetical, descending order */
  558. X
  559. X#include <typhoon.h>
  560. X.br
  561. X
  562. Xd_keylast(CUSTOMER_NAME);
  563. X.br
  564. X
  565. Xwhile( db_status == S_OKAY )
  566. X.br
  567. X{
  568. X.br
  569. X    struct customer cust;
  570. X.br
  571. X
  572. X    d_recread(&cust);
  573. X.br
  574. X    printf("%s\\n", cust.name);
  575. X.br
  576. X    d_keyprev(CUSTOMER_NAME);
  577. X.br
  578. X}
  579. X.SH IDENTIFICATION
  580. XAuthor: Thomas B. Pedersen.
  581. X.br
  582. XCopyright (c) 1994 Thomas B. Pedersen.
  583. X.SH "SEE ALSO"
  584. Xd_keynext(1), d_keyfind(1), d_keyprev(1), d_keylast(1), d_recread(1).
  585. X
  586. END_OF_FILE
  587.   if test 1599 -ne `wc -c <'typhoon/man/d_keylast.1'`; then
  588.     echo shar: \"'typhoon/man/d_keylast.1'\" unpacked with wrong size!
  589.   fi
  590.   # end of 'typhoon/man/d_keylast.1'
  591. fi
  592. if test -f 'typhoon/man/d_keynext.1' -a "${1}" != "-c" ; then 
  593.   echo shar: Will not clobber existing file \"'typhoon/man/d_keynext.1'\"
  594. else
  595.   echo shar: Extracting \"'typhoon/man/d_keynext.1'\" \(1734 characters\)
  596.   sed "s/^X//" >'typhoon/man/d_keynext.1' <<'END_OF_FILE'
  597. X.de Id
  598. X.ds Rv \\$3
  599. X.ds Dt \\$4
  600. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  601. X..
  602. X.Id $Id: d_keynext.1,v 1.1 1994/09/13 21:29:57 tbp Exp $
  603. X.ds r \s-1TYPHOON\s0
  604. X.if n .ds - \%--
  605. X.if t .ds - \(em
  606. X.TH D_KEYNEXT 1 \*(Dt TYPHOON
  607. X.SH NAME
  608. Xd_keynext \- find the next key value in an index
  609. X.SH SYNOPSIS
  610. X.B #include <typhoon.h>
  611. X.br
  612. X
  613. X\fBd_keynext(ulong \fPkeyid\fB)
  614. X.SH DESCRIPTION
  615. X\fBd_keynext\fP finds the next key value greater than or equal to the
  616. Xcurrent key value in the index specified by
  617. X\fIkeyid\fP. If \fBd_keynext\fP returns \fBS_NOTFOUND\fP the end of the index
  618. Xhas been passed. A subsequent call to \fBd_keynext\fP will return the first
  619. Xkey value in the index.
  620. X.br
  621. X
  622. XThe id can be either the id of a compound key or a field that is a key
  623. Xby itself.
  624. X.br
  625. X
  626. XThe actual record is not read from the database until \fBd_recread(1)\fP is
  627. Xcalled.
  628. X.SH DIAGNOSTICS
  629. XThe status code returned by the function is also stored in the global
  630. Xvariable \fIdb_status\fP.
  631. X.TP
  632. X.B S_OKAY
  633. XThe key value was found.
  634. X.TP
  635. X.B S_NOTFOUND
  636. XThe key value was not found, i.e. the index is empty.
  637. X.TP
  638. X.B S_NOCD
  639. XThere is no current database.
  640. X.TP
  641. X.B S_INVFLD
  642. XThe id is not a valid field.
  643. X.TP
  644. X.B S_NOTKEY
  645. XThe field id is not a key itself.
  646. X.SH CURRENCY CHANGES
  647. XIf \fBS_OKAY\fP is returned, the record found becomes the current record.
  648. X.SH EXAMPLE
  649. X/* Traverse the customers in alphabetical order */
  650. X
  651. X#include <typhoon.h>
  652. X.br
  653. X
  654. Xd_keyfrst(CUSTOMER_NAME);
  655. X.br
  656. X
  657. Xwhile( db_status == S_OKAY )
  658. X.br
  659. X{
  660. X.br
  661. X    struct customer cust;
  662. X.br
  663. X
  664. X    d_recread(&cust);
  665. X.br
  666. X    printf("%s\\n", cust.name);
  667. X.br
  668. X    d_keynext(CUSTOMER_NAME);
  669. X.br
  670. X}
  671. X.SH IDENTIFICATION
  672. XAuthor: Thomas B. Pedersen.
  673. X.br
  674. XCopyright (c) 1994 Thomas B. Pedersen.
  675. X.SH "SEE ALSO"
  676. Xd_keyfind(1), d_keyprev(1), d_keyfrst(1), d_keylast(1), d_recread(1).
  677. X
  678. END_OF_FILE
  679.   if test 1734 -ne `wc -c <'typhoon/man/d_keynext.1'`; then
  680.     echo shar: \"'typhoon/man/d_keynext.1'\" unpacked with wrong size!
  681.   fi
  682.   # end of 'typhoon/man/d_keynext.1'
  683. fi
  684. if test -f 'typhoon/man/d_keyprev.1' -a "${1}" != "-c" ; then 
  685.   echo shar: Will not clobber existing file \"'typhoon/man/d_keyprev.1'\"
  686. else
  687.   echo shar: Extracting \"'typhoon/man/d_keyprev.1'\" \(1739 characters\)
  688.   sed "s/^X//" >'typhoon/man/d_keyprev.1' <<'END_OF_FILE'
  689. X.de Id
  690. X.ds Rv \\$3
  691. X.ds Dt \\$4
  692. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  693. X..
  694. X.Id $Id: d_keyprev.1,v 1.1 1994/09/13 21:29:58 tbp Exp $
  695. X.ds r \s-1TYPHOON\s0
  696. X.if n .ds - \%--
  697. X.if t .ds - \(em
  698. X.TH D_KEYPREV 1 \*(Dt TYPHOON
  699. X.SH NAME
  700. Xd_keyprev \- find the previous key value in an index
  701. X.SH SYNOPSIS
  702. X.B #include <typhoon.h>
  703. X.br
  704. X
  705. X\fBd_keyprev(ulong \fPkeyid\fB)
  706. X.SH DESCRIPTION
  707. X\fBd_keyprevf\fP finds the next key value smaller than or equal to the
  708. Xcurrent key value in the index specified by 
  709. X\fIkeyid\fP. If \fBd_keyprev\fP returns \fBS_NOTFOUND\fP the start of the
  710. Xindex has been passed. A subsequent call to \fBd_keyprev\fP will return the
  711. Xlast key value in the index.
  712. X.br
  713. X
  714. XThe id can be either the id of a compound key or a field that is a key
  715. Xby itself.
  716. X.br
  717. X
  718. XThe actual record is not read from the database until \fBd_recread(1)\fP is
  719. Xcalled.
  720. X.SH EXAMPLE
  721. X/* Traverse the customers in alphabetical, descending order */
  722. X
  723. X#include <typhoon.h>
  724. X.br
  725. X
  726. Xd_keylast(CUSTOMER_NAME);
  727. X.br
  728. X
  729. Xwhile( db_status == S_OKAY )
  730. X.br
  731. X{
  732. X.br
  733. X    struct customer cust;
  734. X.br
  735. X
  736. X    d_recread(&cust);
  737. X.br
  738. X    printf("%s\\n", cust.name);
  739. X.br
  740. X    d_keyprev(CUSTOMER_NAME);
  741. X.br
  742. X}
  743. X.SH DIAGNOSTICS
  744. XThe status code returned by the function is also stored in the global
  745. Xvariable \fIdb_status\fP.
  746. X.TP
  747. X.B S_OKAY
  748. XThe key value was found.
  749. X.TP
  750. X.B S_NOTFOUND
  751. XThe key value was not found, i.e. the index is empty.
  752. X.TP
  753. X.B S_NOCD
  754. XThere is no current database.
  755. X.TP
  756. X.B S_INVFLD
  757. XThe id is not a valid field.
  758. X.TP
  759. X.B S_NOTKEY
  760. XThe field id is not a key itself.
  761. X.SH CURRENCY CHANGES
  762. XIf \fBS_OKAY\fP is returned, the record found becomes the current record.
  763. X.SH IDENTIFICATION
  764. XAuthor: Thomas B. Pedersen.
  765. X.br
  766. XCopyright (c) 1994 Thomas B. Pedersen.
  767. X.SH "SEE ALSO"
  768. Xd_keyfind(1), d_keynext(1), d_keylast(1), d_recread(1).
  769. X
  770. END_OF_FILE
  771.   if test 1739 -ne `wc -c <'typhoon/man/d_keyprev.1'`; then
  772.     echo shar: \"'typhoon/man/d_keyprev.1'\" unpacked with wrong size!
  773.   fi
  774.   # end of 'typhoon/man/d_keyprev.1'
  775. fi
  776. if test -f 'typhoon/man/d_open.1' -a "${1}" != "-c" ; then 
  777.   echo shar: Will not clobber existing file \"'typhoon/man/d_open.1'\"
  778. else
  779.   echo shar: Extracting \"'typhoon/man/d_open.1'\" \(1532 characters\)
  780.   sed "s/^X//" >'typhoon/man/d_open.1' <<'END_OF_FILE'
  781. X.de Id
  782. X.ds Rv \\$3
  783. X.ds Dt \\$4
  784. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  785. X..
  786. X.Id $Id: d_open.1,v 1.1 1994/09/13 21:29:58 tbp Exp $
  787. X.ds r \s-1TYPHOON\s0
  788. X.if n .ds - \%--
  789. X.if t .ds - \(em
  790. X.TH D_OPEN 1 \*(Dt TYPHOON
  791. X.SH NAME
  792. Xd_open \- open a database
  793. X.SH SYNOPSIS
  794. X.B #include <typhoon.h>
  795. X.br
  796. X
  797. X\fBd_open(char *\fPdbname\fB, char *\fPmode\fB)
  798. X.SH DESCRIPTION
  799. X\fBd_open\fP opens a database in either shared or exclusive mode.
  800. XIf the database does not already exist it is created without warning.
  801. XThe dbd-file must be placed in the path specified by d_dbdpath(1) and 
  802. Xthe database files must be placed in the path specified by d_dbfpath(1).
  803. X\fIdbname\fP is the name of the dbd-file without extension.
  804. X\fImode\fP is "s" or "x" for shared and exclusive mode, respectively.
  805. X
  806. XIf \fBd_open\fP returns \fBS_OKAY\fP the database becomes the current
  807. Xdatabase.
  808. X
  809. XIf the database has already been opened by another process in exclusive
  810. Xmode, d_open returns S_UNAVAIL.
  811. X.SH DIAGNOSTICS
  812. XThe status code returned by the function is also stored in the global
  813. Xvariable \fIdb_status\fP.
  814. X.TP
  815. X.B S_OKAY
  816. XDatabase opened successfully.
  817. X.TP
  818. X.B S_NOMEM
  819. XOut of memory.
  820. X.TP
  821. X.B S_INVDB
  822. XInvalid database name.
  823. X.TP
  824. X.B S_FATALIO
  825. XFatal file i/o error.
  826. X.TP
  827. X.B S_UNAVAIL
  828. XThe database has been opened in exclusive mode by another process.
  829. X.SH CURRENCY CHANGES
  830. XThe opened database becomes the current database.
  831. X.SH IDENTIFICATION
  832. XAuthor: Thomas B. Pedersen.
  833. X.br
  834. XCopyright (c) 1994 Thomas B. Pedersen.
  835. X.SH "SEE ALSO"
  836. Xd_dbdpath(1), d_dbfpath(1), d_setfiles(1), d_close(1), d_destroy(1).
  837. X
  838. END_OF_FILE
  839.   if test 1532 -ne `wc -c <'typhoon/man/d_open.1'`; then
  840.     echo shar: \"'typhoon/man/d_open.1'\" unpacked with wrong size!
  841.   fi
  842.   # end of 'typhoon/man/d_open.1'
  843. fi
  844. if test -f 'typhoon/man/d_recfrst.1' -a "${1}" != "-c" ; then 
  845.   echo shar: Will not clobber existing file \"'typhoon/man/d_recfrst.1'\"
  846. else
  847.   echo shar: Extracting \"'typhoon/man/d_recfrst.1'\" \(1319 characters\)
  848.   sed "s/^X//" >'typhoon/man/d_recfrst.1' <<'END_OF_FILE'
  849. X.de Id
  850. X.ds Rv \\$3
  851. X.ds Dt \\$4
  852. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  853. X..
  854. X.Id $Id: d_recfrst.1,v 1.1 1994/09/13 21:29:58 tbp Exp $
  855. X.ds r \s-1TYPHOON\s0
  856. X.if n .ds - \%--
  857. X.if t .ds - \(em
  858. X.TH D_RECFRST 1 \*(Dt TYPHOON
  859. X.SH NAME
  860. Xd_recfrst \- find the first record in a table
  861. X.SH SYNOPSIS
  862. X.B #include <typhoon.h>
  863. X.br
  864. X
  865. X\fBd_recfrst(ulong \fPrecid\fB)
  866. X.SH DESCRIPTION
  867. X\fBd_recfrst\fP finds the first record in the table specified by 
  868. X\fIrecid\fP. If \fBd_recfrst\fP returns \fBS_NOTFOUND\fP the table 
  869. Xis empty.
  870. X.SH DIAGNOSTICS
  871. XThe status code returned by the function is also stored in the global
  872. Xvariable \fIdb_status\fP.
  873. X.TP
  874. X.B S_OKAY
  875. XA record was found.
  876. X.TP
  877. X.B S_NOTFOUND
  878. XThe key value was not found, i.e. the index is empty.
  879. X.TP
  880. X.B S_NOCD
  881. XThere is no current database.
  882. X.TP
  883. X.B S_INVREC
  884. XThe id is not a record id.
  885. X.SH CURRENCY CHANGES
  886. XIf \fBS_OKAY\fP is returned, the record found becomes the current record.
  887. X.SH EXAMPLE
  888. X/* Traverse the customers in randomorder */
  889. X
  890. X#include <typhoon.h>
  891. X.br
  892. X
  893. Xd_recfrst(CUSTOMER);
  894. X.br
  895. X
  896. Xwhile( db_status == S_OKAY )
  897. X.br
  898. X{
  899. X.br
  900. X    struct customer cust;
  901. X.br
  902. X
  903. X    d_recread(&cust);
  904. X.br
  905. X    printf("%s\\n", cust.name);
  906. X.br
  907. X    d_recnext(CUSTOMER);
  908. X.br
  909. X}
  910. X.SH IDENTIFICATION
  911. XAuthor: Thomas B. Pedersen.
  912. X.br
  913. XCopyright (c) 1994 Thomas B. Pedersen.
  914. X.SH "SEE ALSO"
  915. Xd_reclast(1), d_recnext(1), d_recprev(1), d_recread(1).
  916. X
  917. END_OF_FILE
  918.   if test 1319 -ne `wc -c <'typhoon/man/d_recfrst.1'`; then
  919.     echo shar: \"'typhoon/man/d_recfrst.1'\" unpacked with wrong size!
  920.   fi
  921.   # end of 'typhoon/man/d_recfrst.1'
  922. fi
  923. if test -f 'typhoon/man/d_recnext.1' -a "${1}" != "-c" ; then 
  924.   echo shar: Will not clobber existing file \"'typhoon/man/d_recnext.1'\"
  925. else
  926.   echo shar: Extracting \"'typhoon/man/d_recnext.1'\" \(1317 characters\)
  927.   sed "s/^X//" >'typhoon/man/d_recnext.1' <<'END_OF_FILE'
  928. X.de Id
  929. X.ds Rv \\$3
  930. X.ds Dt \\$4
  931. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  932. X..
  933. X.Id $Id: d_recnext.1,v 1.1 1994/09/13 21:29:59 tbp Exp $
  934. X.ds r \s-1TYPHOON\s0
  935. X.if n .ds - \%--
  936. X.if t .ds - \(em
  937. X.TH D_RECNEXT 1 \*(Dt TYPHOON
  938. X.SH NAME
  939. Xd_recnext \- find the next record in a table
  940. X.SH SYNOPSIS
  941. X.B #include <typhoon.h>
  942. X.br
  943. X
  944. X\fBd_recnext(ulong \fPrecid\fB)
  945. X.SH DESCRIPTION
  946. X\fBd_recnext\fP finds the next record in the table specified by 
  947. X\fIrecid\fP. If \fBd_recnext\fP returns \fBS_NOTFOUND\fP the table 
  948. Xis empty.
  949. X.SH DIAGNOSTICS
  950. XThe status code returned by the function is also stored in the global
  951. Xvariable \fIdb_status\fP.
  952. X.TP
  953. X.B S_OKAY
  954. XA record was found.
  955. X.TP
  956. X.B S_NOTFOUND
  957. XThe key value was not found, i.e. the index is empty.
  958. X.TP
  959. X.B S_NOCD
  960. XThere is no current database.
  961. X.TP
  962. X.B S_INVREC
  963. XThe id is not a record id.
  964. X.SH CURRENCY CHANGES
  965. XIf \fBS_OKAY\fP is returned, the record found becomes the current record.
  966. X.SH EXAMPLE
  967. X/* Traverse the customers in randomorder */
  968. X
  969. X#include <typhoon.h>
  970. X.br
  971. X
  972. Xd_recfrst(CUSTOMER);
  973. X.br
  974. X
  975. Xwhile( db_status == S_OKAY )
  976. X.br
  977. X{
  978. X.br
  979. X    struct customer cust;
  980. X.br
  981. X
  982. X    d_recread(&cust);
  983. X.br
  984. X    printf("%s\\n", cust.name);
  985. X.br
  986. X    d_recnext(CUSTOMER);
  987. X.br
  988. X}
  989. X.SH IDENTIFICATION
  990. XAuthor: Thomas B. Pedersen.
  991. X.br
  992. XCopyright (c) 1994 Thomas B. Pedersen.
  993. X.SH "SEE ALSO"
  994. Xd_recfrst(1), d_reclast(1), d_recprev(1), d_recread(1).
  995. X
  996. END_OF_FILE
  997.   if test 1317 -ne `wc -c <'typhoon/man/d_recnext.1'`; then
  998.     echo shar: \"'typhoon/man/d_recnext.1'\" unpacked with wrong size!
  999.   fi
  1000.   # end of 'typhoon/man/d_recnext.1'
  1001. fi
  1002. if test -f 'typhoon/man/d_recwrite.1' -a "${1}" != "-c" ; then 
  1003.   echo shar: Will not clobber existing file \"'typhoon/man/d_recwrite.1'\"
  1004. else
  1005.   echo shar: Extracting \"'typhoon/man/d_recwrite.1'\" \(1568 characters\)
  1006.   sed "s/^X//" >'typhoon/man/d_recwrite.1' <<'END_OF_FILE'
  1007. X.de Id
  1008. X.ds Rv \\$3
  1009. X.ds Dt \\$4
  1010. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  1011. X..
  1012. X.Id $Id: d_recwrite.1,v 1.1 1994/09/13 21:30:00 tbp Exp $
  1013. X.ds r \s-1TYPHOON\s0
  1014. X.if n .ds - \%--
  1015. X.if t .ds - \(em
  1016. X.TH D_RECWRITE 1 \*(Dt TYPHOON
  1017. X.SH NAME
  1018. Xd_recwrite \- update the current record
  1019. X.SH SYNOPSIS
  1020. X.B #include <typhoon.h>
  1021. X.br
  1022. X
  1023. X\fBd_recwrite(void *\fPbuf\fB)
  1024. X.SH DESCRIPTION
  1025. X\fBd_recwrite\fP updates the contents of the current record.
  1026. X.SH DIAGNOSTICS
  1027. XThe status code returned by the function is also stored in the global
  1028. Xvariable \fIdb_status\fP.
  1029. X.TP
  1030. X.B S_OKAY
  1031. XThe record was successfully updated.
  1032. X.TP
  1033. X.B S_NOCD
  1034. XThere is no current database.
  1035. X.TP
  1036. X.B S_NOCR
  1037. XThere is no current record.
  1038. X.TP
  1039. X.B S_INVREC
  1040. XThe  record id is not valid.
  1041. X.TP
  1042. X.B S_DUPLICATE
  1043. XOne of the keys in the record would cause duplicates in a unique index.
  1044. X\fIdb_subcode\fP contains the id of the conflicting field or key.
  1045. X.TP
  1046. X.B S_RECSIZE
  1047. XA length determinator of a variable length field contained a illegal 
  1048. Xvalue. \fIdb_subcode\fP contains the id of the conflicting field.
  1049. X.TP
  1050. X.B S_FOREIGN
  1051. XThe target of a foreign key could not be found. \fIdb_subcode\fP contains
  1052. Xthe id of the target table.
  1053. X.TP
  1054. X.SH CURRENCY CHANGES
  1055. XNone.
  1056. X.SH EXAMPLE
  1057. X#include <typhoon.h>
  1058. X
  1059. Xstruct customer cust;
  1060. X.br
  1061. Xstrcpy(cust.name, "Pedersen");
  1062. X.br
  1063. Xif( d_keyfind(CUSTOMER_NAME, &cust.name) == S_OKAY )
  1064. X.br
  1065. X{
  1066. X.br
  1067. X    d_recread(&cust);
  1068. X.br
  1069. X    cust.account = 2000;
  1070. X.br
  1071. X    if( d_recwrite(&cust) != S_OKAY )
  1072. X.br
  1073. X        /* handle error */
  1074. X.br
  1075. X}
  1076. X.SH IDENTIFICATION
  1077. XAuthor: Thomas B. Pedersen.
  1078. X.br
  1079. XCopyright (c) 1994 Thomas B. Pedersen.
  1080. X.SH "SEE ALSO"
  1081. Xd_fillnew(1), d_recread(1)
  1082. END_OF_FILE
  1083.   if test 1568 -ne `wc -c <'typhoon/man/d_recwrite.1'`; then
  1084.     echo shar: \"'typhoon/man/d_recwrite.1'\" unpacked with wrong size!
  1085.   fi
  1086.   # end of 'typhoon/man/d_recwrite.1'
  1087. fi
  1088. if test -f 'typhoon/man/ddlp.1' -a "${1}" != "-c" ; then 
  1089.   echo shar: Will not clobber existing file \"'typhoon/man/ddlp.1'\"
  1090. else
  1091.   echo shar: Extracting \"'typhoon/man/ddlp.1'\" \(2382 characters\)
  1092.   sed "s/^X//" >'typhoon/man/ddlp.1' <<'END_OF_FILE'
  1093. X.de Id
  1094. X.ds Rv \\$3
  1095. X.ds Dt \\$4
  1096. X.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
  1097. X..
  1098. X.Id $Id: ddlp.1,v 1.1 1994/09/13 21:30:01 tbp Exp $
  1099. X.ds r \s-1TYPHOON\s0
  1100. X.if n .ds - \%--
  1101. X.if t .ds - \(em
  1102. X.TH DDLP 1 \*(Dt TYPHOON
  1103. X.SH NAME
  1104. Xddlp \- Data Definition Language Processor
  1105. X.SH SYNOPSIS
  1106. X\fBddlp \fP[\fB-a\fP[1|2|4]] [\fB-f\fP] [\fB-h\fP<file>] file
  1107. X.SH DESCRIPTION
  1108. X\fBddlp\fP processes a ddl-file and generates a dbd-file and a header file
  1109. Xwith structures and ids for records, fields and keys.
  1110. X.br
  1111. X
  1112. XThe \fB-a\fP option sets the structure alignment which must match
  1113. Xthe one used by the C compiler. Specifying the \fB-f\fP
  1114. Xoptions causes \fBddlp\fP to only generate constants for those fields
  1115. Xthat are keys. The \fB-h\fP option overrides the default header file name
  1116. Xby the one specified by the user.
  1117. X.br
  1118. X.SH DATA DEFINITION LANGUAGE GRAMMER
  1119. X.TP
  1120. Xdatabase
  1121. X-> "database" name "{" decl {decl} "}"
  1122. X.TP
  1123. Xdecl
  1124. X-> "data" "file" "[" pagesize "]" name "contains"
  1125. X.br
  1126. X   name ";"
  1127. X.br
  1128. X|  "key"  "file" "[" pagesize "]" name "contains"
  1129. X.br
  1130. X   name "." name
  1131. X";"
  1132. X.br
  1133. X|  "define" name expr
  1134. X.br
  1135. X|  "record" name "{" field {field} [key_decls] "}"
  1136. X.br
  1137. X.TP
  1138. Xkey_decls
  1139. X-> primary_key {alternate_key} {foreign_key}
  1140. X.TP
  1141. Xprimary_key
  1142. X-> "primary" "key" name key_def ";"
  1143. X.TP
  1144. Xalternate_key
  1145. X-> "alternate" ["optional"] ["unique"] "key" name
  1146. X.br
  1147. X    key_def
  1148. X";"
  1149. X.TP
  1150. Xforeign_key
  1151. X-> "foreign" ["optional"] foreign_keydef name
  1152. X.br
  1153. X   "references" name ";"
  1154. X.TP
  1155. Xforeign_keydef
  1156. X-> name
  1157. X|  name "{" name { "," name } "}"
  1158. X.TP
  1159. Xkey_def
  1160. X-> "{" key_field { "," key_field } "}"
  1161. X.br
  1162. X   "on" "update" action
  1163. X.br
  1164. X   "on" "delete" action ";"
  1165. X.TP
  1166. Xkey_field
  1167. X-> name [sortorder]
  1168. X.TP
  1169. Xsortorder
  1170. X-> "asc" | "desc"
  1171. X.TP
  1172. Xaction
  1173. X-> "restrict" | "cascade"
  1174. X.TP
  1175. Xpagesize
  1176. X-> "[" int "]"
  1177. X.TP
  1178. Xfield
  1179. X-> type name [dimension] ";"
  1180. X.TP
  1181. Xdimension
  1182. X-> array {array} [ "variable" "by" name ]
  1183. X.TP
  1184. Xarray
  1185. X-> "[" integer "]"
  1186. X.TP
  1187. Xtype
  1188. X-> int_type
  1189. X.br
  1190. X|  "signed" int_type
  1191. X.br
  1192. X|  "unsigned" int_type
  1193. X.br
  1194. X|  float_type
  1195. X.br
  1196. X|  struct_type
  1197. X.TP
  1198. Xint_type
  1199. X-> "char"
  1200. X.br
  1201. X|  "int"
  1202. X.br
  1203. X|  "long"
  1204. X.TP
  1205. Xfloat_type
  1206. X-> "float"
  1207. X.br
  1208. X|  "double"
  1209. X.TP
  1210. Xstruct_type
  1211. X-> struct_head [name] "{" field {field} "}" name
  1212. X.br
  1213. X   [dimension]
  1214. X.TP
  1215. Xstruct_head
  1216. X-> "struct"
  1217. X.br
  1218. X|  "union"
  1219. X.TP
  1220. Xexpr
  1221. X-> expr "+" expr
  1222. X.br
  1223. X|  expr "-" expr
  1224. X.br
  1225. X|  expr "/" expr
  1226. X.br
  1227. X|  expr "*" expr
  1228. X.br
  1229. X|  "(" expr ")"
  1230. X.br
  1231. X|  integer
  1232. X.SH IDENTIFICATION
  1233. XAuthor: Thomas B. Pedersen.
  1234. X.br
  1235. XCopyright (c) 1994 Thomas B. Pedersen.
  1236. X.SH "SEE ALSO"
  1237. END_OF_FILE
  1238.   if test 2382 -ne `wc -c <'typhoon/man/ddlp.1'`; then
  1239.     echo shar: \"'typhoon/man/ddlp.1'\" unpacked with wrong size!
  1240.   fi
  1241.   # end of 'typhoon/man/ddlp.1'
  1242. fi
  1243. if test -f 'typhoon/src/bt_io.c' -a "${1}" != "-c" ; then 
  1244.   echo shar: Will not clobber existing file \"'typhoon/src/bt_io.c'\"
  1245. else
  1246.   echo shar: Extracting \"'typhoon/src/bt_io.c'\" \(2786 characters\)
  1247.   sed "s/^X//" >'typhoon/src/bt_io.c' <<'END_OF_FILE'
  1248. X/*----------------------------------------------------------------------------
  1249. X * File    : bt_io.c
  1250. X * Library : typhoon
  1251. X * OS      : UNIX, OS/2, DOS
  1252. X * Author  : Thomas B. Pedersen
  1253. X *
  1254. X * Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  1255. X *
  1256. X * Permission is hereby granted, without written agreement and without
  1257. X * license or royalty fees, to use, copy, modify, and distribute this
  1258. X * software and its documentation for any purpose, provided that the above
  1259. X * copyright notice and the following two  paragraphs appear (1) in all 
  1260. X * source copies of this software and (2) in accompanying documentation
  1261. X * wherever the programatic interface of this software, or any derivative
  1262. X * of it, is described.
  1263. X *
  1264. X * IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  1265. X * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  1266. X * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  1267. X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1268. X *
  1269. X * THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  1270. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1271. X * A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  1272. X * BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  1273. X * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1274. X *
  1275. X * Description:
  1276. X *   Contains functions for opening and closing B-tree index files.
  1277. X *
  1278. X * Functions:
  1279. X *
  1280. X * $Log: bt_io.c,v $
  1281. X * Revision 1.2  1994/09/17  16:00:12  tbp
  1282. X * typhoon.h and environ.h are now included from <>.
  1283. X *
  1284. X * Revision 1.1  1994/09/13  21:28:29  tbp
  1285. X * Added to repository.
  1286. X * 
  1287. X *
  1288. X *--------------------------------------------------------------------------*/
  1289. X
  1290. Xstatic char rcsid[] = "$Id: bt_io.c,v 1.2 1994/09/17 16:00:12 tbp Exp $";
  1291. X
  1292. X#include <string.h>
  1293. X#include <stdio.h>
  1294. X#ifndef UNIX
  1295. X#    include <io.h>
  1296. X#else
  1297. X#    include <unistd.h>
  1298. X#endif
  1299. X#include <typhoon.h>
  1300. X#include "ty_dbd.h"
  1301. X#include "ty_type.h"
  1302. X#include "btree.h"
  1303. X
  1304. X
  1305. Xix_addr noderead(I, node, page)
  1306. XINDEX   *I;
  1307. Xchar    *node;
  1308. Xix_addr  page;
  1309. X{
  1310. X    int i;
  1311. X
  1312. X    lseek(I->fh, (long)page * I->H.nodesize, SEEK_SET);
  1313. X    if( read(I->fh, node, I->H.nodesize) < I->H.nodesize )
  1314. X        return (ix_addr)-1;
  1315. X    return page;
  1316. X}
  1317. X
  1318. X
  1319. Xix_addr nodewrite(I, node, page)
  1320. XINDEX   *I;
  1321. Xchar    *node;
  1322. Xix_addr  page;
  1323. X{
  1324. X    if( page == NEWPOS )
  1325. X    {
  1326. X        if( I->H.first_deleted )
  1327. X        {
  1328. X            page = I->H.first_deleted;
  1329. X            lseek(I->fh, (long)I->H.nodesize * page, SEEK_SET);
  1330. X            read(I->fh, &I->H.first_deleted, sizeof I->H.first_deleted);
  1331. X        }
  1332. X        else
  1333. X            page = (lseek(I->fh, 0L, SEEK_END) / I->H.nodesize);
  1334. X    }
  1335. X
  1336. X    lseek(I->fh, (long)page * I->H.nodesize, SEEK_SET);
  1337. X    write(I->fh, node, I->H.nodesize);
  1338. X
  1339. X    return page;
  1340. X}
  1341. X/* end-of-file */                    
  1342. END_OF_FILE
  1343.   if test 2786 -ne `wc -c <'typhoon/src/bt_io.c'`; then
  1344.     echo shar: \"'typhoon/src/bt_io.c'\" unpacked with wrong size!
  1345.   fi
  1346.   # end of 'typhoon/src/bt_io.c'
  1347. fi
  1348. if test -f 'typhoon/src/catalog.h' -a "${1}" != "-c" ; then 
  1349.   echo shar: Will not clobber existing file \"'typhoon/src/catalog.h'\"
  1350. else
  1351.   echo shar: Extracting \"'typhoon/src/catalog.h'\" \(1794 characters\)
  1352.   sed "s/^X//" >'typhoon/src/catalog.h' <<'END_OF_FILE'
  1353. X/*---------- headerfile for catalog.ddl ----------*/
  1354. X/* alignment is 4 */
  1355. X
  1356. X/*---------- structures ----------*/
  1357. Xstruct sys_dissite {  /* size 166 */
  1358. X    unsigned long    id;
  1359. X    long    last_call;
  1360. X    unsigned short   tables;
  1361. X    char    name[21];
  1362. X    char    nua[17];
  1363. X    char    udata_len;
  1364. X    char    udata[16];
  1365. X    char    up_to_date;
  1366. X    char    in_error;
  1367. X    char    spare[99];
  1368. X};
  1369. X
  1370. Xstruct sys_distab {  /* size 24 */
  1371. X    long    id;
  1372. X    long    site_id;
  1373. X    long    last_seqno;
  1374. X    char    tag;
  1375. X    char    up_to_date;
  1376. X    char    spare[10];
  1377. X};
  1378. X
  1379. Xstruct sys_distab_key {  /* size 8 */
  1380. X    long    site_id;
  1381. X    long    id;
  1382. X};
  1383. X
  1384. Xstruct sys_dischange {  /* size 53 */
  1385. X    unsigned long    seqno;
  1386. X    long    table_id;
  1387. X    long    recno;
  1388. X    unsigned short   sites;
  1389. X    unsigned char    prog_id;
  1390. X    char    action;
  1391. X    unsigned char    site[37];
  1392. X};
  1393. X
  1394. Xstruct sys_dischange_key {  /* size 8 */
  1395. X    long    table_id;
  1396. X    long    recno;
  1397. X};
  1398. X
  1399. Xstruct sys_disprkey {  /* size 257 */
  1400. X    unsigned short   size;
  1401. X    unsigned char    buf[255];
  1402. X};
  1403. X
  1404. Xstruct sys_disfulltab {  /* size 12 */
  1405. X    long    site_id;
  1406. X    unsigned long    table_id;
  1407. X    unsigned long    curr_rec;
  1408. X};
  1409. X
  1410. Xstruct fulltab_key {  /* size 8 */
  1411. X    long    site_id;
  1412. X    unsigned long    table_id;
  1413. X};
  1414. X
  1415. X/*---------- record names ----------*/
  1416. X#define SYS_DISSITE 1000L
  1417. X#define SYS_DISTAB 2000L
  1418. X#define SYS_DISCHANGE 3000L
  1419. X#define SYS_DISPRKEY 4000L
  1420. X#define SYS_DISFULLTAB 5000L
  1421. X
  1422. X/*---------- field names ----------*/
  1423. X#define SYS_DISSITE_ID 1001L
  1424. X
  1425. X/*---------- key constants ----------*/
  1426. X#define SYS_DISTAB_KEY 1
  1427. X#define SYS_DISCHANGE_KEY 2
  1428. X#define FULLTAB_KEY 3
  1429. X
  1430. X/*---------- integer constants ----------*/
  1431. X#define SITES_MAX 296
  1432. X#define SITEBITMAP_SIZE 37
  1433. X#define SITENAME_LEN 20
  1434. X#define NUA_LEN 16
  1435. X#define UDATA_LEN 16
  1436. X#define KEYSIZE_MAX 255
  1437. END_OF_FILE
  1438.   if test 1794 -ne `wc -c <'typhoon/src/catalog.h'`; then
  1439.     echo shar: \"'typhoon/src/catalog.h'\" unpacked with wrong size!
  1440.   fi
  1441.   # end of 'typhoon/src/catalog.h'
  1442. fi
  1443. if test -f 'typhoon/src/dos.c' -a "${1}" != "-c" ; then 
  1444.   echo shar: Will not clobber existing file \"'typhoon/src/dos.c'\"
  1445. else
  1446.   echo shar: Extracting \"'typhoon/src/dos.c'\" \(1804 characters\)
  1447.   sed "s/^X//" >'typhoon/src/dos.c' <<'END_OF_FILE'
  1448. X/*----------------------------------------------------------------------------
  1449. X * File    : dos.c
  1450. X * Library : typhoon
  1451. X * OS      : UNIX, OS/2, DOS
  1452. X * Author  : Thomas B. Pedersen
  1453. X *
  1454. X * Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  1455. X *
  1456. X * Permission is hereby granted, without written agreement and without
  1457. X * license or royalty fees, to use, copy, modify, and distribute this
  1458. X * software and its documentation for any purpose, provided that the above
  1459. X * copyright notice and the following two  paragraphs appear (1) in all 
  1460. X * source copies of this software and (2) in accompanying documentation
  1461. X * wherever the programatic interface of this software, or any derivative
  1462. X * of it, is described.
  1463. X *
  1464. X * IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  1465. X * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  1466. X * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  1467. X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1468. X *
  1469. X * THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  1470. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1471. X * A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  1472. X * BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  1473. X * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1474. X *
  1475. X * Description:
  1476. X *   Contiains functions specific to DOS.
  1477. X *
  1478. X * Functions:
  1479. X *
  1480. X * $Log: dos.c,v $
  1481. X * Revision 1.1  1994/09/13  21:28:30  tbp
  1482. X * Added to repository.
  1483. X * 
  1484. X *
  1485. X *--------------------------------------------------------------------------*/
  1486. X
  1487. Xstatic char rcsid[] = "$Id: dos.c,v 1.1 1994/09/13 21:28:30 tbp Exp $";
  1488. X
  1489. X
  1490. Xty_openlock()
  1491. X{
  1492. X    return 0;
  1493. X}
  1494. X
  1495. X
  1496. Xty_closelock()
  1497. X{
  1498. X    return 0;
  1499. X}
  1500. X
  1501. X
  1502. Xty_lock()
  1503. X{
  1504. X    return 0;
  1505. X}
  1506. X
  1507. X
  1508. Xty_unlock()
  1509. X{
  1510. X    return 0;
  1511. X}
  1512. X
  1513. X/* end-of-file */
  1514. X
  1515. END_OF_FILE
  1516.   if test 1804 -ne `wc -c <'typhoon/src/dos.c'`; then
  1517.     echo shar: \"'typhoon/src/dos.c'\" unpacked with wrong size!
  1518.   fi
  1519.   # end of 'typhoon/src/dos.c'
  1520. fi
  1521. if test -f 'typhoon/src/makefile' -a "${1}" != "-c" ; then 
  1522.   echo shar: Will not clobber existing file \"'typhoon/src/makefile'\"
  1523. else
  1524.   echo shar: Extracting \"'typhoon/src/makefile'\" \(2254 characters\)
  1525.   sed "s/^X//" >'typhoon/src/makefile' <<'END_OF_FILE'
  1526. X#-----------------------------------------------------------------------------
  1527. X# File    : makefile
  1528. X# Library : typhoon
  1529. X# OS      : UNIX, OS/2, DOS
  1530. X# Author  : Thomas B. Pedersen
  1531. X#
  1532. X# Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  1533. X#
  1534. X# Permission is hereby granted, without written agreement and without
  1535. X# license or royalty fees, to use, copy, modify, and distribute this
  1536. X# software and its documentation for any purpose, provided that the above
  1537. X# copyright notice and the following two  paragraphs appear (1) in all 
  1538. X# source copies of this software and (2) in accompanying documentation
  1539. X# wherever the programatic interface of this software, or any derivative
  1540. X# of it, is described.
  1541. X# 
  1542. X# IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  1543. X# INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  1544. X# THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  1545. X# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1546. X#
  1547. X# THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  1548. X# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1549. X# A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  1550. X# BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  1551. X# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1552. X#
  1553. X# Description:
  1554. X#   Makefile for Typhoon Relational Database Management System.
  1555. X#
  1556. X# $Id: makefile,v 1.3 1994/09/17 16:11:04 tbp Exp $
  1557. X#
  1558. X# $Log: makefile,v $
  1559. X# Revision 1.3  1994/09/17  16:11:04  tbp
  1560. X# Added include directive.
  1561. X#
  1562. X# Added included directive.
  1563. X#
  1564. X# Revision 1.2  1994/09/13  21:36:06  tbp
  1565. X# Compilation of catalog.ddl cannot take place before ddlp has been compiled.
  1566. X#
  1567. X# Revision 1.1  1994/09/13  21:28:31  tbp
  1568. X# Added to repository.
  1569. X# 
  1570. X#
  1571. X#-----------------------------------------------------------------------------
  1572. X
  1573. XOBJS    = bt_del.o bt_funcs.o bt_io.o bt_open.o cmpfuncs.o os.o \
  1574. X          readdbd.o record.o ty_ins.o ty_find.o ty_auxfn.o ty_open.o ty_io.o \
  1575. X          unix.o vlr.o ty_refin.o ty_util.o ty_log.o ty_repl.o
  1576. XLIB        = libtyphoon.a
  1577. XCFLAGS    = -DUNIX -g -Ih
  1578. X
  1579. Xall: $(LIB)
  1580. X
  1581. X$(LIB): $(OBJS)
  1582. X    ar r $(LIB) $(OBJS)
  1583. X    ranlib $(LIB)
  1584. X
  1585. X#catalog.dbd: catalog.ddl
  1586. X#    ddlp -f -hcatalog.h -a4 catalog
  1587. X
  1588. X.c.o:
  1589. X    cc -c $(CFLAGS) $<
  1590. X
  1591. X# end-of-file
  1592. END_OF_FILE
  1593.   if test 2254 -ne `wc -c <'typhoon/src/makefile'`; then
  1594.     echo shar: \"'typhoon/src/makefile'\" unpacked with wrong size!
  1595.   fi
  1596.   # end of 'typhoon/src/makefile'
  1597. fi
  1598. if test -f 'typhoon/src/ty_glob.h' -a "${1}" != "-c" ; then 
  1599.   echo shar: Will not clobber existing file \"'typhoon/src/ty_glob.h'\"
  1600. else
  1601.   echo shar: Extracting \"'typhoon/src/ty_glob.h'\" \(3068 characters\)
  1602.   sed "s/^X//" >'typhoon/src/ty_glob.h' <<'END_OF_FILE'
  1603. X/*----------------------------------------------------------------------------
  1604. X * File    : ty_glob.h
  1605. X * Library : typhoon
  1606. X * OS      : UNIX, OS/2, DOS
  1607. X * Author  : Thomas B. Pedersen
  1608. X *
  1609. X * Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  1610. X *
  1611. X * Permission is hereby granted, without written agreement and without
  1612. X * license or royalty fees, to use, copy, modify, and distribute this
  1613. X * software and its documentation for any purpose, provided that the above
  1614. X * copyright notice and the following two  paragraphs appear (1) in all 
  1615. X * source copies of this software and (2) in accompanying documentation
  1616. X * wherever the programatic interface of this software, or any derivative
  1617. X * of it, is described.
  1618. X *
  1619. X * IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  1620. X * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  1621. X * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  1622. X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1623. X *
  1624. X * THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  1625. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1626. X * A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  1627. X * BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  1628. X * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1629. X *
  1630. X * Description:
  1631. X *   Contains the global variables for the library.
  1632. X *
  1633. X * $Id: ty_glob.h,v 1.1 1994/09/13 21:28:34 tbp Exp $
  1634. X *
  1635. X * $Log: ty_glob.h,v $
  1636. X * Revision 1.1  1994/09/13  21:28:34  tbp
  1637. X * Added to repository.
  1638. X * 
  1639. X *
  1640. X *--------------------------------------------------------------------------*/
  1641. X
  1642. X/*---------------------------------- OS/2 ----------------------------------*\
  1643. X *
  1644. X * If Typhoon is compiled as an OS/2 DLL, the functions must be a special
  1645. X * class in order to be known to other programs.
  1646. X *
  1647. X */
  1648. X
  1649. X#ifdef OS2
  1650. X#    define INCL_NOPMAPI
  1651. X#    include <os2.h>
  1652. X#    define FNCLASS APIRET EXPENTRY
  1653. X#else
  1654. X#    define FNCLASS
  1655. X#    define VAR
  1656. X#endif
  1657. X
  1658. X#ifdef DEFINE_GLOBALS
  1659. X
  1660. XTyphoonGlobals typhoon = {
  1661. X    { 0 },                                    /* dbtab                         */
  1662. X    NULL,                                    /* db                            */
  1663. X    0,                                        /* do_rebuild                    */
  1664. X    0,                                        /* dbs_open                        */
  1665. X    0,                                        /* cur_open                        */
  1666. X    20,                                        /* max_open                        */
  1667. X    { 0 },                                    /* curr_keybuf                    */
  1668. X    0,                                        /* curr_key                        */
  1669. X    -1,                                        /* curr_db                        */
  1670. X    NULL,                                    /* ty_errfn                        */
  1671. X    { '.', DIR_SWITCH, 0 },                    /* dbfpath                        */
  1672. X    { '.', DIR_SWITCH, 0 }                    /* dbdpath                        */
  1673. X};
  1674. X
  1675. Xint             db_status = 0;                    /* Status code                    */
  1676. Xlong         db_subcode = 0;                /* Sub error code                */
  1677. X
  1678. X#else
  1679. X
  1680. X
  1681. Xextern TyphoonGlobals typhoon;
  1682. Xextern int db_status;
  1683. Xextern long db_subcode;
  1684. X
  1685. X
  1686. X#endif
  1687. X
  1688. Xextern         CMPFUNC keycmp[];                /* Comparison function table    */
  1689. X
  1690. X
  1691. X#define DB                typhoon.db
  1692. X#define CURR_DB            typhoon.curr_db
  1693. X#define CURR_KEY        typhoon.curr_key
  1694. X#define CURR_KEYBUF        typhoon.curr_keybuf
  1695. X#define CURR_REC        typhoon.db->curr_rec
  1696. X#define CURR_RECID        typhoon.db->curr_recid
  1697. X#define CURR_BUFREC        typhoon.db->curr_bufrec
  1698. X#define CURR_BUFRECID    typhoon.db->curr_bufrecid
  1699. X
  1700. X
  1701. X
  1702. X/* end-of-file */
  1703. X
  1704. END_OF_FILE
  1705.   if test 3068 -ne `wc -c <'typhoon/src/ty_glob.h'`; then
  1706.     echo shar: \"'typhoon/src/ty_glob.h'\" unpacked with wrong size!
  1707.   fi
  1708.   # end of 'typhoon/src/ty_glob.h'
  1709. fi
  1710. if test -f 'typhoon/src/util/export.h' -a "${1}" != "-c" ; then 
  1711.   echo shar: Will not clobber existing file \"'typhoon/src/util/export.h'\"
  1712. else
  1713.   echo shar: Extracting \"'typhoon/src/util/export.h'\" \(2629 characters\)
  1714.   sed "s/^X//" >'typhoon/src/util/export.h' <<'END_OF_FILE'
  1715. X/*----------------------------------------------------------------------------
  1716. X * File    : export.h
  1717. X * Program : tyexport
  1718. X * OS      : UNIX, OS/2, DOS
  1719. X * Author  : Thomas B. Pedersen
  1720. X *
  1721. X * Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  1722. X *
  1723. X * Permission is hereby granted, without written agreement and without
  1724. X * license or royalty fees, to use, copy, modify, and distribute this
  1725. X * software and its documentation for any purpose, provided that the above
  1726. X * copyright notice and the following two  paragraphs appear (1) in all 
  1727. X * source copies of this software and (2) in accompanying documentation
  1728. X * wherever the programatic interface of this software, or any derivative
  1729. X * of it, is described.
  1730. X *
  1731. X * IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  1732. X * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  1733. X * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  1734. X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1735. X *
  1736. X * THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  1737. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1738. X * A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  1739. X * BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  1740. X * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1741. X *
  1742. X * Description:
  1743. X *   Header file for export utility.
  1744. X * 
  1745. X * $Id: export.h,v 1.1 1994/09/13 21:28:55 tbp Exp $
  1746. X *
  1747. X * $Log: export.h,v $
  1748. X * Revision 1.1  1994/09/13  21:28:55  tbp
  1749. X * Added to repository.
  1750. X *
  1751. X * Added to repository.
  1752. X * 
  1753. X *
  1754. X *--------------------------------------------------------------------------*/
  1755. X
  1756. X#ifdef DEFINE_GLOBALS
  1757. X#define CLASS
  1758. X#define I(x)    = x
  1759. X#else
  1760. X#define CLASS    extern
  1761. X#define I(x)
  1762. X#endif
  1763. X
  1764. X
  1765. X/*--------------------------- Function prototypes --------------------------*/
  1766. Xint    yyerror                PRM( (char *fmt ELLIPSIS); )
  1767. X
  1768. Xvoid err_quit            PRM( (char * ELLIPSIS); )
  1769. Xvoid GenerateExportSpec    PRM( (char *); )
  1770. Xvoid ReadExportSpec        PRM( (char *); )
  1771. X
  1772. X
  1773. X/*------------------------------- Constants --------------------------------*/
  1774. X#define FT_INCLUDE        0x8000                    /* Set in field[].type if    */
  1775. X                                                /* field should be included    */
  1776. X                                                /* export.                    */
  1777. X
  1778. X/*---------------------------- Global variables ----------------------------*/
  1779. XCLASS Dbentry    dbd;
  1780. XCLASS char        dbd_fname[256];
  1781. XCLASS char        spec_fname[256];
  1782. XCLASS int        lex_lineno            I( 1 );        /* Current line number        */
  1783. XCLASS int        errors                I( 0 );        /* Number of errors            */
  1784. XCLASS Header    header;                            /* .dbd file header            */
  1785. X
  1786. X#undef CLASS
  1787. X#undef I
  1788. X
  1789. X/* end-of-file */
  1790. X
  1791. X
  1792. X
  1793. X
  1794. X
  1795. X
  1796. X
  1797. X
  1798. X
  1799. X
  1800. X
  1801. X
  1802. X
  1803. X
  1804. X
  1805. X
  1806. X
  1807. X
  1808. X
  1809. X
  1810. X
  1811. X
  1812. X
  1813. X
  1814. X
  1815. X
  1816. X
  1817. X
  1818. X
  1819. X
  1820. X
  1821. X
  1822. X
  1823. X
  1824. X
  1825. X
  1826. X
  1827. X
  1828. X
  1829. X
  1830. X
  1831. END_OF_FILE
  1832.   if test 2629 -ne `wc -c <'typhoon/src/util/export.h'`; then
  1833.     echo shar: \"'typhoon/src/util/export.h'\" unpacked with wrong size!
  1834.   fi
  1835.   # end of 'typhoon/src/util/export.h'
  1836. fi
  1837. if test -f 'typhoon/src/util/import.h' -a "${1}" != "-c" ; then 
  1838.   echo shar: Will not clobber existing file \"'typhoon/src/util/import.h'\"
  1839. else
  1840.   echo shar: Extracting \"'typhoon/src/util/import.h'\" \(2621 characters\)
  1841.   sed "s/^X//" >'typhoon/src/util/import.h' <<'END_OF_FILE'
  1842. X/*----------------------------------------------------------------------------
  1843. X * File    : import.h
  1844. X * Program : tyimport
  1845. X * OS      : UNIX, OS/2, DOS
  1846. X * Author  : Thomas B. Pedersen
  1847. X *
  1848. X * Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  1849. X *
  1850. X * Permission is hereby granted, without written agreement and without
  1851. X * license or royalty fees, to use, copy, modify, and distribute this
  1852. X * software and its documentation for any purpose, provided that the above
  1853. X * copyright notice and the following two  paragraphs appear (1) in all 
  1854. X * source copies of this software and (2) in accompanying documentation
  1855. X * wherever the programatic interface of this software, or any derivative
  1856. X * of it, is described.
  1857. X *
  1858. X * IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  1859. X * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  1860. X * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  1861. X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1862. X *
  1863. X * THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  1864. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1865. X * A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  1866. X * BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  1867. X * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1868. X *
  1869. X * Description:
  1870. X *   Header file for tyexport.
  1871. X *
  1872. X * $Id: import.h,v 1.1 1994/09/13 21:28:58 tbp Exp $
  1873. X *
  1874. X * $Log: import.h,v $
  1875. X * Revision 1.1  1994/09/13  21:28:58  tbp
  1876. X * Added to repository.
  1877. X *
  1878. X * Added to repository.
  1879. X * 
  1880. X *
  1881. X *--------------------------------------------------------------------------*/
  1882. X
  1883. X#ifdef DEFINE_GLOBALS
  1884. X#define CLASS
  1885. X#define I(x)    = x
  1886. X#else
  1887. X#define CLASS    extern
  1888. X#define I(x)
  1889. X#endif
  1890. X
  1891. X/*--------------------------- Function prototypes --------------------------*/
  1892. Xint    yyerror                PRM( (char *fmt ELLIPSIS); )
  1893. X
  1894. Xvoid err_quit            PRM( (char * ELLIPSIS); )
  1895. Xvoid GenerateImportSpec    PRM( (char *); )
  1896. Xvoid ReadImportSpec        PRM( (char *); )
  1897. X
  1898. X/*------------------------------- Constants --------------------------------*/
  1899. X#define FT_INCLUDE        0x8000                    /* Set in field[].type if    */
  1900. X                                                /* field should be included    */
  1901. X                                                /* import.                    */
  1902. X
  1903. X
  1904. X/*---------------------------- Global variables ----------------------------*/
  1905. XCLASS Dbentry    dbd;
  1906. XCLASS char        dbd_fname[256];
  1907. XCLASS char        spec_fname[256];
  1908. XCLASS int        lex_lineno            I( 1 );        /* Current line number        */
  1909. XCLASS int        errors                I( 0 );        /* Number of errors            */
  1910. XCLASS Header    header;                            /* .dbd file header            */
  1911. X
  1912. X#undef CLASS
  1913. X#undef I
  1914. X
  1915. X/* end-of-file */
  1916. X
  1917. X
  1918. X
  1919. X
  1920. X
  1921. X
  1922. X
  1923. X
  1924. X
  1925. X
  1926. X
  1927. X
  1928. X
  1929. X
  1930. X
  1931. X
  1932. X
  1933. X
  1934. X
  1935. X
  1936. X
  1937. X
  1938. X
  1939. X
  1940. X
  1941. X
  1942. X
  1943. X
  1944. X
  1945. X
  1946. X
  1947. X
  1948. X
  1949. X
  1950. X
  1951. X
  1952. X
  1953. X
  1954. X
  1955. X
  1956. X
  1957. END_OF_FILE
  1958.   if test 2621 -ne `wc -c <'typhoon/src/util/import.h'`; then
  1959.     echo shar: \"'typhoon/src/util/import.h'\" unpacked with wrong size!
  1960.   fi
  1961.   # end of 'typhoon/src/util/import.h'
  1962. fi
  1963. if test -f 'typhoon/src/util/makefile' -a "${1}" != "-c" ; then 
  1964.   echo shar: Will not clobber existing file \"'typhoon/src/util/makefile'\"
  1965. else
  1966.   echo shar: Extracting \"'typhoon/src/util/makefile'\" \(2836 characters\)
  1967.   sed "s/^X//" >'typhoon/src/util/makefile' <<'END_OF_FILE'
  1968. X#-----------------------------------------------------------------------------
  1969. X# File    : makefile
  1970. X# Library : typhoon
  1971. X# OS      : UNIX, OS/2, DOS
  1972. X# Author  : Thomas B. Pedersen
  1973. X#
  1974. X# Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  1975. X#
  1976. X# Permission is hereby granted, without written agreement and without
  1977. X#  license or royalty fees, to use, copy, modify, and distribute this
  1978. X#  software and its documentation for any purpose, provided that the above
  1979. X#  copyright notice and the following two  paragraphs appear (1) in all 
  1980. X#  source copies of this software and (2) in accompanying documentation
  1981. X#  wherever the programatic interface of this software, or any derivative
  1982. X#  of it, is described.
  1983. X# 
  1984. X# IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  1985. X# INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  1986. X# THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  1987. X# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1988. X#
  1989. X# THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  1990. X# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1991. X# A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  1992. X# BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  1993. X# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1994. X#
  1995. X# Description:
  1996. X#   Makefile for Typhoon utilities.
  1997. X#
  1998. X# $Id: makefile,v 1.2 1994/09/17 16:11:14 tbp Exp $
  1999. X#
  2000. X# $Log: makefile,v $
  2001. X# Revision 1.2  1994/09/17  16:11:14  tbp
  2002. X# Added include directive.
  2003. X#
  2004. X# Added included directive.
  2005. X#
  2006. X# Added include directive.
  2007. X#
  2008. X# Revision 1.1  1994/09/13  21:29:00  tbp
  2009. X# Added to repository.
  2010. X#
  2011. X# Added to repository.
  2012. X# 
  2013. X#
  2014. X# ----------------------------------------------------------------------------
  2015. X
  2016. XDDLP_OBJS        = ddl_y.o ddlp.o ddlplex.o ddlpsym.o
  2017. XDBDVIEW_OBJS    = dbdview.o
  2018. XEXPORT_OBJS        = exp_y.o export.o exportlx.o expspec.o
  2019. XIMPORT_OBJS        = imp_y.o import.o importlx.o impspec.o
  2020. XBACKUP_OBJS        = backup.o util.o
  2021. XRESTORE_OBJS    = restore.o util.o fixlog.o
  2022. XLIB                = ../libtyphoon.a
  2023. X
  2024. XCFLAGS            = -DUNIX -g -I../h
  2025. X
  2026. Xall: ddlp dbdview tyexport tyimport
  2027. X
  2028. Xdbdview: $(DBDVIEW_OBJS)
  2029. X    cc $(CFLAGS) -o dbdview $(DBDVIEW_OBJS)
  2030. X
  2031. Xddlp: $(DDLP_OBJS) ddl_y.c
  2032. X    cc $(CFLAGS) -o ddlp $(DDLP_OBJS)
  2033. X
  2034. Xtyimport: $(IMPORT_OBJS) exp_y.c
  2035. X    cc $(CFLAGS) -o tyimport $(IMPORT_OBJS) $(LIB)
  2036. X
  2037. Xtyexport: $(EXPORT_OBJS) imp_y.c
  2038. X    cc $(CFLAGS) -o tyexport $(EXPORT_OBJS) $(LIB)
  2039. X
  2040. Xtybackup: $(BACKUP_OBJS)
  2041. X    $(CC) -o tybackup $(BACKUP_OBJS) ../readdbd.o ../os.o ../unix.o
  2042. X
  2043. Xtyrestore: $(RESTORE_OBJS)
  2044. X    $(CC) -o tyrestore $(RESTORE_OBJS) ../readdbd.o ../os.o ../unix.o
  2045. X
  2046. Xddl_y.c: ddl.y
  2047. X    yacc -d ddl.y
  2048. X    mv y.tab.c ddl_y.c
  2049. X    mv y.tab.h ddl_y.h
  2050. X
  2051. Xexp_y.c: exp.y
  2052. X    yacc -d exp.y
  2053. X    mv y.tab.c exp_y.c
  2054. X    mv y.tab.h exp_y.h
  2055. X
  2056. Ximp_y.c: imp.y
  2057. X    yacc -d imp.y
  2058. X    mv y.tab.c imp_y.c
  2059. X    mv y.tab.h imp_y.h
  2060. X
  2061. X.c.o:
  2062. X    cc -c $(CFLAGS) $<
  2063. X
  2064. X# end-of-file
  2065. END_OF_FILE
  2066.   if test 2836 -ne `wc -c <'typhoon/src/util/makefile'`; then
  2067.     echo shar: \"'typhoon/src/util/makefile'\" unpacked with wrong size!
  2068.   fi
  2069.   # end of 'typhoon/src/util/makefile'
  2070. fi
  2071. if test -f 'typhoon/src/util/util.c' -a "${1}" != "-c" ; then 
  2072.   echo shar: Will not clobber existing file \"'typhoon/src/util/util.c'\"
  2073. else
  2074.   echo shar: Extracting \"'typhoon/src/util/util.c'\" \(2695 characters\)
  2075.   sed "s/^X//" >'typhoon/src/util/util.c' <<'END_OF_FILE'
  2076. X/*----------------------------------------------------------------------------
  2077. X * File    : util.c
  2078. X * Program : tybackup, tyrestore
  2079. X * OS      : UNIX, OS/2, DOS
  2080. X * Author  : Thomas B. Pedersen
  2081. X *
  2082. X * Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  2083. X *
  2084. X * Permission is hereby granted, without written agreement and without
  2085. X * license or royalty fees, to use, copy, modify, and distribute this
  2086. X * software and its documentation for any purpose, provided that the above
  2087. X * copyright notice and the following two  paragraphs appear (1) in all 
  2088. X * source copies of this software and (2) in accompanying documentation
  2089. X * wherever the programatic interface of this software, or any derivative
  2090. X * of it, is described.
  2091. X *
  2092. X * IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  2093. X * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  2094. X * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  2095. X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2096. X *
  2097. X * THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  2098. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2099. X * A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  2100. X * BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  2101. X * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2102. X *
  2103. X * Description:
  2104. X *   Contains miscellaneous function used by tybackup and tyrestore.
  2105. X *
  2106. X * Functions:
  2107. X *   clock_on            - Start timer.
  2108. X *   clock_off            - Stop timer.
  2109. X *   clock_secs            - Report number of seconds passed.
  2110. X *   printlong            - Print a long with 1000 separators.
  2111. X *
  2112. X * $Log: util.c,v $
  2113. X * Revision 1.2  1994/09/17  16:00:57  tbp
  2114. X * typhoon.h and environ.h are now included from <>.
  2115. X *
  2116. X * Revision 1.1  1994/09/13  21:29:01  tbp
  2117. X * Added to repository.
  2118. X *
  2119. X * Added to repository.
  2120. X * 
  2121. X *
  2122. X *--------------------------------------------------------------------------*/
  2123. X
  2124. Xstatic char rcsid[] = "$Id: util.c,v 1.2 1994/09/17 16:00:57 tbp Exp $";
  2125. X
  2126. X#include <time.h>
  2127. X#include <environ.h>
  2128. X
  2129. X
  2130. X/*---------------------------- Global variables ----------------------------*/
  2131. Xstatic ulong        secs_used = 0;
  2132. Xstatic ulong        clock_start = 0;
  2133. X
  2134. X
  2135. X
  2136. Xvoid clock_on()
  2137. X{
  2138. X    clock_start = time(NULL);
  2139. X}
  2140. X
  2141. X
  2142. Xvoid clock_off()
  2143. X{
  2144. X    if( clock_start )
  2145. X        secs_used += time(NULL) - clock_start;
  2146. X}
  2147. X
  2148. X
  2149. Xulong clock_secs()
  2150. X{
  2151. X    return secs_used;
  2152. X}
  2153. X
  2154. X
  2155. Xchar *printlong(number)
  2156. Xulong number;
  2157. X{
  2158. X    static char s[20];
  2159. X    char *p = s + sizeof(s)-1;
  2160. X    int n = 3;
  2161. X    
  2162. X    s[19] = 0;
  2163. X    if( !number )
  2164. X    {
  2165. X        p = s + sizeof(s)-2;
  2166. X        *p = '0';
  2167. X    }
  2168. X    
  2169. X    while( number )
  2170. X    {
  2171. X        *--p = '0' + (number % 10);
  2172. X        number /= 10;
  2173. X        
  2174. X        if( !--n && number )
  2175. X        {
  2176. X            *--p = ',';
  2177. X            n = 3;
  2178. X        }
  2179. X    }
  2180. X
  2181. X    return p;
  2182. X}
  2183. X
  2184. X/* end-of-file */
  2185. END_OF_FILE
  2186.   if test 2695 -ne `wc -c <'typhoon/src/util/util.c'`; then
  2187.     echo shar: \"'typhoon/src/util/util.c'\" unpacked with wrong size!
  2188.   fi
  2189.   # end of 'typhoon/src/util/util.c'
  2190. fi
  2191. if test -f 'typhoon/src/util/util.h' -a "${1}" != "-c" ; then 
  2192.   echo shar: Will not clobber existing file \"'typhoon/src/util/util.h'\"
  2193. else
  2194.   echo shar: Extracting \"'typhoon/src/util/util.h'\" \(1982 characters\)
  2195.   sed "s/^X//" >'typhoon/src/util/util.h' <<'END_OF_FILE'
  2196. X/*----------------------------------------------------------------------------
  2197. X * File    : util.h
  2198. X * Program : tybackup, tyrestore
  2199. X * OS      : UNIX, OS/2, DOS
  2200. X * Author  : Thomas B. Pedersen
  2201. X *
  2202. X * Copyright (c) 1994 Thomas B. Pedersen.  All rights reserved.
  2203. X *
  2204. X * Permission is hereby granted, without written agreement and without
  2205. X * license or royalty fees, to use, copy, modify, and distribute this
  2206. X * software and its documentation for any purpose, provided that the above
  2207. X * copyright notice and the following two  paragraphs appear (1) in all 
  2208. X * source copies of this software and (2) in accompanying documentation
  2209. X * wherever the programatic interface of this software, or any derivative
  2210. X * of it, is described.
  2211. X *
  2212. X * IN NO EVENT SHALL THOMAS B. PEDERSEN BE LIABLE TO ANY PARTY FOR DIRECT,
  2213. X * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
  2214. X * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN 
  2215. X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2216. X *
  2217. X * THOMAS B. PEDERSEN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
  2218. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2219. X * A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" 
  2220. X * BASIS, AND THOMAS B. PEDERSEN HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
  2221. X * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2222. X *
  2223. X * Description:
  2224. X *   Prototypes for functions in util.c.
  2225. X *
  2226. X * $Id: util.h,v 1.1 1994/09/13 21:29:01 tbp Exp $
  2227. X *
  2228. X * $Log: util.h,v $
  2229. X * Revision 1.1  1994/09/13  21:29:01  tbp
  2230. X * Added to repository.
  2231. X *
  2232. X * Added to repository.
  2233. X * 
  2234. X *
  2235. X *--------------------------------------------------------------------------*/
  2236. X
  2237. Xstatic char rcsid[] = "$Id: util.h,v 1.1 1994/09/13 21:29:01 tbp Exp $";
  2238. X
  2239. X/*-------------------------- Function prototypes ---------------------------*/
  2240. Xvoid    clock_on                    PRM( (void); )
  2241. Xvoid    clock_off                    PRM( (void); )
  2242. Xulong    clock_secs                    PRM( (void); )
  2243. Xchar    *printlong                    PRM( (ulong); )
  2244. X
  2245. X
  2246. X/* end-of-file */
  2247. END_OF_FILE
  2248.   if test 1982 -ne `wc -c <'typhoon/src/util/util.h'`; then
  2249.     echo shar: \"'typhoon/src/util/util.h'\" unpacked with wrong size!
  2250.   fi
  2251.   # end of 'typhoon/src/util/util.h'
  2252. fi
  2253. echo shar: End of archive 8 \(of 9\).
  2254. cp /dev/null ark8isdone
  2255. MISSING=""
  2256. for I in 1 2 3 4 5 6 7 8 9 ; do
  2257.     if test ! -f ark${I}isdone ; then
  2258.     MISSING="${MISSING} ${I}"
  2259.     fi
  2260. done
  2261. if test "${MISSING}" = "" ; then
  2262.     echo You have unpacked all 9 archives.
  2263.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2264. else
  2265.     echo You still must unpack the following archives:
  2266.     echo "        " ${MISSING}
  2267. fi
  2268. exit 0
  2269. exit 0 # Just in case...
  2270.