示例#1
0
文件: allegro.c 项目: Yurand/tw-light
/* _install_allegro_version_check:
 *  Initialises the Allegro library, but return with an error if an
 *  incompatible version is found.
 */
int _install_allegro_version_check(int system_id, int *errno_ptr,
   int (*atexit_ptr)(void (*func)(void)), int version)
{
   int r = _install_allegro(system_id, errno_ptr, atexit_ptr);

   int build_wip = version & 255;
   int build_ver = version & ~255;

   int version_ok;

   if (r != 0) {
      /* failed */
      return r;
   }

#if ALLEGRO_SUB_VERSION & 1
   /* This is a WIP runtime, so enforce strict compatibility. */
   version_ok = version == MAKE_VERSION(ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, ALLEGRO_WIP_VERSION);
#else
   /* This is a stable runtime, so the runtime should be at least as new
    * as the build headers (otherwise we may get a crash, since some
    * functions may have been used which aren't available in this runtime).
    */
   version_ok = (MAKE_VERSION(ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, 0) == build_ver) &&
      (ALLEGRO_WIP_VERSION >= build_wip);
#endif

   if (!version_ok) {
      uszprintf(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text(
         "The detected dynamic Allegro library (%d.%d.%d) is "
         "not compatible with this program (%d.%d.%d)."),
         ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, ALLEGRO_WIP_VERSION,
         build_ver >> 16, (build_ver >> 8) & 255, build_wip);
      return -1;
   }
示例#2
0
void plUoid::read(hsStream* S) {
    unsigned char contents = 0;
    if (S->getVer() < MAKE_VERSION(2, 0, 63, 0) && S->getVer().isValid()) {
        contents = kHasCloneIDs;
    } else {
        contents = S->readByte();
    }
    location.read(S);
    if ((contents & kHasLoadMask) && (!S->getVer().isNewPlasma() || S->getVer().isUniversal()))
        loadMask.read(S);
    else
        loadMask.setAlways();
    classType = pdUnifiedTypeMap::PlasmaToMapped(S->readShort(), S->getVer());
    if (!S->getVer().isUruSP() && !S->getVer().isUniversal())
        objID = S->readInt();
    objName = S->readSafeStr();
    if ((contents & kHasCloneIDs) && (S->getVer().isUru() || S->getVer().isUniversal())) {
        cloneID = S->readInt();
        if (S->getVer() < MAKE_VERSION(2, 0, 57, 0))
            clonePlayerID = 0;
        else
            clonePlayerID = S->readInt();
    } else {
        cloneID = clonePlayerID = 0;
    }
    if ((contents & (kHasLoadMask | kHasLoadMask2)) && S->getVer().isNewPlasma()) {
        loadMask.read(S);
    }
}
示例#3
0
plString plPageInfo::getFilename(PlasmaVer ver) const {
    if (ver.isNewPlasma())
        return plString::Format("%s_%s.prp", fAge.cstr(), fPage.cstr());
    else if (ver < MAKE_VERSION(2, 0, 60, 00))
        return plString::Format("%s_District_%s.prx", fAge.cstr(), fPage.cstr());
    else
        return plString::Format("%s_District_%s.prp", fAge.cstr(), fPage.cstr());
}
示例#4
0
static int nfs_append_sloppy_option(struct mount_options *options)
{
	if (!sloppy || linux_version_code() < MAKE_VERSION(2, 6, 27))
		return 1;

	if (po_append(options, "sloppy") == PO_FAILED)
		return 0;
	return 1;
}
示例#5
0
int
svcgssd_limit_krb5_enctypes(void)
{
	u_int maj_stat, min_stat;
	krb5_enctype old_kernel_enctypes[] = {
		ENCTYPE_DES_CBC_CRC,
		ENCTYPE_DES_CBC_MD5,
		ENCTYPE_DES_CBC_MD4 };
	krb5_enctype new_kernel_enctypes[] = {
		ENCTYPE_AES256_CTS_HMAC_SHA1_96,
		ENCTYPE_AES128_CTS_HMAC_SHA1_96,
		ENCTYPE_DES3_CBC_SHA1,
		ENCTYPE_ARCFOUR_HMAC,
		ENCTYPE_DES_CBC_CRC,
		ENCTYPE_DES_CBC_MD5,
		ENCTYPE_DES_CBC_MD4 };
	krb5_enctype *default_enctypes, *enctypes;
	int default_num_enctypes, num_enctypes;


	if (linux_version_code() < MAKE_VERSION(2, 6, 35)) {
		default_enctypes = old_kernel_enctypes;
		default_num_enctypes =
			sizeof(old_kernel_enctypes) / sizeof(old_kernel_enctypes[0]);
	} else {
		default_enctypes = new_kernel_enctypes;
		default_num_enctypes =
			sizeof(new_kernel_enctypes) / sizeof(new_kernel_enctypes[0]);
	}

	get_kernel_supported_enctypes();

	if (parsed_enctypes != NULL) {
		enctypes = parsed_enctypes;
		num_enctypes = parsed_num_enctypes;
		printerr(2, "%s: Calling gss_set_allowable_enctypes with %d "
			"enctypes from the kernel\n", __func__, num_enctypes);
	} else {
		enctypes = default_enctypes;
		num_enctypes = default_num_enctypes;
		printerr(2, "%s: Calling gss_set_allowable_enctypes with %d "
			"enctypes from defaults\n", __func__, num_enctypes);
	}

	maj_stat = set_allowable_enctypes(&min_stat, gssd_creds,
			&krb5oid, num_enctypes, enctypes);
	if (maj_stat != GSS_S_COMPLETE) {
		printerr(1, "WARNING: gss_set_allowable_enctypes failed\n");
		pgsserr("svcgssd_limit_krb5_enctypes: gss_set_allowable_enctypes",
			maj_stat, min_stat, &krb5oid);
		return -1;
	}
	return 0;
}
示例#6
0
文件: version.c 项目: Coco-wan/git-1
void
ndbSetOwnVersion() {
  char buf[256];
  if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) {
    Uint32 _v1,_v2,_v3;
    if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) {
      ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3);
      ndbout_c("Testing: Version set to 0x%x",  ndbOwnVersionTesting);
    }
  }
}
示例#7
0
/*
 * Unfortunately, the kernel prints annoying console messages
 * in case of an unexpected nfs mount version (instead of
 * just returning some error).  Therefore we'll have to try
 * and figure out what version the kernel expects.
 *
 * Variables:
 *	KERNEL_NFS_MOUNT_VERSION: kernel sources at compile time
 *	NFS_MOUNT_VERSION: these nfsmount sources at compile time
 *	nfs_mount_version: version this source and running kernel can handle
 */
static void
find_kernel_nfs_mount_version(void) {
	int kernel_version = linux_version_code();

	if (kernel_version) {
	     if (kernel_version < MAKE_VERSION(2,1,32))
		  nfs_mount_version = 1;
	     else
		  nfs_mount_version = 3;
	}
	if (nfs_mount_version > NFS_MOUNT_VERSION)
	     nfs_mount_version = NFS_MOUNT_VERSION;
}
示例#8
0
static int
linux_version_code(void) {
	struct utsname my_utsname;
	int p, q, r;

	if (uname(&my_utsname) == 0) {
		p = atoi(strtok(my_utsname.release, "."));
		q = atoi(strtok(NULL, "."));
		r = atoi(strtok(NULL, "."));
		return MAKE_VERSION(p,q,r);
	}
	return 0;
}
示例#9
0
/*
 * Unfortunately, the kernel prints annoying console messages
 * in case of an unexpected nfs mount version (instead of
 * just returning some error).  Therefore we'll have to try
 * and figure out what version the kernel expects.
 *
 * Variables:
 *	NFS_MOUNT_VERSION: these nfsmount sources at compile time
 *	nfs_mount_version: version this source and running kernel can handle
 */
static int
find_kernel_nfs_mount_version(void) {
	static int kernel_version = -1;
	int nfs_mount_version = NFS_MOUNT_VERSION;

	if (kernel_version == -1)
		kernel_version = linux_version_code();

	if (kernel_version) {
	     if (kernel_version < MAKE_VERSION(2,1,32))
		  nfs_mount_version = 1;
	     else if (kernel_version < MAKE_VERSION(2,2,18))
		  nfs_mount_version = 3;
	     else if (kernel_version < MAKE_VERSION(2,3,0))
		  nfs_mount_version = 4; /* since 2.2.18pre9 */
	     else if (kernel_version < MAKE_VERSION(2,3,99))
		  nfs_mount_version = 3;
	     else
		  nfs_mount_version = 4; /* since 2.3.99pre4 */
	}
	if (nfs_mount_version > NFS_MOUNT_VERSION)
	     nfs_mount_version = NFS_MOUNT_VERSION;
	return nfs_mount_version;
}
示例#10
0
/*
 * Unfortunately, the kernel prints annoying console messages
 * in case of an unexpected nfs mount version (instead of
 * just returning some error).  Therefore we'll have to try
 * and figure out what version the kernel expects.
 *
 * Variables:
 *	KERNEL_NFS_MOUNT_VERSION: kernel sources at compile time
 *	NFS_MOUNT_VERSION: these nfsmount sources at compile time
 *	nfs_mount_version: version this source and running kernel can handle
 */
static void
find_kernel_nfs_mount_version(void)
{
	static int kernel_version = 0;

	if (kernel_version)
		return;

	nfs_mount_version = NFS_MOUNT_VERSION; /* default */

	kernel_version = get_kernel_revision();
	if (kernel_version) {
		if (kernel_version < MAKE_VERSION(2,1,32))
			nfs_mount_version = 1;
		else if (kernel_version < MAKE_VERSION(2,2,18) ||
				(kernel_version >=   MAKE_VERSION(2,3,0) &&
				 kernel_version < MAKE_VERSION(2,3,99)))
			nfs_mount_version = 3;
		else
			nfs_mount_version = 4; /* since 2.3.99pre4 */
	}
	if (nfs_mount_version > NFS_MOUNT_VERSION)
		nfs_mount_version = NFS_MOUNT_VERSION;
}
示例#11
0
void MRAOfflineMessage::parse(const QString &rfc822) {
    std::cout << rfc822.toStdString();
    MessagePart message(rfc822);

    m_date      = KDateTime::fromString(message.header("Date"), KDateTime::RFCDate);
    m_from      = message.header("From");

    if (message.hasHeader("Subject")) {
        m_subject   = message.header("Subject");
    }

    QStringList version;
    if (message.hasHeader("Version")) {
        version  = message.header("Version").split('.');
    } else {
        version  = message.header("X-MRIM-Version").split('.');
    }

    m_protoVersion = MAKE_VERSION(
                    version[0].toUInt(),
                    version[1].toUInt()
                );

    m_flags = message.header("X-MRIM-Flags").toUInt(0, 16);

    if (message.contentType() == "text/plain") {
        parseTextPart( message, message );
        return;
    }

    QString boundary = message.boundary();

    QStringList parts   = message.text().split(QRegExp("--" + boundary + "(--)?\r?\n"));

    foreach( const QString &partText, parts ) {
        if (partText.trimmed().length() == 0) {
            continue;
        }

        MessagePart part(partText);
        if (part.contentType() == "text/plain") {
            parseTextPart( message, part );
        } else {
            m_rtfText = message.text();
        }
    }

}
示例#12
0
void plSynchedObject::read(hsStream* S, plResManager* mgr) {
    hsKeyedObject::read(S, mgr);
    fSDLExcludeList.clear();
    fSDLVolatileList.clear();
    if (S->getVer() < MAKE_VERSION(2, 0, 57, 0))
        fSynchFlags = 0;
    else
        fSynchFlags = S->readInt();

    unsigned short count, len, i;
    if (S->getVer().isUru() || S->getVer().isUniversal()) {
        if (fSynchFlags & kExcludePersistentState) {
            count = S->readShort();
            fSDLExcludeList.resize(count);
            for (i=0; i<count; i++) {
                len = S->readShort();
                fSDLExcludeList[i] = S->readStr(len);
            }
        }
        if (fSynchFlags & kHasVolatileState) {
            count = S->readShort();
            fSDLVolatileList.resize(count);
            for (i=0; i<count; i++) {
                len = S->readShort();
                fSDLVolatileList[i] = S->readStr(len);
            }
        }
    } else {
        fSynchFlags &= ~0x8;
        if ((fSynchFlags & 0x6) == 0) {
            count = S->readShort();
            fSDLExcludeList.resize(count);
            for (i=0; i<count; i++) {
                len = S->readShort();
                fSDLExcludeList[i] = S->readStr(len);
            }
        }

        // Sync Flags adjustment -- this is guesswork :/
        unsigned int eoaFlags = fSynchFlags;
        fSynchFlags = ((eoaFlags & 0x1) ? kDontDirty : 0)
                    | ((eoaFlags & 0x2) ? kExcludePersistentState : 0)
                    | ((eoaFlags & 0x4) ? kExcludeAllPersistentState : 0);
        if (eoaFlags & 0xFFFFFFF0)
            plDebug::Debug("Myst5 Object got unknown synch flags: %08X", eoaFlags);
    }
}
示例#13
0
/**
 * プラグイン情報を取得する。
 * @param[out] pluginInfo    プラグイン情報。
 */
void WINAPI ApiGetPluginInfo(lpApiInfo pluginInfo)
{
	if (pluginInfo == NULL) {
		return;
	}

	memset(pluginInfo, 0, sizeof(ApiInfo));

	// プラグイン名
	wcsncpy(pluginInfo->szPluginName, PLUGIN_NAME, API_MAX_PLUGIN_NAME_LENGTH-1);

	// 作者
	wcsncpy(pluginInfo->szAuthorName, PLUGIN_AUTHOR, API_MAX_AUTHOR_NAME_LENGTH-1);

	// プラグインバージョン
	pluginInfo->dwVersion = MAKE_VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_REVISION);
}
示例#14
0
int
Restore::check_file_version(Signal* signal, Uint32 file_version)
{
  if (file_version < MAKE_VERSION(5,1,6))
  {
    char buf[255];
    char verbuf[255];
    ndbGetVersionString(file_version, 0, 0, verbuf, sizeof(verbuf));
    BaseString::snprintf(buf, sizeof(buf),
			 "Unsupported version of LCP files found on disk, "
			 " found: %s", verbuf);
    
    progError(__LINE__, 
	      NDBD_EXIT_SR_RESTARTCONFLICT,
	      buf);
    return -1;
  }
  return 0;
}
示例#15
0
void MRAOfflineMessage::parseTextPart(MessagePart &mainPart, MessagePart &textPart) {
    if (m_protoVersion < MAKE_VERSION(1,16)) {
        return;
    }
    m_text = textPart.text().trimmed();

    if (textPart.header("Content-Transfer-Encoding") == "base64") {

        QByteArray data;
        data = QByteArray::fromBase64( m_text.toAscii() );
        QTextCodec *codec = QTextCodec::codecForName( textPart.charset().toAscii() );

        m_text = codec->toUnicode(data);
    }

    if ( !mainPart.subject().isEmpty() || mainPart.hasHeader("Sender") ) {
        m_text = mainPart.subject() + '(' + mainPart.header("Sender") + "):\n" + m_text;
    }

}
示例#16
0
static int nfs_set_version(struct nfsmount_info *mi)
{
	if (!nfs_nfs_version(mi->options, &mi->version))
		return 0;

	if (strncmp(mi->type, "nfs4", 4) == 0)
		mi->version = 4;

	/*
	 * Before 2.6.32, the kernel NFS client didn't
	 * support "-t nfs vers=4" mounts, so NFS version
	 * 4 cannot be included when autonegotiating
	 * while running on those kernels.
	 */
	if (mi->version == 0 &&
	    linux_version_code() <= MAKE_VERSION(2, 6, 31))
		mi->version = 3;

	/*
	 * If we still don't know, check for version-specific
	 * mount options.
	 */
	if (mi->version == 0) {
		if (po_contains(mi->options, "mounthost") ||
		    po_contains(mi->options, "mountaddr") ||
		    po_contains(mi->options, "mountvers") ||
		    po_contains(mi->options, "mountproto"))
			mi->version = 3;
	}

	/*
	 * If enabled, see if the default version was
	 * set in the config file
	 */
	nfs_default_version(mi);
	
	return 1;
}
示例#17
0
文件: version.c 项目: Coco-wan/git-1
  char buf[256];
  if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) {
    Uint32 _v1,_v2,_v3;
    if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) {
      ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3);
      ndbout_c("Testing: Version set to 0x%x",  ndbOwnVersionTesting);
    }
  }
}
#else
void ndbSetOwnVersion() {}
#endif

#ifndef TEST_VERSION
struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
  { MAKE_VERSION(5,1,NDB_VERSION_BUILD), MAKE_VERSION(5,1,18), UG_Range},
  { MAKE_VERSION(5,1,17), MAKE_VERSION(5,1,0), UG_Range},
  { MAKE_VERSION(5,0,NDB_VERSION_BUILD), MAKE_VERSION(5,0,12), UG_Range},
  { MAKE_VERSION(5,0,11), MAKE_VERSION(5,0,2), UG_Range},
  { MAKE_VERSION(4,1,NDB_VERSION_BUILD), MAKE_VERSION(4,1,15), UG_Range },
  { MAKE_VERSION(4,1,14), MAKE_VERSION(4,1,10), UG_Range },
  { MAKE_VERSION(4,1,10), MAKE_VERSION(4,1,9), UG_Exact },
  { MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact },
  { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact },
  { 0, 0, UG_Null }
};

struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = {
  { MAKE_VERSION(5,0,12), MAKE_VERSION(5,0,11), UG_Exact },
  { MAKE_VERSION(5,0,2), MAKE_VERSION(4,1,8), UG_Exact },
  { MAKE_VERSION(4,1,15), MAKE_VERSION(4,1,14), UG_Exact },
示例#18
0
void Snapshot_LoadState()
{
	char szMessage[32 + MAX_PATH];

	APPLEWIN_SNAPSHOT* pSS = (APPLEWIN_SNAPSHOT*) new char[sizeof(APPLEWIN_SNAPSHOT)];

	try
	{
		if(pSS == NULL)
			throw(0);

		memset(pSS, 0, sizeof(APPLEWIN_SNAPSHOT));

		//

		HANDLE hFile = CreateFile(	g_szSaveStateFilename,
									GENERIC_READ,
									0,
									NULL,
									OPEN_EXISTING,
									FILE_ATTRIBUTE_NORMAL,
									NULL);

		if(hFile == INVALID_HANDLE_VALUE)
		{
			strcpy(szMessage, "File not found: ");
			strcpy(szMessage + strlen(szMessage), g_szSaveStateFilename);
			throw(0);
		}

		DWORD dwBytesRead;
		BOOL bRes = ReadFile(	hFile,
								pSS,
								sizeof(APPLEWIN_SNAPSHOT),
								&dwBytesRead,
								NULL);

		CloseHandle(hFile);

		if(!bRes || (dwBytesRead != sizeof(APPLEWIN_SNAPSHOT)))
		{
			// File size wrong: probably because of version mismatch or corrupt file
			strcpy(szMessage, "File size mismatch");
			throw(0);
		}

		if(pSS->Hdr.dwTag != AW_SS_TAG)
		{
			strcpy(szMessage, "File corrupt");
			throw(0);
		}

		if(pSS->Hdr.dwVersion != MAKE_VERSION(1,0,0,1))
		{
			strcpy(szMessage, "Version mismatch");
			throw(0);
		}

		// TO DO: Verify checksum

		//
		// Reset all sub-systems
		MemReset();

		if (apple2e)
			MemResetPaging();

		DiskReset();
		KeybReset();
		VideoResetState();
		MB_Reset();

		//
		// Apple2 uint
		//

		CpuSetSnapshot(&pSS->Apple2Unit.CPU6502);
		CommSetSnapshot(&pSS->Apple2Unit.Comms);
		JoySetSnapshot(&pSS->Apple2Unit.Joystick);
		KeybSetSnapshot(&pSS->Apple2Unit.Keyboard);
		SpkrSetSnapshot(&pSS->Apple2Unit.Speaker);
		VideoSetSnapshot(&pSS->Apple2Unit.Video);
		MemSetSnapshot(&pSS->Apple2Unit.Memory);

		//

		//
		// Slot4: Mockingboard
		MB_SetSnapshot(&pSS->Mockingboard1, 4);

		//
		// Slot5: Mockingboard
		MB_SetSnapshot(&pSS->Mockingboard2, 5);

		//
		// Slot6: Disk][
		DiskSetSnapshot(&pSS->Disk2, 6);
	}
	catch(int)
	{
		MessageBox(	g_hFrameWindow,
					szMessage,
					TEXT("Load State"),
					MB_ICONEXCLAMATION | MB_SETFOREGROUND);
	}

	delete [] pSS;
}
示例#19
0
void Snapshot_SaveState()
{
	APPLEWIN_SNAPSHOT* pSS = (APPLEWIN_SNAPSHOT*) new char[sizeof(APPLEWIN_SNAPSHOT)];
	if(pSS == NULL)
	{
		// To do
		return;
	}

	memset(pSS, 0, sizeof(APPLEWIN_SNAPSHOT));

	pSS->Hdr.dwTag = AW_SS_TAG;
	pSS->Hdr.dwVersion = MAKE_VERSION(1,0,0,1);
	pSS->Hdr.dwChecksum = 0;	// TO DO

	//
	// Apple2 uint
	//

	pSS->Apple2Unit.UnitHdr.dwLength = sizeof(SS_APPLE2_Unit);
	pSS->Apple2Unit.UnitHdr.dwVersion = MAKE_VERSION(1,0,0,0);

	CpuGetSnapshot(&pSS->Apple2Unit.CPU6502);
	CommGetSnapshot(&pSS->Apple2Unit.Comms);
	JoyGetSnapshot(&pSS->Apple2Unit.Joystick);
	KeybGetSnapshot(&pSS->Apple2Unit.Keyboard);
	SpkrGetSnapshot(&pSS->Apple2Unit.Speaker);
	VideoGetSnapshot(&pSS->Apple2Unit.Video);
	MemGetSnapshot(&pSS->Apple2Unit.Memory);

	//
	// Slot1: Empty
	pSS->Empty1.Hdr.UnitHdr.dwLength = sizeof(SS_CARD_EMPTY);
	pSS->Empty1.Hdr.UnitHdr.dwVersion = MAKE_VERSION(1,0,0,0);
	pSS->Empty1.Hdr.dwSlot = 1;
	pSS->Empty1.Hdr.dwType = CT_Empty;

	//
	// Slot2: Empty
	pSS->Empty2.Hdr.UnitHdr.dwLength = sizeof(SS_CARD_EMPTY);
	pSS->Empty2.Hdr.UnitHdr.dwVersion = MAKE_VERSION(1,0,0,0);
	pSS->Empty2.Hdr.dwSlot = 2;
	pSS->Empty2.Hdr.dwType = CT_Empty;

	//
	// Slot3: Empty
	pSS->Empty3.Hdr.UnitHdr.dwLength = sizeof(SS_CARD_EMPTY);
	pSS->Empty3.Hdr.UnitHdr.dwVersion = MAKE_VERSION(1,0,0,0);
	pSS->Empty3.Hdr.dwSlot = 3;
	pSS->Empty3.Hdr.dwType = CT_Empty;

	//
	// Slot4: Mockingboard
	MB_GetSnapshot(&pSS->Mockingboard1, 4);

	//
	// Slot5: Mockingboard
	MB_GetSnapshot(&pSS->Mockingboard2, 5);

	//
	// Slot6: Disk][
	DiskGetSnapshot(&pSS->Disk2, 6);

	//

	HANDLE hFile = CreateFile(	g_szSaveStateFilename,
								GENERIC_WRITE,
								0,
								NULL,
								CREATE_ALWAYS,
								FILE_ATTRIBUTE_NORMAL,
								NULL);

	DWORD dwError = GetLastError();
	_ASSERT((dwError == 0) || (dwError == ERROR_ALREADY_EXISTS));

	if(hFile != INVALID_HANDLE_VALUE)
	{
		DWORD dwBytesWritten;
		BOOL bRes = WriteFile(	hFile,
								pSS,
								sizeof(APPLEWIN_SNAPSHOT),
								&dwBytesWritten,
								NULL);

		if(!bRes || (dwBytesWritten != sizeof(APPLEWIN_SNAPSHOT)))
			dwError = GetLastError();

		CloseHandle(hFile);
	}
	else
	{
		dwError = GetLastError();
	}

	_ASSERT((dwError == 0) || (dwError == ERROR_ALREADY_EXISTS));

	delete [] pSS;
}
示例#20
0
bool
BackupRestore::table(const TableS & table){
  if (!m_restore && !m_restore_meta)
    return true;

  const char * name = table.getTableName();
 
  /**
   * Ignore blob tables
   */
  if(match_blob(name) >= 0)
    return true;
  
  const NdbTableImpl & tmptab = NdbTableImpl::getImpl(* table.m_dictTable);
  if ((int) tmptab.m_indexType != (int) NdbDictionary::Index::Undefined){
    m_indexes.push_back(table.m_dictTable);
    return true;
  }
  
  BaseString tmp(name);
  Vector<BaseString> split;
  if(tmp.split(split, "/") != 3){
    err << "Invalid table name format `" << name << "`" << endl;
    return false;
  }

  m_ndb->setDatabaseName(split[0].c_str());
  m_ndb->setSchemaName(split[1].c_str());
  
  NdbDictionary::Dictionary* dict = m_ndb->getDictionary();
  if(m_restore_meta)
  {
    NdbDictionary::Table copy(*table.m_dictTable);

    copy.setName(split[2].c_str());
    Uint32 id;
    if (copy.getTablespace(&id))
    {
      debug << "Connecting " << name << " to tablespace oldid: " << id << flush;
      NdbDictionary::Tablespace* ts = m_tablespaces[id];
      debug << " newid: " << ts->getObjectId() << endl;
      copy.setTablespace(* ts);
    }
    
    if (copy.getDefaultNoPartitionsFlag())
    {
      /*
        Table was defined with default number of partitions. We can restore
        it with whatever is the default in this cluster.
        We use the max_rows parameter in calculating the default number.
      */
      Uint32 no_nodes = m_cluster_connection->no_db_nodes();
      copy.setFragmentCount(get_no_fragments(copy.getMaxRows(),
                            no_nodes));
      set_default_nodegroups(&copy);
    }
    else
    {
      /*
        Table was defined with specific number of partitions. It should be
        restored with the same number of partitions. It will either be
        restored in the same node groups as when backup was taken or by
        using a node group map supplied to the ndb_restore program.
      */
      Uint16 *ng_array = (Uint16*)copy.getFragmentData();
      Uint16 no_parts = copy.getFragmentCount();
      if (map_nodegroups(ng_array, no_parts))
      {
        if (translate_frm(&copy))
        {
          err << "Create table " << table.getTableName() << " failed: ";
          err << "Translate frm error" << endl;
          return false;
        }
      }
      copy.setFragmentData((const void *)ng_array, no_parts << 1);
    }

    /**
     * Force of varpart was introduced in 5.1.18, telco 6.1.7 and 6.2.1
     * Since default from mysqld is to add force of varpart (disable with
     * ROW_FORMAT=FIXED) we force varpart onto tables when they are restored
     * from backups taken with older versions. This will be wrong if
     * ROW_FORMAT=FIXED was used on original table, however the likelyhood of
     * this is low, since ROW_FORMAT= was a NOOP in older versions.
     */

    if (table.getBackupVersion() < MAKE_VERSION(5,1,18))
      copy.setForceVarPart(true);
    else if (getMajor(table.getBackupVersion()) == 6 &&
             (table.getBackupVersion() < MAKE_VERSION(6,1,7) ||
              table.getBackupVersion() == MAKE_VERSION(6,2,0)))
      copy.setForceVarPart(true);

    /*
      update min and max rows to reflect the table, this to
      ensure that memory is allocated properly in the ndb kernel
    */
    copy.setMinRows(table.getNoOfRecords());
    if (table.getNoOfRecords() > copy.getMaxRows())
    {
      copy.setMaxRows(table.getNoOfRecords());
    }
    
    NdbTableImpl &tableImpl = NdbTableImpl::getImpl(copy);
    if (table.getBackupVersion() < MAKE_VERSION(5,1,0) && !m_no_upgrade){
      for(int i= 0; i < copy.getNoOfColumns(); i++)
      {
        NdbDictionary::Column::Type t = copy.getColumn(i)->getType();

        if (t == NdbDictionary::Column::Varchar ||
          t == NdbDictionary::Column::Varbinary)
          tableImpl.getColumn(i)->setArrayType(NdbDictionary::Column::ArrayTypeShortVar);
        if (t == NdbDictionary::Column::Longvarchar ||
          t == NdbDictionary::Column::Longvarbinary)
          tableImpl.getColumn(i)->setArrayType(NdbDictionary::Column::ArrayTypeMediumVar);
      }
    }

    if (dict->createTable(copy) == -1) 
    {
      err << "Create table `" << table.getTableName() << "` failed: "
          << dict->getNdbError() << endl;
      if (dict->getNdbError().code == 771)
      {
        /*
          The user on the cluster where the backup was created had specified
          specific node groups for partitions. Some of these node groups
          didn't exist on this cluster. We will warn the user of this and
          inform him of his option.
        */
        err << "The node groups defined in the table didn't exist in this";
        err << " cluster." << endl << "There is an option to use the";
        err << " the parameter ndb-nodegroup-map to define a mapping from";
        err << endl << "the old nodegroups to new nodegroups" << endl; 
      }
      return false;
    }
    info << "Successfully restored table `"
         << table.getTableName() << "`" << endl;
  }  
  
  const NdbDictionary::Table* tab = dict->getTable(split[2].c_str());
  if(tab == 0){
    err << "Unable to find table: `" << split[2].c_str() << "`" << endl;
    return false;
  }
  if(m_restore_meta)
  {
    if (tab->getFrmData())
    {
      // a MySQL Server table is restored, thus an event should be created
      BaseString event_name("REPL$");
      event_name.append(split[0].c_str());
      event_name.append("/");
      event_name.append(split[2].c_str());

      NdbDictionary::Event my_event(event_name.c_str());
      my_event.setTable(*tab);
      my_event.addTableEvent(NdbDictionary::Event::TE_ALL);

      // add all columns to the event
      bool has_blobs = false;
      for(int a= 0; a < tab->getNoOfColumns(); a++)
      {
	my_event.addEventColumn(a);
        NdbDictionary::Column::Type t = tab->getColumn(a)->getType();
        if (t == NdbDictionary::Column::Blob ||
            t == NdbDictionary::Column::Text)
          has_blobs = true;
      }
      if (has_blobs)
        my_event.mergeEvents(true);

      while ( dict->createEvent(my_event) ) // Add event to database
      {
	if (dict->getNdbError().classification == NdbError::SchemaObjectExists)
	{
	  info << "Event for table " << table.getTableName()
	       << " already exists, removing.\n";
	  if (!dict->dropEvent(my_event.getName()))
	    continue;
	}
	err << "Create table event for " << table.getTableName() << " failed: "
	    << dict->getNdbError() << endl;
	dict->dropTable(split[2].c_str());
	return false;
      }
      info << "Successfully restored table event " << event_name << endl ;
    }
  }
  const NdbDictionary::Table* null = 0;
  m_new_tables.fill(table.m_dictTable->getTableId(), null);
  m_new_tables[table.m_dictTable->getTableId()] = tab;
  return true;
}
  void OnInitEnginePlugin();
  void OnDeInitEnginePlugin();
  
  const char *GetPluginName()
  {
    return "vFmodEnginePlugin";
  }
  
};

vFmodEnginePlugin g_FmodEnginePlugin;


// module for serialization/RTTI
DECLARE_THIS_MODULE( g_FmodModule, MAKE_VERSION(1, 0),
                     "Fmod", "Havok", "Havok Fmod", &g_FmodEnginePlugin );

//  Use this to get and initialize the plugin when you link statically
VEXPORT IVisPlugin_cl* GetEnginePlugin_vFmodEnginePlugin()
{
  return &g_FmodEnginePlugin;
}

#if ((defined _DLL) || (defined _WINDLL)) && !defined(VBASE_LIB)
//  The engine uses this to get and initialize the plugin dynamically
VEXPORT IVisPlugin_cl* GetEnginePlugin()
{
  return GetEnginePlugin_vFmodEnginePlugin();
}
#endif // _DLL or _WINDLL
示例#22
0
  void OnInitEnginePlugin();
  void OnDeInitEnginePlugin();

  const char *GetPluginName()
  { // Must match DLL name
    return "T7RunnerEnginePlugin";
  }
};

// Global plugin instance
T7RunnerEnginePlugin g_myComponents;

// Create a global instance of a VModule class
// Note: g_myComponentModule is defined in stdfx.h
DECLARE_THIS_MODULE(g_myComponentModule, MAKE_VERSION(1,0),
                    "Sample Plugin",
                    "Havok",
                    "A sample plugin for entities", &g_myComponents);

// Use this to get and initialize the plugin when you link statically
VEXPORT IVisPlugin_cl* GetEnginePlugin_T7RunnerEnginePlugin(){ return &g_myComponents; }

#if (defined _DLL) || (defined _WINDLL)
// The engine uses this to get and initialize the plugin dynamically
VEXPORT IVisPlugin_cl* GetEnginePlugin() { return GetEnginePlugin_T7RunnerEnginePlugin(); }
#endif

void T7RunnerEnginePlugin::OnInitEnginePlugin()
{
  hkvLog::Info("T7RunnerEnginePlugin:OnInitEnginePlugin()");
示例#23
0
dbus_bool_t
_dbus_misc_test (void)
{
  int major, minor, micro;
  DBusString str;

  /* make sure we don't crash on NULL */
  dbus_get_version (NULL, NULL, NULL);

  /* Now verify that all the compile-time version stuff
   * is right and matches the runtime. These tests
   * are mostly intended to catch various kinds of
   * typo (mixing up major and minor, that sort of thing).
   */
  dbus_get_version (&major, &minor, &micro);

  _dbus_assert (major == DBUS_MAJOR_VERSION);
  _dbus_assert (minor == DBUS_MINOR_VERSION);
  _dbus_assert (micro == DBUS_MICRO_VERSION);

#define MAKE_VERSION(x, y, z) (((x) << 16) | ((y) << 8) | (z))

  /* check that MAKE_VERSION works and produces the intended ordering */
  _dbus_assert (MAKE_VERSION (1, 0, 0) > MAKE_VERSION (0, 0, 0));
  _dbus_assert (MAKE_VERSION (1, 1, 0) > MAKE_VERSION (1, 0, 0));
  _dbus_assert (MAKE_VERSION (1, 1, 1) > MAKE_VERSION (1, 1, 0));

  _dbus_assert (MAKE_VERSION (2, 0, 0) > MAKE_VERSION (1, 1, 1));
  _dbus_assert (MAKE_VERSION (2, 1, 0) > MAKE_VERSION (1, 1, 1));
  _dbus_assert (MAKE_VERSION (2, 1, 1) > MAKE_VERSION (1, 1, 1));

  /* check DBUS_VERSION */
  _dbus_assert (MAKE_VERSION (major, minor, micro) == DBUS_VERSION);

  /* check that ordering works with DBUS_VERSION */
  _dbus_assert (MAKE_VERSION (major - 1, minor, micro) < DBUS_VERSION);
  _dbus_assert (MAKE_VERSION (major, minor - 1, micro) < DBUS_VERSION);
  _dbus_assert (MAKE_VERSION (major, minor, micro - 1) < DBUS_VERSION);
  
  _dbus_assert (MAKE_VERSION (major + 1, minor, micro) > DBUS_VERSION);
  _dbus_assert (MAKE_VERSION (major, minor + 1, micro) > DBUS_VERSION);
  _dbus_assert (MAKE_VERSION (major, minor, micro + 1) > DBUS_VERSION);

  /* Check DBUS_VERSION_STRING */

  if (!_dbus_string_init (&str))
    _dbus_assert_not_reached ("no memory");

  if (!(_dbus_string_append_int (&str, major) &&
        _dbus_string_append_byte (&str, '.') &&
        _dbus_string_append_int (&str, minor) &&
        _dbus_string_append_byte (&str, '.') &&
        _dbus_string_append_int (&str, micro)))
    _dbus_assert_not_reached ("no memory");

  _dbus_assert (_dbus_string_equal_c_str (&str, DBUS_VERSION_STRING));

  _dbus_string_free (&str);
   
  return TRUE;
}
{
public:

  void OnInitEnginePlugin();
  void OnDeInitEnginePlugin();
  
  const char *GetPluginName()
  {
    return "vHavok";  //must match DLL name
  }
};

vHavok_cl g_HavokPlugin;

// declare a module for the serialization
DECLARE_THIS_MODULE(g_vHavokModule, MAKE_VERSION(1,0),
                    "Havok Plugin", "Havok",
                    "Module for the Havok binding", &g_HavokPlugin);

//  Use this to get and initialize the plugin when you link statically
VEXPORT IVisPlugin_cl* GetEnginePlugin_vHavok()
{
  return &g_HavokPlugin;
}

#if ((defined _DLL) || (defined _WINDLL)) && !defined(VBASE_LIB)
//  The engine uses this to get and initialize the plugin dynamically
VEXPORT IVisPlugin_cl* GetEnginePlugin()
{
  return GetEnginePlugin_vHavok();
}
示例#25
0
 */

// ***********************************************************************************************
// Tutorial 04 : Custom Entities
// Copyright (C) Havok.com Inc. All rights reserved.
// ***********************************************************************************************
// How to create a custom entity class
// ***********************************************************************************************
#include <Vision/Samples/Engine/Tutorial04/Tutorial04PCH.h>
#include <Vision/Runtime/Framework/VisionApp/VAppImpl.hpp>

#define MY_VERSION_MAJOR 0x01
#define MY_VERSION_MINOR 0x00

// Module to register our classes with
DECLARE_THIS_MODULE( g_MyModule, MAKE_VERSION(MY_VERSION_MAJOR, MY_VERSION_MINOR), "Engine Sample", "Havok", "Vision Engine Sample", NULL );

class Tutorial04App : public VAppImpl
{
public:
  Tutorial04App() : m_pEntity(NULL) {}
  virtual ~Tutorial04App() {}

  virtual void Init() HKV_OVERRIDE
  {
    // Register the module so the engine knows about the classes
    Vision::RegisterModule(&g_MyModule);

    LoadScene(VisAppLoadSettings("ViewerMap.vscene", ":havok_sdk/Data/Vision/Samples/Engine/Maps/ViewerMap"));
  }
示例#26
0
static INLINE int sys_get_version(uint32_t *version)
{
	uint32_t pv = MAKE_VERSION(MAMBA_VERSION, FIRMWARE_VERSION, IS_CFW);
	return copy_to_user(&pv, get_secure_user_ptr(version), sizeof(uint32_t));
}
示例#27
0
    // encoded as 0x AAAA BBBB CCCC DDDD ULL (spaces added for clarity),
    // but it's not required to be of that format.
    unsigned long long maxVersion;
};

static DllBlockInfo sWindowsDllBlocklist[] = {
    // EXAMPLE:
    // { "uxtheme.dll", ALL_VERSIONS },
    // { "uxtheme.dll", 0x0000123400000000ULL },
    // The DLL name must be in lowercase!

    // NPFFAddon - Known malware
    { "npffaddon.dll", ALL_VERSIONS},

    // AVG 8 - Antivirus vendor AVG, old version, plugin already blocklisted
    {"avgrsstx.dll", MAKE_VERSION(8,5,0,401)},

    // calc.dll - Suspected malware
    {"calc.dll", MAKE_VERSION(1,0,0,1)},

    // hook.dll - Suspected malware
    {"hook.dll", ALL_VERSIONS},

    // GoogleDesktopNetwork3.dll - Extremely old, unversioned instances
    // of this DLL cause crashes
    {"googledesktopnetwork3.dll", UNVERSIONED},

    // rdolib.dll - Suspected malware
    {"rdolib.dll", MAKE_VERSION(6,0,88,4)},

    // fgjk4wvb.dll - Suspected malware
public:

  void OnInitEnginePlugin();
  void OnDeInitEnginePlugin();
  
  const char *GetPluginName()
  {
    return "VisionEnginePlugin";  //must match DLL name
  }
};

VisionEnginePlugin_cl g_VisionEnginePlugin;
extern VModule g_VisionEngineModule;


DECLARE_THIS_MODULE( g_VisionEngineModule, MAKE_VERSION(1, 0),
                     "VisionEngineModule", "Havok", "Engine Effect additions", &g_VisionEnginePlugin);



////////////////////////////////////////////////////////////////////////////
//  -Use this to get and initialize the plugin when you link statically
//   e.g. GetEnginePlugin_VisionEnginePlugin()->InitEnginePlugin();
//  -See VISION_PLUGIN_ENSURE_LOADED for a macro that does 
//   dynamic and static initialization.
////////////////////////////////////////////////////////////////////////////

VEXPORT IVisPlugin_cl* GetEnginePlugin_VisionEnginePlugin()
{
  return &g_VisionEnginePlugin;
}
示例#29
0
// See peripharal.h for documentation on this interface.
const peripheral_packet_interface_t g_framingPacketInterface = {
    serial_packet_init,
    serial_packet_read,
    serial_packet_write,
    serial_packet_abort,
    serial_packet_finalize,
    serial_packet_get_max_packet_size,
    serial_packet_queue_byte
};

//! @brief Ping response.
#if defined(__cplusplus)
const ping_response_t k_PingResponse = {
   MAKE_VERSION(kSerialProtocol_Version_Bugfix,
    kSerialProtocol_Version_Minor,
    kSerialProtocol_Version_Major,
    kSerialProtocol_Version_Name),
    0,        // options, recalculate crc16 if this value changes
    0xeaaa    // crc16 of start byte, packet type, version and options.
              // i.e. [5a a7 00 00 01 50 00 00]
              // Calculated using CRC-16/XMODEM.
};
#else
const ping_response_t k_PingResponse = {
   {kSerialProtocol_Version_Bugfix,
    kSerialProtocol_Version_Minor,
    kSerialProtocol_Version_Major,
    kSerialProtocol_Version_Name},
    0,        // options, recalculate crc16 if this value changes
    0xeaaa    // crc16 of start byte, packet type, version and options.
              // i.e. [5a a7 00 00 01 50 00 00]
	void qGLExtensions::QueryFeatures(void* dc)
	{
		if( GLVersion > 0 )
			return;

		const char* glversion = (const char*)glGetString(GL_VERSION);
		int major, minor;
		bool isgles = false;

		if( 0 == Q_SSCANF(glversion, "%1d.%2d %*s", &major, &minor) )
		{
			Q_SSCANF(glversion, "OpenGL ES %1d %*s", &major);

			minor = 0;
			isgles = true;
		}

		GLVersion = MAKE_VERSION(major, minor);

#ifdef _Q_WINDOWS
		bool coreprofile = (GLVersion >= GL_3_2);

		if( coreprofile )
			glGetStringi = (GLGETSTRINGIPROC)wglGetProcAddress("glGetStringi");

		if( wglGetExtensionsString && dc )
		{
			HDC hdc = (HDC)dc;

			WGL_EXT_swap_control			= wIsSupported("WGL_EXT_swap_control", hdc);
			WGL_ARB_pixel_format			= wIsSupported("WGL_ARB_pixel_format", hdc);
			WGL_ARB_create_context			= wIsSupported("WGL_ARB_create_context", hdc);
			WGL_ARB_create_context_profile	= wIsSupported("WGL_ARB_create_context_profile", hdc);
		}

		if( WGL_ARB_pixel_format )
		{
			wglGetPixelFormatAttribiv		= (WGLGETPIXELFORMATATTRIBIVARBPROC)wglGetProcAddress("wglGetPixelFormatAttribivARB");
			wglGetPixelFormatAttribfv		= (WGLGETPIXELFORMATATTRIBFVARBPROC)wglGetProcAddress("wglGetPixelFormatAttribfvARB");
			wglChoosePixelFormat			= (WGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
		}

		if( WGL_ARB_create_context && WGL_ARB_create_context_profile )
			wglCreateContextAttribs			= (WGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");

		if( WGL_EXT_swap_control )
			wglSwapInterval = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress("wglSwapIntervalEXT");
#endif
		
#ifndef _Q_TEST_LOW_CONFIG
		if( isgles )
		{
			ARB_vertex_buffer_object		= true;
			ARB_vertex_program				= true;
			ARB_fragment_program			= true;
			ARB_shader_objects				= true;
			
			EXT_framebuffer_object			= true;
			EXT_texture_cube_map			= true;

			IMG_texture_compression_pvrtc	= IsSupported("GL_IMG_texture_compression_pvrtc");
			IMG_user_clip_plane				= IsSupported("GL_IMG_user_clip_plane");
		}
		else if( coreprofile )
		{
			ARB_vertex_buffer_object		= true;
			ARB_vertex_program				= true;
			ARB_fragment_program			= true;
			ARB_shader_objects				= true;
			ARB_texture_float				= true;
			ARB_texture_non_power_of_two	= true;
			ARB_texture_rg					= true;
			ARB_texture_compression			= true;
			ARB_draw_buffers				= true;
			ARB_vertex_array_object			= true;
			
			EXT_framebuffer_object			= true;
			EXT_texture_cube_map			= true;
			EXT_framebuffer_sRGB			= true;
			EXT_texture_sRGB				= true;
			EXT_texture_compression_s3tc	= true;
			EXT_framebuffer_multisample		= true;
			EXT_framebuffer_blit			= true;
			EXT_packed_depth_stencil		= true;

			ARB_debug_output					= IsSupported("GL_ARB_debug_output");
			ARB_geometry_shader4				= IsSupported("GL_ARB_geometry_shader4");
			ARB_tessellation_shader				= IsSupported("GL_ARB_tessellation_shader");
			ARB_compute_shader					= IsSupported("GL_ARB_compute_shader");
			ARB_shader_image_load_store			= IsSupported("GL_ARB_shader_image_load_store");
			ARB_shader_storage_buffer_object	= IsSupported("GL_ARB_shader_storage_buffer_object");
			ARB_shader_atomic_counters			= IsSupported("GL_ARB_shader_atomic_counters");
		}
		else
		{
			ARB_vertex_buffer_object		= IsSupported("GL_ARB_vertex_buffer_object");
			ARB_vertex_program				= IsSupported("GL_ARB_vertex_program");
			ARB_fragment_program			= IsSupported("GL_ARB_fragment_program");
			ARB_shader_objects				= IsSupported("GL_ARB_shader_objects");
			ARB_texture_float				= IsSupported("GL_ARB_texture_float");
			ARB_texture_non_power_of_two	= IsSupported("GL_ARB_texture_non_power_of_two");
			ARB_texture_rg					= IsSupported("GL_ARB_texture_rg");
			ARB_texture_compression			= IsSupported("GL_ARB_texture_compression");
			ARB_draw_buffers				= IsSupported("GL_ARB_draw_buffers");
			ARB_vertex_array_object			= IsSupported("GL_ARB_vertex_array_object");

			EXT_framebuffer_object			= IsSupported("GL_EXT_framebuffer_object");
			EXT_framebuffer_sRGB			= IsSupported("GL_EXT_framebuffer_sRGB");
			EXT_framebuffer_multisample		= IsSupported("GL_EXT_framebuffer_multisample");
			EXT_framebuffer_blit			= IsSupported("GL_EXT_framebuffer_blit");
			EXT_texture_sRGB				= IsSupported("GL_EXT_texture_sRGB");
			EXT_texture_compression_s3tc	= IsSupported("GL_EXT_texture_compression_s3tc");
			EXT_texture_cube_map			= IsSupported("GL_EXT_texture_cube_map");
			EXT_packed_depth_stencil		= IsSupported("GL_EXT_packed_depth_stencil");

			if( !EXT_framebuffer_sRGB )
				EXT_framebuffer_sRGB		= IsSupported("GL_ARB_framebuffer_sRGB");

			if( !EXT_texture_cube_map )
				EXT_texture_cube_map		= IsSupported("GL_ARB_texture_cube_map");
		
			if( !ARB_texture_float )
				ARB_texture_float			= IsSupported("GL_APPLE_float_pixels");
		}
#endif

#if defined(_Q_WINDOWS)
		GET_ADDRESS(glActiveTexture, PFNGLACTIVETEXTUREARBPROC, "glActiveTexture");
		GET_ADDRESS(glClientActiveTexture, PFNGLCLIENTACTIVETEXTUREARBPROC, "glClientActiveTexture");
		GET_ADDRESS(glGenerateMipmap, PFNGLGENERATEMIPMAPEXTPROC, "glGenerateMipmapEXT");
		GET_ADDRESS(glMapBuffer, PFNGLMAPBUFFERARBPROC, "glMapBufferARB");
		GET_ADDRESS(glUnmapBuffer, PFNGLUNMAPBUFFERARBPROC, "glUnmapBufferARB");

		if( ARB_texture_compression )
		{
			GET_ADDRESS(glCompressedTexImage2D, PFNGLCOMPRESSEDTEXIMAGE2DPROC, "glCompressedTexImage2D");
			GET_ADDRESS(glCompressedTexImage1D, PFNGLCOMPRESSEDTEXIMAGE1DPROC, "glCompressedTexImage1D");
		}

		if( ARB_draw_buffers )
			GET_ADDRESS(glDrawBuffers, PFNGLDRAWBUFFERSARBPROC, "glDrawBuffers");

		if( ARB_vertex_array_object )
		{
			GET_ADDRESS(glGenVertexArrays, PFNGLGENVERTEXARRAYSPROC, "glGenVertexArrays");
			GET_ADDRESS(glBindVertexArray, PFNGLBINDVERTEXARRAYPROC, "glBindVertexArray");
			GET_ADDRESS(glDeleteVertexArrays, PFNGLDELETEVERTEXARRAYSPROC, "glDeleteVertexArrays");
		}

		if( ARB_vertex_buffer_object )
		{
			GET_ADDRESS(glGetBufferSubData, PFNGLGETBUFFERSUBDATAARBPROC, "glGetBufferSubData");
			GET_ADDRESS(glDrawRangeElements, PFNGLDRAWRANGEELEMENTSPROC, "glDrawRangeElements");

			GET_ADDRESS(glDeleteBuffers, PFNGLDELETEBUFFERSARBPROC, "glDeleteBuffersARB");
			GET_ADDRESS(glBindBuffer, PFNGLBINDBUFFERARBPROC, "glBindBufferARB");
			GET_ADDRESS(glGenBuffers, PFNGLGENBUFFERSARBPROC, "glGenBuffersARB");
			GET_ADDRESS(glBufferData, PFNGLBUFFERDATAARBPROC, "glBufferDataARB");
			GET_ADDRESS(glBufferSubData, PFNGLBUFFERSUBDATAARBPROC, "glBufferSubDataARB");
		}

		if( EXT_framebuffer_object )
		{
			GET_ADDRESS(glGenFramebuffers, PFNGLGENFRAMEBUFFERSEXTPROC, "glGenFramebuffersEXT");
			GET_ADDRESS(glGenRenderbuffers, PFNGLGENRENDERBUFFERSEXTPROC, "glGenRenderbuffersEXT");
			GET_ADDRESS(glBindFramebuffer, PFNGLBINDFRAMEBUFFEREXTPROC, "glBindFramebufferEXT");
			GET_ADDRESS(glFramebufferTexture2D, PFNGLFRAMEBUFFERTEXTURE2DEXTPROC, "glFramebufferTexture2DEXT");
			GET_ADDRESS(glBindRenderbuffer, PFNGLBINDRENDERBUFFEREXTPROC, "glBindRenderbufferEXT");
			GET_ADDRESS(glRenderbufferStorage, PFNGLRENDERBUFFERSTORAGEEXTPROC, "glRenderbufferStorageEXT");
			GET_ADDRESS(glFramebufferRenderbuffer, PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, "glFramebufferRenderbufferEXT");
			GET_ADDRESS(glCheckFramebufferStatus, PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, "glCheckFramebufferStatusEXT");
			GET_ADDRESS(glDeleteFramebuffers, PFNGLDELETEFRAMEBUFFERSEXTPROC, "glDeleteFramebuffersEXT");
			GET_ADDRESS(glDeleteRenderbuffers, PFNGLDELETERENDERBUFFERSEXTPROC, "glDeleteRenderbuffersEXT");
		}

		if( EXT_framebuffer_multisample )
			GET_ADDRESS(glRenderbufferStorageMultisample, PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC, "glRenderbufferStorageMultisampleEXT");

		if( EXT_framebuffer_blit )
			GET_ADDRESS(glBlitFramebuffer, PFNGLBLITFRAMEBUFFEREXTPROC, "glBlitFramebufferEXT");

		if( ARB_shader_objects )
		{
			GET_ADDRESS(glCreateProgram, PFNGLCREATEPROGRAMOBJECTARBPROC, "glCreateProgramObjectARB");
			GET_ADDRESS(glCreateShader, PFNGLCREATESHADEROBJECTARBPROC, "glCreateShaderObjectARB");
			GET_ADDRESS(glShaderSource, PFNGLSHADERSOURCEARBPROC, "glShaderSourceARB");
			GET_ADDRESS(glCompileShader, PFNGLCOMPILESHADERARBPROC, "glCompileShaderARB");
			GET_ADDRESS(glAttachShader, PFNGLATTACHOBJECTARBPROC, "glAttachObjectARB");
			GET_ADDRESS(glDetachShader, PFNGLDETACHOBJECTARBPROC, "glDetachObjectARB");
			GET_ADDRESS(glLinkProgram, PFNGLLINKPROGRAMARBPROC, "glLinkProgramARB");
			GET_ADDRESS(glDeleteProgram, PFNGLDELETEOBJECTARBPROC, "glDeleteObjectARB");
			GET_ADDRESS(glDeleteShader, PFNGLDELETEOBJECTARBPROC, "glDeleteObjectARB");
			GET_ADDRESS(glUseProgram, PFNGLUSEPROGRAMOBJECTARBPROC, "glUseProgramObjectARB");

			GET_ADDRESS(glUniformMatrix2fv, PFNGLUNIFORMMATRIX2FVARBPROC, "glUniformMatrix2fvARB");
			GET_ADDRESS(glUniformMatrix3fv, PFNGLUNIFORMMATRIX3FVARBPROC, "glUniformMatrix3fvARB");
			GET_ADDRESS(glUniformMatrix4fv, PFNGLUNIFORMMATRIX4FVARBPROC, "glUniformMatrix4fvARB");
			GET_ADDRESS(glUniform1i, PFNGLUNIFORM1IARBPROC, "glUniform1iARB");
			GET_ADDRESS(glUniform1f, PFNGLUNIFORM1FARBPROC, "glUniform1fARB");
			GET_ADDRESS(glUniform2f, PFNGLUNIFORM2FARBPROC, "glUniform2fARB");
			GET_ADDRESS(glUniform3f, PFNGLUNIFORM3FARBPROC, "glUniform3fARB");
			GET_ADDRESS(glUniform4f, PFNGLUNIFORM4FARBPROC, "glUniform4fARB");
			GET_ADDRESS(glUniform1fv, PFNGLUNIFORM1FVARBPROC, "glUniform1fvARB");
			GET_ADDRESS(glUniform2fv, PFNGLUNIFORM2FVARBPROC, "glUniform2fvARB");
			GET_ADDRESS(glUniform3fv, PFNGLUNIFORM3FVARBPROC, "glUniform3fvARB");
			GET_ADDRESS(glUniform4fv, PFNGLUNIFORM4FVARBPROC, "glUniform4fvARB");

			GET_ADDRESS(glGetProgramiv, PFNGLGETOBJECTPARAMETERIVARBPROC, "glGetObjectParameterivARB");
			GET_ADDRESS(glGetShaderiv, PFNGLGETOBJECTPARAMETERIVARBPROC, "glGetObjectParameterivARB");
			GET_ADDRESS(glGetActiveUniform, PFNGLGETACTIVEUNIFORMARBPROC, "glGetActiveUniformARB");
			GET_ADDRESS(glGetActiveAttrib, PFNGLGETACTIVEATTRIBPROC, "glGetActiveAttribARB");
			GET_ADDRESS(glGetAttribLocation, PFNGLGETATTRIBLOCATIONPROC, "glGetAttribLocationARB");
			GET_ADDRESS(glGetShaderInfoLog, PFNGLGETINFOLOGARBPROC, "glGetInfoLogARB");
			GET_ADDRESS(glGetProgramInfoLog, PFNGLGETINFOLOGARBPROC, "glGetInfoLogARB");
			GET_ADDRESS(glGetUniformLocation, PFNGLGETUNIFORMLOCATIONARBPROC, "glGetUniformLocationARB");

			GET_ADDRESS(glBindAttribLocation, PFNGLBINDATTRIBLOCATIONARBPROC, "glBindAttribLocationARB");
			GET_ADDRESS(glBindFragDataLocation, PFNGLBINDFRAGDATALOCATIONPROC, "glBindFragDataLocation");

			GET_ADDRESS(glEnableVertexAttribArray, PFNGLENABLEVERTEXATTRIBARRAYARBPROC, "glEnableVertexAttribArrayARB");
			GET_ADDRESS(glDisableVertexAttribArray, PFNGLDISABLEVERTEXATTRIBARRAYARBPROC, "glDisableVertexAttribArrayARB");
			GET_ADDRESS(glVertexAttribPointer, PFNGLVERTEXATTRIBPOINTERARBPROC, "glVertexAttribPointerARB");
		}

		// core profile only
		if( coreprofile )
		{
			GET_ADDRESS(glMapBufferRange, PFNGLMAPBUFFERRANGEPROC, "");
			GET_ADDRESS(glGetIntegeri_v, PFNGLGETINTEGERI_VPROC, "");
			GET_ADDRESS(glGetProgramBinary, PFNGLGETPROGRAMBINARYPROC, "");
		}

		if( ARB_tessellation_shader )
		{
			GET_ADDRESS(glPatchParameteri, PFNGLPATCHPARAMETERIPROC, "");
			GET_ADDRESS(glPatchParameterfv, PFNGLPATCHPARAMETERFVPROC, "");
		}

		if( ARB_compute_shader )
		{
			GET_ADDRESS(glDispatchCompute, PFNGLDISPATCHCOMPUTEPROC, "");
			GET_ADDRESS(glDispatchComputeIndirect, PFNGLDISPATCHCOMPUTEINDIRECTPROC, "");
			GET_ADDRESS(glMemoryBarrier, PFNGLMEMORYBARRIERPROC, "");
		}

		if( ARB_shader_image_load_store )
		{
			GET_ADDRESS(glBindImageTexture, PFNGLBINDIMAGETEXTUREPROC, "");
		}

		if( ARB_shader_storage_buffer_object )
		{
			GET_ADDRESS(glBindBufferBase, PFNGLBINDBUFFERBASEPROC, "");
		}

		if( ARB_debug_output )
		{
			GET_ADDRESS(glDebugMessageControl, PFNGLDEBUGMESSAGECONTROLPROC, "");
			GET_ADDRESS(glDebugMessageCallback, PFNGLDEBUGMESSAGECALLBACKPROC, "");
			GET_ADDRESS(glGetDebugMessageLog, PFNGLGETDEBUGMESSAGELOGPROC, "");
		}
#endif
		
		if( ARB_shader_objects )
		{
			const char* glslversion = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
			int major, minor;
			
			Q_SSCANF(glslversion, "%1d.%2d %*s", &major, &minor);
			GLSLVersion = MAKE_VERSION(major, minor);
		}
		else
			GLSLVersion = 0;
	}