#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <sys/types.h>
#include <time.h>
#include <ert/util/ert_api_config.hpp>
#include "util_unlink.h"
Go to the source code of this file.
|
#define | UTIL_PATH_SEP_STRING "/" /* A \0 terminated separator used when we want a (char *) instance. */ |
|
#define | UTIL_PATH_SEP_CHAR '/' /* A simple character used when we want an actual char instance (i.e. not a pointer). */ |
|
#define | UTIL_WINDOWS_PATH_SEP_CHAR '\\' |
|
#define | UTIL_POSIX_PATH_SEP_CHAR '/' |
|
#define | UTIL_NEWLINE_STRING " \n" |
|
#define | UTIL_DEFAULT_MKDIR_MODE 0777 /* Directories are by default created with mode a+rwx - and then comes the umask ... */ |
|
#define | F_OK 0 |
|
#define | R_OK 4 |
|
#define | W_OK 2 |
|
#define | X_OK 1 |
|
#define | UTIL_FWRITE_SCALAR(s, stream) { if (fwrite(&s , sizeof s , 1 , stream) != 1) util_abort("%s: write failed: %s\n",__func__ , strerror(errno)); } |
|
#define | UTIL_FREAD_SCALAR(s, stream) |
|
#define | UTIL_FWRITE_VECTOR(s, n, stream) { if (fwrite(s , sizeof s , (n) , stream) != (n)) util_abort("%s: write failed: %s \n",__func__ , strerror(errno)); } |
|
#define | UTIL_FREAD_VECTOR(s, n, stream) { if (fread(s , sizeof s , (n) , stream) != (n)) util_abort("%s: read failed: %s \n",__func__ , strerror(errno)); } |
|
#define | CONTAINS_HEADER(TYPE) int util_sorted_contains_ ## TYPE(const TYPE * data , int size , TYPE value) |
|
|
char * | util_get_timezone (void) |
|
time_t | util_make_datetime_utc (int, int, int, int, int, int) |
|
bool | util_make_datetime_utc_validated (int sec, int min, int hour, int mday, int month, int year, time_t *t) |
|
time_t | util_make_date_utc (int, int, int) |
|
time_t | util_make_pure_date_utc (time_t t) |
|
void | util_inplace_forward_seconds_utc (time_t *t, double seconds) |
|
void | util_inplace_forward_days_utc (time_t *t, double days) |
|
time_t | util_file_mtime (const char *file) |
|
double | util_difftime (time_t, time_t, int *, int *, int *, int *) |
|
double | util_difftime_days (time_t, time_t) |
|
double | util_difftime_seconds (time_t start_time, time_t end_time) |
|
bool | util_after (time_t t, time_t limit) |
|
bool | util_before (time_t t, time_t limit) |
|
bool | util_file_newer (const char *file, time_t t0) |
|
bool | util_file_older (const char *file, time_t t0) |
|
char * | util_alloc_date_string_utc (time_t t) |
|
char * | util_alloc_date_stamp_utc (void) |
|
double | util_pow10 (double x) |
|
bool | util_char_in (char c, int, const char *) |
|
char * | util_alloc_sprintf_va (const char *fmt, va_list ap) |
|
char * | util_alloc_sprintf (const char *,...) |
|
char * | util_realloc_sprintf (char *, const char *,...) |
|
bool | util_fscanf_date_utc (FILE *, time_t *) |
|
bool | util_sscanf_date_utc (const char *, time_t *) |
|
bool | util_sscanf_isodate (const char *, time_t *) |
|
bool | util_sscanf_percent (const char *string, double *value) |
|
bool | util_is_executable (const char *) |
|
bool | util_entry_exists (const char *entry) |
|
bool | util_file_exists (const char *) |
|
bool | util_is_abs_path (const char *) |
|
char * | util_alloc_abs_path (const char *path) |
|
char * | util_alloc_rel_path (const char *__root_path, const char *path) |
|
bool | util_fmt_bit8 (const char *) |
|
bool | util_fmt_bit8_stream (FILE *) |
|
char * | util_strstr_int_format (const char *string) |
|
int | util_int_format_count (const char *string) |
|
bool | util_mkdir_p (const char *path) |
|
void | util_make_path (const char *) |
|
char * | util_newest_file (const char *, const char *) |
|
double | util_file_difftime (const char *, const char *) |
|
bool | util_file_update_required (const char *, const char *) |
|
size_t | util_file_size (const char *) |
|
size_t | util_fd_size (int fd) |
|
void | util_clear_directory (const char *path, bool strict_uid, bool unlink_root) |
|
void | util_unlink_existing (const char *filename) |
|
void | util_strupr (char *) |
|
bool | util_string_equal (const char *s1, const char *s2) |
|
char * | util_alloc_strupr_copy (const char *) |
|
void | util_string_tr (char *, char, char) |
|
bool | util_copy_stream (FILE *, FILE *, size_t, void *, bool abort_on_error) |
|
void | util_move_file (const char *src_file, const char *target_file) |
|
void | util_move_file4 (const char *src_name, const char *target_name, const char *src_path, const char *target_path) |
|
bool | util_copy_file (const char *, const char *) |
|
bool | util_copy_file__ (const char *src_file, const char *target_file, size_t buffer_size, void *buffer, bool abort_on_error) |
|
char * | util_alloc_cwd (void) |
|
bool | util_is_cwd (const char *path) |
|
char * | util_alloc_normal_path (const char *input_path) |
|
char * | util_alloc_realpath (const char *) |
|
char * | util_alloc_realpath__ (const char *input_path) |
|
bool | util_string_match (const char *string, const char *pattern) |
|
bool | util_string_has_wildcard (const char *s) |
|
bool | util_file_readable (const char *file) |
|
bool | util_entry_readable (const char *entry) |
|
bool | util_entry_writable (const char *entry) |
|
bool | util_ftruncate (FILE *stream, long size) |
|
void | util_usleep (unsigned long micro_seconds) |
|
int | util_roundf (float x) |
|
int | util_round (double x) |
|
offset_type | util_ftell (FILE *stream) |
|
int | util_fseek (FILE *stream, offset_type offset, int whence) |
|
void | util_rewind (FILE *stream) |
|
int | util_stat (const char *filename, stat_type *stat_info) |
|
int | util_fstat (int fileno, stat_type *stat_info) |
|
int | util_forward_line (FILE *, bool *) |
|
void | util_rewind_line (FILE *) |
|
int | util_count_content_file_lines (FILE *) |
|
FILE * | util_mkdir_fopen (const char *filename, const char *mode) |
|
int | util_fmove (FILE *stream, long offset, long shift) |
|
FILE * | util_fopen (const char *, const char *) |
|
FILE * | util_fopen__ (const char *filename, const char *mode) |
|
bool | util_fopen_test (const char *, const char *) |
|
char * | util_split_alloc_dirname (const char *input_path) |
|
char * | util_split_alloc_filename (const char *input_path) |
|
void | util_alloc_file_components (const char *, char **, char **, char **) |
|
char * | util_alloc_tmp_file (const char *, const char *, bool) |
|
char * | util_fscanf_alloc_line (FILE *, bool *) |
|
char * | util_fscanf_alloc_token (FILE *) |
|
void | util_fskip_token (FILE *) |
|
void | util_fskip_space (FILE *, bool *) |
|
void | util_fskip_chars (FILE *, const char *, bool *) |
|
void | util_fskip_cchars (FILE *, const char *, bool *) |
|
bool | util_fscanf_int (FILE *, int *) |
|
bool | util_fscanf_bool (FILE *stream, bool *value) |
|
bool | util_sscanf_bool (const char *, bool *) |
|
bool | util_sscanf_octal_int (const char *buffer, int *value) |
|
int | util_strcmp_int (const char *s1, const char *s2) |
|
int | util_strcmp_float (const char *s1, const char *s2) |
|
bool | util_sscanf_int (const char *, int *) |
|
const char * | util_parse_int (const char *, int *, bool *) |
|
const char * | util_skip_sep (const char *, const char *, bool *) |
|
bool | util_sscanf_double (const char *, double *) |
|
char * | util_alloc_filename (const char *, const char *, const char *) |
|
char * | util_realloc_filename (char *, const char *, const char *, const char *) |
|
char * | util_alloc_strip_copy (const char *) |
|
char * | util_alloc_string_sum (const char **, int) |
|
char * | util_strcat_realloc (char *, const char *) |
|
char * | util_alloc_string_copy (const char *) |
|
char ** | util_stringlist_append_copy (char **, int, const char *) |
|
char ** | util_stringlist_append_ref (char **, int, const char *) |
|
char ** | util_alloc_stringlist_copy (const char **, int) |
|
void | util_split_string (const char *, const char *, int *, char ***) |
|
void | util_path_split (const char *, int *, char ***) |
|
char * | util_alloc_parent_path (const char *path) |
|
void | util_binary_split_string (const char *, const char *, bool, char **, char **) |
|
void | util_binary_split_string_from_max_length (const char *, const char *, int, char **, char **) |
|
char * | util_alloc_joined_string (const char **, int, const char *) |
|
char * | util_alloc_multiline_string (const char **, int) |
|
char * | util_string_replace_alloc (const char *, const char *, const char *) |
|
char * | util_string_replacen_alloc (const char *, int, const char **, const char **) |
|
int | util_string_replace_inplace (char **, const char *, const char *) |
|
char * | util_string_strip_chars_alloc (const char *, const char *) |
|
char * | util_realloc_string_copy (char *, const char *) |
|
char * | util_realloc_substring_copy (char *, const char *, int N) |
|
char * | util_realloc_dequoted_string (char *) |
|
char * | util_alloc_dequoted_copy (const char *s) |
|
void | util_free_stringlist (char **, int) |
|
void | util_free_NULL_terminated_stringlist (char **string_list) |
|
char * | util_alloc_substring_copy (const char *, int offset, int N) |
|
bool | util_is_directory (const char *) |
|
bool | util_is_file (const char *) |
|
void | util_set_datetime_values_utc (time_t, int *, int *, int *, int *, int *, int *) |
|
void | util_set_date_values_utc (time_t, int *, int *, int *) |
|
bool | util_is_first_day_in_month_utc (time_t t) |
|
unsigned int | util_dev_urandom_seed () |
|
unsigned int | util_clock_seed (void) |
|
void | util_fread_dev_random (int, char *) |
|
void | util_fread_dev_urandom (int, char *) |
|
bool | util_string_isspace (const char *s) |
|
char * | util_alloc_dump_filename (void) |
|
void | util_abort_test_set_intercept_function (const char *) |
|
bool | util_addr2line_lookup (const void *, char **, char **, int *) |
|
void | util_exit (const char *fmt,...) |
|
void | util_install_signals (void) |
|
void | util_update_signals (void) |
|
void * | util_realloc (void *, size_t) |
|
void * | util_malloc (size_t) |
|
void * | util_calloc (size_t elements, size_t element_size) |
|
void * | util_realloc_copy (void *org_ptr, const void *src, size_t byte_size) |
|
void * | util_alloc_copy (const void *, size_t) |
|
void | util_double_to_float (float *, const double *, int) |
|
void | util_float_to_double (double *, const float *, int) |
|
int | util_get_month_nr (const char *) |
|
char * | util_fread_alloc_file_content (const char *, int *) |
|
void | util_fwrite_string (const char *, FILE *) |
|
char * | util_fread_realloc_string (char *, FILE *) |
|
char * | util_fread_alloc_string (FILE *) |
|
void | util_fskip_string (FILE *stream) |
|
void | util_endian_flip_vector (void *data, int element_size, int elements) |
|
void | util_clamp_double (double *value, double limit1, double limit2) |
|
double | util_double_vector_mean (int, const double *) |
|
double | util_double_vector_stddev (int, const double *) |
|
void | util_double_vector_max_min (int, const double *, double *, double *) |
|
void | util_update_double_max_min (double, double *, double *) |
|
void | util_update_float_max_min (float, float *, float *) |
|
void | util_update_int_max_min (int, int *, int *) |
|
float | util_float_max (float, float) |
|
long int | util_long_max (long int a, long int b) |
|
int | util_int_max (int, int) |
|
double | util_double_max (double, double) |
|
float | util_float_min (float, float) |
|
int | util_int_min (int, int) |
|
size_t | util_size_t_min (size_t a, size_t b) |
|
size_t | util_size_t_max (size_t a, size_t b) |
|
time_t | util_time_t_min (time_t a, time_t b) |
|
time_t | util_time_t_max (time_t a, time_t b) |
|
double | util_double_min (double, double) |
|
void | util_fskip_lines (FILE *, int) |
|
bool | util_same_file (const char *, const char *) |
|
void | util_fread (void *, size_t, size_t, FILE *, const char *) |
|
void | util_fwrite (const void *, size_t, size_t, FILE *, const char *) |
|
time_t | util_fread_time_t (FILE *stream) |
|
int | util_fread_int (FILE *) |
|
long | util_fread_long (FILE *) |
|
bool | util_fread_bool (FILE *) |
|
double | util_fread_double (FILE *stream) |
|
void | util_fwrite_offset (offset_type, FILE *) |
|
void | util_fwrite_size_t (size_t, FILE *) |
|
void | util_fwrite_int (int, FILE *) |
|
void | util_fwrite_long (long, FILE *) |
|
void | util_fwrite_bool (bool, FILE *) |
|
void | util_fwrite_time_t (time_t, FILE *) |
|
void | util_fwrite_double (double, FILE *) |
|
void | util_fwrite_int_vector (const int *, int, FILE *, const char *) |
|
void | util_fwrite_double_vector (const double *, int, FILE *, const char *) |
|
void | util_fread_char_vector (char *, int, FILE *, const char *) |
|
int | util_type_get_id (const void *data) |
|
bool | util_sscanf_bytesize (const char *, size_t *) |
|
int | util_get_current_linenr (FILE *stream) |
|
const char * | util_update_path_var (const char *, const char *, bool) |
|
void | util_fskip_int (FILE *stream) |
|
void | util_fskip_long (FILE *stream) |
|
void | util_fskip_bool (FILE *stream) |
|
bool | util_fseek_string (FILE *stream, const char *string, bool skip_string, bool case_sensitive) |
|
char * | util_fscanf_alloc_upto (FILE *stream, const char *stop_string, bool include_stop_string) |
|
bool | util_files_equal (const char *file1, const char *file2) |
|
double | util_kahan_sum (const double *data, size_t N) |
|
bool | util_double_approx_equal (double d1, double d2) |
|
bool | util_double_approx_equal__ (double d1, double d2, double rel_eps, double abs_eps) |
|
bool | util_float_approx_equal__ (float d1, float d2, float rel_eps, float abs_eps) |
|
int | util_fnmatch (const char *pattern, const char *string) |
|
void | util_time_utc (time_t *t, struct tm *ts) |
|
bool | util_is_link (const char *) |
|
int | util_chdir (const char *path) |
|
bool | util_chdir_file (const char *filename) |
|
bool | util_access (const char *entry, int mode) |
|
| CONTAINS_HEADER (int) |
|
| CONTAINS_HEADER (time_t) |
|
| CONTAINS_HEADER (size_t) |
|
void | util_abort__ (const char *file, const char *function, int line, const char *fmt,...) |
|
void | util_abort_signal (int) |
|
◆ CONTAINS_HEADER
#define CONTAINS_HEADER |
( |
|
TYPE | ) |
int util_sorted_contains_ ## TYPE(const TYPE * data , int size , TYPE value) |
◆ F_OK
◆ R_OK
◆ UTIL_DEFAULT_MKDIR_MODE
#define UTIL_DEFAULT_MKDIR_MODE 0777 /* Directories are by default created with mode a+rwx - and then comes the umask ... */ |
◆ UTIL_FREAD_SCALAR
#define UTIL_FREAD_SCALAR |
( |
|
s, |
|
|
|
stream |
|
) |
| |
Value: { \
int fread_return = fread(&s , sizeof s , 1 , stream); \
if (fread_return == 0) { \
if (errno == 0) \
util_abort("%s: read failed - premature EOF\n",__func__); \
\
util_abort("%s: read failed: %s\n",__func__ , strerror(errno)); \
} \
}
◆ UTIL_FREAD_VECTOR
#define UTIL_FREAD_VECTOR |
( |
|
s, |
|
|
|
n, |
|
|
|
stream |
|
) |
| { if (fread(s , sizeof s , (n) , stream) != (n)) util_abort("%s: read failed: %s \n",__func__ , strerror(errno)); } |
◆ UTIL_FWRITE_SCALAR
#define UTIL_FWRITE_SCALAR |
( |
|
s, |
|
|
|
stream |
|
) |
| { if (fwrite(&s , sizeof s , 1 , stream) != 1) util_abort("%s: write failed: %s\n",__func__ , strerror(errno)); } |
◆ UTIL_FWRITE_VECTOR
#define UTIL_FWRITE_VECTOR |
( |
|
s, |
|
|
|
n, |
|
|
|
stream |
|
) |
| { if (fwrite(s , sizeof s , (n) , stream) != (n)) util_abort("%s: write failed: %s \n",__func__ , strerror(errno)); } |
◆ UTIL_NEWLINE_STRING
#define UTIL_NEWLINE_STRING " \n" |
◆ UTIL_PATH_SEP_CHAR
#define UTIL_PATH_SEP_CHAR '/' /* A simple character used when we want an actual char instance (i.e. not a pointer). */ |
◆ UTIL_PATH_SEP_STRING
#define UTIL_PATH_SEP_STRING "/" /* A \0 terminated separator used when we want a (char *) instance. */ |
◆ UTIL_POSIX_PATH_SEP_CHAR
#define UTIL_POSIX_PATH_SEP_CHAR '/' |
◆ UTIL_WINDOWS_PATH_SEP_CHAR
#define UTIL_WINDOWS_PATH_SEP_CHAR '\\' |
◆ W_OK
◆ X_OK
◆ offset_type
◆ stat_type
◆ walk_dir_callback_ftype
typedef bool() walk_dir_callback_ftype(const char *, const char *, int, void *) |
◆ walk_file_callback_ftype
typedef void() walk_file_callback_ftype(const char *, const char *, void *) |
◆ CONTAINS_HEADER() [1/3]
◆ CONTAINS_HEADER() [2/3]
CONTAINS_HEADER |
( |
size_t |
| ) |
|
◆ CONTAINS_HEADER() [3/3]
CONTAINS_HEADER |
( |
time_t |
| ) |
|
◆ util_abort__()
void util_abort__ |
( |
const char * |
file, |
|
|
const char * |
function, |
|
|
int |
line, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ util_abort_signal()
void util_abort_signal |
( |
int |
| ) |
|
◆ util_abort_test_set_intercept_function()
void util_abort_test_set_intercept_function |
( |
const char * |
| ) |
|
◆ util_access()
bool util_access |
( |
const char * |
entry, |
|
|
int |
mode |
|
) |
| |
◆ util_addr2line_lookup()
bool util_addr2line_lookup |
( |
const void * |
, |
|
|
char ** |
, |
|
|
char ** |
, |
|
|
int * |
|
|
) |
| |
◆ util_after()
bool util_after |
( |
time_t |
t, |
|
|
time_t |
limit |
|
) |
| |
◆ util_alloc_abs_path()
char * util_alloc_abs_path |
( |
const char * |
path | ) |
|
◆ util_alloc_copy()
void * util_alloc_copy |
( |
const void * |
, |
|
|
size_t |
|
|
) |
| |
◆ util_alloc_cwd()
char * util_alloc_cwd |
( |
void |
| ) |
|
◆ util_alloc_date_stamp_utc()
char * util_alloc_date_stamp_utc |
( |
void |
| ) |
|
◆ util_alloc_date_string_utc()
char * util_alloc_date_string_utc |
( |
time_t |
t | ) |
|
◆ util_alloc_dequoted_copy()
char * util_alloc_dequoted_copy |
( |
const char * |
s | ) |
|
◆ util_alloc_dump_filename()
char * util_alloc_dump_filename |
( |
void |
| ) |
|
◆ util_alloc_file_components()
void util_alloc_file_components |
( |
const char * |
, |
|
|
char ** |
, |
|
|
char ** |
, |
|
|
char ** |
|
|
) |
| |
◆ util_alloc_filename()
char * util_alloc_filename |
( |
const char * |
, |
|
|
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_alloc_joined_string()
char * util_alloc_joined_string |
( |
const char ** |
, |
|
|
int |
, |
|
|
const char * |
|
|
) |
| |
◆ util_alloc_multiline_string()
char * util_alloc_multiline_string |
( |
const char ** |
, |
|
|
int |
|
|
) |
| |
◆ util_alloc_normal_path()
char * util_alloc_normal_path |
( |
const char * |
input_path | ) |
|
◆ util_alloc_parent_path()
char * util_alloc_parent_path |
( |
const char * |
path | ) |
|
◆ util_alloc_realpath()
char * util_alloc_realpath |
( |
const char * |
| ) |
|
◆ util_alloc_realpath__()
char * util_alloc_realpath__ |
( |
const char * |
input_path | ) |
|
◆ util_alloc_rel_path()
char * util_alloc_rel_path |
( |
const char * |
__root_path, |
|
|
const char * |
path |
|
) |
| |
◆ util_alloc_sprintf()
char * util_alloc_sprintf |
( |
const char * |
, |
|
|
|
... |
|
) |
| |
◆ util_alloc_sprintf_va()
char * util_alloc_sprintf_va |
( |
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |
◆ util_alloc_string_copy()
char * util_alloc_string_copy |
( |
const char * |
| ) |
|
◆ util_alloc_string_sum()
char * util_alloc_string_sum |
( |
const char ** |
, |
|
|
int |
|
|
) |
| |
◆ util_alloc_stringlist_copy()
char ** util_alloc_stringlist_copy |
( |
const char ** |
, |
|
|
int |
|
|
) |
| |
◆ util_alloc_strip_copy()
char * util_alloc_strip_copy |
( |
const char * |
| ) |
|
◆ util_alloc_strupr_copy()
char * util_alloc_strupr_copy |
( |
const char * |
| ) |
|
◆ util_alloc_substring_copy()
char * util_alloc_substring_copy |
( |
const char * |
, |
|
|
int |
offset, |
|
|
int |
N |
|
) |
| |
◆ util_alloc_tmp_file()
char * util_alloc_tmp_file |
( |
const char * |
, |
|
|
const char * |
, |
|
|
bool |
|
|
) |
| |
◆ util_before()
bool util_before |
( |
time_t |
t, |
|
|
time_t |
limit |
|
) |
| |
◆ util_binary_split_string()
void util_binary_split_string |
( |
const char * |
, |
|
|
const char * |
, |
|
|
bool |
, |
|
|
char ** |
, |
|
|
char ** |
|
|
) |
| |
◆ util_binary_split_string_from_max_length()
void util_binary_split_string_from_max_length |
( |
const char * |
, |
|
|
const char * |
, |
|
|
int |
, |
|
|
char ** |
, |
|
|
char ** |
|
|
) |
| |
◆ util_calloc()
void * util_calloc |
( |
size_t |
elements, |
|
|
size_t |
element_size |
|
) |
| |
◆ util_char_in()
bool util_char_in |
( |
char |
c, |
|
|
int |
, |
|
|
const char * |
|
|
) |
| |
◆ util_chdir()
int util_chdir |
( |
const char * |
path | ) |
|
◆ util_chdir_file()
bool util_chdir_file |
( |
const char * |
filename | ) |
|
◆ util_clamp_double()
void util_clamp_double |
( |
double * |
value, |
|
|
double |
limit1, |
|
|
double |
limit2 |
|
) |
| |
◆ util_clear_directory()
void util_clear_directory |
( |
const char * |
path, |
|
|
bool |
strict_uid, |
|
|
bool |
unlink_root |
|
) |
| |
◆ util_clock_seed()
unsigned int util_clock_seed |
( |
void |
| ) |
|
◆ util_copy_file()
bool util_copy_file |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_copy_file__()
bool util_copy_file__ |
( |
const char * |
src_file, |
|
|
const char * |
target_file, |
|
|
size_t |
buffer_size, |
|
|
void * |
buffer, |
|
|
bool |
abort_on_error |
|
) |
| |
◆ util_copy_stream()
bool util_copy_stream |
( |
FILE * |
, |
|
|
FILE * |
, |
|
|
size_t |
, |
|
|
void * |
, |
|
|
bool |
abort_on_error |
|
) |
| |
◆ util_count_content_file_lines()
int util_count_content_file_lines |
( |
FILE * |
| ) |
|
◆ util_dev_urandom_seed()
unsigned int util_dev_urandom_seed |
( |
| ) |
|
◆ util_difftime()
double util_difftime |
( |
time_t |
, |
|
|
time_t |
, |
|
|
int * |
, |
|
|
int * |
, |
|
|
int * |
, |
|
|
int * |
|
|
) |
| |
◆ util_difftime_days()
double util_difftime_days |
( |
time_t |
, |
|
|
time_t |
|
|
) |
| |
◆ util_difftime_seconds()
double util_difftime_seconds |
( |
time_t |
start_time, |
|
|
time_t |
end_time |
|
) |
| |
◆ util_double_approx_equal()
bool util_double_approx_equal |
( |
double |
d1, |
|
|
double |
d2 |
|
) |
| |
◆ util_double_approx_equal__()
bool util_double_approx_equal__ |
( |
double |
d1, |
|
|
double |
d2, |
|
|
double |
rel_eps, |
|
|
double |
abs_eps |
|
) |
| |
◆ util_double_max()
double util_double_max |
( |
double |
, |
|
|
double |
|
|
) |
| |
◆ util_double_min()
double util_double_min |
( |
double |
, |
|
|
double |
|
|
) |
| |
◆ util_double_to_float()
void util_double_to_float |
( |
float * |
, |
|
|
const double * |
, |
|
|
int |
|
|
) |
| |
◆ util_double_vector_max_min()
void util_double_vector_max_min |
( |
int |
, |
|
|
const double * |
, |
|
|
double * |
, |
|
|
double * |
|
|
) |
| |
◆ util_double_vector_mean()
double util_double_vector_mean |
( |
int |
, |
|
|
const double * |
|
|
) |
| |
◆ util_double_vector_stddev()
double util_double_vector_stddev |
( |
int |
, |
|
|
const double * |
|
|
) |
| |
◆ util_endian_flip_vector()
void util_endian_flip_vector |
( |
void * |
data, |
|
|
int |
element_size, |
|
|
int |
elements |
|
) |
| |
◆ util_entry_exists()
bool util_entry_exists |
( |
const char * |
entry | ) |
|
◆ util_entry_readable()
bool util_entry_readable |
( |
const char * |
entry | ) |
|
◆ util_entry_writable()
bool util_entry_writable |
( |
const char * |
entry | ) |
|
◆ util_exit()
void util_exit |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ util_fd_size()
size_t util_fd_size |
( |
int |
fd | ) |
|
◆ util_file_difftime()
double util_file_difftime |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_file_exists()
bool util_file_exists |
( |
const char * |
| ) |
|
◆ util_file_mtime()
time_t util_file_mtime |
( |
const char * |
file | ) |
|
◆ util_file_newer()
bool util_file_newer |
( |
const char * |
file, |
|
|
time_t |
t0 |
|
) |
| |
◆ util_file_older()
bool util_file_older |
( |
const char * |
file, |
|
|
time_t |
t0 |
|
) |
| |
◆ util_file_readable()
bool util_file_readable |
( |
const char * |
file | ) |
|
◆ util_file_size()
size_t util_file_size |
( |
const char * |
| ) |
|
◆ util_file_update_required()
bool util_file_update_required |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_files_equal()
bool util_files_equal |
( |
const char * |
file1, |
|
|
const char * |
file2 |
|
) |
| |
◆ util_float_approx_equal__()
bool util_float_approx_equal__ |
( |
float |
d1, |
|
|
float |
d2, |
|
|
float |
rel_eps, |
|
|
float |
abs_eps |
|
) |
| |
◆ util_float_max()
float util_float_max |
( |
float |
, |
|
|
float |
|
|
) |
| |
◆ util_float_min()
float util_float_min |
( |
float |
, |
|
|
float |
|
|
) |
| |
◆ util_float_to_double()
void util_float_to_double |
( |
double * |
, |
|
|
const float * |
, |
|
|
int |
|
|
) |
| |
◆ util_fmove()
int util_fmove |
( |
FILE * |
stream, |
|
|
long |
offset, |
|
|
long |
shift |
|
) |
| |
◆ util_fmt_bit8()
bool util_fmt_bit8 |
( |
const char * |
| ) |
|
◆ util_fmt_bit8_stream()
bool util_fmt_bit8_stream |
( |
FILE * |
| ) |
|
◆ util_fnmatch()
int util_fnmatch |
( |
const char * |
pattern, |
|
|
const char * |
string |
|
) |
| |
◆ util_fopen()
FILE * util_fopen |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_fopen__()
FILE * util_fopen__ |
( |
const char * |
filename, |
|
|
const char * |
mode |
|
) |
| |
◆ util_fopen_test()
bool util_fopen_test |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_forward_line()
int util_forward_line |
( |
FILE * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_fread()
void util_fread |
( |
void * |
, |
|
|
size_t |
, |
|
|
size_t |
, |
|
|
FILE * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_fread_alloc_file_content()
char * util_fread_alloc_file_content |
( |
const char * |
, |
|
|
int * |
|
|
) |
| |
◆ util_fread_alloc_string()
char * util_fread_alloc_string |
( |
FILE * |
| ) |
|
◆ util_fread_bool()
bool util_fread_bool |
( |
FILE * |
| ) |
|
◆ util_fread_char_vector()
void util_fread_char_vector |
( |
char * |
, |
|
|
int |
, |
|
|
FILE * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_fread_dev_random()
void util_fread_dev_random |
( |
int |
, |
|
|
char * |
|
|
) |
| |
◆ util_fread_dev_urandom()
void util_fread_dev_urandom |
( |
int |
, |
|
|
char * |
|
|
) |
| |
◆ util_fread_double()
double util_fread_double |
( |
FILE * |
stream | ) |
|
◆ util_fread_int()
int util_fread_int |
( |
FILE * |
| ) |
|
◆ util_fread_long()
long util_fread_long |
( |
FILE * |
| ) |
|
◆ util_fread_realloc_string()
char * util_fread_realloc_string |
( |
char * |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_fread_time_t()
time_t util_fread_time_t |
( |
FILE * |
stream | ) |
|
◆ util_free_NULL_terminated_stringlist()
void util_free_NULL_terminated_stringlist |
( |
char ** |
string_list | ) |
|
◆ util_free_stringlist()
void util_free_stringlist |
( |
char ** |
, |
|
|
int |
|
|
) |
| |
◆ util_fscanf_alloc_line()
char * util_fscanf_alloc_line |
( |
FILE * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_fscanf_alloc_token()
char * util_fscanf_alloc_token |
( |
FILE * |
| ) |
|
◆ util_fscanf_alloc_upto()
char * util_fscanf_alloc_upto |
( |
FILE * |
stream, |
|
|
const char * |
stop_string, |
|
|
bool |
include_stop_string |
|
) |
| |
◆ util_fscanf_bool()
bool util_fscanf_bool |
( |
FILE * |
stream, |
|
|
bool * |
value |
|
) |
| |
◆ util_fscanf_date_utc()
bool util_fscanf_date_utc |
( |
FILE * |
, |
|
|
time_t * |
|
|
) |
| |
◆ util_fscanf_int()
bool util_fscanf_int |
( |
FILE * |
, |
|
|
int * |
|
|
) |
| |
◆ util_fseek()
int util_fseek |
( |
FILE * |
stream, |
|
|
offset_type |
offset, |
|
|
int |
whence |
|
) |
| |
◆ util_fseek_string()
bool util_fseek_string |
( |
FILE * |
stream, |
|
|
const char * |
string, |
|
|
bool |
skip_string, |
|
|
bool |
case_sensitive |
|
) |
| |
◆ util_fskip_bool()
void util_fskip_bool |
( |
FILE * |
stream | ) |
|
◆ util_fskip_cchars()
void util_fskip_cchars |
( |
FILE * |
, |
|
|
const char * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_fskip_chars()
void util_fskip_chars |
( |
FILE * |
, |
|
|
const char * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_fskip_int()
void util_fskip_int |
( |
FILE * |
stream | ) |
|
◆ util_fskip_lines()
void util_fskip_lines |
( |
FILE * |
, |
|
|
int |
|
|
) |
| |
◆ util_fskip_long()
void util_fskip_long |
( |
FILE * |
stream | ) |
|
◆ util_fskip_space()
void util_fskip_space |
( |
FILE * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_fskip_string()
void util_fskip_string |
( |
FILE * |
stream | ) |
|
◆ util_fskip_token()
void util_fskip_token |
( |
FILE * |
| ) |
|
◆ util_fstat()
int util_fstat |
( |
int |
fileno, |
|
|
stat_type * |
stat_info |
|
) |
| |
◆ util_ftell()
◆ util_ftruncate()
bool util_ftruncate |
( |
FILE * |
stream, |
|
|
long |
size |
|
) |
| |
◆ util_fwrite()
void util_fwrite |
( |
const void * |
, |
|
|
size_t |
, |
|
|
size_t |
, |
|
|
FILE * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_fwrite_bool()
void util_fwrite_bool |
( |
bool |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_fwrite_double()
void util_fwrite_double |
( |
double |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_fwrite_double_vector()
void util_fwrite_double_vector |
( |
const double * |
, |
|
|
int |
, |
|
|
FILE * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_fwrite_int()
void util_fwrite_int |
( |
int |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_fwrite_int_vector()
void util_fwrite_int_vector |
( |
const int * |
, |
|
|
int |
, |
|
|
FILE * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_fwrite_long()
void util_fwrite_long |
( |
long |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_fwrite_offset()
◆ util_fwrite_size_t()
void util_fwrite_size_t |
( |
size_t |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_fwrite_string()
void util_fwrite_string |
( |
const char * |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_fwrite_time_t()
void util_fwrite_time_t |
( |
time_t |
, |
|
|
FILE * |
|
|
) |
| |
◆ util_get_current_linenr()
int util_get_current_linenr |
( |
FILE * |
stream | ) |
|
◆ util_get_month_nr()
int util_get_month_nr |
( |
const char * |
| ) |
|
◆ util_get_timezone()
char * util_get_timezone |
( |
void |
| ) |
|
◆ util_inplace_forward_days_utc()
void util_inplace_forward_days_utc |
( |
time_t * |
t, |
|
|
double |
days |
|
) |
| |
◆ util_inplace_forward_seconds_utc()
void util_inplace_forward_seconds_utc |
( |
time_t * |
t, |
|
|
double |
seconds |
|
) |
| |
◆ util_install_signals()
void util_install_signals |
( |
void |
| ) |
|
◆ util_int_format_count()
int util_int_format_count |
( |
const char * |
string | ) |
|
◆ util_int_max()
int util_int_max |
( |
int |
, |
|
|
int |
|
|
) |
| |
◆ util_int_min()
int util_int_min |
( |
int |
, |
|
|
int |
|
|
) |
| |
◆ util_is_abs_path()
bool util_is_abs_path |
( |
const char * |
| ) |
|
◆ util_is_cwd()
bool util_is_cwd |
( |
const char * |
path | ) |
|
◆ util_is_directory()
bool util_is_directory |
( |
const char * |
| ) |
|
◆ util_is_executable()
bool util_is_executable |
( |
const char * |
| ) |
|
◆ util_is_file()
bool util_is_file |
( |
const char * |
| ) |
|
◆ util_is_first_day_in_month_utc()
bool util_is_first_day_in_month_utc |
( |
time_t |
t | ) |
|
◆ util_is_link()
bool util_is_link |
( |
const char * |
| ) |
|
◆ util_kahan_sum()
double util_kahan_sum |
( |
const double * |
data, |
|
|
size_t |
N |
|
) |
| |
◆ util_long_max()
long int util_long_max |
( |
long int |
a, |
|
|
long int |
b |
|
) |
| |
◆ util_make_date_utc()
time_t util_make_date_utc |
( |
int |
, |
|
|
int |
, |
|
|
int |
|
|
) |
| |
◆ util_make_datetime_utc()
time_t util_make_datetime_utc |
( |
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
|
|
) |
| |
◆ util_make_datetime_utc_validated()
bool util_make_datetime_utc_validated |
( |
int |
sec, |
|
|
int |
min, |
|
|
int |
hour, |
|
|
int |
mday, |
|
|
int |
month, |
|
|
int |
year, |
|
|
time_t * |
t |
|
) |
| |
◆ util_make_path()
void util_make_path |
( |
const char * |
| ) |
|
◆ util_make_pure_date_utc()
time_t util_make_pure_date_utc |
( |
time_t |
t | ) |
|
◆ util_malloc()
void * util_malloc |
( |
size_t |
| ) |
|
◆ util_mkdir_fopen()
FILE * util_mkdir_fopen |
( |
const char * |
filename, |
|
|
const char * |
mode |
|
) |
| |
◆ util_mkdir_p()
bool util_mkdir_p |
( |
const char * |
path | ) |
|
◆ util_move_file()
void util_move_file |
( |
const char * |
src_file, |
|
|
const char * |
target_file |
|
) |
| |
◆ util_move_file4()
void util_move_file4 |
( |
const char * |
src_name, |
|
|
const char * |
target_name, |
|
|
const char * |
src_path, |
|
|
const char * |
target_path |
|
) |
| |
◆ util_newest_file()
char * util_newest_file |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_parse_int()
const char * util_parse_int |
( |
const char * |
, |
|
|
int * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_path_split()
void util_path_split |
( |
const char * |
, |
|
|
int * |
, |
|
|
char *** |
|
|
) |
| |
◆ util_pow10()
double util_pow10 |
( |
double |
x | ) |
|
◆ util_realloc()
void * util_realloc |
( |
void * |
, |
|
|
size_t |
|
|
) |
| |
◆ util_realloc_copy()
void * util_realloc_copy |
( |
void * |
org_ptr, |
|
|
const void * |
src, |
|
|
size_t |
byte_size |
|
) |
| |
◆ util_realloc_dequoted_string()
char * util_realloc_dequoted_string |
( |
char * |
| ) |
|
◆ util_realloc_filename()
char * util_realloc_filename |
( |
char * |
, |
|
|
const char * |
, |
|
|
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_realloc_sprintf()
char * util_realloc_sprintf |
( |
char * |
, |
|
|
const char * |
, |
|
|
|
... |
|
) |
| |
◆ util_realloc_string_copy()
char * util_realloc_string_copy |
( |
char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_realloc_substring_copy()
char * util_realloc_substring_copy |
( |
char * |
, |
|
|
const char * |
, |
|
|
int |
N |
|
) |
| |
◆ util_rewind()
void util_rewind |
( |
FILE * |
stream | ) |
|
◆ util_rewind_line()
void util_rewind_line |
( |
FILE * |
| ) |
|
◆ util_round()
int util_round |
( |
double |
x | ) |
|
◆ util_roundf()
int util_roundf |
( |
float |
x | ) |
|
◆ util_same_file()
bool util_same_file |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_set_date_values_utc()
void util_set_date_values_utc |
( |
time_t |
, |
|
|
int * |
, |
|
|
int * |
, |
|
|
int * |
|
|
) |
| |
◆ util_set_datetime_values_utc()
void util_set_datetime_values_utc |
( |
time_t |
, |
|
|
int * |
, |
|
|
int * |
, |
|
|
int * |
, |
|
|
int * |
, |
|
|
int * |
, |
|
|
int * |
|
|
) |
| |
◆ util_size_t_max()
size_t util_size_t_max |
( |
size_t |
a, |
|
|
size_t |
b |
|
) |
| |
◆ util_size_t_min()
size_t util_size_t_min |
( |
size_t |
a, |
|
|
size_t |
b |
|
) |
| |
◆ util_skip_sep()
const char * util_skip_sep |
( |
const char * |
, |
|
|
const char * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_split_alloc_dirname()
char * util_split_alloc_dirname |
( |
const char * |
input_path | ) |
|
◆ util_split_alloc_filename()
char * util_split_alloc_filename |
( |
const char * |
input_path | ) |
|
◆ util_split_string()
void util_split_string |
( |
const char * |
, |
|
|
const char * |
, |
|
|
int * |
, |
|
|
char *** |
|
|
) |
| |
◆ util_sscanf_bool()
bool util_sscanf_bool |
( |
const char * |
, |
|
|
bool * |
|
|
) |
| |
◆ util_sscanf_bytesize()
bool util_sscanf_bytesize |
( |
const char * |
, |
|
|
size_t * |
|
|
) |
| |
◆ util_sscanf_date_utc()
bool util_sscanf_date_utc |
( |
const char * |
, |
|
|
time_t * |
|
|
) |
| |
◆ util_sscanf_double()
bool util_sscanf_double |
( |
const char * |
, |
|
|
double * |
|
|
) |
| |
◆ util_sscanf_int()
bool util_sscanf_int |
( |
const char * |
, |
|
|
int * |
|
|
) |
| |
◆ util_sscanf_isodate()
bool util_sscanf_isodate |
( |
const char * |
, |
|
|
time_t * |
|
|
) |
| |
◆ util_sscanf_octal_int()
bool util_sscanf_octal_int |
( |
const char * |
buffer, |
|
|
int * |
value |
|
) |
| |
◆ util_sscanf_percent()
bool util_sscanf_percent |
( |
const char * |
string, |
|
|
double * |
value |
|
) |
| |
◆ util_stat()
int util_stat |
( |
const char * |
filename, |
|
|
stat_type * |
stat_info |
|
) |
| |
◆ util_strcat_realloc()
char * util_strcat_realloc |
( |
char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_strcmp_float()
int util_strcmp_float |
( |
const char * |
s1, |
|
|
const char * |
s2 |
|
) |
| |
◆ util_strcmp_int()
int util_strcmp_int |
( |
const char * |
s1, |
|
|
const char * |
s2 |
|
) |
| |
◆ util_string_equal()
bool util_string_equal |
( |
const char * |
s1, |
|
|
const char * |
s2 |
|
) |
| |
◆ util_string_has_wildcard()
bool util_string_has_wildcard |
( |
const char * |
s | ) |
|
◆ util_string_isspace()
bool util_string_isspace |
( |
const char * |
s | ) |
|
◆ util_string_match()
bool util_string_match |
( |
const char * |
string, |
|
|
const char * |
pattern |
|
) |
| |
◆ util_string_replace_alloc()
char * util_string_replace_alloc |
( |
const char * |
, |
|
|
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_string_replace_inplace()
int util_string_replace_inplace |
( |
char ** |
, |
|
|
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_string_replacen_alloc()
char * util_string_replacen_alloc |
( |
const char * |
, |
|
|
int |
, |
|
|
const char ** |
, |
|
|
const char ** |
|
|
) |
| |
◆ util_string_strip_chars_alloc()
char * util_string_strip_chars_alloc |
( |
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ util_string_tr()
void util_string_tr |
( |
char * |
, |
|
|
char |
, |
|
|
char |
|
|
) |
| |
◆ util_stringlist_append_copy()
char ** util_stringlist_append_copy |
( |
char ** |
, |
|
|
int |
, |
|
|
const char * |
|
|
) |
| |
◆ util_stringlist_append_ref()
char ** util_stringlist_append_ref |
( |
char ** |
, |
|
|
int |
, |
|
|
const char * |
|
|
) |
| |
◆ util_strstr_int_format()
char * util_strstr_int_format |
( |
const char * |
string | ) |
|
◆ util_strupr()
void util_strupr |
( |
char * |
| ) |
|
◆ util_time_t_max()
time_t util_time_t_max |
( |
time_t |
a, |
|
|
time_t |
b |
|
) |
| |
◆ util_time_t_min()
time_t util_time_t_min |
( |
time_t |
a, |
|
|
time_t |
b |
|
) |
| |
◆ util_time_utc()
void util_time_utc |
( |
time_t * |
t, |
|
|
struct tm * |
ts |
|
) |
| |
◆ util_type_get_id()
int util_type_get_id |
( |
const void * |
data | ) |
|
◆ util_unlink_existing()
void util_unlink_existing |
( |
const char * |
filename | ) |
|
◆ util_update_double_max_min()
void util_update_double_max_min |
( |
double |
, |
|
|
double * |
, |
|
|
double * |
|
|
) |
| |
◆ util_update_float_max_min()
void util_update_float_max_min |
( |
float |
, |
|
|
float * |
, |
|
|
float * |
|
|
) |
| |
◆ util_update_int_max_min()
void util_update_int_max_min |
( |
int |
, |
|
|
int * |
, |
|
|
int * |
|
|
) |
| |
◆ util_update_path_var()
const char * util_update_path_var |
( |
const char * |
, |
|
|
const char * |
, |
|
|
bool |
|
|
) |
| |
◆ util_update_signals()
void util_update_signals |
( |
void |
| ) |
|
◆ util_usleep()
void util_usleep |
( |
unsigned long |
micro_seconds | ) |
|
|