lib/k2hqueue.cc
bool K2HQueue::Pop(unsigned char** ppdata, size_t& datalen, K2HAttrs** ppAttrs, const char* encpass)
{
	if(!ppdata){
		ERR_K2HPRN("Parameter is wrong.");
		return false;
	}
	if(!IsSafe()){
		ERR_K2HPRN("This object is not safe.");
		return false;
	}

	unsigned char*	pKey	= NULL;
	size_t			keylen	= 0;
	*ppdata					= NULL;
	datalen					= 0;
	if(!pK2HShm->PopQueue(marker, marker_len, &pKey, keylen, ppdata, datalen, ppAttrs, encpass)){
		ERR_K2HPRN("Something error occurred during popping.");
		K2H_Free(pKey);
		K2H_Free(*ppdata);
		return false;
	}
	K2H_Free(pKey);

	return true;
}
//
// [NOTICE]
// If there is no popping data in k2hshm, this method returns true with *ppdata=NULL.
// Return false means something error is occurred.
//
[NOTICE]
If there is no popping data in k2hshm, this method returns true with *ppdata=NULL.
Return false means something error is occurred.
[ NOTICE ] If there is no popping data in k2hshm this method returns true with * ppdata = NULL . Return false means something error is occurred .
bool K2HQueue::Pop(unsigned char** ppdata, size_t& datalen, K2HAttrs** ppAttrs, const char* encpass)
{
	if(!ppdata){
		ERR_K2HPRN("Parameter is wrong.");
		return false;
	}
	if(!IsSafe()){
		ERR_K2HPRN("This object is not safe.");
		return false;
	}
	unsigned char*	pKey	= NULL;
	size_t			keylen	= 0;
	*ppdata					= NULL;
	datalen					= 0;
	if(!pK2HShm->PopQueue(marker, marker_len, &pKey, keylen, ppdata, datalen, ppAttrs, encpass)){
		ERR_K2HPRN("Something error occurred during popping.");
		K2H_Free(pKey);
		K2H_Free(*ppdata);
		return false;
	}
	K2H_Free(pKey);
	return true;
}
bool K2HQueue :: Pop ( unsigned char * * ppdata , size_t & datalen , K2HAttrs * * ppAttrs , const char * encpass ) { if ( ! ppdata ) { ERR_K2HPRN ( " " ) ; return false ; } if ( ! IsSafe ( ) ) { ERR_K2HPRN ( " " ) ; return false ; } unsigned char * pKey = NULL ; size_t keylen = 0 ; * ppdata = NULL ; datalen = 0 ; if ( ! pK2HShm -> PopQueue ( marker , marker_len , & pKey , keylen , ppdata , datalen , ppAttrs , encpass ) ) { ERR_K2HPRN ( " " ) ; K2H_Free ( pKey ) ; K2H_Free ( * ppdata ) ; return false ; } K2H_Free ( pKey ) ; return true ; }
[NOTICE]
If there is no popping data in k2hshm, this method returns true with *ppdata=NULL.
[ NOTICE ] If there is no popping data in k2hshm this method returns true with * ppdata = NULL .