/* readdct displays the contents of .remoteobjects in html for purpose of creating a dictionary of objects available in a given category */ #include #include main(argc,argv) char *argv[]; int argc; { char s[1024],*sp,*sp2,obj[1024]; int icnt; icnt=3; /* types of lines in .remoteobjects */ while(!feof(stdin)){ if(gets(s) == NULL)break; /* second and third line types begin with a dash */ if(*s == '-'){ switch(icnt++){ case 0: if(strlen(s)>2) printf("%-20s",s+2); else printf("%-20s"," "); break; case 1: if(strlen(s)>2) if(strstr(s,":/")) { sp=strchr(s+2,' '); *sp=0; /* if infoserver string ends in '/' then append the object name */ if (sp-1 == strrchr(s+2,'/')) printf(" %s\n", s+2,obj,sp+1); else /* else the object name is assumed to be present */ printf(" %s\n", s+2,sp+1); } else { printf(" %s\n", INFOSERVER,argv[1],obj,s+2); }; break; }; /* end of switch */ } else { if (icnt <= 1) printf("\n"); sp=strchr(s,'='); *(sp++)=0; if (strstr(sp,":/")) { printf("%-18s",sp,s); strcpy(obj,s); } else { sp2=strchr(sp+2,'/'); *sp2=0; printf("%-18s",sp,sp2+1,s); strcpy(obj,s); }; icnt=0; }; }; if(icnt <= 1) printf("\n"); }