HTList_addObject(Visited_Links, new);
if ((new = typecalloc(VisitedLink)) == NULL) outofmem(__FILE__, "LYAddVisitedLink"); StrAllocCopy(new->address, doc->address); LYformTitle(&(new->title), title);   HTList_appendObject(Visited_Links, new);	 new->prev_first = Last_by_first; Last_by_first = new;   if (PrevVisitedLink) { VisitedLink *a = PrevVisitedLink; VisitedLink *b = a->next_tree; int l = PrevVisitedLink->level;   while (b && b->level > l) a = b, b = b->next_tree;  if (!b)			 Latest_tree = new; new->next_tree = a->next_tree; a->next_tree = new;  new->level = PrevVisitedLink->level + 1; } else { if (Latest_tree) Latest_tree->next_tree = new; new->level = 0; new->next_tree = NULL; Latest_tree = new; } PrevVisitedLink = PrevActiveVisitedLink = new; if (!First_tree) First_tree = new;   Latest_last.prev_latest->next_latest = new; new->prev_latest = Latest_last.prev_latest; new->next_latest = &Latest_last; Latest_last.prev_latest = new;
PUBLIC void LYAddVisitedLink ARGS1(	document *,	doc){    VisitedLink *new;    VisitedLink *old;    HTList *cur;    if (!(doc->address && *doc->address))	return;    /*     *	Exclude POST or HEAD replies, and bookmark, menu     *	or list files. - FM     */    if (doc->post_data || doc->isHEAD || doc->bookmark ||	(/* special url or a temp file */	 (!strncmp(doc->address, "LYNX", 4) ||	  !strncmp(doc->address, "file://localhost/", 17))	 && (	!strcmp((doc->title ? doc->title : ""), HISTORY_PAGE_TITLE) ||	!strcmp((doc->title ? doc->title : ""), PRINT_OPTIONS_TITLE) ||	!strcmp((doc->title ? doc->title : ""), DOWNLOAD_OPTIONS_TITLE) ||	!strcmp((doc->title ? doc->title : ""), OPTIONS_TITLE) ||#ifdef DIRED_SUPPORT	!strcmp((doc->title ? doc->title : ""), DIRED_MENU_TITLE) ||	!strcmp((doc->title ? doc->title : ""), UPLOAD_OPTIONS_TITLE) ||	!strcmp((doc->title ? doc->title : ""), PERMIT_OPTIONS_TITLE) ||#endif /* DIRED_SUPPORT */	!strcmp((doc->title ? doc->title : ""), CURRENT_KEYMAP_TITLE) ||	!strcmp((doc->title ? doc->title : ""), LIST_PAGE_TITLE) ||#ifdef EXP_ADDRLIST_PAGE	!strcmp((doc->title ? doc->title : ""), ADDRLIST_PAGE_TITLE) ||#endif	!strcmp((doc->title ? doc->title : ""), SHOWINFO_TITLE) ||	!strcmp((doc->title ? doc->title : ""), STATUSLINES_TITLE) ||	!strcmp((doc->title ? doc->title : ""), CONFIG_DEF_TITLE) ||	!strcmp((doc->title ? doc->title : ""), LYNXCFG_TITLE) ||	!strcmp((doc->title ? doc->title : ""), COOKIE_JAR_TITLE) ||	!strcmp((doc->title ? doc->title : ""), VISITED_LINKS_TITLE) ||	!strcmp((doc->title ? doc->title : ""), LYNX_TRACELOG_TITLE)))) {	return;    }    if ((new = (VisitedLink *)calloc(1, sizeof(*new))) == NULL)	outofmem(__FILE__, "LYAddVisitedLink");    StrAllocCopy(new->address, doc->address);    StrAllocCopy(new->title, (doc->title ? doc->title : NO_TITLE));    if (!Visited_Links) {	Visited_Links = HTList_new();#ifdef LY_FIND_LEAKS	atexit(Visited_Links_free);#endif	HTList_addObject(Visited_Links, new);	return;    }    cur = Visited_Links;    while (NULL != (old = (VisitedLink *)HTList_nextObject(cur))) {	if (!strcmp((old->address ? old->address : ""),		    (new->address ? new->address : "")) &&	    !strcmp((old->title ? new->title : ""),		    (new->title ? new->title : ""))) {	    FREE(old->address);	    FREE(old->title);	    HTList_removeObject(Visited_Links, old);	    FREE(old);	    break;	}    }    HTList_addObject(Visited_Links, new);    return;}