parameters: (filename, define)
return_statement: return value
docstring: Read the value of a #define from a file.  filename is the name of the
      file.  define is the name of the #define.  None is returned if there was no
      such #define.
docstring_summary: Read the value of a #define from a file.  filename is the name of the
      file.  define is the name of the #define.  None is returned if there was no
      such #define.
docstring_tokens: Read the value of a #define from a file . filename is the name of the file . define is the name of the #define . None is returned if there was no such #define .
function: def read_define(filename, define):
      """ Read the value of a #define from a file.  filename is the name of the
      file.  define is the name of the #define.  None is returned if there was no
      such #define.
      """
  
      f = open(filename)
  
      for l in f:
          wl = l.split()
          if len(wl) >= 3 and wl[0] == "#define" and wl[1] == define:
              # Take account of embedded spaces.
              value = ' '.join(wl[2:])[1:-1]
              break
      else:
          value = None
  
      f.close()
  
      return value
function_tokens: def read_define ( filename , define ) : f = open ( filename ) for l in f : wl = l . split ( ) if len ( wl ) >= 3 and wl [ 0 ] == "#define" and wl [ 1 ] == define : # Take account of embedded spaces. value = ' ' . join ( wl [ 2 : ] ) [ 1 : - 1 ] break else : value = None f . close ( ) return value