#include <aes.h>
#include <string.h>

int msgbuf[8];
char filename[64];

int main(int argc, char *argv[])
{
   int i,gl_apid,acc_id;

   gl_apid=appl_init();
   wind_update(BEG_UPDATE);
   if((acc_id=appl_find("CALCLOCK"))>=0 && argc>1)
   {
      for(i=1; i<argc; i++)
      {
         strcpy(filename,argv[i]);
         shel_find(filename);
         strupr(filename);
         msgbuf[0]=0x4711;
         msgbuf[1]=gl_apid;
         msgbuf[3]=(unsigned int)((long)filename >> 16);
         msgbuf[4]=(unsigned int)((long)filename & 0xffff);
         msgbuf[6]=1;
         msgbuf[7]=0;
         appl_write(acc_id,16,msgbuf);
      }
   }
   wind_update(END_UPDATE);
   appl_exit();
   return(argc-1);
}
