12 #include <libetpan/libetpan.h> 18 int dc_exactly_one_bit_set (
int v);
21 #define DC_EDITORIAL_OPEN "[" 22 #define DC_EDITORIAL_CLOSE "]" 23 #define DC_EDITORIAL_ELLIPSE DC_EDITORIAL_OPEN "..." DC_EDITORIAL_CLOSE 24 #define DC_NDASH "\xE2\x80\x93" 26 char* dc_strdup (
const char*);
27 char* dc_strdup_keep_null (
const char*);
28 int dc_atoi_null_is_0 (
const char*);
29 void dc_ltrim (
char*);
30 void dc_rtrim (
char*);
32 char* dc_strlower (
const char*);
33 void dc_strlower_in_place (
char*);
34 int dc_str_replace (
char** haystack,
const char* needle,
const char* replacement);
35 int dc_str_contains (
const char* haystack,
const char* needle);
36 char* dc_null_terminate (
const char*,
int bytes);
37 char* dc_mprintf (
const char* format, ...);
38 char* dc_binary_to_uc_hex (
const uint8_t* buf,
size_t bytes);
39 void dc_remove_cr_chars (
char*);
40 void dc_unify_lineends (
char*);
41 void dc_replace_bad_utf8_chars (
char*);
42 void dc_truncate_str (
char*,
int approx_characters);
43 void dc_truncate_n_unwrap_str (
char*,
int approx_characters,
int do_unwrap);
44 carray* dc_split_into_lines (
const char* buf_terminated);
45 void dc_free_splitted_lines (carray* lines);
46 char* dc_insert_breaks (
const char*,
int break_every,
const char* break_chars);
47 char* dc_str_from_clist (
const clist*,
const char* delimiter);
48 clist* dc_str_to_clist (
const char*,
const char* delimiter);
49 int dc_str_to_color (
const char*);
52 char* encode_base64 (
const char * in,
int len);
55 void clist_free_content (
const clist*);
56 int clist_search_string_nocase (
const clist*,
const char* str);
59 #define DC_INVALID_TIMESTAMP (-1) 60 #define DC_SECONDS_PER_DAY 86400 61 time_t dc_timestamp_from_date (
struct mailimf_date_time * date_time);
62 char* dc_timestamp_to_str (time_t);
63 struct mailimap_date_time* dc_timestamp_to_mailimap_date_time (time_t);
64 long dc_gm2local_offset (
void);
69 time_t dc_create_smeared_timestamps (
dc_context_t*,
int count);
72 #define DC_CREATE_ID_LEN 11 73 char* dc_create_id (
void);
74 char* dc_create_incoming_rfc724_mid (time_t message_timestamp, uint32_t contact_id_from,
dc_array_t* contact_ids_to);
75 char* dc_create_outgoing_rfc724_mid (
const char* grpid,
const char* addr);
76 char* dc_extract_grpid_from_rfc724_mid (
const char* rfc724_mid);
77 char* dc_extract_grpid_from_rfc724_mid_list(
const clist* rfc724_mid_list);
81 void dc_ensure_no_slash (
char* pathNfilename);
82 void dc_validate_filename (
char* filename);
83 char* dc_get_filename (
const char* pathNfilename);
84 void dc_split_filename (
const char* pathNfilename,
char** ret_basename,
char** ret_all_suffixes_incl_dot);
85 char* dc_get_filesuffix_lc (
const char* pathNfilename);
86 int dc_get_filemeta (
const void* buf,
size_t buf_bytes, uint32_t* ret_width, uint32_t *ret_height);
87 char* dc_get_abs_path (
dc_context_t*,
const char* pathNfilename);
88 int dc_file_exist (
dc_context_t*,
const char* pathNfilename);
89 uint64_t dc_get_filebytes (
dc_context_t*,
const char* pathNfilename);
90 int dc_delete_file (
dc_context_t*,
const char* pathNFilename);
91 int dc_copy_file (
dc_context_t*,
const char* pathNFilename,
const char* dest_pathNFilename);
92 int dc_create_folder (
dc_context_t*,
const char* pathNfilename);
93 int dc_write_file (
dc_context_t*,
const char* pathNfilename,
const void* buf,
size_t buf_bytes);
94 int dc_read_file (
dc_context_t*,
const char* pathNfilename,
void** buf,
size_t* buf_bytes);
95 char* dc_get_fine_pathNfilename (
dc_context_t*,
const char* pathNfolder,
const char* desired_name);
96 int dc_is_blobdir_path (
dc_context_t*,
const char* path);
97 void dc_make_rel_path (
dc_context_t*,
char** pathNfilename);
98 int dc_make_rel_and_copy (
dc_context_t*,
char** pathNfilename);
101 #define DC_QUOTEHELPER(name) #name 102 #define DC_STRINGIFY(macro) DC_QUOTEHELPER(macro) 103 #define DC_MIN(X, Y) (((X) < (Y))? (X) : (Y)) 104 #define DC_MAX(X, Y) (((X) > (Y))? (X) : (Y)) An object representing a single account.
An object containing a simple array.