--- gman-0.9.3.orig/context.c +++ gman-0.9.3/context.c @@ -122,7 +122,7 @@ void AppContext::display_values() { - int i,j,k; + int i,j; printf("values:\n"); j = names->get_size(); for(i = 0; iset_default_value("v_size",(void*)400); context->set_default_value("debuging","int",(void*)0); - context->set_default_value("man_paths","char*",(void*)"/usr/man:/usr/local/man:/usr/X11R6/man"); + context->set_default_value("man_paths","char*",(void*)"/usr/share/man:/usr/X11R6/man:/usr/man:/usr/local/man"); context->set_default_value("display_section_policy","int",(void*)0); context->set_default_value("display_section","int",(void*)3); context->set_default_value("searching_mode","int",(void*)0); context->set_default_value("show_status_bar","int",(void*)0); context->set_default_value("show_warning","int",(void*)0); context->set_default_value("show_mode","int",(void*)0); // 0 = xterm, 1 = ghostview - context->set_default_value("xterm_command","char*",(void*)"xterm"); // rxvt, Eterm also works + context->set_default_value("xterm_command","char*",(void*)"x-terminal-emulator"); context->set_default_value("gv_command","char*",(void*)"gv"); - context->set_default_value("browser_command","char*",(void*)"netscape"); // kfm also works + context->set_default_value("browser_command","char*",(void*)"mozilla"); // kfm also works context->set_default_value("cgi_host","char*",(void*)"localhost"); - context->set_default_value("cgi_location","char*",(void*)"/cgi-bin/gman/gman.pl"); + context->set_default_value("cgi_location","char*",(void*)"/cgi-bin/gman.pl"); context->set_default_value("print_command","char*",(void*)"lpr"); // not in use attach(buffer,getenv("HOME"),".gman"); --- gman-0.9.3.orig/mandata.c +++ gman-0.9.3/mandata.c @@ -30,7 +30,6 @@ void attach (char *dest, const char *dirname, const char *name); static int section_translate_c_to_n(const char* c); -static int ManItemComp(ManItem ** a,ManItem ** b); static int is_zip_suffix(char* c); char buffer1[BUFFER_SIZE]; @@ -40,7 +39,6 @@ ManPath::ManPath(char* _path_name) { int i; - int len; active = 1; path_name = my_strdup(_path_name); for (i=0;id_name); //printf("LoadManPath: %s\n",name); val = stat (buffer1, &state); - if (val < 0) fprintf(stderr,"error number %d, in get state %s",errno,buffer1); + if (val < 0) fprintf(stderr,"error getting state of %s: %s\n",buffer1,strerror(errno)); else if (S_ISDIR(state.st_mode) && !strncmp(item->d_name,"man",3)) LoadManSubPath(item->d_name); else { @@ -151,7 +149,7 @@ attach(buffer1,buffer2,item->d_name); //printf("LoadManSubPath: %s\n",full_name); val = stat (buffer1, &state); - if (val < 0) fprintf(stderr,"error number %d, in get state %s\n",errno,buffer1); + if (val < 0) fprintf(stderr,"error getting state of %s: %s\n",buffer1,strerror(errno)); else if (S_ISDIR(state.st_mode)) continue; else { @@ -166,6 +164,7 @@ } } closedir(dirp); + return 0; } ManItem * ManPath::search_man_item(char * name, char * sect) @@ -236,7 +235,6 @@ void ManItem::active_man_page(void) { - int i; int len; char buffer[2*BUFFER_SIZE]; char loc_name[BUFFER_SIZE]; @@ -295,6 +293,7 @@ strcat(buffer,loc_name); strcat(buffer," ; rm ~/.gman.tmp ; sleep 120; rm "); strcat(buffer,loc_name); + fprintf(stderr, "running: %s\n", buffer); g_warning(buffer); if(!fork()) { @@ -307,7 +306,7 @@ case 2: sprintf(loc_name," ~/.gman.%s.html ",get_display_name(buffer1)); //g_warning(loc_name); - strcpy(buffer,"gman.cgi "); + strcpy(buffer,"/usr/lib/cgi-bin/gman.pl "); strcat(buffer," "); strcat(buffer,get_section_name(buffer2)); strcat(buffer," "); @@ -320,6 +319,7 @@ strcat(buffer,loc_name); strcat(buffer," ; sleep 120; rm "); strcat(buffer,loc_name); + fprintf(stderr, "running: %s\n", buffer); //g_warning(buffer); if(!fork()) { @@ -339,6 +339,7 @@ strcat(buffer,"+"); strcat(buffer,get_display_name(loc_name)); strcat(buffer,"\""); + fprintf(stderr, "running: %s\n", buffer); //g_warning(buffer); if(!fork()) { --- gman-0.9.3.orig/menu.c +++ gman-0.9.3/menu.c @@ -33,8 +33,6 @@ #include "window2.h" #include "taskfunc.h" -static int print_hello(GtkWidget *w, gpointer data); -static int test_callback(GtkWidget *w, gpointer data); static int window_resize_callback(GtkWidget *w, GtkAllocation *size, gpointer data); static int section_policy_callback(GtkWidget *w, gpointer data); static int section_select_callback(GtkWidget *w, gpointer data); @@ -60,36 +58,35 @@ static GtkItemFactoryEntry menu_items[] = { {"/_File", NULL, NULL, 0, ""}, - {"/File/_Quit", "Q", (void (*)(...))app_quit, 0, NULL}, + {"/File/_Quit", "Q", (void (*)())app_quit, 0, NULL}, {"/_Sections", NULL, NULL, 0, ""}, {"/Sections/tearoff1", NULL, NULL, 0, "" }, - {"/Sections/_All", NULL, (void (*)(...))section_policy_callback, 0, ""}, - {"/Sections/all _But", NULL, (void (*)(...))section_policy_callback, 1, "/Sections/All"}, - {"/Sections/_Only", NULL, (void (*)(...))section_policy_callback, 2, "/Sections/All"}, + {"/Sections/_All", NULL, (void (*)())section_policy_callback, 0, ""}, + {"/Sections/all _But", NULL, (void (*)())section_policy_callback, 1, "/Sections/All"}, + {"/Sections/_Only", NULL, (void (*)())section_policy_callback, 2, "/Sections/All"}, {"/Sections/sep1", NULL, NULL, 0, ""}, - {"/Sections/_1: User Commands", NULL, (void (*)(...))section_select_callback, 1<<0, ""}, - {"/Sections/_2: System Calls", NULL, (void (*)(...))section_select_callback, 1<<1, ""}, - {"/Sections/_3: Subroutines", NULL, (void (*)(...))section_select_callback, 1<<2, ""}, - {"/Sections/_4: Devices", NULL, (void (*)(...))section_select_callback, 1<<3, ""}, - {"/Sections/_5: File Formats", NULL, (void (*)(...))section_select_callback, 1<<4, ""}, - {"/Sections/_6: Games", NULL, (void (*)(...))section_select_callback, 1<<5, ""}, - {"/Sections/_7: Miscellaneous", NULL, (void (*)(...))section_select_callback, 1<<6, ""}, - {"/Sections/_8: Sys.Administration",NULL, (void (*)(...))section_select_callback, 1<<7, ""}, - {"/Sections/_l: Local", NULL, (void (*)(...))section_select_callback, 1<<8, ""}, - {"/Sections/_n: New", NULL, (void (*)(...))section_select_callback, 1<<9, ""}, + {"/Sections/_1: User Commands", NULL, (void (*)())section_select_callback, 1<<0, ""}, + {"/Sections/_2: System Calls", NULL, (void (*)())section_select_callback, 1<<1, ""}, + {"/Sections/_3: Subroutines", NULL, (void (*)())section_select_callback, 1<<2, ""}, + {"/Sections/_4: Devices", NULL, (void (*)())section_select_callback, 1<<3, ""}, + {"/Sections/_5: File Formats", NULL, (void (*)())section_select_callback, 1<<4, ""}, + {"/Sections/_6: Games", NULL, (void (*)())section_select_callback, 1<<5, ""}, + {"/Sections/_7: Miscellaneous", NULL, (void (*)())section_select_callback, 1<<6, ""}, + {"/Sections/_8: Sys.Administration",NULL, (void (*)())section_select_callback, 1<<7, ""}, + {"/Sections/_l: Local", NULL, (void (*)())section_select_callback, 1<<8, ""}, + {"/Sections/_n: New", NULL, (void (*)())section_select_callback, 1<<9, ""}, {"/_View", NULL, NULL, 0, ""}, - {"/View/x_Term", "T", (void (*)(...))show_mode_callback, 0, ""}, - {"/View/_GhostView", "G", (void (*)(...))show_mode_callback, 1, "/View/xTerm"}, - {"/View/_LocalBrowse", "L", (void (*)(...))show_mode_callback, 2, "/View/xTerm"}, - {"/View/_NetBrowse", "N", (void (*)(...))show_mode_callback, 3, "/View/xTerm"}, + {"/View/x_Term", "T", (void (*)())show_mode_callback, 0, ""}, + {"/View/_GhostView", "G", (void (*)())show_mode_callback, 1, "/View/xTerm"}, + {"/View/_LocalBrowse", "L", (void (*)())show_mode_callback, 2, "/View/xTerm"}, + {"/View/_NetBrowse", "N", (void (*)())show_mode_callback, 3, "/View/xTerm"}, {"/_Options", NULL, NULL, 0, ""}, - {"/Options/Status bar", NULL, (void (*)(...))status_bar_callback, 0, ""}, + {"/Options/Status bar", NULL, (void (*)())status_bar_callback, 0, ""}, {"/Options/sep1", NULL, NULL, 0, ""}, - {"/Options/_Index search", "I", (void (*)(...))search_mode_callback, 0, ""}, - {"/Options/_Key word search", "K", (void (*)(...))search_mode_callback, 1, "/Options/Index search"}, + {"/Options/_Index search", "I", (void (*)())search_mode_callback, 0, ""}, + {"/Options/_Key word search", "K", (void (*)())search_mode_callback, 1, "/Options/Index search"}, {"/Options/sep2", NULL, NULL, 0, ""}, - {"/Options/Man _Paths...", NULL, (void (*)(...))edit_paths_callback, 0, NULL}, - // {"/Options/Test", NULL, (void (*)(...))test_callback, 0, NULL}, + {"/Options/Man _Paths...", NULL, (void (*)())edit_paths_callback, 0, NULL}, {"/_Help", NULL, NULL, 0, ""}, {"/_Help/About", NULL, GTK_SIGNAL_FUNC(window_help_about_callback),0,NULL} }; @@ -246,8 +243,6 @@ GtkWidget * swindow2; GtkWidget * focus; - int k,k2; - ::window = window; gchar *titles[2] = { "Name", "Section" }; gchar *titles2[3] = { "Name", "Section", "Description"}; @@ -260,7 +255,7 @@ GTK_SIGNAL_FUNC(app_quit), 0); - gtk_window_set_title(GTK_WINDOW(window), "G-man"); + gtk_window_set_title(GTK_WINDOW(window), "Gman"); gtk_window_set_policy( GTK_WINDOW( window ), FALSE, TRUE, FALSE ); gtk_window_set_default_size(GTK_WINDOW(window), (int)context->get_value("h_size"), @@ -446,29 +441,6 @@ gtk_clist_select_row(GTK_CLIST(clist),i,0); } -static int print_hello(GtkWidget *w, gpointer data) { - if(signal_menu_change>0) {signal_menu_change--;return 1;} - g_message("Hello, World! %x\n",data); - return 0; -} - -static int print_page(GtkWidget *w, gpointer data) { - if(signal_menu_change>0) {signal_menu_change--;return 1;} - g_message("Hello, World! %x\n",data); - return 0; -} - -static int test_callback(GtkWidget *w, gpointer data) { - int i,j; - if(signal_menu_change>0) {signal_menu_change--;return 1;} - j = man_paths->get_size(); - for(i = 0;iget_value(i))); - delete (man_paths); - init_man_data(); - return 0; -} - static int section_policy_callback(GtkWidget *w, gpointer data) { // static int signal; int k,k2; @@ -485,6 +457,7 @@ pthread_mutex_unlock(&context_lock); task_set_active(task_extract_man_data); task_set_active(task_add_data_to_clist); + return 0; } static int section_select_callback(GtkWidget *w, gpointer data) { @@ -501,6 +474,7 @@ } pthread_mutex_unlock(&context_lock); // g_message("Hello, World! %x\n",data); + return 0; } static void app_quit(GtkWidget *w, gpointer data) { @@ -517,10 +491,10 @@ context->set_value("man_paths","char*",my_strdup(buffer)); attach(buffer,getenv("HOME"),".gman"); if((fd = fopen(buffer,"w"))) { - context->save(fd,"automatically made by G-man"); + context->save(fd,"automatically made by Gman"); fclose(fd); } - // context->save(stdout,"automatically made by G-man"); + // context->save(stdout,"automatically made by Gman"); gtk_exit((int)data); } @@ -544,7 +518,6 @@ { GtkWidget *button; - GdkFont *font; about_window = gtk_dialog_new (); gtk_window_set_position (GTK_WINDOW (about_window), GTK_WIN_POS_MOUSE); @@ -576,6 +549,12 @@ gtk_label_new ("Copyright (C) 1999 Xinkai Wang"), FALSE, FALSE, 5); + char *tmp = g_strdup_printf("Credits: %s", authors[0]); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_window)->vbox), + gtk_label_new (tmp), + FALSE, FALSE, 5); + g_free(tmp); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_window)->vbox), gtk_label_new ("Comments and suggestions are extremely welcomed!"), FALSE, FALSE, 5); @@ -664,4 +643,5 @@ case 1: task_set_stop(task_key_word_search);break; case 2: task_set_active(task_key_word_search);break; } + return 0; } --- gman-0.9.3.orig/task.c +++ gman-0.9.3/task.c @@ -30,7 +30,7 @@ TaskGroup * task_group_new() { - int retcode; + //int retcode; TaskGroup * task_group = (TaskGroup*)g_malloc(sizeof(TaskGroup)); task_group->tasks = new List; task_group->state = 0; @@ -44,7 +44,7 @@ Task * task_new(TaskGroup * task_group, float priority, TaskRunFunc task_func, gpointer data) { - int i,j,k; + int i,j; Task * task; g_return_val_if_fail((priority>0.0 && priority <1.0)&&(task_group != NULL)&&(task_func != NULL),(Task*)NULL); @@ -106,13 +106,13 @@ { int i,j; int have_task; - int state,k; + int state; Task * task; do { have_task = 0; task = (Task *)NULL; - int flag; + int flag = 0; pthread_mutex_lock(&task_group->lock); j = task_group->tasks->get_size(); for(i = 0; iget_item(0); paths->delete_item(0); - strcpy(buffer,"grep "); + strcat(buffer,"whatis -w \"*"); strcat(buffer,keyword); - strcat(buffer," "); - attach(file_name,path,"whatis"); - strcat(buffer,file_name); - strcat(buffer," "); + strcat(buffer,"*\" "); + fprintf (stderr, "%s\n", file_name); g_return_val_if_fail(!pipe(pipes),0); process_ID = fork(); @@ -377,7 +372,8 @@ man_item = (ManItem*)man_path->search_man_item(s,section); //g_print("point 1\n"); if(context->get_value("show_warning")) - if (!man_item) g_warning("man item: %s (%s) could not found",names->get_item(i),section); + if (!man_item) + g_warning("man item: %s (%s) could not be found in %s",names->get_item(i),section,path); text[0] = (char*)names->get_item(i); //g_print("point 2\n"); if(i == j-1) text[2] = comment; --- gman-0.9.3.orig/window2.c +++ gman-0.9.3/window2.c @@ -2,6 +2,7 @@ /******************** window2.c **************************/ #include +#include #include #include "menu.h" #include "list.h" @@ -241,7 +242,7 @@ x = (GtkWidget*)gtk_object_get_data(GTK_OBJECT(window2),"entry2"); c = gtk_entry_get_text(GTK_ENTRY(x)); if(!strcmp(c,"")) { - g_print("g-man: path name can not be empty\n"); + g_print("gman: path name can not be empty\n"); break; } if (man_paths->have_item(c)) break; @@ -268,7 +269,7 @@ gtk_widget_set_sensitive(apply_button,1); break; default: - g_print("g-man: sorry... this function not implementd yet, please wait for the future version\n"); + g_print("gman: sorry... this function not implemented yet\n"); }; return 1; } --- gman-0.9.3.orig/Makefile +++ gman-0.9.3/Makefile @@ -1,55 +1,37 @@ # Gman Makefile # You can adjust the following variables. + CXX = g++ -CXXFLAGS = -DVERSION=\"0.9.3\" `gtk-config --cflags` -O2 -Wall +CXXFLAGS = -DVERSION=\"0.9.3\" $(shell gtk-config --cflags) -O2 -Wall CC = $(CXX) $(CXXFLAGS) -GNOMELIB = #`gnome-config --libs gnomeui` -GTKLIB = -L/usr/lib/ `gtk-config --libs` prefix = /usr -cgi_bin_prefix = /var/www/cgi-bin +cgi_bin_prefix = ${prefix}/lib/cgi-bin # There shouldn't be any need to edit anything below this point. all: gman -gman: menu.o mandata.o util.o gman.o list.o context.o task.o taskfunc.o window2.o - $(CXX) -lgtk -lgdk -lpthread $(GTKLIB) menu.o mandata.o util.o gman.o list.o context.o task.o taskfunc.o window2.o -o gman - -gman.o: gman.c menu.h - $(CC) -c gman.c +objectfiles = menu.o mandata.o util.o gman.o list.o context.o task.o \ + taskfunc.o window2.o -menu.o: menu.c mandata.h util.h - $(CC) -c menu.c -o menu.o +gman: $(objectfiles) + $(CC) -lgtk -lgdk -lpthread $(shell gtk-config --libs) $(objectfiles) -o gman +%.o: %.c %.h +gman.o: gman.c gman.h menu.h +menu.o: menu.c menu.h mandata.h util.h mandata.o: mandata.c mandata.h util.h mandatadef.h - $(CC) -c mandata.c -o mandata.o - -util.o: util.c util.h - $(CC) -c util.c -o util.o - -list.o: list.c list.h - $(CC) -c list.c - -context.o: context.c context.h - $(CC) -c context.c - -task.o: task.c task.h - $(CC) -c task.c - -taskfunc.o: taskfunc.c taskfunc.h - $(CC) -c taskfunc.c - -window2.o: window2.c window2.h - $(CC) -c window2.c clean: - rm -f *.o *~ gman + rm -f $(objectfiles) gman + +distclean: clean + rm -f *.o *~ install: test -d $(prefix)/bin || mkdir -p $(prefix)/bin - test -d $(prefix)/man/man1 || mkdir -p $(prefix)/man/man1 - test -d $(cgi_bin_prefix)/gman || mkdir -p $(cgi_bin_prefix)/gman - install -s -m 755 gman $(prefix)/bin - install -s -m 755 gman.pl $(prefix)/bin/gman.cgi - install -m 644 gman.1x $(prefix)/man/man1 - install -s -m 755 gman.pl $(ci_bin_prefix)/gman + test -d $(prefix)/share/man/man1 || mkdir -p $(prefix)/share/man/man1 + test -d $(cgi_bin_prefix) || mkdir -p $(cgi_bin_prefix) + install -s -m 755 gman $(prefix)/bin/ + install -m 755 gman.pl $(cgi_bin_prefix)/gman.pl + install -m 644 gman.1x $(prefix)/share/man/man1 --- gman-0.9.3.orig/ChangeLog +++ gman-0.9.3/ChangeLog @@ -1,4 +1,4 @@ -ChangeLog for G-man by Xinkai Wang +ChangeLog for Gman by Xinkai Wang v0.9.2 (31.Mar 2001) - CGI front-end for man2html (gman.pl) added. --- gman-0.9.3.orig/README +++ gman-0.9.3/README @@ -71,7 +71,7 @@ * autoconf support, especially if GNOME support is included. * use of gettext for easier translation to other languages. - * improvment for the parser when reading the ~/.gman file (context.c). + * improvement for the parser which reads the ~/.gman file (context.c). * internal method of displaying manual pages, not with xterm. Your comments and suggestions will be the most important for gman --- gman-0.9.3.orig/gman.1x +++ gman-0.9.3/gman.1x @@ -5,46 +5,53 @@ .B gman .SH DESCRIPTION .B Gman -is a front-end for the original -.I man -page system. The most basic job of gman is to build a database for all -the man pages and display them (or part of them) as a list. When -user decides to read a specific man page, +is a front-end for the manual page system. gman builds a database of all the +available man pages and displays them in a list. Clicking on an entry in the +list makes .B gman -will launch a -.I xterm -window and call the traditional man system to display the man page in the -window. -.sp +launch another window with the manual page displayed in it. +.PP .B Gman -can launch more than one window at same time. And user can use -the index/key word search function to look for the man pages that he needs. -.sp +can launch more than one window at same time. The user can use +the index/key word search function to look for the man pages that they need. +.PP It is simple, but it is useful. .SH OPTIONS There are no command line options for gman, for now. + +.SH DISPLAY OPTIONS +Currently gman has 4 different modes to present the man pages, available as +the following items in the \fBView\fP menu: +.TP +.B xTerm +This will launch an X terminal emulator with the \fIman\fP output shown +inside. .sp -Tips: Currently gman have 4 different modes to present the man pages -to you. In the first mode "Xterm", you can add the following line in -your ~/.gman file to select the xterm software which you would like to -use. +You can add the following line to your ~/.gman file in order to select +the preferred X terminal emulator: .sp +.RS 16 xterm_command = rxvt +.RE +.TP +.B GhostView +gman will present man pages in a GhostView window for you to view and print +the man page. .sp -Tips: If GhostView package (command "gv") is aviable on your system. -You may set "View"->"GhostView" and gman will present man pages with a -ghostview window for you to view and print the man page. -.sp -Tips: If you have netscape on your system, you may set -"View"->"LocalBrowse" and gman will launch a netscape window to show -you the man page. -.sp -Tips: If you have netscape and apache server running ( defult -cgi-bin directory is "/var/www/cgi-bin") , you may enjoy the full -NetBrowse mode by set "View"->"NetBrowse". In this mode, you can view -the pages with netscape browser and navigate from one man page to -another (by click the links in the man pages). This mode is very -useful. +This requires GhostView (command "gv") to be available on your system. +.TP +.B LocalBrowse +gman will launch a Mozilla window to show you the man page. +.sp +This requires man2html and Mozilla (command "mozilla") to be available on your +system. +.TP +.B NetBrowse +In this mode, you can view the pages with Mozilla and navigate from +one man page to another by clicking the links in the man pages. +.sp +This requires man2html, Mozilla (command "mozilla") and a HTTP server +running on localhost. .SH FILES .TP @@ -71,8 +78,13 @@ .BR man (1), .BR man (7), .BR xterm (1). + .SH AUTHOR .B Gman -was written by a smart gay named Xinkai Wang . Home page of gman is at: +was written by a smart guy named Xinkai Wang . +.PP +Home page of gman is at: .br -.I http://homex.coolconnect.com/user/xkwang/gman/ +.UR +http://homex.coolconnect.com/user/xkwang/gman/ +.UE --- gman-0.9.3.orig/gman.pl +++ gman-0.9.3/gman.pl @@ -1,18 +1,30 @@ -#!/usr/bin/perl -use strict(all); +#!/usr/bin/perl -w +use strict; -my $cgi_path = "/cgi-bin/gman/gman.pl"; -my $man2html = "man2html -M $cgi_path"; -my $path = `man -w @ARGV`; -my $tmp_file = "/tmp/gman.$ARGV[1].$ARGV[0]"; +if (@ARGV != 2) { + print <<_EOF_; +Content-type: text/html +gman.pl: invalid use + +

gman.pl cannot be used without arguments.

+ +_EOF_ + die; +} -if (!&file_exist($path)) { - my $name = lc($ARGV[1]); - $path = `man -w $ARGV[0] $name`; -# print "check point 0.9\n"; +my $section = $ARGV[0]; # should also have some sanity check +my $name = $ARGV[1]; +my $man2html = "/usr/lib/cgi-bin/man2html"; +my $path = `man -w $section $name`; chomp $path; $path =~ s/\s*$//; + +unless (-s "$path") { + warn "not -s $path\n"; + $name = lc $name; + $path = `man -w $section $name`; chomp $path; $path =~ s/\s*$//; } -if (!&file_exist($path)) { +unless (-s "$path") { + warn "not -s $path\n"; print <404 Not Found

Not Found

-The requested man page $ARGV[1]($ARGV[0]) was not found on this server.

+The requested man page $name($section) was not found on this server. end_of_line die; } -my $page; -if ($path =~ /gz$/) { - my $file = `gzip -cd $path`; - open (TEMPFILE,">$tmp_file"); - print TEMPFILE $file; - close (TEMPFILE); - $page = `$man2html $tmp_file`; - `rm $tmp_file`; -} else { - $page = `$man2html $path`; -} -$page =~ s/This document was created by\s*man2html<\/A>,\s*using the manual pages.
/This document was created by -
man2html<\/A> for gman<\/A>, -using the manual pages.
/; -print $page; -#print `cat /home/wxk/src/gtk/gman.html`; +my $page = `$man2html $path`; -sub file_exist { - open (FILE,$_[0]); - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) = stat(FILE); - close(FILE); - -# print "check point 0.5, size = $size, $_[0]\n"; - if ($size == 0 or $size eq null) { - return 0; - } else { - return 1; - } -} +# $page =~ s/^Content-type: text\/html\n\n// if (not run as cgi...); + +$page =~ s/(This document was created by\n
man2html<\/a>)(,\nusing the manual pages.
)/$1 for
gman<\/a>$2/io; + +print $page; --- gman-0.9.3.orig/debian/changelog +++ gman-0.9.3/debian/changelog @@ -0,0 +1,75 @@ +gman (0.9.3-2) unstable; urgency=low + + * Recompiled with new maintainer address, new gcc, new standards version. + + -- Josip Rodin Thu, 3 Jul 2003 00:56:58 +0200 + +gman (0.9.3-1) unstable; urgency=low + + * New upstream version, closes: #156493. + * Severe hacking around the CGI crap. + + -- Josip Rodin Tue, 13 Aug 2002 15:28:34 +0200 + +gman (0.0.8-6) unstable; urgency=low + + * Added patches kindly provided by Gergely Nagy to make it compile + with GCC 3.0 on i386 and hppa, closes: #104806. We'll see about the + rest. + * Polishing. + + -- Josip Rodin Sat, 14 Jul 2001 17:29:38 +0200 + +gman (0.0.8-5) unstable; urgency=low + + * Added libjpeg62-dev to build-dependencies, closes: #76913. + + -- Josip Rodin Sun, 19 Nov 2000 20:21:50 +0100 + +gman (0.0.8-4) unstable; urgency=low + + * Added Provides: man-browser. + * Clarified the error message when a manual page can't be found + (2=ENOENT). The listed file may exist, but it is a broken symlink in the + end. Considering man-db also displays such messages, this closes: #50444. + * Partially fixed sorting thanks to Paul Harris , + closes: #75282. I don't know how I didn't notice that this doesn't + work. :/ If you have n defined manpaths, it will give 1 clickable result + and n-1 copies, clicking on which will fail. Oh well. At least the + warning message will display in which directory it failed. :) + * Policy 3.2.1 compliance. + + -- Josip Rodin Fri, 28 Jan 2000 18:24:19 +0100 + +gman (0.0.8-3) unstable; urgency=low + + * Depend on 'xterm | x-terminal-emulator', invoke x-terminal-emulator + by default, closes: #50484. + * Fix the default manpath. + * Standards-Version: 3.1.1. Added Build-Depends:. + + -- Josip Rodin Sun, 28 Nov 1999 18:04:49 +0100 + +gman (0.0.8-2) unstable; urgency=low + + * Fixed discarding a const in window2.c, the one-liner kindly provided + by Edward Brocklesby (larne), closes: #50345. + + -- Josip Rodin Wed, 17 Nov 1999 11:36:33 +0100 + +gman (0.0.8-1) unstable; urgency=low + + * Initial Release. + * menu.c: replaced GNOMEized "About" menu entry with GTK+ code, to + remove the dependency on GNOME libs (which is pointless). Removed + tiny GNOME references from the rest of the code. + * Makefile: various portability changes. Used some nifty shortcuts to + reduce it twice in size. + * gman.c: added usr/share/man to default manpath. + * mandata.c: appended ' manual page' to the XTerm window title. + * Various spelling/style/grammar fixes in the documentation. + * Lots of small fixes in *.c to clean up warnings with "-Wall". + * Changed all references to "G-man" to "Gman", as that is the real name. + * Wrote gman.1x manual page. + + -- Josip Rodin Tue, 12 Oct 1999 14:31:42 +0200 --- gman-0.9.3.orig/debian/copyright +++ gman-0.9.3/debian/copyright @@ -0,0 +1,24 @@ +This package was debianized by Josip Rodin on +Tue, 12 Oct 1999 14:31:42 +0200. + +It was downloaded from: http://homex.coolconnect.com/user/xkwang/gman/ + +Upstream author: Xinkai Wang . + + Copyright (C) 1999 Xinkai Wang + + 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. + +The full text of the GNU GPL can be found in /usr/share/common-licenses/GPL. --- gman-0.9.3.orig/debian/control +++ gman-0.9.3/debian/control @@ -0,0 +1,22 @@ +Source: gman +Section: doc +Priority: optional +Maintainer: Josip Rodin +Build-Depends: debhelper (>= 2), xlibs-dev, libglib1.2-dev, libgtk1.2-dev, libjpeg62-dev +Standards-Version: 3.6.0 + +Package: gman +Architecture: any +Depends: ${shlibs:Depends}, man-db, xterm | x-terminal-emulator +Suggests: gv, man2html, httpd +Provides: man-browser +Description: small man(1) front-end for X + Gman is nothing else but only a simple front-end for the original man + page system. The most basic job of gman is to build a database for all + the man pages and display them (or part of them) on the screen. When + user decides to read a man page, gman will launch a terminal window and + call the original man system to display the man page in the window. + . + Gman can launch more than one terminal window at same time. And user can + use the index search function to look for the man pages that he needs. + It's simple, but it's useful. --- gman-0.9.3.orig/debian/rules +++ gman-0.9.3/debian/rules @@ -0,0 +1,50 @@ +#!/usr/bin/make -f +# Derived from debhelper's sample rules file. + +#export DH_VERBOSE=1 +export DH_COMPAT=2 + +ifneq "$(findstring debug,$(DEB_BUILD_OPTIONS))" "" +DEBUG := -g +endif + +build: build-stamp +build-stamp: + dh_testdir + $(MAKE) DEBUG="$(DEBUG)" + touch $@ + +clean: + dh_testdir + dh_testroot + $(MAKE) clean + dh_clean build-stamp + +install: build + dh_testdir + dh_testroot + dh_clean -k + $(MAKE) install prefix=$(CURDIR)/debian/gman/usr + +binary-indep: +# There are no architecture-independent files here. + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs README AUTHORS + dh_installmenu + dh_installchangelogs ChangeLog +ifeq "$(findstring nostrip,$(DEB_BUILD_OPTIONS))" "" + dh_strip +endif + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- gman-0.9.3.orig/debian/menu +++ gman-0.9.3/debian/menu @@ -0,0 +1 @@ +?package(gman): needs="X11" section="Help" title="Gman" command="gman"