[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/util install-info.c,1.7,1.8
From: |
karl |
Subject: |
texinfo/util install-info.c,1.7,1.8 |
Date: |
Mon, 29 Mar 2004 14:44:26 +0200 |
Update of /cvsroot/texinfo/texinfo/util
In directory sheep:/tmp/cvs-serv28395
Modified Files:
install-info.c
Log Message:
(menu_line_lessp, menu_line_equal): move to before
all uses.
Index: install-info.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/install-info.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** install-info.c 27 Mar 2004 15:33:03 -0000 1.7
--- install-info.c 29 Mar 2004 12:44:23 -0000 1.8
***************
*** 205,208 ****
--- 205,262 ----
}
+ /* Compare the menu item names in LINE1 (line length LEN1)
+ and LINE2 (line length LEN2). Return 1 if the item name
+ in LINE1 is less, 0 otherwise. */
+
+ static int
+ menu_line_lessp (char *line1, int len1, char *line2, int len2)
+ {
+ int minlen = (len1 < len2 ? len1 : len2);
+ int i;
+
+ for (i = 0; i < minlen; i++)
+ {
+ /* If one item name is a prefix of the other,
+ the former one is less. */
+ if (line1[i] == ':' && line2[i] != ':')
+ return 1;
+ if (line2[i] == ':' && line1[i] != ':')
+ return 0;
+ /* If they both continue and differ, one is less. */
+ if (line1[i] < line2[i])
+ return 1;
+ if (line1[i] > line2[i])
+ return 0;
+ }
+ /* With a properly formatted dir file,
+ we can only get here if the item names are equal. */
+ return 0;
+ }
+
+ /* Compare the menu item names in LINE1 (line length LEN1)
+ and LINE2 (line length LEN2). Return 1 if the item names are equal,
+ 0 otherwise. */
+
+ static int
+ menu_line_equal (char *line1, int len1, char *line2, int len2)
+ {
+ int minlen = (len1 < len2 ? len1 : len2);
+ int i;
+
+ for (i = 0; i < minlen; i++)
+ {
+ /* If both item names end here, they are equal. */
+ if (line1[i] == ':' && line2[i] == ':')
+ return 1;
+ /* If they both continue and differ, one is less. */
+ if (line1[i] != line2[i])
+ return 0;
+ }
+ /* With a properly formatted dir file,
+ we can only get here if the item names are equal. */
+ return 1;
+ }
+
+
/* Given the full text of a menu entry, null terminated,
return just the menu item name (copied). */
***************
*** 1451,1509 ****
return lines;
}
-
- /* Compare the menu item names in LINE1 (line length LEN1)
- and LINE2 (line length LEN2). Return 1 if the item name
- in LINE1 is less, 0 otherwise. */
-
- int
- menu_line_lessp (char *line1, int len1, char *line2, int len2)
- {
- int minlen = (len1 < len2 ? len1 : len2);
- int i;
-
- for (i = 0; i < minlen; i++)
- {
- /* If one item name is a prefix of the other,
- the former one is less. */
- if (line1[i] == ':' && line2[i] != ':')
- return 1;
- if (line2[i] == ':' && line1[i] != ':')
- return 0;
- /* If they both continue and differ, one is less. */
- if (line1[i] < line2[i])
- return 1;
- if (line1[i] > line2[i])
- return 0;
- }
- /* With a properly formatted dir file,
- we can only get here if the item names are equal. */
- return 0;
- }
-
- /* Compare the menu item names in LINE1 (line length LEN1)
- and LINE2 (line length LEN2). Return 1 if the item names are equal,
- 0 otherwise. */
-
- int
- menu_line_equal (char *line1, int len1, char *line2, int len2)
- {
- int minlen = (len1 < len2 ? len1 : len2);
- int i;
-
- for (i = 0; i < minlen; i++)
- {
- /* If both item names end here, they are equal. */
- if (line1[i] == ':' && line2[i] == ':')
- return 1;
- /* If they both continue and differ, one is less. */
- if (line1[i] != line2[i])
- return 0;
- }
- /* With a properly formatted dir file,
- we can only get here if the item names are equal. */
- return 1;
- }
-
-
/* This is the comparison function for qsort for a vector of pointers to
--- 1505,1508 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/util install-info.c,1.7,1.8,
karl <=