| 18 */ |
18 */ |
| 19 |
19 |
| 20 #include "myspace.h" |
20 #include "myspace.h" |
| 21 |
21 |
| 22 typedef int (*MSIM_XMLNODE_CONVERT)(MsimSession *, xmlnode *, gchar **, gchar **); |
22 typedef int (*MSIM_XMLNODE_CONVERT)(MsimSession *, xmlnode *, gchar **, gchar **); |
| 23 |
|
| 24 /* Internal functions */ |
|
| 25 |
|
| 26 static guint msim_point_to_purple_size(MsimSession *session, guint point); |
|
| 27 static guint msim_purple_size_to_point(MsimSession *session, guint size); |
|
| 28 static guint msim_height_to_point(MsimSession *session, guint height); |
|
| 29 static guint msim_point_to_height(MsimSession *session, guint point); |
|
| 30 |
|
| 31 static int msim_markup_tag_to_html(MsimSession *, xmlnode *root, gchar **begin, gchar **end); |
|
| 32 static int html_tag_to_msim_markup(MsimSession *, xmlnode *root, gchar **begin, gchar **end); |
|
| 33 static gchar *msim_convert_xml(MsimSession *, const gchar *raw, MSIM_XMLNODE_CONVERT f); |
|
| 34 static gchar *msim_convert_smileys_to_markup(gchar *before); |
|
| 35 static double msim_round(double round); |
|
| 36 |
|
| 37 |
23 |
| 38 /* Globals */ |
24 /* Globals */ |
| 39 |
25 |
| 40 /* The names in in emoticon_names (for <i n=whatever>) map to corresponding |
26 /* The names in in emoticon_names (for <i n=whatever>) map to corresponding |
| 41 * entries in emoticon_symbols (for the ASCII representation of the emoticon). |
27 * entries in emoticon_symbols (for the ASCII representation of the emoticon). |
| 116 |
102 |
| 117 |
103 |
| 118 /* round is part of C99, but sometimes is unavailable before then. |
104 /* round is part of C99, but sometimes is unavailable before then. |
| 119 * Based on http://forums.belution.com/en/cpp/000/050/13.shtml |
105 * Based on http://forums.belution.com/en/cpp/000/050/13.shtml |
| 120 */ |
106 */ |
| 121 double msim_round(double value) |
107 static double msim_round(double value) |
| 122 { |
108 { |
| 123 if (value < 0) { |
109 if (value < 0) { |
| 124 return -(floor(-value + 0.5)); |
110 return -(floor(-value + 0.5)); |
| 125 } else { |
111 } else { |
| 126 return floor( value + 0.5); |
112 return floor( value + 0.5); |