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; }
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! */ }
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 }
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); } }
void BigReqExtensionInit(INITARGS) { AddExtension(XBigReqExtensionName, 0, 0, ProcBigReqDispatch, ProcBigReqDispatch, NULL, StandardMinorOpcode); }
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); } }
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); }
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; }
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); }
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"); } }
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"); } }
void XCMiscExtensionInit(INITARGS) { AddExtension(XCMiscExtensionName, 0, 0, ProcXCMiscDispatch, SProcXCMiscDispatch, NULL, StandardMinorOpcode); }
void DPMSExtensionInit(INITARGS) { AddExtension(DPMSExtensionName, 0, 0, ProcDPMSDispatch, SProcDPMSDispatch, NULL, StandardMinorOpcode); }
void ResExtensionInit(INITARGS) { (void) AddExtension(XRES_NAME, 0, 0, ProcResDispatch, SProcResDispatch, NULL, StandardMinorOpcode); }
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; } }
void AppleWMExtensionInit( AppleWMProcsPtr procsPtr) { ExtensionEntry* extEntry; ClientType = CreateNewResourceType(WMFreeClient); EventType = CreateNewResourceType(WMFreeEvents); eventResource = FakeClientID(0); if (ClientType && EventType && (extEntry = AddExtension(APPLEWMNAME, AppleWMNumberEvents, AppleWMNumberErrors, ProcAppleWMDispatch, SProcAppleWMDispatch, NULL, StandardMinorOpcode))) { WMReqCode = (unsigned char)extEntry->base; WMErrorBase = extEntry->errorBase; WMEventBase = extEntry->eventBase; EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent; appleWMProcs = procsPtr; } }
void XFree86DRIExtensionInit(void) { ExtensionEntry* extEntry; #ifdef XF86DRI_EVENTS EventType = CreateNewResourceType(XF86DRIFreeEvents); #endif if ( DRIExtensionInit() && #ifdef XF86DRI_EVENTS EventType && ScreenPrivateIndex != -1 && #endif (extEntry = AddExtension(XF86DRINAME, XF86DRINumberEvents, XF86DRINumberErrors, ProcXF86DRIDispatch, SProcXF86DRIDispatch, XF86DRIResetProc, StandardMinorOpcode))) { DRIReqCode = (unsigned char)extEntry->base; DRIErrorBase = extEntry->errorBase; } }
void XTestExtensionInit(INITARGS) { #if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, XTestResetProc, StandardMinorOpcode)) != 0) XTestReqCode = (unsigned char)extEntry->base; #else (void) AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, XTestResetProc, StandardMinorOpcode); #endif }
ALERROR CDesignCollection::LoadAdventureDescMainRes (SDesignLoadCtx &Ctx, CAdventureDesc *pAdventure) // LoadAdventureDescMainRes // // Loads an adventure desc from the main resource file. // Adds a new adventure extension to our internal list and sets Ctx.pExtension { ALERROR error; // Do nothing if the adventure doesn't have an extension UNID. This happens in backwards-compatibility // cases when people have replaced Transcendence.xml if (pAdventure->GetExtensionUNID() == 0) return NOERROR; // Create an extension descriptor for this adventure SExtensionDesc *pEntry; if (error = AddExtension(Ctx, extAdventure, pAdventure->GetExtensionUNID(), true, &pEntry)) return error; pEntry->bRegistered = true; // Since it is included in main resources, it counts as registered // Load name pEntry->sName = pAdventure->GetName(); if (pEntry->sName.IsBlank()) pEntry->sName = strPatternSubst(CONSTLIT("Extension %x"), pAdventure->GetExtensionUNID()); return NOERROR; }
void CSetProgsAdvDlg::DoDataExchange(CDataExchange* pDX) { CResizableStandAloneDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_TOOLLISTCTRL, m_ToolListCtrl); if (pDX->m_bSaveAndValidate) { m_Tools.clear(); int count = m_ToolListCtrl.GetItemCount(); for (int i = 0; i < count; i++) { CString ext = m_ToolListCtrl.GetItemText(i, 0); CString value = m_ToolListCtrl.GetItemText(i, 1); m_Tools[ext] = value; } } else { m_ToolListCtrl.DeleteAllItems(); for (auto it = m_Tools.cbegin(); it != m_Tools.cend() ; ++it) { CString ext = it->first; CString value = it->second; AddExtension(ext, value); } } }
void RRExtensionInit (void) { ExtensionEntry *extEntry; if (RRNScreens == 0) return; if (!dixRequestPrivate(RRClientPrivateKey, sizeof (RRClientRec) + screenInfo.numScreens * sizeof (RRTimesRec))) return; if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) return; RRClientType = CreateNewResourceType(RRFreeClient); if (!RRClientType) return; RREventType = CreateNewResourceType(RRFreeEvents); if (!RREventType) return; extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, ProcRRDispatch, SProcRRDispatch, NULL, StandardMinorOpcode); if (!extEntry) return; RRErrorBase = extEntry->errorBase; RREventBase = extEntry->eventBase; EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) SRRScreenChangeNotifyEvent; EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) SRRNotifyEvent; #ifdef PANORAMIX RRXineramaExtensionInit(); #endif }
void XvMCExtensionInit(void) { ExtensionEntry *extEntry; if(XvMCScreenKey == NULL) /* nobody supports it */ return; if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes, "XvMCRTContext"))) return; if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes, "XvMCRTSurface"))) return; if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes, "XvMCRTSubpicture"))) return; extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors, ProcXvMCDispatch, SProcXvMCDispatch, NULL, StandardMinorOpcode); if(!extEntry) return; XvMCReqCode = extEntry->base; XvMCEventBase = extEntry->eventBase; SetResourceTypeErrorValue(XvMCRTContext, extEntry->errorBase + XvMCBadContext); SetResourceTypeErrorValue(XvMCRTSurface, extEntry->errorBase + XvMCBadSurface); SetResourceTypeErrorValue(XvMCRTSubpicture, extEntry->errorBase + XvMCBadSubpicture); }
void DPMSExtensionInit(INITARGS) { #if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(DPMSExtensionName, 0, 0, ProcDPMSDispatch, SProcDPMSDispatch, DPMSResetProc, StandardMinorOpcode))) DPMSCode = (unsigned char)extEntry->base; #else (void) AddExtension(DPMSExtensionName, 0, 0, ProcDPMSDispatch, SProcDPMSDispatch, DPMSResetProc, StandardMinorOpcode); #endif }
void XFixesExtensionInit(void) { ExtensionEntry *extEntry; XFixesClientPrivateIndex = AllocateClientPrivateIndex (); if (!AllocateClientPrivate (XFixesClientPrivateIndex, 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; } }
/* Init extension, register at server. * Since other extensions may rely on XGE (XInput does already), it is a good * idea to init XGE first, before any other extension. */ void GEExtensionInit(void) { ExtensionEntry *extEntry; if (!dixRegisterPrivateKey(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec))) FatalError("GEExtensionInit: GE private request failed.\n"); if(!AddCallback(&ClientStateCallback, GEClientCallback, 0)) { FatalError("GEExtensionInit: register client callback failed.\n"); } if((extEntry = AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch, GEResetProc, StandardMinorOpcode)) != 0) { memset(GEExtensions, 0, sizeof(GEExtensions)); EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent; } else { FatalError("GEInit: AddExtensions failed.\n"); } }
void ShapeExtensionInit() { ExtensionEntry *extEntry, *AddExtension(); ClientType = CreateNewResourceType(ShapeFreeClient); EventType = CreateNewResourceType(ShapeFreeEvents); if (ClientType && EventType && (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0, ProcShapeDispatch, SProcShapeDispatch, ShapeResetProc, StandardMinorOpcode))) { ShapeReqCode = (unsigned char)extEntry->base; ShapeEventBase = extEntry->eventBase; EventSwapVector[ShapeEventBase] = SShapeNotifyEvent; } }
/***************************************************************************** * * XTestExtension1Init * * Called from InitExtensions in main() or from QueryExtension() if the * extension is dynamically loaded. * * XTestExtension1Init has no events or errors * (other than the core errors). */ void XTestExtension1Init() { /* * holds the pointer to the extension entry structure */ ExtensionEntry *extEntry; extEntry = AddExtension(XTestEXTENSION_NAME, XTestEVENT_COUNT, 0, ProcXTestDispatch, SProcXTestDispatch, XTestResetProc, StandardMinorOpcode); if (extEntry) { /* * remember the request code assigned to this extension */ XTestReqCode = extEntry->base; /* * make an atom saying that this extension is present */ (void) MakeAtom(XTestEXTENSION_NAME, strlen(XTestEXTENSION_NAME), TRUE); /* * remember the event codes assigned to this extension */ XTestInputActionType += extEntry->eventBase; XTestFakeAckType += extEntry->eventBase; /* * install the routine to handle byte-swapping the replies * for this extension in the ReplySwapVector table */ ReplySwapVector[XTestReqCode] = (ReplySwapPtr) SReplyXTestDispatch; /* * install the routine to handle byte-swapping the events * for this extension in the EventSwapVector table */ EventSwapVector[XTestInputActionType] = SEventXTestDispatch; EventSwapVector[XTestFakeAckType] = SEventXTestDispatch; /* * get the resource type for this extension */ XTestType = CreateNewResourceType(XTestCurrentClientGone); if (XTestType == 0) { FatalError("XTestExtension1Init: CreateNewResourceType failed\n"); } } else { FatalError("XTestExtension1Init: AddExtensions failed\n"); } }
void XTestExtensionInit(INITARGS) { AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, NULL, StandardMinorOpcode); xtest_evlist = InitEventList(GetMaximumEventsNum()); }
/** Initialize the extension. */ void DMXExtensionInit(void) { ExtensionEntry *extEntry; if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0, ProcDMXDispatch, SProcDMXDispatch, NULL, StandardMinorOpcode))) DMXCode = extEntry->base; }
void XTestExtensionInit(void) { AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, XTestExtensionTearDown, StandardMinorOpcode); xtest_evlist = InitEventList(GetMaximumEventsNum()); }