Man page of tw_backup_db(3) and tw_restore_db(3)

Index


NAME

tw_backup_db, tw_restore_db - backup/restore a Textweiser database

SYNOPSIS

C/C++ #include <tw.h>

 tw_errno_t tw_backup_db(tw_t *tw, const char *out_path);

 tw_errno_t tw_restore_db(tw_t *tw, const char *in_path);

DESCRIPTION

tw_backup_db() generates a backup of a Textweiser database.

tw_restore_db() restores a Textweiser database from a backup file.

PARAMETERS

Both tw_backup_db() and tw_restore_db() expect as a first parameter:

tw (tw_t *)

Pointer to an initialized Textweiser object.

tw_backup_db() expects as a second parameter:

out_path (const char *)

Path to the backup file that should be created within the file system.

tw_restore_db() expects as a second parameter:

in_path (const char *)

Path to a previously created Textweiser database backup that should be restored.

RETURN VALUE

Both tw_backup_db() and tw_restore_db() return an error indicator (tw_errno_t). A return value of TW_OK indicates success, any other value discriminates the occurred error.

The function tw_strerror(3) can be used to obtain a natural language error message.

NOTES

o

During restore any data currently stored in the Textweiser database is removed and replaced by the data contained in the backup.

o

tw_backup_db overwrites a backup file if it already exists within the file system.

SEE ALSO

tw_create_db(3), tw_init(3), tw_free(3), tw_strerror(3)

Textweiser User Manual

http://www.lingua-systems.com/text-classifier/textweiser-library/