docs: def save_toc(self, tocpos):
          """Save the table of contents to disk."""
          self.tocpos = tocpos
          tocstr = self.toc.tobinary()
          self.toclen = len(tocstr)
          self.lib.write(tocstr)