/* SKT.H - Headers for the  function library for handling sockets

            Written by M.C.Gregorie.

            Version history
               
            1.0   27/09/03   Initial release

   environ - C programming support functions
   Copyright (C) 2005  Martin C Gregorie
   
   This program is free software; you can redistribute it and/or
   modify it under the terms of the Lesser GNU General Public License.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
  
   You should have received a copy of the Lesser GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  
   Contact Martin Gregorie at martin@gregorie.org

*/

/* Constants used by skt_getname() and skt_getport() */
 
#define LOCAL_HOST   0
#define REMOTE_HOST  1

/* Function templates */

void skt_debug(int d);
char *skt_error(void);                             /* returns error string  */
int skt_listen(char *name, int portnum);           /* returns listener fd   */
int skt_accept(int listener);                      /* returns connection fd */
int skt_connect(char *name, int portnum);          /* returns connection fd */
int skt_send(int skt, char* buff, int length);     /* returns chars sent    */
int skt_receive(int skt, char *buff, int bufflen); /* returns chars rxd     */
void skt_close(int skt);
void skt_closelistener(int skt, char *pipe);
int skt_getname(int skt,
                int locality,
                char *host,                        /* return value          */
                int lth);                          /* returns 0 or -1       */
int skt_getport(int skt, int locality);            /* returns port or -1    */
      
