[gmime-devel] Important GMime 3.0 changes wrt headers



Hey all,

I've just landed a patch that changes behavior of GMimeHeader[List] in a fairly significant way.

Until now, prepending/appending/setting headers required you to call g_mime_utils_header_encode_text() (or encode_phrase) yourself and getting a header value would return the unfolded header value (but it would not be decoded).

This has all changed.

Getting/setting header values no longer requires manual encoding or decoding of said values.

If you want access to the raw value, you now need to get access to the GMimeHeader and call g_mime_header_get_raw_value().

Be aware, however, that this function returns the original *raw* header value exactly how the parser found it - newlines and all.

Also: g_mime_header_list_register_writer() has been removed. From a quick grep through both Balsa and NotMuch, it didn't seem like anyone was actually using this anyway.

Instead, each GMimeHeader now has a GMimeHeaderRawValueFormatter (may shorten this by removing the RawValue from the name) that is used for formatting the 'raw_value' given an unencoded 'value' and the common formatters have all been made public. There's no accessor API's for this callback yet, but I will add them if developers need access to this functionality.

I'm also considering making a public g_mime_header_set_raw_value(). In fact, I'll probably go and add that right now...

Jeff



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]