void profileval_ctor_ex(profileval_t *self, const char *key, const char *val, const char *type) { profileval_ctor(self); xstrset(&self->pv_key, key); xstrset(&self->pv_val, val); xstrset(&self->pv_type, type); }
static void message(const char *profile, const char *fmt, ...) { static char *previous = 0; static struct timeval zen; static const struct timeval tmo = { 0, 100 * 1000 }; struct timeval now, dif; int gap = 0; getmonotime(&now); timersub(&now, &zen, &dif); if( timercmp(&tmo, &dif, <) ) { zen = now; gap = 1; } if( !xstrsame(previous, profile) ) { xstrset(&previous, profile); gap = 1; } if( gap ) printf("\n"); va_list va; va_start(va, fmt); vprintf(fmt, va); va_end(va); }
void inival_set(inival_t *self, const char *val) { xstrset(&self->iv_val, val); }
void inifile_set_path(inifile_t *self, const char *path) { xstrset(&self->if_path, path); }
void alarm_action_set_dbus_name(alarm_action_t *self, const char *dbus_name) { xstrset(&self->dbus_name, dbus_name); }
void alarm_action_set_dbus_path(alarm_action_t *self, const char *dbus_path) { xstrset(&self->dbus_path, dbus_path); }
void alarm_action_set_dbus_interface(alarm_action_t *self, const char *dbus_interface) { xstrset(&self->dbus_interface, dbus_interface); }
void alarm_action_set_exec_command(alarm_action_t *self, const char *exec_command) { xstrset(&self->exec_command, exec_command); }
void alarm_action_set_label(alarm_action_t *self, const char *label) { xstrset(&self->label, label); }