1/* lookup.c: The opielookup() library function. 2 3%%% copyright-cmetz-96 4This software is Copyright 1996-2001 by Craig Metz, All Rights Reserved. 5The Inner Net License Version 3 applies to this software. 6You should have received a copy of the license with this software. If 7you didn't get a copy, you may request one from <license@inner.net>. 8 9 History: 10 11 Created by cmetz for OPIE 2.3 (re-write). 12*/ 13 14#include "opie_cfg.h" 15#include <stdio.h> 16#include "opie.h" 17 18int opielookup FUNCTION((opie, principal), struct opie *opie AND char *principal) 19{ 20 int i; 21 22 memset(opie, 0, sizeof(struct opie)); 23 opie->opie_principal = principal; 24 25 if (i = __opiereadrec(opie)) 26 return i; 27 28 return (opie->opie_flags & __OPIE_FLAGS_RW) ? 0 : 2; 29} 30 31