code: def parse_config_h(fp, vars=None):
      """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.
      """
      if vars is None:
          vars = {}
      import re
  
      define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
      undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
  
      while True:
          line = fp.readline()
          if not line:
              break
          m = define_rx.match(line)
          if m:
              n, v = m.group(1, 2)
              try:
                  if n in _ALWAYS_STR:
                      raise ValueError
                  v = int(v)
              except ValueError:
                  pass
              vars[n] = v
          else:
              m = undef_rx.match(line)
              if m:
                  vars[m.group(1)] = 0
      return vars
  
imports: import os
  import sys
  import threading
  from os.path import realpath
label_desc: Use image node_id 15 for calling a global function with example usage: parse_config_h(fp, vars) and returns: vars