config_info_print_val(void *val, int type, char *buf)
{
    switch (type) {
    case CONFIG_TYPE_INT:
        sprintf(buf, "%d", (int)((uintptr_t)val));
        break;
    case CONFIG_TYPE_INT_OCTAL:
        sprintf(buf, "%o", (int)((uintptr_t)val));
        break;
    case CONFIG_TYPE_LONG:
        sprintf(buf, "%ld", (long)val);
        break;
    case CONFIG_TYPE_SIZE_T:
        sprintf(buf, "%" PRIu32, (uint32_t)((size_t)val));
        break;
    case CONFIG_TYPE_UINT64:
        sprintf(buf, "%" PRIu64, (uint64_t)((uintptr_t)val));
        break;
    case CONFIG_TYPE_STRING:
        PR_snprintf(buf, BUFSIZ, "%s", (char *)val);
        break;
    case CONFIG_TYPE_ONOFF:
        if ((int)((uintptr_t)val)) {
            sprintf(buf, "on");
        } else {
            sprintf(buf, "off");
        }
        break;
    }
}
config_info_print_val(void *val, int type, char *buf)
{
    switch (type) {
    case CONFIG_TYPE_INT:
        sprintf(buf, "%d", (int)((uintptr_t)val));
        break;
    case CONFIG_TYPE_INT_OCTAL:
        sprintf(buf, "%o", (int)((uintptr_t)val));
        break;
    case CONFIG_TYPE_LONG:
        sprintf(buf, "%ld", (long)val);
        break;
    case CONFIG_TYPE_SIZE_T:
        sprintf(buf, "%" PRIu32, (uint32_t)((size_t)val));
        break;
    case CONFIG_TYPE_UINT64:
        sprintf(buf, "%" PRIu64, (uint64_t)((uintptr_t)val));
        break;
    case CONFIG_TYPE_STRING:
        PR_snprintf(buf, BUFSIZ, "%s", (char *)val);
        break;
    case CONFIG_TYPE_ONOFF:
        if ((int)((uintptr_t)val)) {
            sprintf(buf, "on");
        } else {
            sprintf(buf, "off");
        }
        break;
    }
}