int headerPutString(Header h, rpmTag tag, const char *val) { rpmTagType type = rpmTagGetType(tag) & RPM_MASK_TYPE; const void *sptr = NULL; /* string arrays expect char **, arrange that */ if (type == RPM_STRING_ARRAY_TYPE || type == RPM_I18NSTRING_TYPE) { sptr = &val; } else if (type == RPM_STRING_TYPE) { sptr = val; } else { return 0; } return headerPutType(h, tag, type, sptr, 1); }
int headerPutBin(Header h, rpmTag tag, uint8_t *val, rpm_count_t size) { return headerPutType(h, tag, RPM_BIN_TYPE, val, size); }
int headerPutUint64(Header h, rpmTag tag, uint64_t *val, rpm_count_t size) { return headerPutType(h, tag, RPM_INT64_TYPE, val, size); }
int headerPutChar(Header h, rpmTag tag, char *val, rpm_count_t size) { return headerPutType(h, tag, RPM_CHAR_TYPE, val, size); }
int headerPutStringArray(Header h, rpmTag tag, const char **array, rpm_count_t size) { return headerPutType(h, tag, RPM_STRING_ARRAY_TYPE, array, size); }
int headerPutUint32(Header h, rpmTagVal tag, const uint32_t *val, rpm_count_t size) { return headerPutType(h, tag, RPM_INT32_TYPE, val, size); }