diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-06 08:58:27 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-06 08:58:27 +0000 |
commit | b61ba851da0157ace3bdfc1ebbf87156b0b76413 (patch) | |
tree | d6c567db57af1eb09c254a8bee13c305282334f8 /protocols/YAMN/mails/test/test.cpp | |
parent | a4c70f6bedb25e5cffb08dfc5cbc2597d1642d6b (diff) |
protocols plugins moved to protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@327 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/YAMN/mails/test/test.cpp')
-rw-r--r-- | protocols/YAMN/mails/test/test.cpp | 42 |
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 |