/**********************************************************************
 * construct_nb -- fill in contents of name block
 *
 * $Source$
 * $Author$
 * $Header$
 *
 * Copyright 1990 by the Massachusetts Institute of Technology.
 * For copying and distribution information, see the file
 * "mit-copyright.h".
 **********************************************************************/
#include "mit-copyright.h"

#ifndef lint
static char rcsid_construct_nb_c[] = "$Header$";
#endif /* lint */

#include <stdio.h>
#include <pwd.h>
#include "lucy/lucy.h"
tfile unix_tfile();		/* XXX should be in discuss .h file */

long
construct_nb(nb)
     name_blk *nb;
{
  long code;
  static char *hostname = "euphrosyne";
  static char *pathname = "/usr/spool/discuss/lucyx";
  static char user_id[9];
  static char *aliases[] = { "lucy_experimental", "lucyx", NULL };
  struct passwd *pw;

  /* Initialize fields. XXX hostname, pathname, aliases */
  pw = getpwuid((int) getuid());
  if (!pw)
    strcpy(user_id, "unknown");
  else (void) strcpy(user_id, pw->pw_name);

  /* Fill in fields. */
  bzero(nb, sizeof(name_blk));
  nb->hostname = hostname;
  nb->pathname = pathname;
  nb->user_id = user_id;
  nb->aliases = aliases;
  return(0L);
}
