Re: [Sablevm-developer] Config File Parsing (Done)
Brought to you by:
egagnon
From: Etienne M. G. <eg...@j-...> - 2000-12-09 05:42:28
|
Hi Brent! Sorry for taking some time to reply. I was partly in bed, fighting a popular Winter virus:-( [By the way, it is quite cold here these days: the maximum today was -15 celcius!] Thanks a lot for your contribution. I have looked at it quickly, and it seems mostly good. By the way, I forgot to tell you: to indent your code, simply type 'make indent' in the root directory, and it will indent all your code according to the GNU standard. On Debian, make sure to 'apt-get install indent' first. There are a few points, though [I know, I am very picky;-)]: 1- You use hard coded array lenghts, this can cause all sorts of problems. (Ever heard about buffer overflow exploits?) 2- You are using a non ISO/POSIX function `getline'. I have fixed configure.in so that this breaks the build, which is a good thing, if we want SableVM to remain portable. So, if you could help me fixing these two things, it would be great. [No more MAXPATHLENGTH, or 12 (!!!) constants], and replace the call to getline() by something equivalent that only uses ISO/POSIX library calls. [Preference going to pure ISO library]. I have, here, "The Annotated ANSI C Standard" ISBN 0-07-881952 which contains the ANSI/ISO 9899-1990 standard text and annotations. You can through the annotations out of the window, but the standard text is a wonderful source of information for writing portable code. But be warned, it is a little dry to read (it seems written by lawyers). You might get away with simpler texts, but you should definitely have some reference book for writing portable code. In last resort, 'man 3 functionname' also contains a "CONFORMING TO" section. Try 'man 3 getc'. OK. Thanks a lot. Etienne cvs Brent Fulgham wrote: > > I've committed changes that implement a configuration file > parsing system. It starts at the SYSCONFDIR (which is set > by autoconf), then checks the user's $HOME directory, and > finally it evaluates the command-line parameters. > > The parameters observed the following rules of precedence: > > 1. Command-line parameters trump everything. > 2. $HOME directory configuration parameters are second highest. > 3. SYSCONFDIR config parametres have lowest priority. > > I've tested it on my system, so I'm pretty sure it doesn't > break anything. But of course, please let me know if you > discover otherwise! ;-) > > Thanks, > > -Brent > _______________________________________________ > Sablevm-developer mailing list > Sab...@li... > http://lists.sourceforge.net/mailman/listinfo/sablevm-developer -- ---------------------------------------------------------------------- Etienne M. Gagnon, M.Sc. e-mail: eg...@j-... Author of SableCC: http://www.sable.mcgill.ca/sablecc/ and SableVM: http://www.sablevm.org/ ---------------------------------------------------------------------- |