debug.c

Go to the documentation of this file.
00001 /*
00002  * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
00003  * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
00004  * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
00005  */
00006 
00007 /* $Header$ */
00008 
00009 #include "private.h"
00010 
00011 #ifndef  NDEBUG
00012 
00013 /* If NDEBUG _is_ defined and no debugging should be performed,
00014  * calls to functions in this module are #defined to nothing
00015  * in private.h.
00016  */
00017 
00018 #include <stdio.h>
00019 #include "proto.h"
00020 
00021 void gsm_debug_words P4( (name, from, to, ptr), 
00022    char        * name,
00023    int      from,
00024    int      to,
00025    word     * ptr)
00026 {
00027    int   nprinted = 0;
00028 
00029    fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
00030    while (from <= to) {
00031       fprintf(stderr, "%d ", ptr[ from ] );
00032       from++;
00033       if (nprinted++ >= 7) {
00034          nprinted = 0;
00035          if (from < to) putc('\n', stderr);
00036       }
00037    }
00038    putc('\n', stderr);
00039 }
00040 
00041 void gsm_debug_longwords P4( (name, from, to, ptr),
00042    char        * name,
00043    int      from,
00044    int      to,
00045    longword      * ptr)
00046 {
00047    int   nprinted = 0;
00048 
00049    fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
00050    while (from <= to) {
00051 
00052       fprintf(stderr, "%d ", ptr[ from ] );
00053       from++;
00054       if (nprinted++ >= 7) {
00055          nprinted = 0;
00056          if (from < to) putc('\n', stderr);
00057       }
00058    }
00059    putc('\n', stderr);
00060 }
00061 
00062 void gsm_debug_longword P2(  (name, value),
00063    char     * name,
00064    longword   value  )
00065 {
00066    fprintf(stderr, "%s: %d\n", name, (long)value );
00067 }
00068 
00069 void gsm_debug_word P2(  (name, value),
00070    char  * name,
00071    word    value  )
00072 {
00073    fprintf(stderr, "%s: %d\n", name, (long)value);
00074 }
00075 
00076 #endif

Generated on Thu Apr 16 06:27:32 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6