home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1992-04-05 | 5.1 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Sun Apr 5 17:22:49 1992, modified Sun Apr 5 17:22:49 1992, creator 'MPS ', type ASCII, 4504 bytes "dbmopen.c" , at 0x1218 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 64 62 6d 6f 70 65 | 6e 2e 63 00 00 00 00 00 |..dbmope|n.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 11 98 00 | 00 01 ac a6 05 20 29 a6 |........|..... ).|
|00000060| 05 20 29 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |. ).....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 8d 53 00 00 |........|.....S..|
|00000080| 2f 2a 20 64 62 6d 6f 70 | 65 6e 2e 63 20 2d 20 4f |/* dbmop|en.c - O|
|00000090| 70 65 6e 20 74 68 65 20 | 66 69 6c 65 20 66 6f 72 |pen the |file for|
|000000a0| 20 64 62 6d 20 6f 70 65 | 72 61 74 69 6f 6e 73 2e | dbm ope|rations.|
|000000b0| 20 54 68 69 73 20 6c 6f | 6f 6b 73 20 6c 69 6b 65 | This lo|oks like|
|000000c0| 20 74 68 65 0d 20 20 20 | 4e 44 42 4d 20 69 6e 74 | the. |NDBM int|
|000000d0| 65 72 66 61 63 65 20 66 | 6f 72 20 64 62 6d 20 75 |erface f|or dbm u|
|000000e0| 73 65 2e 20 2a 2f 0d 0d | 2f 2a 20 20 54 68 69 73 |se. */..|/* This|
|000000f0| 20 66 69 6c 65 20 69 73 | 20 70 61 72 74 20 6f 66 | file is| part of|
|00000100| 20 47 44 42 4d 2c 20 74 | 68 65 20 47 4e 55 20 64 | GDBM, t|he GNU d|
|00000110| 61 74 61 20 62 61 73 65 | 20 6d 61 6e 61 67 65 72 |ata base| manager|
|00000120| 2c 20 62 79 20 50 68 69 | 6c 69 70 20 41 2e 20 4e |, by Phi|lip A. N|
|00000130| 65 6c 73 6f 6e 2e 0d 20 | 20 20 20 43 6f 70 79 72 |elson.. | Copyr|
|00000140| 69 67 68 74 20 28 43 29 | 20 31 39 39 30 2c 20 31 |ight (C)| 1990, 1|
|00000150| 39 39 31 20 20 46 72 65 | 65 20 53 6f 66 74 77 61 |991 Fre|e Softwa|
|00000160| 72 65 20 46 6f 75 6e 64 | 61 74 69 6f 6e 2c 20 49 |re Found|ation, I|
|00000170| 6e 63 2e 0d 0d 20 20 20 | 20 47 44 42 4d 20 69 73 |nc... | GDBM is|
|00000180| 20 66 72 65 65 20 73 6f | 66 74 77 61 72 65 3b 20 | free so|ftware; |
|00000190| 79 6f 75 20 63 61 6e 20 | 72 65 64 69 73 74 72 69 |you can |redistri|
|000001a0| 62 75 74 65 20 69 74 20 | 61 6e 64 2f 6f 72 20 6d |bute it |and/or m|
|000001b0| 6f 64 69 66 79 0d 20 20 | 20 20 69 74 20 75 6e 64 |odify. | it und|
|000001c0| 65 72 20 74 68 65 20 74 | 65 72 6d 73 20 6f 66 20 |er the t|erms of |
|000001d0| 74 68 65 20 47 4e 55 20 | 47 65 6e 65 72 61 6c 20 |the GNU |General |
|000001e0| 50 75 62 6c 69 63 20 4c | 69 63 65 6e 73 65 20 61 |Public L|icense a|
|000001f0| 73 20 70 75 62 6c 69 73 | 68 65 64 20 62 79 0d 20 |s publis|hed by. |
|00000200| 20 20 20 74 68 65 20 46 | 72 65 65 20 53 6f 66 74 | the F|ree Soft|
|00000210| 77 61 72 65 20 46 6f 75 | 6e 64 61 74 69 6f 6e 3b |ware Fou|ndation;|
|00000220| 20 65 69 74 68 65 72 20 | 76 65 72 73 69 6f 6e 20 | either |version |
|00000230| 31 2c 20 6f 72 20 28 61 | 74 20 79 6f 75 72 20 6f |1, or (a|t your o|
|00000240| 70 74 69 6f 6e 29 0d 20 | 20 20 20 61 6e 79 20 6c |ption). | any l|
|00000250| 61 74 65 72 20 76 65 72 | 73 69 6f 6e 2e 0d 0d 20 |ater ver|sion... |
|00000260| 20 20 20 47 44 42 4d 20 | 69 73 20 64 69 73 74 72 | GDBM |is distr|
|00000270| 69 62 75 74 65 64 20 69 | 6e 20 74 68 65 20 68 6f |ibuted i|n the ho|
|00000280| 70 65 20 74 68 61 74 20 | 69 74 20 77 69 6c 6c 20 |pe that |it will |
|00000290| 62 65 20 75 73 65 66 75 | 6c 2c 0d 20 20 20 20 62 |be usefu|l,. b|
|000002a0| 75 74 20 57 49 54 48 4f | 55 54 20 41 4e 59 20 57 |ut WITHO|UT ANY W|
|000002b0| 41 52 52 41 4e 54 59 3b | 20 77 69 74 68 6f 75 74 |ARRANTY;| without|
|000002c0| 20 65 76 65 6e 20 74 68 | 65 20 69 6d 70 6c 69 65 | even th|e implie|
|000002d0| 64 20 77 61 72 72 61 6e | 74 79 20 6f 66 0d 20 20 |d warran|ty of. |
|000002e0| 20 20 4d 45 52 43 48 41 | 4e 54 41 42 49 4c 49 54 | MERCHA|NTABILIT|
|000002f0| 59 20 6f 72 20 46 49 54 | 4e 45 53 53 20 46 4f 52 |Y or FIT|NESS FOR|
|00000300| 20 41 20 50 41 52 54 49 | 43 55 4c 41 52 20 50 55 | A PARTI|CULAR PU|
|00000310| 52 50 4f 53 45 2e 20 20 | 53 65 65 20 74 68 65 0d |RPOSE. |See the.|
|00000320| 20 20 20 20 47 4e 55 20 | 47 65 6e 65 72 61 6c 20 | GNU |General |
|00000330| 50 75 62 6c 69 63 20 4c | 69 63 65 6e 73 65 20 66 |Public L|icense f|
|00000340| 6f 72 20 6d 6f 72 65 20 | 64 65 74 61 69 6c 73 2e |or more |details.|
|00000350| 0d 0d 20 20 20 20 59 6f | 75 20 73 68 6f 75 6c 64 |.. Yo|u should|
|00000360| 20 68 61 76 65 20 72 65 | 63 65 69 76 65 64 20 61 | have re|ceived a|
|00000370| 20 63 6f 70 79 20 6f 66 | 20 74 68 65 20 47 4e 55 | copy of| the GNU|
|00000380| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00000390| 4c 69 63 65 6e 73 65 0d | 20 20 20 20 61 6c 6f 6e |License.| alon|
|000003a0| 67 20 77 69 74 68 20 47 | 44 42 4d 3b 20 73 65 65 |g with G|DBM; see|
|000003b0| 20 74 68 65 20 66 69 6c | 65 20 43 4f 50 59 49 4e | the fil|e COPYIN|
|000003c0| 47 2e 20 20 49 66 20 6e | 6f 74 2c 20 77 72 69 74 |G. If n|ot, writ|
|000003d0| 65 20 74 6f 0d 20 20 20 | 20 74 68 65 20 46 72 65 |e to. | the Fre|
|000003e0| 65 20 53 6f 66 74 77 61 | 72 65 20 46 6f 75 6e 64 |e Softwa|re Found|
|000003f0| 61 74 69 6f 6e 2c 20 36 | 37 35 20 4d 61 73 73 20 |ation, 6|75 Mass |
|00000400| 41 76 65 2c 20 43 61 6d | 62 72 69 64 67 65 2c 20 |Ave, Cam|bridge, |
|00000410| 4d 41 20 30 32 31 33 39 | 2c 20 55 53 41 2e 0d 0d |MA 02139|, USA...|
|00000420| 20 20 20 20 59 6f 75 20 | 6d 61 79 20 63 6f 6e 74 | You |may cont|
|00000430| 61 63 74 20 74 68 65 20 | 61 75 74 68 6f 72 20 62 |act the |author b|
|00000440| 79 3a 0d 20 20 20 20 20 | 20 20 65 2d 6d 61 69 6c |y:. | e-mail|
|00000450| 3a 20 20 70 68 69 6c 40 | 63 73 2e 77 77 75 2e 65 |: phil@|cs.wwu.e|
|00000460| 64 75 0d 20 20 20 20 20 | 20 75 73 2d 6d 61 69 6c |du. | us-mail|
|00000470| 3a 20 20 50 68 69 6c 69 | 70 20 41 2e 20 4e 65 6c |: Phili|p A. Nel|
|00000480| 73 6f 6e 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |son. | |
|00000490| 20 20 20 20 43 6f 6d 70 | 75 74 65 72 20 53 63 69 | Comp|uter Sci|
|000004a0| 65 6e 63 65 20 44 65 70 | 61 72 74 6d 65 6e 74 0d |ence Dep|artment.|
|000004b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004c0| 57 65 73 74 65 72 6e 20 | 57 61 73 68 69 6e 67 74 |Western |Washingt|
|000004d0| 6f 6e 20 55 6e 69 76 65 | 72 73 69 74 79 0d 20 20 |on Unive|rsity. |
|000004e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 42 65 | | Be|
|000004f0| 6c 6c 69 6e 67 68 61 6d | 2c 20 57 41 20 39 38 32 |llingham|, WA 982|
|00000500| 32 36 0d 20 20 20 20 20 | 20 20 20 70 68 6f 6e 65 |26. | phone|
|00000510| 3a 20 20 28 32 30 36 29 | 20 36 37 36 2d 33 30 33 |: (206)| 676-303|
|00000520| 35 0d 20 20 20 20 20 20 | 20 0d 2a 2a 2a 2a 2a 2a |5. | .******|
|00000530| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000540| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000550| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000560| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000570| 2a 2a 2a 2f 0d 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |***/...#|include |
|00000580| 22 67 64 62 6d 64 65 66 | 73 2e 68 22 0d 23 69 6e |"gdbmdef|s.h".#in|
|00000590| 63 6c 75 64 65 20 22 67 | 64 62 6d 65 72 72 6e 6f |clude "g|dbmerrno|
|000005a0| 2e 68 22 0d 23 69 6e 63 | 6c 75 64 65 20 22 65 78 |.h".#inc|lude "ex|
|000005b0| 74 65 72 6e 2e 68 22 0d | 0d 65 78 74 65 72 6e 20 |tern.h".|.extern |
|000005c0| 67 64 62 6d 5f 65 72 72 | 6f 72 20 67 64 62 6d 5f |gdbm_err|or gdbm_|
|000005d0| 65 72 72 6e 6f 3b 0d 0d | 2f 2a 20 49 6e 69 74 69 |errno;..|/* Initi|
|000005e0| 61 6c 69 7a 65 20 6e 64 | 62 6d 20 73 79 73 74 65 |alize nd|bm syste|
|000005f0| 6d 2e 20 20 46 49 4c 45 | 20 69 73 20 61 20 70 6f |m. FILE| is a po|
|00000600| 69 6e 74 65 72 20 74 6f | 20 74 68 65 20 66 69 6c |inter to| the fil|
|00000610| 65 20 6e 61 6d 65 2e 20 | 20 49 6e 0d 20 20 20 73 |e name. | In. s|
|00000620| 74 61 6e 64 61 72 64 20 | 64 62 6d 2c 20 74 68 65 |tandard |dbm, the|
|00000630| 20 64 61 74 61 62 61 73 | 65 20 69 73 20 66 6f 75 | databas|e is fou|
|00000640| 6e 64 20 69 6e 20 66 69 | 6c 65 73 20 63 61 6c 6c |nd in fi|les call|
|00000650| 65 64 20 46 49 4c 45 2e | 70 61 67 20 61 6e 64 0d |ed FILE.|pag and.|
|00000660| 20 20 20 46 49 4c 45 2e | 64 69 72 2e 20 20 54 6f | FILE.|dir. To|
|00000670| 20 6d 61 6b 65 20 67 64 | 62 6d 20 63 6f 6d 70 61 | make gd|bm compa|
|00000680| 74 61 62 6c 65 20 77 69 | 74 68 20 64 62 6d 20 75 |table wi|th dbm u|
|00000690| 73 69 6e 67 20 74 68 65 | 20 64 62 6d 69 6e 69 74 |sing the| dbminit|
|000006a0| 20 63 61 6c 6c 2c 0d 20 | 20 20 74 68 65 20 73 61 | call,. | the sa|
|000006b0| 6d 65 20 66 69 6c 65 20 | 6e 61 6d 65 73 20 61 72 |me file |names ar|
|000006c0| 65 20 75 73 65 64 2e 20 | 20 53 70 65 63 69 66 69 |e used. | Specifi|
|000006d0| 63 61 6c 6c 79 2c 20 64 | 62 6d 69 6e 69 74 20 77 |cally, d|bminit w|
|000006e0| 69 6c 6c 20 75 73 65 20 | 74 68 65 20 66 69 6c 65 |ill use |the file|
|000006f0| 0d 20 20 20 6e 61 6d 65 | 20 46 49 4c 45 2e 70 61 |. name| FILE.pa|
|00000700| 67 20 69 6e 20 69 74 73 | 20 63 61 6c 6c 20 74 6f |g in its| call to|
|00000710| 20 67 64 62 6d 20 6f 70 | 65 6e 2e 20 20 49 66 20 | gdbm op|en. If |
|00000720| 74 68 65 20 66 69 6c 65 | 20 28 46 49 4c 45 2e 70 |the file| (FILE.p|
|00000730| 61 67 29 20 68 61 73 20 | 61 0d 20 20 20 73 69 7a |ag) has |a. siz|
|00000740| 65 20 6f 66 20 7a 65 72 | 6f 20 62 79 74 65 73 2c |e of zer|o bytes,|
|00000750| 20 61 20 66 69 6c 65 20 | 69 6e 69 74 69 61 6c 69 | a file |initiali|
|00000760| 7a 61 74 69 6f 6e 20 70 | 72 6f 63 65 64 75 72 65 |zation p|rocedure|
|00000770| 20 69 73 20 70 65 72 66 | 6f 72 6d 65 64 2c 0d 20 | is perf|ormed,. |
|00000780| 20 20 73 65 74 74 69 6e | 67 20 75 70 20 74 68 65 | settin|g up the|
|00000790| 20 69 6e 69 74 69 61 6c | 20 73 74 72 75 63 74 75 | initial| structu|
|000007a0| 72 65 20 69 6e 20 74 68 | 65 20 66 69 6c 65 2e 20 |re in th|e file. |
|000007b0| 20 41 6e 79 20 65 72 72 | 6f 72 20 64 65 74 65 63 | Any err|or detec|
|000007c0| 74 65 64 20 77 69 6c 6c | 0d 20 20 20 63 61 75 73 |ted will|. caus|
|000007d0| 65 20 61 20 72 65 74 75 | 72 6e 20 76 61 6c 75 65 |e a retu|rn value|
|000007e0| 20 6f 66 20 2d 31 2e 20 | 20 4e 6f 20 65 72 72 6f | of -1. | No erro|
|000007f0| 72 73 20 63 61 75 73 65 | 20 74 68 65 20 72 65 74 |rs cause| the ret|
|00000800| 75 72 6e 20 76 61 6c 75 | 65 20 6f 66 20 30 2e 0d |urn valu|e of 0..|
|00000810| 20 20 20 4e 4f 54 45 3a | 20 66 69 6c 65 2e 64 69 | NOTE:| file.di|
|00000820| 72 20 77 69 6c 6c 20 62 | 65 20 69 67 6e 6f 72 65 |r will b|e ignore|
|00000830| 64 20 61 6e 64 20 77 69 | 6c 6c 20 61 6c 77 61 79 |d and wi|ll alway|
|00000840| 73 20 68 61 76 65 20 61 | 20 73 69 7a 65 20 6f 66 |s have a| size of|
|00000850| 20 7a 65 72 6f 2e 0d 20 | 20 20 46 4c 41 47 53 20 | zero.. | FLAGS |
|00000860| 61 6e 64 20 4d 4f 44 45 | 20 61 72 65 20 74 68 65 |and MODE| are the|
|00000870| 20 73 61 6d 65 20 61 73 | 20 74 68 65 20 6f 70 65 | same as| the ope|
|00000880| 6e 20 28 32 29 20 63 61 | 6c 6c 2e 20 20 54 68 69 |n (2) ca|ll. Thi|
|00000890| 73 20 63 61 6c 6c 20 77 | 69 6c 6c 0d 20 20 20 6c |s call w|ill. l|
|000008a0| 6f 6f 6b 20 61 74 20 74 | 68 65 20 46 4c 41 47 53 |ook at t|he FLAGS|
|000008b0| 20 61 6e 64 20 64 65 63 | 69 64 65 20 77 68 61 74 | and dec|ide what|
|000008c0| 20 63 61 6c 6c 20 74 6f | 20 6d 61 6b 65 20 74 6f | call to| make to|
|000008d0| 20 67 64 62 6d 5f 6f 70 | 65 6e 2e 20 20 46 6f 72 | gdbm_op|en. For|
|000008e0| 0d 20 20 20 46 4c 41 47 | 53 20 3d 3d 20 4f 5f 52 |. FLAG|S == O_R|
|000008f0| 44 4f 4e 4c 59 2c 20 69 | 74 20 77 69 6c 6c 20 62 |DONLY, i|t will b|
|00000900| 65 20 61 20 47 44 42 4d | 5f 52 45 41 44 45 52 2c |e a GDBM|_READER,|
|00000910| 20 69 66 20 46 4c 41 47 | 53 20 3d 3d 20 4f 5f 52 | if FLAG|S == O_R|
|00000920| 44 57 52 7c 4f 5f 43 52 | 45 41 54 2c 0d 20 20 20 |DWR|O_CR|EAT,. |
|00000930| 69 74 20 77 69 6c 6c 20 | 62 65 20 61 20 47 44 42 |it will |be a GDB|
|00000940| 4d 5f 57 52 43 52 45 41 | 54 20 28 63 72 65 61 74 |M_WRCREA|T (creat|
|00000950| 65 72 20 61 6e 64 20 77 | 72 69 74 65 72 29 20 61 |er and w|riter) a|
|00000960| 6e 64 20 69 66 20 74 68 | 65 20 46 4c 41 47 53 20 |nd if th|e FLAGS |
|00000970| 3d 3d 20 4f 5f 52 44 57 | 52 2c 0d 20 20 20 69 74 |== O_RDW|R,. it|
|00000980| 20 77 69 6c 6c 20 62 65 | 20 61 20 47 44 42 4d 5f | will be| a GDBM_|
|00000990| 57 52 49 54 45 52 20 61 | 6e 64 20 69 66 20 46 4c |WRITER a|nd if FL|
|000009a0| 41 47 53 20 63 6f 6e 74 | 61 69 6e 20 4f 5f 54 52 |AGS cont|ain O_TR|
|000009b0| 55 4e 43 20 74 68 65 6e | 20 69 74 20 77 69 6c 6c |UNC then| it will|
|000009c0| 20 62 65 0d 20 20 20 61 | 20 47 44 42 4d 5f 4e 45 | be. a| GDBM_NE|
|000009d0| 57 44 42 2e 20 20 41 6c | 6c 20 6f 74 68 65 72 20 |WDB. Al|l other |
|000009e0| 76 61 6c 75 65 73 20 6f | 66 20 46 4c 41 47 53 20 |values o|f FLAGS |
|000009f0| 69 6e 20 74 68 65 20 66 | 6c 61 67 73 20 61 72 65 |in the f|lags are|
|00000a00| 0d 20 20 20 69 67 6e 6f | 72 65 64 2e 20 2a 2f 0d |. igno|red. */.|
|00000a10| 0d 67 64 62 6d 5f 66 69 | 6c 65 5f 69 6e 66 6f 20 |.gdbm_fi|le_info |
|00000a20| 2a 0d 64 62 6d 5f 6f 70 | 65 6e 20 28 66 69 6c 65 |*.dbm_op|en (file|
|00000a30| 2c 20 66 6c 61 67 73 2c | 20 6d 6f 64 65 29 0d 20 |, flags,| mode). |
|00000a40| 20 20 20 20 63 68 61 72 | 20 2a 66 69 6c 65 3b 0d | char| *file;.|
|00000a50| 20 20 20 20 20 69 6e 74 | 20 66 6c 61 67 73 3b 0d | int| flags;.|
|00000a60| 20 20 20 20 20 69 6e 74 | 20 6d 6f 64 65 3b 0d 7b | int| mode;.{|
|00000a70| 0d 20 20 63 68 61 72 2a | 20 70 61 67 5f 66 69 6c |. char*| pag_fil|
|00000a80| 65 3b 09 20 20 20 20 2f | 2a 20 55 73 65 64 20 74 |e;. /|* Used t|
|00000a90| 6f 20 63 6f 6e 73 74 72 | 75 63 74 20 22 66 69 6c |o constr|uct "fil|
|00000aa0| 65 2e 70 61 67 22 2e 20 | 2a 2f 0d 20 20 63 68 61 |e.pag". |*/. cha|
|00000ab0| 72 2a 20 64 69 72 5f 66 | 69 6c 65 3b 09 20 20 20 |r* dir_f|ile;. |
|00000ac0| 20 2f 2a 20 55 73 65 64 | 20 74 6f 20 63 6f 6e 73 | /* Used| to cons|
|00000ad0| 74 72 75 63 74 20 22 66 | 69 6c 65 2e 64 69 72 22 |truct "f|ile.dir"|
|00000ae0| 2e 20 2a 2f 0d 20 20 73 | 74 72 75 63 74 20 73 74 |. */. s|truct st|
|00000af0| 61 74 20 64 69 72 5f 73 | 74 61 74 3b 09 20 20 20 |at dir_s|tat;. |
|00000b00| 20 2f 2a 20 53 74 61 74 | 20 69 6e 66 6f 72 6d 61 | /* Stat| informa|
|00000b10| 74 69 6f 6e 20 66 6f 72 | 20 22 66 69 6c 65 2e 64 |tion for| "file.d|
|00000b20| 69 72 22 2e 20 2a 2f 0d | 20 20 67 64 62 6d 5f 66 |ir". */.| gdbm_f|
|00000b30| 69 6c 65 5f 69 6e 66 6f | 20 2a 74 65 6d 70 5f 64 |ile_info| *temp_d|
|00000b40| 62 66 3b 20 20 2f 2a 20 | 54 65 6d 70 6f 72 61 72 |bf; /* |Temporar|
|00000b50| 79 20 66 69 6c 65 20 70 | 6f 69 6e 74 65 72 20 73 |y file p|ointer s|
|00000b60| 74 6f 72 61 67 65 2e 20 | 2a 2f 0d 0d 0d 20 20 2f |torage. |*/... /|
|00000b70| 2a 20 50 72 65 70 61 72 | 65 20 74 68 65 20 63 6f |* Prepar|e the co|
|00000b80| 72 72 65 63 74 20 6e 61 | 6d 65 73 20 6f 66 20 22 |rrect na|mes of "|
|00000b90| 66 69 6c 65 2e 70 61 67 | 22 20 61 6e 64 20 22 66 |file.pag|" and "f|
|00000ba0| 69 6c 65 2e 64 69 72 22 | 2e 20 2a 2f 0d 20 20 70 |ile.dir"|. */. p|
|00000bb0| 61 67 5f 66 69 6c 65 20 | 3d 20 28 63 68 61 72 20 |ag_file |= (char |
|00000bc0| 2a 29 20 61 6c 6c 6f 63 | 61 20 28 73 74 72 6c 65 |*) alloc|a (strle|
|00000bd0| 6e 20 28 66 69 6c 65 29 | 2b 35 29 3b 0d 20 20 64 |n (file)|+5);. d|
|00000be0| 69 72 5f 66 69 6c 65 20 | 3d 20 28 63 68 61 72 20 |ir_file |= (char |
|00000bf0| 2a 29 20 61 6c 6c 6f 63 | 61 20 28 73 74 72 6c 65 |*) alloc|a (strle|
|00000c00| 6e 20 28 66 69 6c 65 29 | 2b 35 29 3b 0d 0d 20 20 |n (file)|+5);.. |
|00000c10| 73 74 72 63 70 79 20 28 | 70 61 67 5f 66 69 6c 65 |strcpy (|pag_file|
|00000c20| 2c 20 66 69 6c 65 29 3b | 0d 20 20 73 74 72 63 61 |, file);|. strca|
|00000c30| 74 20 28 70 61 67 5f 66 | 69 6c 65 2c 20 22 2e 70 |t (pag_f|ile, ".p|
|00000c40| 61 67 22 29 3b 0d 20 20 | 73 74 72 63 70 79 20 28 |ag");. |strcpy (|
|00000c50| 64 69 72 5f 66 69 6c 65 | 2c 20 66 69 6c 65 29 3b |dir_file|, file);|
|00000c60| 0d 20 20 73 74 72 63 61 | 74 20 28 64 69 72 5f 66 |. strca|t (dir_f|
|00000c70| 69 6c 65 2c 20 22 2e 64 | 69 72 22 29 3b 0d 20 20 |ile, ".d|ir");. |
|00000c80| 0d 0d 20 20 2f 2a 20 43 | 61 6c 6c 20 74 68 65 20 |.. /* C|all the |
|00000c90| 61 63 74 75 61 6c 20 72 | 6f 75 74 69 6e 65 2c 20 |actual r|outine, |
|00000ca0| 73 61 76 69 6e 67 20 74 | 68 65 20 70 6f 69 6e 74 |saving t|he point|
|00000cb0| 65 72 20 74 6f 20 74 68 | 65 20 66 69 6c 65 20 69 |er to th|e file i|
|00000cc0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 2e 20 2a 2f 0d 20 |nformati|on. */. |
|00000cd0| 20 66 6c 61 67 73 20 26 | 3d 20 4f 5f 52 44 4f 4e | flags &|= O_RDON|
|00000ce0| 4c 59 20 7c 20 4f 5f 52 | 44 57 52 20 7c 20 4f 5f |LY | O_R|DWR | O_|
|00000cf0| 43 52 45 41 54 20 7c 20 | 4f 5f 54 52 55 4e 43 3b |CREAT | |O_TRUNC;|
|00000d00| 0d 20 20 69 66 20 28 66 | 6c 61 67 73 20 3d 3d 20 |. if (f|lags == |
|00000d10| 4f 5f 52 44 4f 4e 4c 59 | 29 0d 20 20 20 20 7b 0d |O_RDONLY|). {.|
|00000d20| 20 20 20 20 20 20 74 65 | 6d 70 5f 64 62 66 20 3d | te|mp_dbf =|
|00000d30| 20 67 64 62 6d 5f 6f 70 | 65 6e 20 28 70 61 67 5f | gdbm_op|en (pag_|
|00000d40| 66 69 6c 65 2c 20 30 2c | 20 47 44 42 4d 5f 52 45 |file, 0,| GDBM_RE|
|00000d50| 41 44 45 52 2c 20 30 2c | 20 4e 55 4c 4c 29 3b 0d |ADER, 0,| NULL);.|
|00000d60| 20 20 20 20 7d 0d 20 20 | 65 6c 73 65 20 69 66 20 | }. |else if |
|00000d70| 28 66 6c 61 67 73 20 3d | 3d 20 28 4f 5f 52 44 57 |(flags =|= (O_RDW|
|00000d80| 52 20 7c 20 4f 5f 43 52 | 45 41 54 29 29 0d 20 20 |R | O_CR|EAT)). |
|00000d90| 20 20 7b 0d 20 20 20 20 | 20 20 74 65 6d 70 5f 64 | {. | temp_d|
|00000da0| 62 66 20 3d 20 67 64 62 | 6d 5f 6f 70 65 6e 20 28 |bf = gdb|m_open (|
|00000db0| 70 61 67 5f 66 69 6c 65 | 2c 20 30 2c 20 47 44 42 |pag_file|, 0, GDB|
|00000dc0| 4d 5f 57 52 43 52 45 41 | 54 2c 20 6d 6f 64 65 2c |M_WRCREA|T, mode,|
|00000dd0| 20 4e 55 4c 4c 29 3b 0d | 20 20 20 20 7d 0d 20 20 | NULL);.| }. |
|00000de0| 65 6c 73 65 20 69 66 20 | 28 20 28 66 6c 61 67 73 |else if |( (flags|
|00000df0| 20 26 20 4f 5f 54 52 55 | 4e 43 29 20 3d 3d 20 4f | & O_TRU|NC) == O|
|00000e00| 5f 54 52 55 4e 43 29 0d | 20 20 20 20 7b 0d 20 20 |_TRUNC).| {. |
|00000e10| 20 20 20 20 74 65 6d 70 | 5f 64 62 66 20 3d 20 67 | temp|_dbf = g|
|00000e20| 64 62 6d 5f 6f 70 65 6e | 20 28 70 61 67 5f 66 69 |dbm_open| (pag_fi|
|00000e30| 6c 65 2c 20 30 2c 20 47 | 44 42 4d 5f 4e 45 57 44 |le, 0, G|DBM_NEWD|
|00000e40| 42 2c 20 6d 6f 64 65 2c | 20 4e 55 4c 4c 29 3b 0d |B, mode,| NULL);.|
|00000e50| 20 20 20 20 7d 0d 20 20 | 65 6c 73 65 0d 20 20 20 | }. |else. |
|00000e60| 20 7b 0d 20 20 20 20 20 | 20 74 65 6d 70 5f 64 62 | {. | temp_db|
|00000e70| 66 20 3d 20 67 64 62 6d | 5f 6f 70 65 6e 20 28 70 |f = gdbm|_open (p|
|00000e80| 61 67 5f 66 69 6c 65 2c | 20 30 2c 20 47 44 42 4d |ag_file,| 0, GDBM|
|00000e90| 5f 57 52 49 54 45 52 2c | 20 30 2c 20 4e 55 4c 4c |_WRITER,| 0, NULL|
|00000ea0| 29 3b 0d 20 20 20 20 7d | 0d 0d 20 20 2f 2a 20 44 |);. }|.. /* D|
|00000eb0| 69 64 20 77 65 20 73 75 | 63 63 65 73 73 66 75 6c |id we su|ccessful|
|00000ec0| 6c 79 20 6f 70 65 6e 20 | 74 68 65 20 66 69 6c 65 |ly open |the file|
|00000ed0| 3f 20 2a 2f 0d 20 20 69 | 66 20 28 74 65 6d 70 5f |? */. i|f (temp_|
|00000ee0| 64 62 66 20 3d 3d 20 4e | 55 4c 4c 29 0d 20 20 20 |dbf == N|ULL). |
|00000ef0| 20 7b 0d 20 20 20 20 20 | 20 67 64 62 6d 5f 65 72 | {. | gdbm_er|
|00000f00| 72 6e 6f 20 3d 20 47 44 | 42 4d 5f 46 49 4c 45 5f |rno = GD|BM_FILE_|
|00000f10| 4f 50 45 4e 5f 45 52 52 | 4f 52 3b 0d 20 20 20 20 |OPEN_ERR|OR;. |
|00000f20| 20 20 72 65 74 75 72 6e | 20 4e 55 4c 4c 3b 0d 20 | return| NULL;. |
|00000f30| 20 20 20 7d 0d 0d 23 69 | 66 64 65 66 20 6d 61 63 | }..#i|fdef mac|
|00000f40| 69 6e 74 6f 73 68 0d 20 | 20 2f 2a 20 44 6f 6e 27 |intosh. | /* Don'|
|00000f50| 74 20 62 6f 74 68 65 72 | 20 77 69 74 68 20 6d 69 |t bother| with mi|
|00000f60| 6e 6f 72 20 63 6f 6d 70 | 74 69 62 69 6c 69 74 79 |nor comp|tibility|
|00000f70| 20 64 65 74 61 69 6c 73 | 20 2a 2f 0d 23 65 6c 73 | details| */.#els|
|00000f80| 65 0d 20 20 2f 2a 20 49 | 66 20 74 68 65 20 64 61 |e. /* I|f the da|
|00000f90| 74 61 62 61 73 65 20 69 | 73 20 6e 65 77 2c 20 6c |tabase i|s new, l|
|00000fa0| 69 6e 6b 20 22 66 69 6c | 65 2e 64 69 72 22 20 74 |ink "fil|e.dir" t|
|00000fb0| 6f 20 22 66 69 6c 65 2e | 70 61 67 22 2e 20 54 68 |o "file.|pag". Th|
|00000fc0| 69 73 20 69 73 20 64 6f | 6e 65 0d 20 20 20 20 20 |is is do|ne. |
|00000fd0| 73 6f 20 74 68 65 20 74 | 69 6d 65 20 73 74 61 6d |so the t|ime stam|
|00000fe0| 70 20 6f 6e 20 62 6f 74 | 68 20 66 69 6c 65 73 20 |p on bot|h files |
|00000ff0| 69 73 20 74 68 65 20 73 | 61 6d 65 2e 20 2a 2f 0d |is the s|ame. */.|
|00001000| 20 20 69 66 20 28 73 74 | 61 74 20 28 64 69 72 5f | if (st|at (dir_|
|00001010| 66 69 6c 65 2c 20 26 64 | 69 72 5f 73 74 61 74 29 |file, &d|ir_stat)|
|00001020| 20 3d 3d 20 30 29 0d 20 | 20 20 20 7b 0d 20 20 20 | == 0). | {. |
|00001030| 20 20 20 69 66 20 28 64 | 69 72 5f 73 74 61 74 2e | if (d|ir_stat.|
|00001040| 73 74 5f 73 69 7a 65 20 | 3d 3d 20 30 29 0d 09 69 |st_size |== 0)..i|
|00001050| 66 20 28 75 6e 6c 69 6e | 6b 20 28 64 69 72 5f 66 |f (unlin|k (dir_f|
|00001060| 69 6c 65 29 20 21 3d 20 | 30 20 7c 7c 20 6c 69 6e |ile) != |0 || lin|
|00001070| 6b 20 28 70 61 67 5f 66 | 69 6c 65 2c 20 64 69 72 |k (pag_f|ile, dir|
|00001080| 5f 66 69 6c 65 29 20 21 | 3d 20 30 29 0d 09 20 20 |_file) !|= 0).. |
|00001090| 7b 0d 09 20 20 20 20 67 | 64 62 6d 5f 65 72 72 6e |{.. g|dbm_errn|
|000010a0| 6f 20 3d 20 47 44 42 4d | 5f 46 49 4c 45 5f 4f 50 |o = GDBM|_FILE_OP|
|000010b0| 45 4e 5f 45 52 52 4f 52 | 3b 0d 09 20 20 20 20 67 |EN_ERROR|;.. g|
|000010c0| 64 62 6d 5f 63 6c 6f 73 | 65 20 28 74 65 6d 70 5f |dbm_clos|e (temp_|
|000010d0| 64 62 66 29 3b 0d 09 20 | 20 20 20 72 65 74 75 72 |dbf);.. | retur|
|000010e0| 6e 20 4e 55 4c 4c 3b 0d | 09 20 20 7d 0d 20 20 20 |n NULL;.|. }. |
|000010f0| 20 7d 0d 20 20 65 6c 73 | 65 0d 20 20 20 20 7b 0d | }. els|e. {.|
|00001100| 20 20 20 20 20 20 2f 2a | 20 53 69 6e 63 65 20 77 | /*| Since w|
|00001110| 65 20 63 61 6e 27 74 20 | 73 74 61 74 20 69 74 2c |e can't |stat it,|
|00001120| 20 77 65 20 61 73 73 75 | 6d 65 20 69 74 20 69 73 | we assu|me it is|
|00001130| 20 6e 6f 74 20 74 68 65 | 72 65 20 61 6e 64 20 74 | not the|re and t|
|00001140| 72 79 0d 20 20 20 20 20 | 20 20 20 20 74 6f 20 6c |ry. | to l|
|00001150| 69 6e 6b 20 74 68 65 20 | 64 69 72 5f 66 69 6c 65 |ink the |dir_file|
|00001160| 20 74 6f 20 74 68 65 20 | 70 61 67 5f 66 69 6c 65 | to the |pag_file|
|00001170| 2e 20 2a 2f 0d 20 20 20 | 20 20 20 69 66 20 28 6c |. */. | if (l|
|00001180| 69 6e 6b 20 28 70 61 67 | 5f 66 69 6c 65 2c 20 64 |ink (pag|_file, d|
|00001190| 69 72 5f 66 69 6c 65 29 | 20 21 3d 20 30 29 0d 09 |ir_file)| != 0)..|
|000011a0| 7b 0d 09 20 20 67 64 62 | 6d 5f 65 72 72 6e 6f 20 |{.. gdb|m_errno |
|000011b0| 3d 20 47 44 42 4d 5f 46 | 49 4c 45 5f 4f 50 45 4e |= GDBM_F|ILE_OPEN|
|000011c0| 5f 45 52 52 4f 52 3b 0d | 09 20 20 67 64 62 6d 5f |_ERROR;.|. gdbm_|
|000011d0| 63 6c 6f 73 65 20 28 74 | 65 6d 70 5f 64 62 66 29 |close (t|emp_dbf)|
|000011e0| 3b 0d 09 20 20 72 65 74 | 75 72 6e 20 4e 55 4c 4c |;.. ret|urn NULL|
|000011f0| 3b 0d 09 7d 0d 20 20 20 | 20 7d 0d 23 65 6e 64 69 |;..}. | }.#endi|
|00001200| 66 0d 0d 20 20 72 65 74 | 75 72 6e 20 74 65 6d 70 |f.. ret|urn temp|
|00001210| 5f 64 62 66 3b 0d 7d 0d | 00 00 00 00 00 00 00 00 |_dbf;.}.|........|
|00001220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001280| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00001290| 69 64 20 67 65 74 61 70 | 70 70 61 72 6d 73 28 63 |id getap|pparms(c|
|000012a0| 68 61 72 20 2a 61 70 4e | 61 6d 65 2c 73 68 6f 72 |har *apN|ame,shor|
|000012b0| 09 64 62 6d 6f 70 65 6e | 2e 63 02 00 00 00 54 45 |.dbmopen|.c....TE|
|000012c0| 58 54 4d 50 53 20 00 00 | 00 00 00 00 00 00 00 00 |XTMPS ..|........|
|000012d0| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 00 |..TEXTMP|S ......|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 a6 04 08 29 00 00 | 11 98 00 00 01 ac 43 20 |.....)..|......C |
|00001300| 49 6e 74 65 72 66 61 63 | 65 20 74 6f 20 74 68 65 |Interfac|e to the|
|00001310| 20 4d 61 63 69 6e 74 6f | 73 68 20 4c 69 62 72 61 | Macinto|sh Libra|
|00001320| 72 69 65 73 0d 0d 0d 20 | 20 20 20 20 20 20 20 43 |ries... | C|
|00001330| 6f 70 79 72 69 67 68 74 | 20 41 70 70 6c 65 20 43 |opyright| Apple C|
|00001340| 6f 6d 70 75 74 65 72 2c | 20 49 6e 63 2e 20 20 20 |omputer,| Inc. |
|00001350| 20 31 39 38 35 2d 31 39 | 39 30 0d 20 20 20 20 20 | 1985-19|90. |
|00001360| 20 20 20 41 6c 6c 20 72 | 69 67 68 74 73 20 72 65 | All r|ights re|
|00001370| 73 65 72 76 65 64 0d 0d | 2a 2a 2a 2a 2a 2a 2a 2a |served..|********|
|00001380| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 20 6c 6f |...H..Mo|naco. lo|
|00001390| 6f 6b 73 20 6c 69 6b 65 | 20 74 68 65 0d 20 20 20 |oks like| the. |
|000013a0| 4e 44 42 4d 20 69 00 06 | 00 08 00 50 00 20 01 dd |NDBM i..|...P. ..|
|000013b0| 02 3d 00 50 00 20 01 dd | 02 3d a6 04 e7 e9 00 00 |.=.P. ..|.=......|
|000013c0| 0e bd 00 00 0e c6 00 00 | 0e 73 01 00 00 00 00 1e |........|.s......|
|000013d0| 00 50 00 20 01 dd 02 3d | 00 50 00 20 01 dd 02 3d |.P. ...=|.P. ...=|
|000013e0| 00 00 0e 73 00 00 00 00 | 00 00 00 00 00 00 00 00 |...s....|........|
|000013f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 49 |.....n..|.n...>.I|
|00001400| aa 38 13 1a 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |.8......|.>..MPSR|
|00001410| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00001420| 03 f0 ff ff 00 00 00 4c | 00 4f de 40 00 00 00 00 |.......L|.O.@....|
|00001430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+