summaryrefslogtreecommitdiff
path: root/common/include/email-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/include/email-utils.h')
-rwxr-xr-xcommon/include/email-utils.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/common/include/email-utils.h b/common/include/email-utils.h
new file mode 100755
index 0000000..cf2324e
--- /dev/null
+++ b/common/include/email-utils.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _EMAIL_UTILS_H_
+#define _EMAIL_UTILS_H_
+
+#include "email-common-types.h"
+#include "email-debug.h"
+
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <unicode/uloc.h>
+#include <unicode/ucal.h>
+#include <unicode/udat.h>
+#include <unicode/udatpg.h>
+#include <unicode/ustring.h>
+
+G_BEGIN_DECLS
+
+/*
+ * String utility.
+ */
+#undef STR_VALID
+#define STR_VALID(str) \
+ ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
+#undef STR_INVALID
+#define STR_INVALID(str) \
+ ((str == NULL || strlen(str) == 0) ? TRUE : FALSE)
+#undef STR_LEN
+#define STR_LEN(str) \
+ ({ const char *s = (const char *)str; (s) ? strlen(s) : 0; })
+
+/*
+ * Exported fuctions.
+ */
+char *email_get_current_theme_name(void);
+
+gboolean email_check_dir_exist(const gchar *path);
+gboolean email_check_file_exist(const gchar *path);
+
+gchar *email_parse_get_filename_from_path(const gchar *path); /* g_free(). */
+void email_parse_get_filename_n_ext_from_path(const gchar *path, gchar **ret_file_name, gchar **ret_ext);
+
+void email_save_file(const gchar *path, const gchar *buf, gsize len);
+gchar *email_get_buff_from_file(const gchar *path, guint max_kbyte); /* g_free(). */
+gchar *email_get_file_size_string(guint64 size); /* g_free(). */
+guint64 email_get_file_size(const gchar *path);
+
+char *email_get_date_text(const char *locale, char *skeleton, void *time);
+
+int email_open_icu_pattern_generator(void);
+int email_close_icu_pattern_generator(void);
+
+gboolean email_drm_file_is_right(const gchar *path);
+gboolean email_drm_file_forward_lock_check(const gchar *path);
+
+G_END_DECLS
+#endif /* _EMAIL_UTILS_H_ */
+
+/* EOF */