diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-06-11 12:26:52 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-06-11 12:26:52 +0300 |
commit | bca23d19af0a6d7371d18f6fd763e37e03f6e21a (patch) | |
tree | 4f1643e90f80f400a48cff4e505dab37bf820f6c /lib/header.h | |
parent | 1ae76f69df0eacf8f7fc7aab6b920010a5dde25f (diff) | |
download | rpm-bca23d19af0a6d7371d18f6fd763e37e03f6e21a.tar.gz rpm-bca23d19af0a6d7371d18f6fd763e37e03f6e21a.tar.bz2 rpm-bca23d19af0a6d7371d18f6fd763e37e03f6e21a.zip |
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)
Diffstat (limited to 'lib/header.h')
-rw-r--r-- | lib/header.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/header.h b/lib/header.h index 6ed714139..3188aa4a8 100644 --- a/lib/header.h +++ b/lib/header.h @@ -154,6 +154,7 @@ typedef enum headerGetFlags_e { HEADERGET_MINMEM = (1 << 0), /* string pointers refer to header memory */ HEADERGET_EXT = (1 << 1), /* lookup extension types too */ HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */ + HEADERGET_ALLOC = (1 << 3), /* always allocate memory for all data */ } headerGetFlags; /** \ingroup header |