allow narrow or wide prototypes
authorJohn Kohl <jtkohl@mit.edu>
Mon, 19 Nov 1990 13:59:02 +0000 (13:59 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Mon, 19 Nov 1990 13:59:02 +0000 (13:59 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1457 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/kdb.h
src/include/krb5/kdb_dbm.h
src/include/krb5/keytab.h

index 340b573840a418040ba55d3a4d138c918fb2fea8..589c3a5054ad12e6e9aef33d02ca8ca5b695c0ca 100644 (file)
@@ -51,9 +51,6 @@ extern char *krb5_mkey_pwd_prompt2;
 /* libkdb.spec */
 krb5_error_code krb5_db_set_name
        PROTOTYPE((char * ));
-krb5_error_code krb5_db_set_nonblocking
-       PROTOTYPE((krb5_boolean,
-                  krb5_boolean * ));
 krb5_error_code krb5_db_init
        PROTOTYPE((void ));
 krb5_error_code krb5_db_fini
@@ -86,9 +83,6 @@ krb5_error_code krb5_db_iterate
                   krb5_pointer ));
 krb5_error_code krb5_db_verify_master_key
        PROTOTYPE((krb5_principal, krb5_keyblock *, krb5_encrypt_block *));
-krb5_error_code        krb5_db_fetch_mkey
-       PROTOTYPE((krb5_principal, krb5_encrypt_block *, krb5_boolean,
-                  krb5_boolean, krb5_keyblock * ));
 krb5_error_code krb5_db_store_mkey PROTOTYPE((char *,
                                              krb5_principal,
                                              krb5_keyblock *));
@@ -107,10 +101,28 @@ krb5_error_code krb5_db_lock
 krb5_error_code krb5_db_unlock
        PROTOTYPE ((void ));
 
-/* XXX I give up.... the following int should be a krb5_boolean, but */
- /* it causes gcc to give up and die. */
+/* need to play games here, since we take a pointer and the real thing,
+   and it might be narrow. */
+#ifdef NARROW_PROTOTYPES
+krb5_error_code krb5_db_set_nonblocking
+       PROTOTYPE((krb5_boolean,
+                  krb5_boolean * ));
+#else
+krb5_error_code krb5_db_set_nonblocking
+       PROTOTYPE((int, /* krb5_boolean */
+                  krb5_boolean * ));
+#endif /* NARROW_PROTOTYPES */
+#include <krb5/widen.h>
+
+/* Only put things which don't have pointers to the narrow types in this
+   section */
+
 krb5_boolean krb5_db_set_lockmode
-       PROTOTYPE((int ));
+       PROTOTYPE((krb5_boolean ));
+krb5_error_code        krb5_db_fetch_mkey
+       PROTOTYPE((krb5_principal, krb5_encrypt_block *, krb5_boolean,
+                  krb5_boolean, krb5_keyblock * ));
+#include <krb5/narrow.h>
 
 
 #define KRB5_KDB_DEF_FLAGS     (KRB5_KDB_DISALLOW_DUP_SKEY)
index 3e9edc96f7c6167371c9037a699f042379d6aec3..3814d04d9f246cd13eb944eccbb2c721cdac0f37 100644 (file)
@@ -45,8 +45,6 @@
 
 /* libkdb.spec */
 krb5_error_code krb5_dbm_db_set_name PROTOTYPE((char * ));
-krb5_error_code krb5_dbm_db_set_nonblocking PROTOTYPE((krb5_boolean,
-                                                      krb5_boolean * ));
 krb5_error_code krb5_dbm_db_init PROTOTYPE((void ));
 krb5_error_code krb5_dbm_db_fini PROTOTYPE((void ));
 krb5_error_code krb5_dbm_db_get_age PROTOTYPE((char *, time_t * ));
@@ -63,4 +61,15 @@ krb5_error_code krb5_dbm_db_iterate
     PROTOTYPE((krb5_error_code (*) PROTOTYPE((krb5_pointer,
                                              krb5_db_entry *)),
               krb5_pointer ));
+
+/* need to play games here, since we take a pointer and the real thing,
+   and it might be narrow. */
+#ifdef NARROW_PROTOTYPES
+krb5_error_code krb5_dbm_db_set_nonblocking PROTOTYPE((krb5_boolean,
+                                                      krb5_boolean * ));
+#else
+krb5_error_code krb5_dbm_db_set_nonblocking PROTOTYPE((int, /* krb5_boolean */
+                                                      krb5_boolean * ));
+#endif /* NARROW_PROTOTYPES */
+
 #endif /* KRB5_KDB5_DBM__ */
index 19da0a5af0ca3c767259f806fd39abd191c57cfb..af92e55f9161d14d0d3b62db052fcb7568d5aeae 100644 (file)
@@ -35,6 +35,9 @@ typedef struct _krb5_kt {
 } *krb5_keytab;
 
 
+/* widen prototypes, if needed */
+#include <krb5/widen.h>
+
 typedef struct _krb5_kt_ops {
        char *prefix;
         /* routines always present */
@@ -61,6 +64,10 @@ typedef struct _krb5_kt_ops {
        krb5_error_code (*remove) PROTOTYPE((krb5_keytab,
                                             krb5_keytab_entry *));
 } krb5_kt_ops;
+
+/* and back to narrow */
+#include <krb5/narrow.h>
+
 #define krb5_kt_get_name(keytab, name, namelen) (*(keytab)->ops->get_name)(keytab,name,namelen)
 #define krb5_kt_close(keytab) (*(keytab)->ops->close)(keytab)
 #define krb5_kt_get_entry(keytab, principal, vno, entry) (*(keytab)->ops->get)(keytab, principal, vno, entry)