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_INDIVIDUAL_H
21 #define _FAMILIA_INDIVIDUAL_H
26 * Structure holding individual data.
28 struct familia_individual {
29 /** Individual identifier */
32 /** Individual first name */
35 /** Individual last name */
38 /** Individual families */
39 struct familia_family ** families;
41 /** Number of families */
42 unsigned int families_no;
46 * Creates new individual structure
47 * @return Newly allocated individual. If allocation failed, returns NULL, like
50 struct familia_individual * familia_individual_new();
53 * Frees allocated memory of the given individual
54 * DISCLAIMER! This function does not remove linked families. You have to
55 * remove them manually from storage.
56 * @parameter individual to free
58 void familia_individual_free(struct familia_individual * individual);
61 * Sets first name of the given individual
62 * @parameter individual to set first name
63 * @parameter first name to set
65 void familia_individual_set_first_name(struct familia_individual * individual, char * first_name);
68 * Gets first name of the given individual
69 * @parameter individual from whom get the first name
70 * @return individuals first name
72 char * familia_individual_get_first_name(struct familia_individual * individual);
75 * Sets last name of the given individual
76 * @parameter individual to set last name
77 * @parameter last name to set
79 void familia_individual_set_last_name(struct familia_individual * individual, char * last_name);
82 * Gets last name of the given individual
83 * @parameter individual from whom get the last name
84 * @return individuals last name
86 char * familia_individual_get_last_name(struct familia_individual * individual);
89 * Adds family to the given individual
90 * @parameter individual to set last name
91 * @parameter last name to set
93 void familia_individual_add_family(struct familia_individual * individual, struct familia_family * family);
96 * Gets family with the given id of the given individual
97 * @parameter individual from whom get the family
98 * @parameter family id of the individual
99 * @return individuals last name
101 struct familia_family * familia_individual_get_family_by_id(struct familia_individual * individual, unsigned int id);
104 * Removes family with the given id from the given individual
105 * DISCLAIMER! This function does not remove linked families. You have to
106 * remove them manually from storage.
107 * @parameter individual from whom family will be removed
108 * @parameter family id of the individual
110 void familia_individual_remove_family_by_id(struct familia_individual * individual, unsigned int id);
112 #endif /*_FAMILIA_INDIVIDUAL_H */