From b2093e3016027d6b5cf06b3f91f30769bfc099e2 Mon Sep 17 00:00:00 2001 From: cvsadm Date: Fri, 21 Jan 2005 00:44:34 +0000 Subject: Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth) --- ldap/servers/plugins/shared/plugin-utils.h | 77 ++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 ldap/servers/plugins/shared/plugin-utils.h (limited to 'ldap/servers/plugins/shared/plugin-utils.h') diff --git a/ldap/servers/plugins/shared/plugin-utils.h b/ldap/servers/plugins/shared/plugin-utils.h new file mode 100644 index 00000000..31c956f4 --- /dev/null +++ b/ldap/servers/plugins/shared/plugin-utils.h @@ -0,0 +1,77 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/*********************************************************************** +** +** NAME +** plugin-utils.h +** +** DESCRIPTION +** +** +** AUTHOR +** +** +***********************************************************************/ + +#ifndef _PLUGIN_UTILS_H_ +#define _PLUGIN_UTILS_H_ + +/*********************************************************************** +** Includes +***********************************************************************/ + +#include +/* + * slapi-plugin-compat4.h is needed because we use the following deprecated + * functions: + * + * slapi_search_internal() + * slapi_modify_internal() + */ +#include "slapi-plugin-compat4.h" +#include +#include +#include +#ifdef _WINDOWS +#undef strcasecmp +#define strcasecmp strcmpi +#endif +#include "dirver.h" + +#ifdef LDAP_DEBUG +#ifndef DEBUG +#define DEBUG +#endif +#endif + +#define BEGIN do { +#define END } while(0); + +int initCounterLock(); +int op_error(int internal_error); +Slapi_PBlock *readPblockAndEntry( const char *baseDN, const char *filter, + char *attrs[] ); +int entryHasObjectClass(Slapi_PBlock *pb, Slapi_Entry *e, + const char *objectClass); +Slapi_PBlock *dnHasObjectClass( const char *baseDN, const char *objectClass ); +Slapi_PBlock *dnHasAttribute( const char *baseDN, const char *attrName ); +int setCounter( Slapi_Entry *e, const char *attrName, int value ); +int updateCounter( Slapi_Entry *e, const char *attrName, int increment ); +int updateCounterByDN( const char *dn, const char *attrName, int increment ); + +typedef struct DNLink { + char *dn; + void *data; + struct DNLink *next; +} DNLink; + +DNLink *cacheInit( void ); +DNLink *cacheAdd( DNLink *root, char *dn, void *data ); +char *cacheRemove( DNLink *root, char *dn ); +int cacheDelete( DNLink *root, char *dn ); +DNLink *cacheFind( DNLink *root, char *dn ); + +#endif /* _PLUGIN_UTILS_H_ */ -- cgit