chmspec-devel
[Top][All Lists]
Advanced

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

[chmspec-devel] Request for exception to GPL license


From: Robert Pyron
Subject: [chmspec-devel] Request for exception to GPL license
Date: Sat, 11 Sep 2010 13:40:04 -0400

I have a few other issues that I will address in separate messages, but first an introduction:

I'm implementing a CHM reader in Python, based on Jed Wing's libchm, and guided by chmspec. So far I am able to read (and extract useful information from) #STRINGS, #SYSTEM, #TOCIDX, #TOPICS, #URLSTR, and #URLTBL. There is enough functionality already implemented to be useful to others, and I am almost ready to make an initial source release.

I need to decide on a license for my code. Since I connect to libchm (which is LGPL), and since this code is not intended to be stand-alone, I would like to release it under LGPL. My problem is that comments in my code quote liberally from chmspec, which is GPL.

Is it possible to get an exception to GPL in this case, as long as the quoted text remains as part of my source file (or files)?

Here is a sample comment:

#-----------------------------------------------------------------------------
# /#TOCIDX
#
# From chmspec:
#
#   5.3.7. #TOCIDX
#
#   Present in files with a non-empty contents file, when Binary TOC is on
#   and Compatibility is set to 1.1 or later.
#
#   This file is made up of 0x1000 byte blocks, but this is only apparent
#   because of extra bytes interrupting what would otherwise be a stream
#   of 20/28 byte structs. If the other parts (DWORDs & 16 byte structs)
#   didn't fit into these blocks then presumably this would show up in
#   the other parts too.
#
#   The first block is the header:
#
#   Table 5.9. The format of the #TOCIDX header.
#   Offset  Type    Comment/Value
#   ------  ----    -------------
#   0       DWORD   4096/header length/offset of no. 1 below
#   4       DWORD   offset of no. 3 below
#   8       DWORD   number of no. 3 below
#   0xC     DWORD   offset of no. 2 below
#   0x10    BYTE[4080]  0 (unknown)
#
#   The header is followed by the following different types of structs
#   in the specified order:
#
#      1.   20/28 byte structs (pages/books)
#      2.   list of DWORDs pointing into the #TOPICS file   [rlp = these are indices, not offsets]
#      3.   16 byte structs - links above stuff
#
#   First all the top level books/pages, then the next level, then the next & so on
#
#   Table 5.10. 20/28 byte structures
#   Offset  Type    Comment/Value
#   ------  ----    -------------
#   0       WORD    0 (unknown)
#   2       WORD    Unknown
#   4       DWORD   Seems to be a bit field:
#                       0x2 is whether or not New is turned on,
#                       0x4 is set when the entry is a book/has children and
#                       0x8 is set when the entry has a Local value.
#                       The other bits are unknown (0x1, 0x40, 0x100 are sometimes set on books).
#   8       DWORD   Unknown. In some cases it is an index into the #TOPICS file of the entry containing offsets to the title & filename.
#   0x0C    DWORD   Offset to the parent book.
#   0x10    DWORD   Offset to the next book/page in the current book/page.
#
#   The next two DWORDs are only present in books (28 byte structs)
#   0x14    DWORD   Offset to the first child of the book.
#   0x18    DWORD   0 (unknown)
#
#   Table 5.11. 16 byte structures
#   Offset  Type    Comment/Value
#   ------  ----    -------------
#   0       DWORD   Offset into no. 1 above.
#   4       DWORD   Some kind of sequence number that is incremented by one and starts at 666. I swear :)
#   8       DWORD   Offset into no. 2 above. Can contain RAM litter.
#   0xC     DWORD   Index in #TOPICS file of the entry containing offsets to the title & filename. Can contain RAM litter.
#
# rlp - comments on "Table 5.10. 20/28 byte structures", offset 0x8
#
#   Check the bitflags at offset 0x04. If this node has children (bit 0x4 is set)
#   but has no Local value (bit 0x8 is clear), then the DWORD at offset 0x08
#   is an offset into the #STRINGS file. Otherwise, the DWORD at offset 0x08
#   is an index into the #TOPICS file.
#
# rlp - I save the information extracted from this section in class TOCIDX:
#   class TOCIDX:
#       def __init__(self):
#           self.nodeTable = {}     # currentOffset : (nodeFlags, indexTOPICS, offsetParent, offsetNext, offsetFirstChild)
#           self.miscTable = {}     # currentOffset : (offset_into_nodeTable, offset_into_topicsTable, indexTOPICS)
#           self.topicsTable = {}   # currentOffset : indexTOPICS
#


reply via email to

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