int readtclprog(char *fname)
{
  int  code;
  char *script = NULL, *oneline, cryptline[1024];
  FILE  *f;

  if ((f = fopen(fname, "r")) == NULL)
    return 0;
  
  while (fscanf(f, "\%[^\n]\n", cryptline) != EOF) {
    //printf("cryptline(\%d) == \%s\n", strlen(cryptline), cryptline);
    oneline = rdecrypt_string(FILEKEY, cryptline);
    //printf("oneline(\%d) == \%s\n", strlen(oneline), oneline);
    if (script == NULL) {
      script = nmalloc(strlen(oneline)+2);
      strcpy(script, oneline);
      strcat(script, "\n");
    }
    else {
      script = (char*) nrealloc(script, strlen(script) + strlen(oneline)+1);
      strcat(script, oneline);
      strcat(script, "\n");
    }
  }
  fclose(f);
  
  //printf("script(\%d) == \%s\n", strlen(script), script);
  code = Tcl_Eval(interp, script);
  nfree(script);

  if (code != TCL_OK) {
    putlog(LOG_MISC, "*", "Tcl error in file '\%s':", fname);
    return 0;
  }

  return 1;
}
