.TH "util.c" 3 "Version 1.1.21" "libmtp" \" -*- nroff -*- .ad l .nh .SH NAME libmtp \- .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include 'config\&.h'\fP .br \fC#include 'libmtp\&.h'\fP .br \fC#include 'util\&.h'\fP .br .SS "Functions" .in +1c .ti -1c .RI "void \fBdevice_unknown\fP (const int dev_number, const int id_vendor, const int id_product)" .br .ti -1c .RI "void \fBdata_dump\fP (FILE *f, void *buf, uint32_t n)" .br .ti -1c .RI "void \fBdata_dump_ascii\fP (FILE *f, void *buf, uint32_t n, uint32_t dump_boundry)" .br .ti -1c .RI "char * \fBstrndup\fP (const char *s, size_t n)" .br .in -1c .SH "Detailed Description" .PP This file contains generic utility functions such as can be used for debugging for example\&. .PP Copyright (C) 2005-2007 Linus Walleij triad@df.lth.se .PP This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version\&. .PP This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\&. See the GNU Lesser General Public License for more details\&. .PP You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc\&., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\&. .SH "Function Documentation" .PP .SS "void data_dump (FILE * f, void * buf, uint32_t n)" This dumps out a number of bytes to a textual, hexadecimal dump\&. .PP \fBParameters\fP .RS 4 \fIf\fP the file to dump to (e\&.g\&. stdout or stderr) .br \fIbuf\fP a pointer to the buffer containing the bytes to be dumped out in hex .br \fIn\fP the number of bytes to dump from this buffer .RE .PP .SS "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\&. .PP \fBParameters\fP .RS 4 \fIf\fP the file to dump to (e\&.g\&. stdout or stderr) .br \fIbuf\fP a pointer to the buffer containing the bytes to be dumped out in hex .br \fIn\fP the number of bytes to dump from this buffer .br \fIdump_boundry\fP the address offset to start at (usually 0) .RE .PP .SS "void device_unknown (const int dev_number, const int id_vendor, const int id_product)" This prints to stdout info about device being UNKNOWN, its ids, and libmtp's version number\&. .PP \fBParameters\fP .RS 4 \fIdev_number\fP the device number .br \fIid_vendor\fP vendor ID from the usb_device_desc struct .br \fIid_product\fP product ID from the usb_device_desc struct .RE .PP .PP Referenced by \fBLIBMTP_Detect_Raw_Devices()\fP, and \fBLIBMTP_Detect_Raw_Devices()\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libmtp from the source code\&.