7 static char *confname[MAXCONF];
8 static char *confval[MAXCONF];
10 static char bootargs[BOOTARGSLEN];
17 for(i = 0; i < nconf; i++)
18 if(strcmp(confname[i], name) == 0)
26 char *cp, *line[MAXCONF];
30 * Keep a pristine copy.
31 * Should change this to pass the parsed strings
32 * to the booted programme instead of the raw
33 * string, then it only gets done once.
35 strcpy(bootargs, buf);
36 /* print("boot: stashing /alpha/conf boot args at 0x%lux\n",
37 bootargs); /* DEBUG */
38 conf.bootargs = bootargs;
40 n = getcfields(buf, line, MAXCONF, "\n");
41 for(i = 0; i < n; i++){
44 cp = strchr(line[i], '=');
48 if(cp - line[i] >= NAMELEN+1)
49 *(line[i]+NAMELEN-1) = 0;
50 confname[nconf] = line[i];
57 getcfields(char* lp, char** fields, int n, char* sep)
61 for(i = 0; lp && *lp && i < n; i++){
62 while(*lp && strchr(sep, *lp) != 0)
67 while(*lp && strchr(sep, *lp) == 0){
68 if(*lp == '\\' && *(lp+1) == '\n')