/* $Id: ui.c,v 1.4 1999/06/22 12:23:36 levitte Exp $ */
#include "fish.h"

#include "ui.h"
#include "ssh.h"

void *ui_init(long (*down_write)(unsigned char *,long,void *,Erf,void*),
		void *down_state, Erf erf, void *erfp)
{
    ui_state *state;

    state = MemPtrNew(sizeof(ui_state));
    if (!state) {
	ssh_F_memfull();
	return NULL;
    }

    state->down_write = down_write;
    state->down_state = down_state;

    return state;
}

/* This function is called when data arrives */
void ui_dispatch(unsigned char *data, long len, void *state_, Erf erf,
    void *erfp)
{
#if 0
    ui_state *state = state_;
#endif

    if (len < 0) {
	/* The connection was closed; pass on the info */
	goto ui_dispatch_out;
    }

    write(1, data, len);
	    
ui_dispatch_out:
    ;
}

/* Emacs local variables

Local variables:
eval: (set-c-style "BSD")
end:

*/
