Subversion Repositories SvarDOS

Rev

Rev 421 | Rev 1731 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 421 Rev 436
Line 53... Line 53...
53
    if (*env == 0) return(NULL);
53
    if (*env == 0) return(NULL);
54
  }
54
  }
55
}
55
}
56
 
56
 
57
 
57
 
-
 
58
/* almost identical to env_lookup(), but instead of returning a pointer
-
 
59
 * to the 'NAME=value' string, it returns a pointer to value (or NULL if
-
 
60
 * var not found) */
-
 
61
char far *env_lookup_val(unsigned short env_seg, const char *varname) {
-
 
62
  char far *r = env_lookup(env_seg, varname);
-
 
63
  if (r == NULL) return(NULL);
-
 
64
  /* find '=' or end of string */
-
 
65
  for (;;) {
-
 
66
    if (*r == '=') return(r + 1);
-
 
67
    if (*r == 0) return(r);
-
 
68
    r++;
-
 
69
  }
-
 
70
}
-
 
71
 
-
 
72
 
58
/* returns the size, in bytes, of the allocated environment block */
73
/* returns the size, in bytes, of the allocated environment block */
59
unsigned short env_allocsz(unsigned short env_seg) {
74
unsigned short env_allocsz(unsigned short env_seg) {
60
  unsigned short far *mcbsz = MK_FP(env_seg - 1, 3); /* block size is a word at offset +3 in the MCB */
75
  unsigned short far *mcbsz = MK_FP(env_seg - 1, 3); /* block size is a word at offset +3 in the MCB */
61
  return(*mcbsz * 16); /* return size in bytes, not paragraphs */
76
  return(*mcbsz * 16); /* return size in bytes, not paragraphs */
62
}
77
}