/* Publishing.c generated by valac 0.56.19, the Vala compiler
 * generated from Publishing.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include "shotwell-plugin-dev-1.0.h"
#include <glib/gi18n-lib.h>

#define RESOURCES_PUBLISH "send-to-symbolic"
#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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

VALA_EXTERN void publishing_init (GError** error);
static void _vala_array_add52 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add53 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add54 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN void plugins_register_extension_point (GType type,
                                       const gchar* name,
                                       const gchar* icon_name,
                                       gchar** core_ids,
                                       gint core_ids_length1);
VALA_EXTERN void publishing_terminate (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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
_vala_array_add52 (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_add53 (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_add54 (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;
}

void
publishing_init (GError** error)
{
	gchar** core_ids = NULL;
	gchar** _tmp0_;
	gint core_ids_length1;
	gint _core_ids_size_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	core_ids = _tmp0_;
	core_ids_length1 = 0;
	_core_ids_size_ = core_ids_length1;
	_tmp1_ = g_strdup ("org.gnome.shotwell.publishing.flickr");
	_vala_array_add52 (&core_ids, &core_ids_length1, &_core_ids_size_, _tmp1_);
	_tmp2_ = g_strdup ("org.gnome.shotwell.publishing.youtube");
	_vala_array_add53 (&core_ids, &core_ids_length1, &_core_ids_size_, _tmp2_);
	_tmp3_ = g_strdup ("org.gnome.shotwell.publishing.gnome-photos");
	_vala_array_add54 (&core_ids, &core_ids_length1, &_core_ids_size_, _tmp3_);
	_tmp4_ = core_ids;
	_tmp4__length1 = core_ids_length1;
	plugins_register_extension_point (SPIT_PUBLISHING_TYPE_SERVICE, _ ("Publishing"), RESOURCES_PUBLISH, _tmp4_, (gint) _tmp4__length1);
	core_ids = (_vala_array_free (core_ids, core_ids_length1, (GDestroyNotify) g_free), NULL);
}

void
publishing_terminate (void)
{
}

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 inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

