[Pinfo-devel] r81 - pinfo/branches/cxx/src
Nathanael Nerode
neroden-guest at costa.debian.org
Tue Aug 30 08:52:32 UTC 2005
Author: neroden-guest
Date: 2005-08-30 08:52:32 +0000 (Tue, 30 Aug 2005)
New Revision: 81
Modified:
pinfo/branches/cxx/src/datatypes.cxx
pinfo/branches/cxx/src/datatypes.h
pinfo/branches/cxx/src/parse_config.cxx
pinfo/branches/cxx/src/pinfo.cxx
Log:
More conversion of globals. Also, cleanup of extern declarations in .cxx files.
Modified: pinfo/branches/cxx/src/datatypes.cxx
===================================================================
--- pinfo/branches/cxx/src/datatypes.cxx 2005-08-30 08:39:26 UTC (rev 80)
+++ pinfo/branches/cxx/src/datatypes.cxx 2005-08-30 08:52:32 UTC (rev 81)
@@ -36,8 +36,8 @@
string printutility = "lpr";
string manlinks = "1:8:2:3:4:5:6:7:9:n:l:p:o:3X11:3Xt:3X:3x";
string configuredinfopath = "/usr/share/info:/usr/local/share/info:/opt/info";
-char *ignoredmacros = 0;
-char *rcfile = NULL;
+string ignoredmacros = "";
+string rcfile = "";
char *tmpfilename1 = 0;
char *tmpfilename2 = 0;
Modified: pinfo/branches/cxx/src/datatypes.h
===================================================================
--- pinfo/branches/cxx/src/datatypes.h 2005-08-30 08:39:26 UTC (rev 80)
+++ pinfo/branches/cxx/src/datatypes.h 2005-08-30 08:52:32 UTC (rev 81)
@@ -110,9 +110,9 @@
/* configured paths to infopages */
extern std::string configuredinfopath;
/* groff/troff macros which are removed while preformatting manual page */
-extern char *ignoredmacros;
+extern std::string ignoredmacros;
/* a user specified rc file */
-extern char *rcfile;
+extern std::string rcfile;
/* temporary filename */
extern char *tmpfilename1;
@@ -187,6 +187,12 @@
/* set by SIGWINCH handler */
extern int winchanged;
+/* Needed by parse_config.cxx */
+extern int use_raw_filename;
+
+/* Needed by parse_config.cxx, in pinfo.cxx */
+extern int DontHandleWithoutTagTable;
+
/* initialize history (see struct above) * variables for `lastread' history */
void inithistory ();
/* adds a history entry to the info file `lastread' history */
Modified: pinfo/branches/cxx/src/parse_config.cxx
===================================================================
--- pinfo/branches/cxx/src/parse_config.cxx 2005-08-30 08:39:26 UTC (rev 80)
+++ pinfo/branches/cxx/src/parse_config.cxx 2005-08-30 08:52:32 UTC (rev 81)
@@ -33,17 +33,6 @@
regex_t *h_regexp = 0; /* regexps to highlight */
int h_regexp_num = 0; /* number of those regexps */
-extern int use_apropos;
-extern int CutManHeaders;
-extern int DontHandleWithoutTagTable;
-extern int use_manual;
-extern int use_raw_filename;
-extern int quote_ignored;
-extern string httpviewer;
-extern string ftpviewer;
-extern string maileditor;
-extern char *ignoredmacros;
-
struct keybindings keys =
{
's', 'S', /* regexp search */
@@ -110,13 +99,13 @@
string home;
FILE *f;
- if (rcfile != NULL) { /* User specified config file */
- f = fopen(rcfile, "r");
+ if (rcfile != "") { /* User specified config file */
+ f = fopen(rcfile.c_str(), "r");
if (f == NULL) {
fprintf(stderr, _("Can't open config file!\n"));
exit(1);
}
- } else { /* rcfile == NULL */
+ } else { /* rcfile == "" */
char* rawhome = getenv("HOME");
if (rawhome != NULL)
home = rawhome;
@@ -750,11 +739,13 @@
if (temp)
{
string tmpstr = temp;
- string tmpstr2 = remove_quotes(tmpstr);
- ignoredmacros = strdup(tmpstr2.c_str());
- if (ignoredmacros[0] == '\t' || ignoredmacros[0] == ' '
- || !strncasecmp(ignoredmacros, "FALSE", 5))
- ignoredmacros[0] = '\0';
+ ignoredmacros = remove_quotes(tmpstr);
+ if ( ignoredmacros[0] == '\t'
+ || ignoredmacros[0] == ' '
+ || ignoredmacros.compare(0,5,"FALSE") == 0
+ ) {
+ ignoredmacros = "";
+ }
}
else
return 1;
Modified: pinfo/branches/cxx/src/pinfo.cxx
===================================================================
--- pinfo/branches/cxx/src/pinfo.cxx 2005-08-30 08:39:26 UTC (rev 80)
+++ pinfo/branches/cxx/src/pinfo.cxx 2005-08-30 08:52:32 UTC (rev 81)
@@ -101,7 +101,7 @@
printf(_("--rcfile option used without argument\n"));
exit(1);
}
- rcfile = strdup(optarg);
+ rcfile = optarg;
/* parse user-defined config file */
parse_config();
break;
More information about the Pinfo-devel
mailing list