From: Jan P. <pa...@us...> - 2004-07-13 15:16:47
|
Update of /cvsroot/libexif/libexif/libexif/canon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29889/libexif/canon Modified Files: exif-mnote-data-canon.c Log Message: 2004-07-13 Jan Patera <pa...@us...> * libexif/exif-mnote-*.*: added exif_mnote_data_get_id() returning actual mnote entry tag ID (suggested by Serge Droz <ser...@ps...>) Index: exif-mnote-data-canon.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/canon/exif-mnote-data-canon.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- exif-mnote-data-canon.c 7 Jan 2004 14:53:04 -0000 1.5 +++ exif-mnote-data-canon.c 13 Jul 2004 15:16:37 -0000 1.6 @@ -244,6 +244,16 @@ return n ? ((ExifMnoteDataCanon *) n)->count : 0; } +static unsigned int +exif_mnote_data_canon_get_id (ExifMnoteData *d, unsigned int n) +{ + ExifMnoteDataCanon *note = (ExifMnoteDataCanon *) d; + + if (!note) return 0; + if (note->count <= n) return 0; + return note->entries[n].tag; +} + static const char * exif_mnote_data_canon_get_name (ExifMnoteData *note, unsigned int i) { @@ -278,9 +288,8 @@ { ExifMnoteData *d; - d = malloc (sizeof (ExifMnoteDataCanon)); + d = calloc (1, sizeof (ExifMnoteDataCanon)); if (!d) return NULL; - memset (d, 0, sizeof (ExifMnoteDataCanon)); exif_mnote_data_construct (d); @@ -291,6 +300,7 @@ d->methods.load = exif_mnote_data_canon_load; d->methods.save = exif_mnote_data_canon_save; d->methods.count = exif_mnote_data_canon_count; + d->methods.get_id = exif_mnote_data_canon_get_id; d->methods.get_name = exif_mnote_data_canon_get_name; d->methods.get_title = exif_mnote_data_canon_get_title; d->methods.get_description = exif_mnote_data_canon_get_description; |