Using a library to parse config files #2399
Replies: 8 comments 17 replies
-
I'm in positive position with that if it is not hard to implement and will not make code very complex. It is a good chance to add such feature because we're switching to v1.0. |
Beta Was this translation helpful? Give feedback.
-
Sounds like a good idea. We need to define behaviour in the event of colliding sections. So for example, if we used [section 1]
aaa=bbb
ccc=ddd
include /etc/conf.d/xrdp.conf and [section 1]
ccc=eee I'd expect the result to be either- [section 1]
aaa=bbb
ccc=eee or:- [section 1]
ccc=eee I could make a case for either one. What do people think? |
Beta Was this translation helpful? Give feedback.
-
Also, it is a good chance to bump Furthermore, I would personally like to switch configuration file format to TOML. INI is a mature config file format but AFAIK there's no specification. In contrast, TOML has a formal specification. Another advantage of TOML is the existence of a parser library. We don't need to implement our own config parser. Let's research about TOML parser library for C language available on each OS on this thread. |
Beta Was this translation helpful? Give feedback.
-
I've had a quick look at TOML. Initial comments:-
As regarding platform support, I can't find anything for C in FreeBSD ports. Debian 10 has support for Go, Rust, Perl, Python and Ruby but not C. CentOS 7 has Go and Python, but no C. Am I missing something? |
Beta Was this translation helpful? Give feedback.
-
Personally I'd be happy with that approach. The licence looks OK. There's a couple of possible wrinkles:-
It seems to me we now have three possible approaches to changing the parser.
Another thing to bear in mind is the original discussion point, which is to read the config from multiple files, if I'm correctly understanding it. This is somewhat at odds with making the configs easier to parse. Is that a reasonable summary? @jsorg71 - what do you think about this discussion so far? |
Beta Was this translation helpful? Give feedback.
-
@jsorg71 - we're currently on C90 (with some exceptions for your SPARC machine). POSIX (IEEE Std 1003.1-2017) mentions C99, so it would seem to be a good place to aim for. Our current cppcheck CI test uses C11. Are you still using the SPARC machine for big-endian testing? There seems to be very little big-endian hardware out there these days. |
Beta Was this translation helpful? Give feedback.
-
@matt335672 This is getting a bit off topic but what exceptions for SPARC are you talking about? Are you sure it's not more about an older GCC? |
Beta Was this translation helpful? Give feedback.
-
Platform discussion moved to #2441 |
Beta Was this translation helpful? Give feedback.
-
Hi,all
I am using xrdp as RDP Proxy.
I have added a lot of settings for RDP Proxy in xrdp.ini.
I am modifying xrdp.ini when new xrdp is released.
Is it possible to put some of the
xrdp.ini
settings under/etc/xrdp/conf.d/
and include them, similar to apache and nginx?If that is possible, I could put the configuration regarding RDP Proxy in conf.d.
As another application, when adding the xorgxrdp rpm/deb package, We could add the configuration for Xorg in conf.d, which would make it easier for the package manager.
Beta Was this translation helpful? Give feedback.
All reactions