2009-01-09 [colin] 3.7.0cvs19
[claws.git] / src / common / utils.h
index 7689acc0c7ad9e4be69f01750e99eb92c2945742..b7df76ba9d78fe6bd91e8c93564ca08b8131444a 100644 (file)
@@ -71,19 +71,11 @@ gint g_chmod        (const gchar    *path,
 
 #endif /* !GLIB_CHECK_VERSION */
 
-/* The AC_CHECK_SIZEOF() in configure fails for some machines.
- * we provide some fallback values here */
-#if !SIZEOF_UNSIGNED_SHORT
-  #undef SIZEOF_UNSIGNED_SHORT
-  #define SIZEOF_UNSIGNED_SHORT 2
-#endif
-#if !SIZEOF_UNSIGNED_INT
-  #undef SIZEOF_UNSIGNED_INT
-  #define SIZEOF_UNSIGNED_INT 4
-#endif
-#if !SIZEOF_UNSIGNED_LONG
-  #undef SIZEOF_UNSIGNED_LONG
-  #define SIZEOF_UNSIGNED_LONG 4
+/* why is this sometimes undefined !? */
+#ifndef G_MAXOFFSET
+typedef gint64 goffset;
+#define G_MINOFFSET    G_MININT64
+#define G_MAXOFFSET    G_MAXINT64
 #endif
 
 #ifndef HAVE_U32_TYPEDEF
@@ -243,7 +235,7 @@ gint to_number                      (const gchar *nstr);
 gchar *itos_buf                        (gchar       *nstr,
                                 gint         n);
 gchar *itos                    (gint         n);
-gchar *to_human_readable       (off_t        size);
+gchar *to_human_readable       (goffset      size);
 
 /* alternative string functions */
 gint strcmp2           (const gchar    *s1,
@@ -312,6 +304,9 @@ void unfold_line                    (gchar          *str);
 void subst_char                                (gchar          *str,
                                         gchar           orig,
                                         gchar           subst);
+void subst_chars                       (gchar          *str,   
+                                        gchar          *orig, 
+                                        gchar          subst);
 void subst_for_filename                        (gchar          *str);
 void subst_for_shellsafe_filename      (gchar          *str);
 gboolean is_ascii_str                  (const gchar    *str);
@@ -340,12 +335,13 @@ void decode_uri_with_plus         (gchar          *decoded_uri,
                                         const gchar    *encoded_uri, 
                                         gboolean        with_plus);
 gint scan_mailto_url                   (const gchar    *mailto,
+                                        gchar         **from,
                                         gchar         **to,
                                         gchar         **cc,
                                         gchar         **bcc,
                                         gchar         **subject,
                                         gchar         **body,
-                                        gchar         **attach);
+                                        gchar         ***attach);
 
 /* return static strings */
 const gchar *get_home_dir              (void);
@@ -362,7 +358,10 @@ const gchar *get_tmp_dir           (void);
 const gchar *get_locale_dir            (void);
 gchar *get_tmp_file                    (void);
 const gchar *get_domain_name           (void);
-
+#ifdef G_OS_WIN32
+const gchar *get_themes_dir             (void);
+const gchar *get_cert_file             (void);
+#endif
 /* file / directory handling */
 off_t get_file_size            (const gchar    *file);
 off_t get_file_size_as_crlf    (const gchar    *file);
@@ -431,6 +430,8 @@ gint str_write_to_file              (const gchar    *str,
                                 const gchar    *file);
 gchar *file_read_to_str                (const gchar    *file);
 gchar *file_read_stream_to_str (FILE           *fp);
+gchar *file_read_to_str_no_recode(const gchar *file);
+gchar *file_read_stream_to_str_no_recode(FILE *fp);
 
 char *fgets_crlf(char *buf, int size, FILE *stream);
 
@@ -465,6 +466,7 @@ void * subject_table_lookup(GHashTable *subject_table, gchar * subject);
 void subject_table_insert(GHashTable *subject_table, gchar * subject,
                          void * data);
 void subject_table_remove(GHashTable *subject_table, gchar * subject);
+void utils_free_regex(void);
 gint subject_get_prefix_length (const gchar *subject);
 
 /* quoting recognition */
@@ -520,6 +522,8 @@ void mailcap_update_default    (const gchar *type,
 gboolean file_is_email(const gchar *filename);
 gboolean sc_g_list_bigger(GList *list, gint max);
 gboolean sc_g_slist_bigger(GSList *list, gint max);
+
+int claws_unlink(const gchar *filename);
 #ifdef __cplusplus
 }
 #endif