File:  [ELWIX - Embedded LightWeight unIX -] / mqtt / src / Attic / aitmqtt.c
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Nov 7 08:47:16 2011 UTC (12 years, 8 months ago) by misho
Branches: MAIN
CVS tags: HEAD
Initial revision

#include "global.h"


static int mqtt_Errno;
static char mqtt_Error[STRSIZ];


//
// Error maintenance functions ...
//

// mqtt_GetErrno() Get error code of last operation
inline int
mqtt_GetErrno()
{
	return mqtt_Errno;
}

// mqtt_GetError() Get error text of last operation
inline const char *
mqtt_GetError()
{
	return mqtt_Error;
}

// mqtt_SetErr() Set error to variables for internal use!!!
inline void
mqtt_SetErr(int eno, char *estr, ...)
{
	va_list lst;

	mqtt_Errno = eno;
	memset(mqtt_Error, 0, sizeof mqtt_Error);
	va_start(lst, estr);
	vsnprintf(mqtt_Error, sizeof mqtt_Error, estr, lst);
	va_end(lst);
}

// ----------------------------------------------------------


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>