parser: use C functions instead of C++ std::map/pair