def check_api_version(apiversion, codegen_dir):
curapi_hash, api_hash = get_api_versions(apiversion, codegen_dir)<EOL>if not curapi_hash == api_hash:<EOL><INDENT>msg = "<STR_LIT>""<STR_LIT>""<STR_LIT>""<STR_LIT>""<STR_LIT>"<EOL>warnings.warn(msg % (apiversion, curapi_hash, apiversion, api_hash,<EOL>__file__),<EOL>MismatchCAPIWarning)<EOL><DEDENT>
Emits a MismacthCAPIWarning if the C API version needs updating.