************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
6 Modifications by Richard D. Piccard -- Ohio University
7
8 2000/07/07 Add home_page function immediately before sorting, to
9 change the ranking of the hits based on several
10 criteria. The numerical values can be customized
11 readily, and two environment variables can be used
12 to suppress particular hosts or paths.
13
14 2000/07/10 Use include files custom_head.c and custom_foot.c for
15 cosmetic and site-specific changes to the HTML at
16 the top and bottom of the generated page.
17
18 2000/08/01 Add capability for REQUIRED_REALM to home_page.
19
20 2000/08/24 Removed \n prior to > closing tags, and abolished
21 in order to work around bug in Mac Internet Explorer V5.
22
23 -------------------------------------
24
25 0.0 1993/06/18 Start the program
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
6 0.0 1993/06/18 Start the program
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
362 static char *BAD_HOST_LENGTH = "Deprecated host too long or too short.";
363 static char *BAD_PATH_LENGTH = "Deprecated path too long or too short.";
364 static char *BAD_REALM_LENGTH = "Required realm too long or too short.";
365 static char *MISSING_ARGUMENTS = "Script invoked with missing arguments.";
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
343 static char *MISSING_ARGUMENTS = "Script invoked with missing arguments.";
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
412 static void home_page(Result result);
413
414 void parse_selector(char *str, int *new_style, char **title, char *gtype,
415 char *ptype, char **file, char **host, char **port,
416 char *method, char **path);
417
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
390
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
735
736 /*
737 * Before sorting, elevate the ranking of any hit that is a "home"
738 * page or otherwise preferred. - RDP
739 */
740
741 if (result.count >= 2) home_page(result);
742
743 for (ind = 0; ind < result.count; ind++)
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
708 for (ind = 0; ind < result.count; ind++)
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
747 /*
748 * discard any results with zero score -- RDP
749 */
750
751 for (ind = result.count - 1; ind >= 0; ind--) {
752
753 if (result.select[ind].score == 0) result.count = ind;
754 }
755 }
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
712 }
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
1777
1778 /*
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
1734 /*
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
1809 char ipath_info[SPEC_SIZE],required_realm[250];
1810 char ipath_translated[SPEC_SIZE], alt_ipath_translated[SPEC_SIZE];
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
1765 char ipath_info[SPEC_SIZE];
1766 char ipath_translated[SPEC_SIZE], alt_ipath_translated[SPEC_SIZE];
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
1818
1819 /*
1820 * Check for required realm
1821 */
1822
1823 if ((cp=getenv("WWW_REQUIRED_REALM")) == NULL) {
1824
1825 required_realm[0] = '\0';
1826
1827 } else {
1828
1829 if (strlen(cp) <= 2) {
1830
1831 required_realm[0] ='\0';
1832
1833 } else {
1834
1835 if (strlen(cp) <= 249) {
1836
1837 strcpy(required_realm, cp);
1838
1839 } else {
1840
1841 too_bad(BAD_REALM_LENGTH);
1842 exit(1);
1843 }
1844 }
1845
1846 }
1847
1848
1849 /* Check whether we're using whole files. */
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
1774 /* Check whether we're using whole files. */
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
2032
2033 /* Set up the HTML rendition. */
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
1957 /* Set up the HTML rendition. */
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
2042
2043 /*
2044 * You can leave the part active, if you don't care about
2045 * functioning with Mac Internet Explorer V5 -- none of the hit links
2046 * will be clickable if you do, though! -- RDP 8/21/00
2047 *
2048 * if (!via_form)
2049 * printf("\n");
2050 */
2051
2052 #include "custom_head.c"
2053 }
2054
2055
2056 printf("
Searching for:
\n\n", orig_qstr);
2057 if (required_realm[0] != '\0') {
2058 printf("in pages whose URLs contain:
\n\n", required_realm);
2059 }
2060 EndingHit = TotalHits = result.count;
2061 fprintf(stdout, items_found, TotalHits);
2062 if (StartingHit > 1 && StartingHit > TotalHits) {
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
1966 if (!via_form)
1967 printf("\n");
1968 printf("\n\n");
1969 }
1970 printf("%s
\n", orig_qstr);
1971 EndingHit = TotalHits = result.count;
1972 fprintf(stdout, items_found, TotalHits);
1973 if (TotalHits < 1) {
1974 printf(".
\n");
1975 StartingHit = 0;
1976 add_context = FALSE;
1977 goto check_if_end_form_wanted;
1978 }
1979 if (StartingHit > 1 && StartingHit > TotalHits) {
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
2284 printf ("%s%s%s%s\n",
2285 FileType(gtype),
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
2201 printf ("%s%s%s%s\n",
2202 FileType(gtype),
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
2297 printf ("%s%s%s%s\n",
2298 FileType(gtype),
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
2214 printf ("%s%s%s%s\n",
2215 FileType(gtype),
************
************
File DISK9:[INDEX.VMSINDEX]QUERY.C;75
2364 printf("\n
\n");
2365 #include "custom_research.c"
2366
2367 #include "custom_foot.c"
2368 }
******
File DISK9:[INDEX.VMSINDEX]QUERY.C;1
2281 printf("\n