Creates a new #SoupBuffer containing @length bytes from @data. When
the #SoupBuffer is freed, it will call @owner_dnotify, passing
@owner to it. You must ensure that @data will remain valid until
@owner_dnotify is called.
For example, you could use this to create a buffer containing data
returned from libxml without needing to do an extra copy:
In this example, @data and @owner are the same, but in other cases
they would be different (eg, @owner would be a object, and @data
would be a pointer to one of the object's fields).
Creates a new #SoupBuffer containing @length bytes from @data. When the #SoupBuffer is freed, it will call @owner_dnotify, passing @owner to it. You must ensure that @data will remain valid until @owner_dnotify is called.
For example, you could use this to create a buffer containing data returned from libxml without needing to do an extra copy:
<informalexample><programlisting> xmlDocDumpMemory (doc, &xmlbody, &len); return soup_buffer_new_with_owner (xmlbody, len, xmlbody, (GDestroyNotify)xmlFree); </programlisting></informalexample>
In this example, @data and @owner are the same, but in other cases they would be different (eg, @owner would be a object, and @data would be a pointer to one of the object's fields).