Exemplo n.º 1
0
static void
do_count (QofInstance * employee_p, gpointer count_p)
{
    int *count = count_p;
    if (employee_should_be_saved ((GncEmployee *) employee_p))
        (*count)++;
}
Exemplo n.º 2
0
static void
write_single_employee (QofInstance* term_p, gpointer data_p)
{
    write_objects_t* s = (write_objects_t*)data_p;

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

    if (s->is_ok && employee_should_be_saved (GNC_EMPLOYEE (term_p)))
    {
        s->is_ok = save_employee (s->be, term_p);
    }
}
Exemplo n.º 3
0
static void
xml_add_employee (QofInstance * employee_p, gpointer out_p)
{
    xmlNodePtr node;
    GncEmployee *employee = (GncEmployee *) employee_p;
    FILE *out = out_p;

    if (ferror(out))
        return;
    if (!employee_should_be_saved (employee))
        return;

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