EZ_AddInput man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

EZ_AddInput(3)			EZWGL Functions			EZ_AddInput(3)

NAME
       EZ_AddInput, EZ_RemoveInput - register/remove input handlers

SYNOPSIS
       #include <EZ.h>

       EZ_Input *EZ_AddInput(int fd, int mask,
		     EZ_InputCallBack callback, void *data)

       void EZ_RemoveInput(EZ_Input *input)

ARGUMENTS
       fd  Specifies a file descriptor.

       mask Specifies the mask that indicates a read, write, or exception con‐
       dition. It must be ORed	from  EZ_READABLE_MASK,	 EZ_WRITABLE_MASK  and
       EZ_EXCEPTION_MASK.

       callback	 Specify the procedure to be invoked when input is ready.

       data   Specifies	 the  argument	that is to be passed to callback  when
       invoked.

       input  Specifies a EZ_Input handler.

DESCRIPTION
       EZ_AddInput registers an input handler to the EZWGL library.

       EZ_RemoveInput removes a previousely registered input handler.

       EZ_InputCallBack is a procedure of type
	 void (*inputCallback)(void *object, void *data, int fd, int mask);

       Here is a simple input handler that reads from the standard  input  and
       insert the input in a text widget.

       static void readStdin(EZ_Input *id, void *data, int fd, int mask)
       {
	 EZ_Widget *tw = (EZ_Widget *)data;
	 char buf[1024];
	 int n;
	 if(mask & EZ_READABLE_MASK)
	   {
	     n = read(fd, buf, 1023);
	     if(n > 0)
	    {
	      buf[n] = 0;
	      EZ_TextEndOfBuffer(tw);
	      EZ_TextInsertString(tw,buf);
	    }
	   }
       }

SEE ALSO
       EZ_EventMainLoop(3), EZ_ServiceEvents(3)

EZWGL								EZ_AddInput(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net