On Tue, Jan 20, 2009 at 10:39:09AM -0700, Dr. Neal Krawetz wrote:
> On Tue, Jan 20, 2009 at 05:24:40PM +0100, Morten Jagd Christensen (MJC) wrote:
>
> 0x0138: this is the length between starts of strings.
> For example, let's say that there are 5 tokens:
> "this is a test." (period is a token)
> The 0x0131 will point to the first "t".
> The 0x0132 will point to the last period.
> The 0x0138 lengths will be: 5 3 2 4 1.
> 5 is "this " -- with space. (Distance between starts.) The final
> length is actually ignored since there is no next start.
>
> If you only do 0x0131 and 0x0132, then you will know where the functions
> are, but not which tokens matched.
> With 0x0138, you will know which tokens matched. (This field is the
> magic behind the highlighting in the "view license" web page.)
>
> There is one caveat: all lengths are limited to two bytes. If there is
> a large comment in source code (e.g., a C program that includes the entire
> GPL as a header comment), then there will be a problem here. Similarly,
Minor correction: the 0x0138 uses one-byte lengths. So comments longer
than 255 bytes will cause problems. (I previously said 65535 -- that's
wrong.)
-Neal
_______________________________________________
fossology mailing list
[email protected]
http://fossology.org/mailman/listinfo/fossology