Versioning#

Functions#

OmniClientRequestId omniClientCreateCheckpoint(char const *url, char const *comment, bool force, void *userData, OmniClientCreateCheckpointCallback callback)

Create a checkpoint for a given URL (which can include a branch, otherwise assume the default branch)

void omniClientFreeBranchAndCheckpoint(struct OmniClientBranchAndCheckpoint *branchAndCheckpoint)

Free the structure returned from omniClientGetBranchAndCheckpointFromQuery .

struct OmniClientBranchAndCheckpoint * omniClientGetBranchAndCheckpointFromQuery(const char *query)

Breaks a query string into the branch/checkpoint parameters.

OmniClientRequestId omniClientListCheckpoints(char const *url, void *userData, OmniClientListCheckpointsCallback callback)

Returns a list of checkpoints for a URL.

char * omniClientMakeQueryFromBranchAndCheckpoint(char const *branch, uint64_t checkpoint, char *buffer, size_t *bufferSize)

This creates a query string from the parameters provided.

Structs#

OmniClientBranchAndCheckpoint

Branch and checkpoint information.

Typedefs#

Functions#

OmniClientRequestId omniClientCreateCheckpoint(
char const *url,
char const *comment,
bool force,
void *userData,
OmniClientCreateCheckpointCallback callback,
)#

Create a checkpoint for a given URL (which can include a branch, otherwise assume the default branch)

Returns a query you can combine this with the source url to retrieve this specific checkpoint ‘force=true’ will create a checkpoint even if there are no changes

Note

If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.

Parameters:
  • url – The URL to create a checkpoint for

  • comment – Optional comment for the checkpoint

  • force – True to create a checkpoint even if there are no changes

  • userData – User data passed to the callback

  • callback – The callback function to register

Returns:

A request ID that can be used with omniClientStop

void omniClientFreeBranchAndCheckpoint(
struct OmniClientBranchAndCheckpoint *branchAndCheckpoint,
)#

Free the structure returned from omniClientGetBranchAndCheckpointFromQuery.

Parameters:

branchAndCheckpoint – The structure to free

struct OmniClientBranchAndCheckpoint *omniClientGetBranchAndCheckpointFromQuery(
const char *query,
)#

Breaks a query string into the branch/checkpoint parameters.

Query could be either the expanded “branch=my_branch&checkpoint=30” or shortened “my_branch&30”

Parameters:

query – The query string to parse

Returns:

A pointer to the branch and checkpoint structure, or nullptr on error

OmniClientRequestId omniClientListCheckpoints(
char const *url,
void *userData,
OmniClientListCheckpointsCallback callback,
)#

Returns a list of checkpoints for a URL.

The “relativePath” in the entries list is a query that you can use with the original URL to access this checkpoint. You can pass relativePath to omniClientGetBranchAndCheckpointFromQuery in order to parse it into the branch and checkpoint.

Note

If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.

Parameters:
  • url – The URL to list checkpoints for

  • userData – User data passed to the callback

  • callback – The callback function to register

Returns:

A request ID that can be used with omniClientStop

char *omniClientMakeQueryFromBranchAndCheckpoint(
char const *branch,
uint64_t checkpoint,
char *buffer,
size_t *bufferSize,
)#

This creates a query string from the parameters provided.

“bufferSize” is an in-out parameter; set it to the size of the buffer before calling this function and it will be set to the actual size when the function returns. If the size required is more than the size provided, this function returns null, otherwise it returns ‘buffer’.

Parameters:
  • branch – The branch name

  • checkpoint – The checkpoint number

  • buffer – The buffer to write the query string into

  • bufferSize – On input, the size of the buffer; on output, the actual size needed

Returns:

A pointer to the constructed query string, or nullptr if the buffer is too small

Typedefs#

typedef void (*OmniClientCreateCheckpointCallback)(void *userData, OmniClientResult result, char const *checkpointQuery)#

This is called with the result of omniClientCreateCheckpoint.

typedef void (*OmniClientListCheckpointsCallback)(void *userData, OmniClientResult result, uint32_t numEntries, struct OmniClientListEntry const *entries)#

This is called with the result of omniClientListCheckpoints.