#! /usr/bin/perl $gucfile = "src/backend/utils/misc/guc.c"; open $in, '<', $gucfile || die "hoge"; $gucfilecontent = ""; while (<$in>) { chomp; $gucfilecontent .= $_; } print "inline bool IsConfigOptionIsAList(const char *name)\n { if ("; $first = 1; while ($gucfilecontent =~ /{"([^"]+)" *, *PGC_[^}]*[ ]*GUC_LIST_INPUT[ ]*[^}]*},/g) { print "\n || " if (!$first); $first = 0; print "pg_strcasecmp(name, \"$1\") == 0"; } print ")\n return true;\n return false;\n}\n";