/*
 * This file is part of the OLH system.
 *
 *      Lucien Van Elsen
 *      MIT Project Athena
 *
 * Copyright (C) 1990 by the Massachusetts Institute of Technology.
 * For copying and distribution information, see the file "mit-copyright.h".
 *
 *      $Source: /afs/sipb.mit.edu/project/sipb-athena/repository/src/olh/ascii/keyword.c,v $
 *      $Id: keyword.c,v 1.1 1993/10/12 05:45:09 probe Exp $
 *      $Author: probe $
 */

#ifndef lint
#ifndef SABER
static char *RCSid = "$Header: /afs/sipb.mit.edu/project/sipb-athena/repository/src/olh/ascii/keyword.c,v 1.1 1993/10/12 05:45:09 probe Exp $";
#endif
#endif

#include "olh.h"

void
do_keyword_startup(kw)
     char *kw;
{
  char old_mp[1024];
  int number;

  if (kw[0] == PATH_SEP_CHAR) {
    /* build menupath from argument */
    strcpy(old_mp,menupath);
    resize_menupath(strlen(kw));
    strcpy(menupath,kw);
    doing_keywords = 0;
    keyword_level = 0;
    construct_context(menupath);
    OLH_ui_update_menus();
    return;
  }
  else {
    doing_keywords = 1;
    display_keyword_menu();
    number = find_keyword_index(kw,1);
    if (number == -1) {
      sprintf(old_mp,"\"%s\" is an invalid keyword",kw);
      OLH_ui_message(old_mp);
    }
    else
      invoke_k_item(number);
  }
}
