/*---------------------------------------------------------------*/
/*   Copyright (c) 1988 Regents of the University of California  */
/*                 All Rights Reserved                           */
/*---------------------------------------------------------------*/
/*
      @(#)lcolname.c	1.3  (UCLA, IGPP) 20 Apr 1994 
 */
/*-- LCOLNAME ---------------------------------*/
/* Returns the long column name for the        */
/* column index given. Returns a null          */
/* pointer if the index is not a valid         */
/* index, otherwise returns a pointer to       */
/* a string containing the short column        */
/* name. This string is a temporary string     */
/* therfore it may not still exist after       */
/* any subsequent calls. Hence copying it      */
/* into permant strorage is recommended.       */
/* The index count starts at 1.                */
/*                                             */
/* Entry Requirements:                         */
/*    COLNAME: The short column name for       */
/*             the desired information.        */
/*                                             */
/*                                             */
/* Mapping for return values for char funtions */
/*                                             */
/* Function   Chars used      Return address   */
/* --------   ----------      --------------   */
/* scolname   0-8    9 chars      &Sbuffer[0]  */
/* lcolname   9-41  33 chars      &Sbuffer[9]  */
/* colunits   42-58 17 chars      &Sbuffer[42] */
/* uniqname   59-67  9 chars      &Sbuffer[59] */
/*                                             */
/* History:                                    */
/*   Begun: 3/14/86 - Todd King                */
/*            Under GH06 support.              */
/*   Update: 4/28/87 - Marco Zagha             */
/*            Under GG44 support.              */
/*   Edited:04/14/94 - Gilbert Hyatt           */
/*     Now uses pipec.h as entry point         */
/*     into the library.                       */
/*---------------------------------------------*/
char *lcolname(colname)
char colname[];
{

#include <stdio.h>
#include "pipec.h"

  extern DESC Desc[];
  extern int Ndesc;
  extern char Sbuffer[];

  char *startptr;
  int cindex;
  cindex=colnum(colname);
  cindex--;

  startptr = &Sbuffer[9];
  *startptr ='\0';
  if(cindex < 0) return(startptr);  /* No can do */
  strcpy(startptr,Desc[cindex].longcol);
  return(startptr);
}
