This lib is used to send formated char strings to one or more Collector
Server/s.
The number and kind of UDP "connections" is abstracted in a set of bits,
like select() does with FDs.

A global error number is used, like errno.

ECOL_INIT1ST: is set when you want to send data to a server which isn't
              in the internal info structure array
              so call ColInit() before you send data to a server

ECOL_SEND:    isn't used now

ECOL_SOCKET:  is set if socket() gives back an error

ECOL_MEMORY:  isn't used now

ECOL_BIND:    bind() error

ECOL_FULL:    is set if you want init more connections as possible (max: 32)


To set some bits in an col_set variable (32 bit) the following macros can be
used...

CS_ZERO(set):     MUST called to init the col_set variable

CS_SET(s, set):   is used to set a bit in the variable
                  i.e. CS_SET(3, colset) will set the third bit in colset to 1

CS_CLR(s, set):   is used to clear a bit in the variable

CS_ISSET(s, set): is used to determine if a bit is set or not
                  i.e. CS_ISSET(3, colset) will return 1 if the third bit
                       in colset is set to 1

The programmer only need to use CS_ZERO() the other macros will be used by
the lib.functions.


The following func.s can be used to send data to the server.

ColInit(col_set *set, char *serv_ip, int port)
  Must be called to init all informations needed to send data.
  ColInit() returns the number of "connections" or -1 for error.
  The bit in '*set', which indicates the "connection", will be set by
  ColInit().

ColSend(col_set *set, char *str, ...)
  Sends an printf() formated string to a set of servers.
  YOU HAVE TO COPY your col_set variable because ColSend() will clear
  the bit for the "connections" ColSend() can send data to, so you are able
  to determine which server is not reachable.
  ColSend() will return the number of successfull sendto()s or -1 if an error
  occurred.

ColClose(col_set *set)
  ColClose() removes a subset (or all) "connections" of the set of
  "connections".
  ColClose() returns the number of closed "connections".


------------------------------------------------------------------------------

The code can be distributed without restrictions.
Feel free to modify the code BUT DON'T FORGET to give me the credits!!!
Copyright 1997 TICK (t_i_c_k@hotmail.com)

EOF
