]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/help-index.c
801f088fda8df867cb5b77bbc62a9272c42062b2
4 * Online help index routines for CUPS.
6 * Copyright 2007-2012 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
17 * helpDeleteIndex() - Delete an index, freeing all memory used.
18 * helpFindNode() - Find a node in an index.
19 * helpLoadIndex() - Load a help index from disk.
20 * helpSaveIndex() - Save a help index to disk.
21 * helpSearchIndex() - Search an index.
22 * help_add_word() - Add a word to a node.
23 * help_compile_search() - Convert a search string into a regular expression.
24 * help_delete_node() - Free all memory used by a node.
25 * help_delete_word() - Free all memory used by a word.
26 * help_load_directory() - Load a directory of files into an index.
27 * help_load_file() - Load a HTML files into an index.
28 * help_new_node() - Create a new node and add it to an index.
29 * help_sort_nodes_by_name() - Sort nodes by section, filename, and anchor.
30 * help_sort_nodes_by_score() - Sort nodes by score and text.
31 * help_sort_words() - Sort words alphabetically.
35 * Include necessary headers...
38 #include "cgi-private.h"
43 * List of common English words that should not be indexed...
46 static char help_common_words
[][6] =
151 static help_word_t
*help_add_word(help_node_t
*n
, const char *text
);
152 static void help_delete_node(help_node_t
*n
);
153 static void help_delete_word(help_word_t
*w
);
154 static int help_load_directory(help_index_t
*hi
,
155 const char *directory
,
156 const char *relative
);
157 static int help_load_file(help_index_t
*hi
,
158 const char *filename
,
159 const char *relative
,
161 static help_node_t
*help_new_node(const char *filename
, const char *anchor
,
162 const char *section
, const char *text
,
163 time_t mtime
, off_t offset
,
165 __attribute__((nonnull(1,3,4)));
166 static int help_sort_by_name(help_node_t
*p1
, help_node_t
*p2
);
167 static int help_sort_by_score(help_node_t
*p1
, help_node_t
*p2
);
168 static int help_sort_words(help_word_t
*w1
, help_word_t
*w2
);
172 * 'helpDeleteIndex()' - Delete an index, freeing all memory used.
176 helpDeleteIndex(help_index_t
*hi
) /* I - Help index */
178 help_node_t
*node
; /* Current node */
181 DEBUG_printf(("helpDeleteIndex(hi=%p)", hi
));
186 for (node
= (help_node_t
*)cupsArrayFirst(hi
->nodes
);
188 node
= (help_node_t
*)cupsArrayNext(hi
->nodes
))
191 help_delete_node(node
);
194 cupsArrayDelete(hi
->nodes
);
195 cupsArrayDelete(hi
->sorted
);
202 * 'helpFindNode()' - Find a node in an index.
205 help_node_t
* /* O - Node pointer or NULL */
206 helpFindNode(help_index_t
*hi
, /* I - Index */
207 const char *filename
, /* I - Filename */
208 const char *anchor
) /* I - Anchor */
210 help_node_t key
; /* Search key */
213 DEBUG_printf(("helpFindNode(hi=%p, filename=\"%s\", anchor=\"%s\")",
214 hi
, filename
, anchor
));
217 * Range check input...
220 if (!hi
|| !filename
)
224 * Initialize the search key...
227 key
.filename
= (char *)filename
;
228 key
.anchor
= (char *)anchor
;
231 * Return any match...
234 return ((help_node_t
*)cupsArrayFind(hi
->nodes
, &key
));
239 * 'helpLoadIndex()' - Load a help index from disk.
242 help_index_t
* /* O - Index pointer or NULL */
243 helpLoadIndex(const char *hifile
, /* I - Index filename */
244 const char *directory
) /* I - Directory that is indexed */
246 help_index_t
*hi
; /* Help index */
247 cups_file_t
*fp
; /* Current file */
248 char line
[2048], /* Line from file */
249 *ptr
, /* Pointer into line */
250 *filename
, /* Filename in line */
251 *anchor
, /* Anchor in line */
252 *sectptr
, /* Section pointer in line */
253 section
[1024], /* Section name */
254 *text
; /* Text in line */
255 time_t mtime
; /* Modification time */
256 off_t offset
; /* Offset into file */
257 size_t length
; /* Length in bytes */
258 int update
; /* Update? */
259 help_node_t
*node
; /* Current node */
260 help_word_t
*word
; /* Current word */
263 DEBUG_printf(("helpLoadIndex(hifile=\"%s\", directory=\"%s\")",
267 * Create a new, empty index.
270 if ((hi
= (help_index_t
*)calloc(1, sizeof(help_index_t
))) == NULL
)
273 hi
->nodes
= cupsArrayNew((cups_array_func_t
)help_sort_by_name
, NULL
);
274 hi
->sorted
= cupsArrayNew((cups_array_func_t
)help_sort_by_score
, NULL
);
276 if (!hi
->nodes
|| !hi
->sorted
)
278 cupsArrayDelete(hi
->nodes
);
279 cupsArrayDelete(hi
->sorted
);
285 * Try loading the existing index file...
288 if ((fp
= cupsFileOpen(hifile
, "r")) != NULL
)
291 * Lock the file and then read the first line...
296 if (cupsFileGets(fp
, line
, sizeof(line
)) && !strcmp(line
, "HELPV2"))
299 * Got a valid header line, now read the data lines...
304 while (cupsFileGets(fp
, line
, sizeof(line
)))
307 * Each line looks like one of the following:
309 * filename mtime offset length "section" "text"
310 * filename#anchor offset length "text"
317 * Read a word in the current node...
320 if (!node
|| (ptr
= strrchr(line
, ' ')) == NULL
)
323 if ((word
= help_add_word(node
, ptr
+ 1)) != NULL
)
324 word
->count
= atoi(line
+ 1);
334 if ((ptr
= strchr(line
, ' ')) == NULL
)
337 while (isspace(*ptr
& 255))
340 if ((anchor
= strrchr(filename
, '#')) != NULL
)
346 mtime
= strtol(ptr
, &ptr
, 10);
348 offset
= strtoll(ptr
, &ptr
, 10);
349 length
= strtoll(ptr
, &ptr
, 10);
351 while (isspace(*ptr
& 255))
366 while (*ptr
&& *ptr
!= '\"')
374 strlcpy(section
, sectptr
, sizeof(section
));
376 while (isspace(*ptr
& 255))
386 while (*ptr
&& *ptr
!= '\"')
394 if ((node
= help_new_node(filename
, anchor
, section
, text
,
395 mtime
, offset
, length
)) == NULL
)
400 cupsArrayAdd(hi
->nodes
, node
);
409 * Scan for new/updated files...
412 update
= help_load_directory(hi
, directory
, NULL
);
415 * Remove any files that are no longer installed...
418 for (node
= (help_node_t
*)cupsArrayFirst(hi
->nodes
);
420 node
= (help_node_t
*)cupsArrayNext(hi
->nodes
))
424 * Delete this node...
427 cupsArrayRemove(hi
->nodes
, node
);
428 help_delete_node(node
);
432 * Add nodes to the sorted array...
435 for (node
= (help_node_t
*)cupsArrayFirst(hi
->nodes
);
437 node
= (help_node_t
*)cupsArrayNext(hi
->nodes
))
438 cupsArrayAdd(hi
->sorted
, node
);
441 * Save the index if we updated it...
445 helpSaveIndex(hi
, hifile
);
448 * Return the index...
456 * 'helpSaveIndex()' - Save a help index to disk.
459 int /* O - 0 on success, -1 on error */
460 helpSaveIndex(help_index_t
*hi
, /* I - Index */
461 const char *hifile
) /* I - Index filename */
463 cups_file_t
*fp
; /* Index file */
464 help_node_t
*node
; /* Current node */
465 help_word_t
*word
; /* Current word */
468 DEBUG_printf(("helpSaveIndex(hi=%p, hifile=\"%s\")", hi
, hifile
));
471 * Try creating a new index file...
474 if ((fp
= cupsFileOpen(hifile
, "w9")) == NULL
)
478 * Lock the file while we write it...
483 cupsFilePuts(fp
, "HELPV2\n");
485 for (node
= (help_node_t
*)cupsArrayFirst(hi
->nodes
);
487 node
= (help_node_t
*)cupsArrayNext(hi
->nodes
))
490 * Write the current node with/without the anchor...
495 if (cupsFilePrintf(fp
, "%s#%s " CUPS_LLFMT
" " CUPS_LLFMT
" \"%s\"\n",
496 node
->filename
, node
->anchor
,
497 CUPS_LLCAST node
->offset
, CUPS_LLCAST node
->length
,
503 if (cupsFilePrintf(fp
, "%s %d " CUPS_LLFMT
" " CUPS_LLFMT
" \"%s\" \"%s\"\n",
504 node
->filename
, (int)node
->mtime
,
505 CUPS_LLCAST node
->offset
, CUPS_LLCAST node
->length
,
506 node
->section
? node
->section
: "", node
->text
) < 0)
511 * Then write the words associated with the node...
514 for (word
= (help_word_t
*)cupsArrayFirst(node
->words
);
516 word
= (help_word_t
*)cupsArrayNext(node
->words
))
517 if (cupsFilePrintf(fp
, " %d %s\n", word
->count
, word
->text
) < 0)
523 if (cupsFileClose(fp
) < 0)
533 * 'helpSearchIndex()' - Search an index.
536 help_index_t
* /* O - Search index */
537 helpSearchIndex(help_index_t
*hi
, /* I - Index */
538 const char *query
, /* I - Query string */
539 const char *section
, /* I - Limit search to this section */
540 const char *filename
) /* I - Limit search to this file */
542 help_index_t
*search
; /* Search index */
543 help_node_t
*node
; /* Current node */
544 help_word_t
*word
; /* Current word */
545 void *sc
; /* Search context */
546 int matches
; /* Number of matches */
549 DEBUG_printf(("helpSearchIndex(hi=%p, query=\"%s\", filename=\"%s\")",
550 hi
, query
, filename
));
560 * Reset the scores of all nodes to 0...
563 for (node
= (help_node_t
*)cupsArrayFirst(hi
->nodes
);
565 node
= (help_node_t
*)cupsArrayNext(hi
->nodes
))
569 * Find the first node to search in...
574 node
= helpFindNode(hi
, filename
, NULL
);
579 node
= (help_node_t
*)cupsArrayFirst(hi
->nodes
);
582 * Convert the query into a regular expression...
585 sc
= cgiCompileSearch(query
);
590 * Allocate a search index...
593 search
= calloc(1, sizeof(help_index_t
));
600 search
->nodes
= cupsArrayNew((cups_array_func_t
)help_sort_by_name
, NULL
);
601 search
->sorted
= cupsArrayNew((cups_array_func_t
)help_sort_by_score
, NULL
);
603 if (!search
->nodes
|| !search
->sorted
)
605 cupsArrayDelete(search
->nodes
);
606 cupsArrayDelete(search
->sorted
);
615 * Check each node in the index, adding matching nodes to the
619 for (; node
; node
= (help_node_t
*)cupsArrayNext(hi
->nodes
))
620 if (section
&& strcmp(node
->section
, section
))
622 else if (filename
&& strcmp(node
->filename
, filename
))
626 matches
= cgiDoSearch(sc
, node
->text
);
628 for (word
= (help_word_t
*)cupsArrayFirst(node
->words
);
630 word
= (help_word_t
*)cupsArrayNext(node
->words
))
631 if (cgiDoSearch(sc
, word
->text
) > 0)
632 matches
+= word
->count
;
637 * Found a match, add the node to the search index...
640 node
->score
= matches
;
642 cupsArrayAdd(search
->nodes
, node
);
643 cupsArrayAdd(search
->sorted
, node
);
648 * Free the search context...
654 * Return the results...
662 * 'help_add_word()' - Add a word to a node.
665 static help_word_t
* /* O - New word */
666 help_add_word(help_node_t
*n
, /* I - Node */
667 const char *text
) /* I - Word text */
669 help_word_t
*w
, /* New word */
670 key
; /* Search key */
673 DEBUG_printf(("2help_add_word(n=%p, text=\"%s\")", n
, text
));
676 * Create the words array as needed...
680 n
->words
= cupsArrayNew((cups_array_func_t
)help_sort_words
, NULL
);
683 * See if the word is already added...
686 key
.text
= (char *)text
;
688 if ((w
= (help_word_t
*)cupsArrayFind(n
->words
, &key
)) == NULL
)
691 * Create a new word...
694 if ((w
= calloc(1, sizeof(help_word_t
))) == NULL
)
697 if ((w
->text
= strdup(text
)) == NULL
)
703 cupsArrayAdd(n
->words
, w
);
707 * Bump the counter for this word and return it...
717 * 'help_delete_node()' - Free all memory used by a node.
721 help_delete_node(help_node_t
*n
) /* I - Node */
723 help_word_t
*w
; /* Current word */
726 DEBUG_printf(("2help_delete_node(n=%p)", n
));
743 for (w
= (help_word_t
*)cupsArrayFirst(n
->words
);
745 w
= (help_word_t
*)cupsArrayNext(n
->words
))
748 cupsArrayDelete(n
->words
);
755 * 'help_delete_word()' - Free all memory used by a word.
759 help_delete_word(help_word_t
*w
) /* I - Word */
761 DEBUG_printf(("2help_delete_word(w=%p)", w
));
774 * 'help_load_directory()' - Load a directory of files into an index.
777 static int /* O - 0 = success, -1 = error, 1 = updated */
779 help_index_t
*hi
, /* I - Index */
780 const char *directory
, /* I - Directory */
781 const char *relative
) /* I - Relative path */
783 cups_dir_t
*dir
; /* Directory file */
784 cups_dentry_t
*dent
; /* Directory entry */
785 char *ext
, /* Pointer to extension */
786 filename
[1024], /* Full filename */
787 relname
[1024]; /* Relative filename */
788 int update
; /* Updated? */
789 help_node_t
*node
; /* Current node */
792 DEBUG_printf(("2help_load_directory(hi=%p, directory=\"%s\", relative=\"%s\")",
793 hi
, directory
, relative
));
796 * Open the directory and scan it...
799 if ((dir
= cupsDirOpen(directory
)) == NULL
)
804 while ((dent
= cupsDirRead(dir
)) != NULL
)
810 if (dent
->filename
[0] == '.')
814 * Get absolute and relative filenames...
817 snprintf(filename
, sizeof(filename
), "%s/%s", directory
, dent
->filename
);
819 snprintf(relname
, sizeof(relname
), "%s/%s", relative
, dent
->filename
);
821 strlcpy(relname
, dent
->filename
, sizeof(relname
));
824 * Check if we have a HTML file...
827 if ((ext
= strstr(dent
->filename
, ".html")) != NULL
&&
828 (!ext
[5] || !strcmp(ext
+ 5, ".gz")))
831 * HTML file, see if we have already indexed the file...
834 if ((node
= helpFindNode(hi
, relname
, NULL
)) != NULL
)
837 * File already indexed - check dates to confirm that the
838 * index is up-to-date...
841 if (node
->mtime
== dent
->fileinfo
.st_mtime
)
844 * Same modification time, so mark all of the nodes
845 * for this file as up-to-date...
848 for (; node
; node
= (help_node_t
*)cupsArrayNext(hi
->nodes
))
849 if (!strcmp(node
->filename
, relname
))
860 help_load_file(hi
, filename
, relname
, dent
->fileinfo
.st_mtime
);
862 else if (S_ISDIR(dent
->fileinfo
.st_mode
))
865 * Process sub-directory...
868 if (help_load_directory(hi
, filename
, relname
) == 1)
880 * 'help_load_file()' - Load a HTML files into an index.
883 static int /* O - 0 = success, -1 = error */
885 help_index_t
*hi
, /* I - Index */
886 const char *filename
, /* I - Filename */
887 const char *relative
, /* I - Relative path */
888 time_t mtime
) /* I - Modification time */
890 cups_file_t
*fp
; /* HTML file */
891 help_node_t
*node
; /* Current node */
892 char line
[1024], /* Line from file */
893 temp
[1024], /* Temporary word */
894 section
[1024], /* Section */
895 *ptr
, /* Pointer into line */
896 *anchor
, /* Anchor name */
897 *text
; /* Text for anchor */
898 off_t offset
; /* File offset */
899 char quote
; /* Quote character */
900 help_word_t
*word
; /* Current word */
901 int wordlen
; /* Length of word */
904 DEBUG_printf(("2help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", "
905 "mtime=%ld)", hi
, filename
, relative
, mtime
));
907 if ((fp
= cupsFileOpen(filename
, "r")) == NULL
)
913 strlcpy(section
, "Other", sizeof(section
));
915 while (cupsFileGets(fp
, line
, sizeof(line
)))
918 * Look for "<TITLE>", "<A NAME", or "<!-- SECTION:" prefix...
921 if (!_cups_strncasecmp(line
, "<!-- SECTION:", 13))
924 * Got section line, copy it!
927 for (ptr
= line
+ 13; isspace(*ptr
& 255); ptr
++);
929 strlcpy(section
, ptr
, sizeof(section
));
930 if ((ptr
= strstr(section
, "-->")) != NULL
)
933 * Strip comment stuff from end of line...
936 for (*ptr
-- = '\0'; ptr
> line
&& isspace(*ptr
& 255); *ptr
-- = '\0');
938 if (isspace(*ptr
& 255))
944 for (ptr
= line
; (ptr
= strchr(ptr
, '<')) != NULL
;)
948 if (!_cups_strncasecmp(ptr
, "TITLE>", 6))
957 else if (!_cups_strncasecmp(ptr
, "A NAME=", 7))
965 if (*ptr
== '\"' || *ptr
== '\'')
968 * Get quoted anchor...
973 if ((ptr
= strchr(anchor
, quote
)) != NULL
)
981 * Get unquoted anchor...
986 for (ptr
= anchor
; *ptr
&& *ptr
!= '>' && !isspace(*ptr
& 255); ptr
++);
995 * Got the anchor, now lets find the end...
998 while (*ptr
&& *ptr
!= '>')
1010 * Now collect text for the link...
1014 while ((ptr
= strchr(text
, '<')) == NULL
)
1016 ptr
= text
+ strlen(text
);
1017 if (ptr
>= (line
+ sizeof(line
) - 2))
1022 if (!cupsFileGets(fp
, ptr
, sizeof(line
) - (ptr
- line
) - 1))
1029 node
->length
= offset
- node
->offset
;
1037 if ((node
= helpFindNode(hi
, relative
, anchor
)) != NULL
)
1040 * Node already in the index, so replace the text and other
1044 cupsArrayRemove(hi
->nodes
, node
);
1047 free(node
->section
);
1054 for (word
= (help_word_t
*)cupsArrayFirst(node
->words
);
1056 word
= (help_word_t
*)cupsArrayNext(node
->words
))
1057 help_delete_word(word
);
1059 cupsArrayDelete(node
->words
);
1063 node
->section
= section
[0] ? strdup(section
) : NULL
;
1064 node
->text
= strdup(text
);
1065 node
->mtime
= mtime
;
1066 node
->offset
= offset
;
1075 node
= help_new_node(relative
, anchor
, section
, text
, mtime
, offset
, 0);
1079 * Go through the text value and replace tabs and newlines with
1080 * whitespace and eliminate extra whitespace...
1083 for (ptr
= node
->text
, text
= node
->text
; *ptr
;)
1084 if (isspace(*ptr
& 255))
1086 while (isspace(*ptr
& 255))
1091 else if (text
!= ptr
)
1102 * (Re)add the node to the array...
1105 cupsArrayAdd(hi
->nodes
, node
);
1115 * Scan this line for words...
1118 for (ptr
= line
; *ptr
; ptr
++)
1121 * Skip HTML stuff...
1126 if (!strncmp(ptr
, "<!--", 4))
1129 * Skip HTML comment...
1132 if ((text
= strstr(ptr
+ 4, "-->")) == NULL
)
1133 ptr
+= strlen(ptr
) - 1;
1140 * Skip HTML element...
1143 for (ptr
++; *ptr
&& *ptr
!= '>'; ptr
++)
1145 if (*ptr
== '\"' || *ptr
== '\'')
1147 for (quote
= *ptr
++; *ptr
&& *ptr
!= quote
; ptr
++);
1160 else if (*ptr
== '&')
1163 * Skip HTML entity...
1166 for (ptr
++; *ptr
&& *ptr
!= ';'; ptr
++);
1173 else if (!isalnum(*ptr
& 255))
1177 * Found the start of a word, search until we find the end...
1180 for (text
= ptr
, ptr
++; *ptr
&& isalnum(*ptr
& 255); ptr
++);
1182 wordlen
= ptr
- text
;
1184 memcpy(temp
, text
, wordlen
);
1185 temp
[wordlen
] = '\0';
1189 if (wordlen
> 1 && !bsearch(temp
, help_common_words
,
1190 (sizeof(help_common_words
) /
1191 sizeof(help_common_words
[0])),
1192 sizeof(help_common_words
[0]),
1193 (int (*)(const void *, const void *))
1195 help_add_word(node
, temp
);
1200 * Get the offset of the next line...
1203 offset
= cupsFileTell(fp
);
1209 node
->length
= offset
- node
->offset
;
1216 * 'help_new_node()' - Create a new node and add it to an index.
1219 static help_node_t
* /* O - Node pointer or NULL on error */
1220 help_new_node(const char *filename
, /* I - Filename */
1221 const char *anchor
, /* I - Anchor */
1222 const char *section
, /* I - Section */
1223 const char *text
, /* I - Text */
1224 time_t mtime
, /* I - Modification time */
1225 off_t offset
, /* I - Offset in file */
1226 size_t length
) /* I - Length in bytes */
1228 help_node_t
*n
; /* Node */
1231 DEBUG_printf(("2help_new_node(filename=\"%s\", anchor=\"%s\", text=\"%s\", "
1232 "mtime=%ld, offset=%ld, length=%ld)", filename
, anchor
, text
,
1233 (long)mtime
, (long)offset
, (long)length
));
1235 n
= (help_node_t
*)calloc(1, sizeof(help_node_t
));
1239 n
->filename
= strdup(filename
);
1240 n
->anchor
= anchor
? strdup(anchor
) : NULL
;
1241 n
->section
= (section
&& *section
) ? strdup(section
) : NULL
;
1242 n
->text
= strdup(text
);
1252 * 'help_sort_nodes_by_name()' - Sort nodes by section, filename, and anchor.
1255 static int /* O - Difference */
1256 help_sort_by_name(help_node_t
*n1
, /* I - First node */
1257 help_node_t
*n2
) /* I - Second node */
1259 int diff
; /* Difference */
1262 DEBUG_printf(("2help_sort_by_name(n1=%p(%s#%s), n2=%p(%s#%s)",
1263 n1
, n1
->filename
, n1
->anchor
,
1264 n2
, n2
->filename
, n2
->anchor
));
1266 if ((diff
= strcmp(n1
->filename
, n2
->filename
)) != 0)
1269 if (!n1
->anchor
&& !n2
->anchor
)
1271 else if (!n1
->anchor
)
1273 else if (!n2
->anchor
)
1276 return (strcmp(n1
->anchor
, n2
->anchor
));
1281 * 'help_sort_nodes_by_score()' - Sort nodes by score and text.
1284 static int /* O - Difference */
1285 help_sort_by_score(help_node_t
*n1
, /* I - First node */
1286 help_node_t
*n2
) /* I - Second node */
1288 int diff
; /* Difference */
1291 DEBUG_printf(("2help_sort_by_score(n1=%p(%d \"%s\" \"%s\"), "
1292 "n2=%p(%d \"%s\" \"%s\")",
1293 n1
, n1
->score
, n1
->section
, n1
->text
,
1294 n2
, n2
->score
, n2
->section
, n2
->text
));
1296 if (n1
->score
!= n2
->score
)
1297 return (n2
->score
- n1
->score
);
1299 if (n1
->section
&& !n2
->section
)
1301 else if (!n1
->section
&& n2
->section
)
1303 else if (n1
->section
&& n2
->section
&&
1304 (diff
= strcmp(n1
->section
, n2
->section
)) != 0)
1307 return (_cups_strcasecmp(n1
->text
, n2
->text
));
1312 * 'help_sort_words()' - Sort words alphabetically.
1315 static int /* O - Difference */
1316 help_sort_words(help_word_t
*w1
, /* I - Second word */
1317 help_word_t
*w2
) /* I - Second word */
1319 DEBUG_printf(("2help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))",
1320 w1
, w1
->text
, w2
, w2
->text
));
1322 return (_cups_strcasecmp(w1
->text
, w2
->text
));