/* LogObscurer.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from LogObscurer.vala, do not modify */

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include "deja.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	DEJA_DUP_LOG_OBSCURER_0_PROPERTY,
	DEJA_DUP_LOG_OBSCURER_NUM_PROPERTIES
};
static GParamSpec* deja_dup_log_obscurer_properties[DEJA_DUP_LOG_OBSCURER_NUM_PROPERTIES];
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DejaDupLogObscurerPrivate {
	GHashTable* replacements;
};

static gint DejaDupLogObscurer_private_offset;
static gpointer deja_dup_log_obscurer_parent_class = NULL;

static gchar* deja_dup_log_obscurer_random_str (DejaDupLogObscurer* self,
                                         const gchar* input);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
static void _vala_array_add12 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add13 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static GObject * deja_dup_log_obscurer_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _g_free0_ (gpointer var);
static void deja_dup_log_obscurer_finalize (GObject * obj);
static GType deja_dup_log_obscurer_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
deja_dup_log_obscurer_get_instance_private (DejaDupLogObscurer* self)
{
	return G_STRUCT_MEMBER_P (self, DejaDupLogObscurer_private_offset);
}

static gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static gchar*
deja_dup_log_obscurer_random_str (DejaDupLogObscurer* self,
                                  const gchar* input)
{
	gchar* str = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (input != NULL, NULL);
	_tmp0_ = g_strdup ("");
	str = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				gint _tmp3_;
				gint _tmp4_;
				gchar sub = '\0';
				const gchar* _tmp5_;
				gchar* _tmp6_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = strlen (input);
				_tmp4_ = _tmp3_;
				if (!(i < _tmp4_)) {
					break;
				}
				sub = string_get (input, (glong) i);
				if (g_ascii_isalnum (sub)) {
					sub = (gchar) g_random_int_range ((gint32) ((gint) 'a'), (gint32) ((gint) 'z'));
				}
				_tmp5_ = str;
				_tmp6_ = g_strdup_printf ("%s%c", _tmp5_, (gint) sub);
				_g_free0 (str);
				str = _tmp6_;
			}
		}
	}
	result = str;
	return result;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

gchar*
deja_dup_log_obscurer_replace_path (DejaDupLogObscurer* self,
                                    const gchar* path)
{
	gchar** pieces = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint pieces_length1;
	gint _pieces_size_;
	gchar** _tmp28_;
	gint _tmp28__length1;
	gchar* _tmp29_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp1_ = _tmp0_ = g_strsplit (path, "/", 0);
	pieces = _tmp1_;
	pieces_length1 = _vala_array_length (_tmp0_);
	_pieces_size_ = pieces_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gchar** _tmp4_;
				gint _tmp4__length1;
				gchar* piece = NULL;
				gchar** _tmp5_;
				gint _tmp5__length1;
				const gchar* _tmp6_;
				gchar* _tmp7_;
				gboolean _tmp8_ = FALSE;
				gboolean _tmp9_ = FALSE;
				const gchar* _tmp10_;
				gchar* replacement = NULL;
				GHashTable* _tmp13_;
				const gchar* _tmp14_;
				gconstpointer _tmp15_;
				gchar* _tmp16_;
				const gchar* _tmp17_;
				gchar** _tmp25_;
				gint _tmp25__length1;
				const gchar* _tmp26_;
				gchar* _tmp27_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = pieces;
				_tmp4__length1 = pieces_length1;
				if (!(i < _tmp4__length1)) {
					break;
				}
				_tmp5_ = pieces;
				_tmp5__length1 = pieces_length1;
				_tmp6_ = _tmp5_[i];
				_tmp7_ = g_strdup (_tmp6_);
				piece = _tmp7_;
				_tmp10_ = piece;
				if (g_strcmp0 (_tmp10_, "") == 0) {
					_tmp9_ = TRUE;
				} else {
					const gchar* _tmp11_;
					_tmp11_ = piece;
					_tmp9_ = string_get (_tmp11_, (glong) 0) == '$';
				}
				if (_tmp9_) {
					_tmp8_ = TRUE;
				} else {
					const gchar* _tmp12_;
					_tmp12_ = piece;
					_tmp8_ = g_str_has_prefix (_tmp12_, "duplicity-");
				}
				if (_tmp8_) {
					_g_free0 (piece);
					continue;
				}
				_tmp13_ = self->priv->replacements;
				_tmp14_ = piece;
				_tmp15_ = g_hash_table_lookup (_tmp13_, _tmp14_);
				_tmp16_ = g_strdup ((const gchar*) _tmp15_);
				replacement = _tmp16_;
				_tmp17_ = replacement;
				if (_tmp17_ == NULL) {
					const gchar* _tmp18_;
					gchar* _tmp19_;
					GHashTable* _tmp20_;
					const gchar* _tmp21_;
					gchar* _tmp22_;
					const gchar* _tmp23_;
					gchar* _tmp24_;
					_tmp18_ = piece;
					_tmp19_ = deja_dup_log_obscurer_random_str (self, _tmp18_);
					_g_free0 (replacement);
					replacement = _tmp19_;
					_tmp20_ = self->priv->replacements;
					_tmp21_ = piece;
					_tmp22_ = g_strdup (_tmp21_);
					_tmp23_ = replacement;
					_tmp24_ = g_strdup (_tmp23_);
					g_hash_table_insert (_tmp20_, _tmp22_, _tmp24_);
				}
				_tmp25_ = pieces;
				_tmp25__length1 = pieces_length1;
				_tmp26_ = replacement;
				_tmp27_ = g_strdup (_tmp26_);
				_g_free0 (_tmp25_[i]);
				_tmp25_[i] = _tmp27_;
				_g_free0 (replacement);
				_g_free0 (piece);
			}
		}
	}
	_tmp28_ = pieces;
	_tmp28__length1 = pieces_length1;
	_tmp29_ = _vala_g_strjoinv ("/", _tmp28_, (gint) _tmp28__length1);
	result = _tmp29_;
	pieces = (_vala_array_free (pieces, pieces_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static gchar**
_vala_array_dup2 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

gchar**
deja_dup_log_obscurer_replace_paths (DejaDupLogObscurer* self,
                                     gchar** paths,
                                     gint paths_length1,
                                     gint* result_length1)
{
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				const gchar* _tmp2_;
				gchar* _tmp3_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < paths_length1)) {
					break;
				}
				_tmp2_ = paths[i];
				_tmp3_ = deja_dup_log_obscurer_replace_path (self, _tmp2_);
				_g_free0 (paths[i]);
				paths[i] = _tmp3_;
			}
		}
	}
	_tmp4_ = (paths != NULL) ? _vala_array_dup2 (paths, paths_length1) : paths;
	_tmp4__length1 = paths_length1;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _tmp4__length1;
	if (result_length1) {
		*result_length1 = _tmp5__length1;
	}
	result = _tmp5_;
	return result;
}

gchar*
deja_dup_log_obscurer_replace_word_if_present (DejaDupLogObscurer* self,
                                               const gchar* word)
{
	gchar* replacement = NULL;
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (word != NULL, NULL);
	_tmp0_ = self->priv->replacements;
	_tmp1_ = g_hash_table_lookup (_tmp0_, word);
	_tmp2_ = g_strdup ((const gchar*) _tmp1_);
	replacement = _tmp2_;
	_tmp3_ = replacement;
	if (_tmp3_ == NULL) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup (word);
		result = _tmp4_;
		_g_free0 (replacement);
		return result;
	} else {
		result = replacement;
		return result;
	}
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

gchar*
deja_dup_log_obscurer_replace_uri (DejaDupLogObscurer* self,
                                   const gchar* uri)
{
	gchar* scheme = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (uri != NULL, NULL);
	_tmp0_ = g_uri_parse_scheme (uri);
	scheme = _tmp0_;
	_tmp1_ = scheme;
	if (_tmp1_ == NULL) {
		gchar* _tmp2_;
		_tmp2_ = deja_dup_log_obscurer_replace_path (self, uri);
		result = _tmp2_;
		_g_free0 (scheme);
		return result;
	}
	_tmp3_ = scheme;
	_tmp4_ = scheme;
	_tmp5_ = strlen (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = string_substring (uri, (glong) _tmp6_, (glong) -1);
	_tmp8_ = _tmp7_;
	_tmp9_ = deja_dup_log_obscurer_replace_path (self, _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strconcat (_tmp3_, _tmp10_, NULL);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	result = _tmp12_;
	_g_free0 (scheme);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
_vala_array_add12 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add13 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

gchar*
deja_dup_log_obscurer_replace_freeform_text (DejaDupLogObscurer* self,
                                             const gchar* input)
{
	gchar** tokens = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint tokens_length1;
	gint _tokens_size_;
	gchar** _result_ = NULL;
	gchar** _tmp2_;
	gint _result__length1;
	gint __result__size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** _tmp16_;
	gint _tmp16__length1;
	gchar* _tmp17_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (input != NULL, NULL);
	_tmp1_ = _tmp0_ = g_strsplit_set (input, " '\"", 0);
	tokens = _tmp1_;
	tokens_length1 = _vala_array_length (_tmp0_);
	_tokens_size_ = tokens_length1;
	_tmp2_ = g_new0 (gchar*, 0 + 1);
	_result_ = _tmp2_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	_tmp3_ = tokens;
	_tmp3__length1 = tokens_length1;
	{
		gchar** token_collection = NULL;
		gint token_collection_length1 = 0;
		gint _token_collection_size_ = 0;
		gint token_it = 0;
		token_collection = _tmp3_;
		token_collection_length1 = _tmp3__length1;
		for (token_it = 0; token_it < token_collection_length1; token_it = token_it + 1) {
			gchar* _tmp4_;
			gchar* token = NULL;
			_tmp4_ = g_strdup (token_collection[token_it]);
			token = _tmp4_;
			{
				gboolean _tmp5_ = FALSE;
				const gchar* _tmp6_;
				_tmp6_ = token;
				if (string_contains (_tmp6_, "/")) {
					_tmp5_ = TRUE;
				} else {
					gboolean _tmp7_ = FALSE;
					gboolean _tmp8_ = FALSE;
					const gchar* _tmp9_;
					_tmp9_ = token;
					if (g_strcmp0 (_tmp9_, ".") != 0) {
						const gchar* _tmp10_;
						_tmp10_ = token;
						_tmp8_ = !g_str_has_suffix (_tmp10_, ".");
					} else {
						_tmp8_ = FALSE;
					}
					if (_tmp8_) {
						const gchar* _tmp11_;
						_tmp11_ = token;
						_tmp7_ = string_contains (_tmp11_, ".");
					} else {
						_tmp7_ = FALSE;
					}
					_tmp5_ = _tmp7_;
				}
				if (_tmp5_) {
					const gchar* _tmp12_;
					gchar* _tmp13_;
					_tmp12_ = token;
					_tmp13_ = deja_dup_log_obscurer_replace_path (self, _tmp12_);
					_vala_array_add12 (&_result_, &_result__length1, &__result__size_, _tmp13_);
				} else {
					const gchar* _tmp14_;
					gchar* _tmp15_;
					_tmp14_ = token;
					_tmp15_ = deja_dup_log_obscurer_replace_word_if_present (self, _tmp14_);
					_vala_array_add13 (&_result_, &_result__length1, &__result__size_, _tmp15_);
				}
				_g_free0 (token);
			}
		}
	}
	_tmp16_ = _result_;
	_tmp16__length1 = _result__length1;
	_tmp17_ = _vala_g_strjoinv (" ", _tmp16_, (gint) _tmp16__length1);
	result = _tmp17_;
	_result_ = (_vala_array_free (_result_, _result__length1, (GDestroyNotify) g_free), NULL);
	tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

DejaDupLogObscurer*
deja_dup_log_obscurer_construct (GType object_type)
{
	DejaDupLogObscurer * self = NULL;
	self = (DejaDupLogObscurer*) g_object_new (object_type, NULL);
	return self;
}

DejaDupLogObscurer*
deja_dup_log_obscurer_new (void)
{
	return deja_dup_log_obscurer_construct (DEJA_DUP_TYPE_LOG_OBSCURER);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static GObject *
deja_dup_log_obscurer_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DejaDupLogObscurer * self;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GHashTable* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GHashTable* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GHashTable* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GHashTable* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	GHashTable* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	GHashTable* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	GHashTable* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	parent_class = G_OBJECT_CLASS (deja_dup_log_obscurer_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_LOG_OBSCURER, DejaDupLogObscurer);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
	_g_hash_table_unref0 (self->priv->replacements);
	self->priv->replacements = _tmp2_;
	_tmp3_ = self->priv->replacements;
	_tmp4_ = g_strdup (PACKAGE);
	_tmp5_ = g_strdup (PACKAGE);
	g_hash_table_insert (_tmp3_, _tmp4_, _tmp5_);
	_tmp6_ = self->priv->replacements;
	_tmp7_ = g_strdup (".cache");
	_tmp8_ = g_strdup (".cache");
	g_hash_table_insert (_tmp6_, _tmp7_, _tmp8_);
	_tmp9_ = self->priv->replacements;
	_tmp10_ = g_strdup ("home");
	_tmp11_ = g_strdup ("home");
	g_hash_table_insert (_tmp9_, _tmp10_, _tmp11_);
	_tmp12_ = self->priv->replacements;
	_tmp13_ = g_strdup ("lockfile");
	_tmp14_ = g_strdup ("lockfile");
	g_hash_table_insert (_tmp12_, _tmp13_, _tmp14_);
	_tmp15_ = self->priv->replacements;
	_tmp16_ = g_strdup ("metadata");
	_tmp17_ = g_strdup ("metadata");
	g_hash_table_insert (_tmp15_, _tmp16_, _tmp17_);
	_tmp18_ = self->priv->replacements;
	_tmp19_ = g_strdup ("README");
	_tmp20_ = g_strdup ("README");
	g_hash_table_insert (_tmp18_, _tmp19_, _tmp20_);
	_tmp21_ = self->priv->replacements;
	_tmp22_ = g_strdup ("tmp");
	_tmp23_ = g_strdup ("tmp");
	g_hash_table_insert (_tmp21_, _tmp22_, _tmp23_);
	_tmp24_ = self->priv->replacements;
	_tmp25_ = g_strdup ("restic");
	_tmp26_ = g_strdup ("restic");
	g_hash_table_insert (_tmp24_, _tmp25_, _tmp26_);
	return obj;
}

static void
deja_dup_log_obscurer_class_init (DejaDupLogObscurerClass * klass,
                                  gpointer klass_data)
{
	deja_dup_log_obscurer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DejaDupLogObscurer_private_offset);
	G_OBJECT_CLASS (klass)->constructor = deja_dup_log_obscurer_constructor;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_log_obscurer_finalize;
}

static void
deja_dup_log_obscurer_instance_init (DejaDupLogObscurer * self,
                                     gpointer klass)
{
	self->priv = deja_dup_log_obscurer_get_instance_private (self);
}

static void
deja_dup_log_obscurer_finalize (GObject * obj)
{
	DejaDupLogObscurer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_LOG_OBSCURER, DejaDupLogObscurer);
	_g_hash_table_unref0 (self->priv->replacements);
	G_OBJECT_CLASS (deja_dup_log_obscurer_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
deja_dup_log_obscurer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DejaDupLogObscurerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_log_obscurer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupLogObscurer), 0, (GInstanceInitFunc) deja_dup_log_obscurer_instance_init, NULL };
	GType deja_dup_log_obscurer_type_id;
	deja_dup_log_obscurer_type_id = g_type_register_static (G_TYPE_OBJECT, "DejaDupLogObscurer", &g_define_type_info, 0);
	DejaDupLogObscurer_private_offset = g_type_add_instance_private (deja_dup_log_obscurer_type_id, sizeof (DejaDupLogObscurerPrivate));
	return deja_dup_log_obscurer_type_id;
}

GType
deja_dup_log_obscurer_get_type (void)
{
	static gsize deja_dup_log_obscurer_type_id__once = 0;
	if (g_once_init_enter (&deja_dup_log_obscurer_type_id__once)) {
		GType deja_dup_log_obscurer_type_id;
		deja_dup_log_obscurer_type_id = deja_dup_log_obscurer_get_type_once ();
		g_once_init_leave (&deja_dup_log_obscurer_type_id__once, deja_dup_log_obscurer_type_id);
	}
	return deja_dup_log_obscurer_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

