/[global]/global/libutil/gpathop.c
ViewVC logotype

Diff of /global/libutil/gpathop.c

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

revision 1.16 by h-iwamoto, Sun Oct 31 13:06:12 2004 UTC revision 1.17 by shigio, Sat Nov 6 09:25:16 2004 UTC
# Line 101  gpath_put(path) Line 101  gpath_put(path)
101          if (dbop_get(dbop, path) != NULL)          if (dbop_get(dbop, path) != NULL)
102                  return;                  return;
103          snprintf(fid, sizeof(fid), "%d", _nextkey++);          snprintf(fid, sizeof(fid), "%d", _nextkey++);
104  #ifdef USE_POSTGRES          dbop_put(dbop, path, fid);
105          if (dbop->openflags & DBOP_POSTGRES) {          dbop_put(dbop, fid, path);
                 dbop_put(dbop, path, fid, fid);  
         } else {  
 #endif  
                 dbop_put(dbop, path, fid, "0");  
                 dbop_put(dbop, fid, path, "0");  
 #ifdef USE_POSTGRES  
         }  
 #endif  
106  }  }
107  /*  /*
108   * gpath_path2fid: convert path into id   * gpath_path2fid: convert path into id
# Line 135  char * Line 127  char *
127  gpath_fid2path(fid)  gpath_fid2path(fid)
128          const char *fid;          const char *fid;
129  {  {
 #ifdef USE_POSTGRES  
         if (dbop->openflags & DBOP_POSTGRES)  
                 return dbop_getkey_by_fid(dbop, fid);  
 #endif  
130          return dbop_get(dbop, fid);          return dbop_get(dbop, fid);
131  }  }
132  /*  /*
# Line 158  gpath_delete(path) Line 146  gpath_delete(path)
146          fid = dbop_get(dbop, path);          fid = dbop_get(dbop, path);
147          if (fid == NULL)          if (fid == NULL)
148                  return;                  return;
149  #ifdef USE_POSTGRES          dbop_delete(dbop, fid);
150          if (dbop->openflags & DBOP_POSTGRES) {          dbop_delete(dbop, path);
                 dbop_delete_by_fid(dbop, fid);  
         } else {  
 #endif  
                 dbop_delete(dbop, fid);  
                 dbop_delete(dbop, path);  
 #ifdef USE_POSTGRES  
         }  
 #endif  
151  }  }
152  /*  /*
153   * gpath_nextkey: return next key   * gpath_nextkey: return next key
# Line 196  gpath_close(void) Line 176  gpath_close(void)
176          }          }
177          snprintf(fid, sizeof(fid), "%d", _nextkey);          snprintf(fid, sizeof(fid), "%d", _nextkey);
178          if (_mode == 1 || _mode == 2)          if (_mode == 1 || _mode == 2)
179                  dbop_update(dbop, NEXTKEY, fid, "0");                  dbop_update(dbop, NEXTKEY, fid);
180          dbop_close(dbop);          dbop_close(dbop);
181          if (_mode == 1)          if (_mode == 1)
182                  created = 1;                  created = 1;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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