/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
 *
 * mkisofs-glue.c: mkisofs utility functions
 *
 * Copyright (C) 2002-2004 Red Hat, Inc.
 * Copyright (C) 2005 William Jon McCann <mccann@jhu.edu>
 *
 * This program 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 2 of the
 * License, or (at your option) any later version.
 *
 * This program 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 this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Authors: Alexander Larsson <alexl@redhat.com>
 *          William Jon McCann <mccann@jhu.edu>
 */

#ifndef __MKISOFS_GLUE_H
#define __MKISOFS_GLUE_H

#include <glib.h>
#include <glib/gerror.h>
#include <libgnomevfs/gnome-vfs.h>
#include <stdio.h>

G_BEGIN_DECLS

#define NAUTILUS_BURN_MKISOFS_ERROR nautilus_burn_mkisofs_error_quark ()

GQuark nautilus_burn_mkisofs_error_quark (void);

typedef enum {
	NAUTILUS_BURN_MKISOFS_ERROR_INTERNAL,
	NAUTILUS_BURN_MKISOFS_ERROR_GENERAL
} NautilusBurnMkisofsError;

struct mkisofs_state {
        FILE    *graft_file;
        char    *emptydir;
	int      depth;
        char    *tmpdir;
        char    *copy_to_dir;
        int      copy_depth;
        GList   *remove_files;
        gboolean found_file;
};

struct mkisofs_output {
	GMainLoop  *loop;
	GString    *line;
	GString    *line_stderr;
	time_t      start_time;
	int         result;
	int         pid;
	const char *filename;
	guint64     iso_size;
	GList      *rates;
	GError     *error;
	gboolean    debug;
};

char *		create_graft_file		(GnomeVFSURI			*uri,
						 const char			*prefix,
						 struct mkisofs_state		*state,
						 struct mkisofs_output		*mkisofs_output);
void		graft_file_cleanup		(struct mkisofs_state		*state);
gboolean	ncb_mkisofs_supports_utf8	(void);

G_END_DECLS

#endif /* __MKISOFS_GLUE_H */
