#include <jf/jf_config.h>
#include <jf/jf_defines.h>
#include <jf/jf_wrappers.h>
#include <jf/jf_errors.h>
Go to the source code of this file.
Defines | |
#define | JF_TRACE_MODULE JF_TRACE_MOD_LIB_UTILS |
#define | MAX(a, b) (a>b ? a : b) |
#define | MIN(a, b) (a<b ? a : b) |
Functions | |
unsigned long | jf_magnitude (unsigned long v) |
int | jf_path_is_absolute (const char *path) |
int | jf_stream_size (FILE *stream, jf_offset_t *size) |
int | jf_stream_sync (FILE *stream, jf_word_t policy) |
int | jf_stream_truncate (FILE *stream, jf_offset_t size) |
int | jf_translate_CRLF_NL (byte_t *data, jf_word_t *size) |
int | jf_translate_NL_CRLF (const byte_t *in_data, jf_word_t in_size, byte_t **out_data, jf_word_t *out_size) |
Variables | |
const char * | jf_feature_cache_stress |
const char * | jf_feature_crash_simul |
const char * | jf_feature_debug |
const char * | jf_feature_extra_check |
|
Definition at line 46 of file jf_utils.h. |
|
Definition at line 51 of file jf_utils.h. |
|
Definition at line 54 of file jf_utils.h. |
|
Compute the magnitude of an integer number m(0) = 0 m(1) = 1 m(2) = 2 m(3) = m(4) = 3 m(5) = m(6) = m(7) = m(8) = 4 ...
|
|
Check if path is absolute. NOTE: path must NOT be NULL.
References JF_PATH_SEPARATOR. |
|
Retrieve the size of a stream
References CATCH, fseeko, ftello, jf_offset_t, JF_RC_FFLUSH_ERROR, JF_RC_FILENO_ERROR, JF_RC_FSEEK_ERROR, JF_RC_FSTAT_ERROR, JF_RC_FTELL_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_TRACE, and THROW. Referenced by jf_journal_load(), and jf_journal_util_join(). |
|
Synchronize a standard C stream using the desired policy
References CATCH, JF_JOURNAL_PROP_SYNC_SAFE, JF_RC_FDATASYNC_ERROR, JF_RC_FFLUSH_ERROR, JF_RC_FSYNC_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_NULL_OBJECT, JF_RC_OK, JF_TRACE, jf_word_t, and THROW. Referenced by bench_00_sio_run(), bench_01_sio_run(), bench_02_sio_run(), bench_03_sio_run(), bench_X1_sio_pre(), jf_journal_close_detach_file(), jf_journal_rotate(), and jf_journal_sync(). |
|
Truncate a stream shortening (enlarging) it
References CATCH, jf_offset_t, JF_RC_FFLUSH_ERROR, JF_RC_FILENO_ERROR, JF_RC_FTRUNCATE_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_TRACE, and THROW. Referenced by jf_journal_cold_recovery_prep_pool(), and jf_journal_rollback_int(). |
|
Translate a string from CRLF format ("\r\n") to NL format ("\n")
References byte_t, CATCH, FALSE, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_TRACE, jf_word_t, THROW, and TRUE. Referenced by jf_journal_get_byte_data(). |
|
Translate a string from NL format ("\n") to CRLF format ("\r\n")
References byte_t, CATCH, JF_RC_INTERNAL_ERROR, JF_RC_MALLOC_ERROR, JF_RC_OK, JF_TRACE, jf_word_t, and THROW. Referenced by jf_journal_add_byte_data(). |
|
This constant is used to define the symbol jf_feature_cache_stress in the resulting object/library; you can establish if the "--enable-cache-stress" feature was used at build time inspecting library with this command: strings libjf.so | grep 'jf_feature.*=' Definition at line 57 of file jf_utils.c. |
|
This constant is used to define the symbol jf_feature_crash_simul in the resulting object/library; you can establish if the "--enable-crash-simul" feature was used at build time inspecting library with this command: strings libjf.so | grep 'jf_feature.*=' Definition at line 54 of file jf_utils.c. |
|
This constant is used to define the symbol jf_feature_debug in the resulting object/library; you can establish if the "--enable-debug" feature was used at build time inspecting library with this command: strings libjf.so | grep 'jf_feature.*=' Definition at line 51 of file jf_utils.c. |
|
This constant is used to define the symbol jf_feature_extra_check in the resulting object/library; you can establish if the "--enable-extra-check" feature was used at build time inspecting library with this command: strings libjf.so | grep 'jf_feature.*=' Definition at line 60 of file jf_utils.c. |