Пример #1
0
static void
do_count (QofInstance * cust_p, gpointer count_p)
{
    int *count = count_p;
    if (customer_should_be_saved ((GncCustomer *)cust_p))
        (*count)++;
}
Пример #2
0
static void
do_count (QofInstance* cust_p, gpointer count_p)
{
    int* count = static_cast<decltype (count)> (count_p);
    if (customer_should_be_saved ((GncCustomer*)cust_p))
        (*count)++;
}
Пример #3
0
static void
write_single_customer( QofInstance *term_p, gpointer data_p )
{
    write_customers_t* data = (write_customers_t*)data_p;

    g_return_if_fail( term_p != NULL );
    g_return_if_fail( GNC_IS_CUSTOMER(term_p) );
    g_return_if_fail( data_p != NULL );

    if ( customer_should_be_saved( GNC_CUSTOMER(term_p) ) && data->is_ok )
    {
        data->is_ok = save_customer( data->be, term_p );
    }
}
Пример #4
0
static void
xml_add_customer (QofInstance * cust_p, gpointer out_p)
{
    xmlNodePtr node;
    GncCustomer *cust = (GncCustomer *) cust_p;
    FILE *out = out_p;

    if (ferror(out))
        return;
    if (!customer_should_be_saved (cust))
        return;

    node = customer_dom_tree_create (cust);
    xmlElemDump(out, NULL, node);
    xmlFreeNode (node);
    if (ferror(out) || fprintf(out, "\n") < 0)
        return;
}