#include <exec/types.h>

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

#include "header.h"


struct area *get_area(struct areas *a,int i)
{
   struct area *aa;

   if(i < 1)
   {
      if(MyDEBUG) printf("R_AREAS.C<>get_area: invalid area referenced\n");
   }

   aa=a->first_area;

   while(--i)
   {
      aa=aa->next_area;

      if(aa == 0)
         return(0);
   }

   return(aa);
}

