Portability patch for HP MPE/iX. Submitted by Mark Bixby <mark_bixby@hp.com>
[openssl.git] / crypto / bio / bio_cb.c
index 2f98cd1256bf05c1d20998480971009548ccb18d..37c7c2266683b1c3397206ed739fa98b85af63ea 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/bio/bio_cb.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 #include <string.h>
 #include <stdlib.h>
 #include "cryptlib.h"
-#include "bio.h"
-#include "err.h"
+#include <openssl/bio.h>
+#include <openssl/err.h>
 
-long MS_CALLBACK BIO_debug_callback(bio,cmd,argp,argi,argl,ret)
-BIO *bio;
-int cmd;
-char *argp;
-int argi;
-long argl;
-long ret;
+long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp,
+            int argi, long argl, long ret)
        {
        BIO *b;
        MS_STATIC char buf[256];
@@ -87,10 +82,16 @@ long ret;
                sprintf(p,"Free - %s\n",bio->method->name);
                break;
        case BIO_CB_READ:
-               sprintf(p,"read(%d,%d) - %s\n",bio->num,argi,bio->method->name);
+               if (bio->method->type & BIO_TYPE_DESCRIPTOR)
+                       sprintf(p,"read(%d,%d) - %s fd=%d\n",bio->num,argi,bio->method->name,bio->num);
+               else
+                       sprintf(p,"read(%d,%d) - %s\n",bio->num,argi,bio->method->name);
                break;
        case BIO_CB_WRITE:
-               sprintf(p,"write(%d,%d) - %s\n",bio->num,argi,bio->method->name);
+               if (bio->method->type & BIO_TYPE_DESCRIPTOR)
+                       sprintf(p,"write(%d,%d) - %s fd=%d\n",bio->num,argi,bio->method->name,bio->num);
+               else
+                       sprintf(p,"write(%d,%d) - %s\n",bio->num,argi,bio->method->name);
                break;
        case BIO_CB_PUTS:
                sprintf(p,"puts() - %s\n",bio->method->name);
@@ -124,7 +125,7 @@ long ret;
        b=(BIO *)bio->cb_arg;
        if (b != NULL)
                BIO_write(b,buf,strlen(buf));
-#ifndef WIN16
+#if !defined(NO_STDIO) && !defined(WIN16)
        else
                fputs(buf,stderr);
 #endif