]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/tmpltest.c
"const"ify some static arrays, and related parameters/variables
[openldap] / libraries / libldap / tmpltest.c
index d10837579061a41ed6b0673e88c5c496ece35704..697d4bc1859b7c036fe43e36ddca9986bbd29d3d 100644 (file)
@@ -1,27 +1,29 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include "lber.h"
-#include "ldap.h"
-#include "disptmpl.h"
-#include "srchpref.h"
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+#include "portable.h"
 
-#ifdef MACOS
+#include <stdio.h>
 #include <stdlib.h>
+
+#include <ac/socket.h>
+#include <ac/time.h>
+
+#ifdef HAVE_CONSOLE_H
 #include <console.h>
 #endif /* MACOS */
 
-#ifdef NEEDPROTOS
-void dump_tmpl( struct ldap_disptmpl *tmpl );
-void dump_srchpref( struct ldap_searchobj *sp );
-#else /* NEEDPROTOS */
-void dump_tmpl();
-void dump_srchpref();
-#endif /* NEEDPROTOS */
+#include "lber.h"
+#include "ldap.h"
+#include "disptmpl.h"
+#include "srchpref.h"
 
+static void dump_tmpl   ( struct ldap_disptmpl *tmpl );
+static void dump_srchpref( struct ldap_searchobj *sp );
 
 #define NULLSTRINGIFNULL( s )  ( s == NULL ? "(null)" : s )
 
-
 int
 main( int argc, char **argv )
 {
@@ -29,7 +31,7 @@ main( int argc, char **argv )
     struct ldap_searchobj      *so, *sop;
     int                                err;
 
-#ifdef MACOS
+#ifdef HAVE_CONSOLE_H
        ccommand( &argv );
        for ( argc = 0; argv[ argc ] != NULL; ++argc ) {
            ;
@@ -80,13 +82,13 @@ main( int argc, char **argv )
 }
 
 
-static char *syn_name[] = {
+static const char *const syn_name[] = {
     "?", "CIS", "MLS", "DN", "BOOL", "JPEG", "JPEGBTN", "FAX", "FAXBTN",
     "AUDIOBTN", "TIME", "DATE", "URL", "SEARCHACT", "LINKACT", "ADDDNACT",
     "VERIFYACT",
 };
 
-static char *syn_type[] = {
+static const char *const syn_type[] = {
     "?", "txt", "img", "?", "bool", "?", "?", "?", "btn",
     "?", "?", "?", "?", "?", "?", "?",
     "action", "?"
@@ -94,11 +96,11 @@ static char *syn_type[] = {
 
 static char *includeattrs[] = { "objectClass", "sn", NULL };
 
-static char *item_opts[] = {
+static const char *const item_opts[] = {
     "ro", "sort", "1val", "hide", "required", "hideiffalse", NULL
 };
 
-static unsigned long item_opt_vals[] = {
+static const unsigned long item_opt_vals[] = {
     LDAP_DITEM_OPT_READONLY,           LDAP_DITEM_OPT_SORTVALUES,
     LDAP_DITEM_OPT_SINGLEVALUED,       LDAP_DITEM_OPT_HIDEIFEMPTY,
     LDAP_DITEM_OPT_VALUEREQUIRED,      LDAP_DITEM_OPT_HIDEIFFALSE,