comparison src/database.c @ 247:7a830ce3211e noffle

[svn] *** empty log message ***
author mirkol
date Tue, 26 Mar 2002 17:52:01 +0000
parents 4e69e9b722ae
children 52f467c7213b
comparison
equal deleted inserted replaced
246:6f3a55d18659 247:7a830ce3211e
1 /* 1 /*
2 database.c 2 database.c
3 3
4 $Id: database.c 375 2002-03-15 10:50:33Z bears $ 4 $Id: database.c 379 2002-03-26 17:52:01Z mirkol $
5 5
6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was 6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was
7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs 7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs
8 (e.g. it is not recommended to delete or overwrite entries with 8 (e.g. it is not recommended to delete or overwrite entries with
9 overflow pages). 9 overflow pages).
145 if ( ! p || sscanf( t, "%lu", &db.lastAccess ) != 1 ) 145 if ( ! p || sscanf( t, "%lu", &db.lastAccess ) != 1 )
146 { 146 {
147 Log_err( "Entry in database '%s' is corrupt (lastAccess)", msgId ); 147 Log_err( "Entry in database '%s' is corrupt (lastAccess)", msgId );
148 return FALSE; 148 return FALSE;
149 } 149 }
150 p = Utl_getLn( db.subj, p ); 150 p = Utl_getHeaderLn( db.subj, p );
151 p = Utl_getLn( db.from, p ); 151 p = Utl_getHeaderLn( db.from, p );
152 p = Utl_getLn( db.date, p ); 152 p = Utl_getHeaderLn( db.date, p );
153 p = Utl_getLn( db.ref, p ); 153 p = Utl_getHeaderLn( db.ref, p );
154 p = Utl_getLn( db.xref, p ); 154 p = Utl_getHeaderLn( db.xref, p );
155 if ( ! p ) 155 if ( ! p )
156 { 156 {
157 Log_err( "Entry in database '%s' is corrupt (overview)", msgId ); 157 Log_err( "Entry in database '%s' is corrupt (overview)", msgId );
158 return FALSE; 158 return FALSE;
159 } 159 }
160 p = Utl_getLn( t, p ); 160 p = Utl_getHeaderLn( t, p );
161 if ( ! p || sscanf( t, "%u", &db.bytes ) != 1 ) 161 if ( ! p || sscanf( t, "%u", &db.bytes ) != 1 )
162 { 162 {
163 Log_err( "Entry in database '%s' is corrupt (bytes)", msgId ); 163 Log_err( "Entry in database '%s' is corrupt (bytes)", msgId );
164 return FALSE; 164 return FALSE;
165 } 165 }
166 p = Utl_getLn( t, p ); 166 p = Utl_getHeaderLn( t, p );
167 if ( ! p || sscanf( t, "%u", &db.lines ) != 1 ) 167 if ( ! p || sscanf( t, "%u", &db.lines ) != 1 )
168 { 168 {
169 Log_err( "Entry in database '%s' is corrupt (lines)", msgId ); 169 Log_err( "Entry in database '%s' is corrupt (lines)", msgId );
170 return FALSE; 170 return FALSE;
171 } 171 }