General Public License for more details.
*/
-#include "libopkg.h"
#include "opkg_state.h"
static char *opkg_state_data = NULL;
void
-opkg_set_current_state (opkg_state_t state, const char *data)
+opkg_set_current_state (opkg_conf_t *conf, opkg_state_t state, const char *data)
{
if (opkg_state_data)
free (opkg_state_data);
if (data)
{
- opkg_state_data = malloc (strlen (data));
- strcpy (opkg_state_data, data);
+ opkg_state_data = strdup (data);
}
else
{
}
- printf ("opkg state set to %s: %s\n", state_strings[state], data);
+ if (data == NULL)
+ opkg_message (conf, OPKG_INFO, "opkg state set to %s\n", state_strings[state]);
+ else
+ opkg_message (conf, OPKG_INFO, "opkg state set to %s: %s\n", state_strings[state], data);
}
void