| version 1.27 | version 1.28 |
|---|
| |
| Tcl_AppendResult(interp, "Invalid segid: ", argv[2], NULL); | Tcl_AppendResult(interp, "Invalid segid: ", argv[2], NULL); |
| return TCL_ERROR; | return TCL_ERROR; |
| } else if (argc == 5 && | } else if (argc == 5 && |
| (!strcasecmp(argv[1], "coordinates") || | (!strcasecmp(argv[1], "coordinates") |
| !strcasecmp(argv[1], "mass"))) { | || !strcasecmp(argv[1], "velocities") |
| | || !strcasecmp(argv[1], "mass"))) { |
| topo_mol *mol = psf->mol; | topo_mol *mol = psf->mol; |
| int segindex = (mol ? | int segindex = (mol ? |
| hasharray_index(mol->segment_hash, argv[2]) : | hasharray_index(mol->segment_hash, argv[2]) : |
| |
| sprintf(interp->result, "%f %f %f", atoms->x, atoms->y, atoms->z); | sprintf(interp->result, "%f %f %f", atoms->x, atoms->y, atoms->z); |
| #endif | #endif |
| return TCL_OK; | return TCL_OK; |
| | } else if (!strcasecmp(argv[1], "velocities")) { |
| | #if TCL_MINOR_VERSION >= 6 |
| | char buf[512]; |
| | sprintf(buf, "%f %f %f", atoms->vx, atoms->vy, atoms->vz); |
| | Tcl_AppendResult(interp, buf, NULL); |
| | #else |
| | sprintf(interp->result, "%f %f %f", atoms->vx, atoms->vy, atoms->vz); |
| | #endif |
| | return TCL_OK; |
| } else if (!strcasecmp(argv[1], "mass")) { | } else if (!strcasecmp(argv[1], "mass")) { |
| #if TCL_MINOR_VERSION >= 6 | #if TCL_MINOR_VERSION >= 6 |
| char buf[512]; | char buf[512]; |