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,
* 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 )
{