appro> *** ./bio.h.orig        Mon Sep 27 16:00:09 1999
appro> --- ./bio.h     Thu Jan 20 16:57:00 2000
appro> ***************
appro> *** 116,121 ****
appro> --- 116,122 ----
appro>   /* callback is int cb(BIO *bio,state,ret); */
appro>   #define BIO_CTRL_SET_CALLBACK 14  /* opt - set callback function */
appro>   #define BIO_CTRL_GET_CALLBACK 15  /* opt - set callback function */
appro> + #define BIO_CTRL_ANSI_SET_CALLBACK    16  /* opt - set callback function */
appro>   
appro>   #define BIO_CTRL_SET_FILENAME 30      /* BIO_s_file special */
appro>   
appro> ***************
appro> *** 456,462 ****
appro> --- 457,467 ----
appro>   size_t BIO_ctrl_wpending(BIO *b);
appro>   #define BIO_flush(b)          (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
appro>   #define BIO_get_info_callback(b,cbp) 
(int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(char *)cbp)
appro> + #if 0
appro>   #define BIO_set_info_callback(b,cb) 
(int)BIO_ctrl(b,BIO_CTRL_SET_CALLBACK,0,(char *)cb)
appro> + #else
appro> + int BIO_set_info_callback (BIO *b, int (*cb)());
appro> + #endif
appro>   
appro>   /* For the BIO_f_buffer() type */
appro>   #define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
appro> *** ./bss_conn.c.orig   Thu Jun 10 19:00:10 1999
appro> --- ./bss_conn.c        Thu Jan 20 16:54:36 2000
appro> ***************
appro> *** 447,452 ****
appro> --- 447,454 ----
appro>         return(ret);
appro>         }
appro>   
appro> + typedef union { int (*func) (); void *ptr; } sin_of_ansification;
appro> + 
appro>   static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
appro>         {
appro>         BIO *dbio;
appro> ***************
appro> *** 573,579 ****
appro>                 (void)BIO_set_info_callback(dbio,data->info_callback);
appro>                 break;
appro>         case BIO_CTRL_SET_CALLBACK:
appro> !               data->info_callback=(int (*)())ptr;
appro>                 break;
appro>         case BIO_CTRL_GET_CALLBACK:
appro>                 {
appro> --- 575,587 ----
appro>                 (void)BIO_set_info_callback(dbio,data->info_callback);
appro>                 break;
appro>         case BIO_CTRL_SET_CALLBACK:
appro> !               if (sizeof(void (*)()) == sizeof(void *))
appro> !                       {
appro> !                       sin_of_ansification sin;
appro> !                       sin.ptr = ptr;
appro> !                       data->info_callback=sin.func;
appro> !                       }
appro> !               else    abort ();
appro>                 break;
appro>         case BIO_CTRL_GET_CALLBACK:
appro>                 {
appro> ***************
appro> *** 583,588 ****
appro> --- 591,599 ----
appro>                 *fptr=data->info_callback;
appro>                 }
appro>                 break;
appro> +       case BIO_CTRL_ANSI_SET_CALLBACK:
appro> +               data->info_callback=((sin_of_ansification *)ptr)->func;
appro> +               break;
appro>         default:
appro>                 ret=0;
appro>                 break;
appro> ***************
appro> *** 614,618 ****
appro> --- 625,636 ----
appro>                 }
appro>         }
appro>   
appro> + int BIO_set_info_callback (BIO *b, int (*cb)())
appro> +       {
appro> +       sin_of_ansification not_a_sin;
appro> + 
appro> +       not_a_sin.func = cb;
appro> +       return BIO_ctrl (b,BIO_CTRL_ANSI_SET_CALLBACK,0,(void *)&not_a_sin);
appro> +       }
appro>   #endif

Hmm.  That's basically an anonymous choice 4 and 5 (depending on ctl
code).  My thought about that one was that BIO_ctrl would be declared
and defined to take a 'sin_of_ansification *' as argument instead of a
'void *' (a non-anonymous variant 4).  This would still be binary
compatible (as you noted), but would force new users to use a more
type-safe approach to the control functions.  Also, in that case, new
ctl codes would not be required.

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-161 43  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis             -- [EMAIL PROTECTED]

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to