/*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 The Geeqie Team
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
*
- * Authors:
- * Original version 2005 Lars Ellenberg, base on dcraw by David coffin.
+ * Author: Lars Ellenberg
*
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
const gchar *extension;
FormatRawMatchType magic_type;
const guint magic_offset;
- const void *magic_pattern;
+ gconstpointer magic_pattern;
const guint magic_length;
const FormatRawExifType exif_type;
FormatRawExifParseFunc exif_func;
typedef struct _FormatExifEntry FormatExifEntry;
struct _FormatExifEntry {
FormatExifMatchType header_type;
- const void *header_pattern;
+ gconstpointer header_pattern;
const guint header_length;
const gchar *description;
FormatExifParseFunc func_parse;
guint i;
if (len < offset + 2) return 0;
- if (type < 0 || type > EXIF_FORMAT_COUNT) return 0;
+ if (type > EXIF_FORMAT_COUNT) return 0;
count = exif_byte_get_int16(data + offset, bo);
offset += 2;
return exif_byte_get_int32(data + offset + count * 12, bo);
}
-static gint format_tiff_find_tag_data(guchar *data, const guint len,
- guint tag, ExifFormatType type,
- guint *result_offset, guint *result_count)
+static gboolean format_tiff_find_tag_data(guchar *data, const guint len,
+ guint tag, ExifFormatType type,
+ guint *result_offset, guint *result_count)
{
ExifByteOrder bo;
guint offset;
static FormatRawEntry *format_raw_find(guchar *data, const guint len)
{
gint n;
- gint tiff;
+ gboolean tiff;
guint make_count = 0;
guint make_offset = 0;
return NULL;
}
-static gint format_raw_parse(FormatRawEntry *entry,
- guchar *data, const guint len,
- guint *image_offset, guint *exif_offset)
+static gboolean format_raw_parse(FormatRawEntry *entry,
+ guchar *data, const guint len,
+ guint *image_offset, guint *exif_offset)
{
guint io = 0;
guint eo = 0;
- gint found;
+ gboolean found;
if (!entry || !entry->func_parse) return FALSE;
return TRUE;
}
-gint format_raw_img_exif_offsets(guchar *data, const guint len,
- guint *image_offset, guint *exif_offset)
+gboolean format_raw_img_exif_offsets(guchar *data, const guint len,
+ guint *image_offset, guint *exif_offset)
{
FormatRawEntry *entry;
}
-gint format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
- guchar *header_data, const guint header_len,
- guint *image_offset, guint *exif_offset)
+gboolean format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
+ guchar *header_data, const guint header_len,
+ guint *image_offset, guint *exif_offset)
{
FormatRawEntry *entry;
- void *map_data = NULL;
+ gpointer map_data = NULL;
size_t map_len = 0;
struct stat st;
- gint success;
+ gboolean success;
if (!header_data || fd < 0) return FALSE;
if (path)
{
const gchar *ext;
- gint match = FALSE;
+ gboolean match = FALSE;
gint i;
ext = strrchr(path, '.');
while (!match && format_raw_list[i].magic_pattern)
{
if (format_raw_list[i].extension &&
- strcasecmp(format_raw_list[i].extension, ext) == 0)
+ g_ascii_strcasecmp(format_raw_list[i].extension, ext) == 0)
{
match = TRUE;
}
return FALSE;
}
-gint format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset,
- guint size, ExifByteOrder bo)
+gboolean format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset,
+ guint size, ExifByteOrder bo)
{
FormatExifEntry *entry;
return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
}
-gint format_debug_tiff_raw(guchar *data, const guint len,
- guint *image_offset, guint *exif_offset)
+gboolean format_debug_tiff_raw(guchar *data, const guint len,
+ guint *image_offset, guint *exif_offset)
{
ExifByteOrder bo;
gint level;
#endif
/* not HAVE_EXIV2 */
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */