#include #include #include "ant.h" /* for GetUserName */ #include "libCfg.h" #include "libCfg_local.h" LinkList IdfsNextItems_sublist (StrHier S) { return S->sublist; } void CfgInitSCF () { /* This routine finds all SCF's and moves them into the Projects hierarchy */ char tmp [255]; LinkList l; StrHier S, S_SCF; int i; char *tmpstr; memset (tmp, 0, sizeof (tmp)); CfgInit (); for (i = 0; i < 2; i++) { switch (i) { case 0 : tmpstr = GetEnv ("SDDAS_HOME"); if (tmpstr != NULL) snprintf (tmp, sizeof (tmp), "%s/SCF", tmpstr); break; case 1 : tmpstr = GetHomeDirectory (); if (tmpstr != NULL) snprintf (tmp, sizeof (tmp), "%s/SCF", tmpstr); break; } /* switch */ if ((l = LoadSCFs (tmp)) != NULL) { switch (i) { case 0 : strcpy (tmp, "public-SCFs"); break; case 1 : snprintf (tmp, sizeof (tmp), "%s-SCFs", GetUserName ()); break; } /* switch */ S = StrHierCreateNodes (1); S->str = strdup (tmp); S->sublist = l; S->GetNextItems = IDFSNextItems; while (l) { S_SCF = (StrHier) l->data; S_SCF->parent = S; l = l->next; } /* while */ Projects = LinkAppend (Projects, S); } /* if */ } /* for */ }