[pkg-fso-commits] [SCM] libframeworkd-phonegui branch, upstream, updated. 640da47bfcff755388d0fb8f443eb34e0dea3c72
Klaus Kurzmann
mok at fluxnetz.de
Sat Dec 27 20:50:07 UTC 2008
The following commit has been merged in the upstream branch:
commit d697623d97fadb669ad46516754ca1d5659edda8
Author: Klaus Kurzmann <mok at fluxnetz.de>
Date: Mon Dec 15 23:49:08 2008 +0100
add helper to substitue newlines and tabs with spaces
Signed-off-by: Klaus Kurzmann <mok at fluxnetz.de>
diff --git a/libframeworkd-phonegui-efl/src/util/helper.c b/libframeworkd-phonegui-efl/src/util/helper.c
index d86744f..c237bdf 100644
--- a/libframeworkd-phonegui-efl/src/util/helper.c
+++ b/libframeworkd-phonegui-efl/src/util/helper.c
@@ -11,7 +11,7 @@ time_t time_stringtotimestamp(const char *str) {
struct tm date;
if(strptime(str, "%a %h %e %T %Y %z", &date) == NULL) {
return NULL;
- }
+ }
// Generate long from struct tm
time_t ts = mktime(&date);
@@ -32,6 +32,23 @@ void string_strip_html(char *string) {
}
+void string_replace_newline(char *string) {
+ char *in_p = string, *out_p = string;
+ for (; *in_p; in_p++, out_p++) {
+ switch (*in_p) {
+ case '\n':
+ case '\t':
+ *out_p = ' ';
+ break;
+ default:
+ *out_p = *in_p;
+ break;
+ }
+ }
+ *out_p = '\0';
+}
+
+
gboolean string_is_number(const char *string) {
if(!strlen(string)) {
return FALSE;
diff --git a/libframeworkd-phonegui-efl/src/util/helper.h b/libframeworkd-phonegui-efl/src/util/helper.h
index fccc717..20f86b2 100644
--- a/libframeworkd-phonegui-efl/src/util/helper.h
+++ b/libframeworkd-phonegui-efl/src/util/helper.h
@@ -6,6 +6,7 @@
time_t time_stringtotimestamp(const char *str);
void string_strip_html(char *string);
+void string_replace_newline(char *string);
gboolean string_is_number(const char *string);
gboolean string_is_pin(const char *string);
gboolean string_is_puk(const char *string);
--
libframeworkd-phonegui
More information about the pkg-fso-commits
mailing list