#ifndef _SOCK_SUPP_H
#define _SOCK_SUPP_H

#include "app_general.h"

typedef enum trim_mode_type {
  ignore_spaces,
  ignore_leading_spaces,
  accept_spaces
} trim_mode_type;

void
set_compact_transmission (Boolean compact);

Boolean
get_compact_transmission (void);

void
replace_during_transmission (int /*char*/ src, int /*char*/ replacement);

int
create_socket (int port, int backlog);

void
end_client_connection (int * connection);

void
set_buffered_transmission(Boolean required_transmission_buffered);

void
wr (int * fd,char const * format, ... );
  
void
wr_buf (int * fd, unsigned char const *  data, unsigned int length);

void
wrc (int * fd, int /*char*/ chr);

void
flush_sendbuffer (void);

/* rd reads data from a file. It starts 'start' bytes further than buf, */
/*    and reads upto (and including) 'end' bytes further than bufi      */
/* on failure, an error report is issued and -1 is returned             */
/* on success, it returns the offset of the last byte that was read     */
unsigned int
rd (int fd, char * buf, unsigned int start, unsigned int end);

long
get_bytes_transferred (void);

long
get_bytes_output (void);

void trim (trim_mode_type trim_mode);

#endif