parameters: (filename, include_state, io=codecs)
return_statement: return True
docstring: Fill up the include_state with new includes found from the file.
  
    Args:
      filename: the name of the header to read.
      include_state: an _IncludeState instance in which the headers are inserted.
      io: The io factory to use to read the file. Provided for testability.
  
    Returns:
      True if a header was succesfully added. False otherwise.
docstring_summary: Fill up the include_state with new includes found from the file.
docstring_tokens: Fill up the include_state with new includes found from the file .
function: def UpdateIncludeState(filename, include_state, io=codecs):
    """Fill up the include_state with new includes found from the file.
  
    Args:
      filename: the name of the header to read.
      include_state: an _IncludeState instance in which the headers are inserted.
      io: The io factory to use to read the file. Provided for testability.
  
    Returns:
      True if a header was succesfully added. False otherwise.
    """
    headerfile = None
    try:
      headerfile = io.open(filename, 'r', 'utf8', 'replace')
    except IOError:
      return False
    linenum = 0
    for line in headerfile:
      linenum += 1
      clean_line = CleanseComments(line)
      match = _RE_PATTERN_INCLUDE.search(clean_line)
      if match:
        include = match.group(2)
        # The value formatting is cute, but not really used right now.
        # What matters here is that the key is in include_state.
        include_state.setdefault(include, '%s:%d' % (filename, linenum))
    return True
function_tokens: def UpdateIncludeState ( filename , include_state , io = codecs ) : headerfile = None try : headerfile = io . open ( filename , 'r' , 'utf8' , 'replace' ) except IOError : return False linenum = 0 for line in headerfile : linenum += 1 clean_line = CleanseComments ( line ) match = _RE_PATTERN_INCLUDE . search ( clean_line ) if match : include = match . group ( 2 ) # The value formatting is cute, but not really used right now. # What matters here is that the key is in include_state. include_state . setdefault ( include , '%s:%d' % ( filename , linenum ) ) return True