--- XFree86-4.2.99.3/xc/programs/xman/vendor.h.xman-bzip2 2002-09-21 04:38:25.000000000 +0200 +++ XFree86-4.2.99.3/xc/programs/xman/vendor.h 2002-12-23 13:13:22.000000000 +0100 @@ -131,6 +131,13 @@ # define GUNZIP_FORMAT "gzip -c -d < %s >> %s" # endif # define GZIP_COMPRESS "gzip" +# define BZIP2_EXTENSION "bz2" +# ifndef HAS_MKSTEMP +# define BUNZIP2_FORMAT "bunzip2 -c -d < %s > %s" +# else +# define BUNZIP2_FORMAT "bunzip2 -c -d < %s >> %s" +# endif +# define BZIP2_COMPRESS "bzip2" #endif @@ -178,7 +185,7 @@ # endif #else /* HANDLE_ROFFSEQ */ # if defined(linux) -# define ZSOELIM "zsoelim" +# define ZSOELIM "soelim" # define EQN "geqn" # define TBL "gtbl" # else --- XFree86-4.2.99.3/xc/programs/xman/man.c.xman-bzip2 2002-08-05 03:47:34.000000000 +0200 +++ XFree86-4.2.99.3/xc/programs/xman/man.c 2002-12-23 13:13:22.000000000 +0100 @@ -446,6 +446,10 @@ else if (streq(ptr + 1, GZIP_EXTENSION)) *ptr = '\0'; #endif +#ifdef BZIP2_EXTENSION + else if (streq(ptr + 1, BZIP2_EXTENSION)) + *ptr = '\0'; +#endif } nentries = local_manual->nentries; @@ -484,6 +488,10 @@ else if (streq(ptr + 1, GZIP_EXTENSION)) *ptr = '\0'; #endif +#ifdef BZIP2_EXTENSION + else if (streq(ptr + 1, BZIP2_EXTENSION)) + *ptr = '\0'; +#endif } local_manual->entries[nentries] = StrAlloc(full_name); local_manual->entries_less_paths[nentries] = --- XFree86-4.2.99.3/xc/programs/xman/misc.c.xman-bzip2 2001-12-28 18:09:08.000000000 +0100 +++ XFree86-4.2.99.3/xc/programs/xman/misc.c 2002-12-23 13:13:22.000000000 +0100 @@ -252,6 +252,14 @@ return(file); } #endif +#ifdef BZIP2_EXTENSION + { + sprintf(filename, "%s/%s%s/%s.%s", path, CAT, + section + len_cat, page, BZIP2_EXTENSION); + if ( (file = Uncompress(man_globals, filename)) != NULL) + return(file); + } +#endif #else for(i = 0; i < strlen(COMPRESSION_EXTENSIONS); i++) { sprintf(filename, "%s/%s%s/%s.%c", path, CAT, @@ -378,6 +386,12 @@ sprintf(cmdbuf, GUNZIP_FORMAT, filename, output); else #endif +#ifdef BZIP2_EXTENSION + if (streq(filename + strlen(filename) - strlen(BZIP2_EXTENSION), + BZIP2_EXTENSION)) + sprintf(cmdbuf, BUNZIP2_FORMAT, filename, output); + else +#endif sprintf(cmdbuf, UNCOMPRESS_FORMAT, filename, output); if(system(cmdbuf) == 0) /* execute search. */ return(TRUE); @@ -726,6 +740,8 @@ ParseEntry(entry, path, section, page); + man_globals->bzip2 = FALSE; + #if defined(__OpenBSD__) || defined(__NetBSD__) /* * look for uncomressed file in machine subdir first @@ -770,6 +786,25 @@ } #endif /* GZIP_EXTENSION */ #endif /* __OpenBSD__ || __NetBSD__ */ + +#ifdef BZIP2_EXTENSION + { + sprintf(input, "%s.%s", filename, BZIP2_EXTENSION); +#ifndef HAS_MKSTEMP + if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = TRUE; + man_globals->gzip = FALSE; + man_globals->bzip2 = TRUE; + sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, + CAT, section + len_cat, page, BZIP2_EXTENSION); + return(TRUE); + } + } +#endif /* BZIP2_EXTENSION */ + /* * Look for uncompressed file first. */ @@ -814,6 +849,24 @@ } } #endif + +#ifdef BZIP2_EXTENSION + { + sprintf(input, "%s.%s", filename, BZIP2_EXTENSION); +#ifndef HAS_MKSTEMP + if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = TRUE; + man_globals->gzip = TRUE; + sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, + CAT, section + len_cat, page, BZIP2_EXTENSION); + return(TRUE); + } + } +#endif + /* * And lastly files in a compressed directory. */ --- XFree86-4.2.99.3/xc/programs/xman/man.h.xman-bzip2 2001-07-25 17:05:27.000000000 +0200 +++ XFree86-4.2.99.3/xc/programs/xman/man.h 2002-12-23 13:13:22.000000000 +0100 @@ -146,6 +146,7 @@ page from. */ Boolean compress; /* Compress file on save? */ Boolean gzip; /* Gzip file on save? */ + Boolean bzip2; /* Bzip2 file on save? */ char ** section_name; /* The name of each of the sections */ ManPageWidgets manpagewidgets; /* The manpage widgets. */