]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/disptmpl.c
rename ldap_pvt_init_utils() to ldap_int_utils_init() and provide
[openldap] / libraries / libldap / disptmpl.c
index 1385ef587b70f9e246217d3a70c52a7081cc473a..d3db6106fdb724a0518a16e9def96b947fb90a5f 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/*  Portions
  * Copyright (c) 1993, 1994 Regents of the University of Michigan.
  * All rights reserved.
  *
  * 7 March 1994 by Mark C Smith
  */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <ctype.h>
-#include <string.h>
 #include <stdlib.h>
-#ifdef MACOS
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
-#ifndef VMS
-#include <unistd.h>
-#endif /* VMS */
-#endif /* DOS */
-#endif /* MACOS */
-
-#include "lber.h"
-#include "ldap.h"
+#endif
+
+#include "ldap-int.h"
 #include "disptmpl.h"
 
-#ifndef NEEDPROTOS
-static void free_disptmpl();
-static int read_next_tmpl();
-int next_line_tokens();
-void free_strarray();
-#else /* !NEEDPROTOS */
-static void free_disptmpl( struct ldap_disptmpl *tmpl );
-static int read_next_tmpl( char **bufp, long *blenp,
-       struct ldap_disptmpl **tmplp, int dtversion );
-int next_line_tokens( char **bufp, long *blenp, char ***toksp );
-void free_strarray( char **sap );
-#endif /* !NEEDPROTOS */
-
-static char            *tmploptions[] = {
+static void free_disptmpl LDAP_P(( struct ldap_disptmpl *tmpl ));
+static int read_next_tmpl LDAP_P(( char **bufp, long *blenp,
+       struct ldap_disptmpl **tmplp, int dtversion ));
+
+static const char *const       tmploptions[] = {
     "addable", "modrdn",
     "altview",
     NULL
 };
 
 
-static unsigned long   tmploptvals[] = {
+static const unsigned long     tmploptvals[] = {
     LDAP_DTMPL_OPT_ADDABLE, LDAP_DTMPL_OPT_ALLOWMODRDN,
     LDAP_DTMPL_OPT_ALTVIEW,
 };
 
 
-static char            *itemtypes[] = {
+static const char *const       itemtypes[] = {
     "cis",                     "mls",                  "dn",
     "bool",                    "jpeg",                 "jpegbtn",
     "fax",                     "faxbtn",               "audiobtn",
@@ -72,7 +61,7 @@ static char           *itemtypes[] = {
     NULL
 };
 
-static unsigned long   itemsynids[] = {
+static const unsigned long     itemsynids[] = {
     LDAP_SYN_CASEIGNORESTR,    LDAP_SYN_MULTILINESTR,  LDAP_SYN_DN,
     LDAP_SYN_BOOLEAN,          LDAP_SYN_JPEGIMAGE,     LDAP_SYN_JPEGBUTTON,
     LDAP_SYN_FAXIMAGE,         LDAP_SYN_FAXBUTTON,     LDAP_SYN_AUDIOBUTTON,
@@ -82,7 +71,7 @@ static unsigned long  itemsynids[] = {
 };
 
 
-static char            *itemoptions[] = {
+static const char *const       itemoptions[] = {
     "ro",                              "sort",
     "1val",                            "hide",
     "required",                                "hideiffalse",
@@ -90,7 +79,7 @@ static char           *itemoptions[] = {
 };
 
 
-static unsigned long   itemoptvals[] = {
+static const unsigned long     itemoptvals[] = {
     LDAP_DITEM_OPT_READONLY,           LDAP_DITEM_OPT_SORTVALUES,
     LDAP_DITEM_OPT_SINGLEVALUED,       LDAP_DITEM_OPT_HIDEIFEMPTY,
     LDAP_DITEM_OPT_VALUEREQUIRED,      LDAP_DITEM_OPT_HIDEIFFALSE,