Ejemplo n.º 1
0
bool set_glob_advance (int iw)
{
    char danswer[TERMSIZE];
    xterm_get_focus(iw); clear_stdin_buffer();
    sprintf (danswer, "%d", n[iw].glob_advance);
    sscanf(readline_gets("\nFilelist step advance",danswer),
           "%d", &(n[iw].glob_advance));
    xterm_release_focus(iw);
    n[iw].glob_advance = ABS(n[iw].glob_advance);
    return (FALSE);
} /* set_glob_advance() */
Ejemplo n.º 2
0
bool find_atom (int iw)
{
    static int last_atom = 0;
    int i;
    char question[MAX_FILENAME_SIZE],danswer[MAX_FILENAME_SIZE],*answer;
    xterm_get_focus(iw); clear_stdin_buffer();
    sprintf (question, "\nFind atom [0-%d]", np-1);
    sprintf (danswer, "%d", last_atom);
    answer = readline_gets(question,danswer);
    sscanf (answer, "%d", &i);
    xterm_release_focus(iw);
    if ((i < 0) || (i >= np)) printf("find_atom: illegal index\n");
    else
    {
        n[iw].anchor = i;
        print_atom(iw,i);
        last_atom = i;
    }
    return (FALSE);
} /* end find_atom() */
Ejemplo n.º 3
0
bool xtal_origin_goto (int iw)
{
    double old_s[3], s[3];
    char danswer[MAX_FILENAME_SIZE],*answer;
    if (!n[iw].xtal_mode)
    {
        printf ("Crystal translation is only available under Xtal mode.\n");
        return(FALSE);
    }
    V3mM3 (AX_3D[iw].x, HI, old_s);
    xterm_get_focus(iw); clear_stdin_buffer();
    sprintf (danswer, "%g %g %g", old_s[0],old_s[1],old_s[2]);
    answer = readline_gets("\nCrystal origin s0,s1,s2",danswer);
    sscanf (answer, "%lf %lf %lf", s, s+1, s+2);
    xterm_release_focus(iw);
    V3TRIM (s,s);
    if (V3EQ(old_s,s)) return(FALSE);
    V3mM3 (s, H, n[iw].xtal_origin);
    atom_xtal_origin (n[iw].xtal_origin);
    if (n[iw].bond_mode) bond_xtal_origin_update (iw);
    else n[iw].bond_xtal_origin_need_update = TRUE;
    return (TRUE);
} /* end xtal_origin_goto() */
Ejemplo n.º 4
0
int main(int argc, const char** argv)
{
  ndb_init();
  const char* usage = "Usage: ndbsql [-h] [-d dsn] [-f file] [stmt]\n-h help\n-d <database name or connect string>\n-f <file name> batch mode\nstmt single SQL statement\n";
  const char* dsn = "TEST_DB";
  bool helpFlg = false, batchMode = false;
  const char* fileName = 0;
  FILE* inputFile = stdin;
  const char* singleStmt = 0;

  s_readBuf = (char*)malloc(s_bufSize);
  while (++argv, --argc > 0) {
    const char* arg = argv[0];
    if (arg[0] != '-')
      break;
    if (strcmp(arg, "-d") == 0) {
      if (++argv, --argc > 0) {
        dsn = argv[0];
        continue;
      }
    }
    if (strcmp(arg, "-h") == 0) {
      helpFlg = true;
      continue;
    }
    if (strcmp(arg, "-f") == 0) {
      if (++argv, --argc > 0) {
	fileName = argv[0];
	continue;
      }
    }
    ndbout << usage;
    return 1;
  }
  if (helpFlg) {
    ndbout << usage << "\n";
    print_help();
    return 0;
  }
  if (fileName != 0) {
    if (argc > 0) {
      ndbout << usage;
      return 1;
    }
    if ((inputFile = fopen(fileName, "r")) == 0) {
      ndbout << "Could not read file " << fileName << ": " << strerror(errno) << endl;
      return 1;
    }
    batchMode = true;
  }
  if (argc > 0) {
    singleStmt = argv[0];
    batchMode = true;
  }
  if (! batchMode)
    ndbout << "NDB Cluster NDB SQL -- A simple SQL Command-line Interface\n\n";

  Con con(dsn);
  if (do_connect(con) < 0)
    return 1;
  if (! batchMode)
    ndbout << "Terminate SQL statements with a semi-colon ';'\n";

  char* line = 0;
  char* line2 = 0;
  char* line3 = 0;
  unsigned lineno = 0;
  bool has_semi;
  bool exit_on_error = false;
  int exit_code = 0;
  while (1) {
    free(line);
    line = 0;
    lineno = 0;

more_lines:
    free(line2);
    free(line3);
    line2 = line3 = 0;
    lineno++;
    has_semi = false;
    char prompt[20];
    if (lineno == 1)
      strcpy(prompt, "SQL> ");
    else
      sprintf(prompt, "%4d ", lineno);
    if (singleStmt != 0) {
      line = strdup(singleStmt);
      int n = strlen(line);
      while (n > 0 && isspace(line[n - 1])) {
        line[--n] = 0;
      }
      if (n > 0 && line[n - 1] == ';')
        line[n - 1] = 0;
      has_semi = true;  // regardless
    } else {
      const char *line1 = readline_gets(prompt, batchMode, inputFile); 
      if (line1 != 0) {
        if (line == 0)
          line = strdup(line1);
        else {
          line = (char*)realloc(line, strlen(line) + 1 + strlen(line1) + 1);
          strcat(line, "\n");
          strcat(line, line1);
        }
        if (batchMode)
          ndbout << prompt << line1 << endl;
      } else {
        if (! batchMode)
          ndbout << endl;
        if (line != 0)
          ndbout << "Ignored unterminated SQL statement" << endl;
        break;
      }
    }

    line2 = (char*)malloc(strlen(line) + 1);
    {
      char* p = line2;
      char* q = line;
      bool str = false;
      while (*q != 0) {
        if (*q == '\'') {
          str = !str;
          *p++ = *q++;
        } else if (!str && *q == '-' && *(q + 1) == '-') {
          while (*q != 0 && *q != '\n')
            q++;
        } else
          *p++ = *q++;
      }
      *p = 0;
      int n = strlen(line2);
      while (n > 0 && isspace(line2[n - 1]))
        line2[--n] = 0;
      if (n > 0 && line2[n - 1] == ';') {
        line2[--n] = 0;
        has_semi = true;
      }
    }
    line3 = strdup(line2);
    char* tok[10];
    int ntok = 0;
    tok[ntok] = strtok(line3, " ");
    while (tok[ntok] != 0) {
      ntok++;
      if (ntok == 10)
        break;
      tok[ntok] = strtok(0, " ");
    }
    if (ntok == 0)
      continue;

    if (!strcasecmp(tok[0], "help") || !strcmp(tok[0], "?")) {
      if (ntok != 2)
	print_help();
      else if (!strcasecmp(tok[1], "create"))
	print_help_create();
      else if (!strcasecmp(tok[1], "insert"))
	print_help_insert();
      else if (strcasecmp(tok[1], "select"))
	print_help_select();
      else if (!strcasecmp(tok[1], "delete"))
	print_help_update();
      else if (!strcasecmp(tok[1], "update"))
	print_help_update();
      else if (!strcasecmp(tok[1], "virtual"))
	print_help_virtual();
      else
	print_help();
      continue;
    }

    if (!strcasecmp(tok[0], "list")) {
      if (ntok == 2 && !strcasecmp(tok[1], "tables")) {
	free(line2);
	line2 = strdup("SELECT TABLE_NAME FROM ODBC$TABLES");
        has_semi = true;
      } else {
        ndbout << "Invalid list option - try help" << endl;
        continue;
      }
    }

    if (ntok == 1 && !strcasecmp(tok[0], "quit"))
      break;
    if (ntok == 1 && !strcasecmp(tok[0], "exit"))
      break;
    if (ntok == 1 && !strcasecmp(tok[0], "bye"))
      break;

    if (!strcasecmp(tok[0], "set")) {
      if (ntok == 1) {
	char* p;
	p = getenv("NDB_ODBC_TRACE");
	ndbout << "Trace level is " << (p ? atoi(p) : 0) << endl;
	int ret = get_autocommit(con);
	if (ret != -1)
	  ndbout << "Autocommit is " << (ret == SQL_AUTOCOMMIT_ON ? "on" : "off") << endl;
      } else if (ntok == 3 && !strcasecmp(tok[1], "trace")) {
	static char env[40];
	int n = tok[2] ? atoi(tok[2]) : 0;
	sprintf(env, "NDB_ODBC_TRACE=%d", n);
	putenv(env);
	ndbout << "Trace level set to " << n << endl;
      } else if (ntok == 3 && !strcasecmp(tok[1], "autocommit")) {
	if (tok[2] && !strcasecmp(tok[2], "on")) {
	  int ret = set_autocommit(con, SQL_AUTOCOMMIT_ON);
	  if (ret != -1)
	    ndbout << "Autocommit set to ON" << endl;
	} else if (tok[2] && !strcasecmp(tok[2], "off")) {
	  int ret = set_autocommit(con, SQL_AUTOCOMMIT_OFF);
	  if (ret != -1)
	    ndbout << "Autocommit set to OFF - transaction may time out" << endl;
	} else {
	  ndbout << "Invalid autocommit option - try help" << endl;
	}
      } else {
	ndbout << "Invalid set command - try help" << endl;
      }
      continue;
    }

    if (ntok >= 2 &&
        !strcasecmp(tok[0], "whenever") && !strcasecmp(tok[1], "sqlerror")) {
      if (ntok == 3 && !strcasecmp(tok[2], "exit"))
        exit_on_error = true;
      else if (ntok == 3 && !strcasecmp(tok[2], "continue"))
        exit_on_error = false;
      else {
        ndbout << "Invalid whenever clause - try help" << endl;
      }
      continue;
    }

    if (!strcasecmp(tok[0], "commit")) {
      if (ntok == 1) {
        if (do_commit(con) != -1)
          ndbout << "Commit done" << endl;
        else {
          exit_code = 1;
          if (exit_on_error) {
            ndbout << "Exit on error" << endl;
            break;
          }
        }
      } else {
        ndbout << "Invalid commit command - try help" << endl;
      }
      continue;
    }

    if (!strcasecmp(tok[0], "rollback")) {
      if (ntok == 1) {
        if (do_rollback(con) != -1)
          ndbout << "Rollback done" << endl;
        else {
          exit_code = 1;
          if (exit_on_error) {
            ndbout << "Exit on error" << endl;
            break;
          }
        }
      } else {
        ndbout << "Invalid commit command - try help" << endl;
      }
      continue;
    }

    if (! has_semi)
      goto more_lines;
    if (do_stmt(con, line2) != 0) {
      exit_code = 1;
      if (exit_on_error) {
        ndbout << "Exit on error" << endl;
        break;
      }
    }
    if (singleStmt)
      break;
  }
  do_disconnect(con);
  return exit_code;
}
Ejemplo n.º 5
0
/* Save atoms selected in a monoclinic filter to a file */
void save_atoms_in_monoclinic_filter (int iw)
{
    M3 HH;
    double d0, zmargin, xytolerance, origin[3];
    char danswer[MAX_FILENAME_SIZE], *answer, fname[MAX_FILENAME_SIZE];
    char *taglist = NULL;
    int selected[2];
    
    V3SUB( B->BALL[n[iw].atom_stack[0]].x,
           B->BALL[n[iw].atom_stack[1]].x, HH[0] );
    V3SUB( B->BALL[n[iw].atom_stack[2]].x,
           B->BALL[n[iw].atom_stack[1]].x, HH[1] );
    V3CROSS (HH[0], HH[1], HH[2]);
    if (V3ISSMALL(HH[2]))
    {
        printf("The selected parallelogram is ill-conditioned\n"
               "for constructing a monoclinic filter.\n");
        return;
    }
    V3NORMALIZE (HH[2], d0);
    printf ("\"up\" is [%g %g %g]\n"
            "check it agrees with your mirror normal...\n", V3E(HH[2]));
        
    d0 = 2.5;
    zmargin = 0.01; 
    xytolerance = 0.01;
    xterm_get_focus(iw); clear_stdin_buffer();
    REALLOC (save_atoms_in_monoclinic_filter, taglist, np, char);
    while (1)
    {
        sprintf (danswer, "%g %g %g", d0, zmargin, xytolerance);
        answer = readline_gets
            ("Interplanar spacing [A]  z-margin [A]  xy-tolerance", danswer);
        sscanf(answer, "%lf %lf %lf", &d0, &zmargin, &xytolerance);
        V3ADDMUL (B->BALL[n[iw].atom_stack[1]].x, d0/2,HH[2], origin);
        if (tag_atoms_in_monoclinic_filter
            (origin,HH, d0+2*zmargin,xytolerance, selected,taglist)>0) break;
        strcpy (danswer, answer);
    }
    printf("down=%d and up=%d atoms selected in filter.\n",
           selected[0], selected[1]);
    while (1)
    {
        sprintf (danswer, "%s.idx", fbasename);
        answer = readline_gets("Save the selected atoms to", danswer);
        sscanf(answer, "%s", fname);
        if ( tested_to_be_writable(fname) )
        {
            save_dipole_indices (selected, taglist, fname);
            printf ("selected atom indices [0-%d] saved to %s.\n", np-1,fname);
            Free (taglist);
            break;
        }
        else
        {
            printf ("\n** %s: **\n", fname);
            printf ("** This file is unwritable! **\n");
        }
        strcpy(danswer, answer);
    }
    xterm_release_focus(iw);

    return;
} /* end save_atoms_in_monoclinic_filter() */
Ejemplo n.º 6
0
/* Load color/radii file for atoms */
bool load_atom_color_from_file (int iw)
{
    char fname[MAX_FILENAME_SIZE], buf[COLOR_LINESIZE];
    FILE *fp;
    int m, j, k, items;
    double c[4];

    xterm_get_focus(iw); clear_stdin_buffer();
    sprintf (buf, "%s.clr", fbasename);
    strcpy(fname,readline_gets("\nLoad color properties from",buf));
    xterm_release_focus(iw);
    if (Freadable(fname))
    {
        fp = ROpen(fname);
        for (m=0; ; m++)
            if (fgets(buf,COLOR_LINESIZE,fp))
            {
                if (m >= np)
                {
                    printf ("\n** %s has more rows than atoms **\n", fname);
                    return (FALSE);
                }
                items = sscanf (buf, "%lf %lf %lf %lf", c, c+1, c+2, c+3);
                if (items == 1)
                {
                    c[3] = c[0];
                    c[0] = B->BALL[m].r;
                    c[1] = B->BALL[m].g;
                    c[2] = B->BALL[m].b;
                }
                else if (items == 3)
                    c[3] = B->BALL[m].radius / n[iw].atom_r_ratio;
                if (c[0]>1) c[0]/=255;
                if (c[1]>1) c[1]/=255;
                if (c[2]>1) c[2]/=255;
                AX_3D_AssignRGB(B->BALL[m], c[0], c[1], c[2]);
                B->BALL[m].radius = c[3] * n[iw].atom_r_ratio;
            }
            else if (m < np) 
            {
                if (m == 0)
                {
                    printf ("\n** %s has no data **\n", fname);
                    return (FALSE);
                }
                else if ( ISFACTOR (m, np) )
                { /* make a bold guess */
                    for (j=m; j<np; j++)
                    {
                        k = j % m;
                        AX_3D_AssignRGB (B->BALL[j], B->BALL[k].r,
                                         B->BALL[k].g, B->BALL[k].b);
                        B->BALL[j].radius = B->BALL[k].radius;
                    }
                }
                else printf ("\n** premature ending of %s **\n", fname);
                bond_atom_color_update (iw);
                return (TRUE);
            }
            else break;
    }
    else
    {
        printf ("\n** %s: **\n", fname);
        printf ("** This file is unreadable! **\n");
        return (FALSE);
    }
    bond_atom_color_update (iw);
    return (TRUE);
} /* end load_atom_color_from_file() */
Ejemplo n.º 7
0
/* Use script to produce jpeg frames */
void script_animate (int iw)
{
    char buf[SCRIPT_LINE_SIZE],output[SCRIPT_LINE_SIZE],*ptr;
    int i,hascontent,quality,frames;
    FILE *fp;
    glob_t globbuf;
    
    strcpy(buf, "scr_anim");
    if (!(fp=ropen(buf)))
    {
        printf ("\nAnimation script \"%s\" does not exist,\n", buf);
        xterm_get_focus(iw); clear_stdin_buffer();
        if (!strcasecmp("y", readline_gets
                        ("Do you want a default one created (y/n)?","y")))
        {
            numerically_sorted_glob (config_fname, &globbuf);
            fp=wopen(buf);
            fprintf (fp, "%d\n", AX_JPG_DEF_QUALITY);
            for (i=0; i<globbuf.gl_pathc; i++)
                fprintf (fp, "%s Jpg/%05d.jpg\n", globbuf.gl_pathv[i], i);
            globfree (&globbuf);
            fclose(fp);
            fp = ropen(buf);
        }
        else
        {
            xterm_release_focus(iw);
            return;
        }
    }
    if (!(ptr=fgets(buf,SCRIPT_LINE_SIZE,fp)))
    {
        printf ("\nThere is nothing in animation script \"%s\".\n", buf);
        fclose (fp);
        return;
    }
    for (hascontent=i=0; (buf[i]!=EOS) &&
             (ISDIGIT(buf[i]) || ISBLANK(buf[i]) || (buf[i]=='\n')); i++)
        if (ISALNUM(buf[i])) hascontent=1;
    if (!hascontent)
    {
        printf ("\nThere is no content in animation script \"%s\".\n", buf);
        fclose (fp);
        return;
    }
    if (buf[i] == EOS)
    {
        sscanf (buf, "%d", &quality);
        if ((quality<0) || (quality>100))
        {
            printf ("\nquality = %d is out of valid range ([0,100]).\n",
                    quality);
            return;
        }
        else printf ("\nquality = %d\n", quality);
        ptr = fgets(buf,SCRIPT_LINE_SIZE,fp);
    }
    else quality = AX_JPG_DEF_QUALITY;
    frames = 0;
    /* If bonds are not on now, there is no need to refresh */
    temporary_disable_bond = !n[iw].bond_mode;
    /* cylinder data structure during the rendering.        */
    while (ptr)
    {
        buf[SCRIPT_LINE_CHAR] = EOS;
        sscanf (buf, "%s %s", config_fname, output);
        reload_config (iw, FALSE);
        paint_scene(iw);
        AX_dump(iw); AX_show(iw);
        if (str_caseend_with(output,".png"))
            AX_save_pixmap_as_png
                (iw,AX_JPG_QUALITY_TO_PNG_LEVEL(quality),output);
        else if (str_caseend_with(output,".eps"))
            AX_save_pixmap_as_eps(iw,quality,output);
        else AX_save_pixmap_as_jpg(iw,quality,output);
        frames++;
        ptr = fgets(buf,SCRIPT_LINE_SIZE,fp);
    }
    fclose(fp);
    printf ("%d frames saved.\n\n", frames);
    if (temporary_disable_bond)
    {
        Config_to_3D_Bonds (n[iw].bond_radius);
        if (n[iw].bond_mode)
        {
            bond_xtal_origin_update (iw);
            bond_atom_color_update(iw);
        }
        else
        {
            n[iw].bond_xtal_origin_need_update = TRUE;
            n[iw].bond_atom_color_need_update = TRUE;
        }
        temporary_disable_bond = 0;
    }
    return;
} /* end script_animate() */
Ejemplo n.º 8
0
/* Reload the configuration but keeping the rendering state */
void reload_config (int iw, bool term_input_filename)
{
    register int i;
    int j, k, old_np;
    char fname[MAX_FILENAME_SIZE], oldfname[MAX_FILENAME_SIZE]; 
    V3 hook_s, tmp, dx;
    char *old_symbol=NULL;
    bool incompatible_config;
    
    strcpy(oldfname, config_fname);
    if (n[iw].anchor >= 0)
    { /* the new configuration may not even have the atom */
        V3EQV (B->BALL[n[iw].anchor].x, n[iw].hook);
        n[iw].anchor = -1;
    }
    /* hook_s[] is what is kept invariant */
    V3mM3 (n[iw].hook, HI, hook_s);
    if (term_input_filename)
    {
        xterm_get_focus(iw); clear_stdin_buffer();
        strcpy(fname,readline_gets("\nLoad configuration",config_fname));
        strcpy(config_fname,fname);
        xterm_release_focus(iw);
    }
    if (!Fexists(config_fname))
    {
        printf ("\n** %s: **\n", config_fname);
        printf ("** There is no such file! **\n");
        strcpy(config_fname, oldfname);
        return;
    }
    if (!Freadable(config_fname))
    {
        printf ("\n** %s: **\n", config_fname);
        printf ("** This file is unreadable! **\n");
        strcpy(config_fname, oldfname);
        return;
    }
    cr();

    old_np = np;
    CLONE(symbol, SYMBOL_SIZE*np, char, old_symbol);
    i = CONFIG_LOAD (config_fname, Config_Aapp_to_Alib);

    for (k=0; k<CONFIG_num_auxiliary; k++)
        if (*blank_advance(CONFIG_auxiliary_name[k])==EOS)
            sprintf(CONFIG_auxiliary_name[k], "auxiliary%d", k);
    rebind_CT (Config_Aapp_to_Alib, "", ct, &tp); cr();
    Neighborlist_Recreate_Form (Config_Aapp_to_Alib, ct, N);
    if (i == CONFIG_CFG_LOADED)
        N->s_overflow_err_handler =
            NEIGHBORLIST_S_OVERFLOW_ERR_HANDLER_FOLD_INTO_PBC;
    else
        N->s_overflow_err_handler =
            NEIGHBORLIST_S_OVERFLOW_ERR_HANDLER_BOUNDING_BOX;
    N->small_cell_err_handler = NEIGHBORLIST_SMALL_CELL_ERR_HANDLER_MULTIPLY;
    for (i=0; i<ct->t; i++)
        for (j=i; j<ct->t; j++)
            for (k=0; k<rcut_patch_top; k++)
                if ( ( ( (rcut_patch[k].Zi == ct->Z[i]) &&
                         (rcut_patch[k].Zj == ct->Z[j]) ) ||
                       ( (rcut_patch[k].Zi == ct->Z[j]) &&
                         (rcut_patch[k].Zj == ct->Z[i]) ) ) )
                    NEIGHBOR_TABLE(N->rcut,ct,i,j) =
                        NEIGHBOR_TABLE(N->rcut,ct,j,i) = rcut_patch[k].rcut;
    Neighborlist_Recreate (Config_Aapp_to_Alib, stdout, ct, &tp, N);
    V3mM3 (hook_s, H, tmp);
    V3SUB (tmp, n[iw].hook, dx);
    V3EQV (tmp, n[iw].hook);
    V3AdD (dx, AX_3D[iw].x);
    M3InV (H, HI, volume);
    lengthscale = cbrt(volume);
    V3ASSIGN (0.5,0.5,0.5,tmp);
    V3mM3 (tmp, H, cm);
    geo_clear_has_evaluated_flags();
    evaluate_geo_measures(); Free(s1); Free(mass);

    if  ( ComputeLeastSquareStrain )
    {
        if (ConfigChecksum(Config_Aapp_to_Alib) != ref->checksum)
            printf ("This configuration is not isoatomic with the imprinted "
                    "reference\n%s. Least-square strain NOT calculated.\n",
                    ref_fbasename);
        else LeastSquareStrain_Append();
    }

    incompatible_config = (np != old_np) ||
        memcmp(symbol, old_symbol, SYMBOL_SIZE*MIN(np,old_np));
    Free(old_symbol);
    
    if (incompatible_config)
        Config_to_3D_Balls (n[iw].atom_r_ratio);
    else for (i=0; i<np; i++) V3mM3 ( &(s[DIMENSION*i]), H, B->BALL[i].x );

    atom_xtal_origin (n[iw].xtal_origin);
    if (!n[iw].auxiliary_thresholds_rigid)
    {
        for (i=0; i<CONFIG_num_auxiliary; i++)
            reset_auxiliary_threshold(iw,i);
        for (i=0; i<MAX_GEO_MEASURES; i++)
            if (geolist[i].has_evaluated)
                reset_auxiliary_threshold(iw,CONFIG_MAX_AUXILIARY+i);
    }
    if (!temporary_disable_bond) Config_to_3D_Bonds (n[iw].bond_radius);
    select_fbasename (config_fname);
    if ((n[iw].xtal_mode) && (n[iw].color_mode == COLOR_MODE_COORD))
        assign_coordination_color(iw);
    else if (n[iw].color_mode == COLOR_MODE_AUXILIARY)
        color_encode_auxiliary(iw);
    else if (n[iw].color_mode == COLOR_MODE_SCRATCH)
        scratch_color (iw);
    else
    {
        strcpy (AX_title[iw],fbasename);
        AXSetName (iw);
        XStoreName(AX_display[iw],xterm_win,AX_title[iw]);
        XSetIconName(AX_display[iw],xterm_win,AX_title[iw]);
        if (!temporary_disable_bond)
        {
            bond_xtal_origin_update (iw);
            bond_atom_color_update (iw);
        }
    }
    return;
} /* end reload_config() */