mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-23 14:09:39 +08:00
Added ldif_countlines()
This commit is contained in:
parent
8fd686ada0
commit
67583f45eb
@ -75,6 +75,9 @@ ldif_fetch_url LDAP_P((
|
||||
LDAP_LDIF_F( char * )
|
||||
ldif_getline LDAP_P(( char **next ));
|
||||
|
||||
LDAP_LDIF_F( int )
|
||||
ldif_countlines LDAP_P(( LDAP_CONST char *line ));
|
||||
|
||||
LDAP_LDIF_F( int )
|
||||
ldif_read_record LDAP_P((
|
||||
FILE *fp,
|
||||
|
@ -308,6 +308,21 @@ ldif_parse_line2(
|
||||
* which it updates and must be supplied on subsequent calls.
|
||||
*/
|
||||
|
||||
int
|
||||
ldif_countlines( LDAP_CONST char *buf )
|
||||
{
|
||||
char *nl;
|
||||
int ret = 0;
|
||||
|
||||
if ( !buf ) return ret;
|
||||
|
||||
for ( nl = strchr(buf, '\n'); nl; nl = strchr(nl, '\n') ) {
|
||||
nl++;
|
||||
if ( *nl != ' ' ) ret++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *
|
||||
ldif_getline( char **next )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user