1: /* $Header$ */ 2: 3: /* 4: * Author: Peter J. Nicklin 5: */ 6: 7: /* 8: * pbfndkey() searchs for key in buffer and returns a pointer to its 9: * location, otherwise null. 10: */ 11: #include "null.h" 12: #include "pdbuf.h" 13: 14: extern char *CURPBUF; /* current database buffer */ 15: 16: char * 17: pbfndkey(key) 18: char *key; /* key string */ 19: { 20: register char *bp; /* buffer pointer */ 21: char *pbskipkey(); /* skip to next key */ 22: int pbcmpkey(); /* compare keys */ 23: 24: bp = CURPBUF; 25: while (*bp != _PBFS && *bp != '\0') 26: { 27: if (pbcmpkey(key, bp) == 0) 28: return(bp); 29: bp = pbskipkey(bp); 30: } 31: return(NULL); 32: }