From: Luke Howard Date: Fri, 28 Jan 2005 08:33:29 +0000 (+0000) Subject: Add slapi_x_backend_get_flags() API X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~229 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4b1d72ab2ffe5eddeb5bb3daa6f12b5c0eed43e5;p=openldap Add slapi_x_backend_get_flags() API --- diff --git a/include/slapi-plugin.h b/include/slapi-plugin.h index f8cc9f2150..dcb3a95a63 100644 --- a/include/slapi-plugin.h +++ b/include/slapi-plugin.h @@ -317,6 +317,8 @@ void *slapi_get_object_extension(int objecttype, void *object, void slapi_set_object_extension(int objecttype, void *object, int extensionhandle, void *extension); +int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); + /* parameters currently supported */ /* @@ -330,6 +332,20 @@ void slapi_set_object_extension(int objecttype, void *object, #define SLAPI_ATTR_FLAG_COLLECTIVE 0x0080 #define SLAPI_ATTR_FLAG_NOUSERMOD 0x0100 +/* + * Backend flags returned by slapi_x_backend_get_flags() + */ +#define SLAPI_BACKEND_FLAG_NOLASTMOD 0x0001U +#define SLAPI_BACKEND_FLAG_NO_SCHEMA_CHECK 0x0002U +#define SLAPI_BACKEND_FLAG_GLUE_INSTANCE 0x0010U /* a glue backend */ +#define SLAPI_BACKEND_FLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */ +#define SLAPI_BACKEND_FLAG_GLUE_LINKED 0x0040U /* child is connected to parent */ +#define SLAPI_BACKEND_FLAG_OVERLAY 0x0080U /* this db struct is an overlay */ +#define SLAPI_BACKEND_FLAG_GLOBAL_OVERLAY 0x0100U /* this db struct is a global overlay */ +#define SLAPI_BACKEND_FLAG_SHADOW 0x8000U /* a shadow */ +#define SLAPI_BACKEND_FLAG_SYNC_SHADOW 0x1000U /* a sync shadow */ +#define SLAPI_BACKEND_FLAG_SLURP_SHADOW 0x2000U /* a slurp shadow */ + /* * ACL levels */ diff --git a/servers/slapd/slapi/proto-slapi.h b/servers/slapd/slapi/proto-slapi.h index 1470e34518..2e7ce1c140 100644 --- a/servers/slapd/slapi/proto-slapi.h +++ b/servers/slapd/slapi/proto-slapi.h @@ -248,6 +248,8 @@ extern int slapi_x_compute_get_pblock(computed_attr_context *c, Slapi_PBlock **p extern int slapi_int_access_allowed(Operation *op, Entry *entry, AttributeDescription *desc, struct berval *val, slap_access_t access, AccessControlState *state); +extern int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); + extern ldap_pvt_thread_mutex_t slapi_hn_mutex; extern ldap_pvt_thread_mutex_t slapi_time_mutex; extern ldap_pvt_thread_mutex_t slapi_printmessage_mutex; diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 8d469801d2..244ec53701 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -4267,3 +4267,17 @@ void slapi_ldap_unbind( LDAP *ld ) #endif /* LDAP_SLAPI */ } +int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ) +{ +#ifdef LDAP_SLAPI + if ( be == NULL ) + return LDAP_PARAM_ERROR; + + *flags = SLAP_DBFLAGS(be); + + return LDAP_SUCCESS; +#else + return -1; +#endif /* LDAP_SLAPI */ +} +