view src/protocols/zephyr/ZPeekPkt.c @ 13033:69b3d5cbd2b1

[gaim-migrate @ 15389] Kill gaim_date() and gaim_date_full(). The former isn't used and the latter is used only twice. This makes the buddy pounce pop-ups and debug log headers contain localized dates, fixing part of SF Bug #1325915. Thanks to Bleeter for discovering that gaim_date() isn't used. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Wed, 25 Jan 2006 02:58:54 +0000
parents 64895571248f
children
line wrap: on
line source

/* This file is part of the Project Athena Zephyr Notification System.
 * It contains source for ZPeekPacket 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"

Code_t ZPeekPacket(buffer, ret_len, from)
    char **buffer;
    int *ret_len;
    struct sockaddr_in *from;
{
    Code_t retval;
    struct _Z_InputQ *nextq;
    
    if ((retval = Z_WaitForComplete()) != ZERR_NONE)
	return (retval);

    nextq =Z_GetFirstComplete();

    *ret_len = nextq->packet_len;
    
    if (!(*buffer = (char *) malloc((unsigned) *ret_len)))
	return (ENOMEM);

    (void) memcpy(*buffer, nextq->packet, *ret_len);

    if (from)
	*from = nextq->from;
	
    return (ZERR_NONE);
}