def parse_config_h(fp, vars=None):
if vars is None:<EOL><INDENT>vars = {}<EOL><DEDENT>define_rx = re.compile("<STR_LIT>")<EOL>undef_rx = re.compile("<STR_LIT>")<EOL>while True:<EOL><INDENT>line = fp.readline()<EOL>if not line:<EOL><INDENT>break<EOL><DEDENT>m = define_rx.match(line)<EOL>if m:<EOL><INDENT>n, v = m.group(<NUM_LIT:1>, <NUM_LIT:2>)<EOL>try:<EOL><INDENT>v = int(v)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>vars[n] = v<EOL><DEDENT>else:<EOL><INDENT>m = undef_rx.match(line)<EOL>if m:<EOL><INDENT>vars[m.group(<NUM_LIT:1>)] = <NUM_LIT:0><EOL><DEDENT><DEDENT><DEDENT>return vars<EOL>
Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.