Пример #1
0
int db_list_remove_db(int** list_head, db_header* db){
	return list_int_delete((int)db, list_head);
}
Пример #2
0
/** Return the HBCI return code of the given 'job', or zero if none was
 * found. If 'verbose' is TRUE, make a lot of debugging messages about
 * this outboxjob. */
static int
gnc_hbci_debug_outboxjob (GNCInteractor *inter, AB_JOB *job, gboolean verbose)
{
    int cause = 0;
    AB_JOB_STATUS jobstatus;

    g_assert (job);

    if (verbose)
    {
        g_warning("gnc_hbci_debug_outboxjob: Job status: %s", AB_Job_Status2Char(AB_Job_GetStatus(job)));

        g_warning(", result: %s", AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
        g_warning("\n");
    }

    jobstatus = AB_Job_GetStatus (job);
    if (jobstatus == AB_Job_StatusError)
    {
        if (AB_Job_GetResultText (job))
        {
            /* Add the "result text" to the log window */
            char *logstring = g_strdup_printf("Job %s had an error: %s\n",
                                              AB_Job_Type2Char(AB_Job_GetType(job)),
                                              AB_Job_GetResultText(job));
            GNCInteractor_add_log_text (inter, logstring);
            g_free (logstring);
        }

        if (!verbose)
            g_warning("gnc_hbci_debug_outboxjob: Job %s had an error: %s\n",
                      AB_Job_Type2Char(AB_Job_GetType(job)),
                      AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
        cause = 9000;
    }
    else
    {
        cause = 0;
    }

#if 0
    /* hbci debugging code; might be adapted to aqbanking at a later
       point in time */
    list = AB_JOB_resultCodes (job);
    if (list_int_size (list) > 0)
    {

        cause = get_resultcode_error (list);

        if (verbose)
        {
            g_warning("OutboxJob resultcodes: ");
            print_list_int (list);

            switch (cause)
            {
            case 9310:
                msg = "Schluessel noch nicht hinterlegt";
                break;
            case 9320:
                msg = "Schluessel noch nicht freigeschaltet";
                break;
            case 9330:
                msg = "Schluessel gesperrt";
                break;
            case 9340:
                msg = "Schluessel falsch";
                break;
            default:
                msg = "Unknown";
            }
            g_warning("Probable cause of error was: code %d, msg: %s\n", cause, msg);
        }
    }
    else
    {
        if (verbose)
            g_warning("OutboxJob's resultCodes list has zero length.\n");
    }
    list_int_delete (list);
#endif

    return cause;
}