home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / infosrvr / src / diffs / wwwlibr1.dif < prev    next >
Encoding:
Text File  |  1993-11-04  |  73.8 KB  |  2,537 lines

  1. *** ../../../../2.12a/WWW/Library/Implementation/HTAABrow.c    Thu Oct  7 14:42:12 1993
  2. --- HTAABrow.c    Wed Nov  3 16:20:18 1993
  3. ***************
  4. *** 35,42 ****
  5.   **    AL    Ari Luotonen    luotonen@dxcern.cern.ch
  6.   **
  7.   ** HISTORY:
  8. ! **
  9. ! **
  10.   ** BUGS:
  11.   **
  12.   **
  13. --- 35,47 ----
  14.   **    AL    Ari Luotonen    luotonen@dxcern.cern.ch
  15.   **
  16.   ** HISTORY:
  17. ! **    Oct 17    AL    Made corrections suggested by marca:
  18. ! **            Added  if (!realm->username) return NULL;
  19. ! **            Changed some ""s to NULLs.
  20. ! **            Now doing calloc() to init uuencode source;
  21. ! **            otherwise HTUU_encode() reads uninitialized memory
  22. ! **            every now and then (not a real bug but not pretty).
  23. ! **            Corrected the formula for uuencode destination size.
  24.   ** BUGS:
  25.   **
  26.   **
  27. ***************
  28. *** 113,123 ****
  29. --- 118,156 ----
  30.                                           /* connect.                 */
  31.   PRIVATE char *current_docname    = NULL;    /* The document's name we are        */
  32.                                           /* trying to access.             */
  33. + PRIVATE char *HTAAForwardAuth    = NULL;    /* Authorization: line to forward    */
  34. +                                         /* (used by gateway httpds)         */
  35.   
  36.   
  37. + /*** HTAAForwardAuth for enabling gateway-httpds to forward Authorization ***/
  38.   
  39. + PUBLIC void HTAAForwardAuth_set ARGS2(CONST char *, scheme_name,
  40. +                       CONST char *, scheme_specifics)
  41. + {
  42. +     int len = 20 + (scheme_name      ? strlen(scheme_name)      : 0) 
  43. +              + (scheme_specifics ? strlen(scheme_specifics) : 0);
  44.   
  45. +     FREE(HTAAForwardAuth);
  46. +     if (!(HTAAForwardAuth = (char*)malloc(len)))
  47. +     outofmem(__FILE__, "HTAAForwardAuth_set");
  48.   
  49. +     strcpy(HTAAForwardAuth, "Authorization: ");
  50. +     if (scheme_name) {
  51. +     strcat(HTAAForwardAuth, scheme_name);
  52. +     strcat(HTAAForwardAuth, " ");
  53. +     if (scheme_specifics) {
  54. +         strcat(HTAAForwardAuth, scheme_specifics);
  55. +     }
  56. +     }
  57. + }
  58. + PUBLIC void HTAAForwardAuth_reset NOARGS
  59. + {
  60. +     FREE(HTAAForwardAuth);
  61. + }
  62.   /**************************** HTAAServer ***********************************/
  63.   
  64.   
  65. ***************
  66. *** 489,494 ****
  67. --- 522,528 ----
  68.   **            (with, of course, a newly generated secret
  69.   **            key and fresh timestamp, if Pubkey-scheme
  70.   **            is being used).
  71. + **            NULL, if something fails.
  72.   ** NOTE:
  73.   **    Like throughout the entire AA package, no string or structure
  74.   **    returned by AA package needs to (or should) be freed.
  75. ***************
  76. *** 514,523 ****
  77.       if ((scheme != HTAA_BASIC && scheme != HTAA_PUBKEY) || !setup ||
  78.       !setup->scheme_specifics || !setup->scheme_specifics[scheme] ||
  79.       !setup->server  ||  !setup->server->realms)
  80. !     return "";
  81.   
  82.       realmname = HTAssocList_lookup(setup->scheme_specifics[scheme], "realm");
  83. !     if (!realmname) return "";
  84.   
  85.       realm = HTAARealm_lookup(setup->server->realms, realmname);
  86.       if (!realm || setup->retry) {
  87. --- 548,557 ----
  88.       if ((scheme != HTAA_BASIC && scheme != HTAA_PUBKEY) || !setup ||
  89.       !setup->scheme_specifics || !setup->scheme_specifics[scheme] ||
  90.       !setup->server  ||  !setup->server->realms)
  91. !     return NULL;
  92.   
  93.       realmname = HTAssocList_lookup(setup->scheme_specifics[scheme], "realm");
  94. !     if (!realmname) return NULL;
  95.   
  96.       realm = HTAARealm_lookup(setup->server->realms, realmname);
  97.       if (!realm || setup->retry) {
  98. ***************
  99. *** 529,550 ****
  100.                      "not found -- creating");
  101.           realm = HTAARealm_new(setup->server->realms, realmname, NULL,NULL);
  102.           sprintf(msg,
  103. !             "Document is protected. Enter username for %s at %s: ",
  104.               realm->realmname,
  105.               setup->server->hostname ? setup->server->hostname : "??");
  106. -         realm->username =
  107. -         HTPrompt(msg, realm->username);
  108.       }
  109.       else {
  110. !         sprintf(msg,"Enter username for %s at %s: ", realm->realmname,
  111.               setup->server->hostname ? setup->server->hostname : "??");
  112. -         username = HTPrompt(msg, realm->username);
  113. -         FREE(realm->username);
  114. -         realm->username = username;
  115.       }
  116. !     password = HTPromptPassword("Enter password: ");
  117.       FREE(realm->password);
  118.       realm->password = password;
  119.       }
  120.       
  121.       len = strlen(realm->username ? realm->username : "") +
  122. --- 563,588 ----
  123.                      "not found -- creating");
  124.           realm = HTAARealm_new(setup->server->realms, realmname, NULL,NULL);
  125.           sprintf(msg,
  126. !             "Document is protected. Enter username for %s at %s",
  127.               realm->realmname,
  128.               setup->server->hostname ? setup->server->hostname : "??");
  129.       }
  130.       else {
  131. !         sprintf(msg,"Enter username for %s at %s", realm->realmname,
  132.               setup->server->hostname ? setup->server->hostname : "??");
  133.       }
  134. !     username = realm->username;
  135. !     password = NULL;
  136. !     HTPromptUsernameAndPassword(msg, &username, &password);
  137. !     FREE(realm->username);
  138.       FREE(realm->password);
  139. +     realm->username = username;
  140.       realm->password = password;
  141. +     if (!realm->username)
  142. +         return NULL;        /* Suggested by marca; thanks! */
  143.       }
  144.       
  145.       len = strlen(realm->username ? realm->username : "") +
  146. ***************
  147. *** 561,567 ****
  148.       else
  149.       FREE(secret_key);
  150.   
  151. !     if (!(cleartext  = (char*)malloc(len)))
  152.       outofmem(__FILE__, "compose_auth_string");
  153.   
  154.       if (realm->username) strcpy(cleartext, realm->username);
  155. --- 599,605 ----
  156.       else
  157.       FREE(secret_key);
  158.   
  159. !     if (!(cleartext  = (char*)calloc(len, 1)))
  160.       outofmem(__FILE__, "compose_auth_string");
  161.   
  162.       if (realm->username) strcpy(cleartext, realm->username);
  163. ***************
  164. *** 590,596 ****
  165.       free(ciphertext);
  166.       }
  167.       else { /* scheme == HTAA_BASIC */
  168. !     if (!(result = (char*)malloc(len + len/2)))
  169.           outofmem(__FILE__, "compose_auth_string");
  170.       HTUU_encode(cleartext, strlen(cleartext), result);
  171.       free(cleartext);
  172. --- 628,634 ----
  173.       free(ciphertext);
  174.       }
  175.       else { /* scheme == HTAA_BASIC */
  176. !     if (!(result = (char*)malloc(4 * ((len+2)/3) + 1)))
  177.           outofmem(__FILE__, "compose_auth_string");
  178.       HTUU_encode(cleartext, strlen(cleartext), result);
  179.       free(cleartext);
  180. ***************
  181. *** 661,666 ****
  182. --- 699,721 ----
  183.       BOOL retry;
  184.       HTAAScheme scheme;
  185.   
  186. +     /*
  187. +     ** Make gateway httpds pass authorization field as it was received.
  188. +     ** (This still doesn't really work because Authenticate: headers
  189. +     **  from remote server are not forwarded to client yet so it cannot
  190. +     **  really know that it should send authorization;  I will not
  191. +     **  implement it yet because I feel we will soon change radically
  192. +     **  the way requests are represented to allow multithreading
  193. +     **  on server-side.  Life is hard.)
  194. +     */
  195. +     if (HTAAForwardAuth) {
  196. +     if (TRACE) fprintf(stderr, "HTAA_composeAuth: %s\n",
  197. +                "Forwarding received authorization");
  198. +     StrAllocCopy(result, HTAAForwardAuth);
  199. +     HTAAForwardAuth_reset();    /* Just a precaution */
  200. +     return result;
  201. +     }
  202.       FREE(result);            /* From previous call */
  203.   
  204.       if (TRACE)
  205. ***************
  206. *** 707,718 ****
  207.               "This client doesn't know how to compose authentication",
  208.               "information for scheme", HTAAScheme_name(scheme));
  209.           HTAlert(msg);
  210. !         auth_string = "";
  211.       }
  212.       } /* switch scheme */
  213.   
  214.       current_setup->retry = NO;
  215.   
  216.       if (!(result = (char*)malloc(sizeof(char) * (strlen(auth_string)+40))))
  217.       outofmem(__FILE__, "HTAA_composeAuth");
  218.       strcpy(result, "Authorization: ");
  219. --- 762,777 ----
  220.               "This client doesn't know how to compose authentication",
  221.               "information for scheme", HTAAScheme_name(scheme));
  222.           HTAlert(msg);
  223. !         auth_string = NULL;
  224.       }
  225.       } /* switch scheme */
  226.   
  227.       current_setup->retry = NO;
  228.   
  229. +     /* Added by marca. */
  230. +     if (!auth_string)
  231. +     return NULL;
  232. +     
  233.       if (!(result = (char*)malloc(sizeof(char) * (strlen(auth_string)+40))))
  234.       outofmem(__FILE__, "HTAA_composeAuth");
  235.       strcpy(result, "Authorization: ");
  236. ***************
  237. *** 724,730 ****
  238.   
  239.   
  240.   
  241. !         
  242.   /* BROWSER PUBLIC                HTAA_shouldRetryWithAuth()
  243.   **
  244.   **        DETERMINES IF WE SHOULD RETRY THE SERVER
  245. --- 783,789 ----
  246.   
  247.   
  248.   
  249.   /* BROWSER PUBLIC                HTAA_shouldRetryWithAuth()
  250.   **
  251.   **        DETERMINES IF WE SHOULD RETRY THE SERVER
  252. *** ../../../../2.12a/WWW/Library/Implementation/HTAABrow.h    Tue Oct  5 10:48:54 1993
  253. --- HTAABrow.h    Wed Nov  3 16:28:43 1993
  254. ***************
  255. *** 113,118 ****
  256. --- 113,132 ----
  257.                                                int        soc));
  258.   /*
  259.   
  260. + Enabling Gateway httpds to Forward Authorization
  261. +    These functions should only be called from daemon code, and HTAAForwardAuth_reset()
  262. +    must be called before the next request is handled to make sure that authorization
  263. +    string isn't cached in daemon so that other people can access private files using
  264. +    somebody elses previous authorization information.
  265. +    
  266. +  */
  267. + PUBLIC void HTAAForwardAuth_set PARAMS((CONST char * scheme_name,
  268. +                                         CONST char * scheme_specifics));
  269. + PUBLIC void HTAAForwardAuth_reset NOPARAMS;
  270. + /*
  271.    */
  272.   
  273.   #endif  /* NOT HTAABROW_H */
  274. *** ../../../../2.12a/WWW/Library/Implementation/HTAAProt.c    Thu Oct  7 14:42:16 1993
  275. --- HTAAProt.c    Wed Nov  3 16:20:19 1993
  276. ***************
  277. *** 6,13 ****
  278.   **    AL    Ari Luotonen    luotonen@dxcern.cern.ch
  279.   **
  280.   ** HISTORY:
  281. ! **
  282. ! **
  283.   ** BUGS:
  284.   **
  285.   **
  286. --- 6,14 ----
  287.   **    AL    Ari Luotonen    luotonen@dxcern.cern.ch
  288.   **
  289.   ** HISTORY:
  290. ! **    20 Oct 93  AL    Now finds uid/gid for nobody/nogroup by name
  291. ! **            (doesn't use default 65534 right away).
  292. ! **            Also understands negative uids/gids.
  293.   ** BUGS:
  294.   **
  295.   **
  296. ***************
  297. *** 51,56 ****
  298. --- 52,60 ----
  299.   
  300.       if (!s || !*s) return NO;
  301.   
  302. +     if (*cur == '-')
  303. +     cur++;        /* Allow initial minus sign in a number */
  304.       while (*cur) {
  305.       if (*cur < '0' || *cur > '9')
  306.           return NO;
  307. ***************
  308. *** 96,101 ****
  309. --- 100,116 ----
  310.           }
  311.       }
  312.       }
  313. +     /*
  314. +     ** Ok, then let's get uid for nobody.
  315. +     */
  316. +     if (NULL != (pw = getpwnam("nobody"))) {
  317. +     if (TRACE) fprintf(stderr, "HTAA_getUid: Uid for `nobody' is %d\n",
  318. +                pw->pw_uid);
  319. +     return pw->pw_uid;
  320. +     }
  321. +     /*
  322. +     ** Ok, then use default.
  323. +     */
  324.       return 65534;    /* nobody */
  325.   }
  326.   
  327. ***************
  328. *** 135,140 ****
  329. --- 150,166 ----
  330.           }
  331.       }
  332.       }
  333. +     /*
  334. +     ** Ok, then let's get gid for nogroup.
  335. +     */
  336. +     if (NULL != (gr = getgrnam("nogroup"))) {
  337. +     if (TRACE) fprintf(stderr, "HTAA_getGid: Gid for `nogroup' is %d\n",
  338. +                gr->gr_gid);
  339. +     return gr->gr_gid;
  340. +     }
  341. +     /*
  342. +     ** Ok, then use default.
  343. +     */
  344.       return 65534;    /* nogroup */
  345.   }
  346.   
  347. *** ../../../../2.12a/WWW/Library/Implementation/HTAAServ.c    Thu Oct  7 14:42:17 1993
  348. --- HTAAServ.c    Wed Nov  3 16:20:20 1993
  349. ***************
  350. *** 111,116 ****
  351. --- 111,123 ----
  352.         case HTAA_SETUP_ERROR:
  353.       return "Forbidden -- server protection setup error";
  354.       break;
  355. +       case HTAA_DOTDOT:
  356. +     return "Forbidden -- URL containing /../ disallowed";
  357. +     break;
  358. +     /*
  359. +     ** It ought to, using an executable script (TBL)
  360. +     ** What do you mean, Tim?? (AL)
  361. +     */
  362.   
  363.       /* 404 cases */
  364.         case HTAA_NOT_FOUND:
  365. ***************
  366. *** 122,127 ****
  367. --- 129,138 ----
  368.       return "AA: Access should be ok but something went wrong"; 
  369.       break;
  370.   
  371. +       case HTAA_OK_GATEWAY:
  372. +     return "AA check bypassed (gatewaying) but something went wrong";
  373. +     break;
  374.       /* Others */
  375.         default:
  376.       return "Access denied -- unable to specify reason (bug)";
  377. ***************
  378. *** 159,164 ****
  379. --- 170,178 ----
  380.         case HTAA_SETUP_ERROR:
  381.       return "SETUP-ERROR";
  382.       break;
  383. +       case HTAA_DOTDOT:
  384. +     return "SLASH-DOT-DOT";
  385. +     break;
  386.   
  387.       /* 404 cases */
  388.         case HTAA_NOT_FOUND:
  389. ***************
  390. *** 169,174 ****
  391. --- 183,191 ----
  392.         case HTAA_OK:
  393.       return "OK";
  394.       break;
  395. +       case HTAA_OK_GATEWAY:
  396. +     return "OK-GATEWAY";
  397. +     break;
  398.   
  399.       /* Others */
  400.         default:
  401. ***************
  402. *** 427,443 ****
  403.       if (keywords) *keywords = (char)0;    /* Chop off keywords */
  404.       }
  405.       HTSimplify(local_copy);    /* Remove ".." etc. */
  406. -     pathname = HTTranslate(local_copy);
  407. -     if (!HTSecure) {
  408. -     char *localname = HTLocalName(pathname);
  409. -     free(pathname);
  410. -     pathname = localname;
  411. -     }        
  412. -     FREE(local_copy);
  413.   
  414. !     HTAAFailReason = check_authorization(pathname, method,
  415. !                      scheme, scheme_specifics);
  416.   
  417.       if (htaa_logfile) {
  418.       time(&theTime);
  419.       fprintf(htaa_logfile, "%24.24s %s %s %s %s %s\n",
  420. --- 444,500 ----
  421.       if (keywords) *keywords = (char)0;    /* Chop off keywords */
  422.       }
  423.       HTSimplify(local_copy);    /* Remove ".." etc. */
  424.   
  425. !     /* HTSimplify will leave in a "/../" at the top, which can
  426. !     ** be a security hole.
  427. !     */
  428. !     if (strstr(local_copy, "/../")) {
  429. !     if (TRACE) fprintf(stderr, "HTAA_checkAuthorization: %s (`%s')\n",
  430. !                "Illegal attempt to use /../", url);
  431. !     HTAAFailReason = HTAA_DOTDOT;
  432. !     }
  433. !     else {
  434. !     pathname = HTTranslate(local_copy); /* Translate rules even if */
  435. !                                         /* a /htbin call to set up */
  436. !                                         /* protections.           */
  437. !     if (0 == strncmp(local_copy, "/htbin/", 7)) {
  438. !         char *end = strchr(local_copy+7, '/');
  439. !         if (end)
  440. !         *end = (char)0;
  441. !         if (!HTBinDir)
  442. !         StrAllocCopy(HTBinDir, HTBINDIR);
  443. !         FREE(pathname);
  444. !         pathname = (char*)malloc(strlen(HTBinDir)+strlen(local_copy)-4);
  445. !         strcpy(pathname, HTBinDir);
  446. !         strcat(pathname, local_copy+6);
  447. !     }
  448.   
  449. +     if (!pathname) {        /* Forbidden by rule */
  450. +         if (TRACE) fprintf(stderr,
  451. +                    "HTAA_checkAuthorization: Forbidden by rule\n");
  452. +         HTAAFailReason = HTAA_BY_RULE;
  453. +     }
  454. +     else {    /* pathname != NULL */
  455. +         char *access = HTParse(pathname, "", PARSE_ACCESS);
  456. +         if (!*access  ||  0 == strcmp(access, "file")) { /*Local file, do AA*/
  457. +         if (!HTSecure && 0 != strncmp(local_copy, "/htbin/", 7)) {
  458. +             char *localname = HTLocalName(pathname);
  459. +             free(pathname);
  460. +             pathname = localname;
  461. +         }
  462. +         HTAAFailReason = check_authorization(pathname, method,
  463. +                              scheme, scheme_specifics);
  464. +         }
  465. +         else {  /* Not local access */
  466. +         HTAAFailReason = HTAA_OK_GATEWAY;
  467. +         fprintf(stderr, "HTAA_checkAuthorization: %s (%s access)\n",
  468. +             "Gatewaying -- skipping authorization check",
  469. +             access);
  470. +         }
  471. +     } /* pathname */
  472. +     }
  473. +     FREE(local_copy);
  474.       if (htaa_logfile) {
  475.       time(&theTime);
  476.       fprintf(htaa_logfile, "%24.24s %s %s %s %s %s\n",
  477. ***************
  478. *** 471,476 ****
  479. --- 528,534 ----
  480.         case HTAA_NO_ACL:
  481.         case HTAA_NO_ENTRY:
  482.         case HTAA_SETUP_ERROR:
  483. +       case HTAA_DOTDOT:
  484.       return 403;
  485.       break;
  486.   
  487. ***************
  488. *** 479,484 ****
  489. --- 537,543 ----
  490.       break;
  491.   
  492.         case HTAA_OK:
  493. +       case HTAA_OK_GATEWAY:
  494.       return 200;
  495.       break;
  496.   
  497. *** ../../../../2.12a/WWW/Library/Implementation/HTAlert.c    Wed Oct 13 17:12:31 1993
  498. --- HTAlert.c    Thu Nov  4 10:54:13 1993
  499. ***************
  500. *** 80,87 ****
  501.   PUBLIC char * HTPromptPassword ARGS1(CONST char *, Msg)
  502.   {
  503.       char *result = NULL;
  504. !     char *pw = (char*) getpass(Msg ? Msg : "Password: ");
  505.       StrAllocCopy(result, pw);
  506.       return result;
  507.   }
  508.   
  509. --- 80,118 ----
  510.   PUBLIC char * HTPromptPassword ARGS1(CONST char *, Msg)
  511.   {
  512.       char *result = NULL;
  513. !     char *pw = (char*)getpass(Msg ? Msg : "Password: ");
  514.       StrAllocCopy(result, pw);
  515.       return result;
  516. + }
  517. + /*    Prompt both username and password    HTPromptUsernameAndPassword()
  518. + **    ---------------------------------
  519. + ** On entry,
  520. + **    Msg        is the prompting message.
  521. + **    *username and
  522. + **    *password    are char pointers; they are changed
  523. + **            to point to result strings.
  524. + **
  525. + **            If *username is not NULL, it is taken
  526. + **            to point to  a default value.
  527. + **            Initial value of *password is
  528. + **            completely discarded.
  529. + **
  530. + ** On exit,
  531. + **    *username and *password point to newly allocated
  532. + **    strings -- original strings pointed to by them
  533. + **    are NOT freed.
  534. + **    
  535. + */
  536. + PUBLIC void HTPromptUsernameAndPassword ARGS3(CONST char *,    Msg,
  537. +                           char **,        username,
  538. +                           char **,        password)
  539. + {
  540. +     if (Msg)
  541. +     fprintf(stderr, "WWW: %s\n", Msg);
  542. +     *username = HTPrompt("Username: ", *username);
  543. +     *password = HTPromptPassword("Password: ");
  544.   }
  545.   
  546. *** ../../../../2.12a/WWW/Library/Implementation/HTAlert.h    Tue Oct  5 11:04:23 1993
  547. --- HTAlert.h    Thu Nov  4 10:07:13 1993
  548. ***************
  549. *** 1,4 ****
  550. ! /*                  /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTAlert.html
  551.                     DISPLAYING MESSAGES AND GETTING INPUT FOR WWW LIBRARY
  552.                                                
  553.      This module may be overridden for GUI clients.    It allows progress indications and
  554. --- 1,4 ----
  555. ! /*                                                  HTAlert: Handling user messages in libwww
  556.                     DISPLAYING MESSAGES AND GETTING INPUT FOR WWW LIBRARY
  557.                                                
  558.      This module may be overridden for GUI clients.    It allows progress indications and
  559. ***************
  560. *** 13,18 ****
  561. --- 13,23 ----
  562.   #include "HTUtils.h"
  563.   #include "tcp.h"
  564.   
  565. + #ifdef SHORT_NAMES
  566. + #define HTPrPass        HTPromptPassword
  567. + #define HTPUnAPw        HTPromptUsernameAndPassword
  568. + #endif /*SHORT_NAMES*/
  569.   /*
  570.   
  571.   HTPrompt and HTPromptPassword: Display a message and get the input
  572. ***************
  573. *** 34,40 ****
  574. --- 39,72 ----
  575.   extern char * HTPrompt PARAMS((CONST char * Msg, CONST char * deflt));
  576.   extern char * HTPromptPassword PARAMS((CONST char * Msg));
  577.   
  578. + /*
  579.   
  580. + HTPromptUsernameAndPassword: Get both username and password
  581. +   ON ENTRY,
  582. +   
  583. +   Msg                    String to be displayed.
  584. +                          
  585. +   username                Pointer to char pointer, i.e. *usernamepoints to a string.  If
  586. +                          non-NULL it is taken to be a default value.
  587. +                          
  588. +   password                Pointer to char pointer, i.e. *passwordpoints to a string.
  589. +                          Initial value discarded.
  590. +                          
  591. +   ON EXIT,
  592. +   
  593. +   *username               and
  594. +                          
  595. +   *password               point to newly allocated strings representing the typed-in
  596. +                          username and password.  Initial strings pointed to by them are
  597. +                          NOT freed!
  598. +                          
  599. +  */
  600. + extern void HTPromptUsernameAndPassword PARAMS((CONST char *    Msg,
  601. +                                                 char **         username,
  602. +                                                 char **         password));
  603.   /*
  604.   
  605.   Display a message, don't wait for input
  606. ***************
  607. *** 76,81 ****
  608. --- 108,114 ----
  609.    */
  610.   
  611.   extern BOOL HTConfirm PARAMS ((CONST char * Msg));
  612.   
  613.   
  614.   
  615. *** ../../../../2.12a/WWW/Library/Implementation/HTAuth.c    Thu Oct  7 14:42:20 1993
  616. --- HTAuth.c    Wed Nov  3 16:20:27 1993
  617. ***************
  618. *** 6,13 ****
  619.   **    AL    Ari Luotonen    luotonen@dxcern.cern.ch
  620.   **
  621.   ** HISTORY:
  622.   **
  623. - **
  624.   ** BUGS:
  625.   **
  626.   **
  627. --- 6,13 ----
  628.   **    AL    Ari Luotonen    luotonen@dxcern.cern.ch
  629.   **
  630.   ** HISTORY:
  631. + **    AL 14.10.93 Fixed the colon-not-allowed-in-password-bug.
  632.   **
  633.   ** BUGS:
  634.   **
  635.   **
  636. ***************
  637. *** 44,50 ****
  638.       char *inet_addr = NULL;
  639.       char *timestamp = NULL;
  640.       char *browsers_key = NULL;
  641. -     char *extras = NULL;
  642.   
  643.       if (!user && !(user = (HTAAUser*)malloc(sizeof(HTAAUser))))    /* Allocated */
  644.       outofmem(__FILE__, "decompose_auth_string");        /* only once */
  645. --- 44,49 ----
  646. ***************
  647. *** 120,135 ****
  648.                      "fields missing in authentication string");
  649.           return NULL;
  650.       }
  651. -     extras = strchr(browsers_key, ':');
  652. -     }
  653. -     else extras = strchr(password, ':');
  654. -     if (extras) {
  655. -     *(extras++) = '\0';
  656. -     if (TRACE) fprintf(stderr, "%s `%s' %s `%s'\n",
  657. -                "decompose_auth_string: extra field(s) in",
  658. -                (scheme==HTAA_BASIC ? "Basic" : "Pubkey"),
  659. -                "authorization string ignored:", extras);
  660.       }
  661.   
  662.   /*
  663. --- 119,124 ----
  664. *** ../../../../2.12a/WWW/Library/Implementation/HTChunk.h    Thu Jun 10 11:55:20 1993
  665. --- HTChunk.h    Thu Nov  4 10:07:11 1993
  666. ***************
  667. *** 1,4 ****
  668. ! /*                  /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTChunk.html
  669.                                        CHUNK HANDLING:
  670.                                        FLEXIBLE ARRAYS
  671.                                                
  672. --- 1,4 ----
  673. ! /*                                                HTChunk: Flexible array handling for libwww
  674.                                        CHUNK HANDLING:
  675.                                        FLEXIBLE ARRAYS
  676.                                                
  677. ***************
  678. *** 105,115 ****
  679.     
  680.     ch                      A valid chunk pointer made by HTChunkCreate()
  681.                            
  682. !   c                      The character to be appended
  683.                            
  684.     ON EXIT,
  685.     
  686. !   *ch                    Is one character bigger
  687.                            
  688.    */
  689.   extern void HTChunkPutc PARAMS((HTChunk * ch, char c));
  690. --- 105,115 ----
  691.     
  692.     ch                      A valid chunk pointer made by HTChunkCreate()
  693.                            
  694. !   c                       The character to be appended
  695.                            
  696.     ON EXIT,
  697.     
  698. !   *ch                     Is one character bigger
  699.                            
  700.    */
  701.   extern void HTChunkPutc PARAMS((HTChunk * ch, char c));
  702. ***************
  703. *** 157,160 ****
  704.   
  705.   /*
  706.   
  707. !    end  */
  708. --- 157,160 ----
  709.   
  710.   /*
  711.   
  712. !    end */
  713. *** ../../../../2.12a/WWW/Library/Implementation/HTFTP.c    Thu Sep  2 17:52:47 1993
  714. --- HTFTP.c    Wed Nov  3 16:21:29 1993
  715. ***************
  716. *** 275,281 ****
  717.           break;        
  718.           } /* if end of line */
  719.           
  720. !         if (*(p-1) < 0) {
  721.           if(TRACE) fprintf(stderr, "Error on rx: closing socket %d\n",
  722.               control->socket);
  723.           strcpy(response_text, "000 *** TCP read error on response\n");
  724. --- 275,281 ----
  725.           break;        
  726.           } /* if end of line */
  727.           
  728. !         if (*(p-1) == (char) EOF) {
  729.           if(TRACE) fprintf(stderr, "Error on rx: closing socket %d\n",
  730.               control->socket);
  731.           strcpy(response_text, "000 *** TCP read error on response\n");
  732. *** ../../../../2.12a/WWW/Library/Implementation/HTFWriter.c    Tue Oct  5 11:20:30 1993
  733. --- HTFWriter.c    Wed Nov  3 16:21:32 1993
  734. ***************
  735. *** 126,134 ****
  736.   */
  737.   PRIVATE void HTFWriter_free ARGS1(HTStream *, me)
  738.   {
  739. !     fflush(me->fp);
  740.       if (me->end_command) {        /* Temp file */
  741. -         fclose(me->fp);
  742.           HTProgress(me->end_command);    /* Tell user what's happening */
  743.       system(me->end_command);
  744.       free (me->end_command);
  745. --- 126,133 ----
  746.   */
  747.   PRIVATE void HTFWriter_free ARGS1(HTStream *, me)
  748.   {
  749. !     fclose(me->fp);
  750.       if (me->end_command) {        /* Temp file */
  751.           HTProgress(me->end_command);    /* Tell user what's happening */
  752.       system(me->end_command);
  753.       free (me->end_command);
  754. ***************
  755. *** 146,154 ****
  756.   
  757.   PRIVATE void HTFWriter_abort ARGS2(HTStream *, me, HTError, e)
  758.   {
  759. !     fflush(me->fp);
  760.       if (me->end_command) {        /* Temp file */
  761. -         fclose(me->fp);
  762.       if (TRACE) fprintf(stderr,
  763.           "HTFWriter: Aborting: file not executed.\n");
  764.       free (me->end_command);
  765. --- 145,152 ----
  766.   
  767.   PRIVATE void HTFWriter_abort ARGS2(HTStream *, me, HTError, e)
  768.   {
  769. !     fclose(me->fp);
  770.       if (me->end_command) {        /* Temp file */
  771.       if (TRACE) fprintf(stderr,
  772.           "HTFWriter: Aborting: file not executed.\n");
  773.       free (me->end_command);
  774. *** ../../../../2.12a/WWW/Library/Implementation/HTFile.c    Tue Oct  5 10:47:44 1993
  775. --- HTFile.c    Thu Nov  4 10:54:15 1993
  776. ***************
  777. *** 97,102 ****
  778. --- 97,105 ----
  779.   **    representation.
  780.   **    Calling this with suffix set to "*.*" will set the default
  781.   **    representation for unknown suffix files which contain a ".".
  782. + **
  783. + **    If filename suffix is already defined its previous
  784. + **    definition is overridden.
  785.   */
  786.   PUBLIC void HTSetSuffix ARGS4(
  787.       CONST char *,    suffix,
  788. ***************
  789. *** 106,122 ****
  790.   {
  791.       
  792.       HTSuffix * suff;
  793. !     
  794.       if (strcmp(suffix, "*")==0) suff = &no_suffix;
  795.       else if (strcmp(suffix, "*.*")==0) suff = &unknown_suffix;
  796.       else {
  797. !     suff = (HTSuffix*) calloc(1, sizeof(HTSuffix));
  798. !     if (suff == NULL) outofmem(__FILE__, "HTSetSuffix");
  799.       
  800. !     if (!HTSuffixes) HTSuffixes = HTList_new();
  801. !     HTList_addObject(HTSuffixes, suff);
  802.       
  803. !     StrAllocCopy(suff->suffix, suffix);
  804.       }
  805.   
  806.       suff->rep = HTAtom_for(representation);
  807. --- 109,133 ----
  808.   {
  809.       
  810.       HTSuffix * suff;
  811.       if (strcmp(suffix, "*")==0) suff = &no_suffix;
  812.       else if (strcmp(suffix, "*.*")==0) suff = &unknown_suffix;
  813.       else {
  814. !     HTList *cur = HTSuffixes;
  815. !     while (NULL != (suff = (HTSuffix*)HTList_nextObject(cur))) {
  816. !         if (suff->suffix && 0==strcmp(suff->suffix, suffix))
  817. !         break;
  818. !     }
  819. !     if (!suff) { /* Not found -- create a new node */
  820. !         suff = (HTSuffix*) calloc(1, sizeof(HTSuffix));
  821. !         if (suff == NULL) outofmem(__FILE__, "HTSetSuffix");
  822.       
  823. !         if (!HTSuffixes) HTSuffixes = HTList_new();
  824. !         HTList_addObject(HTSuffixes, suff);
  825.       
  826. !         StrAllocCopy(suff->suffix, suffix);
  827. !     }
  828.       }
  829.   
  830.       suff->rep = HTAtom_for(representation);
  831. *** ../../../../2.12a/WWW/Library/Implementation/HTGroup.h    Tue Oct  5 11:04:36 1993
  832. --- HTGroup.h    Thu Nov  4 10:07:16 1993
  833. ***************
  834. *** 30,35 ****
  835. --- 30,36 ----
  836.   */
  837.   typedef enum {
  838.       HTAA_OK,            /* 200 OK                               */
  839. +     HTAA_OK_GATEWAY,    /* 200 OK, acting as a gateway          */
  840.       HTAA_NO_AUTH,       /* 401 Unauthorized, not authenticated  */
  841.       HTAA_NOT_MEMBER,    /* 401 Unauthorized, not authorized     */
  842.       HTAA_IP_MASK,       /* 403 Forbidden by IP mask             */
  843. ***************
  844. *** 37,42 ****
  845. --- 38,44 ----
  846.       HTAA_NO_ACL,        /* 403 Forbidden, ACL non-existent      */
  847.       HTAA_NO_ENTRY,      /* 403 Forbidden, no ACL entry          */
  848.       HTAA_SETUP_ERROR,   /* 403 Forbidden, server setup error    */
  849. +     HTAA_DOTDOT,        /* 403 Forbidden, URL with /../ illegal */
  850.       HTAA_NOT_FOUND      /* 404 Not found, or read protected     */
  851.   } HTAAFailReasonType;
  852.   
  853. *** ../../../../2.12a/WWW/Library/Implementation/HTInit.c    Mon Sep 27 15:15:12 1993
  854. --- HTInit.c    Wed Nov  3 16:20:30 1993
  855. ***************
  856. *** 23,56 ****
  857.   PUBLIC void HTFormatInit NOARGS
  858.   {
  859.   #ifdef NeXT
  860. !   HTSetPresentation("application/postscript", "open %s",    1.0, 2.0, 0.0);
  861. !   /* The following needs the GIF previewer -- you might not have it. */
  862. !   HTSetPresentation("image/gif",         "open %s",     0.3, 2.0, 0.0);
  863. !   HTSetPresentation("image/x-tiff",         "open %s",     1.0, 2.0, 0.0);
  864. !   HTSetPresentation("audio/basic",         "open %s",     1.0, 2.0, 0.0);
  865. !   HTSetPresentation("*",             "open %s",     1.0, 0.0, 0.0);
  866.   #else
  867. !  if (getenv("DISPLAY")) {    /* Must have X11 */
  868. !   HTSetPresentation("application/postscript", "ghostview %s",    1.0, 3.0, 0.0);
  869. !   HTSetPresentation("image/gif",         "xv %s",     1.0, 3.0, 0.0);
  870. !   HTSetPresentation("image/x-tiff",         "xv %s",     1.0, 3.0, 0.0);
  871. !   HTSetPresentation("image/jpeg",         "xv %s",     1.0, 3.0, 0.0);
  872. !  }
  873.   #endif
  874. !  HTSetConversion("www/mime",  "*",           HTMIMEConvert,     1.0, 0.0, 0.0);
  875. !  HTSetConversion("application/x-wais-source",
  876. !                "*",           HTWSRCConvert,     1.0, 0.0, 0.0);
  877. !  HTSetConversion("text/html", "text/x-c",    HTMLToC,             0.5, 0.0, 0.0);
  878. !  HTSetConversion("text/html", "text/plain",  HTMLToPlain,     0.5, 0.0, 0.0);
  879. !  HTSetConversion("text/html", "www/present", HTMLPresent,     1.0, 0.0, 0.0);
  880. !  HTSetConversion("text/plain", "text/html",  HTPlainToHTML,    1.0, 0.0, 0.0);
  881. !  HTSetConversion("text/plain", "www/present", HTPlainPresent,    1.0, 0.0, 0.0);
  882. !  HTSetConversion("application/octet-stream", "www/present",
  883. !                            HTSaveLocally,    0.1, 0.0, 0.0);
  884. !  HTSetConversion("www/unknown", "www/present",
  885. !                            HTSaveLocally,    0.3, 0.0, 0.0);
  886. !  HTSetConversion("www/source", "www/present",
  887. !                            HTSaveLocally,    0.3, 0.0, 0.0);
  888.   }
  889.   
  890.   
  891. --- 23,52 ----
  892.   PUBLIC void HTFormatInit NOARGS
  893.   {
  894.   #ifdef NeXT
  895. !     HTSetPresentation("application/postscript", "open %s",    1.0, 2.0, 0.0);
  896. !     /* The following needs the GIF previewer -- you might not have it. */
  897. !     HTSetPresentation("image/gif",         "open %s",     0.3, 2.0, 0.0);
  898. !     HTSetPresentation("image/x-tiff",         "open %s",     1.0, 2.0, 0.0);
  899. !     HTSetPresentation("audio/basic",         "open %s",     1.0, 2.0, 0.0);
  900. !     HTSetPresentation("*",             "open %s",     1.0, 0.0, 0.0);
  901.   #else
  902. !     if (getenv("DISPLAY")) {    /* Must have X11 */
  903. !     HTSetPresentation("application/postscript", "ghostview %s",    1.0, 3.0, 0.0);
  904. !     HTSetPresentation("image/gif",         "xv %s",    1.0, 3.0, 0.0);
  905. !     HTSetPresentation("image/x-tiff",     "xv %s",    1.0, 3.0, 0.0);
  906. !     HTSetPresentation("image/jpeg",     "xv %s",    1.0, 3.0, 0.0);
  907. !     }
  908.   #endif
  909. !     HTSetConversion("www/mime",            "*",        HTMIMEConvert,    1.0, 0.0, 0.0);
  910. !     HTSetConversion("application/x-wais-source","*",        HTWSRCConvert,     1.0, 0.0, 0.0);
  911. !     HTSetConversion("text/html",        "text/x-c",    HTMLToC,    0.5, 0.0, 0.0);
  912. !     HTSetConversion("text/html",        "text/plain",    HTMLToPlain,    0.5, 0.0, 0.0);
  913. !     HTSetConversion("text/html",        "www/present",    HTMLPresent,    1.0, 0.0, 0.0);
  914. !     HTSetConversion("text/plain",        "text/html",    HTPlainToHTML,    1.0, 0.0, 0.0);
  915. !     HTSetConversion("text/plain",        "www/present",    HTPlainPresent,    1.0, 0.0, 0.0);
  916. !     HTSetConversion("application/octet-stream",    "www/present",    HTSaveLocally,    0.1, 0.0, 0.0);
  917. !     HTSetConversion("www/unknown",        "www/present",    HTSaveLocally,    0.3, 0.0, 0.0);
  918. !     HTSetConversion("www/source",        "www/present",    HTSaveLocally,    0.3, 0.0, 0.0);
  919.   }
  920.   
  921.   
  922. ***************
  923. *** 68,116 ****
  924.   
  925.   #ifndef NO_INIT
  926.   PUBLIC void HTFileInit NOARGS
  927. ! {    /*     Suffix     Contenet-Type   Content-Encoding    Quality  */
  928. !     
  929. !     HTSetSuffix(".ai",    "application/postscript", "8bit", 0.5);    /* Adobe illustator */
  930. !     HTSetSuffix(".au",  "audio/basic", "binary", 1.0);
  931. !     HTSetSuffix(".mime","www/mime", "8bit", 1.0); /* Internal -- MIME is not recursive? */
  932. !     
  933. !     HTSetSuffix(".PS",    "application/postscript", "8bit", 0.8);
  934. !     HTSetSuffix(".eps",    "application/postscript", "8bit", 0.8);
  935. !     HTSetSuffix(".ps",    "application/postscript", "8bit", 0.8);
  936.   
  937. !     HTSetSuffix(".execme.csh", "application/x-csh", "7bit", 0.5);
  938.       
  939. !     HTSetSuffix(".html","text/html", "8bit", 1.0);
  940. !     
  941. !     HTSetSuffix(".c",    "text/plain", "7bit", 0.5);
  942. !     HTSetSuffix(".h",    "text/plain", "7bit", 0.5);    /* html better */
  943. !     HTSetSuffix(".m",    "text/plain", "7bit", 0.5);    /* Objective-C code */
  944. !     HTSetSuffix(".f90",    "text/plain", "7bit", 0.5);    /* Fortran 90 */
  945. !     HTSetSuffix(".txt", "text/plain", "7bit", 0.5);
  946. !     HTSetSuffix(".rtf",    "application/x-rtf", "8bit", 1.0);
  947. !     HTSetSuffix(".src",    "application/x-wais-source", "7bit", 1.0);
  948. !     
  949. !     HTSetSuffix(".snd", "audio/basic", "binary", 1.0);
  950. !     
  951. !     HTSetSuffix(".bin",    "application/octet-stream", "binary", 1.0);
  952. !     HTSetSuffix(".Z",    "application/x-compressed", "binary", 1.0);
  953. !     
  954. !     HTSetSuffix(".gif", "image/gif", "binary", 1.0);
  955. !     HTSetSuffix(".tiff","image/x-tiff", "binary", 1.0);
  956. !     
  957. !     HTSetSuffix(".jpg", "image/jpeg", "binary", 1.0);
  958. !     HTSetSuffix(".JPG", "image/jpeg", "binary", 1.0);
  959. !     HTSetSuffix(".JPEG","image/jpeg", "binary", 1.0);
  960. !     HTSetSuffix(".jpeg","image/jpeg", "binary", 1.0);
  961. !     
  962. !     HTSetSuffix(".MPEG","video/mpeg", "binary", 1.0);
  963. !     HTSetSuffix(".mpg","video/mpeg", "binary", 1.0);
  964. !     HTSetSuffix(".MPG","video/mpeg", "binary", 1.0);
  965. !     HTSetSuffix(".mpeg","video/mpeg", "binary", 1.0);
  966.   
  967.   }
  968.   #endif /* NO_INIT */
  969. --- 64,160 ----
  970.   
  971.   #ifndef NO_INIT
  972.   PUBLIC void HTFileInit NOARGS
  973. ! {
  974. !     /*        Suffix     Contenet-Type    Content-Encoding  Quality            */
  975.   
  976. !     HTSetSuffix(".mime",   "www/mime",            "8bit",   1.0);    /* Internal -- MIME is    */
  977. !                                                                         /* not recursive    */
  978. !     HTSetSuffix(".bin",    "application/octet-stream",    "binary", 1.0); /* Uninterpreted binary    */
  979. !     HTSetSuffix(".oda",    "application/oda",        "binary", 1.0);
  980. !     HTSetSuffix(".pdf",    "application/pdf",        "binary", 1.0);
  981. !     HTSetSuffix(".ai",     "application/postscript",    "8bit",   0.5);    /* Adobe Illustrator    */
  982. !     HTSetSuffix(".PS",     "application/postscript",    "8bit",      0.8);    /* PostScript        */
  983. !     HTSetSuffix(".eps",    "application/postscript",    "8bit",   0.8);
  984. !     HTSetSuffix(".ps",     "application/postscript",    "8bit",   0.8);
  985. !     HTSetSuffix(".rtf",    "application/x-rtf",        "7bit",   1.0);    /* RTF            */
  986. !     HTSetSuffix(".Z",      "application/x-compressed",    "binary", 1.0);    /* Compressed data    */
  987. !     HTSetSuffix(".csh",    "application/x-csh",        "7bit",   0.5);    /* C-shell script    */
  988. !     HTSetSuffix(".dvi",    "application/x-dvi",        "binary", 1.0);    /* TeX DVI        */
  989. !     HTSetSuffix(".hdf",    "application/x-hdf",        "binary", 1.0);    /* NCSA HDF data file    */
  990. !     HTSetSuffix(".latex",  "application/x-latex",    "8bit",   1.0);    /* LaTeX source        */
  991. !     HTSetSuffix(".nc",     "application/x-netcdf",    "binary", 1.0);    /* Unidata netCDF data    */
  992. !     HTSetSuffix(".cdf",    "application/x-netcdf",    "binary", 1.0);
  993. !     HTSetSuffix(".sh",     "application/x-sh",        "7bit",   0.5);    /* Shell-script        */
  994. !     HTSetSuffix(".tcl",    "application/x-tcl",        "7bit",   0.5);    /* TCL-script        */
  995. !     HTSetSuffix(".tex",    "application/x-tex",        "8bit",   1.0);    /* TeX source        */
  996. !     HTSetSuffix(".texi",   "application/x-texinfo",    "7bit",   1.0);    /* Texinfo        */
  997. !     HTSetSuffix(".texinfo","application/x-texinfo",    "7bit",   1.0);
  998. !     HTSetSuffix(".t",      "application/x-troff",    "7bit",   0.5);    /* Troff        */
  999. !     HTSetSuffix(".roff",   "application/x-troff",    "7bit",   0.5);
  1000. !     HTSetSuffix(".tr",     "application/x-troff",    "7bit",   0.5);
  1001. !     HTSetSuffix(".man",    "application/x-troff-man",    "7bit",   0.5);    /* Troff with man macros*/
  1002. !     HTSetSuffix(".me",     "application/x-troff-me",    "7bit",   0.5);    /* Troff with me macros    */
  1003. !     HTSetSuffix(".ms",     "application/x-troff-ms",    "7bit",   0.5);    /* Troff with ms macros    */
  1004. !     HTSetSuffix(".src",    "application/x-wais-source",    "7bit",   1.0);    /* WAIS source        */
  1005. !     HTSetSuffix(".zip",    "application/zip",        "binary", 1.0);    /* PKZIP        */
  1006. !     HTSetSuffix(".bcpio",  "application/x-bcpio",    "binary", 1.0);    /* Old binary CPIO    */
  1007. !     HTSetSuffix(".cpio",   "application/x-cpio",    "binary", 1.0);    /* POSIX CPIO        */
  1008. !     HTSetSuffix(".gtar",   "application/x-gtar",    "binary", 1.0);    /* Gnu tar        */
  1009. !     HTSetSuffix(".shar",   "application/x-shar",    "8bit",   1.0);    /* Shell archive    */
  1010. !     HTSetSuffix(".sv4cpio","application/x-sv4cpio",    "binary", 1.0);    /* SVR4 CPIO        */
  1011. !     HTSetSuffix(".sv4crc", "application/x-sv4crc",    "binary", 1.0);    /* SVR4 CPIO with CRC    */
  1012. !     HTSetSuffix(".tar",    "application/x-tar",        "binary", 1.0);    /* 4.3BSD tar        */
  1013. !     HTSetSuffix(".ustar",  "application/x-ustar",    "binary", 1.0);    /* POSIX tar        */
  1014. !     HTSetSuffix(".snd",    "audio/basic",        "binary", 1.0);    /* Audio        */
  1015. !     HTSetSuffix(".au",     "audio/basic",        "binary", 1.0);
  1016. !     HTSetSuffix(".aiff",   "audio/x-aiff",        "binary", 1.0);
  1017. !     HTSetSuffix(".aifc",   "audio/x-aiff",        "binary", 1.0);
  1018. !     HTSetSuffix(".aif",    "audio/x-aiff",        "binary", 1.0);
  1019. !     HTSetSuffix(".wav",    "audio/x-wav",        "binary", 1.0);    /* Windows+ WAVE format    */
  1020. !     HTSetSuffix(".gif",    "image/gif",            "binary", 1.0);    /* GIF            */
  1021. !     HTSetSuffix(".ief",    "image/ief",            "binary", 1.0);    /* Image Exchange fmt    */
  1022. !     HTSetSuffix(".jpg",    "image/jpeg",        "binary", 1.0);    /* JPEG            */
  1023. !     HTSetSuffix(".JPG",    "image/jpeg",        "binary", 1.0);
  1024. !     HTSetSuffix(".JPE",    "image/jpeg",        "binary", 1.0);
  1025. !     HTSetSuffix(".jpe",    "image/jpeg",        "binary", 1.0);
  1026. !     HTSetSuffix(".JPEG",   "image/jpeg",        "binary", 1.0);
  1027. !     HTSetSuffix(".jpeg",   "image/jpeg",        "binary", 1.0);
  1028. !     HTSetSuffix(".tif",    "image/tiff",        "binary", 1.0);    /* TIFF            */
  1029. !     HTSetSuffix(".tiff",   "image/tiff",        "binary", 1.0);
  1030. !     HTSetSuffix(".ras",    "image/cmu-raster",        "binary", 1.0);
  1031. !     HTSetSuffix(".pnm",    "image/x-portable-anymap",    "binary", 1.0);    /* PBM Anymap format    */
  1032. !     HTSetSuffix(".pbm",    "image/x-portable-bitmap",    "binary", 1.0);    /* PBM Bitmap format    */
  1033. !     HTSetSuffix(".pgm",    "image/x-portable-graymap",    "binary", 1.0);    /* PBM Graymap format    */
  1034. !     HTSetSuffix(".ppm",    "image/x-portable-pixmap",    "binary", 1.0);    /* PBM Pixmap format    */
  1035. !     HTSetSuffix(".rgb",    "image/x-rgb",        "binary", 1.0);
  1036. !     HTSetSuffix(".xbm",    "image/x-xbitmap",        "binary", 1.0);    /* X bitmap        */
  1037. !     HTSetSuffix(".xpm",    "image/x-xpixmap",        "binary", 1.0);    /* X pixmap format    */
  1038. !     HTSetSuffix(".xwd",    "image/x-xwindowdump",    "binary", 1.0);    /* X window dump (xwd)    */
  1039. !     HTSetSuffix(".html",   "text/html",            "8bit",   1.0);    /* HTML            */
  1040. !     HTSetSuffix(".c",      "text/plain",        "7bit",   0.5);    /* C source        */
  1041. !     HTSetSuffix(".h",      "text/plain",        "7bit",   0.5);    /* C headers        */
  1042. !     HTSetSuffix(".C",      "text/plain",        "7bit",   0.5);    /* C++ source        */
  1043. !     HTSetSuffix(".cc",     "text/plain",        "7bit",   0.5);    /* C++ source        */
  1044. !     HTSetSuffix(".hh",     "text/plain",        "7bit",   0.5);    /* C++ headers        */
  1045. !     HTSetSuffix(".m",      "text/plain",        "7bit",   0.5);    /* Objective-C source    */
  1046. !     HTSetSuffix(".f90",    "text/plain",        "7bit",   0.5);    /* Fortran 90 source    */
  1047. !     HTSetSuffix(".txt",    "text/plain",        "7bit",   0.5);    /* Plain text        */
  1048. !     HTSetSuffix(".rtx",    "text/richtext",        "7bit",   1.0);    /* MIME Richtext format    */
  1049. !     HTSetSuffix(".tsv",    "text/tab-separated-values",    "7bit",   1.0);    /* Tab-separated values    */
  1050. !     HTSetSuffix(".etx",    "text/x-setext",        "7bit",   0.9);    /* Struct Enchanced Txt    */
  1051. !     HTSetSuffix(".MPG",    "video/mpeg",        "binary", 1.0);    /* MPEG            */
  1052. !     HTSetSuffix(".mpg",    "video/mpeg",        "binary", 1.0);
  1053. !     HTSetSuffix(".MPE",    "video/mpeg",        "binary", 1.0);
  1054. !     HTSetSuffix(".mpe",    "video/mpeg",        "binary", 1.0);
  1055. !     HTSetSuffix(".MPEG",   "video/mpeg",        "binary", 1.0);
  1056. !     HTSetSuffix(".mpeg",   "video/mpeg",        "binary", 1.0);
  1057. !     HTSetSuffix(".qt",     "video/quicktime",        "binary", 1.0);    /* QuickTime        */
  1058. !     HTSetSuffix(".mov",    "video/quicktime",        "binary", 1.0);
  1059. !     HTSetSuffix(".avi",    "video/x-msvideo",        "binary", 1.0);    /* MS Video for Windows    */
  1060. !     HTSetSuffix(".movie",  "video/x-sgi-movie",        "binary", 1.0);    /* SGI "moviepalyer"    */
  1061.       
  1062. !     HTSetSuffix("*.*",     "application/octet-stream",    "binary", 0.1);
  1063. !     HTSetSuffix("*",       "text/plain",        "7bit",   0.5);
  1064.   
  1065.   }
  1066.   #endif /* NO_INIT */
  1067. *** ../../../../2.12a/WWW/Library/Implementation/HTML.c    Thu Sep  2 17:55:07 1993
  1068. --- HTML.c    Wed Nov  3 16:21:35 1993
  1069. ***************
  1070. *** 493,498 ****
  1071. --- 493,512 ----
  1072.          HTAnchor_setIndex(me->node_anchor);
  1073.       break;
  1074.       
  1075. +     case HTML_BR: 
  1076. +     UPDATE_STYLE;
  1077. +     HText_appendCharacter(me->text, '\n');
  1078. +     me->in_word = NO;
  1079. +     break;
  1080. +     
  1081. +     case HTML_HR: 
  1082. +     UPDATE_STYLE;
  1083. +     HText_appendCharacter(me->text, '\n');
  1084. +     HText_appendCharacter(me->text, "___________________________________");
  1085. +     HText_appendCharacter(me->text, '\n');
  1086. +     me->in_word = NO;
  1087. +     break;
  1088. +     
  1089.       case HTML_P:
  1090.       UPDATE_STYLE;
  1091.       HText_appendParagraph(me->text);
  1092. ***************
  1093. *** 659,665 ****
  1094.   {
  1095.       HTML_put_string(me, ISO_Latin1[entity_number]);    /* @@ Other representations */
  1096.   }
  1097.   
  1098.   
  1099.   /*    Free an HTML object
  1100. --- 673,678 ----
  1101. *** ../../../../2.12a/WWW/Library/Implementation/HTML.h    Mon Jun 21 16:13:15 1993
  1102. --- HTML.h    Thu Nov  4 10:07:11 1993
  1103. ***************
  1104. *** 1,6 ****
  1105. --- 1,8 ----
  1106.   /*                                                     HTML to rich text converter for libwww
  1107.                                THE HTML TO RTF OBJECT CONVERTER
  1108.                                                
  1109. +    This interprets the HTML semantics.
  1110. +    
  1111.    */
  1112.   #ifndef HTML_H
  1113.   #define HTML_H
  1114. ***************
  1115. *** 73,78 ****
  1116. --- 75,81 ----
  1117.           CONST char *    message));
  1118.   
  1119.   #endif
  1120.   
  1121.   /*
  1122.   
  1123. *** ../../../../2.12a/WWW/Library/Implementation/HTMLDTD.c    Thu Jul  8 12:17:36 1993
  1124. --- HTMLDTD.c    Thu Nov  4 15:35:11 1993
  1125. ***************
  1126. *** 89,95 ****
  1127.   **    Lists must be in alphatbetical order by attribute name
  1128.   **    The tag elements contain the number of attributes
  1129.   */
  1130. ! static attr no_attr[] = 
  1131.       {{ 0 }};
  1132.   
  1133.   static attr a_attr[] = {        /* Anchor attributes */
  1134. --- 89,95 ----
  1135.   **    Lists must be in alphatbetical order by attribute name
  1136.   **    The tag elements contain the number of attributes
  1137.   */
  1138. ! static attr no_attr[1] = 
  1139.       {{ 0 }};
  1140.   
  1141.   static attr a_attr[] = {        /* Anchor attributes */
  1142. ***************
  1143. *** 103,111 ****
  1144.       { 0 }    /* Terminate list */
  1145.   };    
  1146.   
  1147. ! static attr img_attr[] = {            /* Anchor attributes */
  1148.       { "SRC"},
  1149. -     { "ISMAP"},            /* @@@ Use HTTP SpaceJump instead */
  1150.       { 0 }    /* Terminate list */
  1151.   };    
  1152.   
  1153. --- 103,113 ----
  1154.       { 0 }    /* Terminate list */
  1155.   };    
  1156.   
  1157. ! static attr img_attr[HTML_IMG_ATTRIBUTES+1] = {    /* Anchor attributes */
  1158. !     { "ALIGN" },
  1159. !     { "ALT" },
  1160. !     { "ISMAP"},            /* Use HTTP SpaceJump instead */
  1161.       { "SRC"},
  1162.       { 0 }    /* Terminate list */
  1163.   };    
  1164.   
  1165. ***************
  1166. *** 119,129 ****
  1167.       { 0 }    /* Terminate list */
  1168.   };
  1169.   
  1170. ! static attr nextid_attr[] = {
  1171. !     { "N" }
  1172.   };
  1173.   
  1174.   
  1175.   /*    Elements
  1176.   **    --------
  1177.   **
  1178. --- 121,137 ----
  1179.       { 0 }    /* Terminate list */
  1180.   };
  1181.   
  1182. ! static attr nextid_attr[HTML_NEXTID_ATTRIBUTES+1] = {
  1183. !     { "N" },
  1184. !     { 0 }    /* Terminate list */
  1185.   };
  1186.   
  1187. + static attr pre_attr[HTML_PRE_ATTRIBUTES+1] = {
  1188. +     { "WIDTH" },
  1189. +     { 0 }    /* Terminate list */
  1190. + };
  1191.   
  1192.   /*    Elements
  1193.   **    --------
  1194.   **
  1195. ***************
  1196. *** 138,143 ****
  1197. --- 146,152 ----
  1198.       { "B"    , no_attr,    0,        SGML_MIXED },
  1199.       { "BLOCKQUOTE", no_attr,    0,        SGML_MIXED },
  1200.       { "BODY"    , no_attr,    0,        SGML_MIXED },
  1201. +     { "BR"    , no_attr,    0,        SGML_EMPTY },
  1202.       { "CITE"    , no_attr,    0,        SGML_MIXED },
  1203.       { "CODE"    , no_attr,    0,        SGML_MIXED },
  1204.       { "COMMENT",  no_attr,    0,        SGML_MIXED },
  1205. ***************
  1206. *** 156,161 ****
  1207. --- 165,171 ----
  1208.       { "H5"    , no_attr,    0,        SGML_MIXED },
  1209.       { "H6"    , no_attr,    0,        SGML_MIXED },
  1210.       { "H7"    , no_attr,    0,        SGML_MIXED },
  1211. +     { "HR"    , no_attr,    0,        SGML_EMPTY },
  1212.       { "HTML"    , no_attr,    0,        SGML_MIXED },
  1213.       { "I"    , no_attr,    0,        SGML_MIXED },
  1214.       { "IMG"     , img_attr,    2,        SGML_EMPTY },
  1215. ***************
  1216. *** 169,175 ****
  1217.       { "OL"    , list_attr,    1,        SGML_MIXED },
  1218.       { "P"    , no_attr,    0,        SGML_EMPTY },
  1219.       { "PLAINTEXT", no_attr,    0,        SGML_LITTERAL },
  1220. !     { "PRE"    , no_attr,    0,        SGML_MIXED },
  1221.       { "SAMP"    , no_attr,    0,        SGML_MIXED },
  1222.       { "STRONG"    , no_attr,    0,        SGML_MIXED },
  1223.       { "TITLE",       no_attr,    0,        SGML_CDATA },
  1224. --- 179,185 ----
  1225.       { "OL"    , list_attr,    1,        SGML_MIXED },
  1226.       { "P"    , no_attr,    0,        SGML_EMPTY },
  1227.       { "PLAINTEXT", no_attr,    0,        SGML_LITTERAL },
  1228. !     { "PRE"    , pre_attr,    0,        SGML_MIXED },
  1229.       { "SAMP"    , no_attr,    0,        SGML_MIXED },
  1230.       { "STRONG"    , no_attr,    0,        SGML_MIXED },
  1231.       { "TITLE",       no_attr,    0,        SGML_CDATA },
  1232. ***************
  1233. *** 224,229 ****
  1234. --- 234,259 ----
  1235.       }
  1236.       
  1237.       (*obj->isa->start_element)(obj, HTML_A , present, value);
  1238. + }
  1239. + PUBLIC void HTNextID ARGS2(HTStructured *, obj,
  1240. +         int,    next_one)
  1241. + {
  1242. +     BOOL        present[HTML_NEXTID_ATTRIBUTES];
  1243. +     CONST char*        value[HTML_NEXTID_ATTRIBUTES];
  1244. +     char string[10];
  1245. +     
  1246. +     sprintf(string, "z%i", next_one);
  1247. +     {
  1248. +         int i;
  1249. +         for(i=0; i<HTML_NEXTID_ATTRIBUTES; i++)
  1250. +         present[i] = NO;
  1251. +     }
  1252. +     present[HTML_NEXTID_N] = YES;
  1253. +     value[HTML_NEXTID_N] = string;
  1254. +     
  1255. +     (*obj->isa->start_element)(obj, HTML_NEXTID , present, value);
  1256.   
  1257.   }
  1258.   
  1259. *** ../../../../2.12a/WWW/Library/Implementation/HTMLDTD.h    Thu Sep  2 18:02:20 1993
  1260. --- HTMLDTD.h    Wed Nov  3 16:29:06 1993
  1261. ***************
  1262. *** 29,34 ****
  1263. --- 29,35 ----
  1264.   typedef enum _HTMLElement {
  1265.           HTML_A,         HTML_ADDRESS,
  1266.           HTML_B,         HTML_BLOCKQUOTE,        HTML_BODY,
  1267. +         HTML_BR,
  1268.           HTML_CITE,      HTML_CODE,      HTML_COMMENT,
  1269.           HTML_DD,        HTML_DFN,       HTML_DIR,
  1270.           HTML_DL,        HTML_DLC,       HTML_DT,
  1271. ***************
  1272. *** 36,41 ****
  1273. --- 37,43 ----
  1274.           HTML_HEAD,
  1275.           HTML_H1,        HTML_H2,        HTML_H3,
  1276.           HTML_H4,        HTML_H5,        HTML_H6,        HTML_H7,
  1277. +         HTML_HR,
  1278.           HTML_HTML,
  1279.           HTML_I,         HTML_IMG,       HTML_ISINDEX,
  1280.           HTML_KBD,
  1281. ***************
  1282. *** 47,53 ****
  1283.           HTML_U,         HTML_UL,
  1284.           HTML_VAR,       HTML_XMP } HTMLElement;
  1285.   
  1286. ! #define HTML_ELEMENTS 45
  1287.   
  1288.   /*
  1289.   
  1290. --- 49,55 ----
  1291.           HTML_U,         HTML_UL,
  1292.           HTML_VAR,       HTML_XMP } HTMLElement;
  1293.   
  1294. ! #define HTML_ELEMENTS 48
  1295.   
  1296.   /*
  1297.   
  1298. ***************
  1299. *** 57,63 ****
  1300.   
  1301.   /*
  1302.   
  1303. !    Identifier is HTML_<element>_<attribute>. These must match the tables in HTML.c!
  1304.      
  1305.    */
  1306.   #define HTML_A_HREF             0
  1307. --- 59,65 ----
  1308.   
  1309.   /*
  1310.   
  1311. !    Identifier is HTML_<element>_<attribute>. These must match the tables in HTMLDTD.c !
  1312.      
  1313.    */
  1314.   #define HTML_A_HREF             0
  1315. ***************
  1316. *** 71,80 ****
  1317.   
  1318.   #define DL_COMPACT 0
  1319.   
  1320. ! #define HTML_IMG_SRC            0
  1321.   
  1322. ! #define NEXTID_N 0
  1323.   
  1324.   extern CONST SGML_dtd HTML_dtd;
  1325.   
  1326.   
  1327. --- 73,91 ----
  1328.   
  1329.   #define DL_COMPACT 0
  1330.   
  1331. ! #define HTML_IMG_ALIGN          0
  1332.   
  1333. ! #define HTML_IMG_ALT            1
  1334. ! #define HTML_IMG_ISMAP          2       /* Obsolete but supported */
  1335. ! #define HTML_IMG_SRC            3
  1336. ! #define HTML_IMG_ATTRIBUTES     4
  1337.   
  1338. + #define HTML_NEXTID_ATTRIBUTES  1
  1339. + #define HTML_NEXTID_N 0
  1340. + #define HTML_PRE_WIDTH          0
  1341. + #define HTML_PRE_ATTRIBUTES     1
  1342.   extern CONST SGML_dtd HTML_dtd;
  1343.   
  1344.   
  1345. ***************
  1346. *** 99,104 ****
  1347. --- 110,126 ----
  1348.   
  1349.   
  1350.   #endif /* HTMLDTD_H */
  1351. + /*
  1352. + Specify next ID to be used
  1353. +    This is anoter convenience routine, for specifying the next ID to be used by an editor
  1354. +    in the series z1. z2,...
  1355. +    
  1356. +  */
  1357. + extern void HTNextID PARAMS((HTStructured * targetStream, int n));
  1358.   
  1359.   /*
  1360.   
  1361. *** ../../../../2.12a/WWW/Library/Implementation/HTMLGen.c    Thu Sep  2 17:55:30 1993
  1362. --- HTMLGen.c    Wed Nov  3 16:21:46 1993
  1363. ***************
  1364. *** 8,17 ****
  1365.   **        Should convert old XMP, LISTING and PLAINTEXT to PRE.
  1366.   **
  1367.   **    It is not obvious to me right now whether the HEAD should be generated
  1368. ! **    from the incomming data or the anchor.  Currently itis from the former
  1369.   **    which is cleanest.
  1370.   */
  1371.   
  1372.   /* Implements:
  1373.   */
  1374.   #include "HTMLGen.h"
  1375. --- 8,19 ----
  1376.   **        Should convert old XMP, LISTING and PLAINTEXT to PRE.
  1377.   **
  1378.   **    It is not obvious to me right now whether the HEAD should be generated
  1379. ! **    from the incomming data or the anchor.  Currently it is from the former
  1380.   **    which is cleanest.
  1381.   */
  1382.   
  1383. + #define BUFFER_SIZE    80    /* Line buffer attempts to make neat breaks */
  1384.   /* Implements:
  1385.   */
  1386.   #include "HTMLGen.h"
  1387. ***************
  1388. *** 23,29 ****
  1389.   #include "HTFormat.h"
  1390.   
  1391.   #define PUTC(c) (*me->targetClass.put_character)(me->target, c)
  1392. ! #define PUTS(s) (*me->targetClass.put_string)(me->target, s)
  1393.   #define PUTB(s,l) (*me->targetClass.put_block)(me->target, s, l)
  1394.   
  1395.   /*        HTML Object
  1396. --- 25,31 ----
  1397.   #include "HTFormat.h"
  1398.   
  1399.   #define PUTC(c) (*me->targetClass.put_character)(me->target, c)
  1400. ! /* #define PUTS(s) (*me->targetClass.put_string)(me->target, s) */
  1401.   #define PUTB(s,l) (*me->targetClass.put_block)(me->target, s, l)
  1402.   
  1403.   /*        HTML Object
  1404. ***************
  1405. *** 40,54 ****
  1406.       CONST HTStructuredClass *    isa;
  1407.       HTStream *             target;
  1408.       HTStreamClass            targetClass;    /* COPY for speed */
  1409.   };
  1410.   
  1411.   
  1412.   /*    Character handling
  1413.   **    ------------------
  1414.   */
  1415.   PRIVATE void HTMLGen_put_character ARGS2(HTStructured *, me, char, c)
  1416.   {
  1417. !     PUTC(c);
  1418.   }
  1419.   
  1420.   
  1421. --- 42,109 ----
  1422.       CONST HTStructuredClass *    isa;
  1423.       HTStream *             target;
  1424.       HTStreamClass            targetClass;    /* COPY for speed */
  1425. +     
  1426. +     char                buffer[BUFFER_SIZE];
  1427. +     char *                write_pointer;
  1428. +     char *                line_break;
  1429. +     int                cleanness;
  1430. +     BOOL                preformatted;
  1431.   };
  1432.   
  1433.   
  1434. + /*    Flush Buffer
  1435. + **    ------------
  1436. + */
  1437. + PRIVATE void HTMLGen_flush ARGS1(HTStructured *, me)
  1438. + {
  1439. +     (*me->targetClass.put_block)(me->target, 
  1440. +                     me->buffer,
  1441. +                 me->write_pointer - me->buffer);
  1442. +     me->write_pointer = me->buffer;
  1443. +     me->line_break = me->buffer;
  1444. +     me->cleanness = 0;
  1445. + }
  1446.   /*    Character handling
  1447.   **    ------------------
  1448.   */
  1449.   PRIVATE void HTMLGen_put_character ARGS2(HTStructured *, me, char, c)
  1450.   {
  1451. !     *me->write_pointer++ = c;
  1452. !     
  1453. !     if (c=='\n') {
  1454. !         HTMLGen_flush(me);
  1455. !     return;
  1456. !     }
  1457. !     
  1458. !     if ((!me->preformatted  && c==' ')) {
  1459. !         me->line_break = me->write_pointer;
  1460. !     me->cleanness = 1;
  1461. !     }
  1462. !     
  1463. !     /* Flush buffer out when full */
  1464. !     if (me->write_pointer == me->buffer + BUFFER_SIZE) {
  1465. !         if (me->cleanness) {
  1466. !         me->line_break[-1] = '\n';
  1467. !         (*me->targetClass.put_block)(me->target,
  1468. !                         me->buffer,
  1469. !                     me->line_break - me->buffer);
  1470. !         {  /* move next line in */
  1471. !             char * p,*q;
  1472. !         for(q=me->buffer, p=me->line_break; p < me->write_pointer; )
  1473. !             *q++ = *p++;
  1474. !         }
  1475. !         me->cleanness = 0;
  1476. !     } else {
  1477. !         (*me->targetClass.put_block)(me->target,
  1478. !             me->buffer,
  1479. !         BUFFER_SIZE);
  1480. !     }
  1481. !     me->write_pointer = me->buffer;
  1482. !     me->line_break = me->buffer;
  1483. !     }
  1484.   }
  1485.   
  1486.   
  1487. ***************
  1488. *** 58,74 ****
  1489.   */
  1490.   PRIVATE void HTMLGen_put_string ARGS2(HTStructured *, me, CONST char*, s)
  1491.   {
  1492. !     PUTS(s);
  1493.   }
  1494.   
  1495.   PRIVATE void HTMLGen_write ARGS3(HTStructured *, me, CONST char*, s, int, l)
  1496.   {
  1497. !     PUTB(s,l);
  1498.   }
  1499.   
  1500.   
  1501.   /*    Start Element
  1502.   **    -------------
  1503.   */
  1504.   PRIVATE void HTMLGen_start_element ARGS4(
  1505.       HTStructured *,     me,
  1506. --- 113,134 ----
  1507.   */
  1508.   PRIVATE void HTMLGen_put_string ARGS2(HTStructured *, me, CONST char*, s)
  1509.   {
  1510. !     CONST char * p;
  1511. !     for(p=s; *p; p++) HTMLGen_put_character(me, *p);
  1512.   }
  1513.   
  1514.   PRIVATE void HTMLGen_write ARGS3(HTStructured *, me, CONST char*, s, int, l)
  1515.   {
  1516. !     CONST char * p;
  1517. !     for(p=s; p<s+l; p++) HTMLGen_put_character(me, *p);
  1518.   }
  1519.   
  1520.   
  1521.   /*    Start Element
  1522.   **    -------------
  1523. + **
  1524. + **    Within the opening tag, there may be spaces
  1525. + **    and the line may be broken at these spaces.
  1526.   */
  1527.   PRIVATE void HTMLGen_start_element ARGS4(
  1528.       HTStructured *,     me,
  1529. ***************
  1530. *** 77,98 ****
  1531.       CONST char **,        value)
  1532.   {
  1533.       int i;
  1534.       HTTag * tag = &HTML_dtd.tags[element_number];
  1535. !     PUTC('<');
  1536. !     PUTS(tag->name);
  1537.       if (present) for (i=0; i< tag->number_of_attributes; i++) {
  1538.           if (present[i]) {
  1539. !         PUTC(' ');
  1540. !         PUTS(tag->attributes[i].name);
  1541.           if (value[i]) {
  1542. !          PUTS("=\"");
  1543. !         PUTS(value[i]);
  1544. !         PUTC('"');
  1545.           }
  1546.       }
  1547.       }
  1548. !     PUTC('>');
  1549.   }
  1550.   
  1551.   
  1552. --- 137,166 ----
  1553.       CONST char **,        value)
  1554.   {
  1555.       int i;
  1556. !     
  1557. !     BOOL was_preformatted = me->preformatted;
  1558.       HTTag * tag = &HTML_dtd.tags[element_number];
  1559. !     me->preformatted = NO;
  1560. !     HTMLGen_put_character(me, '<');
  1561. !     HTMLGen_put_string(me, tag->name);
  1562.       if (present) for (i=0; i< tag->number_of_attributes; i++) {
  1563.           if (present[i]) {
  1564. !         HTMLGen_put_character(me, ' ');
  1565. !         HTMLGen_put_string(me, tag->attributes[i].name);
  1566.           if (value[i]) {
  1567. !          HTMLGen_put_string(me, "=\"");
  1568. !         HTMLGen_put_string(me, value[i]);
  1569. !         HTMLGen_put_character(me, '"');
  1570.           }
  1571.       }
  1572.       }
  1573. !     HTMLGen_put_string(me, ">\n");
  1574. !     
  1575. !     /* Make very specific HTML assumption that PRE can't be
  1576. !        nested! */
  1577. !        
  1578. !     me->preformatted = (element_number == HTML_PRE)  ? YES : was_preformatted;
  1579.   }
  1580.   
  1581.   
  1582. ***************
  1583. *** 110,118 ****
  1584.   PRIVATE void HTMLGen_end_element ARGS2(HTStructured *, me,
  1585.               int , element_number)
  1586.   {
  1587. !     PUTS("</");
  1588. !     PUTS(HTML_dtd.tags[element_number].name);
  1589. !     PUTC('>');
  1590.   }
  1591.   
  1592.   
  1593. --- 178,187 ----
  1594.   PRIVATE void HTMLGen_end_element ARGS2(HTStructured *, me,
  1595.               int , element_number)
  1596.   {
  1597. !     HTMLGen_put_string(me, "</");
  1598. !     HTMLGen_put_string(me, HTML_dtd.tags[element_number].name);
  1599. !     HTMLGen_put_character(me, '>');
  1600. !     if (element_number == HTML_PRE) me->preformatted = NO;
  1601.   }
  1602.   
  1603.   
  1604. ***************
  1605. *** 123,131 ****
  1606.   
  1607.   PRIVATE void HTMLGen_put_entity ARGS2(HTStructured *, me, int, entity_number)
  1608.   {
  1609. !     PUTC('&');
  1610. !     PUTS(HTML_dtd.entity_names[entity_number]);
  1611. !     PUTC(';');
  1612.   }
  1613.   
  1614.   
  1615. --- 192,200 ----
  1616.   
  1617.   PRIVATE void HTMLGen_put_entity ARGS2(HTStructured *, me, int, entity_number)
  1618.   {
  1619. !     HTMLGen_put_character(me, '&');
  1620. !     HTMLGen_put_string(me, HTML_dtd.entity_names[entity_number]);
  1621. !     HTMLGen_put_character(me, ';');
  1622.   }
  1623.   
  1624.   
  1625. ***************
  1626. *** 133,149 ****
  1627.   /*    Free an HTML object
  1628.   **    -------------------
  1629.   **
  1630. - **    Note that the SGML parsing context is freed, but the created object is not,
  1631. - **    as it takes on an existence of its own unless explicitly freed.
  1632.   */
  1633.   PRIVATE void HTMLGen_free ARGS1(HTStructured *, me)
  1634.   {
  1635.       (*me->targetClass.free)(me->target);    /* ripple through */
  1636.       free(me);
  1637.   }
  1638.   
  1639.   
  1640.   
  1641.   PRIVATE void HTMLGen_abort ARGS2(HTStructured *, me, HTError, e)
  1642.   {
  1643.       HTMLGen_free(me);
  1644. --- 202,227 ----
  1645.   /*    Free an HTML object
  1646.   **    -------------------
  1647.   **
  1648.   */
  1649.   PRIVATE void HTMLGen_free ARGS1(HTStructured *, me)
  1650.   {
  1651. +     (*me->targetClass.put_character)(me->target, '\n');
  1652. +     HTMLGen_flush(me);
  1653.       (*me->targetClass.free)(me->target);    /* ripple through */
  1654.       free(me);
  1655.   }
  1656.   
  1657.   
  1658. + PRIVATE void PlainToHTML_free ARGS1(HTStructured *, me)
  1659. + {
  1660. +     HTMLGen_end_element(me, HTML_PRE);
  1661. +     HTMLGen_end_element(me, HTML_BODY);
  1662. +     HTMLGen_end_element(me, HTML_HTML);
  1663. +     HTMLGen_free(me);
  1664. + }
  1665.   
  1666.   PRIVATE void HTMLGen_abort ARGS2(HTStructured *, me, HTError, e)
  1667.   {
  1668.       HTMLGen_free(me);
  1669. ***************
  1670. *** 152,158 ****
  1671.   
  1672.   PRIVATE void PlainToHTML_abort ARGS2(HTStructured *, me, HTError, e)
  1673.   {
  1674. !     HTMLGen_free(me);
  1675.   }
  1676.   
  1677.   
  1678. --- 230,236 ----
  1679.   
  1680.   PRIVATE void PlainToHTML_abort ARGS2(HTStructured *, me, HTError, e)
  1681.   {
  1682. !     PlainToHTML_free(me);
  1683.   }
  1684.   
  1685.   
  1686. ***************
  1687. *** 183,189 ****
  1688.   
  1689.       me->target = output;
  1690.       me->targetClass = *me->target->isa; /* Copy pointers to routines for speed*/
  1691.       return me;
  1692.   }
  1693.   
  1694. --- 261,271 ----
  1695.   
  1696.       me->target = output;
  1697.       me->targetClass = *me->target->isa; /* Copy pointers to routines for speed*/
  1698. !     
  1699. !     me->write_pointer = me->buffer;
  1700. !     me->line_break =     me->buffer;
  1701. !     me->cleanness =     0;
  1702. !     me->preformatted =     NO;
  1703.       return me;
  1704.   }
  1705.   
  1706. ***************
  1707. *** 217,232 ****
  1708.       HTParentAnchor *,    anchor,    
  1709.       HTStream *,        sink)
  1710.   {
  1711. !     HTStream* me = (HTStream*)malloc(sizeof(*me));
  1712.       if (me == NULL) outofmem(__FILE__, "PlainToHTML");
  1713. !     me->isa = (HTStreamClass*) &PlainToHTMLConversion;       
  1714.   
  1715.       me->target = sink;
  1716.       me->targetClass = *me->target->isa;
  1717.           /* Copy pointers to routines for speed*/
  1718.       
  1719. !     PUTS("<BODY>\n<PRE>\n");
  1720. !     return me;
  1721.   }
  1722.   
  1723.   
  1724. --- 299,315 ----
  1725.       HTParentAnchor *,    anchor,    
  1726.       HTStream *,        sink)
  1727.   {
  1728. !     HTStructured* me = (HTStructured*)malloc(sizeof(*me));
  1729.       if (me == NULL) outofmem(__FILE__, "PlainToHTML");
  1730. !     me->isa = (HTStructuredClass*) &PlainToHTMLConversion;       
  1731.   
  1732.       me->target = sink;
  1733.       me->targetClass = *me->target->isa;
  1734.           /* Copy pointers to routines for speed*/
  1735.       
  1736. !     HTMLGen_put_string(me, "<HTML>\n<BODY>\n<PRE>\n");
  1737. !     me->preformatted = YES;
  1738. !     return (HTStream*) me;
  1739.   }
  1740.   
  1741.   
  1742. *** ../../../../2.12a/WWW/Library/Implementation/HTMLGen.h    Thu Jun 10 11:55:22 1993
  1743. --- HTMLGen.h    Thu Nov  4 10:07:12 1993
  1744. ***************
  1745. *** 1,8 ****
  1746. ! /*  */
  1747. ! /*              HTML generator
  1748. ! */
  1749.   #ifndef HTMLGEN_H
  1750.   #define HTMLGEN_H
  1751.   
  1752. --- 1,10 ----
  1753. ! /*                  /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTMLGen.html
  1754. !                                       HTML GENERATOR
  1755. !                                              
  1756. !    This module converts structed stream into stream.  That is, given a stream to write to,
  1757. !    it will give you a structured stream to
  1758. !    
  1759. !  */
  1760.   #ifndef HTMLGEN_H
  1761.   #define HTMLGEN_H
  1762.   
  1763. ***************
  1764. *** 24,29 ****
  1765. --- 26,32 ----
  1766.   
  1767.   
  1768.   #endif
  1769.   /*
  1770.   
  1771.       */
  1772. *** ../../../../2.12a/WWW/Library/Implementation/HTPasswd.c    Wed Oct 13 16:53:43 1993
  1773. --- HTPasswd.c    Wed Nov  3 16:20:34 1993
  1774. ***************
  1775. *** 125,130 ****
  1776. --- 125,136 ----
  1777.   ** ON EXIT:
  1778.   **    returns        YES, if password matches the encrypted one.
  1779.   **            NO, if not, or if either parameter is NULL.
  1780. + ** FIX:
  1781. + **    Only the length of original encrypted password is
  1782. + **    checked -- longer given passwords are accepted if
  1783. + **    common length is correct (but not shorter).
  1784. + **    This is to allow interoperation of servers and clients
  1785. + **    who have a hard-coded limit of 8 to password.
  1786.   */
  1787.   PUBLIC BOOL HTAA_passwdMatch ARGS2(CONST char *, password,
  1788.                      CONST char *, encrypted)
  1789. ***************
  1790. *** 133,143 ****
  1791.       int len;
  1792.       int status;
  1793.   
  1794. !     if (!password || !encrypted ||
  1795. !     13*((strlen(password)+7)/8) != strlen(encrypted))
  1796.       return NO;
  1797.   
  1798. !     len = strlen(encrypted);
  1799.   
  1800.       if (!(result = (char*)malloc(len + 1)))
  1801.       outofmem(__FILE__, "HTAA_encryptPasswd");
  1802. --- 139,150 ----
  1803.       int len;
  1804.       int status;
  1805.   
  1806. !     if (!password || !encrypted)
  1807.       return NO;
  1808.   
  1809. !     len = 13*((strlen(password)+7)/8);
  1810. !     if (len < strlen(encrypted))
  1811. !     return NO;
  1812.   
  1813.       if (!(result = (char*)malloc(len + 1)))
  1814.       outofmem(__FILE__, "HTAA_encryptPasswd");
  1815. ***************
  1816. *** 166,172 ****
  1817.       len -= 13;
  1818.       } /* while */
  1819.   
  1820. !     status = strcmp(result, encrypted);
  1821.   
  1822.       if (TRACE)
  1823.       fprintf(stderr,
  1824. --- 173,179 ----
  1825.       len -= 13;
  1826.       } /* while */
  1827.   
  1828. !     status = strncmp(result, encrypted, strlen(encrypted));
  1829.   
  1830.       if (TRACE)
  1831.       fprintf(stderr,
  1832. *** ../../../../2.12a/WWW/Library/Implementation/HTRules.c    Tue Oct  5 10:47:51 1993
  1833. --- HTRules.c    Wed Nov  3 16:20:34 1993
  1834. ***************
  1835. *** 10,19 ****
  1836.   **      17 Jun 92       Bug fix: pass and fail failed if didn't contain '*' TBL
  1837.   **       1 Sep 93       Bug fix: no memory check - Nathan Torkington
  1838.   **                      BYTE_ADDRESSING removed - Arthur Secret
  1839. ! **    11 Sep 93 MD    Changed %i into %d in debug printf. 
  1840.   **            VMS does not recognize %i.
  1841.   **            Bug Fix: in case of PASS, only one parameter to printf.
  1842. ! **    19 Sep 93    Added Access Authorization stuff - AL
  1843.   **
  1844.   */
  1845.   
  1846. --- 10,20 ----
  1847.   **      17 Jun 92       Bug fix: pass and fail failed if didn't contain '*' TBL
  1848.   **       1 Sep 93       Bug fix: no memory check - Nathan Torkington
  1849.   **                      BYTE_ADDRESSING removed - Arthur Secret
  1850. ! **    11 Sep 93  MD    Changed %i into %d in debug printf. 
  1851.   **            VMS does not recognize %i.
  1852.   **            Bug Fix: in case of PASS, only one parameter to printf.
  1853. ! **    19 Sep 93  AL    Added Access Authorization stuff.
  1854. ! **     1 Nov 93  AL    Added htbin.
  1855.   **
  1856.   */
  1857.   
  1858. ***************
  1859. *** 35,40 ****
  1860. --- 36,47 ----
  1861.       char *        equiv;
  1862.   } rule;
  1863.   
  1864. + /*    Global variables
  1865. + **    ----------------
  1866. + */
  1867. + PUBLIC char *HTBinDir = NULL;    /* Physical /htbin directory path.    */
  1868. +                                 /* In future this should not be global.    */
  1869.   /*    Module-wide variables
  1870.   **    ---------------------
  1871.   */
  1872. ***************
  1873. *** 341,347 ****
  1874.               status >= 1? quality         : 1.0,
  1875.               status >= 2 ? secs             : 0.0,
  1876.               status >= 3 ? secs_per_byte     : 0.0 );
  1877. !     
  1878.       } else {
  1879.       op =    0==strcasecomp(word1, "map")  ?    HT_Map
  1880.           :    0==strcasecomp(word1, "pass") ?    HT_Pass
  1881. --- 348,357 ----
  1882.               status >= 1? quality         : 1.0,
  1883.               status >= 2 ? secs             : 0.0,
  1884.               status >= 3 ? secs_per_byte     : 0.0 );
  1885. !     } else if (0==strcasecomp(word1, "htbin")) { /* Physical /htbin location */
  1886. !     StrAllocCopy(HTBinDir, word2);
  1887.       } else {
  1888.       op =    0==strcasecomp(word1, "map")  ?    HT_Map
  1889.           :    0==strcasecomp(word1, "pass") ?    HT_Pass
  1890. *** ../../../../2.12a/WWW/Library/Implementation/HTRules.h    Tue Oct  5 11:04:24 1993
  1891. --- HTRules.h    Thu Nov  4 10:07:13 1993
  1892. ***************
  1893. *** 27,32 ****
  1894. --- 27,37 ----
  1895.           HT_Protect
  1896.   } HTRuleOp;
  1897.   
  1898. + #ifndef HTBINDIR
  1899. + #define HTBINDIR "/htbin"       /* Default /htbin location */
  1900. + #endif
  1901. + extern char * HTBinDir;         /* Physical /htbin location */
  1902.   /*
  1903.   
  1904.   HTAddRule:  Add rule to the list
  1905. *** ../../../../2.12a/WWW/Library/Implementation/HTStyle.h    Thu Sep  2 18:02:22 1993
  1906. --- HTStyle.h    Thu Nov  4 10:07:12 1993
  1907. ***************
  1908. *** 7,13 ****
  1909.      A StyleSheet is a collection of styles, defining the translation necessary to represent
  1910.      a document. It is a linked list of styles.
  1911.      
  1912. ! Overiding this module
  1913.   
  1914.      Why is the style structure declared in the HTStyle.h module, instead of having the user
  1915.      browser define the structure, and the HTStyle routines just use sizeof() for copying?
  1916. --- 7,13 ----
  1917.      A StyleSheet is a collection of styles, defining the translation necessary to represent
  1918.      a document. It is a linked list of styles.
  1919.      
  1920. ! Overriding this module
  1921.   
  1922.      Why is the style structure declared in the HTStyle.h module, instead of having the user
  1923.      browser define the structure, and the HTStyle routines just use sizeof() for copying?
  1924. ***************
  1925. *** 55,61 ****
  1926.   #endif
  1927.   
  1928.   #ifdef NeXT_suppressed
  1929. ! #include 60;appkit/appkit.h>
  1930.   typedef NXCoord HTCoord;
  1931.   #define HTParagraphStyle NXTextStyle
  1932.   #define HTCoord NXCoord
  1933. --- 55,61 ----
  1934.   #endif
  1935.   
  1936.   #ifdef NeXT_suppressed
  1937. ! #include <appkit/appkit.h>
  1938.   typedef NXCoord HTCoord;
  1939.   #define HTParagraphStyle NXTextStyle
  1940.   #define HTCoord NXCoord
  1941. ***************
  1942. *** 174,179 ****
  1943. --- 174,180 ----
  1944.   #endif
  1945.   #define CLEAR_POINTER ((void *)-1)      /* Pointer value means "clear me" */
  1946.   #endif /* HTStyle_H */
  1947.   
  1948.   /*
  1949.   
  1950. *** ../../../../2.12a/WWW/Library/Implementation/HTUtils.h    Mon Oct 11 12:01:52 1993
  1951. --- HTUtils.h    Mon Oct 18 16:34:34 1993
  1952. ***************
  1953. *** 183,190 ****
  1954.   #define BOOL BOOLEAN
  1955.   #endif
  1956.   #ifndef YES
  1957. ! #define YES (BOOLEAN)1
  1958. ! #define NO (BOOLEAN)0
  1959.   #endif
  1960.   
  1961.   #ifndef min
  1962. --- 183,190 ----
  1963.   #define BOOL BOOLEAN
  1964.   #endif
  1965.   #ifndef YES
  1966. ! #define YES (BOOL)1
  1967. ! #define NO (BOOL)0
  1968.   #endif
  1969.   
  1970.   #ifndef min
  1971. *** ../../../../2.12a/WWW/Library/Implementation/HText.h    Mon Jun 21 16:13:19 1993
  1972. --- HText.h    Thu Nov  4 16:16:13 1993
  1973. ***************
  1974. *** 5,11 ****
  1975.   
  1976.   /*
  1977.   
  1978. !    This is the C interface to the Objective-C (or whatever) HyperText class.
  1979.      
  1980.    */
  1981.   #ifndef HTEXT_H
  1982. --- 5,13 ----
  1983.   
  1984.   /*
  1985.   
  1986. !    This is the C interface to the Objective-C (or whatever) Style-oriented HyperText
  1987. !    class. It is used when a style-oriented text object is available or craeted in order to
  1988. !    display hypertext.
  1989.      
  1990.    */
  1991.   #ifndef HTEXT_H
  1992. ***************
  1993. *** 13,18 ****
  1994. --- 15,21 ----
  1995.   #include "HTAnchor.h"
  1996.   #include "HTStyle.h"
  1997.   #include "HTStream.h"
  1998. + #include "SGML.h"
  1999.   
  2000.   #ifdef SHORT_NAMES
  2001.   #define HTMainText                      HTMaText
  2002. ***************
  2003. *** 24,29 ****
  2004. --- 27,33 ----
  2005.   #define HText_endAppend                 HTHTEnAp
  2006.   #define HText_setStyle                  HTHTSeSt
  2007.   #define HText_appendCharacter           HTHTApCh
  2008. + #define HText_appendImage               HTHTApIm
  2009.   #define HText_appendText                HTHTApTe
  2010.   #define HText_appendParagraph           HTHTApPa
  2011.   #define HText_beginAnchor               HTHTBeAn
  2012. ***************
  2013. *** 55,139 ****
  2014.   extern HText * HTMainText;              /* Pointer to current main text */
  2015.   extern HTParentAnchor * HTMainAnchor;   /* Pointer to current text's anchor */
  2016.   
  2017. ! /*                      Creation and deletion
  2018. ! **
  2019. ! **      Create hypertext object                                 HText_new
  2020. ! */
  2021.    extern HText * HText_new PARAMS((HTParentAnchor * anchor));
  2022.    extern HText * HText_new2 PARAMS((HTParentAnchor * anchor,
  2023.                                   HTStream * output_stream));
  2024.   
  2025. ! /*      Free hypertext object                                   HText_free
  2026. ! */
  2027.   extern void     HText_free PARAMS((HText * me));
  2028.   
  2029.   
  2030. ! /*                      Object Building methods
  2031. ! **                      -----------------------
  2032. ! **
  2033. ! **      These are used by a parser to build the text in an object
  2034. ! **      HText_beginAppend must be called, then any combination of other
  2035. ! **      append calls, then HText_endAppend. This allows optimised
  2036. ! **      handling using buffers and caches which are flushed at the end.
  2037. ! */
  2038.   extern void HText_beginAppend PARAMS((HText * text));
  2039.   
  2040.   extern void HText_endAppend PARAMS((HText * text));
  2041.   
  2042. ! /*      Set the style for future text
  2043. ! */
  2044.   extern void HText_setStyle PARAMS((HText * text, HTStyle * style));
  2045.   
  2046. ! /*      Add one character
  2047. ! */
  2048.   extern void HText_appendCharacter PARAMS((HText * text, char ch));
  2049.   
  2050. ! /*      Add a zero-terminated string
  2051. ! */
  2052.   extern void HText_appendText PARAMS((HText * text, CONST char * str));
  2053.   
  2054. ! /*      New Paragraph
  2055. ! */
  2056.   extern void HText_appendParagraph PARAMS((HText * text));
  2057.   
  2058. ! /*      Start/end sensitive text
  2059. ! **
  2060. ! ** The anchor object is created and passed to HText_beginAnchor.
  2061. ! ** The senstive text is added to the text object, and then HText_endAnchor
  2062. ! ** is called. Anchors may not be nested.
  2063. ! */
  2064.   
  2065.   extern void HText_beginAnchor PARAMS((HText * text, HTChildAnchor * anc));
  2066.   extern void HText_endAnchor PARAMS((HText * text));
  2067.   
  2068.   
  2069. ! /*      Dump diagnostics to stderr
  2070. ! */
  2071.   extern void HText_dump PARAMS((HText * me));
  2072.   
  2073. ! /*      Return the anchor associated with this node
  2074. ! */
  2075.   extern HTParentAnchor * HText_nodeAnchor PARAMS((HText * me));
  2076.   
  2077.   
  2078. ! /*              Browsing functions
  2079. ! **              ------------------
  2080. ! */
  2081.   
  2082. ! /*      Bring to front and highlight it
  2083. ! */
  2084.   
  2085.   extern BOOL HText_select PARAMS((HText * text));
  2086.   extern BOOL HText_selectAnchor PARAMS((HText * text, HTChildAnchor* anchor));
  2087.   
  2088. ! /*              Editing functions
  2089. ! **              -----------------
  2090. ! **
  2091. ! **      These are called from the application. There are many more functions
  2092. ! **      not included here from the orginal text object. These functions
  2093. ! **      NEED NOT BE IMPLEMENTED in a browser which cannot edit.
  2094. ! */
  2095.   
  2096.   /*      Style handling:
  2097.   */
  2098.   /*      Apply this style to the selection
  2099. --- 59,221 ----
  2100.   extern HText * HTMainText;              /* Pointer to current main text */
  2101.   extern HTParentAnchor * HTMainAnchor;   /* Pointer to current text's anchor */
  2102.   
  2103. ! /*
  2104. ! Creation and deletion
  2105. !   HTEXT_NEW: CREATE HYPERTEXT OBJECT
  2106. !   
  2107. !    There are several methods depending on how much you want to specify. The output stream
  2108. !    is used with objects which need to output the hypertext to a stream.  The structure is
  2109. !    for objects which need to refer to the structure which is kep by the creating stream.
  2110. !    
  2111. !  */
  2112.    extern HText * HText_new PARAMS((HTParentAnchor * anchor));
  2113.    extern HText * HText_new2 PARAMS((HTParentAnchor * anchor,
  2114.                                   HTStream * output_stream));
  2115.   
  2116. !  extern HText * HText_new3 PARAMS((HTParentAnchor * anchor,
  2117. !                                 HTStream * output_stream,
  2118. !                                 HTStructured * structure));
  2119. ! /*
  2120. !   FREE HYPERTEXT OBJECT
  2121. !   
  2122. !  */
  2123.   extern void     HText_free PARAMS((HText * me));
  2124.   
  2125.   
  2126. ! /*
  2127. ! Object Building methods
  2128. !    These are used by a parser to build the text in an object HText_beginAppend must be
  2129. !    called, then any combination of other append calls, then HText_endAppend. This allows
  2130. !    optimised handling using buffers and caches which are flushed at the end.
  2131. !    
  2132. !  */
  2133.   extern void HText_beginAppend PARAMS((HText * text));
  2134.   
  2135.   extern void HText_endAppend PARAMS((HText * text));
  2136.   
  2137. ! /*
  2138. !   SET THE STYLE FOR FUTURE TEXT
  2139. !   
  2140. !  */
  2141.   extern void HText_setStyle PARAMS((HText * text, HTStyle * style));
  2142.   
  2143. ! /*
  2144. !   ADD ONE CHARACTER
  2145. !   
  2146. !  */
  2147.   extern void HText_appendCharacter PARAMS((HText * text, char ch));
  2148.   
  2149. ! /*
  2150. !   ADD A ZERO-TERMINATED STRING
  2151. !   
  2152. !  */
  2153.   extern void HText_appendText PARAMS((HText * text, CONST char * str));
  2154.   
  2155. ! /*
  2156. !   NEW PARAGRAPH
  2157. !   
  2158. !    and similar things
  2159. !    
  2160. !  */
  2161.   extern void HText_appendParagraph PARAMS((HText * text));
  2162.   
  2163. ! extern void HText_appendLineBreak PARAMS((HText * text));
  2164.   
  2165. + extern void HText_appendHorizontalRule PARAMS((HText * text));
  2166. + /*
  2167. +   START/END SENSITIVE TEXT
  2168. +   
  2169. +  */
  2170. + /*
  2171. +    The anchor object is created and passed to HText_beginAnchor. The senstive text is
  2172. +    added to the text object, and then HText_endAnchor is called. Anchors may not be
  2173. +    nested.
  2174. +    
  2175. +  */
  2176.   extern void HText_beginAnchor PARAMS((HText * text, HTChildAnchor * anc));
  2177.   extern void HText_endAnchor PARAMS((HText * text));
  2178.   
  2179.   
  2180. ! /*
  2181. !   APPEND AN INLINE IMAGE
  2182. !   
  2183. !    The image is handled by the creation of an anchor whose destination is the image
  2184. !    document to be included. The semantics is the intended inline display of the image.
  2185. !    
  2186. !    An alternative implementation could be, for example, to begin an anchor, append the
  2187. !    alternative text or "IMAGE", then end the anchor. This would simply generate some text
  2188. !    linked to the image itself as a separate document.
  2189. !    
  2190. !  */
  2191. ! extern void HText_appendImage PARAMS((
  2192. !         HText *         text,
  2193. !         HTChildAnchor * anc,
  2194. !         CONST char *    alternative_text,
  2195. !         int             alignment,
  2196. !         BOOL            isMap));
  2197. ! /*
  2198. !   DUMP DIAGNOSTICS TO STDERR
  2199. !   
  2200. !  */
  2201.   extern void HText_dump PARAMS((HText * me));
  2202.   
  2203. ! /*
  2204. !   RETURN THE ANCHOR ASSOCIATED WITH THIS NODE
  2205. !   
  2206. !  */
  2207.   extern HTParentAnchor * HText_nodeAnchor PARAMS((HText * me));
  2208.   
  2209.   
  2210. ! /*
  2211.   
  2212. ! Browsing functions
  2213.   
  2214. +  */
  2215. + /*
  2216. +   BRING TO FRONT AND HIGHLIGHT IT
  2217. +   
  2218. +  */
  2219.   extern BOOL HText_select PARAMS((HText * text));
  2220.   extern BOOL HText_selectAnchor PARAMS((HText * text, HTChildAnchor* anchor));
  2221.   
  2222. ! /*
  2223.   
  2224. + Editing functions
  2225. +    These are called from the application. There are many more functions not included here
  2226. +    from the orginal text object. These functions NEED NOT BE IMPLEMENTED in a browser
  2227. +    which cannot edit.
  2228. +    
  2229. +  */
  2230.   /*      Style handling:
  2231.   */
  2232.   /*      Apply this style to the selection
  2233. ***************
  2234. *** 177,180 ****
  2235.   #endif /* HTEXT_H */
  2236.   /*
  2237.   
  2238. !    end  */
  2239. --- 259,262 ----
  2240.   #endif /* HTEXT_H */
  2241.   /*
  2242.   
  2243. !    end */
  2244. *** ../../../../2.12a/WWW/Library/Implementation/SGML.c    Thu Sep  2 19:03:14 1993
  2245. --- SGML.c    Thu Nov  4 15:43:09 1993
  2246. ***************
  2247. *** 265,271 ****
  2248.   **        NULL        tag not found
  2249.   **        else        address of tag structure in dtd
  2250.   */
  2251. ! PRIVATE HTTag * find_tag ARGS2(CONST SGML_dtd*, dtd, char *, string)
  2252.   {
  2253.       int high, low, i, diff;
  2254.       for(low=0, high=dtd->number_of_tags;
  2255. --- 265,271 ----
  2256.   **        NULL        tag not found
  2257.   **        else        address of tag structure in dtd
  2258.   */
  2259. ! PUBLIC HTTag * SGMLFindTag ARGS2(CONST SGML_dtd*, dtd, CONST char *, string)
  2260.   {
  2261.       int high, low, i, diff;
  2262.       for(low=0, high=dtd->number_of_tags;
  2263. ***************
  2264. *** 424,430 ****
  2265.           }
  2266.           HTChunkTerminate(string) ;
  2267.   
  2268. !         t = find_tag(dtd, string->data);
  2269.           if (!t) {
  2270.           if(TRACE) fprintf(stderr, "SGML: *** Unknown element %s\n",
  2271.               string->data);
  2272. --- 424,430 ----
  2273.           }
  2274.           HTChunkTerminate(string) ;
  2275.   
  2276. !         t = SGMLFindTag(dtd, string->data);
  2277.           if (!t) {
  2278.           if(TRACE) fprintf(stderr, "SGML: *** Unknown element %s\n",
  2279.               string->data);
  2280. ***************
  2281. *** 563,569 ****
  2282.           if (!*string->data)    {    /* Empty end tag */
  2283.               t = context->element_stack->tag;
  2284.           } else {
  2285. !         t = find_tag(dtd, string->data);
  2286.           }
  2287.           if (!t) {
  2288.           if(TRACE) fprintf(stderr,
  2289. --- 563,569 ----
  2290.           if (!*string->data)    {    /* Empty end tag */
  2291.               t = context->element_stack->tag;
  2292.           } else {
  2293. !         t = SGMLFindTag(dtd, string->data);
  2294.           }
  2295.           if (!t) {
  2296.           if(TRACE) fprintf(stderr,
  2297. *** ../../../../2.12a/WWW/Library/Implementation/SGML.h    Fri Sep  3 15:24:43 1993
  2298. --- SGML.h    Thu Nov  4 15:51:31 1993
  2299. ***************
  2300. *** 90,119 ****
  2301.   
  2302.   /*__________________________________________________________________________
  2303.   */
  2304. - /*              Structured Object definition
  2305. - **
  2306. - **      A structured object is something which can reasonably be
  2307. - **      represented in SGML.  I'll rephrase that.  A structured
  2308. - **      object is am ordered tree-structured arrangement of data
  2309. - **      which is representable as text.
  2310. - **
  2311. - **      The SGML parer outputs to a Structured object.
  2312. - **      A Structured object can output its contents
  2313. - **      to another Structured Object.
  2314. - **      It's a kind of typed stream.  The architecure
  2315. - **      is largely Dan Conolly's.
  2316. - **      Elements and entities are passed to the sob by number, implying
  2317. - **      a knowledge of the DTD.
  2318. - **      Knowledge of the SGML syntax is not here, though.
  2319. - **
  2320. - **      Superclass: HTStream
  2321. - */
  2322.   
  2323.   
  2324. ! /*      The creation methods will vary on the type of Structured Object.
  2325. ! **      Maybe the callerData is enough info to pass along.
  2326. ! */
  2327.   
  2328.   typedef struct _HTStructured HTStructured;
  2329.   
  2330.   typedef struct _HTStructuredClass{
  2331. --- 90,114 ----
  2332.   
  2333.   /*__________________________________________________________________________
  2334.   */
  2335.   
  2336. + /*
  2337.   
  2338. ! Structured Object definition
  2339.   
  2340. +    A structured object is something which can reasonably be represented in SGML.  I'll
  2341. +    rephrase that.  A structured object is am ordered tree-structured arrangement of data
  2342. +    which is representable as text.The SGML parer outputs to a Structured object. A
  2343. +    Structured object can output its contents to another Structured Object. It's a kind of
  2344. +    typed stream. The architecure is largely Dan Conolly's. Elements and entities are
  2345. +    passed to the sob by number, implying a knowledge of the DTD. Knowledge of the SGML
  2346. +    syntax is not here, though.
  2347. +    
  2348. +    Superclass: HTStream
  2349. +    
  2350. +    The creation methods will vary on the type of Structured Object.Maybe the callerData is
  2351. +    enough info to pass along.
  2352. +    
  2353. +  */
  2354.   typedef struct _HTStructured HTStructured;
  2355.   
  2356.   typedef struct _HTStructuredClass{
  2357. ***************
  2358. *** 156,165 ****
  2359.                   
  2360.   }HTStructuredClass;
  2361.   
  2362.   
  2363.   
  2364. ! /*      Create an SGML parser
  2365. ! **
  2366.   ** On entry,
  2367.   **      dtd             must point to a DTD structure as defined above
  2368.   **      callbacks       must point to user routines.
  2369. --- 151,172 ----
  2370.                   
  2371.   }HTStructuredClass;
  2372.   
  2373. + /*
  2374.   
  2375. + Find a Tag by Name
  2376.   
  2377. !    Returns a pointer to the tag within the DTD.
  2378. !    
  2379. !  */
  2380. ! extern HTTag * SGMLFindTag PARAMS((CONST SGML_dtd* dtd, CONST char * string));
  2381. ! /*
  2382. ! Create an SGML parser
  2383. !  */
  2384. ! /*
  2385.   ** On entry,
  2386.   **      dtd             must point to a DTD structure as defined above
  2387.   **      callbacks       must point to user routines.
  2388. ***************
  2389. *** 177,182 ****
  2390. --- 184,194 ----
  2391.   
  2392.   
  2393.   #endif  /* SGML_H */
  2394.   
  2395.   
  2396.   
  2397. *** ../../../../2.12a/WWW/Library/Implementation/Version.make    Wed Oct 13 16:53:45 1993
  2398. --- Version.make    Wed Nov  3 16:20:38 1993
  2399. ***************
  2400. *** 1 ****
  2401. ! VC = 2.12a
  2402. --- 1 ----
  2403. ! VC = 2.13
  2404. *** ../../../../2.12a/WWW/Library/Implementation/tcp.h    Wed Oct 13 16:57:39 1993
  2405. --- tcp.h    Thu Nov  4 10:07:14 1993
  2406. ***************
  2407. *** 2,8 ****
  2408.                                      SYSTEM DEPENDENCIES
  2409.                                                
  2410.      System-system differences for TCP include files and macros. This file includes for each
  2411. !    system the files necessary for network and file I/O.
  2412.      
  2413.     AUTHORS
  2414.     
  2415. --- 2,8 ----
  2416.                                      SYSTEM DEPENDENCIES
  2417.                                                
  2418.      System-system differences for TCP include files and macros. This file includes for each
  2419. !    system the files necessary for network and file I/O.  Part of libwww.
  2420.      
  2421.     AUTHORS
  2422.     
  2423. ***************
  2424. *** 542,548 ****
  2425.   
  2426.   /*
  2427.   
  2428. !   MACROS FOR CONVERTING CHARACTERS
  2429.     
  2430.    */
  2431.   #ifndef TOASCII
  2432. --- 542,548 ----
  2433.   
  2434.   /*
  2435.   
  2436. !   M ACROS FOR CONVERTING CHARACTERS
  2437.     
  2438.    */
  2439.   #ifndef TOASCII
  2440.