+\f/*
+** MAKEMAPENTRY -- create a map entry
+**
+** Parameters:
+** line -- the config file line
+**
+** Returns:
+** TRUE if it successfully entered the map entry.
+** FALSE otherwise (usually syntax error).
+**
+** Side Effects:
+** Enters the map into the dictionary.
+*/
+
+void
+makemapentry(line)
+ char *line;
+{
+ register char *p;
+ char *mapname;
+ char *classname;
+ register STAB *map;
+ STAB *class;
+
+ for (p = line; isspace(*p); p++)
+ continue;
+ if (!isalnum(*p))
+ {
+ syserr("readcf: config K line: no map name");
+ return;
+ }
+
+ mapname = p;
+ while (isalnum(*++p))
+ continue;
+ if (*p != '\0')
+ *p++ = '\0';
+ while (isspace(*p))
+ p++;
+ if (!isalnum(*p))
+ {
+ syserr("readcf: config K line, map %s: no map class", mapname);
+ return;
+ }
+ classname = p;
+ while (isalnum(*++p))
+ continue;
+ if (*p != '\0')
+ *p++ = '\0';
+ while (isspace(*p))
+ p++;
+
+ /* look up the class */
+ class = stab(classname, ST_MAPCLASS, ST_FIND);
+ if (class == NULL)
+ {
+ syserr("readcf: map %s: class %s not available", mapname, classname);
+ return;
+ }
+
+ /* enter the map */
+ map = stab(mapname, ST_MAP, ST_ENTER);
+ map->s_map.map_class = &class->s_mapclass;
+
+ if ((*class->s_mapclass.map_init)(&map->s_map, mapname, p))
+ map->s_map.map_flags |= MF_VALID;
+}