int tclprint_to_result_BondedIA(Tcl_Interp *interp, int i)
{
  Bonded_ia_parameters *params = &bonded_ia_params[i];
  char buffer[TCL_INTEGER_SPACE];

  sprintf(buffer, "%d ", i);
  Tcl_AppendResult(interp, buffer, (char *)NULL);
  
  switch (params->type) {
  case BONDED_IA_FENE:
    return tclprint_to_result_feneIA(interp, params);
  case BONDED_IA_HARMONIC:
    return tclprint_to_result_harmonicIA(interp, params);
#ifdef BOND_ANGLE_OLD
  case BONDED_IA_ANGLE_OLD:
    return tclprint_to_result_angleIA(interp, params);
#endif
#ifdef BOND_ANGLE_
  case BONDED_IA_ANGLE_HARMONIC:
    return tclprint_to_result_angle_harmonicIA(interp, params);
  case BONDED_IA_ANGLE_COSINE:
    return tclprint_to_result_angle_cosineIA(interp, params);
  case BONDED_IA_ANGLE_COSSQUARE:
    return tclprint_to_result_angle_cossquareIA(interp, params);
#endif
#ifdef BOND_ANGLEDIST
  case BONDED_IA_ANGLEDIST:
    return tclprint_to_result_angledistIA(interp, params);
#endif
  case BONDED_IA_DIHEDRAL:
    return tclprint_to_result_dihedralIA(interp, params);
#ifdef BOND_ENDANGLEDIST
  case BONDED_IA_ENDANGLEDIST:
    return tclprint_to_result_endangledistIA(interp, params);
#endif
#ifdef TABULATED
  case BONDED_IA_TABULATED:
    return tclprint_to_result_tabulated_bondedIA(interp, params);
#endif
#ifdef OVERLAPPED
  case BONDED_IA_OVERLAPPED:
    return tclprint_to_result_overlapIA(interp, params);
#endif
#ifdef BOND_CONSTRAINT
  case BONDED_IA_RIGID_BOND:
    return tclprint_to_result_rigid_bond(interp, params);
#endif
#ifdef LENNARD_JONES
  case BONDED_IA_SUBT_LJ:
    return tclprint_to_result_subt_ljIA(interp, params);
#endif
#ifdef BOND_VIRTUAL
  case BONDED_IA_VIRTUAL_BOND:
    Tcl_AppendResult(interp, "VIRTUAL_BOND ", (char *) NULL);
    return (TCL_OK);
#endif
  case BONDED_IA_NONE:
    Tcl_ResetResult(interp);
    Tcl_AppendResult(interp, "unknown bonded interaction number ",buffer,
		     (char *) NULL);
    return (TCL_ERROR);
  }
  /* if none of the above */
  Tcl_ResetResult(interp);
  Tcl_AppendResult(interp, "unknown bonded interaction type",(char *) NULL);
  return (TCL_ERROR);
}
int tclprint_to_result_BondedIA(Tcl_Interp *interp, int i)
{
  Bonded_ia_parameters *params = &bonded_ia_params[i];
  char buffer[TCL_INTEGER_SPACE];

  sprintf(buffer, "%d ", i);
  Tcl_AppendResult(interp, buffer, (char *)NULL);
  
  switch (params->type) {
  case BONDED_IA_FENE:
    return tclprint_to_result_feneIA(interp, params);
  case BONDED_IA_STRETCHING_FORCE:						
    return tclprint_to_result_stretchingforceIA(interp, params);
  case BONDED_IA_STRETCHLIN_FORCE:						
    return tclprint_to_result_stretchlinforceIA(interp, params);
  case BONDED_IA_AREA_FORCE_LOCAL:					
	return tclprint_to_result_areaforcelocalIA(interp, params);
  case BONDED_IA_BENDING_FORCE:						
	return tclprint_to_result_bendingforceIA(interp, params);
#ifdef AREA_FORCE_GLOBAL
  case BONDED_IA_AREA_FORCE_GLOBAL:						
	return tclprint_to_result_areaforceglobalIA(interp, params);
#endif
#ifdef VOLUME_FORCE
  case BONDED_IA_VOLUME_FORCE:						
	return tclprint_to_result_volumeforceIA(interp, params);
#endif
      
#ifdef IMMERSED_BOUNDARY
    case BONDED_IA_IBM_TRIEL:
      return tclprint_to_result_ibm_triel(interp, params);
    case BONDED_IA_IBM_VOLUME_CONSERVATION:
      return tclprint_to_result_ibm_volume_conservation(interp, params);
    case BONDED_IA_IBM_TRIBEND:
      return tclprint_to_result_ibm_tribend(interp, params);
      
#endif
      
  case BONDED_IA_HARMONIC:
    return tclprint_to_result_harmonicIA(interp, params);
  case BONDED_IA_QUARTIC:
    return tclprint_to_result_quarticIA(interp, params);
#ifdef ELECTROSTATICS
  case BONDED_IA_BONDED_COULOMB:
    return tclprint_to_result_bonded_coulombIA(interp, params);
#endif
#ifdef BOND_ANGLE_OLD
  case BONDED_IA_ANGLE_OLD:
    return tclprint_to_result_angleIA(interp, params);
#endif
#ifdef BOND_ANGLE
  case BONDED_IA_ANGLE_HARMONIC:
    return tclprint_to_result_angle_harmonicIA(interp, params);
  case BONDED_IA_ANGLE_COSINE:
    return tclprint_to_result_angle_cosineIA(interp, params);
  case BONDED_IA_ANGLE_COSSQUARE:
    return tclprint_to_result_angle_cossquareIA(interp, params);
#endif
#ifdef BOND_ANGLEDIST
  case BONDED_IA_ANGLEDIST:
    return tclprint_to_result_angledistIA(interp, params);
#endif
  case BONDED_IA_DIHEDRAL:
    return tclprint_to_result_dihedralIA(interp, params);
#ifdef BOND_ENDANGLEDIST
  case BONDED_IA_ENDANGLEDIST:
    return tclprint_to_result_endangledistIA(interp, params);
#endif
#ifdef TABULATED
  case BONDED_IA_TABULATED:
    return tclprint_to_result_tabulated_bondedIA(interp, params);
#endif
#ifdef OVERLAPPED
  case BONDED_IA_OVERLAPPED:
    return tclprint_to_result_overlapIA(interp, params);
#endif
#ifdef BOND_CONSTRAINT
  case BONDED_IA_RIGID_BOND:
    return tclprint_to_result_rigid_bond(interp, params);
#endif
#ifdef LENNARD_JONES
  case BONDED_IA_SUBT_LJ:
    return tclprint_to_result_subt_ljIA(interp, params);
#endif
#ifdef BOND_VIRTUAL
  case BONDED_IA_VIRTUAL_BOND:
    Tcl_AppendResult(interp, "VIRTUAL_BOND ", (char *) NULL);
    return (TCL_OK);
#endif
  case BONDED_IA_NONE:
    Tcl_ResetResult(interp);
    Tcl_AppendResult(interp, "unknown bonded interaction number ",buffer,
		     (char *) NULL);
    return (TCL_ERROR);
  default: // keep the compiler happy if interactions are compiled out
    break;
  }
  /* if none of the above */
  Tcl_ResetResult(interp);
  Tcl_AppendResult(interp, "unknown bonded interaction type",(char *) NULL);
  return (TCL_ERROR);
}