summaryrefslogtreecommitdiff
path: root/protocols/YAMN/mails/test/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/YAMN/mails/test/test.cpp')
-rw-r--r--protocols/YAMN/mails/test/test.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/protocols/YAMN/mails/test/test.cpp b/protocols/YAMN/mails/test/test.cpp
new file mode 100644
index 0000000000..f8dcd14e89
--- /dev/null
+++ b/protocols/YAMN/mails/test/test.cpp
@@ -0,0 +1,42 @@
+/*
+ * This file is for testing purposes. Save in header.txt your problem header and you can
+ * browse through functions to get result
+ *
+ * (c) majvan 2002-2004
+ */
+
+#include <stdio.h>
+#include "../m_mails.h"
+
+extern void WINAPI TranslateHeaderFcn(char *stream,int len,struct CMimeItem **head);
+extern void ExtractHeader(struct CMimeItem *items,int CP,struct CHeader *head);
+
+void main()
+{
+ char Buffer[8192]; //we do not suppose longer header
+ FILE *fp;
+ YAMNMAIL *Mail;
+ PMAILDATA *MailData;
+ CMimeItem *head;
+
+ struct CHeader ExtractedHeader;
+
+ if(NULL==(fp=fopen("header2.txt","r")))
+ return;
+ fread(Buffer,sizeof(Buffer),1,fp);
+ if(ferror(fp))
+ {
+ fclose(fp);
+ return;
+ }
+ fclose(fp);
+ Mail = new YAMNMAIL;
+ MailData = new PMAILDATA;
+ head = new CMimeItem;
+ Mail->MailData = *MailData;
+ Mail->MailData->TranslatedHeader = head;
+
+ TranslateHeaderFcn(Buffer,strlen(Buffer), &Mail->MailData->TranslatedHeader);
+ ExtractHeader(Mail->MailData->TranslatedHeader,CP_ACP,&ExtractedHeader);
+ return;
+} \ No newline at end of file