#include "typedef.h"
#include "datei.h"
extern int INFO_LEVEL;
lattice_element **lattice(char *symb,int dim,int almost,int zclass,int *no,
int OPTION)
{
lattice_element **res;
FILE *infile;
int i;
static char filename[1000];
sprintf(filename,"%s%s%d/%s%s_%d_%d",TOPDIR,"/tables/lattices/dim",
dim,"lattice_",symb,almost,zclass);
infile = fopen(filename,"r");
if (infile == NULL){
fprintf(stderr,"Couldn't find my input file %s\n",filename);
exit(4);
}
fscanf(infile,"#%d\n",no);
if (INFO_LEVEL & 1){
fprintf(stderr,"%d\n",no[0]);
}
res = (lattice_element **) malloc(no[0] * sizeof(lattice_element *));
for (i=0;i<no[0];i++){
res[i] = fget_lattice_element(infile,OPTION);
if (INFO_LEVEL & 1){
fput_lattice_element(res[i],NULL);
}
}
fclose(infile);
return res;
}