htdig: add_anchors_to_excerpt


Marjolein Katsma (webmaster@javawoman.com)
Thu, 31 Dec 1998 11:45:28 +0100


I was really happy when I saw this configuration parameter - but now I'm
unhappy to find this is not actually implemented: I need this badly to
enable a jump to the nearest location within a (long) document.

I'm trying to path Display.cc to implement this.

Looking at db.docdb I can see that each document actually has a list of
anchor names; I need to retrieve the correct name.

I found that ref->DocAnchor() returns the sequence number of the anchor.
How do I get at the name? This is what I'm trying to do (in
Display::excerpt()):

          List *anchors = ref->DocAnchors();
          String *tmpanchor;
          int n = ref->DocAnchor();

          *tmpanchor << ((String*) (*anchors)[n])->get();
          String *docanchor = (String*) "#";
          *docanchor << tmpanchor;
          vars.Add("ANCHOR", docanchor);
          *url << docanchor;

No compilation errors or warnings. But I'm getting a segmentation fault at
 ((String*) (*anchors)[n])->get() .

What am I not doing or doing wrong?

Marjolein Katsma webmaster@javawoman.com
Java Woman - http://javawoman.com/
----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:29:57 PST