/* @(#)store_into_matrix.c 2.1 93/05/18 */ /******************************************************************************/ /* function : store_into_matrix.c */ /* */ /* subsystem : chgen */ /* */ /* input : x, y, length, path_history */ /* */ /* output : (writes into PATHTABLE) */ /* */ /* returns : void */ /* */ /* author : Cheng */ /* */ /* created : July, 1991 */ /* */ /* revisions : 93s523: change strncpy to use variable hcg_abbr_size */ /* */ /* description : This routine stores the specified path_history into the */ /* PATHTABLE. */ /* */ /******************************************************************************/ #include #include #include "chgen_define.h" #include "chgen_externs.h" void store_into_matrix(x, y, length, path_history) int x , y , length; char path_history[]; { static char rcsid[] = "$Id: store_into_matrix.c,v 1.2.4.1 1999/05/04 17:00:22 jkarner Exp $"; /* Decide what's the path (first or second or 3rd ...10rd giong to be processed */ if (PINDEX[x][y].PathIsUnique == 0) PINDEX[x][y].PXindex = PXindex; PINDEX[x][y].TTchildindex = x; PINDEX[x][y].TTparentindex = y; PINDEX[x][y].PathIsUnique++; if (PINDEX[x][y].PathIsUnique == 1) PINDEX[x][y].UniqPathindex = PTindex; PATHTABLE[PTindex].PTindex = PTindex; PATHTABLE[PTindex].PXindex = PINDEX[x][y].PXindex; strncpy(PATHTABLE[PTindex].PathName, path_history, hcg_abbr_size); PATHTABLE[PTindex].PathName[hcg_abbr_size] = '_'; PATHTABLE[PTindex].PathName[hcg_abbr_size+1] = '_'; strcpy (&(PATHTABLE[PTindex].PathName[hcg_abbr_size+2]),&(path_history[length * hcg_abbr_size])); strcpy ( PATHTABLE[PTindex].PathBody, path_history ); PATHTABLE[PTindex].PathLength = length; PTindex++; if (PINDEX[x][y].PathIsUnique == 1) PXindex++; return; }