⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ustaticcppdrv98.cpp

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 CPP
字号:
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: UStaticCppDrv98.cpp,v 1.2 2002/08/06 20:10:50 dallen Exp $
____________________________________________________________________________*/

#include "pgpClassesConfig.h"
#include "UStaticCpp.h"

_USING_PGP

_UNNAMED_BEGIN

// Types

typedef void (_cdecl *PtrVoidFunc)(void);

struct AtExitEntry
{
	PtrVoidFunc func;
	AtExitEntry *next;
};

// Static variables

AtExitEntry *AtExitEntryList = NULL;

_UNNAMED_END


// Exported variables

#pragma data_seg("INITAAAA")
PtrVoidFunc	__xc_a[]	= {NULL};
#pragma data_seg()

#pragma data_seg("INITZZZZ")
PGPUInt32	_aZero		= 0;
#pragma data_seg()


// Functions

int 
_cdecl 
atexit(PtrVoidFunc func)
{
	AtExitEntry	*newEntry;

	newEntry = new AtExitEntry;

	if (IsNull(newEntry))
		return 0;

	newEntry->func = func;

	newEntry->next = AtExitEntryList;
	AtExitEntryList = newEntry;

	return 1;
}

void 
UStaticCpp::CallGlobalConstructors()
{
	PtrVoidFunc	*pfbegin;

	pfbegin = __xc_a;

	while (TRUE)
	{
		++pfbegin;

		if (*pfbegin == NULL)
			break;

		(**pfbegin)();
	}
}

void 
UStaticCpp::CallGlobalDestructors()
{
	AtExitEntry	*curEntry, *nextEntry;

	curEntry = AtExitEntryList;

	while (IsntNull(curEntry))
	{
		curEntry->func();
		nextEntry = curEntry->next;
		delete curEntry;
		curEntry = nextEntry;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -