Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 1997 07:20:03 -0700 (PDT)
From:      Dmitrij Tejblum <tejblum@arc.hq.cti.ru>
To:        freebsd-bugs
Subject:   Re: misc/3291: md2.h, md4.h, and md5.h headers useless for c++ programms 
Message-ID:  <199704151420.HAA11940@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/3291; it has been noted by GNATS.

From: Dmitrij Tejblum <tejblum@arc.hq.cti.ru>
To: phk@dk.tfs.com
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: misc/3291: md2.h, md4.h, and md5.h headers useless for c++ programms 
Date: Tue, 15 Apr 1997 18:10:51 +0400 (MSD)

 Here is the second version of the patch.
 
 I changed <sys/types.h> to <machines/types.h>. It seems that for now it
 is best way. 
 
 Other improvements:
 
 1. __P added to function prototypes (to keep consistency in FreeBSD
 includes)
 2. filename parameter of MDXFile should be const char*, not char*.
 (Changes to sources and man page also included, of course).
 
 libmd still pass test after this patch :).
 
 	Dima
 
 
 diff -c -r lib/libmd.orig/md2.h lib/libmd/md2.h
 *** lib/libmd.orig/md2.h	Fri Apr  4 00:17:05 1997
 --- lib/libmd/md2.h	Tue Apr 15 17:00:56 1997
 ***************
 *** 30,40 ****
     unsigned char buffer[16];	/* input buffer */
   } MD2_CTX;
   
 ! void   MD2Init(MD2_CTX *);
 ! void   MD2Update(MD2_CTX *, const unsigned char *, unsigned int);
 ! void   MD2Final(unsigned char [16], MD2_CTX *);
 ! char * MD2End(MD2_CTX *, char *);
 ! char * MD2File(char *, char *);
 ! char * MD2Data(const unsigned char *, unsigned int, char *);
   
   #endif /* _MD2_H_ */
 --- 30,44 ----
     unsigned char buffer[16];	/* input buffer */
   } MD2_CTX;
   
 ! #include <sys/cdefs.h>
 ! 
 ! __BEGIN_DECLS
 ! void   MD2Init __P((MD2_CTX *));
 ! void   MD2Update __P((MD2_CTX *, const unsigned char *, unsigned int));
 ! void   MD2Final __P((unsigned char [16], MD2_CTX *));
 ! char * MD2End __P((MD2_CTX *, char *));
 ! char * MD2File __P((const char *, char *));
 ! char * MD2Data __P((const unsigned char *, unsigned int, char *));
 ! __END_DECLS
   
   #endif /* _MD2_H_ */
 diff -c -r lib/libmd.orig/md4.h lib/libmd/md4.h
 *** lib/libmd.orig/md4.h	Fri Apr  4 00:17:05 1997
 --- lib/libmd/md4.h	Tue Apr 15 17:27:52 1997
 ***************
 *** 26,42 ****
   #ifndef _MD4_H_
   #define _MD4_H_
   /* MD4 context. */
   typedef struct MD4Context {
     u_int32_t state[4];	/* state (ABCD) */
     u_int32_t count[2];	/* number of bits, modulo 2^64 (lsb first) */
     unsigned char buffer[64];	/* input buffer */
   } MD4_CTX;
   
 ! void   MD4Init(MD4_CTX *);
 ! void   MD4Update(MD4_CTX *, const unsigned char *, unsigned int);
 ! void   MD4Final(unsigned char [16], MD4_CTX *);
 ! char * MD4End(MD4_CTX *, char *);
 ! char * MD4File(char *, char *);
 ! char * MD4Data(const unsigned char *, unsigned int, char *);
   
   #endif /* _MD4_H_ */
 --- 26,49 ----
   #ifndef _MD4_H_
   #define _MD4_H_
   /* MD4 context. */
 + 
 + #include <machine/types.h>      /* XXX */
 + 
   typedef struct MD4Context {
     u_int32_t state[4];	/* state (ABCD) */
     u_int32_t count[2];	/* number of bits, modulo 2^64 (lsb first) */
     unsigned char buffer[64];	/* input buffer */
   } MD4_CTX;
   
 ! #include <sys/cdefs.h>
 ! 
 ! __BEGIN_DECLS
 ! void   MD4Init __P((MD4_CTX *));
 ! void   MD4Update __P((MD4_CTX *, const unsigned char *, unsigned int));
 ! void   MD4Final __P((unsigned char [16], MD4_CTX *));
 ! char * MD4End __P((MD4_CTX *, char *));
 ! char * MD4File __P((const char *, char *));
 ! char * MD4Data __P((const unsigned char *, unsigned int, char *));
 ! __END_DECLS
   
   #endif /* _MD4_H_ */
 diff -c -r lib/libmd.orig/mdX.3 lib/libmd/mdX.3
 *** lib/libmd.orig/mdX.3	Tue Apr 15 17:18:32 1997
 --- lib/libmd/mdX.3	Tue Apr 15 17:17:40 1997
 ***************
 *** 31,37 ****
   .Ft "char *"
   .Fn MDXEnd "MDX_CTX *context" "char *buf"
   .Ft "char *"
 ! .Fn MDXFile "char *filename" "char *buf"
   .Ft "char *"
   .Fn MDXData "const unsigned char *data" "unsigned int len" "char *buf"
   .Sh DESCRIPTION
 --- 31,37 ----
   .Ft "char *"
   .Fn MDXEnd "MDX_CTX *context" "char *buf"
   .Ft "char *"
 ! .Fn MDXFile "const char *filename" "char *buf"
   .Ft "char *"
   .Fn MDXData "const unsigned char *data" "unsigned int len" "char *buf"
   .Sh DESCRIPTION
 diff -c -r lib/libmd.orig/mdXhl.c lib/libmd/mdXhl.c
 *** lib/libmd.orig/mdXhl.c	Fri Oct 25 10:48:12 1996
 --- lib/libmd/mdXhl.c	Tue Apr 15 17:10:07 1997
 ***************
 *** 41,47 ****
   }
   
   char *
 ! MDXFile (char *filename, char *buf)
   {
       unsigned char buffer[BUFSIZ];
       MDX_CTX ctx;
 --- 41,47 ----
   }
   
   char *
 ! MDXFile (const char *filename, char *buf)
   {
       unsigned char buffer[BUFSIZ];
       MDX_CTX ctx;
 
 
 
 === The next patch is for <sys/md5.h>, not for <md5.h> ====
 
 
 *** sys/sys/md5.h.orig	Sun Dec 22 13:31:34 1996
 --- sys/sys/md5.h	Tue Apr 15 17:46:51 1997
 ***************
 *** 26,31 ****
 --- 26,34 ----
   
   #ifndef _SYS_MD5_H_
   #define _SYS_MD5_H_
 + 
 + #include <machine/types.h>    /* XXX */
 + 
   /* MD5 context. */
   typedef struct MD5Context {
     u_int32_t state[4];	/* state (ABCD) */
 ***************
 *** 33,42 ****
     unsigned char buffer[64];	/* input buffer */
   } MD5_CTX;
   
 ! void   MD5Init (MD5_CTX *);
 ! void   MD5Update (MD5_CTX *, const unsigned char *, unsigned int);
 ! void   MD5Final (unsigned char [16], MD5_CTX *);
 ! char * MD5End(MD5_CTX *, char *);
 ! char * MD5File(char *, char *);
 ! char * MD5Data(const unsigned char *, unsigned int, char *);
   #endif /* _SYS_MD5_H_ */
 --- 36,50 ----
     unsigned char buffer[64];	/* input buffer */
   } MD5_CTX;
   
 ! #include <sys/cdefs.h>
 ! 
 ! __BEGIN_DECLS
 ! void   MD5Init __P((MD5_CTX *));
 ! void   MD5Update __P((MD5_CTX *, const unsigned char *, unsigned int));
 ! void   MD5Final __P((unsigned char [16], MD5_CTX *));
 ! char * MD5End __P((MD5_CTX *, char *));
 ! char * MD5File __P((const char *, char *));
 ! char * MD5Data __P((const unsigned char *, unsigned int, char *));
 ! __END_DECLS
 ! 
   #endif /* _SYS_MD5_H_ */
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704151420.HAA11940>