/**********************************************************************
 * ti library's routine for sending a file from memory
 *
 * $Author: brlewis $
 * $Source: /afs/net.mit.edu/project/net_dev/brlewis/src/lib/RCS/sendbuf.c,v $
 * $Header: /afs/net.mit.edu/project/net_dev/brlewis/src/lib/RCS/sendbuf.c,v 0.2 92/04/01 16:17:52 brlewis Exp $
 *
 * Copyright 1991 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <mit-copyright.h>.
 **********************************************************************/

#include <mit-copyright.h>

#ifndef lint
static char rcsid_ti_sendbuf_c[] = "$Header: /afs/net.mit.edu/project/net_dev/brlewis/src/lib/RCS/sendbuf.c,v 0.2 92/04/01 16:17:52 brlewis Exp $";
#endif /* lint */

#include <ti/ti.h>

/**********************************************************************
 * ti_sendbuf(TI *tp, ti_node *np, char *buf, int size)
 *	np must be a node that has been created with TI_NSYSGEN_FN set
 *
 * - sends contents of buf to server
 * - returns error code
 **********************************************************************/

long
ti_sendbuf(tp, np, buf, size)
     TI *tp;
     ti_node *np;
     char *buf;
     int size;
{
  long code;

  if (code=ti_sendfirst(tp, np)) return(code);
  if (code=ti_sendmiddle(tp, buf, size)) return(code);
  return(ti_sendlast(tp));
}
