a suggestion from a discussion in one of the IGD courses:
if one ACEDB is shared by (several) people not having write access
to the database they cannot store a keyset (the result of possibly
longer work) and continue on it in the next session.
suggestion: in the KeySet menu, analgous to "name dump"
there should be a function "name read".
It reads the contents of the .ace file ~/myKeySet
and makes it the active KeySet. It skips objects that do
not exist in the database.
The file ~/myKeySet can be generated by the "name dump" function.
What do you think about that?
Detlef
----------------------------------------------
Appendix:
this code works, but is not nice.
it should use ACEDB parsing routines and
could work on lexiques directly to be faster.
The KEYSET readKeySet(FILE* ksf) {
KEYSET ks=0,kstmp;
char classname[128];
char objname[256];
char queryt[384];
int i;
kstmp=keySetCreate();
classname[0]='\0';
/* ignore first line */
while ((i=fscanf(ksf,"%s : %s",classname,objname))!=2 && i!=EOF);
if (strcmp(classname,"KeySet")) {
printf("expected class KeySet, but found %s. Abort reading\n",classname);
return(0);
};
while (fscanf(ksf,"%s : %s",classname,objname)==2) {
sprintf(queryt,"FIND %s %s",classname,objname);
kstmp=query(0,queryt);
ks=keySetOR(kstmp,ks);
};
keySetDestroy(kstmp);
return(ks);
}