X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstorage%2Findividual.h;h=87045c179bdefa3c9d28dfec75a1c46e5dcd099a;hb=23eeb22223e34cfae61897bc1b15f45c41cc6df5;hp=cd4d448e675c7e914bb27c80a5e5456ef85c94af;hpb=094bc471373afa79a63c024909d57261fef00b2f;p=familia.git diff --git a/src/storage/individual.h b/src/storage/individual.h index cd4d448..87045c1 100644 --- a/src/storage/individual.h +++ b/src/storage/individual.h @@ -40,6 +40,9 @@ struct familia_individual { /** Number of families */ unsigned int families_no; + + /** Parent family. Family this individual comes from. */ + struct familia_family * parents; }; /** @@ -51,7 +54,7 @@ struct familia_individual * familia_individual_new(); /** * Frees allocated memory of the given individual - * DISCLAIMER! This function does not remove linked families. You have to + * DISCLAIMER! This function does not free memory of linked families. You have to * remove them manually from storage. * @parameter individual to free */ @@ -96,17 +99,41 @@ void familia_individual_add_family(struct familia_individual * individual, struc * Gets family with the given id of the given individual * @parameter individual from whom get the family * @parameter family id of the individual - * @return individuals last name + * @return selected family or NULL if such does not exists or index is out of + * array bounds */ struct familia_family * familia_individual_get_family_by_id(struct familia_individual * individual, unsigned int id); /** * Removes family with the given id from the given individual - * DISCLAIMER! This function does not remove linked families. You have to + * DISCLAIMER! This function does not free memory of linked families. You have to * remove them manually from storage. * @parameter individual from whom family will be removed * @parameter family id of the individual */ void familia_individual_remove_family_by_id(struct familia_individual * individual, unsigned int id); +/** + * Sets parents family of the given individual + * @parameter individual to set parents + * @parameter parents to set + */ +void familia_individual_set_parents(struct familia_individual * individual, struct familia_family * family); + +/** + * Gets family with the given id of the given individual + * @parameter individual from whom get the family + * @parameter family id of the individual + * @return individuals last name + */ +struct familia_family * familia_individual_get_parents(struct familia_individual * individual); + +/** + * Removes parents from the given individual + * DISCLAIMER! This function does not free memory of linked family. You have to + * remove them manually from storage. + * @parameter individual from whom parents will be removed + */ +void familia_individual_remove_parents(struct familia_individual * individual); + #endif /*_FAMILIA_INDIVIDUAL_H */