[Extractor-gtk-cvslog] SF.net SVN: extractor-gtk:[92] trunk/extractor
Extract files from unusual archive formats
Brought to you by:
someone-guy
From: <som...@us...> - 2008-08-22 16:06:41
|
Revision: 92 http://extractor-gtk.svn.sourceforge.net/extractor-gtk/?rev=92&view=rev Author: someone-guy Date: 2008-08-22 16:06:35 +0000 (Fri, 22 Aug 2008) Log Message: ----------- Allow compilation without GTK Modified Paths: -------------- trunk/extractor/Makefile trunk/extractor/extractor.c Modified: trunk/extractor/Makefile =================================================================== --- trunk/extractor/Makefile 2008-08-22 16:06:08 UTC (rev 91) +++ trunk/extractor/Makefile 2008-08-22 16:06:35 UTC (rev 92) @@ -1,6 +1,7 @@ CC=gcc CFLAGS=-Wall -Wdeclaration-after-statement -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -g -O2 GTKFLAGS=`pkg-config --cflags --libs gtk+-2.0` +#GTKFLAGS=-DWITHOUT_GTK #GTKFLAGS=-mms-bitfields -Iinclude libglib-2.0-0.dll libgobject-2.0-0.dll libgdk-win32-2.0-0.dll libgdk_pixbuf-2.0-0.dll libgtk-win32-2.0-0.dll intl.dll #GTKFLAGS+=-mwindows MODULES= \ Modified: trunk/extractor/extractor.c =================================================================== --- trunk/extractor/extractor.c 2008-08-22 16:06:08 UTC (rev 91) +++ trunk/extractor/extractor.c 2008-08-22 16:06:35 UTC (rev 92) @@ -11,7 +11,9 @@ #include <errno.h> #include <unistd.h> #include <inttypes.h> +#ifndef WITHOUT_GTK #include <gtk/gtk.h> +#endif #include <libintl.h> #define _(String) gettext(String) #include "formats.h" @@ -29,6 +31,7 @@ NULL }; +#ifndef WITHOUT_GTK #define SHOW_MSG(t, s, a...) \ {\ GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,\ @@ -59,10 +62,12 @@ static GtkWidget *dir_button; static GtkListStore *gflist; static GtkWidget *treeview; +#endif static FILE *input_file = NULL; static file_t *flist = NULL; static const fmt_desc_t *cur_fmt = NULL; +#ifndef WITHOUT_GTK /** * \brief extracts the file specified by iter * \param data path to extract the file into @@ -134,6 +139,7 @@ } set_treeview_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(gflist)); } +#endif static int open_file(const char *fname, const fmt_desc_t *fmt) { // close previous file and free its data @@ -164,6 +170,7 @@ return 1; } +#ifndef WITHOUT_GTK /** * \brief called when a new archive is selected */ @@ -244,6 +251,7 @@ gtk_widget_show(img); gtk_window_present(GTK_WINDOW(preview_win)); } +#endif static void print_help(void) { int i; @@ -256,6 +264,7 @@ int main(int argc, char *argv[]) { int i; int fmt_idx = -1; +#ifndef WITHOUT_GTK GtkWidget *window; GtkWidget *preview_win; GtkWidget *table; @@ -267,6 +276,7 @@ GtkCellRenderer *renderer; GtkTreeSelection *selection; int row = 0, col = 0; +#endif int list_files = 0; if (argc > 1) { @@ -320,6 +330,7 @@ } } +#ifndef WITHOUT_GTK gtk_disable_setlocale(); gtk_init(&argc, &argv); @@ -429,5 +440,6 @@ gtk_widget_show_all(window); set_treeview(flist); gtk_main(); +#endif return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |