# parse headers api changes # # 2004.02.23 created (andrei) Starting with the ser version 0.10.99-dev1, the parse headers api has been slighlty changed. The reason for this change was performance improvement (now gcc can optimze much better all the switches involving header types) and dramatically reducing the memory impact of switching to 64 bits flags. The header flags (HDR_xxx) have been split into header types (hdr_types_t) and header flags (hdr_flags_t). Instead of the old HDR_xxx use now HDR_xxx_T when the header type is required and HDR_xxx_F or HDR_T2F(HDR_xxx_T) when the corresponding header flag is needed (e.g. in the parse_headers() call). The hdr_field structure and the parse_headers() function have also been changed. struct hdr_field's type member is now a hdr_types_t instead of an int and the flags parameter of parse_headers is now a hdr_flags_t. The change affects also the lump types for header operations. For example instead of del_lump( msg, via_offset, via_len, HDR_VIA) use del_lump( msg, via_offset, via_len, HDR_VIA_T). WARNING: don't use a header type (HDR_xxx_T) where a header flag (HDR_xxx_F) is expected or viceversa! Examples: An old call to parse_headers(msg, HDR_FOO, 0) will become parse_header(msg, HDR_FOO_F, 0). An old loop searching for a header field: while(hdr && (hdr->type!=HDR_FOO)) hdr=hdr->next; will become: while (hdr && (hdr->type!=HDR_FOO_T)) hdr=hdr->next; .