added chunk_from_thing() macro

This commit is contained in:
Martin Willi
2007-03-29 11:06:59 +00:00
parent 6819e4d754
commit 25eaae17db
+5
View File
@@ -88,6 +88,11 @@ void chunk_free(chunk_t *chunk);
*/
#define chunk_from_buf(str) { str, sizeof(str) }
/**
* Initialize a chunk to point to a thing
*/
#define chunk_from_thing(thing) chunk_create((char*)&(thing), sizeof(thing))
/**
* Allocate a chunk on the heap
*/