#include <u.h>
#include <libc.h>
#include "project.h"
static struct {
int (*init)(projection*, elliptic*, char*);
char *name, *description;
} proj_list[] = {
tmin, "tm", "Transverse Mercator",
utmin, "utm", "Universal Transverse Mercator",
};
int
get_projection(projection *p, char *name) {
int i, m;
if(name==nil) return 0;
m = sizeof(proj_list)/sizeof(*proj_list);
for(i=0;i<m;i++)
if(!strcmp(name, proj_list[i].name)) break;
if(i==m) return 0;
p->description = proj_list[i].description;
p->init = proj_list[i].init;
return 1;
};
|