FreeBSD/usr.sbin/nandsim/nandsim_rcfile.c
/* Count how many sections with given name exists in configuration. */
Count how many sections with given name exists in configuration.
Count how many sections with given name exists in configuration .
int rc_getsectionscount(struct rcfile *f, const char *sectname)
{
	struct rcsection *p;
	int count = 0;
	p = rc_findsect(f, sectname, 0);
	if (p) {
		while (p != NULL) {
			count = p->rs_id + 1;
			p = rc_findsect(f, sectname, count);
		}
		return (count);
	} else
		return (0);
}
int rc_getsectionscount ( struct rcfile * f , const char * sectname ) { struct rcsection * p ; int count = 0 ; p = rc_findsect ( f , sectname , 0 ) ; if ( p ) { while ( p != NULL ) { count = p -> rs_id + 1 ; p = rc_findsect ( f , sectname , count ) ; } return ( count ) ; } else return ( 0 ) ; }
Count how many sections with given name exists in configuration.
Count how many sections with given name exists in configuration .