Example #1
0
char *gnc_hbci_getremotename (const AB_TRANSACTION *h_trans)
{
    /* Description */
    char *othername = NULL;
    char *result;
    const GWEN_STRINGLIST *h_remotename = AB_Transaction_GetRemoteName (h_trans);
    struct cb_struct cb_object;

    cb_object.gnc_iconv_handler =
        g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
    g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));

    /* Get othername */
    cb_object.result = &othername;
    if (h_remotename)
        GWEN_StringList_ForEach (h_remotename,
                                 &gnc_list_string_cb,
                                 &cb_object);
    /*DEBUG("HBCI Description '%s'", h_descr);*/

    if (othername && (strlen (othername) > 0))
        result = g_strdup (othername);
    else
        result = NULL;

    g_iconv_close(cb_object.gnc_iconv_handler);
    g_free (othername);
    return result;
}
Example #2
0
gchar *
gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)
{
    const GWEN_STRINGLIST *ab_purpose;
    gchar *gnc_description = NULL;

    g_return_val_if_fail(ab_trans, g_strdup(""));

    ab_purpose = AB_Transaction_GetPurpose(ab_trans);
    if (ab_purpose)
        GWEN_StringList_ForEach(ab_purpose, join_ab_strings_cb,
                                &gnc_description);

    if (!gnc_description)
        gnc_description = g_strdup("");

    return gnc_description;
}
Example #3
0
gchar *
gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans)
{
    const GWEN_STRINGLIST *ab_remote_name;
    gchar *gnc_other_name = NULL;

    g_return_val_if_fail(ab_trans, NULL);

    ab_remote_name = AB_Transaction_GetRemoteName(ab_trans);
    if (ab_remote_name)
        GWEN_StringList_ForEach(ab_remote_name, join_ab_strings_cb,
                                &gnc_other_name);

    if (!gnc_other_name || !*gnc_other_name)
    {
        g_free(gnc_other_name);
        gnc_other_name = NULL;
    }

    return gnc_other_name;
}
Example #4
0
char *gnc_hbci_getpurpose (const AB_TRANSACTION *h_trans)
{
    /* Description */
    char *h_descr = NULL;
    char *g_descr;
    const GWEN_STRINGLIST *h_purpose = AB_Transaction_GetPurpose (h_trans);
    struct cb_struct cb_object;

    cb_object.gnc_iconv_handler =
        g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
    g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));

    cb_object.result = &h_descr;
    if (h_purpose)
        GWEN_StringList_ForEach (h_purpose,
                                 &gnc_list_string_cb,
                                 &cb_object);

    g_descr = g_strdup (h_descr ? h_descr : "");

    g_iconv_close(cb_object.gnc_iconv_handler);
    g_free (h_descr);
    return g_descr;
}
Example #5
0
SVector StringList::toVector() const
{
  SVector result;
  GWEN_StringList_ForEach(m_ptr, &cb_func, &result);
  return result;
}