Re: [Sablevm-developer] Re: Config File Parsing
Brought to you by:
egagnon
From: Etienne M. G. <eg...@j-...> - 2000-12-05 22:36:52
|
Brent Fulgham wrote: > I've got a stupid C question: > > Is it possible to modify the char* vector "argv" passed from > the command line? No. You have to allocate a new array. > Based on our earlier e-mail, I would anticipate the following: > > 1. User starts sablevm with one or two command line options. > 2. SableVM opens and parses the /etc/sablevm file. (This works) The location of this file should be chosen by "configure". The existence of this file is optional. We should also consider allowing for user specific configuration file (typically in $HOME/.sablevm), but this can wait until the system-wide one works. I am taking care of that. You can assume that there is a SYSCONFDIR (#defined in config.h) that will contain this path (typically: "/usr/local/etc"). > 3. SableVM must then insert options from the /etc/sablevm file > into the argv that gets passed to the "popt" library for > parsing. No. You simply create an array big enough to contain all options. > > How does this work? I tried a realloc on the argv vector, but > that caused a segfault. realloc won't work for argv. Etienne -- ---------------------------------------------------------------------- Etienne M. Gagnon, M.Sc. e-mail: eg...@j-... Author of SableCC: http://www.sable.mcgill.ca/sablecc/ and SableVM: http://www.sablevm.org/ ---------------------------------------------------------------------- |