diff options
Diffstat (limited to 'c/src/libmisc/dumpbuf')
-rw-r--r-- | c/src/libmisc/dumpbuf/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/libmisc/dumpbuf/Makefile.am | 42 | ||||
-rw-r--r-- | c/src/libmisc/dumpbuf/dumpbuf.c | 75 | ||||
-rw-r--r-- | c/src/libmisc/dumpbuf/dumpbuf.h | 21 |
4 files changed, 0 insertions, 140 deletions
diff --git a/c/src/libmisc/dumpbuf/.cvsignore b/c/src/libmisc/dumpbuf/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/libmisc/dumpbuf/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/libmisc/dumpbuf/Makefile.am b/c/src/libmisc/dumpbuf/Makefile.am deleted file mode 100644 index a87d1c5689..0000000000 --- a/c/src/libmisc/dumpbuf/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -include_rtemsdir = $(includedir)/rtems - -LIBNAME = libdumpbuf-tmp -LIB = $(ARCH)/$(LIBNAME).a - -C_FILES = dumpbuf.c -C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) - -include_rtems_HEADERS = dumpbuf.h - -OBJS = $(C_O_FILES) - -include $(top_srcdir)/../../../automake/compile.am -include $(top_srcdir)/../../../automake/lib.am - -$(PROJECT_INCLUDE)/rtems: - @$(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/rtems/%.h: %.h - $(INSTALL_DATA) $< $@ - -# -# (OPTIONAL) Add local stuff here using += -# - -$(LIB): $(OBJS) - $(make-library) - -PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \ - $(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%) - -all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB) - -.PRECIOUS: $(LIB) - -EXTRA_DIST = dumpbuf.c - -include $(top_srcdir)/../../../automake/local.am diff --git a/c/src/libmisc/dumpbuf/dumpbuf.c b/c/src/libmisc/dumpbuf/dumpbuf.c deleted file mode 100644 index 1e41f52bbf..0000000000 --- a/c/src/libmisc/dumpbuf/dumpbuf.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * COPYRIGHT (c) 1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <rtems/dumpbuf.h> - -/* - * Put the body below Dump_Buffer so it won't get inlined. - */ - -static inline void Dump_Line( - unsigned char *buffer, - int length -); - -void Dump_Buffer( - unsigned char *buffer, - int length -) -{ - - int i, mod, max; - - if ( !length ) return; - - mod = length % 16; - - max = length - mod; - - for ( i=0 ; i<max ; i+=16 ) - Dump_Line( &buffer[ i ], 16 ); - - if ( mod ) - Dump_Line( &buffer[ max ], mod ); -} - -static inline void Dump_Line( - unsigned char *buffer, - int length -) -{ - - int i; - char line_buffer[120]; - - line_buffer[0] = '\0'; - - for( i=0 ; i<length ; i++ ) - sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] ); - - for( ; i<16 ; i++ ) - strcat( line_buffer, " " ); - - strcat( line_buffer, "|" ); - for( i=0 ; i<length ; i++ ) - sprintf( line_buffer, "%s%c", line_buffer, - isprint( buffer[ i ] ) ? buffer[ i ] : '.' ); - - for( ; i<16 ; i++ ) - strcat( line_buffer, " " ); - - strcat( line_buffer, "|\n" ); - - printf( line_buffer ); -} diff --git a/c/src/libmisc/dumpbuf/dumpbuf.h b/c/src/libmisc/dumpbuf/dumpbuf.h deleted file mode 100644 index 3af196e8d1..0000000000 --- a/c/src/libmisc/dumpbuf/dumpbuf.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * COPYRIGHT (c) 1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __DUMP_BUFFER_h -#define __DUMP_BUFFER_h - -void Dump_Buffer( - unsigned char *buffer, - int length -); - -#endif -/* end of include file */ |