help-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-texinfo] Info file format spec?


From: Eli Zaretskii
Subject: Re: [help-texinfo] Info file format spec?
Date: Mon, 06 Nov 2006 20:45:31 +0200

> Date: Mon, 6 Nov 2006 11:16:41 -0700
> From: "Robert Dodier" <address@hidden>
> Cc: address@hidden
> 
> I want to use that table to find (by comparing a input string against
> "foo", "bar", etc) the text for "foo", read just that much text
> (open "FOO.info-4" and then seek 1755 bytes and then read
> 26 bytes), and print that text.

And the purpose of this is what? display those 26 bytes to the user as
the function's signature?

It's not easy: the Info file does not record the place in the manual
where the indexed function's description starts, it only records the
node which describes the function.  You will need to get to the node,
and then search for the string "-- Function: foo".

The byte offset of the node is recorded in the Info file's Tag table,
but its value assumes that the whole Info manual is a single file.  If
the manual is split to several subfiles, the offset of the beginning
of each subfile is recorded in the Indirect table.  There's one quirk:
the preamble (everything before the first Ctrl-_ character in the
file) is counted only once: in the first subfile; the other offsets
pretend that there's no preamble in the other subfiles.

This is quite complicated, so I'd actually suggest to add a new option
to the stand-alone Info reader that would search in the index and
output the function's description given its name, and then you could
in your program simply run the Info reader via a pipe and use the text
it produces.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]