Commit 639d6785 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

cleanup struct declarations

parent a6e232e7
......@@ -91,7 +91,7 @@ do_abandon( Operation *op, SlapReply *rs )
LDAP_STAILQ_FOREACH( o, &op->o_conn->c_pending_ops, o_next ) {
if ( o->o_msgid == id ) {
LDAP_STAILQ_REMOVE( &op->o_conn->c_pending_ops,
o, slap_op, o_next );
o, Operation, o_next );
LDAP_STAILQ_NEXT(o, o_next) = NULL;
op->o_conn->c_n_ops_pending--;
slap_op_free( o );
......
......@@ -74,7 +74,7 @@ struct aindexrec {
static Avlnode *attr_index = NULL;
static Avlnode *attr_cache = NULL;
static LDAP_STAILQ_HEAD(ATList, slap_attribute_type) attr_list
static LDAP_STAILQ_HEAD(ATList, AttributeType) attr_list
= LDAP_STAILQ_HEAD_INITIALIZER(attr_list);
/* Last hardcoded attribute registered */
......@@ -253,7 +253,7 @@ at_delete( AttributeType *at )
{
at->sat_flags |= SLAP_AT_DELETED;
LDAP_STAILQ_REMOVE(&attr_list,at,slap_attribute_type,sat_next);
LDAP_STAILQ_REMOVE(&attr_list, at, AttributeType, sat_next);
at_delete_names( at );
}
......
......@@ -31,6 +31,7 @@
/* String rewrite library */
#include "rewrite.h"
LDAP_BEGIN_DECL
/*
......@@ -40,9 +41,6 @@ LDAP_BEGIN_DECL
#define META_BACK_PRINT_CONNTREE 0
#endif /* !META_BACK_PRINT_CONNTREE */
struct slap_conn;
struct slap_op;
/* from back-ldap.h before rwm removal */
struct ldapmap {
int drop_missing;
......@@ -223,7 +221,7 @@ typedef struct metasingleconn_t {
} metasingleconn_t;
typedef struct metaconn_t {
struct slap_conn *mc_conn;
Connection *mc_conn;
#define lc_conn mc_conn
unsigned mc_refcnt;
......
......@@ -285,6 +285,10 @@ typedef struct monitor_extra_t {
monitor_subsys_t * (*get_subsys_by_dn)( struct berval *ndn, int sub );
int (*register_subsys)( monitor_subsys_t *ms );
int (*register_backend)( BackendInfo *bi );
int (*register_database)( BackendDB *be );
int (*register_overlay_info)( slap_overinst *on );
int (*register_overlay)( BackendDB *be );
int (*register_entry)( Entry *e, monitor_callback_t *cb,
monitor_subsys_t *ms, unsigned long flags );
int (*register_entry_parent)( Entry *e, monitor_callback_t *cb,
......
......@@ -27,7 +27,7 @@
#include "back-monitor.h"
int
monitor_back_compare( struct slap_op *op, struct slap_rep *rs)
monitor_back_compare( Operation *op, SlapReply *rs )
{
monitor_info_t *mi = ( monitor_info_t * ) op->o_bd->be_private;
Entry *e, *matched = NULL;
......
......@@ -26,7 +26,7 @@
#include "back-relay.h"
static int
relay_back_swap_bd( struct slap_op *op, struct slap_rep *rs )
relay_back_swap_bd( Operation *op, SlapReply *rs )
{
slap_callback *cb = op->o_callback;
BackendDB *be = op->o_bd;
......@@ -38,7 +38,7 @@ relay_back_swap_bd( struct slap_op *op, struct slap_rep *rs )
}
static void
relay_back_add_cb( slap_callback *cb, struct slap_op *op )
relay_back_add_cb( slap_callback *cb, Operation *op )
{
cb->sc_next = op->o_callback;
cb->sc_response = relay_back_swap_bd;
......@@ -55,7 +55,7 @@ relay_back_add_cb( slap_callback *cb, struct slap_op *op )
* any valid error send as error result
*/
static BackendDB *
relay_back_select_backend( struct slap_op *op, struct slap_rep *rs, int err )
relay_back_select_backend( Operation *op, SlapReply *rs, int err )
{
relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
BackendDB *bd = ri->ri_bd;
......@@ -100,7 +100,7 @@ relay_back_select_backend( struct slap_op *op, struct slap_rep *rs, int err )
}
int
relay_back_op_bind( struct slap_op *op, struct slap_rep *rs )
relay_back_op_bind( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -134,7 +134,7 @@ relay_back_op_bind( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_unbind( struct slap_op *op, struct slap_rep *rs )
relay_back_op_unbind( Operation *op, SlapReply *rs )
{
relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
BackendDB *bd;
......@@ -165,7 +165,7 @@ relay_back_op_unbind( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_search( struct slap_op *op, struct slap_rep *rs )
relay_back_op_search( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -200,7 +200,7 @@ relay_back_op_search( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_compare( struct slap_op *op, struct slap_rep *rs )
relay_back_op_compare( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -235,7 +235,7 @@ relay_back_op_compare( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_modify( struct slap_op *op, struct slap_rep *rs )
relay_back_op_modify( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -270,7 +270,7 @@ relay_back_op_modify( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_modrdn( struct slap_op *op, struct slap_rep *rs )
relay_back_op_modrdn( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -305,7 +305,7 @@ relay_back_op_modrdn( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_add( struct slap_op *op, struct slap_rep *rs )
relay_back_op_add( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -340,7 +340,7 @@ relay_back_op_add( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_delete( struct slap_op *op, struct slap_rep *rs )
relay_back_op_delete( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -370,7 +370,7 @@ relay_back_op_delete( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_abandon( struct slap_op *op, struct slap_rep *rs )
relay_back_op_abandon( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -400,7 +400,7 @@ relay_back_op_abandon( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_cancel( struct slap_op *op, struct slap_rep *rs )
relay_back_op_cancel( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -435,7 +435,7 @@ relay_back_op_cancel( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_op_extended( struct slap_op *op, struct slap_rep *rs )
relay_back_op_extended( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 1;
......@@ -470,7 +470,7 @@ relay_back_op_extended( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_entry_release_rw( struct slap_op *op, Entry *e, int rw )
relay_back_entry_release_rw( Operation *op, Entry *e, int rw )
{
relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
BackendDB *bd;
......@@ -497,7 +497,7 @@ relay_back_entry_release_rw( struct slap_op *op, Entry *e, int rw )
}
int
relay_back_entry_get_rw( struct slap_op *op, struct berval *ndn,
relay_back_entry_get_rw( Operation *op, struct berval *ndn,
ObjectClass *oc, AttributeDescription *at, int rw, Entry **e )
{
relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
......@@ -532,7 +532,7 @@ relay_back_entry_get_rw( struct slap_op *op, struct berval *ndn,
* naming context... mmmh.
*/
int
relay_back_chk_referrals( struct slap_op *op, struct slap_rep *rs )
relay_back_chk_referrals( Operation *op, SlapReply *rs )
{
BackendDB *bd;
int rc = 0;
......@@ -574,7 +574,7 @@ relay_back_chk_referrals( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_operational( struct slap_op *op, struct slap_rep *rs )
relay_back_operational( Operation *op, SlapReply *rs )
{
relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
BackendDB *bd;
......@@ -608,7 +608,7 @@ relay_back_operational( struct slap_op *op, struct slap_rep *rs )
}
int
relay_back_has_subordinates( struct slap_op *op, Entry *e, int *hasSubs )
relay_back_has_subordinates( Operation *op, Entry *e, int *hasSubs )
{
relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
BackendDB *bd;
......@@ -635,7 +635,7 @@ relay_back_has_subordinates( struct slap_op *op, Entry *e, int *hasSubs )
}
int
relay_back_connection_init( BackendDB *bd, struct slap_conn *c )
relay_back_connection_init( BackendDB *bd, Connection *c )
{
relay_back_info *ri = (relay_back_info *)bd->be_private;
......@@ -652,7 +652,7 @@ relay_back_connection_init( BackendDB *bd, struct slap_conn *c )
}
int
relay_back_connection_destroy( BackendDB *bd, struct slap_conn *c )
relay_back_connection_destroy( BackendDB *bd, Connection *c )
{
relay_back_info *ri = (relay_back_info *)bd->be_private;
......
......@@ -46,10 +46,6 @@ struct shellinfo {
char **si_delete; /* cmd + args to exec for delete */
};
struct slap_backend_db;
struct slap_conn;
struct slap_op;
extern pid_t forkandexec LDAP_P((
char **args,
FILE **rfp,
......@@ -57,11 +53,11 @@ extern pid_t forkandexec LDAP_P((
extern void print_suffixes LDAP_P((
FILE *fp,
struct slap_backend_db *bd));
BackendDB *bd));
extern int read_and_send_results LDAP_P((
struct slap_op *op,
struct slap_rep *rs,
Operation *op,
SlapReply *rs,
FILE *fp));
LDAP_END_DECL
......
......@@ -418,7 +418,7 @@ backend_stopdown_one( BackendDB *bd )
void backend_destroy_one( BackendDB *bd, int dynamic )
{
if ( dynamic ) {
LDAP_STAILQ_REMOVE(&backendDB, bd, slap_backend_db, be_next );
LDAP_STAILQ_REMOVE(&backendDB, bd, BackendDB, be_next );
}
if ( bd->be_syncinfo ) {
......@@ -560,7 +560,7 @@ backend_db_move(
int idx
)
{
LDAP_STAILQ_REMOVE(&backendDB, be, slap_backend_db, be_next);
LDAP_STAILQ_REMOVE(&backendDB, be, BackendDB, be_next);
backend_db_insert(be, idx);
}
......@@ -614,7 +614,7 @@ backend_db_init(
fprintf( stderr, "database init failed (%s)\n", type );
/* If we created and linked this be, remove it and free it */
if ( !b0 ) {
LDAP_STAILQ_REMOVE(&backendDB, be, slap_backend_db, be_next);
LDAP_STAILQ_REMOVE(&backendDB, be, BackendDB, be_next);
ch_free( be );
be = NULL;
nbackends--;
......
......@@ -67,7 +67,7 @@ int cancel_extop( Operation *op, SlapReply *rs )
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
LDAP_STAILQ_FOREACH( o, &op->o_conn->c_pending_ops, o_next ) {
if ( o->o_msgid == opid ) {
LDAP_STAILQ_REMOVE( &op->o_conn->c_pending_ops, o, slap_op, o_next );
LDAP_STAILQ_REMOVE( &op->o_conn->c_pending_ops, o, Operation, o_next );
LDAP_STAILQ_NEXT(o, o_next) = NULL;
op->o_conn->c_n_ops_pending--;
slap_op_free( o );
......
......@@ -1157,7 +1157,7 @@ operations_error:
ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx_null );
LDAP_STAILQ_REMOVE( &conn->c_ops, op, slap_op, o_next);
LDAP_STAILQ_REMOVE( &conn->c_ops, op, Operation, o_next);
LDAP_STAILQ_NEXT(op, o_next) = NULL;
slap_op_free( op );
conn->c_n_ops_executing--;
......
......@@ -30,7 +30,7 @@ struct cindexrec {
};
static Avlnode *cr_index = NULL;
static LDAP_STAILQ_HEAD(CRList, slap_content_rule) cr_list
static LDAP_STAILQ_HEAD(CRList, ContentRule) cr_list
= LDAP_STAILQ_HEAD_INITIALIZER(cr_list);
static int
......
......@@ -30,9 +30,9 @@ struct mindexrec {
};
static Avlnode *mr_index = NULL;
static LDAP_SLIST_HEAD(MRList, slap_matching_rule) mr_list
static LDAP_SLIST_HEAD(MRList, MatchingRule) mr_list
= LDAP_SLIST_HEAD_INITIALIZER(&mr_list);
static LDAP_SLIST_HEAD(MRUList, slap_matching_rule_use) mru_list
static LDAP_SLIST_HEAD(MRUList, MatchingRuleUse) mru_list
= LDAP_SLIST_HEAD_INITIALIZER(&mru_list);
static int
......
......@@ -37,16 +37,16 @@ int is_object_subclass(
sup->soc_oid, sub->soc_oid, sup == sub );
#endif
if( sup == sub ) {
if ( sup == sub ) {
return 1;
}
if( sub->soc_sups == NULL ) {
if ( sub->soc_sups == NULL ) {
return 0;
}
for( i=0; sub->soc_sups[i] != NULL; i++ ) {
if( is_object_subclass( sup, sub->soc_sups[i] ) ) {
for ( i = 0; sub->soc_sups[i] != NULL; i++ ) {
if ( is_object_subclass( sup, sub->soc_sups[i] ) ) {
return 1;
}
}
......@@ -71,11 +71,11 @@ int is_entry_objectclass(
assert( !( e == NULL || oc == NULL ) );
assert( ( flags & SLAP_OCF_MASK ) != SLAP_OCF_MASK );
if( e == NULL || oc == NULL ) {
if ( e == NULL || oc == NULL ) {
return 0;
}
if( flags == SLAP_OCF_SET_FLAGS && ( e->e_ocflags & SLAP_OC__END ) )
if ( flags == SLAP_OCF_SET_FLAGS && ( e->e_ocflags & SLAP_OC__END ) )
{
/* flags are set, use them */
return (e->e_ocflags & oc->soc_flags & SLAP_OC__MASK) != 0;
......@@ -85,7 +85,7 @@ int is_entry_objectclass(
* find objectClass attribute
*/
attr = attr_find( e->e_attrs, slap_schema.si_ad_objectClass );
if( attr == NULL ) {
if ( attr == NULL ) {
/* no objectClass attribute */
Debug( LDAP_DEBUG_ANY, "is_entry_objectclass(\"%s\", \"%s\") "
"no objectClass attribute\n",
......@@ -95,7 +95,7 @@ int is_entry_objectclass(
return 0;
}
for( bv=attr->a_vals; bv->bv_val; bv++ ) {
for ( bv = attr->a_vals; bv->bv_val; bv++ ) {
ObjectClass *objectClass = oc_bvfind( bv );
if ( objectClass == NULL ) {
......@@ -132,7 +132,7 @@ struct oindexrec {
static Avlnode *oc_index = NULL;
static Avlnode *oc_cache = NULL;
static LDAP_STAILQ_HEAD(OCList, slap_object_class) oc_list
static LDAP_STAILQ_HEAD(OCList, ObjectClass) oc_list
= LDAP_STAILQ_HEAD_INITIALIZER(oc_list);
ObjectClass *oc_sys_tail;
......@@ -193,7 +193,7 @@ oc_bvfind( struct berval *ocname )
return( NULL );
}
static LDAP_STAILQ_HEAD(OCUList, slap_object_class) oc_undef_list
static LDAP_STAILQ_HEAD(OCUList, ObjectClass) oc_undef_list
= LDAP_STAILQ_HEAD_INITIALIZER(oc_undef_list);
ObjectClass *
......@@ -414,7 +414,7 @@ oc_delete( ObjectClass *oc )
{
oc->soc_flags |= SLAP_OC_DELETED;
LDAP_STAILQ_REMOVE(&oc_list,oc,slap_object_class,soc_next);
LDAP_STAILQ_REMOVE(&oc_list, oc, ObjectClass, soc_next);
oc_delete_names( oc );
}
......
......@@ -26,7 +26,7 @@
#include "lutil.h"
#include "config.h"
static LDAP_STAILQ_HEAD(OidMacroList, slap_oid_macro) om_list
static LDAP_STAILQ_HEAD(OidMacroList, OidMacro) om_list
= LDAP_STAILQ_HEAD_INITIALIZER(om_list);
OidMacro *om_sys_tail;
......
......@@ -38,7 +38,7 @@
#endif
static ldap_pvt_thread_mutex_t slap_op_mutex;
static LDAP_STAILQ_HEAD(s_o, slap_op) slap_free_ops;
static LDAP_STAILQ_HEAD(s_o, Operation) slap_free_ops;
static time_t last_time;
static int last_incr;
......
......@@ -1030,7 +1030,7 @@ syncprov_drop_psearch( syncops *so, int lock )
ldap_pvt_thread_mutex_lock( &so->s_op->o_conn->c_mutex );
so->s_op->o_conn->c_n_ops_executing--;
so->s_op->o_conn->c_n_ops_completed++;
LDAP_STAILQ_REMOVE( &so->s_op->o_conn->c_ops, so->s_op, slap_op,
LDAP_STAILQ_REMOVE( &so->s_op->o_conn->c_ops, so->s_op, Operation,
o_next );
if ( lock )
ldap_pvt_thread_mutex_unlock( &so->s_op->o_conn->c_mutex );
......
......@@ -348,7 +348,7 @@ LDAP_SLAPD_F (int) be_slurp_update LDAP_P(( Operation *op ));
LDAP_SLAPD_F (int) be_shadow_update LDAP_P(( Operation *op ));
LDAP_SLAPD_F (int) be_isupdate_dn LDAP_P(( Backend *be, struct berval *ndn ));
LDAP_SLAPD_F (struct berval *) be_root_dn LDAP_P(( Backend *be ));
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( struct slap_op *o,
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( Operation *o,
struct berval *ndn, ObjectClass *oc,
AttributeDescription *at, int rw, Entry **e ));
LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P((
......@@ -1600,7 +1600,7 @@ LDAP_SLAPD_F( slap_mr_indexer_func ) octetStringIndexer;
LDAP_SLAPD_F( slap_mr_filter_func ) octetStringFilter;
LDAP_SLAPD_F( int ) numericoidValidate LDAP_P((
struct slap_syntax *syntax,
Syntax *syntax,
struct berval *in ));
LDAP_SLAPD_F( int ) octetStringMatch LDAP_P((
int *matchp,
......
......@@ -85,9 +85,9 @@ oidValidate(
static int objectClassPretty(
struct slap_syntax *syntax,
struct berval * in,
struct berval * out,
Syntax *syntax,
struct berval *in,
struct berval *out,
void *ctx )
{
ObjectClass *oc;
......@@ -241,8 +241,8 @@ objectSubClassMatch(
static int objectSubClassIndexer(
slap_mask_t use,
slap_mask_t mask,
struct slap_syntax *syntax,
struct slap_matching_rule *mr,
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
BerVarray values,
BerVarray *keysp,
......
......@@ -21,7 +21,7 @@
LDAP_BEGIN_DECL
typedef struct slap_set_cookie {
struct slap_op *set_op;
Operation *set_op;
} SetCookie;
/* this routine needs to return the bervals instead of
......
This diff is collapsed.
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