/[global]/global/libutil/dbop.h
ViewVC logotype

Diff of /global/libutil/dbop.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by shigio, Fri Jun 27 15:51:34 2003 UTC revision 1.12 by shigio, Sat Nov 6 09:25:16 2004 UTC
# Line 25  Line 25 
25  #include "gparam.h"  #include "gparam.h"
26  #include "db.h"  #include "db.h"
27  #include "regex.h"  #include "regex.h"
 #ifdef USE_POSTGRES  
 #include "libpq-fe.h"  
 #endif  
28  #include "strbuf.h"  #include "strbuf.h"
29    
30  #define DBOP_PAGESIZE   8192  #define DBOP_PAGESIZE   8192
# Line 50  typedef        struct { Line 47  typedef        struct {
47          int keylen;                     /* key length */          int keylen;                     /* key length */
48          char prev[MAXKEYLEN+1];         /* previous key value */          char prev[MAXKEYLEN+1];         /* previous key value */
49          int perm;                       /* file permission */          int perm;                       /* file permission */
 #ifdef USE_POSTGRES  
         /*  
          * (3) POSTGRES PART  
          */  
         char tblname[80];               /* table name */  
         PGresult *res;                  /* result structure */  
         /* SQL statement templete */  
         STRBUF *get_stmt;               /* pgop_get() */  
         int get_stmt_len;  
         STRBUF *getkey_stmt;            /* pgop_getkey_by_fid() */  
         int getkey_stmt_len;  
         STRBUF *put_stmt;               /* pgop_put() */  
         int put_stmt_len;  
         STRBUF *fetch_stmt;             /* pgop_first(), pgop_next() */  
         int fetch_stmt_len;  
         STRBUF *delete_stmt;            /* pgop_delete() */  
         int delete_stmt_len;  
 #endif /* POSTGRES */  
50  } DBOP;  } DBOP;
51    
52  /*  /*
# Line 75  typedef        struct { Line 54  typedef        struct {
54   */   */
55  #define DBOP_DUP        1               /* allow duplicate records      */  #define DBOP_DUP        1               /* allow duplicate records      */
56  #define DBOP_REMOVE     2               /* remove file when closed      */  #define DBOP_REMOVE     2               /* remove file when closed      */
 #define DBOP_POSTGRES   4               /* use postgres database        */  
57  /*  /*
58   * ioflags   * ioflags
59   */   */
# Line 85  typedef        struct { Line 63  typedef        struct {
63  void dbop_setinfo(char *info);  void dbop_setinfo(char *info);
64  DBOP *dbop_open(const char *, int, int, int);  DBOP *dbop_open(const char *, int, int, int);
65  char *dbop_get(DBOP *, const char *);  char *dbop_get(DBOP *, const char *);
66  void dbop_put(DBOP *, const char *, const char *, const char *);  void dbop_put(DBOP *, const char *, const char *);
67  void dbop_delete(DBOP *, const char *);  void dbop_delete(DBOP *, const char *);
68  char *dbop_getkey_by_fid(DBOP *, const char *);  void dbop_update(DBOP *, const char *, const char *);
 void dbop_delete_by_fid(DBOP *, const char *);  
 void dbop_update(DBOP *, const char *, const char *, const char *);  
69  char *dbop_first(DBOP *, const char *, regex_t *, int);  char *dbop_first(DBOP *, const char *, regex_t *, int);
70  char *dbop_next(DBOP *);  char *dbop_next(DBOP *);
71  char *dbop_lastdat(DBOP *);  char *dbop_lastdat(DBOP *);

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26