[asterisk-commits] russell: branch group/http_mods r60321 - /team/group/http_mods/main/minimime/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Apr 5 14:53:13 MST 2007


Author: russell
Date: Thu Apr  5 16:53:13 2007
New Revision: 60321

URL: http://svn.digium.com/view/asterisk?view=rev&rev=60321
Log:
Add another API call to parse from a file pointer

Modified:
    team/group/http_mods/main/minimime/minimime.c
    team/group/http_mods/main/minimime/mm.h
    team/group/http_mods/main/minimime/mm_parse.c

Modified: team/group/http_mods/main/minimime/minimime.c
URL: http://svn.digium.com/view/asterisk/team/group/http_mods/main/minimime/minimime.c?view=diff&rev=60321&r1=60320&r2=60321
==============================================================================
--- team/group/http_mods/main/minimime/minimime.c (original)
+++ team/group/http_mods/main/minimime/minimime.c Thu Apr  5 16:53:13 2007
@@ -58,7 +58,7 @@
 {
 	MM_CTX *ctx;
 	struct mm_mimeheader *header, *lastheader;
-	struct mm_warning *warning, *lastwarning;
+	struct mm_warning *lastwarning;
 	struct mm_mimepart *part;
 	struct mm_content *ct;
 	int parts, i;

Modified: team/group/http_mods/main/minimime/mm.h
URL: http://svn.digium.com/view/asterisk/team/group/http_mods/main/minimime/mm.h?view=diff&rev=60321&r1=60320&r2=60321
==============================================================================
--- team/group/http_mods/main/minimime/mm.h (original)
+++ team/group/http_mods/main/minimime/mm.h Thu Apr  5 16:53:13 2007
@@ -261,6 +261,7 @@
 
 int mm_parse_mem(MM_CTX *, const char *, int, int);
 int mm_parse_file(MM_CTX *, const char *, int, int);
+int mm_parse_fileptr(MM_CTX *, FILE *, int, int);
 
 MM_CTX *mm_context_new(void);
 void mm_context_free(MM_CTX *);

Modified: team/group/http_mods/main/minimime/mm_parse.c
URL: http://svn.digium.com/view/asterisk/team/group/http_mods/main/minimime/mm_parse.c?view=diff&rev=60321&r1=60320&r2=60321
==============================================================================
--- team/group/http_mods/main/minimime/mm_parse.c (original)
+++ team/group/http_mods/main/minimime/mm_parse.c Thu Apr  5 16:53:13 2007
@@ -156,3 +156,26 @@
 	fclose(fp);
 	return res;
 }
+
+int
+mm_parse_fileptr(MM_CTX *ctx, FILE *f, int parsemode, int flags)
+{
+	int res;
+	void *yyscanner;
+	struct parser_state pstate;
+	int mimeparser_yylex_init (yyscan_t* scanner);
+	int mimeparser_yylex_destroy (yyscan_t yyscanner );
+
+	mimeparser_yylex_init(&yyscanner);
+
+	PARSER_setfp(f, yyscanner);
+	PARSER_initialize(&pstate, yyscanner);
+
+	pstate.ctx = ctx;
+	pstate.parsemode = parsemode;
+
+	res = mimeparser_yyparse(&pstate,yyscanner);
+	mimeparser_yylex_destroy(yyscanner);
+
+	return res;
+}



More information about the asterisk-commits mailing list