]> code.citadel.org Git - citadel.git/blobdiff - webcit/mime_parser.h
* Brought over yet another new version of the MIME parser from Citadel
[citadel.git] / webcit / mime_parser.h
index 579e01a029ecd1ac732efafcd02f453ff0f65ec0..9464f01fae32802f2c5839328204db87260f6f75 100644 (file)
@@ -1,35 +1,69 @@
+/*
+ * $Id$
+ *
+ */
+
+/*
+ * Here's a bunch of stupid magic to make the MIME parser portable between
+ * Citadel and WebCit.
+ */
+#ifndef SIZ
+#define SIZ    4096
+#endif
+
+#ifndef mallok
+#define mallok(x) malloc(x)
+#endif
+
+#ifndef phree
+#define phree(x) free(x)
+#endif
+
+#ifndef reallok
+#define reallok(x,y) realloc(x,y)
+#endif
+
+#ifndef strdoop
+#define strdoop(x) strdup(x)
+#endif
+
+/* 
+ * Declarations for functions in the parser
+ */
+
 void extract_key(char *target, char *source, char *key);
 
-void do_something_with_it(char *content,
-               int length,
-               char *content_type,
-               char *content_disposition,
+void mime_parser(char *content_start, char *content_end,
                void (*CallBack)
                        (char *cbname,
                        char *cbfilename,
-                       char *cbencoding,
+                       char *cbpartnum,
+                       char *cbdisp,
                        void *cbcontent,
-                       size_t cblength)
-               );
-
-void handle_part(char *content,
-               int part_length,
-               char *supplied_content_type,
-               void (*CallBack)
+                       char *cbtype,
+                       size_t cblength,
+                       char *cbencoding,
+                       void *cbuserdata),
+               void (*PreMultiPartCallBack)
                        (char *cbname,
                        char *cbfilename,
-                       char *cbencoding,
+                       char *cbpartnum,
+                       char *cbdisp,
                        void *cbcontent,
-                       size_t cblength)
-               );
-
-void mime_parser(char *content,
-               int ContentLength,
-               char *ContentType,
-               void (*CallBack)
+                       char *cbtype,
+                       size_t cblength,
+                       char *cbencoding,
+                       void *cbuserdata),
+               void (*PostMultiPartCallBack)
                        (char *cbname,
                        char *cbfilename,
-                       char *cbencoding,
+                       char *cbpartnum,
+                       char *cbdisp,
                        void *cbcontent,
-                       size_t cblength)
+                       char *cbtype,
+                       size_t cblength,
+                       char *cbencoding,
+                       void *cbuserdata),
+               void *userdata,
+               int dont_decode
                );