#include "parser.h"
#include "debug.h"
+#include "plugin_manager.h"
static struct parser_info *parser_list;
return 0;
}
-struct parser_info *str_to_parser(const char *str)
+static struct parser_info *_str_to_parser(const char *str)
{
struct parser_info *parser;
return NULL;
}
+
+struct parser_info *str_to_parser(const char *str)
+{
+ struct parser_info *parser;
+ int ret;
+
+ parser = _str_to_parser(str);
+
+ if (parser)
+ return parser;
+
+ /* No parser found? Try loading a plugin */
+ ret = load_parser_plugin(str);
+ if (ret)
+ return NULL;
+
+ /* Try finding the parser again, maybe we got lucky and have it now */
+ return _str_to_parser(str);
+}