當前位置: 首頁>>代碼示例>>C++>>正文


C++ AddExtension函數代碼示例

本文整理匯總了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;
}
開發者ID:hoangduit,項目名稱:reactos,代碼行數:33,代碼來源:stats.c

示例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! */
}
開發者ID:narenas,項目名稱:nx-libs,代碼行數:27,代碼來源:xevie.c

示例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
}
開發者ID:BackupTheBerlios,項目名稱:dri-ex-svn,代碼行數:16,代碼來源:mitmisc.c

示例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);
    }
}
開發者ID:EMGD-Community,項目名稱:xserver-xorg,代碼行數:35,代碼來源:damageext.c

示例5: BigReqExtensionInit

void
BigReqExtensionInit(INITARGS)
{
    AddExtension(XBigReqExtensionName, 0, 0,
                 ProcBigReqDispatch, ProcBigReqDispatch,
                 NULL, StandardMinorOpcode);
}
開發者ID:OpenInkpot-archive,項目名稱:iplinux-xorg-server,代碼行數:7,代碼來源:bigreq.c

示例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);
    }
}
開發者ID:4eremuxa,項目名稱:xserver,代碼行數:28,代碼來源:xfixes.c

示例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);
}
開發者ID:0kRolllKa,項目名稱:xserver,代碼行數:34,代碼來源:bigreq.c

示例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;
}
開發者ID:GrahamCobb,項目名稱:maemo-xsisusb,代碼行數:27,代碼來源:xvmc.c

示例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);
}
開發者ID:4eremuxa,項目名稱:xserver,代碼行數:31,代碼來源:xselinux_ext.c

示例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");
   }
}
開發者ID:dezelin,項目名稱:xf86-video-vmware,代碼行數:34,代碼來源:vmwarexinerama.c

示例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");
    }
}
開發者ID:Magister,項目名稱:x11rdp_xorg71,代碼行數:33,代碼來源:extinit.c

示例12: XCMiscExtensionInit

void
XCMiscExtensionInit(INITARGS)
{
    AddExtension(XCMiscExtensionName, 0, 0,
		 ProcXCMiscDispatch, SProcXCMiscDispatch,
		 NULL, StandardMinorOpcode);
}
開發者ID:Happy-Ferret,項目名稱:xserver-with-gl-accelerated-xephyr,代碼行數:7,代碼來源:xcmisc.c

示例13: DPMSExtensionInit

void
DPMSExtensionInit(INITARGS)
{
    AddExtension(DPMSExtensionName, 0, 0,
		 ProcDPMSDispatch, SProcDPMSDispatch,
		 NULL, StandardMinorOpcode);
}
開發者ID:aosm,項目名稱:X11server,代碼行數:7,代碼來源:dpms.c

示例14: ResExtensionInit

void
ResExtensionInit(INITARGS)
{
    (void) AddExtension(XRES_NAME, 0, 0,
                            ProcResDispatch, SProcResDispatch,
                            NULL, StandardMinorOpcode);
}
開發者ID:Happy-Ferret,項目名稱:xserver-with-gl-accelerated-xephyr,代碼行數:7,代碼來源:xres.c

示例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;
    }
}
開發者ID:cubanismo,項目名稱:xserver,代碼行數:25,代碼來源:winwindowswm.c


注:本文中的AddExtension函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。