[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Gnu dbn (GBDM) - hjælp



>[Jeg skal lave et distribueret DB management system. Herunder kataloger =
>og filstrukturer til tabellerne. Har lavet et SQL-sprog, som nu skal =
>implementeres. Her skal jeg bl.a. finde p=E5 en m=E5de at repr=E6sentere =
>tabellerne p=E5.]

Det kunne være at du kunne få noget inspiration fra:

http://www.hwaci.com/sw/sqlite/

men ellers -- gdb fungerer som en hash tabel/en dictionary, hvor du ved hjælp
af en nøgle kan finde noget data. Nøglen er vilkårlig længde binære data. Det
er alt :)

Start med:

db = gdbm_open("yourfile", 512, GDBM_READER|GDBM_WRCREAT, 0600, NULL);

og så
struct datum key;
key.dptr = "something";
key.dsize = strlen(key.dptr);

data.dptr = "noget data her";
data.dsize = strlen(key.dptr);

gdbm_store(db, key, data, GDBM_REPLACE);

// hent data igen:

data = gdbm_fetch(db, key);
// husk at free data.dptr efter du er færdig med at bruge den her


Det burde være forholdsvis let at lægge et tyndt lag C++ over det her, så det
bliver noget lettere at have noget med at gøre.

Mere information i gdbm info filen (C-h C-I gdbm fra emacs, eller "info gdbm"
på kommandolinen).

PS: Der bliver dog ikke udviklket på GDBM mere, så måske skulle du overveje
Berkeley DB.

-- 
=======================================================================
<sslug@sslug>           Herlev, Denmark       Software Designer
<URL:http://www.andreasen.org/>       <*>         LASAT^WEicon Networks
=======================================================================


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *