#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+
+#ifdef YTNEF_H_SUBDIR
+#include <libytnef/tnef-types.h>
+#include <libytnef/ytnef.h>
+#include <libytnef/mapi.h>
+#include <libytnef/mapidefs.h>
+#else
+#include <tnef-types.h>
+#include <ytnef.h>
+#include <mapi.h>
+#include <mapidefs.h>
+#endif
+
#include "common/claws.h"
#include "common/version.h"
#include "main.h"
#include "plugin.h"
#include "procmime.h"
#include "utils.h"
-
-#include <tnef-types.h>
-#include <ytnef.h>
-#include <mapi.h>
-#include <mapidefs.h>
+#include "file-utils.h"
#include "tnef_dump.h"
"Claws Mail TNEF parser:\n\n"
"%s\n"), reason?reason:_("Unknown error"));
- fclose(fp);
+ claws_fclose(fp);
if (g_stat(tmpfilename, &statbuf) < 0) {
claws_unlink(tmpfilename);
procmime_mimeinfo_free_all(&sub_info);
}
}
- if (fwrite(data, 1, size, fp) < size) {
- FILE_OP_ERROR(tmpfilename, "fwrite");
- fclose(fp);
+ if (claws_fwrite(data, 1, size, fp) < size) {
+ FILE_OP_ERROR(tmpfilename, "claws_fwrite");
+ claws_fclose(fp);
claws_unlink(tmpfilename);
procmime_mimeinfo_free_all(&sub_info);
return tnef_broken_mimeinfo(_("Failed to write the part data."));
}
- fclose(fp);
+ claws_fclose(fp);
if (g_stat(tmpfilename, &statbuf) < 0) {
claws_unlink(tmpfilename);
result = SaveVCalendar(fp, tnef);
- fclose(fp);
+ claws_fclose(fp);
if (g_stat(tmpfilename, &statbuf) < 0) {
result = FALSE;
result = SaveVTask(fp, tnef);
- fclose(fp);
+ claws_fclose(fp);
if (g_stat(tmpfilename, &statbuf) < 0) {
result = FALSE;
result = SaveVCard(fp, tnef);
- fclose(fp);
+ claws_fclose(fp);
ret = g_stat(tmpfilename, &statbuf);
if (ret == -1) {
if (mimeinfo->content == MIMECONTENT_FILE)
debug_print("content: %s\n", mimeinfo->data.filename);
else
- debug_print("contents in memory (len %zd)\n",
+ debug_print("contents in memory (len %"G_GSIZE_FORMAT")\n",
strlen(mimeinfo->data.mem));
tnef = g_new0(TNEFStruct, 1);