tnt-util

tnt-util —

Synopsis




#define     TNT_BITS_TO_BYTES               (bits)
#define     TNT_REAL_LEN_TO_BITMAP_LEN      (bytes)
#define     TNT_BLOCK_IN_FILE_LEN           (block_id, file_len)
#define     NIBBLE_TO_HEX_ASCII             (n)
#define     HEX_ASCII_TO_NIBBLE             (c)
#define     BYTES_IN_K
#define     KS_IN_M
#define     MS_IN_G
#define     GS_IN_T
#define     BYTES_IN_M
#define     BYTES_IN_G
#define     BYTES_IN_T
#define     SECONDS_IN_MINUTE
#define     MINUTES_IN_HOUR
#define     HOURS_IN_DAY
#define     DAYS_IN_WEEK
#define     DAYS_IN_MONTH
#define     DAYS_IN_YEAR
#define     SECONDS_IN_HOUR
#define     SECONDS_IN_DAY
#define     SECONDS_IN_WEEK
#define     SECONDS_IN_MONTH
#define     SECONDS_IN_YEAR
gboolean    tnt_path_exists                 (const gchar *path);
gboolean    tnt_path_is_dir                 (const gchar *path);
gboolean    tnt_path_is_file                (const gchar *file);
gboolean    tnt_dir_have_full_access        (const gchar *dir);
gboolean    tnt_dir_have_full_access_stat   (struct stat *sbuf);
gboolean    tnt_dir_have_read_access        (const gchar *dir);
gboolean    tnt_dir_have_read_access_stat   (struct stat *sbuf);
gboolean    tnt_file_have_full_access       (const gchar *file);
gboolean    tnt_file_have_full_access_stat  (struct stat *sbuf);
gboolean    tnt_file_have_read_access       (const gchar *file);
gboolean    tnt_file_have_read_access_stat  (struct stat *sbuf);
gboolean    tnt_dir_delete                  (const gchar *dir);
gchar*      tnt_amount_print_dot_padded     (guint64 amount);
gchar*      tnt_time_describe               (guint seconds_abs);
gchar*      tnt_time_describe_delta         (gint seconds_ago);
gchar*      tnt_size_describe               (guint64 size);
gchar*      tnt_bandwidth_describe          (guint cps);
gint        tnt_strlen_limited              (const gchar *string,
                                             gint limit);
void        tnt_string_to_lower             (gchar *string);
void        tnt_string_capitalize_first     (gchar *string);
GList*      tnt_string_extract_substrings   (const gchar *string,
                                             gint min_token_len,
                                             gint max_token_len,
                                             gboolean get_min_string_end);
gchar*      tnt_path_make_keyword_string    (const gchar *path);
GSList*     tnt_path_split                  (const gchar *path);
gchar*      tnt_path_join                   (GSList *pelem);
gboolean    tnt_string_is_valid_ipv4_address
                                            (const gchar *address);
gboolean    tnt_string_is_valid_address     (const gchar *address);
TntNodeIP4  tnt_string_to_ip                (const gchar *string);
gchar*      tnt_ip_to_string                (TntNodeIP4 ip);
gchar*      tnt_file_id_to_string           (const TntFileID *file_id);
gboolean    tnt_string_to_file_id           (const gchar *string,
                                             TntFileID *file_id);
gchar*      tnt_block_id_to_string          (gint block_id);
gchar*      tnt_file_block_id_to_string     (const TntFileID *file_id,
                                             gint block_id);
gboolean    tnt_is_valid_file_id_string     (const gchar *string);
gboolean    tnt_is_valid_block_id_string    (const gchar *string);
void        tnt_fold_hash                   (const guchar *hash,
                                             guchar *dest,
                                             guint len);
TntTimeStamp tnt_timestamp                  (void);
void        tnt_slist_free_with_data        (GSList *slist);
void        tnt_list_free_with_data         (GList *list);
gchar*      tnt_filename_to_utf8_lossy      (const gchar *filename);
gchar*      tnt_filename_to_utf8_replace    (gchar *filename);

Description

Details

TNT_BITS_TO_BYTES()

#define     TNT_BITS_TO_BYTES(bits)

bits :

TNT_REAL_LEN_TO_BITMAP_LEN()

#define     TNT_REAL_LEN_TO_BITMAP_LEN(bytes)

bytes :

TNT_BLOCK_IN_FILE_LEN()

#define     TNT_BLOCK_IN_FILE_LEN(block_id, file_len)

block_id :
file_len :

NIBBLE_TO_HEX_ASCII()

#define     NIBBLE_TO_HEX_ASCII(n)

n :

HEX_ASCII_TO_NIBBLE()

#define     HEX_ASCII_TO_NIBBLE(c)

c :

BYTES_IN_K

#define BYTES_IN_K        1024


KS_IN_M

#define KS_IN_M           1024


MS_IN_G

#define MS_IN_G           1024


GS_IN_T

#define GS_IN_T           1024


BYTES_IN_M

#define BYTES_IN_M        ((guint64) BYTES_IN_K * (guint64) KS_IN_M)


BYTES_IN_G

#define BYTES_IN_G        ((guint64) BYTES_IN_M * (guint64) MS_IN_G)


BYTES_IN_T

#define BYTES_IN_T        ((guint64) BYTES_IN_G * (guint64) GS_IN_T)


SECONDS_IN_MINUTE

#define SECONDS_IN_MINUTE 60


MINUTES_IN_HOUR

#define MINUTES_IN_HOUR   60


HOURS_IN_DAY

#define HOURS_IN_DAY      24


DAYS_IN_WEEK

#define DAYS_IN_WEEK      7


DAYS_IN_MONTH

#define DAYS_IN_MONTH     30


DAYS_IN_YEAR

#define DAYS_IN_YEAR      365


SECONDS_IN_HOUR

#define SECONDS_IN_HOUR   (SECONDS_IN_MINUTE * MINUTES_IN_HOUR)


SECONDS_IN_DAY

#define SECONDS_IN_DAY    (SECONDS_IN_HOUR * HOURS_IN_DAY)


SECONDS_IN_WEEK

#define SECONDS_IN_WEEK   (SECONDS_IN_DAY * DAYS_IN_WEEK)


SECONDS_IN_MONTH

#define SECONDS_IN_MONTH  (SECONDS_IN_DAY * DAYS_IN_MONTH)


SECONDS_IN_YEAR

#define SECONDS_IN_YEAR   (SECONDS_IN_DAY * DAYS_IN_YEAR)


tnt_path_exists ()

gboolean    tnt_path_exists                 (const gchar *path);

path :
Returns :

tnt_path_is_dir ()

gboolean    tnt_path_is_dir                 (const gchar *path);

path :
Returns :

tnt_path_is_file ()

gboolean    tnt_path_is_file                (const gchar *file);

file :
Returns :

tnt_dir_have_full_access ()

gboolean    tnt_dir_have_full_access        (const gchar *dir);

dir :
Returns :

tnt_dir_have_full_access_stat ()

gboolean    tnt_dir_have_full_access_stat   (struct stat *sbuf);

sbuf :
Returns :

tnt_dir_have_read_access ()

gboolean    tnt_dir_have_read_access        (const gchar *dir);

dir :
Returns :

tnt_dir_have_read_access_stat ()

gboolean    tnt_dir_have_read_access_stat   (struct stat *sbuf);

sbuf :
Returns :

tnt_file_have_full_access ()

gboolean    tnt_file_have_full_access       (const gchar *file);

file :
Returns :

tnt_file_have_full_access_stat ()

gboolean    tnt_file_have_full_access_stat  (struct stat *sbuf);

sbuf :
Returns :

tnt_file_have_read_access ()

gboolean    tnt_file_have_read_access       (const gchar *file);

file :
Returns :

tnt_file_have_read_access_stat ()

gboolean    tnt_file_have_read_access_stat  (struct stat *sbuf);

sbuf :
Returns :

tnt_dir_delete ()

gboolean    tnt_dir_delete                  (const gchar *dir);

dir :
Returns :

tnt_amount_print_dot_padded ()

gchar*      tnt_amount_print_dot_padded     (guint64 amount);

amount :
Returns :

tnt_time_describe ()

gchar*      tnt_time_describe               (guint seconds_abs);

seconds_abs :
Returns :

tnt_time_describe_delta ()

gchar*      tnt_time_describe_delta         (gint seconds_ago);

seconds_ago :
Returns :

tnt_size_describe ()

gchar*      tnt_size_describe               (guint64 size);

size :
Returns :

tnt_bandwidth_describe ()

gchar*      tnt_bandwidth_describe          (guint cps);

cps :
Returns :

tnt_strlen_limited ()

gint        tnt_strlen_limited              (const gchar *string,
                                             gint limit);

string :
limit :
Returns :

tnt_string_to_lower ()

void        tnt_string_to_lower             (gchar *string);

string :

tnt_string_capitalize_first ()

void        tnt_string_capitalize_first     (gchar *string);

string :

tnt_string_extract_substrings ()

GList*      tnt_string_extract_substrings   (const gchar *string,
                                             gint min_token_len,
                                             gint max_token_len,
                                             gboolean get_min_string_end);

string :
min_token_len :
max_token_len :
get_min_string_end :
Returns :

tnt_path_make_keyword_string ()

gchar*      tnt_path_make_keyword_string    (const gchar *path);

path :
Returns :

tnt_path_split ()

GSList*     tnt_path_split                  (const gchar *path);

path :
Returns :

tnt_path_join ()

gchar*      tnt_path_join                   (GSList *pelem);

pelem :
Returns :

tnt_string_is_valid_ipv4_address ()

gboolean    tnt_string_is_valid_ipv4_address
                                            (const gchar *address);

address :
Returns :

tnt_string_is_valid_address ()

gboolean    tnt_string_is_valid_address     (const gchar *address);

address :
Returns :

tnt_string_to_ip ()

TntNodeIP4  tnt_string_to_ip                (const gchar *string);

string :
Returns :

tnt_ip_to_string ()

gchar*      tnt_ip_to_string                (TntNodeIP4 ip);

ip :
Returns :

tnt_file_id_to_string ()

gchar*      tnt_file_id_to_string           (const TntFileID *file_id);

file_id :
Returns :

tnt_string_to_file_id ()

gboolean    tnt_string_to_file_id           (const gchar *string,
                                             TntFileID *file_id);

string :
file_id :
Returns :

tnt_block_id_to_string ()

gchar*      tnt_block_id_to_string          (gint block_id);

block_id :
Returns :

tnt_file_block_id_to_string ()

gchar*      tnt_file_block_id_to_string     (const TntFileID *file_id,
                                             gint block_id);

file_id :
block_id :
Returns :

tnt_is_valid_file_id_string ()

gboolean    tnt_is_valid_file_id_string     (const gchar *string);

string :
Returns :

tnt_is_valid_block_id_string ()

gboolean    tnt_is_valid_block_id_string    (const gchar *string);

string :
Returns :

tnt_fold_hash ()

void        tnt_fold_hash                   (const guchar *hash,
                                             guchar *dest,
                                             guint len);

hash :
dest :
len :

tnt_timestamp ()

TntTimeStamp tnt_timestamp                  (void);

Returns :

tnt_slist_free_with_data ()

void        tnt_slist_free_with_data        (GSList *slist);

slist :

tnt_list_free_with_data ()

void        tnt_list_free_with_data         (GList *list);

list :

tnt_filename_to_utf8_lossy ()

gchar*      tnt_filename_to_utf8_lossy      (const gchar *filename);

filename :
Returns :

tnt_filename_to_utf8_replace ()

gchar*      tnt_filename_to_utf8_replace    (gchar *filename);

filename :
Returns :