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

« back to all changes in this revision

Viewing changes to src/gedlib/brwslist.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:
32
32
#include "translat.h"
33
33
#include "gedcom.h"
34
34
#include "indiseq.h"
35
 
 
36
 
LIST browse_lists;
 
35
#include "vtable.h"
 
36
 
 
37
/*********************************************
 
38
 * global/exported variables
 
39
 *********************************************/
 
40
 
37
41
INDISEQ current_seq = NULL;
38
42
 
39
 
typedef struct {
 
43
/*********************************************
 
44
 * local types
 
45
 *********************************************/
 
46
 
 
47
struct tag_blel {
 
48
        struct tag_vtable *vtable; /* generic object */
 
49
        INT refcnt; /* ref-countable object */
40
50
        STRING bl_name;
41
51
        INDISEQ bl_seq;
42
 
} *BLEL, BLEL_struct;
 
52
};
 
53
typedef struct tag_blel *BLEL;
 
54
 
 
55
/*********************************************
 
56
 * local function prototypes
 
57
 *********************************************/
 
58
 
 
59
static void blel_destructor(VTABLE *obj);
 
60
static BLEL create_new_blel(void);
 
61
/* unused
 
62
static void destroy_blel(BLEL blel);
 
63
*/
 
64
 
 
65
/*********************************************
 
66
 * local variables
 
67
 *********************************************/
 
68
 
 
69
static struct tag_vtable vtable_for_blel = {
 
70
        VTABLE_MAGIC
 
71
        , "blel"
 
72
        , &blel_destructor
 
73
        , &refcountable_isref
 
74
        , &refcountable_addref
 
75
        , &refcountable_release
 
76
        , 0 /* copy_fnc */
 
77
        , &generic_get_type_name
 
78
};
 
79
static LIST browse_lists=0;
 
80
 
 
81
/*********************************************
 
82
 * local & exported function definitions
 
83
 * body of module
 
84
 *********************************************/
43
85
 
44
86
/*=====================================================
45
87
 *  init_browse_lists -- Initialize named browse lists.
50
92
        browse_lists = create_list();
51
93
}
52
94
/*===========================================
 
95
 *  create_new_blel -- Create browse list entry
 
96
 *=========================================*/
 
97
static BLEL
 
98
create_new_blel (void)
 
99
{
 
100
        BLEL blel = (BLEL) stdalloc(sizeof(*blel));
 
101
        memset(blel, 0, sizeof(*blel));
 
102
        blel->vtable = &vtable_for_blel;
 
103
        blel->refcnt = 1;
 
104
        return blel;
 
105
}
 
106
/*===========================================
53
107
 *  add_browse_list -- Add named browse list.
54
108
 *=========================================*/
55
109
void
56
 
add_browse_list (STRING name,
57
 
                 INDISEQ seq)
 
110
add_browse_list (STRING name, INDISEQ seq)
58
111
{
59
112
        BLEL blel;
60
113
        BOOLEAN done = FALSE;
79
132
                        return;
80
133
                }
81
134
        ENDLIST
82
 
        blel = (BLEL) stdalloc(sizeof(BLEL_struct));
 
135
        blel = create_new_blel();
83
136
        blel->bl_name = name;
84
137
        blel->bl_seq = seq;
85
138
        enqueue_list(browse_lists, blel);
192
245
                rename_indiseq(seq, key);
193
246
        ENDLIST
194
247
}
 
248
/*=================================================
 
249
 * blel_destructor -- destructor for blel (browse list element)
 
250
 *  (destructor entry in vtable)
 
251
 *===============================================*/
 
252
static void
 
253
blel_destructor (VTABLE *obj)
 
254
{
 
255
        BLEL blel = (BLEL)obj;
 
256
        ASSERT(blel->vtable == &vtable_for_blel);
 
257
        stdfree(blel);
 
258
}
 
259
/*=================================================
 
260
 * destroy_blel -- destroy and free blel (browse list element)
 
261
 * All blels are destroyed in this function
 
262
 *===============================================*/
 
263
/* not used
 
264
static void
 
265
destroy_blel (BLEL blel)
 
266
{
 
267
        stdfree(blel->bl_name);
 
268
        remove_indiseq(blel->bl_seq);   
 
269
        stdfree(blel);
 
270
}
 
271
*/