Advanced Programming in the UNIX® Environment
ptg10805159 Section 20.4 Implementation Overview 747 Withdb_store,only one recordfor each key is allowed. Some database systems ...
ptg10805159 748 ADatabase Library Chapter 20 To find a record in the database given its key,db_fetchcalculates the hash value of ...
ptg10805159 Section 20.4 Implementation Overview 749 when we wrote the record to the database. The data offset( 0 )and data leng ...
ptg10805159 750 ADatabase Library Chapter 20 located with only two disk accesses (see Litwin[ 1980 ]or Fagin et al.[ 1979 ]for d ...
ptg10805159 Section 20.5 Centralized or Decentralized? 751 We purposely show the IPC going through the kernel, as most forms of ...
ptg10805159 752 ADatabase Library Chapter 20 The user processes that call the functions in the database library to perform I/O a ...
ptg10805159 Section 20.8 Source Code 753 fgets,for example, to return data that was read into a standardI/O buffer 10 minutes ag ...
ptg10805159 754 ADatabase Library Chapter 20 1#ifndef _APUE_DB_H 2#define _APUE_DB_H 3typedef void*DBHANDLE; 4DBHANDLE db_open(c ...
ptg10805159 Section 20.8 Source Code 755 The next file isdb.c,the C source file for the library.For simplicity, we include all f ...
ptg10805159 756 ADatabase Library Chapter 20 27 /* 28 * Library’s private representation of the database. 29 */ 30 typedef struc ...
ptg10805159 Section 20.8 Source Code 757 60 /* 61 * Internal functions. 62 */ 63 static DB *_db_alloc(int); 64 static void _db_d ...
ptg10805159 758 ADatabase Library Chapter 20 94 db->nhash =NHASH_DEF;/* hash table size */ 95 db->hashoff =HASH_OFF; /* of ...
ptg10805159 Section 20.8 Source Code 759 121 if ((oflag & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC)) { 122 /* 123 * If the ...
ptg10805159 760 ADatabase Library Chapter 20 138 hash[0]=0; 139 for (i = 0; i < NHASH_DEF + 1; i++) 140 strcat(hash, asciiptr ...
ptg10805159 Section 20.8 Source Code 761 171 /* 172 * Allocate an index buffer and a data buffer. 173 * +2 for newline and null ...
ptg10805159 762 ADatabase Library Chapter 20 200 if (db->idxbuf != NULL) 201 free(db->idxbuf); 202 if (db->datbuf != NU ...
ptg10805159 Section 20.8 Source Code 763 230 /* 231 * Find the specified record. Called by db_delete, db_fetch, 232 * and db_sto ...
ptg10805159 764 ADatabase Library Chapter 20 262 while (offset != 0) { 263 nextoffset=_db_readidx(db, offset); 264 if (strcmp(db ...
ptg10805159 Section 20.8 Source Code 765 287 /* 288 * Read a chain ptr field from anywhere in the index file: 289 * the free lis ...
ptg10805159 766 ADatabase Library Chapter 20 317 /* 318 * Position index file and record the offset. db_nextrec 319 * calls us w ...
«
35
36
37
38
39
40
41
42
43
44
»
Free download pdf