Commit 67583f45 authored by Howard Chu's avatar Howard Chu
Browse files

Added ldif_countlines()

parent 8fd686ad
......@@ -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 )
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment