"Fossies" - the Fresh Open Source Software Archive

Member "mirrordir-0.10.49/diffie/mad.h" (23 Nov 1999, 1779 Bytes) of package /linux/misc/old/mirrordir-0.10.49.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mad.h" see the Fossies "Dox" file reference documentation.

    1 /*   This has nothing to do with cryptography. */
    2 #ifndef __MAD_H
    3 #define __MAD_H
    4 
    5 #ifdef HAVE_MAD
    6 #   define INLINE 
    7 #else
    8 #   ifndef INLINE
    9 #       define INLINE inline
   10 #   endif
   11 #endif
   12 
   13 #ifdef HAVE_MAD
   14 
   15 /* The Memory Allocation Debugging system */
   16 
   17 /* GNU headers define this as macros */
   18 #ifdef malloc
   19 #   undef malloc
   20 #endif
   21 
   22 #ifdef calloc
   23 #   undef calloc
   24 #endif
   25 
   26 #define malloc(x)   mad_alloc (x, __FILE__, __LINE__)
   27 #define calloc(x, y)    mad_alloc (x * y, __FILE__, __LINE__)
   28 #define realloc(x, y)   mad_realloc (x, y, __FILE__, __LINE__)
   29 #define xmalloc(x, y)   mad_alloc (x, __FILE__, __LINE__)
   30 #define strdup(x)   mad_strdup (x, __FILE__, __LINE__)
   31 #define tempnam(x, y)   mad_tempnam (x, y, __FILE__, __LINE__)
   32 #define free(x)     mad_free (x, __FILE__, __LINE__)
   33 
   34 void mad_check (char *file, int line);
   35 void *mad_alloc (int size, char *file, int line);
   36 void *mad_realloc (void *ptr, int newsize, char *file, int line);
   37 char *mad_strdup (const char *s, char *file, int line);
   38 char *mad_tempnam (const char *s, const char *y, char *file, int line);
   39 void mad_free (void *ptr, char *file, int line);
   40 void mad_finalize (char *file, int line);
   41 
   42 #if 0
   43 
   44 #define open(a,b...) mad_open (__FILE__, __LINE__, a, b)
   45 #define creat(a,b) mad_creat (__FILE__, __LINE__, a, b)
   46 #define socket(a,b,c) mad_socket (a,b,c,__FILE__,__LINE__)
   47 #define accept(a,b,c) mad_accept (a,b,c,__FILE__,__LINE__)
   48 
   49 #ifndef _MAD_C
   50 int mad_open (char *file, int line, char *p, int f,...);
   51 #endif
   52 int mad_creat (char *file, int line, char *p, int m);
   53 int mad_socket (int domain, int type, int protocol, char *file, int line);
   54 int mad_accept (int sockfd, void *addr, int *addrlen, char *file, int line);
   55 
   56 #endif
   57 
   58 #else
   59 
   60 #define mad_finalize(x, y)
   61 #define mad_check(file,line)
   62 
   63 #endif /* HAVE_MAD */
   64 
   65 #endif /* __MAD_H */