/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for 
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #                                      
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    WimpSWIs.DLLPoll.c
    Author:  Copyright  1995 Julian Smith
    Version: 1.00 (15 Apr 1995)
    Purpose: Simple veneer function for Desk_Wimp_Poll which preserves the
             application  starttime as required by Straylight's DLL
             system.

             These functions are only needed for the SDLS version of
             DeskLib.
*/



#include "Desk.WimpSWIs.h"
#include "DLLPDefs.h"


#if defined( Desk__using_SDLS)




Desk_os_error	*Desk_Wimp_Poll3_DLL(
			Desk_event_pollmask	mask, 
			Desk_event_pollblock	*event,
			void		*pollword
			)
{
event->type = _dll_wimpPoll( mask, &event->data, 0, pollword);

if (event->type > 256)
	return (Desk_os_error *) (int) event->type;
	/* cc 5 doesn't like casts from an enum directly to a pointer	*/
else	return NULL;
}


Desk_os_error	*Desk_Wimp_PollIdle3_DLL(
			Desk_event_pollmask	mask, 
			Desk_event_pollblock	*event,
			int		earliest, 
			void		*pollword
			)
{
event->type = _dll_wimpPollIdle( mask, &event->data, earliest, pollword);

if (event->type > 256)
	return (Desk_os_error *) (int) event->type;
	/* cc 5 doesn't like casts from an enum directly to a pointer	*/
else	return NULL;
}


/*
Perhaps we could just have, in DeskLib:WimpSWIs.h

extern Desk_event_type _dll_wimpPoll( 
	Desk_event_pollmask mask, Desk_event_data *data, int idletime, void *pollword
	);

#define Desk_Wimp_Poll3_DLL( mask, event, pollword)          	\
  (								\
  event->type = _dll_wimpPoll( mask, &event->data, 0, pollword)	\
  , 								\
  ((event)->type<256) ? NULL : (void *) (event)->type		\
  )

This gives warning about no context in void vontext or something...

*/



#else
int	Desk_Wimp_Poll__dummy;
/*
To stop cc complaining about 'no extern declaration in translation unit
*/


#endif

