Einfacher Config-parser
Ingo Luetkebohle
ingo at blank.pages.de
Sun Aug 27 00:50:16 CEST 2000
On Sat, Aug 26, 2000 at 04:53:55PM +0200, Nils Bokermann wrote:
> Hat jemand mal nen ganz simplen config-parser geschrieben? So einer,
> der text-config's ausliest, die nur attribut/wert-paare enthalten?
char name[40], value[40];
fscanf(fd, "%40s=%40s", name, value);
und wenn Du noch Expansion von Sonderzeichen moechtest
char buf[80];
snprintf(buf, 80, value);
Wobei man da aufpassen sollte, dass einem niemand "%"'s in den Wert
schummelt :)
--
Ingo Luetkebohle / 21st Century Digital Boy
its easy to stop using Perl: I do it after every project
-
Hinweise zur Benutzung dieser (und anderer Mailing-Listen) bitte beachten:
--> http://lug-owl.de/mailinglist_hints.html <--
More information about the Linux
mailing list