VirtualBox

Changeset 82491 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Dec 7, 2019 10:42:14 AM (5 years ago)
Author:
vboxsync
Message:

VBox/GuestHost/SharedClipboard-transfers.h: Just use DECLCALLBACKMEMBER for SHCLPROVIDERINTERFACE too. As already said, easier to read & document, also shorter and probably less work for the compiler to read too. bugref:9437

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/SharedClipboard-transfers.h

    r82490 r82491  
    722722 * This is handed in to the provider implementation callbacks.
    723723 */
    724 typedef struct _SHCLPROVIDERCTX
     724typedef struct SHCLPROVIDERCTX
    725725{
    726726    /** Pointer to the related Shared Clipboard transfer. */
     
    730730} SHCLPROVIDERCTX, *PSHCLPROVIDERCTX;
    731731
    732 /** @todo r=bird: These macros must go as they do no lend themselves to writing
    733  *        sane documentation.  Use the DECLCALLBACKMEMBER macro instead, as you
    734  *        probably do not need the function and function pointer typedefs.
    735  *
    736  *        However, we need the documentation as you don't document a flying
    737  *        flamingo elsewhere regarding these functions.
    738  */
    739 /** Defines an clipboard transfer provider function declaration with additional parameters. */
    740 #define SHCLPROVIDERFUNCDECL(a_Name, ...) \
    741     typedef DECLCALLBACK(int) RT_CONCAT(FNSHCLPROVIDER, a_Name)(PSHCLPROVIDERCTX, __VA_ARGS__); \
    742     typedef RT_CONCAT(FNSHCLPROVIDER, a_Name) RT_CONCAT(*PFNSHCLPROVIDER, a_Name);
    743 
    744 /** Defines an clipboard transfer provider function declaration with additional parameters. */
    745 #define SHCLPROVIDERFUNCDECLRET(a_Ret, a_Name, ...) \
    746     typedef DECLCALLBACK(a_Ret) RT_CONCAT(FNSHCLPROVIDER, a_Name)(PSHCLPROVIDERCTX, __VA_ARGS__); \
    747     typedef RT_CONCAT(FNSHCLPROVIDER, a_Name) RT_CONCAT(*PFNSHCLPROVIDER, a_Name);
    748 
    749 /** Defines an clipboard transfer provider function declaration (no additional parameters). */
    750 #define SHCLPROVIDERFUNCDECLVOID(a_Name) \
    751     typedef DECLCALLBACK(int) RT_CONCAT(FNSHCLPROVIDER, a_Name)(PSHCLPROVIDERCTX); \
    752     typedef RT_CONCAT(FNSHCLPROVIDER, a_Name) RT_CONCAT(*PFNSHCLPROVIDER, a_Name);
    753 
    754 /** Declares a clipboard transfer provider function member. */
    755 #define SHCLPROVIDERFUNCMEMBER(a_Name, a_Member) \
    756     RT_CONCAT(PFNSHCLPROVIDER, a_Name) a_Member;
    757 
    758 SHCLPROVIDERFUNCDECLVOID(TRANSFEROPEN)
    759 SHCLPROVIDERFUNCDECLVOID(TRANSFERCLOSE)
    760 SHCLPROVIDERFUNCDECL(GETROOTS, PSHCLROOTLIST *ppRootList)
    761 SHCLPROVIDERFUNCDECL(LISTOPEN, PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList)
    762 SHCLPROVIDERFUNCDECL(LISTCLOSE, SHCLLISTHANDLE hList)
    763 SHCLPROVIDERFUNCDECL(LISTHDRREAD, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr)
    764 SHCLPROVIDERFUNCDECL(LISTHDRWRITE, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr)
    765 SHCLPROVIDERFUNCDECL(LISTENTRYREAD, SHCLLISTHANDLE hList, PSHCLLISTENTRY pEntry)
    766 SHCLPROVIDERFUNCDECL(LISTENTRYWRITE, SHCLLISTHANDLE hList, PSHCLLISTENTRY pEntry)
    767 SHCLPROVIDERFUNCDECL(OBJOPEN, PSHCLOBJOPENCREATEPARMS pCreateParms, PSHCLOBJHANDLE phObj)
    768 SHCLPROVIDERFUNCDECL(OBJCLOSE, SHCLOBJHANDLE hObj)
    769 SHCLPROVIDERFUNCDECL(OBJREAD, SHCLOBJHANDLE hObj, void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead)
    770 SHCLPROVIDERFUNCDECL(OBJWRITE, SHCLOBJHANDLE hObj, void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten)
    771 
    772732/**
    773733 * Shared Clipboard transfer provider interface table.
    774734 */
    775 typedef struct _SHCLPROVIDERINTERFACE
    776 {
    777     SHCLPROVIDERFUNCMEMBER(TRANSFEROPEN, pfnTransferOpen)
    778     SHCLPROVIDERFUNCMEMBER(TRANSFERCLOSE, pfnTransferClose)
    779     SHCLPROVIDERFUNCMEMBER(GETROOTS, pfnRootsGet)
    780     SHCLPROVIDERFUNCMEMBER(LISTOPEN, pfnListOpen)
    781     SHCLPROVIDERFUNCMEMBER(LISTCLOSE, pfnListClose)
    782     SHCLPROVIDERFUNCMEMBER(LISTHDRREAD, pfnListHdrRead)
    783     SHCLPROVIDERFUNCMEMBER(LISTHDRWRITE, pfnListHdrWrite)
    784     SHCLPROVIDERFUNCMEMBER(LISTENTRYREAD, pfnListEntryRead)
    785     SHCLPROVIDERFUNCMEMBER(LISTENTRYWRITE, pfnListEntryWrite)
    786     SHCLPROVIDERFUNCMEMBER(OBJOPEN, pfnObjOpen)
    787     SHCLPROVIDERFUNCMEMBER(OBJCLOSE, pfnObjClose)
    788     SHCLPROVIDERFUNCMEMBER(OBJREAD, pfnObjRead)
    789     SHCLPROVIDERFUNCMEMBER(OBJWRITE, pfnObjWrite)
     735typedef struct SHCLPROVIDERINTERFACE
     736{
     737    DECLCALLBACKMEMBER(int, pfnTransferOpen)(PSHCLPROVIDERCTX pCtx);
     738    DECLCALLBACKMEMBER(int, pfnTransferClose)(PSHCLPROVIDERCTX pCtx);
     739    DECLCALLBACKMEMBER(int, pfnRootsGet)(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList);
     740    DECLCALLBACKMEMBER(int, pfnListOpen)(PSHCLPROVIDERCTX pCtx, PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList);
     741    DECLCALLBACKMEMBER(int, pfnListClose)(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList);
     742    DECLCALLBACKMEMBER(int, pfnListHdrRead)(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr);
     743    DECLCALLBACKMEMBER(int, pfnListHdrWrite)(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr);
     744    DECLCALLBACKMEMBER(int, pfnListEntryRead)(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pEntry);
     745    DECLCALLBACKMEMBER(int, pfnListEntryWrite)(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pEntry);
     746    DECLCALLBACKMEMBER(int, pfnObjOpen)(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms, PSHCLOBJHANDLE phObj);
     747    DECLCALLBACKMEMBER(int, pfnObjClose)(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj);
     748    DECLCALLBACKMEMBER(int, pfnObjRead)(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, void *pvData, uint32_t cbData,
     749                                        uint32_t fFlags, uint32_t *pcbRead);
     750    DECLCALLBACKMEMBER(int, pfnObjWrite)(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, void *pvData, uint32_t cbData,
     751                                         uint32_t fFlags, uint32_t *pcbWritten);
    790752} SHCLPROVIDERINTERFACE, *PSHCLPROVIDERINTERFACE;
    791753
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette