[452] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: Narrow vs. wide function prototypes (LIBRARY CHANGE)

jtkohl@ATHENA.MIT.EDU (jtkohl@ATHENA.MIT.EDU)
Mon Nov 19 14:25:10 1990

I've finished (or so I think) updating all the prototype declarations
found in our sources to auto-magically use widened or narrowed types. 

Here's how it works:

in the <foobar>.cf file, #define NeedNarrowPrototypes YES if you need
them (this is currently set in the VAX file, since our library is
currently compiled with narrow types).

If you declare prototypes which use any of the following types:

krb5_boolean
krb5_msgtype
krb5_kvno

krb5_addrtype
krb5_keytype
krb5_enctype
krb5_cksumtype
krb5_authdatatype

...then you should bracket such prototype declarations with
#include <krb5/widen.h>
and
#include <krb5/narrow.h>

If any of the functions take both a narrow type and a pointer to a
narrow type, then you'll need to do some conditionalization, a la
kdb_dbm.h:

/* 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 */

I may do some more makefile frobbing to make prototypes independent of
__STDC__.

home help back first fref pref prev next nref lref last post