From: John Kohl Date: Mon, 19 Nov 1990 13:59:02 +0000 (+0000) Subject: allow narrow or wide prototypes X-Git-Tag: krb5-1.0-alpha3~136 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1405092b0d4f0fb1b232d718cc3a031ac7ae8ae;p=krb5.git allow narrow or wide prototypes git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1457 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/kdb.h b/src/include/krb5/kdb.h index 340b57384..589c3a505 100644 --- a/src/include/krb5/kdb.h +++ b/src/include/krb5/kdb.h @@ -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 + +/* 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 #define KRB5_KDB_DEF_FLAGS (KRB5_KDB_DISALLOW_DUP_SKEY) diff --git a/src/include/krb5/kdb_dbm.h b/src/include/krb5/kdb_dbm.h index 3e9edc96f..3814d04d9 100644 --- a/src/include/krb5/kdb_dbm.h +++ b/src/include/krb5/kdb_dbm.h @@ -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__ */ diff --git a/src/include/krb5/keytab.h b/src/include/krb5/keytab.h index 19da0a5af..af92e55f9 100644 --- a/src/include/krb5/keytab.h +++ b/src/include/krb5/keytab.h @@ -35,6 +35,9 @@ typedef struct _krb5_kt { } *krb5_keytab; +/* widen prototypes, if needed */ +#include + 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 + #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)