Unix Man ( )


DBM(3)


DBM(3)
XENIX System V (21 1987)


dbminit, fetch, store, delete, firstkey, nextkey - ypae ao ax

typedef struct {char *dptr;int dsize;} datum;

int dbminit (file) char *file;

datum fetch (key) datum key;

store (key, content) datum key, content;

delete (key) datum key;

datum firstkey ()

datum nextkey (key) datum key;


y ypa paoo a ax, oopo ocy aoy eey a ocyecec o y. y oy ocya oe oe a ax (o apa oo). ocy o y oe a p, a oceoae. popa, coye y, o oooac c ao -ldbm.

o key content ocac c oo e a datum, aaeo cpoy dsize ao, a oopy yaae dptr. oyc pooe ae oo ccee cce coe cpo. aa ax paeaec yx aax. ep a o aao a, coepa apy pacpeee a. Bopo a coep coceo ae. epoo aa ee cyc .dir, opoo - cyc .pag.

oye ocya ae ee yo op oo dbminit. B oe op a file.dir file.pag (file - apye y dbminit) o cyecoa. yca aa coaec ye coa x ao c yeo o.

oce op a ae ee pac c oo y fetch aocc ee c oo y store. Bopa aecee pooc c oo a - apyea key. K cae c ae yoac c oo y delete. oceoae pocop cex e ae oe cea c oo y firstkey nextkey. Firstkey opaae ep ae, nextkey opaae , oop ceye a o, c apyeo y. Hecey ooe pocope c ay:

for(key=firstkey();key.dptr!=NULL;key=nextkey(key))

BOPAAEOE AEE


y, opaae ee ae, cyae o opaa opaeoe co. B cyae yceoo aepe opaaec 0. y, opaae aee a datum, cyae o ycaaa oe dptr NULL.

AEA