Example #1
0
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);
}
Example #2
0
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);
}
Example #3
0
void
inival_set(inival_t *self, const char *val)
{
  xstrset(&self->iv_val, val);
}
Example #4
0
void
inifile_set_path(inifile_t *self, const char *path)
{
  xstrset(&self->if_path, path);
}
Example #5
0
void
alarm_action_set_dbus_name(alarm_action_t *self, const char *dbus_name)
{
  xstrset(&self->dbus_name, dbus_name);
}
Example #6
0
void
alarm_action_set_dbus_path(alarm_action_t *self, const char *dbus_path)
{
  xstrset(&self->dbus_path, dbus_path);
}
Example #7
0
void
alarm_action_set_dbus_interface(alarm_action_t *self, const char *dbus_interface)
{
  xstrset(&self->dbus_interface, dbus_interface);
}
Example #8
0
void
alarm_action_set_exec_command(alarm_action_t *self, const char *exec_command)
{
  xstrset(&self->exec_command, exec_command);
}
Example #9
0
void
alarm_action_set_label(alarm_action_t *self, const char *label)
{
  xstrset(&self->label, label);
}