static int check_arg(const CmdArgs *cmd_args, QDict *args)

{

    QObject *value;

    const char *name;



    name = qstring_get_str(cmd_args->name);



    if (!args) {

        return check_opt(cmd_args, name, args);

    }



    value = qdict_get(args, name);

    if (!value) {

        return check_opt(cmd_args, name, args);

    }



    switch (cmd_args->type) {

        case 'F':

        case 'B':

        case 's':

            if (qobject_type(value) != QTYPE_QSTRING) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "string");

                return -1;

            }

            break;

        case '/': {

            int i;

            const char *keys[] = { "count", "format", "size", NULL };



            for (i = 0; keys[i]; i++) {

                QObject *obj = qdict_get(args, keys[i]);

                if (!obj) {

                    qerror_report(QERR_MISSING_PARAMETER, name);

                    return -1;

                }

                if (qobject_type(obj) != QTYPE_QINT) {

                    qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "int");

                    return -1;

                }

            }

            break;

        }

        case 'i':

        case 'l':

        case 'M':

            if (qobject_type(value) != QTYPE_QINT) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "int");

                return -1;

            }

            break;

        case 'f':

        case 'T':

            if (qobject_type(value) != QTYPE_QINT && qobject_type(value) != QTYPE_QFLOAT) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "number");

                return -1;

            }

            break;

        case 'b':

            if (qobject_type(value) != QTYPE_QBOOL) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "bool");

                return -1;

            }

            break;

        case '-':

            if (qobject_type(value) != QTYPE_QINT &&

                qobject_type(value) != QTYPE_QBOOL) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "bool");

                return -1;

            }

            break;

        case 'O':

        default:

            /* impossible */

            abort();

    }



    return 0;

}

static int check_arg(const CmdArgs *cmd_args, QDict *args)

{

    QObject *value;

    const char *name;



    name = qstring_get_str(cmd_args->name);



    if (!args) {

        return check_opt(cmd_args, name, args);

    }



    value = qdict_get(args, name);

    if (!value) {

        return check_opt(cmd_args, name, args);

    }



    switch (cmd_args->type) {

        case 'F':

        case 'B':

        case 's':

            if (qobject_type(value) != QTYPE_QSTRING) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "string");

                return -1;

            }

            break;

        case '/': {

            int i;

            const char *keys[] = { "count", "format", "size", NULL };



            for (i = 0; keys[i]; i++) {

                QObject *obj = qdict_get(args, keys[i]);

                if (!obj) {

                    qerror_report(QERR_MISSING_PARAMETER, name);

                    return -1;

                }

                if (qobject_type(obj) != QTYPE_QINT) {

                    qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "int");

                    return -1;

                }

            }

            break;

        }

        case 'i':

        case 'l':

        case 'M':

            if (qobject_type(value) != QTYPE_QINT) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "int");

                return -1;

            }

            break;

        case 'f':

        case 'T':

            if (qobject_type(value) != QTYPE_QINT && qobject_type(value) != QTYPE_QFLOAT) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "number");

                return -1;

            }

            break;

        case 'b':

            if (qobject_type(value) != QTYPE_QBOOL) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "bool");

                return -1;

            }

            break;

        case '-':

            if (qobject_type(value) != QTYPE_QINT &&

                qobject_type(value) != QTYPE_QBOOL) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "bool");

                return -1;

            }

            break;

        case 'O':

        default:

            

            abort();

    }



    return 0;

}

static int FUNC_0(const CmdArgs *VAR_0, QDict *VAR_1)

{

    QObject *value;

    const char *VAR_2;



    VAR_2 = qstring_get_str(VAR_0->VAR_2);



    if (!VAR_1) {

        return check_opt(VAR_0, VAR_2, VAR_1);

    }



    value = qdict_get(VAR_1, VAR_2);

    if (!value) {

        return check_opt(VAR_0, VAR_2, VAR_1);

    }



    switch (VAR_0->type) {

        case 'F':

        case 'B':

        case 's':

            if (qobject_type(value) != QTYPE_QSTRING) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "string");

                return -1;

            }

            break;

        case '/': {

            int VAR_3;

            const char *VAR_4[] = { "count", "format", "size", NULL };



            for (VAR_3 = 0; VAR_4[VAR_3]; VAR_3++) {

                QObject *obj = qdict_get(VAR_1, VAR_4[VAR_3]);

                if (!obj) {

                    qerror_report(QERR_MISSING_PARAMETER, VAR_2);

                    return -1;

                }

                if (qobject_type(obj) != QTYPE_QINT) {

                    qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "int");

                    return -1;

                }

            }

            break;

        }

        case 'VAR_3':

        case 'l':

        case 'M':

            if (qobject_type(value) != QTYPE_QINT) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "int");

                return -1;

            }

            break;

        case 'f':

        case 'T':

            if (qobject_type(value) != QTYPE_QINT && qobject_type(value) != QTYPE_QFLOAT) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "number");

                return -1;

            }

            break;

        case 'b':

            if (qobject_type(value) != QTYPE_QBOOL) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "bool");

                return -1;

            }

            break;

        case '-':

            if (qobject_type(value) != QTYPE_QINT &&

                qobject_type(value) != QTYPE_QBOOL) {

                qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "bool");

                return -1;

            }

            break;

        case 'O':

        default:

            

            abort();

    }



    return 0;

}

static int FUNC_0(const CmdArgs *VAR_0, QDict *VAR_1)
{ QObject *value; const char *VAR_2; VAR_2 = qstring_get_str(VAR_0->VAR_2); if (!VAR_1) { return check_opt(VAR_0, VAR_2, VAR_1); } value = qdict_get(VAR_1, VAR_2); if (!value) { return check_opt(VAR_0, VAR_2, VAR_1); } switch (VAR_0->type) { case 'F':
case 'B':
case 's':
if (qobject_type(value) != QTYPE_QSTRING) { qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "string"); return -1; } break; case '/': { int VAR_3; const char *VAR_4[] = { "count", "format", "size", NULL }; for (VAR_3 = 0; VAR_4[VAR_3]; VAR_3++) { QObject *obj = qdict_get(VAR_1, VAR_4[VAR_3]); if (!obj) { qerror_report(QERR_MISSING_PARAMETER, VAR_2); return -1; } if (qobject_type(obj) != QTYPE_QINT) { qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "int"); return -1; } } break; } case 'VAR_3':
case 'l':
case 'M':
if (qobject_type(value) != QTYPE_QINT) { qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "int"); return -1; } break; case 'f':
case 'T':
if (qobject_type(value) != QTYPE_QINT && qobject_type(value) != QTYPE_QFLOAT) { qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "number"); return -1; } break; case 'b':
if (qobject_type(value) != QTYPE_QBOOL) { qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "bool"); return -1; } break; case '-':
if (qobject_type(value) != QTYPE_QINT &&
qobject_type(value) != QTYPE_QBOOL) { qerror_report(QERR_INVALID_PARAMETER_TYPE, VAR_2, "bool"); return -1; } break; case 'O':
default:
abort(); } return 0; }