Lines Matching full:ep

84 	EXF *ep;  in db_get()  local
99 if ((ep = sp->ep) == NULL) { in db_get()
135 if (lno == ep->c_lno) { in db_get()
140 *lenp = ep->c_len; in db_get()
142 *pp = ep->c_lp; in db_get()
145 ep->c_lno = OOBLNO; in db_get()
151 switch (ep->db->get(ep->db, &key, &data, 0)) { in db_get()
175 BINC_GOTOW(sp, ep->c_lp, ep->c_blen, wlen); in db_get()
176 MEMCPY(ep->c_lp, wp, wlen); in db_get()
178 ep->c_lp = data.data; in db_get()
179 ep->c_lno = lno; in db_get()
180 ep->c_len = wlen; in db_get()
188 *pp = ep->c_lp; in db_get()
202 EXF *ep; in db_delete() local
208 if ((ep = sp->ep) == NULL) { in db_delete()
225 if (ep->db->del(ep->db, &key, 0) == 1) { in db_delete()
232 if (lno <= ep->c_lno) in db_delete()
233 ep->c_lno = OOBLNO; in db_delete()
234 if (ep->c_nlines != OOBLNO) in db_delete()
235 --ep->c_nlines; in db_delete()
238 if (F_ISSET(ep, F_FIRSTMODIFY)) in db_delete()
240 F_SET(ep, F_MODIFIED); in db_delete()
256 EXF *ep; in db_append() local
265 if ((ep = sp->ep) == NULL) { in db_append()
277 if (ep->db->put(ep->db, &key, &data, R_IAFTER) == -1) { in db_append()
284 if (lno < ep->c_lno) in db_append()
285 ep->c_lno = OOBLNO; in db_append()
286 if (ep->c_nlines != OOBLNO) in db_append()
287 ++ep->c_nlines; in db_append()
290 if (F_ISSET(ep, F_FIRSTMODIFY)) in db_append()
292 F_SET(ep, F_MODIFIED); in db_append()
327 EXF *ep; in db_insert() local
337 if ((ep = sp->ep) == NULL) { in db_insert()
349 if (ep->db->put(ep->db, &key, &data, R_IBEFORE) == -1) { in db_insert()
356 if (lno >= ep->c_lno) in db_insert()
357 ep->c_lno = OOBLNO; in db_insert()
358 if (ep->c_nlines != OOBLNO) in db_insert()
359 ++ep->c_nlines; in db_insert()
362 if (F_ISSET(ep, F_FIRSTMODIFY)) in db_insert()
364 F_SET(ep, F_MODIFIED); in db_insert()
390 EXF *ep; in db_set() local
399 if ((ep = sp->ep) == NULL) { in db_set()
414 if (ep->db->put(ep->db, &key, &data, 0) == -1) { in db_set()
421 if (lno == ep->c_lno) in db_set()
422 ep->c_lno = OOBLNO; in db_set()
425 if (F_ISSET(ep, F_FIRSTMODIFY)) in db_set()
427 F_SET(ep, F_MODIFIED); in db_set()
445 EXF *ep; in db_exist() local
448 if ((ep = sp->ep) == NULL) { in db_exist()
460 if (ep->c_nlines != OOBLNO) in db_exist()
462 ep->c_nlines + (((TEXT *)TAILQ_LAST(sp->tiq, _texth))->lno - in db_exist()
463 ((TEXT *)TAILQ_FIRST(sp->tiq))->lno) : ep->c_nlines)); in db_exist()
479 EXF *ep; in db_last() local
485 if ((ep = sp->ep) == NULL) { in db_last()
494 if (ep->c_nlines != OOBLNO) { in db_last()
495 *lnop = ep->c_nlines; in db_last()
505 switch (ep->db->seq(ep->db, &key, &data, R_LAST)) { in db_last()
518 if (lno != ep->c_lno) { in db_last()
523 BINC_GOTOW(sp, ep->c_lp, ep->c_blen, wlen); in db_last()
524 MEMCPY(ep->c_lp, wp, wlen); in db_last()
526 ep->c_lp = data.data; in db_last()
527 ep->c_lno = lno; in db_last()
528 ep->c_len = wlen; in db_last()
530 ep->c_nlines = lno; in db_last()
552 EXF *ep = sp->ep; in db_rget() local
558 if ((rval = ep->db->get(ep->db, &key, &data, 0)) == 0) in db_rget()
577 EXF *ep = sp->ep; in db_rset() local
584 return ep->db->put(ep->db, &key, &data, 0); in db_rset()
608 EXF *ep; in scr_update() local
614 ep = sp->ep; in scr_update()
615 if (ep->refcnt != 1) in scr_update()
617 if (sp != tsp && tsp->ep == ep) in scr_update()