EXIF library (libexif) Internals  0.6.24
test-parse-from-data.c File Reference

Completely parse all files given on the command line. More...

#include "libexif/exif-data.h"
#include "libexif/exif-system.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
Include dependency graph for test-parse-from-data.c:

Go to the source code of this file.

Typedefs

typedef void(* test_parse_func) (const char *filename, void *callback_data, int swap)
 

Functions

static void content_foreach_func (ExifEntry *entry, void *UNUSED(callback_data))
 
static void data_foreach_func (ExifContent *content, void *callback_data)
 
static void dump_makernote (ExifData *d)
 
static void test_parse (const char *filename, void *callback_data, int swap)
 
static void split_ws_string (const char *string, test_parse_func func, void *callback_data)
 
int main (const int argc, const char *argv[])
 

Variables

static unsigned entry_count
 

Detailed Description

Completely parse all files given on the command line.

Copyright (C) 2007 Hans Ulrich Niedermann gp@n-.nosp@m.dime.nosp@m.nsion.nosp@m.al.d.nosp@m.e

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.

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.

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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file test-parse-from-data.c.

Typedef Documentation

◆ test_parse_func

typedef void(* test_parse_func) (const char *filename, void *callback_data, int swap)

Callback function prototype for string parsing.

Definition at line 154 of file test-parse-from-data.c.

Function Documentation

◆ content_foreach_func()

static void content_foreach_func ( ExifEntry entry,
void *  UNUSEDcallback_data 
)
static

Callback function handling an ExifEntry.

Definition at line 37 of file test-parse-from-data.c.

References _ExifEntry::components, entry_count, exif_entry_get_value(), exif_format_get_name(), exif_tag_get_name(), _ExifEntry::format, _ExifEntry::size, and _ExifEntry::tag.

Referenced by data_foreach_func().

Here is the call graph for this function:

◆ data_foreach_func()

static void data_foreach_func ( ExifContent content,
void *  callback_data 
)
static

Callback function handling an ExifContent (corresponds 1:1 to an IFD).

Definition at line 55 of file test-parse-from-data.c.

References content_foreach_func(), entry_count, exif_content_foreach_entry(), and exif_content_get_ifd().

Referenced by test_parse().

Here is the call graph for this function:

◆ dump_makernote()

static void dump_makernote ( ExifData d)
static

Definition at line 64 of file test-parse-from-data.c.

References exif_data_get_mnote_data(), exif_mnote_data_count(), exif_mnote_data_get_id(), exif_mnote_data_get_name(), exif_mnote_data_get_value(), and name.

Referenced by test_parse().

Here is the call graph for this function:

◆ main()

int main ( const int  argc,
const char *  argv[] 
)

Main program.

Definition at line 188 of file test-parse-from-data.c.

References split_ws_string(), and test_parse().

Here is the call graph for this function:

◆ split_ws_string()

static void split_ws_string ( const char *  string,
test_parse_func  func,
void *  callback_data 
)
static

Split string at whitespace and call callback with each substring.

Definition at line 158 of file test-parse-from-data.c.

References string.

Referenced by main().

◆ test_parse()

static void test_parse ( const char *  filename,
void *  callback_data,
int  swap 
)
static

Run EXIF parsing test on the given file.

Definition at line 86 of file test-parse-from-data.c.

References data_foreach_func(), dump_makernote(), exif_byte_order_get_name(), EXIF_BYTE_ORDER_INTEL, EXIF_BYTE_ORDER_MOTOROLA, exif_data_foreach_content(), exif_data_get_byte_order(), exif_data_new_from_data(), exif_data_new_from_file(), exif_data_set_byte_order(), and exif_data_unref().

Referenced by main().

Here is the call graph for this function:

Variable Documentation

◆ entry_count

unsigned entry_count
static

Definition at line 34 of file test-parse-from-data.c.

Referenced by content_foreach_func(), and data_foreach_func().


libexif Generated by doxygen