Added functions to add, remove and move substructs.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 26 Jan 2003 16:33:45 +0000 (16:33 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 26 Jan 2003 16:33:45 +0000 (16:33 +0000)
18 files changed:
gom/association.c
gom/event.c
gom/family_link.c
gom/func_template.h
gom/gom.c
gom/gom_internal.h
gom/lds_event.c
gom/multimedia_link.c
gom/note_sub.c
gom/personal_name.c
gom/source_citation.c
gom/source_description.c
gom/source_event.c
gom/user_rec.c
gom/user_ref.c
include/gom.h
t/output/update_gom.ref
t/src/update_gom.c

index 9398bbc49182929cb32efc2d7fe1cf536a825736..9e392099c5fe73daed06146a375ed7e339952c11 100644 (file)
@@ -58,6 +58,10 @@ Gedcom_ctxt sub_assoc_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(association)
+DEFINE_SUB_ADDFUNC(association)
+DEFINE_SUB_FINDFUNC(association)
+DEFINE_SUB_REMOVEFUNC(association)
+DEFINE_SUB_MOVEFUNC(association)
      
 DEFINE_STRING_CB(association, sub_assoc_rela_start, relation)
 
index b946aa64a2f069f44ca817fc9e6c36578c62b59d..3b45643c06265bcd735d176cf1e25010009533f5 100644 (file)
@@ -126,6 +126,10 @@ Gedcom_ctxt sub_attr_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(event)
+DEFINE_SUB_ADDFUNC(event)
+DEFINE_SUB_FINDFUNC(event)
+DEFINE_SUB_REMOVEFUNC(event)
+DEFINE_SUB_MOVEFUNC(event)
      
 DEFINE_STRING_CB(event, sub_evt_type_start, type)
 DEFINE_DATE_CB(event, sub_evt_date_start, date)
index cb5435be90781d1f18c3726236479e3da24319de..4ea3fc1c1bd1911504a671a15dbfacaf8668be0b 100644 (file)
@@ -84,6 +84,10 @@ Gedcom_ctxt sub_fam_link_pedi_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(family_link)
+DEFINE_SUB_ADDFUNC(family_link)
+DEFINE_SUB_FINDFUNC(family_link)
+DEFINE_SUB_REMOVEFUNC(family_link)
+DEFINE_SUB_MOVEFUNC(family_link)
      
 DEFINE_ADDFUNC2(family_link, note_sub, note)
 DEFINE_ADDFUNC2(family_link, user_data, extra)
@@ -115,6 +119,12 @@ void CLEANFUNC(pedigree)(struct pedigree* ped)
   }
 }
 
+DEFINE_SUB_MAKEFUNC(pedigree)
+DEFINE_SUB_ADDFUNC(pedigree)
+DEFINE_SUB_FINDFUNC(pedigree)
+DEFINE_SUB_REMOVEFUNC(pedigree)
+DEFINE_SUB_MOVEFUNC(pedigree)
+     
 void UNREFALLFUNC(family_link)(struct family_link* obj)
 {
   if (obj) {
index 769debb2a96e84c350da8c118a6e0067885bd7dc..d5b22c5e21032d177283f20259362807b59b8020 100644 (file)
 #define CLEANFUNC(STRUCTTYPE)    STRUCTTYPE ## _cleanup
 #define ADDFUNC(STRUCTTYPE)      gom_new_ ## STRUCTTYPE
 #define SUB_SETFUNC(STRUCTTYPE)  gom_set_new_ ## STRUCTTYPE
+#define SUB_ADDFUNC(STRUCTTYPE)  gom_add_new_ ## STRUCTTYPE
 #define UNREFALLFUNC(STRUCTTYPE) STRUCTTYPE ## _unref_all
 #define DELETEFUNC(STRUCTTYPE)   gom_delete_ ## STRUCTTYPE
 #define SUB_DELETEFUNC(STRUCTTYPE) gom_delete_ ## STRUCTTYPE
+#define SUB_FINDFUNC(STRUCTTYPE) find_ ## STRUCTTYPE
+#define SUB_REMOVEFUNC(STRUCTTYPE) gom_remove_ ## STRUCTTYPE
+#define SUB_MOVEFUNC(STRUCTTYPE) gom_move_ ## STRUCTTYPE
 #define ADDFUNC2(T1,T2)          T1 ## _add_ ## T2
 #define ADDFUNC2_TOVAR(T1,T2,F)  T1 ## _add_ ## T2 ## _to_ ## F
 #define ADDFUNC2_NOLIST(T1,T2)   ADDFUNC2(T1,T2)
     return obj;                                                               \
   }
 
+#define DEFINE_SUB_ADDFUNC(STRUCTTYPE)                                        \
+  struct STRUCTTYPE *SUB_ADDFUNC(STRUCTTYPE)(struct STRUCTTYPE** addto)       \
+  {                                                                           \
+    struct STRUCTTYPE *obj = NULL;                                            \
+    if (addto) {                                                              \
+      MAKE_CHAIN_ELT(STRUCTTYPE, *addto, obj);                                \
+    }                                                                         \
+    return obj;                                                               \
+  }
+
 #define DEFINE_DELETEFUNC(STRUCTTYPE)                                         \
   DECLARE_UNREFALLFUNC(STRUCTTYPE);                                           \
   int DELETEFUNC(STRUCTTYPE)(struct STRUCTTYPE* obj)                          \
     return result;                                                            \
   }
 
+#define DEFINE_SUB_FINDFUNC(STRUCTTYPE)                                       \
+  struct STRUCTTYPE* SUB_FINDFUNC(STRUCTTYPE)(struct STRUCTTYPE** data,       \
+                                             struct STRUCTTYPE* obj)         \
+  {                                                                           \
+    struct STRUCTTYPE* result = NULL;                                         \
+    struct STRUCTTYPE* runner;                                                \
+    for (runner = *data ; runner ; runner = runner->next) {                   \
+      if (runner == obj) {                                                    \
+       result = runner;                                                      \
+       break;                                                                \
+      }                                                                       \
+    }                                                                         \
+    if (! result)                                                             \
+      gom_find_error(#STRUCTTYPE);                                            \
+    return result;                                                            \
+  }
+
+#define DEFINE_SUB_REMOVEFUNC(STRUCTTYPE)                                     \
+  int SUB_REMOVEFUNC(STRUCTTYPE) (struct STRUCTTYPE** data,                   \
+                                 struct STRUCTTYPE* obj)                     \
+  {                                                                           \
+    int result = 1;                                                           \
+    if (data && obj) {                                                        \
+      struct STRUCTTYPE* toremove = SUB_FINDFUNC(STRUCTTYPE)(data, obj);      \
+      if (toremove) {                                                         \
+       UNLINK_CHAIN_ELT(STRUCTTYPE, *data, toremove);                        \
+       CLEANFUNC(STRUCTTYPE)(toremove);                                      \
+       SAFE_FREE(toremove);                                                  \
+       result = 0;                                                           \
+      }                                                                       \
+    }                                                                         \
+    return result;                                                            \
+  }
+
+#define DEFINE_SUB_MOVEFUNC(STRUCTTYPE)                                       \
+  int SUB_MOVEFUNC(STRUCTTYPE)(Gom_direction dir, struct STRUCTTYPE** data,   \
+                              struct STRUCTTYPE* obj)                        \
+  {                                                                           \
+    int result = 1;                                                           \
+    if (data && obj) {                                                        \
+      struct STRUCTTYPE* tomove = SUB_FINDFUNC(STRUCTTYPE)(data, obj);        \
+      if (tomove) {                                                           \
+       MOVE_CHAIN_ELT(STRUCTTYPE, dir, *data, tomove);                       \
+       result = 0;                                                           \
+      }                                                                       \
+    }                                                                         \
+    return result;                                                            \
+  }
+
 #define DEFINE_ADDFUNC2(STRUCTTYPE,T2,FIELD)                                  \
   void ADDFUNC2(STRUCTTYPE,T2)(Gom_ctxt ctxt, struct T2* addobj)              \
   {                                                                           \
index a3188ac10a4115466112d52ca259980ab7e3a7ea..6ca25d234ed2a5ebcef91c9e3b9b60ce38febe4d 100644 (file)
--- a/gom/gom.c
+++ b/gom/gom.c
@@ -223,6 +223,11 @@ void gom_move_error(const char* type)
   gedcom_warning(_("Could not move struct of type %s"), type);
 }
 
+void gom_find_error(const char* type)
+{
+  gedcom_warning(_("Could not find struct of type %s in chain"), type);
+}
+
 void gom_default_callback (Gedcom_elt elt UNUSED, Gedcom_ctxt parent UNUSED,
                           int level, char* tag, char* raw_value,
                           int parsed_tag UNUSED)
index 476cc9e362a7a1ed790f969d47c7912daf845b9f..baa11955bded95dc81924fea3cce9d748f1f24d0 100644 (file)
@@ -77,6 +77,7 @@ void gom_no_context(const char* file, int line);
 void gom_unexpected_context(const char* file, int line, OBJ_TYPE found);
 void gom_xref_already_in_use(const char *xrefstr);
 void gom_move_error(const char* type);
+void gom_find_error(const char* type);
 void unref_xref_value(struct xref_value *xref);
 
 int gom_write_xref_list(Gedcom_write_hndl hndl,
index b922bd258992e95faed426cca02caa58877db402..799e23d75431b257447e8c96030ceea8530b3f28 100644 (file)
@@ -67,6 +67,10 @@ Gedcom_ctxt sub_lds_event_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(lds_event)
+DEFINE_SUB_ADDFUNC(lds_event)
+DEFINE_SUB_FINDFUNC(lds_event)
+DEFINE_SUB_REMOVEFUNC(lds_event)
+DEFINE_SUB_MOVEFUNC(lds_event)
      
 DEFINE_STRING_CB(lds_event, sub_lds_event_stat_start, date_status)
 DEFINE_DATE_CB(lds_event, sub_lds_event_date_start, date)
index 44e9a2df79d6afec7bcabc99eeb2f827fdb93d46..fda4feb20018bc098d78711b433da34071b61538 100644 (file)
@@ -80,6 +80,10 @@ Gedcom_ctxt sub_obje_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(multimedia_link)
+DEFINE_SUB_ADDFUNC(multimedia_link)
+DEFINE_SUB_FINDFUNC(multimedia_link)
+DEFINE_SUB_REMOVEFUNC(multimedia_link)
+DEFINE_SUB_MOVEFUNC(multimedia_link)
      
 DEFINE_STRING_CB(multimedia_link, sub_obje_form_start, form)
 DEFINE_STRING_CB(multimedia_link, sub_obje_titl_start, title)
index e523b32ba120dc0cece1800f11f24642d0922180..8104aaeb8d19dcb09f1bbc0a6ad36d92576c08e3 100644 (file)
@@ -132,6 +132,10 @@ void sub_note_end(_ELT_END_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(note_sub)
+DEFINE_SUB_ADDFUNC(note_sub)
+DEFINE_SUB_FINDFUNC(note_sub)
+DEFINE_SUB_REMOVEFUNC(note_sub)
+DEFINE_SUB_MOVEFUNC(note_sub)
      
 DEFINE_ADDFUNC2(note_sub, source_citation, citation)
 DEFINE_ADDFUNC2(note_sub, user_data, extra)
index bff72bd87a9cf562c6e0599a656c1f2107813a75..686422fc3b88f2e8a228ee95e464fd2d9d72ca29 100644 (file)
@@ -62,6 +62,10 @@ Gedcom_ctxt sub_name_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(personal_name)
+DEFINE_SUB_ADDFUNC(personal_name)
+DEFINE_SUB_FINDFUNC(personal_name)
+DEFINE_SUB_REMOVEFUNC(personal_name)
+DEFINE_SUB_MOVEFUNC(personal_name)
      
 DEFINE_STRING_CB(personal_name, sub_name_npfx_start, prefix)
 DEFINE_STRING_CB(personal_name, sub_name_givn_start, given)
index 64ad42b4e7bb34ee1331bdc8424185155c4fe2cb..3738636fc086c90e207d17209ac0c118e39df7e7 100644 (file)
@@ -133,6 +133,10 @@ Gedcom_ctxt sub_cit_text_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(source_citation)
+DEFINE_SUB_ADDFUNC(source_citation)
+DEFINE_SUB_FINDFUNC(source_citation)
+DEFINE_SUB_REMOVEFUNC(source_citation)
+DEFINE_SUB_MOVEFUNC(source_citation)
      
 DEFINE_STRING_CB(source_citation, sub_cit_page_start, page)
 DEFINE_STRING_CB(source_citation, sub_cit_even_start, event)
@@ -182,6 +186,12 @@ void CLEANFUNC(text)(struct text* t)
   }
 }
 
+DEFINE_SUB_MAKEFUNC(text)
+DEFINE_SUB_ADDFUNC(text)
+DEFINE_SUB_FINDFUNC(text)
+DEFINE_SUB_REMOVEFUNC(text)
+DEFINE_SUB_MOVEFUNC(text)
+     
 void UNREFALLFUNC(source_citation)(struct source_citation* obj)
 {
   if (obj) {
index 71bd9e816db3a73c3357748ce8eb520f3345d2ca..65e98ac92e99bf72cb82e1cdcef40106063c490e 100644 (file)
@@ -62,6 +62,10 @@ Gedcom_ctxt sub_sour_caln_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(source_description)
+DEFINE_SUB_ADDFUNC(source_description)
+DEFINE_SUB_FINDFUNC(source_description)
+DEFINE_SUB_REMOVEFUNC(source_description)
+DEFINE_SUB_MOVEFUNC(source_description)
      
 DEFINE_STRING_CB(source_description, sub_sour_caln_medi_start, media)
 
index 6e353b962b587548095f716020b522be011b3e2c..319dbb7f8c0b854d2d2fe9d26bbca7ca709e5633 100644 (file)
@@ -62,6 +62,10 @@ Gedcom_ctxt sub_sour_even_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(source_event)
+DEFINE_SUB_ADDFUNC(source_event)
+DEFINE_SUB_FINDFUNC(source_event)
+DEFINE_SUB_REMOVEFUNC(source_event)
+DEFINE_SUB_MOVEFUNC(source_event)
      
 DEFINE_DATE_CB(source_event, sub_sour_even_date_start, date_period)
 DEFINE_STRING_CB(source_event, sub_sour_even_plac_start, jurisdiction)
index 4dfd14fba66e59ee85654c39f9d622e7a7b8529a..ba1dc5eca4145b42a2f5b0b1714bd5072ad27043 100644 (file)
@@ -241,6 +241,12 @@ Gedcom_ctxt user_elt_start(_ELT_PARAMS_)
   return (Gedcom_ctxt)result;
 }
 
+DEFINE_SUB_MAKEFUNC(user_data)
+DEFINE_SUB_ADDFUNC(user_data)
+DEFINE_SUB_FINDFUNC(user_data)
+DEFINE_SUB_REMOVEFUNC(user_data)
+DEFINE_SUB_MOVEFUNC(user_data)
+     
 void user_rec_subscribe()
 {
   gedcom_subscribe_to_record(REC_USER, user_rec_start, def_rec_end);
index 2c08e3afa8216a3db20cb753db22987673449a7e..1dac775aba5eb8cc633704ceb3a247b7c634fc71 100644 (file)
@@ -77,6 +77,10 @@ Gedcom_ctxt sub_user_ref_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(user_ref_number)
+DEFINE_SUB_ADDFUNC(user_ref_number)
+DEFINE_SUB_FINDFUNC(user_ref_number)
+DEFINE_SUB_REMOVEFUNC(user_ref_number)
+DEFINE_SUB_MOVEFUNC(user_ref_number)
      
 DEFINE_STRING_CB(user_ref_number, sub_user_ref_type_start, type)
 
index fbc5e39855759e58deaf90fa90499a02618f5ca5..85997e41cbe38f9d723063976501f1253f4c11f4 100644 (file)
@@ -482,6 +482,7 @@ typedef enum _DIR {
 } Gom_direction;
   
 struct xref_value* gom_set_xref(struct xref_value** data, const char* xref);
+  
 struct xref_list*  gom_add_xref(struct xref_list** data, const char* xref);
 int                gom_remove_xref(struct xref_list** data, const char* xref);
 int                gom_move_xref(Gom_direction dir, struct xref_list** data,
@@ -490,12 +491,112 @@ int                gom_move_xref(Gom_direction dir, struct xref_list** data,
 struct address*    gom_set_new_address(struct address** obj);
 int                gom_delete_address(struct address** obj);
 
-struct place*      gom_set_new_place(struct place** obj);
-int                gom_delete_place(struct place** obj);
-
+struct association* gom_add_new_association(struct association** data);
+int                gom_remove_association(struct association** data,
+                                         struct association* obj);
+int                gom_move_association(Gom_direction dir,
+                                       struct association** data,
+                                       struct association* obj);
+  
 struct change_date* gom_set_new_change_date(struct change_date** obj);
 int                 gom_delete_change_date(struct change_date** obj);
 int                 gom_update_timestamp(struct change_date** obj, time_t t);
+
+struct event*      gom_add_new_event(struct event** data);
+int                gom_remove_event(struct event** data, struct event* obj);
+int                gom_move_event(Gom_direction dir, struct event** data,
+                                 struct event* obj);
+  
+struct family_link* gom_add_new_family_link(struct family_link** data);
+int                gom_remove_family_link(struct family_link** data,
+                                         struct family_link* obj);
+int                gom_move_family_link(Gom_direction dir,
+                                       struct family_link** data,
+                                       struct family_link* obj);
+  
+struct lds_event*  gom_add_new_lds_event(struct lds_event** data);
+int                gom_remove_lds_event(struct lds_event** data,
+                                       struct lds_event* obj);
+int                gom_move_lds_event(Gom_direction dir,
+                                     struct lds_event** data,
+                                     struct lds_event* obj);
+  
+struct multimedia_link*
+                   gom_add_new_multimedia_link(struct multimedia_link** data);
+int                gom_remove_multimedia_link(struct multimedia_link** data,
+                                             struct multimedia_link* obj);
+int                gom_move_multimedia_link(Gom_direction dir,
+                                           struct multimedia_link** data,
+                                           struct multimedia_link* obj);
+  
+struct note_sub*   gom_add_new_note_sub(struct note_sub** data);
+int                gom_remove_note_sub(struct note_sub** data,
+                                      struct note_sub* obj);
+int                gom_move_note_sub(Gom_direction dir,
+                                    struct note_sub** data,
+                                    struct note_sub* obj);
+  
+struct pedigree*   gom_add_new_pedigree(struct pedigree** data);
+int                gom_remove_pedigree(struct pedigree** data,
+                                      struct pedigree* obj);
+int                gom_move_pedigree(Gom_direction dir,
+                                    struct pedigree** data,
+                                    struct pedigree* obj);
+  
+struct personal_name* gom_add_new_personal_name(struct personal_name** data);
+int                gom_remove_personal_name(struct personal_name** data,
+                                           struct personal_name* obj);
+int                gom_move_personal_name(Gom_direction dir,
+                                         struct personal_name** data,
+                                         struct personal_name* obj);
+  
+struct place*      gom_set_new_place(struct place** obj);
+int                gom_delete_place(struct place** obj);
+
+struct source_citation*
+                   gom_add_new_source_citation(struct source_citation** data);
+int                gom_remove_source_citation(struct source_citation** data,
+                                             struct source_citation* obj);
+int                gom_move_source_citation(Gom_direction dir,
+                                           struct source_citation** data,
+                                           struct source_citation* obj);
+  
+struct source_description*
+              gom_add_new_source_description(struct source_description** data);
+int           gom_remove_source_description(struct source_description** data,
+                                           struct source_description* obj);
+int           gom_move_source_description(Gom_direction dir,
+                                         struct source_description** data,
+                                         struct source_description* obj);
+  
+struct source_event* gom_add_new_source_event(struct source_event** data);
+int                gom_remove_source_event(struct source_event** data,
+                                          struct source_event* obj);
+int                gom_move_source_event(Gom_direction dir,
+                                        struct source_event** data,
+                                        struct source_event* obj);
+  
+struct text*       gom_add_new_text(struct text** data);
+int                gom_remove_text(struct text** data,
+                                  struct text* obj);
+int                gom_move_text(Gom_direction dir,
+                                struct text** data,
+                                struct text* obj);
+  
+struct user_data*  gom_add_new_user_data(struct user_data** data);
+int                gom_remove_user_data(struct user_data** data,
+                                       struct user_data* obj);
+int                gom_move_user_data(Gom_direction dir,
+                                     struct user_data** data,
+                                     struct user_data* obj);
+  
+struct user_ref_number*
+                   gom_add_new_user_ref_number(struct user_ref_number** data);
+int                gom_remove_user_ref_number(struct user_ref_number** data,
+                                             struct user_ref_number* obj);
+int                gom_move_user_ref_number(Gom_direction dir,
+                                           struct user_ref_number** data,
+                                           struct user_ref_number* obj);
   
 #ifdef __cplusplus
 }
index 9f486e5ca8eab7bd60064803d3d331a7d4009f25..26f74ffdab9a40c7d266f825109500b77c323cfe 100644 (file)
@@ -283,7 +283,18 @@ change date: 0x<null>
 User data: 0x<null>
 === INDIVIDUAL (@IND2@) ===
 Restriction notice: '(null)'
-names: 0x<null>
+names: 
+  Name: 
+    Name: 'Testname'
+    Prefix: '(null)'
+    Given: '(null)'
+    Nickname: '(null)'
+    Surname prefix: '(null)'
+    Surname: '(null)'
+    Suffix: '(null)'
+    citations: 0x<null>
+    notes: 0x<null>
+    User data: 0x<null>
 Sex: '(null)'
 Individual events: 0x<null>
 Individual attributes: 0x<null>
index dc48749911cd7407bae90598aa93c9793f643f70..a4e0b0e4b531582aa1b62d874d744248f6ce60e0 100644 (file)
@@ -213,7 +213,7 @@ int test_date_functions()
   return 0;
 }
 
-int test_record_add_delete_functions()
+int test_add_delete_functions()
 {
   struct family* fam1;
   struct individual *ind1, *ind2, *ind3, *ind4;
@@ -226,6 +226,7 @@ int test_record_add_delete_functions()
   struct user_rec* user1;
   struct xref_value* xr;
   struct xref_list* xrl;
+  struct personal_name* name;
   int result;
   char* value;
   const char* new_nr_of_children = "3";
@@ -301,22 +302,40 @@ int test_record_add_delete_functions()
   if (!xrl) return 124;
 
   result = gom_move_xref(MOVE_UP, &(fam1->children), ind4->xrefstr);
-  if (result != 0) return 127;
+  if (result != 0) return 125;
 
   result = gom_move_xref(MOVE_UP, &(fam1->children), ind4->xrefstr);
-  if (result != 0) return 128;
+  if (result != 0) return 126;
 
   result = gom_move_xref(MOVE_UP, &(fam1->children), ind4->xrefstr);
-  if (result != 0) return 129;
+  if (result != 0) return 127;
 
   result = gom_move_xref(MOVE_DOWN, &(fam1->children), ind4->xrefstr);
-  if (result != 0) return 130;
+  if (result != 0) return 128;
 
   result = gom_remove_xref(&(fam1->children), ind3->xrefstr);
-  if (result != 0) return 125;
+  if (result != 0) return 129;
 
   result = gom_remove_xref(&(fam1->children), ind4->xrefstr);
-  if (result != 0) return 126;
+  if (result != 0) return 130;
+
+  name = gom_add_new_personal_name(&(ind2->name));
+  if (name == NULL) return 131;
+
+  value = gom_set_string(&(name->name), "Testname");
+  if (value == NULL) return 132;
+
+  name = gom_add_new_personal_name(&(ind2->name));
+  if (name == NULL) return 133;
+
+  value = gom_set_string(&(name->name), "Testname 2");
+  if (value == NULL) return 134;
+
+  result = gom_move_personal_name(MOVE_UP, &(ind2->name), name);
+  if (result != 0) return 135;
+
+  result = gom_remove_personal_name(&(ind2->name), name);
+  if (result != 0) return 136;
 
   output(1, "Intermediate output:\n");
   show_data();
@@ -406,7 +425,7 @@ int main(int argc, char* argv[])
   if (result == 0)
     result |= test_date_functions();
   if (result == 0)
-    result |= test_record_add_delete_functions();
+    result |= test_add_delete_functions();
   if (result == 0) {
     output(1, "Test succeeded\n");
   }