static int send_response(GAState *s, QObject *payload)

{

    const char *buf;

    QString *payload_qstr;

    GIOStatus status;



    g_assert(payload && s->channel);



    payload_qstr = qobject_to_json(payload);

    if (!payload_qstr) {

        return -EINVAL;

    }



    qstring_append_chr(payload_qstr, '\n');

    buf = qstring_get_str(payload_qstr);

    status = ga_channel_write_all(s->channel, buf, strlen(buf));

    QDECREF(payload_qstr);

    if (status != G_IO_STATUS_NORMAL) {

        return -EIO;

    }



    return 0;

}

static int send_response(GAState *s, QObject *payload)

{

    const char *buf;

    QString *payload_qstr;

    GIOStatus status;



    g_assert(payload && s->channel);



    payload_qstr = qobject_to_json(payload);

    if (!payload_qstr) {

        return -EINVAL;

    }



    qstring_append_chr(payload_qstr, '\n');

    buf = qstring_get_str(payload_qstr);

    status = ga_channel_write_all(s->channel, buf, strlen(buf));

    QDECREF(payload_qstr);

    if (status != G_IO_STATUS_NORMAL) {

        return -EIO;

    }



    return 0;

}

static int FUNC_0(GAState *VAR_0, QObject *VAR_1)

{

    const char *VAR_2;

    QString *payload_qstr;

    GIOStatus status;



    g_assert(VAR_1 && VAR_0->channel);



    payload_qstr = qobject_to_json(VAR_1);

    if (!payload_qstr) {

        return -EINVAL;

    }



    qstring_append_chr(payload_qstr, '\n');

    VAR_2 = qstring_get_str(payload_qstr);

    status = ga_channel_write_all(VAR_0->channel, VAR_2, strlen(VAR_2));

    QDECREF(payload_qstr);

    if (status != G_IO_STATUS_NORMAL) {

        return -EIO;

    }



    return 0;

}

static int FUNC_0(GAState *VAR_0, QObject *VAR_1)
{ const char *VAR_2; QString *payload_qstr; GIOStatus status; g_assert(VAR_1 && VAR_0->channel); payload_qstr = qobject_to_json(VAR_1); if (!payload_qstr) { return -EINVAL; } qstring_append_chr(payload_qstr, '\n'); VAR_2 = qstring_get_str(payload_qstr); status = ga_channel_write_all(VAR_0->channel, VAR_2, strlen(VAR_2)); QDECREF(payload_qstr); if (status != G_IO_STATUS_NORMAL) { return -EIO; } return 0; }