/* post_processors.c generated by valac 0.21.2.9-2b15d, the Vala compiler
 * generated from post_processors.vala, do not modify */

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2010-2012 Sébastien Wilmet
 *
 * LaTeXila is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * LaTeXila is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib/gi18n-lib.h>


#define TYPE_POST_PROCESSOR (post_processor_get_type ())
#define POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_POST_PROCESSOR, PostProcessor))
#define POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_POST_PROCESSOR, PostProcessorClass))
#define IS_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_POST_PROCESSOR))
#define IS_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_POST_PROCESSOR))
#define POST_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_POST_PROCESSOR, PostProcessorClass))

typedef struct _PostProcessor PostProcessor;
typedef struct _PostProcessorClass PostProcessorClass;
typedef struct _PostProcessorPrivate PostProcessorPrivate;

#define TYPE_BUILD_MSG (build_msg_get_type ())

#define TYPE_BUILD_MSG_TYPE (build_msg_type_get_type ())
typedef struct _BuildMsg BuildMsg;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_NO_OUTPUT_POST_PROCESSOR (no_output_post_processor_get_type ())
#define NO_OUTPUT_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NO_OUTPUT_POST_PROCESSOR, NoOutputPostProcessor))
#define NO_OUTPUT_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NO_OUTPUT_POST_PROCESSOR, NoOutputPostProcessorClass))
#define IS_NO_OUTPUT_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NO_OUTPUT_POST_PROCESSOR))
#define IS_NO_OUTPUT_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NO_OUTPUT_POST_PROCESSOR))
#define NO_OUTPUT_POST_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NO_OUTPUT_POST_PROCESSOR, NoOutputPostProcessorClass))

typedef struct _NoOutputPostProcessor NoOutputPostProcessor;
typedef struct _NoOutputPostProcessorClass NoOutputPostProcessorClass;
typedef struct _NoOutputPostProcessorPrivate NoOutputPostProcessorPrivate;

#define TYPE_ALL_OUTPUT_POST_PROCESSOR (all_output_post_processor_get_type ())
#define ALL_OUTPUT_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALL_OUTPUT_POST_PROCESSOR, AllOutputPostProcessor))
#define ALL_OUTPUT_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALL_OUTPUT_POST_PROCESSOR, AllOutputPostProcessorClass))
#define IS_ALL_OUTPUT_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALL_OUTPUT_POST_PROCESSOR))
#define IS_ALL_OUTPUT_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALL_OUTPUT_POST_PROCESSOR))
#define ALL_OUTPUT_POST_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALL_OUTPUT_POST_PROCESSOR, AllOutputPostProcessorClass))

typedef struct _AllOutputPostProcessor AllOutputPostProcessor;
typedef struct _AllOutputPostProcessorClass AllOutputPostProcessorClass;
typedef struct _AllOutputPostProcessorPrivate AllOutputPostProcessorPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_LATEXMK_POST_PROCESSOR (latexmk_post_processor_get_type ())
#define LATEXMK_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LATEXMK_POST_PROCESSOR, LatexmkPostProcessor))
#define LATEXMK_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LATEXMK_POST_PROCESSOR, LatexmkPostProcessorClass))
#define IS_LATEXMK_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LATEXMK_POST_PROCESSOR))
#define IS_LATEXMK_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LATEXMK_POST_PROCESSOR))
#define LATEXMK_POST_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LATEXMK_POST_PROCESSOR, LatexmkPostProcessorClass))

typedef struct _LatexmkPostProcessor LatexmkPostProcessor;
typedef struct _LatexmkPostProcessorClass LatexmkPostProcessorClass;
typedef struct _LatexmkPostProcessorPrivate LatexmkPostProcessorPrivate;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_match_info_unref0(var) ((var == NULL) ? NULL : (var = (g_match_info_unref (var), NULL)))

#define TYPE_LATEX_POST_PROCESSOR (latex_post_processor_get_type ())
#define LATEX_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LATEX_POST_PROCESSOR, LatexPostProcessor))
#define LATEX_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LATEX_POST_PROCESSOR, LatexPostProcessorClass))
#define IS_LATEX_POST_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LATEX_POST_PROCESSOR))
#define IS_LATEX_POST_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LATEX_POST_PROCESSOR))
#define LATEX_POST_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LATEX_POST_PROCESSOR, LatexPostProcessorClass))

typedef struct _LatexPostProcessor LatexPostProcessor;
typedef struct _LatexPostProcessorClass LatexPostProcessorClass;
#define _build_msg_free0(var) ((var == NULL) ? NULL : (var = (build_msg_free (var), NULL)))

typedef enum  {
	BUILD_MSG_TYPE_TITLE,
	BUILD_MSG_TYPE_JOB_TITLE,
	BUILD_MSG_TYPE_JOB_SUB_COMMAND,
	BUILD_MSG_TYPE_ERROR,
	BUILD_MSG_TYPE_WARNING,
	BUILD_MSG_TYPE_BADBOX,
	BUILD_MSG_TYPE_INFO
} BuildMsgType;

struct _BuildMsg {
	BuildMsgType type;
	gchar* text;
	gchar* filename;
	gint start_line;
	gint end_line;
	gboolean expand;
	GeeList* children;
};

struct _PostProcessor {
	GObject parent_instance;
	PostProcessorPrivate * priv;
	GeeList* _all_messages;
	gboolean _has_details;
	GeeList* _messages_without_details;
};

struct _PostProcessorClass {
	GObjectClass parent_class;
	void (*process) (PostProcessor* self, GFile* file, const gchar* output);
};

struct _NoOutputPostProcessor {
	PostProcessor parent_instance;
	NoOutputPostProcessorPrivate * priv;
};

struct _NoOutputPostProcessorClass {
	PostProcessorClass parent_class;
};

struct _AllOutputPostProcessor {
	PostProcessor parent_instance;
	AllOutputPostProcessorPrivate * priv;
};

struct _AllOutputPostProcessorClass {
	PostProcessorClass parent_class;
};

struct _LatexmkPostProcessor {
	PostProcessor parent_instance;
	LatexmkPostProcessorPrivate * priv;
};

struct _LatexmkPostProcessorClass {
	PostProcessorClass parent_class;
};

struct _LatexmkPostProcessorPrivate {
	gint _exit_status;
};


static gpointer post_processor_parent_class = NULL;
static gpointer no_output_post_processor_parent_class = NULL;
static gpointer all_output_post_processor_parent_class = NULL;
static gpointer latexmk_post_processor_parent_class = NULL;
static GRegex* latexmk_post_processor__reg_rule;
static GRegex* latexmk_post_processor__reg_rule = NULL;
static GRegex* latexmk_post_processor__reg_no_rule;
static GRegex* latexmk_post_processor__reg_no_rule = NULL;

GType post_processor_get_type (void) G_GNUC_CONST;
GType build_msg_get_type (void) G_GNUC_CONST;
GType build_msg_type_get_type (void) G_GNUC_CONST;
BuildMsg* build_msg_dup (const BuildMsg* self);
void build_msg_free (BuildMsg* self);
void build_msg_copy (const BuildMsg* self, BuildMsg* dest);
void build_msg_destroy (BuildMsg* self);
enum  {
	POST_PROCESSOR_DUMMY_PROPERTY
};
gboolean post_processor_has_details (PostProcessor* self);
GeeList* post_processor_get_messages (PostProcessor* self);
GeeList* post_processor_get_detailed_messages (PostProcessor* self);
void post_processor_process (PostProcessor* self, GFile* file, const gchar* output);
static void post_processor_real_process (PostProcessor* self, GFile* file, const gchar* output);
PostProcessor* post_processor_construct (GType object_type);
static void post_processor_finalize (GObject* obj);
GType no_output_post_processor_get_type (void) G_GNUC_CONST;
enum  {
	NO_OUTPUT_POST_PROCESSOR_DUMMY_PROPERTY
};
static void no_output_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output);
NoOutputPostProcessor* no_output_post_processor_new (void);
NoOutputPostProcessor* no_output_post_processor_construct (GType object_type);
GType all_output_post_processor_get_type (void) G_GNUC_CONST;
enum  {
	ALL_OUTPUT_POST_PROCESSOR_DUMMY_PROPERTY
};
static void all_output_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output);
void build_msg_init (BuildMsg *self);
AllOutputPostProcessor* all_output_post_processor_new (void);
AllOutputPostProcessor* all_output_post_processor_construct (GType object_type);
GType latexmk_post_processor_get_type (void) G_GNUC_CONST;
#define LATEXMK_POST_PROCESSOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_LATEXMK_POST_PROCESSOR, LatexmkPostProcessorPrivate))
enum  {
	LATEXMK_POST_PROCESSOR_DUMMY_PROPERTY
};
LatexmkPostProcessor* latexmk_post_processor_new (gint exit_status);
LatexmkPostProcessor* latexmk_post_processor_construct (GType object_type, gint exit_status);
static void latexmk_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output);
LatexPostProcessor* latex_post_processor_new (void);
LatexPostProcessor* latex_post_processor_construct (GType object_type);
GType latex_post_processor_get_type (void) G_GNUC_CONST;
static void latexmk_post_processor_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


gboolean post_processor_has_details (PostProcessor* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->_has_details;
	result = _tmp0_;
	return result;
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


GeeList* post_processor_get_messages (PostProcessor* self) {
	GeeList* result = NULL;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_has_details;
	if (_tmp0_) {
		GeeList* _tmp1_ = NULL;
		GeeList* _tmp2_ = NULL;
		_tmp1_ = self->_messages_without_details;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		result = _tmp2_;
		return result;
	} else {
		GeeList* _tmp3_ = NULL;
		GeeList* _tmp4_ = NULL;
		_tmp3_ = self->_all_messages;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		result = _tmp4_;
		return result;
	}
}


GeeList* post_processor_get_detailed_messages (PostProcessor* self) {
	GeeList* result = NULL;
	GeeList* _tmp0_ = NULL;
	GeeList* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_all_messages;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}


static void post_processor_real_process (PostProcessor* self, GFile* file, const gchar* output) {
	g_critical ("Type `%s' does not implement abstract method `post_processor_process'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void post_processor_process (PostProcessor* self, GFile* file, const gchar* output) {
	g_return_if_fail (self != NULL);
	POST_PROCESSOR_GET_CLASS (self)->process (self, file, output);
}


PostProcessor* post_processor_construct (GType object_type) {
	PostProcessor * self = NULL;
	self = (PostProcessor*) g_object_new (object_type, NULL);
	return self;
}


static void post_processor_class_init (PostProcessorClass * klass) {
	post_processor_parent_class = g_type_class_peek_parent (klass);
	POST_PROCESSOR_CLASS (klass)->process = post_processor_real_process;
	G_OBJECT_CLASS (klass)->finalize = post_processor_finalize;
}


static void post_processor_instance_init (PostProcessor * self) {
	GeeLinkedList* _tmp0_ = NULL;
	GeeLinkedList* _tmp1_ = NULL;
	_tmp0_ = gee_linked_list_new (TYPE_BUILD_MSG, (GBoxedCopyFunc) build_msg_dup, build_msg_free, NULL);
	self->_all_messages = (GeeList*) _tmp0_;
	self->_has_details = FALSE;
	_tmp1_ = gee_linked_list_new (TYPE_BUILD_MSG, (GBoxedCopyFunc) build_msg_dup, build_msg_free, NULL);
	self->_messages_without_details = (GeeList*) _tmp1_;
}


static void post_processor_finalize (GObject* obj) {
	PostProcessor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_POST_PROCESSOR, PostProcessor);
	_g_object_unref0 (self->_all_messages);
	_g_object_unref0 (self->_messages_without_details);
	G_OBJECT_CLASS (post_processor_parent_class)->finalize (obj);
}


GType post_processor_get_type (void) {
	static volatile gsize post_processor_type_id__volatile = 0;
	if (g_once_init_enter (&post_processor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PostProcessorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) post_processor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PostProcessor), 0, (GInstanceInitFunc) post_processor_instance_init, NULL };
		GType post_processor_type_id;
		post_processor_type_id = g_type_register_static (G_TYPE_OBJECT, "PostProcessor", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&post_processor_type_id__volatile, post_processor_type_id);
	}
	return post_processor_type_id__volatile;
}


static void no_output_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output) {
	NoOutputPostProcessor * self;
	self = (NoOutputPostProcessor*) base;
	g_return_if_fail (file != NULL);
	g_return_if_fail (output != NULL);
}


NoOutputPostProcessor* no_output_post_processor_construct (GType object_type) {
	NoOutputPostProcessor * self = NULL;
	self = (NoOutputPostProcessor*) post_processor_construct (object_type);
	return self;
}


NoOutputPostProcessor* no_output_post_processor_new (void) {
	return no_output_post_processor_construct (TYPE_NO_OUTPUT_POST_PROCESSOR);
}


static void no_output_post_processor_class_init (NoOutputPostProcessorClass * klass) {
	no_output_post_processor_parent_class = g_type_class_peek_parent (klass);
	POST_PROCESSOR_CLASS (klass)->process = no_output_post_processor_real_process;
}


static void no_output_post_processor_instance_init (NoOutputPostProcessor * self) {
}


GType no_output_post_processor_get_type (void) {
	static volatile gsize no_output_post_processor_type_id__volatile = 0;
	if (g_once_init_enter (&no_output_post_processor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (NoOutputPostProcessorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) no_output_post_processor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NoOutputPostProcessor), 0, (GInstanceInitFunc) no_output_post_processor_instance_init, NULL };
		GType no_output_post_processor_type_id;
		no_output_post_processor_type_id = g_type_register_static (TYPE_POST_PROCESSOR, "NoOutputPostProcessor", &g_define_type_info, 0);
		g_once_init_leave (&no_output_post_processor_type_id__volatile, no_output_post_processor_type_id);
	}
	return no_output_post_processor_type_id__volatile;
}


static void all_output_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output) {
	AllOutputPostProcessor * self;
	const gchar* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gchar** lines = NULL;
	const gchar* _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gchar** _tmp5_ = NULL;
	gint lines_length1 = 0;
	gint _lines_size_ = 0;
	gint nb_lines = 0;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	gint _tmp7_ = 0;
	gchar** _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	gint _tmp9_ = 0;
	const gchar* _tmp10_ = NULL;
	gint _tmp11_ = 0;
	gint _tmp12_ = 0;
	BuildMsg message = {0};
	self = (AllOutputPostProcessor*) base;
	g_return_if_fail (file != NULL);
	g_return_if_fail (output != NULL);
	_tmp0_ = output;
	_tmp1_ = strlen (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0) {
		return;
	}
	_tmp3_ = output;
	_tmp5_ = _tmp4_ = g_strsplit (_tmp3_, "\n", 0);
	lines = _tmp5_;
	lines_length1 = _vala_array_length (_tmp4_);
	_lines_size_ = lines_length1;
	_tmp6_ = lines;
	_tmp6__length1 = lines_length1;
	nb_lines = _tmp6__length1;
	_tmp7_ = nb_lines;
	g_return_if_fail (_tmp7_ > 0);
	_tmp8_ = lines;
	_tmp8__length1 = lines_length1;
	_tmp9_ = nb_lines;
	_tmp10_ = _tmp8_[_tmp9_ - 1];
	_tmp11_ = strlen (_tmp10_);
	_tmp12_ = _tmp11_;
	if (_tmp12_ == 0) {
		gint _tmp13_ = 0;
		_tmp13_ = nb_lines;
		nb_lines = _tmp13_ - 1;
	}
	build_msg_init (&message);
	{
		gint line_num = 0;
		line_num = 0;
		{
			gboolean _tmp14_ = FALSE;
			_tmp14_ = TRUE;
			while (TRUE) {
				gboolean _tmp15_ = FALSE;
				gint _tmp17_ = 0;
				gint _tmp18_ = 0;
				gchar** _tmp19_ = NULL;
				gint _tmp19__length1 = 0;
				gint _tmp20_ = 0;
				const gchar* _tmp21_ = NULL;
				gchar* _tmp22_ = NULL;
				GeeList* _tmp23_ = NULL;
				BuildMsg _tmp24_ = {0};
				_tmp15_ = _tmp14_;
				if (!_tmp15_) {
					gint _tmp16_ = 0;
					_tmp16_ = line_num;
					line_num = _tmp16_ + 1;
				}
				_tmp14_ = FALSE;
				_tmp17_ = line_num;
				_tmp18_ = nb_lines;
				if (!(_tmp17_ < _tmp18_)) {
					break;
				}
				_tmp19_ = lines;
				_tmp19__length1 = lines_length1;
				_tmp20_ = line_num;
				_tmp21_ = _tmp19_[_tmp20_];
				_tmp22_ = g_strdup (_tmp21_);
				_g_free0 (message.text);
				message.text = _tmp22_;
				_tmp23_ = ((PostProcessor*) self)->_all_messages;
				_tmp24_ = message;
				gee_collection_add ((GeeCollection*) _tmp23_, &_tmp24_);
			}
		}
	}
	build_msg_destroy (&message);
	lines = (_vala_array_free (lines, lines_length1, (GDestroyNotify) g_free), NULL);
}


AllOutputPostProcessor* all_output_post_processor_construct (GType object_type) {
	AllOutputPostProcessor * self = NULL;
	self = (AllOutputPostProcessor*) post_processor_construct (object_type);
	return self;
}


AllOutputPostProcessor* all_output_post_processor_new (void) {
	return all_output_post_processor_construct (TYPE_ALL_OUTPUT_POST_PROCESSOR);
}


static void all_output_post_processor_class_init (AllOutputPostProcessorClass * klass) {
	all_output_post_processor_parent_class = g_type_class_peek_parent (klass);
	POST_PROCESSOR_CLASS (klass)->process = all_output_post_processor_real_process;
}


static void all_output_post_processor_instance_init (AllOutputPostProcessor * self) {
}


GType all_output_post_processor_get_type (void) {
	static volatile gsize all_output_post_processor_type_id__volatile = 0;
	if (g_once_init_enter (&all_output_post_processor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AllOutputPostProcessorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) all_output_post_processor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AllOutputPostProcessor), 0, (GInstanceInitFunc) all_output_post_processor_instance_init, NULL };
		GType all_output_post_processor_type_id;
		all_output_post_processor_type_id = g_type_register_static (TYPE_POST_PROCESSOR, "AllOutputPostProcessor", &g_define_type_info, 0);
		g_once_init_leave (&all_output_post_processor_type_id__volatile, all_output_post_processor_type_id);
	}
	return all_output_post_processor_type_id__volatile;
}


LatexmkPostProcessor* latexmk_post_processor_construct (GType object_type, gint exit_status) {
	LatexmkPostProcessor * self = NULL;
	gint _tmp0_ = 0;
	GRegex* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
	self = (LatexmkPostProcessor*) post_processor_construct (object_type);
	_tmp0_ = exit_status;
	self->priv->_exit_status = _tmp0_;
	_tmp1_ = latexmk_post_processor__reg_rule;
	if (_tmp1_ != NULL) {
		return self;
	}
	{
		gchar* ungreedy_lines = NULL;
		gchar* _tmp2_ = NULL;
		gchar* reg_rule_str = NULL;
		gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		const gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		const gchar* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
		gchar* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		const gchar* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		gchar* _tmp26_ = NULL;
		gchar* _tmp27_ = NULL;
		gchar* _tmp28_ = NULL;
		gchar* _tmp29_ = NULL;
		gchar* _tmp30_ = NULL;
		const gchar* _tmp31_ = NULL;
		gchar* _tmp32_ = NULL;
		GRegex* _tmp33_ = NULL;
		const gchar* _tmp34_ = NULL;
		GRegex* _tmp35_ = NULL;
		gchar* reg_no_rule_str = NULL;
		gchar* _tmp36_ = NULL;
		const gchar* _tmp37_ = NULL;
		gchar* _tmp38_ = NULL;
		const gchar* _tmp39_ = NULL;
		gchar* _tmp40_ = NULL;
		GRegex* _tmp41_ = NULL;
		const gchar* _tmp42_ = NULL;
		GRegex* _tmp43_ = NULL;
		_tmp2_ = g_strdup ("((?U)(.*\\R)*)");
		ungreedy_lines = _tmp2_;
		_tmp3_ = g_strdup ("(?P<title>Run number \\d+ of rule '(?P<rule>.*)')\\R");
		reg_rule_str = _tmp3_;
		_tmp4_ = reg_rule_str;
		_tmp5_ = g_strconcat (_tmp4_, "(-{12}\\R){2}", NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp5_;
		_tmp6_ = reg_rule_str;
		_tmp7_ = g_strconcat (_tmp6_, "Running '(?P<cmd>.*)'\\R", NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp7_;
		_tmp8_ = reg_rule_str;
		_tmp9_ = g_strconcat (_tmp8_, "-{12}\\R", NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp9_;
		_tmp10_ = reg_rule_str;
		_tmp11_ = ungreedy_lines;
		_tmp12_ = g_strconcat (_tmp10_, _tmp11_, NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp12_;
		_tmp13_ = reg_rule_str;
		_tmp14_ = g_strconcat (_tmp13_, "(Latexmk: applying rule .*\\R)+", NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp14_;
		_tmp15_ = reg_rule_str;
		_tmp16_ = g_strconcat (_tmp15_, "(For rule '.*', running .*\\R)?", NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp16_;
		_tmp17_ = reg_rule_str;
		_tmp18_ = ungreedy_lines;
		_tmp19_ = g_strconcat ("(?P<output>", _tmp18_, NULL);
		_tmp20_ = _tmp19_;
		_tmp21_ = g_strconcat (_tmp20_, ")", NULL);
		_tmp22_ = _tmp21_;
		_tmp23_ = g_strconcat (_tmp17_, _tmp22_, NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp23_;
		_g_free0 (_tmp22_);
		_g_free0 (_tmp20_);
		_tmp24_ = reg_rule_str;
		_tmp25_ = ungreedy_lines;
		_tmp26_ = g_strconcat ("(?P<latexmk>(Latexmk:|Rule '.*':)", _tmp25_, NULL);
		_tmp27_ = _tmp26_;
		_tmp28_ = g_strconcat (_tmp27_, ")", NULL);
		_tmp29_ = _tmp28_;
		_tmp30_ = g_strconcat (_tmp24_, _tmp29_, NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp30_;
		_g_free0 (_tmp29_);
		_g_free0 (_tmp27_);
		_tmp31_ = reg_rule_str;
		_tmp32_ = g_strconcat (_tmp31_, "(-{12}\\R|$)", NULL);
		_g_free0 (reg_rule_str);
		reg_rule_str = _tmp32_;
		_tmp34_ = reg_rule_str;
		_tmp35_ = g_regex_new (_tmp34_, G_REGEX_OPTIMIZE, 0, &_inner_error_);
		_tmp33_ = _tmp35_;
		if (_inner_error_ != NULL) {
			_g_free0 (reg_rule_str);
			_g_free0 (ungreedy_lines);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch45_g_regex_error;
			}
			_g_free0 (reg_rule_str);
			_g_free0 (ungreedy_lines);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_g_regex_unref0 (latexmk_post_processor__reg_rule);
		latexmk_post_processor__reg_rule = _tmp33_;
		_tmp36_ = g_strdup ("(Latexmk: This is Latexmk.*\\R)?");
		reg_no_rule_str = _tmp36_;
		_tmp37_ = reg_no_rule_str;
		_tmp38_ = g_strconcat (_tmp37_, "(\\*{4} Report bugs.*\\R)?", NULL);
		_g_free0 (reg_no_rule_str);
		reg_no_rule_str = _tmp38_;
		_tmp39_ = reg_no_rule_str;
		_tmp40_ = g_strconcat (_tmp39_, "(?P<output>(.*\\R)*)", NULL);
		_g_free0 (reg_no_rule_str);
		reg_no_rule_str = _tmp40_;
		_tmp42_ = reg_no_rule_str;
		_tmp43_ = g_regex_new (_tmp42_, 0, 0, &_inner_error_);
		_tmp41_ = _tmp43_;
		if (_inner_error_ != NULL) {
			_g_free0 (reg_no_rule_str);
			_g_free0 (reg_rule_str);
			_g_free0 (ungreedy_lines);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch45_g_regex_error;
			}
			_g_free0 (reg_no_rule_str);
			_g_free0 (reg_rule_str);
			_g_free0 (ungreedy_lines);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_g_regex_unref0 (latexmk_post_processor__reg_no_rule);
		latexmk_post_processor__reg_no_rule = _tmp41_;
		_g_free0 (reg_no_rule_str);
		_g_free0 (reg_rule_str);
		_g_free0 (ungreedy_lines);
	}
	goto __finally45;
	__catch45_g_regex_error:
	{
		GError* e = NULL;
		GError* _tmp44_ = NULL;
		const gchar* _tmp45_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp44_ = e;
		_tmp45_ = _tmp44_->message;
		g_warning ("post_processors.vala:123: LatexmkPostProcessor: %s", _tmp45_);
		_g_error_free0 (e);
	}
	__finally45:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	return self;
}


LatexmkPostProcessor* latexmk_post_processor_new (gint exit_status) {
	return latexmk_post_processor_construct (TYPE_LATEXMK_POST_PROCESSOR, exit_status);
}


static void latexmk_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output) {
	LatexmkPostProcessor * self;
	gboolean _tmp0_ = FALSE;
	GRegex* _tmp1_ = NULL;
	gboolean _tmp3_ = FALSE;
	gchar* last_latex_output = NULL;
	gint last_latex_child_num = 0;
	gboolean last_rule_is_latex_rule = FALSE;
	GMatchInfo* match_info = NULL;
	GRegex* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	GMatchInfo* _tmp6_ = NULL;
	const gchar* _tmp59_ = NULL;
	GeeList* _tmp84_ = NULL;
	gint _tmp85_ = 0;
	gint _tmp86_ = 0;
	PostProcessor* all_output_pp = NULL;
	AllOutputPostProcessor* _tmp87_ = NULL;
	GRegex* _tmp88_ = NULL;
	const gchar* _tmp89_ = NULL;
	GMatchInfo* _tmp90_ = NULL;
	gboolean _tmp91_ = FALSE;
	PostProcessor* _tmp100_ = NULL;
	GeeList* _tmp101_ = NULL;
	GError * _inner_error_ = NULL;
	self = (LatexmkPostProcessor*) base;
	g_return_if_fail (file != NULL);
	g_return_if_fail (output != NULL);
	_tmp1_ = latexmk_post_processor__reg_rule;
	if (_tmp1_ != NULL) {
		GRegex* _tmp2_ = NULL;
		_tmp2_ = latexmk_post_processor__reg_no_rule;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp3_ = _tmp0_;
	g_return_if_fail (_tmp3_);
	last_latex_output = NULL;
	last_latex_child_num = 0;
	last_rule_is_latex_rule = FALSE;
	_tmp4_ = latexmk_post_processor__reg_rule;
	_tmp5_ = output;
	g_regex_match (_tmp4_, _tmp5_, 0, &_tmp6_);
	_g_match_info_unref0 (match_info);
	match_info = _tmp6_;
	while (TRUE) {
		GMatchInfo* _tmp7_ = NULL;
		gboolean _tmp8_ = FALSE;
		BuildMsg msg = {0};
		GMatchInfo* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		BuildMsg cmd_line_msg = {0};
		GMatchInfo* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		BuildMsg _tmp15_ = {0};
		GeeList* _tmp16_ = NULL;
		BuildMsg _tmp17_ = {0};
		gchar* rule = NULL;
		GMatchInfo* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
		gboolean _tmp20_ = FALSE;
		const gchar* _tmp21_ = NULL;
		gboolean is_latex_cmd = FALSE;
		gboolean _tmp23_ = FALSE;
		gboolean _tmp24_ = FALSE;
		gboolean _tmp25_ = FALSE;
		GeeList* _tmp42_ = NULL;
		BuildMsg _tmp43_ = {0};
		BuildMsg latexmk_msg = {0};
		const gchar* _tmp44_ = NULL;
		gchar* _tmp45_ = NULL;
		gchar* latexmk_output = NULL;
		GMatchInfo* _tmp46_ = NULL;
		gchar* _tmp47_ = NULL;
		PostProcessor* all_output_pp = NULL;
		AllOutputPostProcessor* _tmp48_ = NULL;
		PostProcessor* _tmp49_ = NULL;
		GFile* _tmp50_ = NULL;
		const gchar* _tmp51_ = NULL;
		PostProcessor* _tmp52_ = NULL;
		GeeList* _tmp53_ = NULL;
		GeeList* _tmp54_ = NULL;
		BuildMsg _tmp55_ = {0};
		_tmp7_ = match_info;
		_tmp8_ = g_match_info_matches (_tmp7_);
		if (!_tmp8_) {
			break;
		}
		build_msg_init (&msg);
		msg.type = BUILD_MSG_TYPE_JOB_SUB_COMMAND;
		msg.expand = FALSE;
		_tmp9_ = match_info;
		_tmp10_ = g_match_info_fetch_named (_tmp9_, "title");
		_g_free0 (msg.text);
		msg.text = _tmp10_;
		build_msg_init (&cmd_line_msg);
		_tmp11_ = match_info;
		_tmp12_ = g_match_info_fetch_named (_tmp11_, "cmd");
		_tmp13_ = _tmp12_;
		_tmp14_ = g_strconcat ("$ ", _tmp13_, NULL);
		_g_free0 (cmd_line_msg.text);
		cmd_line_msg.text = _tmp14_;
		_g_free0 (_tmp13_);
		_tmp15_ = msg;
		_tmp16_ = _tmp15_.children;
		_tmp17_ = cmd_line_msg;
		gee_collection_add ((GeeCollection*) _tmp16_, &_tmp17_);
		_tmp18_ = match_info;
		_tmp19_ = g_match_info_fetch_named (_tmp18_, "rule");
		rule = _tmp19_;
		_tmp21_ = rule;
		if (g_strcmp0 (_tmp21_, "latex") == 0) {
			_tmp20_ = TRUE;
		} else {
			const gchar* _tmp22_ = NULL;
			_tmp22_ = rule;
			_tmp20_ = g_strcmp0 (_tmp22_, "pdflatex") == 0;
		}
		_tmp23_ = _tmp20_;
		is_latex_cmd = _tmp23_;
		_tmp24_ = is_latex_cmd;
		last_rule_is_latex_rule = _tmp24_;
		_tmp25_ = is_latex_cmd;
		if (_tmp25_) {
			GMatchInfo* _tmp26_ = NULL;
			gchar* _tmp27_ = NULL;
			GeeList* _tmp28_ = NULL;
			gint _tmp29_ = 0;
			gint _tmp30_ = 0;
			_tmp26_ = match_info;
			_tmp27_ = g_match_info_fetch_named (_tmp26_, "output");
			_g_free0 (last_latex_output);
			last_latex_output = _tmp27_;
			_tmp28_ = ((PostProcessor*) self)->_all_messages;
			_tmp29_ = gee_collection_get_size ((GeeCollection*) _tmp28_);
			_tmp30_ = _tmp29_;
			last_latex_child_num = _tmp30_;
		} else {
			gchar* cmd_output = NULL;
			GMatchInfo* _tmp31_ = NULL;
			gchar* _tmp32_ = NULL;
			PostProcessor* all_output_pp = NULL;
			AllOutputPostProcessor* _tmp33_ = NULL;
			PostProcessor* _tmp34_ = NULL;
			GFile* _tmp35_ = NULL;
			const gchar* _tmp36_ = NULL;
			BuildMsg _tmp37_ = {0};
			GeeList* _tmp38_ = NULL;
			PostProcessor* _tmp39_ = NULL;
			GeeList* _tmp40_ = NULL;
			GeeList* _tmp41_ = NULL;
			_tmp31_ = match_info;
			_tmp32_ = g_match_info_fetch_named (_tmp31_, "output");
			cmd_output = _tmp32_;
			_tmp33_ = all_output_post_processor_new ();
			all_output_pp = (PostProcessor*) _tmp33_;
			_tmp34_ = all_output_pp;
			_tmp35_ = file;
			_tmp36_ = cmd_output;
			post_processor_process (_tmp34_, _tmp35_, _tmp36_);
			_tmp37_ = msg;
			_tmp38_ = _tmp37_.children;
			_tmp39_ = all_output_pp;
			_tmp40_ = post_processor_get_messages (_tmp39_);
			_tmp41_ = _tmp40_;
			gee_collection_add_all ((GeeCollection*) _tmp38_, (GeeCollection*) _tmp41_);
			_g_object_unref0 (_tmp41_);
			_g_object_unref0 (all_output_pp);
			_g_free0 (cmd_output);
		}
		_tmp42_ = ((PostProcessor*) self)->_all_messages;
		_tmp43_ = msg;
		gee_collection_add ((GeeCollection*) _tmp42_, &_tmp43_);
		build_msg_init (&latexmk_msg);
		latexmk_msg.type = BUILD_MSG_TYPE_JOB_SUB_COMMAND;
		_tmp44_ = _ ("Latexmk messages");
		_tmp45_ = g_strdup (_tmp44_);
		_g_free0 (latexmk_msg.text);
		latexmk_msg.text = _tmp45_;
		latexmk_msg.expand = FALSE;
		_tmp46_ = match_info;
		_tmp47_ = g_match_info_fetch_named (_tmp46_, "latexmk");
		latexmk_output = _tmp47_;
		_tmp48_ = all_output_post_processor_new ();
		all_output_pp = (PostProcessor*) _tmp48_;
		_tmp49_ = all_output_pp;
		_tmp50_ = file;
		_tmp51_ = latexmk_output;
		post_processor_process (_tmp49_, _tmp50_, _tmp51_);
		_tmp52_ = all_output_pp;
		_tmp53_ = post_processor_get_messages (_tmp52_);
		_g_object_unref0 (latexmk_msg.children);
		latexmk_msg.children = _tmp53_;
		_tmp54_ = ((PostProcessor*) self)->_all_messages;
		_tmp55_ = latexmk_msg;
		gee_collection_add ((GeeCollection*) _tmp54_, &_tmp55_);
		{
			GMatchInfo* _tmp56_ = NULL;
			_tmp56_ = match_info;
			g_match_info_next (_tmp56_, &_inner_error_);
			if (_inner_error_ != NULL) {
				if (_inner_error_->domain == G_REGEX_ERROR) {
					goto __catch46_g_regex_error;
				}
				_g_object_unref0 (all_output_pp);
				_g_free0 (latexmk_output);
				build_msg_destroy (&latexmk_msg);
				_g_free0 (rule);
				build_msg_destroy (&cmd_line_msg);
				build_msg_destroy (&msg);
				_g_match_info_unref0 (match_info);
				_g_free0 (last_latex_output);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return;
			}
		}
		goto __finally46;
		__catch46_g_regex_error:
		{
			GError* e = NULL;
			GError* _tmp57_ = NULL;
			const gchar* _tmp58_ = NULL;
			e = _inner_error_;
			_inner_error_ = NULL;
			_tmp57_ = e;
			_tmp58_ = _tmp57_->message;
			g_warning ("post_processors.vala:204: LatexmkPostProcessor: %s", _tmp58_);
			_g_error_free0 (e);
			_g_object_unref0 (all_output_pp);
			_g_free0 (latexmk_output);
			build_msg_destroy (&latexmk_msg);
			_g_free0 (rule);
			build_msg_destroy (&cmd_line_msg);
			build_msg_destroy (&msg);
			break;
		}
		__finally46:
		if (_inner_error_ != NULL) {
			_g_object_unref0 (all_output_pp);
			_g_free0 (latexmk_output);
			build_msg_destroy (&latexmk_msg);
			_g_free0 (rule);
			build_msg_destroy (&cmd_line_msg);
			build_msg_destroy (&msg);
			_g_match_info_unref0 (match_info);
			_g_free0 (last_latex_output);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
		_g_object_unref0 (all_output_pp);
		_g_free0 (latexmk_output);
		build_msg_destroy (&latexmk_msg);
		_g_free0 (rule);
		build_msg_destroy (&cmd_line_msg);
		build_msg_destroy (&msg);
	}
	_tmp59_ = last_latex_output;
	if (_tmp59_ != NULL) {
		PostProcessor* latex_pp = NULL;
		LatexPostProcessor* _tmp60_ = NULL;
		PostProcessor* _tmp61_ = NULL;
		GFile* _tmp62_ = NULL;
		const gchar* _tmp63_ = NULL;
		gboolean _tmp64_ = FALSE;
		gint _tmp65_ = 0;
		gboolean _tmp67_ = FALSE;
		BuildMsg msg = {0};
		GeeList* _tmp70_ = NULL;
		gint _tmp71_ = 0;
		gpointer _tmp72_ = NULL;
		BuildMsg* _tmp73_ = NULL;
		BuildMsg _tmp74_ = {0};
		BuildMsg _tmp75_ = {0};
		BuildMsg _tmp76_ = {0};
		GeeList* _tmp77_ = NULL;
		PostProcessor* _tmp78_ = NULL;
		GeeList* _tmp79_ = NULL;
		GeeList* _tmp80_ = NULL;
		GeeList* _tmp81_ = NULL;
		gint _tmp82_ = 0;
		BuildMsg _tmp83_ = {0};
		_tmp60_ = latex_post_processor_new ();
		latex_pp = (PostProcessor*) _tmp60_;
		_tmp61_ = latex_pp;
		_tmp62_ = file;
		_tmp63_ = last_latex_output;
		post_processor_process (_tmp61_, _tmp62_, _tmp63_);
		_tmp65_ = self->priv->_exit_status;
		if (_tmp65_ == 0) {
			_tmp64_ = TRUE;
		} else {
			gboolean _tmp66_ = FALSE;
			_tmp66_ = last_rule_is_latex_rule;
			_tmp64_ = _tmp66_;
		}
		_tmp67_ = _tmp64_;
		if (_tmp67_) {
			PostProcessor* _tmp68_ = NULL;
			GeeList* _tmp69_ = NULL;
			((PostProcessor*) self)->_has_details = TRUE;
			_tmp68_ = latex_pp;
			_tmp69_ = post_processor_get_messages (_tmp68_);
			_g_object_unref0 (((PostProcessor*) self)->_messages_without_details);
			((PostProcessor*) self)->_messages_without_details = _tmp69_;
		}
		_tmp70_ = ((PostProcessor*) self)->_all_messages;
		_tmp71_ = last_latex_child_num;
		_tmp72_ = gee_list_get (_tmp70_, _tmp71_);
		_tmp73_ = (BuildMsg*) _tmp72_;
		build_msg_copy (_tmp73_, &_tmp74_);
		_tmp75_ = _tmp74_;
		_build_msg_free0 (_tmp73_);
		msg = _tmp75_;
		_tmp76_ = msg;
		_tmp77_ = _tmp76_.children;
		_tmp78_ = latex_pp;
		_tmp79_ = post_processor_get_messages (_tmp78_);
		_tmp80_ = _tmp79_;
		gee_collection_add_all ((GeeCollection*) _tmp77_, (GeeCollection*) _tmp80_);
		_g_object_unref0 (_tmp80_);
		msg.expand = TRUE;
		_tmp81_ = ((PostProcessor*) self)->_all_messages;
		_tmp82_ = last_latex_child_num;
		_tmp83_ = msg;
		gee_list_set (_tmp81_, _tmp82_, &_tmp83_);
		build_msg_destroy (&msg);
		_g_object_unref0 (latex_pp);
	}
	_tmp84_ = ((PostProcessor*) self)->_all_messages;
	_tmp85_ = gee_collection_get_size ((GeeCollection*) _tmp84_);
	_tmp86_ = _tmp85_;
	if (_tmp86_ > 0) {
		_g_match_info_unref0 (match_info);
		_g_free0 (last_latex_output);
		return;
	}
	_tmp87_ = all_output_post_processor_new ();
	all_output_pp = (PostProcessor*) _tmp87_;
	_tmp88_ = latexmk_post_processor__reg_no_rule;
	_tmp89_ = output;
	_tmp91_ = g_regex_match (_tmp88_, _tmp89_, 0, &_tmp90_);
	_g_match_info_unref0 (match_info);
	match_info = _tmp90_;
	if (_tmp91_) {
		gchar* all_output = NULL;
		GMatchInfo* _tmp92_ = NULL;
		gchar* _tmp93_ = NULL;
		PostProcessor* _tmp94_ = NULL;
		GFile* _tmp95_ = NULL;
		const gchar* _tmp96_ = NULL;
		_tmp92_ = match_info;
		_tmp93_ = g_match_info_fetch_named (_tmp92_, "output");
		all_output = _tmp93_;
		_tmp94_ = all_output_pp;
		_tmp95_ = file;
		_tmp96_ = all_output;
		post_processor_process (_tmp94_, _tmp95_, _tmp96_);
		_g_free0 (all_output);
	} else {
		PostProcessor* _tmp97_ = NULL;
		GFile* _tmp98_ = NULL;
		const gchar* _tmp99_ = NULL;
		_tmp97_ = all_output_pp;
		_tmp98_ = file;
		_tmp99_ = output;
		post_processor_process (_tmp97_, _tmp98_, _tmp99_);
	}
	_tmp100_ = all_output_pp;
	_tmp101_ = post_processor_get_messages (_tmp100_);
	_g_object_unref0 (((PostProcessor*) self)->_all_messages);
	((PostProcessor*) self)->_all_messages = _tmp101_;
	_g_object_unref0 (all_output_pp);
	_g_match_info_unref0 (match_info);
	_g_free0 (last_latex_output);
}


static void latexmk_post_processor_class_init (LatexmkPostProcessorClass * klass) {
	latexmk_post_processor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (LatexmkPostProcessorPrivate));
	POST_PROCESSOR_CLASS (klass)->process = latexmk_post_processor_real_process;
	G_OBJECT_CLASS (klass)->finalize = latexmk_post_processor_finalize;
}


static void latexmk_post_processor_instance_init (LatexmkPostProcessor * self) {
	self->priv = LATEXMK_POST_PROCESSOR_GET_PRIVATE (self);
}


static void latexmk_post_processor_finalize (GObject* obj) {
	LatexmkPostProcessor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LATEXMK_POST_PROCESSOR, LatexmkPostProcessor);
	G_OBJECT_CLASS (latexmk_post_processor_parent_class)->finalize (obj);
}


GType latexmk_post_processor_get_type (void) {
	static volatile gsize latexmk_post_processor_type_id__volatile = 0;
	if (g_once_init_enter (&latexmk_post_processor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (LatexmkPostProcessorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) latexmk_post_processor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LatexmkPostProcessor), 0, (GInstanceInitFunc) latexmk_post_processor_instance_init, NULL };
		GType latexmk_post_processor_type_id;
		latexmk_post_processor_type_id = g_type_register_static (TYPE_POST_PROCESSOR, "LatexmkPostProcessor", &g_define_type_info, 0);
		g_once_init_leave (&latexmk_post_processor_type_id__volatile, latexmk_post_processor_type_id);
	}
	return latexmk_post_processor_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



