#define VERSION 7
#include "openaxiom-c-macros.h"
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "cfuns.h"
using namespace OpenAxiom;
int printandor(char *list);
int printlist(char *list);
int pprintobject(char *list);
int pprintcond(int seekpt,char *path);
char *AXIOM;
char interppath[256];
FILE *interp;
int seekinterp;
char browsepath[256];
FILE *browse;
int seekbrowse;
char compresspath[256];
FILE *compress;
int seekcompress;
char **ct;
int Nct;
char list[2048];
int listptr = 0;
char list2[65535];
int listptr2 = 0;
int ppcount=0;
int indent=6;
char erasecmd[256];
char domain[256];
char operationalist[256];
char constructormodemap[256];
char modemaps[256];
char object[256];
char constructorcategory[256];
char niladic[256];
char abbreviation[256];
char constructor[256];
char cosig[256];
char constructorkind[256];
char defaultdomain[256];
char ancestors[256];
char bdomain[256];
char bsourcefile[256];
char bconstructorform[256];
char bdocumentation[256];
char battributes[256];
char bpredicates[256];
int S2N(char *s)
{
int i;
for (i=0;i<Nct;i++) {
if(strcmp(ct[i],s)==0) return -i;
}
return 1;
}
const char* N2S(int n)
{
return ((n<=0 && n>-Nct) ? ct[-n] : "the unknown thing");
}
int echoargs(int argc, char *argv[])
{
int i;
for (i=0; i < argc; i++)
printf("%d=%s%s",i,argv[i],(i < argc-1) ? " " : "");
printf("\n");
return 0;
}
int printnoquotes(char *chars)
{ int i;
for (i=0; chars[i] != '\0'; i++)
if (chars[i] != '\"') putchar(chars[i]);
putchar('\n');
return(0);
}
int printenter(char *name)
{ int i;
printf("\n>enter %s >",name);
for (i=0; i < 10; i++) printf("%c",list2[ppcount+i]);
printf("<\n");
return(0);
}
int printexit(char *name)
{ int i;
printf("\n<exit %s >",name);
for (i=0; i < 10; i++) printf("%c",list2[ppcount+i]);
printf("<\n");
return(0);
}
int readlist(FILE *file)
{
int c;
list[listptr++]='(';
while ((c=fgetc(file)) != EOF)
{if ((char)c == ')') break;
if ((char)c == '(') readlist(file);
else list[listptr++]=(char)c;}
list[listptr++]=')';
list[listptr]='\0';
return(0);
}
int readstring2(FILE *file)
{ int c;
list2[listptr2++]='"';
while ((c=fgetc(file)) != EOF)
{if ((char)c == '"') break;
if ((char)c == '\\') list2[listptr2++]=fgetc(file);
else list2[listptr2++]=(char)c;}
list2[listptr2++]='"';
list2[listptr2]='\0';
return(0);
}
int readlist2(FILE *file)
{
int c;
list2[listptr2++]='(';
while ((c=fgetc(file)) != EOF)
{if ((char)c == ')') break;
if ((char)c == '"') readstring2(file);
if ((char)c == '(') readlist2(file);
else list2[listptr2++]=(char)c;}
list2[listptr2++]=')';
list2[listptr2]='\0';
return(0);
}
int pprintatom(char *list)
{
char c;
while ((c=list[ppcount]) != 0)
{
if (c == '-') {
printf("%s",N2S(atoi(list+ppcount)));
while(c=='-' || isdigit(c)) {
c=list[++ppcount];
}
break;
}
if (c == ' ') {
printf("%c",list[ppcount++]);
break;
}
if (c == '(') break;
if (c == ')') break;
if (c == '|')
ppcount ++;
else
printf("%c",list[ppcount++]);};
return(0);
}
int printob(char *list)
{ char c;
while ((c=list[ppcount]) != 0)
{if (list[ppcount] == '(' ) printlist(list);
else if (list[ppcount] == ')' ) return(0);
else
pprintatom(list);}
return(0);
}
int printlist(char *list)
{ printf("%c",list[ppcount++]);
printob(list);
printf("%c",list[ppcount++]);
return(0);
}
int pprintlist(char *list)
{ int i;
printf("\n");
for (i=indent; i != 0; --i) printf(" ");
indent=indent+2;
printf("%c",list[ppcount++]);
pprintobject(list);
printf("%c",list[ppcount++]);
indent=indent-2;
return(0);
}
int pprintobject(char *list)
{ char c;
while ((c=list[ppcount]) != 0)
{if (list[ppcount] == '(' ) pprintlist(list);
else if (list[ppcount] == ')' ) return(0);
else
pprintatom(list);}
return(0);
}
int skiplist(char *list)
{ while (list[ppcount++] != '(');
while(list[ppcount] !=')')
{if (list[ppcount] == '(')
skiplist(list);
else
ppcount++;}
ppcount++;
return(0);
}
int pprintalist(int seekpt,char *path)
{ char c;
int i;
FILE *file;
file=fopen(path,"r");
fseek(file,seekpt,SEEK_SET);
listptr2=0;
if ((c=fgetc(file)) == '(')
readlist2(file);
else
{ list2[listptr2++]=c;
while (! isspace(c = fgetc(file))) list2[listptr2++]=c;};
list2[listptr2]='\0';
fclose(file);
ppcount=0;
if (list2[0] != '(')
pprintatom(list2);
else
while (list2[ppcount++] != ')')
{while (list2[ppcount++] !='(');
printf("\n");
for (i=indent; i != 0; --i) printf(" ");
if (list2[ppcount] == '(')
printlist(list2);
else
pprintatom(list2);
while(list2[ppcount] != ')')
if (list2[ppcount] == '(')
skiplist(list2);
else
ppcount++;
ppcount++;};
return(0);
}
int pprint(int seekpt,char *path)
{ char c;
FILE *file;
file=fopen(path,"r");
listptr2=0;
fseek(file,seekpt,SEEK_SET);
if ((c=fgetc(file)) == '(')
readlist2(file);
else
{ list2[listptr2++]=c;
while (! isspace(c = fgetc(file))) list2[listptr2++]=c;}
list2[listptr2]='\0';
fclose(file);
ppcount=0;
pprintobject(list2);
printf("\n");
return(0);
}
int printdomain()
{
printf("%s\n",N2S(atoi(domain)));
return(0);
}
int printobject(int all)
{ char stripped[256];
int i;
for (i=1; object[i] != '"'; i++) stripped[i-1]=object[i];
stripped[i-1]='\0';
printf("...loading info not available yet\n");
return(0);
}
int printconstructorkind(int all)
{if (all == 1)
printf("...is a %s\n",N2S(atoi(constructorkind)));
else
printf("%s\n",N2S(atoi(constructorkind)));
return(0);
}
int printniladic(int all)
{ if (niladic[0] == 'T')
if (all == 1)
printf("...is niladic\n");
else
printf("niladic\n");
else
if (all == 1)
printf("...is not niladic\n");
else
printf("padic\n");
return(0);
}
int printabbreviation(int all)
{ if (all == 1)
printf("...is abbreviated as %s\n",abbreviation);
else
printf("%s\n",abbreviation);
return(0);
}
int printsourcefile(int all)
{ if (all == 1)
printf("...is defined in the source file %s\n",bsourcefile);
else
printnoquotes(bsourcefile);
return(0);
}
int printdefaultdomain(int all)
{ int i;
if (strcmp(defaultdomain,"NIL") == 0)
if (all == 1)
printf("...has no default domain\n");
else
printf("NIL\n");
else
if (all == 1)
{printf("...has a default domain of ");
for (i=1; defaultdomain[i] != '|'; i++) putchar(defaultdomain[i]);
printf("\n");}
else
{for (i=1; defaultdomain[i] != '|'; i++) putchar(defaultdomain[i]);
printf("\n");}
return(0);
}
int printancestors(int pretty)
{ if (strcmp(ancestors,"NIL") == 0)
printf("...has no ancestors\n");
else
{seekinterp=atoi(ancestors)+1;
printf("...has the ancestors: ");
if (pretty == 1)
{ppcount=0;
pprintcond(seekinterp,interppath);
printf("\n");}
else
printf("%d\n",seekinterp);}
return(0);
}
int printoperationalist(int pretty)
{
if (strcmp(operationalist,"NIL") == 0)
printf("...has no operationalist\n");
else
{seekinterp=atoi(operationalist)+1;
printf("...has the operations: ");
if (pretty == 1)
{pprintalist(seekinterp,interppath);
printf("\n");}
else
printf("%d\n",seekinterp);};
return(0);
}
int printhas(char *list)
{
printf(" if ");
ppcount=ppcount+6;
if (list2[ppcount] == '(')
{printlist(list2);
printf(" ");
ppcount++;}
else
pprintatom(list2);
printf("has ");
if (list2[ppcount] == '(')
printlist(list2);
else
pprintatom(list2);
ppcount++;
return(0);
}
int printand(char *list)
{
if ((list2[ppcount] == '|') && (list2[ppcount+1] == 'a')) ppcount=ppcount+2;
ppcount=ppcount+5;
printandor(list2);
ppcount++;
while (list2[ppcount] == '(')
{printf(" and");
ppcount++;
printandor(list2);
ppcount++;}
return(0);
}
int printor(char *list)
{
ppcount=ppcount+4;
printandor(list2);
ppcount++;
while (list2[ppcount] == '(')
{printf(" or");
ppcount++;
printandor(list2);
ppcount++;}
return(0);
}
int printandor(char *list)
{
if ((list2[ppcount] == '|') && (list2[ppcount+1] == 'a')) printand(list2);
if (list2[ppcount] == '|') printhas(list2);
if (list2[ppcount] == 'A') printand(list2);
if (list2[ppcount] == 'O') printor(list2);
return(0);
}
int pprintcond(int seekpt,char *path)
{ char c;
int i;
FILE *file;
file=fopen(path,"r");
fseek(file,seekpt,SEEK_SET);
listptr2=0;
if ((c=fgetc(file)) == '(')
readlist2(file);
else
{ list2[listptr2++]=c;
while (! isspace(c = fgetc(file))) list2[listptr2++]=c;};
list2[listptr2]='\0';
fclose(file);
ppcount=0;
if (list2[0] != '(')
pprintatom(list2);
else
while (list2[ppcount++] != ')')
{while (list2[ppcount++] !='(');
printf("\n");
for (i=indent; i != 0; --i) printf(" ");
if (list2[ppcount] == '(')
printlist(list2);
else
pprintatom(list2);
while(isspace(list2[ppcount])) ppcount++;
if (list2[ppcount] != '.')
printandor(list2);
else
while(list2[ppcount++] !=')');};
return(0);
}
int printattributes(int pretty)
{if (strcmp(battributes,"NIL") == 0)
printf("...has no attributes\n");
else
{seekbrowse=atoi(battributes)+1;
printf("...has the attributes: ");
if (pretty == 1)
{pprintcond(seekbrowse,browsepath);
printf("\n");}
else
printf("%d\n",seekbrowse);};
return(0);
}
int printcosig()
{ printf("...has the cosig: %s\n",cosig);
return(0);
}
int printconstructorform(int pretty)
{ FILE *file;
seekbrowse=atoi(bconstructorform)+1;
printf("...has the constructorform: ");
if (pretty == 1)
{file=fopen(browsepath,"r");
fseek(file,seekbrowse,SEEK_SET);
fgetc(file);
listptr2=0;
readlist2(file);
listptr2=0;
ppcount=0;
pprintlist(list2);
printf("\n");}
else
printf("%d\n",seekbrowse);
return(0);
}
int printconstructormodemap(int pretty)
{ FILE *file;
seekinterp=atoi(constructormodemap)+1;
printf("...has the constructormodemap: ");
if (pretty == 1)
{file=fopen(interppath,"r");
fseek(file,seekinterp,SEEK_SET);
fgetc(file);
listptr2=0;
readlist2(file);
listptr2=0;
ppcount=0;
pprintlist(list2);
printf("\n");}
else
printf("%d\n",seekinterp);
return(0);
}
int printmodemaps(int pretty)
{ FILE *file;
seekinterp=atoi(modemaps)+1;
if (pretty == 1)
{file=fopen(interppath,"r");
fseek(file,seekinterp,SEEK_SET);
if (fgetc(file) == 'N')
printf("...has no modemaps\n");
else
{printf("...has the modemaps: ");
listptr2=0;
readlist2(file);
listptr2=0;
ppcount=0;
pprintlist(list2);
printf("\n");};}
else
printf("%d\n",seekinterp);
return(0);
}
int printconstructorcategory(int pretty)
{ FILE *file;
seekinterp=atoi(constructorcategory)+1;
printf("...has the constructorcategory: ");
if (pretty == 1)
{file=fopen(interppath,"r");
fseek(file,seekinterp,SEEK_SET);
fgetc(file);
listptr2=0;
readlist2(file);
listptr2=0;
ppcount=0;
pprintlist(list2);
printf("\n");}
else
printf("%d\n",seekinterp);
return(0);
}
int printdocumentation(int pretty)
{ FILE *file;
seekbrowse=atoi(bdocumentation)+1;
if (pretty == 1)
{file=fopen(browsepath,"r");
fseek(file,seekbrowse,SEEK_SET);
if (fgetc(file) == 'N')
printf("...has no documentation\n");
else
{printf("...has the documentation: ");
listptr2=0;
readlist2(file);
listptr2=0;
ppcount=0;
pprintlist(list2);
printf("\n");};}
else
printf("%d\n",seekbrowse);
return(0);
}
int printpredicates(int pretty)
{ FILE *file;
{seekbrowse=atoi(bpredicates)+1;
if (pretty == 1)
{file=fopen(browsepath,"r");
fseek(file,seekbrowse,SEEK_SET);
if (fgetc(file) == 'N')
printf("...has no predicates\n");
else
{printf("...has the predicates: ");
listptr2=0;
readlist2(file);
listptr2=0;
ppcount=0;
pprintlist(list2);
printf("\n");};}
else
printf("%d\n",seekbrowse);};
return(0);
}
int opencompress()
{ char line[256];
char other[256];
int count = 256;
int i;
if (AXIOM != NULL)
sprintf(compresspath,"%s/algebra/compress.daase",AXIOM);
else
sprintf(compresspath,"compress.daase");
compress=fopen(compresspath,"r");
if (compress == NULL)
{printf("unable to find the file %s\n",compresspath);
exit(1);};
fseek(compress,1,SEEK_SET);
if (fgets(line,count,compress) == NULL)
printf("get failed\n");
else
for (i=1; ! isspace(line[i]); i++) other[i-1]=line[i];
seekcompress=atoi(other)+2;
return(0);
}
int openinterp()
{ char line[256];
char other[256];
int count = 256;
int i;
if (AXIOM != NULL)
sprintf(interppath,"%s/algebra/interp.daase",AXIOM);
else
sprintf(interppath,"interp.daase");
interp=fopen(interppath,"r");
if (interp == NULL)
{printf("unable to find the file %s\n",interppath);
exit(1);};
fseek(interp,1,SEEK_SET);
if (fgets(line,count,interp) == NULL)
printf("get failed\n");
else
for (i=1; ! isspace(line[i]); i++) other[i-1]=line[i];
seekinterp=atoi(other)+2;
return(0);
}
int parseinterp()
{ int i;
int j;
for ((i=1, j=0); ! isspace(list[i]); (i++,j++))
domain[j]=list[i];
domain[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
operationalist[j]=list[i];
operationalist[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
constructormodemap[j]=list[i];
constructormodemap[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
modemaps[j]=list[i];
modemaps[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
object[j]=list[i];
object[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
constructorcategory[j]=list[i];
constructorcategory[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
niladic[j]=list[i];
niladic[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
abbreviation[j]=list[i];
abbreviation[j]='\0';
for ((i++,j=0); (list[i] != ')'); (i++,j++))
cosig[j]=list[i];
cosig[j++]=')';
i++;
cosig[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
constructorkind[j]=list[i];
constructorkind[j]='\0';
for ((i++,j=0); ! isspace(list[i]); (i++,j++))
defaultdomain[j]=list[i];
defaultdomain[j]='\0';
for ((i++,j=0); (list[i] != ')'); (i++,j++))
ancestors[j]=list[i];
ancestors[j]='\0';
return(0);
}
int openbrowse()
{
char line[256];
char other[256];
int count = 256;
int i;
if (AXIOM != NULL)
sprintf(browsepath,"%s/algebra/browse.daase",AXIOM);
else
sprintf(browsepath,"browse.daase");
browse=fopen(browsepath,"r");
if (browse == NULL)
{printf("unable to find the file %s\n",browsepath);
exit(1);};
fseek(browse,1,SEEK_SET);
if (fgets(line,count,browse) == NULL)
printf("get failed\n");
else
for (i=1; ! isspace(line[i]); i++) other[i-1]=line[i];
seekbrowse=atoi(other)+2;
return(0);
}
int parsebrowse()
{ int i;
int j;
for ((i=1, j=0); ! isspace(list[i]); (i++,j++)) bdomain[j]=list[i];
bdomain[j]='\0';
for ((i++, j=0); ! isspace(list[i]); (i++,j++)) bsourcefile[j]=list[i];
bsourcefile[j]='\0';
for ((i++, j=0); ! isspace(list[i]); (i++,j++)) bconstructorform[j]=list[i];
bconstructorform[j]='\0';
for ((i++, j=0); ! isspace(list[i]); (i++,j++)) bdocumentation[j]=list[i];
bdocumentation[j]='\0';
for ((i++, j=0); ! isspace(list[i]); (i++,j++)) battributes[j]=list[i];
battributes[j]='\0';
for ((i++, j=0); ! isspace(list[i]); (i++,j++)) bpredicates[j]=list[i];
bpredicates[j]='\0';
return(0);
}
int pprintinfo(const char* property)
{ int pretty = 1;
int all = 0;
if (strcmp(property,"short") == 0) {pretty=0; all=1;}
if (strcmp(property,"all") == 0) all=1;
if (all) printf("\n");
if (all || (strcmp(property,"domain") == 0))
printdomain();
if (all || (strcmp(property,"sourcefile") == 0))
printsourcefile(all);
if (all || (strcmp(property,"object" ) == 0))
printobject(all);
if (all || (strcmp(property,"constructorkind")) == 0)
printconstructorkind(all);
if (all || (strcmp(property,"niladic") == 0))
printniladic(all);
if (all || (strcmp(property,"abbreviation") == 0))
printabbreviation(all);
if (all || (strcmp(property,"defaultdomain") == 0))
printdefaultdomain(all);
if (all || (strcmp(property,"ancestors") == 0))
printancestors(pretty);
if (all || (strcmp(property,"operationalist") == 0))
printoperationalist(pretty);
if (all || (strcmp(property,"attributes") == 0))
printattributes(pretty);
if (all || (strcmp(property,"cosig") == 0))
printcosig();
if (all || (strcmp(property,"constructorform") == 0))
printconstructorform(pretty);
if (all || (strcmp(property,"constructormodemap") == 0))
printconstructormodemap(pretty);
if (all || (strcmp(property,"modemaps") == 0))
printmodemaps(pretty);
if (all || (strcmp(property,"constructorcategory") == 0))
printconstructorcategory(pretty);
if (all || (strcmp(property,"documentation") == 0))
printdocumentation(pretty);
if (all || (strcmp(property,"predicates") == 0))
printpredicates(pretty);
return(0);
}
const char* fullname(char *property, char *progname)
{ if (strncmp(property,"ab",2) == 0) return "abbreviation";
else if (strncmp(property,"al",2) == 0) return "all";
else if (strncmp(property,"an",2) == 0) return "ancestors";
else if (strncmp(property,"at",2) == 0) return "attributes";
else if (strncmp(property,"ca",2) == 0) return "constructorcategory";
else if (strncmp(property,"cc",2) == 0) return "constructorcategory";
else if (strncmp(property,"cf",2) == 0) return "constructorform";
else if (strncmp(property,"fo",2) == 0) return "constructorform";
else if (strncmp(property,"ck",2) == 0) return "constructorkind";
else if (strncmp(property,"ki",2) == 0) return "constructorkind";
else if (strncmp(property,"cm",2) == 0) return "constructormodemap";
else if (strncmp(property,"con",3) == 0) return "constructor";
else if (strncmp(property,"cos",3) == 0) return "cosig";
else if (strncmp(property,"de",2) == 0) return "defaultdomain";
else if (strncmp(property,"dom",3) == 0) return "domain";
else if (strncmp(property,"doc",3) == 0) return "documentation";
else if (strncmp(property,"mo",2) == 0) return "modemaps";
else if (strncmp(property,"ni",2) == 0) return "niladic";
else if (strncmp(property,"ob",2) == 0) return "object";
else if (strncmp(property,"op",2) == 0) return "operationalist";
else if (strncmp(property,"pr",2) == 0) return "predicates";
else if (strncmp(property,"sh",2) == 0) return "short";
else if (strncmp(property,"so",2) == 0) return("sourcefile");
printf("I don't know what %s means. I'll use 'short'\n",property);
printf("type %s with no arguments to get the usage page\n",progname);
return "short";
}
int printhelp(const char* arg)
{printf("%s -property searchkey \n\n",arg);
printf("property is one of the following flags: \n");
printf(" (al) all (default) (sh) short\n");
printf(" (ab) abbreviation (an) ancestors\n");
printf(" (at) attributes (ca cc) constructorcategory\n");
printf(" (cf fo) constructorform (ck ki) constructorkind\n");
printf(" (cm) constructormodemap (con) constructor\n");
printf(" (cos) cosig (de) defaultdomain\n");
printf(" (dom) domain (doc) documentation\n");
printf(" (mo) modemaps (ni) niladic\n");
printf(" (ob) object (op) operationalist\n");
printf(" (pr) predicates (so) sourcefile\n");
printf("searchkey can be either a domain or its abbreviation.\n");
printf("\n e.g. %s -so Integer\n",arg);
printf(" will give the source file name written to stdout\n");
printf(" (Version %d)\n",VERSION);
return(0);
}
int main(int argc, char *argv[])
{
const char* ssearch ="";
const char* property="";
int found=1;
char c;
int i;
char proparg[256];
AXIOM=oa_getenv("AXIOM");
if (AXIOM == NULL)
printf("AXIOM shell variable has no value. using current directory\n");
if ((argv[1] == NULL) || (strcmp(argv[1],"") == 0))
{printhelp(argv[0]);
exit(1);}
if (strncmp(argv[1],"-",1) == 0)
{for (i=1; argv[1][i] != '\0'; i++) proparg[i-1]=argv[1][i];
property=fullname(proparg,argv[0]);
if ((argv[2] == NULL) || (strcmp(argv[2],"") == 0))
{printhelp(argv[0]);
exit(1);}
ssearch=argv[2];}
else
if ((argv[2] == NULL) || (strcmp(argv[2],"") == 0))
{property="all";
ssearch=argv[1];}
opencompress();
fseek(compress,seekcompress,SEEK_SET);
fscanf(compress,"%d",&Nct);
ct = (char**) malloc(Nct*sizeof(char *));
{
int foo1,foo2;
for (foo1=0;foo1<Nct;foo1++) {
foo2=0;
while(isspace(c=fgetc(compress)) || c=='|') {};
list[foo2++]=c;
while(1) {
c=fgetc(compress);
if (isspace(c) || c == ')' ) break;
if (c != '|') list[foo2++] = c;
}
list[foo2]='\0';
ct[foo1]=strdup(list);
}
}
openinterp();
if (strcmp(property,"all") == 0)
printf("Searching %s for %s\n",interppath,ssearch);
while (1)
{
fseek(interp,seekinterp,SEEK_SET);
if ((c=fgetc(interp)) != '(')
{
printf("%s not found\n",ssearch);
found=0;
break;};
readlist(interp);
seekinterp=seekinterp+listptr+1;
listptr=0;
parseinterp();
if (strcmp(ssearch,N2S(atoi(domain))) == 0) break;
if (strcmp(ssearch,abbreviation) == 0)
{
ssearch=N2S(atoi(domain));
break;
}
}
openbrowse();
if (strcmp(property,"all") == 0)
printf("Searching %s for %s\n",browsepath,ssearch);
while (1)
{fseek(browse,seekbrowse,SEEK_SET);
if ((c=fgetc(browse)) != '(')
{printf("%s not found\n",ssearch);
found=0;
break;};
readlist(browse);
seekbrowse=seekbrowse+listptr+1;
listptr=0;
parsebrowse();
if (strcmp(ssearch,N2S(atoi(bdomain))) == 0) break;};
if (found == 1) pprintinfo(property);
if ((argv[2] != NULL) && (strcmp(argv[2],"test") == 0))
{sprintf(erasecmd,"erase %s",argv[1]);
system(erasecmd);}
return(0);
}