view libpurple/protocols/zephyr/ZPending.c @ 16467:b2044e10915a

merge of 'ca40214f7a10f0e15d7bd32bed84b177889ca02d' and 'dfafb91b749752416047f800169f9c839c909733'
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 27 Apr 2007 00:28:21 +0000
parents 5fe8042783c1
children a8cc50c2279f
line wrap: on
line source

/* This file is part of the Project Athena Zephyr Notification System.
 * It contains source for the ZPending function.
 *
 *	Created by:	Robert French
 *
 *	Copyright (c) 1987 by the Massachusetts Institute of Technology.
 *	For copying and distribution information, see the file
 *	"mit-copyright.h". 
 */

#include "internal.h"

int ZPending()
{
	int retval;
	
	if (ZGetFD() < 0) {
		errno = ZERR_NOPORT;
		return (-1);
	}
	
	if ((retval = Z_ReadEnqueue()) != ZERR_NONE) {
		errno = retval;
		return (-1);
	} 
	
	return(ZQLength());
}