Internal callback function. This function is used internally by the eXtremeDB backup subsystem to write data chunks to a backup file. It is passed as a callback to low-level backup routines and should not be called directly by applications.
MCO_RET mco_backup_chunk(
/*IN*/ mco_uint4 chunk_id,
/*IN*/ const char *chunk,
/*IN*/ mco_uint4 chunk_size,
/*IN*/ void *param
);
chunk_id
MCO_BACKUP_CHUNK_PAGE_MEMORY, MCO_BACKUP_CHUNK_DICT,
MCO_BACKUP_CHUNK_STOP).chunk
NULL if chunk_size is zero.chunk_size
param
mco_backup_ctx_t context structure, cast to void*. This context holds the backup file
handle, buffer state, and encryption settings.This internal function appends a single data chunk to the backup stream. It is designed to be used as a callback by the core backup engine (e.g., from
mco_backup()) during snapshot or incremental backup operations.The function performs the following actions:
- Writes a chunk header containing the
chunk_idandsize,- Copies the chunk data into an internal buffer,
- Automatically flushes the buffer to the backup file when it becomes full,
- Performs a final flush when the
MCO_BACKUP_CHUNK_STOPmarker is received.It handles buffer management, I/O buffering, and optional encryption (via the context). Direct use of this function may lead to corrupted backup files.
Applications should use high-level APIs such as
mco_backup_create()instead.See Incremental Backup and Restore for more details.
MCO_S_OK
MCO_E_DISK_WRITE), memory allocation failures, or internal system errors during buffer flush.