Its just an example of what me program does. The real thing goes like this:-
Code:
prompt()
{
char buffer[1000];
int i;
if(promptr!=NULL)
{
printf("%s ", promptr);
}
inputstr=gets(sizedstring1);
if(strlen(inputstr)>692)
{
error3(41, NULL);
prompt();
}
starstring=inputstr;
if(strcmp(starstring, "\n")!=0) { fprintf(perm, "%s\n", starstring); }
if(privstat!=0)
{
i=0;
do
{
buffer[i]=NULL;
i=i+1;
}
while(i<sizeof(buffer));
strcpy(buffer, "p=");
strcat(buffer, starstring);
starstring=eciread("[ACCESS]", buffer, 700, 0, 1);
if(starstring!=NULL)
{
error3(40, NULL);
prompt();
}
}
process(inputstr, 1, 1);
}
void process(char *processr, int a, int b)
{
if(b==1) { refresh(0); }
if(k==1)
{
stdint1=0;
fp=fopen("~tmp01.tmo", "a");
while(stdint1<2000)
{
peek(0, stdint1, starstring, 54);
fprintf(fp, starstring);
stdint1=stdint1+1;
}
starstring=NULL;
stdint1=0;
fclose(fp);
}
if(strncmp(processr, "", 1)==0)
{
if(a!=2) { prompt(); }
}
/* more strncmp statements all branching off to different procedures */
prompt();
}