}
#endif /* !__OpenBSD__ */
OBJ(freq) {
- if (obj->a) {
- obj->a = get_freq(p, p_max_size, "%.0f", 1,
+ static int ok = 1;
+ if (ok) {
+ ok = get_freq(p, p_max_size, "%.0f", 1,
obj->data.i);
}
}
OBJ(freq_g) {
- if (obj->a) {
+ static int ok = 1;
+ if (ok) {
#ifndef __OpenBSD__
- obj->a = get_freq(p, p_max_size, "%'.2f", 1000,
+ ok = get_freq(p, p_max_size, "%'.2f", 1000,
obj->data.i);
#else
/* OpenBSD has no such flag (SUSv2) */
- obj->a = get_freq(p, p_max_size, "%.2f", 1000,
+ ok = get_freq(p, p_max_size, "%.2f", 1000,
obj->data.i);
#endif /* __OpenBSD */
}
}
#if defined(__linux__)
OBJ(voltage_mv) {
- if (obj->a) {
- obj->a = get_voltage(p, p_max_size, "%.0f", 1,
+ static int ok = 1;
+ if (ok) {
+ ok = get_voltage(p, p_max_size, "%.0f", 1,
obj->data.i);
}
}
OBJ(voltage_v) {
- if (obj->a) {
- obj->a = get_voltage(p, p_max_size, "%'.3f", 1000,
+ static int ok = 1;
+ if (ok) {
+ ok = get_voltage(p, p_max_size, "%'.3f", 1000,
obj->data.i);
}
}
print_tailhead("head", obj, p, p_max_size);
}
OBJ(lines) {
- FILE *fp = open_file(obj->data.s, &obj->a);
+ static int rep = 0;
+ FILE *fp = open_file(obj->data.s, &rep);
if(fp != NULL) {
/* FIXME: use something more general (see also tail.c, head.c */
}
OBJ(words) {
- FILE *fp = open_file(obj->data.s, &obj->a);
+ static int rep = 0;
+ FILE *fp = open_file(obj->data.s, &rep);
if(fp != NULL) {
char buf[BUFSZ];
} else {
obj->data.i = atoi(&arg[0]);
}
- obj->a = 1;
END OBJ(freq_g, 0)
get_cpu_count();
if (!arg || !isdigit(arg[0]) || strlen(arg) >= 2 || atoi(&arg[0]) == 0
} else {
obj->data.i = atoi(&arg[0]);
}
- obj->a = 1;
END OBJ_ARG(read_tcp, 0, "read_tcp: Needs \"(host) port\" as argument(s)")
parse_read_tcp_arg(obj, arg, free_at_crash);
#if defined(__linux__)
} else {
obj->data.i = atoi(&arg[0]);
}
- obj->a = 1;
END OBJ(voltage_v, 0)
get_cpu_count();
if (!arg || !isdigit(arg[0]) || strlen(arg) >= 2 || atoi(&arg[0]) == 0
} else {
obj->data.i = atoi(&arg[0]);
}
- obj->a = 1;
#ifdef HAVE_IWLIB
END OBJ(wireless_essid, &update_net_stats)
if (new_iconv == (iconv_t) (-1)) {
NORM_ERR("Can't convert from %s to %s.", iconv_from, iconv_to);
} else {
- obj->a = register_iconv(&new_iconv);
+ obj->data.i = register_iconv(&new_iconv);
iconv_converting = 1;
}
}
void do_iconv_start(struct text_object *obj)
{
iconv_converting = 1;
- iconv_selected = obj->a;
+ iconv_selected = obj->data.i;
}
void do_iconv_stop(void)