return (ISC_R_SUCCESS);
}
-isc_result_t
+void
isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
unsigned int length)
{
- isc_buffer_t *dbuf;
- unsigned char * bdata;
- REQUIRE(dynbuffer != NULL);
- REQUIRE(*dynbuffer == NULL);
+ REQUIRE(dynbuffer != NULL && *dynbuffer == NULL);
- dbuf = isc_mem_get(mctx, sizeof(isc_buffer_t));
-
- bdata = isc_mem_get(mctx, length);
+ isc_buffer_t *dbuf = isc_mem_get(mctx, sizeof(isc_buffer_t));
+ unsigned char *bdata = isc_mem_get(mctx, length);
isc_buffer_init(dbuf, bdata, length);
dbuf->mctx = mctx;
*dynbuffer = dbuf;
-
- return (ISC_R_SUCCESS);
}
isc_result_t
*** Functions
***/
-isc_result_t
+void
isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
unsigned int length);
/*!<
*
*\li "dynbuffer" is non-NULL, and "*dynbuffer" is NULL.
*
- * Returns:
- *\li ISC_R_SUCCESS - success
- *\li ISC_R_NOMEMORY - no memory available
- *
* Note:
*\li Changing the buffer's length field is not permitted.
*/