31#include "xbps_api_impl.h"
34xbps_cb_message(
struct xbps_handle *xhp, xbps_dictionary_t pkgd,
const char *key)
38 const char *pkgver = NULL;
47 xbps_dictionary_get_cstring_nocopy(pkgd,
"pkgver", &pkgver);
50 msg = xbps_dictionary_get(pkgd, key);
51 if (xbps_object_type(msg) != XBPS_TYPE_DATA)
55 data = xbps_data_data_nocopy(msg);
56 len = xbps_data_size(msg);
59 memcpy(buf, data, len);
64 if (strcmp(key,
"install-msg") == 0)
65 xbps_set_cb_state(xhp, XBPS_STATE_SHOW_INSTALL_MSG, 0, pkgver,
"%s", buf);
67 xbps_set_cb_state(xhp, XBPS_STATE_SHOW_REMOVE_MSG, 0, pkgver,
"%s", buf);
Generic XBPS structure handler for initialization.