diff -ur lynx2-8-3/LYMessages_en.h lynx2-8-3.bibp/LYMessages_en.h --- lynx2-8-3/LYMessages_en.h Sun Apr 23 18:44:03 2000 +++ lynx2-8-3.bibp/LYMessages_en.h Mon Dec 11 20:40:46 2000 @@ -356,6 +356,7 @@ #define POPUP_FAILED gettext("Unable to create popup window!") #define GOTO_DISALLOWED gettext("Goto a random URL is disallowed!") #define GOTO_NON_HTTP_DISALLOWED gettext("Goto a non-http URL is disallowed!") +#define GOTO_BIBP_DISALLOWED gettext("You are not allowed to goto \"bibp:\" URLs") #define GOTO_CSO_DISALLOWED gettext("You are not allowed to goto \"cso:\" URLs") #define GOTO_FILE_DISALLOWED gettext("You are not allowed to goto \"file:\" URLs") #define GOTO_FINGER_DISALLOWED gettext("You are not allowed to goto \"finger:\" URLs") Only in lynx2-8-3.bibp: LYMessages_en.h~ diff -ur lynx2-8-3/WWW/Library/Implementation/HTAnchor.c lynx2-8-3.bibp/WWW/Library/Implementation/HTAnchor.c --- lynx2-8-3/WWW/Library/Implementation/HTAnchor.c Sun Mar 12 16:38:38 2000 +++ lynx2-8-3.bibp/WWW/Library/Implementation/HTAnchor.c Mon Dec 11 20:40:46 2000 @@ -83,6 +83,7 @@ newAnchor->FileCache = NULL; /* Path to a disk-cached copy. - FM */ newAnchor->SugFname = NULL; /* Suggested filename. - FM */ newAnchor->RevTitle = NULL; /* TITLE for a LINK with REV. - FM */ + newAnchor->citehost = NULL; /* LINK REL=citehost - RDC */ newAnchor->cache_control = NULL; /* Cache-Control. - FM */ newAnchor->no_cache = FALSE; /* no-cache? - FM */ newAnchor->content_type = NULL; /* Content-Type. - FM */ @@ -743,6 +744,7 @@ FREE(me->bookmark); FREE(me->owner); FREE(me->RevTitle); + FREE(me->citehost); #ifdef SOURCE_CACHE HTAnchor_clearSourceCache(me); #endif @@ -1048,6 +1050,23 @@ me->RevTitle[i] = ' '; } } + } +} + +/* Citehost for bibp links from LINKs with REL="citehost". - RDC +*/ +PUBLIC CONST char * HTAnchor_citehost ARGS1( + HTParentAnchor *, me) +{ + return( me ? me->citehost : NULL); +} + +PUBLIC void HTAnchor_setCitehost ARGS2( + HTParentAnchor *, me, + CONST char *, citehost) +{ + if (me) { + StrAllocCopy(me->citehost, citehost); } } diff -ur lynx2-8-3/WWW/Library/Implementation/HTAnchor.h lynx2-8-3.bibp/WWW/Library/Implementation/HTAnchor.h --- lynx2-8-3/WWW/Library/Implementation/HTAnchor.h Wed Dec 15 03:03:18 1999 +++ lynx2-8-3.bibp/WWW/Library/Implementation/HTAnchor.h Mon Dec 11 20:40:46 2000 @@ -67,6 +67,7 @@ char * title; /* Title of document */ char * owner; /* Owner of document */ char * RevTitle; /* TITLE in REV="made" or REV="owner" LINK */ + char * citehost; /* Citehost from REL="citehost" LINK */ #ifdef USE_HASH char * style; #endif @@ -294,6 +295,15 @@ extern void HTAnchor_setRevTitle PARAMS(( HTParentAnchor * me, CONST char * title)); + +/* Citehost for bibp links from LINKs with REL="citehost". - RDC +*/ +extern CONST char * HTAnchor_citehost PARAMS(( + HTParentAnchor * me)); + +extern void HTAnchor_setCitehost PARAMS(( + HTParentAnchor * me, + CONST char * citehost)); /* Suggested filename handling. - FM ** (will be loaded if we had a Content-Disposition diff -ur lynx2-8-3/lynx.cfg lynx2-8-3.bibp/lynx.cfg --- lynx2-8-3/lynx.cfg Wed Apr 19 18:57:56 2000 +++ lynx2-8-3.bibp/lynx.cfg Mon Dec 11 20:40:46 2000 @@ -1077,6 +1077,19 @@ # #LYNX_SIG_FILE:.lynxsig +.h1 Bibliographic Protocol (bibp scheme) + +.h2 BIBP_GLOBAL_SERVER +# BIBP_GLOBAL_SERVER is the default global server for bibp: links, used +# when a local bibhost or document-specified citehost is unavailable. +# Set in userdefs.h and can be changed here. +#BIBP_GLOBAL_SERVER:http://usin.org/ + +.h2 BIBP_BIBHOST +# BIBP_BIBHOST is the URL at which local bibp service may be found, if +# it exists. Defaults to http://bibhost/ for protocol conformance, but +# may be overridden here or via --bibhost parameter. +#BIBP_BIBHOST:http://bibhost/ .h1 Interaction # These settings control interaction of the user with lynx. Only in lynx2-8-3.bibp: lynx.cfg~ diff -ur lynx2-8-3/lynx_help/lynx_url_support.html lynx2-8-3.bibp/lynx_help/lynx_url_support.html --- lynx2-8-3/lynx_help/lynx_url_support.html Thu Apr 13 19:39:31 2000 +++ lynx2-8-3.bibp/lynx_help/lynx_url_support.html Mon Dec 11 20:40:46 2000 @@ -18,6 +18,7 @@ mailto | finger | cso | +bibp | lynxexec, lynxprog | lynxcgi| internal] @@ -537,6 +538,15 @@ (searches) which appear to be a URL with a supported scheme will be converted into a link for accessing that URL.
+ +

The bibp URL:

+ +

Lynx provides built-in support for bibliographic protocol (BibP). +BibP links are links to published works such as books or journal articles, +without a predefined server. BibP links are intended for resolution +by a local bibhost server (http://bibhost/) if it exists. Otherwise, +resolution is performed by a document-specified server or a known global +server.

The lynxexec and lynxprog URLs:

diff -ur lynx2-8-3/src/HTML.c lynx2-8-3.bibp/src/HTML.c --- lynx2-8-3/src/HTML.c Wed Apr 19 18:57:56 2000 +++ lynx2-8-3.bibp/src/HTML.c Mon Dec 11 20:40:46 2000 @@ -1522,6 +1522,13 @@ StrAllocCopy(temp, "RelTitle: "); StrAllocCat(temp, value[HTML_LINK_REL]); } + } else + if (!strcasecomp(value[HTML_LINK_REL], "citehost")) { + /* Citehost determination for bibp links. - RDC */ + HTAnchor_setCitehost(me->node_anchor, href); + CTRACE((tfp, "HTML: citehost '%s' found\n", href)); + FREE(href); + break; } else { CTRACE((tfp, "HTML: LINK with REL=\"%s\" ignored.\n", value[HTML_LINK_REL])); Only in lynx2-8-3.bibp/src: HTML.c~ diff -ur lynx2-8-3/src/LYGetFile.c lynx2-8-3.bibp/src/LYGetFile.c --- lynx2-8-3/src/LYGetFile.c Sun Mar 26 19:14:00 2000 +++ lynx2-8-3.bibp/src/LYGetFile.c Mon Dec 11 20:40:46 2000 @@ -758,6 +758,27 @@ #ifdef DIRED_SUPPORT lynx_edit_mode = FALSE; #endif /* DIRED_SUPPORT */ + if (url_type == BIBP_URL_TYPE) { + char *bibpTmp=NULL; + if (!BibP_bibhost_checked) LYCheckBibHost(); + if (BibP_bibhost_available) { + StrAllocCopy(bibpTmp, BibP_bibhost); + } else if (HTMainAnchor && HTAnchor_citehost(HTMainAnchor)) { + StrAllocCopy(bibpTmp, HTAnchor_citehost(HTMainAnchor)); + } else { + StrAllocCopy(bibpTmp, BibP_globalserver); + } + if (HTMainAnchor && HTAnchor_citehost(HTMainAnchor)) { + StrAllocCat(bibpTmp, "bibp1.0/resolve?citehost="); + StrAllocCat(bibpTmp, HTAnchor_citehost(HTMainAnchor)); + StrAllocCat(bibpTmp, "&usin="); + } + else StrAllocCat(bibpTmp, "bibp1.0/resolve?usin="); + StrAllocCat(bibpTmp, doc->address+5); /* USIN after bibp: */ + StrAllocCopy(doc->address, bibpTmp); + WWWDoc.address = doc->address; + FREE(bibpTmp); + } if (url_type == FILE_URL_TYPE) { /* @@ -865,6 +886,8 @@ url_type == FILE_URL_TYPE) || (no_goto_lynxcgi && url_type == LYNXCGI_URL_TYPE) || + (no_goto_bibp && + url_type == BIBP_URL_TYPE) || (no_goto_cso && url_type == CSO_URL_TYPE) || (no_goto_finger && diff -ur lynx2-8-3/src/LYGlobalDefs.h lynx2-8-3.bibp/src/LYGlobalDefs.h --- lynx2-8-3/src/LYGlobalDefs.h Sun Mar 26 19:14:00 2000 +++ lynx2-8-3.bibp/src/LYGlobalDefs.h Mon Dec 11 20:40:46 2000 @@ -253,6 +253,7 @@ extern BOOLEAN no_goto_lynxexec; extern BOOLEAN no_goto_lynxprog; extern BOOLEAN no_goto_mailto; +extern BOOLEAN no_goto_bibp; extern BOOLEAN no_goto_news; extern BOOLEAN no_goto_nntp; extern BOOLEAN no_goto_rlogin; @@ -371,6 +372,10 @@ extern BOOLEAN LYMBMAdvanced; /* MBM statusline for ADVANCED? */ extern int LYStatusLine; /* Line for statusline() or -1 */ extern BOOLEAN LYCollapseBRs; /* Collapse serial BRs? */ +extern char *BibP_globalserver; /* global server for bibp: links */ +extern char *BibP_bibhost; /* local server for bibp: links */ +extern BOOLEAN BibP_bibhost_checked; /* bibhost has been checked */ +extern BOOLEAN BibP_bibhost_available; /* bibhost is responding */ extern BOOLEAN LYSetCookies; /* Process Set-Cookie headers? */ extern BOOLEAN LYAcceptAllCookies; /* accept ALL cookies? */ extern char *LYCookieAcceptDomains; /* domains to accept all cookies */ Only in lynx2-8-3.bibp/src: LYGlobalDefs.h~ diff -ur lynx2-8-3/src/LYMain.c lynx2-8-3.bibp/src/LYMain.c --- lynx2-8-3/src/LYMain.c Sun Apr 23 18:44:03 2000 +++ lynx2-8-3.bibp/src/LYMain.c Mon Dec 11 20:40:46 2000 @@ -244,6 +244,7 @@ PUBLIC BOOLEAN no_goto_lynxexec = FALSE; PUBLIC BOOLEAN no_goto_lynxprog = FALSE; PUBLIC BOOLEAN no_goto_mailto = FALSE; +PUBLIC BOOLEAN no_goto_bibp = FALSE; #ifndef DISABLE_NEWS PUBLIC BOOLEAN no_goto_news = FALSE; PUBLIC BOOLEAN no_goto_nntp = FALSE; @@ -404,6 +405,10 @@ PUBLIC BOOLEAN LYMBMAdvanced = TRUE; PUBLIC int LYStatusLine = -1; /* Line for statusline() if > -1 */ PUBLIC BOOLEAN LYCollapseBRs = COLLAPSE_BR_TAGS; /* Collapse serial BRs? */ +PUBLIC char *BibP_globalserver = NULL; /* global server for bibp: links */ +PUBLIC char *BibP_bibhost = NULL; /* local server for bibp: links */ +PUBLIC BOOLEAN BibP_bibhost_checked = FALSE; /* until LYCheckBibHost */ +PUBLIC BOOLEAN BibP_bibhost_available = FALSE; /* until check succeeds */ PUBLIC BOOLEAN LYSetCookies = SET_COOKIES; /* Process Set-Cookie headers? */ PUBLIC BOOLEAN LYAcceptAllCookies = ACCEPT_ALL_COOKIES; /* take all cookies? */ PUBLIC char *LYCookieAcceptDomains = NULL; /* domains to accept all cookies */ @@ -610,6 +615,8 @@ FREE(LynxSigFile); FREE(system_mail); FREE(system_mail_flags); + FREE(BibP_bibhost); + FREE(BibP_globalserver); #ifdef EXP_PERSISTENT_COOKIES FREE(LYCookieFile); FREE(LYCookieSaveFile); @@ -1115,7 +1122,8 @@ StrAllocCopy(URLDomainPrefixes, URL_DOMAIN_PREFIXES); StrAllocCopy(URLDomainSuffixes, URL_DOMAIN_SUFFIXES); StrAllocCopy(XLoadImageCommand, XLOADIMAGE_COMMAND); - + StrAllocCopy(BibP_globalserver, BIBP_GLOBAL_SERVER); + StrAllocCopy(BibP_bibhost, "http://bibhost/"); /* protocol specified. */ /* * Disable news posting if the compilation-based * LYNewsPosting value is FALSE. This may be changed @@ -3120,6 +3128,10 @@ PARSE_FUN( "base", FUNCTION_ARG, base_fun, "prepend a request URL comment and BASE tag to text/html\noutputs for -source dumps" + ), + PARSE_STR( + "bibhost", 4|NEED_LYSTRING_ARG, &BibP_bibhost, + "=URL\nlocal bibp server (default http://bibhost/)" ), #ifdef USE_SLANG PARSE_FUN( Only in lynx2-8-3.bibp/src: LYMain.c~ diff -ur lynx2-8-3/src/LYMainLoop.c lynx2-8-3.bibp/src/LYMainLoop.c --- lynx2-8-3/src/LYMainLoop.c Wed Apr 19 18:57:56 2000 +++ lynx2-8-3.bibp/src/LYMainLoop.c Mon Dec 11 20:40:47 2000 @@ -560,6 +560,10 @@ !strncmp(user_input_buffer, "mailto:", 7)) { HTUserMsg(GOTO_MAILTO_DISALLOWED); + } else if (no_goto_bibp && + !strncmp(user_input_buffer, "bibp:", 5)) { + HTUserMsg(GOTO_BIBP_DISALLOWED); + #ifndef DISABLE_NEWS } else if (no_goto_news && !strncmp(user_input_buffer, "news:", 5)) { diff -ur lynx2-8-3/src/LYReadCFG.c lynx2-8-3.bibp/src/LYReadCFG.c --- lynx2-8-3/src/LYReadCFG.c Mon Apr 17 03:59:17 2000 +++ lynx2-8-3.bibp/src/LYReadCFG.c Mon Dec 11 20:40:47 2000 @@ -1348,6 +1348,8 @@ #ifdef DIRED_SUPPORT PARSE_ENV("auto_uncache_dirlists", CONF_INT, &LYAutoUncacheDirLists), #endif + PARSE_STR("bibp_bibhost", CONF_STR, &BibP_bibhost), + PARSE_STR("bibp_globalserver", CONF_STR, &BibP_globalserver), PARSE_SET("block_multi_bookmarks", CONF_BOOL, &LYMBMBlocked), PARSE_SET("bold_h1", CONF_BOOL, &bold_H1), PARSE_SET("bold_headers", CONF_BOOL, &bold_headers), Only in lynx2-8-3.bibp/src: LYReadCFG.c~ diff -ur lynx2-8-3/src/LYUtils.c lynx2-8-3.bibp/src/LYUtils.c --- lynx2-8-3/src/LYUtils.c Mon Apr 17 03:59:17 2000 +++ lynx2-8-3.bibp/src/LYUtils.c Mon Dec 11 20:40:47 2000 @@ -2824,6 +2824,9 @@ } else if (compare_type(cp, "mailto:", 7)) { return(MAILTO_URL_TYPE); + } else if (compare_type(cp, "bibp:", 5)) { + return(BIBP_URL_TYPE); + } else if (compare_type(cp, "file:", 5)) { if (LYisLocalFile(cp)) { return(FILE_URL_TYPE); @@ -4106,6 +4109,7 @@ no_inside_rlogin = !(CAN_ANONYMOUS_INSIDE_DOMAIN_RLOGIN); no_outside_rlogin = !(CAN_ANONYMOUS_OUTSIDE_DOMAIN_RLOGIN); no_goto = !(CAN_ANONYMOUS_GOTO); + no_goto_bibp = !(CAN_ANONYMOUS_GOTO_BIBP); no_goto_cso = !(CAN_ANONYMOUS_GOTO_CSO); no_goto_file = !(CAN_ANONYMOUS_GOTO_FILE); #ifndef DISABLE_FINGER @@ -6807,6 +6811,29 @@ StrAllocCopy((p->name), newname); } } + +/* + * Check that bibhost defines the BibP icon. + */ +PUBLIC void LYCheckBibHost NOARGS +{ + DocAddress bibhostIcon; + BOOLEAN saveFlag; + bibhostIcon.address = NULL; + StrAllocCopy(bibhostIcon.address, BibP_bibhost); + StrAllocCat(bibhostIcon.address, "bibp1.0/bibpicon.jpg"); + bibhostIcon.post_data = NULL; + bibhostIcon.post_content_type = NULL; + bibhostIcon.bookmark = FALSE; + bibhostIcon.isHEAD = FALSE; + bibhostIcon.safe = FALSE; + saveFlag = traversal; + traversal = TRUE; /* Hack to force error response. */ + BibP_bibhost_available = HTLoadAbsolute(&bibhostIcon) == YES; + traversal = saveFlag; + BibP_bibhost_checked = TRUE; +} + /* * Management of User Interface Pages. - kw Only in lynx2-8-3.bibp/src: LYUtils.c~ diff -ur lynx2-8-3/src/LYUtils.h lynx2-8-3.bibp/src/LYUtils.h --- lynx2-8-3/src/LYUtils.h Sun Mar 26 19:14:00 2000 +++ lynx2-8-3.bibp/src/LYUtils.h Mon Dec 11 20:40:47 2000 @@ -101,6 +101,7 @@ extern void LYAddPathSep PARAMS((char **path)); extern void LYAddPathSep0 PARAMS((char *path)); extern void LYAddPathToHome PARAMS((char *fbuffer, size_t fbuffer_size, char *fname)); +extern void LYCheckBibHost NOPARAMS; extern void LYCheckMail NOPARAMS; extern void LYCleanupTemp NOPARAMS; extern void LYCloseTemp PARAMS((char *name)); @@ -205,6 +206,7 @@ TELNET_GOPHER_URL_TYPE, INDEX_GOPHER_URL_TYPE, MAILTO_URL_TYPE, + BIBP_URL_TYPE, FINGER_URL_TYPE, CSO_URL_TYPE, HTTPS_URL_TYPE, Only in lynx2-8-3.bibp/src: LYUtils.h~ diff -ur lynx2-8-3/userdefs.h lynx2-8-3.bibp/userdefs.h --- lynx2-8-3/userdefs.h Sun Apr 23 18:44:03 2000 +++ lynx2-8-3.bibp/userdefs.h Mon Dec 11 20:40:47 2000 @@ -832,6 +832,12 @@ #define LYNX_SIG_FILE ".lynxsig" /******************************** + * BIBP_GLOBAL_SERVER is the default global server for bibp: links, used + * when a local bibhost or document-specified citehost is unavailable. + */ +#define BIBP_GLOBAL_SERVER "http://usin.org/" + +/******************************** * If USE_SELECT_POPUPS is set FALSE, Lynx will present a vertical list * of radio buttons for the OPTIONs in SELECT blocks which lack the * MULTIPLE attribute, instead of using a popup menu. Note that if @@ -1561,6 +1567,7 @@ * set to FALSE if you don't want users of your anonymous * account to be able to goto particular URLs. */ +#define CAN_ANONYMOUS_GOTO_BIBP TRUE /* BIBP maps to HTTP */ #define CAN_ANONYMOUS_GOTO_CSO FALSE #define CAN_ANONYMOUS_GOTO_FILE FALSE #define CAN_ANONYMOUS_GOTO_FINGER TRUE Only in lynx2-8-3.bibp: userdefs.h~