1: # include   "../ingres.h"
   2: 
   3: /*
   4: **  TRIM_RELNAME -- trim blanks from relation name for printing
   5: **
   6: **	A relation name (presumably in 'ingresname' format: MAXNAME
   7: **	characters long with no terminating null byte) has the
   8: **	trailing blanks trimmed off of it into a local buffer, so
   9: **	that it can be printed neatly.
  10: **
  11: **	Parameters:
  12: **		name -- a pointer to the relation name
  13: **
  14: **	Returns:
  15: **		a pointer to the trimmed relation name.
  16: **
  17: **	Side Effects:
  18: **		none
  19: **
  20: **	Files:
  21: **		none
  22: **
  23: **	Compilation Flags:
  24: **		none
  25: **
  26: **	Trace Flags:
  27: **		none
  28: **
  29: **	Diagnostics:
  30: **		none
  31: **
  32: **	Syserrs:
  33: **		none
  34: **
  35: **	History:
  36: **		3/22/78 (eric) -- stripped off from 'help'
  37: */
  38: 
  39: char *trim_relname(name)
  40: char    *name;
  41: {
  42:     register char   *old, *new;
  43:     register int    i;
  44:     static char trimname[MAXNAME + 1];
  45: 
  46:     old = name;
  47:     new = trimname;
  48:     i = MAXNAME;
  49: 
  50:     while (i--)
  51:         if ((*new++ = *old++) == ' ')
  52:         {
  53:             new--;
  54:             break;
  55:         }
  56: 
  57:     *new = '\0';
  58: 
  59:     return (trimname);
  60: }

Defined functions

Last modified: 1980-12-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1793
Valid CSS Valid XHTML 1.0 Strict