util.c File Reference

#include <sys/time.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "libmtp.h"
#include "util.h"

Functions

void data_dump (FILE *f, void *buf, uint32_t n)
void data_dump_ascii (FILE *f, void *buf, uint32_t n, uint32_t dump_boundry)

Detailed Description

This file contains generic utility functions such as can be used for debugging for example.

Function Documentation

void data_dump ( FILE *  f,
void *  buf,
uint32_t  n 
)

This dumps out a number of bytes to a textual, hexadecimal dump.

Parameters:
f the file to dump to (e.g. stdout or stderr)
buf a pointer to the buffer containing the bytes to be dumped out in hex
n the number of bytes to dump from this buffer

void data_dump_ascii ( FILE *  f,
void *  buf,
uint32_t  n,
uint32_t  dump_boundry 
)

This dumps out a number of bytes to a textual, hexadecimal dump, and also prints out the string ASCII representation for each line of bytes. It will also print the memory address offset from a certain boundry.

Parameters:
f the file to dump to (e.g. stdout or stderr)
buf a pointer to the buffer containing the bytes to be dumped out in hex
n the number of bytes to dump from this buffer
dump_boundry the address offset to start at (usually 0)


Generated on Tue Sep 12 03:22:55 2006 for libmtp by  doxygen 1.4.7