ANSIfy function declarations
authorBill Sommerfeld <wesommer@mit.edu>
Tue, 16 Jan 1990 20:58:22 +0000 (20:58 +0000)
committerBill Sommerfeld <wesommer@mit.edu>
Tue, 16 Jan 1990 20:58:22 +0000 (20:58 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@92 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/encryption.h

index 3f0f8b94f03b7ea0aedeeb9cb967bafc90e88e32..03ae1b883d14b831777bf8c2e5541e71fa2d7d5e 100644 (file)
 #ifndef __KRB5_ENCRYPTION__
 #define __KRB5_ENCRYPTION__
 
+#ifndef __STDC__
+#define PROTOTYPE(x) ()
+#else
+#define PROTOTYPE(x) x
+#endif
+
 typedef struct _krb5_keyblock {
     krb5_keytype keytype;
     int length;
@@ -30,18 +36,26 @@ typedef struct _krb5_checksum {
                                           on length */
 } krb5_checksum;
 
+typedef struct _krb5_encrypt_block {
+    struct _krb5_cryptosystem_entry *crypto_entry;
+    krb5_keyblock *key;
+    void *priv;                                /* for private use, e.g. DES
+                                          key schedules */
+} krb5_encrypt_block;
+
 /* could be used in a table to find an etype and initialize a block */
 typedef struct _krb5_cryptosystem_entry {
-    int (*encrypt_func)(/* void *in, void *out, size_t length,
-                          krb5_encrypt_block *block */);
-    int (*decrypt_func)(/* void *in, void *out, size_t length,
-                          krb5_encrypt_block *block */);
-    int (*process_key)(/* krb5_encrypt_block *block, krb5_keyblock *key */);
-    int (*finish_key)(/* krb5_encrypt_block *block */);
-    int (*string_to_key)(/* krb5_keytype keytype, krb5_keyblock *key,
-                           char *string, krb5_principal *client */);
-    int (*random_key)(/* void *sequence */);
-    void * (*init_random_key)(/* krb5_keyblock *key */);
+    int (*encrypt_func) PROTOTYPE((void *in, void *out, size_t length,
+                                   krb5_encrypt_block *block));
+    int (*decrypt_func) PROTOTYPE((void *in, void *out, size_t length,
+                          krb5_encrypt_block *block));
+    int (*process_key) PROTOTYPE((krb5_encrypt_block *block,
+                                 krb5_keyblock *key));
+    int (*finish_key) PROTOTYPE((krb5_encrypt_block *block));
+    int (*string_to_key) PROTOTYPE((krb5_keytype keytype, krb5_keyblock *key,
+                                   char *string, krb5_principal *client));
+    int (*random_key) PROTOTYPE((void *sequence));
+    void * (*init_random_key) PROTOTYPE((krb5_keyblock *key));
     int block_length;
     int pad_minimum;                   /* needed for cksum size computation */
     int keysize;
@@ -49,17 +63,10 @@ typedef struct _krb5_cryptosystem_entry {
                                           (assigned protocol number) */
 } krb5_cryptosystem_entry;
 
-typedef struct _krb5_encrypt_block {
-    krb5_cryptosystem_entry *crypto_entry;
-    krb5_keyblock *key;
-    void *priv;                                /* for private use, e.g. DES
-                                          key schedules */
-} krb5_encrypt_block;
-
 /* could be used in a table to find a sumtype */
 typedef struct _krb5_checksum_entry {
-    void * (*sum_func)(/* void *in, void *out, void *seed,
-                      size_t in_length, size_t seed_length */);
+    void * (*sum_func) PROTOTYPE ((void *in, void *out, void *seed,
+                                  size_t in_length, size_t seed_length));
     int checksum_length;               /* length of stuff returned by
                                           sum_func */
 } krb5_checksum_entry;
@@ -84,4 +91,6 @@ typedef struct _krb5_checksum_entry {
 #define ETYPE_IS_LOCAL(etype) (etype & 0x8000)
 #define CKSUMTYPE_IS_LOCAL(cksumtype) (cksumtype & 0x8000)
 
+#undef PROTOTYPE
+
 #endif /* __KRB5_ENCRYPTION__ */