📄 ustaticcppdrvnt.cpp
字号:
/*____________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: UStaticCppDrvNT.cpp,v 1.2 2002/08/06 20:10:51 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(".CRT$XCA")
PtrVoidFunc __xc_a[] = {NULL};
#pragma data_seg(".CRT$XCZ")
PtrVoidFunc __xc_z[] = {NULL};
#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, *pfend;
pfbegin = __xc_a;
pfend = __xc_z;
while (pfbegin < pfend)
{
if (*pfbegin != NULL)
(**pfbegin)();
++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 + -