Support slapi_entry_first_attr()/slapi_entry_next_attr() API

This commit is contained in:
Luke Howard 2003-01-24 09:23:06 +00:00
parent f709f86bed
commit fc55ee9edc
2 changed files with 38 additions and 0 deletions

View file

@ -462,6 +462,42 @@ slapi_entry_attr_merge_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals
#endif
}
int
slapi_entry_first_attr( const Slapi_Entry *e, Slapi_Attr **attr )
{
#ifdef LDAP_SLAPI
if ( e == NULL ) {
return -1;
}
*attr = e->e_attrs;
return ( *attr != NULL ) ? 0 : -1;
#else
return -1;
#endif
}
int
slapi_entry_next_attr( const Slapi_Entry *e, Slapi_Attr *prevattr, Slapi_Attr **attr )
{
#ifdef LDAP_SLAPI
if ( e == NULL ) {
return -1;
}
if ( prevattr == NULL ) {
return -1;
}
*attr = prevattr->a_next;
return ( *attr != NULL ) ? 0 : -1;
#else
return -1;
#endif
}
int
slapi_entry_attr_replace_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals )
{

View file

@ -55,6 +55,8 @@ int slapi_entry_attr_get_uint( const Slapi_Entry *e, const char *type );
int slapi_entry_attr_get_ulong( const Slapi_Entry *e, const char *type );
int slapi_entry_attr_hasvalue( Slapi_Entry *e, const char *type, const char *value );
int slapi_entry_attr_merge_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
int slapi_entry_first_attr( const Slapi_Entry *e, Slapi_Attr **attr );
int slapi_entry_next_attr( const Slapi_Entry *e, Slapi_Attr *prevattr, Slapi_Attr **attr );
char *slapi_entry_get_dn( Slapi_Entry *e );
int slapi_x_entry_get_id( Slapi_Entry *e );
void slapi_entry_set_dn( Slapi_Entry *e, char *dn );