Library for reading config files? 
Author Message
 Library for reading config files?

I'm looking for a free C library for reading config files, in some
reasonably flexible format.  That is, I'm writing a program in C,
under HP-UX, that needs a config file, and I don't want to have to
write my own routines for reading the config file.  I was going to
just use the termcap library, but termcap style files aren't real
readable.  Does anyone know of anything that might be better?

My news feed is pretty flaky, so I'd really appreciate if you could
email responses.  Thanks in advance!

Adrian



Mon, 22 Feb 1999 03:00:00 GMT  
 Library for reading config files?

Quote:

> I'm looking for a free C library for reading config files, in some
> reasonably flexible format.  That is, I'm writing a program in C,
> under HP-UX, that needs a config file, and I don't want to have to
> write my own routines for reading the config file.  I was going to
> just use the termcap library, but termcap style files aren't real
> readable.  Does anyone know of anything that might be better?

> My news feed is pretty flaky, so I'd really appreciate if you could
> email responses.  Thanks in advance!

> Adrian

I have heard of a MS Windows style INI file config file library
for Unix.  It is free, but I can't remember where I last saw it.

INI files look something like
-------------

[section]
variable1 = value
..
..
..

[section2]

et al.

It would be nice to have this sort of thing as a standard feature
of Unix.

-Greg



Mon, 22 Feb 1999 03:00:00 GMT  
 Library for reading config files?


: I have heard of a MS Windows style INI file config file library for
: Unix.  It is free, but I can't remember where I last saw it.

If it was IniConf, it's in Perl, at

        http://habanero.ucs.indiana.edu/Perl/modules/

Bill
--
--

                "First we ping Manhattan, then we ping Berlin."



Tue, 23 Feb 1999 03:00:00 GMT  
 Library for reading config files?


Quote:

> : I have heard of a MS Windows style INI file config file library for
> : Unix.  It is free, but I can't remember where I last saw it.

> If it was IniConf, it's in Perl, at

>    http://habanero.ucs.indiana.edu/Perl/modules/

Midnight Commander has C routines for managing *.ini files. They are in
two files (.c and .h) and (AFAIK ;) pretty self-content, so it should be
easy to use them in any other product. MC is GPL'ed; official site is

ftp://ftp.nuclecu.unam.mx/pub/mc

greetings

-------------------------------------------------------------------------
Andrej Borsenkow                Fax:   +7 (095) 252 01 05
SNI ITS Moscow                  Tel:   +7 (095) 252 13 88


-------------------------------------------------------------------------



Tue, 23 Feb 1999 03:00:00 GMT  
 Library for reading config files?

] I have heard of a MS Windows style INI file config file library
] for Unix.  It is free, but I can't remember where I last saw it.

There is C source code as part of the "SAMBA" package.

There is independently created C source code as part of the
"Midnight Commander" package.

                                        Terry Lambert

---
Any opinions in this posting are my own and not those of my present
or previous employers.



Tue, 23 Feb 1999 03:00:00 GMT  
 Library for reading config files?

Quote:

> I'm looking for a free C library for reading config files, in some
> reasonably flexible format.  That is, I'm writing a program in C,
> under HP-UX, that needs a config file, and I don't want to have to
> write my own routines for reading the config file.  I was going to
> just use the termcap library, but termcap style files aren't real
> readable.  Does anyone know of anything that might be better?

The best one I have seen is the PrologIO library from the wxWindows
project (http://www.aiai.ed.ac.uk/~jacs/wxwin.html).  It handles
config files in a Prolog-like syntax, with lists and arbitrary
nesting.  It's partly in C++, though -- you would have to wrap a C
interface around it if you really can't use C++.  But any C++ compiler
(such as gcc later than 2.1) will compile it.  Also, there is very
clear documentation (only two pages) available for this library.

Regards,
Wolfram.



Wed, 24 Feb 1999 03:00:00 GMT  
 Library for reading config files?

Quote:

>I'm looking for a free C library for reading config files, in some
>reasonably flexible format.  That is, I'm writing a program in C,
>under HP-UX, that needs a config file, and I don't want to have to
>write my own routines for reading the config file.  I was going to
>just use the termcap library, but termcap style files aren't real
>readable.  Does anyone know of anything that might be better?

You can do this very easily (and much more) with Lua (see below).

* What is Lua?
  Lua is a simple, yet powerful, language for extending applications.
  Lua has been developed by TeCGraf, the Computer Graphics Technology Group
  of PUC-Rio, the Pontifical Catholic University of Rio de Janeiro, Brazil.
  Dozens of industrial products developed by TeCGraf use Lua.

* Some features of Lua
  + a simple, Pascal-like, syntax
  + powerful data description constructs (e.g., associative arrays)
  + user-controlled type constructors
  + fallbacks for extending the language in unconventional ways (e.g.,
    inheritance, overloading)
  + garbage collection
  + Lua programs are compiled into bytecodes, which are then interpreted
  + portable, written in ANSI C (runs in Unix, DOS, Windows, Mac, Cray, ...)

* Availability
  The latest version of Lua is always available at the following locations:
  In Brazil:    ftp://ftp.icad.puc-rio.br/pub/lua/lua.tar.gz
  In Canada:    ftp://csg.uwaterloo.ca/pub/lhf/lua/lua.tar.gz
  In Greece:    ftp://ftp.ntua.gr/pub/lang/lua/lua.tar.gz
  Home page:    http://www.inf.puc-rio.br/~roberto/lua.html
  The current version is 2.4.

* Legal matters
  Lua is freely available for both academic and commercial purposes.
  Lua is not in the public domain; TeCGraf keeps its copyright.

* Contacting the authors

  Please send us email if you download Lua so that we can know how far it goes.

--
Luiz Henrique de Figueiredo                      http://csg.uwaterloo.ca/~lhf/
Computer Systems Group, Department of Computer Science, University of Waterloo
Waterloo, Ontario, Canada N2L 3G1    (519) 888-4567-1-5517, fax (519) 746-5422



Wed, 24 Feb 1999 03:00:00 GMT  
 Library for reading config files?

Quote:

>I'm looking for a free C library for reading config files, in some
>reasonably flexible format.  That is, I'm writing a program in C,
>under HP-UX, that needs a config file, and I don't want to have to
>write my own routines for reading the config file.  I was going to
>just use the termcap library, but termcap style files aren't real
>readable.  Does anyone know of anything that might be better?

>My news feed is pretty flaky, so I'd really appreciate if you could
>email responses.  Thanks in advance!

I've seen plenty of good suggestions posted already, but alternatively,
you might want to see if the lex and yacc parser generators adequately
fulfill your needs.  I've never used them myself, but I understand
(or do I?) that they're supposed to generate parser code based on a
set of rules that you give to them.

GNU Public Licensed versions of lex and yacc are respectively known as
flex and bison, and they're available at ftp://prep.ai.mit.edu/pub/gnu
(along with all the other stuff, of course).

Quote:
>Adrian

--Arthur


Sun, 28 Feb 1999 03:00:00 GMT  
 Library for reading config files?

Quote:

> I'm looking for a free C library for reading config files, in some
> reasonably flexible format.  That is, I'm writing a program in C,

Kerberos V5 contains Ted T'so's "profile" library, which interprets a
multilevel config file with some similarities to Windows-style INI
files.  athena-dist.mit.edu:/pub/kerberos is a starting point; I don't
know if Ted has released it seperately.


Mon, 01 Mar 1999 03:00:00 GMT  
 Library for reading config files?

Quote:


>> I'm looking for a free C library for reading config files, in some
>> reasonably flexible format.  That is, I'm writing a program in C,
> Kerberos V5 contains Ted T'so's "profile" library, which interprets a
> multilevel config file with some similarities to Windows-style INI
> files.  athena-dist.mit.edu:/pub/kerberos is a starting point; I don't
> know if Ted has released it seperately.

Another idea -- X resources?

--
==================================================================
David Masterson                         KLA Instruments
408-456-6836                            P.O. Box 49055 M/S F1-9440

==================================================================
      I only speak for myself -- it keeps me out of trouble



Tue, 02 Mar 1999 03:00:00 GMT  
 Library for reading config files?

   Another idea -- X resources?

What about getting one of these little schemes that can be
compiled as library (SIOD?) and making config file a primitive
scheme program like

(set! a 'foo)
(set! b 'bar)
(define v #(1 2 3 4 5 6))

just like .emacs?

Is there a chance that any other config reading library will be
smaller then SIOD?



Tue, 02 Mar 1999 03:00:00 GMT  
 Library for reading config files?

 Adrian> I'm looking for a free C library for reading config files, in some
 Adrian> reasonably flexible format.

Isn't this the sort of thing libguile was written to do?
(http://nis-www.lanl.gov/~rosalia/mydocs/guile-user_toc.html)

--
Jesse Zbikowski                                                Ascom Nexion

                                                                  Group
[EOF]



Fri, 05 Mar 1999 03:00:00 GMT  
 Library for reading config files?

Quote:

> Is there a chance that any other config reading library will be
> smaller then SIOD?

My ezini-lib is 8304 Bytes. And it an read constructs like:

kompliziert = {
        { name = ich;
          adresse = {"auf dem Mond"}; }
        { englische_Zahl = 2.71;
          deutsche_Zahl = 3,14;
          adresse = {"hinter den Blumen" "auf dem Mond"}; }
        };

I think it should be enough for config-files. If you use lisp, the
config files could be much more complex. But this is also a big problem,
because then you mix up data and methods. And by this it is nearly
impossible to create a gui-interface for the majority of users who are
normally abel to change some parameters but who are not abel to change
the methods.

-- bis sp?ter...
 - Sascha         ---<~>=( http://www.ping.de/sites/aibon/ )=<~>---

   () Free speech online
   /\ http://www.eff.org/BlueRibbon/bluehtml.html



Sat, 06 Mar 1999 03:00:00 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. Library for manipulating config files

2. Config file works with class library project?

3. Need library to handle config files

4. Config files: best to use struct when reading in data

5. read Config-file module for C?

6. reading config files

7. basic config file read

8. are there better ways to read config file?

9. How to read a config file in C

10. looking for function to read config file

11. read config file

12. Updating the security.config file in the CONFIG directory

 

 
Powered by phpBB® Forum Software