function appendGlobalErrorCodes(srcDir, codes) {
  var headerFile = path.join(srcDir, 'include', 'mysys_err.h');
  var code       = '';
  var contents   = fs.readFileSync(headerFile, 'ascii');
  var block      = false;
  var match      = null;
  var num        = 0;
  var regexp     = /#define +(EE_[A-Z0-9_]+)\s+([0-9]+)/mg;

  while ((match = regexp.exec(contents))) {
    code = match[1];
    num  = Number(match[2]);

    if (!block) {
      block = code === 'EE_ERROR_FIRST';
      continue;
    }

    if (code === 'EE_ERROR_LAST') {
      break;
    }

    codes[num] = code;
  }

  return codes;
}
\n * MySQL error constants\n *\n * Extracted from version ' + version + '\n *\n * !! Generated by ' + script + ', do not modify by hand !!\n