[Pinfo-devel] r135 - pinfo/branches/cxx/src

Nathanael Nerode neroden-guest at costa.debian.org
Fri Sep 2 05:58:20 UTC 2005


Author: neroden-guest
Date: 2005-09-02 05:58:19 +0000 (Fri, 02 Sep 2005)
New Revision: 135

Modified:
   pinfo/branches/cxx/src/filehandling_functions.cxx
   pinfo/branches/cxx/src/initializelinks.cxx
   pinfo/branches/cxx/src/mainfunction.cxx
   pinfo/branches/cxx/src/pinfo.cxx
   pinfo/branches/cxx/src/utils.cxx
   pinfo/branches/cxx/src/utils.h
Log:
Make gettagtablepos take a string argument.


Modified: pinfo/branches/cxx/src/filehandling_functions.cxx
===================================================================
--- pinfo/branches/cxx/src/filehandling_functions.cxx	2005-09-02 05:57:13 UTC (rev 134)
+++ pinfo/branches/cxx/src/filehandling_functions.cxx	2005-09-02 05:58:19 UTC (rev 135)
@@ -409,9 +409,8 @@
 		}
 	}
 
-	/* FIXME: info should ALWAYS start at the 'Top' node, not at the first
+	/* info should ALWAYS start at the 'Top' node, not at the first
 	   mentioned node(vide ocaml.info) */
-
 	for (i = 0; i < tag_table.size(); i++)
 	{
 		if (strcasecmp(tag_table[i].nodename.c_str(), "Top") == 0)

Modified: pinfo/branches/cxx/src/initializelinks.cxx
===================================================================
--- pinfo/branches/cxx/src/initializelinks.cxx	2005-09-02 05:57:13 UTC (rev 134)
+++ pinfo/branches/cxx/src/initializelinks.cxx	2005-09-02 05:58:19 UTC (rev 135)
@@ -88,7 +88,7 @@
 inline int
 exists_in_tag_table(const string item)
 {
-	int result = gettagtablepos(item.c_str());
+	int result = gettagtablepos(item);
 	if (result != -1)
 		return 1;
 	else

Modified: pinfo/branches/cxx/src/mainfunction.cxx
===================================================================
--- pinfo/branches/cxx/src/mainfunction.cxx	2005-09-02 05:57:13 UTC (rev 134)
+++ pinfo/branches/cxx/src/mainfunction.cxx	2005-09-02 05:58:19 UTC (rev 135)
@@ -786,7 +786,7 @@
 					(key == keys.prevnode_2))
 			{
 				string token_str = getprevnode(Type);
-				return_value = gettagtablepos(token_str.c_str());
+				return_value = gettagtablepos(token_str);
 				if (return_value != -1)
 				{
 					infohistory[infohistory.size() - 1].pos = pos;
@@ -805,7 +805,7 @@
 			{
 				string token_str;
 				token_str = getnextnode(Type);
-				return_value = gettagtablepos(token_str.c_str());
+				return_value = gettagtablepos(token_str);
 				if (return_value != -1)
 				{
 					infohistory[infohistory.size() - 1].pos = pos;
@@ -827,7 +827,7 @@
 				{
 					ungetch(keys.dirpage_1);
 				}
-				return_value = gettagtablepos(token_str.c_str());
+				return_value = gettagtablepos(token_str);
 				if (return_value != -1)
 				{
 					if (toggled_by_menu == KEEP_HISTORY)

Modified: pinfo/branches/cxx/src/pinfo.cxx
===================================================================
--- pinfo/branches/cxx/src/pinfo.cxx	2005-09-02 05:57:13 UTC (rev 134)
+++ pinfo/branches/cxx/src/pinfo.cxx	2005-09-02 05:58:19 UTC (rev 135)
@@ -363,7 +363,7 @@
 
 	if (pinfo_start_node != "")
 	{
-		tag_table_pos = gettagtablepos(pinfo_start_node.c_str());
+		tag_table_pos = gettagtablepos(pinfo_start_node);
 		if (tag_table_pos == -1)
 		{
 			printf(_("Specified node does not exist...\n"));
@@ -372,7 +372,7 @@
 	}
 	else
 	{
-		tag_table_pos = gettagtablepos(FirstNodeName.c_str());
+		tag_table_pos = gettagtablepos(FirstNodeName);
 	}
 	/* initialize curses screen interface */
 	init_curses();
@@ -395,7 +395,7 @@
 			/* no cross-file link selected */
 			if (work_return_value.file[0] == 0)
 			{
-				int tmppos = gettagtablepos(work_return_value.node.c_str());
+				int tmppos = gettagtablepos(work_return_value.node);
 				if (tmppos != -1)
 					tag_table_pos = tmppos;
 			}
@@ -405,7 +405,7 @@
 				/* file name was the same with the file currently viewed */
 				if (curfile == work_return_value.file)
 				{
-					int tmppos = gettagtablepos(work_return_value.node.c_str());
+					int tmppos = gettagtablepos(work_return_value.node);
 					if (tmppos != -1)
 						tag_table_pos = tmppos;
 				}
@@ -500,14 +500,14 @@
 						}
 						if (work_return_value.node != "")
 						{
-							int tmptagtablepos = gettagtablepos(work_return_value.node.c_str()	);
+							int tmptagtablepos = gettagtablepos(work_return_value.node);
 							if (tmptagtablepos != -1)
 								tag_table_pos = tmptagtablepos;
 							else
-								tag_table_pos = gettagtablepos(FirstNodeName.c_str());
+								tag_table_pos = gettagtablepos(FirstNodeName);
 						}
 						else
-							tag_table_pos = gettagtablepos(FirstNodeName.c_str());
+							tag_table_pos = gettagtablepos(FirstNodeName);
 						}		/* end: open new info file -- file exists */
 				}		/* end: open new info file */
 			}			/* end: file name was specified */

Modified: pinfo/branches/cxx/src/utils.cxx
===================================================================
--- pinfo/branches/cxx/src/utils.cxx	2005-09-02 05:57:13 UTC (rev 134)
+++ pinfo/branches/cxx/src/utils.cxx	2005-09-02 05:58:19 UTC (rev 135)
@@ -338,10 +338,10 @@
 }
 
 int
-gettagtablepos(const char * node)
+gettagtablepos(string node)
 {
 	int result;
-	char* my_node = strdup(node);
+	char* my_node = strdup(node.c_str());
 	/* strip spaces from the beginning */
 	while (1)
 	{

Modified: pinfo/branches/cxx/src/utils.h
===================================================================
--- pinfo/branches/cxx/src/utils.h	2005-09-02 05:57:13 UTC (rev 134)
+++ pinfo/branches/cxx/src/utils.h	2005-09-02 05:58:19 UTC (rev 135)
@@ -65,7 +65,7 @@
 /* takes care of the cursor, which is turned off */
 void myendwin ();
 /* get offset of "node" in tag_table variable */
-int gettagtablepos (const char * node);
+int gettagtablepos (std::string node);
 
 /* handle localized `(y/n)' dialog box.  */
 int yesno (char *prompt, int def);




More information about the Pinfo-devel mailing list