/**********************************************************************
 * ti library's routine for getting main menu
 *
 * $Author: brlewis $
 * $Source: /mit/techinfodev/src/libti/RCS/main.c,v $
 * $Header: /mit/techinfodev/src/libti/RCS/main.c,v 0.3 1995/04/10 20:21:57 brlewis Exp $
 *
 * Copyright 1992 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_main_c[] = "$Header: /mit/techinfodev/src/libti/RCS/main.c,v 0.3 1995/04/10 20:21:57 brlewis Exp $";
#endif /* lint */

#include <errno.h>
#include <string.h>
#include <ti/memory.h>
#include <ti/ti.h>

/**********************************************************************
 * ti_main(TI *tp, ti_menu **mp)
 *	puts correct menu in mp
 *
 * - returns error code
 **********************************************************************/

long
ti_main(tp, mp)
     TI *tp;
     ti_menu **mp;
{
  static char *getmain = "w:2:0:1";

  TI_MEM(*mp = New(ti_menu));
  memset(*mp, 0, sizeof(ti_menu));
  TI_MEM((*mp)->query = newstring(getmain)); /* XXX small leak */
  strcpy((*mp)->query, getmain);
  tp->links++;
  (*mp)->tp=tp;
  return(0L);
}
