~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to src/gedlib/editvtab.c

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-05-23 23:49:53 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20070523234953-ogno9rnbmth61i7p
Tags: 3.0.50-2etch1
* Changing docs/ll-reportmanual.xml and docs/ll-userguide.xml to fix
  documentation build problems (Closes: #418347).

* lifelines-reports
  - Adding a dependency to lifelines >= 3.0.50 to prevent file conflict.
    (Closes: #405500).

* Updating French translation. Thanks to Bernard Adrian. (Closes: #356671).

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 *===========================================================*/
31
31
 
32
32
#include "sys_inc.h"
33
 
#include <curses.h>
 
33
#include "mycurses.h"
34
34
#include "llstdlib.h"
35
35
#include "table.h"
36
36
#include "translat.h"
42
42
 
43
43
static STRING trans_edin(STRING input, INT len);
44
44
static STRING trans_ined(STRING input, INT len);
45
 
static BOOLEAN edit_valtab_impl(TABLE *ptab, INT sep, STRING ermsg, STRING (*validator)(TABLE tab));
 
45
static BOOLEAN edit_valtab_impl(TABLE *ptab, INT sep, STRING ermsg, STRING (*validator)(TABLE tab, void * param), void * param);
46
46
 
47
47
/*
48
48
TODO
62
62
 * single character (the sep arg) between each key & value.
63
63
 *============================================*/
64
64
BOOLEAN
65
 
edit_valtab_from_db (STRING key, TABLE *ptab, INT sep, STRING ermsg, STRING (*validator)(TABLE tab))
 
65
edit_valtab_from_db (STRING key, TABLE *ptab, INT sep, STRING ermsg, STRING (*validator)(TABLE tab, void * param), void * param)
66
66
{
67
 
        endwin();
68
 
 
69
67
        unlink(editfile);
70
68
 
71
69
        if (retrieve_to_textfile(key, editfile, trans_ined) == RECORD_ERROR) {
72
70
                msg_error(_(qSdataerr));
73
71
                return FALSE;
74
72
        }
75
 
        if (!edit_valtab_impl(ptab, sep, ermsg, validator))
 
73
        if (!edit_valtab_impl(ptab, sep, ermsg, validator, param))
76
74
                return FALSE;
77
75
 
78
76
        if (readonly) {
95
93
 * single character (the sep arg) between each key & value.
96
94
 *============================================*/
97
95
static BOOLEAN
98
 
edit_valtab_impl (TABLE *ptab, INT sep, STRING ermsg, STRING (*validator)(TABLE tab))
 
96
edit_valtab_impl (TABLE *ptab, INT sep, STRING ermsg, STRING (*validator)(TABLE tab, void * param), void * param)
99
97
{
100
98
        TABLE tmptab = NULL;
101
99
        STRING msg;
102
100
        static char fullerr[78]; /* TODO -- fix static usage */
103
101
        STRING ptr;
104
102
        XLAT ttmi = transl_get_predefined_xlat(MEDIN);
105
 
        endwin();
106
103
 
107
104
        do_edit();
108
105
        while (TRUE) {
109
 
                tmptab = create_table(FREEBOTH);
 
106
                tmptab = create_table_str();
110
107
                if (init_valtab_from_file(editfile, tmptab, ttmi, sep, &msg)) {
111
 
                        if (!validator || !(ptr = (*validator)(tmptab))) {
 
108
                        if (!validator || !(ptr = (*validator)(tmptab, param))) {
112
109
                                if (*ptab) destroy_table(*ptab);
113
110
                                *ptab = tmptab;
114
111
                                return TRUE;