Add headerGet() flag to force allocation of returned data
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 11 Jun 2008 09:26:52 +0000 (12:26 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 11 Jun 2008 09:26:52 +0000 (12:26 +0300)
commitbca23d19af0a6d7371d18f6fd763e37e03f6e21a
tree4f1643e90f80f400a48cff4e505dab37bf820f6c
parent1ae76f69df0eacf8f7fc7aab6b920010a5dde25f
Add headerGet() flag to force allocation of returned data
- earlier there was no way for caller to know if returned data or parts
  of it pointed to header memory (other than "know" how rpm behaves on
  given types), this allows consistent behavior for callers (ie you
  always "own" the returned data, not depending on header) when needed
- if HEADERGET_ALLOC flag is set, all returned data is malloced, instead
  of possibly pointing to header memory depending on type
- HEADERGET_ALLOC overrides HEADERGET_MINMEM if both specified
- adjust various header internal callers to accept flags instead of just
  minmem argument
- TODO: make sure tag extensions honor this too (all but fsnamesTag
  currently allocate anyway)
lib/header.c
lib/header.h