diff options
Diffstat (limited to 'src/membuf.c')
-rw-r--r-- | src/membuf.c | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/src/membuf.c b/src/membuf.c index 24cca3da..41568c60 100644 --- a/src/membuf.c +++ b/src/membuf.c @@ -1,13 +1,19 @@ -/** +/* * XML Security Library (http://www.aleksey.com/xmlsec). * - * Memory buffer transform * * This is free software; see Copyright file in the source * distribution for preciese wording. * * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ +/** + * SECTION:membuf + * @Short_description: Memory buffer transform functions. + * @Stability: Stable + * + */ + #include "globals.h" #include <stdlib.h> @@ -24,7 +30,6 @@ #include <xmlsec/membuf.h> #include <xmlsec/errors.h> - /***************************************************************************** * * Memory Buffer Transform @@ -74,7 +79,7 @@ static xmlSecTransformKlass xmlSecTransformMemBufKlass = { /** * xmlSecTransformMemBufGetKlass: * - * The memory buffer transorm (used to store the data that go through it). + * The memory buffer transform (used to store the data that go through it). * * Returns: memory buffer transform klass. */ @@ -115,11 +120,8 @@ xmlSecTransformMemBufInitialize(xmlSecTransformPtr transform) { ret = xmlSecBufferInitialize(buffer, 0); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferInitialize", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + xmlSecInternalError("xmlSecBufferInitialize", + xmlSecTransformGetName(transform)); return(-1); } return(0); @@ -162,31 +164,25 @@ xmlSecTransformMemBufExecute(xmlSecTransformPtr transform, int last, xmlSecTrans /* just copy everything from in to our buffer and out */ ret = xmlSecBufferAppend(buffer, xmlSecBufferGetData(in), inSize); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferAppend", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "size=%d", inSize); + xmlSecInternalError2("xmlSecBufferAppend", + xmlSecTransformGetName(transform), + "size=%d", inSize); return(-1); } ret = xmlSecBufferAppend(out, xmlSecBufferGetData(in), inSize); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferAppend", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "size=%d", inSize); + xmlSecInternalError2("xmlSecBufferAppend", + xmlSecTransformGetName(transform), + "size=%d", inSize); return(-1); } ret = xmlSecBufferRemoveHead(in, inSize); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferRemoveHead", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "size=%d", inSize); + xmlSecInternalError2("xmlSecBufferRemoveHead", + xmlSecTransformGetName(transform), + "size=%d", inSize); return(-1); } @@ -197,11 +193,7 @@ xmlSecTransformMemBufExecute(xmlSecTransformPtr transform, int last, xmlSecTrans /* the only way we can get here is if there is no input */ xmlSecAssert2(inSize == 0, -1); } else { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - NULL, - XMLSEC_ERRORS_R_INVALID_STATUS, - "status=%d", transform->status); + xmlSecInvalidTransfromStatusError(transform); return(-1); } return(0); |