exif-content.c File Reference

#include <config.h>
#include <libexif/exif-content.h>
#include <libexif/exif-system.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  _ExifContentPrivate

Functions

ExifContentexif_content_new (void)
ExifContentexif_content_new_mem (ExifMem *mem)
void exif_content_ref (ExifContent *content)
void exif_content_unref (ExifContent *content)
void exif_content_free (ExifContent *content)
void exif_content_dump (ExifContent *content, unsigned int indent)
 Dump contents of the IFD to stdout.
void exif_content_add_entry (ExifContent *c, ExifEntry *entry)
 Add an EXIF tag to an IFD.
void exif_content_remove_entry (ExifContent *c, ExifEntry *e)
 Remove an EXIF tag from an IFD.
ExifEntryexif_content_get_entry (ExifContent *content, ExifTag tag)
 Return the ExifEntry in this IFD corresponding to the given tag.
void exif_content_foreach_entry (ExifContent *content, ExifContentForeachEntryFunc func, void *data)
 Executes function on each EXIF tag in this IFD in turn.
void exif_content_log (ExifContent *content, ExifLog *log)
 Set the log message object for this IFD.
ExifIfd exif_content_get_ifd (ExifContent *c)
 Return the IFD number in which the given ExifContent is found.
static void fix_func (ExifEntry *e, void *UNUSED(data))
static void remove_not_recorded (ExifEntry *e, void *UNUSED(data))
 Check if this entry is unknown and if so, delete it.
void exif_content_fix (ExifContent *c)
 Fix the IFD to bring it into specification.


Function Documentation

void exif_content_add_entry ( ExifContent c,
ExifEntry entry 
)

Add an EXIF tag to an IFD.

If this tag already exists in the IFD, this function does nothing.

Precondition:
The "tag" member of the entry must be set on entry.
Parameters:
[out] c IFD
[in] entry EXIF entry to add

Definition at line 133 of file exif-content.c.

Referenced by exif_content_fix(), exif_data_load_data_content(), and main().

void exif_content_dump ( ExifContent content,
unsigned int  indent 
)

Dump contents of the IFD to stdout.

This is intended for diagnostic purposes only.

Parameters:
[in] content IFD data
[in] indent how many levels deep to indent the data

Definition at line 114 of file exif-content.c.

Referenced by exif_data_dump().

void exif_content_fix ( ExifContent c  ) 

Fix the IFD to bring it into specification.

Call exif_entry_fix on each entry in this IFD to fix existing entries, create any new entries that are mandatory in this IFD but do not yet exist, and remove any entries that are not allowed in this IFD.

Parameters:
[in,out] c EXIF content for an IFD

Definition at line 278 of file exif-content.c.

Referenced by fix_func().

void exif_content_foreach_entry ( ExifContent content,
ExifContentForeachEntryFunc  func,
void *  user_data 
)

Executes function on each EXIF tag in this IFD in turn.

The tags will not necessarily be visited in numerical order.

Parameters:
[in,out] content IFD over which to iterate
[in] func function to call for each entry
[in] user_data data to pass into func on each call

Definition at line 210 of file exif-content.c.

Referenced by content_set_byte_order(), data_foreach_func(), and exif_content_fix().

void exif_content_free ( ExifContent content  ) 

Definition at line 93 of file exif-content.c.

Referenced by exif_content_unref().

ExifEntry* exif_content_get_entry ( ExifContent content,
ExifTag  tag 
)

Return the ExifEntry in this IFD corresponding to the given tag.

This is a pointer into a member of the ExifContent array and must NOT be freed or unrefed by the caller.

Parameters:
[in] content EXIF content for an IFD
[in] tag EXIF tag to return
Returns:
ExifEntry of the tag, or NULL on error

Definition at line 196 of file exif-content.c.

Referenced by exif_content_add_entry(), exif_content_fix(), and exif_entry_get_value().

ExifIfd exif_content_get_ifd ( ExifContent c  ) 

Return the IFD number in which the given ExifContent is found.

Parameters:
[in] c an ExifContent*
Returns:
IFD number, or EXIF_IFD_COUNT on error

Definition at line 234 of file exif-content.c.

Referenced by data_foreach_func(), exif_content_fix(), and fix_func().

void exif_content_log ( ExifContent content,
ExifLog log 
)

Set the log message object for this IFD.

Parameters:
[in] content IFD
[in] log ExifLog*

Definition at line 223 of file exif-content.c.

Referenced by exif_data_log().

ExifContent* exif_content_new ( void   ) 

Definition at line 43 of file exif-content.c.

ExifContent* exif_content_new_mem ( ExifMem mem  ) 

Definition at line 54 of file exif-content.c.

Referenced by exif_content_new(), and exif_data_new_mem().

void exif_content_ref ( ExifContent content  ) 

Definition at line 79 of file exif-content.c.

void exif_content_remove_entry ( ExifContent c,
ExifEntry e 
)

Remove an EXIF tag from an IFD.

If this tag does not exist in the IFD, this function does nothing.

Parameters:
[out] c IFD
[in] e EXIF entry to remove

Definition at line 157 of file exif-content.c.

Referenced by fix_func(), and remove_not_recorded().

void exif_content_unref ( ExifContent content  ) 

Definition at line 85 of file exif-content.c.

Referenced by exif_data_free().

static void fix_func ( ExifEntry e,
void *  UNUSED(data) 
) [static]

Definition at line 248 of file exif-content.c.

References exif_entry_fix().

Referenced by exif_content_fix(), and exif_data_fix().

static void remove_not_recorded ( ExifEntry e,
void *  UNUSED(data) 
) [static]

Check if this entry is unknown and if so, delete it.

Note:
Be careful calling this function in a loop. Deleting an entry from an ExifContent changes the index of subsequent entries, as well as the total size of the entries array.

Definition at line 260 of file exif-content.c.

References exif_content_remove_entry(), exif_data_get_data_type(), exif_entry_get_ifd, exif_ifd_get_name(), exif_log(), EXIF_LOG_CODE_DEBUG, EXIF_SUPPORT_LEVEL_NOT_RECORDED, exif_tag_get_support_level_in_ifd(), ifd, _ExifContentPrivate::log, _ExifContent::parent, _ExifEntry::parent, _ExifContent::priv, and _ExifEntry::tag.

Referenced by exif_content_fix().


SourceForge.net Logo Generated by doxygen