From d0516836b57d967d2ae604deef528f5f55518d7a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 10 Jan 1999 02:16:48 +0000 Subject: [PATCH] rename 'struct op' to 'struct slap_op' rename 'struct conn' to 'struct slap_conn' rename op_function to slap_op_func for functions add/delete/free This change is need to avoid clashing with perl internals. --- servers/slapd/connection.c | 4 ++-- servers/slapd/operation.c | 8 +++---- servers/slapd/proto-slap.h | 8 ++++--- servers/slapd/slap.h | 49 ++++++++++++++++++++++++++------------ 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 98275706a9..3ea80d3200 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -89,7 +89,7 @@ connection_operation( void *arg_v ) pthread_mutex_lock( &arg->co_conn->c_opsmutex ); arg->co_conn->c_opscompleted++; - op_delete( &arg->co_conn->c_ops, arg->co_op ); + slap_op_delete( &arg->co_conn->c_ops, arg->co_op ); pthread_mutex_unlock( &arg->co_conn->c_opsmutex ); free( (char *) arg ); @@ -184,7 +184,7 @@ connection_activity( pthread_mutex_unlock( &conn->c_dnmutex ); pthread_mutex_lock( &conn->c_opsmutex ); - arg->co_op = op_add( &conn->c_ops, ber, msgid, tag, tmpdn, + arg->co_op = slap_op_add( &conn->c_ops, ber, msgid, tag, tmpdn, conn->c_opsinitiated, conn->c_connid ); pthread_mutex_unlock( &conn->c_opsmutex ); diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index b7c8613ff2..47d084d6b4 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -11,7 +11,7 @@ void -op_free( Operation *op ) +slap_op_free( Operation *op ) { if ( op->o_ber != NULL ) ber_free( op->o_ber, 1 ); @@ -23,7 +23,7 @@ op_free( Operation *op ) } Operation * -op_add( +slap_op_add( Operation **olist, BerElement *ber, unsigned long msgid, @@ -57,7 +57,7 @@ op_add( } void -op_delete( Operation **olist, Operation *op ) +slap_op_delete( Operation **olist, Operation *op ) { Operation **tmp; @@ -71,5 +71,5 @@ op_delete( Operation **olist, Operation *op ) } *tmp = (*tmp)->o_next; - op_free( op ); + slap_op_free( op ); } diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 7e8ce52357..c454828283 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -153,10 +153,11 @@ void monitor_info LDAP_P(( Connection *conn, Operation *op )); * operation.c */ -void op_free LDAP_P(( Operation *op )); -Operation * op_add LDAP_P(( Operation **olist, BerElement *ber, unsigned long msgid, +void slap_op_free LDAP_P(( Operation *op )); +Operation * slap_op_add LDAP_P(( Operation **olist, + BerElement *ber, unsigned long msgid, unsigned long tag, char *dn, int id, int connid )); -void op_delete LDAP_P(( Operation **olist, Operation *op )); +void slap_op_delete LDAP_P(( Operation **olist, Operation *op )); /* * phonetic.c @@ -321,3 +322,4 @@ extern void shell_back_init LDAP_P((Backend *be)); #endif #endif /* _proto_slap */ + diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index df7ac5dab6..a8f1a1fbc9 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -47,8 +47,8 @@ LDAP_BEGIN_DECL extern int slap_debug; -struct op; -struct conn; +struct slap_op; +struct slap_conn; /* * represents an attribute value assertion (i.e., attr=value) @@ -234,17 +234,36 @@ struct backend { void *be_private; /* anything the backend needs */ /* backend routines */ - int (*be_bind) LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, int method, struct berval *cred )); - void (*be_unbind) LDAP_P((Backend *be, struct conn *c, struct op *o )); - int (*be_search) LDAP_P((Backend *be, struct conn *c, struct op *o, char *base, int scope, int deref, int slimit, int tlimit, Filter *f, char *filterstr, char **attrs, int attrsonly)); - int (*be_compare)LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, Ava *ava)); - int (*be_modify) LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, LDAPModList *m)); - int (*be_modrdn) LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, char *newrdn, int deleteoldrdn )); - int (*be_add) LDAP_P((Backend *be, struct conn *c, struct op *o, Entry *e)); - int (*be_delete) LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn)); + int (*be_bind) LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + char *dn, int method, struct berval *cred )); + void (*be_unbind) LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o )); + int (*be_search) LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + char *base, int scope, int deref, int slimit, int tlimit, + Filter *f, char *filterstr, char **attrs, int attrsonly)); + int (*be_compare)LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + char *dn, Ava *ava)); + int (*be_modify) LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + char *dn, LDAPModList *m)); + int (*be_modrdn) LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + char *dn, char *newrdn, int deleteoldrdn )); + int (*be_add) LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + Entry *e)); + int (*be_delete) LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + char *dn)); /* Bug: be_abandon in unused! */ - void (*be_abandon)LDAP_P((Backend *be, struct conn *c, struct op *o, int msgid)); - void (*be_config) LDAP_P((Backend *be, char *fname, int lineno, int argc, char **argv )); + void (*be_abandon)LDAP_P((Backend *be, + struct slap_conn *c, struct slap_op *o, + int msgid)); + void (*be_config) LDAP_P((Backend *be, + char *fname, int lineno, int argc, char **argv )); void (*be_init) LDAP_P((Backend *be)); void (*be_close) LDAP_P((Backend *be)); @@ -259,7 +278,7 @@ struct backend { * represents an operation pending from an ldap client */ -typedef struct op { +typedef struct slap_op { BerElement *o_ber; /* ber of the request */ long o_msgid; /* msgid of the request */ unsigned long o_tag; /* tag of the request */ @@ -277,7 +296,7 @@ typedef struct op { struct sockaddr o_clientaddr; /* client address if via CLDAP */ char o_searchbase; /* search base if via CLDAP */ #endif - struct op *o_next; /* next operation pending */ + struct slap_op *o_next; /* next operation pending */ pthread_t o_tid; /* thread handling this op */ int o_abandon; /* signals op has been abandoned */ pthread_mutex_t o_abandonmutex; /* signals op has been abandoned */ @@ -289,7 +308,7 @@ typedef struct op { * represents a connection from an ldap client */ -typedef struct conn { +typedef struct slap_conn { Sockbuf c_sb; /* ber connection stuff */ char *c_dn; /* current DN bound to this conn */ pthread_mutex_t c_dnmutex; /* mutex for c_dn field */ -- 2.39.5