gopherfs

A FUSE gopher file system.
git clone git://r-36.net/gopherfs
Log | Files | Refs | README | LICENSE

sdb.h (503B)


      1 /*
      2  * Copy me if you can.
      3  * by 20h
      4  */
      5 
      6 #ifndef DB_H
      7 #define DB_H
      8 
      9 typedef struct sdbe sdbe;
     10 struct sdbe {
     11 	sdbe *n;
     12 	sdbe *p;
     13 	char *k;
     14 	char *v;
     15 	int l;
     16 };
     17 
     18 typedef struct sdb sdb;
     19 struct sdb {
     20 	sdbe *b;
     21 	sdbe *l;
     22 	int n;
     23 };
     24 
     25 void freeelem(sdbe *e);
     26 sdbe *mkelem(char *v, char *k, int l, sdbe *p, sdbe *n);
     27 sdb *createdb(void);
     28 void destroydb(sdb *d);
     29 int addelem(sdb *d, char *k, char *v, int l);
     30 sdbe *getelem(sdb *d, char *k, sdbe *e);
     31 int delelem(sdb *d, char *k);
     32 void printdb(sdb *d);
     33 
     34 #endif
     35