4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include "ldap_structs.h"
44 #define NIL(s) (((s) != 0) ? (s) : "<nil>")
45 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
49 #define MSG_NOTIMECHECK 0
51 #define MSG_MEMPARAM 2
54 #define MSG_INVALIDDELDISP 5
55 #define MSG_NORULEVALUE 6
56 #define MSG_NONPCOLDSTART 7
57 #define MSG_VLV_INSUFF_ACC 8
60 /* Error numbers (NPL is NisPlusLdap) */
64 #define NPL_BERENCODE 3
65 #define NPL_BERDECODE 4
67 /* Structure used to maintain a buffer with a length */
73 /* Generic print buffer */
74 extern __nis_buffer_t pb
;
76 /* Deferred error reporting buffer (TSD) */
80 } __nis_deferred_error_t
;
82 /* Exported symbols */
83 extern unsigned long numMisaligned
;
85 /* Exported functions */
86 void logmsg(int msgtype
, int priority
, char *fmt
, ...);
87 void reportError(int error
, char *fmt
, ...);
88 int getError(char **message
);
89 void clearError(void);
90 void logError(int priority
);
91 void *am(char *msg
, int size
);
93 char *sdup(char *msg
, int allocate
, char *str
);
94 char *scat(char *msg
, int deallocate
, char *s1
, char *s2
);
95 void sfree(void *ptr
);
96 char lastChar(__nis_single_value_t
*v
);
97 void *appendString2SingleVal(char *str
, __nis_single_value_t
*v
,
99 int scmp(char *s
, __nis_single_value_t
*v
);
100 int scasecmp(char *s
, __nis_single_value_t
*v
);
101 int vp2buf(char *msg
, char **buf
, int buflen
, char *fmt
, va_list ap
);
102 void p2buf(char *msg
, char *fmt
, ...);
103 void bp2buf(char *msg
, __nis_buffer_t
*b
, char *fmt
, ...);
104 void bc2buf(char *msg
, void *buf
, int len
, __nis_buffer_t
*b
);
105 void sbc2buf(char *msg
, void *buf
, int len
, __nis_buffer_t
*b
);
106 void c2buf(char *msg
, void *buf
, int len
);
107 void sc2buf(char *msg
, void *buf
, int len
);
109 void *extendArray(void *array
, int newsize
);
110 int checkIPaddress(char *addr
, int len
, char **newaddr
);
111 int sstrncmp(const char *s1
, const char *s2
, int n
);
112 char *trimWhiteSpaces(char *str
, int *len
, int deallocate
);
113 int escapeSpecialChars(__nis_value_t
*val
);
114 void removeEscapeChars(__nis_value_t
*val
);
119 #endif /* __cplusplus */
121 #endif /* _LDAP_UTIL_H */