Lines Matching refs:dbp

65 ask_db(dbp, file)
66 struct db *dbp;
102 for (ep = (struct dbe *)&(dbp->db_hash[index]); (ep && ep->dbe_lop);
105 (struct dbe *)&AP(dbp)[ep->dbe_next]) {
107 tlop = (struct link_object *)&AP(dbp)[ep->dbe_lop];
109 if (strcmp((char *)&AP(dbp)[tlop->lo_name],
120 &AP(dbp)[ep->dbe_name] + tlop->lo_minor) > 0)
122 &AP(dbp)[ep->dbe_name], file + to_min);
123 return (&AP(dbp)[ep->dbe_name]);
133 struct db *dbp; /* database pointer */
143 if (dbp = find_so(ds)) {
144 (void) new_dbd(dbdpp, dbp);
146 return (dbp);
159 struct db *dbp; /* database */
196 dbp = calloc(sizeof (struct db), 1);
197 dbp->db_name = RELPTR(dbp, calloc((strlen(ds) + 1), 1));
198 (void) strcpy((char *)&AP(dbp)[dbp->db_name], ds);
247 ep = &(dbp->db_hash[index]);
249 ep->dbe_lop = (long)get_lo(dbp, cp,
253 &AP(dbp)[ep->dbe_lop];
254 (void) strcpy(&AP(dbp)[tlop->lo_next],
258 for (ep = &(dbp->db_hash[index]); ep;
260 ep = (struct dbe *)&AP(dbp)[ep->dbe_next]) {
263 &AP(dbp)[ep->dbe_lop];
269 (strncmp(&AP(dbp)[tlop->lo_name],
271 (*(&AP(dbp)[tlop->lo_name +
274 (char *)(&AP(dbp)[tlop->lo_next]
276 (void) strcpy(&AP(dbp)
282 ep->dbe_next = RELPTR(dbp,
286 &AP(dbp)[ep->dbe_next];
287 ep->dbe_lop = (long)get_lo(dbp,
291 &AP(dbp)[ep->dbe_lop];
292 (void) strcpy(&AP(dbp)[tlop->lo_next],
298 fix_lo(dbp);
300 return (dbp);
307 get_lo(dbp, cp, cplen, m, n)
308 struct db *dbp; /* data base */
328 lop = (struct link_object *)RELPTR(dbp,
331 tlop = (struct link_object *)&AP(dbp)[(long)lop];
341 tlop->lo_next = (long)RELPTR(dbp, calloc(MAXNAMLEN, 1));
346 tlop->lo_name = (long)RELPTR(dbp, calloc((cplen + 1), 1));
347 (void) strncpy((char *)&AP(dbp)[tlop->lo_name], cp, cplen);
378 fix_lo(dbp)
379 struct db *dbp;
382 int dirlen = strlen(&AP(dbp)[dbp->db_name]);
390 for (ep = &(dbp->db_hash[i]); ep && ep->dbe_lop;
393 (struct dbe *)&AP(dbp)[ep->dbe_next])) {
395 lop = (struct link_object *)&AP(dbp)[ep->dbe_lop];
396 tp = &AP(dbp)[lop->lo_next];
397 ep->dbe_name = RELPTR(dbp,
400 cp = strncpy(&AP(dbp)[ep->dbe_name],
401 &AP(dbp)[dbp->db_name], dirlen);
410 * Allocate a new dbd, append it after dbdpp and set the dbd_dbp to dbp.
413 new_dbd(dbdpp, dbp)
415 struct db *dbp; /* db associated with this dbd */
420 dbdp->dbd_db = dbp;