libjf API reference guide

Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

jf_journal_util.c File Reference

#include <jf/jf_config.h>
#include <jf_file.h>
#include <jf/jf_journal_util.h>

Go to the source code of this file.

Defines

#define JF_TRACE_MODULE   JF_TRACE_MOD_LIB_JOURNAL

Functions

int jf_journal_util_join (const char *journal_path, const char *journaled_file_path, jf_offset_t file_pos)
int jf_journal_util_leave (const char *journal_path, const char *journaled_file_path)
int jf_journal_util_rename (const char *journal_path, const char *journaled_file_old_path, const char *journaled_file_new_path)


Define Documentation

#define JF_TRACE_MODULE   JF_TRACE_MOD_LIB_JOURNAL
 

Definition at line 33 of file jf_journal_util.c.


Function Documentation

int jf_journal_util_join const char *  journal_path,
const char *  journaled_file_path,
jf_offset_t  file_pos
 

Utility function used to join a journaled file to a journal

Parameters:
journal_path IN path of the journal
journaled_file_path IN path of the file must join the journal
file_pos IN initial journaled file pointer position (use -1 if not interested in setting it)
Returns:
a reason code
Definition at line 37 of file jf_journal_util.c.

References CATCH, FALSE, jf_file_close(), jf_file_get_id(), jf_file_open(), jf_journal_close(), jf_journal_file_set_last_pos(), jf_journal_file_set_last_size(), jf_journal_file_tab_get_jfile(), jf_journal_open(), jf_offset_t, JF_RC_FCLOSE_ERROR, JF_RC_FOPEN_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_OK, jf_set_default_file_open_opts(), jf_set_default_journal_opts(), jf_stream_size(), JF_TRACE, jf_word_t, jf_file_open_opts_s::join_the_journal, jf_journal_opts_s::recovery_enabled, THROW, and TRUE.

Referenced by main().

int jf_journal_util_leave const char *  journal_path,
const char *  journaled_file_path
 

Utility function used to remove a journaled file from a journal

Parameters:
journal_path IN path of the journal
journaled_file_path IN path of the journaled file must leave the journal
Returns:
a reason code
Definition at line 151 of file jf_journal_util.c.

References CATCH, FALSE, jf_journal_t::file_table, jf_journal_close(), jf_journal_file_tab_del(), JF_JOURNAL_FILE_TAB_PATH, jf_journal_file_tab_search(), JF_JOURNAL_FILE_TAB_SIZE, JF_JOURNAL_JOURNAL_FILE_ID, jf_journal_open(), jf_journal_rotate(), jf_journal_update_file_table(), JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_RC_OUT_OF_RANGE, jf_set_default_journal_opts(), JF_TRACE, jf_word_t, jf_journal_opts_s::recovery_enabled, and THROW.

Referenced by main().

int jf_journal_util_rename const char *  journal_path,
const char *  journaled_file_old_path,
const char *  journaled_file_new_path
 

Utility function used to rename a journaled file
NOTE: this function is not transactional: if something goes wrong, automatic recover may not be able to restore a working environment

Parameters:
journal_path IN path of the journal
journaled_file_old_path IN old path of the journaled file must be renamed
journaled_file_new_path IN new path of the journaled file must be renamed
Returns:
a reason code
Definition at line 237 of file jf_journal_util.c.

References CATCH, FALSE, jf_journal_t::file_table, jf_journal_close(), jf_journal_file_set_path(), jf_journal_file_tab_get_jfile(), JF_JOURNAL_FILE_TAB_PATH, jf_journal_file_tab_search(), JF_JOURNAL_JOURNAL_FILE_ID, jf_journal_open(), jf_journal_rotate(), jf_journal_update_file_table(), JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_RC_OUT_OF_RANGE, JF_RC_RENAME_ERROR, jf_set_default_journal_opts(), JF_TRACE, jf_word_t, jf_journal_opts_s::recovery_enabled, and THROW.

Referenced by main().


Copyright 2005 © Tiian