WWW/LineMode/Implementation/HTBrowse.c 664 32211 105 132347 5544315604 13254 /* HyperText Browser for Dumb Terminals HTBrowse.c ** ==================================== ** ** Authors: ** NP: Nicola Pellow Tech.Student CERN 1990-91 ** TBL: Tim Berners-Lee CERN (timbl@info.cern.ch) ** JFG: Jean-Francois Groff, Cooperant CERN 1991-92 (jfg@info.cern.ch) ** DR: Dudu Rashty +972-2-584848 ** MD: Mark Donszelmann, DELPHI CERN, (duns@vxdeop.cern.ch) ** ** Copyright CERN 1990-1992 See Copyright.html ** ** History: ** ** 4 Dec 90: Written from scratch (NP) ** 11 Feb 91: Code written by TBL so that the browser could be linked with ** code produced by Bernd Pollermann, enabling access to the ** data on CERNVM. This involved changing the code to handle file ** numbers rather than file pointers. ** 18 Mar 91: The feature of history mechanism was included, enabling a ** record of previous nodes visited to be kept. ** 6 Apr 91: When a node is accessed, it is immediately read into a ** buffer, in an unformatted state, as soon as the connection is ** made, so that the server is freed as quickly as possible. ** The program now also uses the additional modules HTBufferFile.c ** and HTBufferFile.h. ** 17 Apr 91: Can be used on machines running ANSI C and ordinary C. ** 10 May 91: Formatted text is stored in a linked list buffer which allows ** scrolling and better page breaks in the middle of text. ** Code incorporated by Tim BL, to enable anonymous FTP. ** 21 May 91: Accepts various parameters on the command line. ** 19 Aug 91: Currently available in Unix, VAX/VMS and MVS environments. ** 21 Nov 91: Character grid uses new architecture. (TBL) ** added -w option, new commands, print, ** ... See Features.html for further details ** 16 Jan 92: Put in VIOLA-compatible options - see \017 characters. ** \017 and \016 bracket user-selectable input. ** 27 Feb 92: New handling of user input, enhanced command syntax. (JFG) ** 18 May 92: PS command see ifdef SLAVE_PRINTER (DR/TBL) ** 6 Oct 92: Painful recovery from someone(?)'s attept to pretty print.(TBL) ** Please see coding style guide before changing indentation etc! ** Mar 93: Force on HTFile's HTDirAccess and HTDirReadme flags. ** 3 Nov 93: (MD) Changed vms into VMS ** (MD) Assigne output in main, not at initialize (VMS only) ** ** Compilation-time macro options ** ** REF_MARK Printf string to be used for printing anchor numbers ** END_MARK String to be used to denote the end of a document ** VL Version number, quoted eg "1.2a" */ #ifndef VL #define VL "unspecified" #endif /* If the guy gives the "MANUAL" command, jump to this: */ #ifndef MANUAL #define MANUAL "http://info.cern.ch/hypertext/WWW/LineMode/Defaults/QuickGuide.html" #endif #ifndef DEFAULT_LOCAL_LOGFILE #define DEFAULT_LOCAL_LOGFILE "WWW-log" /* Log file name for local execution */ #endif #ifndef DEFAULT_OUTPUT_FILE #define DEFAULT_OUTPUT_FILE "WWW-out" /* Output file name for non-interactive run */ #endif #ifndef DEFAULT_REF_HEAD #define DEFAULT_REF_HEAD "*** References from this document ***" #endif /* Check Statements */ /* ================ */ #define NAME_CHECK 0 /* Trace to show NAME anchors */ /* #define LONG_PROMPT 1 */ /* Long or short user prompt */ /* Include Files */ /* ============= */ #include #include "HTUtils.h" /* WWW general purpose macros */ #include "HTBrowse.h" /* Things exported, short names */ #include "GridText.h" /* Hypertext definition */ #include "HTFormat.h" #include "HTTCP.h" /* TCP/IP utilities */ #include "HTAnchor.h" /* Anchor class */ #include "HTParse.h" /* WWW address manipulation */ #include "HTAccess.h" /* WWW document access network code */ #include "HTHistory.h" /* Navigational aids */ #include "HTML.h" /* For parser */ #include "HTFWriter.h" /* For non-interactive output */ #include "HTFile.h" /* For Dir access flags */ #include "HTRules.h" /* For loading rule file */ #ifdef THINK_C /* Macintosh Think C development system */ #include #include extern int socketdebug; /* Must be declared in the socket library */ #endif extern HTStyleSheet * styleSheet; /* Define Statements */ /* ================= */ #ifndef REF_MARK /* May be redefined on command line */ #ifdef VIOLA #define REF_MARK "[\017%d\016]" /* Shift-in, shift-out around number */ #define PROMPT_MARK "\017%s\016" #else #define PROMPT_MARK "%s" #ifdef VM #define REF_MARK " <%d>" /* IBM terminals can't handle [] well */ #else #define REF_MARK "[%d]" #endif #endif #endif #ifndef END_MARK #ifdef VM #define END_MARK " " #else #define END_MARK " [End]" #endif #endif #ifndef EOF #define EOF (-1) /* End of file character defined as -1 */ #endif #ifdef NEWLIB #define SCREEN_WIDTH 78 #endif #ifndef SCREEN_WIDTH #define SCREEN_WIDTH 79 /* Default width of the screen */ #endif #ifndef MIN_SCREEN_WIDTH #define MIN_SCREEN_WIDTH 10 #endif #ifndef MAX_SCREEN_WIDTH #define MAX_SCREEN_WIDTH 150 #endif #ifndef SCREEN_HEIGHT #define SCREEN_HEIGHT 24 /* Default number of lines to the screen */ #endif #ifndef MIN_SCREEN_HEIGHT #define MIN_SCREEN_HEIGHT 5 #endif #ifndef MAX_SCREEN_HEIGHT #define MAX_SCREEN_HEIGHT 200 #endif #ifdef VM /* Needed to flush out the prompt line..*/ #ifndef NEWLIB /* except on NEWLIB which can wrap. */ #define NEWLINE_PROMPT /* before input */ #endif #endif #define INFINITY 1024 /*!! BUG*/ #define ADDRESS_LENGTH INFINITY /* Maximum address length of node */ #define TITLE_LENGTH INFINITY /* Maximum length of a title */ #define RESPONSE_LENGTH INFINITY /* Maximum length of users response */ #ifndef MAXPATHLEN #define NO_GETWD /* Assume no getwd() if no MAXPATHLEN */ #else extern char * getwd(); #endif #ifdef HAS_GETCWD /* May be defined on command line */ extern char * getcwd(); #endif #ifndef NO_GETPID /* May be defined from command line */ extern int getpid(); #endif /* Public Variables ** ================ */ PUBLIC char * HTAppName = "CERN-LineMode"; /* Application name */ PUBLIC char * HTAppVersion = VL; /* Application version */ PUBLIC int HTScreenWidth = SCREEN_WIDTH; /* By default */ PUBLIC int HTScreenHeight = -1; /* Undefined */ PUBLIC BOOL display_anchors = YES; /* anchor will be shown in text? */ PUBLIC char * log_file_name = 0; /* Root of log file name */ #ifdef OLD_CODE #ifdef VMS PUBLIC BOOL interactive = YES; /* e.g. shows prompts etc */ #else /* not VMS */ PRIVATE BOOL interactive = YES; /* e.g. shows prompts etc */ #endif /* not VMS */ #endif /* OLD_CODE */ PUBLIC char * start_reference = NULL; /* Format string for start anchor */ PUBLIC char * end_reference = REF_MARK; /* for end anchor */ PUBLIC char * reference_mark = "[%d] "; /* for reference lists */ PUBLIC char * end_mark = END_MARK; /* Format string for [End] */ /* Moved into other files: */ /* PUBLIC char * HTClientHost = 0; HTAccess */ /* PUBLIC int WWW_TraceFlag = 0; HTString */ /* PUBLIC FILE * logfile = 0; HTAccess */ /* Private variables ** ================= */ /* Arrays for storing the HyperText References */ PRIVATE HTParentAnchor * home_anchor = NULL; /* First document anchor */ PRIVATE char keywords[ADDRESS_LENGTH]; /* Search terms from command line */ PRIVATE char * output_file_name = NULL; /* -o xxxx */ PRIVATE char choice[RESPONSE_LENGTH]; /* Users response */ PRIVATE char * refhead = DEFAULT_REF_HEAD; /* Reference list heading */ PRIVATE char * logfile_root = 0; /* Log file name */ PRIVATE BOOL filter=0; /* Load from stdin? */ PRIVATE BOOL listrefs_option = 0; /* -listrefs option used? */ PRIVATE HTRequest * request; PRIVATE BOOL OutSource = NO; /* Output source, YES/NO */ #ifdef VMS PRIVATE FILE * output; /* assignment done in main */ #ifdef __DECC /* dummy declarations to make sure that LINKER will not complain */ PUBLIC char *HTBinDir; PUBLIC int HTDiag; PUBLIC char *HTPostScript; PUBLIC char *HTPutScript; PUBLIC char *HTSearchScript; #endif /* DECC */ #else /* not VMS */ PRIVATE FILE * output = stdout; #endif /* not VMS */ /* Forward Declaration of Functions */ /* ================================ */ PRIVATE void History_List NOPARAMS; PRIVATE BOOL Selection_Prompt NOPARAMS; PRIVATE void Error_Selection NOPARAMS; PRIVATE void help_screen NOPARAMS; PRIVATE void Reference_List PARAMS((BOOL titles)); PRIVATE void ErrMsg PARAMS((char *Msg, char *Str)); PRIVATE BOOL SaveOutputStream PARAMS((char *This, char *Next)); #ifdef ultrix #define GET_SCREEN_SIZE #endif #ifdef __osf__ #define GET_SCREEN_SIZE #endif #ifdef GET_SCREEN_SIZE #include /* * Get size of the output screen. Stolen from less. */ void scrsize(p_height, p_width) int *p_height; int *p_width; { register char *s; int ioctl(); struct winsize w; if (ioctl(2, TIOCGWINSZ, &w) == 0 && w.ws_row > 0) *p_height = w.ws_row; else if ((s = getenv("LINES")) != NULL) *p_height = atoi(s); else *p_height = SCREEN_HEIGHT; if (ioctl(2, TIOCGWINSZ, &w) == 0 && w.ws_col > 0) *p_width = w.ws_col; else if ((s = getenv("COLUMNS")) != NULL) *p_width = atoi(s); else *p_width = 80; } #endif /* GET_SCREEN_SIZE, BSN */ /* MAIN PROGRAM ** ------------ */ int main #ifdef __STDC__ (int argc, char * argv[]) #else (argc, argv) int argc; char * argv[]; #endif { int return_status = 0; int arg; /* Argument number as we scan */ BOOL argument_found = NO; BOOL logfile_flag = NO; BOOL interactive = YES; /* Default is interactive mode */ BOOL first_keyword = YES; char* default_default=0; /* Parse home relative to this */ HTFormat input_format = WWW_HTML; /* Used with filter */ #if defined(ultrix) || defined(__osf__) int scr_height, scr_width; #endif /* ultrix and OSF/1 */ #ifdef THINK_C /* command line from Think_C */ int i; argc=ccommand(&argv); #endif request = HTRequest_new(); /* request->conversions = HTList_new(); Done by HTRequest_new() Henrik 18/02-94 */ #ifdef VMS output = stdout; #endif /* VMS */ StrAllocCopy(default_default, "file://"); StrAllocCat(default_default, HTHostName()); /* eg file://cernvax.cern.ch */ #ifdef GET_SCREEN_SIZE scrsize(&scr_height, &scr_width); HTScreenHeight = scr_height; #endif /* ultrix or OSF/1, BSN */ #ifndef MAXPATHLEN #define NO_GETWD /* Assume no getwd() if no MAXPATHLEN */ #endif #ifdef NO_GETWD /* No getwd() on this machine */ #ifdef HAS_GETCWD /* System V variant SIGN CHANGED TBL 921006 !! */ { char wd[1024]; /*!! Arbitrary*/ char * result = getcwd(wd, sizeof(wd)); if (result) { #ifdef VMS /* convert directory name to Unix-style syntax */ char * disk = strchr (wd, ':'); char * dir = strchr (wd, '['); if (disk) { *disk = '\0'; StrAllocCat (default_default, "/"); /* needs delimiter */ StrAllocCat (default_default, wd); } if (dir) { char *p; *dir = '/'; /* Convert leading '[' */ for (p = dir ; *p != ']'; ++p) if (*p == '.') *p = '/'; *p = '\0'; /* Cut on final ']' */ StrAllocCat (default_default, dir); } #else /* not VMS */ StrAllocCat (default_default, wd); #endif /* not VMS */ } else { ErrMsg("Can't read working directory (getcwd)", NULL); } } /* end if good getcwd result */ #else /* has NO getcwd */ ErrMsg("This platform does not support getwd() or getcwd()", NULL); #endif /* has no getcwd */ #else /* has getwd */ { char wd[MAXPATHLEN]; char * result = getwd(wd); if (result) { StrAllocCat(default_default, wd); } else { ErrMsg("Can't read working directory.", NULL); } } #endif #ifdef VMS StrAllocCat(default_default, "default.html"); #else StrAllocCat(default_default, "/default.html"); #endif /* Check for command line options ** ------------------------------ */ keywords[0] = 0; /* Clear string */ for (arg=1; arg filter */ if (argv[arg][1] == 0) { filter = YES; interactive = NO; /* From stdin, Force non-interactive */ /* from -- Initial represntation (only with filter) */ } else if (!strcmp(argv[arg], "-from")) { input_format = (arg+1 >= argc || *argv[arg+1] == '-') ? WWW_HTML : HTAtom_for(argv[++arg]); #ifdef TRACE /* Verify: Turns on trace */ } else if (!strcmp(argv[arg], "-v")) { WWW_TraceFlag = 1; #endif /* Page size */ } else if (!strncmp(argv[arg], "-p", 2)) { if (arg+1 < argc && *argv[arg+1] != '-') { if (sscanf(argv[++arg], "%d", &HTScreenHeight) < 1) HTScreenHeight = -1; else { if(HTScreenHeight < MIN_SCREEN_HEIGHT) HTScreenHeight = MIN_SCREEN_HEIGHT; if(HTScreenHeight > MAX_SCREEN_HEIGHT) HTScreenHeight = MAX_SCREEN_HEIGHT; } } else { if (sscanf(argv[arg]+2, "%d", &HTScreenHeight) < 1) HTScreenHeight = -1; else { if(HTScreenHeight < MIN_SCREEN_HEIGHT) HTScreenHeight = MIN_SCREEN_HEIGHT; if(HTScreenHeight > MAX_SCREEN_HEIGHT) HTScreenHeight = MAX_SCREEN_HEIGHT; } } /* Page width */ } else if (!strncmp(argv[arg], "-w", 2)) { if (arg+1 < argc && *argv[arg+1] != '-') { if (sscanf(argv[++arg], "%d", &HTScreenWidth) < 1) HTScreenWidth = SCREEN_WIDTH; } else { if (sscanf(argv[arg]+2, "%d", &HTScreenWidth) < 1) HTScreenWidth = SCREEN_WIDTH; } if(HTScreenWidth < MIN_SCREEN_WIDTH) HTScreenWidth = MIN_SCREEN_WIDTH; if(HTScreenWidth > MAX_SCREEN_WIDTH) HTScreenWidth = MAX_SCREEN_WIDTH; /* to -- Final represntation */ } else if (!strcmp(argv[arg], "-to")) { request->output_format = (arg+1 >= argc || *argv[arg+1] == '-') ? WWW_PRESENT : HTAtom_for(argv[++arg]); HTOutputSource = YES; /* Turn on shortcut */ interactive = NO; /* JFG */ /* Telnet from */ } else if (!strcmp(argv[arg], "-h")) { if (arg+1 < argc && *argv[arg+1] != '-') { HTClientHost = argv[++arg]; /* Use host name */ } /* Log file */ } else if (!strcmp(argv[arg], "-l")) { if (arg+1 < argc && *argv[arg+1] != '-') logfile_root = argv[++arg]; logfile_flag = YES; /* List References */ } else if (!strcmp(argv[arg], "-listrefs")) { listrefs_option = YES; interactive = NO; /* non-interactive */ /* Non-interactive */ } else if (!strcmp(argv[arg], "-n")) { interactive = NO; /* Output filename */ } else if (!strcmp(argv[arg], "-o")) { output_file_name = (arg+1 < argc && *argv[arg+1] != '-') ? argv[++arg] : DEFAULT_OUTPUT_FILE; interactive = NO; /* Anchor format */ } else if (!strcmp(argv[arg], "-a")) { if (arg+1 < argc && *argv[arg+1] != '-') end_reference = argv[++arg]; /* New representation */ /* Anchor format */ } else if (!strcmp(argv[arg], "-ar")) { if (arg+1 < argc && *argv[arg+1] != '-') reference_mark = argv[++arg]; /* Change representation */ /* Anchor format */ } else if (!strcmp(argv[arg], "-as")) { if (arg+1 < argc && *argv[arg+1] != '-') start_reference = argv[++arg]; /* Change representation */ /* No anchors */ } else if (!strcmp(argv[arg], "-na")) { display_anchors = NO; #ifndef NO_RULES } else if (!strcmp(argv[arg], "-r")) { if (arg+1 < argc && *argv[arg+1] != '-') { if (HTLoadRules(argv[++arg]) < 0) { ErrMsg("Can't open rule file", argv[arg]); return_status = -1; goto endproc; } } #endif #ifndef NO_DIR_OPTIONS } else if (!strncmp(argv[arg], "-d", 2)) { char *p = argv[arg]+2; for(;*p;p++) { switch (argv[arg][2]) { case 'b': HTDirReadme = HT_DIR_README_BOTTOM; break; case 'n': HTDirAccess = HT_DIR_FORBID; break; case 'r': HTDirReadme = HT_DIR_README_NONE; break; case 's': HTDirAccess = HT_DIR_SELECTIVE; break; case 't': HTDirReadme = HT_DIR_README_TOP; break; case 'y': HTDirAccess = HT_DIR_OK; break; default: ErrMsg("HTDaemon: bad -d option", argv[arg]); return_status = -4; goto endproc; } } /* loop over characters */ #endif /* Reference list heading */ } else if (!strcmp(argv[arg], "-refhead")) { if (arg+1 < argc && *argv[arg+1] != '-') refhead = argv[++arg]; /* Print version and exit */ } else if (!strcmp(argv[arg], "-version")) { printf("WWW LineMode Browser version %s (WWW Library %s)\n", VL, HTLibraryVersion); goto endproc; /* Source please */ } else if (!strcmp(argv[arg], "-source")) { request->output_format = WWW_SOURCE; HTOutputSource = YES; /* Turn on shortcut */ interactive = NO; /* JFG */ #ifdef THINK_C /* Echo to file */ } else if (!strcmp(argv[arg], "-e")){ struct tm *tm_now; time_t time_now; cecho2file("ThinkCconsole",FALSE,stdout); time_now=time(NULL);tm_now=localtime(&time_now); printf("\n--------------------------------------------" "\n Time: %d.%.2d.%.2d %d:%d:%d\n" "--------------------------------------------\n", (*tm_now).tm_year, (*tm_now).tm_mon+1, (*tm_now).tm_mday, (*tm_now).tm_hour, (*tm_now).tm_min, (*tm_now).tm_sec); /* debug socket library */ } else if (!strcmp(argv[arg], "-s")) { socketdebug=1; #endif /* endif long list of argument options */ } else { ErrMsg("Bad Command Line Argument", argv[arg]); } } else { /* it doesn't start with a dash */ /* Check for main argument ** ----------------------- */ if (!argument_found) { char * ref = HTParse(argv[arg], default_default, PARSE_ALL); home_anchor = (HTParentAnchor*)HTAnchor_findAddress(ref); free(ref); argument_found = YES; /* Check for successive keyword arguments ** ------------------------------------- */ } else { /* Argument already found */ /* Collect keywords */ if (first_keyword){ first_keyword = NO; } else { strcat(keywords, " "); } strcat(keywords,HTStrip(argv[arg])); } /* argument already found */ } /* Not an option '-'*/ } /* End of argument loop */ if (HTClientHost) HTSecure = YES; if (HTScreenHeight == -1) /* Default page size */ HTScreenHeight = interactive ? SCREEN_HEIGHT : 999999; #ifndef NO_RULES { char * rules = getenv("WWW_CONFIG"); if (rules && HTLoadRules(rules) < 0) { ErrMsg("Cant't open rule file", rules); } } #endif /* Force predefined presentations etc to be set up. Now it is taking care of non-interactive, where no HTSaveLocally() of call backs are used */ if (interactive) HTFormatInit(request->conversions); else HTFormatInitNIM(request->conversions); /* Open output file ** ---------------- */ if (!interactive) { /* check for file name @@@@@ */ if (output_file_name) { FILE * fp = fopen(output_file_name, "w"); if (!fp) { ErrMsg("Can't open file for writing", output_file_name); return_status = -3; goto endproc; } output = fp; } request->output_stream = HTFWriter_new(output, output == stdout ? YES : NO); /* Just pump to stdout but YES: leave it open */ } /* Open Log File. Logfile via Telnet is now optional (HENRIK 11/02-94) ** -------------------------- */ /* OLD VERSION if (!logfile_root && HTClientHost) { logfile_root = DEFAULT_LOGFILE; } */ if (logfile_flag) { if(!logfile_root) logfile_root = HTClientHost ? DEFAULT_LOGFILE : DEFAULT_LOCAL_LOGFILE; log_file_name = (char*) malloc(strlen(logfile_root)+20); #ifdef NO_GETPID sprintf(log_file_name, "%s", logfile_root); /* No getpid() */ #else sprintf(log_file_name, "%s-%d", logfile_root, getpid()); #endif logfile = fopen(log_file_name, "a"); if (!logfile) ErrMsg("Can't open log file", log_file_name); }; /* Enable local directory access */ HTDirReadme = HT_DIR_README_TOP; /* Readme presentation */ HTDirAccess = HTClientHost ? HT_DIR_SELECTIVE : HT_DIR_OK; /* browsing */ /* Make home page address ** ---------------------- */ if (!home_anchor) home_anchor = HTHomeAnchor (); /* Non-interactive use ** ------------------- */ if (filter) { /* Just convert formats */ HTBindAnchor((HTAnchor*)home_anchor, request); HTParseSocket(input_format, 0, request); /* From std UNIX input */ goto endproc; } /* Load first document ** ------------------- */ if ( *keywords ? HTSearch(keywords, home_anchor, request) : HTLoadAnchor((HTAnchor*) home_anchor, request)) { HTHistory_record((HTAnchor *)home_anchor); } else { /* Can't even get last resort: give up */ char *addr = HTAnchor_address((HTAnchor *)home_anchor); ErrMsg("Can't access document", addr); free(addr); if (!HTMainText) { return_status = -2; /* Can't get first page */ goto endproc; } } if (!HTMainText) goto endproc; /* Hypertext object was not created */ /* Main "Event Loop" ** ---------------- */ if (interactive) { while (Selection_Prompt()); } else if (!HTOutputSource) { /* Non-interactive but formatted */ #ifdef OLD_CODE fprintf(output, "\f"); /* Form feed for new page */ while(HText_canScrollDown(HTMainText)) { HText_scrollDown(HTMainText); fprintf(output, "\f"); /* Form feed for new page */ } #endif if (listrefs_option) { Reference_List(NO); /* List without titles */ } } endproc: HTRequest_delete(request); if(default_default) free(default_default); if(!return_status) { /* Good! */ #ifdef VMS return 1; #else return 0; /* Good */ #endif } return return_status; /* Bad! */ } /* main() */ /* Error_Selection ** --------------- ** Produce an error message. ** */ #ifdef __STDC__ PRIVATE void Error_Selection(void) #else PRIVATE void Error_Selection() #endif { fprintf(stderr, "%s", "Bad command, for list of commands type help.\n"); return; } /* Display Help screen Help_screen ** ------------------- ** ** Produce a help screen, displaying the current document address and a list of ** available commands *in this context*. ** ?? Perhaps this should be a hypertext page, not included in the history list. */ PRIVATE void help_screen NOARGS { char * current_address = HTAnchor_address((HTAnchor*)HTMainAnchor); CONST char * title = HTAnchor_title(HTMainAnchor); printf("\n\nWWW LineMode Browser version %s (WWWLib %s) COMMANDS AVAILABLE\n\n", VL, HTLibraryVersion); if (title) printf("You are reading\n \"%s\"\nwhose address is\n %s\n\n", title, current_address); else printf("You are reading a document whose address is\n '%s' \n\n", current_address); if (HText_canScrollDown(HTMainText)) { printf( " Move down one page within the document.\n"); printf( " BOttom Go to the last page of the document.\n"); }; if (HText_canScrollUp(HTMainText)) { printf( " Top Return to the first page of the document.\n"); printf( " Up Move up one page within the document\n"); }; if (HText_sourceAnchors(HTMainText) != 0) { printf(" List List the references from this document.\n *"); printf(" Select a referenced document by number (from 1 to %d).\n", HText_sourceAnchors(HTMainText)); } if (HTAnchor_isIndex(HTMainAnchor)) { printf( " Find Search this index for given words (separated by spaces).\n"); } if (HTHistory_canBacktrack()) { printf(" Recall List visited documents.\n"); printf(" Recall Return to a previously visited document\n"); printf(" as numbered in the recall list.\n"); printf(" HOme Return to the starting document.\n"); printf(" Back Move back to the last document.\n"); } if (HTHistory_canMoveBy(1)) printf(" Next Take next link from last document.\n"); if (HTHistory_canMoveBy(-1)) printf(" Previous Take previous link from last document.\n"); printf(" REFresh Refresh screen with current document\n"); printf(" Go
Go to document of given [relative] address\n"); #ifdef GOT_SYSTEM if (!HTClientHost) { /* NOT for telnet guest! */ printf(" PRInt Print text of this document. *\n"); printf(" ! Execute shell without leaving.\n"); printf(" > Save the text of this document in . *\n"); printf(" If exists use '>!' to overwrite it.\n"); printf(" >> Append the text of this document to . *\n"); printf(" | Pipe this document to the shell . *\n"); #ifdef unix printf(" CD Change local working directory.\n"); #endif printf("* Prefix these commands with \"Source \" to use raw source.\n\n"); } #endif #ifdef SLAVE_PRINTER printf( " Ps Print text of this document to Terminal's Slave printer.\n"); #endif printf(" Verbose Switch to %sverbose mode.\n", WWW_TraceFlag ? "non-" : ""); printf(" Help Display this page.\n"); printf(" Manual Jump to the online manual for this program\n"); printf(" Quit Leave the www program.\n"); printf("\n"); free(current_address); } /* End of help_screen */ /* Select_Reference ** ---------------- ** ** After a reference is selected by the user, opens document, links into the ** history list and displays. ** ** On Entry: ** int reference_num Number corresponding to the hypertext reference ** given in the text. */ BOOL Select_Reference ARGS1(int,reference_num) { HTAnchor * destination; HTChildAnchor * source = HText_childNumber(HTMainText, reference_num); if (!source) return NO; /* No anchor */ destination = HTAnchor_followMainLink((HTAnchor*) source); if (!HTLoadAnchor(destination, request)) return NO; /* No link */ HTHistory_leavingFrom((HTAnchor*) source); HTHistory_record(destination); return YES; } /* Select_Reference*/ /* Reference_List ** -------------- ** Print out a list of HyperText References accumulated within the text. ** ** On entry ** titles Set: if we want titles where available ** Clear: we only get addresses. */ PRIVATE void Reference_List ARGS1(BOOL, titles) { int n; if (HText_sourceAnchors(HTMainText) == 0) { fprintf(output, "\n\n There are no references from this document.\n\n"); } else { fprintf(output, "\n%s\n", refhead); for (n=1; n<=HText_sourceAnchors(HTMainText); n++) { HTAnchor * destination = HTAnchor_followMainLink( (HTAnchor *)HText_childNumber(HTMainText, n) ); HTParentAnchor * parent = HTAnchor_parent(destination); char * address = HTAnchor_address(destination); CONST char * title = titles ? HTAnchor_title(parent) : 0 ; fprintf(output, reference_mark, n); fprintf(output, "%s%s\n", ((HTAnchor*)parent!=destination) && title ? "in " : "", (char *)(title ? title : address)); free(address); } fprintf(output, "\n"); } } /* History_List ** ------------ */ /* Display a history list of nodes visited during the session. ** ?? This should really be a hypertext page (not itself in history!). ** ?? Should have option to display address even when anchor has a title. */ PRIVATE void History_List NOARGS { int history_number = 1; printf("\n Documents you have visited:-\n\n"); do { char * address; CONST char * title; HTAnchor * anchor = HTHistory_read(history_number); HTParentAnchor * parent; if (!anchor) break; parent = HTAnchor_parent(anchor); title = HTAnchor_title(parent); address = HTAnchor_address(anchor); #ifdef VIOLA printf("\017R %2d\016) %s%s\n", /* SI user field SO */ #else printf("R %2d) %s%s\n", #endif history_number, ((HTAnchor*)parent!=anchor) && title ? "in " : "", title ? title : address); free(address); history_number++; } while (YES); printf("\n"); } /* ** Check_User_Input ** ---------------- ** ** Accepts shortened versions of commands. ** ** On Entry: ** char *s Correct and full version of command, to which the user's ** input is compared. ** ** On Exit: ** returns YES User's input corresponds to the command. ** NO Not a recognized command. */ #define Check_User_Input(command) \ (!strncasecomp (command, this_word, strlen(this_word))) /* USER INTERFACE ** ============== */ /* Selection_Prompt ** ---------------- ** Produces a prompt at the bottom of a page full of text. The prompt varies ** depending on the options avaliable. */ #ifdef __STDC__ PRIVATE BOOL Selection_Prompt(void) #else PRIVATE BOOL Selection_Prompt() #endif { int length_of_prompt = 0; BOOL is_index = HTAnchor_isIndex(HTMainAnchor); if (!HText_canScrollDown(HTMainText) && !HTAnchor_hasChildren(HTMainAnchor) && !is_index && (!HTHistory_canBacktrack())) { ErrMsg("No way out of here, so I exit!", NULL); return NO; /* Exit if no other options */ } HText_setStale(HTMainText); /* We corrupt the display */ #ifndef VM /* Normal prompt */ if (is_index){ printf("FIND , "); length_of_prompt = length_of_prompt + 14; } if (HTAnchor_hasChildren(HTMainAnchor)!=0){ int refs = HText_sourceAnchors(HTMainText); if (refs>1) { printf("1-%d, ", refs); length_of_prompt = length_of_prompt + 6; /* Roughly */ } else { printf("1, "); length_of_prompt = length_of_prompt + 3; } } if (HTHistory_canBacktrack()){ printf(PROMPT_MARK, "Back"); printf(", "); #ifdef LONG_PROMPT printf(PROMPT_MARK, "Recall"); printf(", "); #endif length_of_prompt = length_of_prompt + 6; } if (HText_canScrollUp(HTMainText)){ printf(PROMPT_MARK,"Up"); printf(", "); length_of_prompt = length_of_prompt + 4; } if (HText_canScrollDown(HTMainText)) { printf(" for more, "); length_of_prompt = length_of_prompt + 19; } if (length_of_prompt <= 47) { printf(PROMPT_MARK, "Quit"); printf(", "); } printf("or Help: "); #else /* Special prompt for VM assuming PF keys set*/ if (is_index) { printf("FIND , "); /* 14 */ length_of_prompt = length_of_prompt + 14; } if (HTAnchor_hasChildren(HTMainAnchor)!=0){ int refs = HText_sourceAnchors(HTMainText); if (refs>1) { printf("1-%d, ", refs); length_of_prompt = length_of_prompt + 6; /* approx 6 */ } else { printf("1, "); length_of_prompt = length_of_prompt + 3; } } if (HTHistory_canMoveBy(1)) { printf("PF2=Next "); length_of_prompt = length_of_prompt + 9; /* 9 */ } printf("PF3=Quit PF4=Return, "); length_of_prompt = length_of_prompt + 21; /* 21 */ if (HTHistory_canBacktrack()){ printf("Recall, "); length_of_prompt = length_of_prompt + 8; /* 8 */ } if (HText_canScrollUp(HTMainText)){ printf(PROMPT_MARK,"PF7=Up "); printf(", "); length_of_prompt = length_of_prompt + 7; /* 7 */ } if (HText_canScrollDown(HTMainText)){ printf("PF8=Down "); length_of_prompt = length_of_prompt + 9; /* 9 */ } if (length_of_prompt<70) printf("PF11=Help"); /* 9 */ /* EQUAL 82 */ #endif /* Read in the user's input, and deal with it as necessary. ** ** Any Command which works returns from the routine. If nothing ** works then a search or error message down at the bottom. */ { int reference_num; char * the_choice = 0; /* preserved user command */ char * this_word = 0; /* First word of command */ char * this_command; /* this_word and following */ char * next_word; /* Second word */ char * other_words; /* Second word and following */ #ifdef NEWLINE_PROMPT printf("\n"); /* For use on VM to flush out the prompt */ #endif if (!fgets(choice, RESPONSE_LENGTH, stdin)) /* Read User Input */ return NO; /* Exit if EOF */ StrAllocCopy (the_choice, choice); /* Remember it as is, */ if (the_choice[strlen(the_choice)-1] == '\n') /* The final \n */ the_choice[strlen(the_choice)-1] = '\0'; #ifdef VM /* Clear the screen (on screen-mode systems) */ clear_screen(); #endif this_word = strtok (choice, " \t\n\r"); /* Tokenize user input */ this_command = the_choice; if (this_word) { next_word = strtok (NULL, " \t\n\r"); other_words = the_choice + (next_word - choice); } else goto down; /* Empty input : scroll down */ /* Process Command ** --------------- */ /* Giant switch for incoming commands, many of which are single-letter. */ loop: switch (TOUPPER(*this_word)) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': sscanf(this_word,"%d",&reference_num); if ((reference_num >= 1) && (reference_num <= HText_sourceAnchors(HTMainText))) { Select_Reference(reference_num); /* Select a reference */ goto ret; } break; case 'B': if (Check_User_Input("BACK")) { /* Return to previous node */ if (HTHistory_canBacktrack()) { HTLoadAnchor(HTHistory_backtrack(), request); } else { printf("\n The BACK command cannot be used,"); printf(" as there are no previous documents\n"); } } else if (Check_User_Input("BOTTOM")) { /* Scroll to bottom */ HText_scrollBottom(HTMainText); } goto ret; break; #ifdef unix case 'C': if (Check_User_Input("CD")) /* Change working directory ? */ goto lcd; break; #endif case 'D': if (Check_User_Input("DOWN")) { /* Scroll down one page */ down: if (HText_canScrollDown(HTMainText)) HText_scrollDown(HTMainText); goto ret; } break; case 'E': /* Quit program ? Alternative command */ if (Check_User_Input("EXIT")) goto stop; break; case 'F': /* Keyword search ? */ if (is_index && Check_User_Input("FIND")) { find: if (next_word && HTSearch(other_words, HTMainAnchor, request)) HTHistory_record((HTAnchor*)HTMainAnchor); goto ret; } break; case 'G': if (Check_User_Input("GOTO")) { /* GOTO */ if (next_word && HTLoadRelative(next_word, HTMainAnchor, request)) HTHistory_record((HTAnchor*) HTMainAnchor); goto ret; } break; case '?': help_screen(); goto ret; case 'H': if (Check_User_Input("HELP")){ /* help menu, ..*/ help_screen(); /*!! or a keyword search ? */ goto ret; } else if (Check_User_Input("HOME")) { /* back HOME */ if (!HTHistory_canBacktrack()){ HText_scrollTop(HTMainText); } else { HTLoadAnchor(HTHistory_recall(1), request); /*!! this assumes history is kept.*/ } goto ret; } /* if HOME */ break; case 'K': /* Keyword search ? */ if (is_index && Check_User_Input("KEYWORDS")) { goto find; } break; case 'L': if (Check_User_Input("LIST")){ /* List of references ? */ Reference_List(!OutSource); goto ret; } #ifdef unix else if (Check_User_Input ("LCD")) { /* Local change dir ? */ extern int chdir(); lcd: if (!next_word) { /* Missing argument */ printf ("\nPlease specify the name of the new local directory.\n"); goto ret; } if (chdir (next_word)) { /* failed : say why */ fprintf (stderr, "\n "); perror (next_word); } else { /* Success : display new local directory */ /* AS Sep 93 */ #ifdef NO_GETWD /* No getwd() on this machine */ #ifdef HAS_GETCWD /* System V variant SIGN CHANGED TBL 921006 !! */ printf ("\nLocal directory is now:\n %s\n", getcwd (choice, sizeof(choice))); #else /* has NO getcwd */ ErrMsg("This platform does not support getwd() or getcwd()", NULL); #endif /* has no getcwd */ #else /* has getwd */ printf("\nLocal directory is now:\n %s\n", getwd (choice)); #endif /* has getwd */ /* End AS Sep 93 */ } goto ret; } #endif break; case 'M': if (Check_User_Input("MANUAL")){ /* Read User manual */ if (HTLoadRelative(MANUAL, HTMainAnchor, request)) HTHistory_record((HTAnchor*)HTMainAnchor); goto ret; } break; case 'N': if (Check_User_Input("NEXT")) { if (!HTHistory_canMoveBy(1)) { /* No nodes to jump back to */ printf("\n Can't take the NEXT link from the last"); if (!HTHistory_canBacktrack()) printf(" document as there is no last"); printf(" document.\n"); goto ret; } HTLoadAnchor(HTHistory_moveBy(1), request); goto ret; } break; case 'P': if (Check_User_Input("PREVIOUS")) { if (!HTHistory_canMoveBy(-1)){ printf("\n Can't take the PREVIOUS link from the last"); if (!HTHistory_canBacktrack()) printf(" document as there is no last"); printf(" document.\n"); goto ret; } HTLoadAnchor(HTHistory_moveBy(-1), request); goto ret; } #ifdef GOT_SYSTEM else if (!HTClientHost && Check_User_Input("PRINT")) { char * address = HTAnchor_address((HTAnchor*)HTMainAnchor); char * command; char * template = (char*)getenv("WWW_PRINT_COMMAND"); int result; if (!template) template = "www -n -na -p66 '%s' | lpr"; command = (char *) malloc(strlen(address)+strlen(template)+20); sprintf(command, template, address); result = system(command); free(address); free(command); if (result) printf(" %s\n returns %d\n", command, result); goto ret; } #endif /* this command prints the entire current text to the terminal's printer; at the end it displays the top of the text */ #ifdef SLAVE_PRINTER #define SLAVE_PRINTER_ON "\033\133\065\151" #define SLAVE_PRINTER_OFF "\033\133\064\151" if (Check_User_Input("PS")) { printf ("%s",SLAVE_PRINTER_ON); printf("\f"); /* Form feed for new page */ HText_scrollTop(HTMainText); while(HText_canScrollDown(HTMainText)) { HText_scrollDown(HTMainText); } printf("\f"); /* Form feed for new page */ printf ("%s",SLAVE_PRINTER_OFF); HText_scrollTop(HTMainText); goto ret; } #endif break; case 'Q': /* Quit program ? */ if (Check_User_Input("QUIT")) { #ifdef VM if (HTHistory_canBacktrack()){ /* Means one level only */ HTLoadAnchor(HTHistory_backtrack(), request); goto ret; } else { goto stop; /* On last level, exit */ } #endif /* JFG 9/7/92, following a complaint of 'q' mis-typed for '1'. JFG Then made optional because I hate it !!! TBL made it only affect remote logged on users. 921122 */ if (HTClientHost && (strcasecomp(this_word, "quit") != 0) ) { printf ("\n Please type \"quit\" in full to leave www.\n"); goto ret; } goto stop; } break; case 'R': #ifdef VM if (Check_User_Input("RETURN")) /* Means quit program */ goto stop; #endif if (Check_User_Input("RECALL")) { int recall_node_num; if (!HTHistory_canBacktrack()) { /* No nodes to recall */ printf("\n No other documents to recall.\n"); goto ret; } /* Previous node number exists, or does the user just */ /* require a list of nodes visited? */ if (next_word) { if ((recall_node_num = atoi(next_word)) > 0) /* Parm OK */ HTLoadAnchor(HTHistory_recall(recall_node_num), request); else Error_Selection(); } else History_List(); goto ret; } else if (Check_User_Input("REFRESH")){ HText_select(HTMainText); /* Refresh screen */ goto ret; } break; case 'S': /* TBL 921009 */ if (Check_User_Input("SOURCE")) { /* Apply to source */ if (!next_word) goto ret; /* Should refresh as source @@@ */ OutSource = YES; /* Load and print as source */ this_word = next_word; /* Move up one word */ next_word = strtok (NULL, " \t\n\r"); this_command = the_choice + (this_word - choice); other_words = the_choice + (next_word - choice); goto loop; /* Go treat as before */ } else if (Check_User_Input("SET")) { /* config */ HTSetConfiguration(other_words); goto ret; } break; case 'T': if (Check_User_Input("TOP")) { /* Return to top */ HText_scrollTop(HTMainText); goto ret; } break; case 'U': if (Check_User_Input("UP")) { /* Scroll up one page */ HText_scrollUp(HTMainText); goto ret; } break; case 'V': if (Check_User_Input("VERBOSE")) { /* Switch verbose mode */ WWW_TraceFlag = ! WWW_TraceFlag; printf ("\n Verbose mode %s.\n", WWW_TraceFlag ? "ON":"OFF"); goto ret; } break; case '>': if (!HTClientHost) { SaveOutputStream(this_word, next_word); goto ret; } break; #ifdef GOT_PIPE case '|': if (!HTClientHost) { /* Local only!!!! */ char * address = HTAnchor_address((HTAnchor*) HTMainAnchor); char * command; int result; command = (char*) malloc(strlen(address) +strlen(this_command)+30); #ifdef VM sprintf(command, "PIPE CMS WWW %s \"%s\" | %s", /* Note format is | > */ #else sprintf(command, "www %s \"%s\" %s", #endif OutSource ? "-source" : "-n -na -p", address, this_command); printf("Command: %s\n", command); result = system(command); if (result) printf(" %s returns %d\n", command, result); free(command); free(address); goto ret; } #endif #ifdef GOT_SYSTEM case '!': if (!HTClientHost) { /* Local only!!!!!!! */ int result; result = system(strchr(this_command, '!') + 1); if (result) printf(" %s returns %d\n", strchr(this_command, '!') + 1, result); goto ret; } #endif default: break; } /* Switch on 1st character */ if (is_index && *this_word) { /* No commands, search keywords */ next_word = other_words = this_command; goto find; } else { Error_Selection(); } ret: free (the_choice); return YES; stop: free(the_choice); return NO; } /* Get user selection */ } /* Selection_Prompt */ /* ------------------------------------------------------------------------- General Error Message for Line Mode Browser. If verbose mode is on, then the message is passed to stderr. Henrik Frystyk 02/03-94 ------------------------------------------------------------------------- */ PRIVATE void ErrMsg ARGS2(char *, Msg, char *, Str) { if (WWW_TraceFlag) { if (Str) fprintf(stderr, "Line Mode Browser Message: %s (%s)\n", Msg, Str); else fprintf(stderr, "Line Mode Browser Message: %s\n", Msg); } } /* ------------------------------------------------------------------------- This function puts up a stream to a file in order to save a document. This is activated by '>', '>>' or '>!' from the prompt line. Returns NO if Error and YES if OK Henrik Frystyk 02/03-94 ------------------------------------------------------------------------- */ PRIVATE BOOL SaveOutputStream ARGS2(char *, This, char *, Next) { FILE *fp; char *fname; char *fmode; /* Checks if file exists. Can be overruled by using '>!' */ if (*(This+1) == '>') { /* Append to file */ fmode = "a"; fname = *(This+2) ? (This+2) : Next; } else if (*(This+1) == '!') { fmode = "w"; /* Overwrite file */ fname = *(This+2) ? (This+2) : Next; } else { /* File name follows */ fmode = "w"; fname = *(This+1) ? (This+1) : Next; if (fname) { /* See if file exists */ if ((fp = fopen(fname, "r")) != NULL) { printf("%s: File exists\n", fname); fclose(fp); return NO; } } } if (!fname) /* No file name given */ return NO; if ((fp = fopen(fname, fmode)) == NULL) { ErrMsg("Can't access file", fname); return NO; } /* Now, file is open and OK: reload the text and put up a stream for it! */ ErrMsg("Save file", fname); { BOOL ret = NO; HTRequest *req = HTRequest_new(); /* Set up a new request */ HTFormatInitNIM(req->conversions); /* Non-interactive mode */ if(OutSource) req->output_format = WWW_SOURCE; req->output_stream = HTFWriter_new(fp, NO); HTForceReload = YES; ret = HTLoadAnchor((HTAnchor*) HTMainAnchor, req); HTForceReload = NO; HTRequest_delete(req); return ret; } } /* End HTBrowse.c */ om the last"); if (!HTHistory_canBacktrack()) printf(" document as there is no last"); printf(" document.\n"); goto ret; } HTLoadAnchor(HTHistory_moveBy(1), request); goto ret; } break; case 'P': if (Check_User_Input(WWW/LineMode/Implementation/HTBrowse.h 664 472 105 1703 5411602273 13146 /* HTBrowse.h ** ** Declarations of things available from HTBrowse.c ** ------------------------------------------------ ** ** HTBrowse.c, the main program of a line mode browser, leaves various ** public variables atteh disposal of its submodules. ** ** 6 Oct 92 Nothing provided TO the W3 library (TBL) */ #ifndef HTBROWSE_H #define HTBROWSE_H #include "tcp.h" #ifdef SHORT_NAMES #define HTScreenHeight HTScHeig #define HTScreenWidth HTScWidt #define display_anchors HTDiAnch #define interactive HTIntera #define reference_mark HTReMark #endif /* extern int WWW_TraceFlag; Off unless -v option given */ extern int HTScreenWidth; /* By default */ extern int HTScreenHeight; /* Undefined */ extern BOOL display_anchors; /* anchor will be shown in text? */ extern char * reference_mark; /* Format string for [1] &c */ extern char * end_mark; /* Format string for [End] */ #endif /* HTBROWSE_H */ 'S': /* TBL 921009 */ if (Check_User_Input("SWWW/LineMode/Implementation/GridText.c 664 32211 105 63343 5544315603 13267 /* Character grid hypertext object ** =============================== */ /* Implements: */ #include "HText.h" #include #include #include "HTUtils.h" #include "HTString.h" #include "GridText.h" #include "HTFont.h" #include "HTBrowse.h" #include "HTStream.h" struct _HTStream { /* only know it as object */ CONST HTStreamClass * isa; /* ... */ }; #define MAX_LINE HTScreenWidth /* No point in accumulating more */ #ifdef THINK_C #define LOADED_LIMIT 3 /* For now, save last two texts */ #else #define LOADED_LIMIT 6 /* For now, save last five texts */ #endif /* From main program: */ extern char * start_reference; /* Template for anchors */ extern char * end_reference; /* Template for anchors */ extern char * end_mark; /* Template for end */ extern int HTScreenWidth, /* The screen width */ HTScreenHeight; /* The screen height */ extern BOOL display_anchors; /* anchor will be shown in text? */ #ifdef CURSES #define DISPLAY_LINES (HTScreenHeight) #define TITLE_LINES 0 #else #define DISPLAY_LINES (HTScreenHeight - 1) /* Exclude prompt line */ #define TITLE_LINES 1 #endif /* From default style sheet: */ extern HTStyleSheet * styleSheet; /* Default or overridden */ /* Exports */ PUBLIC HText * HTMainText = 0; /* Equivalent of main window */ PUBLIC HTParentAnchor * HTMainAnchor = 0; /* Anchor for HTMainText */ typedef struct _line { struct _line *next; struct _line *prev; short unsigned offset; /* Implicit initial spaces */ short unsigned size; /* Number of characters */ BOOL split_after; /* Can we split after? */ BOOL bullet; /* Do we bullet? */ char data[1]; /* Space for terminator at least! */ } HTLine; #define LINE_SIZE(l) (sizeof(HTLine)+(l)) /* allow for terminator */ typedef struct _TextAnchor { struct _TextAnchor * next; int number; /* For user interface */ int start; /* Characters */ int extent; /* Characters */ HTChildAnchor * anchor; } TextAnchor; /* Notes on struct _Htext: ** next_line is valid iff state is false. ** top_of_screen line means the line at the top of the screen ** or just under the title if there is one. */ struct _HText { HTParentAnchor * node_anchor; char * title; HTLine * last_line; int lines; /* Number of them */ int chars; /* Number of them */ TextAnchor * first_anchor; /* Singly linked list */ TextAnchor * last_anchor; int last_anchor_number; /* user number */ /* For Internal use: */ HTStyle * style; /* Current style */ int display_on_the_fly; /* Lines left */ BOOL all_pages; /* Loop on the fly */ int top_of_screen; /* Line number */ HTLine * top_of_screen_line; /* Top */ HTLine * next_line; /* Bottom + 1 */ int permissible_split; /* in last line */ BOOL in_line_1; /* of paragraph */ BOOL stale; /* Must refresh */ HTStream* target; /* Output stream */ HTStreamClass targetClass; /* Output routines */ }; #define PUTC(c) (*text->targetClass.put_character)(text->target, c) #define PUTS(s) (*text->targetClass.put_string)(text->target, s) /* Boring static variable used for moving cursor across */ #define SPACES(n) (&space_string[HTScreenWidth - (n)]) /* String containing blank spaces only */ PRIVATE char * space_string; PRIVATE HTStyle default_style = { 0, "(Unstyled)", "", (HTFont)0, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_LEFT, 1, 0, 0, NO, NO, 0, 0, 0 }; PUBLIC void clear_screen NOPARAMS; /* Forward */ PRIVATE HTList * loaded_texts; /* A list of all those in memory */ /* Creation Method ** --------------- ** ** Interactive version ** */ PUBLIC HText * HText_new ARGS1(HTParentAnchor *,anchor) { HTLine * line; HText * self = (HText *) malloc(sizeof(*self)); if (!self) return self; if (!loaded_texts) loaded_texts = HTList_new(); HTList_addObject(loaded_texts, self); if (HTList_count(loaded_texts) >= LOADED_LIMIT) { if (TRACE) fprintf(stderr, "GridText: Freeing off cached doc.\n"); HText_free((HText *)HTList_removeFirstObject(loaded_texts)); } line = self->last_line = (HTLine *)malloc(LINE_SIZE(MAX_LINE)); if (line == NULL) outofmem(__FILE__, "HText_New"); line->next = line->prev = line; line->offset = line->size = 0; self->lines = self->chars = 0; self->title = 0; self->first_anchor = self->last_anchor = 0; self->style = &default_style; self->top_of_screen = 0; self->node_anchor = anchor; self->last_anchor_number = 0; /* Numbering of them for references */ self->stale = YES; self->target = NULL; HTAnchor_setDocument(anchor, (HyperDoc *)self); clear_screen(); HTMainText = self; HTMainAnchor = anchor; self->display_on_the_fly = DISPLAY_LINES; self->all_pages = NO; /* One page at a time on the fly */ if (!space_string) { /* Make a blank line */ char *p; space_string = (char *)malloc(HTScreenWidth+1); if (space_string == NULL) outofmem(__FILE__, "HText_New"); for (p=space_string; ptarget = stream; me->targetClass = *stream->isa; /* copy action procedures */ me->all_pages = YES; /* Display whole file on the fly */ } return me; } /* Free Entire Text ** ---------------- */ PUBLIC void HText_free ARGS1(HText *,self) { HTAnchor_setDocument(self->node_anchor, (HyperDoc *)0); while(YES) { /* Free off line array */ HTLine * l = self->last_line; l->next->prev = l->prev; l->prev->next = l->next; /* Unlink l */ self->last_line = l->prev; free(l); if (l == self->last_line) break; /* empty */ }; while(self->first_anchor) { /* Free off anchor array */ TextAnchor * l = self->first_anchor; self->first_anchor = l->next; free(l); } free(self); if (self == HTMainText) /* Henrik 24/02-94 */ HTMainText = NULL; } /* Display Methods ** --------------- */ /* Clear the screen (on screen-mode systems) ** ---------------- */ PUBLIC void clear_screen NOARGS { if (TRACE) return; /* in trace mode, don't clear trace away */ #ifdef CURSES if (w_text != NULL) { wmove(w_text,0,0); wclear(w_text); } #else #ifdef VM #ifdef NEWLIB int newlib_ncmd = 2; char newlib_cmd[2][80]; memset(newlib_cmd, ' ', sizeof(newlib_cmd)); strncpy(newlib_cmd[0], "clear", 5); /* Clear screen */ strncpy(newlib_cmd[1], "quit", 4); /* Leave newlib */ newlib(newlib_cmd, &newlib_ncmd); /* Execute command */ #else /* not NEWLIB - real VM */ system("CLRSCRN"); /* Clear screen */ #endif /* not NEWLIB */ #else /* Not VM */ /* Do nothing */ #endif /* Not VM */ #endif /* Not CURSES */ if (HTMainText) HTMainText->stale = YES; } /* Output a line ** ------------- */ PRIVATE void display_line ARGS2(HText *,text, HTLine *,line) { #ifdef CURSES int y, x; waddstr(w_text, SPACES(line->offset)); waddstr(w_text, line->data); getyx(w_text, y, x); if (y < DISPLAY_LINES-1) { wmove(w_text, ++y, 0); } #else if (!text->target) printf("%s%s\n", SPACES(line->offset), line->data); else { PUTS(SPACES(line->offset)); PUTS(line->data); PUTC('\n'); } #endif } /* Output the title line ** --------------------- */ PRIVATE void display_title ARGS1(HText *,text) { CONST char * title = HTAnchor_title(text->node_anchor); char percent[20], format[20]; if (text->lines > (DISPLAY_LINES-1)) { #ifdef NOPE sprintf(percent, " (p%d of %d)", (text->top_of_screen/(DISPLAY_LINES-1)) + 1, (text->lines-1)/(DISPLAY_LINES-1) + 1); sprintf(percent, " (%d%%)", 100*(text->top_of_screen+DISPLAY_LINES-1)/ /* Seen */ (text->lines)); /* Total */ #else sprintf(percent, " (%d/%d)", text->top_of_screen+DISPLAY_LINES-1, /* Seen */ text->lines); /* Total */ #endif } else { percent[0] = 0; /* Null string */ } sprintf(format, "%%%d.%ds%%s\n", /* Generate format string */ (int)(HTScreenWidth-strlen(percent)), (int)(HTScreenWidth-strlen(percent)) ); /* if (TRACE) fprintf(stderr, "FORMAT IS `%s'\n", format); */ #ifdef CURSES mvwprintw(w_top, 0, 0, format, title, percent); wrefresh(w_top); #else if (!text->target) printf(format, title, percent); else { char * line = (char*)malloc(HTScreenWidth+10); sprintf(line, format, title, percent); PUTS(line); free(line); } #endif } /* Fill the screen with blank after the file ** -------------------------- */ PRIVATE void fill_screen ARGS2(HText *, text, int,n) { if (n<=0 || n>1000) return; /* Large value means no pagination */ if (text->target) return; #ifdef CURSES waddstr(w_text, end_mark); wclrtobot(w_text); wrefresh(w_text); #else #ifndef VIOLA if (!text->target) printf("%s\n", end_mark); else { PUTS(end_mark); PUTC('\n'); } n--; for (; n; n--) { if (!text->target) printf("\n"); else PUTC('\n'); } #endif #endif /* Not CURSES */ } /* Output a page ** ------------- */ PRIVATE void display_page ARGS2(HText *,text, int,line_number) { HTLine * line = text->last_line->prev; int i; CONST char * title = HTAnchor_title(text->node_anchor); int lines_of_text = title ? (DISPLAY_LINES-TITLE_LINES) : DISPLAY_LINES; int last_screen = text->lines - lines_of_text; /* Constrain the line number to be within the document */ if (text->lines <= lines_of_text) line_number = 0; else if (line_number>last_screen) line_number = last_screen; else if (line_number < 0) line_number = 0; for(i=0, line = text->last_line->next; /* Find line */ ilast_line); i++, line=line->next) /* Loop */ assert(line->next != NULL); while((line!=text->last_line) && (line->size==0)) { /* Skip blank lines */ assert(line->next != NULL); line = line->next; line_number ++; } /* Can we just scroll to it? */ #ifndef VM /* No scrolling */ if (!text->stale && (line_number>=text->top_of_screen) && (line_number < text->top_of_screen + DISPLAY_LINES)) { /* Yes */ lines_of_text = line_number - text->top_of_screen; line = text->next_line; text->top_of_screen = line_number; #ifdef CURSES scrollok(w_text, TRUE); for (i = 0; i < lines_of_text; i++) { scroll(w_text); } #endif } else #endif { clear_screen(); /* No */ text->top_of_screen = line_number; if (title) display_title(text); } /* Bug: when we scroll to a part slightly futher down a page which previously fitted all on one screen including the [End], the code below will add an extra [End] to the screen, giving a total of two, one underneath the other. */ /* print it */ if (line) { for(i=0; (i< lines_of_text) && (line != text->last_line); i++) { assert(line != NULL); display_line(text, line); line = line->next; } fill_screen(text, lines_of_text - i); } text->next_line = line; /* Line after screen */ text->stale = NO; /* Display is up-to-date */ } /* Object Building methods ** ----------------------- ** ** These are used by a parser to build the text in an object */ PUBLIC void HText_beginAppend ARGS1(HText *,text) { text->permissible_split = 0; text->in_line_1 = YES; } /* Add a new line of text ** ---------------------- ** ** On entry, ** ** split is zero for newline function, else number of characters ** before split. ** text->display_on_the_fly ** may be set to indicate direct output of the finished line. ** text->all_pages ** if set indicates all pages are to be done on the fly. ** On exit, ** A new line has been made, justified according to the ** current style. Text after the split (if split nonzero) ** is taken over onto the next line. ** ** If display_on_the_fly is set, then it is decremented and ** the finished line is displayed. */ #define new_line(text) split_line(text, 0) PRIVATE void split_line ARGS2(HText *,text, int,split) { HTStyle * style = text->style; int spare; int indent = text->in_line_1 ? text->style->indent1st : text->style->leftIndent; /* Make new line */ HTLine * previous = text->last_line; HTLine * line = (HTLine *) malloc(LINE_SIZE(MAX_LINE)); if (line == NULL) outofmem(__FILE__, "split_line"); text->lines++; previous->next->prev = line; line->prev = previous; line->next = previous->next; previous->next = line; text->last_line = line; line->size = 0; line->offset = 0; /* Split at required point */ if (split) { /* Delete space at "split" splitting line */ char * p; previous->data[previous->size] = 0; for (p = &previous->data[split]; *p; p++) if (*p != ' ') break; strcpy(line->data, p); line->size = strlen(line->data); previous->size = split; } /* Economise on space. ** Not on the RS6000 due to a chaotic bug in realloc argument passing. ** Same problem with Ultrix (4.2) : realloc() is not declared properly. */ #ifndef AIX #ifndef ultrix while ((previous->size > 0) && (previous->data[previous->size-1] == ' ')) /* Strip trailers */ previous->size--; previous = (HTLine *) realloc (previous, LINE_SIZE(previous->size)); if (previous == NULL) outofmem(__FILE__, "split_line"); #endif /* ultrix */ #endif /* AIX */ previous->prev->next = previous; /* Link in new line */ previous->next->prev = previous; /* Could be same node of course */ /* Terminate finished line for printing */ previous->data[previous->size] = 0; /* Align left, right or center */ spare = HTScreenWidth - style->rightIndent + style->leftIndent - previous->size; /* @@ first line indent */ switch (style->alignment) { case HT_CENTER : previous->offset = previous->offset + indent + spare/2; break; case HT_RIGHT : previous->offset = previous->offset + indent + spare; break; case HT_LEFT : case HT_JUSTIFY : /* Not implemented */ default: previous->offset = previous->offset + indent; break; } /* switch */ text->chars = text->chars + previous->size + 1; /* 1 for the line */ text->in_line_1 = NO; /* unless caller sets it otherwise */ /* If displaying as we go, output it: */ if (text->display_on_the_fly) { if (text->display_on_the_fly == DISPLAY_LINES) { /* First line */ if (previous->size == 0) { text->top_of_screen++; /* Scroll white space off top */ return; } if (HTAnchor_title(text->node_anchor)) { /* Title exists */ display_title(text); text->display_on_the_fly--; } } display_line(text, previous); text->display_on_the_fly--; /* Loop to top of next page? */ if (!text->display_on_the_fly && text->all_pages) { PUTS("\f\n"); /* Form feed on its own line a la rfc1111 */ text->display_on_the_fly = DISPLAY_LINES; } } } /* split_line */ /* Allow vertical blank space ** -------------------------- */ PRIVATE void blank_lines ARGS2(HText *,text, int,newlines) { if (text->last_line->size == 0) { /* No text on current line */ HTLine * line = text->last_line->prev; while ((line!=text->last_line) && (line->size == 0)) { if (newlines==0) break; newlines--; /* Don't bother: already blank */ line = line->prev; } } else { newlines++; /* Need also to finish this line */ } for(;newlines;newlines--) { new_line(text); } text->in_line_1 = YES; } /* New paragraph in current style ** ------------------------------ ** See also: setStyle. */ PUBLIC void HText_appendParagraph ARGS1(HText *,text) { int after = text->style->spaceAfter; int before = text->style->spaceBefore; blank_lines(text, after>before ? after : before); } /* Set Style ** --------- ** ** Does not filter unnecessary style changes. */ PUBLIC void HText_setStyle ARGS2(HText *,text, HTStyle *,style) { int after, before; if (!style) return; /* Safety */ after = text->style->spaceAfter; before = style->spaceBefore; if (TRACE) fprintf(stderr, "HTML: Change to style %s\n", style->name); blank_lines (text, after>before ? after : before); text->style = style; } /* Append a character to the text object ** ------------------------------------- */ PUBLIC void HText_appendCharacter ARGS2(HText *,text, char,ch) { HTLine * line = text->last_line; HTStyle * style = text->style; int indent = text->in_line_1 ? style->indent1st : style->leftIndent; /* New Line */ if (ch == '\n') { new_line(text); text->in_line_1 = YES; /* First line of new paragraph */ return; } /* Tabs */ if (ch == '\t') { HTTabStop * tab; int target; /* Where to tab to */ int here = line->size + line->offset +indent; if (style->tabs) { /* Use tab table */ for (tab = style->tabs; tab->position <= here; tab++) if (!tab->position) { new_line(text); return; } target = tab->position; } else if (text->in_line_1) { /* Use 2nd indent */ if (here >= style->leftIndent) { new_line(text); /* wrap */ return; } else { target = style->leftIndent; } } else { /* Default tabs align with left indent mod 8 */ #ifdef DEFAULT_TABS_8 target = ((line->offset + line->size + 8) & (-8)) + style->leftIndent; #else new_line(text); return; #endif } if (target > HTScreenWidth - style->rightIndent) { new_line(text); return; } else { text->permissible_split = line->size; /* Can split here */ if (line->size == 0) line->offset = line->offset + target - here; else for(; heredata[line->size++] = ' '; /* Put character into line */ } return; } /*NOTREACHED*/ } /* if tab */ if (ch==' ') { text->permissible_split = line->size; /* Can split here */ } /* Check for end of line */ if (indent + line->offset + line->size + style->rightIndent >= HTScreenWidth) { if (style->wordWrap) { if(text->permissible_split > line->size) /* HENRIK 21/02-94 */ text->permissible_split = line->size; split_line(text, text->permissible_split); if (ch==' ') return; /* Ignore space causing split */ } else new_line(text); } /* Insert normal characters */ if (ch == HT_NON_BREAK_SPACE) { ch = ' '; } { HTLine * line = text->last_line; /* May have changed */ HTFont font = style->font; line->data[line->size++] = /* Put character into line */ font & HT_CAPITALS ? TOUPPER(ch) : ch; if (font & HT_DOUBLE) /* Do again if doubled */ HText_appendCharacter(text, HT_NON_BREAK_SPACE); /* NOT a permissible split */ } } /* Anchor handling ** --------------- */ /* Start an anchor field */ PUBLIC void HText_beginAnchor ARGS2(HText *,text, HTChildAnchor *,anc) { TextAnchor * a = (TextAnchor *) malloc(sizeof(*a)); char marker[100]; if (a == NULL) outofmem(__FILE__, "HText_beginAnchor"); a->start = text->chars + text->last_line->size; a->extent = 0; if (text->last_anchor) { text->last_anchor->next = a; } else { text->first_anchor = a; } a->next = 0; a->anchor = anc; text->last_anchor = a; if (HTAnchor_followMainLink((HTAnchor*)anc)) { a->number = ++(text->last_anchor_number); } else { a->number = 0; } if (start_reference && a->number && display_anchors) { /* If it goes somewhere */ sprintf(marker, start_reference, a->number); HText_appendText(text, marker); } } PUBLIC void HText_endAnchor ARGS1(HText *,text) { TextAnchor * a = text->last_anchor; char marker[100]; if (a->number && display_anchors) { /* If it goes somewhere */ sprintf(marker, end_reference, a->number); HText_appendText(text, marker); } a->extent = text->chars + text->last_line->size - a->start; } /* IMAGES */ PUBLIC void HText_appendImage ARGS5( HText *, text, HTChildAnchor *, anc, CONST char *, alt, /* int, alignment, */ /* HENRIK */ CONST char*, alignment, BOOL, isMap) { /* HText_beginAnchor(text, anc); */ HText_appendText(text, alt? alt: ""); /* HText_endAnchor(text) */ } PUBLIC void HText_appendText ARGS2(HText *,text, CONST char *,str) { CONST char * p; for(p=str; *p; p++) { HText_appendCharacter(text, *p); } } PUBLIC void HText_endAppend ARGS1(HText *,text) { new_line(text); if (text->display_on_the_fly) { /* Not finished? */ fill_screen(text, text->display_on_the_fly); /* Finish it */ text->display_on_the_fly = 0; text->next_line = text->last_line; /* Bug fix after EvA 920117 */ text->stale = NO; } } /* Dump diagnostics to stderr */ PUBLIC void HText_dump ARGS1(HText *,text) { fprintf(stderr, "HText: Dump called\n"); } /* Return the anchor associated with this node */ PUBLIC HTParentAnchor * HText_nodeAnchor ARGS1(HText *,text) { return text->node_anchor; } /* GridText specials ** ================= */ /* Return the anchor with index N ** ** The index corresponds to the number we print in the anchor. */ PUBLIC HTChildAnchor * HText_childNumber ARGS2(HText *,text, int,number) { TextAnchor * a; for (a = text->first_anchor; a; a = a->next) { if (a->number == number) return a->anchor; } return (HTChildAnchor *)0; /* Fail */ } PUBLIC void HText_setStale ARGS1(HText *,text) { text->stale = YES; } PUBLIC void HText_refresh ARGS1(HText *,text) { if (text->stale) display_page(text, text->top_of_screen); } PUBLIC int HText_sourceAnchors ARGS1(HText *,text) { return text->last_anchor_number; } PUBLIC BOOL HText_canScrollUp ARGS1(HText *,text) { return text->top_of_screen != 0; } PUBLIC BOOL HText_canScrollDown ARGS1(HText *,text) { char * title = text->title; return (text->top_of_screen + DISPLAY_LINES - (title? TITLE_LINES:0) ) < text->lines; } /* Scroll actions */ PUBLIC void HText_scrollTop ARGS1(HText *,text) { display_page(text, 0); } PUBLIC void HText_scrollDown ARGS1(HText *,text) { display_page(text, text->top_of_screen + DISPLAY_LINES -1); } PUBLIC void HText_scrollUp ARGS1(HText *,text) { display_page(text, text->top_of_screen - DISPLAY_LINES +1); } PUBLIC void HText_scrollBottom ARGS1(HText *,text) { display_page(text, text->lines - DISPLAY_LINES +1); } /* Browsing functions ** ================== */ /* Bring to front and highlight it */ PRIVATE int line_for_char ARGS2(HText *,text, int,char_num) { int line_number =0; int characters = 0; HTLine * line = text->last_line->next; for(;;) { if (line == text->last_line) return 0; /* Invalid */ characters = characters + line->size + 1; if (characters > char_num) return line_number; line_number ++; line = line->next; } } PUBLIC BOOL HText_select ARGS1(HText *,text) { /* if (text != HTMainText) { Do it anyway to refresh */ { HTMainText = text; HTMainAnchor = text->node_anchor; display_page(text, text->top_of_screen); } return YES; } PUBLIC BOOL HText_selectAnchor ARGS2(HText *,text, HTChildAnchor *,anchor) { TextAnchor * a; /* This is done later, hence HText_select is unused in GridText.c Should it be the contrary ? @@@ if (text != HTMainText) { HText_select(text); } */ for(a=text->first_anchor; a; a=a->next) { if (a->anchor == anchor) break; } if (!a) { if (TRACE) fprintf(stderr, "HText: No such anchor in this text!\n"); return NO; } if (text != HTMainText) { /* Comment out by ??? */ HTMainText = text; /* Put back in by tbl 921208 */ HTMainAnchor = text->node_anchor; } { int l = line_for_char(text, a->start); if (TRACE) fprintf(stderr, "HText: Selecting anchor [%d] at character %d, line %d\n", a->number, a->start, l); if ( !text->stale && (l >= text->top_of_screen) && ( l < text->top_of_screen + DISPLAY_LINES-1)) return YES; display_page(text, l - (DISPLAY_LINES/3)); /* Scroll to it */ } return YES; } /* Editing functions - NOT IMPLEMENTED ** ================= ** ** These are called from the application. There are many more functions ** not included here from the orginal text object. */ /* Style handling: */ /* Apply this style to the selection */ PUBLIC void HText_applyStyle ARGS2(HText *, me, HTStyle *,style) { } /* Update all text with changed style. */ PUBLIC void HText_updateStyle ARGS2(HText *, me, HTStyle *,style) { } /* Return style of selection */ PUBLIC HTStyle * HText_selectionStyle ARGS2( HText *,me, HTStyleSheet *,sheet) { return 0; } /* Paste in styled text */ PUBLIC void HText_replaceSel ARGS3( HText *,me, CONST char *,aString, HTStyle *,aStyle) { } /* Apply this style to the selection and all similarly formatted text ** (style recovery only) */ PUBLIC void HTextApplyToSimilar ARGS2(HText *,me, HTStyle *,style) { } /* Select the first unstyled run. ** (style recovery only) */ PUBLIC void HTextSelectUnstyled ARGS2(HText *,me, HTStyleSheet *,sheet) { } /* Anchor handling: */ PUBLIC void HText_unlinkSelection ARGS1(HText *,me) { } PUBLIC HTAnchor * HText_referenceSelected ARGS1(HText *,me) { return 0; } #ifdef CURSES PUBLIC int HText_getTopOfScreen ARGS1(HText *,text) { return text->top_of_screen; } PUBLIC int HText_getLines ARGS1(HText *,text) { return text->lines; } #endif PUBLIC HTAnchor * HText_linkSelTo ARGS2(HText *,me, HTAnchor *,anchor) { return 0; } issible_split = line->size; /* Can split here */ if (line->size == 0) line->offset = line->offset + target - here; else for(; heredata[line->size++] = ' '; /* Put character into line */ } return; } /*NOTREACHED*/ } /* WWW/LineMode/Implementation/GridText.h 664 472 105 2337 5371241462 13213 /* Specialities of GridText as subclass of HText */ #include "HText.h" /* Superclass */ #ifdef SHORT_NAMES #define HText_childNumber HTGTChNu #define HText_canScrollUp HTGTCaUp #define HText_canScrollDown HTGTCaDo #define HText_scrollUp HTGTScUp #define HText_scrollDown HTGTScDo #define HText_scrollTop HTGTScTo #define HText_scrollBottom HTGTScBo #define HText_sourceAnchors HTGTSoAn #define HText_setStale HTGTStal #define HText_refresh HTGTRefr #endif extern HTChildAnchor * HText_childNumber PARAMS((HText * text, int n)); /* Is there any file left? */ extern BOOL HText_canScrollUp PARAMS((HText * text)); extern BOOL HText_canScrollDown PARAMS((HText * text)); /* Move display within window */ extern void HText_scrollUp PARAMS((HText * text)); /* One page */ extern void HText_scrollDown PARAMS((HText * text)); /* One page */ extern void HText_scrollTop PARAMS((HText * text)); extern void HText_scrollBottom PARAMS((HText * text)); extern int HText_sourceAnchors PARAMS((HText * text)); extern void HText_setStale PARAMS((HText * text)); extern void HText_refresh PARAMS((HText * text)); #ifdef CURSES extern int HText_getTopOfScreen PARAMS((HText * text)); extern int HText_getLines PARAMS((HText * text)); #endif tSelectUnstyled ARGS2(HText *,me, HTStyleSheet *,sheet) { } /* Anchor handling: */ PUBLIC void HText_unlinkSelection ARGS1(HText *,me) { } PUBLIC HTAnchor * HText_referenceSelected ARGS1(HText *,me) { return 0; } #ifdef CURSES PUBLIC int HText_getTopOfScreen ARGS1(WWW/LineMode/Implementation/HTFont.h 664 472 105 516 5371241471 12600 /* The portable font concept (!?*) */ /* Line mode browser version: */ typedef long int HTLMFont; /* For now */ #define HT_NON_BREAK_SPACE ((char)1) /* For now */ #define HT_FONT 0 #define HT_CAPITALS 1 #define HT_BOLD 2 #define HT_UNDERLINE 4 #define HT_INVERSE 8 #define HT_DOUBLE 0x10 #define HT_BLACK 0 #define HT_WHITE 1 xt_scrollBottom HTGTScBo #define HText_sourceAnchors HTGTSoAn #define HText_setStale HTGTStal #define HText_refresh HTGTRefr #endif extern HTChildAnchor * HText_childNumbWWW/LineMode/Implementation/Version.make 664 32211 105 12 5544315605 13557 VL = 2.13 rtable font concept (!?*) */ /* Line mode browser version: */ typedef long int HTLMFont; /* For now */ #define HT_NON_BREAK_SPACE ((char)1) /* For now */ #define HT_FONT 0 #define HT_CAPITALS 1 #define HT_BOLD 2 #define HT_UNDERLINE 4 #define HT_INVERSE 8 #define HT_DOUBLE 0x10 #define HT_BLACK 0 #define HT_WHITE 1 xt_scrollBottom HTGTScBo #define HText_sourceAnchors HTGTSoAn #define HText_setStale HTGTStal #define HText_refresh HTGTRefr #endif extern HTChildAnchor * HText_childNumbWWW/LineMode/Implementation/DefaultStyles.c 664 472 105 7710 5373711016 14243 /* A real style sheet for the Character Grid browser ** ** The dimensions are all in characters! */ #include "HTStyle.h" #include "HTFont.h" /* Tab arrays: */ PRIVATE HTTabStop tabs_8[] = { { 0, 8 }, {0, 16}, {0, 24}, {0, 32}, {0, 40}, { 0, 48 }, {0, 56}, {0, 64}, {0, 72}, {0, 80}, { 0, 88 }, {0, 96}, {0, 104}, {0, 112}, {0, 120}, { 0, 128 }, {0, 136}, {0, 144}, {0, 152}, {0, 160}, {0, 168}, {0, 176}, {0, 0 } /* Terminate */ }; #ifdef NOT_USED PRIVATE HTTabStop tabs_16[] = { { 0, 16 }, {0, 32}, {0, 48}, {0, 64}, {0, 80}, {0, 96}, {0, 112}, {0, 0 } /* Terminate */ }; #endif PRIVATE HTTabStop tabs_24[] = { {0, 24}, {0, 48}, /* 3 columns */ {0, 0 } /* Terminate */ }; /* Template: ** link to next, name, tag, tagtype, ** font, size, colour, superscript, anchor id, ** indents: (1st,l,r), justific, lineheight, descent, tabs, ** word wrap, free format, space: before, after, flags. */ PRIVATE HTStyle HTStyleNormal = { 0, "Normal", "P", HT_FONT, 1.0, HT_BLACK, 0, 0, 3, 3, 0, HT_LEFT, 1, 0, tabs_8, YES, YES, 1, 1, 0 }; PRIVATE HTStyle HTStyleList = { &HTStyleNormal, "List", "UL", HT_FONT, 1.0, HT_BLACK, 0, 0, 6, 6, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 1, 0 }; PRIVATE HTStyle HTStyleMenu = { &HTStyleList, "Menu", "MENU", HT_FONT, 1.0, HT_BLACK, 0, 0, 1, 1, 0, HT_LEFT, 1, 0, 0, YES, YES, 0, 0, 0 }; PRIVATE HTStyle HTStyleDirect = { &HTStyleMenu, "Dir", "DIR", HT_FONT, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_LEFT, 1, 0, tabs_24, YES, YES, 0, 0, 0 }; PRIVATE HTStyle HTStyleGlossary = { &HTStyleDirect, "Glossary", "DL", HT_FONT, 1.0, HT_BLACK, 0, 0, 2, 25, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 1, 0 }; PRIVATE HTStyle HTStyleGlossaryCompact = { &HTStyleGlossary, "GlossaryCompact", "DLC", HT_FONT, 1.0, HT_BLACK, 0, 0, 0, 24, 0, HT_LEFT, 1, 0, 0, YES, YES, 0, 0, 0 }; PRIVATE HTStyle HTStyleExample = { &HTStyleGlossaryCompact, "Example", "XMP", HT_FONT, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_LEFT, 1, 0, tabs_8, NO, NO, 1, 1, 0 }; PRIVATE HTStyle HTStylePreformatted = { &HTStyleExample, "Preformatted", "PRE", HT_FONT, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_LEFT, 1, 0, tabs_8, NO, YES, 1, 1, 0 }; PRIVATE HTStyle HTStyleListing = { &HTStylePreformatted, "Listing", "LISTING", HT_FONT, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_LEFT, 1, 0, tabs_8, NO, NO, 1, 1, 0 }; PRIVATE HTStyle HTStyleAddress = { &HTStyleListing, "Address", "ADDRESS", HT_FONT, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_RIGHT, 1, 0, 0, NO, NO, 1, 1, 0 }; PRIVATE HTStyle HTStyleBlockQuote = { &HTStyleAddress, "BlockQuote", "BLOCKQUOTE", HT_FONT, 1.0, HT_BLACK, 0, 0, 7, 5, 5, HT_LEFT, 1, 0, 0, NO, NO, 1, 1, 0 }; PRIVATE HTStyle HTStyleHeading1 = { &HTStyleBlockQuote, "Heading1", "H1", HT_FONT+HT_CAPITALS+HT_BOLD, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_CENTER, 1, 0, 0, YES, YES, 1, 1, 0 }; PRIVATE HTStyle HTStyleHeading2 = { &HTStyleHeading1, "Heading2", "H2", HT_FONT+HT_BOLD, 1.0, HT_BLACK, 0, 0, 0, 0, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 1, 0 }; PRIVATE HTStyle HTStyleHeading3 = { &HTStyleHeading2, "Heading3", "H3", HT_FONT+HT_CAPITALS, 1.0, HT_BLACK, 0, 0, 2, 2, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 0, 0 }; PRIVATE HTStyle HTStyleHeading4 = { &HTStyleHeading3, "Heading4", "H4", HT_FONT, 1.0, HT_BLACK, 0, 0, 4, 4, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 0, 0 }; PRIVATE HTStyle HTStyleHeading5 = { &HTStyleHeading4, "Heading5", "H5", HT_FONT, 1.0, HT_BLACK, 0, 0, 6, 6, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 0, 0 }; PRIVATE HTStyle HTStyleHeading6 = { &HTStyleHeading5, "Heading6", "H6", HT_FONT, 1.0, HT_BLACK, 0, 0, 8, 8, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 0, 0 }; PRIVATE HTStyle HTStyleHeading7 = { &HTStyleHeading6, "Heading7", "H7", HT_FONT, 1.0, HT_BLACK, 0, 0, 10, 10, 0, HT_LEFT, 1, 0, 0, YES, YES, 1, 0, 0 }; /* Style sheet points to the last in the list: */ PRIVATE HTStyleSheet sheet = { "default.style", &HTStyleHeading7 }; /* sheet */ PUBLIC HTStyleSheet * styleSheet = &sheet; pace causing split */ } else new_line(text); } /* WWW/LineMode/Implementation/CommonMakefile 664 32211 105 17774 5544315601 14207 # Makefile for WorldWideWeb Line Mode browser (www) # # (c) CERN 1990, 1991 -- see Copyright.html for conditions # # This file should be invariant between systems. # DEPENDENCIES NOT COMPLETE @@ # # make Compile and link the software (private version) # make install Copy it into the system (implies make) # make update Copy installed version into installed version # make uninstall Unlink installed version from the system # make clean Remove intermediate files # make cleanall Remove intremediate files and products # # Macros required to be defined already for make: # # CC The C compiler # CFLAGS Flags for $(CC) # LFLAGS Flags for ld # WWW Root of WWW source tree # USELIBDIR Directory in which libwww.a should be found # # Macros needed for make install: # # BINDIR Directory for installed binary #______________________________________________________________________ # If this env var is set to something else Some makes will use that instead SHELL = /bin/sh # If this is actually run in a subdirectory. # # WWW = ../../.. # If it is run in this directory: # # WWW = ../.. For [cernlib] build in this directory LM = $(WWW)/LineMode/Implementation/ LMD = $(WWW)/LineMode/Defaults CMN = $(WWW)/Library/Implementation/ DEFAULTS = $(WWW)/LineMode/Defaults CFLAGS2 = $(CFLAGS) -I$(CMN) -I$(LM) CERNLIBBIN = $(WWW)/bin # WTMP is either WWW or /tmp for example. It allows the # machine-dependent files to be put in a separate tree so that # - The source tree can be read-only # - The source tree can be shared across platforms # USELIBDIR = $(WTMP)/Library/$(WWW_MACH) OBJ = $(WTMP)/LineMode/$(WWW_MACH) BIN = $(WWW)/LineMode/$(WWW_MACH) OE = $(OBJ)/.created WWWLIB = -L$(USELIBDIR) -lwww OBJS = $(OBJ)/HTBrowse.o $(OBJ)/GridText.o $(OBJ)/DefaultStyles.o # Final main product PROD = www SOURCES = $(LM)HTBrowse.c $(LM)HTBrowse.h \ $(LM)GridText.c $(LM)GridText.h \ $(LM)HTFont.h $(LM)Version.make\ $(LM)DefaultStyles.c $(LM)CommonMakefile SPECIFIC = \ $(LM)apollo_m68k/Makefile \ $(LM)decstation/Makefile \ $(LM)next/Makefile \ $(LM)pc-nfs/makefile \ $(LM)pc-nfs/README \ $(LM)pc-nfs/topc \ $(LM)rs6000/Makefile \ $(LM)sgi/Makefile \ $(LM)snake/Makefile \ $(LM)sun3/Makefile \ $(LM)sun4/Makefile \ $(LM)unix/Makefile \ $(LM)vax_ultrix/Makefile \ $(LM)vax_ultrix_cc/Makefile \ $(LM)vms/descrip.mms \ $(LM)vms/setup.com # Bug: This path, if relative, is taken relative to the directory # in which this makefile is, not the pwd. This screws up the # recursive invocation include $(ABS)$(LM)Version.make $(BIN)/$(PROD) : $(OBJS) $(USELIBDIR)/libwww.a $(CC) -o $(BIN)/$(PROD)_$(VL) $(OBJS) $(WWWLIB) $(WAISLIB) $(LFLAGS) -rm $(BIN)/$(PROD) ln -s $(PROD)_$(VL) $(BIN)/$(PROD) $(USELIBDIR)/libwww.a : @echo You must get and make the WWWLibrary product first! (cd $(WWW)/Library/$(WWW_MACH) && make) lib : (cd $(WWW)/Library/$(WWW_MACH) && make) inc : (cd $(WWW)/Library/Implementation && make inc) # Make a copy of the binary and documentation on this machine install : $(PROD) cp $(PROD) $(BINDIR)/$(PROD) - mkdir /usr/local - mkdir /usr/local/lib - mkdir /usr/local/lib/WWW cp $(DEFAULTS)/*.html /usr/local/lib/WWW # Link system to the binary and documentation in this tree link : Works/$(PROD) ln -s `pwd`/$(PROD) $(BINDIR)/$(PROD) - mkdir /usr/local - mkdir /usr/local/lib ln -s $(DEFAULTS) /usr/local/lib/WWW uninstall : rm $(BINDIR)/$(PROD) rm -r /usr/local/lib/WWW # Clean up everything generatable except final products # Including obj directory UNLESS there is anything else in it clean : rm $(OBJ)/.created $(OBJ)/*.o -rmdir $(OBJ) # Clean up everything generatable including final products cleanall : clean rm $(PROD) # Binary release # # Must be done on anonymous FTP server! # # This makefile does not knw how to make $(PROD)_$(VL) so that trying # to make binay or asis on a weird machine doesn't try to build $(PROD)! binary : $(PROD)_$(VL) -mkdir /pub/www/bin/$(WWW_MACH) cp $(PROD)_$(VL) /pub/www/bin/$(WWW_MACH)/$(PROD)_$(VL) # ASIS installation # ----------------- # Can only happen on an allocated ASIS development machine and # with uid of the controlling user for the project. # asis : /asis/share/usr.local/lib/WWW/default.html \ /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) touch asis echo ASIS distribution is now up-to-date. /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) : $(PROD)_$(VL) cp $(PROD)_$(VL) /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD)_$(VL) rm -f /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) ln -s $(PROD)_$(VL) \ /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) /asis/share/usr.local/lib/WWW/default.html : $(DEFAULTS)/cern.html - mkdir /asis/share/usr.local/lib/WWW cp $(DEFAULTS)/*.html /asis/share/usr.local/lib/WWW cp $(DEFAULTS)/cern.html /asis/share/usr.local/lib/WWW/default.html cp $(DEFAULTS)/default.html /asis/share/usr.local/lib/WWW/top.html # CERNLIB installation # -------------------- # Assuming the cernlib-style directory structure # Warning: Not suitable for machine-shared file structure. # cernlib : $(PROD) - mkdir $(CERNLIBBIN) cp $(PROD) $(CERNLIBBIN) #_________________________________________________________________________ # Compiling the Objects (Dependenies incomplete) # Check directory exists $(OE) : -mkdir $(WTMP) -mkdir $(WTMP)/LineMode -mkdir $(WTMP)/LineMode/$(WWW_MACH) touch $(OE) # $(OBJ)/HTBrowse.o : $(OE) $(LM)HTBrowse.c $(LM)GridText.h $(LM)Version.make \ $(CMN)HTUtils.h $(CMN)HTAccess.h $(CC) -c -o $@ $(CFLAGS2) -DVL=\"$(VL)\" $(LM)HTBrowse.c $(OBJ)/GridText.o : $(OE) $(LM)GridText.c $(LM)GridText.h\ $(CMN)HTAnchor.h $(CMN)HTStyle.h $(CC) -c -o $@ $(CFLAGS2) $(LM)GridText.c $(OBJ)/DefaultStyles.o : $(OE) $(LM)DefaultStyles.c $(CMN)HTStyle.h $(CC) -c -o $@ $(CFLAGS2) $(LM)DefaultStyles.c #_________________________________________________________________ # For W3 Administrative use only: # W3 Source + documentation release # --------------------------------- distribute : /pub/www/README.txt /pub/www/Copyright.txt (cd $(WWW)/.. && WWW=WWW ABS=`pwd`/ make $(MFLAGS) \ -f WWW/LineMode/Implementation/CommonMakefile \ /pub/www/src/WWWLineMode_$(VL).tar.Z) (cd ../Implementation; cvs tag \ `sed -e 's/V. = /v/' Version.make | sed -e 's?\.?/?'` ) echo Distribution of Line Mode version $(VC) up to date. # THIS MUST BE BUILT FROM THE DIRECTORY ABOVE WWW ! USE distribute above! /pub/www/src/WWWLineMode_$(VL).tar.Z : $(SOURCES) $(LMD)/line-mode-guide.txt tar cf /pub/www/src/WWWLineMode_$(VL).tar \ $(SOURCES) $(LMD)/line-mode-guide.txt \ $(WWW)/LineMode/*/Makefile \ $(WWW)/LineMode/vms/descrip.mms $(WWW)/LineMode/vms/build_multinet.com \ $(WWW)/LineMode/vms/setup.com compress /pub/www/src/WWWLineMode_$(VL).tar # Hypertext supplied in text format # --------------------------------- $(WWW)/README.txt : $(WWW)/../README.html www -n -p66 http://info.cern.ch/hypertext/README.html \ > $(WWW)/README.txt /pub/www/README.txt : $(WWW)/README.txt cp $(WWW)/README.txt /pub/www/README.txt $(WWW)/Copyright.txt : $(WWW)/../Copyright.html www -n -p66 http://info.cern.ch/hypertext/Copyright.html \ > $(WWW)/Copyright.txt /pub/www/Copyright.txt : $(WWW)/Copyright.txt cp $? $@ # Line Mode Manual # QUICKGUIDE = \ $(LMD)/QuickGuide.html \ $(LMD)/Commands.html \ $(LMD)/SourceExamples.html \ $(LMD)/CommandLine.html \ $(LMD)/Shortcuts.html \ $(LMD)/VMS_Shortcuts.html \ $(LMD)/Installation.html \ $(LMD)/Installation_VMS.html \ $(LMD)/Installation_VMS_NewTCP.html \ $(LMD)/Distribution.html \ $(LMD)/Porting.html \ $(LMD)/MachineTypes.html \ $(LMD)/InstallNotSU.html \ $(LMD)/Path.html \ $(LMD)/LoginScript.html \ $(LMD)/Customisation.html \ $(LMD)/EnvVariables.html \ $(LMD)/GlobalV.html \ $(LMD)/NewsServer.html \ $(LMD)/Bugs.html \ $(LMD)/Features.html doc : /pub/www/doc/line-mode-guide.txt echo line mode browser guide exists. /pub/www/doc/line-mode-guide.txt : $(LMD)/line-mode-guide.txt cp $? $@ $(LMD)/line-mode-guide.txt : $(QUICKGUIDE) -rm $@ for i in $(QUICKGUIDE) ; do www -n -na -p66 $$i >> $@; done kdirWWW/LineMode/Defaults/line-mode-guide.txt 664 32211 105 214220 5544315656 13700 User Guide for the WWW Line Mode Browser WWW LINE MODE BROWSER The World-Wide Web line-mode browser allows you to find information by following references and/or by using keywords. References are numbers in [brackets] after particular phrases. Type the number and RETURN for more information on the phrase. Some documents are indexes. These contain little text, but allow you to search for information with keywords. Type "find" or "f" (space) and the keywords. For example, "f sgml examples" searches the index for items with keywords SGML and EXAMPLE. You can only use the "find" command when it is present in the prompt. You can omit the "f" if the first keyword doesn't conflict with existing commands . Futher information: command line syntax , shortcuts , installation , customization , deeper details . Please send any bugs and suggestions to www-bug@info.cern.ch. Tim BL [End] Commands -- /LineMode COMMANDS The following commands are available at the prompt within www . Some are disabled when not applicable. All commands may be abbreviated. Case is not significant. GETTING HELP Help, ? Gives a list of available commands depending on the context, the version number of the www program, and the hypertext address , (or UDI) of the document you are reading. Manual Jumps directly to the master document of the online manual. GETTING AROUND IN A DOCUMENT Just hitting Return displays the next page (if any) of the current document. Top, Bottom Goes to the top or the bottom of the current document Up, Down Scrolls up or down one page in the current document. LOAD A DOCUMENT Typing a number by itself follows the corresponding reference from the currently displayed document. Back Goes back to the document you were reading before. Next, Previous Goes to the next or previous document in the list of pointers from the document that led to the current one. This is better explained with an example: suppose you are reading a document which looks like a menu, and you want to read all entries in turn. You first type "1" to read the first referred document (by following the first link), and then you type "next" or just "n" to read the next one from the menu, without actually coming back to the menu and typing "2", etc. Go
Goes to the document represented by the given hypertext address, which is interpreted relatively to the current document. Home Goes back to the first document you were reading. LINKS List Gives a numbered list of the links from the current document, giving the title of the target documents if it is known otherwise the URL To follow a link, type the number by itself as above. By using source , only the URL's are dislayed. SEARCH Find, Keywords Queries the current index with the supplied keywords (separated by blanks). The interpretation of the keywords depends on the particular information server you're looking at. In most cases, it will search a database for entries matching the keywords, and will Commands -- /LineMode (119/119) the URL's are dislayed. SEARCH Find, Keywords Queries the current index with the supplied keywords (separated by blanks). The interpretation of the keywords depends on the particular information server you're looking at. In most cases, it will search a database for entries matching the keywords, and will display the results with possibly links to further details. For more complex queries, instructions should be present in the cover page. The "Find" (or "Keywords") command can be omitted if the first keyword does not conflict with another www command. HISTORY Recall Without a parameter, gives a numbered list of the documents you have visited. To select one, type "Recall" followed by the number. OTHER FEATURES Source Followed by another command, causes raw source to be generated for that command but without any MIME headers wrapped around it. This is useful for printing postscript files without formatting, with SOURCE PRINT. See examples . Verbose Toggles verbose mode (for maintenance purposes). EXIT WORLD WIDE WEB Quit, Exit Leaves the application. ON UNIX VERSIONS, THE FOLLOWING EXTRA COMMANDS ARE AVAILABLE: Print Prints the current document, without the numbered document references. A background www is launched to do that, and its output is piped to the command defined by the environment variable WWW_PRINT_COMMAND ("lpr" by default). Can be used with source . > file Saves the current document to the given file, without the numbered document references. A background www is launched to do that. If the file exists, a ">!" will overwrite it. Can be used with source . >> file Appends the current document to the given file without the numbered links. Can be used with source . | command Pipes the current document to the given command, without the numbered document references. A background www is launched to do that. Can be used with source . ! command Executes the given shell command without leaving www. CD (or LCD) directory Changes the local working directory. "! cd directory" won't do this because it applies to a subshell. Tim BL SourceExamples -- /Defaults USING THE "SOURCE" PREFIX Note: Version 1.3 and later. The SOURCE (S) prefix to a command within www qualifies the execution of that command. It make the command generate raw unformatted text instead of formatting it. Som examples of use are: Printing Poscscript documents Currently, a postscript document comes up on the screen in its postscript form. Printing the display from the screen, formatted, is not a good idea as the postscript is damages by being formatted. Use with PRInt to send the document to the printer directly: SOURCE PRINT You must have a postscript printer for this to work. Looking at SGML source code If you want to see the SGML source of a document, prefix the FIND or jump command with SOURCE. SOURCE > temp.html saves the current document in a file temp.html. SOURCE 1 Follows the first link from the current document, displaying the source of the destination document. Note that while the raw data is retrieved without interpretation, it is formatted for display on your terminal in this case. What it won't do SOURCE won't change the format of a document already loaded, so SOURCE by itself won't display the source of the current document. SOURCE only works for documents from W3 servers and, to a certain extent, news articles. You can't get original source for for example file directories. Tim BL [End] Command Line Syntax for the Line Mode browser COMMAND LINE SYNTAX The syntax is: www [ options ] [ docaddress [ keywords ]] With no arguments, the www shell command allows you to browse from the system default page, /usr/local/lib/WWW/default.html. Options Options should be specified before other arguments. Currently available options are:- MAIN MODES OF EXECUTION - A minus sign with no trailing characters indicates that the program will accept HTML format input from the standard input. This allows www to be used as a filter from html to plain text for example. Relative links in the input are parsed as though the address of the document was that of the home page (or docaddress if specified). Implies non-interactive mode. -h host Establish a telnet connection to the remote host specified. This implies a "secure mode" execution where all references to the local file system are cancelled. -n Non-interactive mode. Outputs the formatted document to the standard output, then exits. Pages are delimited with form feed (FF) characters. -v Verbose mode: Gives a running commentary on the program's attempts to read data in various ways. This can also be turned on and off during normal execution, see Existing Commands . OTHER MODES THAT FORCE NON-INTERACTIVE MODE -from format Only if WWW is executed as a filter, this option indicates the desired input format according to the HTTP-specifications. The default value is "text/html". -listrefs Adds a list of the addresses of all documents references to the end. -o file Redirects output to specified file. -source Display the original source (without any MIME-headers) of a document instead of parsing it. Has effect for HTML from w3 servers, and news articles. (v1.2a or later). In order to get the MIME-headers, use the " -to " command. -to format Format is the output format for www. Default value is "www/present" but may be changed according to the HTTP-specifications. Two common output formats are "www/source" that is the source without MIME-headers and "www/mime" that is the source with the MIME-header if any. -version Prints out the version number of the software, and Command Line Syntax for the Line Mode browser (119/119) use the " -to " command. -to format Format is the output format for www. Default value is "www/present" but may be changed according to the HTTP-specifications. Two common output formats are "www/source" that is the source without MIME-headers and "www/mime" that is the source with the MIME-header if any. -version Prints out the version number of the software, and the version number of the WWW library, and exits. SCREEN OPTIONS -p n where n is a number, specifies the page length. Without a number, makes the page length infinite. Default is 24. -w n where n is a number, specifies the page width in columns. The default is 78, 79 or 80 depending on the system. (v1.0 or later) ANCHOR FORMATS -a format Specifies the printf-style format string to be used when printing references. Must contain the two characters "%d" where the numbers should occur. Be sure to escape or quote any special characters you use. For example under unix: -na Hides anchor positions in the text. Useful, when printing out the document. OTHER CONFIGURATION OPTIONS -l file Specifies a log file with a list of visited documents. -r file Rule file (configuration file). If this is specified, a rule file may be used to map URLs, and to set up other aspects of the behavior of the browser. Many rule files may be given with successive -r options. One rule file name may be given using the WWW_CONFIG environment variable. www -a \<%d\> www -a " (Type %d)" docaddress If present, the next argument (docaddress) is the hypertext address , of the document at which you want to start browsing. You may want to define an alias for www followed by name of your favorite index. keywords Any further command line arguments are taken as keywords. The first argument must refer to an index in this case. The index is searched for entries matching the keywords, and a list of matching entries is displayed. Tim BL Shortcuts -- /LineMode SHORTCUTS To save having always to go through the www default page, you can use a shortcut to get to an index. On the central CERN nodes for example, the following shell commands are predefined: yellow The CERN yellow pages telephone directory. xfind The CERN computer center documentation keyword index vmnews The CERN computer centre news service: all news articles, in reverse chronological order. You can search an index which has a shortcut command by giving the keywords as parameters, e.g. yellow taxes To make your own shortcuts, you can define your own commands. On Unix (with csh), use an alias (see VMS equivalent ) : alias z www address where address is the hypertext address of the document you want to jump into. You can find the hypertext address of a node from HELP command when you are in www. An alternative method uses a shell script. Tim BL [End] VMS_Shortcuts -- /LineMode VMS SHORTCUT COMMAND On VMS, to make a shortcut command , use a symbol: $ Z :== 'WWW' """address""" substituting Z with the shortcut command name, and the word "address" with the actual hypertext address. Note that you MUST use single quotes around WWW, and THREE DOUBLE QUOTE CHARACTERS each side of the address. (That's DCL syntax for you!) Tim BL [End] Installation -- /LineMode INSTALLING WWW This section describes how to install the World-Wide Web line-mode browser called "www". First of all, If you have a VAX/VMS machine, then see the special instuctions for VMS If you have not already got hold of the files, see the section on getting them . If you have a VM mainframe, see special instructions . The browser has already been ported to many machines. Check the list of machine types for your machine. If your machine is not one of those, see the section on porting . If the binary is available If you found your machine type, check in the anonymous FTP archive for the subdirectory of /pub/www/bin for your machine. If that directory exists and contains a file named www with some version number appended, then select binary mode and take the file, calling your copy www. Otherwise, go to "compiling from source " . Copy www into an apropriate directory which appears in your path. If you can be superuser, this can be /usr/local/bin/www (typically) so that everyone can use www. If you cannot be superuser, see how to use www without being superuser ). If you type "rehash", you will be able to use www. It will start at a default home page which is at CERN. To make your own home page, take the tar file WWWLineModeDefaults.tar.Z. Unwrap it and put the files into a directory /usr/local/lib/WWW. Now skip to make yourself at home below. Compiling from source If a binary is not available, see instructions for compiling from source. You must get, uncompress and untar BOTH the WWWLineMode* product AND the WWWLibrary* product source tar files. Find the subdirectory of WWW/LineMode named after your machine type. cd to it. Check the directory definitions in the Makefile, and change them if necessary. See the definition of the macros in the file Implementation/CommonMakefile . Type "make lib". You should get a file WWW/Library/libwww.a Type "make". You should get a binary of WWW/LineMode/www. Installing Become superuser (su root). If you can't do this, see how to do it without being superuser ). Type "make install". A reference copy of the executable is made and copied into the system. The "make install" step creates a copy in your system directories of the www executable and the basic documenattion. If you wish to just soft link them Installation -- /LineMode (83/83) If you found your machine type, check in the anonymous FTP archive for the subdirectory of /pub/www/bin for your machine. If that directory exists and contains a file named www with some version number appended, then select binary mode and take the file, calling your copy www. Otherwise, go to "compiling from source " . Copy www into an apropriate directory which appears in your path. If you can be superuser, this can be /usr/local/bin/www (typically) so that everyone can use www. If you cannot be superuser, see how to use www without being superuser ). If you type "rehash", you will be able to use www. It will start at a default home page which is at CERN. To make your own home page, take the tar file WWWLineModeDefaults.tar.Z. Unwrap it and put the files into a directory /usr/local/lib/WWW. Now skip to make yourself at home below. Compiling from source If a binary is not available, see instructions for compiling from source. You must get, uncompress and untar BOTH the WWWLineMode* product AND the WWWLibrary* product source tar files. Find the subdirectory of WWW/LineMode named after your machine type. cd to it. Check the directory definitions in the Makefile, and change them if necessary. See the definition of the macros in the file Implementation/CommonMakefile . Type "make lib". You should get a file WWW/Library/libwww.a Type "make". You should get a binary of WWW/LineMode/www. Installing Become superuser (su root). If you can't do this, see how to do it without being superuser ). Type "make install". A reference copy of the executable is made and copied into the system. The "make install" step creates a copy in your system directories of the www executable and the basic documenattion. If you wish to just soft link them to the files on the WWW tree, say "make link" instead. After either of these, "make clean" will remove intermediate files. Make yourself at home You must now check that the default "Home" page works, and customize it if it is not what you want. The default home page just a place to start. The cern.html file (distributed at the same time) is an example of a customized home page. You may wish to chose one of these as a basis. Setting up news To read Internet news, you must have first defined the news server's address . Tim BL Installation_VMS -- /LineMode INSTALLATION UNDER VMS To install under VMS, get the files WWW.EXE and SETUP.COM from sources described below. To set up the commands, put the command $ @[...]SETUP into your LOGIN.COM, or the system SYLOGIN.COM. This command file assumes you have left all the distributed files in the same directory as itself. Customization using logical names Under VMS, the home page may be defined using the logical name WWW_HOME. You should define this to be the full address of the document which you want to be displayed when www is invoked without parameters. For example, $ DEFINE/SYSTEM WWW_HOME "file://myvax/sys$library/default.html" Note that the www address you must set it to is still in unix-like format (with slashes instead of :: : [.])Users may of course override the system logical name with their own. If no logical name is defined, the VMS browser will default to picking up the default page from our server, document http://info.cern.ch./default.html. The other customization variables may be defined in the same way. Accessing VMS files If you are making you own home page, or any other documentation, you will probably want to store it on your VMS machine. The www program has the ability, if running under VMS, to access VMS files. the document name for a VMS file is simply the filename, but: The host name must be the name of the machine WITHOUT any domain name on it, e.g. //vxcrna/ The filename is written with each punctuation converted into a single slash. Examples are Document identifier Filename file://vxcrna/sys$www_home vxcrna::sys$home Availability of .EXE files Versions are available for any of the following implementations of TCP/IP which you may have installed on your system: Digital's UCX, Wollongongs's WIN/TCP, or SRI's Multinet. If you are on the High Energy Physics DECnet, the versions are currently (Jan 92) available compiled in directories as follows: Wollongong WIN_TCP none - see recompiling . Multinet vxcrna::disk$oc1:[timbl.www.multinet.works] Digital's UCX vxcrna::disk$oc1:[timbl.www.ucx.works] CMU TCP none - see recompiling . If you are not on HEPnet, but can pick up binary files from info.cern.ch using FTP, then you will find executables in the /pub/www/bin/vms, as files www_ucx.exe or www_multinet.exe. Remember to transfer in binary mode. Pick one and rename it to www.exe Installation_VMS -- /LineMode (98/97) The host name must be the name of the machine WITHOUT any domain name on it, e.g. //vxcrna/ The filename is written with each punctuation converted into a single slash. Examples are Document identifier Filename file://vxcrna/sys$www_home vxcrna::sys$home Availability of .EXE files Versions are available for any of the following implementations of TCP/IP which you may have installed on your system: Digital's UCX, Wollongongs's WIN/TCP, or SRI's Multinet. If you are on the High Energy Physics DECnet, the versions are currently (Jan 92) available compiled in directories as follows: Wollongong WIN_TCP none - see recompiling . Multinet vxcrna::disk$oc1:[timbl.www.multinet.works] Digital's UCX vxcrna::disk$oc1:[timbl.www.ucx.works] CMU TCP none - see recompiling . If you are not on HEPnet, but can pick up binary files from info.cern.ch using FTP, then you will find executables in the /pub/www/bin/vms, as files www_ucx.exe or www_multinet.exe. Remember to transfer in binary mode. Pick one and rename it to www.exe Rebuilding from source You may have to do this if your sharable libraries are not compatible with those for which the .EXE file was built. If there is a version incompatability, then you get an explicit message about sharable library versions when you try to run www. If you have utilities for uncompressing and untarring the main source file, then you could remake the distribution from source. Another way of getting the sources up can be used if you happen to have access to an untrix machine on the same DECnet as your vax. FTP the source tar file over to the ultrix machine, uncompress it and untar it, then copy over the descrip.mms in LineMode/Implementation/vms. In there you'll find all the commands to copy the sources from a unix machine (PRIAM:: in that instance -- you'll have to edit it) and rebuild the .exe. When you remake the exe, you must specifify MMS/MACRO=(MULTINET=1) or MMS/MACRO=(WIN_TCP=1) or MMS/MACRO=(UCX=1) to get the right version for Multinet, Wollongong TCP or DEC/UCX respectively. Tim BL [End] Installation_VMS_NewTCP -- /Defaults RECOMPILING FOR VMS This is how to get the sources for www and recompile them. You need to do this if you have a shareable library incompatibility with the distributed executable. The tar file is, on info.cern.ch, /pub/www/src/WWWLineMode_v.vv.tar.Z, v.vv being the version - get the latest. If you are on the HEP DECnet, then the files can be found under vxcrna::disk$oc1:[timbl.www.*] Changing to a new TCP/IP version Do this bit if your TCP/IP system is not SRI/Multinet, DEC/UCX or whatever they call it now, or Wollongong TCP/IP. You might need to change something in tcp.h which is the system specific include file, and in descrip.mms, the makefile. If you do, please mail me the changes. Look for all occurences of "MULTINET", "UCX" or "WIN_TCP" and add a "CMU_TEK" or whatever where necessary. The same goes for decsrip.mms. This will need to pass the CMU_TEK option onto the c compiler in the CFLAGS macro, and also use different libraries for the link. Changes to other files will probably not be necessary. [The program uses the socket library in a very standard way - no tricks. You just have to get the include files from the right place and fix the macros for NETREAD etc to whatever CMU-TEK calls the socket read() function. It can't call it read() because that's in the VMS unix library already for file access. You notice that under some systems the read does a socket_read or a real read depending on whether the socket number is small (unix) or large (VMS channel=socket). I don't know what CMU-TEK does but I'm interested to know If you don't know either, try compiling for say WIN_TCP and see what's undefined and mail me] If you do this, let me know how you get on, please! Compiling One way, if you have a unix (sultrix?) system with DECnet is to unwrap the tar file on that system. Then copy WWW/LineMode/Implementation/vms/descrip.mms across to VMS. Edit descrip.mms so that all the references to $(U)"/userd/tbl/hypertext are changed to point to the decnet address of the files you have unwrapped on the unix system. Then run mms with /macro=(u=HOST::, cmu_tek=1) -- whatever your unix HOST is -- and it will pickup all the files from your unix system. The other way is to uncompress/untar it on under VMS, if you have a tool to do that, and just run mms/macro=(cmu_tek=1). Tim BL [End] Distribution -- /LineMode GETTING THE WWW FILES Read this if you have not yet got the WWW files you need, and you cannot NFS mount a directory on which they reside. The source and binary of CERN WWW project files are currently available (see copyright ) by anonymous FTP from node info.cern.ch. This node is currently 128.141.201.74 but THIS MAY CHANGE. The files are compressed tape archive files (.tar.Z). To get a file using anonymous FTP, use user name "anonymous", and your email address as a password:- > ftp info.cern.ch Enter user name: anonymous Password: me@myhost.edu ftp> cd /pub/www/src ftp> binary ftp> get WWWLineMode_vvv.tar.Z ftp> quit > The file name will depend on the product you want. Here vvv is the version number of the software. Once you have the compressed tar file, you must uncompress it and unwrap it. uncompress WWWLineMode_vvv.tar.Z This will make a rather larger file with the name without the ".Z". To unwrap it, tar xvf WWWLineMode_vvv.tar Now you should install the line mode browser , install the server , install Viola , etc. Tim BL [End] Porting -- /LineMode PORTING TO A NEW MACHINE Read this secion if the browser has not already been ported to a binary-compatible machine.We assume you have a unix-like environment, including some sort of C (either Kernigan and Ritchie or ANSI) compiler, and a socket library supporting TCP/IP communications. The browser has been ported to many systems, and so you should not have much trouble with a new one. Make a new subdirectory under WWW/LineMode for your combination of machine and operating system. Copy the Makefile from another (similar) machine's subdirectory. Modify the Makefile as necessary to compile and install on your system. This involves selecting the compiler command, flags, etc, to be used, and specifying directory names. See the file Implementation/CommonMakefile which is included in the Makefile. Type "make" to generate an executable file. Mail the Makefile, and any other changes you found were necessary, back to us for the use of others. This is mandatory Now install the software . Tim BL [End] MachineTypes -- /Defaults MACHINE TYPES The W3 code is distributed with machine-specific files for certain platforms. Binaries, where they exists, are in subdirectories of the /pub/www/bin distribution directory. Machine-specific Makefiles and other sources are in subdirectories of the Implementation (src) directory for a product. The subdirectory names are as follows. Please consider all trademarks to be acknowledged as such. apollo_m68k Apollo unix machines based on the M680x0 series CPU. (i.e. not HP snake) decstation Digital DECstations. (MIPS-based workstations) mac The Macintosh range from Apple. next NeXT -- all machines (non-RISC) pc-nfs IBM-PC compatible, with socket library from the PC-NFS product. rs6000 IBM's rs6000 range of AIX workstations sgi Silicon Graphics Inc's workstations. snake HP700 and HP800 series. sun3 The sun-3 (M68k based) series of workstations. sun4 The sun4 (RISC) series of worksations. vax_ultrix VAX machines running ultix for which gcc exists. vax_ultrix_cc VAX machines tunning ultrix, using the native cc compiler. vms The VMS operating system for DEC's VAX range. unix Generic unix source: if your machine is not listed, check these Makefiles for necessary changes fro yoru system then run them. If you need to make changes please mail back the new file to www-bug@info.cern.ch for inclusions in future releases. Tim BL [End] InstallNotSU -- /Defaults INSTALLING WWW IF YOU ARE NOT SUPERUSER So you want to install www, but you do not have the privilege to become super-user. No problem: you can install it for your own use. You have found (or built if it did not exist ) a subdirectory of WWW/LineMode/Implementation for your type of machine. You have modified the Makefile in that directory to reflect the directory name. Don't worry about BINDIR, the name of the installation directory, because you aren't making a system-wide installation. Type make This should generate the executable file called "www". There are two ways you can make this available. One is, if in your " path " there is a directory to wrich you do have write access, then you put move www into that directory. You may have to then "rehash" to regenerate the list of commands. If there isn't a writable directory on your path, then you can put an alias command into a login shell script (.login or .cshrc) to define www as being a file in the directory where it is. Now if you run www it will complain that it can't find the default home page, /usr/local/bin/WWW/default.html. You will find a copy of a default page in the distribution WWW/LineMode/Defaults/default.html. In your login shell script , set the environment variable WWW_HOME to the full pathname of default.html as distributed, or to the w3 address of the copy on our server. See customization about how to set environment variables. Tim BL [End] Path -- /Defaults UNIX "PATH" This is the set of directories which the system looks in for executable files. You can find out what your path is by the command echo $path Normally the path is set by a command in your login shell script . Remember that if you change your path, then you must type rehash so that the shell rebuilds the set of executable files which it will accept as commands. Tim BL [End] LoginScript -- /Defaults YOUR LOGIN SCRIPT Under unix, when you start your shell, a login script is executed. Use the manual page for your shell to find out more about this. If you are using csh, then files .login and .cshrc in your home directory are both executed. [Remember that ls -a displays also filenames which start with a dot, whereas ls normally hides them...] [End] Customizing WWW line mode browser operation CUSTOMIZING WWW Customizing www 's behaviour is done with environment variables or their equivalent. " Environment variable " is a unix term. On VMS you should use a logical name . Under VM/CMS use a global variable . You can also customise www by defining your own "www" command to invoke www with certain command line options set, such as the page length. See also how to make shortcut commands (aliases) , and how to set up gateways. A list of things you can customize with environment variables (or local equivalents) are as follows:- WWW_HOME The address of the first document to start with if you run www without a document name on the command line. For example, you can set it to http://info.cern.ch/hypertext/WWW/LineMode/Defaults/default.html if you want to always use the home page on the CERN information server. As the line mode browser is installed, it comes with a default copy of that home page, frozen at the time when the distribution was made. That page has (right at the bottom) a link back to the current version on our server. If you are installing www without privileges, you may not be able to install the home page, and so you will have to set WWW_HOME to point to a local copy of the file, or to our server. You can customize www to start at a page of your choice. You can write your own page, or use someone else's. All you have to do is to set the environment variable WWW_HOME to the www address of your preferred home page. (When you are using www, you can see what an address looks like by typing help when you are reading a document - it tells you the address of that node). WWW_CONFIG If defined, must be the name of a local file which contains configuration information including rules, presentation recipes, etc. If configuration files are also specified using the -r option, they are loaded first. NNTPSERVER See how to set up the news server's address . WWW_PRINT_COMMAND Unix only. A quoted printf-style format string for the system command you wish to invoke with the www PRINT command. This should contain one %s marker where www should put the name of the document to be printed. The default is www -n -na -p66 '%s' | lpr (The single quotes around the %s are necessary in case the address contains shell metacharacters. When you define this variable, you may of course have to enclose the whole thing in double quotes, e.g. Customizing WWW line mode browser operation (70/70) " Environment variable " is a unix term. On VMS you should use a logical name . Under VM/CMS use a global variable . You can also customise www by defining your own "www" command to invoke www with certain command line options set, such as the page length. See also how to make shortcut commands (aliases) , and how to set up gateways. A list of things you can customize with environment variables (or local equivalents) are as follows:- WWW_HOME The address of the first document to start with if you run www without a document name on the command line. For example, you can set it to http://info.cern.ch/hypertext/WWW/LineMode/Defaults/default.html if you want to always use the home page on the CERN information server. As the line mode browser is installed, it comes with a default copy of that home page, frozen at the time when the distribution was made. That page has (right at the bottom) a link back to the current version on our server. If you are installing www without privileges, you may not be able to install the home page, and so you will have to set WWW_HOME to point to a local copy of the file, or to our server. You can customize www to start at a page of your choice. You can write your own page, or use someone else's. All you have to do is to set the environment variable WWW_HOME to the www address of your preferred home page. (When you are using www, you can see what an address looks like by typing help when you are reading a document - it tells you the address of that node). WWW_CONFIG If defined, must be the name of a local file which contains configuration information including rules, presentation recipes, etc. If configuration files are also specified using the -r option, they are loaded first. NNTPSERVER See how to set up the news server's address . WWW_PRINT_COMMAND Unix only. A quoted printf-style format string for the system command you wish to invoke with the www PRINT command. This should contain one %s marker where www should put the name of the document to be printed. The default is www -n -na -p66 '%s' | lpr (The single quotes around the %s are necessary in case the address contains shell metacharacters. When you define this variable, you may of course have to enclose the whole thing in double quotes, e.g. setenv WWW_PRINT_COMMAND "www -n -na -p66 '%s' | lpr" Tim BL EnvVariables -- /Defaults ENVIRONMENT VARIABALES Under unix, environment variables are used to pass information to programs to modify how they should run. They are used for customizing www for a particular user's requirements. See also: VMS logical names, VM/CMS globalv. [End] GlobalV -- /Defaults GLOBAL VARIABLES UNDER VM/CMS (These are the equivalent of environment variables under unix.) A particular GLOBALV table (CENV) is used to hold the C environment. The command to set a variable VVVV to a value XXXX is GLOBALV SELECT CENV SET VVVV XXXX for example GLOBALV SELECT CENV SET WWW_HOME http://info.cern.ch/junk.html Beware of the fact that CMS puts everything into upper case. It is not obvious how to get around this problem without writing a little REXX exec to do what you want. [End] NewsServer -- /Defaults NEWS SERVER ADDRESS To be able to read news, the www program needs the address of a news server. This is a machine which runs the NNTP protocol. If you already use internet news on your site, you will have one of these. There are several ways you can tell www which news server to use. Note you may also have your machine enabled as being authorised to pick up news from the news server by that server's system manager. Exception On a NeXT The NeXT defaults are read, looking for a value for "NewsHost" for application name "WorldWideWeb", then for a global default, then for application named "News". All other cases SET AN ENVIRONMENT VARIABLE You can set the environment variable NNTPSERVER to be the internet address of the server. You can do this in your .login file. (On VMS, use a logical name, on VM/CMS, the CENV globalv table). USE A FILE The file /usr/local/lib/rn/server will be read if it exists and no environment variable is defined. It should contain the single line containing the name of the news server. This filename may be overridden at compile time by defining the SERVER_FILE symbol to be the quoted string. AT COMPILE TIME If you are installing www for several people, you can set the default by defining the variable DEFAULT_NEWS_HOST to be the quoted string of the server name on the command line fo the compilation of the HTNews.c module For example, use the option (check your own compiler's command line syntax) -DDEFAULT_NEWS_HOST="mynewshost.domain" USE A DOMAIN NAME ALIAS If no other deafult news host is found, the software looks for a machine with name or alias "news" in the local domain. If your domain has a single news server which you would like to use as a default, and the person in charge of the domain name registration agrees, then make an alias "news" for the server. This will have the managemnt advantage that the administration can move the news server without any trouble later. (This is the way it is done at CERN). Tim BL [End] Line Mode Browser bugs BUGS, AND IMPROVEMENTS NEEDED The following are known bugs in the line-mode browser , and improvements which we have in mind. See also the list of features added. Known Bugs Spacing is not very intelligent around anchors. Save to file, print, etc. Don't use systm(), just set up a stream. Will then work on VMS too. Judy Nicholls nicholls@fnal.gov Telnet problem: If one visits a telnet node and then revisits it, an empty page is displayed. When saving a file with ">", should ask confirmation if the file already exists. Improvements for the near future Paragraph numbering option (Gene Oleynik, Oleynik@fndaut.fnal.gov) for long documents or serialisations. Style sheet load from disk. A command line option to print out the version of the software. Currently one has to start it and type "help". (--JP Matheys) While connecting, if timeout is long, how can we make it less painful for the user -- if necessary in a non-portable way? Variation of "Connect" whih displays a message? Allow user to quit or keep trying? Change the underlying timeout? Should we always put a CR/LF after the prompt, to allow a long list of keywords (Peter Dobberstein and DESY colleagues: yes)? Advantage: one can always type in many keywords. Disadvantage: one less line of text on the screen. The NEWLINE_PROMPT compile switch lets you choose. Better error reporting. Difficult when many possible paths have been tried. Save log of attempts? Portability of error message generation? Command: Append to a given file a hypertext reference to the document. In UNIX a document address given as a command line argument is parsed relative to the current directory. A similar thing needs to be applied for VMS and MVS environments. Keep all anchor information, in case user returns to a previous node, then the information is automatically available. Try to use ^z key and predefined keys like F10 to exit from the program under VMS. Ask user about strange formats. Unable to deal with anything other than HTML and plaintext files (now just displays it as plaintext). Offer to display it as plaintext, store the file somewhere, or print out on a default printer. Create a new tag and . Line Mode Browser bugs (129/135) These are placed around a paragraph and effects any headings contained within them, removing all blank lines above and below, and not allowing capitalization. Also, maybe use this tag to indicate that the position of the anchors should be at the start of the line, in front of the sensitive text. Compare LineMode Parser and the NeXT Parser, and produce with a common module that can be used by both browsers, and maybe for the Mac version aswell. Also will provide access to the Internet News. Other Improvements Pick up the size of a file before trying to store in a buffer. If too large only read in part of the file, and then only call up the file again if the user requires more data. For example in the case of 'http://crnvmc/FIND/DESY?NNEWS8' and then reference number [3]. If the user needs to print out documents when following links, instead of inserting anchor numbers, insert page numbers of the destination nodes, as they would appear in the printed document. Do this by first following the links with no output on the screen, reading all the files into the buffer and calculating the page numbers. Then go through the path again, with output directed to the printer, inserting the correspondng page numbers rather than the anchor numbers. Apply glossary first line indent code to produce ordered lists. Deal with lists within lists. At the end of a document, produce the last page if the user presses return. Put some form of paging into reference and recall lists. Offer a no blank line spacing option. User defined style sheet? Use cursor functions (termcap or curses). Add a search facility within the document for when a long document is returned. -- jackson@stsci.edu Change code to look like a 'more' or 'less' program. Public copies of this program may be available from Antonio Pastore or Roberto Divia. Offer some kind of editing of the style sheet to the user. Users Comments Highlight headings. Maybe move anchor numbers to the left hand side, rather than after the sensitive text. (Not really a good idea with VMNEWS or YELLOW PAGES because the anchors will be next to other numbers and may look confusing). If numbers are going to be left justified and the anchor text is in a heading, maybe rewrite the HTML as follows to indicate the change in the position of the anchor numbers. Where we use now

......

we could use

.....

. In YELLOW PAGES, when looking to find out more details of a number of a person by selecting the anchor, the number does not go through with it. Maybe invent a new tag which tells the parser to take the sensitive text through with it to the top of the next document or maybe Bernd should change the files. Be careful of keyword searches inside FIND as they can be confusing as to whether the search is the whole of FIND or just a sub-section of it. Features added to www line-mode browser FEATURES ADDED Improvements made to the line-mode browser are listed in reverse chronological order. (See also the bug list ). Note: Many changes to this product stem directly from changes tothe common code, and are documented in the common code change list . 2.13 This release of the Line Mode Browser is mainly a debugged version that is brought up to date with the WWW library version 2.15. For the changes in the Client side of the Library, see Changes to W3 Common Library. See also existing commands and command line syntax. Using the save function ">" now checks if file exists. Use "!>" to overwrite it. All save functions now put up an output stream instead of making a system call. The -from command line option can be used in filter mode (using a "-") in order to specify the input format. In Non-interactive mode, no third party programs are called through "save & execute". If the Browser finds gets an unknown format, the result is put onto standard output. 2.10 Millions of things which seem to have slipped past this list in versions 2.x to s.09, inclduing the rule file, firing off X applications for graphics files, etc etc. See the library change list. 1.4a REFRESH command refreshes current document 11 Dec 92: 1.4 -version command line option included . Compiled for many machines with library version 1.1 . Dec 92 1.3c Makefile for rs6000 fixed. (rs6000 cc does not have good -o flag). Binary available for rs6000 again. -version option on command line for quick version check 16 Oct 92: Version 1.3a SOURCE command prefix allows printing, pipiping etc postscript source without formatting. SOURCE PRINT prints a postscript file. SOURCE > allows the original source to be saved. -listrefs option allow noninteractive output to be followed by lists of addresses of documents referred to. MANUAL command takes a hypertext jump straight to the latest version of the online manual. (HELP is still local slightly context-sensitive help). Oct 92 version 1.2l Features added to www line-mode browser (129/424) Bug in Gopher access removed. Now uses common code library version 1.2k Default port number changed to 80 ****. 18 May 92 version 1.2h PS command added to print document on local printer attached to a terminal. Special compilation flag SLAVE_PRINTER. BUG FIX: Crashes on some machines only fixed (malloc length error on HTTP.c.) version 1.2f Bug fix: telnet under unix: -l option was put AFTER the host name. Fixed 27-Mar-92. Version 1.2e New command: 'Verbose' toggles verbose mode on/off as per '-v' command switch. New command: for Unix, 'cd' or 'lcd' changes the local working directory (as in FTP clients). Command input handled more efficiently. Should use readline() in the future, with completion on anchor names.. Some minor bug fixes. Version 1.2d COMMENT tag introduced for future use only. Speed improvement: Use of a hash table for document names improves load time especially of documents with many links. Version 1.2c Bug fix: unknown tags without attributes caused text to be skipped until the end of the next tag. This lead to missing information (like phone numbers! ) in CERN yellow pages listing and a strange format for the xfind server. Version 1.2b Release includes a few strict C bug fixes for the Mac, and adds makefile for pc-nfs. Version 1.2a Feature: the -source option makes www load the unparsed source from HTML servers. See details ... Tags MENU and DIR introduced for future use. Bug fix: The style was not set until a style change occured: therefore, formatting of any text before a heading etc was wrong (no paragraph spacing, indents, etc). Bug fix: Newlines in HTML source are not taken as blanks if they follow other white space. This caused initial blanks on some paragraphs when a newline followed a tag. Feb 12 1992: Version 1.2 Binaries generated for unix and vms hosts, for general announcement. Code fixes for compilation on the various platforms. Version 1.1c www can be used as a filter: The - option (a dash by itself) makes it take HTML data from stdin. See details FTP directories contain pointers back to their parent directory. Bug fix: News access didn't work on little-endian machines (VAX etc). Bug fix: VMS descrip.mms file was not complete. Version 1.1b Bug fix: when using the ">" and "|" commands in www on a document whose name contained shell metacharacters, it failed. Bug fix: HTBrowse.h missing from source release. Version 1.1a Bug fix: news server address always taken as "cernvax" : see documentation January 1992 Version 1.1 "Gopher" protocol added to allow access to those campus-wide systems using that protocol. "Telnet:" access added for information system which don't have a server at all; Allows gateways to be defined for arbitrary new (or old) naming schemes, eg setenv WWW_wais_GATEWAY //node:port/ Bug fixes: the -n option didn't work properly in v1.0 Version 1.0 (released as alpha test only) New archiecture, more modularity. "News" access added: picks up news using NNTP as the NeXT W3 browser does. Forward and reverse scrolling. "Next" and "Previous" commands added to allow to move to next article in a list. Bug fix: Searches are now only allowed on indexes. Version 14a Logfile option -l, and -h allows remote usage to be logged. (Existed in version 14, but bug in that log file was all one line!) If telnet used, default logfile /usr/adm/www-log- is used even though no -l logfileroot is specified. November 1991 version 0.14 The `Recall' command now displays references as `R 1', `R 2', etc. instead of just `1', `2', etc. so the user is reminded to type `R '. An out-of-range reference number will launch a keyword search if applicable. For instance, in the phone book, you can now type directly `3755' instead of `K 3755'. New command : `(G)OTO
' jumps to the document specified by its hypertext address. The address may be absolute or relative to the current node. Clear screen after user input for NEWLIB and VM. NEWLIB-special source put in. VM version defaults to home page on //info.cern.ch. Entity handling ., . and . put in for text and TITLE fields. Bug fix: CR now ignored in remote FTP files which used to be displayed double-spaced. Bug fix: tabs in plain text were displayed as newlines! Now to next multiple of 8 columns. version 0.12 -a xxx option now allows the anchor format to be specified. The old -a option for anchor supression is renamed -na. Bug fix: occasional crash when going "back". Bug fix with the -n command line option. In non interactive mode the prompt was still produced. Now treats '\r' characters as '\n' characters. Reproduces last line of page at the top of the next page if a paragraph is split between them. Bug fix in FTP handling as for NeXTStep editor . (Could not access some sites). HTTP host addresses may now contain a port number after a colon to override the default. 15 August 1991 version 0.11 You can read the address of the current document in the HELP information. MVS and VM only: Line width reduced to 78 characters. July 91 version 0.10 Bug fix for TOP commmand. Now functions correctly, and data is only buffered and formatted when the user requires more text, hence saving time. Can pick up on the users home environment, to display a certain intial page. Set variable (on VMS, logical name) WWW_HOME to the full hypertext of the file or index you want to start with. Features added to www line-mode browser (322/424) Keyword search accepts longer strings. On VMS, VMS files may be accessed. The WWW address is still unix-like, with slashes, and is converted into VMS syntax by the browser. VMS users can now write their own hypertext and keep it on VMS, though it will only be readable (at the moment) from VMS machines. June 91 version 0.9 Bug fix in anonymous FTP. The first version with a-ftp access. 24 May 91 version 0.8 Page size selection now works with -p (bug in version 0.7) Styles have been made more compact, plain text uses all 80 columns. Bug fix: Missing loop end condidtion caused crash when listing some documents Files with suffixes other than .HTML are treated as plain text. 21 May 91 version 0.7 Parameters avaliable on the command line :- -v Shows trace comments, including the pathways taken to locate a file. -n Makes the program non interactive with the user. No prompts are shown, and after the node is displayed it exits the program -p Turns off the paging. The page size can be selected by adding the value immediately after the 'p'. -a Stops positions of anchors being shown in the text. These options are particulary useful when redirecting the input into either a file or to the printer. They can also be used in any order on the command line, as long as 'WWW' is the first arguement. When the recall command is used to view what files have been visited, the titles of the files are used, rather than the file name. If there is no title then the file name is used. 14 May 91 The function HTOpen() called from HTAccess has been changed so that it takes two parameters instead of one. This extra one being a pointer to an address where the format style is stored as an integer. The translations of the integers to the formats can be seen in WWW.h. At the momment this extra parameter is not used but will be in the near future so that more files can be accessed. 10 May 91 WWW now reads the formatted text into a double linked buffer one screen full at a time and then produces it on the screen. This enables checking of documents so that splitting of small paragraphs or titles does not occur at the bottom of the screen. An option is offered to return to the top of the present document being viewed. Features added to www line-mode browser (387/424) Tim added the necessary code so that WWW can now access remote files using anonymous FTP. 17 April 91 Modified WWW so that it is also executable on the SUN machines., i.e. using ordinary C. First version realeased on PRIAM, for testing by a few users, to gain feedback. Accepts keywords with the execute command. 8 April 91 Keywords can be entered on the command line. The input file is copied into a buffer as soon as it is opened, so that the input channel is closed as soon as possible and the server freed. The first 23 lines of the document are read into the buffer and produced onto the screen. As soon as this is done, the remaining file is read into the buffer so the input channel is closed. 7 March 91 Created an array called 'string_space' which is filled with blank spaces to be used for printing out margins etc. This method of printing a string was found to be faster than individually printing spaces. A history mechanism has been included so that a list of all the documents viewed are stored so that the user can refer back to them using the BACK, HOME and RECALL commands. Changed code so that the browser can handle text which contains long words which exceed the allowed line length on their own. This is just done by continuing the word on the following line. Read titles and headings into a buffer before outputting so that in cases where the title has a word longer than the allowed line length can be dealt with (for example above).This could also be useful in helping to solve the above problem. Maybe extend the length of headings. 5 March 91 Handles a "LISTING" tag by treating it in the same way as an "XMP" tag. This is because, in the case of the line mode browser, the screen is limited to 80 columns and so the browser is unable to work with the 132 columns which the "LISTING" tag normally expects. Handles an "ADDRESS" tag, which left justifies the text. 27 Feb 91 Lists and the help menu are not so spread out, as before. The browser works with file numbers rather than the file pointers. Tidied up paging, with the last line of a page repeated at top of next. Deals with tags within anchors. 11 Feb 91 HTTP access to cernvm server, including FIND and NEWS tested. Browser can be executed by 'WWW' , 'YP' (yellow pages), 'XNEWS', or 'FIND'. "PLAINTEXT" tag added. Prints out the node exactly as it finds it in the file. Prompt only contains appropriate options, as does the help message. Keyword search option added. Before Feb 91 Text formatting and line wrapping completed to a reasonable standard. Removed section of program where 'r' has to be entered in order to select a reference. When no hypertext references have been found, the browser informs the user, and doesn't offer the list option in the help menu. Produces an error message if the user tries to select a reference or menu, when no references have been found. Records whether an anchor is a NAME or an HREF. Stop **** END **** (now [End]) appearing in the wrong places. This problem appears due to the lines in the html file being too long, so this causes an error in the 'C' run time. Handles a glossary. __________________________________________________________ Nicola P , Tim BL , JFG lain text were displayed as newlines! Now to next multiple of 8 columns. version 0.12 -a xxx option now allows the anchor format to be specified. The old -a option for anchor supression is renamed -na. Bug fix: occasional crash when going "back". Bug fix with the -n command line option. In non interactive mode theWWW/LineMode/Defaults/Makefile 664 472 105 2177 5457247200 11535 # Make FTP-able default page - Distribution use only # HTEXT = Bugs.html CommandLine.html Commands.html \ Customisation.html Distribution.html EnvVariables.html \ Features.html GlobalV.html InstallNotSU.html \ Installation.html Installation_VMS.html LoginScript.html \ NewsServer.html Path.html \ Porting.html QuickGuide.html Shortcuts.html \ VMS_Shortcuts.html default.html \ cern.html REF = /pub/www/default.html TAR = /pub/www/WWWLineModeDefaults.tar all : $(TAR).Z $(REF) @ echo Default pages updated $(TAR).Z : $(HTEXT) tar -cvf $(TAR) $(HTEXT) compress $(TAR) $(REF) : default.html clean cp *.html /usr/local/lib/WWW cp default.html $(REF) # Do this on info, asis01, www1, dxcern and on other master cern servers cern : clean /usr/local/lib/WWW/default.html /usr/local/lib/WWW/default.html : cern.html cp *.html /usr/local/lib/WWW dxcern : cp cern.html /usr/local/lib/WWW/default.html asis : cp cern.html /usr/local/lib/WWW/default.html # Note name mapping is done by the httpd.conf file so no ln -s # ln -s /usr/local/lib/WWW/cern.html /usr/local/lib/WWW/default.html clean : -rm ,* *~ Records whether an anchor is a NAME or an HREF. Stop **** END **** (now [End]) appearing in the wrong places. This problem appears due to the lines in the html file being too long, so this causes an error in the 'C' run time. Handles a glossary. __________________________________________________________ WWW/LineMode/OldImplementation/Makefile 777 472 105 0 5506014172 22573 2../../All/Implementation/Makefile.productWWW/LineMode/apollo_m68k/Makefile 664 472 105 1326 5301701302 12076 # Make WWW for apollo NOTE WWW macro changed for unwritable source tree ** # # For W3 distribution, machine type for subdirectories WWW_MACH = apollo_m68k # For ASIS installation, the ASIS code for the machine/os ASIS_MACH = apollo-68k/sr-10.3 CFLAGS = -g -DDEBUG LFLAGS = CC = cc LFLAGS = # Directory for installed binary: BINDIR = /usr/local/bin #_________________ OK if normal W3 distribution # Where is the WWW source root? #WWW = ../../.. WWW = /user/timbl/hypertext/WWW # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? # LIBDIR = $(WWW)/Library/Implementation/$(WWW_MACH) LIBDIR = /tmp/WWWLibrary_Build include $(WWW)/LineMode/Implementation/CommonMakefile eLog”€Upgrade_3.0.app¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/decstation/Makefile 664 472 105 1015 5342763743 12121 # Make WWW line mode browser under unix for decstation ultrix # # MAchine type for distribution: ASIS_MACH = dec-station/ultrix-4.2 WWW_MACH = decstation # Directory for installed binary: BINDIR = /usr/local/bin CFLAGS = -Wall -g CC = gcc #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile index….xinitrc† .xserverrc‡.mwmrcˆ.twmrc‰ .XdefaultsK¤NextToureÎ Mailboxes´tempŠnm.opôJLibrary UpgradeLog”€Upgrade_3.0.app¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/next-386/Makefile 777 472 105 0 5526204211 20440 2../../All/Implementation/Makefile.productWWW/LineMode/next/Makefile 777 0 0 0 5506014076 20005 2../../All/Implementation/Makefile.productWWW/LineMode/rs6000/Makefile 664 472 105 1440 5301701176 10703 # Make WWW under unix for rs6000 with no gcc # # For W3 distribution, machine type for subdirectories WWW_MACH = rs6000 # For ASIS ASIS_MACH = ibm-rs6000/aix-3.2 # Directory for installed binary: BINDIR = /usr/local/bin # The AIX compiler does not define unix... AIX will do it and avoid realloc bug # CFLAGS = -I$(CMN) -I$(LM) -DDEBUG -DAIX CFLAGS = -I$(CMN) -I$(LM) -g -DDEBUG -DAIX # LFLAGS = -lresolv CC = cc #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? Was /tmp but -o doesn't # work on the CC on this machine, so object files must be in this directory! WTMP = $(WWW) # Where is the W3 object library if installed? LIBDIR = /usr/lib/www include $(WWW)/LineMode/Implementation/CommonMakefile rep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/sgi/Makefile 664 472 105 1145 5301701305 10527 # Make WWW for Silicon Graphics # # For W3 distribution, machine type for subdirectories WWW_MACH = sgi # Architecutre in ASIS scheme ASIS_MACH = sgi/iris-3.5 CFLAGS = -I$(CMN) -I$(LM) -DDEBUG #CFLAGS = -I$(CMN) -I$(LM) -Wall -g -DDEBUG CC = cc #LFLAGS = -lresolv LFLAGS = # Directory for installed binary: BINDIR = /usr/local/bin #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile XdefaultsK¤NextToureÎ Mailboxes´tempŠnm.opôJLibrary UpgradeLog”€Upgrade_3.0.app¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/snake/Makefile 777 472 105 0 5506014122 20243 2../../All/Implementation/Makefile.productWWW/LineMode/sun3/Makefile 664 472 105 1277 5301701306 10644 # Make WWW under unix for sun 3 # # For W3 distribution, machine type for subdirectories WWW_MACH = sun3 # For ASIS installation, the ASIS code for the machine/os ASIS_MACH = sun-3/sunos-4.1.1 # Directory for installed binary: BINDIR = /usr/local/bin CFLAGS = -I$(CMN) -I$(LM) -DDEBUG #CFLAGS = -I$(CMN) -I$(LM) -g -DDEBUG #LFLAGS = -lresolv LFLAGS = CC = cc # Directory for installed binary: BINDIR = /usr/local/bin #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile Library UpgradeLog”€Upgrade_3.0.app¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/sun4-sol2/Makefile 664 27367 105 21431 5525737351 11631 # Make WWW under unix for solaris 2.2 # # For W3 distribution, machine type for subdirectories WWW_MACH = sun4-sol2 # The ASIS repository's name for the machine we are on ASIS_MACH = sun-4 # Not important - changing all the time! CFLAGS = -DUSE_DIRENT -D__svr4__ -DNGROUPS=NGROUPS_MAX -Dd_namlen=d_reclen -DNO_GETWD -DHAS_GETCWD -DPOSIXWAIT # Ask for static linking so that binary will be transportable LFLAGS = -lresolv -lnsl -lsocket -ldl -Bstatic CC = cc # Directory for installed binary: # BINDIR = /opt/bin BINDIR = /usr/local/bin #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /usr/tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/Implementation/$(WWW_MACH):/usr/lib # Makefile for WorldWideWeb Line Mode browser (www) # # (c) CERN 1990, 1991 -- see Copyright.html for conditions # # This file should be invariant between systems. # DEPENDENCIES NOT COMPLETE @@ # # make Compile and link the software (private version) # make install Copy it into the system (implies make) # make update Copy installed version into installed version # make uninstall Unlink installed version from the system # make clean Remove intermediate files # make cleanall Remove intremediate files and products # # Macros required to be defined already for make: # # CC The C compiler # CFLAGS Flags for $(CC) # LFLAGS Flags for ld # WWW Root of WWW source tree # USELIBDIR Directory in which libwww.a should be found # # Macros needed for make install: # # BINDIR Directory for installed binary #______________________________________________________________________ # If this env var is set to something else Some makes will use that instead SHELL = /bin/sh # If this is actually run in a subdirectory. # # WWW = ../../.. # If it is run in this directory: # # WWW = ../.. For [cernlib] build in this directory LM = $(WWW)/LineMode/Implementation/ LMD = $(WWW)/LineMode/Defaults CMN = $(WWW)/Library/Implementation/ DEFAULTS = $(WWW)/LineMode/Defaults CFLAGS2 = $(CFLAGS) -I$(CMN) -I$(LM) CERNLIBBIN = $(WWW)/bin # WTMP is either WWW or /tmp for example. It allows the # machine-dependent files to be put in a separate tree so that # - The source tree can be read-only # - The source tree can be shared across platforms # USELIBDIR = $(WTMP)/Library/$(WWW_MACH) OBJ = $(WTMP)/LineMode/$(WWW_MACH) BIN = $(WWW)/LineMode/$(WWW_MACH) OE = $(OBJ)/.created WWWLIB = -L$(USELIBDIR) -lwww OBJS = $(OBJ)/HTBrowse.o $(OBJ)/GridText.o $(OBJ)/DefaultStyles.o # Final main product PROD = www SOURCES = $(LM)HTBrowse.c $(LM)HTBrowse.h \ $(LM)GridText.c $(LM)GridText.h \ $(LM)HTFont.h $(LM)Version.make\ $(LM)DefaultStyles.c $(LM)CommonMakefile SPECIFIC = \ $(LM)apollo_m68k/Makefile \ $(LM)decstation/Makefile \ $(LM)next/Makefile \ $(LM)pc-nfs/makefile \ $(LM)pc-nfs/README \ $(LM)pc-nfs/topc \ $(LM)rs6000/Makefile \ $(LM)sgi/Makefile \ $(LM)snake/Makefile \ $(LM)sun3/Makefile \ $(LM)sun4/Makefile \ $(LM)unix/Makefile \ $(LM)vax_ultrix/Makefile \ $(LM)vax_ultrix_cc/Makefile \ $(LM)vms/descrip.mms \ $(LM)vms/setup.com # Bug: This path, if relative, is taken relative to the directory # in which this makefile is, not the pwd. This screws up the # recursive invocation include $(ABS)$(LM)Version.make $(BIN)/$(PROD) : $(OBJS) $(USELIBDIR)/libwww.a $(CC) -o $(BIN)/$(PROD)_$(VL) $(OBJS) $(WWWLIB) $(WAISLIB) $(LFLAGS) -rm $(BIN)/$(PROD) ln -s $(PROD)_$(VL) $(BIN)/$(PROD) $(USELIBDIR)/libwww.a : @echo You must get and make the WWWLibrary product first! (cd $(WWW)/Library/$(WWW_MACH) && make) lib : (cd $(WWW)/Library/$(WWW_MACH) && make) inc : (cd $(WWW)/Library/Implementation && make inc) # Make a copy of the binary and documentation on this machine install : $(PROD) cp $(PROD) $(BINDIR)/$(PROD) - mkdir /usr/local - mkdir /usr/local/lib - mkdir /usr/local/lib/WWW cp $(DEFAULTS)/*.html /usr/local/lib/WWW # Link system to the binary and documentation in this tree link : Works/$(PROD) ln -s `pwd`/$(PROD) $(BINDIR)/$(PROD) - mkdir /usr/local - mkdir /usr/local/lib ln -s $(DEFAULTS) /usr/local/lib/WWW uninstall : rm $(BINDIR)/$(PROD) rm -r /usr/local/lib/WWW # Clean up everything generatable except final products # Including obj directory UNLESS there is anything else in it clean : rm $(OBJ)/.created $(OBJ)/*.o -rmdir $(OBJ) # Clean up everything generatable including final products cleanall : clean rm $(PROD) # Binary release # # Must be done on anonymous FTP server! # # This makefile does not knw how to make $(PROD)_$(VL) so that trying # to make binay or asis on a weird machine doesn't try to build $(PROD)! binary : $(PROD)_$(VL) -mkdir /pub/www/bin/$(WWW_MACH) cp $(PROD)_$(VL) /pub/www/bin/$(WWW_MACH)/$(PROD)_$(VL) # ASIS installation # ----------------- # Can only happen on an allocated ASIS development machine and # with uid of the controlling user for the project. # asis : /asis/share/usr.local/lib/WWW/default.html \ /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) touch asis echo ASIS distribution is now up-to-date. /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) : $(PROD)_$(VL) cp $(PROD)_$(VL) /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD)_$(VL) rm -f /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) ln -s $(PROD)_$(VL) \ /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) /asis/share/usr.local/lib/WWW/default.html : $(DEFAULTS)/cern.html - mkdir /asis/share/usr.local/lib/WWW cp $(DEFAULTS)/*.html /asis/share/usr.local/lib/WWW cp $(DEFAULTS)/cern.html /asis/share/usr.local/lib/WWW/default.html cp $(DEFAULTS)/default.html /asis/share/usr.local/lib/WWW/top.html # CERNLIB installation # -------------------- # Assuming the cernlib-style directory structure # Warning: Not suitable for machine-shared file structure. # cernlib : $(PROD) - mkdir $(CERNLIBBIN) cp $(PROD) $(CERNLIBBIN) #_________________________________________________________________________ # Compiling the Objects (Dependenies incomplete) # Check directory exists $(OE) : -mkdir $(WTMP) -mkdir $(WTMP)/LineMode -mkdir $(WTMP)/LineMode/$(WWW_MACH) touch $(OE) # $(OBJ)/HTBrowse.o : $(OE) $(LM)HTBrowse.c $(LM)GridText.h $(LM)Version.make \ $(CMN)HTUtils.h $(CMN)HTAccess.h $(CC) -c -o $@ $(CFLAGS2) -DVL=\"$(VL)\" $(LM)HTBrowse.c $(OBJ)/GridText.o : $(OE) $(LM)GridText.c $(LM)GridText.h\ $(CMN)HTAnchor.h $(CMN)HTStyle.h $(CC) -c -o $@ $(CFLAGS2) $(LM)GridText.c $(OBJ)/DefaultStyles.o : $(OE) $(LM)DefaultStyles.c $(CMN)HTStyle.h $(CC) -c -o $@ $(CFLAGS2) $(LM)DefaultStyles.c #_________________________________________________________________ # For W3 Administrative use only: # W3 Source + documentation release # --------------------------------- distribute : /pub/www/README.txt /pub/www/Copyright.txt (cd $(WWW)/.. && WWW=WWW ABS=`pwd`/ make $(MFLAGS) \ -f WWW/LineMode/Implementation/CommonMakefile \ /pub/www/src/WWWLineMode_$(VL).tar.Z) (cd ../Implementation; cvs tag \ `sed -e 's/V. = /v/' Version.make | sed -e 's?\.?/?'` ) echo Distribution of Line Mode version $(VC) up to date. # THIS MUST BE BUILT FROM THE DIRECTORY ABOVE WWW ! USE distribute above! /pub/www/src/WWWLineMode_$(VL).tar.Z : $(SOURCES) $(LMD)/line-mode-guide.txt tar cf /pub/www/src/WWWLineMode_$(VL).tar \ $(SOURCES) $(LMD)/line-mode-guide.txt \ $(WWW)/LineMode/*/Makefile \ $(WWW)/LineMode/vms/descrip.mms $(WWW)/LineMode/vms/build_multinet.com \ $(WWW)/LineMode/vms/setup.com compress /pub/www/src/WWWLineMode_$(VL).tar # Hypertext supplied in text format # --------------------------------- $(WWW)/README.txt : $(WWW)/../README.html www -n -p66 http://info.cern.ch/hypertext/README.html \ > $(WWW)/README.txt /pub/www/README.txt : $(WWW)/README.txt cp $(WWW)/README.txt /pub/www/README.txt $(WWW)/Copyright.txt : $(WWW)/../Copyright.html www -n -p66 http://info.cern.ch/hypertext/Copyright.html \ > $(WWW)/Copyright.txt /pub/www/Copyright.txt : $(WWW)/Copyright.txt cp $? $@ # Line Mode Manual # QUICKGUIDE = \ $(LMD)/QuickGuide.html \ $(LMD)/Commands.html \ $(LMD)/SourceExamples.html \ $(LMD)/CommandLine.html \ $(LMD)/Shortcuts.html \ $(LMD)/VMS_Shortcuts.html \ $(LMD)/Installation.html \ $(LMD)/Installation_VMS.html \ $(LMD)/Installation_VMS_NewTCP.html \ $(LMD)/Distribution.html \ $(LMD)/Porting.html \ $(LMD)/MachineTypes.html \ $(LMD)/InstallNotSU.html \ $(LMD)/Path.html \ $(LMD)/LoginScript.html \ $(LMD)/Customisation.html \ $(LMD)/EnvVariables.html \ $(LMD)/GlobalV.html \ $(LMD)/NewsServer.html \ $(LMD)/Bugs.html \ $(LMD)/Features.html doc : /pub/www/doc/line-mode-guide.txt echo line mode browser guide exists. /pub/www/doc/line-mode-guide.txt : $(LMD)/line-mode-guide.txt cp $? $@ $(LMD)/line-mode-guide.txt : $(QUICKGUIDE) -rm $@ for i in $(QUICKGUIDE) ; do www -n -na -p66 $$i >> $@; done d to be faster than individually printing spaces. A history mechanism has been included so that a list of all the documents viewed are stored so that the user can refer back to them using the BACK, HOME anWWW/LineMode/sun4/Makefile 664 472 105 1207 5312105157 10642 # Make WWW under unix for sun 4 # # For W3 distribution, machine type for subdirectories WWW_MACH = sun4 # The ASIS repository's name for the machine we are on ASIS_MACH = sun-4/sunos-4.1.1 CFLAGS = -I$(CMN) -I$(LM) -DDEBUG #CFLAGS = -I$(CMN) -I$(LM) -g -DDEBUG #LFLAGS = -lresolv LFLAGS = CC = cc # Directory for installed binary: BINDIR = /usr/local/bin #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /usr/tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile e for the machine we are on ASIS_MACH = sun-4/sunos-4.1.1 CFLAGS = -I$(CMN) -I$(LM) -DDEBUG #CFLAGS = -I$(CMN) -I$(LM) -g -DDEBUG #LFLAGS = -lresolv LFLAGS = CC = cc # Directory for installed binary: BINDIR = /usr/local/bin #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /uWWW/LineMode/unix/Makefile 664 472 105 1403 5301701307 10727 # Make WWW under unix # # This is a generic version. If you copy it and adapt it for # a new architecure, please mail the diffs mack to www-bug@info.cern.ch # # For W3 distribution, machine type for subdirectories WWW_MACH = unix # For ASIS installation, the ASIS code for the machine/os ASIS_MACH = hardware/os CFLAGS = -I$(CMN) -I$(LM) -DDEBUG #CFLAGS = -I$(CMN) -I$(LM) -Wall -g -DDEBUG CC = cc #LFLAGS = -lresolv LFLAGS = # Directory for installed binary: BINDIR = /usr/local/bin #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile atedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/vax_ultrix/Makefile 664 472 105 1250 5301701310 12143 # Make WWW under ultrix with gcc # CFLAGS = -I$(CMN) -I$(LM) -g -DDEBUG -Wall # For W3 distribution, machine type for subdirectories WWW_MACH = vax_ultrix # For ASIS installation, the ASIS code for the machine/os ASIS_MACH = none CC = gcc # This is bug fix for out-of-date ultrix on cernvax # LFLAGS = -g pfcode.o -lresolv LFLAGS = -g # Directory for installed binary: BINDIR = /usr/local/unix #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile Šnm.opôJLibrary UpgradeLog”€Upgrade_3.0.app¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/vax_ultrix_cc/Makefile 664 472 105 1362 5301701311 12615 # Make WWW under VAX/ultrix with cc # This platform make is NOT currently tested with the W3 release # # For W3 distribution, machine type for subdirectories WWW_MACH = vax_ultrix_cc # For ASIS installation, the ASIS code for the machine/os ASIS_MACH = none CFLAGS = -I$(CMN) -I$(LM) -g -DDEBUG CC = cc # pfcode.o is bug fix for out-of-date ultrix (3.1) on cernvax # LFLAGS = pfcode.o -g -lresolv LFLAGS = -g # Directory for installed binary: BINDIR = /usr/local/unix #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile p¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/vms/descrip.mms 664 472 105 25427 5276234110 11320 ! Make WorldWideWeb line mode hypertext browser under VMS ! ======================================================= ! ! History: ! 14 Aug 91 (TBL) Reconstituted ! 25 Jun 92 (JFG) Added TCP socket emulation over DECnet ! ! Bugs: ! The dependencies are anything but complete - they were ! just enough to allow the files to be compiled. ! ! Instructions: ! Use the correct command line for your TCP/IP implementation: ! ! $ MMS/MACRO=(MULTINET=1) for Multinet ! $ MMS/MACRO=(WIN_TCP=1) for Wollongong TCP/IP ! $ MMS/MACRO=(UCX=1) for DEC/UCX ! $ MMS/MACRO=(DECNET=1) for socket emulation over DECnet ! ! If you are on HEP net and want to build using the really latest sources on ! PRIAM:: then define an extra macro U=PRIAM::, e.g. ! ! $ MMS/MACRO=(MULTINET=1, U=PRIAM::) for Multinet ! ! This will copy the sources from PRIAM as necessary. You can also try ! ! $ MMS/MACRO=(U=PRIAM::) descrip.mms ! ! to update this file. ! .IFDEF UCX LIBS = sys$library:ucx$ipc/lib ! For UCX OPTION_FILE = CFLAGS = /DEBUG/DEFINE=DEBUG TCP=UCX .ENDIF .IFDEF MULTINET LIBS = multinet.opt/opt ! For Multinet OPTION_FILE = multinet.opt CFLAGS = /DEFINE=(DEBUG,MULTINET) TCP=MULTINET .ENDIF .IFDEF WIN_TCP LIBS = win_tcp.opt/opt ! For Wollongong TCP OPTION_FILE = win_tcp.opt CFLAGS = /DEFINE=(DEBUG,WIN_TCP) TCP=WIN_TCP .ENDIF .IFDEF DECNET LIBS = disk$c3:[hemmer.unix.usr.lib]libc.opt/opt ! TCP socket library over DECnet OPTION_FILE = disk$c3:[hemmer.unix.usr.lib]libc.opt CFLAGS = /DEFINE=(DEBUG,DECNET) TCP=DECNET .ENDIF .IFDEF LIBS .ELSE LIBS = multinet.opt/opt ! (Default to multinet) OPTION_FILE = multinet.opt CFLAGS = /DEFINE=(DEBUG,MULTINET) .ENDIF .INCLUDE Version.make OBJECTS = HTBrowse.obj, GridText.obj, DefaultStyles.obj OBJECTS_D = HTBrowse_d.obj, GridText_d.obj, DefaultStyles_d.obj !___________________________________________________________________ ! WWW WWW_$(TCP).exe : $(OBJECTS) $(OPTION_FILE) descrip.mms build_$(TCP).com define/nolog LNK$LIBRARY SYS$LIBRARY:VAXCRTL.OLB build_$(TCP).com link/exe=WWW_$(TCP) $(OBJECTS), [-.library]wwwlib_$(TCP)/lib, $(LIBS) WWW_d_$(TCP).exe : $(OBJECTS_D) $(OPTION_FILE) descrip.mms define/nolog LNK$LIBRARY SYS$LIBRARY:VAXCRTL.OLB link/debug/exe=WWW_d_$(TCP) $(OBJECTS_D), - [-.library]wwwlib_$(TCP)/lib, $(LIBS) ! Com file for non-MMS sites build_$(TCP).com : descrip.mms mms/from_sources/out=build_$(TCP).com/macro=($(tcp)=1) www_$(TCP).exe ![-.LIBRARY]WWWLIB_$(TCP).OLB : ! set def [-.Library] !.IFEF U ! mms/macro=($(TCP)=1, u=$(U)) !.ELSE ! mms/macro=($(TCP)=1) !.ENDIF ! set def [-.LineMode] !____________________________________________________________________ update : www.exe setup.com copy www.exe [.works] copy setup.com [.works] ! C O M M O N M O D U L E S - Include files !_____________________________ HTAccess .IFDEF U HTAccess.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTAccess.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTAccess.h" - HTAccess.h .ENDIF !_____________________________ HTAnchor .IFDEF U HTAnchor.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTAnchor.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTAnchor.h" - HTAnchor.h .ENDIF !_________________________________ HTFile .IFDEF U HTFile.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFile.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFile.h" - HTFile.h .ENDIF !_____________________________ HTFormat .IFDEF U HTFormat.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFormat.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFormat.h" - HTFormat.h .ENDIF !__________________________________ HTFTP .IFDEF DECNET .ELSE .IFDEF U HTFTP.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFTP.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFTP.h" - HTFTP.h .ENDIF .ENDIF !_____________________________ HTGopher .IFDEF DECNET .ELSE HTGopher.obj : HTGopher.c HTGopher.h HTUtils.h cc $(CFLAGS)/obj=$*.obj HTGopher.c HTGopher_d.obj : HTGopher.c HTGopher.h HTUtils.h cc/debug $(CFLAGS)/obj=$*.obj HTGopher.c .IFDEF U HTGopher.c : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTGopher.c" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTGopher.c" - HTGopher.c HTGopher.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTGopher.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTGopher.h" - HTGopher.h .ENDIF .ENDIF !_____________________________ HTHistory .IFDEF U HTHistory.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTHistory.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTHistory.h" - HTHistory.h .ENDIF !_____________________________ HTNews .IFDEF DECNET .ELSE .IFDEF U HTNews.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTNews.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTNews.h" - HTNews.h .ENDIF .ENDIF !_____________________________ HTML .IFDEF U HTML.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTML.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTML.h" - HTML.h .ENDIF !________________________________ HTParse .IFDEF U HTParse.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTParse.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTParse.h" - HTParse.h .ENDIF !_____________________________ HTStyle .IFDEF U HTStyle.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTStyle.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTStyle.h" - HTStyle.h .ENDIF ! _________________________________ HTTCP .IFDEF U HTTCP.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTTCP.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTTCP.h" - HTTCP.h .ENDIF !________________________________ HTTP .IFDEF U HTTP.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTTP.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTTP.h" - HTTP.h .ENDIF !_____________________________ SGML .IFDEF U SGML.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/SGML.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/SGML.h" - SGML.h .ENDIF !_________________________________ include files only: .IFDEF U HTUtils.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTUtils.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTUtils.h" - HTUtils.h tcp.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/tcp.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/tcp.h" - tcp.h HText.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HText.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HText.h" - HText.h README : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/README" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/README" - README WWW.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/WWW.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/WWW.h" - WWW.h .ENDIF !____________________________________________________________________________ ! L I N E M O D E M O D U L E S !_____________________________ HTBrowse !INCS = HTBrowse.h HTUtils.h GridText.h HText.h - ! HTAnchor.h HTAccess.h HTFormat.h HText.h HTStyle.h WWW.h - ! HTTCP.h INCS = - HTAccess.h HTFile.h HTML.h HTTCP.h WWW.h - HTAnchor.h HTFormat.h HTNews.h HTTP.h tcp.h - HTAtom.h HTGopher.h HTParse.h HTUtils.h - HTChunk.h HTHistory.h HTString.h HText.h - HTFTP.h HTList.h HTStyle.h SGML.h - HTFont.h HTBrowse.obj : HTBrowse.c $(INCS) Version.make cc $(CFLAGS)/obj=$*.obj/define=(VL="""$(VL)""") HTBrowse.c HTBrowse_d.obj : HTBrowse.c $(INCS) Version.make cc/debug $(CFLAGS)/define=(VL="""$(VL)""")/obj=$*.obj HTBrowse.c .IFDEF U HTBrowse.c : $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/HTBrowse.c" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/HTBrowse.c" - HTBrowse.c HTBrowse.h : $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/HTBrowse.h" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/HTBrowse.h" - HTBrowse.h HTFont.h : $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/HTFont.h" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/HTFont.h" - HTFont.h .ENDIF !_____________________________ GridText GridText.obj : GridText.c GridText.h HTUtils.h HTBrowse.h cc $(CFLAGS)/obj=$*.obj GridText.c GridText_d.obj : GridText.c GridText.h HTUtils.h HTBrowse.h cc/debug $(CFLAGS)/obj=$*.obj GridText.c .IFDEF U GridText.c : $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/GridText.c" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/GridText.c" - GridText.c GridText.h : $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/GridText.h" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/GridText.h" - GridText.h .ENDIF !_____________________________ DefaultStyles DefaultStyles.obj : DefaultStyles.c HTStyle.h HTUtils.h cc $(CFLAGS)/obj=$*.obj DefaultStyles.c DefaultStyles_d.obj : DefaultStyles.c HTStyle.h HTUtils.h cc/debug $(CFLAGS)/obj=$*.obj DefaultStyles.c .IFDEF U DefaultStyles.c : $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/DefaultStyles.c" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/DefaultStyles.c" - DefaultStyles.c .ENDIF ! ______________________________ The version file .IFDEF U Version.make : $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/Version.make" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/Implementation/Version.make" - Version.make write sys$output: "Please rebuild with new MMS file" exit 2 ! Error .ENDIF ! _____________________________VMS SPECIAL FILES: ! latest version of this one: .IFDEF U descrip.mms : $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/descrip.mms" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/descrip.mms" - descrip.mms write sys$output: "Please rebuild with new MMS file just fetched" exit 2 ! Error setup.com : $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/setup.com" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/setup.com" - setup.com multinet.opt : $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/multinet.opt" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/multinet.opt" - multinet.opt win_tcp.opt : $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/win_tcp.opt" copy $(U)"/userd/tbl/hypertext/WWW/LineMode/vms/win_tcp.opt" - win_tcp.opt .ENDIF )"/userd/tbl/hypertext/WWW/Library/Implementation/HTAccess.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTAccess.h" - HTAccess.h .ENDIF !_____________________________ HTAnchor .IFDEF U HTAnchor.h :WWW/LineMode/vms/setup.com 664 472 105 1124 5134577210 10761 $ ! $ ! Set up WorldWideWeb line mode browser and a few aliass $ ! $ ! WWW_HOME is the default start page if no parameter is given. $ define/nolog WWW_HOME "http://info.cern.ch./hypertext/WWW/LineMode/Defaults/default.html" $ www == "$"+f$parse("www.exe.0", f$environment("procedure")) $! $ xfind :== 'www' """http://crnvmc.cern.ch./FIND""" $ xnews :== 'www' """http://crnvmc.cern.ch./NEWS""" $ stu*dent :== 'www' """http://crnvmc.cern.ch./NEWS/student""" $ yellow :== 'www' """http://crnvmc.cern.ch./FIND/yellow""" $ qspires :== 'www' """http://slacvm.slac.stanford.edu./FIND/spires""" $ ! serd/tbl/hypertext/WWW/Library/Implementation/HTAnchor.h" - HTAnchor.h .ENDIF !_________________________________ HTFile .IFDEF U HTFile.h : $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFile.h" copy $(U)"/userd/tbl/hypertext/WWW/Library/Implementation/HTFile.h" - HTFile.h .ENDIF !_____________________________ HTFormat .IFDEF U HTFormat.h : $(U)"/userd/tbl/hypertext/WWW/Library/Itemporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile Šnm.opôJLibrary UpgradeLog”€Upgrade_3.0.app¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/vax_ultrix_cc/Makefile 664 472 105 1362 5301701311 12615 # Make WWW under VAX/ultrix with cc # This platform make is NOT currently tested with the W3 release # # For W3 distribution, machine type for subdirectories WWW_MACH = vax_ultrix_cc # For ASIS installation, the ASIS code for the machine/os ASIS_MACH = none CFLAGS = -I$(CMN) -I$(LM) -g -DDEBUG CC = cc # pfcode.o is bug fix for out-of-date ultrix (3.1) on cernvax # LFLAGS = pfcode.o -g -lresolv LFLAGS = -g # Directory for installed binary: BINDIR = /usr/local/unix #_________________ OK if normal W3 distribution # Where is the WWW source root? WWW = ../.. # Where should temporary (object) files go? WTMP = /tmp # Where is the W3 object library? LIBDIR = $(WWW)/Library/$(WWW_MACH) include $(WWW)/LineMode/Implementation/CommonMakefile p¢X UpdatedFilesz'UpgradePrep.appÙK LocalLibrary‹.cubxwrc».Remotes½.dir.wmd· hypertextX6 Micks_Disk¶ asis_specific¹duns¸ .gatorftprcº pubtar.ZWWW/LineMode/vms/descrip.mms 664 472 105 25427 5276234110 11320 ! Make WorldWideWeb line mode hypertext browser under VMS ! ======================================================= ! ! History: ! 14 Aug 91 (TBL) Reconstituted ! 25 Jun 92 (JFG) Added TCP socket emulation over DECnet ! ! Bugs: ! The dependencies are anything but complete - they were ! just enough to allow the files to be compiled. ! ! Instructions: ! Use the correct command line for your TCP/IP implementation: ! ! $ MMS/MACRO=(MULTINET=1) for Multinet ! $ MMS/MACRO=(WIN_TCP=1) for Wollongong TCP/IP ! $ MMS/MACRO=(UCX=1) for DEC/UCX ! $ MMS/MACRO=(DECNET=1) for socket emulation over DECnet ! ! If you are on HEP net and want to build using the really latest sources on ! PRIAM:: then define an extra macro U=PRIAM::, e.g. ! ! $ MMS/MACRO=(MULTINET=1, U=PRIAM::) for Multinet ! ! This will copy the sources from PRIAM as necessary. You can also try ! ! $ MMS/MACRO=(U=PRIAM::) descrip.mms ! ! to update this file. ! .IFDEF UCX LIBS = sys$library:ucx$ipc/lib ! For UCX OPTION_FILE = CFLAGS = /DEBUG/DEFINE=DEBUG TCP=UCX .ENDIF .IFDEF MULTINET LIBS = multinet.opt/opt ! For Multinet OPTION_FILE = multinet.opt CFLAGS = /DEFINE=(DEBUG,MULTINET) TCP=MULTINET .ENDIF .IFDEF WIN_TCP LIBS = win_tcp.opt/opt ! For Wollongong TCP OPTION_FILE = win_tcp.opt CFLAGS = /DEFINE=(DEBUG,WIN_TCP) TCP=WIN_TCP .ENDIF .IFDEF DECNET LIBS = disk$c3:[hemmer.unix.usr.lib]libc.opt/opt ! TCP socket library over DECnet OPTION_FILE = disk$c3:[hemmer.unix.usr.lib]libc.opt CFLAGS = /DEFINE=(DEBUG,DECNET) TCP=DECNET .ENDIF .IFDEF LIBS .ELSE LIBS = multinet.opt/opt ! (Default to multinet) OPTION_FILE = multinet.opt CFLAGS = /DEFINE=(DEBUG,MULTINET) .ENDIF .INCLUDE Version.make OBJECTS = HTBrowse.obj, GridText.obj, DefaultStyles.obj OBJECTS_D = HTBrowse_d.obj, GridText_d.obj, DefaultStyles_d.obj !___________________________________________________________________ ! WWW WWW_$(TCP).exe : $(OBJECTS) $(OPTION_FILE) descrip.mms build_$(TCP).com define/nolog LNK$LIBRARY SYS$LIBRARY:VAXCRTL.OLB build_$(TCP).com link/exe=WWW_$(TCP) $(OBJECTS), [-.library]wwwlib_$(TCP)/lib, $(LIBS) WWW_d_$(TCP).exe : $(OBJECTS_D) $(OPTION_FILE) descrip.mms define/nolog LNK$LIBRARY SYS$LIBRARY:VAXCRTL.OLB link/debug/exe=WWW_d_$(TCP) $(OBJECTS_D), - [-.library]wwwlib_$(TCP)/lib, $(LIBS) ! Com file for non-MMS sites build_$(TCP).com : descrip.mms mms/from_sources/out=build_$(TCP).com/macro=($(tcp)=1) www_$(TCP).exe ![-.LIBRARY]WWWLIB_$(TCP).OLB : ! set def [-.Library] !.IFEF U ! mms/macro=($(TCP)=1, u=$(U)) !.ELSE ! mms/macro=($(TCP)=1) !.ENDIF ! set de