SAI || Sommersemester 1997 || Systemnahe Software II || Übungen

<- Alle Module

Lösung zu Blatt 7 (Aufgabe 8): main.c

Hauptprogramm der kleinen Suchmaschine.

main.c

/*
 * SS 97 Soft II Blatt 
 * Hauptprogramm der kleinen (Internet-)Suchmaschine
 */
 
void main(int argc, char **argv)
{       char *http = "http:";

        if (argc <3)
        {       printf("usage: %s word1+word2.. http-address\n", argv[0]),
                exit(1);
        }
        strlwr(argv[1]);                /* Suchworte kleinschreiben     */
                                        /* evtl. "http" entfernen       */
        if (!strncmp(argv[2], http, strlen(http)))
        {       argv[2] += strlen(http);
                while (argv[2][0] == '/')       /* evtl. // entfernen   */
                        argv[2]++;
        }
        search(argv[1], argv[2], 1);    /* Suche starten        */
}
<- Alle Module
SAI || Sommersemester 1997 || Systemnahe Software II || Übungen

Matthias Grabert, Juli 1997