/**********************************************************************
 * luc_parse.c -- ask server to parse a transaction
 *
 * $Author: brlewis $
 * $Source$
 * $Header$
 *
 * 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_luc_parse_c[] = "$Header$";
#endif /* lint */

#include <strings.h>
#include <lucy/lucy.h>

/**********************************************************************
 * luc_parse(int n)
 *	caller sets n to transaction number in queue to parse
 *
 * - sends request to server
 * - returns error code
 **********************************************************************/

long
luc_parse(n)
     int n;
{
  long code;
  enum clnt_stat retval;

  retval=callrpc(luv_host, luv_prog, LUCY_RPC_VERS, LUCY_RPC_PARSE,
		 xdr_int, (char *)&n, xdr_long, (char *)&code);
  if (retval) {
    strcpy(luv_context, luv_host);
    return(LUC_RPC_SUCCESS + (long) retval);
  }

  if (code) sprintf(luv_context, "%d", n);
  return(code);
}
