Base APIs

Platform integration utilities.

Files

file umbra_defs.h
Common definitions across all Umbra APIs.

Classes

struct UmbraAllocator
User provided memory management interface.
struct UmbraLogger
User provided logging interface.
struct UmbraInputStream
User provided input stream interface.
struct UmbraOutputStream
User provided output stream interface.
struct UmbraHttp
User provided HTTP implementation.
struct UmbraConfig
Opaque Umbra configuration struct.

Enums

enum UmbraLogLevel { UmbraLogLevel_Debug = 0, UmbraLogLevel_Info, UmbraLogLevel_Warning, UmbraLogLevel_Error }
Log levels.

Typedefs

typedef void*(* UmbraAllocateFunc )(void*userData, size_t size, const char*info)
The function pointer type for allocating memory.
typedef void(* UmbraDeallocateFunc )(void*userData, void*ptr)
The function pointer type for deallocating memory.
typedef void(* UmbraLogFunc )(void*userData, UmbraLogLevel level, const char*str)
The function pointer type for logging messages.
typedef uint32_t(* UmbraReadFunc )(void*userData, void*buf, uint32_t numBytes)
The function pointer type for reading streams.
typedef uint32_t(* UmbraWriteFunc )(void*userData, const void*ptr, uint32_t numBytes)
The function pointer type for writing streams.
typedef UmbraHttpRequest(* UmbraHttpCreateRequestFunc )(void*userData, const char*url, UmbraHttpMethod method)
The function pointer type for creating UmbraHttpRequest objects.
typedef void(* UmbraHttpDestroyRequestFunc )(void*userData, UmbraHttpRequest req)
The function pointer type for destroying UmbraHttpRequest objects.
typedef void(* UmbraHttpSetUploadDataFunc )(void*userData, UmbraHttpRequest req, const char*data, uint32_t numBytes)
The function pointer type for setting the request body.
typedef void(* UmbraHttpSetUploadStreamFunc )(void*userData, UmbraHttpRequest req, UmbraInputStream*stream)
The function pointer type for setting the request body stream.
typedef void(* UmbraHttpSetDownloadStreamFunc )(void*userData, UmbraHttpRequest req, UmbraOutputStream*stream)
The function pointer type for setting the response output stream.
typedef void(* UmbraHttpSetHeaderFunc )(void*userData, UmbraHttpRequest req, const char*name, const char*value)
The function pointer type for setting HTTP request headers.
typedef void(* UmbraHttpSetAuthorizationFunc )(void*userData, UmbraHttpRequest req, const char*auth)
The function pointer type for setting HTTP request credentials.
typedef void(* UmbraHttpStartTransferFunc )(void*userData, UmbraHttpRequest req)
The function pointer type for starting an HTTP request.
typedef UmbraTransferStatus(* UmbraHttpReadStatusFunc )(void*userData, UmbraHttpRequest req, UmbraHttpTransferInfo*info)
The function pointer type for querying the status of an HTTP request.

Functions

void UmbraConfigInit(UmbraConfig*)
Initialize an UmbraConfig struct with default values.
void UmbraSetAllocator(UmbraConfig* config, const UmbraAllocator* allocator)
Replace the default allocator.
void UmbraSetLogger(UmbraConfig* config, const UmbraLogger* logger, UmbraLogLevel minLevel)
Replace the default logger.
void UmbraSetHttp(UmbraConfig* config, const UmbraHttp* http)
Replace the default HTTP implementation.
UmbraClient* UmbraClientCreate(const char* appName, const UmbraConfig* config)
Create a client object.
void UmbraClientDestroy(UmbraClient* client)
Destroy a client object.
const char* UmbraGetLibraryInfo(UmbraLibraryInfo field)
Get information about Umbra's compile-time configuration.

Enum details

enum UmbraLogLevel

Log levels.

Enumerators
UmbraLogLevel_Debug

Debugging information, only useful for working on Umbra itself.

UmbraLogLevel_Info

An informational message.

UmbraLogLevel_Warning

A warning message.

UmbraLogLevel_Error

A fatal error message.

Typedef details

typedef void*(*UmbraAllocateFunc)(void*userData, size_t size, const char*info)

The function pointer type for allocating memory.

typedef void(*UmbraDeallocateFunc)(void*userData, void*ptr)

The function pointer type for deallocating memory.

typedef void(*UmbraLogFunc)(void*userData, UmbraLogLevel level, const char*str)

The function pointer type for logging messages.

typedef uint32_t(*UmbraReadFunc)(void*userData, void*buf, uint32_t numBytes)

The function pointer type for reading streams.

typedef uint32_t(*UmbraWriteFunc)(void*userData, const void*ptr, uint32_t numBytes)

The function pointer type for writing streams.

typedef UmbraHttpRequest(*UmbraHttpCreateRequestFunc)(void*userData, const char*url, UmbraHttpMethod method)

The function pointer type for creating UmbraHttpRequest objects.

typedef void(*UmbraHttpDestroyRequestFunc)(void*userData, UmbraHttpRequest req)

The function pointer type for destroying UmbraHttpRequest objects.

typedef void(*UmbraHttpSetUploadDataFunc)(void*userData, UmbraHttpRequest req, const char*data, uint32_t numBytes)

The function pointer type for setting the request body.

typedef void(*UmbraHttpSetUploadStreamFunc)(void*userData, UmbraHttpRequest req, UmbraInputStream*stream)

The function pointer type for setting the request body stream.

typedef void(*UmbraHttpSetDownloadStreamFunc)(void*userData, UmbraHttpRequest req, UmbraOutputStream*stream)

The function pointer type for setting the response output stream.

typedef void(*UmbraHttpSetHeaderFunc)(void*userData, UmbraHttpRequest req, const char*name, const char*value)

The function pointer type for setting HTTP request headers.

typedef void(*UmbraHttpSetAuthorizationFunc)(void*userData, UmbraHttpRequest req, const char*auth)

The function pointer type for setting HTTP request credentials.

typedef void(*UmbraHttpStartTransferFunc)(void*userData, UmbraHttpRequest req)

The function pointer type for starting an HTTP request.

typedef UmbraTransferStatus(*UmbraHttpReadStatusFunc)(void*userData, UmbraHttpRequest req, UmbraHttpTransferInfo*info)

The function pointer type for querying the status of an HTTP request.

Function details

void UmbraSetAllocator(UmbraConfig* config, const UmbraAllocator* allocator)

Replace the default allocator.

Parameters
config in The configuration object.
allocator in The allocator implementation.

void UmbraSetLogger(UmbraConfig* config, const UmbraLogger* logger, UmbraLogLevel minLevel)

Replace the default logger.

Parameters
config in The configuration object.
logger in The logger implementation.
minLevel in The minimum logging level.

void UmbraSetHttp(UmbraConfig* config, const UmbraHttp* http)

Replace the default HTTP implementation.

Parameters
config in The configuration object.
http in The HTTP implementation.

UmbraClient* UmbraClientCreate(const char* appName, const UmbraConfig* config)

Create a client object.

Parameters
appName in The application name.
config in The configuration object.
Returns A new client object.

void UmbraClientDestroy(UmbraClient* client)

Destroy a client object.

Parameters
client in The client object.

const char* UmbraGetLibraryInfo(UmbraLibraryInfo field)

Get information about Umbra's compile-time configuration.

Parameters
field in The info string to retrieve.
Returns The ASCII encoded info string. It is statically allocated and doesn't need to be deallocated.

This function returns a string describing Umbra's compile-time configuration. See UmbraLibraryInfo for the complete list of available strings.