perror(func); \
}
+#define debug_print(format, ...) debug_print_real(__FILE__, __LINE__, format , ##__VA_ARGS__)
+
/* for macro expansion */
#define Str(x) #x
#define Xstr(x) Str(x)
void slist_free_strings (GSList *list);
void hash_free_strings (GHashTable *table);
+void hash_free_value_mem (GHashTable *table);
void ptr_array_free_strings (GPtrArray *array);
/* alternative string functions */
gint strcmp2 (const gchar *s1,
const gchar *s2);
+gint strstr2 (const gchar *s1,
+ const gchar *s2);
gint path_cmp (const gchar *s1,
const gchar *s2);
gchar *strretchomp (gchar *str);
gint change_dir (const gchar *dir);
gint make_dir_hier (const gchar *dir);
gint remove_all_files (const gchar *dir);
+gint remove_numbered_files (const gchar *dir,
+ guint first,
+ guint last);
gint remove_all_numbered_files (const gchar *dir);
gint remove_dir_recursive (const gchar *dir);
gint copy_file (const gchar *src,
/* process execution */
gint execute_async (gchar *const argv[]);
-gint execute_command_line (const gchar *cmdline);
+gint execute_sync (gchar *const argv[]);
+gint execute_command_line (const gchar *cmdline,
+ gboolean async);
/* open URI with external browser */
gint open_uri(const gchar *uri, const gchar *cmdline);
gint len);
/* logging */
-void debug_print(const gchar *format, ...) G_GNUC_PRINTF(1, 2);
-void log_print (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
-void log_message(const gchar *format, ...) G_GNUC_PRINTF(1, 2);
-void log_warning(const gchar *format, ...) G_GNUC_PRINTF(1, 2);
-void log_error (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
+void set_log_file (const gchar *filename);
+void close_log_file (void);
+void log_verbosity_set (gboolean verbose);
+void debug_print_real (const gchar *file, const guint line, const gchar *format, ...) G_GNUC_PRINTF(3, 4);
+void log_print (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
+void log_message (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
+void log_warning (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
+void log_error (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
#endif /* __UTILS_H__ */