"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/plugins/ole2_extractor.c" between
libextractor-1.7.tar.gz and libextractor-1.8.tar.gz

About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.

ole2_extractor.c  (libextractor-1.7):ole2_extractor.c  (libextractor-1.8)
skipping to change at line 219 skipping to change at line 219
{ {
contents = strdup (g_value_get_string (gval)); contents = strdup (g_value_get_string (gval));
} }
else else
{ {
/* convert other formats? */ /* convert other formats? */
contents = g_strdup_value_contents (gval); contents = g_strdup_value_contents (gval);
} }
if (NULL == contents) if (NULL == contents)
return; return;
if (0 == strcmp (type, "meta:generator")) if (0 == strcmp (type,
"meta:generator"))
{ {
const char *mimetype = "application/vnd.ms-files"; const char *mimetype = "application/vnd.ms-files";
if ( (0 == strncmp (value, "Microsoft Word", 14)) || struct {
(0 == strncmp (value, "Microsoft Office Word", 21))) const char *v;
mimetype = "application/msword"; const char *m;
else if ( (0 == strncmp(value, "Microsoft Excel", 15)) || } mm[] = {
(0 == strncmp(value, "Microsoft Office Excel", 22)) ) { "Microsoft Word", "application/msword" },
mimetype = "application/vnd.ms-excel"; { "Microsoft Office Word", "application/msword" },
else if ( (0 == strncmp(value, "Microsoft PowerPoint", 20)) || { "Microsoft Excel", "application/vnd.ms-excel" },
(0 == strncmp(value, "Microsoft Office PowerPoint", 27)) ) { "Microsoft Office Excel", "application/vnd.ms-excel" },
mimetype = "application/vnd.ms-powerpoint"; { "Microsoft PowerPoint", "application/vnd.ms-powerpoint" },
else if (0 == strncmp(value, "Microsoft Project", 17)) { "Microsoft Office PowerPoint", "application/vnd.ms-powerpoint"},
mimetype = "application/vnd.ms-project"; { "Microsoft Project", "application/vnd.ms-project" },
else if (0 == strncmp(value, "Microsoft Visio", 15)) { "Microsoft Visio", "application/vnd.visio" },
mimetype = "application/vnd.visio"; { "Microsoft Office", "application/vnd.ms-office" },
else if (0 == strncmp(value, "Microsoft Office", 16)) { NULL, NULL }
mimetype = "application/vnd.ms-office"; };
int i;
for (i=0;NULL != mm[i].v; i++)
if (0 == strncmp (value,
mm[i].v,
strlen (mm[i].v) + 1))
{
mimetype = mm[i].m;
break;
}
if (0 != add_metadata (pc->proc, if (0 != add_metadata (pc->proc,
pc->proc_cls, pc->proc_cls,
mimetype, mimetype,
EXTRACTOR_METATYPE_MIMETYPE)) EXTRACTOR_METATYPE_MIMETYPE))
{ {
free (contents); free (contents);
pc->ret = 1; pc->ret = 1;
return; return;
} }
} }
 End of changes. 2 change blocks. 
16 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)