|
Lines 172-221
get_attendee_if_attendee_sentby_is_user
|
Link Here
|
|---|
|
} | } |
| |
static char * | static char * |
html_new_lines_for (char *string) |
html_new_lines_for (const char *string) |
{ | { |
char *html_string = (char *) malloc (sizeof (char)* (3500)); |
gchar **lines; |
int length = strlen (string); |
gchar *joined; |
int index = 0; |
|
char *index_ptr = string; |
|
char *temp = string; |
|
| |
/*Find the first occurence*/ |
lines = g_strsplit_set (string, "\n", -1); |
index_ptr = strstr ((const char *)temp, "\n"); |
joined = g_strjoinv ("<br>", lines); |
|
g_strfreev (lines); |
| |
/*Doesn't occur*/ |
return joined; |
if (index_ptr == NULL) { |
|
strcpy (html_string, (const char *)string); |
|
html_string[length] = '\0'; |
|
return html_string; |
|
} |
|
|
|
/*Split into chunks inserting <br> for \n */ |
|
do{ |
|
while (temp != index_ptr){ |
|
html_string[index++] = *temp; |
|
temp++; |
|
} |
|
temp++; |
|
|
|
html_string[index++] = '<'; |
|
html_string[index++] = 'b'; |
|
html_string[index++] = 'r'; |
|
html_string[index++] = '>'; |
|
|
|
index_ptr = strstr ((const char *)temp, "\n"); |
|
|
|
} while (index_ptr); |
|
|
|
/*Don't leave out the last chunk*/ |
|
while (*temp != '\0'){ |
|
html_string[index++] = *temp; |
|
temp++; |
|
} |
|
|
|
html_string[index] = '\0'; |
|
|
|
return html_string; |
|
} | } |
| |
char * | char * |