import re


def hasMainFunc( filename ):
    """
    Returns True if file contains something that looks like a main() or
    main( int argc, char argv ) function.
    """
    main_regex = re.compile('.*main(.*argc.*argv).*')
    f = open(filename)
    for line in f.readlines():
        if main_regex.search( line ):
            return True
    return False