41 fprintf( stderr,
"test-fuzzer: code=%d domain=%s ",
code, domain);
42 vfprintf (stderr,
format, args);
43 fprintf (stderr,
"\n");
54 buf[
sizeof(buf)-1] = 0;
55 buf[
sizeof(buf)-2] = 0;
59 if (buf[
sizeof(buf)-2] != 0) abort();
77 fprintf (stdout,
"Byte order: %s\n",
82 fprintf (stderr,
"Could not parse maker note!\n");
90 for (i = 0; i < c; i++) {
105 static void test_parse(
const char *filename,
void *callback_data)
109 unsigned int buf_size;
140 if (-1 == stat(filename,&stbuf))
142 f = fopen(filename,
"r");
145 buf = malloc(stbuf.st_size);
146 fread (buf, stbuf.st_size, 1, f);
161 int main(
const int argc,
const char *argv[])
164 void *callback_data = NULL;
165 for (i=1; i<argc; i++) {
const char * exif_byte_order_get_name(ExifByteOrder order)
Return a short, localized, textual name for the given byte order.
@ EXIF_BYTE_ORDER_INTEL
Little-endian byte order.
ExifIfd exif_content_get_ifd(ExifContent *c)
Return the IFD number in which the given ExifContent is found.
void exif_content_foreach_entry(ExifContent *content, ExifContentForeachEntryFunc func, void *data)
Executes function on each EXIF tag in this IFD in turn.
void exif_data_set_byte_order(ExifData *data, ExifByteOrder order)
Set the byte order to use for this EXIF data.
void exif_data_unref(ExifData *data)
ExifByteOrder exif_data_get_byte_order(ExifData *data)
Return the byte order in use by this EXIF structure.
ExifMnoteData * exif_data_get_mnote_data(ExifData *d)
Return the MakerNote data out of the EXIF data.
ExifData * exif_data_new_from_file(const char *path)
Allocate a new ExifData and load EXIF data from a JPEG file.
void exif_data_save_data(ExifData *data, unsigned char **d, unsigned int *ds)
Store raw EXIF data representing the ExifData structure into a memory buffer.
void exif_data_foreach_content(ExifData *data, ExifDataForeachContentFunc func, void *user_data)
Execute a function on each IFD in turn.
void exif_data_log(ExifData *data, ExifLog *log)
Set the log message object for all IFDs.
Defines the ExifData type and the associated functions.
const char * exif_entry_get_value(ExifEntry *e, char *val, unsigned int maxlen)
Return a localized textual representation of the value of the EXIF entry.
ExifLoader * exif_loader_new(void)
Allocate a new ExifLoader.
void exif_loader_unref(ExifLoader *loader)
Decrease the refcount of the ExifLoader.
ExifData * exif_loader_get_data(ExifLoader *loader)
Create an ExifData from the data in the loader.
unsigned char exif_loader_write(ExifLoader *eld, unsigned char *buf, unsigned int len)
Load a buffer into the ExifLoader from a memory buffer.
Defines the ExifLoader type.
void exif_log_set_func(ExifLog *log, ExifLogFunc func, void *data)
Register log callback function.
ExifLog * exif_log_new(void)
Create a new logging instance.
void exif_mnote_data_ref(ExifMnoteData *d)
char * exif_mnote_data_get_value(ExifMnoteData *d, unsigned int n, char *val, unsigned int maxlen)
Return a textual representation of the value of the MakerNote entry.
const char * exif_mnote_data_get_name(ExifMnoteData *d, unsigned int n)
Returns textual name of the given MakerNote tag.
const char * exif_mnote_data_get_description(ExifMnoteData *d, unsigned int n)
Returns verbose textual description of the given MakerNote tag.
const char * exif_mnote_data_get_title(ExifMnoteData *d, unsigned int n)
Returns textual title of the given MakerNote tag.
unsigned int exif_mnote_data_count(ExifMnoteData *d)
Return the number of tags in the MakerNote.
void exif_mnote_data_unref(ExifMnoteData *d)
System specific definitions, not for installation!
const char * exif_tag_get_name(ExifTag tag)
Represents the entire EXIF data found in an image.
Data found in one EXIF tag.
ExifFormat format
Type of data in this entry.
ExifTag tag
EXIF tag for this entry.
void data_foreach_func(ExifContent *content, void *callback_data)
static int test_exif_data(ExifData *d)
int main(const int argc, const char *argv[])
static void test_parse(const char *filename, void *callback_data)
void content_foreach_func(ExifEntry *entry, void *callback_data)
Completely parse all files given on the command line.