#include "fossils.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct fossil *init_fossil(char *species, enum body_part body_part, size_t age, char has_wings){

    if(species == NULL) return NULL;

    struct fossil *fossil = malloc(sizeof(struct fossil));
    if(fossil == NULL)return NULL;

    int index = 0;
    while(*(species + index) != '\0') index ++;
    
    fossil->species = malloc((index + 1) * sizeof(char*));
    if(fossil == NULL){
        free(fossil);
        return NULL;
    }
    
    strcpy(fossil->species, species);
    fossil->part = body_part;
    fossil->age = age;
    fossil->has_wings = has_wings;
    
    return fossil;
}

struct fossil *assemble_wingless(struct fossil *fossils[4]){

    if(fossils == NULL) return NULL;
    
    for(int i = 0; i < 4; i++){
        if(fossils[i] == NULL) return NULL;
    }

    if()
    /*
    char *sp = fossils[0]->species;
    int age = fossils[0]->age;
    int req = 0;
    for(int i = 0; i < 4; i++){

        if(fossils[i]->has_wings != 0) return NULL;
        if(fossils[i]->species != sp && fossils[i]->age == age) return NULL;
        if((fossils[i]->part != SKULL || fossils[i]->part != ) || req != 1;){}
    }*/
}
