#include <malloc.h>
#include "fibolib.h"

int
fiboseries (int **series, int n)
{
    int *p;
    int i;

    if (n < 0)
        return 0;

    p = malloc (sizeof (int) * (n + 1));
    *series = p;

    if (!p)
        return 0;

    for (i = 0; i <= n; i++) {
        p[i] = fibofnc (i);
    }

    return 1;
}