diff options
Diffstat (limited to 'usr/src/lib/libresolv2/common/irs/lcl_ng.c')
-rw-r--r-- | usr/src/lib/libresolv2/common/irs/lcl_ng.c | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/usr/src/lib/libresolv2/common/irs/lcl_ng.c b/usr/src/lib/libresolv2/common/irs/lcl_ng.c index 05adcdf9f9..70e0b4563f 100644 --- a/usr/src/lib/libresolv2/common/irs/lcl_ng.c +++ b/usr/src/lib/libresolv2/common/irs/lcl_ng.c @@ -1,29 +1,22 @@ /* - * Copyright 1997-2002 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: lcl_ng.c,v 1.17 2001/05/29 05:49:05 marka Exp $"; +static const char rcsid[] = "$Id: lcl_ng.c,v 1.3 2005/04/27 04:56:31 sra Exp $"; #endif /* Imports */ @@ -50,11 +43,10 @@ static const char rcsid[] = "$Id: lcl_ng.c,v 1.17 2001/05/29 05:49:05 marka Exp /* Definitions */ -#define NG_HOST 0 /* Host name */ -#define NG_USER 1 /* User name */ -#define NG_DOM 2 /* and Domain name */ -#define LINSIZ 1024 /* Length of netgroup file line */ - +#define NG_HOST 0 /*%< Host name */ +#define NG_USER 1 /*%< User name */ +#define NG_DOM 2 /*%< and Domain name */ +#define LINSIZ 1024 /*%< Length of netgroup file line */ /* * XXX Warning XXX * This code is a hack-and-slash special. It realy needs to be @@ -62,24 +54,25 @@ static const char rcsid[] = "$Id: lcl_ng.c,v 1.17 2001/05/29 05:49:05 marka Exp * More reasonable data structures would not be a bad thing. */ -/* +/*% * Static Variables and functions used by setnetgrent(), getnetgrent() and * endnetgrent(). + * * There are two linked lists: - * - linelist is just used by setnetgrent() to parse the net group file via. + * \li linelist is just used by setnetgrent() to parse the net group file via. * parse_netgrp() - * - netgrp is the list of entries for the current netgroup + * \li netgrp is the list of entries for the current netgroup */ struct linelist { - struct linelist *l_next; /* Chain ptr. */ - int l_parsed; /* Flag for cycles */ - char * l_groupname; /* Name of netgroup */ - char * l_line; /* Netgroup entrie(s) to be parsed */ + struct linelist *l_next; /*%< Chain ptr. */ + int l_parsed; /*%< Flag for cycles */ + char * l_groupname; /*%< Name of netgroup */ + char * l_line; /*%< Netgroup entrie(s) to be parsed */ }; struct ng_old_struct { - struct ng_old_struct *ng_next; /* Chain ptr */ - char * ng_str[3]; /* Field pointers, see below */ + struct ng_old_struct *ng_next; /*%< Chain ptr */ + char * ng_str[3]; /*%< Field pointers, see below */ }; struct pvt { @@ -149,7 +142,7 @@ ng_close(struct irs_ng *this) { memput(this, sizeof *this); } -/* +/*% * Parse the netgroup file looking for the netgroup and build the list * of netgrp structures. Let parse_netgrp() and read_for_group() do * most of the work. @@ -181,7 +174,7 @@ ng_rewind(struct irs_ng *this, const char *group) { pvt->nextgrp = pvt->grouphead.gr; } -/* +/*% * Get the next netgroup off the list. */ static int @@ -200,7 +193,7 @@ ng_next(struct irs_ng *this, const char **host, const char **user, return (0); } -/* +/*% * Search for a match in a netgroup. */ static int @@ -236,7 +229,7 @@ ng_minimize(struct irs_ng *this) { /* Private */ -/* +/*% * endnetgrent() - cleanup */ static void @@ -273,7 +266,7 @@ freelists(struct irs_ng *this) { pvt->grouphead.gr = NULL; } -/* +/*% * Parse the netgroup file setting up the linked lists. */ static int @@ -356,7 +349,7 @@ parse_netgrp(struct irs_ng *this, const char *group) { return (1); } -/* +/*% * Read the netgroup file and save lines until the line for the netgroup * is found. Return 1 if eof is encountered. */ @@ -449,3 +442,5 @@ read_for_group(struct irs_ng *this, const char *group) { } return (NULL); } + +/*! \file */ |