1 /****************************************************************************
2 * Familia Lignum - Genealogical program *
3 * Copyright (C) 2011-2012 Rafał Długołęcki <rafal@dlugolecki.net.pl> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; version 2 of the License. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License along *
15 * with this program; if not, write to the Free Software Foundation, Inc., *
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18 ****************************************************************************/
20 #ifndef _FAMILIA_MARRIAGE_H
21 #define _FAMILIA_MARRIAGE_H
23 #include "individual.h"
25 enum FFamilyIndividualIndex {
31 * Structure holding family data.
33 struct familia_family {
34 /** Marriage identifier */
37 /** First individual of family */
38 struct familia_individual * individual1;
40 /** Second individual of family */
41 struct familia_individual * individual2;
45 * Creates new family structure
46 * @return Newly allocated individual.If allocation failed, returns NULL, like
49 struct familia_family * familia_family_new();
52 * Frees allocated memory of the given family
53 * DISCLAIMER! This function does not remove linked individuals. You have to
54 * remove them manually from storage.
55 * @parameter individual free
57 void familia_family_free(struct familia_family * family);
60 * Sets individual1 in the given family
61 * @parameter family to set the individual
62 * @parameter individual which will be set
64 void familia_family_set_individual(struct familia_family * family, struct familia_individual * individual, enum FFamilyIndividualIndex index);
67 * Gets individual from the given family
68 * @parameter family to get the individual
69 * @parameter individual index of which individual get
71 struct familia_individual * familia_family_get_individual(struct familia_family * family, enum FFamilyIndividualIndex index);
74 * Removes individual from the given family
75 * DISCLAIMER! This function does not remove linked individuals. You have to
76 * remove them manually from storage.
77 * @parameter family to remove the individual
78 * @parameter individual index of which individual to remove
80 struct familia_individual * familia_family_remove_individual(struct familia_family * family, enum FFamilyIndividualIndex index);
82 #endif /*_FAMILIA_MARRIAGE_H */