Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
Burger::MacOSXOld Struct Reference

Functions exclusive to Apple macOS. More...

Collaboration diagram for Burger::MacOSXOld:
Collaboration graph
[legend]

Public Types

enum  eDLLIndex { LIBDL_DLL , DLL_COUNT }
 DLL enumeration for loading in system DLLs. More...
 
enum  eCallIndex { CALL_getattrlistbulk , CALL_COUNT }
 Function enumeration for loading in system calls. More...
 

Public Member Functions

 ~MacOSXOld ()
 Clean up globals.
 

Static Public Member Functions

static voidLoadLibraryIndex (eDLLIndex eIndex)
 Load a library if needed.
 
static voidLoadFunctionIndex (eCallIndex eIndex)
 Load a function from a DLL library if needed.
 
static int getattrlistbulk (int dirfd, attrlist *attrList, void *attrBuf, uintptr_t attrBufSize, uint64_t options)
 Call getattrlistbulk() if present on macOS.
 

Private Attributes

voidm_pInstances [DLL_COUNT]
 Instances of dynamically loaded system DLLs.
 
voidm_pMacOSXCalls [CALL_COUNT]
 Pointers to resolved windows function calls.
 
uint8_t m_bInstancesTested [DLL_COUNT]
 Flags to determine if a DLL was tested for loading.
 
uint8_t m_bFunctionsTested [CALL_COUNT]
 Flags to determine if a function was tested for loading.
 

Static Private Attributes

static MacOSXOld g_Globals
 Singleton instance of the macOS global variables.
 

Detailed Description

Functions exclusive to Apple macOS.


Note
This is only available on Mac OSX
See also
Burger::Globals

Member Enumeration Documentation

◆ eCallIndex

Function enumeration for loading in system calls.


Note
This is only available on Mac OSX
See also
LoadFunctionIndex()
Enumerator
CALL_getattrlistbulk 

Index for getattrlistbulk.

CALL_COUNT 

Total number of function calls to be managed.

◆ eDLLIndex

DLL enumeration for loading in system DLLs.


Note
This is only available on Mac OSX
See also
LoadLibraryIndex()
Enumerator
LIBDL_DLL 

Index for libdl.dylib.

DLL_COUNT 

Total number of dynamic libraries to be managed.

Constructor & Destructor Documentation

◆ ~MacOSXOld()

Burger::MacOSXOld::~MacOSXOld ( )

Clean up globals.


If any global resources were allocated at runtime, this function will release all resources before application shutdown

Note
This should not be called by an application directly.

Member Function Documentation

◆ getattrlistbulk()

int BURGER_API Burger::MacOSXOld::getattrlistbulk ( int dirfd,
attrlist * attrList,
void * attrBuf,
uintptr_t attrBufSize,
uint64_t options )
static

Call getattrlistbulk() if present on macOS.


This function exists on macOS 10.10 or later.

Note
This is only available on Mac OSX
Parameters
dirfdA file descriptor that references a directory opened for reading.
attrListPointer to a attribute request structure.
attrBufPointer to a buffer to accept output.
attrBufSizeThe size of the buffer in bytes of attrBuf.
optionsA bit set that controls the behavior.
Returns
Negative on error, positive for the number of entries read.
See also
LoadLibraryIndex()

◆ LoadFunctionIndex()

void *BURGER_API Burger::MacOSXOld::LoadFunctionIndex ( eCallIndex eIndex)
static

Load a function from a DLL library if needed.


Given a function index, detect if the library has already been loaded and if not, load it. If loaded, look up the function and return the pointer to the function or NULL if not found.

Note
This is only available on Mac OSX
Parameters
eIndexeCallIndex index to a macOS function Burgerlib is tracking.
Returns
NULL if the DLL was not loaded or the function didn't exist, a valid function pointer on success
See also
LoadLibraryIndex()

◆ LoadLibraryIndex()

void *BURGER_API Burger::MacOSXOld::LoadLibraryIndex ( eDLLIndex eIndex)
static

Load a library if needed.


Given a DLL index, detect if the library has already been loaded and if so, return the existing void *, otherwise, load the DLL and if successful, return the void *. If the load failed, return NULL.

Note
This is only available on Mac OSX
Parameters
eIndexeDLLIndex index to a DLL Burgerlib is tracking.
Returns
NULL if the DLL was not loaded, a valid pointer on success
See also
LoadFunctionIndex()

Member Data Documentation

◆ g_Globals

Burger::MacOSXOld Burger::MacOSXOld::g_Globals
staticprivate

Singleton instance of the macOS global variables.

◆ m_bFunctionsTested

uint8_t Burger::MacOSXOld::m_bFunctionsTested[CALL_COUNT]
private

Flags to determine if a function was tested for loading.

Note
This is only available on Mac OSX

◆ m_bInstancesTested

uint8_t Burger::MacOSXOld::m_bInstancesTested[DLL_COUNT]
private

Flags to determine if a DLL was tested for loading.

Note
This is only available on Mac OSX

◆ m_pInstances

void* Burger::MacOSXOld::m_pInstances[DLL_COUNT]
private

Instances of dynamically loaded system DLLs.

Note
This is only available on Mac OSX

◆ m_pMacOSXCalls

void* Burger::MacOSXOld::m_pMacOSXCalls[CALL_COUNT]
private

Pointers to resolved windows function calls.

Note
This is only available on Mac OSX