[pacman-dev] [PATCH 0/9] extract ini parser from parseconfig

Andrew Gregory andrew.gregory.8 at gmail.com
Mon Jul 22 02:46:44 EDT 2013


This creates a generic ini parser than can be reused for hooks or other
configuration files.  I took a very different approach from the previous
patchset by utilizing a callback that processes the options as the file is
parsed.  This should have a much lower memory footprint and is closer to how we
were already parsing config files.

Parsing differences:
* Include directives can be outside a section.  They can include their own
  sections so it made little sense to require that they be in one already.
* Errors in included files are now fatal.

Andrew Gregory (9):
  conf.c: add parse_options to section_t
  conf.c: move repo parsing out of _parseconfig
  conf.c: move directive parsing out of _parseconfig
  conf.c: move section handling out of _parseconfig
  conf.c: pass _parse_directive as a callback
  conf.c: extract ini parsing code to separate files
  ini.c: move recursion limit to a macro
  ini.c: reuse line buffer
  ini.c: make errors in includes fatal

 src/pacman/Makefile.am |   1 +
 src/pacman/conf.c      | 257 ++++++++++++++-----------------------------------
 src/pacman/ini.c       | 217 +++++++++++++++++++++++++++++++++++++++++
 src/pacman/ini.h       |  30 ++++++
 4 files changed, 319 insertions(+), 186 deletions(-)
 create mode 100644 src/pacman/ini.c
 create mode 100644 src/pacman/ini.h

-- 
1.8.3.3



More information about the pacman-dev mailing list