本文整理匯總了C++中AddExtension函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddExtension函數的具體用法?C++ AddExtension怎麽用?C++ AddExtension使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddExtension函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: _tmain
int _tmain(int argc, _TCHAR * argv[])
{
int a;
_tprintf (_T("ReactOS Project Statistics\n"));
_tprintf (_T("==========================\n\n"));
if (argc < 2 || argc > 2 + MAX_OPTIONS)
{
_tprintf(_T("Usage: stats [-e] [-s] directory\n"));
_tprintf(_T(" -e: don't count empty lines\n"));
_tprintf(_T(" -s: be silent, don't print directories while processing\n"));
return 1;
}
Initialize();
AddExtension (_T("c\0\0"), _T("Ansi C Source files"));
AddExtension (_T("cpp\0cxx\0\0"), _T("C++ Source files"));
AddExtension (_T("h\0\0"), _T("Header files"));
for(a = 1; a < argc - 1; a++)
{
Options[a - 1] = argv[a];
}
SkipEmptyLines = IsOptionSet(_T("-e"));
BeSilent = IsOptionSet(_T("-s"));
Execute (argv[argc - 1]);
Cleanup();
return 0;
}
示例2: XevieExtensionInit
void
XevieExtensionInit ()
{
ExtensionEntry* extEntry;
if (serverGeneration != xevieServerGeneration) {
if ((xevieDevicePrivateIndex = AllocateDevicePrivateIndex()) == -1)
return;
xevieServerGeneration = serverGeneration;
}
if (!AddCallback(&ServerGrabCallback,XevieServerGrabStateCallback,NULL))
return;
if ((extEntry = AddExtension (XEVIENAME,
0,
XevieNumberErrors,
ProcDispatch,
SProcDispatch,
ResetProc,
StandardMinorOpcode))) {
ReqCode = (unsigned char)extEntry->base;
ErrorBase = extEntry->errorBase;
}
/* PC servers initialize the desktop colors (citems) here! */
}
示例3: MITMiscExtensionInit
void
MITMiscExtensionInit(INITARGS)
{
#if 0
ExtensionEntry *extEntry;
if ((extEntry = AddExtension(MITMISCNAME, 0, 0,
ProcMITDispatch, SProcMITDispatch,
MITResetProc, StandardMinorOpcode)) != 0)
MITReqCode = (unsigned char)extEntry->base;
#else
(void) AddExtension(MITMISCNAME, 0, 0,
ProcMITDispatch, SProcMITDispatch,
MITResetProc, StandardMinorOpcode);
#endif
}
示例4: DamageExtensionInit
void
DamageExtensionInit(void)
{
ExtensionEntry *extEntry;
int s;
for (s = 0; s < screenInfo.numScreens; s++)
DamageSetup (screenInfo.screens[s]);
DamageExtType = CreateNewResourceType (FreeDamageExt, "DamageExt");
if (!DamageExtType)
return;
DamageExtWinType = CreateNewResourceType (FreeDamageExtWin, "DamageExtWin");
if (!DamageExtWinType)
return;
if (!dixRegisterPrivateKey(&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (DamageClientRec)))
return;
if (!AddCallback (&ClientStateCallback, DamageClientCallback, 0))
return;
if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents,
XDamageNumberErrors,
ProcDamageDispatch, SProcDamageDispatch,
DamageResetProc, StandardMinorOpcode)) != 0)
{
DamageReqCode = (unsigned char)extEntry->base;
DamageEventBase = extEntry->eventBase;
EventSwapVector[DamageEventBase + XDamageNotify] =
(EventSwapPtr) SDamageNotifyEvent;
SetResourceTypeErrorValue(DamageExtType, extEntry->errorBase + BadDamage);
}
}
示例5: BigReqExtensionInit
void
BigReqExtensionInit(INITARGS)
{
AddExtension(XBigReqExtensionName, 0, 0,
ProcBigReqDispatch, ProcBigReqDispatch,
NULL, StandardMinorOpcode);
}
示例6: XFixesExtensionInit
void
XFixesExtensionInit(void)
{
ExtensionEntry *extEntry;
if (!dixRegisterPrivateKey(&XFixesClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (XFixesClientRec)))
return;
if (!AddCallback (&ClientStateCallback, XFixesClientCallback, 0))
return;
if (XFixesSelectionInit() && XFixesCursorInit () && XFixesRegionInit () &&
(extEntry = AddExtension(XFIXES_NAME, XFixesNumberEvents,
XFixesNumberErrors,
ProcXFixesDispatch, SProcXFixesDispatch,
XFixesResetProc, StandardMinorOpcode)) != 0)
{
XFixesReqCode = (unsigned char)extEntry->base;
XFixesEventBase = extEntry->eventBase;
XFixesErrorBase = extEntry->errorBase;
EventSwapVector[XFixesEventBase + XFixesSelectionNotify] =
(EventSwapPtr) SXFixesSelectionNotifyEvent;
EventSwapVector[XFixesEventBase + XFixesCursorNotify] =
(EventSwapPtr) SXFixesCursorNotifyEvent;
SetResourceTypeErrorValue(RegionResType, XFixesErrorBase + BadRegion);
SetResourceTypeErrorValue(PointerBarrierType,
XFixesErrorBase + BadBarrier);
}
}
示例7: ProcBigReqDispatch
static int
ProcBigReqDispatch(ClientPtr client)
{
REQUEST(xBigReqEnableReq);
xBigReqEnableReply rep;
if (client->swapped) {
swaps(&stuff->length);
}
if (stuff->brReqType != X_BigReqEnable)
return BadRequest;
REQUEST_SIZE_MATCH(xBigReqEnableReq);
client->big_requests = TRUE;
rep = (xBigReqEnableReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.max_request_size = maxBigRequestSize
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.max_request_size);
}
WriteToClient(client, sizeof(xBigReqEnableReply), &rep);
return Success;
}
void
BigReqExtensionInit(void)
{
AddExtension(XBigReqExtensionName, 0, 0,
ProcBigReqDispatch, ProcBigReqDispatch,
NULL, StandardMinorOpcode);
}
示例8: XvMCExtensionInit
void
XvMCExtensionInit()
{
ExtensionEntry *extEntry;
if(XvMCScreenIndex < 0) /* nobody supports it */
return;
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
return;
if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes)))
return;
if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes)))
return;
extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors,
ProcXvMCDispatch, SProcXvMCDispatch,
XvMCResetProc, StandardMinorOpcode);
if(!extEntry) return;
XvMCReqCode = extEntry->base;
XvMCEventBase = extEntry->eventBase;
XvMCErrorBase = extEntry->errorBase;
}
示例9: SELinuxExtensionInit
void
SELinuxExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
/* Check SELinux mode on system, configuration file, and boolean */
if (!is_selinux_enabled()) {
LogMessage(X_INFO, "SELinux: Disabled on system\n");
return;
}
if (selinuxEnforcingState == SELINUX_MODE_DISABLED) {
LogMessage(X_INFO, "SELinux: Disabled in configuration file\n");
return;
}
if (!security_get_boolean_active("xserver_object_manager")) {
LogMessage(X_INFO, "SELinux: Disabled by boolean\n");
return;
}
/* Set up XACE hooks */
SELinuxLabelInit();
SELinuxFlaskInit();
/* Add extension to server */
extEntry = AddExtension(SELINUX_EXTENSION_NAME,
SELinuxNumberEvents, SELinuxNumberErrors,
ProcSELinuxDispatch, SProcSELinuxDispatch,
SELinuxResetProc, StandardMinorOpcode);
AddExtensionAlias("Flask", extEntry);
}
示例10: VMwareXinerama_ExtInit
void
VMwareXinerama_ExtInit(ScrnInfoPtr pScrn)
{
ExtensionEntry *myext;
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Built-in Xinerama active, not initializing VMware Xinerama\n");
pVMWARE->xinerama = FALSE;
return;
}
#endif
if (!(myext = CheckExtension(PANORAMIX_PROTOCOL_NAME))) {
if (!(myext = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
VMwareXineramaDispatch,
SVMwareXineramaDispatch,
VMwareXineramaResetProc,
StandardMinorOpcode))) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to add VMware Xinerama extension.\n");
return;
}
pVMWARE->xinerama = TRUE;
myext->extPrivate = pScrn;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Initialized VMware Xinerama extension.\n");
}
}
示例11: XInputExtensionInit
void
XInputExtensionInit(void)
{
ExtensionEntry *extEntry;
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
SProcIDispatch, IResetProc, StandardMinorOpcode);
if (extEntry) {
IReqCode = extEntry->base;
AllExtensionVersions[IReqCode - 128] = thisversion;
MakeDeviceTypeAtoms();
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
FixExtensionEvents(extEntry);
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
EventSwapVector[DeviceValuator] = SEventIDispatch;
EventSwapVector[DeviceKeyPress] = SEventIDispatch;
EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
EventSwapVector[DeviceButtonPress] = SEventIDispatch;
EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
EventSwapVector[DeviceFocusIn] = SEventIDispatch;
EventSwapVector[DeviceFocusOut] = SEventIDispatch;
EventSwapVector[ProximityIn] = SEventIDispatch;
EventSwapVector[ProximityOut] = SEventIDispatch;
EventSwapVector[DeviceStateNotify] = SEventIDispatch;
EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
} else {
FatalError("IExtensionInit: AddExtensions failed\n");
}
}
示例12: XCMiscExtensionInit
void
XCMiscExtensionInit(INITARGS)
{
AddExtension(XCMiscExtensionName, 0, 0,
ProcXCMiscDispatch, SProcXCMiscDispatch,
NULL, StandardMinorOpcode);
}
示例13: DPMSExtensionInit
void
DPMSExtensionInit(INITARGS)
{
AddExtension(DPMSExtensionName, 0, 0,
ProcDPMSDispatch, SProcDPMSDispatch,
NULL, StandardMinorOpcode);
}
示例14: ResExtensionInit
void
ResExtensionInit(INITARGS)
{
(void) AddExtension(XRES_NAME, 0, 0,
ProcResDispatch, SProcResDispatch,
NULL, StandardMinorOpcode);
}
示例15: winWindowsWMExtensionInit
void
winWindowsWMExtensionInit(void)
{
ExtensionEntry *extEntry;
ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
eventResource = FakeClientID(0);
if (ClientType && eventResourceType &&
(extEntry = AddExtension(WINDOWSWMNAME,
WindowsWMNumberEvents,
WindowsWMNumberErrors,
ProcWindowsWMDispatch,
SProcWindowsWMDispatch,
NULL, StandardMinorOpcode))) {
size_t i;
WMReqCode = (unsigned char) extEntry->base;
WMErrorBase = extEntry->errorBase;
WMEventBase = extEntry->eventBase;
for (i = 0; i < WindowsWMNumberEvents; i++)
EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent;
}
}