[Pinfo-devel] r136 - pinfo/branches/cxx/src
Nathanael Nerode
neroden-guest at costa.debian.org
Fri Sep 2 06:02:51 UTC 2005
Author: neroden-guest
Date: 2005-09-02 06:02:50 +0000 (Fri, 02 Sep 2005)
New Revision: 136
Modified:
pinfo/branches/cxx/src/initializelinks.cxx
pinfo/branches/cxx/src/initializelinks.h
pinfo/branches/cxx/src/utils.cxx
pinfo/branches/cxx/src/utils.h
Log:
Move compare_tag_table_string from initializelinks.cxx to utils.cxx
Modified: pinfo/branches/cxx/src/initializelinks.cxx
===================================================================
--- pinfo/branches/cxx/src/initializelinks.cxx 2005-09-02 05:58:19 UTC (rev 135)
+++ pinfo/branches/cxx/src/initializelinks.cxx 2005-09-02 06:02:50 UTC (rev 136)
@@ -46,42 +46,7 @@
std::sort(startlink, endlink, compare_hyperlink);
}
-
/*
- * Compares two strings, ignoring whitespaces(tabs, spaces)
- */
-int
-compare_tag_table_string(const char *base, const char *compared)
-{
- int i, j;
-
- j = 0;
-
- for (i = 0; base[i] != 0; i++)
- {
- if (base[i] != compared[j])
- {
- if ((isspace(compared[j])) &&(isspace(base[i]))); /* OK--two blanks */
- else if (isspace(compared[j]))
- i--; /* index of `base' should be unchanged after for's i++ */
- else if (isspace(base[i]))
- j--; /* index of `compared' stands in place
- and waits for base to skip blanks */
- else
- return (int) base[i] -(int) compared[j];
- }
- j++;
- }
- while (compared[j]) /* handle trailing whitespaces of variable `compared' */
- {
- if (!isspace(compared[j]))
- return (int) base[i] -(int) compared[j];
- j++;
- }
- return 0;
-}
-
-/*
* checks if an item belongs to tag table. returns 1 on success and 0 on
* failure. It should be optimised...
*/
Modified: pinfo/branches/cxx/src/initializelinks.h
===================================================================
--- pinfo/branches/cxx/src/initializelinks.h 2005-09-02 05:58:19 UTC (rev 135)
+++ pinfo/branches/cxx/src/initializelinks.h 2005-09-02 06:02:50 UTC (rev 136)
@@ -33,8 +33,6 @@
/* scans for the beginning of username. Returns a pointer to it. */
char *findemailstart (char *str);
-/* strcmp, which is insensitive to whitespaces */
-int compare_tag_table_string (const char *base, const char *compared);
/*
* calculate length of visible part of string ('\t' included) between start and
* end. Returns length.
Modified: pinfo/branches/cxx/src/utils.cxx
===================================================================
--- pinfo/branches/cxx/src/utils.cxx 2005-09-02 05:58:19 UTC (rev 135)
+++ pinfo/branches/cxx/src/utils.cxx 2005-09-02 06:02:50 UTC (rev 136)
@@ -307,7 +307,41 @@
}
}
+/*
+ * Compares two strings, ignoring whitespaces(tabs, spaces)
+ */
int
+compare_tag_table_string(const char *base, const char *compared)
+{
+ int i, j;
+
+ j = 0;
+
+ for (i = 0; base[i] != 0; i++)
+ {
+ if (base[i] != compared[j])
+ {
+ if ((isspace(compared[j])) &&(isspace(base[i]))); /* OK--two blanks */
+ else if (isspace(compared[j]))
+ i--; /* index of `base' should be unchanged after for's i++ */
+ else if (isspace(base[i]))
+ j--; /* index of `compared' stands in place
+ and waits for base to skip blanks */
+ else
+ return (int) base[i] -(int) compared[j];
+ }
+ j++;
+ }
+ while (compared[j]) /* handle trailing whitespaces of variable `compared' */
+ {
+ if (!isspace(compared[j]))
+ return (int) base[i] -(int) compared[j];
+ j++;
+ }
+ return 0;
+}
+
+int
gettagtablepos_search_internal(char *node, int left, int right)
{
/* left+(right-left)/2 */
Modified: pinfo/branches/cxx/src/utils.h
===================================================================
--- pinfo/branches/cxx/src/utils.h 2005-09-02 05:58:19 UTC (rev 135)
+++ pinfo/branches/cxx/src/utils.h 2005-09-02 06:02:50 UTC (rev 136)
@@ -64,6 +64,10 @@
void myclrtoeol ();
/* takes care of the cursor, which is turned off */
void myendwin ();
+
+/* strcmp, which is insensitive to whitespaces */
+int compare_tag_table_string (const char *base, const char *compared);
+
/* get offset of "node" in tag_table variable */
int gettagtablepos (std::string node);
More information about the Pinfo-devel
mailing list