extern void slapi_entry_attr_set_long(Slapi_Entry* e, const char *type, long l);
extern void slapi_entry_attr_set_ulong(Slapi_Entry* e, const char *type, unsigned long l);
extern int slapi_is_rootdse( const char *dn );
+extern int slapi_entry_has_children(const Slapi_Entry *e);
+
extern int slapi_entry_attr_merge_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
extern int slapi_entry_add_values_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
extern int slapi_entry_add_valueset(Slapi_Entry *e, const char *type, Slapi_ValueSet *vs);
int deloldrdn, LDAPControl **controls, int log_change);
extern char **slapi_get_supported_extended_ops(void);
extern struct berval *slapi_int_get_supported_extop( int );
+Connection *slapi_int_init_connection(char *DN, int OpType);
/*
* Was: slapi_cl.h
Slapi_Entry *
slapi_str2entry(
char *s,
- int check_dup )
+ int flags )
{
#ifdef LDAP_SLAPI
Slapi_Entry *e = NULL;
#endif
}
+int
+slapi_entry_has_children(const Slapi_Entry *e)
+{
+#ifdef LDAP_SLAPI
+ Connection *pConn;
+ Operation *op;
+ int hasSubordinates = 0;
+
+ pConn = slapi_int_init_connection( NULL, LDAP_REQ_SEARCH );
+ if ( pConn == NULL ) {
+ return 0;
+ }
+
+ op = (Operation *)pConn->c_pending_ops.stqh_first;
+ op->o_bd = select_backend( (struct berval *)&e->e_nname, 0, 0 );
+ if ( op->o_bd == NULL ) {
+ return 0;
+ }
+
+ op->o_bd->be_has_subordinates( op, (Entry *)e, &hasSubordinates );
+
+ slapi_int_connection_destroy( &pConn );
+
+ return ( hasSubordinates == LDAP_COMPARE_TRUE );
+#else
+ return 0;
+#endif
+}
+
/*
* Add values to entry.
*