[PATCH 1/3] stkutil: display text attributes as html
Andrzej Zaborowski
andrew.zaborowski at intel.com
Thu Jul 1 15:10:54 PDT 2010
Hi
On 1 July 2010 18:30, Denis Kenzior <denkenz at gmail.com> wrote:
>> +char *stk_text_to_html(char *text, int text_len,
>> + const unsigned char *attrs, int attrs_len)
>> +{
>> + GString *string = g_string_sized_new(text_len + 1);
>> + int formats[257]; /* maximum number of chars in text + 1 */
>> + int pos = 0, i, j, attr, prev_attr;
>> + guint8 start, end, code, color, len, align;
>> +
>> + /* we will need formatting at the position beyond the last char */
>> + for (i = 0; i <= text_len; i++)
>> + formats[i] = STK_TEXT_FORMAT_INIT;
>> +
>
> Please note that the same formatting can be used for EMS messages
> (23.040). These messages have a fairly large max-len (255 segments *
> ~153 characters) I'd like to have this function useable for EMS
> messages as well.
It would have a different signature because as far as I understand a
separate array of attributes is sent in each segment (the start/len
fields can't address more than 256 characters anyway). So that
function can be a wrapper around this function.
Regards,
Andrew
More information about the ofono
mailing list