Add type-safe headerPutFoo() methods for supported tag data types
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 19 Jun 2008 12:41:58 +0000 (15:41 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 19 Jun 2008 12:41:58 +0000 (15:41 +0300)
commit62d7b0c98d30c70613319e6af742827a67d9c732
tree41af9b2b14b0572c4ee425801d968107e5af18c2
parenta10f770ccaed6e722a0065a59887d6fc133cc86a
Add type-safe headerPutFoo() methods for supported tag data types
- requiring all access through rpmtdFromFoo() just adds unnecessary
  indirection and pain for little gain, the header is fairly intelligent
  when it comes to inserting data
- this gives us various benefits over the old headerAddEntry() interface too:
  + basic type checking done by compiler
  + extra sanity checking (ie you can't add string data to integer tags,
    don't permit adding more than one entry to non-array data etc)
  + "do the right thing" approach - add / append as needed and supported
    by various types
  + headerPutString() can now be used on both single strings and string
    arrays making the interface much nicer for the rather common case of
    appending strings one by one to string array tags
lib/header.c
lib/header.h