GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  EZ_REMOVEINPUT (3)

NAME

EZ_AddInput, EZ_RemoveInput - register/remove input handlers

CONTENTS

Synopsis
Arguments
Description

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 condition. 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)

Search for    or go to Top of page |  Section 3 |  Main Index


EZWGL EZ_ADDINPUT (3)

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.