# TARGTYPE "Win32 (x86) External Target" 0x0106
-CFG=build - Win32 Single Debug
+CFG=build - Win32 DLL Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!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 "build.mak" CFG="build - Win32 Single Debug"
+!MESSAGE NMAKE /f "build.mak" CFG="build - Win32 DLL Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "build - Win32 Single Debug" (based on "Win32 (x86) External Target")
!MESSAGE "build - Win32 Single Release" (based on\
"Win32 (x86) External Target")
+!MESSAGE "build - Win32 DLL Debug" (based on "Win32 (x86) External Target")
+!MESSAGE "build - Win32 DLL Release" (based on "Win32 (x86) External Target")
!MESSAGE
# Begin Project
# PROP Bsc_Name "build.bsc"
# PROP Target_Dir ""
+!ELSEIF "$(CFG)" == "build - Win32 DLL Debug"
+
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "build__1"
+# PROP BASE Intermediate_Dir "build__1"
+# PROP BASE Cmd_Line ""
+# PROP BASE Rebuild_Opt ""
+# PROP BASE Bsc_Name ""
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "build__1"
+# PROP Intermediate_Dir "build__1"
+# PROP Cmd_Line ""
+# PROP Rebuild_Opt ""
+# PROP Bsc_Name ""
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "build - Win32 DLL Release"
+
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "build__2"
+# PROP BASE Intermediate_Dir "build__2"
+# PROP BASE Cmd_Line "NMAKE /f build.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "build.exe"
+# PROP BASE Bsc_Name "build.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "build__2"
+# PROP Intermediate_Dir "build__2"
+# PROP Cmd_Line "NMAKE /f build.mak"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "build.exe"
+# PROP Bsc_Name "build.bsc"
+# PROP Target_Dir ""
+
!ENDIF
# Begin Target
# Name "build - Win32 Debug"
# Name "build - Win32 Single Debug"
# Name "build - Win32 Single Release"
+# Name "build - Win32 DLL Debug"
+# Name "build - Win32 DLL Release"
!IF "$(CFG)" == "build - Win32 Release"
!ELSEIF "$(CFG)" == "build - Win32 Single Release"
+!ELSEIF "$(CFG)" == "build - Win32 DLL Debug"
+
+!ELSEIF "$(CFG)" == "build - Win32 DLL Release"
+
!ENDIF
# End Target
*/
/* BER classes and mask */
-#define LBER_CLASS_UNIVERSAL (ber_tag_t) 0x00U
-#define LBER_CLASS_APPLICATION (ber_tag_t) 0x40U
-#define LBER_CLASS_CONTEXT (ber_tag_t) 0x80U
-#define LBER_CLASS_PRIVATE (ber_tag_t) 0xc0U
-#define LBER_CLASS_MASK (ber_tag_t) 0xc0U
+#define LBER_CLASS_UNIVERSAL ((ber_tag_t) 0x00U)
+#define LBER_CLASS_APPLICATION ((ber_tag_t) 0x40U)
+#define LBER_CLASS_CONTEXT ((ber_tag_t) 0x80U)
+#define LBER_CLASS_PRIVATE ((ber_tag_t) 0xc0U)
+#define LBER_CLASS_MASK ((ber_tag_t) 0xc0U)
/* BER encoding type and mask */
-#define LBER_PRIMITIVE (ber_tag_t) 0x00U
-#define LBER_CONSTRUCTED (ber_tag_t) 0x20U
-#define LBER_ENCODING_MASK (ber_tag_t) 0x20U
+#define LBER_PRIMITIVE ((ber_tag_t) 0x00U)
+#define LBER_CONSTRUCTED ((ber_tag_t) 0x20U)
+#define LBER_ENCODING_MASK ((ber_tag_t) 0x20U)
-#define LBER_BIG_TAG_MASK (ber_tag_t) 0x1fU
-#define LBER_MORE_TAG_MASK (ber_tag_t) 0x80U
+#define LBER_BIG_TAG_MASK ((ber_tag_t) 0x1fU)
+#define LBER_MORE_TAG_MASK ((ber_tag_t) 0x80U)
/*
* Note that LBER_ERROR and LBER_DEFAULT are values that can never appear
* as valid BER tags, and so it is safe to use them to report errors. In
* fact, any tag for which the following is true is invalid:
*/
-#define LBER_INVALID(t) (((t) & 0x080) && (((t) & (ber_tag_t) ~ 0x0FF))
-#define LBER_ERROR ((ber_tag_t) ~ 0x0)
-#define LBER_DEFAULT ((ber_tag_t) ~ 0x0)
+#define LBER_INVALID(t) (((t) & (ber_tag_t) 0x080) \
+ && (((t) & (ber_tag_t) ~ 0x0FF))
+
+#define LBER_ERROR ((ber_tag_t) -1)
+#define LBER_DEFAULT ((ber_tag_t) -1)
/* general BER types we know about */
-#define LBER_BOOLEAN (ber_tag_t) 0x01UL
-#define LBER_INTEGER (ber_tag_t) 0x02UL
-#define LBER_BITSTRING (ber_tag_t) 0x03UL
-#define LBER_OCTETSTRING (ber_tag_t) 0x04UL
-#define LBER_NULL (ber_tag_t) 0x05UL
-#define LBER_ENUMERATED (ber_tag_t) 0x0aUL
-#define LBER_SEQUENCE (ber_tag_t) 0x30UL /* constructed */
-#define LBER_SET (ber_tag_t) 0x31UL /* constructed */
-
-#define OLD_LBER_SEQUENCE (ber_tag_t) 0x10UL /* w/o constructed bit - broken */
-#define OLD_LBER_SET (ber_tag_t) 0x11UL /* w/o constructed bit - broken */
+#define LBER_BOOLEAN ((ber_tag_t) 0x01UL)
+#define LBER_INTEGER ((ber_tag_t) 0x02UL)
+#define LBER_BITSTRING ((ber_tag_t) 0x03UL)
+#define LBER_OCTETSTRING ((ber_tag_t) 0x04UL)
+#define LBER_NULL ((ber_tag_t) 0x05UL)
+#define LBER_ENUMERATED ((ber_tag_t) 0x0aUL)
+#define LBER_SEQUENCE ((ber_tag_t) 0x30UL) /* constructed */
+#define LBER_SET ((ber_tag_t) 0x31UL) /* constructed */
typedef int (*BERTranslateProc) LDAP_P((
char **bufp,
#define LBER_TRANSLATE_STRINGS 0x04
/* get/set options for BerElement */
-#define LBER_OPT_BER_OPTIONS 0x01
-#define LBER_OPT_BER_DEBUG 0x02
+#define LBER_OPT_BER_OPTIONS 0x01
+#define LBER_OPT_BER_DEBUG 0x02
+#define LBER_OPT_BER_REMAINING_BYTES 0x03
+#define LBER_OPT_BER_TOTAL_BYTES 0x04
+#define LBER_OPT_BER_BYTES_TO_WRITE 0x05
#define LBER_OPT_DEBUG_LEVEL LBER_OPT_BER_DEBUG
+#define LBER_OPT_REMAINING_BYTES LBER_OPT_BER_REMAINING_BYTES
+#define LBER_OPT_TOTAL_BYTES LBER_OPT_BER_TOTAL_BYTES
+#define LBER_OPT_BYTES_TO_WRITE LBER_OPT_BER_BYTES_TO_WRITE
#define LBER_OPT_LOG_PRINT_FN 0x8001
#define LBER_OPT_MEMORY_FNS 0x8002
+#define LBER_OPT_ERROR_FN 0x8003
+
+typedef int* (*BER_ERRNO_FN) LDAP_P(( void ));
typedef void (*BER_LOG_PRINT_FN) LDAP_P(( char *buf ));
#define LBER_OPT_ON ((void *) 1)
#define LBER_OPT_OFF ((void *) 0)
-#define LBER_OPT_SUCCESS 0
+#define LBER_OPT_SUCCESS (0)
#define LBER_OPT_ERROR (-1)
typedef struct berelement BerElement;
ber_next_element LDAP_P((
BerElement *ber,
ber_len_t *len,
- char *last ));
+ LDAP_CONST char *last ));
LDAP_F( ber_tag_t )
ber_scanf LDAP_P((
ber_strdup LDAP_P((
LDAP_CONST char * ));
+/*
+ * error.c
+ */
+LDAP_F( int * ) ber_errno_addr LDAP_P((void));
+#define ber_errno (*(ber_errno_addr)())
+
+#define LBER_ERROR_NONE 0
+#define LBER_ERROR_PARAM 0x1
+#define LBER_ERROR_MEMORY 0x2
+
LDAP_END_DECL
-#endif /* _LBER_H */
+#endif /* _LBER_H */
\ No newline at end of file
*/
/*
- * LBER types for Windows NT
+ * LBER types for Windows NT (and Win32)
+ * copied by setup.mak to lber_types.h (when confingure is not used).
*/
-#ifndef _LBER_TYPES_H_NT
-#define _LBER_TYPES_H_NT
+#ifndef _LBER_TYPES_H
+#define _LBER_TYPES_H
/*
* NT types:
/* LBER lengths - 32 bits or larger*/
#define LBER_LEN_T int
-#endif /* _LBER_TYPES_H_NT */
+#endif /* _LBER_TYPES_H */
#define LDAP_API_VERSION 2004
#define LDAP_VENDOR_NAME "OpenLDAP"
/* We'll eventually release as 200 */
-#define LDAP_VENDOR_VERSION 193
+#define LDAP_VENDOR_VERSION 194
/* OpenLDAP API Features */
#define LDAP_API_FEATURE_X_OPENLDAP LDAP_VENDOR_VERSION
*/
/* general stuff */
-#define LDAP_TAG_MESSAGE (ber_tag_t) 0x30U /* constructed + 16 */
-#define LDAP_TAG_MSGID (ber_tag_t) 0x02U /* integer */
-#define LDAP_TAG_LDAPDN (ber_tag_t) 0x04U /* octect string */
-#define LDAP_TAG_LDAPCRED (ber_tag_t) 0x04U /* octect string */
-#define LDAP_TAG_CONTROLS (ber_tag_t) 0xa0U /* context specific + constructed + 0 */
-#define LDAP_TAG_REFERRAL (ber_tag_t) 0xa3U /* context specific + constructed + 3 */
+#define LDAP_TAG_MESSAGE ((ber_tag_t) 0x30U) /* constructed + 16 */
+#define LDAP_TAG_MSGID ((ber_tag_t) 0x02U) /* integer */
+#define LDAP_TAG_LDAPDN ((ber_tag_t) 0x04U) /* octect string */
+#define LDAP_TAG_LDAPCRED ((ber_tag_t) 0x04U) /* octect string */
+#define LDAP_TAG_CONTROLS ((ber_tag_t) 0xa0U) /* context specific + constructed + 0 */
+#define LDAP_TAG_REFERRAL ((ber_tag_t) 0xa3U) /* context specific + constructed + 3 */
-#define LDAP_TAG_NEWSUPERIOR (ber_tag_t) 0x80U /* context-specific + primitive + 0 */
+#define LDAP_TAG_NEWSUPERIOR ((ber_tag_t) 0x80U) /* context-specific + primitive + 0 */
-#define LDAP_TAG_EXOP_REQ_OID (ber_tag_t) 0x80U /* context specific + primitive */
-#define LDAP_TAG_EXOP_REQ_VALUE (ber_tag_t) 0x81U /* context specific + primitive */
-#define LDAP_TAG_EXOP_RES_OID (ber_tag_t) 0x8aU /* context specific + primitive */
-#define LDAP_TAG_EXOP_RES_VALUE (ber_tag_t) 0x8bU /* context specific + primitive */
+#define LDAP_TAG_EXOP_REQ_OID ((ber_tag_t) 0x80U) /* context specific + primitive */
+#define LDAP_TAG_EXOP_REQ_VALUE ((ber_tag_t) 0x81U) /* context specific + primitive */
+#define LDAP_TAG_EXOP_RES_OID ((ber_tag_t) 0x8aU) /* context specific + primitive */
+#define LDAP_TAG_EXOP_RES_VALUE ((ber_tag_t) 0x8bU) /* context specific + primitive */
-#define LDAP_TAG_SASL_RES_CREDS (ber_tag_t) 0x87U /* context specific + primitive */
+#define LDAP_TAG_SASL_RES_CREDS ((ber_tag_t) 0x87U) /* context specific + primitive */
/* possible operations a client can invoke */
-#define LDAP_REQ_BIND (ber_tag_t) 0x60U /* application + constructed */
-#define LDAP_REQ_UNBIND (ber_tag_t) 0x42U /* application + primitive */
-#define LDAP_REQ_SEARCH (ber_tag_t) 0x63U /* application + constructed */
-#define LDAP_REQ_MODIFY (ber_tag_t) 0x66U /* application + constructed */
-#define LDAP_REQ_ADD (ber_tag_t) 0x68U /* application + constructed */
-#define LDAP_REQ_DELETE (ber_tag_t) 0x4aU /* application + primitive */
-#define LDAP_REQ_MODRDN (ber_tag_t) 0x6cU /* application + constructed */
+#define LDAP_REQ_BIND ((ber_tag_t) 0x60U) /* application + constructed */
+#define LDAP_REQ_UNBIND ((ber_tag_t) 0x42U) /* application + primitive */
+#define LDAP_REQ_SEARCH ((ber_tag_t) 0x63U) /* application + constructed */
+#define LDAP_REQ_MODIFY ((ber_tag_t) 0x66U) /* application + constructed */
+#define LDAP_REQ_ADD ((ber_tag_t) 0x68U) /* application + constructed */
+#define LDAP_REQ_DELETE ((ber_tag_t) 0x4aU) /* application + primitive */
+#define LDAP_REQ_MODRDN ((ber_tag_t) 0x6cU) /* application + constructed */
#define LDAP_REQ_MODDN LDAP_REQ_MODRDN
#define LDAP_REQ_RENAME LDAP_REQ_MODRDN
-#define LDAP_REQ_COMPARE (ber_tag_t) 0x6eU /* application + constructed */
-#define LDAP_REQ_ABANDON (ber_tag_t) 0x50U /* application + primitive */
-#define LDAP_REQ_EXTENDED (ber_tag_t) 0x77U /* application + constructed */
+#define LDAP_REQ_COMPARE ((ber_tag_t) 0x6eU) /* application + constructed */
+#define LDAP_REQ_ABANDON ((ber_tag_t) 0x50U) /* application + primitive */
+#define LDAP_REQ_EXTENDED ((ber_tag_t) 0x77U) /* application + constructed */
/* possible result types a server can return */
-#define LDAP_RES_BIND (ber_tag_t) 0x61U /* application + constructed */
-#define LDAP_RES_SEARCH_ENTRY (ber_tag_t) 0x64U /* application + constructed */
-#define LDAP_RES_SEARCH_REFERENCE (ber_tag_t) 0x73U /* V3: application + constructed */
-#define LDAP_RES_SEARCH_RESULT (ber_tag_t) 0x65U /* application + constructed */
-#define LDAP_RES_MODIFY (ber_tag_t) 0x67U /* application + constructed */
-#define LDAP_RES_ADD (ber_tag_t) 0x69U /* application + constructed */
-#define LDAP_RES_DELETE (ber_tag_t) 0x6bU /* application + constructed */
-#define LDAP_RES_MODRDN (ber_tag_t) 0x6dU /* application + constructed */
+#define LDAP_RES_BIND ((ber_tag_t) 0x61U) /* application + constructed */
+#define LDAP_RES_SEARCH_ENTRY ((ber_tag_t) 0x64U) /* application + constructed */
+#define LDAP_RES_SEARCH_REFERENCE ((ber_tag_t) 0x73U) /* V3: application + constructed */
+#define LDAP_RES_SEARCH_RESULT ((ber_tag_t) 0x65U) /* application + constructed */
+#define LDAP_RES_MODIFY ((ber_tag_t) 0x67U) /* application + constructed */
+#define LDAP_RES_ADD ((ber_tag_t) 0x69U) /* application + constructed */
+#define LDAP_RES_DELETE ((ber_tag_t) 0x6bU) /* application + constructed */
+#define LDAP_RES_MODRDN ((ber_tag_t) 0x6dU) /* application + constructed */
#define LDAP_RES_MODDN LDAP_RES_MODRDN /* application + constructed */
#define LDAP_RES_RENAME LDAP_RES_MODRDN /* application + constructed */
-#define LDAP_RES_COMPARE (ber_tag_t) 0x6fU /* application + constructed */
-#define LDAP_RES_EXTENDED (ber_tag_t) 0x78U /* V3: application + constructed */
+#define LDAP_RES_COMPARE ((ber_tag_t) 0x6fU) /* application + constructed */
+#define LDAP_RES_EXTENDED ((ber_tag_t) 0x78U) /* V3: application + constructed */
#define LDAP_RES_ANY ((ber_tag_t)(-1))
#define LDAP_RES_UNSOLICITED ((ber_tag_t)(0))
#define LDAP_SASL_SIMPLE NULL
/* authentication methods available */
-#define LDAP_AUTH_NONE (ber_tag_t) 0x00U /* no authentication */
-#define LDAP_AUTH_SIMPLE (ber_tag_t) 0x80U /* context specific + primitive */
-#define LDAP_AUTH_SASL (ber_tag_t) 0xa3U /* context specific + primitive */
-#define LDAP_AUTH_KRBV4 (ber_tag_t) 0xffU /* means do both of the following */
-#define LDAP_AUTH_KRBV41 (ber_tag_t) 0x81U /* context specific + primitive */
-#define LDAP_AUTH_KRBV42 (ber_tag_t) 0x82U /* context specific + primitive */
+#define LDAP_AUTH_NONE ((ber_tag_t) 0x00U) /* no authentication */
+#define LDAP_AUTH_SIMPLE ((ber_tag_t) 0x80U) /* context specific + primitive */
+#define LDAP_AUTH_SASL ((ber_tag_t) 0xa3U) /* context specific + primitive */
+#define LDAP_AUTH_KRBV4 ((ber_tag_t) 0xffU) /* means do both of the following */
+#define LDAP_AUTH_KRBV41 ((ber_tag_t) 0x81U) /* context specific + primitive */
+#define LDAP_AUTH_KRBV42 ((ber_tag_t) 0x82U) /* context specific + primitive */
/* filter types */
-#define LDAP_FILTER_AND (ber_tag_t) 0xa0U /* context specific + constructed */
-#define LDAP_FILTER_OR (ber_tag_t) 0xa1U /* context specific + constructed */
-#define LDAP_FILTER_NOT (ber_tag_t) 0xa2U /* context specific + constructed */
-#define LDAP_FILTER_EQUALITY (ber_tag_t) 0xa3U /* context specific + constructed */
-#define LDAP_FILTER_SUBSTRINGS (ber_tag_t) 0xa4U /* context specific + constructed */
-#define LDAP_FILTER_GE (ber_tag_t) 0xa5U /* context specific + constructed */
-#define LDAP_FILTER_LE (ber_tag_t) 0xa6U /* context specific + constructed */
-#define LDAP_FILTER_PRESENT (ber_tag_t) 0x87U /* context specific + primitive */
-#define LDAP_FILTER_APPROX (ber_tag_t) 0xa8U /* context specific + constructed */
-#define LDAP_FILTER_EXT (ber_tag_t) 0xa9U /* context specific + constructed */
+#define LDAP_FILTER_AND ((ber_tag_t) 0xa0U) /* context specific + constructed */
+#define LDAP_FILTER_OR ((ber_tag_t) 0xa1U) /* context specific + constructed */
+#define LDAP_FILTER_NOT ((ber_tag_t) 0xa2U) /* context specific + constructed */
+#define LDAP_FILTER_EQUALITY ((ber_tag_t) 0xa3U) /* context specific + constructed */
+#define LDAP_FILTER_SUBSTRINGS ((ber_tag_t) 0xa4U) /* context specific + constructed */
+#define LDAP_FILTER_GE ((ber_tag_t) 0xa5U) /* context specific + constructed */
+#define LDAP_FILTER_LE ((ber_tag_t) 0xa6U) /* context specific + constructed */
+#define LDAP_FILTER_PRESENT ((ber_tag_t) 0x87U) /* context specific + primitive */
+#define LDAP_FILTER_APPROX ((ber_tag_t) 0xa8U) /* context specific + constructed */
+#define LDAP_FILTER_EXT ((ber_tag_t) 0xa9U) /* context specific + constructed */
/* extended filter component types */
-#define LDAP_FILTER_EXT_OID (ber_tag_t) 0x81U /* context specific */
-#define LDAP_FILTER_EXT_TYPE (ber_tag_t) 0x82U /* context specific */
-#define LDAP_FILTER_EXT_VALUE (ber_tag_t) 0x83U /* context specific */
-#define LDAP_FILTER_EXT_DNATTRS (ber_tag_t) 0x84U /* context specific */
+#define LDAP_FILTER_EXT_OID ((ber_tag_t) 0x81U) /* context specific */
+#define LDAP_FILTER_EXT_TYPE ((ber_tag_t) 0x82U) /* context specific */
+#define LDAP_FILTER_EXT_VALUE ((ber_tag_t) 0x83U) /* context specific */
+#define LDAP_FILTER_EXT_DNATTRS ((ber_tag_t) 0x84U) /* context specific */
/* substring filter component types */
-#define LDAP_SUBSTRING_INITIAL (ber_tag_t) 0x80U /* context specific */
-#define LDAP_SUBSTRING_ANY (ber_tag_t) 0x81U /* context specific */
-#define LDAP_SUBSTRING_FINAL (ber_tag_t) 0x82U /* context specific */
+#define LDAP_SUBSTRING_INITIAL ((ber_tag_t) 0x80U) /* context specific */
+#define LDAP_SUBSTRING_ANY ((ber_tag_t) 0x81U) /* context specific */
+#define LDAP_SUBSTRING_FINAL ((ber_tag_t) 0x82U) /* context specific */
/* search scopes */
-#define LDAP_SCOPE_BASE (ber_int_t) 0x0000
-#define LDAP_SCOPE_ONELEVEL (ber_int_t) 0x0001
-#define LDAP_SCOPE_SUBTREE (ber_int_t) 0x0002
+#define LDAP_SCOPE_BASE ((ber_int_t) 0x0000)
+#define LDAP_SCOPE_ONELEVEL ((ber_int_t) 0x0001)
+#define LDAP_SCOPE_SUBTREE ((ber_int_t) 0x0002)
/* for modifications */
typedef struct ldapmod {
int mod_op;
-#define LDAP_MOD_ADD (ber_int_t) 0x0000
-#define LDAP_MOD_DELETE (ber_int_t) 0x0001
-#define LDAP_MOD_REPLACE (ber_int_t) 0x0002
-#define LDAP_MOD_BVALUES (ber_int_t) 0x0080
+#define LDAP_MOD_ADD ((ber_int_t) 0x0000)
+#define LDAP_MOD_DELETE ((ber_int_t) 0x0001)
+#define LDAP_MOD_REPLACE ((ber_int_t) 0x0002)
+#define LDAP_MOD_BVALUES ((ber_int_t) 0x0080)
/* IMPORTANT: do not use code 0x1000 (or above),
* it is used internally by the backends!
* (see ldap/servers/slapd/slap.h)
*/
/*
- * This file works in confunction with OpenLDAP configure system.
+ * This file works in confunction with OpenLDAP setup.mak system.
* If you do no like the values below, adjust your configure options.
*/
# TARGTYPE "Win32 (x86) External Target" 0x0106
-CFG=setup - Win32 Single Debug
+CFG=setup - Win32 DLL Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!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 "setup.mak" CFG="setup - Win32 Single Debug"
+!MESSAGE NMAKE /f "setup.mak" CFG="setup - Win32 DLL Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "setup - Win32 Single Debug" (based on "Win32 (x86) External Target")
!MESSAGE "setup - Win32 Single Release" (based on\
"Win32 (x86) External Target")
+!MESSAGE "setup - Win32 DLL Debug" (based on "Win32 (x86) External Target")
+!MESSAGE "setup - Win32 DLL Release" (based on "Win32 (x86) External Target")
!MESSAGE
# Begin Project
# PROP Bsc_Name "setup.bsc"
# PROP Target_Dir ""
+!ELSEIF "$(CFG)" == "setup - Win32 DLL Debug"
+
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "setup__1"
+# PROP BASE Intermediate_Dir "setup__1"
+# PROP BASE Cmd_Line "NMAKE /f setup.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "setup.txt"
+# PROP BASE Bsc_Name "setup.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "setup__1"
+# PROP Intermediate_Dir "setup__1"
+# PROP Cmd_Line "NMAKE /f setup.mak"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "setup.txt"
+# PROP Bsc_Name "setup.bsc"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "setup - Win32 DLL Release"
+
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "setup__2"
+# PROP BASE Intermediate_Dir "setup__2"
+# PROP BASE Cmd_Line "NMAKE /f setup.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "setup.txt"
+# PROP BASE Bsc_Name "setup.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "setup__2"
+# PROP Intermediate_Dir "setup__2"
+# PROP Cmd_Line "NMAKE /f setup.mak"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "setup.txt"
+# PROP Bsc_Name "setup.bsc"
+# PROP Target_Dir ""
+
!ENDIF
# Begin Target
# Name "setup - Win32 Debug"
# Name "setup - Win32 Single Debug"
# Name "setup - Win32 Single Release"
+# Name "setup - Win32 DLL Debug"
+# Name "setup - Win32 DLL Release"
!IF "$(CFG)" == "setup - Win32 Release"
!ELSEIF "$(CFG)" == "setup - Win32 Single Release"
+!ELSEIF "$(CFG)" == "setup - Win32 DLL Debug"
+
+!ELSEIF "$(CFG)" == "setup - Win32 DLL Release"
+
!ENDIF
# Begin Source File
#include "lber-int.h"
+/*
+ * ber errno
+ */
+BER_ERRNO_FN ber_int_errno_fn;
+
+int * ber_errno_addr(void)
+{
+ static int ber_int_errno = LBER_ERROR_NONE;
+
+ if( ber_int_errno_fn ) {
+ return (*ber_int_errno_fn)();
+ }
+
+ return &ber_int_errno;
+}
+
/*
* Print stuff
*/
BerElement *ber_in,
ber_len_t *len )
{
- ber_tag_t tag;
+ char* save;
BerElement *ber;
+ ber_tag_t tag;
assert( ber_in != NULL );
assert( BER_VALID( ber_in ) );
- ber = ber_dup( ber_in );
-
- if( ber == NULL ) {
- return LBER_ERROR;
- }
-
- assert( BER_VALID( ber ) );
+ /* save state */
+ save = ber->ber_ptr;
tag = ber_skip_tag( ber, len );
- ber_free( ber, 0 );
+ /* restore state */
+ ber->ber_ptr = save;
+
return( tag );
}
/* skip the sequence header, use the len to mark where to stop */
if ( ber_skip_tag( ber, len ) == LBER_DEFAULT ) {
- *last = NULL;
- return( LBER_DEFAULT );
+ return( LBER_ERROR );
}
*last = ber->ber_ptr + *len;
ber_next_element(
BerElement *ber,
ber_len_t *len,
- char *last )
+ LDAP_CONST char *last )
{
assert( ber != NULL );
assert( len != NULL );
assert( BER_VALID( ber ) );
if ( ber->ber_ptr == last ) {
+ /* set last to NULL on end of SEQUENCE */
return( LBER_DEFAULT );
}
# TARGTYPE "Win32 (x86) Console Application" 0x0103
-CFG=dtest - Win32 Single Debug
+CFG=dtest - Win32 DLL Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!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 "dtest.mak" CFG="dtest - Win32 Single Debug"
+!MESSAGE NMAKE /f "dtest.mak" CFG="dtest - Win32 DLL Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
"Win32 (x86) Console Application")
!MESSAGE "dtest - Win32 Single Release" (based on\
"Win32 (x86) Console Application")
+!MESSAGE "dtest - Win32 DLL Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "dtest - Win32 DLL Release" (based on\
+ "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# ADD BASE LINK32 olber32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release"
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+!ELSEIF "$(CFG)" == "dtest - Win32 DLL Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "dtest___"
+# PROP BASE Intermediate_Dir "dtest___"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\DLLDebug"
+# PROP Intermediate_Dir "..\..\DLLDebug\dtest"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+
+!ELSEIF "$(CFG)" == "dtest - Win32 DLL Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "dtest__0"
+# PROP BASE Intermediate_Dir "dtest__0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "dtest__0"
+# PROP Intermediate_Dir "dtest__0"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+
!ENDIF
# Begin Target
# Name "dtest - Win32 Debug"
# Name "dtest - Win32 Single Debug"
# Name "dtest - Win32 Single Release"
+# Name "dtest - Win32 DLL Debug"
+# Name "dtest - Win32 DLL Release"
# Begin Source File
SOURCE=.\dtest.c
break;
case 'B': /* bit string */
+ case 'X': /* bit string (deprecated) */
s = va_arg( ap, char * );
len = va_arg( ap, int ); /* in bits */
rc = ber_put_bitstring( ber, s, len, ber->ber_tag );
LDAP_BEGIN_DECL
+extern BER_ERRNO_FN ber_int_errno_fn;
+
+
/* these have to match lber types settings */
#define LBER_INT_HTON(i) AC_HTONL(i)
#define LBER_INT_NTOH(i) AC_NTOHL(i)
# TARGTYPE "Win32 (x86) Static Library" 0x0104
-CFG=liblber - Win32 Single Debug
+CFG=liblber - Win32 DLL Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!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 "liblber.mak" CFG="liblber - Win32 Single Debug"
+!MESSAGE NMAKE /f "liblber.mak" CFG="liblber - Win32 DLL Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "liblber - Win32 Single Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "liblber - Win32 Single Release" (based on\
"Win32 (x86) Static Library")
+!MESSAGE "liblber - Win32 DLL Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "liblber - Win32 DLL Release" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# ADD BASE LIB32 /nologo /out:"..\Release\olber32.lib"
# ADD LIB32 /nologo /out:"..\..\SRelease\olber32.lib"
+!ELSEIF "$(CFG)" == "liblber - Win32 DLL Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "liblber_"
+# PROP BASE Intermediate_Dir "liblber_"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\DLLDebug"
+# PROP Intermediate_Dir "..\..\DLLDebug\liblber"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\..\Debug\olber32.lib"
+# ADD LIB32 /nologo /out:"..\..\DLLDebug\olber32.lib"
+
+!ELSEIF "$(CFG)" == "liblber - Win32 DLL Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "liblber0"
+# PROP BASE Intermediate_Dir "liblber0"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "liblber0"
+# PROP Intermediate_Dir "liblber0"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_WINDOWS" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\..\Release\olber32.lib"
+# ADD LIB32 /nologo /out:"..\..\Release\olber32.lib"
+
!ENDIF
# Begin Target
# Name "liblber - Win32 Debug"
# Name "liblber - Win32 Single Debug"
# Name "liblber - Win32 Single Release"
+# Name "liblber - Win32 DLL Debug"
+# Name "liblber - Win32 DLL Release"
# Begin Source File
SOURCE=.\bprint.c
* (int *) outvalue = ber->ber_debug;
return LBER_OPT_SUCCESS;
+ case LBER_OPT_BER_REMAINING_BYTES:
+ *((ber_len_t *) outvalue) = ber->ber_end - ber->ber_ptr;
+ return LBER_OPT_SUCCESS;
+
+ case LBER_OPT_BER_TOTAL_BYTES:
+ *((ber_len_t *) outvalue) = ber->ber_end - ber->ber_buf;
+ return LBER_OPT_SUCCESS;
+
+ case LBER_OPT_BER_BYTES_TO_WRITE:
+ *((ber_len_t *) outvalue) = ber->ber_ptr - ber->ber_buf;
+ return LBER_OPT_SUCCESS;
+
default:
/* bad param */
break;
ber->ber_debug = * (const int *) invalue;
return LBER_OPT_SUCCESS;
+ case LBER_OPT_BER_REMAINING_BYTES:
+ ber->ber_end = &ber->ber_ptr[* (const ber_len_t *) invalue];
+ return LBER_OPT_SUCCESS;
+
+ case LBER_OPT_BER_TOTAL_BYTES:
+ ber->ber_end = &ber->ber_buf[* (const ber_len_t *) invalue];
+ return LBER_OPT_SUCCESS;
+
+ case LBER_OPT_BER_BYTES_TO_WRITE:
+ ber->ber_ptr = &ber->ber_buf[* (const ber_len_t *) invalue];
+ return LBER_OPT_SUCCESS;
+
default:
/* bad param */
break;
Connection *conn,
BerElement *ber )
{
- ber_len_t bytes = ber_pvt_ber_bytes( ber );
+ ber_len_t bytes;
+
+ ber_get_option( ber, LBER_OPT_BER_BYTES_TO_WRITE, &bytes );
/* write only one pdu at a time - wait til it's our turn */
ldap_pvt_thread_mutex_lock( &conn->c_write_mutex );