MSVC5 cleanup...

lber: ifdef'ed out lber_..set_nonblock() function because it used ioctl's.
  If it remains, it needs to be written to support various methods for
  setting non-blocking.  ioctls should probably be last choice.  configure
  could detect existance of fcntl(), ioctl(), etc.
bdb2:
  added .dsp/.dsw files and did some basic cleanup (still needs work).
This commit is contained in:
Kurt Zeilenga 1999-03-06 00:57:25 +00:00
parent 654f21b237
commit 588a458d78
16 changed files with 157 additions and 39 deletions

View file

@ -31,10 +31,14 @@
#define strdup _strdup
#define vsnprintf _vsnprintf
#define vsprintf _vsprintf
#define sleep _sleep
/* define type for caddr_t */
typedef char * caddr_t;
/* we have NT threads */
#define HAVE_NT_THREADS 1
/* we have spawnlp instead of fork/execlp */
#define HAVE_SPAWNLP 1
@ -47,12 +51,20 @@ typedef char * caddr_t;
/* we have <conio.h> */
#define HAVE_CONIO_H 1
/* we have <direct.h> */
#define HAVE_DIRECT_H 1
/* we have <io.h> */
#define HAVE_IO_H 1
/* we have <process.h> */
#define HAVE_PROCESS_H 1
#define LDAP_SIGUSR1 SIGILL
#define LDAP_SIGUSR2 SIGTERM
#define MAXPATHLEN _MAX_PATH
/* end of MSVC5 specific entries */
/* --------------------------------------------------- */
@ -164,7 +176,7 @@ typedef char * caddr_t;
/* #undef HAVE_BERKELEY_DB */
/* define if you have berkeley db2 */
/* #undef HAVE_BERKELEY_DB2 */
#define HAVE_BERKELEY_DB2 1
/* define if you have crypt */
/* #undef HAVE_CRYPT */
@ -209,25 +221,25 @@ typedef char * caddr_t;
/* #undef LDAP_SYSLOG */
/* define this to use DBBTREE w/ LDBM backend */
/* #undef LDBM_USE_DBBTREE */
#define LDBM_USE_DBBTREE 1
/* define this to use DBHASH w/ LDBM backend */
/* #undef LDBM_USE_DBHASH */
/* define this for ACL Group support */
/* #undef SLAPD_ACLGROUPS */
#define SLAPD_ACLGROUPS 1
/* define this to use SLAPD Berkeley DB2 backend */
/* #undef SLAPD_BDB2 */
#define SLAPD_BDB2 1
/* define this for ClearText password support */
/* #undef SLAPD_CLEARTEXT */
#define SLAPD_CLEARTEXT 1
/* define this for crypt(3) password support */
/* #undef SLAPD_CRYPT */
/* define this to use SLAPD LDBM backend */
/* #undef SLAPD_LDBM */
/* #define SLAPD_LDBM 1 */
/* define this to use SLAPD passwd backend */
/* #undef SLAPD_PASSWD */
@ -412,7 +424,7 @@ typedef char * caddr_t;
/* #undef HAVE_CRYPT_H */
/* Define if you have the <db.h> header file. */
/* #undef HAVE_DB_H */
#define HAVE_DB_H 1
/* Define if you have the <db_185.h> header file. */
/* #undef HAVE_DB_185_H */
@ -456,9 +468,6 @@ typedef char * caddr_t;
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define if you have the <lwp/lwp.h> header file. */
/* #undef HAVE_LWP_LWP_H */

View file

@ -122,5 +122,9 @@ SOURCE=.\options.c
SOURCE=..\..\include\portable.h
# End Source File
# Begin Source File
SOURCE=.\sockbuf.c
# End Source File
# End Target
# End Project

View file

@ -72,19 +72,20 @@ update_status( Sockbuf *sb )
static int
status_is_ok( Sockbuf *sb )
{
int obr;
int osr;
obr = sb->sb_buf_ready;
int obr = sb->sb_buf_ready;
#ifdef USE_SASL
osr = sb->sb_sec_ready;
int osr = sb->sb_sec_ready;
#endif
update_status(sb);
if (obr!=sb->sb_buf_ready)
return 0;
#ifdef USE_SASL
if (osr!=sb->sb_sec_ready)
return 0;
#endif
return 1;
}
#endif
@ -538,6 +539,8 @@ long lber_pvt_sb_write( Sockbuf *sb, void *buf, long len_arg )
#ifdef USE_SASL
}
#endif
return ret;
}
int lber_pvt_sb_close( Sockbuf *sb )
@ -561,6 +564,7 @@ int lber_pvt_sb_set_readahead( Sockbuf *sb, int rh )
return 0;
}
#ifdef USE_NONBLOCK
int lber_pvt_sb_set_nonblock( Sockbuf *sb, int nb )
{
assert( status_is_ok(sb) );
@ -583,6 +587,7 @@ int lber_pvt_sb_set_nonblock( Sockbuf *sb, int nb )
}
return 0;
}
#endif
#define sockbuf_buf_init( bb ) \
(bb)->buf_base=NULL;\

View file

@ -3,10 +3,10 @@
#include "portable.h"
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
#include "slap.h"
#include "back-bdb2.h"

View file

@ -0,0 +1,78 @@
# Microsoft Developer Studio Project File - Name="backbdb2" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=backbdb2 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "backbdb2.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "backbdb2.mak" CFG="backbdb2 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "backbdb2 - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "backbdb2 - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
!IF "$(CFG)" == "backbdb2 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "backbdb2 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "backbdb2 - Win32 Release"
# Name "backbdb2 - Win32 Debug"
# End Target
# End Project

View file

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 5.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "backbdb2"=".\backbdb2.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -38,8 +38,6 @@ static void lru_print(struct cache *cache);
static int
cache_entry_private_init( Entry*e )
{
struct ldbm_entry_info *lei;
#ifdef LDAP_DEBUG
assert( e->e_private == NULL );
#endif
@ -57,8 +55,6 @@ cache_entry_private_init( Entry*e )
static int
cache_entry_private_destroy( Entry*e )
{
struct ldbm_entry_info *lei;
#ifdef LDAP_DEBUG
assert( e->e_private );
#endif
@ -444,7 +440,6 @@ bdb2i_cache_find_entry_id(
e.e_id = id;
try_again:
/* set cache mutex */
ldap_pvt_thread_mutex_lock( &cache->c_mutex );

View file

@ -19,8 +19,6 @@ bdb2i_id2children_add(
{
struct dbcache *db;
Datum key;
int len, rc;
ID_BLOCK *idl;
char buf[20];
ldbm_datum_init( key );
@ -63,8 +61,6 @@ bdb2i_id2children_remove(
{
struct dbcache *db;
Datum key;
int len, rc;
ID_BLOCK *idl;
char buf[20];
Debug( LDAP_DEBUG_TRACE, "=> bdb2i_id2children_remove( %ld, %ld )\n",

View file

@ -15,7 +15,7 @@ static ID_BLOCK* idl_dup( ID_BLOCK *idl );
/* Allocate an ID_BLOCK with room for nids ids */
ID_BLOCK *
bdb2i_idl_alloc( int nids )
bdb2i_idl_alloc( unsigned long nids )
{
ID_BLOCK *new;
@ -615,9 +615,9 @@ bdb2i_idl_insert_key(
* 3 id not inserted, block must be split
*/
int
bdb2i_idl_insert( ID_BLOCK **idl, ID id, int maxids )
bdb2i_idl_insert( ID_BLOCK **idl, ID id, unsigned long maxids )
{
unsigned int i, j;
unsigned long i, j;
if ( ID_BLOCK_ALLIDS( *idl ) ) {
return( 2 ); /* already there */

View file

@ -20,7 +20,6 @@ bdb2i_index_add_entry(
)
{
Attribute *ap;
char *dnval;
struct berval bv;
struct berval *bvals[2];

View file

@ -123,7 +123,6 @@ bdb2i_back_db_init_internal(
{
struct ldbminfo *li;
char *argv[ 4 ];
int i;
/* allocate backend-database-specific stuff */
li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );

View file

@ -25,7 +25,7 @@ bdb2i_back_modify_internal(
char *matched;
LDAPModList *ml;
Entry *e;
int i, err;
int err;
Debug(LDAP_DEBUG_ARGS, "bdb2i_back_modify:\n", 0, 0, 0);

View file

@ -101,12 +101,12 @@ Entry * bdb2i_id2entry_rw LDAP_P(( BackendDB *be, ID id, int rw ));
* idl.c
*/
ID_BLOCK * bdb2i_idl_alloc LDAP_P(( int nids ));
ID_BLOCK * bdb2i_idl_alloc LDAP_P(( unsigned long nids ));
ID_BLOCK * bdb2i_idl_allids LDAP_P(( BackendDB *be ));
void bdb2i_idl_free LDAP_P(( ID_BLOCK *idl ));
ID_BLOCK * bdb2i_idl_fetch LDAP_P(( BackendDB *be, struct dbcache *db, Datum key ));
int bdb2i_idl_insert_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
int bdb2i_idl_insert LDAP_P(( ID_BLOCK **idl, ID id, int maxids ));
int bdb2i_idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned long maxids ));
int bdb2i_idl_delete_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
ID_BLOCK * bdb2i_idl_intersection LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
ID_BLOCK * bdb2i_idl_union LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));

View file

@ -6,6 +6,7 @@
#include <ac/string.h>
#include <ac/socket.h>
#include <ac/time.h>
#include "slap.h"
#include "back-bdb2.h"
@ -51,7 +52,7 @@ bdb2i_back_search_internal(
Attribute *ref;
char *matched = NULL;
int rmaxsize, nrefs;
char *rbuf, *rcur, *r;
char *rbuf, *rcur;
int nentries = 0;
char *realBase;
@ -186,7 +187,7 @@ bdb2i_back_search_internal(
strncmp( e->e_ndn, "REF=", 4 ) == 0 &&
(ref = attr_find( e->e_attrs, "ref" )) != NULL )
{
int i, len;
int i;
if ( ref->a_vals == NULL ) {
Debug( LDAP_DEBUG_ANY, "null ref in (%s)\n",
@ -368,8 +369,6 @@ base_candidates(
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
int rc;
ID id;
ID_BLOCK *idl;
Entry *e;

View file

@ -6,6 +6,11 @@
#include <ac/string.h>
#include <ac/socket.h>
#include <ac/unistd.h>
#ifdef HAVE_DIRECT_H
#include <direct.h>
#endif
#include "ldapconfig.h"
#include "slap.h"

View file

@ -3,10 +3,10 @@
#include "portable.h"
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
#include "slap.h"
#include "back-bdb2.h"