Add an enhanced interface for loading, aka importing, headers
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 30 Nov 2011 07:12:48 +0000 (09:12 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 30 Nov 2011 08:41:00 +0000 (10:41 +0200)
commit52bcafcfb2e7c6bb8bb59f8def831e4f6a6f4930
tree0d56f5d789669e909e5417e8b7f02660200708f4
parentc943d42880b1499d4b4f3574e3086c292d006406
Add an enhanced interface for loading, aka importing, headers

- Unlike headerLoad(), headerImport() takes a blob size argument
  to allow sanity checking the size calculated from the blob itself
  against the "physical" passed-in blob size so its a bit safer.
  Note that header size is capped by various things - its not size_t.
- headerImport() also takes a flags argument to allow controlling
  various aspects of importing.
- Implement "take copy of blob" as a flag to headerImport(), push
  the copying into headerCreate() where we already know the blob
  size, avoiding the need to do double-calculations on headerCopyLoad()..
- headerLoad() and headerCopyLoad() are now just compat wrappers
  around the new interface.
lib/header.c
lib/header.h