MXS-2495 Cleanup GWBUF interface
All GWBUF macros that address a single link in a chain are now simple wrappers for equivalent gwbuf_link-functions. Next step is to drop the macros and replace their use with calls to the functions.
This commit is contained in:
@ -39,6 +39,12 @@
|
||||
#include <maxscale/buffer.hh>
|
||||
#include <maxscale/hint.h>
|
||||
|
||||
/*< Return the byte at offset byte from the start of the unconsumed portion of the buffer */
|
||||
#define GWBUF_DATA_CHAR(b, byte) (GWBUF_LENGTH(b) < ((byte) + 1) ? -1 : *(((char*)(b)->start) + 4))
|
||||
|
||||
/*< Check that the data in a buffer has the SQL marker*/
|
||||
#define GWBUF_IS_SQL(b) (0x03 == GWBUF_DATA_CHAR(b, 4))
|
||||
|
||||
/**
|
||||
* Generate predefined test data
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user